It could happen that inventory adjustment journals are created after an intercompany sales order is created with picking list generated and packing slip posted for the same item in the order and different price. This by it self doesn’t create a problem until the IC order has to be invoiced which updates the order lines with the latest price adjustments. As the intercompany rules require to keep the same price from creating the orders to invoicing in order to prevent the update (actually re-update) we need to extend class ‘IntercompanySalesAtCostPriceFormLetterHandler’ and method ‘onSalesLineSelected’. Before CoC we need to keep the previous value and then after it we will update the sales line with the original value.
final class IntercompanySalesAtCostPriceFormLetterHandler_Extension
public void onSalesLineSelected(SalesLine _salesLine)
SalesPrice origSalesPrice = _salesLine.SalesPrice;
SalesLineAmount origLineAmount = _salesLine.LineAmount;
//revert the price to the original price
SalesLine salesLineLocal = SalesLine::findRecId(_salesLine.RecId, true);
salesLineLocal.SalesPrice = origSalesPrice;
salesLineLocal.LineAmount = origLineAmount;
public void onSalesLinesSelectionStarted()
public void onSalesLinesSelectionFinished()
Just have in mind that you need to extend methods ‘onSalesLinesSelectionStarted’ and ‘onSalesLinesSelectionFinished’ as well as they must reside in the same transaction as ‘onSalesLineSelected’.
Allow All Cookies
Third Party Embedes
Third-party cookies are cookies that are set by other websites, not this one. This website may use embedded content from other websites, such as YouTube or Google maps. Your consent is required to view content from these websites embedded on this site.