mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-02 19:59:12 +00:00
Merge pull request #20653 from P-Froggy/develop
feat: Move SWIFT-number and branch-code from bank account to bank
This commit is contained in:
@@ -7,7 +7,20 @@ frappe.ui.form.on('Bank', {
|
|||||||
},
|
},
|
||||||
refresh: function(frm) {
|
refresh: function(frm) {
|
||||||
add_fields_to_mapping_table(frm);
|
add_fields_to_mapping_table(frm);
|
||||||
}
|
|
||||||
|
frappe.dynamic_link = { doc: frm.doc, fieldname: 'name', doctype: 'Bank' };
|
||||||
|
|
||||||
|
frm.toggle_display(['address_html','contact_html'], !frm.doc.__islocal);
|
||||||
|
|
||||||
|
if (frm.doc.__islocal) {
|
||||||
|
frm.set_df_property('address_and_contact', 'hidden', 1);
|
||||||
|
frappe.contacts.clear_address_and_contact(frm);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
frm.set_df_property('address_and_contact', 'hidden', 0);
|
||||||
|
frappe.contacts.render_address_and_contact(frm);
|
||||||
|
}
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,224 +1,137 @@
|
|||||||
{
|
{
|
||||||
"allow_copy": 0,
|
"actions": [],
|
||||||
"allow_events_in_timeline": 0,
|
"allow_import": 1,
|
||||||
"allow_guest_to_view": 0,
|
"allow_rename": 1,
|
||||||
"allow_import": 0,
|
"autoname": "field:bank_name",
|
||||||
"allow_rename": 0,
|
"creation": "2018-04-07 16:59:59.496668",
|
||||||
"autoname": "field:bank_name",
|
"doctype": "DocType",
|
||||||
"beta": 0,
|
"document_type": "Setup",
|
||||||
"creation": "2018-04-07 16:59:59.496668",
|
"editable_grid": 1,
|
||||||
"custom": 0,
|
"engine": "InnoDB",
|
||||||
"docstatus": 0,
|
"field_order": [
|
||||||
"doctype": "DocType",
|
"bank_details_section",
|
||||||
"document_type": "",
|
"bank_name",
|
||||||
"editable_grid": 1,
|
"swift_number",
|
||||||
"engine": "InnoDB",
|
"column_break_1",
|
||||||
|
"branch_code",
|
||||||
|
"website",
|
||||||
|
"address_and_contact",
|
||||||
|
"address_html",
|
||||||
|
"column_break_13",
|
||||||
|
"contact_html",
|
||||||
|
"data_import_configuration_section",
|
||||||
|
"bank_transaction_mapping",
|
||||||
|
"section_break_4",
|
||||||
|
"plaid_access_token"
|
||||||
|
],
|
||||||
"fields": [
|
"fields": [
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
"fieldname": "bank_name",
|
||||||
"allow_in_quick_entry": 0,
|
"fieldtype": "Data",
|
||||||
"allow_on_submit": 0,
|
"label": "Bank Name",
|
||||||
"bold": 0,
|
"reqd": 1,
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "bank_name",
|
|
||||||
"fieldtype": "Data",
|
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 1,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Bank Name",
|
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"permlevel": 0,
|
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 1,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"translatable": 0,
|
|
||||||
"unique": 1
|
"unique": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
"fieldname": "bank_details_section",
|
||||||
"allow_in_quick_entry": 0,
|
"fieldtype": "Section Break",
|
||||||
"allow_on_submit": 0,
|
"label": "Bank Details"
|
||||||
"bold": 0,
|
},
|
||||||
"collapsible": 1,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "data_import_configuration_section",
|
|
||||||
"fieldtype": "Section Break",
|
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Data Import Configuration",
|
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"permlevel": 0,
|
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"translatable": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
"allow_in_quick_entry": 1,
|
||||||
"allow_in_quick_entry": 0,
|
"fieldname": "swift_number",
|
||||||
"allow_on_submit": 0,
|
"fieldtype": "Data",
|
||||||
"bold": 0,
|
"in_list_view": 1,
|
||||||
"collapsible": 0,
|
"in_standard_filter": 1,
|
||||||
"columns": 0,
|
"label": "SWIFT number",
|
||||||
"fieldname": "bank_transaction_mapping",
|
"unique": 1
|
||||||
"fieldtype": "Table",
|
},
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Bank Transaction Mapping",
|
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"options": "Bank Transaction Mapping",
|
|
||||||
"permlevel": 0,
|
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"translatable": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
"fieldname": "column_break_1",
|
||||||
"allow_in_quick_entry": 0,
|
"fieldtype": "Column Break",
|
||||||
"allow_on_submit": 0,
|
"search_index": 1
|
||||||
"bold": 0,
|
},
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "section_break_4",
|
|
||||||
"fieldtype": "Section Break",
|
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"permlevel": 0,
|
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"translatable": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
"allow_in_quick_entry": 1,
|
||||||
"allow_in_quick_entry": 0,
|
"fieldname": "branch_code",
|
||||||
"allow_on_submit": 0,
|
"fieldtype": "Data",
|
||||||
"bold": 0,
|
"in_list_view": 1,
|
||||||
"collapsible": 0,
|
"in_standard_filter": 1,
|
||||||
"columns": 0,
|
"label": "Branch Code",
|
||||||
"fieldname": "plaid_access_token",
|
"unique": 1
|
||||||
"fieldtype": "Data",
|
},
|
||||||
"hidden": 1,
|
{
|
||||||
"ignore_user_permissions": 0,
|
"fieldname": "address_and_contact",
|
||||||
"ignore_xss_filter": 0,
|
"fieldtype": "Section Break",
|
||||||
"in_filter": 0,
|
"label": "Address and Contact",
|
||||||
"in_global_search": 0,
|
"options": "fa fa-map-marker"
|
||||||
"in_list_view": 0,
|
},
|
||||||
"in_standard_filter": 0,
|
{
|
||||||
"label": "Plaid Access Token",
|
"fieldname": "address_html",
|
||||||
"length": 0,
|
"fieldtype": "HTML",
|
||||||
"no_copy": 1,
|
"label": "Address HTML"
|
||||||
"permlevel": 0,
|
},
|
||||||
"precision": "",
|
{
|
||||||
"print_hide": 0,
|
"fieldname": "website",
|
||||||
"print_hide_if_no_value": 0,
|
"fieldtype": "Data",
|
||||||
"read_only": 1,
|
"label": "Website"
|
||||||
"remember_last_selected_value": 0,
|
},
|
||||||
"report_hide": 0,
|
{
|
||||||
"reqd": 0,
|
"fieldname": "column_break_13",
|
||||||
"search_index": 0,
|
"fieldtype": "Column Break"
|
||||||
"set_only_once": 0,
|
},
|
||||||
"translatable": 0,
|
{
|
||||||
"unique": 0
|
"fieldname": "contact_html",
|
||||||
|
"fieldtype": "HTML",
|
||||||
|
"label": "Contact HTML"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"collapsible": 1,
|
||||||
|
"fieldname": "data_import_configuration_section",
|
||||||
|
"fieldtype": "Section Break",
|
||||||
|
"label": "Data Import Configuration"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "bank_transaction_mapping",
|
||||||
|
"fieldtype": "Table",
|
||||||
|
"label": "Bank Transaction Mapping",
|
||||||
|
"options": "Bank Transaction Mapping"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "section_break_4",
|
||||||
|
"fieldtype": "Section Break"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "plaid_access_token",
|
||||||
|
"fieldtype": "Data",
|
||||||
|
"hidden": 1,
|
||||||
|
"label": "Plaid Access Token",
|
||||||
|
"no_copy": 1,
|
||||||
|
"read_only": 1
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"has_web_view": 0,
|
"links": [],
|
||||||
"hide_heading": 0,
|
"modified": "2020-03-25 21:22:33.496264",
|
||||||
"hide_toolbar": 0,
|
"modified_by": "Administrator",
|
||||||
"idx": 0,
|
"module": "Accounts",
|
||||||
"image_view": 0,
|
"name": "Bank",
|
||||||
"in_create": 0,
|
"owner": "Administrator",
|
||||||
"is_submittable": 0,
|
|
||||||
"issingle": 0,
|
|
||||||
"istable": 0,
|
|
||||||
"max_attachments": 0,
|
|
||||||
"modified": "2018-11-27 16:12:13.938776",
|
|
||||||
"modified_by": "Administrator",
|
|
||||||
"module": "Accounts",
|
|
||||||
"name": "Bank",
|
|
||||||
"name_case": "",
|
|
||||||
"owner": "Administrator",
|
|
||||||
"permissions": [
|
"permissions": [
|
||||||
{
|
{
|
||||||
"amend": 0,
|
"create": 1,
|
||||||
"cancel": 0,
|
"delete": 1,
|
||||||
"create": 1,
|
"email": 1,
|
||||||
"delete": 1,
|
"export": 1,
|
||||||
"email": 1,
|
"print": 1,
|
||||||
"export": 1,
|
"read": 1,
|
||||||
"if_owner": 0,
|
"report": 1,
|
||||||
"import": 0,
|
"role": "System Manager",
|
||||||
"permlevel": 0,
|
"share": 1,
|
||||||
"print": 1,
|
|
||||||
"read": 1,
|
|
||||||
"report": 1,
|
|
||||||
"role": "System Manager",
|
|
||||||
"set_user_permissions": 0,
|
|
||||||
"share": 1,
|
|
||||||
"submit": 0,
|
|
||||||
"write": 1
|
"write": 1
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"quick_entry": 1,
|
"quick_entry": 1,
|
||||||
"read_only": 0,
|
"sort_field": "modified",
|
||||||
"read_only_onload": 0,
|
"sort_order": "DESC",
|
||||||
"show_name_in_global_search": 0,
|
"track_changes": 1
|
||||||
"sort_field": "modified",
|
|
||||||
"sort_order": "DESC",
|
|
||||||
"track_changes": 1,
|
|
||||||
"track_seen": 0,
|
|
||||||
"track_views": 0
|
|
||||||
}
|
}
|
||||||
@@ -5,6 +5,12 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
import frappe
|
import frappe
|
||||||
from frappe.model.document import Document
|
from frappe.model.document import Document
|
||||||
|
from frappe.contacts.address_and_contact import load_address_and_contact, delete_contact_and_address
|
||||||
|
|
||||||
class Bank(Document):
|
class Bank(Document):
|
||||||
pass
|
def onload(self):
|
||||||
|
"""Load address and contacts in `__onload`"""
|
||||||
|
load_address_and_contact(self)
|
||||||
|
|
||||||
|
def on_trash(self):
|
||||||
|
delete_contact_and_address('Bank', self.name)
|
||||||
@@ -24,8 +24,6 @@
|
|||||||
"iban",
|
"iban",
|
||||||
"column_break_12",
|
"column_break_12",
|
||||||
"bank_account_no",
|
"bank_account_no",
|
||||||
"branch_code",
|
|
||||||
"swift_number",
|
|
||||||
"address_and_contact",
|
"address_and_contact",
|
||||||
"address_html",
|
"address_html",
|
||||||
"website",
|
"website",
|
||||||
@@ -145,17 +143,6 @@
|
|||||||
"label": "Bank Account No",
|
"label": "Bank Account No",
|
||||||
"length": 30
|
"length": 30
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"fieldname": "branch_code",
|
|
||||||
"fieldtype": "Data",
|
|
||||||
"in_list_view": 1,
|
|
||||||
"label": "Branch Code"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldname": "swift_number",
|
|
||||||
"fieldtype": "Data",
|
|
||||||
"label": "SWIFT number"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"fieldname": "address_and_contact",
|
"fieldname": "address_and_contact",
|
||||||
"fieldtype": "Section Break",
|
"fieldtype": "Section Break",
|
||||||
@@ -213,7 +200,7 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2020-01-29 20:42:26.458316",
|
"modified": "2020-01-30 20:42:26.458316",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Accounts",
|
"module": "Accounts",
|
||||||
"name": "Bank Account",
|
"name": "Bank Account",
|
||||||
|
|||||||
@@ -4,8 +4,8 @@
|
|||||||
cur_frm.add_fetch('bank_account','account','account');
|
cur_frm.add_fetch('bank_account','account','account');
|
||||||
cur_frm.add_fetch('bank_account','bank_account_no','bank_account_no');
|
cur_frm.add_fetch('bank_account','bank_account_no','bank_account_no');
|
||||||
cur_frm.add_fetch('bank_account','iban','iban');
|
cur_frm.add_fetch('bank_account','iban','iban');
|
||||||
cur_frm.add_fetch('bank_account','branch_code','branch_code');
|
cur_frm.add_fetch('bank','branch_code','branch_code');
|
||||||
cur_frm.add_fetch('bank_account','swift_number','swift_number');
|
cur_frm.add_fetch('bank','swift_number','swift_number');
|
||||||
|
|
||||||
frappe.ui.form.on('Bank Guarantee', {
|
frappe.ui.form.on('Bank Guarantee', {
|
||||||
setup: function(frm) {
|
setup: function(frm) {
|
||||||
|
|||||||
@@ -33,7 +33,9 @@ frappe.ui.form.on('Payment Entry', {
|
|||||||
frm.set_query("party_bank_account", function() {
|
frm.set_query("party_bank_account", function() {
|
||||||
return {
|
return {
|
||||||
filters: {
|
filters: {
|
||||||
"is_company_account":0
|
"is_company_account":0,
|
||||||
|
party_type: frm.doc.party_type,
|
||||||
|
party: frm.doc.party
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -839,7 +839,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
"fetch_from": "bank_account.branch_code",
|
"fetch_from": "bank.branch_code",
|
||||||
"fieldname": "branch_code",
|
"fieldname": "branch_code",
|
||||||
"fieldtype": "Read Only",
|
"fieldtype": "Read Only",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -873,7 +873,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
"fetch_from": "bank_account.swift_number",
|
"fetch_from": "bank.swift_number",
|
||||||
"fieldname": "swift_number",
|
"fieldname": "swift_number",
|
||||||
"fieldtype": "Read Only",
|
"fieldtype": "Read Only",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
|
|||||||
@@ -34,4 +34,4 @@ def get_data():
|
|||||||
'items': ['Pricing Rule']
|
'items': ['Pricing Rule']
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -658,4 +658,5 @@ erpnext.patches.v12_0.set_permission_einvoicing
|
|||||||
erpnext.patches.v12_0.set_published_in_hub_tracked_item
|
erpnext.patches.v12_0.set_published_in_hub_tracked_item
|
||||||
erpnext.patches.v12_0.set_job_offer_applicant_email
|
erpnext.patches.v12_0.set_job_offer_applicant_email
|
||||||
erpnext.patches.v12_0.create_irs_1099_field_united_states
|
erpnext.patches.v12_0.create_irs_1099_field_united_states
|
||||||
|
erpnext.patches.v12_0.move_bank_account_swift_number_to_bank
|
||||||
erpnext.patches.v12_0.rename_bank_reconciliation_fields # 2020-01-22
|
erpnext.patches.v12_0.rename_bank_reconciliation_fields # 2020-01-22
|
||||||
|
|||||||
@@ -0,0 +1,14 @@
|
|||||||
|
from __future__ import unicode_literals
|
||||||
|
import frappe
|
||||||
|
|
||||||
|
def execute():
|
||||||
|
frappe.reload_doc('accounts', 'doctype', 'bank', force=1)
|
||||||
|
|
||||||
|
frappe.db.sql("""
|
||||||
|
UPDATE `tabBank` b, `tabBank Account` ba
|
||||||
|
SET b.swift_number = ba.swift_number, b.branch_code = ba.branch_code
|
||||||
|
WHERE b.name = ba.bank
|
||||||
|
""")
|
||||||
|
|
||||||
|
frappe.reload_doc('accounts', 'doctype', 'bank_account')
|
||||||
|
frappe.reload_doc('accounts', 'doctype', 'payment_request')
|
||||||
Reference in New Issue
Block a user