Skip to content

Latest commit

 

History

History
45 lines (43 loc) · 4.58 KB

R30383-24.md

File metadata and controls

45 lines (43 loc) · 4.58 KB
erp.type erp.entity
front-end-business-rule
Crm.Invoicing.InvoiceLines

R30383-24 InvoiceLine - Calculate Unit Price

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