static void CreateAndPostSales(Args _args)
{
List il = new List(Types::Record);
SalesTable localSalesTable;
SalesLine localSalesLine;
SalesFormLetter salesFormLetter;
TmpFrmVirtual localTmpFrmVirtual;
CustPackingSlipJour localCustPackingSlipJour;
; ttsbegin;
localSalesTable.clear();
localSalesTable.initValue();
localSalesTable.CustAccount = "C-00001";
localSalesTable.initFromCustTable();
localSalesTable.SalesId = NumberSeq::newGetNumFromCode("SONUM").num();
localSalesTable.SalesPoolId = "NOR";
localSalesTable.ReceiptDateConfirmed = systemDateGet();
localSalesTable.ShippingDateConfirmed = systemDateGet();
localSalesTable.CurrencyCode = "RMB";
localSalesTable.insert(); localSalesLine.clear();
localSalesLine.initValue();
localSalesLine.initFromSalesTable(localSalesTable);
localSalesLine.ItemId = "100XA00125";
localSalesLine.initFromInventTable(InventTable::find(localSalesLine.ItemId));
localSalesLine.SalesQty = ;
localSalesLine.SalesUnit = InventTableModule::find(localSalesLine.ItemId,ModuleInventPurchSales::Invent).UnitId;
localSalesLine.THK_2ndSalesQty = ;
localSalesLine.THK_2ndSalesUnit = InventTableModule::find(localSalesLine.ItemId,ModuleInventPurchSales::Invent).THK_2ndUnit;
localSalesLine.SalesPrice = ;
localSalesLine.InventDimId = "T06094862";
localSalesLine.LineAmount = localSalesLine.calcLineAmount();
localSalesLine.ReceiptDateConfirmed = systemDateGet();
localSalesLine.ShippingDateConfirmed = systemDateGet();
localSalesLine.createLine(NoYes::No, // Validate
NoYes::No, // initFromSalesTable
NoYes::No, // initFromInventTable
NoYes::Yes, // calcInventQty
NoYes::No, // searchMarkup
NoYes::No // searchPrice
); info(strfmt("Sales %1 is created", localSalesTable.SalesId),'', SysInfoAction_TableField::newBuffer(localSalesTable)); salesFormLetter = SalesFormLetter::construct(DocumentStatus::PackingSlip);
salesFormLetter.getLast();
salesFormLetter.allowEmptyTable(salesFormLetter.initAllowEmptyTable(true));
salesFormLetter.transDate(systemdateget());
salesFormLetter.update(localSalesTable, systemdateget(), SalesUpdate::All, AccountOrder::None, false, false);
salesFormLetter.runShipCarrier(); while select localCustPackingSlipJour
where localCustPackingSlipJour.SalesId == localSalesTable.SalesId
{
localTmpFrmVirtual.clear();
localTmpFrmVirtual.TableNum = tableNum(custPackingSlipJour);
localTmpFrmVirtual.RecordNo = localCustPackingSlipJour.recid;
localTmpFrmVirtual.insert();
il.addEnd(localTmpFrmVirtual);
} salesFormLetter = SalesFormLetter::construct(DocumentStatus::Invoice);
salesFormLetter.getLast();
salesFormLetter.allowEmptyTable(salesFormLetter.initAllowEmptyTable(true));
salesFormLetter.transDate(systemdateget());
salesFormLetter.setNumAndVoucher(NumberSeq::newGetNumFromCode("SOINV11").num(),NumberSeq::newGetNumFromCode("SOINV11").num());
salesFormLetter.update(localSalesTable, systemdateget(), SalesUpdate::PackingSlip, AccountOrder::Account, false, false,false,false,il.pack());
salesFormLetter.runShipCarrier(); ttscommit;
}

AX_CreateAndPostSales的更多相关文章

随机推荐

  1. ---rk3288 mipi 整发(适用于新版的kernel 4.4 )

    http://www.pianshen.com/article/7245318143/ 老的Anroid 5.1 下 Linux 3.10 的数据的名字和 处理方式有不少不同 不过rk3128 还在走 ...

  2. 字母导航跳转react核心代码

    componentDidMount() { this.move(); } skipToDep(e) { let dom = document.getElementById(e); // 获取要跳至的字 ...

  3. CentOS7虚拟机配置ip地址

    首先安装后的虚拟机选NAT模式配置vm的虚拟网络编辑器(vmware中的编辑),NAT模式中查看DHCP的范围,配置子网(写成和电脑一样),在linux中进入/etc/sysconfig/networ ...

  4. Android中 Git 使用中几个概念

    1.仓库(版本库) 版本库又名仓库,英文名repository,你可以简单理解成一个目录,这个目录里面的所有文件都可以被Git管理起来,每个文件的修改.删除,Git都能跟踪,以便任何时刻都可以追踪历史 ...

  5. Servlet学习记录2

    读取web.xml参数 上篇文章ImageServlet里只设置了JPG,GIF,DOC类型文件的Content-Type.如果这时候需求变化了,需要增加Excel文件格式的Content-Type, ...

  6. redis+thinkphp5的注册、登陆、关注基础例子

    最近初步接触redis,结合thinkphp5与redis,写了一个用户注册的基础例子,用于学习. 这个例子是结合了兄弟连的redis视频,最后两节的内容写的:https://study.163.co ...

  7. mysql 采样查询 / 间隔查询 / 跳跃查询的两种实现思路

    先创建一张测试表 CREATE TABLE `test` ( `id` ) DEFAULT NULL, `) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET= ...

  8. Python txt文件读取写入字典的方法(json、eval)

    link:https://blog.csdn.net/li532331251/article/details/78203438 一.使用json转换方法 1.字典写入txt import json d ...

  9. Centos7下杀毒软件clamav的安装和使用

    目录 一.yum安装 二.编译安装 2.1:下载软件包 2.2:创建clamav用户和存放病毒库目录 2.3:解压安装包 2.4:安装依赖 2.5:编译安装 2.6:配置clamav 2.7:启动cl ...

  10. 使用C编程语言实现AVL树

    本文将介绍AVL树及其插入.删除操作,最后使用C编程语言实现基于平衡因子(balance factor)的AVL树. 什么是AVL树? AVL树(AVL tree)是前苏联计算机科学家Adelson- ...