首页 > 代码库 > AX_InventCounting
AX_InventCounting
static void Job649(Args _args) { ItemId ItemId = "000XA00612R1"; InventDimId InventDimId = "K00811600"; InventQty qty = 5; InventQty physicalQty; NumberSeq numberSeq; InventJournalVoucherId voucherId; InventTransId InventTransId; InventUpd_Financial financial; InventMov_Vir_Counting movement; TransactionTxt transactionTxt; LedgerVoucher ledgerVoucher; LedgerVoucherObject ledgerVoucherObject; THK_2ndInventQty THK_2ndqty; CostAmount calcCostAmount() { InventPriceMap inventPriceMap = InventTable::find(ItemId).inventCostPriceMap(InventDimId); ; return PriceDisc::price2Amount(inventPriceMap.price(), inventPriceMap.priceUnit(), 0, qty, qty, inventPriceMap.markup(), 0, ‘‘, 0); } ; physicalQty = InventSum::find(ItemId,InventDimId).PhysicalInvent; qty = qty - physicalQty; if (qty != 0) { if (!InventTransId) { InventTransId = NumberSeq::newGetNum(InventParameters::numRefInventTransId()).num(); } numberSeq = NumberSeq::newGetNum(InventParameters::numRefInventJournalVoucherId()); voucherId = numberSeq.num(); transactionTxt = new TransactionTxt(); transactionTxt.setType(LedgerTransTxt::InventJournalCount); transactionTxt.setDate(systemdateget()); transactionTxt.setVoucher(voucherId); ledgerVoucher = LedgerVoucher::newLedgerPost(DetailSummary::Summary, SysModule::Invent, numberSeq.parmVoucherSequenceCode()); ledgerVoucherObject = LedgerVoucherObject::newVoucher(voucherId, systemdateget(), SysModule::Invent, LedgerTransType::Invent); ledgerVoucherObject.lastTransTxt(transactionTxt.txt()); ledgerVoucher.addVoucher(ledgerVoucherObject); movement = InventMov_Vir_Counting::newParameters( InventTransId, ItemId, InventDimId, systemdateget(), qty, THK_2ndqty); financial = InventUpd_Financial::newVirtuelCounting(movement, ledgerVoucher, abs(calcCostAmount()) * movement.transSign()); financial.updateNow(); } }
AX_InventCounting
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。