Se rendre au contenu
Menu
Cette question a été signalée
7 Réponses
5576 Vues

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
Ignorer
Auteur Meilleure réponse
  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
Ignorer

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 :)

Meilleure réponse

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
Ignorer
Auteur

Thanks for your input!

Meilleure réponse

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
Ignorer
Meilleure réponse

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

Avatar
Ignorer
Meilleure réponse

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
Ignorer
Meilleure réponse

@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
Ignorer

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

Meilleure réponse

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
Ignorer
Auteur

Hello Roberto,

We would be happy to hear your solution to this!

Publications associées Réponses Vues Activité
1
août 25
301
0
août 25
727
2
août 25
947
3
juil. 25
3488
1
juin 25
1673