while select forupdate salesLine
join salesTable
where salesLine.SalesId == salesTable.SalesId
&& salesLine.SalesStatus == SalesStatus::Delivered
&& salesTable.ISLFOC == NoYes::Yes
{
select firstonly markupTable
where markupTable.ModuleType == MarkupModuleType::Cust
&& markupTable.ISLFOC == NoYes::Yes;
delete_from markupTransTmp
where markupTransTmp.MarkupCode == markupTable.MarkupCode
&& markupTransTmp.TransTableId == salesLine.TableId
&& markupTransTmp.TransRecId == salesLine.RecId;
costPrice = salesLine.ISLItemOnhandPhysicalCost(salesLine.ItemId, salesLine.InventTransId);
if (costPrice)
{
if(salesTable.ISLFOC == NoYes::Yes
&& salesTable.SalesStatus == SalesStatus::Invoiced
&& salesLine.SalesStatus == SalesStatus::Delivered )
{
salesLine.ISLUpdateCharges(salesLine, costPrice);
}
else
{
salesLine.ISLUpdateCharges(salesLine, costPrice);
salesLine.ISLUpdateCharges(salesLine, -costPrice);
}
}
}
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 290,277 Super User 2024 Season 2
Martin Dráb 228,135 Most Valuable Professional
nmaenpaa 101,148