public static void closeSalesOrders(Guid _transId)
{
#AviFiles
SysOperationProgress progress = new SysOperationProgress();
SalesTable salesTable;
SalesLine salesLine;
;
progress.setCaption("Sales order closing ....");
progress.setAnimation(#AviSearch);
try
{
ttsbegin;
while select firstonly forupdate salesTable
where salesTable.SalesId == salesOrderClosing.SalesId
{
while select forupdate salesline
where salesLine.SalesId == salesTable.SalesId
&& salesLine.SalesStatus == salesStatus::Backorder
{
salesLine.RemainInventPhysical = 0;
salesLine.RemainSalesPhysical = 0;
salesLine.Complete = noYes::Yes;
salesLine.Blocked = noYes::Yes;
salesLine.update();
progress.setText('Processing item ' + salesLine.ItemId + ' with sales id ' + salesLine.SalesId + '.');
}
}
ttscommit;
}
catch(Exception::Error)
{
ttsabort;
}
}
{
#AviFiles
SysOperationProgress progress = new SysOperationProgress();
SalesTable salesTable;
SalesLine salesLine;
;
progress.setCaption("Sales order closing ....");
progress.setAnimation(#AviSearch);
try
{
ttsbegin;
while select firstonly forupdate salesTable
where salesTable.SalesId == salesOrderClosing.SalesId
{
while select forupdate salesline
where salesLine.SalesId == salesTable.SalesId
&& salesLine.SalesStatus == salesStatus::Backorder
{
salesLine.RemainInventPhysical = 0;
salesLine.RemainSalesPhysical = 0;
salesLine.Complete = noYes::Yes;
salesLine.Blocked = noYes::Yes;
salesLine.update();
progress.setText('Processing item ' + salesLine.ItemId + ' with sales id ' + salesLine.SalesId + '.');
}
}
ttscommit;
}
catch(Exception::Error)
{
ttsabort;
}
}
No comments:
Post a Comment