Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
7 Risposte
5568 Visualizzazioni

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
Abbandona
Autore Risposta migliore
  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
Abbandona

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

Autore

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

Thanks a lot ! Very useful :)

Risposta migliore

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
Abbandona
Autore

Thanks for your input!

Risposta migliore

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
Abbandona
Risposta migliore

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

Avatar
Abbandona
Risposta migliore

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
Abbandona
Risposta migliore

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

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

Risposta migliore

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
Abbandona
Autore

Hello Roberto,

We would be happy to hear your solution to this!

Post correlati Risposte Visualizzazioni Attività
1
ago 25
282
0
ago 25
723
2
ago 25
939
3
lug 25
3480
1
giu 25
1670