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. oracle增加记录谁在连接你的数据库

    我们都知道在v$session 中记录着客户端的机器名称,但是没有IP , 如果记录clinet ip 呢? 有两种思路: ①    利用trigger,后面就是这种方式 ②    利用 DBMS_S ...

  2. 进制与进制转换DAY2

    进制和进制转换 一.进制的基础 1.十进制(案例) 系数:0-9 进位规则:逢十进一 权:基数的次幂 基数:几进制基数就是几 规律:右侧第一位的权是10的0次幂,每向左移动一位次幂会+1. 进制的表示 ...

  3. Python学习日记 --day4

    list列表: # # 列表 ''' # 增 # li = [1,'qwer','小明',[1,2,'qwe']] # print(li[0],type(li)) # 跟字符串的操作方法是一样的,返回 ...

  4. Java并发编程随笔

    死锁:两个线程互相等待对方释放锁才可以继续运行. 避免死锁的常见方法: 1.避免一个线程同时获取多个锁 2.避免一个线程在锁内同时占用多个资源,尽量保证一个锁只占用一个资源 3.尝试使用定时锁,使用l ...

  5. 函数(一.return)

    #return的用法:#return用于退出函数,选择性的返回一个表达式.def test1(a,b): total = a+b return total print(total) def test2 ...

  6. NetworkStream介绍说明

    如果服务器和客户端之间基于TCP连接的,他们之间能够依靠一个稳定的字节流进行相互传输信息,这也是NetworkStream的最关键的作用,有了这个神奇的协议,NetWorkStream便能向其他流一样 ...

  7. gradle 排除jar包依赖

    1.直接在configuration中排除 configurations { compile.exclude module: 'commons' all*.exclude group: 'org.gr ...

  8. CDH5.15.1 hive 连接mongodb配置及增删改查

    1. 下载 wget http://repo1.maven.org/maven2/org/mongodb/mongo-hadoop/mongo-hadoop-hive/2.0.2/mongo-hado ...

  9. Nginx入门基础(一)

    Nginx介绍 Nginx 是一个高性能的 HTTP 和反向代理服务器,也是一个 IMAP/POP3/SMTP服务器. 官方测试Nginx能够支撑5万并发链接,并且cpu.内存等资源消耗却非常低,运行 ...

  10. 给统计人讲python(1)模拟城市_数据分析

    为让学校统计学社的同学了解python在数据处理方面的功能,将手游模拟城市的工厂生产进行建模,让同学在建模与处理非结构数据的过程中学习和了解python.将准备的内容放在此让更多需要的人特别是统计人( ...