[IMP] account :Fix the problem of type in profit and loss report
bzr revid: sbh@tinyerp.com-20100721090431-mv151ees6uhtibua
This commit is contained in:
@@ -83,7 +83,7 @@ class report_pl_account_horizontal(rml_parse.rml_parse, common_report_header):
|
||||
self.result_sum_cr += self.res_pl['balance']
|
||||
return self.result_sum_cr or 0.0
|
||||
|
||||
def get_data(self, form):
|
||||
def get_data(self, data):
|
||||
cr, uid = self.cr, self.uid
|
||||
db_pool = pooler.get_pool(self.cr.dbname)
|
||||
|
||||
@@ -98,16 +98,16 @@ class report_pl_account_horizontal(rml_parse.rml_parse, common_report_header):
|
||||
|
||||
ctx = self.context.copy()
|
||||
# ctx['state'] = form['context'].get('state','all')
|
||||
ctx['fiscalyear'] = form['fiscalyear']
|
||||
ctx['fiscalyear'] = data['form']['fiscalyear_id']
|
||||
|
||||
if form['filter']=='filter_period' :
|
||||
ctx['periods'] = form['periods']
|
||||
elif form['filter']== 'filter_date':
|
||||
ctx['date_from'] = form['date_from']
|
||||
ctx['date_to'] = form['date_to']
|
||||
if data['form']['filter']=='filter_period' :
|
||||
ctx['periods'] = data['periods']
|
||||
elif data['form']['filter']== 'filter_date':
|
||||
ctx['date_from'] = data['date_from']
|
||||
ctx['date_to'] = data['date_to']
|
||||
|
||||
cal_list={}
|
||||
account_id = [form['Account_list']]
|
||||
account_id =data['form']['chart_account_id']
|
||||
account_ids = account_pool._get_children_and_consol(cr, uid, account_id, context=ctx)
|
||||
accounts = account_pool.browse(cr, uid, account_ids, context=ctx)
|
||||
|
||||
@@ -119,10 +119,10 @@ class report_pl_account_horizontal(rml_parse.rml_parse, common_report_header):
|
||||
self.result_sum_dr += abs(account.debit - account.credit)
|
||||
if typ == 'income' and account.type <> 'view' and (account.debit <> account.credit):
|
||||
self.result_sum_cr += abs(account.debit - account.credit)
|
||||
if form['display_account'] == 'bal_mouvement':
|
||||
if data['form']['display_account'] == 'bal_mouvement':
|
||||
if account.credit > 0 or account.debit > 0 or account.balance > 0 :
|
||||
accounts_temp.append(account)
|
||||
elif form['display_account'] == 'bal_solde':
|
||||
elif data['form']['display_account'] == 'bal_solde':
|
||||
if account.balance != 0:
|
||||
accounts_temp.append(account)
|
||||
else:
|
||||
|
||||
@@ -198,7 +198,7 @@
|
||||
</tr>
|
||||
</blockTable>
|
||||
|
||||
<para style="P2">[[ get_data(data['form']) or removeParentNode('para')]]</para>
|
||||
<para style="P2">[[ get_data(data) or removeParentNode('para')]]</para>
|
||||
<para style="Standard">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
@@ -284,7 +284,7 @@
|
||||
<para style="terp_default_Bold_9">[[ final_result()['type'] == 'Net Profit C.F.B.L.' and final_result()['type'] or removeParentNode('blockTable') ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9_Bold">[[ final_result()['balance'] and final_result()['type'] == 'Net Profit C.F.B.L.' and formatLang(abs(final_result()['balance'])) or 0.0 ]]</para>
|
||||
<para style="terp_default_Right_9_Bold">[[ final_result()['balance'] and final_result()['type'] == 'Net Profit C.F.B.L.' and formatLang(final_result()['balance']) or 0.0 ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
@@ -294,7 +294,7 @@
|
||||
<para style="terp_default_Bold_9">Total:([[ get_currency(data) ]])</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9_Bold"><u>[[ sum_dr() and formatLang(abs(sum_dr())) or 0.0 ]]</u></para>
|
||||
<para style="terp_default_Right_9_Bold"><u>[[ sum_dr() and formatLang(sum_dr()) or 0.0 ]]</u></para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
|
||||
Reference in New Issue
Block a user