コンテンツへスキップ
メニュー
この質問にフラグが付けられました
7 返信
5580 ビュー

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.


アバター
破棄
著作者 最善の回答
  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.
     

アバター
破棄

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

著作者

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

Thanks a lot ! Very useful :)

最善の回答

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.

アバター
破棄
著作者

Thanks for your input!

最善の回答

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


アバター
破棄
最善の回答

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

アバター
破棄
最善の回答

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'"

アバター
破棄
最善の回答

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

アバター
破棄

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

最善の回答

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. 

アバター
破棄
著作者

Hello Roberto,

We would be happy to hear your solution to this!

関連投稿 返信 ビュー 活動
1
8月 25
317
0
8月 25
734
2
8月 25
957
3
7月 25
3497
1
6月 25
1674