[fix] Sales order tax not fetching on the sales invoice (#12055)

diff --git a/erpnext/public/js/controllers/transaction.js b/erpnext/public/js/controllers/transaction.js
index 5cb1973..f1d274d 100644
--- a/erpnext/public/js/controllers/transaction.js
+++ b/erpnext/public/js/controllers/transaction.js
@@ -243,10 +243,14 @@
 						frappe.run_serially([
 							() => {
 								// directly set in doc, so as not to call triggers
-								me.frm.doc.taxes_and_charges = r.message.taxes_and_charges;
+								if(r.message.taxes_and_charges) {
+									me.frm.doc.taxes_and_charges = r.message.taxes_and_charges;
+								}
 
 								// set taxes table
-								me.frm.set_value("taxes", r.message.taxes);
+								if(r.message.taxes) {
+									me.frm.set_value("taxes", r.message.taxes);
+								}
 							},
 							() => me.calculate_taxes_and_totals()
 						]);