diff --git a/addons/account/project/report/__init__.py b/addons/account/project/report/__init__.py index 933401799f0..32226f801e9 100644 --- a/addons/account/project/report/__init__.py +++ b/addons/account/project/report/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ############################################################################## -# +# # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (). # @@ -15,7 +15,7 @@ # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . +# along with this program. If not, see . # ############################################################################## @@ -24,7 +24,6 @@ import analytic_balance import inverted_analytic_balance import cost_ledger import quantity_cost_ledger -import analytic_check # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account/project/report/analytic_balance.py b/addons/account/project/report/analytic_balance.py index 2de6ada841a..780c519c1d4 100644 --- a/addons/account/project/report/analytic_balance.py +++ b/addons/account/project/report/analytic_balance.py @@ -75,7 +75,7 @@ class account_analytic_balance(report_sxw.rml_parse): sum(aal.amount) AS balance, sum(aal.unit_amount) AS quantity \ FROM account_analytic_line AS aal, account_account AS aa \ WHERE (aal.general_account_id=aa.id) \ - AND (aal.account_id IN aal.account_id IN %s)\ + AND (aal.account_id IN %s)\ AND (date>=%s) AND (date<=%s) AND aa.active \ GROUP BY aal.general_account_id, aa.name, aa.code, aal.code \ ORDER BY aal.code", (tuple(ids), date1, date2)) @@ -101,7 +101,7 @@ class account_analytic_balance(report_sxw.rml_parse): self.acc_data_dict[account_id] = ids else: ids = self.acc_data_dict[account_id] - + query_params = (tuple(ids), date1, date2) if option == "credit" : self.cr.execute("SELECT -sum(amount) FROM account_analytic_line \ diff --git a/addons/account/project/report/analytic_balance.rml b/addons/account/project/report/analytic_balance.rml index 926b2adadd3..52878d08612 100644 --- a/addons/account/project/report/analytic_balance.rml +++ b/addons/account/project/report/analytic_balance.rml @@ -3,37 +3,6 @@ @@ -41,156 +10,216 @@ - + + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - + + + + + + - - - - - - - - - - + + + + + + + + + + - + - - + + - + - - + + + + - - - - - - Code - - - Account Name - - - Debit - - - Credit - - - Balance - - - Quantity - - - - - - Total - - - - [[ formatLang(sum_all(get_objects(data['form']['empty_acc']),data['form']['date1'],data['form']['date2'],'debit')) ]] - - - [[ formatLang(sum_all(get_objects(data['form']['empty_acc']),data['form']['date1'],data['form']['date2'],'credit')) ]] - - - [[ formatLang(sum_balance(get_objects(data['form']['empty_acc']),data['form']['date1'],data['form']['date2'])) ]] - - - [[ formatLang(sum_all(get_objects(data['form']['empty_acc']),data['form']['date1'],data['form']['date2'],'quantity')) ]] - - - -
- [[ repeatIn(get_objects(data['form']['empty_acc']),'o') ]] - - + + - [[ o['code'] ]] - - - [[ o['complete_name'] ]] - - - [[ formatLang(move_sum(o['id'],data['form']['date1'],data['form']['date2'], 'debit')) ]] - - - [[ formatLang(move_sum(o['id'],data['form']['date1'],data['form']['date2'], 'credit')) ]] - - - [[ formatLang(move_sum_balance(o['id'],data['form']['date1'],data['form']['date2'])) ]] - - - [[ formatLang(move_sum(o['id'],data['form']['date1'],data['form']['date2'], 'quantity')) ]] - - - - - [[ repeatIn(lines_g(o['id'],data['form']['date1'],data['form']['date2']),'move_g') ]] - [[ move_g['code'] ]] - - - [[ move_g['name'] ]] - - - [[ formatLang(move_g['debit'])]] - - - [[ formatLang(move_g['credit']) ]] - - - [[ formatLang(move_g['balance'])]] - - - [[ formatLang(move_g['quantity']) ]] - - + Analytic Balance - [[ company.currency_id.name ]] + + + + + + + + + + Code + + + Account Name + + + Debit([[ company.currency_id.name]]) + + + Credit([[ company.currency_id.name]]) + + + Balance([[ company.currency_id.name]]) + + + Quantity + + + + + + + + + + Total + + + + + + + + [[ formatLang(sum_all(get_objects(data['form']['empty_acc']),data['form']['date1'],data['form']['date2'],'debit')) ]] [[ company.currency_id.symbol ]] + + + [[ formatLang(sum_all(get_objects(data['form']['empty_acc']),data['form']['date1'],data['form']['date2'],'credit')) ]] [[ company.currency_id.symbol]] + + + [[ formatLang(sum_balance(get_objects(data['form']['empty_acc']),data['form']['date1'],data['form']['date2'])) ]] [[ company.currency_id.symbol]] + + + [[ formatLang(sum_all(get_objects(data['form']['empty_acc']),data['form']['date1'],data['form']['date2'],'quantity')) ]] + + + + + + +
+ [[ repeatIn(get_objects(data['form']['empty_acc']),'o') ]] + + + + [[ o['code'] ]] + + + [[ o['complete_name'] ]] + + + [[ formatLang(move_sum(o['id'],data['form']['date1'],data['form']['date2'],'debit')) ]] [[ company.currency_id.symbol]] + + + [[ formatLang(move_sum(o['id'],data['form']['date1'],data['form']['date2'],'credit')) ]] [[ company.currency_id.symbol]] + + + [[ formatLang(move_sum_balance(o['id'],data['form']['date1'],data['form']['date2'])) ]] [[ company.currency_id.symbol]] + + + [[ formatLang(move_sum(o['id'],data['form']['date1'],data['form']['date2'],'quantity')) ]] + + -
- + +
+ [[ repeatIn(lines_g(o['id'],data['form']['date1'],data['form']['date2']),'move_g') ]] + + + + [[ move_g['code'] ]] + + + [[ move_g['name'] ]] + + + [[ formatLang(move_g['debit'])]] [[ company.currency_id.symbol ]] + + + [[ formatLang(move_g['credit']) ]] [[ company.currency_id.symbol ]] + + + [[ formatLang(move_g['balance'])]] [[ company.currency_id.symbol ]] + + + [[ formatLang(move_g['quantity']) ]] + + + + + + +
+ + + +
+ + + + + + + + + + + +
\ No newline at end of file diff --git a/addons/account/project/report/analytic_check.py b/addons/account/project/report/analytic_check.py deleted file mode 100644 index a35f2ec718c..00000000000 --- a/addons/account/project/report/analytic_check.py +++ /dev/null @@ -1,100 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2010 Tiny SPRL (). -# -# 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 time - -import pooler -from report import report_sxw - -class account_analytic_analytic_check(report_sxw.rml_parse): - def __init__(self, cr, uid, name, context): - super(account_analytic_analytic_check, self).__init__(cr, uid, name, context=context) - self.sum_gen_deb = 0.0 - self.sum_gen_cred = 0.0 - self.sum_ana_deb = 0.0 - self.sum_ana_cred = 0.0 - self.localcontext.update( { - 'time': time, - 'lines_p': self._lines_p, - 'general_debit': self._gen_deb, - 'general_credit': self._gen_cred, - 'analytic_debit': self._ana_deb, - 'analytic_credit': self._ana_cred, - 'delta_debit': self._delta_deb, - 'delta_credit': self._delta_cred, - }) - def _lines_p(self, date1, date2): - res = [] - acc_obj = self.pool.get('account.account') - - for a in acc_obj.read(self.cr, self.uid, self.ids, ['name', 'code']): - self.cr.execute("SELECT sum(debit), sum(credit) \ - FROM account_move_line \ - WHERE date>=%s AND date<=%s AND state<>'draft' AND account_id = %s", (date1, date2, a['id'])) - (gd, gc) = self.cr.fetchone() - gd = gd or 0.0 - gc = gc or 0.0 - - self.cr.execute("SELECT abs(sum(amount)) AS balance \ - FROM account_analytic_line \ - WHERE date>=%s AND date<=%s AND amount<0 AND general_account_id = %s", (date1, date2, a['id'])) - (ad,) = self.cr.fetchone() - ad = ad or 0.0 - self.cr.execute("SELECT abs(sum(amount)) AS balance \ - FROM account_analytic_line \ - WHERE date>=%s AND date<=%s AND amount>0 AND general_account_id = %s", (date1, date2, a['id'])) - (ac,) = self.cr.fetchone() - ac = ac or 0.0 - - res.append({'code': a['code'], 'name': a['name'], - 'gen_debit': gd, - 'gen_credit': gc, - 'ana_debit': ad, - 'ana_credit': ac, - 'delta_debit': gd - ad, - 'delta_credit': gc - ac,}) - self.sum_gen_deb += gd - self.sum_gen_cred += gc - self.sum_ana_deb += ad - self.sum_ana_cred += ac - - return res - - def _gen_deb(self, date1, date2): - return self.sum_gen_deb - - def _gen_cred(self, date1, date2): - return self.sum_gen_cred - - def _ana_deb(self, date1, date2): - return self.sum_ana_deb - - def _ana_cred(self, date1, date2): - return self.sum_ana_cred - - def _delta_deb(self, date1, date2): - return (self._gen_deb(date1,date2)-self._ana_deb(date1,date2)) - - def _delta_cred(self, date1, date2): - return (self._gen_cred(date1,date2)-self._ana_cred(date1,date2)) - -report_sxw.report_sxw('report.account.analytic.account.analytic.check', 'account.analytic.account', 'addons/account/project/report/analytic_check.rml',parser=account_analytic_analytic_check, header="internal") - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account/project/report/cost_ledger.rml b/addons/account/project/report/cost_ledger.rml index 2675aa33872..ad1fef8e96e 100644 --- a/addons/account/project/report/cost_ledger.rml +++ b/addons/account/project/report/cost_ledger.rml @@ -169,19 +169,19 @@ - Date or Code + Date/Code - J.C. or Move name + J.C. /Move name - Debit + Debit([[ company.currency_id.code]]) - Credit + Credit([[ company.currency_id.code]]) - Balance + Balance([[ company.currency_id.code]]) @@ -199,13 +199,13 @@ - [[ formatLang (sum_debit(objects,data['form']['date1'],data['form']['date2'])) ]] + [[ formatLang (sum_debit(objects,data['form']['date1'],data['form']['date2'])) ]] [[ company.currency_id.symbol ]] - [[ formatLang (sum_credit(objects,data['form']['date1'],data['form']['date2'])) ]] + [[ formatLang (sum_credit(objects,data['form']['date1'],data['form']['date2'])) ]] [[ company.currency_id.symbol ]] - [[ formatLang (sum_balance(objects,data['form']['date1'],data['form']['date2'])) ]] + [[ formatLang (sum_balance(objects,data['form']['date1'],data['form']['date2'])) ]] [[ company.currency_id.symbol ]] @@ -223,13 +223,13 @@ [[ o.complete_name ]] - [[ formatLang (account_sum_debit(o.id,data['form']['date1'],data['form']['date2'])) ]] + [[ formatLang (account_sum_debit(o.id,data['form']['date1'],data['form']['date2'])) ]] [[ company.currency_id.symbol ]] - [[ formatLang (account_sum_credit(o.id,data['form']['date1'],data['form']['date2'])) ]] + [[ formatLang (account_sum_credit(o.id,data['form']['date1'],data['form']['date2'])) ]] [[ company.currency_id.symbol ]] - [[ formatLang (account_sum_balance(o.id,data['form']['date1'],data['form']['date2']))]] + [[ formatLang (account_sum_balance(o.id,data['form']['date1'],data['form']['date2']))]] [[ company.currency_id.symbol ]] @@ -247,13 +247,13 @@ [[ move_g['name'] ]] - [[ formatLang( move_g['debit']) ]] + [[ formatLang( move_g['debit']) ]] [[ company.currency_id.symbol ]] - [[ formatLang( move_g['credit']) ]] + [[ formatLang( move_g['credit']) ]] [[ company.currency_id.symbol ]] - [[ formatLang( move_g['balance']) ]] + [[ formatLang( move_g['balance']) ]] [[ company.currency_id.symbol ]] @@ -274,13 +274,13 @@ [[ move_a['name'] ]] - [[ formatLang( move_a['debit'] )]] + [[ formatLang( move_a['debit'] )]] [[ company.currency_id.symbol]] - [[ formatLang( move_a['credit']) ]] + [[ formatLang( move_a['credit']) ]] [[ company.currency_id.symbol]] - [[ formatLang( move_a['balance']) ]] + [[ formatLang( move_a['balance']) ]] [[ company.currency_id.symbol]] diff --git a/addons/account/project/report/inverted_analytic_balance.rml b/addons/account/project/report/inverted_analytic_balance.rml index 13bf6328486..1404183e913 100644 --- a/addons/account/project/report/inverted_analytic_balance.rml +++ b/addons/account/project/report/inverted_analytic_balance.rml @@ -84,8 +84,8 @@ + - @@ -94,10 +94,7 @@ - - - - + @@ -109,13 +106,13 @@ Name - Debit + Debit([[ company.currency_id.code]]) - Credit + Credit([[ company.currency_id.code]]) - Balance + Balance([[ company.currency_id.code]]) Quantity @@ -136,22 +133,19 @@ - [[ formatLang(sum_debit(objects,data['form']['date1'],data['form']['date2'])) ]] + [[ formatLang(sum_debit(objects,data['form']['date1'],data['form']['date2'])) ]] [[ company.currency_id.symbol]] - [[ formatLang(sum_credit(objects,data['form']['date1'],data['form']['date2']))]] + [[ formatLang(sum_credit(objects,data['form']['date1'],data['form']['date2']))]] [[ company.currency_id.symbol]] - [[ formatLang(sum_balance(objects,data['form']['date1'],data['form']['date2']))]] + [[ formatLang(sum_balance(objects,data['form']['date1'],data['form']['date2']))]] [[ company.currency_id.symbol]] [[ formatLang(sum_quantity(objects,data['form']['date1'],data['form']['date2'])) ]] - - -
[[ repeatIn(lines_g(objects,data['form']['date1'],data['form']['date2']),'move_g') ]] @@ -163,22 +157,19 @@ [[ move_g['name'] ]] - [[ formatLang(move_g['debit'])]] + [[ formatLang(move_g['debit'])]] [[ company.currency_id.symbol]] - [[formatLang(move_g['credit'])]] + [[formatLang(move_g['credit'])]] [[ company.currency_id.symbol]] - [[ formatLang(move_g['balance'])]] + [[ formatLang(move_g['balance'])]] [[ company.currency_id.symbol]] [[formatLang(move_g['quantity']) ]] - - -
[[ repeatIn(lines_a(objects,move_g['id'],data['form']['date1'],data['form']['date2']),'move_a') ]] @@ -190,16 +181,16 @@ [[ move_a['complete_name'] ]] - [[ formatLang(move_a['debit']) ]] + [[ formatLang(move_a['debit']) ]] [[ company.currency_id.symbol]] - [[ formatLang(move_a['credit']) ]] + [[ formatLang(move_a['credit']) ]] [[ company.currency_id.symbol]] - [[ formatLang(move_a['balance']) ]] + [[ formatLang(move_a['balance']) ]] [[ company.currency_id.symbol]] - [[ formatLang(move_a['quantity'] or 0.00) ]] + [[ formatLang(move_a['quantity']) ]] @@ -207,12 +198,6 @@
- - -
- - -
- + \ No newline at end of file diff --git a/addons/account/project/report/quantity_cost_ledger.rml b/addons/account/project/report/quantity_cost_ledger.rml index f5364039a94..68e391223b4 100644 --- a/addons/account/project/report/quantity_cost_ledger.rml +++ b/addons/account/project/report/quantity_cost_ledger.rml @@ -1,6 +1,6 @@ -