From b9fed2aa38c322354999f4d828eec0e40193a0e3 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 9 May 2018 15:10:29 +0530 Subject: [PATCH] Removed company from Finance Book and related changes --- .../doctype/finance_book/finance_book.json | 34 +------------------ .../doctype/journal_entry/journal_entry.json | 34 ++++++++++++++++++- .../accounts_payable/accounts_payable.js | 10 +----- .../accounts_receivable.js | 10 +----- .../accounts_receivable.py | 2 +- .../accounts/report/financial_statements.py | 3 +- .../report/general_ledger/general_ledger.js | 10 +----- .../report/general_ledger/general_ledger.py | 2 +- erpnext/public/js/financial_statements.js | 10 +----- 9 files changed, 42 insertions(+), 73 deletions(-) diff --git a/erpnext/accounts/doctype/finance_book/finance_book.json b/erpnext/accounts/doctype/finance_book/finance_book.json index d13a484028..c9fb843cc3 100644 --- a/erpnext/accounts/doctype/finance_book/finance_book.json +++ b/erpnext/accounts/doctype/finance_book/finance_book.json @@ -43,38 +43,6 @@ "set_only_once": 0, "translatable": 0, "unique": 0 - }, - { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "company", - "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": "Company", - "length": 0, - "no_copy": 0, - "options": "Company", - "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 } ], "has_web_view": 0, @@ -88,7 +56,7 @@ "issingle": 0, "istable": 0, "max_attachments": 0, - "modified": "2018-04-23 02:15:07.997774", + "modified": "2018-05-09 14:55:01.394387", "modified_by": "Administrator", "module": "Accounts", "name": "Finance Book", diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry.json b/erpnext/accounts/doctype/journal_entry/journal_entry.json index 916c71f20f..a975aa0756 100644 --- a/erpnext/accounts/doctype/journal_entry/journal_entry.json +++ b/erpnext/accounts/doctype/journal_entry/journal_entry.json @@ -238,6 +238,38 @@ "translatable": 0, "unique": 0 }, + { + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "finance_book", + "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": "Finance Book", + "length": 0, + "no_copy": 0, + "options": "Finance Book", + "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, @@ -1553,7 +1585,7 @@ "istable": 0, "max_attachments": 0, "menu_index": 0, - "modified": "2018-05-05 13:11:33.696498", + "modified": "2018-05-09 14:56:08.687994", "modified_by": "Administrator", "module": "Accounts", "name": "Journal Entry", diff --git a/erpnext/accounts/report/accounts_payable/accounts_payable.js b/erpnext/accounts/report/accounts_payable/accounts_payable.js index cd6a8fc5f8..f39df3da3d 100644 --- a/erpnext/accounts/report/accounts_payable/accounts_payable.js +++ b/erpnext/accounts/report/accounts_payable/accounts_payable.js @@ -14,15 +14,7 @@ frappe.query_reports["Accounts Payable"] = { "fieldname":"finance_book", "label": __("Finance Book"), "fieldtype": "Link", - "options": "Finance Book", - "get_query": function() { - var company = frappe.query_report_filters_by_name.company.get_value(); - return { - "filters": { - "company": company, - } - }; - } + "options": "Finance Book" }, { "fieldname":"supplier", diff --git a/erpnext/accounts/report/accounts_receivable/accounts_receivable.js b/erpnext/accounts/report/accounts_receivable/accounts_receivable.js index 776835e86d..2caf3590fb 100644 --- a/erpnext/accounts/report/accounts_receivable/accounts_receivable.js +++ b/erpnext/accounts/report/accounts_receivable/accounts_receivable.js @@ -14,15 +14,7 @@ frappe.query_reports["Accounts Receivable"] = { "fieldname":"finance_book", "label": __("Finance Book"), "fieldtype": "Link", - "options": "Finance Book", - "get_query": function() { - var company = frappe.query_report_filters_by_name.company.get_value(); - return { - "filters": { - "company": company, - } - }; - } + "options": "Finance Book" }, { "fieldname":"customer", diff --git a/erpnext/accounts/report/accounts_receivable/accounts_receivable.py b/erpnext/accounts/report/accounts_receivable/accounts_receivable.py index eb14513d79..fc76be406e 100644 --- a/erpnext/accounts/report/accounts_receivable/accounts_receivable.py +++ b/erpnext/accounts/report/accounts_receivable/accounts_receivable.py @@ -322,7 +322,7 @@ class ReceivablePayableReport(object): values.append(self.filters.company) if self.filters.finance_book: - conditions.append("finance_book=%s") + conditions.append("finance_book in (%s, '')") values.append(self.filters.finance_book) else: conditions.append("ifnull(finance_book,'')=%s") diff --git a/erpnext/accounts/report/financial_statements.py b/erpnext/accounts/report/financial_statements.py index 87b7ba1536..ea22bacf21 100644 --- a/erpnext/accounts/report/financial_statements.py +++ b/erpnext/accounts/report/financial_statements.py @@ -376,7 +376,8 @@ def get_additional_conditions(from_date, ignore_closing_entries, filters): if filters.get("cost_center"): additional_conditions.append(get_cost_center_cond(filters.get("cost_center"))) if filters.get("finance_book"): - additional_conditions.append("finance_book = '%s'" % frappe.db.escape(filters.get("finance_book"))) + additional_conditions.append("finance_book in ('%s', '')" % + frappe.db.escape(filters.get("finance_book"))) else: additional_conditions.append("ifnull(finance_book, '') = ''") diff --git a/erpnext/accounts/report/general_ledger/general_ledger.js b/erpnext/accounts/report/general_ledger/general_ledger.js index 91879a8c1f..9a774ce6b9 100644 --- a/erpnext/accounts/report/general_ledger/general_ledger.js +++ b/erpnext/accounts/report/general_ledger/general_ledger.js @@ -15,15 +15,7 @@ frappe.query_reports["General Ledger"] = { "fieldname":"finance_book", "label": __("Finance Book"), "fieldtype": "Link", - "options": "Finance Book", - "get_query": function() { - var company = frappe.query_report_filters_by_name.company.get_value(); - return { - "filters": { - "company": company, - } - }; - } + "options": "Finance Book" }, { "fieldname":"from_date", diff --git a/erpnext/accounts/report/general_ledger/general_ledger.py b/erpnext/accounts/report/general_ledger/general_ledger.py index 6c16a840a0..2d0bd52fd0 100644 --- a/erpnext/accounts/report/general_ledger/general_ledger.py +++ b/erpnext/accounts/report/general_ledger/general_ledger.py @@ -165,7 +165,7 @@ def get_conditions(filters): conditions.append("project=%(project)s") if filters.get("finance_book"): - conditions.append("finance_book=%(finance_book)s") + conditions.append("finance_book in (%(finance_book)s, '')") else: conditions.append("ifnull(finance_book, '')=''") diff --git a/erpnext/public/js/financial_statements.js b/erpnext/public/js/financial_statements.js index 94518f83da..7e31c573c5 100644 --- a/erpnext/public/js/financial_statements.js +++ b/erpnext/public/js/financial_statements.js @@ -74,15 +74,7 @@ function get_filters(){ "fieldname":"finance_book", "label": __("Finance Book"), "fieldtype": "Link", - "options": "Finance Book", - "get_query": function() { - var company = frappe.query_report_filters_by_name.company.get_value(); - return { - "filters": { - "company": company, - } - }; - } + "options": "Finance Book" }, { "fieldname":"from_fiscal_year",