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. Python 为什么不支持 switch 语句?

    本文出自"Python为什么"系列,请查看全部文章 在这篇文章里,我们会聊一聊为什么 Python 决定不支持 switch 语句. 为什么想要聊这个话题呢? 主要是因为 swit ...

  2. 【题解】【HAOI2011】Problem b

    \(Luogu2522\) 题目大意:求下面式子的值: \[\sum_{i=x}^n\sum_{j=y}^m[\gcd(i,j)=k] \] 这个东西直接求不好求,考虑差分,从\([1,n]\)的范围 ...

  3. PicGo图床与Typora(PicGo+Typora+GitHub的完整设置)

    PicGo图床与Typora(PicGo+Typora+GitHub的完整设置) 如何更方便的用markdown写文章,接下来按照我的步骤来,你一定可以的,这个文章包含了GitHub图床配置.PicG ...

  4. selenium登录163邮箱,得到cookie,requests后续请求

    1.场景 很多时候登录操作是比较复杂的,因为存在各种反爆破操作,以及为了安全性提交数据都会存在加密.如果要完全模拟代码去实现登录操作是比较复杂,并且该网站后续更新了登录安全相关功能,那么登录的模拟操作 ...

  5. 带权二分图最大匹配KM算法

    二分图的判定 如果一个图是连通的,可以用如下的染色法判定是否二分图: 我们把X部的结点颜色设为0,Y部的颜色设为1. 从某个未染色的结点u开始,做BFS或者DFS .把u染为0,枚举u的儿子v.如果v ...

  6. centos8安装zookeeper(单机方式)

    一,下载zookeeper: 1,官网地址 http://zookeeper.apache.org/ 找到这个地址: https://mirrors.tuna.tsinghua.edu.cn/apac ...

  7. gin教程

    Golang Gin 实战(十)| XML渲染 Golang Gin 实战(九)| JSONP跨域和劫持 Golang Gin 实战(八)| JSON渲染输出 Golang Gin 实战(七)| 分组 ...

  8. C++常用数据类型

    基本的内置类型 C++ 为程序员提供了种类丰富的内置数据类型和用户自定义的数据类型.下表列出了七种基本的 C++ 数据类型: 类型 关键字 布尔型 bool 字符型 char 整型 int 浮点型 f ...

  9. Typora图片一键传——picgo使用兰空图床

    Typora picgo使用兰空图床 最近smms图床免费版的速度眼看着越来越慢,特别是到晚上,图片几乎是在原地打转,于是我想替换掉Typora中picgo默认使用的smms图床,网上的教程清一色地只 ...

  10. windows下安装mongodb4.x版本

    一个无名前辈的血汗经验,提醒来者 现在mongod出到4.x的版本,而网上的大多数教程是针对3.x的版本的.在4.x的版本中,不要再试图使用自定义安装,我搞了3个多小时都没搞定,如果土豪c盘很大,直接 ...