我应该如何用负金额表示UBL订单行?

时间:2019-01-24 07:32:58

标签: xml invoice

我正在按照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发票中添加金额为负的行?

1 个答案:

答案 0 :(得分:0)

价格金额应为正数,以便发票有效。但是LineExtensionAmount可以为负数。 您可能需要将InvoicedQuantity设置为负数。 退货时数量可能为负。