This question has been flagged
1 Reply
4758 Views

Hi,

I've done one invoice with several products and different taxes. When printing the invoice I was expecting to see a table with all taxes that I used and the value to witch tax, But I've this: image description So, in the table just appear the IVA23 and the other taxes are ignored.

I open the report with OpenOffice and I saw the cicle for the table of taxes but in the pdf just appear one.

In report:

Tax [[ o.tax_line==[] and removeParentNode('blockTable') ]]
Base 
Amount 

[[ repeatIn(o.tax_line,'t') ]]
[[ t.name ]] 
[[ formatLang(t.base, digits=get_digits(dp='Account'))   ]] [[ o.currency_id.symbol ]]
[[  (t.tax_code_id and t.tax_code_id.notprintable) and removeParentNode('blockTable') or '' ]] [[ formatLang(t.amount, digits=get_digits(dp='Account'))   ]] [[ o.currency_id.symbol ]]

Thanks

Avatar
Discard

I have the same problem, did you find any solution?

Author Best Answer

Hi,

I solve this a long time ago, and I forget to put the solution here. I look for the code that fixes the bug and by the comments, I think is this:

class account_invoice(osv.osv):
    _inherit = "account.invoice"    

   def check_tax_lines(self, cr, uid, inv, compute_taxes, ait_obj):
        if not inv.tax_line:
            for tax in compute_taxes.values():
                ait_obj.create(cr, uid, tax)
        else:
            tax_key = []
            for tax in inv.tax_line:
                if tax.manual:
                    continue
                #IDI
                #key = (tax.tax_code_id.id, tax.base_code_id.id, tax.account_id.id, tax.account_analytic_id.id)
                key = (tax.name, tax.vi_tax_id.id, tax.tax_code_id.id, tax.base_code_id.id, tax.account_id.id, tax.account_analytic_id.id)
                tax_key.append(key)
                if not key in compute_taxes:
                    raise osv.except_osv(_('Warning!'), _('Global taxes defined, but they are not in invoice lines !'))
                base = compute_taxes[key]['base']
                if abs(base - tax.base) > inv.company_id.currency_id.rounding:
                    raise osv.except_osv(_('Warning!'), _('Tax base different!\nClick on compute to update the tax base.'))
            for key in compute_taxes:
                if not key in tax_key:
                    raise osv.except_osv(_('Warning!'), _('Taxes are missing!\nClick on compute button.'))
account_invoice()

I think that is just this. Good luck. =)

Avatar
Discard

I've update the code put nothing happend. The RML file need to be modified in someway too? Stop-Start server and compile the file too.