Skip to content

Latest commit

 

History

History
49 lines (47 loc) · 5.08 KB

R31508-15.md

File metadata and controls

49 lines (47 loc) · 5.08 KB

erp.type: front-end-business-rule erp.entity: Logistics.Procurement.PurchaseInvoices

R31508-15 Purchase Invoice - Convert Line Prices

+----------------------+-----------------------------------------------------------------------------------------------+ | Code | 31508-15 | +----------------------+-----------------------------------------------------------------------------------------------+ | Entity | @Logistics.Procurement.PurchaseInvoices | +----------------------+-----------------------------------------------------------------------------------------------+ | Name | ConvertLinePrices | +----------------------+-----------------------------------------------------------------------------------------------+ | Attribute | PurchaseInvoiceLine.UnitPrice | +----------------------+-----------------------------------------------------------------------------------------------+ | Layer | Front-End | +----------------------+-----------------------------------------------------------------------------------------------+ | Events | AttributeChanged(DocumentCurrency) | +----------------------+-----------------------------------------------------------------------------------------------+ | Priority | Normal | +----------------------+-----------------------------------------------------------------------------------------------+ | Modify | YES | +----------------------+-----------------------------------------------------------------------------------------------+ | **Applicable | ALL // no condition needed | | Legislations** | | +----------------------+-----------------------------------------------------------------------------------------------+ | Action | IF(oldCurrency is not null and CurrencyDirectory is not null) | | |

| | | foreach (line in Lines) | | | if (line.UnitPrice.Value != 0) { | | |

| | | IF(new Amount(line.UnitPrice.Value, oldCurrency).ConvertToOrDefault(DocumentCurrency, | | | CurrencyDirectory)) is not null | | | line.UnitPrice= new Amount(line.UnitPrice.Value, | | | oldCurrency).ConvertToOrDefault(DocumentCurrency, CurrencyDirectory) | | | if (null) IssueWarning once | +----------------------+-----------------------------------------------------------------------------------------------+ | Description | When Document Currency is changed, Unit Price should be converted to the new currency for | | | each of the lines in the document. If Currency Directory is missing, conversion is not made. | +----------------------+-----------------------------------------------------------------------------------------------+ | Message | same as R30505-7 ReceivingOrder - Convert Line Prices | +----------------------+-----------------------------------------------------------------------------------------------+ | Version | Introduced: 21 | +----------------------+-----------------------------------------------------------------------------------------------+ | Revocable | YES | +----------------------+-----------------------------------------------------------------------------------------------+

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