diff --git a/erpnext/accounts/doctype/bank_transaction/auto_match_party.py b/erpnext/accounts/doctype/bank_transaction/auto_match_party.py index 2a2aff1eef..e43d9beb05 100644 --- a/erpnext/accounts/doctype/bank_transaction/auto_match_party.py +++ b/erpnext/accounts/doctype/bank_transaction/auto_match_party.py @@ -99,15 +99,24 @@ class AutoMatchbyAccountIBAN: for party in parties: or_filters = {} if self.bank_party_account_number: - acc_no_field = "bank_ac_no" if party == "Employee" else "bank_account_no" - or_filters[acc_no_field] = self.bank_party_account_number + or_filters["bank_account_no"] = self.bank_party_account_number if self.bank_party_iban: or_filters["iban"] = self.bank_party_iban party_result = frappe.db.get_all( - party, or_filters=or_filters, pluck="name", limit_page_length=1 + "Bank Account", or_filters=or_filters, pluck="name", limit_page_length=1 ) + + if party == "Employee" and not party_result: + # Search in Bank Accounts first for Employee, and then Employee record + if "bank_account_no" in or_filters: + or_filters["bank_ac_no"] = or_filters.pop("bank_account_no") + + party_result = frappe.db.get_all( + party, or_filters=or_filters, pluck="name", limit_page_length=1 + ) + if party_result: result = ( party, diff --git a/erpnext/buying/doctype/supplier/supplier.json b/erpnext/buying/doctype/supplier/supplier.json index a80dcfe538..f0097898f6 100644 --- a/erpnext/buying/doctype/supplier/supplier.json +++ b/erpnext/buying/doctype/supplier/supplier.json @@ -52,11 +52,6 @@ "supplier_primary_address", "primary_address", "accounting_tab", - "bank_details_section", - "bank_account_no", - "column_break_n8mz", - "iban", - "section_break_ow3k", "payment_terms", "accounts", "settings_tab", @@ -450,29 +445,6 @@ { "fieldname": "column_break_59", "fieldtype": "Column Break" - }, - { - "fieldname": "bank_details_section", - "fieldtype": "Section Break", - "label": "Bank Details" - }, - { - "fieldname": "bank_account_no", - "fieldtype": "Data", - "label": "Bank Account No" - }, - { - "fieldname": "column_break_n8mz", - "fieldtype": "Column Break" - }, - { - "fieldname": "iban", - "fieldtype": "Data", - "label": "IBAN" - }, - { - "fieldname": "section_break_ow3k", - "fieldtype": "Section Break" } ], "icon": "fa fa-user", @@ -485,7 +457,7 @@ "link_fieldname": "party" } ], - "modified": "2023-03-30 15:50:40.241257", + "modified": "2023-05-09 15:34:13.408932", "modified_by": "Administrator", "module": "Buying", "name": "Supplier", diff --git a/erpnext/selling/doctype/customer/customer.json b/erpnext/selling/doctype/customer/customer.json index 5dc6a72da8..72a1594b2d 100644 --- a/erpnext/selling/doctype/customer/customer.json +++ b/erpnext/selling/doctype/customer/customer.json @@ -61,10 +61,6 @@ "tax_category", "tax_withholding_category", "accounting_tab", - "bank_details_section", - "bank_account_no", - "column_break_xtwg", - "iban", "credit_limit_section", "payment_terms", "credit_limits", @@ -559,25 +555,6 @@ { "fieldname": "column_break_54", "fieldtype": "Column Break" - }, - { - "fieldname": "bank_details_section", - "fieldtype": "Section Break", - "label": "Bank Details" - }, - { - "fieldname": "bank_account_no", - "fieldtype": "Data", - "label": "Bank Account No" - }, - { - "fieldname": "column_break_xtwg", - "fieldtype": "Column Break" - }, - { - "fieldname": "iban", - "fieldtype": "Data", - "label": "IBAN" } ], "icon": "fa fa-user", @@ -591,7 +568,7 @@ "link_fieldname": "party" } ], - "modified": "2023-03-30 15:45:44.387975", + "modified": "2023-05-09 15:38:40.255193", "modified_by": "Administrator", "module": "Selling", "name": "Customer",