R30316-8 InvoiceOrder - Convert Line Prices

Code 30316-8
Entity Crm.Invoicing.InvoiceOrders Entity
Name ConvertLinePrices
Attribute UnitPrice,LineAmount
Layer Front-End
Events AttributeChanged(DocumentCurrency)
Priority Normal
Modify YES
Applicable Legislations ALL // no condition needed
Action FOREACH( line)

IF(DocumentCurrency != line.LineAmount.Currency){

if(line.LineAmount==0 )

if(line.UnitPrice!=0)

line.UnitPrice = line.UnitPrice.ConvertTo(DocumentCurrency)

if(line,LineAmount!=0)

line.LineAmount = line.LineAmount.ConvertTo(DocumentCurrency)}
Description When the Document Currency has changed, if the previous currency is different from the new currency, the Line Amount for each Invoice Order Line should be converted to the new currency. If in the line, LineAmount is 0, then the Unit Price is recalculated if it is not 0, too. If Line Amount is not 0, only Line Amount is recalculated.
Message
Version Introduced: 2020.1
Revocable YES

* For more information about the Business Rules Documentation Template and a short explanation of each column, see topic System Business Rules.