GithubHelp home page GithubHelp logo

Comments (4)

alexis-via avatar alexis-via commented on August 16, 2024

@bosd : Would you agree if we add your UBL invoice to the automated test suite, so that when the bug is fixed (I plan to work on it this month) we are sure it doesn't "come back" ? Do you want to anonymise some stuff in the XML before adding it to the test suite ?

from edi.

alexis-via avatar alexis-via commented on August 16, 2024

This is what happens for the 1st line: it reads:
<cbc:InvoicedQuantity unitCode="LTR">70.31</cbc:InvoicedQuantity>
<cbc:LineExtensionAmount currencyID="EUR">71.41</cbc:LineExtensionAmount>

So it writes in invoice line:
qty = 70.31
price unit = 71.41 / 70.31 = 1.01564
As the decimal precision for price unit is 2 by default, it writes price unit = 1.01 (should be 1.02...)
So the subtotal is 1.01 * 70.31 = 71.01

I see 3 solutions for this:
a) higher decimal precision for price unit => I exclude this solution because it impacts all invoices, including customer invoices
b) when this case happens, write:
qty = 1
price unit = price subtotal = 71.41
We loose the information about the exact qty...
c) keep the current behavior and add a line "Adjustement" which has the difference between the total untaxed computed by Odoo and the total untaxed of the invoice.

For the moment, I prefer option c (even if, in this particular case for gas, loosing the info of the qty is not important, so option b would be fine). @bosd what do you think ?

from edi.

bosd avatar bosd commented on August 16, 2024

@alexis-via
Yes you may use the UBL file in the test suite. It is already annonimzed. As the adress is on sesamestreet :)

Well, maybe it is in my lack of knowledge of odoo. But I was expecting to have the quantity and price unit to be dynamic. Though that will be more something into the core of odoo.

As a sollution I also prefer option C . So the total quantity of the product will still be visible.

from edi.

alexis-via avatar alexis-via commented on August 16, 2024

I implemented option c) on v10 tonight and I'm pretty happy with the result. I have 2 levels of adjustments:

  1. when, for a particular line, the price_subtotal is different between odoo and the XML file -> il create an adjustment line related to that line (same properties, same taxes, etc..)
  2. after those per-line adjustement, if there is still a difference between the amount_untaxed in Odoo and the monetary summation in the XML, I add a global adjustment line that has no tax and no product.

I added the invoice of this bug report to the automated test suite. I'll push the code to github when @bosd will confirm he agrees on that.

from edi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.