static void CreateAndPostPurch(Args _args)
{
List il = new List(Types::Record);
DocumentNum DocumentNum;
TmpFrmVirtual TmpFrmVirtual;
PurchLine localPurchLine;
PurchTable localPurchTable;
VendPackingSlipJour ventPackingSlipJour;
PurchFormLetter_PackingSlip purchFormLetter_PackintSlip = PurchFormLetter::construct(DocumentStatus::PackingSlip);
PurchFormLetter_PackingSlip purchFormLetter_Invoice = PurchFormLetter::construct(DocumentStatus::Invoice);
; ttsbegin;
localPurchTable.clear();
localPurchTable.initValue();
localPurchTable.PurchId = NumberSeq::newGetNumFromCode("PONUM").num();
localPurchTable.initFromVendTable(VendTable::find("V-00001"));
localPurchTable.PurchaseType = PurchaseType::Purch;
localPurchTable.CurrencyCode = "RMB";
localPurchTable.PurchPoolId = "NOR";
localPurchTable.DeliveryDate = systemdateget();
localPurchTable.insert(); localPurchLine.clear();
localPurchLine.initValue();
localPurchLine.initFromPurchTable(localPurchTable);
localPurchLine.ItemId = "100XA00125";
localPurchLine.initFromInventTable(InventTable::find(localPurchLine.ItemId));
localPurchLine.PurchQty = ;
localPurchLine.PurchUnit = InventTableModule::find(localPurchLine.ItemId,ModuleInventPurchSales::Invent).UnitId;
localPurchLine.THK_2ndPurchQty = ;
localPurchLine.THK_2ndPurchUnit = InventTableModule::find(localPurchLine.ItemId,ModuleInventPurchSales::Invent).THK_2ndUnit;
localPurchLine.PurchPrice = ;
localPurchLine.LineAmount = localPurchLine.calcLineAmount();
localPurchLine.THK_2ndQtyOrdered = localPurchLine.THK_2ndcalcQtyOrdered();
localPurchLine.QtyOrdered = localPurchLine.calcQtyOrdered();
localPurchLine.DeliveryDate = systemdateget();
localPurchLine.InventDimId = "T00309533";
localPurchLine.createLine(); info(strfmt("@SYS82024", localPurchTable.PurchId),'', SysInfoAction_TableField::newBuffer(localPurchTable)); if(localPurchTable)
{
DocumentNum = NumberSeq::newGetNumFromCode("POPS").num();
purchFormLetter_PackintSlip.update(localPurchTable,
DocumentNum,
systemDateGet(),
PurchUpdate::All,
AccountOrder::Account,
NoYes::No,
NoYes::No,
false,
noYes::Yes);
} while select ventPackingSlipJour
where ventPackingSlipJour.PurchId == localPurchTable.PurchId
{
tmpFrmVirtual.clear();
tmpFrmVirtual.TableNum = tableNum(VendPackingSlipJour);
tmpFrmVirtual.RecordNo = ventPackingSlipJour.recid;
tmpFrmVirtual.insert();
il.addEnd(tmpFrmVirtual);
}
purchFormLetter_Invoice.update(localPurchTable,
NumberSeq::newGetNumFromCode("POINV").num(),
systemDateGet(),
PurchUpdate::All,
AccountOrder::Account,
NoYes::No,
NoYes::No,
false,
noYes::Yes,
il.pack()); ttscommit;
} template 2
static void CreatePurchTemplate2(Args _args)
{
SalesTable salesTable = SalesTable::find("VS1000031");
PurchCreateFromSalesOrder purchCreate;
SalesLine getSalesLine;
QueryRun queryRun;
Query querySalesLine;
TmpPurchLinePrice tmpPurchLinePrice;
; purchCreate = PurchCreateFromSalesOrder::construct();
purchCreate.getLast();
purchCreate.resetCurrentListCS();
purchCreate.salesTable(salesTable);
purchCreate.callerRecord(salesTable); querySalesLine = new Query();
querySalesLine.addDataSource(tablenum(SalesLine));
queryRun = new QueryRun(purchCreate.querySalesLine(querySalesLine));
while (queryRun.next())
{
getSalesLine = queryRun.get(tablenum(SalesLine)); select tmpPurchLinePrice where tmpPurchLinePrice.SalesId == getSalesLine.SalesId &&
tmpPurchLinePrice.LineNum == getSalesLine.LineNum &&
tmpPurchLinePrice.SalesLineRefRecId == getSalesLine.RecId; tmpPurchLinePrice.initFromInventTable(InventTable::find(getSalesLine.ItemId));
tmpPurchLinePrice.SalesId = getSalesLine.SalesId;
tmpPurchLinePrice.LineNum = getSalesLine.LineNum;
tmpPurchLinePrice.SalesLineRefRecId = getSalesLine.RecId;
tmpPurchLinePrice.ItemId = getSalesLine.ItemId;
tmpPurchLinePrice.AccountNum = "V-10001";
tmpPurchLinePrice.PurchQty = getSalesLine.SalesQty;
tmpPurchLinePrice.PurchUnit = getSalesLine.SalesUnit;
tmpPurchLinePrice.PriceUnit = getSalesLine.PriceUnit;
tmpPurchLinePrice.CurrencyCode = "HKD";
tmpPurchLinePrice.Price = getSalesLine.SalesPrice;
tmpPurchLinePrice.Included = NoYes::Yes;
tmpPurchLinePrice.PriceSearched = NoYes::Yes;
tmpPurchLinePrice.InventDimId = getSalesLine.InventDimId;
tmpPurchLinePrice.write();
tmpPurchLinePrice.setLineAmount();
tmpPurchLinePrice.write();
} purchCreate.tmpPurchLinePrice(tmpPurchLinePrice);
purchCreate.run();
}

 

 

AX_CreateAndPostPurch的更多相关文章

随机推荐

  1. for循环,数字类型,字符串类型

    for 循环: l=['a','b','c'] for i in l : print(i) while循环和for循环 while循环:条件循环,循环的次数取决于条件何时为False for循环:循环 ...

  2. ie8兼容性总结

    DOCTYPE 首先需要确保你的HTML页面开始部分要有DOCTYPE声明.DOCTYPE告诉浏览器使用什么样的HTML或XHTML规范来解析HTML文档,具体会影响: 对标记.attributes ...

  3. app常见性能测试点

    转载自 https://blog.csdn.net/xiaomaoxiao336368/article/details/83547318 1.响应 冷启动 首次启动APP的时间间隔 adb shell ...

  4. Python——Django运行问题

    1.Python3.7+Django2.2操作Mysql数据库时出现如下错误:django.core.exceptions.ImproperlyConfigured: mysqlclient 1.3. ...

  5. LevelDB源码分析-Bloom Filter

    Bloom Filter bloom filter是leveldb中用来在一个block中检测key是否存在的工具,主要在BloomFilterPolicy类中实现: class BloomFilte ...

  6. C# 异步示例代码

    在 使用BackgroundWorker组件 一文中,阐述了在Winform编程中,使用BackgroundWorker组件实现异步调用,本文主要讲述利用委托实现异步. 以下描述摘抄于MSDN: 异步 ...

  7. GitHub下载提速

    通过修改hosts文件来提速(该方法也可加速其他因为CDN被屏蔽导致访问慢的网站) 第一步:获取GitHub的IP地址 通过访问:http://tool.chinaz.com/dns或者https:/ ...

  8. java使用selenium版本不兼容解决汇总

    selenium之webDriver与浏览器版本问题 http://blog.csdn.net/xqhadoop/article/details/77892796 selenium自动化测试资源整理( ...

  9. Python学习—框架篇之初识Django

    什么是web框架? 框架,即framework,特指为解决一个开放性问题而设计的具有一定约束性的支撑结构,使用框架可以帮你快速开发特定的系统,简单地说,就是你用别人搭建好的舞台来做表演. 对于所有的W ...

  10. <a>超链接用作下载

    在a标签里添加  download=""  ,“ ”里面的内容可随意写,比如文件名. <a href="/download/武林秘籍.pdf" downl ...