diff --git a/account_financial_report_webkit/__init__.py b/account_financial_report_webkit/__init__.py
new file mode 100644
index 00000000..1583e4ad
--- /dev/null
+++ b/account_financial_report_webkit/__init__.py
@@ -0,0 +1,23 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+# Author: Nicolas Bessi. Copyright Camptocamp SA
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero 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 Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see .
+#
+##############################################################################
+import account
+from . import wizard
+from . import report
+from . import account_move_line
\ No newline at end of file
diff --git a/account_financial_report_webkit/__openerp__.py b/account_financial_report_webkit/__openerp__.py
new file mode 100644
index 00000000..d756e2b3
--- /dev/null
+++ b/account_financial_report_webkit/__openerp__.py
@@ -0,0 +1,132 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+# Authors: Nicolas Bessi, Guewen Baconnier
+# Copyright Camptocamp SA 2011
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero 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 Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see .
+#
+##############################################################################
+# TODO refactor helper in order to act more like mixin
+# By using properties we will have a more simple signature in fuctions
+{
+ 'name': 'Webkit based extended report financial report',
+ 'description': """
+This module replace the following standard openerp financial reports :
+ - General ledger
+ - Trial Balance (simple or comparative view)
+ - Partner ledger
+ - Partner balance
+ - Open invoices report
+
+
+Main improvements per report:
+
+ * The General ledger: details of all entries posted in your books sorted by account.
+ - Filter by account in the wizard (no need to go to the Chart of account to do this anymore)
+ or by view account (the report will display all regular children account) ie: you can select all P&L accounts.
+ - The report will now print only account with movements OR with a balance not null. No more endless
+ report with accounts with no data. (field: display account is hidden)
+ - initial balance calculation on the fly if no open entry posted
+ - Thanks to a new checkbox in account form, you will have possibility to centralize any accounts you like.
+ Ie: you do not want to see all entries posted under the account ‘VAT on sales’; you will only see aggregated amounts by periods.
+ - Counterpart account displayed for each transaction (3 accounts max.) to ease searching.
+ - Better ergonomy on the wizard: important information at the top, filters in the middle, options
+ at the bottom or separate tab, more specific filtering on a other tabs. No more unique wizard layout
+ for all financial reports (ie: we have removed the journal tab for the GL report)
+ - improved report style
+
+ * The partner ledger: details of entries relative to payable & receivable accounts posted in your books sorted by account and partner.
+ - Filter by partner now possible
+ - Now you can see accounts then Partner with subtotals for each account allowing you to check you data
+ with trial balance and partner balance for instance & accounts are ordered the same way than in the Chart of account
+ - period have been added (date only is uncompleted since date can be outside period)
+ - Reconciliation code added
+ - subtotal by account
+ - alpha sorting (same in partner balance)
+
+ * Open invoice report : other version of the partner ledger showing unreconciled / partially reconcies entries
+(added on the 20/01/2012)
+ - Possibility to print unreconciled transactions only at any date in the past (thanks to the brand-new field:
+ last_rec_date which calculated the last move line reconciled date). No more pain to get open invoices at the last closing date.
+ - no initial balance calculated because the report shows open invoices from previous years.
+
+ * The Trial balance: list of account with balances
+ - you can either see the column : Initial balance , debit, credit , end balance or compare balances over 4 periods of your choice
+ - You can select the filter opening to get the opening trial balance only
+ - If you create a extra virtual charts (using consolidated account) of account for your P&L and your balance sheet,
+ you can print your statutory accounts (with comparision over years for ex.)
+ - If you compare 2 periods, you will get differences in value and % also
+
+ * The Partner balance: list of account with balances
+ - subtotal by account & partner
+ - alpha sorting (same in partner balance)
+
+Limitations:
+In order to run properly this module make sure you have installed the librairie ‘wkhtmltopdf’
+for the pdf rendering (this library path must be added to you company settings).
+
+Initial balances in these reports are based either on opening entry
+posted in the opening period or calculated on the fly. So make sure,
+your past accounting opening entries are in a opening period.
+Initials balances are not calculated when using date filter (since a
+date can be outside its logical period and IB could be different by
+date Vs IB by period) The opening period is assumed to be the 01.01 of
+the year with an opening flag and the first period of the year must
+starts also the 01.01
+
+Totals for amount in currencies are affective if the partner belong to
+an account with a secondary currency.
+
+html headers and footers are deactivated for these reports because of
+an issue of wkhtmltopdf :
+http://code.google.com/p/wkhtmltopdf/issues/detail?id=656 Instead, the
+header and footer are created as text with arguments passed to
+wkhtmltopdf. The texts are defined inside the report classes.
+
+""",
+ 'version': '1.0',
+ 'author': 'Camptocamp',
+ 'category': 'Finance',
+ 'website': 'http://www.camptocamp.com',
+ 'images': [
+ 'images/ledger.png',],
+ 'depends': ['account',
+ 'report_webkit'],
+ 'init_xml': [],
+ 'demo_xml' : [],
+ 'update_xml': ['account_view.xml',
+ 'account_move_line_view.xml',
+ 'data/financial_webkit_header.xml',
+ 'report/report.xml',
+ 'wizard/wizard.xml',
+ 'wizard/balance_common_view.xml',
+ 'wizard/general_ledger_wizard_view.xml',
+ 'wizard/partners_ledger_wizard_view.xml',
+ 'wizard/trial_balance_wizard_view.xml',
+ 'wizard/partner_balance_wizard_view.xml',
+ 'wizard/open_invoices_wizard_view.xml',
+ 'report_menus.xml',
+# 'wizard/profit_loss_wizard_view.xml',
+ ],
+ # tests order matter
+ 'test': ['tests/general_ledger.yml',
+ 'tests/partner_ledger.yml',
+ 'tests/trial_balance.yml',
+ 'tests/partner_balance.yml',
+ 'tests/open_invoices.yml',],
+ #'tests/account_move_line.yml'
+ 'active': False,
+ 'installable': True,
+}
diff --git a/account_financial_report_webkit/account.py b/account_financial_report_webkit/account.py
new file mode 100644
index 00000000..d7d28f30
--- /dev/null
+++ b/account_financial_report_webkit/account.py
@@ -0,0 +1,45 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# Copyright (c) 2011 Camptocamp SA (http://www.camptocamp.com)
+#
+# Author : Guewen Baconnier (Camptocamp)
+#
+# WARNING: This program as such is intended to be used by professional
+# programmers who take the whole responsability of assessing all potential
+# consequences resulting from its eventual inadequacies and bugs
+# End users who are looking for a ready-to-use solution with commercial
+# garantees and support are strongly adviced to contract a Free Software
+# Service Company
+#
+# 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 2
+# 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, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+##############################################################################
+
+from osv import osv, fields
+
+
+class AccountAccount(osv.osv):
+ _inherit = 'account.account'
+
+ _columns = {
+ 'centralized': fields.boolean('Centralized', help="If flagged, no details will be displayed in the General Ledger report (the webkit one only), only centralized amounts per period.")
+ }
+
+ _defaults = {
+ 'centralized': False,
+ }
+
+AccountAccount()
diff --git a/account_financial_report_webkit/account_move_line.py b/account_financial_report_webkit/account_move_line.py
new file mode 100644
index 00000000..2e96728f
--- /dev/null
+++ b/account_financial_report_webkit/account_move_line.py
@@ -0,0 +1,89 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+# Author: Nicolas Bessi.
+# Copyright Camptocamp SA 2011
+#
+# 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 .
+#
+##############################################################################
+
+from osv import fields, osv
+from tools.translate import _
+
+
+class AccountMoveLine(osv.osv):
+ """Overriding Account move line in order to add last_rec_date.
+ Last rec date is the date of the last reconciliation (full or partial) account move line"""
+ _inherit = 'account.move.line'
+
+ def init(self, cr):
+ ##We do not want to catch error as if sql is not run it will give invalid data
+ cr.execute("UPDATE account_move_line as acm "
+ " SET last_rec_date ="
+ " (SELECT date from account_move_line"
+ " WHERE reconcile_id = acm.reconcile_id"
+ " AND reconcile_id IS NOT NULL"
+ " ORDER BY date DESC LIMIT 1)"
+ " WHERE last_rec_date is null;")
+
+ cr.execute("UPDATE account_move_line as acm "
+ " SET last_rec_date ="
+ " (SELECT date from account_move_line"
+ " WHERE reconcile_partial_id = acm.reconcile_partial_id"
+ " AND reconcile_partial_id IS NOT NULL"
+ " ORDER BY date DESC LIMIT 1)"
+ " WHERE last_rec_date is null;")
+
+
+ def _get_move_line_from_line_rec(self, cr, uid, ids, context=None):
+ moves = []
+ for reconcile in self.pool.get('account.move.reconcile').browse(cr, uid, ids, context=context):
+ for move_line in reconcile.line_partial_ids:
+ moves.append(move_line.id)
+ for move_line in reconcile.line_id:
+ moves.append(move_line.id)
+ return list(set(moves))
+
+ def _get_last_rec_date(self, cursor, uid, ids, name, args, context=None):
+ if not isinstance(ids, list):
+ ids = [ids]
+ res = {}
+ for line in self.browse(cursor, uid, ids, context):
+ res[line.id] = {'last_rec_date': False}
+ rec = line.reconcile_id or line.reconcile_partial_id or False
+ if rec:
+ # we use cursor in order to gain some perfs
+ cursor.execute('SELECT date from account_move_line where'
+ ' reconcile_id = %s OR reconcile_partial_id = %s'
+ ' ORDER BY date DESC LIMIT 1 ',
+ (rec.id, rec.id))
+ res_set = cursor.fetchone()
+ if res_set:
+ res[line.id] = {'last_rec_date': res_set[0]}
+ return res
+
+ _columns = {
+ 'last_rec_date': fields.function(_get_last_rec_date,
+ method=True,
+ string='Last reconciliation date',
+ store={'account.move.line': (lambda self, cr, uid, ids, c={}: ids, ['date'], 20),
+ 'account.move.reconcile': (_get_move_line_from_line_rec, None ,20)},
+ type='date',
+ multi='all',
+ help="the date of the last reconciliation (full or partial) account move line"),
+
+ }
+
+AccountMoveLine()
diff --git a/account_financial_report_webkit/account_move_line_view.xml b/account_financial_report_webkit/account_move_line_view.xml
new file mode 100644
index 00000000..a99a8e9d
--- /dev/null
+++ b/account_financial_report_webkit/account_move_line_view.xml
@@ -0,0 +1,23 @@
+
+
+
+
+
+ last_rec_date_form
+ account.move.line
+
+
+
+ form
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/account_financial_report_webkit/account_view.xml b/account_financial_report_webkit/account_view.xml
new file mode 100644
index 00000000..60666774
--- /dev/null
+++ b/account_financial_report_webkit/account_view.xml
@@ -0,0 +1,18 @@
+
+
+
+
+ account.account.form.webkit
+ account.account
+
+ form
+
+
+
+
+
+
+
+
+
+
diff --git a/account_financial_report_webkit/data/financial_webkit_header.xml b/account_financial_report_webkit/data/financial_webkit_header.xml
new file mode 100644
index 00000000..fd72405d
--- /dev/null
+++ b/account_financial_report_webkit/data/financial_webkit_header.xml
@@ -0,0 +1,409 @@
+
+
+
+
+
+
+
+
+
+ <% import datetime %>
+
+