[Fix] account: Fix the central_journal report
bzr revid: sbh@tinyerp.com-20100720085723-9hjfw3w6823k4wah
This commit is contained in:
parent
9612537141
commit
1afb884e8d
|
@ -49,6 +49,7 @@ class journal_print(report_sxw.rml_parse, common_report_header):
|
|||
'sum_currency_amount_account': self._sum_currency_amount_account,
|
||||
'get_start_date':self._get_start_date,
|
||||
'get_end_date':self._get_end_date,
|
||||
'print_data':self._print_data,
|
||||
})
|
||||
|
||||
def set_context(self, objects, data, ids, report_type=None): # Improve move to common default?
|
||||
|
@ -90,6 +91,21 @@ class journal_print(report_sxw.rml_parse, common_report_header):
|
|||
else:
|
||||
currency_total = self.tot_currency = 0.0
|
||||
return currency_total
|
||||
report_sxw.report_sxw('report.account.central.journal', 'account.journal.period', 'addons/account/report/central_journal.rml', parser=journal_print, header=False)
|
||||
|
||||
def _get_account(self, data):
|
||||
if data['model']=='account.journal.period':
|
||||
return self.pool.get('account.journal.period').browse(self.cr, self.uid, data['id']).company_id.name
|
||||
return super(journal_print ,self)._get_account(data)
|
||||
|
||||
def _get_fiscalyear(self, data):
|
||||
if data['model']=='account.journal.period':
|
||||
return self.pool.get('account.journal.period').browse(self.cr, self.uid, data['id']).fiscalyear_id.name
|
||||
return super(journal_print ,self)._get_fiscalyear(data)
|
||||
|
||||
def _print_data(self, data):
|
||||
if data['model']=='account.journal.period':
|
||||
return self.pool.get('account.journal.period').browse(self.cr, self.uid, data['id']).journal_id.currency or False
|
||||
return data['form']['amount_currency']
|
||||
report_sxw.report_sxw('report.account.central.journal', 'account.journal.period', 'addons/account/report/central_journal.rml', parser=journal_print, header='internal')
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
|
@ -267,10 +267,11 @@
|
|||
</para>
|
||||
<blockTable colWidths="80.0,80.0,100.0,130.0,100.0" style="Table2">
|
||||
<tr>
|
||||
<td><para style="terp_tblheader_General_Centre">Chat Account</para></td>
|
||||
<td><para style="terp_tblheader_General_Centre">Company <font color="white"> [[ data['model']=='account.journal.period' or removeParentNode('para') ]]</font></para>
|
||||
<para style="terp_tblheader_General_Centre">Chart of Account <font color="white"> [[ data['model']=='ir.ui.menu' or removeParentNode('para') ]]</font></para></td>
|
||||
<td><para style="terp_tblheader_General_Centre">Fiscal Year</para></td>
|
||||
<td><para style="terp_tblheader_General_Centre">Journal</para></td>
|
||||
<td><para style="terp_tblheader_General_Centre">Filters By <font color="white">[[ get_filter(data)!='No Filter' and '' or removeParentNode('font') ]]</font><font>[[ get_filter(data)]]</font></para></td>
|
||||
<td><para style="terp_tblheader_General_Centre">Filters By </para></td>
|
||||
<td><para style="terp_tblheader_General_Centre">Printing Date</para></td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -305,7 +306,7 @@
|
|||
<para style="P9">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<blockTable colWidths="83.0,200.0,95.0,92.0,69.0" style="Table_Account_detail_Title">[[ data['form']['amount_currency'] == False or removeParentNode('blockTable') ]]
|
||||
<blockTable colWidths="83.0,200.0,95.0,92.0,69.0" style="Table_Account_detail_Title">[[ print_data(data) == False or removeParentNode('blockTable') ]]
|
||||
<tr>
|
||||
<td><para style="terp_tblheader_Details">A/C No.</para></td>
|
||||
<td><para style="terp_tblheader_Details">Account Name</para></td>
|
||||
|
@ -314,7 +315,7 @@
|
|||
<td><para style="terp_tblheader_Details_Right">Balance</para></td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable colWidths="83.0,150.0,95.0,92.0,69.0,50.0" style="Table_Account_detail_Title_Currency">[[ data['form']['amount_currency'] == True or removeParentNode('blockTable') ]]
|
||||
<blockTable colWidths="83.0,150.0,95.0,92.0,69.0,50.0" style="Table_Account_detail_Title_Currency">[[ print_data(data) or removeParentNode('blockTable') ]]
|
||||
<tr>
|
||||
<td><para style="terp_tblheader_Details">A/C No.</para></td>
|
||||
<td><para style="terp_tblheader_Details">Account Name</para></td>
|
||||
|
@ -327,7 +328,7 @@
|
|||
<para style="terp_default_2">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<blockTable colWidths="83.0,200.0,94.0,92.0,69.0" style="Table_Final_Total">[[ data['form']['amount_currency'] == False or removeParentNode('blockTable') ]]
|
||||
<blockTable colWidths="83.0,200.0,94.0,92.0,69.0" style="Table_Final_Total">[[ print_data(data) == False or removeParentNode('blockTable') ]]
|
||||
<tr>
|
||||
<td><para style="terp_default_Bold_9">Total:</para></td>
|
||||
<td><para style="terp_default_Bold_9"><font color="white"> </font></para></td>
|
||||
|
@ -336,7 +337,7 @@
|
|||
<td><para style="terp_default_Bold_9_Right">[[ formatLang( sum_credit(o.period_id.id, o.journal_id.id)-sum_credit(o.period_id.id, o.journal_id.id) ) ]]</para></td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable colWidths="83.0,150.0,95.0,92.0,69.0,50.0" style="Table_Final_Total_currency">[[ data['form']['amount_currency'] == True or removeParentNode('blockTable') ]]
|
||||
<blockTable colWidths="83.0,150.0,95.0,92.0,69.0,50.0" style="Table_Final_Total_currency">[[ print_data(data) or removeParentNode('blockTable') ]]
|
||||
<tr>
|
||||
<td><para style="terp_default_Bold_9">Total:</para></td>
|
||||
<td><para style="terp_default_Bold_9"><font color="white"> </font></para></td>
|
||||
|
@ -351,7 +352,7 @@
|
|||
</para>
|
||||
<section>
|
||||
<para style="terp_default_8">[[ repeatIn(lines(o.period_id.id,o.journal_id.id),'line') ]]</para>
|
||||
<blockTable colWidths="83.0,200.0,94.0,92.0,69.0" style="Table_Journal_Line_Content">[[ data['form']['amount_currency'] == False or removeParentNode('blockTable') ]]
|
||||
<blockTable colWidths="83.0,200.0,94.0,92.0,69.0" style="Table_Journal_Line_Content">[[ print_data(data) == False or removeParentNode('blockTable') ]]
|
||||
<tr>
|
||||
<td><para style="terp_default_9">[[ line['code'] ]]</para></td>
|
||||
<td><para style="terp_default_9">[[ line['name'] ]]</para></td>
|
||||
|
@ -360,7 +361,7 @@
|
|||
<td><para style="terp_default_Right_9">[[ formatLang(line['debit']-line['credit']) ]]</para></td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable colWidths="83.0,150.0,95.0,92.0,69.0,50.0" style="Table_Journal_Line_Content_currency">[[ data['form']['amount_currency'] == True or removeParentNode('blockTable') ]]
|
||||
<blockTable colWidths="83.0,150.0,95.0,92.0,69.0,50.0" style="Table_Journal_Line_Content_currency">[[ print_data(data) or removeParentNode('blockTable') ]]
|
||||
<tr>
|
||||
<td><para style="terp_default_9">[[ line['code'] ]]</para></td>
|
||||
<td><para style="terp_default_9">[[ line['name'] ]]</para></td>
|
||||
|
|
Loading…
Reference in New Issue