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

[FIX] send total amount as euro in invoice #94

Closed
wants to merge 5 commits into from

Conversation

Fmartinsz
Copy link

@Fmartinsz Fmartinsz commented Oct 16, 2023

Found out that when sending the invoice amount using another currency than Euro, the conversion would be wrong. This is due to invoicexpress expecting to receive the amount in Euro and proceeding to exchange to whatever currency we sent. Using the balance field, Odoo will automatically exchange the amount to the currency that is set in the users Company, which needs to be set to Euro.

@OCA-git-bot
Copy link
Collaborator

Hi @dreispt,
some modules you are maintaining are being modified, check this out!

@dreispt
Copy link
Member

dreispt commented Oct 17, 2023

Hi, the balance is total amount, not per unit amount, right? Also, I worry about the case where price can be tax inclusive (b2c).

@cpintofonseca
Copy link

@dreispt thanks for your help, you are correct.
I'm going to assume that the company's currency is EUR as I also assume it should be the case when using InvoiceXpress (it doesn't necessarily need to be like this but it simplifies since we can grab the currency from the company instead of getting the external id of euro currency).

If the line's currency is different than company's currency, we are now converting the unit price to company's currency.

Co-authored-by: Daniel Reis <dreis@opensourceintegrators.com>
line.price_unit,
line.company_id.currency_id,
line.company_id,
date_today,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why today, shouldn't it be the Invoice Date?
What date is used to convert the amount used for the accounting entries?

Copy link

@cpintofonseca cpintofonseca Dec 29, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dreispt invoice date seems more reasonable. I checked the way Odoo is calculating the currency rate for the invoice line and did the same, new commit is available to improve this.

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

Successfully merging this pull request may close these issues.

5 participants