fix: Check if payment schedule exits before updating label

This commit is contained in:
Deepesh Garg 2021-05-05 12:19:57 +05:30
parent 04923d6a65
commit 1bb7bb74ad

View File

@ -1379,7 +1379,7 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({
update_payment_schedule_grid_labels: function(company_currency) { update_payment_schedule_grid_labels: function(company_currency) {
const me = this; const me = this;
if (this.frm.fields_dict["payment_schedule"]) { if (this.frm.doc.payment_schedule.length > 0) {
this.frm.set_currency_labels(["base_payment_amount", "base_outstanding", "base_paid_amount"], this.frm.set_currency_labels(["base_payment_amount", "base_outstanding", "base_paid_amount"],
company_currency, "payment_schedule"); company_currency, "payment_schedule");
this.frm.set_currency_labels(["payment_amount", "outstanding", "paid_amount"], this.frm.set_currency_labels(["payment_amount", "outstanding", "paid_amount"],