Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
7 Odpovědi
5523 Zobrazení

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
Zrušit
Autor Nejlepší odpověď
  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
Zrušit

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

Autor

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

Thanks a lot ! Very useful :)

Nejlepší odpověď

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
Zrušit
Autor

Thanks for your input!

Nejlepší odpověď

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
Zrušit
Nejlepší odpověď

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

Avatar
Zrušit
Nejlepší odpověď

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
Zrušit
Nejlepší odpověď

@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
Zrušit

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

Nejlepší odpověď

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
Zrušit
Autor

Hello Roberto,

We would be happy to hear your solution to this!

Related Posts Odpovědi Zobrazení Aktivita
0
srp 25
672
2
srp 25
884
3
čvc 25
3440
1
čvn 25
1648
5
čvn 25
17643