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

TVA Account by country is not used #31159

Closed
comaiteseb opened this issue Sep 27, 2024 · 3 comments
Closed

TVA Account by country is not used #31159

comaiteseb opened this issue Sep 27, 2024 · 3 comments
Labels
Bug This is a bug (something does not work as expected)

Comments

@comaiteseb
Copy link
Contributor

Bug

When you are in the mode SERVICE_ARE_ECOMMERCE_200238EC activated, you must vetiled TVA on account spécified here : /admin/dict.php?id=10&from=accountancy&search_country_id=1&mainmenu=accountancy&leftmenu=accountancy_admin

But it doesn't work and return the seller country account.

I think we need to add condition on the SERVICE_ARE_ECOMMERCE_200238EC in the getTaxedFromId function in core/lib/functions.lib.php line 6597. And use $buyer->country_code rather than seller->country_code

And when this function is called line 227 in accountancy/journal/sellsjournal.php, change :
$vatdata = getTaxesFromId($tax_id, $mysoc, $mysoc, 0);
by

$vatdata = getTaxesFromId($tax_id, $mysoc, $thirdparty, 0);

we need to create a $thirdparty object just before.

In fact if we want to respect UE legacy, we need to use delivery country address linked into the invoice contact and if not, use the thirdparty country.

see : https://www.impots.gouv.fr/professionnel/achatvente-de-biens

Dolibarr Version

19.3

Environment PHP

No response

Environment Database

No response

Steps to reproduce the behavior and expected behavior

No response

Attached files

No response

@comaiteseb comaiteseb added the Bug This is a bug (something does not work as expected) label Sep 27, 2024
@eldy
Copy link
Member

eldy commented Sep 30, 2024

I think so.
Can you check if this patch is ok for you: 61e8382

@comaiteseb
Copy link
Contributor Author

Hi @eldy ,
It seems to be ok.

Thank's

@comaiteseb
Copy link
Contributor Author

Hi, @eldy
Can you make a MR on 19.0 branch please ? (version where I create this issue)
Thank's

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug This is a bug (something does not work as expected)
Projects
None yet
Development

No branches or pull requests

2 participants