# DT-CIUS-PT-020_12.5

Source: https://xmlvalid.com/rules/DT-CIUS-PT-020_12.5

> The BT-22 when prefixed with '#ENTITY@ATMPAYMENT-000#' is mandatory an element with the prefix '#AMOUNT@ATMPAYMENT-000#'.

- Level: error
- Rule sets: CIUS-PT rules (Portugal, UBL) 2.1.1
- Context: `//ubl:Invoice/cbc:Note | //cn:CreditNote/cbc:Note`
- Test: `starts-with(normalize-space(.),$atm20_12) and (every $note in (ancestor::ubl:Invoice/cbc:Note | ancestor::cn:CreditNote/cbc:Note) satisfies (not(starts-with(normalize-space($note),concat('#AMOUNT@ATMPAYMENT-',normalize-space(substring-before(substring-after(.,'#ENTITY@ATMPAYMENT-'),'#')),'#')))))`

Validate a document against these rules: https://xmlvalid.com/validate
