← Back to team overview

openerp-community-reviewer team mailing list archive

lp:~camptocamp/account-financial-tools/credit_control_report_improvement_vre into lp:account-financial-tools

 

Vincent Renaville@camptocamp has proposed merging lp:~camptocamp/account-financial-tools/credit_control_report_improvement_vre into lp:account-financial-tools.

Requested reviews:
  Account Core Editors (account-core-editors)

For more details, see:
https://code.launchpad.net/~camptocamp/account-financial-tools/credit_control_report_improvement_vre/+merge/201920

Improvement of layout of report, on address format and add banking information related to the invoice linked
-- 
https://code.launchpad.net/~camptocamp/account-financial-tools/credit_control_report_improvement_vre/+merge/201920
Your team OpenERP Community Reviewer/Maintainer is subscribed to branch lp:account-financial-tools.
=== modified file 'account_credit_control/report/credit_control_summary.html.mako'
--- account_credit_control/report/credit_control_summary.html.mako	2013-11-21 15:44:48 +0000
+++ account_credit_control/report/credit_control_summary.html.mako	2014-01-16 12:50:15 +0000
@@ -4,17 +4,15 @@
     <style type="text/css">
       ${css}
 body {
-    font-family: helvetica;
     font-size: 12px;
 }
 
 .custom_text {
-    font-family: helvetica;
     font-size: 12px;
+    text-align:justify;
 }
 
 table {
-    font-family: helvetica;
     font-size: 12px;
 }
 
@@ -34,7 +32,6 @@
     text-align: center;
     border: 1px solid lightGrey;
     border-collapse: collapse;
-    font-family: helvetica;
     font-size: 12px;
 }
 
@@ -110,6 +107,27 @@
 .address td.name {
     font-weight: bold;
 }
+.list_bank_table {
+    text-align:center;
+    border-collapse: collapse;
+}
+.list_bank_table th {
+    background-color: #EEEEEE;
+    text-align:left;
+    font-size:12;
+    font-weight:bold;
+    padding-right:3px;
+    padding-left:3px;
+}
+.list_bank_table td {
+    text-align:left;
+    font-size:12;
+    padding-right:3px;
+    padding-left:3px;
+    padding-top:3px;
+    padding-bottom:3px;
+}
+
 
 td.amount, th.amount {
     text-align: right;
@@ -135,42 +153,68 @@
   <body>
 
     %for comm in objects :
+    <%
+      inv_bank = comm.credit_control_line_ids[0].invoice_id.partner_bank_id
+      inv = comm.credit_control_line_ids[0].invoice_id
+    %>
     <% setLang(comm.get_contact_address().lang) %>
     <div class="address">
-        <table class="recipient">
-          <%
-             add = comm.get_contact_address()
-          %>
-            %if comm.partner_id.id == add.id:
-              <tr><td class="name">${comm.partner_id.title and comm.partner_id.title.name or ''} ${comm.partner_id.name }</td></tr>
-              <% address_lines = comm.partner_id.contact_address.split("\n") %>
-
-            %else:
-              <tr><td class="name">${comm.partner_id.name or ''}</td></tr>
-              <tr><td>${add.title and add.title.name or ''} ${add.name}</td></tr>
-              <% address_lines = add.contact_address.split("\n")[1:] %>
-            %endif
-            %for part in address_lines:
-                %if part:
-                <tr><td>${part}</td></tr>
-                %endif
-            %endfor
-        </table>
-        <br/>
-        <br/>
-        <br/>
-        <br/>
-
-    </div>
-        <br/>
-        <br/>
-        <br/>
+      %if hasattr(inv, 'commercial_partner_id'):
+        <table class="recipient" >
+            %if inv.partner_id.id != inv.commercial_partner_id.id:
+            <tr><td class="name">${inv.commercial_partner_id.name or '' }</td></tr>
+            <tr><td>${inv.partner_id.title and inv.partner_id.title.name or ''} ${inv.partner_id.name }</td></tr>
+            %else:
+            <tr><td class="name">${inv.partner_id.title and inv.partner_id.title.name or ''} ${inv.partner_id.name}</td></tr>
+            %endif
+            %for part in inv.partner_id.contact_address.split("\n")[0:]:
+                %if part:
+                <tr><td>${part}</td></tr>
+                %endif
+            %endfor
+        </table>
+      %else:
+        <table class="recipient">
+            %if inv.partner_id.parent_id:
+            <tr><td class="name">${inv.partner_id.parent_id.name or ''}</td></tr>
+            <tr><td>${inv.partner_id.title and inv.partner_id.title.name or ''} ${inv.partner_id.name }</td></tr>
+            %else:
+            <tr><td class="name">${inv.partner_id.title and inv.partner_id.title.name or ''} ${inv.partner_id.name }</td></tr>
+            %endif
+            %for part in inv.partner_id.contact_address.split("\n")[0:]:
+                %if part:
+                <tr><td>${part}</td></tr>
+                %endif
+            %endfor
+        </table>
+      %endif
+        <br/>
+        <br/>
+        <br/>
+        <br/>
+
+    </div>
+        <br/>
+        <br/>
+        <br/>
+        <br/>
+        <br/>
+        <br/>
+        <br/>
+        <br/>
+        <br/>
+    <div class="address">
+        <table class="recipient">
+            <tr><td style="text-align:right;">${comm.company_id.city}, ${comm.credit_control_line_ids[0].date}</td></tr>
+        </table>
+
+    </div>
     <div>
 
       <h3 style="clear: both; padding-top: 20px;">
           ${_('Reminder')}: ${comm.current_policy_level.name or '' }
       </h3>
-
+	  <br/>
       <p>${_('Dear')},</p>
       <p class="custom_text" width="95%">${comm.current_policy_level.custom_text.replace('\n', '<br />')}</p>
 
@@ -203,37 +247,62 @@
         <td class="date">${line.date_due}</td>
         <td class="amount">${line.amount_due}</td>
         <td class="amount">${line.balance_due}</td>
-        <td class="amount">${line.currency_id.name or comm.company_id.currency_id.name}</td>
+        <td class="amount">${line.currency_id.name or inv.company_id.currency_id.name}</td>
       </tr>
 %endfor
       </table>
       <br/>
       <br/>
+   <table class="list_bank_table" width="100%" >
+      <!-- vat value are taken back from commercial id -->
+        <tr>
+            <th style="width:20%;">${_("Bank")}</th>
+            <td style="width:30%;text-align:left;">${inv_bank and inv_bank.bank_name or '-' } </td>
+            %if inv.partner_id and inv.partner_id.vat :
+            <th style="width:20%;">${_("Customer VAT No")}</th>
+            <td style="width:30%;">${inv.partner_id.vat or '-'}</td>
+            %else:
+            <!-- conserve table's cells widths -->
+            <td style="width:20%;"></td>
+            <td style="width:30%;"></td>
+            %endif
+        </tr>
+        <tr>
+            <th style="width:20%;">${_("Bank account")}</th>
+            <td style="width:50%;text-align:left;">${ inv_bank and inv_bank.acc_number or '-' }</td>
+        </tr>
+        <tr>
+            <th width="20%">${_("BIC")}</th>
+            <td style="width:30%;">${inv_bank and inv_bank.bank_bic or '-' }</td>
+        </tr>
+    </table>
+      <br/>
+      <br/>
 <%doc>
       <!-- uncomment to have info after summary -->
       <p>${_('If you have any question, do not hesitate to contact us.')}</p>
 
-      <p>${comm.user_id.name} ${comm.user_id.email and '<%s>'%(comm.user_id.email) or ''}<br/>
-      ${comm.company_id.name}<br/>
-      % if comm.company_id.street:
-      ${comm.company_id.street or ''}<br/>
-
-      % endif
-
-      % if comm.company_id.street2:
-      ${comm.company_id.street2}<br/>
-      % endif
-      % if comm.company_id.city or comm.company_id.zip:
-      ${comm.company_id.zip or ''} ${comm.company_id.city or ''}<br/>
-      % 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 ''}<br/>
-      % endif
-      % if comm.company_id.phone:
-      Phone: ${comm.company_id.phone}<br/>
-      % endif
-      % if comm.company_id.website:
-      ${comm.company_id.website or ''}<br/>
+      <p>${inv.user_id.name} ${inv.user_id.email and '<%s>'%(inv.user_id.email) or ''}<br/>
+      ${inv.company_id.name}<br/>
+      % if inv.company_id.street:
+      ${inv.company_id.street or ''}<br/>
+
+      % endif
+
+      % if inv.company_id.street2:
+      ${inv.company_id.street2}<br/>
+      % endif
+      % if inv.company_id.city or inv.company_id.zip:
+      ${inv.company_id.zip or ''} ${inv.company_id.city or ''}<br/>
+      % endif
+      % if inv.company_id.country_id:
+      ${inv.company_id.state_id and ('%s, ' % inv.company_id.state_id.name) or ''} ${inv.company_id.country_id.name or ''}<br/>
+      % endif
+      % if inv.company_id.phone:
+      Phone: ${inv.company_id.phone}<br/>
+      % endif
+      % if inv.company_id.website:
+      ${inv.company_id.website or ''}<br/>
       % endif
 </%doc>
 


Follow ups