fetch party name (#11985)

This commit is contained in:
Shreya Shah 2017-12-14 12:42:01 +05:30 committed by Nabin Hait
parent 4667cb2f62
commit a2cfd97cd7
2 changed files with 4 additions and 0 deletions

View File

@ -266,6 +266,7 @@ frappe.ui.form.on('Payment Entry', {
}
},
() => frm.set_value("party_balance", r.message.party_balance),
() => frm.set_value("party_name", r.message.party_name),
() => frm.events.get_outstanding_documents(frm),
() => frm.events.hide_unhide_fields(frm),
() => frm.events.set_dynamic_labels(frm),

View File

@ -617,10 +617,13 @@ def get_party_details(company, party_type, party, date):
account_currency = get_account_currency(party_account)
account_balance = get_balance_on(party_account, date)
_party_name = "title" if party_type == "Student" else party_type.lower() + "_name"
party_name = frappe.db.get_value(party_type, party, _party_name)
party_balance = get_balance_on(party_type=party_type, party=party)
return {
"party_account": party_account,
"party_name": party_name,
"party_account_currency": account_currency,
"party_balance": party_balance,
"account_balance": account_balance