[IMP] account: Improved condition for general ledger report

bzr revid: pso@tinyerp.com-20101228064946-y6tbf5fqa0eiv7dm
This commit is contained in:
pso
2010-12-28 12:19:46 +05:30
parent 06be64cb90
commit fbe53992bc
@@ -179,8 +179,13 @@ class general_ledger(report_sxw.rml_parse, common_report_header):
if res_lines and self.init_balance:
#FIXME: replace the label of lname with a string translatable
sql = """
SELECT 0 AS lid, '' AS ldate, '' AS lcode, COALESCE(SUM(l.amount_currency),0.0) AS amount_currency, '' AS lref, 'Initial Balance' AS lname, COALESCE(SUM(l.debit),0.0) AS debit, COALESCE(SUM(l.credit),0.0) AS credit, '' AS lperiod_id, '' AS lpartner_id,
SELECT 0 AS lid, '' AS ldate, '' AS lcode, '' AS lref, 'Initial Balance' AS lname, COALESCE(SUM(l.debit),0.0) AS debit, COALESCE(SUM(l.credit),0.0) AS credit, '' AS lperiod_id, '' AS lpartner_id,
'' AS move_name, '' AS mmove_id, '' AS period_code,
sum(case when a.currency_id is not null then
l.amount_currency
else
0.0
end) as amount_currency,
'' AS currency_code,
NULL AS currency_id,
'' AS invoice_id, '' AS invoice_type, '' AS invoice_number,