erp.type | erp.entity |
---|---|
front-end-business-rule |
Crm.Invoicing.InvoiceOrderLines |
+----------------------+-----------------------------------------------------------------------------------------------+
| Code | 30316-17 |
+----------------------+-----------------------------------------------------------------------------------------------+
| Entity | @Crm.Invoicing.InvoiceOrderLines |
+----------------------+-----------------------------------------------------------------------------------------------+
| Name | CalculateUnitPriceFromLineAmount |
+----------------------+-----------------------------------------------------------------------------------------------+
| Attribute | UnitPrice |
+----------------------+-----------------------------------------------------------------------------------------------+
| Layer | Front-End |
+----------------------+-----------------------------------------------------------------------------------------------+
| Events | AttributeChanged(LineAmount) |
+----------------------+-----------------------------------------------------------------------------------------------+
| Priority | Normal |
+----------------------+-----------------------------------------------------------------------------------------------+
| Modify | YES |
+----------------------+-----------------------------------------------------------------------------------------------+
| **Applicable | ALL // no condition needed |
| Legislations** | |
+----------------------+-----------------------------------------------------------------------------------------------+
| Action | if (LineAmount != null) |
| | { |
| |
|
| | lineAmount= (lineAmount / (1 - lineStandardDiscountPercent))/ (1 - |
| | LineCustomDiscountPercent); |
| |
|
| | if (Quantity != 0) |
| | { |
| | UnitPrice= lineAmount / Quantity; |
| | } |
| |
|
| | ELSE |
| |
|
| | UnitPrice=lineAmount |
+----------------------+-----------------------------------------------------------------------------------------------+
| Description | When Line Amount has changed, Unit Price should be recalculated. The Unit Price is equal to |
| | the Line Amount increased with the Line Standard Discount Percent and the Line Custom |
| | Discount Percent and divided by the Quantity if it is not 0. |
+----------------------+-----------------------------------------------------------------------------------------------+
| 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.