static void PurchTableCancel()
{
PurchTable PurchTable;
PurchLine PurchLine;
InventTrans InventTrans;
;
ttsbegin;
select forupdate PurchTable
where PurchTable.PurchId == "MAA00051615";
PurchTable.PurchStatus = PurchStatus::Canceled;
PurchTable.PurchPoolId = "İptal";
PurchTable.update();
while select forupdate PurchLine
where PurchLine.PurchId == PurchTable.PurchId
{
InventTrans = InventTrans::findTransId(PurchLine.InventTransId, true);
InventTrans.StatusReceipt = StatusReceipt::Ordered;//Açık sipariş
InventTrans.DatePhysical = datenull();
InventTrans.VoucherPhysical ="";
InventTrans.CostAmountPhysical = 0;
InventTrans.CostAmountSecCurPhysical_TR = 0;
InventTrans.update();
PurchLine.PurchStatus = PurchStatus::Canceled;//Açık sipariş
PurchLine.ReturnStatus = ReturnStatusLine::None;
PurchLine.RemainPurchPhysical = 1;
PurchLine.RemainInventPhysical = 1;
PurchLine.RemainPurchFinancial = 0;
PurchLine.RemainInventFinancial = 0;
PurchLine.PurchStatus = PurchStatus::Canceled;
PurchLine.doUpdate();
}
ttscommit;
info("bitti");
}
Hiç yorum yok:
Yorum Gönder