Nehal Panchal (OpenERP) has proposed merging
lp:~openerp-dev/openobject-addons/6.0-opw-16360-nep into
lp:openobject-addons/6.0.
Requested reviews:
Anup(OpenERP) (ach-openerp)
For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/6.0-opw-16360-nep/+merge/69601
Hello,
General journals Report prints double entry, if the payment currency differs
from the company's currency.
Improved General journals Report for grouping the entries as per journals.
Thank You.
--
https://code.launchpad.net/~openerp-dev/openobject-addons/6.0-opw-16360-nep/+merge/69601
Your team OpenERP R&D Team is subscribed to branch
lp:~openerp-dev/openobject-addons/6.0-opw-16360-nep.
=== modified file 'account/report/account_general_journal.py'
--- account/report/account_general_journal.py 2011-01-14 00:11:01 +0000
+++ account/report/account_general_journal.py 2011-07-28 08:52:34 +0000
@@ -80,21 +80,32 @@
filtered_objs = filter(filter_unique, journal_period_objs)
return map(lambda x: x.period_id, filtered_objs)
- def lines(self, period_id):
+ def lines(self, period_id, amount_currency):
if not self.journal_ids:
return []
move_state = ['draft','posted']
if self.target_move == 'posted':
move_state = ['posted']
- self.cr.execute('SELECT j.code, j.name, l.amount_currency,c.symbol AS currency_code,l.currency_id, '
+ if not amount_currency:
+ self.cr.execute('SELECT j.code, j.name, '
'SUM(l.debit) AS debit, SUM(l.credit) AS credit '
'FROM account_move_line l '
'LEFT JOIN account_move am ON (l.move_id=am.id) '
'LEFT JOIN account_journal j ON (l.journal_id=j.id) '
'LEFT JOIN res_currency c on (l.currency_id=c.id)'
'WHERE am.state IN %s AND l.period_id=%s AND l.journal_id IN %s ' + self.query_get_clause + ' '
- 'GROUP BY j.id, j.code, j.name, l.amount_currency, c.symbol, l.currency_id ',
+ 'GROUP BY j.id, j.code, j.name ',
(tuple(move_state), period_id, tuple(self.journal_ids)))
+ else:
+ self.cr.execute('SELECT j.code, j.name, l.amount_currency,c.symbol AS currency_code,l.currency_id, '
+ 'SUM(l.debit) AS debit, SUM(l.credit) AS credit '
+ 'FROM account_move_line l '
+ 'LEFT JOIN account_move am ON (l.move_id=am.id) '
+ 'LEFT JOIN account_journal j ON (l.journal_id=j.id) '
+ 'LEFT JOIN res_currency c on (l.currency_id=c.id)'
+ 'WHERE am.state IN %s AND l.period_id=%s AND l.journal_id IN %s ' + self.query_get_clause + ' '
+ 'GROUP BY j.id, j.code, j.name, l.amount_currency, c.symbol, l.currency_id ',
+ (tuple(move_state), period_id, tuple(self.journal_ids)))
return self.cr.dictfetchall()
def _set_get_account_currency_code(self, account_id):
=== modified file 'account/report/account_general_journal.rml'
--- account/report/account_general_journal.rml 2011-01-14 00:11:01 +0000
+++ account/report/account_general_journal.rml 2011-07-28 08:52:34 +0000
@@ -342,7 +342,7 @@
</tr>
</blockTable>
<section>
- <para style="Standard">[[ repeatIn(lines(o.id),'line')]]</para>
+ <para style="Standard">[[ repeatIn(lines(o.id, data['form']['amount_currency']),'line')]]</para>
<blockTable colWidths="100.0,125.0,90.0,100.0,100.0" style="Table_Journal_Detail">[[ display_currency(data) == False or removeParentNode('blockTable') ]]
<tr>
<td>
@@ -364,7 +364,7 @@
</blockTable>
</section>
<section>
- <para style="Standard">[[ repeatIn(lines(o.id),'line')]]</para>
+ <para style="Standard">[[ repeatIn(lines(o.id, data['form']['amount_currency']),'line')]]</para>
<blockTable colWidths="100.0,100.0,73.0,80.0,80.0,80.0" style="Table_Journal_Detail">[[ display_currency(data) or removeParentNode('blockTable') ]]
<tr>
<td><para style="terp_default_9">[[ line['code'] ]]</para></td>
_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help : https://help.launchpad.net/ListHelp