Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

Advance Invoice per percentage - Have the tax included on both Invoice not only on the last one

By
Selverine
on 1/26/16, 9:42 AM 657 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

A little up for the hope :-).


Thank you!

Selverine
on 1/29/16, 5:58 AM
0
ludolac
On 6/15/16, 9:16 AM

Hi Selverine,


Same question and part of solution was here:

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



Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 1/26/16, 9:42 AM
Seen: 657 times
Last updated: 6/15/16, 9:16 AM