For simple user operation posting packing slip with purchase order. we added a function button on Quality Orders Form.

// VAR Changed by Xie Yu Fan.Fandy 谢宇帆
void YIP_PostPurchPackingSlip()
{
PurchFormLetter_PackingSlip purchFormLetter;
SysQueryRun chooseLinesQuery; PurchParmUpdate purchParmUpdate;
PurchLine purchLine;
PurchParmTable purchParmTable;
PurchParmLine purchParmLine;
InventDim inventDim;
;
ttsbegin;
chooseLinesQuery = new SysQueryRun(querystr(PurchUpdate)); chooseLinesQuery.query().dataSourceTable(tablenum(PurchTable)).addRange(fieldnum(PurchTable, PurchId)).value(queryValue(this.InventRefId));
chooseLinesQuery.query().dataSourceTable(tablenum(PurchLine)).addRange(fieldnum(PurchLine, InventTransId)).value(queryValue(this.InventRefTransId)); chooseLinesQuery.query().interactive(false);
chooseLinesQuery.saveUserSetup (false); purchFormLetter = PurchFormLetter::construct(DocumentStatus::PackingSlip); purchFormLetter.chooseLinesQuery (chooseLinesQuery);
purchFormLetter.purchTable (PurchTable::find(this.InventRefId));
purchFormLetter.transDate (systemdateget());
purchFormLetter.specQty (PurchUpdate::All);
purchFormLetter.printFormLetter (NoYes::No);
purchFormLetter.splitDeliveryInformation(NoYes::No);
purchFormLetter.sumBy (AccountOrder::None); purchFormLetter.createParmUpdate(false);
purchFormLetter.chooseLines();
purchFormLetter.setForUpdatePurchParmTable(); purchParmTable = purchFormLetter.currentPurchParmTable();
if (!purchParmTable)
throw Exception::Break; purchParmLine = purchParmLine::findInventTransId(purchParmTable.ParmId,this.InventRefTransId,true);
if (!purchParmLine)
throw Exception::Break; inventDim = this.inventDim();
purchParmLine.InventDimId = InventDim::findOrCreate(inventDim).inventDimId;
purchLine = PurchLine::findInventTransId(this.InventRefTransId);
[purchParmLine.ReceiveNow, purchParmLine.RemainBefore , purchParmLine.RemainAfter ] = purchFormLetter.qtyPurch (purchLine, purchLine.YIP_calcPurchQty(this.Qty));
[purchParmLine.InventNow, purchParmLine.RemainBeforeInvent, purchParmLine.RemainAfterInvent] = purchFormLetter.qtyInvent(purchLine, this.Qty);
purchParmLine.setLineAmount(purchParmLine.ReceiveNow,purchLine);
purchParmLine.update(); purchFormLetter.reArrangeNow(true);
purchFormLetter.YIP_parmFromExternalRun(true);
purchFormLetter.saveLast();
ttscommit;
if (purchFormLetter.prompt())
{
try
{
ttsbegin;
purchFormLetter.run();
this.YIP_QCStatus = YIP_QCStatus::PackingSlip;
this.doUpdate();
ttscommit;
}
catch(exception::Error)
{
ttsabort;
throw error("Catch an error exception.");
}
catch(exception::CLRError)
{
ttsabort;
throw error(AifUtil::getClrErrorMessage());
}
}
}

How to using code post packingSlip on Quality Orders Form[AX2009]的更多相关文章

  1. 什么是Code Review(转)

    Code Review是一种通过复查代码提高代码质量的过程,在XP方法中占有极为重要的地位,也已经成为软件工程中一个不可缺少的环节.本文通过对Code Review的一些概念和经验的探讨,就如何进行C ...

  2. Code Understanding Step by Step - We Need a Task

      Code understanding is a task we are always doing, though we are not even aware that we're doing it ...

  3. Code Review(转)

    Code Review是一种通过复查代码提高代码质量的过程,在XP方法中占有极为重要的地位,也已经成为软件工程中一个不可缺少的环节.本文通过对Code Review的一些概念和经验的探讨,就如何进行C ...

  4. Code is not literature

    http://www.gigamonkeys.com/code-reading/ I have started code reading groups at the last two companie ...

  5. asp.net权限认证:OWIN实现OAuth 2.0 之授权码模式(Authorization Code)

    asp.net权限认证系列 asp.net权限认证:Forms认证 asp.net权限认证:HTTP基本认证(http basic) asp.net权限认证:Windows认证 asp.net权限认证 ...

  6. spotify engineering culture part 1

    原文 ,因为原视频说的太快太长, 又没有字幕,于是借助youtube,把原文听&打出来了. 中文版日后有时间再翻译. one of the big succeess factors here ...

  7. C# Note37: Writing unit tests with use of mocking

    前言 What's mocking and its benefits Mocking is an integral part of unit testing. Although you can run ...

  8. mongodb与mysql区别(超详细)

    MySQL是关系型数据库. 优势: 在不同的引擎上有不同 的存储方式. 查询语句是使用传统的sql语句,拥有较为成熟的体系,成熟度很高. 开源数据库的份额在不断增加,mysql的份额页在持续增长. 缺 ...

  9. API返回错误信息的最佳实践

    使用HTTP Status区分不同消息返回 最基础的三个状态200 OK, 400 Client Error, 500 Server Error 这些应该是够的, 如果客户端可以处理更细的划分, 可以 ...

随机推荐

  1. CAD常用知识点

    1.Ctrl+9:打开命令窗口: 2.删除标注或者其他(选择对象过滤器):输入fi后回车会出现对象选择过滤器窗口,以删除标注为例,点击选择过滤器-----标注 按以下顺序点击后回车, 框选要去掉的标注 ...

  2. vue+elmentUI项目的正则判断

    一.为了方便重复利用管理,我创建一个regExp.ts文件来管理正则的表达式,内容如下: 1 /* eslint-disable */ 2 const phoneNumberRegExp = /^[1 ...

  3. JavaScript innerTHML和createElement效率对比

    前言: 在DOM节点操作中,innerTHML和createElement都可以实现创建元素.它们实现的功能类似,但是效率却相差很大.本文分别统计用innerTHML字符串拼接方式.innerTHML ...

  4. Linux中断驱动程序

    1.中断概念 中断时一种电信号,由硬件设备产生,然后再由中断控制器向处理器发送相应的信号.处理器一经检测到该信号,便中断自己当前正在处理的工作,转而去处理中断.此后,处理器会通知操作系统已经产生中断. ...

  5. Cesium.Viewer

    <!DOCTYPE html><html lang="en"><head> <meta charset="utf-8" ...

  6. K8S节点异常怎么办?TKE"节点健康检查和自愈"来帮忙

    节点健康检测 意义 在K8S集群运行的过程中,节点常常会因为运行时组件的问题.内核死锁.资源不足等各种各样的原因不可用.Kubelet默认对节点的PIDPressure.MemoryPressure. ...

  7. lambda函数小结

    C++中的lambda函数 lambda函数是函数式编程中的概念,由C++11引入,成为现代C++中重要的特性. 所谓lambda函数就是匿名函数,语法结构: [capture list] (para ...

  8. 19。删除链表倒数第N个节点

    class ListNode: def __init__(self, val=0, next=None): self.val = val self.next = next# 这道题还是很简单的,我们只 ...

  9. spring boot:用dynamic-datasource-spring-boot-starter配置druid多数据源(spring boot 2.3.3)

    一,dynamic-datasource-spring-boot-starter的用途? 1,dynamic-datasource-spring-boot-starter 是一个基于springboo ...

  10. python操作excel xlwt (转)

    Python中xlrd和xlwt模块使用方法   阅读目录 安装 xlrd模块使用 xlwt模块 xlrd模块实现对excel文件内容读取,xlwt模块实现对excel文件的写入. 回到顶部 安装 ? ...