feat: Store Party bank details in party records (Customer/Supplier/Employee/Shareholder)

This commit is contained in:
marination 2023-03-30 21:03:03 +05:30
parent 12325cb685
commit ad31e02616
6 changed files with 132 additions and 10 deletions

View File

@ -33,7 +33,11 @@
"unallocated_amount", "unallocated_amount",
"party_section", "party_section",
"party_type", "party_type",
"party" "party",
"column_break_3czf",
"bank_party_name",
"bank_party_no",
"bank_party_iban"
], ],
"fields": [ "fields": [
{ {
@ -202,11 +206,30 @@
"fieldtype": "Data", "fieldtype": "Data",
"label": "Transaction Type", "label": "Transaction Type",
"length": 50 "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, "is_submittable": 1,
"links": [], "links": [],
"modified": "2022-05-29 18:36:50.475964", "modified": "2023-03-30 15:30:46.485683",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Accounts", "module": "Accounts",
"name": "Bank Transaction", "name": "Bank Transaction",
@ -260,4 +283,4 @@
"states": [], "states": [],
"title_field": "bank_account", "title_field": "bank_account",
"track_changes": 1 "track_changes": 1
} }

View File

@ -8,6 +8,17 @@ from erpnext.controllers.status_updater import StatusUpdater
class BankTransaction(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): def after_insert(self):
self.unallocated_amount = abs(flt(self.withdrawal) - flt(self.deposit)) self.unallocated_amount = abs(flt(self.withdrawal) - flt(self.deposit))

View File

@ -1,4 +1,5 @@
{ {
"actions": [],
"autoname": "naming_series:", "autoname": "naming_series:",
"creation": "2017-12-25 16:50:53.878430", "creation": "2017-12-25 16:50:53.878430",
"doctype": "DocType", "doctype": "DocType",
@ -19,7 +20,11 @@
"contact_html", "contact_html",
"section_break_3", "section_break_3",
"share_balance", "share_balance",
"contact_list" "contact_list",
"bank_details_section",
"bank_account_no",
"column_break_tyo0",
"iban"
], ],
"fields": [ "fields": [
{ {
@ -109,13 +114,33 @@
"hidden": 1, "hidden": 1,
"label": "Contact List", "label": "Contact List",
"read_only": 1 "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", "modified_by": "Administrator",
"module": "Accounts", "module": "Accounts",
"name": "Shareholder", "name": "Shareholder",
"name_case": "Title Case", "naming_rule": "By \"Naming Series\" field",
"owner": "Administrator", "owner": "Administrator",
"permissions": [ "permissions": [
{ {
@ -158,6 +183,7 @@
"search_fields": "folio_no", "search_fields": "folio_no",
"sort_field": "modified", "sort_field": "modified",
"sort_order": "DESC", "sort_order": "DESC",
"states": [],
"title_field": "title", "title_field": "title",
"track_changes": 1 "track_changes": 1
} }

View File

@ -52,6 +52,11 @@
"supplier_primary_address", "supplier_primary_address",
"primary_address", "primary_address",
"accounting_tab", "accounting_tab",
"bank_details_section",
"bank_account_no",
"column_break_n8mz",
"iban",
"section_break_ow3k",
"payment_terms", "payment_terms",
"accounts", "accounts",
"settings_tab", "settings_tab",
@ -445,6 +450,29 @@
{ {
"fieldname": "column_break_59", "fieldname": "column_break_59",
"fieldtype": "Column Break" "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", "icon": "fa fa-user",
@ -457,7 +485,7 @@
"link_fieldname": "party" "link_fieldname": "party"
} }
], ],
"modified": "2023-02-18 11:05:50.592270", "modified": "2023-03-30 15:50:40.241257",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Buying", "module": "Buying",
"name": "Supplier", "name": "Supplier",

View File

@ -61,6 +61,10 @@
"tax_category", "tax_category",
"tax_withholding_category", "tax_withholding_category",
"accounting_tab", "accounting_tab",
"bank_details_section",
"bank_account_no",
"column_break_xtwg",
"iban",
"credit_limit_section", "credit_limit_section",
"payment_terms", "payment_terms",
"credit_limits", "credit_limits",
@ -555,6 +559,25 @@
{ {
"fieldname": "column_break_54", "fieldname": "column_break_54",
"fieldtype": "Column Break" "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", "icon": "fa fa-user",
@ -568,7 +591,7 @@
"link_fieldname": "party" "link_fieldname": "party"
} }
], ],
"modified": "2023-02-18 11:04:46.343527", "modified": "2023-03-30 15:45:44.387975",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Selling", "module": "Selling",
"name": "Customer", "name": "Customer",

View File

@ -78,7 +78,9 @@
"salary_mode", "salary_mode",
"bank_details_section", "bank_details_section",
"bank_name", "bank_name",
"column_break_heye",
"bank_ac_no", "bank_ac_no",
"iban",
"personal_details", "personal_details",
"marital_status", "marital_status",
"family_background", "family_background",
@ -804,17 +806,26 @@
{ {
"fieldname": "column_break_104", "fieldname": "column_break_104",
"fieldtype": "Column Break" "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", "icon": "fa fa-user",
"idx": 24, "idx": 24,
"image_field": "image", "image_field": "image",
"links": [], "links": [],
"modified": "2022-09-13 10:27:14.579197", "modified": "2023-03-30 15:57:05.174592",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Setup", "module": "Setup",
"name": "Employee", "name": "Employee",
"name_case": "Title Case",
"naming_rule": "By \"Naming Series\" field", "naming_rule": "By \"Naming Series\" field",
"owner": "Administrator", "owner": "Administrator",
"permissions": [ "permissions": [