From 5759258dcf2ac41eade0192dc8ff025d6d751825 Mon Sep 17 00:00:00 2001 From: rohitwaghchaure Date: Wed, 13 Dec 2017 18:57:37 +0530 Subject: [PATCH] [fix] Added total closing in general ledger (#11961) --- .../report/general_ledger/general_ledger.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/erpnext/accounts/report/general_ledger/general_ledger.py b/erpnext/accounts/report/general_ledger/general_ledger.py index d5180a6272..c275c04721 100644 --- a/erpnext/accounts/report/general_ledger/general_ledger.py +++ b/erpnext/accounts/report/general_ledger/general_ledger.py @@ -193,6 +193,17 @@ def get_data_with_opening_closing(filters, account_details, gl_entries): # closing data.append(totals.closing) + #total closing + total_closing = totals.total_closing + total_debit = totals.closing.get('debit', 0) + total_credit = totals.closing.get('credit', 0) + debit_in_account_currency = totals.closing.get('debit_in_account_currency', 0) + credit_in_account_currency = totals.closing.get('credit_in_account_currency', 0) + + total_closing['debit'] = total_debit - total_credit + total_closing['debit_in_account_currency'] = debit_in_account_currency - credit_in_account_currency + data.append(totals.total_closing) + return data def get_totals_dict(): @@ -207,7 +218,8 @@ def get_totals_dict(): return _dict( opening = _get_debit_credit_dict(_('Opening')), total = _get_debit_credit_dict(_('Total')), - closing = _get_debit_credit_dict(_('Closing (Opening + Total)')) + closing = _get_debit_credit_dict(_('Closing (Opening + Total)')), + total_closing = _get_debit_credit_dict(_('Closing Balance (Dr - Cr)')) ) def initialize_gle_map(gl_entries):