This question has been flagged
2 Replies
4109 Views

Hi everybody,


I am using the "percentage" mode to do my invoice from my sale order.

Right now I have this:

Sale order price withouth VAT = 1 000 euros. Tax = 210 euros. Total = 12100 euros

With percentage I have for my first Invoice:

Total: 6050 euros , Tax = 0 euros, Withouth VAT =6050  euros

The second Invoice

Total : 6050  euros, Tax = 1210 euros, Without VAT =4840


---QUESTION---


Is it possible to have the VAT not just on the last one but on the first one too?

So to have for both:

TOTAL: 6050 VAT = 1050, Without VAT = 5000


-----CODE--------

I suppose that for it I will have to modify the file sale_make_invoice_advance.py

I will have to change this line ( in order take the unit price without VAT) 

inv_amount = sale.amount_total * wizard.amount / 100

  by   

inv_amount_untaxed = sale.amount_untaxed* wizard.amount / 100

However how can I get the Tax? The code is bellow

if wizard.advance_payment_method == 'percentage':

inv_amount = sale.amount_total * wizard.amount / 100

if not res.get('name'):

res['name'] = _("Advance of %s %%") % (wizard.amount)

else:

inv_amount = wizard.amount

if not res.get('name'):

#TODO: should find a way to call formatLang() from rml_parse

symbol = sale.pricelist_id.currency_id.symbol

if sale.pricelist_id.currency_id.position == 'after':

res['name'] = _("Advance of %s %s") % (inv_amount, symbol)

else:

res['name'] = _("Advance of %s %s") % (symbol, inv_amount)

# determine taxes

if res.get('invoice_line_tax_id'):

res['invoice_line_tax_id'] = [(6, 0, res.get('invoice_line_tax_id'))]

else:

res['invoice_line_tax_id'] = False


Many thanks for your help and yuor time,


Selverine

Avatar
Discard

A little up for the hope :-).


Thank you!

Best Answer

Hi Selverine,


Same question and part of solution was here:

https://github.com/odoo/odoo/pull/6073/commits/2ba5e58b6fafa24ffffb233057824074f79f1515



Avatar
Discard