我应该如何表示负数的 UBL 订单行?

How should I represent a UBL order line with a negative amount?

我正在考虑以 UBL 标准发送我们的发票,更具体地说是 PEPPOL BIS Billing 3.0。我们的一些客户使用负价格的商品进行减价。他们想保持这种工作方式。

UBL 强制 InvoiceLinePrice.PriceAmount 不能为负数。那么这种发票行应该怎么处理呢?

下面是我尝试添加 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 test: (cac:Price/cbc:PriceAmount) >= 0

Error message: [BR-27]-The Item net price (BT-146) shall NOT be negative.

如何向我的 UBL 发票添加负数额的行?

为了使发票有效,价格金额应为正数。但是 LineExtensionAmount 可能有负数。 您可能希望将 InvoicedQuantity 设置为负值。 在 returns.

的情况下,数量可能为负数