Code Monkey home page Code Monkey logo

Comments (14)

guewen avatar guewen commented on July 17, 2024

On the backend, there is an option that indicates if tax is included in price or not and I think it changes this behavior. Could you check that?

from connector-magento.

aignermi avatar aignermi commented on July 17, 2024

I tried that before, but then I have the problem that the imported sales orders are completely wrong. Our products in Magento have prices incl. tax. The synced orders with that option calculate the tax on top of the products which already have tax incl. For example: product price is 69€ incl. tax, sales order with this product total is 82.11€ - but it should be 69€.

from connector-magento.

guewen avatar guewen commented on July 17, 2024

Pity. Getting all the options working together in all possible ways is really tricky with incl. and excl. taxes. I have no clue for that yet.

from connector-magento.

aignermi avatar aignermi commented on July 17, 2024

Ok, thats unfortunate. Can you tell me where you handle the tax calculations - then I'll have a look at it in the code, as the rules itself are pretty straight forward.

Is there a documentation for the connector where I can have a look how you handle various cases? I'm especially interested in the order syncing mechanism!

from connector-magento.

guewen avatar guewen commented on July 17, 2024

Here is the mapping for the discount: https://github.com/OCA/connector-magento/blob/8.0/magentoerpconnect/sale.py#L961-L972

And a test which proves to be insufficient here: https://github.com/OCA/connector-magento/blob/8.0/magentoerpconnect/tests/test_synchronization.py#L240-L266

There is no general documentation for that.

from connector-magento.

guewen avatar guewen commented on July 17, 2024

(record in the method contains the values from Magento)

from connector-magento.

aignermi avatar aignermi commented on July 17, 2024

Thanks, I just had a look at the code and the problem is the self.options.tax_include parameter and how it is used. To every order that is imported from Magento, Odoo calculates the tax on top, so in our case (our prices in Magento include the tax already) if I set the parameter to yes, I would have the double tax value in Odoo, but the correct discount logic. If I set it to no, I have correct imported orders but wrong discount logic. Therefore this parameter makes no sense at the discount logic step.

from connector-magento.

guewen avatar guewen commented on July 17, 2024

@aignermi does it depend on a configuration on Magento perhaps? I know Magento had a handful of options such as compute discount after total, before taxes, ...

from connector-magento.

guewen avatar guewen commented on July 17, 2024

I mean we can remove this logic in the discount, but I don't want to break other scenario, if it was there at a first place, I think (I hope) it was working for the one who wrote this part

from connector-magento.

aignermi avatar aignermi commented on July 17, 2024

@guewen yep I understand that. Let me check our settings there and let me check how Magento behaves with different settings and how the base_row_total_incl_tax field is calculated then. I'll try it out by removing that section too.

from connector-magento.

guewen avatar guewen commented on July 17, 2024

if I set the parameter to yes, I would have the double tax value in Odoo

Why not set tax include taxes on the products?

from connector-magento.

aignermi avatar aignermi commented on July 17, 2024

Where would I set that?

from connector-magento.

guewen avatar guewen commented on July 17, 2024

By activating "Tax included in Price" in the tax of your products

2015-07-08-152959_1650x894_scrot

from connector-magento.

aignermi avatar aignermi commented on July 17, 2024

Thx, that did the trick!

from connector-magento.

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.