Discount lines in <name/> must match this regular expression: <value-of select="$XR-SKONTO-REGEX"/>. The information on granting a discount shall be transmitted in the element "Payment terms" (BT-20) as follows: The first segment shall be "SKONTO", the second "TAGE=n", the third "PROZENT=n". Percentages shall be stated without a sign and with a dot as the decimal separator and two decimal places. If the amount to be calculated is based not on BT-115, "Amount due for payment", but only on part of the invoice amount due, the base amount for calculating the discount shall be stated as the fourth segment "BASISBETRAG=n" in accordance with the semantic data type Amount. Each entry begins with a #, the segments are separated by a # and a line ends with a #. An XML-compliant line break shall follow at the end of a complete discount specification. All information on granting a discount shall be in uppercase. Additional whitespace (spaces, tabs or line breaks) is not permitted. Characters or text other than those specified above are not permitted.
A cash discount entry in ram:Description does not match the required format. The segments must begin with and be separated by #; SKONTO, TAGE=n and PROZENT=n are required. If the calculation basis is not BT-115, BASISBETRAG=n must also be provided. Values must be uppercase, and the percentage must have no sign and use a decimal point followed by two digits. Disallowed whitespace, other content, or a missing XML-compliant line break at the end also causes the test to fail.
The payment terms convey cash discount details in a defined text format. The basis amount is required when the discount is calculated on part of the amount rather than the due payable amount BT-115.
The cash discount details in the payment text do not follow the required structure. Adjust the segments, the percentage, and the final line break.
- Check the first
ram:Descriptionunderram:SpecifiedTradePaymentTerms. - Provide the segments in the order
SKONTO,TAGE=nandPROZENT=n, separated by#. - If the calculation basis is not
BT-115, addBASISBETRAG=n; end the entry with#and an XML-compliant line break. - Check the cash discount details using
AddTradePaymentTerms(...)orPaymentTerms. - Generate the invoice again and validate it once more.
<ram:SpecifiedTradePaymentTerms> <ram:Description>#SKONTO#TAGE=14#PROZENT=2#</ram:Description> </ram:SpecifiedTradePaymentTerms>
<ram:SpecifiedTradePaymentTerms> <ram:Description>#SKONTO#TAGE=14#PROZENT=2.00#</ram:Description> </ram:SpecifiedTradePaymentTerms>
FacturXInvoice.AddTradePaymentTerms(description, dueDate, paymentTermsType, dueDays, percentage, baseAmount, actualAmount, maturityDate)(BT-20)FacturXInvoice.ClearTradePaymentTerms()(BT-20)FacturXInvoice.DuePayableAmount(BT-115)FacturXInvoice.GetTradePaymentTerms()(BT-20)FacturXInvoice.PaymentTerms(BT-20)
Technical details
The test matches each line beginning with # in the first ram:Description against $XR-SKONTO-REGEX. It also requires the text after the last complete cash discount entry to begin with a line break.
The rule checks the first description under ram:SpecifiedTradePaymentTerms in the invoice header payment information.
rule/@context)assert/@test)