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
=== added directory 'invoice_print_report_balance_payment'
=== added file 'invoice_print_report_balance_payment/__init__.py'
--- invoice_print_report_balance_payment/__init__.py 1970-01-01 00:00:00 +0000
+++ invoice_print_report_balance_payment/__init__.py 2013-12-26 20:27:44 +0000
@@ -0,0 +1,24 @@
1# -*- encoding: utf-8 -*-
2###############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU General Public License for more details.
16#
17# You should have received a copy of the GNU General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20###############################################################################
21
22from . import account_invoice
23from . import partner
24from . import report
025
=== added file 'invoice_print_report_balance_payment/__openerp__.py'
--- invoice_print_report_balance_payment/__openerp__.py 1970-01-01 00:00:00 +0000
+++ invoice_print_report_balance_payment/__openerp__.py 2013-12-26 20:27:44 +0000
@@ -0,0 +1,63 @@
1# -*- encoding: utf-8 -*-
2###############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU General Public License for more details.
16#
17# You should have received a copy of the GNU General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20###############################################################################
21
22{
23 "name": "Print invoices with balance payments",
24 'version': '1.0',
25 'author': 'Savoir-faire Linux',
26 'maintainer': 'Savoir-faire Linux',
27 'website': 'http://www.savoirfairelinux.com',
28 'license': 'AGPL-3',
29 "category": "Accounting & Finance",
30 'summary': "Prints invoices with balance payments (and other things)",
31 'description': """
32Print invoices with balance payments
33====================================
34Changes the default invoice layout to add a few things, the main of which is the balance payment
35fields. Under the Total field, 3 new lines appear:
36
37* Previous balance: The previous balance of the customer at the date of the previous invoice.
38* Payments: The amount of payments that have been made between the date of the last invoice and \
39the date of the printed invoice.
40* To Pay: The total amount owed by the customer at the date of this invoice.
41
42Also, it changes two minor and unrelated aspects:
43
44* Replaces "Source" by "Contract Number".
45* Removes the Tax column in the invoice line table.
46
47Contributors:
48-------------
49* Virgil Dupras (virgil.dupras@savoirfairelinux.com)
50""",
51 "depends": ['account'],
52 'external_dependencies': {
53 'python': [],
54 },
55 'data': [],
56 'update_xml': [
57 'reports.xml',
58 ],
59 'demo': [],
60 'test': [],
61 'installable': True,
62 'active': False,
63}
064
=== added file 'invoice_print_report_balance_payment/account_invoice.py'
--- invoice_print_report_balance_payment/account_invoice.py 1970-01-01 00:00:00 +0000
+++ invoice_print_report_balance_payment/account_invoice.py 2013-12-26 20:27:44 +0000
@@ -0,0 +1,81 @@
1# -*- encoding: utf-8 -*-
2###############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU General Public License for more details.
16#
17# You should have received a copy of the GNU General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20###############################################################################
21
22from openerp.osv import orm, fields
23
24
25class account_invoice(orm.Model):
26 _inherit = 'account.invoice'
27
28 def _previous_invoice_get(self, cr, uid, ids, field_names, arg, context=None):
29 res = {}
30 for invoice in self.browse(cr, uid, ids, context=context):
31 domain = [
32 ('date_invoice', '<', invoice.date_invoice),
33 ('partner_id', '=', invoice.partner_id.id),
34 ]
35 search_result = self.search(
36 cr, uid, domain, limit=1, order='date_invoice desc')
37 res[invoice.id] = search_result[0] if search_result else False
38 return res
39
40 def _previous_balance_get(self, cr, uid, ids, field_names, arg, context=None):
41 res = {}
42 partner_obj = self.pool.get('res.partner')
43 for invoice in self.browse(cr, uid, ids, context=context):
44 if invoice.previous_invoice_id:
45 res[invoice.id] = partner_obj.get_balance_at_date(
46 cr, uid, invoice.partner_id.id, invoice.previous_invoice_id.date_invoice,
47 context=context
48 )
49 else:
50 res[invoice.id] = 0.0
51 return res
52
53 def _to_pay_get(self, cr, uid, ids, field_names, arg, context=None):
54 res = {}
55 partner_obj = self.pool.get('res.partner')
56 for invoice in self.browse(cr, uid, ids, context=context):
57 res[invoice.id] = partner_obj.get_balance_at_date(
58 cr, uid, invoice.partner_id.id, invoice.date_invoice,
59 context=context
60 )
61 return res
62
63 def _payment_total_get(self, cr, uid, ids, field_names, arg, context=None):
64 res = {}
65 for invoice in self.browse(cr, uid, ids, context=context):
66 res[invoice.id] = invoice.previous_balance - \
67 (invoice.to_pay - invoice.amount_total)
68 return res
69
70 _columns = {
71 'previous_invoice_id': fields.function(_previous_invoice_get, type='many2one', relation='account.invoice'),
72 'previous_balance': fields.function(_previous_balance_get, type='float'),
73 'to_pay': fields.function(_to_pay_get, type='float'),
74 'payment_total': fields.function(_payment_total_get, type='float'),
75 }
76
77 def invoice_print(self, cr, uid, ids, context=None):
78 result = super(account_invoice, self).invoice_print(
79 cr, uid, ids, context=context)
80 result['report_name'] = 'account.invoice.balance_payment'
81 return result
082
=== added file 'invoice_print_report_balance_payment/partner.py'
--- invoice_print_report_balance_payment/partner.py 1970-01-01 00:00:00 +0000
+++ invoice_print_report_balance_payment/partner.py 2013-12-26 20:27:44 +0000
@@ -0,0 +1,46 @@
1# -*- encoding: utf-8 -*-
2###############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU General Public License for more details.
16#
17# You should have received a copy of the GNU General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20###############################################################################
21
22import datetime
23
24from openerp.osv import orm
25
26
27class res_partner(orm.Model):
28 _inherit = 'res.partner'
29
30 def get_balance_at_date(self, cr, uid, id, date, context=None):
31 query = self.pool.get('account.move.line')._query_get(
32 cr, uid, context=context)
33 if isinstance(date, datetime.date):
34 date = date.strftime('%Y-%m-%d')
35 sql = """SELECT SUM(l.debit-l.credit)
36 FROM account_move_line l
37 JOIN account_move m ON (l.move_id=m.id)
38 LEFT JOIN account_account a ON (l.account_id=a.id)
39 WHERE a.type IN ('receivable','payable')
40 AND l.partner_id = %s
41 AND m.date <= '%s'
42 AND %s
43 """ % (id, date, query)
44 cr.execute(sql)
45 row = cr.fetchone()
46 return row[0] if row is not None else 0
047
=== added directory 'invoice_print_report_balance_payment/report'
=== added file 'invoice_print_report_balance_payment/report/__init__.py'
--- invoice_print_report_balance_payment/report/__init__.py 1970-01-01 00:00:00 +0000
+++ invoice_print_report_balance_payment/report/__init__.py 2013-12-26 20:27:44 +0000
@@ -0,0 +1,22 @@
1# -*- encoding: utf-8 -*-
2###############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU General Public License for more details.
16#
17# You should have received a copy of the GNU General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20###############################################################################
21
22from . import invoice_print_report_balance_payment
023
=== added file 'invoice_print_report_balance_payment/report/invoice_print_report_balance_payment.py'
--- invoice_print_report_balance_payment/report/invoice_print_report_balance_payment.py 1970-01-01 00:00:00 +0000
+++ invoice_print_report_balance_payment/report/invoice_print_report_balance_payment.py 2013-12-26 20:27:44 +0000
@@ -0,0 +1,28 @@
1# -*- encoding: utf-8 -*-
2###############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU General Public License for more details.
16#
17# You should have received a copy of the GNU General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20###############################################################################
21
22from openerp.report import report_sxw
23
24report_sxw.report_sxw(
25 'report.account.invoice.balance_payment',
26 'account.invoice',
27 'addons/invoice_print_report_balance_payment/report/invoice_print_report_balance_payment.rml',
28)
029
=== added file 'invoice_print_report_balance_payment/report/invoice_print_report_balance_payment.rml'
--- invoice_print_report_balance_payment/report/invoice_print_report_balance_payment.rml 1970-01-01 00:00:00 +0000
+++ invoice_print_report_balance_payment/report/invoice_print_report_balance_payment.rml 2013-12-26 20:27:44 +0000
@@ -0,0 +1,406 @@
1<?xml version="1.0"?>
2<document filename="Invoices.pdf">
3 <template title="Invoices" author="OpenERP S.A.(sales@openerp.com)" allowSplitting="20">
4 <pageTemplate id="first">
5 <frame id="first" x1="34.0" y1="28.0" width="530" height="786"/>
6 </pageTemplate>
7 </template>
8 <stylesheet>
9 <blockTableStyle id="Standard_Outline">
10 <blockAlignment value="LEFT"/>
11 <blockValign value="TOP"/>
12 </blockTableStyle>
13 <blockTableStyle id="Table_Partner_Address">
14 <blockAlignment value="LEFT"/>
15 <blockValign value="TOP"/>
16 </blockTableStyle>
17 <blockTableStyle id="Table_Invoice_General_Header">
18 <blockAlignment value="LEFT"/>
19 <blockValign value="TOP"/>
20 <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="0,0" stop="0,-1"/>
21 <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="0,0" stop="0,0"/>
22 <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
23 <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="1,0" stop="1,-1"/>
24 <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="1,0" stop="1,0"/>
25 <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
26 <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="2,0" stop="2,-1"/>
27 <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="2,0" stop="2,-1"/>
28 <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="2,0" stop="2,0"/>
29 <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
30 <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="3,0" stop="3,-1"/>
31 <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="3,0" stop="3,-1"/>
32 <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="3,0" stop="3,0"/>
33 <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
34 </blockTableStyle>
35 <blockTableStyle id="Table_General_Detail_Content">
36 <blockAlignment value="LEFT"/>
37 <blockValign value="TOP"/>
38 <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="0,0" stop="0,-1"/>
39 <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="0,0" stop="0,0"/>
40 <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
41 <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="1,0" stop="1,-1"/>
42 <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="1,0" stop="1,0"/>
43 <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
44 <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="2,0" stop="2,-1"/>
45 <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="2,0" stop="2,-1"/>
46 <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="2,0" stop="2,0"/>
47 <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
48 <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="3,0" stop="3,-1"/>
49 <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="3,0" stop="3,-1"/>
50 <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="3,0" stop="3,0"/>
51 <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
52 </blockTableStyle>
53 <blockTableStyle id="Table7">
54 <blockAlignment value="LEFT"/>
55 <blockValign value="TOP"/>
56 <lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
57 <lineStyle kind="LINEBELOW" colorName="#000000" start="1,-1" stop="1,-1"/>
58 <lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1"/>
59 <lineStyle kind="LINEBELOW" colorName="#000000" start="3,-1" stop="3,-1"/>
60 <lineStyle kind="LINEBELOW" colorName="#000000" start="4,-1" stop="4,-1"/>
61 <lineStyle kind="LINEBELOW" colorName="#000000" start="5,-1" stop="5,-1"/>
62 </blockTableStyle>
63 <blockTableStyle id="Table8">
64 <blockAlignment value="LEFT"/>
65 <blockValign value="TOP"/>
66 <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
67 <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
68 <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
69 <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
70 <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="4,-1" stop="4,-1"/>
71 <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="5,-1" stop="5,-1"/>
72 </blockTableStyle>
73 <blockTableStyle id="Table10">
74 <blockAlignment value="LEFT"/>
75 <blockValign value="TOP"/>
76 <lineStyle kind="LINEABOVE" colorName="#000000" start="1,0" stop="1,0"/>
77 <lineStyle kind="LINEABOVE" colorName="#000000" start="2,0" stop="2,0"/>
78 <lineStyle kind="LINEABOVE" colorName="#000000" start="1,2" stop="1,2"/>
79 <lineStyle kind="LINEABOVE" colorName="#000000" start="2,2" stop="2,2"/>
80 </blockTableStyle>
81 <blockTableStyle id="Table9">
82 <blockAlignment value="LEFT"/>
83 <blockValign value="TOP"/>
84 <lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
85 <lineStyle kind="LINEBELOW" colorName="#000000" start="1,-1" stop="1,-1"/>
86 <lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1"/>
87 </blockTableStyle>
88 <blockTableStyle id="Table2">
89 <blockAlignment value="LEFT"/>
90 <blockValign value="TOP"/>
91 <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
92 <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
93 <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
94 </blockTableStyle>
95 <blockTableStyle id="Table1">
96 <blockAlignment value="LEFT"/>
97 <blockValign value="TOP"/>
98 </blockTableStyle>
99 <initialize>
100 <paraStyle name="all" alignment="justify"/>
101 </initialize>
102 <paraStyle name="Standard"/>
103 <paraStyle name="Text body" spaceBefore="0.0" spaceAfter="6.0"/>
104 <paraStyle name="List" spaceBefore="0.0" spaceAfter="6.0"/>
105 <paraStyle name="Table Contents" spaceBefore="0.0" spaceAfter="6.0"/>
106 <paraStyle name="Caption" fontSize="10.0" leading="13" spaceBefore="6.0" spaceAfter="6.0"/>
107 <paraStyle name="Index"/>
108
109 <paraStyle name="terp_header" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
110 <paraStyle name="terp_default_8" rightIndent="0.0" leftIndent="0.0" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
111 <paraStyle name="Footer"/>
112 <paraStyle name="Horizontal Line" fontSize="6.0" leading="8" spaceBefore="0.0" spaceAfter="14.0"/>
113
114 <paraStyle name="terp_tblheader_General" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
115 <paraStyle name="terp_tblheader_Details" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
116 <paraStyle name="terp_tblheader_General_Centre" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
117 <paraStyle name="terp_tblheader_General_Right" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
118 <paraStyle name="terp_tblheader_Details_Centre" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
119 <paraStyle name="terp_tblheader_Details_Right" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
120
121 <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"/>
122 <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"/>
123 <paraStyle name="terp_default_address" rightIndent="0.0" leftIndent="0.0" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
124 <paraStyle name="terp_default_9" rightIndent="0.0" leftIndent="0.0" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
125 <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"/>
126 <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"/>
127 <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"/>
128 <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"/>
129 <paraStyle name="terp_default_2" rightIndent="0.0" leftIndent="0.0" fontSize="2.0" leading="3" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
130 <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"/>
131
132 <paraStyle name="Table" fontSize="10.0" leading="13" spaceBefore="6.0" spaceAfter="6.0"/>
133 <paraStyle name="User Index 10" rightIndent="0.0" leftIndent="127.0"/>
134 <paraStyle name="Preformatted Text" fontSize="10.0" leading="13" spaceBefore="0.0" spaceAfter="0.0"/>
135 <images/>
136 </stylesheet>
137 <story>
138 <pto>
139 <para style="terp_default_8">[[ repeatIn(objects,'o') ]]</para>
140 <para style="terp_default_8">[[ setLang(o.partner_id.lang) ]]</para>
141 <pto_header><!-- Must be after setLang() -->
142 <blockTable colWidths="202.0,87.0,71.0,57.0,42.0,71.0" style="Table7">
143 <tr>
144 <td><para style="terp_tblheader_Details"><b>Description</b></para></td>
145 <td><para style="terp_tblheader_Details_Centre"><b>Taxes</b></para></td>
146 <td><para style="terp_tblheader_Details_Centre"><b>Quantity</b></para></td>
147 <td><para style="terp_tblheader_Details_Right"><b>Unit Price</b></para></td>
148 <td><para style="terp_tblheader_Details_Right"><b>Disc.(%)</b></para></td>
149 <td><para style="terp_tblheader_Details_Right"><b>Price</b></para></td>
150 </tr>
151 </blockTable>
152 </pto_header>
153 <blockTable colWidths="297.0,233.0" style="Table_Partner_Address">
154 <tr>
155 <td>
156 <para style="terp_default_8">
157 <font color="white"> </font>
158 </para>
159 </td>
160 <td>
161 <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>
162 <para style="terp_default_8">[[ display_address(o.partner_id) ]]</para>
163 <para style="terp_default_8">
164 <font color="white"> </font>
165 </para>
166 <para style="terp_default_8">Tel. : [[ (o.partner_id.phone) or removeParentNode('para') ]]</para>
167 <para style="terp_default_8">Fax : [[ (o.partner_id.fax) or removeParentNode('para') ]]</para>
168 <para style="terp_default_8">TIN : [[ (o.partner_id.vat) or removeParentNode('para') ]]</para>
169 </td>
170 </tr>
171 </blockTable>
172 <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>
173 <para style="terp_header"><b>PRO-FORMA [[ ((o.type == 'out_invoice' and o.state == 'proforma2') or removeParentNode('para')) and '' ]]</b></para>
174 <para style="terp_header"><b>Draft Invoice [[ ((o.type == 'out_invoice' and o.state == 'draft') or removeParentNode('para')) and '' ]]</b></para>
175 <para style="terp_header"><b>Cancelled Invoice [[ ((o.type == 'out_invoice' and o.state == 'cancel') or removeParentNode('para')) and '' ]] [[ o.number ]]</b></para>
176 <para style="terp_header"><b>Refund [[ (o.type=='out_refund' or removeParentNode('para')) and '' ]] [[ o.number ]]</b></para>
177 <para style="terp_header"><b>Supplier Refund [[ (o.type=='in_refund' or removeParentNode('para')) and '' ]] [[ o.number ]]</b></para>
178 <para style="terp_header"><b>Supplier Invoice [[ (o.type=='in_invoice' or removeParentNode('para')) and '' ]] [[ o.number ]]</b></para>
179 <para style="terp_default_8">
180 <font color="white"> </font>
181 </para>
182 <blockTable colWidths="132.50,132.50,132.50,132.50" style="Table_Invoice_General_Header">
183 <tr>
184 <td>
185 <para style="terp_tblheader_General_Centre"><b>Description</b></para>
186 </td>
187 <td>
188 <para style="terp_tblheader_General_Centre"><b>Invoice Date</b></para>
189 </td>
190 <td>
191 <para style="terp_tblheader_General_Centre"><b>Contract Number</b></para>
192 </td>
193 <td>
194 <para style="terp_tblheader_General_Centre"><b>Customer Code</b></para>
195 </td>
196 </tr>
197 </blockTable>
198 <blockTable colWidths="132.50,132.50,132.50,132.50" style="Table_General_Detail_Content">
199 <tr>
200 <td>
201 <para style="terp_default_Centre_9">[[ o.name or ' ' ]]</para>
202 </td>
203 <td>
204 <para style="terp_default_Centre_9">[[ formatLang(o.date_invoice,date=True) ]]</para>
205 </td>
206 <td>
207 <para style="terp_default_Centre_9">[[ o.origin or '' ]]</para>
208 </td>
209 <td>
210 <para style="terp_default_Centre_9">[[ (o.partner_id.ref) or ' ' ]]</para>
211 </td>
212 </tr>
213 </blockTable>
214 <para style="terp_default_8">
215 <font color="white"> </font>
216 </para>
217 <blockTable colWidths="255.0,80.0,60.0,50.0,85.0" style="Table7">
218 <tr>
219 <td>
220 <para style="terp_tblheader_General"><b>Description</b></para>
221 </td>
222 <td>
223 <para style="terp_tblheader_General_Right"><b>Quantity</b></para>
224 </td>
225 <td>
226 <para style="terp_tblheader_General_Right"><b>Unit Price</b></para>
227 </td>
228 <td>
229 <para style="terp_tblheader_General_Right"><b>Disc.(%)</b></para>
230 </td>
231 <td>
232 <para style="terp_tblheader_General_Right"><b>Price</b></para>
233 </td>
234 </tr>
235 </blockTable>
236 <section>
237 <para style="terp_default_2">[[ repeatIn(o.invoice_line,'l') ]]</para>
238 <blockTable colWidths="255.0,80.0,60.0,50.0,85.0" style="Table8">
239 <tr>
240 <td>
241 <para style="terp_default_9">[[ format(l.name) ]]</para>
242 </td>
243 <td>
244 <para style="terp_default_Right_9">[[ formatLang(l.quantity)]] [[ (l.uos_id and l.uos_id.name) or '' ]]</para>
245 </td>
246 <td>
247 <para style="terp_default_Right_9">[[ formatLang(l.price_unit) ]]</para>
248 </td>
249 <td>
250 <para style="terp_default_Centre_9">[[ formatLang(l.discount, dp='Account') ]] </para>
251 </td>
252 <td>
253 <para style="terp_default_Right_9">[[ formatLang(l.price_subtotal, dp='Account', currency_obj=o.currency_id) ]]</para>
254 </td>
255 </tr>
256 </blockTable>
257 </section>
258 <blockTable colWidths="335.0,110.0,85.0" style="Table10">
259 <tr>
260 <td>
261 <para style="terp_default_8">
262 <font color="white"> </font>
263 </para>
264 </td>
265 <td>
266 <para style="terp_default_9">Net Total:</para>
267 </td>
268 <td>
269 <para style="terp_default_Right_9">[[ formatLang(o.amount_untaxed, digits=get_digits(dp='Account'), currency_obj=o.currency_id) ]]</para>
270 </td>
271 </tr>
272 <tr>
273 <td>
274 <para style="terp_default_8">
275 <font color="white"> </font>
276 </para>
277 </td>
278 <td>
279 <para style="terp_default_9">Taxes:</para>
280 </td>
281 <td>
282 <para style="terp_default_Right_9">[[ formatLang(o.amount_tax, dp='Account', currency_obj=o.currency_id) ]]</para>
283 </td>
284 </tr>
285 <tr>
286 <td>
287 <para style="terp_default_8">
288 <font color="white"> </font>
289 </para>
290 </td>
291 <td>
292 <para style="terp_default_9"><b>Total:</b></para>
293 </td>
294 <td>
295 <para style="terp_default_Right_9"><b>[[ formatLang(o.amount_total, digits=get_digits(dp='Account'), currency_obj=o.currency_id) ]]</b></para>
296 </td>
297 </tr>
298 <tr>
299 <td>
300 <para style="terp_default_8">
301 <font color="white"> </font>
302 </para>
303 </td>
304 <td>
305 <para style="terp_default_9">Previous Balance:</para>
306 </td>
307 <td>
308 <para style="terp_default_Right_9">[[ formatLang(o.previous_balance, digits=get_digits(dp='Account'), currency_obj=o.currency_id) ]]</para>
309 </td>
310 </tr>
311 <tr>
312 <td>
313 <para style="terp_default_8">
314 <font color="white"> </font>
315 </para>
316 </td>
317 <td>
318 <para style="terp_default_9">Payments:</para>
319 </td>
320 <td>
321 <para style="terp_default_Right_9">[[ formatLang(o.payment_total, digits=get_digits(dp='Account'), currency_obj=o.currency_id) ]]</para>
322 </td>
323 </tr>
324 <tr>
325 <td>
326 <para style="terp_default_8">
327 <font color="white"> </font>
328 </para>
329 </td>
330 <td>
331 <para style="terp_default_9"><b>To Pay:</b></para>
332 </td>
333 <td>
334 <para style="terp_default_Right_9"><b>[[ formatLang(o.to_pay, digits=get_digits(dp='Account'), currency_obj=o.currency_id) ]]</b></para>
335 </td>
336 </tr>
337 </blockTable>
338 <para style="Text body">
339 <font color="white"> </font>
340 </para>
341 <blockTable colWidths="205.0,71.0,71.0,183.0" style="Table9">
342 <tr>
343 <td>
344 <para style="terp_tblheader_Details"><b>Tax [[ o.tax_line==[] and removeParentNode('blockTable') ]]</b></para>
345 </td>
346 <td>
347 <para style="terp_tblheader_Details_Right"><b>Base </b></para>
348 </td>
349 <td>
350 <para style="terp_tblheader_Details_Right"><b>Amount </b></para>
351 </td>
352 <td>
353 <para style="terp_default_8">
354 <font color="white"> </font>
355 </para>
356 </td>
357 </tr>
358 </blockTable>
359 <section>
360 <para style="terp_default_2">[[ repeatIn(o.tax_line,'t') ]]</para>
361 <blockTable colWidths="205.0,71.0,71.0,184.0" style="Table2">
362 <tr>
363 <td>
364 <para style="terp_default_8">[[ t.name ]]</para>
365 </td>
366 <td>
367 <para style="terp_default_Right_8">[[ formatLang(t.base, dp='Account', currency_obj=o.currency_id) ]]</para>
368 </td>
369 <td>
370 <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>
371 </td>
372 <td>
373 <para style="terp_default_8">
374 <font color="white"> </font>
375 </para>
376 </td>
377 </tr>
378 </blockTable>
379 </section>
380 <para style="terp_default_9">
381 <font color="white"> </font>
382 </para>
383 <para style="terp_default_9">[[ (o.comment and format(o.comment )) or removeParentNode('para') ]]</para>
384 <para style="terp_default_8">
385 <font color="white"> </font>
386 </para>
387 <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>
388 <para style="terp_default_9">
389 <font color="white"> </font>
390 </para>
391 <blockTable colWidths="120.0,410.0" style="Table1">
392 <tr>
393 <td>
394 <para style="terp_default_Bold_9"><b>Fiscal Position Remark : </b></para>
395 </td>
396 <td>
397 <para style="terp_default_9">[[ (o.fiscal_position and o.fiscal_position.note and format(o.fiscal_position.note)) or removeParentNode('blockTable') ]]</para>
398 </td>
399 </tr>
400 </blockTable>
401 <para style="terp_default_2">
402 <font color="white"> </font>
403 </para>
404 </pto>
405 </story>
406</document>
0407
=== added file 'invoice_print_report_balance_payment/reports.xml'
--- invoice_print_report_balance_payment/reports.xml 1970-01-01 00:00:00 +0000
+++ invoice_print_report_balance_payment/reports.xml 2013-12-26 20:27:44 +0000
@@ -0,0 +1,11 @@
1<?xml version="1.0" encoding="utf-8"?>
2<openerp>
3 <data>
4 <report auto="False"
5 id="invoice_print_report_payment_balance"
6 model="account.invoice"
7 name="account.invoice.balance_payment"
8 rml="invoice_print_report_balance_payment/report/invoice_print_report_balance_payment.rml"
9 string="Invoices (with balance payments)" />
10 </data>
11</openerp>

Subscribers

People subscribed via source and target branches