diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry.py b/erpnext/accounts/doctype/journal_entry/journal_entry.py index 26fbc23b4cd..d082b602117 100644 --- a/erpnext/accounts/doctype/journal_entry/journal_entry.py +++ b/erpnext/accounts/doctype/journal_entry/journal_entry.py @@ -458,8 +458,9 @@ class JournalEntry(AccountsController): pay_to_recd_from = frappe.db.get_value(d.party_type, d.party, "customer_name" if d.party_type=="Customer" else "supplier_name") - party_amount += (d.debit_in_account_currency or d.credit_in_account_currency) - party_account_currency = d.account_currency + if pay_to_recd_from and pay_to_recd_from == d.party: + party_amount += (d.debit_in_account_currency or d.credit_in_account_currency) + party_account_currency = d.account_currency elif frappe.db.get_value("Account", d.account, "account_type") in ["Bank", "Cash"]: bank_amount += (d.debit_in_account_currency or d.credit_in_account_currency) diff --git a/erpnext/accounts/report/accounts_receivable/accounts_receivable.html b/erpnext/accounts/report/accounts_receivable/accounts_receivable.html index d7aa0c0d191..192b6d7be38 100644 --- a/erpnext/accounts/report/accounts_receivable/accounts_receivable.html +++ b/erpnext/accounts/report/accounts_receivable/accounts_receivable.html @@ -46,6 +46,8 @@ var range2 = report.columns[12].label; var range3 = report.columns[13].label; var range4 = report.columns[14].label; + var range5 = report.columns[15].label; + var range6 = report.columns[16].label; %} {% if(balance_row) { %}
| {%= __(range2) %} | {%= __(range3) %} | {%= __(range4) %} | +{%= __(range5) %} | +{%= __(range6) %} | {%= __("Total") %} | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| {%= __("Total Outstanding") %} | -{%= format_currency(balance_row[range1]) %} | +{%= format_number(balance_row[range1], null, 2) %} | {%= format_currency(balance_row[range2]) %} | {%= format_currency(balance_row[range3]) %} | {%= format_currency(balance_row[range4]) %} | +{%= format_currency(balance_row[range5]) %} | +{%= format_currency(balance_row[range6]) %} | {%= format_currency(flt(balance_row[("outstanding_amount")]), data[data.length-1]["currency"]) %} | @@ -86,6 +94,8 @@+ | + | {%= format_currency(flt(balance_row[("pdc/lc_amount")]), data[data.length-1]["currency"]) %} | @@ -95,6 +105,8 @@+ | + | {%= format_currency(flt(balance_row[("outstanding_amount")]-balance_row[("pdc/lc_amount")]), data[data.length-1]["currency"]) %} |