R30768-11 PaymentSlip - Set Document Currency From Payment Account

Code 30768-11
Entity Finance.Payments.PaymentSlips Entity
Name SetDocumentCurrencyFromPaymentAccount
Attribute DocumentCurrency
Layer Front-End
Events AttributeChanged(PaymentAccount)
Priority Normal
Modify YES
Applicable Legislations ALL // no condition needed
Action if (PaymentAccount != null) { if (DocumentCurrency == null) DocumentCurrency = PaymentAccount.Currency; else if (DocumentCurrency != PaymentAccount.Currency) { if (CurrencyDirectory == null) IssueWarning(); DocumentCurrency = PaymentAccount.Currency;} }
Description When Payment Account is changed, the Document Currency is set to the Currency of the Payment Account, if it is different. If the previous value of Document Currency was not null but there is no Currency Directory specified in the document, the rule issues a warning that the amounts in the document won't be converted.
Message Document Currency has been changed in document '{DocumentText}' but the amounts in the document won't be converted because there is no Currency Directory.
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.