From dfb0f372ac081a40a438fb84e72c9bbd8f6d6125 Mon Sep 17 00:00:00 2001 From: Nicolas Bessi Date: Mon, 28 Apr 2014 10:43:19 +0200 Subject: [PATCH] [IMP] fees column in report and mail --- .../__openerp__.py | 5 +- .../report/credit_control_summary.html.mako | 246 ++++++++++++++++++ .../report/report.xml | 12 + 3 files changed, 261 insertions(+), 2 deletions(-) create mode 100644 account_credit_control_dunning_fees/report/credit_control_summary.html.mako create mode 100644 account_credit_control_dunning_fees/report/report.xml diff --git a/account_credit_control_dunning_fees/__openerp__.py b/account_credit_control_dunning_fees/__openerp__.py index 36ceb3944..ce82a897e 100644 --- a/account_credit_control_dunning_fees/__openerp__.py +++ b/account_credit_control_dunning_fees/__openerp__.py @@ -53,14 +53,15 @@ on the generated credit lines. Fees can be manually edited as long credit line is draft -To Come +Credit control Summary report includes a new fee columns. ------- Support of fees price list """, 'website': 'http://www.camptocamp.com', 'data': ['view/policy_view.xml', - 'view/line_view.xml'], + 'view/line_view.xml', + 'report/report.xml'], 'demo': [], 'test': [], 'installable': True, diff --git a/account_credit_control_dunning_fees/report/credit_control_summary.html.mako b/account_credit_control_dunning_fees/report/credit_control_summary.html.mako new file mode 100644 index 000000000..985a93403 --- /dev/null +++ b/account_credit_control_dunning_fees/report/credit_control_summary.html.mako @@ -0,0 +1,246 @@ +## -*- coding: utf-8 -*- + + + + + + + %for comm in objects : + <% setLang(comm.get_contact_address().lang) %> +
+ + <% + add = comm.get_contact_address() + %> + %if comm.partner_id.id == add.id: + + <% address_lines = comm.partner_id.contact_address.split("\n") %> + + %else: + + + <% address_lines = add.contact_address.split("\n")[1:] %> + %endif + %for part in address_lines: + %if part: + + %endif + %endfor +
${comm.partner_id.title and comm.partner_id.title.name or ''} ${comm.partner_id.name }
${comm.partner_id.name or ''}
${add.title and add.title.name or ''} ${add.name}
${part}
+
+
+
+
+ +
+
+
+
+
+ +

+ ${_('Reminder')}: ${comm.current_policy_level.name or '' } +

+ +

${_('Dear')},

+

${comm.current_policy_level.custom_text.replace('\n', '
')}

+ +
+
+

${_('Summary')}

+ + + + + + + + + + + +%for line in comm.credit_control_line_ids: + + %if line.invoice_id: + + %else: + + %endif + + + + + + + +%endfor +
${_('Invoice number')}${_('Invoice date')}${_('Date due')}${_('Invoiced amount')}${_('Open amount')}${_('Fees')}${_('Currency')}
${line.invoice_id.number} + %if line.invoice_id.name: +
+ ${line.invoice_id.name} + %endif +
${line.move_line_id.name}${line.date_entry}${line.date_due}${line.amount_due}${line.balance_due}${line.dunning_fees_amount}${line.currency_id.name or comm.company_id.currency_id.name}
+
+
+<%doc> + +

${_('If you have any question, do not hesitate to contact us.')}

+ +

${comm.user_id.name} ${comm.user_id.email and '<%s>'%(comm.user_id.email) or ''}
+ ${comm.company_id.name}
+ % if comm.company_id.street: + ${comm.company_id.street or ''}
+ + % endif + + % if comm.company_id.street2: + ${comm.company_id.street2}
+ % endif + % if comm.company_id.city or comm.company_id.zip: + ${comm.company_id.zip or ''} ${comm.company_id.city or ''}
+ % endif + % if comm.company_id.country_id: + ${comm.company_id.state_id and ('%s, ' % comm.company_id.state_id.name) or ''} ${comm.company_id.country_id.name or ''}
+ % endif + % if comm.company_id.phone: + Phone: ${comm.company_id.phone}
+ % endif + % if comm.company_id.website: + ${comm.company_id.website or ''}
+ % endif + + +

+ %endfor + + + diff --git a/account_credit_control_dunning_fees/report/report.xml b/account_credit_control_dunning_fees/report/report.xml new file mode 100644 index 000000000..89a9874a6 --- /dev/null +++ b/account_credit_control_dunning_fees/report/report.xml @@ -0,0 +1,12 @@ + + + + +