Removed DR/CR from balance column (#12791)
* Removed DR/CR from balance column
* Update general_ledger.html
* Update general_ledger.py
diff --git a/erpnext/accounts/report/general_ledger/general_ledger.html b/erpnext/accounts/report/general_ledger/general_ledger.html
index 90e8059..9e1b884 100644
--- a/erpnext/accounts/report/general_ledger/general_ledger.html
+++ b/erpnext/accounts/report/general_ledger/general_ledger.html
@@ -22,7 +22,7 @@
<th style="width: 25%">{%= __("Party") %}</th>
<th style="width: 15%">{%= __("Debit") %}</th>
<th style="width: 15%">{%= __("Credit") %}</th>
- <th style="width: 18%">{%= __("Balance") %}</th>
+ <th style="width: 18%">{%= __("Balance (Dr - Cr)") %}</th>
</tr>
</thead>
<tbody>
@@ -76,11 +76,11 @@
{% } %}
{% } %}
{% if(filters.print_in_account_currency) { %}
- <td style="text-align: right">{%= get_currency_symbol(data[i].account_currency)%}
- {%= data[i].balance_in_account_currency %}</td>
+ <td style="text-align: right">
+ {%= format_currency(data[i].balance_in_account_currency, data[i].account_currency) %}
+ </td>
{% } else { %}
- <td style="text-align: right">{%= get_currency_symbol()%}
- {%= data[i].balance %}</td>
+ <td style="text-align: right">{%= format_currency(data[i].balance) %}</td>
{% } %}
</tr>
{% } %}
diff --git a/erpnext/accounts/report/general_ledger/general_ledger.py b/erpnext/accounts/report/general_ledger/general_ledger.py
index b6b26b1..8e4259c 100644
--- a/erpnext/accounts/report/general_ledger/general_ledger.py
+++ b/erpnext/accounts/report/general_ledger/general_ledger.py
@@ -241,13 +241,13 @@
if not d.get('posting_date'):
balance, balance_in_account_currency = 0, 0
- balance, label = get_balance(d, balance, 'debit', 'credit')
- d['balance'] = '{0} {1}'.format(fmt_money(abs(balance)), label)
+ balance = get_balance(d, balance, 'debit', 'credit')
+ d['balance'] = balance
if filters.get("show_in_account_currency"):
- balance_in_account_currency, label = get_balance(d, balance_in_account_currency,
+ balance_in_account_currency = get_balance(d, balance_in_account_currency,
'debit_in_account_currency', 'credit_in_account_currency')
- d['balance_in_account_currency'] = '{0} {1}'.format(fmt_money(abs(balance_in_account_currency)), label)
+ d['balance_in_account_currency'] = balance_in_account_currency
else:
d['debit_in_account_currency'] = d.get('debit', 0)
d['credit_in_account_currency'] = d.get('credit', 0)
@@ -268,9 +268,8 @@
def get_balance(row, balance, debit_field, credit_field):
balance += (row.get(debit_field, 0) - row.get(credit_field, 0))
- label = 'DR' if balance > 0 else 'CR'
- return balance, label
+ return balance
def get_columns(filters):
columns = [
@@ -300,10 +299,10 @@
"width": 100
},
{
- "label": _("Balance"),
+ "label": _("Balance (Dr - Cr)"),
"fieldname": "balance",
- "fieldtype": "Data",
- "width": 100
+ "fieldtype": "Float",
+ "width": 130
}
]