Browse Source

[FIX] using 'type' to make bold accounts

pull/7/merge
Lorenzo Battistini 11 years ago
parent
commit
43cb715ab8
  1. 8
      account_financial_report_horizontal/report/account_balance_sheet.py
  2. 13
      account_financial_report_horizontal/report/account_balance_sheet_horizontal.rml
  3. 14
      account_financial_report_horizontal/report/account_profit_horizontal.rml
  4. 7
      account_financial_report_horizontal/report/account_profit_loss.py

8
account_financial_report_horizontal/report/account_balance_sheet.py

@ -145,6 +145,7 @@ class report_balancesheet_horizontal(report_sxw.rml_parse, common_report_header)
'name': account.name,
'level': account.level,
'balance': (account.balance and typ == 'liability' and -1 or 1 ) * account.balance,
'type': account.type,
}
currency = account.currency_id and account.currency_id or account.company_id.currency_id
if typ == 'liability' and account.type <> 'view' and (account.debit <> account.credit):
@ -177,10 +178,12 @@ class report_balancesheet_horizontal(report_sxw.rml_parse, common_report_header)
'name': cal_list['liability'][i]['name'],
'level': cal_list['liability'][i]['level'],
'balance':cal_list['liability'][i]['balance'],
'type':cal_list['liability'][i]['type'],
'code1': cal_list['asset'][i]['code'],
'name1': cal_list['asset'][i]['name'],
'level1': cal_list['asset'][i]['level'],
'balance1':cal_list['asset'][i]['balance'],
'type1':cal_list['asset'][i]['type'],
}
self.result_temp.append(temp)
else:
@ -190,10 +193,11 @@ class report_balancesheet_horizontal(report_sxw.rml_parse, common_report_header)
'name': '',
'level': False,
'balance':False,
'type':False,
'code1': cal_list['asset'][i]['code'],
'name1': cal_list['asset'][i]['name'],
'level1': cal_list['asset'][i]['level'],
'balance1':cal_list['asset'][i]['balance'],
'type1':cal_list['asset'][i]['type'],
}
self.result_temp.append(temp)
if i < len(cal_list['liability']):
@ -202,10 +206,12 @@ class report_balancesheet_horizontal(report_sxw.rml_parse, common_report_header)
'name': cal_list['liability'][i]['name'],
'level': cal_list['liability'][i]['level'],
'balance':cal_list['liability'][i]['balance'],
'type':cal_list['liability'][i]['type'],
'code1': '',
'name1': '',
'level1': False,
'balance1':False,
'type1':False,
}
self.result_temp.append(temp)
return None

13
account_financial_report_horizontal/report/account_balance_sheet_horizontal.rml

@ -197,27 +197,26 @@
</tr>
<tr>
<td>
<para style="terp_default_9"><font>[[ a['level']&lt;4 and ( setTag('para','para',{'style':'terp_default_Bold_9'})) or removeParentNode('font') ]]</font><font>[[ a['code1'] ]]</font></para>
<para style="terp_default_9"><font>[[ a['type1'] == 'view' and ( setTag('para','para',{'style':'terp_default_Bold_9'})) or removeParentNode('font') ]]</font><font>[[ a['code1'] ]]</font></para>
</td>
<td>
<para style="terp_default_9"><font color="white">[[ '. '*(a['level1']-1) ]]</font><font>[[ a['level1']&lt;4 and ( setTag('para','para',{'style':'terp_default_Bold_9'})) or removeParentNode('font') ]][[ a['name1'] ]]</font></para>
<para style="terp_default_9"><font color="white">[[ '. '*(a['level1']-1) ]]</font><font>[[ a['type1'] == 'view' and ( setTag('para','para',{'style':'terp_default_Bold_9'})) or removeParentNode('font') ]][[ a['name1'] ]]</font></para>
</td>
<td>
<para style="terp_default_Right_9">
<font>[[ a['level1']&lt;4 and ( setTag('para','para',{'style':'terp_default_Right_9_Bold'})) or removeParentNode('font') ]]</font>
<font>[[ a['type1'] == 'view' and ( setTag('para','para',{'style':'terp_default_Right_9_Bold'})) or removeParentNode('font') ]]</font>
<font>[[ a['code1'] and formatLang(a['balance1']) or removeParentNode('font') ]] [[ company.currency_id.symbol ]]</font>
</para>
</td>
<td>
<para style="terp_default_9"><font face="Times-Roman">[[ repeatIn(get_lines(), 'a') ]]</font> <font>[[ a['level']&lt;4 and ( setTag('para','para',{'style':'terp_default_Bold_9'})) or removeParentNode('font') ]]</font><font>[[ a['code'] ]]</font><font>[[ a['name']=='Net Profit' and setTag('para','para',{'style':'terp_default_Bold_9'}) or removeParentNode('font') ]]</font></para>
<para style="terp_default_9"><font face="Times-Roman">[[ repeatIn(get_lines(), 'a') ]]</font> <font>[[ a['type'] == 'view' and ( setTag('para','para',{'style':'terp_default_Bold_9'})) or removeParentNode('font') ]]</font><font>[[ a['code'] ]]</font></para>
</td>
<td>
<para style="terp_default_9"><font color="white">[[ '. '*(a['level']-1) ]]</font><font>[[ a['level']&lt;4 and ( setTag('para','para',{'style':'terp_default_Bold_9'})) or removeParentNode('font') ]][[ a['name'] ]]</font><font>[[ a['name']=='Net Profit' and setTag('para','para',{'style':'terp_default_Bold_9'}) or removeParentNode('font') ]]</font></para>
<para style="terp_default_9"><font color="white">[[ '. '*(a['level']-1) ]]</font><font>[[ a['type'] == 'view' and ( setTag('para','para',{'style':'terp_default_Bold_9'})) or removeParentNode('font') ]][[ a['name'] ]]</font></para>
</td>
<td>
<para style="terp_default_Right_9">
<font>[[ a['level']&lt;4 and ( setTag('para','para',{'style':'terp_default_Right_9_Bold'})) or removeParentNode('font') ]]</font>
<font>[[ a['name']=='Net Profit' and setTag('para','para',{'style':'terp_default_Right_9_Bold'}) or removeParentNode('font') ]]</font>
<font>[[ a['type'] == 'view' and ( setTag('para','para',{'style':'terp_default_Right_9_Bold'})) or removeParentNode('font') ]]</font>
<font>[[ a['code'] and formatLang(a['balance']) or removeParentNode('font') ]] [[ company.currency_id.symbol ]]</font>
</para>
</td>

14
account_financial_report_horizontal/report/account_profit_horizontal.rml

@ -213,33 +213,35 @@
<td>
<para style="terp_default_9">
<font face="Times-Roman">[[ repeatIn(get_lines(),'a' ) ]] </font>[[ a['code'] ]]<font>[[ a['level']&lt;4 and ( setTag('para','para',{'style':'terp_default_Bold_9'})) or removeParentNode('font') ]]</font>
<font face="Times-Roman">[[ repeatIn(get_lines(),'a' ) ]]</font>
[[ a['code'] ]]
<font>[[ a['type'] == 'view' and ( setTag('para','para',{'style':'terp_default_Bold_9'})) or removeParentNode('font') ]]</font>
</para>
</td>
<td>
<para style="terp_default_9">
<font color="white">[[ '. '*(a['level']-1) ]]</font><font>[[ a['level']&lt;4 and ( setTag('para','para',{'style':'terp_default_Bold_9'})) or removeParentNode('font') ]][[ a['name'] ]]</font>
<font color="white">[[ '. '*(a['level']-1) ]]</font><font>[[ a['type'] == 'view' and ( setTag('para','para',{'style':'terp_default_Bold_9'})) or removeParentNode('font') ]][[ a['name'] ]]</font>
</para>
</td>
<td>
<para style="terp_default_Right_9">
<font>[[ a['level']&lt;4 and ( setTag('para','para',{'style':'terp_default_Right_9_Bold'})) or removeParentNode('font') ]]</font>
<font>[[ a['type'] == 'view' and ( setTag('para','para',{'style':'terp_default_Right_9_Bold'})) or removeParentNode('font') ]]</font>
<font>[[ a['code'] and formatLang(a['balance']) or removeParentNode('font') ]] [[ company.currency_id.symbol ]]</font>
</para>
</td>
<td>
<para style="terp_default_9">
[[ a['code1'] ]]<font>[[ a['level1']&lt;4 and ( setTag('para','para',{'style':'terp_default_Bold_9'})) or removeParentNode('font') ]]</font>
[[ a['code1'] ]]<font>[[ a['type1'] == 'view' and ( setTag('para','para',{'style':'terp_default_Bold_9'})) or removeParentNode('font') ]]</font>
</para>
</td>
<td>
<para style="terp_default_9">
<font color="white">[[ '. '*(a['level1']-1) ]]</font><font>[[ a['level1']&lt;4 and ( setTag('para','para',{'style':'terp_default_Bold_9'})) or removeParentNode('font') ]][[ a['name1'] ]]</font>
<font color="white">[[ '. '*(a['level1']-1) ]]</font><font>[[ a['type1'] == 'view' and ( setTag('para','para',{'style':'terp_default_Bold_9'})) or removeParentNode('font') ]][[ a['name1'] ]]</font>
</para>
</td>
<td>
<para style="terp_default_Right_9">
<font>[[ a['level1']&lt;4 and ( setTag('para','para',{'style':'terp_default_Right_9_Bold'})) or removeParentNode('font') ]]</font>
<font>[[ a['type1'] == 'view' and ( setTag('para','para',{'style':'terp_default_Right_9_Bold'})) or removeParentNode('font') ]]</font>
<font>[[ a['code1'] and formatLang(a['balance1']) or removeParentNode('font') ]] [[ company.currency_id.symbol ]]</font>
</para>
</td>

7
account_financial_report_horizontal/report/account_profit_loss.py

@ -93,6 +93,7 @@ class report_pl_account_horizontal(report_sxw.rml_parse, common_report_header):
'name': account.name,
'level': account.level,
'balance': account.balance and (account_type == 'income' and -1 or 1) * account.balance,
'type': account.type,
}
cr, uid = self.cr, self.uid
@ -158,10 +159,12 @@ class report_pl_account_horizontal(report_sxw.rml_parse, common_report_header):
'name': cal_list['expense'][i]['name'],
'level': cal_list['expense'][i]['level'],
'balance':cal_list['expense'][i]['balance'],
'type':cal_list['expense'][i]['type'],
'code1': cal_list['income'][i]['code'],
'name1': cal_list['income'][i]['name'],
'level1': cal_list['income'][i]['level'],
'balance1': cal_list['income'][i]['balance'],
'type1':cal_list['income'][i]['type'],
}
self.result_temp.append(temp)
else:
@ -171,10 +174,12 @@ class report_pl_account_horizontal(report_sxw.rml_parse, common_report_header):
'name': '',
'level': False,
'balance':False,
'type':False,
'code1': cal_list['income'][i]['code'],
'name1': cal_list['income'][i]['name'],
'level1': cal_list['income'][i]['level'],
'balance1': cal_list['income'][i]['balance'],
'type1':cal_list['income'][i]['type'],
}
self.result_temp.append(temp)
if i < len(cal_list['expense']):
@ -183,10 +188,12 @@ class report_pl_account_horizontal(report_sxw.rml_parse, common_report_header):
'name': cal_list['expense'][i]['name'],
'level': cal_list['expense'][i]['level'],
'balance': cal_list['expense'][i]['balance'],
'type': cal_list['expense'][i]['type'],
'code1': '',
'name1': '',
'level1': False,
'balance1':False,
'type1':False,
}
self.result_temp.append(temp)
return None

Loading…
Cancel
Save