From 99e3ca0f67bc9d4c1a9d35a77196af8c03987168 Mon Sep 17 00:00:00 2001 From: Sathisha Poojary Date: Sat, 7 Apr 2018 19:00:05 +0530 Subject: [PATCH] Create a new doctype for bank so that we can suport other bank statements dynamically. --- erpnext/accounts/doctype/bank/__init__.py | 0 erpnext/accounts/doctype/bank/bank.js | 8 ++ erpnext/accounts/doctype/bank/bank.json | 94 +++++++++++++++++++ erpnext/accounts/doctype/bank/bank.py | 10 ++ erpnext/accounts/doctype/bank/test_bank.js | 23 +++++ erpnext/accounts/doctype/bank/test_bank.py | 10 ++ .../bank_statement_settings.json | 8 +- .../bank_statement_transaction_entry.json | 66 ++++++------- 8 files changed, 182 insertions(+), 37 deletions(-) create mode 100644 erpnext/accounts/doctype/bank/__init__.py create mode 100644 erpnext/accounts/doctype/bank/bank.js create mode 100644 erpnext/accounts/doctype/bank/bank.json create mode 100644 erpnext/accounts/doctype/bank/bank.py create mode 100644 erpnext/accounts/doctype/bank/test_bank.js create mode 100644 erpnext/accounts/doctype/bank/test_bank.py diff --git a/erpnext/accounts/doctype/bank/__init__.py b/erpnext/accounts/doctype/bank/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/accounts/doctype/bank/bank.js b/erpnext/accounts/doctype/bank/bank.js new file mode 100644 index 0000000000..1063a07b82 --- /dev/null +++ b/erpnext/accounts/doctype/bank/bank.js @@ -0,0 +1,8 @@ +// Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors +// For license information, please see license.txt + +frappe.ui.form.on('Bank', { + refresh: function(frm) { + + } +}); diff --git a/erpnext/accounts/doctype/bank/bank.json b/erpnext/accounts/doctype/bank/bank.json new file mode 100644 index 0000000000..0a24726f36 --- /dev/null +++ b/erpnext/accounts/doctype/bank/bank.json @@ -0,0 +1,94 @@ +{ + "allow_copy": 0, + "allow_guest_to_view": 0, + "allow_import": 0, + "allow_rename": 0, + "autoname": "field:bank_name", + "beta": 0, + "creation": "2018-04-07 16:59:59.496668", + "custom": 0, + "docstatus": 0, + "doctype": "DocType", + "document_type": "", + "editable_grid": 1, + "engine": "InnoDB", + "fields": [ + { + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "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": 0 + } + ], + "has_web_view": 0, + "hide_heading": 0, + "hide_toolbar": 0, + "idx": 0, + "image_view": 0, + "in_create": 0, + "is_submittable": 0, + "issingle": 0, + "istable": 0, + "max_attachments": 0, + "modified": "2018-04-07 17:00:21.246202", + "modified_by": "Administrator", + "module": "Accounts", + "name": "Bank", + "name_case": "", + "owner": "Administrator", + "permissions": [ + { + "amend": 0, + "apply_user_permissions": 0, + "cancel": 0, + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "if_owner": 0, + "import": 0, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "System Manager", + "set_user_permissions": 0, + "share": 1, + "submit": 0, + "write": 1 + } + ], + "quick_entry": 1, + "read_only": 0, + "read_only_onload": 0, + "show_name_in_global_search": 0, + "sort_field": "modified", + "sort_order": "DESC", + "track_changes": 1, + "track_seen": 0 +} \ No newline at end of file diff --git a/erpnext/accounts/doctype/bank/bank.py b/erpnext/accounts/doctype/bank/bank.py new file mode 100644 index 0000000000..b205d56678 --- /dev/null +++ b/erpnext/accounts/doctype/bank/bank.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors +# For license information, please see license.txt + +from __future__ import unicode_literals +import frappe +from frappe.model.document import Document + +class Bank(Document): + pass diff --git a/erpnext/accounts/doctype/bank/test_bank.js b/erpnext/accounts/doctype/bank/test_bank.js new file mode 100644 index 0000000000..9ec264415a --- /dev/null +++ b/erpnext/accounts/doctype/bank/test_bank.js @@ -0,0 +1,23 @@ +/* eslint-disable */ +// rename this file from _test_[name] to test_[name] to activate +// and remove above this line + +QUnit.test("test: Bank", function (assert) { + let done = assert.async(); + + // number of asserts + assert.expect(1); + + frappe.run_serially([ + // insert a new Bank + () => frappe.tests.make('Bank', [ + // values to be set + {key: 'value'} + ]), + () => { + assert.equal(cur_frm.doc.key, 'value'); + }, + () => done() + ]); + +}); diff --git a/erpnext/accounts/doctype/bank/test_bank.py b/erpnext/accounts/doctype/bank/test_bank.py new file mode 100644 index 0000000000..d8741f24c5 --- /dev/null +++ b/erpnext/accounts/doctype/bank/test_bank.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors +# See license.txt +from __future__ import unicode_literals + +import frappe +import unittest + +class TestBank(unittest.TestCase): + pass diff --git a/erpnext/accounts/doctype/bank_statement_settings/bank_statement_settings.json b/erpnext/accounts/doctype/bank_statement_settings/bank_statement_settings.json index 19a567ac8f..53fbf7d446 100644 --- a/erpnext/accounts/doctype/bank_statement_settings/bank_statement_settings.json +++ b/erpnext/accounts/doctype/bank_statement_settings/bank_statement_settings.json @@ -19,7 +19,7 @@ "collapsible": 0, "columns": 0, "fieldname": "bank", - "fieldtype": "Data", + "fieldtype": "Link", "hidden": 0, "ignore_user_permissions": 0, "ignore_xss_filter": 0, @@ -27,10 +27,10 @@ "in_global_search": 0, "in_list_view": 1, "in_standard_filter": 0, - "label": "Bank Name", + "label": "Bank Account", "length": 0, "no_copy": 0, - "options": "", + "options": "Bank", "permlevel": 0, "precision": "", "print_hide": 0, @@ -213,7 +213,7 @@ "issingle": 0, "istable": 0, "max_attachments": 0, - "modified": "2018-03-31 10:08:46.971367", + "modified": "2018-04-07 18:57:04.048423", "modified_by": "Administrator", "module": "Accounts", "name": "Bank Statement Settings", diff --git a/erpnext/accounts/doctype/bank_statement_transaction_entry/bank_statement_transaction_entry.json b/erpnext/accounts/doctype/bank_statement_transaction_entry/bank_statement_transaction_entry.json index defcc1009c..a7c56a1e56 100644 --- a/erpnext/accounts/doctype/bank_statement_transaction_entry/bank_statement_transaction_entry.json +++ b/erpnext/accounts/doctype/bank_statement_transaction_entry/bank_statement_transaction_entry.json @@ -168,6 +168,38 @@ "translatable": 0, "unique": 0 }, + { + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "bank", + "fieldtype": "Link", + "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", + "length": 0, + "no_copy": 0, + "options": "Bank", + "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_on_submit": 0, @@ -232,38 +264,6 @@ "translatable": 0, "unique": 0 }, - { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "bank", - "fieldtype": "Select", - "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 Name", - "length": 0, - "no_copy": 0, - "options": "Syndicate", - "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_on_submit": 0, @@ -709,7 +709,7 @@ "issingle": 0, "istable": 0, "max_attachments": 0, - "modified": "2018-03-31 10:11:46.533629", + "modified": "2018-04-07 17:01:47.480572", "modified_by": "Administrator", "module": "Accounts", "name": "Bank Statement Transaction Entry",