Skip to content

Latest commit

 

History

History
54 lines (52 loc) · 5.67 KB

R30316-17.md

File metadata and controls

54 lines (52 loc) · 5.67 KB
erp.type erp.entity
front-end-business-rule
Crm.Invoicing.InvoiceOrderLines

R30316-17 InvoiceOrderLine - Calculate Unit Price From Line Amount

+----------------------+-----------------------------------------------------------------------------------------------+ | 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.