fix: Cannot read properties of null (reading 'doctype') (backport #42941) (#42943)

fix: Cannot read properties of null (reading 'doctype') (#42941)

(cherry picked from commit 86d3a9ab03)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
This commit is contained in:
mergify[bot]
2024-08-27 17:15:23 +05:30
committed by GitHub
parent 01cd509113
commit 2c99075899

View File

@@ -1421,12 +1421,13 @@ erpnext.TransactionController = class TransactionController extends erpnext.taxe
let show = cint(this.frm.doc.discount_amount) || let show = cint(this.frm.doc.discount_amount) ||
((this.frm.doc.taxes || []).filter(function(d) {return d.included_in_print_rate===1}).length); ((this.frm.doc.taxes || []).filter(function(d) {return d.included_in_print_rate===1}).length);
if(frappe.meta.get_docfield(cur_frm.doctype, "net_total")) if(this.frm.doc.doctype && frappe.meta.get_docfield(this.frm.doc.doctype, "net_total")) {
this.frm.toggle_display("net_total", show); this.frm.toggle_display("net_total", show);
}
if(frappe.meta.get_docfield(cur_frm.doctype, "base_net_total")) if(this.frm.doc.doctype && frappe.meta.get_docfield(this.frm.doc.doctype, "base_net_total")) {
this.frm.toggle_display("base_net_total", (show && (me.frm.doc.currency != company_currency))); this.frm.toggle_display("base_net_total", (show && (me.frm.doc.currency != company_currency)));
}
} }
change_grid_labels(company_currency) { change_grid_labels(company_currency) {