← Back to team overview

savoirfairelinux-openerp team mailing list archive

lp:~savoirfairelinux-openerp/account-invoice-report/invoice_print_report_balance_payment into lp:account-invoice-report

 

Sandy Carter (http://www.savoirfairelinux.com) has proposed merging lp:~savoirfairelinux-openerp/account-invoice-report/invoice_print_report_balance_payment into lp:account-invoice-report.

Requested reviews:
  Maxime Chambreuil (http://www.savoirfairelinux.com) (max3903)

For more details, see:
https://code.launchpad.net/~savoirfairelinux-openerp/account-invoice-report/invoice_print_report_balance_payment/+merge/198457

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.
-- 
https://code.launchpad.net/~savoirfairelinux-openerp/account-invoice-report/invoice_print_report_balance_payment/+merge/198457
Your team Savoir-faire Linux' OpenERP is subscribed to branch lp:~savoirfairelinux-openerp/account-invoice-report/invoice_print_report_balance_payment.
=== 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-10 20:09:48 +0000
@@ -0,0 +1,24 @@
+# -*- encoding: utf-8 -*-
+###############################################################################
+#
+#    OpenERP, Open Source Management Solution
+#    Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
+#
+#    This program is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU General Public License as
+#    published by the Free Software Foundation, either version 3 of the
+#    License, or (at your option) any later version.
+#
+#    This program is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#    GNU General Public License for more details.
+#
+#    You should have received a copy of the GNU General Public License
+#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+###############################################################################
+
+import account_invoice
+import partner
+import report

=== 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-10 20:09:48 +0000
@@ -0,0 +1,62 @@
+# -*- encoding: utf-8 -*-
+###############################################################################
+#
+#    OpenERP, Open Source Management Solution
+#    Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
+#
+#    This program is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU General Public License as
+#    published by the Free Software Foundation, either version 3 of the
+#    License, or (at your option) any later version.
+#
+#    This program is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#    GNU General Public License for more details.
+#
+#    You should have received a copy of the GNU General Public License
+#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+###############################################################################
+
+{
+    "name": "Print invoices with balance payments",
+    'version': '1.0',
+    'author': 'Savoir-faire Linux',
+    'maintainer': 'Savoir-faire Linux',
+    'website': 'http://www.savoirfairelinux.com',
+    'license': 'AGPL-3',
+    "category": "Accounting & Finance",
+    'summary': "Prints invoices with balance payments (and other things)",
+    'description': """
+Print invoices with balance payments
+====================================
+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.
+
+Contributors:
+* Virgil Dupras (virgil.dupras@xxxxxxxxxxxxxxxxxxxx)
+""",
+    "depends": ['account'],
+    'external_dependencies': {
+        'python': [],
+    },
+    'data': [],
+    'update_xml': [
+        'reports.xml',
+    ],
+    'demo': [],
+    'test': [],
+    'installable': True,
+    'active': False,
+}

=== 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-10 20:09:48 +0000
@@ -0,0 +1,85 @@
+# -*- encoding: utf-8 -*-
+###############################################################################
+#
+#    OpenERP, Open Source Management Solution
+#    Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
+#
+#    This program is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU General Public License as
+#    published by the Free Software Foundation, either version 3 of the
+#    License, or (at your option) any later version.
+#
+#    This program is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#    GNU General Public License for more details.
+#
+#    You should have received a copy of the GNU General Public License
+#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+###############################################################################
+
+import logging
+
+from openerp.osv import orm, fields
+
+_logger = logging.getLogger(__name__)
+
+
+class account_invoice(orm.Model):
+    _inherit = 'account.invoice'
+
+    def _previous_invoice_get(self, cr, uid, ids, field_names, arg, context=None):
+        res = {}
+        for invoice in self.browse(cr, uid, ids, context=context):
+            domain = [
+                ('date_invoice', '<', invoice.date_invoice),
+                ('partner_id', '=', invoice.partner_id.id),
+            ]
+            search_result = self.search(
+                cr, uid, domain, limit=1, order='date_invoice desc')
+            res[invoice.id] = search_result[0] if search_result else False
+        return res
+
+    def _previous_balance_get(self, cr, uid, ids, field_names, arg, context=None):
+        res = {}
+        partner_obj = self.pool.get('res.partner')
+        for invoice in self.browse(cr, uid, ids, context=context):
+            if invoice.previous_invoice_id:
+                res[invoice.id] = partner_obj.get_balance_at_date(
+                    cr, uid, invoice.partner_id.id, invoice.previous_invoice_id.date_invoice,
+                    context=context
+                )
+            else:
+                res[invoice.id] = 0.0
+        return res
+
+    def _to_pay_get(self, cr, uid, ids, field_names, arg, context=None):
+        res = {}
+        partner_obj = self.pool.get('res.partner')
+        for invoice in self.browse(cr, uid, ids, context=context):
+            res[invoice.id] = partner_obj.get_balance_at_date(
+                cr, uid, invoice.partner_id.id, invoice.date_invoice,
+                context=context
+            )
+        return res
+
+    def _payment_total_get(self, cr, uid, ids, field_names, arg, context=None):
+        res = {}
+        for invoice in self.browse(cr, uid, ids, context=context):
+            res[invoice.id] = invoice.previous_balance - \
+                (invoice.to_pay - invoice.amount_total)
+        return res
+
+    _columns = {
+        'previous_invoice_id': fields.function(_previous_invoice_get, type='many2one', relation='account.invoice'),
+        'previous_balance': fields.function(_previous_balance_get, type='float'),
+        'to_pay': fields.function(_to_pay_get, type='float'),
+        'payment_total': fields.function(_payment_total_get, type='float'),
+    }
+
+    def invoice_print(self, cr, uid, ids, context=None):
+        result = super(account_invoice, self).invoice_print(
+            cr, uid, ids, context=context)
+        result['report_name'] = 'account.invoice.balance_payment'
+        return result

=== 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-10 20:09:48 +0000
@@ -0,0 +1,49 @@
+# -*- encoding: utf-8 -*-
+###############################################################################
+#
+#    OpenERP, Open Source Management Solution
+#    Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
+#
+#    This program is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU General Public License as
+#    published by the Free Software Foundation, either version 3 of the
+#    License, or (at your option) any later version.
+#
+#    This program is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#    GNU General Public License for more details.
+#
+#    You should have received a copy of the GNU General Public License
+#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+###############################################################################
+
+import datetime
+import logging
+
+from openerp.osv import orm
+
+_logger = logging.getLogger(__name__)
+
+
+class res_partner(orm.Model):
+    _inherit = 'res.partner'
+
+    def get_balance_at_date(self, cr, uid, id, date, context=None):
+        query = self.pool.get('account.move.line')._query_get(
+            cr, uid, context=context)
+        if isinstance(date, datetime.date):
+            date = date.strftime('%Y-%m-%d')
+        sql = """SELECT SUM(l.debit-l.credit)
+                 FROM account_move_line l
+                 JOIN account_move m ON (l.move_id=m.id)
+                 LEFT JOIN account_account a ON (l.account_id=a.id)
+                 WHERE a.type IN ('receivable','payable')
+                 AND l.partner_id = %s
+                 AND m.date <= '%s'
+                 AND %s
+        """ % (id, date, query)
+        cr.execute(sql)
+        row = cr.fetchone()
+        return row[0] if row is not None else 0

=== 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-10 20:09:48 +0000
@@ -0,0 +1,1 @@
+import invoice_print_report_balance_payment

=== 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-10 20:09:48 +0000
@@ -0,0 +1,28 @@
+# -*- encoding: utf-8 -*-
+#
+#
+#    OpenERP, Open Source Management Solution
+#    Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
+#
+#    This program is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU General Public License as
+#    published by the Free Software Foundation, either version 3 of the
+#    License, or (at your option) any later version.
+#
+#    This program is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#    GNU General Public License for more details.
+#
+#    You should have received a copy of the GNU General Public License
+#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+#
+
+from openerp.report import report_sxw
+
+report_sxw.report_sxw(
+    'report.account.invoice.balance_payment',
+    'account.invoice',
+    'addons/invoice_print_report_balance_payment/report/invoice_print_report_balance_payment.rml',
+)

=== 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-10 20:09:48 +0000
@@ -0,0 +1,406 @@
+<?xml version="1.0"?>
+<document filename="Invoices.pdf">
+  <template title="Invoices" author="OpenERP S.A.(sales@xxxxxxxxxxx)" allowSplitting="20">
+    <pageTemplate id="first">
+      <frame id="first" x1="34.0" y1="28.0" width="530" height="786"/>
+    </pageTemplate>
+  </template>
+  <stylesheet>
+    <blockTableStyle id="Standard_Outline">
+      <blockAlignment value="LEFT"/>
+      <blockValign value="TOP"/>
+    </blockTableStyle>
+    <blockTableStyle id="Table_Partner_Address">
+      <blockAlignment value="LEFT"/>
+      <blockValign value="TOP"/>
+    </blockTableStyle>
+    <blockTableStyle id="Table_Invoice_General_Header">
+      <blockAlignment value="LEFT"/>
+      <blockValign value="TOP"/>
+      <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="0,0" stop="0,-1"/>
+      <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="0,0" stop="0,0"/>
+      <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
+      <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="1,0" stop="1,-1"/>
+      <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="1,0" stop="1,0"/>
+      <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
+      <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="2,0" stop="2,-1"/>
+      <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="2,0" stop="2,-1"/>
+      <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="2,0" stop="2,0"/>
+      <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
+      <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="3,0" stop="3,-1"/>
+      <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="3,0" stop="3,-1"/>
+      <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="3,0" stop="3,0"/>
+      <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
+    </blockTableStyle>
+    <blockTableStyle id="Table_General_Detail_Content">
+      <blockAlignment value="LEFT"/>
+      <blockValign value="TOP"/>
+      <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="0,0" stop="0,-1"/>
+      <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="0,0" stop="0,0"/>
+      <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
+      <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="1,0" stop="1,-1"/>
+      <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="1,0" stop="1,0"/>
+      <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
+      <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="2,0" stop="2,-1"/>
+      <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="2,0" stop="2,-1"/>
+      <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="2,0" stop="2,0"/>
+      <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
+      <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="3,0" stop="3,-1"/>
+      <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="3,0" stop="3,-1"/>
+      <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="3,0" stop="3,0"/>
+      <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
+    </blockTableStyle>
+    <blockTableStyle id="Table7">
+      <blockAlignment value="LEFT"/>
+      <blockValign value="TOP"/>
+      <lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
+      <lineStyle kind="LINEBELOW" colorName="#000000" start="1,-1" stop="1,-1"/>
+      <lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1"/>
+      <lineStyle kind="LINEBELOW" colorName="#000000" start="3,-1" stop="3,-1"/>
+      <lineStyle kind="LINEBELOW" colorName="#000000" start="4,-1" stop="4,-1"/>
+      <lineStyle kind="LINEBELOW" colorName="#000000" start="5,-1" stop="5,-1"/>
+    </blockTableStyle>
+    <blockTableStyle id="Table8">
+      <blockAlignment value="LEFT"/>
+      <blockValign value="TOP"/>
+      <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
+      <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
+      <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
+      <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
+      <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="4,-1" stop="4,-1"/>
+      <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="5,-1" stop="5,-1"/>
+    </blockTableStyle>
+    <blockTableStyle id="Table10">
+      <blockAlignment value="LEFT"/>
+      <blockValign value="TOP"/>
+      <lineStyle kind="LINEABOVE" colorName="#000000" start="1,0" stop="1,0"/>
+      <lineStyle kind="LINEABOVE" colorName="#000000" start="2,0" stop="2,0"/>
+      <lineStyle kind="LINEABOVE" colorName="#000000" start="1,2" stop="1,2"/>
+      <lineStyle kind="LINEABOVE" colorName="#000000" start="2,2" stop="2,2"/>
+    </blockTableStyle>
+    <blockTableStyle id="Table9">
+      <blockAlignment value="LEFT"/>
+      <blockValign value="TOP"/>
+      <lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
+      <lineStyle kind="LINEBELOW" colorName="#000000" start="1,-1" stop="1,-1"/>
+      <lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1"/>
+    </blockTableStyle>
+    <blockTableStyle id="Table2">
+      <blockAlignment value="LEFT"/>
+      <blockValign value="TOP"/>
+      <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
+      <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
+      <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
+    </blockTableStyle>
+    <blockTableStyle id="Table1">
+      <blockAlignment value="LEFT"/>
+      <blockValign value="TOP"/>
+    </blockTableStyle>
+    <initialize>
+      <paraStyle name="all" alignment="justify"/>
+    </initialize>
+    <paraStyle name="Standard"/>
+    <paraStyle name="Text body" spaceBefore="0.0" spaceAfter="6.0"/>
+    <paraStyle name="List" spaceBefore="0.0" spaceAfter="6.0"/>
+    <paraStyle name="Table Contents" spaceBefore="0.0" spaceAfter="6.0"/>
+    <paraStyle name="Caption" fontSize="10.0" leading="13" spaceBefore="6.0" spaceAfter="6.0"/>
+    <paraStyle name="Index"/>
+
+    <paraStyle name="terp_header" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
+    <paraStyle name="terp_default_8" rightIndent="0.0" leftIndent="0.0" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
+    <paraStyle name="Footer"/>
+    <paraStyle name="Horizontal Line" fontSize="6.0" leading="8" spaceBefore="0.0" spaceAfter="14.0"/>
+
+    <paraStyle name="terp_tblheader_General" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
+    <paraStyle name="terp_tblheader_Details" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
+    <paraStyle name="terp_tblheader_General_Centre" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
+    <paraStyle name="terp_tblheader_General_Right" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
+    <paraStyle name="terp_tblheader_Details_Centre" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
+    <paraStyle name="terp_tblheader_Details_Right" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
+
+    <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"/>
+    <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"/>
+    <paraStyle name="terp_default_address" rightIndent="0.0" leftIndent="0.0" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
+    <paraStyle name="terp_default_9" rightIndent="0.0" leftIndent="0.0" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
+    <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"/>
+    <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"/>
+    <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"/>
+    <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"/>
+    <paraStyle name="terp_default_2" rightIndent="0.0" leftIndent="0.0" fontSize="2.0" leading="3" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
+    <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"/>
+
+    <paraStyle name="Table" fontSize="10.0" leading="13" spaceBefore="6.0" spaceAfter="6.0"/>
+    <paraStyle name="User Index 10" rightIndent="0.0" leftIndent="127.0"/>
+    <paraStyle name="Preformatted Text" fontSize="10.0" leading="13" spaceBefore="0.0" spaceAfter="0.0"/>
+    <images/>
+  </stylesheet>
+  <story>
+  <pto>
+    <para style="terp_default_8">[[ repeatIn(objects,'o') ]]</para>
+    <para style="terp_default_8">[[ setLang(o.partner_id.lang) ]]</para>
+    <pto_header><!-- Must be after setLang() -->
+    <blockTable colWidths="202.0,87.0,71.0,57.0,42.0,71.0" style="Table7">
+    <tr>
+        <td><para style="terp_tblheader_Details"><b>Description</b></para></td>
+        <td><para style="terp_tblheader_Details_Centre"><b>Taxes</b></para></td>
+        <td><para style="terp_tblheader_Details_Centre"><b>Quantity</b></para></td>
+        <td><para style="terp_tblheader_Details_Right"><b>Unit Price</b></para></td>
+        <td><para style="terp_tblheader_Details_Right"><b>Disc.(%)</b></para></td>
+        <td><para style="terp_tblheader_Details_Right"><b>Price</b></para></td>
+    </tr>
+    </blockTable>
+    </pto_header>
+    <blockTable colWidths="297.0,233.0" style="Table_Partner_Address">
+      <tr>
+        <td>
+          <para style="terp_default_8">
+            <font color="white"> </font>
+          </para>
+        </td>
+        <td>
+          <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>
+          <para style="terp_default_8">[[ display_address(o.partner_id) ]]</para>
+          <para style="terp_default_8">
+            <font color="white"> </font>
+          </para>
+          <para style="terp_default_8">Tel. : [[ (o.partner_id.phone) or removeParentNode('para') ]]</para>
+          <para style="terp_default_8">Fax : [[ (o.partner_id.fax) or removeParentNode('para') ]]</para>
+          <para style="terp_default_8">TIN : [[ (o.partner_id.vat) or removeParentNode('para') ]]</para>
+        </td>
+      </tr>
+    </blockTable>
+    <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>
+    <para style="terp_header"><b>PRO-FORMA [[ ((o.type == 'out_invoice' and o.state == 'proforma2') or removeParentNode('para')) and '' ]]</b></para>
+    <para style="terp_header"><b>Draft Invoice [[ ((o.type == 'out_invoice' and o.state == 'draft') or removeParentNode('para')) and '' ]]</b></para>
+    <para style="terp_header"><b>Cancelled Invoice [[ ((o.type == 'out_invoice' and o.state == 'cancel') or removeParentNode('para')) and '' ]] [[ o.number ]]</b></para>
+    <para style="terp_header"><b>Refund [[ (o.type=='out_refund' or removeParentNode('para')) and '' ]] [[ o.number ]]</b></para>
+    <para style="terp_header"><b>Supplier Refund [[ (o.type=='in_refund' or removeParentNode('para')) and '' ]] [[ o.number ]]</b></para>
+    <para style="terp_header"><b>Supplier Invoice [[ (o.type=='in_invoice' or removeParentNode('para')) and '' ]] [[ o.number ]]</b></para>
+    <para style="terp_default_8">
+      <font color="white"> </font>
+    </para>
+    <blockTable colWidths="132.50,132.50,132.50,132.50" style="Table_Invoice_General_Header">
+      <tr>
+        <td>
+          <para style="terp_tblheader_General_Centre"><b>Description</b></para>
+        </td>
+        <td>
+          <para style="terp_tblheader_General_Centre"><b>Invoice Date</b></para>
+        </td>
+        <td>
+          <para style="terp_tblheader_General_Centre"><b>Contract Number</b></para>
+        </td>
+        <td>
+          <para style="terp_tblheader_General_Centre"><b>Customer Code</b></para>
+        </td>
+      </tr>
+    </blockTable>
+    <blockTable colWidths="132.50,132.50,132.50,132.50" style="Table_General_Detail_Content">
+      <tr>
+        <td>
+          <para style="terp_default_Centre_9">[[ o.name or ' ' ]]</para>
+        </td>
+        <td>
+          <para style="terp_default_Centre_9">[[ formatLang(o.date_invoice,date=True) ]]</para>
+        </td>
+    <td>
+          <para style="terp_default_Centre_9">[[ o.origin or '' ]]</para>
+        </td>
+        <td>
+          <para style="terp_default_Centre_9">[[ (o.partner_id.ref) or ' ' ]]</para>
+        </td>
+      </tr>
+    </blockTable>
+    <para style="terp_default_8">
+      <font color="white"> </font>
+    </para>
+    <blockTable colWidths="255.0,80.0,60.0,50.0,85.0" style="Table7">
+      <tr>
+        <td>
+          <para style="terp_tblheader_General"><b>Description</b></para>
+        </td>
+        <td>
+          <para style="terp_tblheader_General_Right"><b>Quantity</b></para>
+        </td>
+        <td>
+          <para style="terp_tblheader_General_Right"><b>Unit Price</b></para>
+        </td>
+        <td>
+          <para style="terp_tblheader_General_Right"><b>Disc.(%)</b></para>
+        </td>
+        <td>
+          <para style="terp_tblheader_General_Right"><b>Price</b></para>
+        </td>
+      </tr>
+    </blockTable>
+    <section>
+      <para style="terp_default_2">[[ repeatIn(o.invoice_line,'l') ]]</para>
+      <blockTable colWidths="255.0,80.0,60.0,50.0,85.0" style="Table8">
+        <tr>
+          <td>
+            <para style="terp_default_9">[[ format(l.name) ]]</para>
+          </td>
+          <td>
+            <para style="terp_default_Right_9">[[ formatLang(l.quantity)]] [[ (l.uos_id and l.uos_id.name) or '' ]]</para>
+          </td>
+          <td>
+            <para style="terp_default_Right_9">[[ formatLang(l.price_unit) ]]</para>
+          </td>
+          <td>
+            <para style="terp_default_Centre_9">[[ formatLang(l.discount, dp='Account') ]] </para>
+          </td>
+          <td>
+            <para style="terp_default_Right_9">[[ formatLang(l.price_subtotal, dp='Account', currency_obj=o.currency_id) ]]</para>
+          </td>
+        </tr>
+      </blockTable>
+    </section>
+    <blockTable colWidths="335.0,110.0,85.0" style="Table10">
+      <tr>
+        <td>
+          <para style="terp_default_8">
+            <font color="white"> </font>
+          </para>
+        </td>
+        <td>
+          <para style="terp_default_9">Net Total:</para>
+        </td>
+        <td>
+          <para style="terp_default_Right_9">[[ formatLang(o.amount_untaxed, digits=get_digits(dp='Account'), currency_obj=o.currency_id) ]]</para>
+        </td>
+      </tr>
+      <tr>
+        <td>
+          <para style="terp_default_8">
+            <font color="white"> </font>
+          </para>
+        </td>
+        <td>
+          <para style="terp_default_9">Taxes:</para>
+        </td>
+        <td>
+          <para style="terp_default_Right_9">[[ formatLang(o.amount_tax, dp='Account', currency_obj=o.currency_id) ]]</para>
+        </td>
+      </tr>
+      <tr>
+        <td>
+          <para style="terp_default_8">
+            <font color="white"> </font>
+          </para>
+        </td>
+        <td>
+          <para style="terp_default_9"><b>Total:</b></para>
+        </td>
+        <td>
+          <para style="terp_default_Right_9"><b>[[ formatLang(o.amount_total, digits=get_digits(dp='Account'), currency_obj=o.currency_id) ]]</b></para>
+        </td>
+      </tr>
+      <tr>
+        <td>
+          <para style="terp_default_8">
+            <font color="white"> </font>
+          </para>
+        </td>
+        <td>
+          <para style="terp_default_9">Previous Balance:</para>
+        </td>
+        <td>
+          <para style="terp_default_Right_9">[[ formatLang(o.previous_balance, digits=get_digits(dp='Account'), currency_obj=o.currency_id) ]]</para>
+        </td>
+      </tr>
+      <tr>
+        <td>
+          <para style="terp_default_8">
+            <font color="white"> </font>
+          </para>
+        </td>
+        <td>
+          <para style="terp_default_9">Payments:</para>
+        </td>
+        <td>
+          <para style="terp_default_Right_9">[[ formatLang(o.payment_total, digits=get_digits(dp='Account'), currency_obj=o.currency_id) ]]</para>
+        </td>
+      </tr>
+      <tr>
+        <td>
+          <para style="terp_default_8">
+            <font color="white"> </font>
+          </para>
+        </td>
+        <td>
+          <para style="terp_default_9"><b>To Pay:</b></para>
+        </td>
+        <td>
+          <para style="terp_default_Right_9"><b>[[ formatLang(o.to_pay, digits=get_digits(dp='Account'), currency_obj=o.currency_id) ]]</b></para>
+        </td>
+      </tr>
+    </blockTable>
+    <para style="Text body">
+      <font color="white"> </font>
+    </para>
+    <blockTable colWidths="205.0,71.0,71.0,183.0" style="Table9">
+      <tr>
+        <td>
+          <para style="terp_tblheader_Details"><b>Tax [[ o.tax_line==[] and removeParentNode('blockTable') ]]</b></para>
+        </td>
+        <td>
+          <para style="terp_tblheader_Details_Right"><b>Base </b></para>
+        </td>
+        <td>
+          <para style="terp_tblheader_Details_Right"><b>Amount </b></para>
+        </td>
+        <td>
+          <para style="terp_default_8">
+            <font color="white"> </font>
+          </para>
+        </td>
+      </tr>
+    </blockTable>
+    <section>
+      <para style="terp_default_2">[[ repeatIn(o.tax_line,'t') ]]</para>
+      <blockTable colWidths="205.0,71.0,71.0,184.0" style="Table2">
+        <tr>
+          <td>
+            <para style="terp_default_8">[[ t.name ]]</para>
+          </td>
+          <td>
+            <para style="terp_default_Right_8">[[ formatLang(t.base, dp='Account', currency_obj=o.currency_id) ]]</para>
+          </td>
+          <td>
+            <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>
+          </td>
+          <td>
+            <para style="terp_default_8">
+              <font color="white"> </font>
+            </para>
+          </td>
+        </tr>
+      </blockTable>
+    </section>
+    <para style="terp_default_9">
+      <font color="white"> </font>
+    </para>
+    <para style="terp_default_9">[[ (o.comment and format(o.comment )) or removeParentNode('para') ]]</para>
+    <para style="terp_default_8">
+      <font color="white"> </font>
+    </para>
+    <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>
+    <para style="terp_default_9">
+      <font color="white"> </font>
+    </para>
+    <blockTable colWidths="120.0,410.0" style="Table1">
+      <tr>
+        <td>
+          <para style="terp_default_Bold_9"><b>Fiscal Position Remark : </b></para>
+        </td>
+        <td>
+          <para style="terp_default_9">[[ (o.fiscal_position and o.fiscal_position.note and format(o.fiscal_position.note)) or removeParentNode('blockTable') ]]</para>
+        </td>
+      </tr>
+    </blockTable>
+    <para style="terp_default_2">
+      <font color="white"> </font>
+    </para>
+  </pto>
+  </story>
+</document>

=== 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-10 20:09:48 +0000
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+    <data>
+        <report auto="False"
+                id="invoice_print_report_payment_balance"
+                model="account.invoice"
+                name="account.invoice.balance_payment"
+                rml="invoice_print_report_balance_payment/report/invoice_print_report_balance_payment.rml"
+                string="Invoices (with balance payments)" />
+    </data>
+</openerp>


Follow ups