[fix] Closing balance showing at wrong side (#12220)
diff --git a/erpnext/accounts/report/general_ledger/general_ledger.py b/erpnext/accounts/report/general_ledger/general_ledger.py
index f169b99..eefb3d1 100644
--- a/erpnext/accounts/report/general_ledger/general_ledger.py
+++ b/erpnext/accounts/report/general_ledger/general_ledger.py
@@ -200,8 +200,15 @@
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
+ total_amount = total_debit - total_credit
+
+ if total_amount > 0:
+ total_closing['debit'] = total_amount
+ total_closing['debit_in_account_currency'] = debit_in_account_currency - credit_in_account_currency
+ else:
+ total_closing['credit'] = abs(total_amount)
+ total_closing['credit_in_account_currency'] = abs(debit_in_account_currency - credit_in_account_currency)
+
data.append(totals.total_closing)
return data