diff --git a/account_financial_report_qweb/report/general_ledger.py b/account_financial_report_qweb/report/general_ledger.py index 8bd8fc25..78023c63 100644 --- a/account_financial_report_qweb/report/general_ledger.py +++ b/account_financial_report_qweb/report/general_ledger.py @@ -976,7 +976,7 @@ INNER JOIN LEFT JOIN account_full_reconcile fr ON ml.full_reconcile_id = fr.id LEFT JOIN - res_currency c ON a.currency_id = c.id + res_currency c ON ml.currency_id = c.id """ if self.filter_cost_center_ids: query_inject_move_line += """ @@ -1086,7 +1086,8 @@ WITH )::date AS date, SUM(ml.debit) AS debit, SUM(ml.credit) AS credit, - SUM(ml.balance) AS balance + SUM(ml.balance) AS balance, + ml.currency_id AS currency_id FROM report_general_ledger_qweb_account ra INNER JOIN @@ -1119,7 +1120,7 @@ WITH """ query_inject_move_line_centralized += """ GROUP BY - ra.id, ml.account_id, a.code, 2 + ra.id, ml.account_id, a.code, 2, ml.currency_id ) INSERT INTO report_general_ledger_qweb_move_line @@ -1154,7 +1155,7 @@ INNER JOIN INNER JOIN account_account a ON ml.account_id = a.id LEFT JOIN - res_currency c ON a.currency_id = c.id + res_currency c ON ml.currency_id = c.id WHERE ra.report_id = %s AND diff --git a/account_financial_report_qweb/report/open_items.py b/account_financial_report_qweb/report/open_items.py index 5265fd00..f787c222 100644 --- a/account_financial_report_qweb/report/open_items.py +++ b/account_financial_report_qweb/report/open_items.py @@ -361,7 +361,8 @@ FROM THEN pr.amount_currency ELSE NULL END - ) AS partial_amount_currency + ) AS partial_amount_currency, + ml.currency_id FROM report_open_items_qweb_partner rp INNER JOIN @@ -469,13 +470,15 @@ WITH ELSE amount_currency + SUM(partial_amount_currency) END ELSE amount_currency - END AS amount_residual_currency + END AS amount_residual_currency, + currency_id FROM move_lines_amount GROUP BY id, balance, - amount_currency + amount_currency, + currency_id ) INSERT INTO report_open_items_qweb_move_line @@ -557,7 +560,7 @@ INNER JOIN LEFT JOIN account_full_reconcile fr ON ml.full_reconcile_id = fr.id LEFT JOIN - res_currency c ON a.currency_id = c.id + res_currency c ON ml2.currency_id = c.id WHERE ra.report_id = %s AND diff --git a/account_financial_report_qweb/report/templates/general_ledger.xml b/account_financial_report_qweb/report/templates/general_ledger.xml index 0cb91502..9d7fa76b 100644 --- a/account_financial_report_qweb/report/templates/general_ledger.xml +++ b/account_financial_report_qweb/report/templates/general_ledger.xml @@ -126,12 +126,10 @@