Dolibarr / dolibarr

Dolibarr ERP CRM is a modern software package to manage your company or foundation's activity (contacts, suppliers, invoices, orders, stocks, agenda, accounting, ...). it's an open source Web application (written in PHP) designed for businesses of any sizes, foundations and freelancers.
https://www.dolibarr.org
GNU General Public License v3.0
5.46k stars 2.79k forks source link

International invoice VAT for EU seller with EU customers #20788

Closed xabitrigo closed 1 week ago

xabitrigo commented 2 years ago

Bug

International buys should allow VAT types for both the origin and destination countries. According to this: https://ec.europa.eu/taxation_customs/business/vat/vat-e-commerce_en both cases are possible.

This can be activated via the option SERVICE_ARE_ECOMMERCE_200238EC (https://wiki.dolibarr.org/index.php/Setup_Other#Services_Module) , but it only seems to be working for predefined items, and not for free text products or services.

I think the problem may be in the line 5903 of tile htdocs/core/class/html.form.class.php

if (!isInEEC($societe_vendeuse) && (!is_object($societe_acheteuse) || (isInEEC($societe_acheteuse) && !$societe_acheteuse->isACompany()))) {

if I remove the "not" from the first isInEEC I can see the VAT for both countries

This is related to issue #12557

Environment Version

15.0.1

Environment OS

Ubuntu 20.04

Environment Web server

Apache

Environment PHP

7.4.29 FPM/FastCGI

Environment Database

PostgreSQL 12.10 (Ubuntu 12.10-0ubuntu0.20.04.1)

Environment URL(s)

No response

Expected and actual behavior

To see the VAT for both countries

Steps to reproduce the behavior

Attached files

No response

lemathou commented 2 years ago

I'm working on it at the moment... The conditions seems to be bugged. First, it should also work for products and it is not, and second this prevents the main enterprise configured in Dolibarr (sender/seller) to be in EEC, which is nonsense... !isInEEC($societe_vendeuse).

I think we should replace : if (!isInEEC($societe_vendeuse) && (!is_object($societe_acheteuse) || (isInEEC($societe_acheteuse) && !$societe_acheteuse->isACompany()))) { with if (isInEEC($societe_vendeuse) && (is_object($societe_acheteuse) && (isInEEC($societe_acheteuse) && !$societe_acheteuse->isACompany()))) {

and after : if ($type == 1) with if ($type == 1 || $type == 0)

Or, better make it work with every product line, and some services (except shipping, and any others if I understood well the rules)

Ludovicode42 commented 1 year ago

Informations:

Dolibarr 15.0.3 SERVICE_ARE_ECOMMERCE_200238EC = 1

On Sales Order, Sales Proposal and Invoice, when modifying a line with VAT outside of France (e.g. Germany), the VAT goes from 19% to 0% .

Example with a German third party,

Product added with good VAT :

image

If you click on the pencil, the VAT is set to 0 and the German VAT is not proposed :

image

If you don't make any changes and validate the order, everything is fine (VAT at 19%). If you want to create an invoice for a fixed amount on account, the VAT will also appear at 0% :

image

image

ErikRakhorst commented 1 year ago

any progress on this? I still see the same behavior as described above with 17.0.0

ksar-ksar commented 1 year ago

Hello,

Is it still the case on V18 ?

github-actions[bot] commented 3 weeks ago

This issue is stale because it has been open 1 year with no activity. If this is a bug, please comment to confirm it is still present on latest stable version. if this is a feature request, please comment to notify the request is still relevant and not yet covered by latest stable version. This issue may be closed automatically by stale bot in 10 days (you should still be able to re-open it if required).