[FIX] Account: Partner ledger report => If i have one invoice with Date and period with January-2010 (old) and it is already recoiled/paid.

- Now i print the report with Include initial balance option ticked and filter by periods + include Reconciled entries Ticked
                  - Start period => Sep-2010
                  - End period  => Dec-2010
       - If i look in the report  -> i can not found that reconciled amount for the partner on Initial balance row.

bzr revid: mra@mra-laptop-20101029103211-puynyojr919lnsfy
This commit is contained in:
Mustufa Rangwala
2010-10-29 16:02:11 +05:30
parent a6d42b32e2
commit f3d14cd792
@@ -164,6 +164,10 @@ class third_party_ledger(rml_parse.rml_parse, common_report_header):
move_state = ['draft','posted']
if self.target_move == 'posted':
move_state = ['posted']
if self.reconcil:
RECONCILE_TAG = " "
else:
RECONCILE_TAG = "AND l.reconcile_id IS NULL"
self.cr.execute(
"SELECT COALESCE(SUM(l.debit),0.0), COALESCE(SUM(l.credit),0.0), COALESCE(sum(debit-credit), 0.0) " \
@@ -173,7 +177,7 @@ class third_party_ledger(rml_parse.rml_parse, common_report_header):
"AND m.id = l.move_id " \
"AND m.state IN %s "
"AND account_id IN %s" \
"AND reconcile_id IS NULL " \
" " + RECONCILE_TAG + " "\
"AND " + self.init_query + " ",
(partner.id, tuple(move_state), tuple(self.account_ids)))
return self.cr.fetchall()