BR-FR-DEC-03_BT-147

The rule sets below word this rule differently; each wording is shown with its rule set.

In English The item price discount (BT-147) is not valid: it must be positive (no minus sign, except with the billing modes S9, B9 and M9), with at most 6 decimals, a point as the decimal separator and at most 19 characters without it.

error: the document is invalid

What the rule checks

As the rule set's publisher wrote it. The rule runs on every element the context matches, and fails where the test is false; the validator reports the line of that element

Message

[BR-FR-DEC-03/BT-147] Le montant « … » est invalide. Il doit : - être un nombre strictement positif (sans signe « - »), - comporter au plus 6 décimales (séparateur « . »), - contenir au maximum 19 caractères (hors séparateur). Veuillez corriger ce montant pour respecter le format requis.

Context
ubl:Invoice/cac:InvoiceLine/cac:Price/cac:AllowanceCharge | cn:CreditNote/cac:CreditNoteLine/cac:Price/cac:AllowanceCharge
Test
not($amount) or (custom:isSpecialContractBD(/ubl:Invoice|/cn:CreditNote) and custom:is-valid-decimal-19-6($amount)) or (not(custom:isSpecialContractBD(/ubl:Invoice|/cn:CreditNote)) and custom:is-valid-decimal-19-6-positive($amount))

Checked with France e-invoice (UBL), France e-credit note (UBL), France EXTENDED-CTC-FR (UBL)

Message

BR-FR-DEC-03/BT-147 : Le montant « … » est invalide. Il doit : - être un nombre strictement positif (sans signe « - »), sauf si Cadre de Facturation (BT-23) est S9, M9 ou B9 (bi-directionnel) - comporter au plus 6 décimales (séparateur « . »), - contenir au maximum 19 caractères (hors séparateur). Veuillez corriger ce montant pour respecter le format requis.

Context
rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:IncludedSupplyChainTradeLineItem/ram:SpecifiedLineTradeAgreement/ram:GrossPriceProductTradePrice/ram:AppliedTradeAllowanceCharge/ram:ActualAmount
Test
(custom:isSpecialContractBD(/rsm:CrossIndustryInvoice) and custom:is-valid-decimal-19-6($amount)) or (not(custom:isSpecialContractBD(/rsm:CrossIndustryInvoice)) and custom:is-valid-decimal-19-6-positive($amount))

Checked with France e-invoice (CII), France Factur-X EN 16931, France EXTENDED-CTC-FR (CII), France Factur-X EXTENDED, France Factur-X BASIC WL