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的更多相关文章
随机推荐
- Webpack 使用url-loader和file-loader打包资源文件
在js中不仅可以通过import引入js文件,还可以引入图片.视频等资源文件,这样webpack打包时就会把所引入的资源文件也一起打包进来 打包进来的文件会返回一个字符串:即文件的路径 要做到这一点, ...
- Vue 自定义指令实现权限控制(按钮级)
在用户登陆后,根据用户id读取用户的所有权限数据,放入本地的sessionStorage进行存储(这里我是拿到权限按钮按钮的标识,英文名称.把他们合成一个字符串存储在 btnPowerString 中 ...
- 注解@Transactional(rollbackFor = Exception.class) 的用法
由于业务需求要求,在一个Service的一个方法A中有一个for循环,每次循环里面的业务逻辑有可能发生异常,这个时候就需要将这个循环内的所有数据库操作给回滚掉,但是又不能影响到之前循环里数据的更改,并 ...
- 深度学习原理与框架- tf.nn.conv2d_transpose(反卷积操作) tf.nn.conv2d_transpose(进行反卷积操作) 对于stride的理解存在问题?
反卷积操作: 首先对需要进行维度扩张的feature_map 进行补零操作,然后使用3*3的卷积核,进行卷积操作,使得其维度进行扩张,图中可以看出,2*2的feature经过卷积变成了4*4. ...
- urllib、urllib2、urllib3区别和使用
python3中把urllib和urllib合并为一个库了,urllib对应urllib.request 1.) python 中最早内置拥有的网络请求模块就是 urllib,我们可以看一下 urll ...
- appium python中的android uiautomator定位
text定位:driver.find_element_by_android_uiautomator('new UiSelector().text("请输入手机号")') #模糊定位 ...
- JVM、redis缓存适用场景
1. 数据状态相对稳定:(针对数据本身)数据修改较少. 2. 输出的数据是相对幂等:(针对业务)多次查询期间,数据不变动.如果查询频率过高,缓存可能没有及时更新. 了解一下redis.ehcache. ...
- Unity Shader笔记
shader “MyShader”{ Properties{ -CubeMap(“Cube Map” , Cube) = ""{这里可以添加图片渲染模式} } SubShader{ ...
- jquery cdn bootstrap静态资源库问题
使用微软静态资源库 <script src="http://ajax.aspnetcdn.com/ajax/jquery/jquery-1.9.0.min.js">&l ...
- MySQL实现批量检查表并进行repair与optimize的方法
这篇文章主要介绍了MySQL实现批量检查表并进行repair与optimize的方法,结合实例形式分析了MySQL批量修复与优化表的相关技巧,需要的朋友可以参考下 本文实例讲述了MySQL实现批量检查 ...