Sales/Address Book/Customers/ Print Overdue Payment
* Display currency symbol (€) instead of currency name (EUR) * wrong address format bzr revid: apa@tinyerp.com-20100909070434-9neov41afugbnejm
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
@@ -15,7 +15,7 @@
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
@@ -46,15 +46,18 @@ class Overdue(report_sxw.rml_parse):
|
||||
result = {
|
||||
'name': False,
|
||||
'street': False,
|
||||
'street2': False,
|
||||
'city' : False,
|
||||
'zip' : False,
|
||||
'state_id':False,
|
||||
'country_id' : False,
|
||||
}
|
||||
if adr_id:
|
||||
result = res_partner_address.read(self.cr, self.uid, [adr_id], context=self.context.copy())
|
||||
result[0]['country_id'] = result[0]['country_id'] and result[0]['country_id'][1] or False
|
||||
return result
|
||||
|
||||
result[0]['state_id'] = result[0]['state_id'] and result[0]['state_id'][1] or False
|
||||
return result
|
||||
|
||||
res.append(result)
|
||||
return res
|
||||
|
||||
@@ -80,12 +83,12 @@ class Overdue(report_sxw.rml_parse):
|
||||
('state', '<>', 'draft'), ('reconcile_id', '=', False)])
|
||||
movelines = moveline_obj.browse(self.cr, self.uid, movelines)
|
||||
return movelines
|
||||
|
||||
|
||||
def _message(self, obj, company):
|
||||
company_pool = pooler.get_pool(self.cr.dbname).get('res.company')
|
||||
message = company_pool.browse(self.cr, self.uid, company.id, {'lang':obj.lang}).overdue_msg
|
||||
message = company_pool.browse(self.cr, self.uid, company.id, {'lang':obj.lang}).overdue_msg
|
||||
return message
|
||||
|
||||
|
||||
report_sxw.report_sxw('report.account.overdue', 'res.partner',
|
||||
'addons/account/report/overdue.rml', parser=Overdue)
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0"?>
|
||||
<document filename="test.pdf">
|
||||
<template pageSize="(595.0,842.0)" title="Overdue" author="OpenERP S.A. (sales@openerp.com)" allowSplitting="20">
|
||||
<template pageSize="(595.0,842.0)" title="Overdue Payment" author="OpenERP S.A. (sales@openerp.com)" allowSplitting="20">
|
||||
<pageTemplate id="first">
|
||||
<frame id="first" x1="42.0" y1="28.0" width="511" height="786"/>
|
||||
</pageTemplate>
|
||||
@@ -55,16 +55,16 @@
|
||||
<initialize>
|
||||
<paraStyle name="all" alignment="justify"/>
|
||||
</initialize>
|
||||
<paraStyle name="Standard" fontName="Times-Roman"/>
|
||||
<paraStyle name="Text body" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="List" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Table Contents" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Table Heading" fontName="Times-Roman" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Caption" fontName="Times-Roman" fontSize="10.0" leading="13" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Index" fontName="Times-Roman"/>
|
||||
<paraStyle name="Standard" fontName="Helvetica"/>
|
||||
<paraStyle name="Text body" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="List" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Table Contents" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Table Heading" fontName="Helvetica" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Caption" fontName="Helvetica" fontSize="10.0" leading="13" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Index" fontName="Helvetica"/>
|
||||
<paraStyle name="Heading" fontName="Helvetica" fontSize="15.0" leading="19" spaceBefore="12.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Footer" fontName="Times-Roman"/>
|
||||
<paraStyle name="Horizontal Line" fontName="Times-Roman" fontSize="6.0" leading="8" spaceBefore="0.0" spaceAfter="14.0"/>
|
||||
<paraStyle name="Footer" fontName="Helvetica"/>
|
||||
<paraStyle name="Horizontal Line" fontName="Helvetica" fontSize="6.0" leading="8" spaceBefore="0.0" spaceAfter="14.0"/>
|
||||
<paraStyle name="terp_header" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Heading 9" fontName="Helvetica-Bold" fontSize="75%" leading="NaN" spaceBefore="12.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_tblheader_General" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
@@ -96,9 +96,10 @@
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_9">[[ o.name ]]</para>
|
||||
<para style="terp_default_9">[[ addr['name'] ]]</para>
|
||||
<para style="terp_default_9">[[ addr['street'] ]]</para>
|
||||
<para style="terp_default_9">[[ addr['street2'] or removeParentNode('para') ]]</para>
|
||||
<para style="terp_default_9">[[ addr['zip'] ]] [[ addr['city'] ]]</para>
|
||||
<para style="terp_default_9">[[ addr['state_id'] or removeParentNode('para')]]</para>
|
||||
<para style="terp_default_9">[[ addr['country_id'] ]]</para>
|
||||
<para style="terp_default_9">
|
||||
<font color="white"> </font>
|
||||
@@ -135,7 +136,7 @@
|
||||
<para style="terp_default_9">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<blockTable colWidths="56.0,137.0,52.0,72.0,60.0,57.0,56.0,18.0" style="Table1">
|
||||
<blockTable colWidths="56.0,136.0,51.0,72.0,54.0,56.0,66.0,18.0" style="Table1">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details">Date</para>
|
||||
@@ -147,16 +148,16 @@
|
||||
<para style="terp_tblheader_Details_Centre">Ref</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Centre">Due date</para>
|
||||
<para style="terp_tblheader_Details_Centre">Maturity date</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Right">Due</para>
|
||||
<para style="terp_tblheader_Details_Right">Due<font face="Helvetica" size="8.0">([[ company.currency_id.name ]])</font></para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Right">Paid</para>
|
||||
<para style="terp_tblheader_Details_Right">Paid<font face="Helvetica" size="8.0">([[ company.currency_id.name ]])</font></para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Right">Maturity</para>
|
||||
<para style="terp_tblheader_Details_Right">Maturity<font face="Helvetica" size="8.0">([[ company.currency_id.name ]])</font></para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Centre">Li.</para>
|
||||
@@ -165,7 +166,7 @@
|
||||
</blockTable>
|
||||
<section>
|
||||
<para style="terp_default_8">[[repeatIn(getLines(o), 'line') ]]</para>
|
||||
<blockTable colWidths="56.0,138.0,52.0,73.0,60.0,57.0,56.0,17.0" style="Table3">
|
||||
<blockTable colWidths="56.0,136.0,52.0,71.0,55.0,56.0,66.0,17.0" style="Table3">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_9">[[ formatLang(line['date'],date=True) ]]</para>
|
||||
@@ -194,7 +195,7 @@
|
||||
</tr>
|
||||
</blockTable>
|
||||
</section>
|
||||
<blockTable colWidths="247.0,72.0,60.0,57.0,56.0,17.0" style="Table2">
|
||||
<blockTable colWidths="247.0,65.0,59.0,56.0,66.0,17.0" style="Table2">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_8">
|
||||
@@ -205,13 +206,13 @@
|
||||
<para style="terp_default_Bold_9">Sub-Total : </para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9">[[ formatLang((reduce(lambda x, y: x + ((y['account_id']['type'] == 'receivable' and y['debit'] or 0) or (y['account_id']['type'] == 'payable' and y['credit'] * -1 or 0)), getLines(o), 0))) ]]</para>
|
||||
<para style="terp_default_Right_9">[[ formatLang((reduce(lambda x, y: x + ((y['account_id']['type'] == 'receivable' and y['debit'] or 0) or (y['account_id']['type'] == 'payable' and y['credit'] * -1 or 0)), getLines(o), 0))) ]] [[ company.currency_id.symbol ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9">[[ formatLang((reduce(lambda x, y: x + ((y['account_id']['type'] == 'receivable' and y['credit'] or 0) or (y['account_id']['type'] == 'payable' and y['debit'] * -1 or 0)), getLines(o), 0))) ]] </para>
|
||||
<para style="terp_default_Right_9">[[ formatLang((reduce(lambda x, y: x + ((y['account_id']['type'] == 'receivable' and y['credit'] or 0) or (y['account_id']['type'] == 'payable' and y['debit'] * -1 or 0)), getLines(o), 0))) ]] [[ company.currency_id.symbol ]] </para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9">[[ formatLang((reduce(lambda x, y: x + (y['debit'] - y['credit']), filter(lambda x: x['date_maturity'] < time.strftime('%Y-%m-%d'), getLines(o)), 0))) ]]</para>
|
||||
<para style="terp_default_Right_9">[[ formatLang((reduce(lambda x, y: x + (y['debit'] - y['credit']), filter(lambda x: x['date_maturity'] < time.strftime('%Y-%m-%d'), getLines(o)), 0))) ]] [[ company.currency_id.symbol ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_9">
|
||||
@@ -229,7 +230,7 @@
|
||||
<para style="terp_default_Bold_9">Balance : </para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9">[[ formatLang((reduce(lambda x, y: x +(y['debit'] - y['credit']), getLines(o), 0))) ]]</para>
|
||||
<para style="terp_default_Right_9">[[ formatLang((reduce(lambda x, y: x +(y['debit'] - y['credit']), getLines(o), 0))) ]] [[ company.currency_id.symbol ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_9">
|
||||
@@ -248,7 +249,7 @@
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<para style="terp_default_9">Total amount due: [[ formatLang((reduce(lambda x, y: x + (y['debit'] - y['credit']), getLines(o), 0))) ]] [[ company.currency_id.name ]].</para>
|
||||
<para style="terp_default_9">Total amount due: [[ formatLang((reduce(lambda x, y: x + (y['debit'] - y['credit']), getLines(o), 0))) ]] [[ company.currency_id.symbol ]].</para>
|
||||
<para style="terp_default_8">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
|
||||
Reference in New Issue
Block a user