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",
"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
}
}

View File

@ -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))

View File

@ -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
}

View File

@ -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",

View File

@ -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",

View File

@ -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": [