diff --git a/addons/account/invoice.py b/addons/account/invoice.py index 2e5550325b7..de343eedfd1 100644 --- a/addons/account/invoice.py +++ b/addons/account/invoice.py @@ -483,13 +483,9 @@ class account_invoice(osv.osv): cur_obj = self.pool.get('res.currency') for inv in self.browse(cr, uid, ids): - if not inv.tax_line: - self.button_compute(cr, uid, [inv.id], context={}, set_total=False) if inv.move_id: continue - if inv.type in ('in_invoice', 'in_refund') and abs(inv.check_total - inv.amount_total) >= (inv.currency_id.rounding/2.0): - raise osv.except_osv(_('Bad total !'), _('Please verify the price of the invoice !\nThe real total does not match the computed total.')) if not inv.date_invoice: self.write(cr, uid, [inv.id], {'date_invoice':time.strftime('%Y-%m-%d')}) company_currency = inv.company_id.currency_id.id @@ -519,6 +515,9 @@ class account_invoice(osv.osv): if not key in tax_key: raise osv.except_osv(_('Warning !'), _('Taxes missing !')) + if inv.type in ('in_invoice', 'in_refund') and abs(inv.check_total - inv.amount_total) >= (inv.currency_id.rounding/2.0): + raise osv.except_osv(_('Bad total !'), _('Please verify the price of the invoice !\nThe real total does not match the computed total.')) + # one move line per tax line iml += ait_obj.move_line_get(cr, uid, inv.id) @@ -986,7 +985,7 @@ class account_invoice_line(osv.osv): taxes = res.taxes_id and res.taxes_id or (a and self.pool.get('account.account').browse(cr, uid,a).tax_ids or False) tax_id = self.pool.get('account.fiscal.position').map_tax(cr, uid, fpos, taxes) else: - taxes = res.taxes_id and res.taxes_id or (a and self.pool.get('account.account').browse(cr, uid,a).tax_ids or False) + taxes = res.supplier_taxes_id and res.supplier_taxes_id or (a and self.pool.get('account.account').browse(cr, uid,a).tax_ids or False) tax_id = self.pool.get('account.fiscal.position').map_tax(cr, uid, fpos, taxes) if type in ('in_invoice', 'in_refund'): to_update = self.product_id_change_unit_price_inv(cr, uid, tax_id, price_unit, qty, address_invoice_id, product, partner_id, context=context) diff --git a/addons/account/project/report/analytic_balance.rml b/addons/account/project/report/analytic_balance.rml index 0d1c7d53ad1..598937b29aa 100644 --- a/addons/account/project/report/analytic_balance.rml +++ b/addons/account/project/report/analytic_balance.rml @@ -128,16 +128,16 @@ - [[ sum_debit(objects,data['form']['date1'],data['form']['date2']) or '0.0' ]] + [[ formatLang(sum_debit(objects,data['form']['date1'],data['form']['date2'])) ]] - [[ sum_credit(objects,data['form']['date1'],data['form']['date2']) or '0.0' ]] + [[ formatLang(sum_credit(objects,data['form']['date1'],data['form']['date2'])) ]] - [[ sum_balance(objects,data['form']['date1'],data['form']['date2']) or '0.0' ]] + [[ formatLang(sum_balance(objects,data['form']['date1'],data['form']['date2'])) ]] - [[ sum_quantity(objects,data['form']['date1'],data['form']['date2']) or '0.0' ]] + [[ formatLang(sum_quantity(objects,data['form']['date1'],data['form']['date2'])) ]] @@ -153,16 +153,16 @@ [[ o.complete_name ]] - [[ move_sum_debit(o.id,data['form']['date1'],data['form']['date2']) or '0.0' ]] + [[ formatLang(move_sum_debit(o.id,data['form']['date1'],data['form']['date2'])) ]] - [[ move_sum_credit(o.id,data['form']['date1'],data['form']['date2']) or '0.0' ]] + [[ formatLang(move_sum_credit(o.id,data['form']['date1'],data['form']['date2'])) ]] - [[ move_sum_balance(o.id,data['form']['date1'],data['form']['date2']) or '0.0' ]] + [[ formatLang(move_sum_balance(o.id,data['form']['date1'],data['form']['date2'])) ]] - [[ move_sum_quantity(o.id,data['form']['date1'],data['form']['date2']) or '0.0']] + [[ formatLang(move_sum_quantity(o.id,data['form']['date1'],data['form']['date2'])) ]] @@ -174,16 +174,16 @@ [[ move_g['name'] ]] - [[ move_g['debit'] or '0.0']] + [[ formatLang(move_g['debit'])]] - [[ move_g['credit'] or '0.0']] + [[ formatLang(move_g['credit']) ]] - [[ move_g['balance'] or '0.0']] + [[ formatLang(move_g['balance'])]] - [[ (move_g['quantity'] or '0.0') ]] + [[ formatLang(move_g['quantity']) ]] diff --git a/addons/account/project/report/analytic_check.rml b/addons/account/project/report/analytic_check.rml index 0bbc727e9f6..d38ac43adc8 100644 --- a/addons/account/project/report/analytic_check.rml +++ b/addons/account/project/report/analytic_check.rml @@ -141,22 +141,22 @@ - [[ '%.2f' % general_debit(data['form']['date1'],data['form']['date2']) ]] + [[ formatLang( general_debit(data['form']['date1'],data['form']['date2'])) ]] - [[ '%.2f' % general_credit(data['form']['date1'],data['form']['date2']) ]] + [[ formatLang( general_credit(data['form']['date1'],data['form']['date2'])) ]] - [[ '%.2f' % analytic_debit(data['form']['date1'],data['form']['date2']) ]] + [[ formatLang( analytic_debit(data['form']['date1'],data['form']['date2'])) ]] - [[ '%.2f' % analytic_credit(data['form']['date1'],data['form']['date2']) ]] + [[ formatLang( analytic_credit(data['form']['date1'],data['form']['date2'])) ]] - [[ '%.2f' % delta_debit(data['form']['date1'],data['form']['date2']) ]] + [[ formatLang( delta_debit(data['form']['date1'],data['form']['date2'])) ]] - [[ '%.2f' % delta_credit(data['form']['date1'],data['form']['date2']) ]] + [[ formatLang( delta_credit(data['form']['date1'],data['form']['date2'])) ]] @@ -167,22 +167,22 @@ [[ acc['name'] ]] - [[ '%.2f' % acc['gen_debit'] ]] + [[ formatLang( acc['gen_debit']) ]] - [[ '%.2f' % acc['gen_credit'] ]] + [[ formatLang( acc['gen_credit']) ]] - [[ '%.2f' % acc['ana_debit'] ]] + [[ formatLang( acc['ana_debit']) ]] - [[ '%.2f' % acc['ana_credit'] ]] + [[ formatLang( acc['ana_credit']) ]] - [[ '%.2f' % acc['delta_debit'] ]] + [[ formatLang( acc['delta_debit']) ]] - [[ '%.2f' % acc['delta_credit'] ]] + [[ formatLang( acc['delta_credit']) ]] diff --git a/addons/account/project/report/analytic_journal.rml b/addons/account/project/report/analytic_journal.rml index d7e9f391114..96383420a1f 100644 --- a/addons/account/project/report/analytic_journal.rml +++ b/addons/account/project/report/analytic_journal.rml @@ -83,8 +83,8 @@ [[ o.code ]] - [[ o.name ]] - [[ '%.2f' % sum_general(o.id,data['form']['date1'],data['form']['date2']) ]] - [[ '%.2f' % sum_analytic(o.id,data['form']['date1'],data['form']['date2']) ]] + [[ formatLang(sum_general(o.id,data['form']['date1'],data['form']['date2'])) ]] + [[ formatLang(sum_analytic(o.id,data['form']['date1'],data['form']['date2'])) ]] @@ -99,7 +99,7 @@ [[ move.name ]] [[ move.account_id.code ]] - [[ move.account_id.name ]] - [[ '%.2f' % (move.debit-move.credit) ]] + [[ formatLang(move.debit-move.credit) ]] @@ -108,13 +108,13 @@ [[ repeatIn(lines_a(move.id,o.id,data['form']['date1'],data['form']['date2']),'move_a') ]] - [[ move_a.date ]] + [[ formatLang(move_a.date,date = True) ]] [[ move_a.code ]] [[ move_a.name ]] [[ move_a.account_id.code ]] - [[ move_a.account_id.name ]] - [[ '%.2f' % move_a.amount ]] + [[ formatLang( move_a.amount) ]] @@ -124,12 +124,12 @@ [[ repeatIn(lines_a(False,o.id,data['form']['date1'],data['form']['date2']),'move_a') ]] - [[ move_a.date ]] + [[ formatLang(move_a.date,date = True) ]] [[ move_a.code ]] [[ move_a.name ]] [[move_a.account_id.code ]] - [[ move_a.account_id.name ]] - [[ '%.2f' % move_a.amount ]] + [[ formatLang( move_a.amount) ]] diff --git a/addons/account/project/report/quantity_cost_ledger.rml b/addons/account/project/report/quantity_cost_ledger.rml index 42fb7330a07..5c7e9331078 100644 --- a/addons/account/project/report/quantity_cost_ledger.rml +++ b/addons/account/project/report/quantity_cost_ledger.rml @@ -3,30 +3,6 @@ @@ -69,7 +45,10 @@ - + + + + @@ -78,29 +57,28 @@ - - - + + + + - - + + - - @@ -114,13 +92,13 @@ - + - - + + @@ -132,30 +110,30 @@ - - - - - - + + + + - + @@ -181,13 +159,13 @@ - [[ data['form']['date1'] ]] + [[ formatLang(data['form']['date1'],date = True) ]] - [[ data['form']['date2'] ]] + [[ formatLang(data['form']['date2'],date = True) ]] - [[ time.strftime('%Y-%m-%d') ]] at [[ time.strftime('%H:%M:%S') ]] + [[ formatLang(time.strftime('%Y-%m-%d %H:%M:%S'),date_time = True) ]] @@ -197,11 +175,10 @@ -
- + - Code/Date + Code/Date J.C./Move name @@ -213,92 +190,105 @@ Total - - - - - - - Total: - - - - - - [[ '%.2f' % (sum_quantity(objects,data['form']['date1'],data['form']['date2'], data['form']['journal']) or 0.0) ]] - - - - - - + + + + + - - [[ repeatIn(objects,'o') ]] - - - - [[ o.code ]] - - - [[ o.complete_name ]] - - - Max.qty:[[ '%.2f' % (o.quantity_max or 0.0)]] - - - [[ '%.2f' % (account_sum_quantity(o.id,data['form']['date1'],data['form']['date2'], data['form']['journal']) or 0.0 )]] - - - - - - [[ repeatIn(lines_g(o.id,data['form']['date1'],data['form']['date2'],data['form']['journal']),'move_g') ]] - - - - [[ move_g['code'] ]] - - - [[ move_g['name'] ]] - - - - - - - - [[ '%.2f' % (move_g['quantity'] or 0.0) ]] - - - - - - - - - [[ repeatIn(lines_a(move_g['id'],o.id,data['form']['date1'],data['form']['date2'],data['form']['journal']),'move_a') ]][[ move_a['date'] ]] - - - [[ move_a['cj'] ]] / [[ move_a['name'] ]] - - - [[ '%.2f' % (move_a['quantity'] or 0.0 )]] - - - - - - - - - - - - - - - + + Total: + + + + + + + + + + + + + [[ formatLang (sum_quantity(objects,data['form']['date1'],data['form']['date2'], data['form']['journal']) ) ]] + + + + + + +
+ [[ repeatIn(objects,'o') ]] + + + + + + + [[ o.code ]] + + + [[ o.complete_name ]] + + + Max Qty: [[ formatLang (o.quantity_max )]] + + + [[ formatLang (account_sum_quantity(o.id,data['form']['date1'],data['form']['date2'], data['form']['journal']) )]] + + + + + + +
+ [[ repeatIn(lines_g(o.id,data['form']['date1'],data['form']['date2'],data['form']['journal']),'move_g') ]] + + + + + + + [[ move_g['code'] ]] + + + [[ move_g['name'] ]] + + + [[ formatLang (move_g['quantity']) ]] + + + + + + + [[ repeatIn(lines_a(move_g['id'],o.id,data['form']['date1'],data['form']['date2'],data['form']['journal']),'move_a') ]] + [[ formatLang(move_a['date'],date = True) ]] + + + [[ move_a['cj'] ]] + + + [[ move_a['name'] ]] + + + [[ formatLang (move_a['quantity'] )]] + + + + + + +
+ + + + + +
+ + + diff --git a/addons/account/report/invoice.rml b/addons/account/report/invoice.rml index 2d3ec597087..62df090ed59 100644 --- a/addons/account/report/invoice.rml +++ b/addons/account/report/invoice.rml @@ -258,8 +258,8 @@ Invoice [[ ((o.type == 'out_invoice' and (o.state == 'open' or o.state == 'paid')) or removeParentNode('para')) and '' ]] [[ o.number ]] - PRO-FORMA [[ ((o.type == 'out_invoice' and o.state == 'proforma') or removeParentNode('para')) and '' ]] - PRO-FORMA [[ ((o.type == 'out_invoice' and o.state == 'draft') or removeParentNode('para')) and '' ]] + PRO-FORMA [[ ((o.type == 'out_invoice' and o.state == 'proforma2') or removeParentNode('para')) and '' ]] + Draft [[ ((o.type == 'out_invoice' and o.state == 'draft') or removeParentNode('para')) and '' ]] Canceled Invoice [[ ((o.type == 'out_invoice' and o.state == 'cancel') or removeParentNode('para')) and '' ]] Refund [[ (o.type=='out_refund' or removeParentNode('para')) and '' ]] [[ o.number ]] Supplier Refund [[ (o.type=='in_refund' or removeParentNode('para')) and '' ]] [[ o.number ]] @@ -560,4 +560,4 @@ - \ No newline at end of file + diff --git a/addons/account/wizard/wizard_account_balance_report.py b/addons/account/wizard/wizard_account_balance_report.py index ab03f87bb98..232d2a80475 100644 --- a/addons/account/wizard/wizard_account_balance_report.py +++ b/addons/account/wizard/wizard_account_balance_report.py @@ -35,17 +35,17 @@ period_form = ''' - - - - + + + + + + + + + + - - - - - - ''' period_fields = { diff --git a/addons/account/wizard/wizard_general_ledger_report.py b/addons/account/wizard/wizard_general_ledger_report.py index 84ee61a7005..841f5c8d893 100644 --- a/addons/account/wizard/wizard_general_ledger_report.py +++ b/addons/account/wizard/wizard_general_ledger_report.py @@ -51,15 +51,16 @@ period_form = ''' - - - - - - - - - + + + + + + + + + +