From 80381475c499fb0273d795843a150cfc7d53cf7a Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Tue, 21 Apr 2015 11:08:53 +0530 Subject: [PATCH] [ux] re-arranged columns in bank reconciliation, fixes #3114 --- .../bank_reconciliation.js | 40 +++---- .../bank_reconciliation_detail.json | 105 +++++++++--------- 2 files changed, 75 insertions(+), 70 deletions(-) diff --git a/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.js b/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.js index 5f4aa5490f..96f9007d06 100644 --- a/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.js +++ b/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.js @@ -1,10 +1,25 @@ // Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors // License: GNU General Public License v3. See license.txt -cur_frm.cscript.onload = function(doc, cdt, cdn){ - cur_frm.set_intro(' ' + - __("Update clearance date of Journal Entries marked as 'Bank Entry'")); +frappe.ui.form.on("Bank Reconciliation", { + update_clearance_date: function(frm) { + return frappe.call({ + method: "update_details", + doc: frm.doc + }); + }, + get_relevant_entries: function(frm) { + return frappe.call({ + method: "get_details", + doc: frm.doc, + callback: function(r, rt) { + frm.refresh() + } + }); + } +}); +cur_frm.cscript.onload = function(doc, cdt, cdn) { cur_frm.add_fetch("bank_account", "company", "company"); cur_frm.set_query("bank_account", function() { @@ -15,21 +30,8 @@ cur_frm.cscript.onload = function(doc, cdt, cdn){ } }; }); + + cur_frm.set_value("from_date", frappe.datetime.month_start()); + cur_frm.set_value("to_date", frappe.datetime.month_end()); } -frappe.ui.form.on("Bank Reconciliation", "update_clearance_date", function(frm) { - return frappe.call({ - method: "update_details", - doc: frm.doc - }) -}) - -frappe.ui.form.on("Bank Reconciliation", "get_relevant_entries", function(frm) { - return frappe.call({ - method: "get_details", - doc: frm.doc, - callback: function(r, rt) { - frm.refresh() - } - }) -}) diff --git a/erpnext/accounts/doctype/bank_reconciliation_detail/bank_reconciliation_detail.json b/erpnext/accounts/doctype/bank_reconciliation_detail/bank_reconciliation_detail.json index 7cdb071c41..b2c6e66e04 100644 --- a/erpnext/accounts/doctype/bank_reconciliation_detail/bank_reconciliation_detail.json +++ b/erpnext/accounts/doctype/bank_reconciliation_detail/bank_reconciliation_detail.json @@ -1,12 +1,12 @@ { - "creation": "2013-02-22 01:27:37.000000", + "creation": "2013-02-22 01:27:37", "docstatus": 0, "doctype": "DocType", "fields": [ { "fieldname": "voucher_id", "fieldtype": "Link", - "in_list_view": 1, + "in_list_view": 0, "label": "Voucher ID", "no_copy": 0, "oldfieldname": "voucher_id", @@ -15,6 +15,17 @@ "permlevel": 0, "search_index": 0 }, + { + "fieldname": "clearance_date", + "fieldtype": "Date", + "in_list_view": 1, + "label": "Clearance Date", + "no_copy": 0, + "oldfieldname": "clearance_date", + "oldfieldtype": "Date", + "permlevel": 0, + "search_index": 0 + }, { "fieldname": "against_account", "fieldtype": "Data", @@ -27,29 +38,6 @@ "read_only": 1, "search_index": 0 }, - { - "fieldname": "posting_date", - "fieldtype": "Date", - "in_list_view": 1, - "label": "Posting Date", - "no_copy": 0, - "oldfieldname": "posting_date", - "oldfieldtype": "Date", - "permlevel": 0, - "read_only": 1, - "search_index": 0 - }, - { - "fieldname": "clearance_date", - "fieldtype": "Date", - "in_list_view": 1, - "label": "Clearance Date", - "no_copy": 0, - "oldfieldname": "clearance_date", - "oldfieldtype": "Date", - "permlevel": 0, - "search_index": 0 - }, { "fieldname": "cheque_number", "fieldtype": "Data", @@ -62,6 +50,44 @@ "read_only": 1, "search_index": 0 }, + { + "fieldname": "debit", + "fieldtype": "Currency", + "in_list_view": 1, + "label": "Debit", + "no_copy": 0, + "oldfieldname": "debit", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "read_only": 1, + "search_index": 0 + }, + { + "fieldname": "credit", + "fieldtype": "Currency", + "in_list_view": 1, + "label": "Credit", + "no_copy": 0, + "oldfieldname": "credit", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "read_only": 1, + "search_index": 0 + }, + { + "fieldname": "posting_date", + "fieldtype": "Date", + "in_list_view": 0, + "label": "Posting Date", + "no_copy": 0, + "oldfieldname": "posting_date", + "oldfieldtype": "Date", + "permlevel": 0, + "read_only": 1, + "search_index": 0 + }, { "fieldname": "cheque_date", "fieldtype": "Date", @@ -73,37 +99,14 @@ "permlevel": 0, "read_only": 1, "search_index": 0 - }, - { - "fieldname": "debit", - "fieldtype": "Currency", - "label": "Debit", - "no_copy": 0, - "oldfieldname": "debit", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "permlevel": 0, - "read_only": 1, - "search_index": 0 - }, - { - "fieldname": "credit", - "fieldtype": "Currency", - "label": "Credit", - "no_copy": 0, - "oldfieldname": "credit", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "permlevel": 0, - "read_only": 1, - "search_index": 0 } ], "idx": 1, "istable": 1, - "modified": "2013-12-20 19:22:55.000000", + "modified": "2015-04-21 01:29:29.570890", "modified_by": "Administrator", "module": "Accounts", "name": "Bank Reconciliation Detail", - "owner": "Administrator" + "owner": "Administrator", + "permissions": [] } \ No newline at end of file