Merge lp:~savoirfairelinux-openerp/account-invoice-report/invoice_print_report_balance_payment into lp:~account-core-editors/account-invoice-report/7.0

Status: Merged
Merged at revision: 47
Proposed branch: lp:~savoirfairelinux-openerp/account-invoice-report/invoice_print_report_balance_payment
Merge into: lp:~account-core-editors/account-invoice-report/7.0
Diff against target: 722 lines (+681/-0)
8 files modified
invoice_print_report_balance_payment/__init__.py (+24/-0)
invoice_print_report_balance_payment/__openerp__.py (+63/-0)
invoice_print_report_balance_payment/account_invoice.py (+81/-0)
invoice_print_report_balance_payment/partner.py (+46/-0)
invoice_print_report_balance_payment/report/__init__.py (+22/-0)
invoice_print_report_balance_payment/report/invoice_print_report_balance_payment.py (+28/-0)
invoice_print_report_balance_payment/report/invoice_print_report_balance_payment.rml (+406/-0)
invoice_print_report_balance_payment/reports.xml (+11/-0)
To merge this branch: bzr merge lp:~savoirfairelinux-openerp/account-invoice-report/invoice_print_report_balance_payment
Reviewer Review Type Date Requested Status
Guewen Baconnier @ Camptocamp Approve
Maxime Chambreuil (http://www.savoirfairelinux.com) code review Approve
Sandy Carter (http://www.savoirfairelinux.com) Abstain
Joël Grand-Guillaume @ camptocamp code review, no tests Approve
Review via email: mp+198457@code.launchpad.net

Description of the change

Prints invoices with balance payments (and other things)

Changes the default invoice layout to add a few things, the main of which is the balance payment
fields. Under the Total field, 3 new lines appear:

* Previous balance: The previous balance of the customer at the date of the previous invoice.
* Payments: The amount of payments that have been made between the date of the last invoice and
            the date of the printed invoice.
* To Pay: The total amount owed by the customer at the date of this invoice.

Also, it changes two minor and unrelated aspects:

* Replaces "Source" by "Contract Number".
* Removes the Tax column in the invoice line table.

To post a comment you must log in.
Revision history for this message
Joël Grand-Guillaume @ camptocamp (jgrandguillaume-c2c) wrote :

LGTM

review: Approve (code review, no tests)
Revision history for this message
Sandy Carter (http://www.savoirfairelinux.com) (sandy-carter) wrote :

Missing "-------------" between l.81,82 this causes the markup to format strangely
l.73 There are some other funny formatting glitches in the description

There are also a lot of unused declarations of _logger

review: Needs Fixing (code review, test)
45. By Sandy Carter (http://www.savoirfairelinux.com)

Removed logger, fix markup formatting

Revision history for this message
Sandy Carter (http://www.savoirfairelinux.com) (sandy-carter) wrote :

Reviewed my own MP...
Woops

review: Abstain
Revision history for this message
Maxime Chambreuil (http://www.savoirfairelinux.com) (max3903) wrote :

l27 to l29, l262: Add "from . import ..."

review: Needs Fixing (code review)
46. By Sandy Carter (http://www.savoirfairelinux.com)

[FIX] Using local imports

47. By Sandy Carter (http://www.savoirfairelinux.com)

[FIX] Using local imports - take 2

Revision history for this message
Maxime Chambreuil (http://www.savoirfairelinux.com) (max3903) :
review: Approve (code review)
Revision history for this message
Sandy Carter (http://www.savoirfairelinux.com) (sandy-carter) wrote :

Can someone merge this, please.

Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added directory 'invoice_print_report_balance_payment'
2=== added file 'invoice_print_report_balance_payment/__init__.py'
3--- invoice_print_report_balance_payment/__init__.py 1970-01-01 00:00:00 +0000
4+++ invoice_print_report_balance_payment/__init__.py 2013-12-26 20:27:44 +0000
5@@ -0,0 +1,24 @@
6+# -*- encoding: utf-8 -*-
7+###############################################################################
8+#
9+# OpenERP, Open Source Management Solution
10+# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
11+#
12+# This program is free software: you can redistribute it and/or modify
13+# it under the terms of the GNU General Public License as
14+# published by the Free Software Foundation, either version 3 of the
15+# License, or (at your option) any later version.
16+#
17+# This program is distributed in the hope that it will be useful,
18+# but WITHOUT ANY WARRANTY; without even the implied warranty of
19+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20+# GNU General Public License for more details.
21+#
22+# You should have received a copy of the GNU General Public License
23+# along with this program. If not, see <http://www.gnu.org/licenses/>.
24+#
25+###############################################################################
26+
27+from . import account_invoice
28+from . import partner
29+from . import report
30
31=== added file 'invoice_print_report_balance_payment/__openerp__.py'
32--- invoice_print_report_balance_payment/__openerp__.py 1970-01-01 00:00:00 +0000
33+++ invoice_print_report_balance_payment/__openerp__.py 2013-12-26 20:27:44 +0000
34@@ -0,0 +1,63 @@
35+# -*- encoding: utf-8 -*-
36+###############################################################################
37+#
38+# OpenERP, Open Source Management Solution
39+# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
40+#
41+# This program is free software: you can redistribute it and/or modify
42+# it under the terms of the GNU General Public License as
43+# published by the Free Software Foundation, either version 3 of the
44+# License, or (at your option) any later version.
45+#
46+# This program is distributed in the hope that it will be useful,
47+# but WITHOUT ANY WARRANTY; without even the implied warranty of
48+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
49+# GNU General Public License for more details.
50+#
51+# You should have received a copy of the GNU General Public License
52+# along with this program. If not, see <http://www.gnu.org/licenses/>.
53+#
54+###############################################################################
55+
56+{
57+ "name": "Print invoices with balance payments",
58+ 'version': '1.0',
59+ 'author': 'Savoir-faire Linux',
60+ 'maintainer': 'Savoir-faire Linux',
61+ 'website': 'http://www.savoirfairelinux.com',
62+ 'license': 'AGPL-3',
63+ "category": "Accounting & Finance",
64+ 'summary': "Prints invoices with balance payments (and other things)",
65+ 'description': """
66+Print invoices with balance payments
67+====================================
68+Changes the default invoice layout to add a few things, the main of which is the balance payment
69+fields. Under the Total field, 3 new lines appear:
70+
71+* Previous balance: The previous balance of the customer at the date of the previous invoice.
72+* Payments: The amount of payments that have been made between the date of the last invoice and \
73+the date of the printed invoice.
74+* To Pay: The total amount owed by the customer at the date of this invoice.
75+
76+Also, it changes two minor and unrelated aspects:
77+
78+* Replaces "Source" by "Contract Number".
79+* Removes the Tax column in the invoice line table.
80+
81+Contributors:
82+-------------
83+* Virgil Dupras (virgil.dupras@savoirfairelinux.com)
84+""",
85+ "depends": ['account'],
86+ 'external_dependencies': {
87+ 'python': [],
88+ },
89+ 'data': [],
90+ 'update_xml': [
91+ 'reports.xml',
92+ ],
93+ 'demo': [],
94+ 'test': [],
95+ 'installable': True,
96+ 'active': False,
97+}
98
99=== added file 'invoice_print_report_balance_payment/account_invoice.py'
100--- invoice_print_report_balance_payment/account_invoice.py 1970-01-01 00:00:00 +0000
101+++ invoice_print_report_balance_payment/account_invoice.py 2013-12-26 20:27:44 +0000
102@@ -0,0 +1,81 @@
103+# -*- encoding: utf-8 -*-
104+###############################################################################
105+#
106+# OpenERP, Open Source Management Solution
107+# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
108+#
109+# This program is free software: you can redistribute it and/or modify
110+# it under the terms of the GNU General Public License as
111+# published by the Free Software Foundation, either version 3 of the
112+# License, or (at your option) any later version.
113+#
114+# This program is distributed in the hope that it will be useful,
115+# but WITHOUT ANY WARRANTY; without even the implied warranty of
116+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
117+# GNU General Public License for more details.
118+#
119+# You should have received a copy of the GNU General Public License
120+# along with this program. If not, see <http://www.gnu.org/licenses/>.
121+#
122+###############################################################################
123+
124+from openerp.osv import orm, fields
125+
126+
127+class account_invoice(orm.Model):
128+ _inherit = 'account.invoice'
129+
130+ def _previous_invoice_get(self, cr, uid, ids, field_names, arg, context=None):
131+ res = {}
132+ for invoice in self.browse(cr, uid, ids, context=context):
133+ domain = [
134+ ('date_invoice', '<', invoice.date_invoice),
135+ ('partner_id', '=', invoice.partner_id.id),
136+ ]
137+ search_result = self.search(
138+ cr, uid, domain, limit=1, order='date_invoice desc')
139+ res[invoice.id] = search_result[0] if search_result else False
140+ return res
141+
142+ def _previous_balance_get(self, cr, uid, ids, field_names, arg, context=None):
143+ res = {}
144+ partner_obj = self.pool.get('res.partner')
145+ for invoice in self.browse(cr, uid, ids, context=context):
146+ if invoice.previous_invoice_id:
147+ res[invoice.id] = partner_obj.get_balance_at_date(
148+ cr, uid, invoice.partner_id.id, invoice.previous_invoice_id.date_invoice,
149+ context=context
150+ )
151+ else:
152+ res[invoice.id] = 0.0
153+ return res
154+
155+ def _to_pay_get(self, cr, uid, ids, field_names, arg, context=None):
156+ res = {}
157+ partner_obj = self.pool.get('res.partner')
158+ for invoice in self.browse(cr, uid, ids, context=context):
159+ res[invoice.id] = partner_obj.get_balance_at_date(
160+ cr, uid, invoice.partner_id.id, invoice.date_invoice,
161+ context=context
162+ )
163+ return res
164+
165+ def _payment_total_get(self, cr, uid, ids, field_names, arg, context=None):
166+ res = {}
167+ for invoice in self.browse(cr, uid, ids, context=context):
168+ res[invoice.id] = invoice.previous_balance - \
169+ (invoice.to_pay - invoice.amount_total)
170+ return res
171+
172+ _columns = {
173+ 'previous_invoice_id': fields.function(_previous_invoice_get, type='many2one', relation='account.invoice'),
174+ 'previous_balance': fields.function(_previous_balance_get, type='float'),
175+ 'to_pay': fields.function(_to_pay_get, type='float'),
176+ 'payment_total': fields.function(_payment_total_get, type='float'),
177+ }
178+
179+ def invoice_print(self, cr, uid, ids, context=None):
180+ result = super(account_invoice, self).invoice_print(
181+ cr, uid, ids, context=context)
182+ result['report_name'] = 'account.invoice.balance_payment'
183+ return result
184
185=== added file 'invoice_print_report_balance_payment/partner.py'
186--- invoice_print_report_balance_payment/partner.py 1970-01-01 00:00:00 +0000
187+++ invoice_print_report_balance_payment/partner.py 2013-12-26 20:27:44 +0000
188@@ -0,0 +1,46 @@
189+# -*- encoding: utf-8 -*-
190+###############################################################################
191+#
192+# OpenERP, Open Source Management Solution
193+# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
194+#
195+# This program is free software: you can redistribute it and/or modify
196+# it under the terms of the GNU General Public License as
197+# published by the Free Software Foundation, either version 3 of the
198+# License, or (at your option) any later version.
199+#
200+# This program is distributed in the hope that it will be useful,
201+# but WITHOUT ANY WARRANTY; without even the implied warranty of
202+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
203+# GNU General Public License for more details.
204+#
205+# You should have received a copy of the GNU General Public License
206+# along with this program. If not, see <http://www.gnu.org/licenses/>.
207+#
208+###############################################################################
209+
210+import datetime
211+
212+from openerp.osv import orm
213+
214+
215+class res_partner(orm.Model):
216+ _inherit = 'res.partner'
217+
218+ def get_balance_at_date(self, cr, uid, id, date, context=None):
219+ query = self.pool.get('account.move.line')._query_get(
220+ cr, uid, context=context)
221+ if isinstance(date, datetime.date):
222+ date = date.strftime('%Y-%m-%d')
223+ sql = """SELECT SUM(l.debit-l.credit)
224+ FROM account_move_line l
225+ JOIN account_move m ON (l.move_id=m.id)
226+ LEFT JOIN account_account a ON (l.account_id=a.id)
227+ WHERE a.type IN ('receivable','payable')
228+ AND l.partner_id = %s
229+ AND m.date <= '%s'
230+ AND %s
231+ """ % (id, date, query)
232+ cr.execute(sql)
233+ row = cr.fetchone()
234+ return row[0] if row is not None else 0
235
236=== added directory 'invoice_print_report_balance_payment/report'
237=== added file 'invoice_print_report_balance_payment/report/__init__.py'
238--- invoice_print_report_balance_payment/report/__init__.py 1970-01-01 00:00:00 +0000
239+++ invoice_print_report_balance_payment/report/__init__.py 2013-12-26 20:27:44 +0000
240@@ -0,0 +1,22 @@
241+# -*- encoding: utf-8 -*-
242+###############################################################################
243+#
244+# OpenERP, Open Source Management Solution
245+# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
246+#
247+# This program is free software: you can redistribute it and/or modify
248+# it under the terms of the GNU General Public License as
249+# published by the Free Software Foundation, either version 3 of the
250+# License, or (at your option) any later version.
251+#
252+# This program is distributed in the hope that it will be useful,
253+# but WITHOUT ANY WARRANTY; without even the implied warranty of
254+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
255+# GNU General Public License for more details.
256+#
257+# You should have received a copy of the GNU General Public License
258+# along with this program. If not, see <http://www.gnu.org/licenses/>.
259+#
260+###############################################################################
261+
262+from . import invoice_print_report_balance_payment
263
264=== added file 'invoice_print_report_balance_payment/report/invoice_print_report_balance_payment.py'
265--- invoice_print_report_balance_payment/report/invoice_print_report_balance_payment.py 1970-01-01 00:00:00 +0000
266+++ invoice_print_report_balance_payment/report/invoice_print_report_balance_payment.py 2013-12-26 20:27:44 +0000
267@@ -0,0 +1,28 @@
268+# -*- encoding: utf-8 -*-
269+###############################################################################
270+#
271+# OpenERP, Open Source Management Solution
272+# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
273+#
274+# This program is free software: you can redistribute it and/or modify
275+# it under the terms of the GNU General Public License as
276+# published by the Free Software Foundation, either version 3 of the
277+# License, or (at your option) any later version.
278+#
279+# This program is distributed in the hope that it will be useful,
280+# but WITHOUT ANY WARRANTY; without even the implied warranty of
281+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
282+# GNU General Public License for more details.
283+#
284+# You should have received a copy of the GNU General Public License
285+# along with this program. If not, see <http://www.gnu.org/licenses/>.
286+#
287+###############################################################################
288+
289+from openerp.report import report_sxw
290+
291+report_sxw.report_sxw(
292+ 'report.account.invoice.balance_payment',
293+ 'account.invoice',
294+ 'addons/invoice_print_report_balance_payment/report/invoice_print_report_balance_payment.rml',
295+)
296
297=== added file 'invoice_print_report_balance_payment/report/invoice_print_report_balance_payment.rml'
298--- invoice_print_report_balance_payment/report/invoice_print_report_balance_payment.rml 1970-01-01 00:00:00 +0000
299+++ invoice_print_report_balance_payment/report/invoice_print_report_balance_payment.rml 2013-12-26 20:27:44 +0000
300@@ -0,0 +1,406 @@
301+<?xml version="1.0"?>
302+<document filename="Invoices.pdf">
303+ <template title="Invoices" author="OpenERP S.A.(sales@openerp.com)" allowSplitting="20">
304+ <pageTemplate id="first">
305+ <frame id="first" x1="34.0" y1="28.0" width="530" height="786"/>
306+ </pageTemplate>
307+ </template>
308+ <stylesheet>
309+ <blockTableStyle id="Standard_Outline">
310+ <blockAlignment value="LEFT"/>
311+ <blockValign value="TOP"/>
312+ </blockTableStyle>
313+ <blockTableStyle id="Table_Partner_Address">
314+ <blockAlignment value="LEFT"/>
315+ <blockValign value="TOP"/>
316+ </blockTableStyle>
317+ <blockTableStyle id="Table_Invoice_General_Header">
318+ <blockAlignment value="LEFT"/>
319+ <blockValign value="TOP"/>
320+ <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="0,0" stop="0,-1"/>
321+ <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="0,0" stop="0,0"/>
322+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
323+ <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="1,0" stop="1,-1"/>
324+ <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="1,0" stop="1,0"/>
325+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
326+ <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="2,0" stop="2,-1"/>
327+ <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="2,0" stop="2,-1"/>
328+ <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="2,0" stop="2,0"/>
329+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
330+ <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="3,0" stop="3,-1"/>
331+ <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="3,0" stop="3,-1"/>
332+ <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="3,0" stop="3,0"/>
333+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
334+ </blockTableStyle>
335+ <blockTableStyle id="Table_General_Detail_Content">
336+ <blockAlignment value="LEFT"/>
337+ <blockValign value="TOP"/>
338+ <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="0,0" stop="0,-1"/>
339+ <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="0,0" stop="0,0"/>
340+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
341+ <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="1,0" stop="1,-1"/>
342+ <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="1,0" stop="1,0"/>
343+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
344+ <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="2,0" stop="2,-1"/>
345+ <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="2,0" stop="2,-1"/>
346+ <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="2,0" stop="2,0"/>
347+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
348+ <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="3,0" stop="3,-1"/>
349+ <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="3,0" stop="3,-1"/>
350+ <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="3,0" stop="3,0"/>
351+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
352+ </blockTableStyle>
353+ <blockTableStyle id="Table7">
354+ <blockAlignment value="LEFT"/>
355+ <blockValign value="TOP"/>
356+ <lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
357+ <lineStyle kind="LINEBELOW" colorName="#000000" start="1,-1" stop="1,-1"/>
358+ <lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1"/>
359+ <lineStyle kind="LINEBELOW" colorName="#000000" start="3,-1" stop="3,-1"/>
360+ <lineStyle kind="LINEBELOW" colorName="#000000" start="4,-1" stop="4,-1"/>
361+ <lineStyle kind="LINEBELOW" colorName="#000000" start="5,-1" stop="5,-1"/>
362+ </blockTableStyle>
363+ <blockTableStyle id="Table8">
364+ <blockAlignment value="LEFT"/>
365+ <blockValign value="TOP"/>
366+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
367+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
368+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
369+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
370+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="4,-1" stop="4,-1"/>
371+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="5,-1" stop="5,-1"/>
372+ </blockTableStyle>
373+ <blockTableStyle id="Table10">
374+ <blockAlignment value="LEFT"/>
375+ <blockValign value="TOP"/>
376+ <lineStyle kind="LINEABOVE" colorName="#000000" start="1,0" stop="1,0"/>
377+ <lineStyle kind="LINEABOVE" colorName="#000000" start="2,0" stop="2,0"/>
378+ <lineStyle kind="LINEABOVE" colorName="#000000" start="1,2" stop="1,2"/>
379+ <lineStyle kind="LINEABOVE" colorName="#000000" start="2,2" stop="2,2"/>
380+ </blockTableStyle>
381+ <blockTableStyle id="Table9">
382+ <blockAlignment value="LEFT"/>
383+ <blockValign value="TOP"/>
384+ <lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
385+ <lineStyle kind="LINEBELOW" colorName="#000000" start="1,-1" stop="1,-1"/>
386+ <lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1"/>
387+ </blockTableStyle>
388+ <blockTableStyle id="Table2">
389+ <blockAlignment value="LEFT"/>
390+ <blockValign value="TOP"/>
391+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
392+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
393+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
394+ </blockTableStyle>
395+ <blockTableStyle id="Table1">
396+ <blockAlignment value="LEFT"/>
397+ <blockValign value="TOP"/>
398+ </blockTableStyle>
399+ <initialize>
400+ <paraStyle name="all" alignment="justify"/>
401+ </initialize>
402+ <paraStyle name="Standard"/>
403+ <paraStyle name="Text body" spaceBefore="0.0" spaceAfter="6.0"/>
404+ <paraStyle name="List" spaceBefore="0.0" spaceAfter="6.0"/>
405+ <paraStyle name="Table Contents" spaceBefore="0.0" spaceAfter="6.0"/>
406+ <paraStyle name="Caption" fontSize="10.0" leading="13" spaceBefore="6.0" spaceAfter="6.0"/>
407+ <paraStyle name="Index"/>
408+
409+ <paraStyle name="terp_header" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
410+ <paraStyle name="terp_default_8" rightIndent="0.0" leftIndent="0.0" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
411+ <paraStyle name="Footer"/>
412+ <paraStyle name="Horizontal Line" fontSize="6.0" leading="8" spaceBefore="0.0" spaceAfter="14.0"/>
413+
414+ <paraStyle name="terp_tblheader_General" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
415+ <paraStyle name="terp_tblheader_Details" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
416+ <paraStyle name="terp_tblheader_General_Centre" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
417+ <paraStyle name="terp_tblheader_General_Right" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
418+ <paraStyle name="terp_tblheader_Details_Centre" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
419+ <paraStyle name="terp_tblheader_Details_Right" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
420+
421+ <paraStyle name="terp_default_Right_8" rightIndent="0.0" leftIndent="0.0" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
422+ <paraStyle name="terp_default_Centre_8" rightIndent="0.0" leftIndent="0.0" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
423+ <paraStyle name="terp_default_address" rightIndent="0.0" leftIndent="0.0" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
424+ <paraStyle name="terp_default_9" rightIndent="0.0" leftIndent="0.0" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
425+ <paraStyle name="terp_default_Bold_9" rightIndent="0.0" leftIndent="-3.0" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
426+ <paraStyle name="terp_default_Centre_9" rightIndent="0.0" leftIndent="0.0" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
427+ <paraStyle name="terp_default_Right_9" rightIndent="0.0" leftIndent="0.0" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
428+ <paraStyle name="terp_default_Bold_Right_9" rightIndent="0.0" leftIndent="-3.0" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
429+ <paraStyle name="terp_default_2" rightIndent="0.0" leftIndent="0.0" fontSize="2.0" leading="3" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
430+ <paraStyle name="terp_default_White_2" rightIndent="0.0" leftIndent="0.0" fontSize="2.0" leading="3" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0" textColor="#ffffff"/>
431+
432+ <paraStyle name="Table" fontSize="10.0" leading="13" spaceBefore="6.0" spaceAfter="6.0"/>
433+ <paraStyle name="User Index 10" rightIndent="0.0" leftIndent="127.0"/>
434+ <paraStyle name="Preformatted Text" fontSize="10.0" leading="13" spaceBefore="0.0" spaceAfter="0.0"/>
435+ <images/>
436+ </stylesheet>
437+ <story>
438+ <pto>
439+ <para style="terp_default_8">[[ repeatIn(objects,'o') ]]</para>
440+ <para style="terp_default_8">[[ setLang(o.partner_id.lang) ]]</para>
441+ <pto_header><!-- Must be after setLang() -->
442+ <blockTable colWidths="202.0,87.0,71.0,57.0,42.0,71.0" style="Table7">
443+ <tr>
444+ <td><para style="terp_tblheader_Details"><b>Description</b></para></td>
445+ <td><para style="terp_tblheader_Details_Centre"><b>Taxes</b></para></td>
446+ <td><para style="terp_tblheader_Details_Centre"><b>Quantity</b></para></td>
447+ <td><para style="terp_tblheader_Details_Right"><b>Unit Price</b></para></td>
448+ <td><para style="terp_tblheader_Details_Right"><b>Disc.(%)</b></para></td>
449+ <td><para style="terp_tblheader_Details_Right"><b>Price</b></para></td>
450+ </tr>
451+ </blockTable>
452+ </pto_header>
453+ <blockTable colWidths="297.0,233.0" style="Table_Partner_Address">
454+ <tr>
455+ <td>
456+ <para style="terp_default_8">
457+ <font color="white"> </font>
458+ </para>
459+ </td>
460+ <td>
461+ <para style="terp_default_8">[[ (o.partner_id and o.partner_id.title and o.partner_id.title.name) or '' ]] [[ (o.partner_id and o.partner_id.name) or '' ]]</para>
462+ <para style="terp_default_8">[[ display_address(o.partner_id) ]]</para>
463+ <para style="terp_default_8">
464+ <font color="white"> </font>
465+ </para>
466+ <para style="terp_default_8">Tel. : [[ (o.partner_id.phone) or removeParentNode('para') ]]</para>
467+ <para style="terp_default_8">Fax : [[ (o.partner_id.fax) or removeParentNode('para') ]]</para>
468+ <para style="terp_default_8">TIN : [[ (o.partner_id.vat) or removeParentNode('para') ]]</para>
469+ </td>
470+ </tr>
471+ </blockTable>
472+ <para style="terp_header"><b>Invoice [[ ((o.type == 'out_invoice' and (o.state == 'open' or o.state == 'paid')) or removeParentNode('para')) and '' ]] [[ o.number ]]</b></para>
473+ <para style="terp_header"><b>PRO-FORMA [[ ((o.type == 'out_invoice' and o.state == 'proforma2') or removeParentNode('para')) and '' ]]</b></para>
474+ <para style="terp_header"><b>Draft Invoice [[ ((o.type == 'out_invoice' and o.state == 'draft') or removeParentNode('para')) and '' ]]</b></para>
475+ <para style="terp_header"><b>Cancelled Invoice [[ ((o.type == 'out_invoice' and o.state == 'cancel') or removeParentNode('para')) and '' ]] [[ o.number ]]</b></para>
476+ <para style="terp_header"><b>Refund [[ (o.type=='out_refund' or removeParentNode('para')) and '' ]] [[ o.number ]]</b></para>
477+ <para style="terp_header"><b>Supplier Refund [[ (o.type=='in_refund' or removeParentNode('para')) and '' ]] [[ o.number ]]</b></para>
478+ <para style="terp_header"><b>Supplier Invoice [[ (o.type=='in_invoice' or removeParentNode('para')) and '' ]] [[ o.number ]]</b></para>
479+ <para style="terp_default_8">
480+ <font color="white"> </font>
481+ </para>
482+ <blockTable colWidths="132.50,132.50,132.50,132.50" style="Table_Invoice_General_Header">
483+ <tr>
484+ <td>
485+ <para style="terp_tblheader_General_Centre"><b>Description</b></para>
486+ </td>
487+ <td>
488+ <para style="terp_tblheader_General_Centre"><b>Invoice Date</b></para>
489+ </td>
490+ <td>
491+ <para style="terp_tblheader_General_Centre"><b>Contract Number</b></para>
492+ </td>
493+ <td>
494+ <para style="terp_tblheader_General_Centre"><b>Customer Code</b></para>
495+ </td>
496+ </tr>
497+ </blockTable>
498+ <blockTable colWidths="132.50,132.50,132.50,132.50" style="Table_General_Detail_Content">
499+ <tr>
500+ <td>
501+ <para style="terp_default_Centre_9">[[ o.name or ' ' ]]</para>
502+ </td>
503+ <td>
504+ <para style="terp_default_Centre_9">[[ formatLang(o.date_invoice,date=True) ]]</para>
505+ </td>
506+ <td>
507+ <para style="terp_default_Centre_9">[[ o.origin or '' ]]</para>
508+ </td>
509+ <td>
510+ <para style="terp_default_Centre_9">[[ (o.partner_id.ref) or ' ' ]]</para>
511+ </td>
512+ </tr>
513+ </blockTable>
514+ <para style="terp_default_8">
515+ <font color="white"> </font>
516+ </para>
517+ <blockTable colWidths="255.0,80.0,60.0,50.0,85.0" style="Table7">
518+ <tr>
519+ <td>
520+ <para style="terp_tblheader_General"><b>Description</b></para>
521+ </td>
522+ <td>
523+ <para style="terp_tblheader_General_Right"><b>Quantity</b></para>
524+ </td>
525+ <td>
526+ <para style="terp_tblheader_General_Right"><b>Unit Price</b></para>
527+ </td>
528+ <td>
529+ <para style="terp_tblheader_General_Right"><b>Disc.(%)</b></para>
530+ </td>
531+ <td>
532+ <para style="terp_tblheader_General_Right"><b>Price</b></para>
533+ </td>
534+ </tr>
535+ </blockTable>
536+ <section>
537+ <para style="terp_default_2">[[ repeatIn(o.invoice_line,'l') ]]</para>
538+ <blockTable colWidths="255.0,80.0,60.0,50.0,85.0" style="Table8">
539+ <tr>
540+ <td>
541+ <para style="terp_default_9">[[ format(l.name) ]]</para>
542+ </td>
543+ <td>
544+ <para style="terp_default_Right_9">[[ formatLang(l.quantity)]] [[ (l.uos_id and l.uos_id.name) or '' ]]</para>
545+ </td>
546+ <td>
547+ <para style="terp_default_Right_9">[[ formatLang(l.price_unit) ]]</para>
548+ </td>
549+ <td>
550+ <para style="terp_default_Centre_9">[[ formatLang(l.discount, dp='Account') ]] </para>
551+ </td>
552+ <td>
553+ <para style="terp_default_Right_9">[[ formatLang(l.price_subtotal, dp='Account', currency_obj=o.currency_id) ]]</para>
554+ </td>
555+ </tr>
556+ </blockTable>
557+ </section>
558+ <blockTable colWidths="335.0,110.0,85.0" style="Table10">
559+ <tr>
560+ <td>
561+ <para style="terp_default_8">
562+ <font color="white"> </font>
563+ </para>
564+ </td>
565+ <td>
566+ <para style="terp_default_9">Net Total:</para>
567+ </td>
568+ <td>
569+ <para style="terp_default_Right_9">[[ formatLang(o.amount_untaxed, digits=get_digits(dp='Account'), currency_obj=o.currency_id) ]]</para>
570+ </td>
571+ </tr>
572+ <tr>
573+ <td>
574+ <para style="terp_default_8">
575+ <font color="white"> </font>
576+ </para>
577+ </td>
578+ <td>
579+ <para style="terp_default_9">Taxes:</para>
580+ </td>
581+ <td>
582+ <para style="terp_default_Right_9">[[ formatLang(o.amount_tax, dp='Account', currency_obj=o.currency_id) ]]</para>
583+ </td>
584+ </tr>
585+ <tr>
586+ <td>
587+ <para style="terp_default_8">
588+ <font color="white"> </font>
589+ </para>
590+ </td>
591+ <td>
592+ <para style="terp_default_9"><b>Total:</b></para>
593+ </td>
594+ <td>
595+ <para style="terp_default_Right_9"><b>[[ formatLang(o.amount_total, digits=get_digits(dp='Account'), currency_obj=o.currency_id) ]]</b></para>
596+ </td>
597+ </tr>
598+ <tr>
599+ <td>
600+ <para style="terp_default_8">
601+ <font color="white"> </font>
602+ </para>
603+ </td>
604+ <td>
605+ <para style="terp_default_9">Previous Balance:</para>
606+ </td>
607+ <td>
608+ <para style="terp_default_Right_9">[[ formatLang(o.previous_balance, digits=get_digits(dp='Account'), currency_obj=o.currency_id) ]]</para>
609+ </td>
610+ </tr>
611+ <tr>
612+ <td>
613+ <para style="terp_default_8">
614+ <font color="white"> </font>
615+ </para>
616+ </td>
617+ <td>
618+ <para style="terp_default_9">Payments:</para>
619+ </td>
620+ <td>
621+ <para style="terp_default_Right_9">[[ formatLang(o.payment_total, digits=get_digits(dp='Account'), currency_obj=o.currency_id) ]]</para>
622+ </td>
623+ </tr>
624+ <tr>
625+ <td>
626+ <para style="terp_default_8">
627+ <font color="white"> </font>
628+ </para>
629+ </td>
630+ <td>
631+ <para style="terp_default_9"><b>To Pay:</b></para>
632+ </td>
633+ <td>
634+ <para style="terp_default_Right_9"><b>[[ formatLang(o.to_pay, digits=get_digits(dp='Account'), currency_obj=o.currency_id) ]]</b></para>
635+ </td>
636+ </tr>
637+ </blockTable>
638+ <para style="Text body">
639+ <font color="white"> </font>
640+ </para>
641+ <blockTable colWidths="205.0,71.0,71.0,183.0" style="Table9">
642+ <tr>
643+ <td>
644+ <para style="terp_tblheader_Details"><b>Tax [[ o.tax_line==[] and removeParentNode('blockTable') ]]</b></para>
645+ </td>
646+ <td>
647+ <para style="terp_tblheader_Details_Right"><b>Base </b></para>
648+ </td>
649+ <td>
650+ <para style="terp_tblheader_Details_Right"><b>Amount </b></para>
651+ </td>
652+ <td>
653+ <para style="terp_default_8">
654+ <font color="white"> </font>
655+ </para>
656+ </td>
657+ </tr>
658+ </blockTable>
659+ <section>
660+ <para style="terp_default_2">[[ repeatIn(o.tax_line,'t') ]]</para>
661+ <blockTable colWidths="205.0,71.0,71.0,184.0" style="Table2">
662+ <tr>
663+ <td>
664+ <para style="terp_default_8">[[ t.name ]]</para>
665+ </td>
666+ <td>
667+ <para style="terp_default_Right_8">[[ formatLang(t.base, dp='Account', currency_obj=o.currency_id) ]]</para>
668+ </td>
669+ <td>
670+ <para style="terp_default_Right_8">[[ (t.tax_code_id and t.tax_code_id.notprintable) and removeParentNode('blockTable') or '' ]] [[ formatLang(t.amount, digits=get_digits(dp='Account'), currency_obj=o.currency_id) ]]</para>
671+ </td>
672+ <td>
673+ <para style="terp_default_8">
674+ <font color="white"> </font>
675+ </para>
676+ </td>
677+ </tr>
678+ </blockTable>
679+ </section>
680+ <para style="terp_default_9">
681+ <font color="white"> </font>
682+ </para>
683+ <para style="terp_default_9">[[ (o.comment and format(o.comment )) or removeParentNode('para') ]]</para>
684+ <para style="terp_default_8">
685+ <font color="white"> </font>
686+ </para>
687+ <para style="terp_default_9">[[ (o.payment_term and o.payment_term.note and format(o.payment_term and o.payment_term.note)) or removeParentNode('para') ]]</para>
688+ <para style="terp_default_9">
689+ <font color="white"> </font>
690+ </para>
691+ <blockTable colWidths="120.0,410.0" style="Table1">
692+ <tr>
693+ <td>
694+ <para style="terp_default_Bold_9"><b>Fiscal Position Remark : </b></para>
695+ </td>
696+ <td>
697+ <para style="terp_default_9">[[ (o.fiscal_position and o.fiscal_position.note and format(o.fiscal_position.note)) or removeParentNode('blockTable') ]]</para>
698+ </td>
699+ </tr>
700+ </blockTable>
701+ <para style="terp_default_2">
702+ <font color="white"> </font>
703+ </para>
704+ </pto>
705+ </story>
706+</document>
707
708=== added file 'invoice_print_report_balance_payment/reports.xml'
709--- invoice_print_report_balance_payment/reports.xml 1970-01-01 00:00:00 +0000
710+++ invoice_print_report_balance_payment/reports.xml 2013-12-26 20:27:44 +0000
711@@ -0,0 +1,11 @@
712+<?xml version="1.0" encoding="utf-8"?>
713+<openerp>
714+ <data>
715+ <report auto="False"
716+ id="invoice_print_report_payment_balance"
717+ model="account.invoice"
718+ name="account.invoice.balance_payment"
719+ rml="invoice_print_report_balance_payment/report/invoice_print_report_balance_payment.rml"
720+ string="Invoices (with balance payments)" />
721+ </data>
722+</openerp>

Subscribers

People subscribed via source and target branches