erp.type | erp.entity |
---|---|
front-end-business-rule |
Crm.Invoicing.InvoiceLines |
+----------------------+-----------------------------------------------------------------------------------------------+
| Code | 30383-24 |
+----------------------+-----------------------------------------------------------------------------------------------+
| Entity | @Crm.Invoicing.InvoiceLines |
+----------------------+-----------------------------------------------------------------------------------------------+
| Name | CalculateUnitPrice |
+----------------------+-----------------------------------------------------------------------------------------------+
| Attribute | UnitPrice |
+----------------------+-----------------------------------------------------------------------------------------------+
| Layer | Front-End |
+----------------------+-----------------------------------------------------------------------------------------------+
| Events | AttributeChanged(LineAmount) |
+----------------------+-----------------------------------------------------------------------------------------------+
| Priority | Normal |
+----------------------+-----------------------------------------------------------------------------------------------+
| Modify | YES |
+----------------------+-----------------------------------------------------------------------------------------------+
| **Applicable | ALL // no condition needed |
| Legislations** | |
+----------------------+-----------------------------------------------------------------------------------------------+
| Action | if (LineAmount != null) |
| | UnitPrice = ((LineAmount / (1 - LineStandardDiscountPercent)) / (1 - |
| | LineCustomDiscountPercent))/ Quantity* |
| |
|
| | *if Quantity is null or 0, divide by 1 |
+----------------------+-----------------------------------------------------------------------------------------------+
| Description | When Line Amount is changed, Unit Price should be recalculated. Unit Price is equal to Line |
| | Amount increased with the line's discounts and then divided by the Quantity. If Quantity is |
| | empty or 0, Unit Price is equal to Line Amount increased with the line's discounts. |
+----------------------+-----------------------------------------------------------------------------------------------+
| Message | |
+----------------------+-----------------------------------------------------------------------------------------------+
| Version | Introduced: 2020 |
+----------------------+-----------------------------------------------------------------------------------------------+
| Revocable | YES |
+----------------------+-----------------------------------------------------------------------------------------------+
* For more information about the Business Rules Documentation Template and a short explanation of each column, see topic System Business Rules.