[IMP] Add the Debit and Credit fields in financial report
bzr revid: jap@tinyerp.com-20120210132742-wkqwvfjgoo7gzqtm
This commit is contained in:
parent
2e4dbceb5f
commit
11989f6cd2
|
@ -86,7 +86,12 @@ class report_account_common(report_sxw.rml_parse, common_report_header):
|
|||
'type': 'account',
|
||||
'level': report.display_detail == 'detail_with_hierarchy' and min(account.level + 1,6) or 6, #account.level + 1
|
||||
'account_type': account.type,
|
||||
|
||||
}
|
||||
if data['form']['debit_credit'] == True:
|
||||
vals['debit'] = account.debit
|
||||
vals['credit'] = account.credit
|
||||
lines.append(vals)
|
||||
if not currency_obj.is_zero(self.cr, self.uid, account.company_id.currency_id, vals['balance']):
|
||||
flag = True
|
||||
if data['form']['enable_filter']:
|
||||
|
|
|
@ -207,10 +207,12 @@
|
|||
</para>
|
||||
<blockTable colWidths="390.0,100.0" style="Table_Account_Line_Title">
|
||||
[[ data['form']['enable_filter'] == 0 or removeParentNode('blockTable') ]]
|
||||
[[ data['form']['debit_credit'] == 0 or removeParentNode('blockTable') ]]
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_Bold_9">Name</para>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Right">Balance</para>
|
||||
</td>
|
||||
|
@ -220,12 +222,52 @@
|
|||
[[ (a.get('level') <> 0) or removeParentNode('tr') ]]
|
||||
[[ setTag('tr','tr',{'style': 'Table'+str(min(3,'level' in a and a.get('level') or 1))}) ]]
|
||||
<td><para style="terp_level_3_name">[[ setTag('para','para',{'style': 'terp_level_'+str(min(6,a.get('level')))+'_name'}) ]][[ a.get('name') ]]</para></td>
|
||||
|
||||
<td>[[ (a.get('account_type') =='view' and a.get('level') <> 1) or removeParentNode('td') ]]
|
||||
<para style="terp_level_3_balance"><u>[[ setTag('para','para',{'style': 'terp_level_'+str(min(6,a.get('level')))+'_balance'}) ]][[ formatLang(a.get('balance'), currency_obj = company.currency_id) ]]</u></para></td>
|
||||
<td>[[ (a.get('account_type') <>'view' or a.get('level') == 1) or removeParentNode('td') ]]
|
||||
<para style="terp_level_3_balance">[[ setTag('para','para',{'style': 'terp_level_'+str(min(6,a.get('level')))+'_balance'}) ]][[ formatLang(a.get('balance'), currency_obj = company.currency_id) ]]</para></td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
|
||||
|
||||
<blockTable colWidths="200.0,90.0,90.0,110.0" style="Table_Account_Line_Title">
|
||||
[[ data['form']['debit_credit'] == 1 or removeParentNode('blockTable') ]]
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_Bold_9">Name</para>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Right">Debit</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Right">Credit</para>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Right">Balance</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr style="Table3">
|
||||
[[ repeatIn(get_lines(data), 'a') ]]
|
||||
[[ (a.get('level') <> 0) or removeParentNode('tr') ]]
|
||||
[[ setTag('tr','tr',{'style': 'Table'+str(min(3,'level' in a and a.get('level') or 1))}) ]]
|
||||
<td><para style="terp_level_3_name">[[ setTag('para','para',{'style': 'terp_level_'+str(min(6,a.get('level')))+'_name'}) ]][[ a.get('name') ]]</para></td>
|
||||
|
||||
<td><para style="terp_level_3_name">[[ a.get('debit') or '0.00']]</para></td>
|
||||
|
||||
<td><para style="terp_level_3_name">[[ a.get('credit') or '0.00' ]]</para></td>
|
||||
|
||||
<td>[[ (a.get('account_type') =='view' and a.get('level') <> 1) or removeParentNode('td') ]]
|
||||
<para style="terp_level_3_balance"><u>[[ setTag('para','para',{'style': 'terp_level_'+str(min(6,a.get('level')))+'_balance'}) ]][[ formatLang(a.get('balance'), currency_obj = company.currency_id) ]]</u></para></td>
|
||||
<td>[[ (a.get('account_type') <>'view' or a.get('level') == 1) or removeParentNode('td') ]]
|
||||
<para style="terp_level_3_balance">[[ setTag('para','para',{'style': 'terp_level_'+str(min(6,a.get('level')))+'_balance'}) ]][[ formatLang(a.get('balance'), currency_obj = company.currency_id) ]]</para></td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
|
||||
|
||||
|
||||
<para style="Standard">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
|
|
|
@ -36,6 +36,7 @@ class accounting_report(osv.osv_memory):
|
|||
'period_to_cmp': fields.many2one('account.period', 'End Period'),
|
||||
'date_from_cmp': fields.date("Start Date"),
|
||||
'date_to_cmp': fields.date("End Date"),
|
||||
'debit_credit': fields.boolean('Debit/Credit'),
|
||||
}
|
||||
|
||||
def _get_account_report(self, cr, uid, context=None):
|
||||
|
@ -85,7 +86,7 @@ class accounting_report(osv.osv_memory):
|
|||
return res
|
||||
|
||||
def _print_report(self, cr, uid, ids, data, context=None):
|
||||
data['form'].update(self.read(cr, uid, ids, ['date_from_cmp', 'date_to_cmp', 'fiscalyear_id_cmp', 'period_from_cmp', 'period_to_cmp', 'filter_cmp', 'account_report_id', 'enable_filter', 'label_filter'], context=context)[0])
|
||||
data['form'].update(self.read(cr, uid, ids, ['date_from_cmp', 'debit_credit', 'date_to_cmp', 'fiscalyear_id_cmp', 'period_from_cmp', 'period_to_cmp', 'filter_cmp', 'account_report_id', 'enable_filter', 'label_filter'], context=context)[0])
|
||||
return {
|
||||
'type': 'ir.actions.report.xml',
|
||||
'report_name': 'account.financial.report',
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
<xpath expr="//field[@name='target_move']" position="after">
|
||||
<field name="account_report_id" domain="[('parent_id','=',False)]"/>
|
||||
<field name="enable_filter"/>
|
||||
<field name="debit_credit" attrs="{'invisible': [('enable_filter','=',True)]}"/>
|
||||
</xpath>
|
||||
<xpath expr="//notebook/page[@string='Filters']" position="after">
|
||||
<page string="Comparison" attrs="{'invisible': [('enable_filter','=',False)]}">
|
||||
|
|
Loading…
Reference in New Issue