fix: fetch swift_number in payment_request
There isn't direct link between payment_request and bank so swift_number wasn't fetched using Fetch form. I fixed it by fetching swift_number on_change of bank_account.
diff --git a/erpnext/accounts/doctype/payment_request/payment_request.js b/erpnext/accounts/doctype/payment_request/payment_request.js
index 901ef19..da66edc 100644
--- a/erpnext/accounts/doctype/payment_request/payment_request.js
+++ b/erpnext/accounts/doctype/payment_request/payment_request.js
@@ -9,6 +9,13 @@
query: "erpnext.setup.doctype.party_type.party_type.get_party_type",
};
});
+ },
+ "bank_account": function(frm) {
+ frappe.db.get_value('Bank', frm.doc.bank, ['swift_number'])
+ .then(r => {
+ let values = r.message;
+ frm.set_value('swift_number', values.swift_number)
+ })
}
})
diff --git a/erpnext/accounts/doctype/payment_request/payment_request.json b/erpnext/accounts/doctype/payment_request/payment_request.json
index 2ee356a..33edb63 100644
--- a/erpnext/accounts/doctype/payment_request/payment_request.json
+++ b/erpnext/accounts/doctype/payment_request/payment_request.json
@@ -219,7 +219,6 @@
"label": "Branch Code"
},
{
- "fetch_from": "bank.swift_number",
"fieldname": "swift_number",
"fieldtype": "Read Only",
"label": "SWIFT Number"
@@ -366,7 +365,7 @@
"index_web_pages_for_search": 1,
"is_submittable": 1,
"links": [],
- "modified": "2020-09-18 12:24:14.178853",
+ "modified": "2022-09-28 12:39:30.160837",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Payment Request",