R27332 PaymentTransaction - Compare Total Expense And Income Amounts On Parent Transfer

Code R27332
Entity Finance.Payments.PaymentTransactions Entity
Name CompareAllPaymentAmountsOnParentTransfers
Attribute TotalAmount
Layer Back-End
Events Released +
Priority Normal
Modify NO
Applicable Legislations ALL // no condition needed
Action If (Payment.ParentDocument.DocumentType.EntityName == Transfer)

Validate that:

SUM(all at least released non-voided Payments which ParentDocument == currentTransfer AND Payment.Direction == Expense) >= SUM (all at least released non-voided Payments which ParentDocument == currentTransfer AND Payment.Direction == Income)





(in all SUMs the current Payment.TotalAmount is included)
Description On document state change when the new state is greater than or equal to Release and the PaymentTransaction has parent document which is Transfer, validate that the total expense is greater than or equal to the total income amounts. The total expense amounts are calculated by the sum of all at least released and non voided PaymentTransactions on the current Transfer which has direction 'Expense'. The total income amounts are calculated by the sum of all at least released and non voided PaymentTransactions on the current Transfer which has direction 'Income'.
Message "The state of document '{0}' cannot become 'Released' or higher, because the expense ({1}) is less than the income ({2}).", [DocumentText], [sum of the total expense and its currency], [sum of the total income and its currency]
Version Introduced: 2017

Updated: 2019.1 - "Revocable" changed from "NO" to "YES"
Revocable YES
Revocable NO

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