Removed DR/CR from balance column (#12791)
* Removed DR/CR from balance column * Update general_ledger.html * Update general_ledger.py
This commit is contained in:
parent
80423de611
commit
9a5037193f
@ -22,7 +22,7 @@
|
|||||||
<th style="width: 25%">{%= __("Party") %}</th>
|
<th style="width: 25%">{%= __("Party") %}</th>
|
||||||
<th style="width: 15%">{%= __("Debit") %}</th>
|
<th style="width: 15%">{%= __("Debit") %}</th>
|
||||||
<th style="width: 15%">{%= __("Credit") %}</th>
|
<th style="width: 15%">{%= __("Credit") %}</th>
|
||||||
<th style="width: 18%">{%= __("Balance") %}</th>
|
<th style="width: 18%">{%= __("Balance (Dr - Cr)") %}</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@ -76,11 +76,11 @@
|
|||||||
{% } %}
|
{% } %}
|
||||||
{% } %}
|
{% } %}
|
||||||
{% if(filters.print_in_account_currency) { %}
|
{% if(filters.print_in_account_currency) { %}
|
||||||
<td style="text-align: right">{%= get_currency_symbol(data[i].account_currency)%}
|
<td style="text-align: right">
|
||||||
{%= data[i].balance_in_account_currency %}</td>
|
{%= format_currency(data[i].balance_in_account_currency, data[i].account_currency) %}
|
||||||
|
</td>
|
||||||
{% } else { %}
|
{% } else { %}
|
||||||
<td style="text-align: right">{%= get_currency_symbol()%}
|
<td style="text-align: right">{%= format_currency(data[i].balance) %}</td>
|
||||||
{%= data[i].balance %}</td>
|
|
||||||
{% } %}
|
{% } %}
|
||||||
</tr>
|
</tr>
|
||||||
{% } %}
|
{% } %}
|
||||||
|
|||||||
@ -241,13 +241,13 @@ def get_result_as_list(data, filters):
|
|||||||
if not d.get('posting_date'):
|
if not d.get('posting_date'):
|
||||||
balance, balance_in_account_currency = 0, 0
|
balance, balance_in_account_currency = 0, 0
|
||||||
|
|
||||||
balance, label = get_balance(d, balance, 'debit', 'credit')
|
balance = get_balance(d, balance, 'debit', 'credit')
|
||||||
d['balance'] = '{0} {1}'.format(fmt_money(abs(balance)), label)
|
d['balance'] = balance
|
||||||
|
|
||||||
if filters.get("show_in_account_currency"):
|
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')
|
'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:
|
else:
|
||||||
d['debit_in_account_currency'] = d.get('debit', 0)
|
d['debit_in_account_currency'] = d.get('debit', 0)
|
||||||
d['credit_in_account_currency'] = d.get('credit', 0)
|
d['credit_in_account_currency'] = d.get('credit', 0)
|
||||||
@ -268,9 +268,8 @@ def get_supplier_invoice_details():
|
|||||||
|
|
||||||
def get_balance(row, balance, debit_field, credit_field):
|
def get_balance(row, balance, debit_field, credit_field):
|
||||||
balance += (row.get(debit_field, 0) - row.get(credit_field, 0))
|
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):
|
def get_columns(filters):
|
||||||
columns = [
|
columns = [
|
||||||
@ -300,10 +299,10 @@ def get_columns(filters):
|
|||||||
"width": 100
|
"width": 100
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": _("Balance"),
|
"label": _("Balance (Dr - Cr)"),
|
||||||
"fieldname": "balance",
|
"fieldname": "balance",
|
||||||
"fieldtype": "Data",
|
"fieldtype": "Float",
|
||||||
"width": 100
|
"width": 130
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user