From ad31e02616786480cfbadeb39fcaf357e68b4133 Mon Sep 17 00:00:00 2001 From: marination Date: Thu, 30 Mar 2023 21:03:03 +0530 Subject: [PATCH] feat: Store Party bank details in party records (Customer/Supplier/Employee/Shareholder) --- .../bank_transaction/bank_transaction.json | 29 +++++++++++++++-- .../bank_transaction/bank_transaction.py | 11 +++++++ .../doctype/shareholder/shareholder.json | 32 +++++++++++++++++-- erpnext/buying/doctype/supplier/supplier.json | 30 ++++++++++++++++- .../selling/doctype/customer/customer.json | 25 ++++++++++++++- erpnext/setup/doctype/employee/employee.json | 15 +++++++-- 6 files changed, 132 insertions(+), 10 deletions(-) diff --git a/erpnext/accounts/doctype/bank_transaction/bank_transaction.json b/erpnext/accounts/doctype/bank_transaction/bank_transaction.json index 768d2f0fa4..1543fdb894 100644 --- a/erpnext/accounts/doctype/bank_transaction/bank_transaction.json +++ b/erpnext/accounts/doctype/bank_transaction/bank_transaction.json @@ -33,7 +33,11 @@ "unallocated_amount", "party_section", "party_type", - "party" + "party", + "column_break_3czf", + "bank_party_name", + "bank_party_no", + "bank_party_iban" ], "fields": [ { @@ -202,11 +206,30 @@ "fieldtype": "Data", "label": "Transaction Type", "length": 50 + }, + { + "fieldname": "column_break_3czf", + "fieldtype": "Column Break" + }, + { + "fieldname": "bank_party_name", + "fieldtype": "Data", + "label": "Party Name (Bank Statement)" + }, + { + "fieldname": "bank_party_no", + "fieldtype": "Data", + "label": "Party Account No. (Bank Statement)" + }, + { + "fieldname": "bank_party_iban", + "fieldtype": "Data", + "label": "Party IBAN (Bank Statement)" } ], "is_submittable": 1, "links": [], - "modified": "2022-05-29 18:36:50.475964", + "modified": "2023-03-30 15:30:46.485683", "modified_by": "Administrator", "module": "Accounts", "name": "Bank Transaction", @@ -260,4 +283,4 @@ "states": [], "title_field": "bank_account", "track_changes": 1 -} +} \ No newline at end of file diff --git a/erpnext/accounts/doctype/bank_transaction/bank_transaction.py b/erpnext/accounts/doctype/bank_transaction/bank_transaction.py index fcbaf329f5..676c71910b 100644 --- a/erpnext/accounts/doctype/bank_transaction/bank_transaction.py +++ b/erpnext/accounts/doctype/bank_transaction/bank_transaction.py @@ -8,6 +8,17 @@ from erpnext.controllers.status_updater import StatusUpdater class BankTransaction(StatusUpdater): + # TODO + # On BT save: + # - Match by account no/iban in Customer/Supplier/Employee + # - Match by Party Name + # - If match found, set party type and party name. + + # On submit/update after submit + # - Create/Update a Bank Party Map record + # - User can edit after submit. + # - If changes in party/party name after submit, edit bank party map (which should edit all transactions with same account no/iban/bank party name) + def after_insert(self): self.unallocated_amount = abs(flt(self.withdrawal) - flt(self.deposit)) diff --git a/erpnext/accounts/doctype/shareholder/shareholder.json b/erpnext/accounts/doctype/shareholder/shareholder.json index e94aea94b7..2be2a2fc42 100644 --- a/erpnext/accounts/doctype/shareholder/shareholder.json +++ b/erpnext/accounts/doctype/shareholder/shareholder.json @@ -1,4 +1,5 @@ { + "actions": [], "autoname": "naming_series:", "creation": "2017-12-25 16:50:53.878430", "doctype": "DocType", @@ -19,7 +20,11 @@ "contact_html", "section_break_3", "share_balance", - "contact_list" + "contact_list", + "bank_details_section", + "bank_account_no", + "column_break_tyo0", + "iban" ], "fields": [ { @@ -109,13 +114,33 @@ "hidden": 1, "label": "Contact List", "read_only": 1 + }, + { + "fieldname": "bank_details_section", + "fieldtype": "Section Break", + "label": "Bank Details" + }, + { + "fieldname": "bank_account_no", + "fieldtype": "Data", + "label": "Bank Account No" + }, + { + "fieldname": "column_break_tyo0", + "fieldtype": "Column Break" + }, + { + "fieldname": "iban", + "fieldtype": "Data", + "label": "IBAN" } ], - "modified": "2019-11-17 23:24:11.395882", + "links": [], + "modified": "2023-03-30 16:00:55.087823", "modified_by": "Administrator", "module": "Accounts", "name": "Shareholder", - "name_case": "Title Case", + "naming_rule": "By \"Naming Series\" field", "owner": "Administrator", "permissions": [ { @@ -158,6 +183,7 @@ "search_fields": "folio_no", "sort_field": "modified", "sort_order": "DESC", + "states": [], "title_field": "title", "track_changes": 1 } \ No newline at end of file diff --git a/erpnext/buying/doctype/supplier/supplier.json b/erpnext/buying/doctype/supplier/supplier.json index 1bf7f589e2..a80dcfe538 100644 --- a/erpnext/buying/doctype/supplier/supplier.json +++ b/erpnext/buying/doctype/supplier/supplier.json @@ -52,6 +52,11 @@ "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", @@ -445,6 +450,29 @@ { "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", @@ -457,7 +485,7 @@ "link_fieldname": "party" } ], - "modified": "2023-02-18 11:05:50.592270", + "modified": "2023-03-30 15:50:40.241257", "modified_by": "Administrator", "module": "Buying", "name": "Supplier", diff --git a/erpnext/selling/doctype/customer/customer.json b/erpnext/selling/doctype/customer/customer.json index c133cd3152..5dc6a72da8 100644 --- a/erpnext/selling/doctype/customer/customer.json +++ b/erpnext/selling/doctype/customer/customer.json @@ -61,6 +61,10 @@ "tax_category", "tax_withholding_category", "accounting_tab", + "bank_details_section", + "bank_account_no", + "column_break_xtwg", + "iban", "credit_limit_section", "payment_terms", "credit_limits", @@ -555,6 +559,25 @@ { "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", @@ -568,7 +591,7 @@ "link_fieldname": "party" } ], - "modified": "2023-02-18 11:04:46.343527", + "modified": "2023-03-30 15:45:44.387975", "modified_by": "Administrator", "module": "Selling", "name": "Customer", diff --git a/erpnext/setup/doctype/employee/employee.json b/erpnext/setup/doctype/employee/employee.json index 99693d9091..6cb4292226 100644 --- a/erpnext/setup/doctype/employee/employee.json +++ b/erpnext/setup/doctype/employee/employee.json @@ -78,7 +78,9 @@ "salary_mode", "bank_details_section", "bank_name", + "column_break_heye", "bank_ac_no", + "iban", "personal_details", "marital_status", "family_background", @@ -804,17 +806,26 @@ { "fieldname": "column_break_104", "fieldtype": "Column Break" + }, + { + "fieldname": "column_break_heye", + "fieldtype": "Column Break" + }, + { + "depends_on": "eval:doc.salary_mode == 'Bank'", + "fieldname": "iban", + "fieldtype": "Data", + "label": "IBAN" } ], "icon": "fa fa-user", "idx": 24, "image_field": "image", "links": [], - "modified": "2022-09-13 10:27:14.579197", + "modified": "2023-03-30 15:57:05.174592", "modified_by": "Administrator", "module": "Setup", "name": "Employee", - "name_case": "Title Case", "naming_rule": "By \"Naming Series\" field", "owner": "Administrator", "permissions": [