Я рассчитываю на отправку наших счетов в стандарте UBL, более конкретно, PEPPOL BIS Billing 3.0. Некоторые из наших клиентов используют товары с отрицательной ценой для предоставления скидок. Они хотят сохранить этот метод работы.
UBL обеспечивает, что Price.PriceAmount
из InvoiceLine
не может быть отрицательным. Как мне тогда обращаться с такими строками счетов?
Вот небольшой пример, где я пытаюсь добавить 30 пунктов с уменьшением на 31 евроцент:
<cac:InvoiceLine>
<!-- Unique identifier for the individual line within the invoice -->
<cbc:ID>1</cbc:ID>
<!-- Quantity of items charged in the invoice line. The unit of measure that applies to the invoiced quantity is a code from one of two standards. -->
<cbc:InvoicedQuantity unitCode="C62">30</cbc:InvoicedQuantity>
<!-- Line extension amount for this invoice line, rounded to max 2 decimals -->
<cbc:LineExtensionAmount currencyID="EUR">-9.30</cbc:LineExtensionAmount>
<!-- Item information -->
<cac:Item>
<!-- Item name -->
<cbc:Name>KO Algemene korting</cbc:Name>
<!-- Line VAT information -->
<cac:ClassifiedTaxCategory>
<!-- VAT category code for the invoiced item -->
<cbc:ID>E</cbc:ID>
<cbc:Percent>0.00</cbc:Percent>
<cac:TaxScheme>
<!-- Mandatory element, use "VAT" -->
<cbc:ID>VAT</cbc:ID>
</cac:TaxScheme>
</cac:ClassifiedTaxCategory>
</cac:Item>
<!-- Price details -->
<cac:Price>
<!-- Item price, VAT exclusive, after subtracting item price discount. The Item net price has to be equal with the Item gross price less the Item price discount, if they are both provided. Item price can not be negative. -->
<cbc:PriceAmount currencyID="EUR">-0.31</cbc:PriceAmount>
<!-- Number of item units to which the price applies -->
<cbc:BaseQuantity unitCode="C62">1</cbc:BaseQuantity>
<!-- Allowance to apply reduction -->
<cac:AllowanceCharge>
<!-- Mandatory element that must be set to false -->
<cbc:ChargeIndicator>false</cbc:ChargeIndicator>
<!-- Item price discount -->
<cbc:Amount currencyID="EUR">0.31</cbc:Amount>
</cac:AllowanceCharge>
</cac:Price>
</cac:InvoiceLine>
Это не проходит проверку со следующим сообщением:
Тест XPath: (cac: Price / cbc: PriceAmount)> = 0
Сообщение об ошибке: [BR-27] - Чистая цена товара (BT-146) НЕ должна быть отрицательной.
Как добавить строки в мои счета UBL с отрицательной суммой?