diff --git a/erpnext/accounts/doctype/discounted_invoice/discounted_invoice.json b/erpnext/accounts/doctype/discounted_invoice/discounted_invoice.json index 9a276cad49..5c3519a159 100644 --- a/erpnext/accounts/doctype/discounted_invoice/discounted_invoice.json +++ b/erpnext/accounts/doctype/discounted_invoice/discounted_invoice.json @@ -38,6 +38,8 @@ "read_only": 1 }, { + "fetch_from": "sales_invoice.outstanding_amount", + "fetch_if_empty": 1, "fieldname": "outstanding_amount", "fieldtype": "Currency", "in_list_view": 1, @@ -58,7 +60,7 @@ } ], "istable": 1, - "modified": "2019-09-23 15:29:54.199318", + "modified": "2019-09-26 11:05:36.016772", "modified_by": "Administrator", "module": "Accounts", "name": "Discounted Invoice", diff --git a/erpnext/accounts/doctype/invoice_discounting/invoice_discounting.js b/erpnext/accounts/doctype/invoice_discounting/invoice_discounting.js index c061fb70bf..f928f1179d 100644 --- a/erpnext/accounts/doctype/invoice_discounting/invoice_discounting.js +++ b/erpnext/accounts/doctype/invoice_discounting/invoice_discounting.js @@ -204,15 +204,9 @@ frappe.ui.form.on('Invoice Discounting', { }); frappe.ui.form.on('Discounted Invoice', { - sales_invoice: (frm, cdt, cdn) => { + sales_invoice: (frm) => { frm.events.calculate_total_amount(frm); frm.events.refresh_filters(frm); - - let row = locals[cdt][cdn]; - frappe.db.get_value("Sales Invoice",row["sales_invoice"], "outstanding_amount", (res) => { - row.outstanding_amount = res["outstanding_amount"]; - frm.refresh_field("invoices"); - }); }, invoices_remove: (frm) => { frm.events.calculate_total_amount(frm);