Skip to content

Commit

Permalink
feat: Store Party bank details in party records (Customer/Supplier/Em…
Browse files Browse the repository at this point in the history
…ployee/Shareholder)
  • Loading branch information
marination committed Mar 30, 2023
1 parent 7c42b72 commit 4c13c26
Show file tree
Hide file tree
Showing 6 changed files with 132 additions and 10 deletions.
29 changes: 26 additions & 3 deletions erpnext/accounts/doctype/bank_transaction/bank_transaction.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
{
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -260,4 +283,4 @@
"states": [],
"title_field": "bank_account",
"track_changes": 1
}
}
11 changes: 11 additions & 0 deletions erpnext/accounts/doctype/bank_transaction/bank_transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,17 @@


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

Expand Down
32 changes: 29 additions & 3 deletions erpnext/accounts/doctype/shareholder/shareholder.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"actions": [],
"autoname": "naming_series:",
"creation": "2017-12-25 16:50:53.878430",
"doctype": "DocType",
Expand All @@ -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": [
{
Expand Down Expand Up @@ -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": [
{
Expand Down Expand Up @@ -158,6 +183,7 @@
"search_fields": "folio_no",
"sort_field": "modified",
"sort_order": "DESC",
"states": [],
"title_field": "title",
"track_changes": 1
}
30 changes: 29 additions & 1 deletion erpnext/buying/doctype/supplier/supplier.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand All @@ -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",
Expand Down
25 changes: 24 additions & 1 deletion erpnext/selling/doctype/customer/customer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand All @@ -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",
Expand Down
15 changes: 13 additions & 2 deletions erpnext/setup/doctype/employee/employee.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,9 @@
"salary_mode",
"bank_details_section",
"bank_name",
"column_break_heye",
"bank_ac_no",
"iban",
"personal_details",
"marital_status",
"family_background",
Expand Down Expand Up @@ -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": [
Expand Down

0 comments on commit 4c13c26

Please sign in to comment.