From 9c806c8d58c33356c2a2009569871b585a2ae0e8 Mon Sep 17 00:00:00 2001 From: "VRA(OpenERP)" <> Date: Wed, 18 Nov 2009 12:49:26 +0530 Subject: [PATCH] [FIX] Account_invoice_layout : Reports improved and SXWs made compatible to RML bzr revid: jvo@tinyerp.com-20091118071926-mbvsj1mniomge7ho --- .../report/report_account_invoice_layout.rml | 784 +++++++++++------ .../report/special_message_invoice.py | 14 +- .../report/special_message_invoice.rml | 806 ++++++++++++------ 3 files changed, 1067 insertions(+), 537 deletions(-) diff --git a/addons/account_invoice_layout/report/report_account_invoice_layout.rml b/addons/account_invoice_layout/report/report_account_invoice_layout.rml index 74d33a8e5ec..e8f1cee42f3 100644 --- a/addons/account_invoice_layout/report/report_account_invoice_layout.rml +++ b/addons/account_invoice_layout/report/report_account_invoice_layout.rml @@ -1,263 +1,525 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -[[ repeatIn(objects,'o') ]] -[[ setLang(o.partner_id.lang) ]] - - - - - [[ o.partner_id.title or '' ]] [[ o.partner_id.name ]] - [[ o.address_invoice_id.title or '' ]] [[ o.address_invoice_id.name ]] - [[ o.address_invoice_id.street ]] - [[ o.address_invoice_id.street2 or '' ]] - [[ o.address_invoice_id.zip or '' ]] [[ o.address_invoice_id.city or '' ]] - [[ o.address_invoice_id.state_id and o.address_invoice_id.state_id.name or '' ]] - [[ o.address_invoice_id.country_id and o.address_invoice_id.country_id.name or '' ]] - - Tel. : [[ o.address_invoice_id.phone or removeParentNode('para') ]] - Fax : [[ o.address_invoice_id.fax or removeParentNode('para') ]] - VAT : [[ o.partner_id.vat or removeParentNode('para') ]] - - - - - - -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 '' ]] -Draft Invoice [[ ((o.type == 'out_invoice' and o.state == 'draft') or removeParentNode('para')) and '' ]] -Cancelled 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 ]] -Supplier Invoice [[ (o.type=='in_invoice' or removeParentNode('para')) and '' ]][[ o.number ]] - - - -Document:[[ o.name ]] - -Invoice Date: [[ formatLang(o.date_invoice,date=True) ]] -Customer Ref:[[ o.address_invoice_id.partner_id.ref or '/' ]] - - - - - -Description / Taxes -Quantity -Unit Price -Disc. (%) -Price - - -
- [[ repeatIn(invoice_lines(o), 'a') ]] - - - [[ a['type']=='text' and removeParentNode('blockTable')]] - [[ (a['type']=='title' or a['type']=='subtotal') and ( setTag('para','para',{'fontName':'Helvetica-bold'})) ]][[ a['name'] ]] / ( [[ a['tax_types'] ]] ) - [[ a['type']=='subtotal' and ( setTag('para','para',{'fontName':'Helvetica-bold'})) ]][[ a['quantity'] ]] - [[ a['uos'] ]] - [[ a['type']=='subtotal' and ( setTag('para','para',{'fontName':'Helvetica-bold'})) ]][[ a['price_unit'] ]] - [[ a['type']=='subtotal' and ( setTag('para','para',{'fontName':'Helvetica-bold'})) ]][[ a['discount'] ]] - [[ a['type']=='subtotal' and ( setTag('para','para',{'fontName':'Helvetica-bold'})) ]][[ a['price_subtotal'] ]] [[ a['currency'] ]] - - - - Note : [[ format(a['note']) or removeParentNode('tr') ]] - - - - - - - - - - [[ a['type']=='text' and format(a['name']) or removeParentNode('blockTable') ]] - [[ a['type']=='text' and '' ]] - - - [[ a['type']!='break' and removeParentNode('pageBreak')]] - - - Description/Taxes [[ a['type']!='break' and removeParentNode('blockTable')]] - Quantity - Unit Price - Disc. (%) - Price - - -
- - - - - - - - - - - - - - - - - - - - Total (Excl. taxes): - [[ '%.2f' % o.amount_untaxed ]] [[o.currency_id.code ]] - - - Taxes: - [[ '%.2f' % o.amount_tax ]] [[o.currency_id.code ]] - - - Total (Incl. taxes): - [[ '%.2f' % o.amount_total ]] [[o.currency_id.code ]] - - - - - - - - - - - Tax - Base - Amount - - - [[ repeatIn(o.tax_line,'t') ]][[ t.name ]] - [[ '%.2f' % t.base ]] - [[ '%.2f' % t.amount]] - - - - - - - - - - - - - - - - - - - - - - -[[ format(o.comment) or removeParentNode('para') ]] -[[ format(o.payment_term and o.payment_term.note) or removeParentNode('para') ]] -
-
\ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [[ repeatIn(objects,'o') ]] + [[ setLang(o.partner_id.lang) ]] + + + + + + + + + [[ o.partner_id.title or '' ]] [[ o.partner_id.name ]] + [[ o.address_invoice_id.title or '' ]] [[ o.address_invoice_id.name ]] + [[ o.address_invoice_id.street ]] + [[ o.address_invoice_id.street2 or '' ]] + [[ o.address_invoice_id.zip or '' ]] [[ o.address_invoice_id.city or '' ]] + [[ o.address_invoice_id.state_id and o.address_invoice_id.state_id.name or '' ]] + [[ o.address_invoice_id.country_id and o.address_invoice_id.country_id.name or '' ]] + + + + Tel. : [[ o.address_invoice_id.phone or removeParentNode('para') ]] + Fax : [[ o.address_invoice_id.fax or removeParentNode('para') ]] + VAT : [[ o.partner_id.vat or removeParentNode('para') ]] + + + + + + + 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 == 'proforma2') or removeParentNode('para')) and '' ]] + Draft Invoice [[ ((o.type == 'out_invoice' and o.state == 'draft') or removeParentNode('para')) and '' ]] + Cancelled Invoice [[ ((o.type == 'out_invoice' and o.state == 'cancel') or removeParentNode('para')) and '' ]] [[ o.number ]] + Refund [[ (o.type=='out_refund' or removeParentNode('para')) and '' ]] [[ o.number ]] + Supplier Refund [[ (o.type=='in_refund' or removeParentNode('para')) and '' ]] [[ o.number ]] + Supplier Invoice [[ (o.type=='in_invoice' or removeParentNode('para')) and '' ]] [[ o.number ]] + + + + + + + + + + Document + + + Invoice Date + + + Partner Ref. + + + + + + + [[ o.name ]] + + + [[ formatLang(o.date_invoice,date=True) ]] + + + [[ o.address_invoice_id.partner_id.ref or '' ]] + + + + + + + + + + Description / Taxes + + + Quantity + + + Unit Price + + + Disc. (%) + + + Price + + + +
+ [[ repeatIn(invoice_lines(o), 'a') ]] + + + + [[ a['type']=='text' and removeParentNode('blockTable')]] + + + [[ (a['type']=='title' or a['type']=='subtotal') and ( setTag('para','para',{'fontName':'Helvetica-bold'})) ]][[ a['name'] ]] [[ a['type']=='article' and ('/ (' + a['tax_types'] + ')' ) ]] + + + [[ a['type']=='subtotal' and ( setTag('para','para',{'fontName':'Helvetica-bold'})) ]][[ a['quantity'] ]] + + + [[ a['uos'] ]] + + + [[ a['type']=='subtotal' and ( setTag('para','para',{'fontName':'Helvetica-bold'})) ]][[ a['price_unit'] ]] + + + [[ a['type']=='subtotal' and ( setTag('para','para',{'fontName':'Helvetica-bold'})) ]][[ a['discount'] ]] + + + [[ a['type']=='subtotal' and ( setTag('para','para',{'fontName':'Helvetica-bold'})) ]] [[ a['price_subtotal'] ]] + + + [[ a['currency'] ]] + + + + + + + + + + Note: [[ format(a['note']) or removeParentNode('tr') ]] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [[ a['type']=='text' and format(a['name']) or removeParentNode('blockTable') ]] + + + [[ a['type']=='text' and '' ]] + + + + [[ a['type']!='break' and removeParentNode('pageBreak')]] + + + + Description / Taxes [[ a['type']!='break' and removeParentNode('blockTable')]] + + + Quantity + + + Unit Price + + + Disc. (%) + + + Price + + + + +
+ + + + + + + + + + + + Net Total: + + + [[ formatLang(o.amount_untaxed) ]] + + + [[ o.currency_id.code ]] + + + + + + + + + + + + + + + Taxes: + + + [[ formatLang(o.amount_tax) ]] + + + [[ o.currency_id.code ]] + + + + + + + + + + + + + + + Total: + + + [[ formatLang(o.amount_total) ]] + + + [[ o.currency_id.code ]] + + + + + + + + + + + + + Tax + + + Base + + + Amount + + + + + + + + + + + +
+ [[ repeatIn(o.tax_line,'t') ]] + + + + [[ t.name ]] + + + [[ formatLang(t.base) ]] + + + [[ (t.tax_code_id and t.tax_code_id.notprintable) and removeParentNode('blockTable') or '' ]] [[ formatLang(t.amount) ]] + + + + + + + + + + + +
+ + + + + + + [[ format(o.comment or removeParentNode('blockTable')) ]] + + + + + + + + + + [[ format((o.payment_term and o.payment_term.note) or removeParentNode('blockTable')) ]] + + + + + + +
+ diff --git a/addons/account_invoice_layout/report/special_message_invoice.py b/addons/account_invoice_layout/report/special_message_invoice.py index 94dff32a54e..e814461ae44 100644 --- a/addons/account_invoice_layout/report/special_message_invoice.py +++ b/addons/account_invoice_layout/report/special_message_invoice.py @@ -132,14 +132,14 @@ class account_invoice_with_message(report_sxw.rml_parse): res['price_subtotal']='' res['currency']='' elif entry.state=='line': - res['quantity']='___________________' - res['price_unit']='______________________' - res['discount']='____________________________________' - res['tax_types']='_____________________' + res['quantity']='_______________' + res['price_unit']='______________' + res['discount']='____________' + res['tax_types']='____________________' res['uos']='_____' - res['name']='______________________________________' - res['price_subtotal']='___________' - res['currency']='_' + res['name']='_______________________________________________' + res['price_subtotal']='____________' + res['currency']='____' elif entry.state=='break': res['type']=entry.state res['name']=entry.name diff --git a/addons/account_invoice_layout/report/special_message_invoice.rml b/addons/account_invoice_layout/report/special_message_invoice.rml index b227ee0c3d0..133fffe5c0f 100644 --- a/addons/account_invoice_layout/report/special_message_invoice.rml +++ b/addons/account_invoice_layout/report/special_message_invoice.rml @@ -1,272 +1,540 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -[[ repeatIn(objects,'o') ]] -[[ setLang(o.partner_id.lang) ]] - - - - - [[ o.partner_id.title or '' ]] [[ o.partner_id.name ]] - [[ o.address_invoice_id.title or '' ]] [[ o.address_invoice_id.name ]] - [[ o.address_invoice_id.street ]] - [[ o.address_invoice_id.street2 or '' ]] - [[ o.address_invoice_id.zip or '' ]] [[ o.address_invoice_id.city or '' ]] - [[ o.address_invoice_id.state_id and o.address_invoice_id.state_id.name or '' ]] - [[ o.address_invoice_id.country_id and o.address_invoice_id.country_id.name or '' ]] - - - - Tel. : [[ o.address_invoice_id.phone or removeParentNode('para') ]] - Fax : [[ o.address_invoice_id.fax or removeParentNode('para') ]] - VAT : [[ o.partner_id.vat or removeParentNode('para') ]] - - - - - - -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 '' ]] -Draft Invoice [[ ((o.type == 'out_invoice' and o.state == 'draft') or removeParentNode('para')) and '' ]] -Cancelled Invoice [[ ((o.type == 'out_invoice' and o.state == 'cancel') or removeParentNode('para')) and '' ]] [[ o.number ]] -Refund [[ (o.type=='out_refund' or removeParentNode('para')) and '' ]] [[ o.number ]] -Supplier Refund [[ (o.type=='in_refund' or removeParentNode('para')) and '' ]] [[ o.number ]] -Supplier Invoice [[ (o.type=='in_invoice' or removeParentNode('para')) and '' ]][[ o.number ]] - - - -Document:[[o.name]] - -Invoice Date: [[ formatLang(o.date_invoice,date=True) ]] -Customer Ref: [[ o.address_invoice_id.partner_id.ref or '/' ]] - - - -Description / Taxes -Quantity -Unit Price -Disc. (%) -Price - - -
- [[ repeatIn(invoice_lines(o), 'a') ]] - - - [[ a['type']=='text' and removeParentNode('blockTable')]] - [[ (a['type']=='title' or a['type']=='subtotal') and ( setTag('para','para',{'fontName':'Helvetica-bold'})) ]][[ a['name'] ]] / ( [[ a['tax_types'] ]] ) - [[ a['type']=='subtotal' and ( setTag('para','para',{'fontName':'Helvetica-bold'})) ]][[ a['quantity'] ]] - [[ a['uos'] ]] - [[ a['type']=='subtotal' and ( setTag('para','para',{'fontName':'Helvetica-bold'})) ]][[ a['price_unit'] ]] - [[ a['type']=='subtotal' and ( setTag('para','para',{'fontName':'Helvetica-bold'})) ]][[ a['discount'] ]] - [[ a['type']=='subtotal' and ( setTag('para','para',{'fontName':'Helvetica-bold'})) ]][[ a['price_subtotal'] ]] [[ a['currency'] ]] - - - - Note : [[ format(a['note']) or removeParentNode('tr') ]] - - - - - - - - - - [[ a['type']=='text' and format(a['name']) or removeParentNode('blockTable') ]] - [[ a['type']=='text' and '' ]] - - - [[ a['type']!='break' and removeParentNode('pageBreak')]] - - - Description/Taxes [[ a['type']!='break' and removeParentNode('blockTable')]] - Quantity - Unit Price - Disc. (%) - Price - - -
- - - - - - - - - - - - - - - - - - - - Total (Excl. taxes): - [[ '%.2f' % o.amount_untaxed ]] [[o.currency_id.code ]] - - - Taxes: - [[ '%.2f' % o.amount_tax ]] [[o.currency_id.code ]] - - - Total (Incl. taxes): - [[ '%.2f' % o.amount_total ]] [[o.currency_id.code ]] - - - - - - - - - - - Tax - Base - Amount - - - [[ repeatIn(o.tax_line,'t') ]][[ t.name ]] - [[ '%.2f' % t.base ]] - [[ '%.2f' % t.amount]] - - - - - - - - - - - - - - - - - - - - - - -[[ format(o.comment) or removeParentNode('para') ]] -[[ format(o.payment_term and o.payment_term.note) or removeParentNode('para') ]] - - - -
-[[ repeatIn((spcl_msg(data['form']) and spcl_msg(data['form']).splitlines()) or [], 'note') ]] -[[ format(note) or removeParentNode('para') ]] -
-
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [[ repeatIn(objects,'o') ]] + [[ setLang(o.partner_id.lang) ]] + + + + + + + + + [[ o.partner_id.title or '' ]] [[ o.partner_id.name ]] + [[ o.address_invoice_id.title or '' ]] [[ o.address_invoice_id.name ]] + [[ o.address_invoice_id.street ]] + [[ o.address_invoice_id.street2 or '' ]] + [[ o.address_invoice_id.zip or '' ]] [[ o.address_invoice_id.city or '' ]] + [[ o.address_invoice_id.state_id and o.address_invoice_id.state_id.name or '' ]] + [[ o.address_invoice_id.country_id and o.address_invoice_id.country_id.name or '' ]] + + + + Tel. : [[ o.address_invoice_id.phone or removeParentNode('para') ]] + Fax : [[ o.address_invoice_id.fax or removeParentNode('para') ]] + VAT : [[ o.partner_id.vat or removeParentNode('para') ]] + + + + + + + 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 == 'proforma2') or removeParentNode('para')) and '' ]] + Draft Invoice [[ ((o.type == 'out_invoice' and o.state == 'draft') or removeParentNode('para')) and '' ]] + Cancelled Invoice [[ ((o.type == 'out_invoice' and o.state == 'cancel') or removeParentNode('para')) and '' ]] [[ o.number ]] + Refund [[ (o.type=='out_refund' or removeParentNode('para')) and '' ]] [[ o.number ]] + Supplier Refund [[ (o.type=='in_refund' or removeParentNode('para')) and '' ]] [[ o.number ]] + Supplier Invoice [[ (o.type=='in_invoice' or removeParentNode('para')) and '' ]] [[ o.number ]] + + + + + + + + + + Document + + + Invoice Date + + + Partner Ref. + + + + + + + [[ o.name ]] + + + [[ formatLang(o.date_invoice,date=True) ]] + + + [[ o.address_invoice_id.partner_id.ref or '' ]] + + + + + + + + + + Description / Taxes + + + Quantity + + + Unit Price + + + Disc. (%) + + + Price + + + +
+ [[ repeatIn(invoice_lines(o), 'a') ]] + + + + [[ a['type']=='text' and removeParentNode('blockTable')]] + + + [[ (a['type']=='title' or a['type']=='subtotal') and ( setTag('para','para',{'fontName':'Helvetica-bold'})) ]][[ a['name'] ]] [[ a['type']=='article' and ('/ (' + a['tax_types'] +')' ) ]] + + + [[ a['type']=='subtotal' and ( setTag('para','para',{'fontName':'Helvetica-bold'})) ]][[ a['quantity'] ]] + + + [[ a['uos'] ]] + + + [[ a['type']=='subtotal' and ( setTag('para','para',{'fontName':'Helvetica-bold'})) ]][[ a['price_unit'] ]] + + + [[ a['type']=='subtotal' and ( setTag('para','para',{'fontName':'Helvetica-bold'})) ]][[ a['discount'] ]] + + + [[ a['type']=='subtotal' and ( setTag('para','para',{'fontName':'Helvetica-bold'})) ]] [[ a['price_subtotal'] ]] + + + [[ a['currency'] ]] + + + + + + + + + + Note: [[ format(a['note']) or removeParentNode('tr') ]] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [[ a['type']=='text' and format(a['name']) or removeParentNode('blockTable') ]] + + + [[ a['type']=='text' and '' ]] + + + + [[ a['type']!='break' and removeParentNode('pageBreak')]] + + + + Description / Taxes [[ a['type']!='break' and removeParentNode('blockTable')]] + + + Quantity + + + Unit Price + + + Disc. (%) + + + Price + + + + +
+ + + + + + + + + + + + Net Total: + + + [[ formatLang(o.amount_untaxed) ]] + + + [[ o.currency_id.code ]] + + + + + + + + + + + + + + + Taxes: + + + [[ formatLang(o.amount_tax) ]] + + + [[ o.currency_id.code ]] + + + + + + + + + + + + + + + Total: + + + [[ formatLang(o.amount_total) ]] + + + [[ o.currency_id.code ]] + + + + + + + + + + + + + Tax + + + Base + + + Amount + + + + + + + + + + + +
+ [[ repeatIn(o.tax_line,'t') ]] + + + + [[ t.name ]] + + + [[ formatLang(t.base) ]] + + + [[ (t.tax_code_id and t.tax_code_id.notprintable) and removeParentNode('blockTable') or '' ]] [[ formatLang(t.amount) ]] + + + + + + + + + + + +
+ + + + + + + [[ format(o.comment or removeParentNode('blockTable')) ]] + + + + + + + + + + [[ format((o.payment_term and o.payment_term.note) or removeParentNode('blockTable')) ]] + + + + + + + + + + [[ repeatIn((spcl_msg(data['form']) and spcl_msg(data['form']).splitlines()) or [], 'note') ]] + [[ note or removeParentNode('para') ]] + + + + + + +