This question has been flagged
2 Replies
17024 Views

I have used open erp 7.0. I want discount and tax are added with sale order.

For eg:Product with price=3390 and discount=10%,tax=1.86 I need the calculation as follows, initial price 3390 after 10% discount=3051 Then the tax 1.86 will reduced from the unit price only ,initial price 3390 after 1.86 tax=63.05(for the product with3390 price_unit) Total of sale order =3051+63.05=3114.05.But I cannot this calculation .Pls help me ?

Avatar
Discard
Best Answer

Based on your requirement the below steps to follow:-

1) Openerp Menu Configuration --> Sales screen Enable the check box "Allow setting a discount on the sales order lines"

2) Openerp Menu Accounting --> Configuration --> Taxes Screen add new tax with below details Tax Type Percentage 0.01860

3) In the Sale Order default code

   def _amount_line_tax(self, cr, uid, line, context=None):
        val = 0.0
        for c in self.pool.get('account.tax').compute_all(cr, uid, line.tax_id, line.price_unit * (1-(line.discount or 0.0)/100.0), line.product_uom_qty, line.product_id, line.order_id.partner_id)['taxes']:
            val += c.get('amount', 0.0)
        return val

The above code override in custom module as below

   def _amount_line_tax(self, cr, uid, line, context=None):
        val = 0.0
        for c in self.pool.get('account.tax').compute_all(cr, uid, line.tax_id, line.price_unit,  line.product_uom_qty, line.product_id, line.order_id.partner_id)['taxes']:
            val += c.get('amount', 0.0)
        return val

After that create sale order the excepted output will be shown

Avatar
Discard
Author

this code working properly in sale order only. But i want this same function in Account..if any solution to find this?

Best Answer

Hi Rakhi,

I have gone through the same issue. However I found the way in Tax configuration.

Please follow the steps to configure the tax in exclusive:

Accounting -> Configuration -> Accounts -> Template -> Taxes -> Tax Template, from the list open your tax template; now you can see the tab "Tax Definition"; under the tab there is a check box called "Include in base amount"; tick that check box and save it.

Now go to Accounting -> Configuration -> Taxes -> Taxes,  open the tax form which you configured for the company; there you can see "Tax Definition"; and the same field ""Include in base amount" at the right site you can see; just tick that check box and save it.

Here you go...

Now create the invoice with discount;  your tax will be caculated based on your base amount.

Thanks

Avatar
Discard