R30707-1 LogisticsDocument - Validate Currency Change

Code R30707-1
Entity LogisticsDocument
Name ValidateCurrencyChange
Attribute DocumentCurrencyId
Layer Front-End
Events AttributeChanged(DocumentCurrencyId)
Priority Normal
Modify YES
Applicable Legislations ALL // no condition needed
Action

document.IsCurrencyChangeValid(oldCurrency, newCurrency)

IsCurrencyChangeValid returns true if:

  • oldCurrency == null
  • oldCurrency == newCurrency

    throw an error if:

  • newCurrency == null (Error1)

    throw an error if:

  • CurrencyDirectory is null (Error2)

    returns true if:

  • there is a CurrencyDirectory and oldCurrency can be converted to newCurrency

    throws an error if:

  • there is a CurrencyDirectory and oldCurrency cannot be converted to newCurrency (Error3)
Description Validates that when changing the document currency, the conversion between those currencies is possible. In this way, we ensure that the amount conversion business rules, which are usually also triggered by the currency change, can be executed successfully.
Message Error1: Deleting of 'Document Currency' is not allowed. If you want to change the document currency you can simply select the new currency into the field.

Error2: Cannot convert '{oldCurrency.CurrencySign}' to '{newCurrency.CurrencySign}', because there is no currency directory specified.

Error3: There is no conversion ratio found for currencies {oldCurrency.CurrencySign} and {newCurrency.CurrencySign} in currency directory {CurrencyDirectory.Name}.





The message is also used in:

R30768-8 PaymentSlip - Validate Currency Change

R30968-3 Deal - Is Currency Change Valid

R31465-1 Asset Order - Validate Currency Change
Version Introduced: 2020.1
Revocable NO

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