Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug on Allowance and Invoice Totals #58

Open
liviubirleanu opened this issue Jun 25, 2024 · 1 comment
Open

Bug on Allowance and Invoice Totals #58

liviubirleanu opened this issue Jun 25, 2024 · 1 comment

Comments

@liviubirleanu
Copy link

Hello,

If we have 2 allowances for the same invoice line, one with positive amount and the other with negative amount, invoices totals are buggy, as total calculations does not take into account both.

Valid XML attached however totals shown by the library are completely wrong
3514844377.zip

netAmount 2642.16 correct 3265.20
vatAmount 502.01 correct 620.39
taxInclusiveAmount 3144.17 correct 3885.59

What is worth to be mentioned, is that original invoice is not issued with same library, but with other commercial software www.oblio.eu

However, its a valid invoice confirmed by our local authorities and I want to correctly read & import it in our systems.

Looking forward to your feedback here

Best
Liviu

@josemmo
Copy link
Owner

josemmo commented Aug 3, 2024

Hello @liviubirleanu,

The invoice you sent doesn't seem to have the right amounts. Take invoice line 1:

<cac:InvoiceLine>
    <cbc:ID>1</cbc:ID>
    <cbc:InvoicedQuantity unitCode="H87">177</cbc:InvoicedQuantity>
    <cbc:LineExtensionAmount currencyID="RON">3115.2</cbc:LineExtensionAmount>
    <cac:AllowanceCharge>
        <cbc:ChargeIndicator>false</cbc:ChargeIndicator>
        <cbc:AllowanceChargeReason>Discount produse</cbc:AllowanceChargeReason>
        <cbc:MultiplierFactorNumeric>20</cbc:MultiplierFactorNumeric>
        <cbc:Amount currencyID="RON">778.8</cbc:Amount>
    </cac:AllowanceCharge>
    <!-- [...] -->
</cac:InvoiceLine>

It has a charge of 20%, which the library calculates to be 3115.2 × 0.2 = 623.04. However, the value from <cbc:Amount /> is 778.8, which is not correct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants