AX_CreateAndPostPurch
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的更多相关文章
随机推荐
- 创建Oracle表空间
*分为四步 */ /*第1步:创建临时表空间 */ create temporarytablespace user_temp tempfile 'D:\oracle\oradata\Oracle9i\ ...
- python初学心得之一
昨天开始接触并学习python,对python有了初步印象. 一.python主要应用方向 二.python语言类型 三.python2和3的主要区别 四.常见字符编码 五.Python语法初学 一 ...
- 11Linux_sshd_Apache
1.Linux系统中一切都是文件. 2.配置服务实际上就是在修改配置文件. 3.重启相应服务来加载最新的配置参数. 4.为了保证下次还生效,加入到开机启动项中.
- C# ConfigurationManager不存在问题解决
在做串口通信的时候,需要使用"ConfigurationManager"类,但是添加"Using System.Configuration"命名空间后编译器依旧 ...
- Java demo之时间
jdk原生 public class Start { public static void main(String[] args) { SimpleDateFormat simpleDateForma ...
- JavaFX(Maven 方式)
运行界面第一种方式 运行界面第二种方式 参考文献 https://github.com/AlmasB/JavaFX11-example
- java学习-- String
String 类的实例是不可改变的,所以你一旦创建了 String 对象,那它的值就无法改变了 String 类是不可改变的解析,例如: String s = "Google"; ...
- (转)Thinkpad X1 Carbon 扩展硬盘
http://tieba.baidu.com/p/5837920925 网上看到有人成功利用X1C空闲的4G模块来实现了扩充用的是东芝RC100或者建兴的T11 其实难点应该是2242这种尺寸的SSD ...
- 【MYSQL】MYSQLの環境構築
ダウンロード:https://dev.mysql.com/downloads/mysql/ 手順① 手順② mysql.iniの設定について [mysql]default-character-set= ...
- freeswitch dialplan 基础
freeswitch dialplan 基础 一.基础概念 dialplan 拨号方案 context 拨号表(块) extension 拨号去向 action (拨号后执行的)动作 condit ...