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 add constant to avoid price error when TTC is price base type #32869

Open
wants to merge 1 commit into
base: 20.0
Choose a base branch
from

Conversation

hregis
Copy link
Contributor

@hregis hregis commented Jan 30, 2025

No description provided.

@hregis
Copy link
Contributor Author

hregis commented Jan 30, 2025

@eldy maybe remove the possibility to set content of TTC field with ajax return ?

@hregis
Copy link
Contributor Author

hregis commented Jan 30, 2025

@sonikf
Copy link
Contributor

sonikf commented Jan 30, 2025

Hi @hregis @eldy
The client in this case is from an EU country so this is a reverse charge and vat must always be 0.
Imo setting TTC is not a problem since ht=TTC and PDF lines do not show TTC but changing vat percent other than 0 for EU customers shouldn't be allowed.

@hregis
Copy link
Contributor Author

hregis commented Jan 30, 2025

@eldy @sonikf here the problem is that if you have a product with a price defined in TTC base with a VAT rate of 20% and you sell to an EU or non-EU customer, the HT is not taken into account, the line is recorded in TTC! That's why I tell myself that when we select a defined product, whether it is in TTC or HT base we should always have the HT informed during the selection (ajax return)

@hregis
Copy link
Contributor Author

hregis commented Jan 30, 2025

@eldy @sonikf look if you have a product with price base type in TTC

Capture d’écran 2025-01-30 à 00 21 01

and if you add a line for an EU customer with VAT intracom

Capture d’écran 2025-01-30 à 00 22 49 Capture d’écran 2025-01-30 à 00 23 07

the real price is 125€ !!! not 150€

@hregis
Copy link
Contributor Author

hregis commented Jan 30, 2025

the ajax return should only provide the HT field and not the TTC field
with my fix the HT field is 125€

@sonikf
Copy link
Contributor

sonikf commented Jan 30, 2025

You are right. Sorry i was lost in translation seeing forum post and didn't realize the price was incl tax thought was different products!!!
Do you agree though that vat percent change in reverse charge cases should be disabled?

@hregis
Copy link
Contributor Author

hregis commented Jan 30, 2025

@sonikf yes if there is no exception in the rule 😄

@zeug-it
Copy link
Contributor

zeug-it commented Jan 30, 2025

Hi,
there are two variables possible with this fix:

MAIN_NO_INPUT_PRICE_WITH_TAX
MAIN_SET_CONTENT_INPUT_PRICE_WITH_TAX_DISABLED

which one should be set or not set?

with MAIN_NO_INPUT_PRICE_WITH_TAX I get only NET price displayed - but get NET and with Tax price on in the PDF

This works for B2B but I need the option like before to change to NET + TAX (Brutto) price for private customers

@eldy
Copy link
Member

eldy commented Jan 30, 2025

When a price has been defined to be a price including tax, the prixe must be recorded including tax. And it is the prices without tax that will vary depeding on we add tax or not.

I think the trouble is only in edit. When we edit, if the price on product is tax included, the suggested price in form must be with tax, if not,the suggested price must be price without. But currently, we do not save the unit price including tax into the field subprice_ttc (we only fill subprice). So we always suggest the price exluding tax when we edit. This feature was never implemented.

So first thing to do is to update code in develop to store the unit price including tax into subprice_ttc when we enter a price including tax. So we are able to autofill the field price including taxt when we edit the line.

@eldy eldy added the Discussion Some questions or discussions are opened and wait answers of author or other people to be processed label Jan 30, 2025
@hregis
Copy link
Contributor Author

hregis commented Jan 30, 2025

@eldy

The problem is that there can be two visions of things when we define a price on a tax-inclusive basis.
Either we want this final price whatever the value of the VAT and in this case the VAT-inclusive becomes excluding VAT in the documents.

Product Price: 150 including VAT with a rate of 20%
Sold: 150 excluding VAT with a rate of 0%

Or we can think that when we sell a product with a tax-inclusive base with a VAT rate of 0, then we will have the price excluding VAT in the documents.

Product Price: 150 including VAT with a rate of 20%
Sold: 125 excluding VAT with a rate of 0%

@hregis
Copy link
Contributor Author

hregis commented Jan 30, 2025

@eldy with my PR you can manage the 2 cases :

without MAIN_SET_CONTENT_INPUT_PRICE_WITH_TAX_DISABLED = case 1
with MAIN_SET_CONTENT_INPUT_PRICE_WITH_TAX_DISABLED = case 2

@zeug-it
Copy link
Contributor

zeug-it commented Jan 30, 2025

From my Point of View:
We import the selling Prices from Priceslists where we get the RRP (with Tax) from the Distributor and import this as selling price. On the other side we import the NET buying price. So the net selling price is no option in retail.

@hregis
Copy link
Contributor Author

hregis commented Jan 30, 2025

@zeug-it what is the price base type of your customer prices?

@zeug-it
Copy link
Contributor

zeug-it commented Jan 30, 2025

@hregis The base price is the with tax Brutto price
image

@hregis
Copy link
Contributor Author

hregis commented Jan 30, 2025

@zeug-it and if you create an invoice for an UE or not UE with 0% you would brutto or netto prices?

@zeug-it
Copy link
Contributor

zeug-it commented Jan 30, 2025

@hregis for a company customer in EU with TAX ID we create a netto price invoice, because the customer has to pay the tax in his own country. 0% netto price

for a company customer in EU without TAX ID we create a brutto price invoice (German Tax), because the customer has to pay the tax in his own country. 19% brutto price

invoice for non EU Countries 0% nettp price

@hregis
Copy link
Contributor Author

hregis commented Jan 30, 2025

@eldy ok donc il y a un soucis quand un produit a une base de prix ttc et qu'on vend à TVA 0%
Ou alors il faut prendre en compte les deux cas de figure

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Discussion Some questions or discussions are opened and wait answers of author or other people to be processed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants