Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
7 Antwoorden
5508 Weergaven

Taxes on margins are mainly used when reselling used products in second hand stores for example. This can easily be done by creating a new tax as shown below. 


NB: For the sake of simplicity, I will not adapt the tax grid, nor adapt the accounts.


Avatar
Annuleer
Auteur Beste antwoord
  1. Make sure the cost amount has been defined on the product


  2. Go to Accounting > Configuration > Taxes and create a new tax. You can duplicate an existing one or create one from scratch.

  3. Select the tax computation as Python code, and define the computation at the bottom of the configuration screen.
    1. Adapt the percentage value to the tax amount you would need. Ex. For a 7% tax rate, use result = (price_unit - product.standard_price) * 0.07

  4. When creating a Sales Order, you will see that the 21% tax is not computed based on the sales price, but on the 100€ margin I made on this item.
     

Avatar
Annuleer

Hello, i am interested by your answer.
Unfortunately the image are not visible, could you reload them ?
Thanks !!

Auteur

Hello Rayane, I just uploaded new screenshots. Hope this helps!

Thanks a lot ! Very useful :)

Beste antwoord

Very useful post @kha, thanks! By the way, it is required to have installed module "account_tax_python" to be able to find the Phyton Code option as a tax computation.

Avatar
Annuleer
Auteur

Thanks for your input!

Beste antwoord

Hello Kevin. 

Thank you for your contribution. I wanted to add some more information on that atter

  1. Do not forget to add "* quantity" at the end of the expression so that it applies to sales with more than one item sold. See below
  2. Furthermore, there are two possibilities : Tax included prices and tax excluded prices.


Here are the expression for the two : 

Tax excluded prices

  • result = (price_unit - product.standard_price) * 0.21 * quantity

Tax included prices

  • result = ((price_unit - standard_price) -((price_unit - standard_price) / 1.21)) * quantity
  • In this case, you would need to check the box "included in price" in the "advanced options" tab of the tax


Avatar
Annuleer
Beste antwoord

Why don't I have "python code" when I open the drop-down menu ? 

Avatar
Annuleer
Beste antwoord

Hey, It s working well on V16 but on the V17 i have this message ovr and over again: "Erreur : : "name 'standard_price' is not defined" while evaluating

'result = (price_unit - product.standard_price)*0.21'"

Avatar
Annuleer
Beste antwoord

@juba, it's not working "Erreur : <class 'NameError'>: "name 'standard_price' is not defined" while evaluating
'result = (price_unit - standard_price)*0.085*quantity'"

Avatar
Annuleer

Hello Rayanne,

you can try using the right field name: (price_unit - product.standard_price). In his formula JUBA likely forgot the "product" attribute before the field

Beste antwoord

Hello, 

Your salution is based on a "fixed cost", it is not real. The same item can be bought at 1$, and at 2$ from another provider or at any other time ( prices go up and down ). 

To implement a real taxes on margin you have to make use of serial numbers, and identify every item as unique, with a unique serial number, cost and sale price. 

This is much more complex than this. 

Avatar
Annuleer
Auteur

Hello Roberto,

We would be happy to hear your solution to this!

Gerelateerde posts Antwoorden Weergaven Activiteit
0
aug. 25
664
2
aug. 25
871
3
jul. 25
3434
1
jun. 25
1646
5
jun. 25
17606