我一直在尝试取消销售订单装箱单。我正在通过尝试重新发布但是在下一个之后收到一个错误来验证它是否有效。
我找到了一种发布装箱单的方法,但有一种简单的方法可以取消装箱单,而无需查找库存移动表中需要更新的所有字段吗?
是否有类似发布的简单内容(例如下面的内容):
static void SalesOrderPost(Args _args)
{
SalesFormLetter salesFormLetter;
salesTable salesTable;
salesTable = SalesTable::find('SO-101248');
salesFormLetter = SalesFormLetter::construct(
DocumentStatus::PackingSlip);
salesFormLetter.update(
salesTable,
systemDateGet(),
SalesUpdate::All,
AccountOrder::None,
NoYes::No,
NoYes::Yes);
}
答案 0 :(得分:2)
我能够检索客户装箱单日记帐并将其传递给SalesFormLetter_PackingSlipCancel操作菜单项。
CustPackingSlipJour custPackingSlipJour;
boolean isCancelEnabled, isCorrectionEnabled;
Args args;
//find latest packing slip
select * from custPackingSlipJour
order by PackingSlipId desc
where custPackingSlipJour.SalesId == salesTable.SalesId;
[isCancelEnabled, isCorrectionEnabled] = custPackingSlipJour.canPackingSlipBeCanceledOrCorrected();
if(isCancelEnabled)
{
//"cancel" latest packing slip
args = new Args();
args.record(custPackingSlipJour);
new MenuFunction(menuitemActionStr(SalesFormLetter_PackingSlipCancel), MenuItemType::Action).run(args);
}
super();