[IMP] account: Improved partner ledger report for currency

bzr revid: pso@tinyerp.com-20101124083029-kn69p6roavd6786c
This commit is contained in:
pso
2010-11-24 14:00:29 +05:30
parent ba17231b13
commit 11d9e19f3c
2 changed files with 8 additions and 5 deletions
@@ -51,6 +51,7 @@ class third_party_ledger(report_sxw.rml_parse, common_report_header):
'display_initial_balance':self._display_initial_balance,
'display_currency':self._display_currency,
'get_target_move': self._get_target_move,
'get_currency': self._get_currency,
'sum_currency_amount_account': self._sum_currency_amount_account
})
@@ -162,6 +163,10 @@ class third_party_ledger(report_sxw.rml_parse, common_report_header):
full_account.append(r)
return full_account
def _get_currency(self):
self.cr.execute("select distinct currency_id from account_invoice")
return self.cr.fetchall()
def _get_intial_balance(self, partner):
move_state = ['draft','posted']
if self.target_move == 'posted':
@@ -638,9 +638,7 @@
<para style="P5">[[ formatLang((sum_debit_partner(p) - sum_credit_partner(p))) ]] [[ company.currency_id.symbol ]]</para>
</td>
<td>
<para style="P5">
<font color="white"> </font>
</para>
<para style="terp_default_Right_9">[[ p.property_account_receivable.currency_id and formatLang(sum_currency_amount_account(p.property_account_receivable), digits=get_digits(dp='Account')) + p.property_account_receivable.currency_id.symbol or '' ]]</para>
</td>
</tr>
<tr>
@@ -657,7 +655,7 @@
<para style="terp_default_Right_9">[[ formatLang(get_intial_balance(p)[0][2]) ]] [[ company.currency_id.symbol ]]</para>
</td>
<td>
<para style="terp_default_Right_9">[[ p.property_account_receivable.currency_id and formatLang(sum_currency_amount_account(p.property_account_receivable), digits=get_digits(dp='Account')) + p.property_account_receivable.currency_id.symbol or '' ]]</para>
<para style="terp_default_Right_9">[[ len(get_currency())==1 and p.property_account_receivable.currency_id and formatLang(sum_currency_amount_account(p.property_account_receivable), digits=get_digits(dp='Account')) + p.property_account_receivable.currency_id.symbol or '' ]]</para>
</td>
</tr>
</blockTable>
@@ -690,7 +688,7 @@
<para style="terp_default_Right_9">[[ formatLang((line['progress'])) ]] [[ company.currency_id.symbol ]]</para>
</td>
<td>
<para style="terp_default_Right_9"><font>[[ (p.property_account_receivable.currency_id and formatLang(line['amount_currency'])) or removeParentNode('font') ]] [[ line['currency_code'] or '']] </font></para>
<para style="terp_default_Right_9"><font>[[ (len(get_currency())==1 and p.property_account_receivable.currency_id and formatLang(line['amount_currency'])) or removeParentNode('font') ]] [[ line['currency_code'] or '']] </font></para>
</td>
</tr>
</blockTable>