From dd8dbe000b25ac197d5659585047f2a11c262dc5 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Thu, 10 Mar 2016 10:58:31 +0530 Subject: [PATCH 1/4] [fix] Rearranged position of mode_of_payment in sales invoice --- .../doctype/sales_invoice/sales_invoice.json | 76 ++++++++++++------- 1 file changed, 48 insertions(+), 28 deletions(-) diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.json b/erpnext/accounts/doctype/sales_invoice/sales_invoice.json index 2f57a5ba486..8d7ba3f4c97 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.json +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.json @@ -368,6 +368,33 @@ "set_only_once": 0, "unique": 0 }, + { + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "mode_of_payment", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Mode of Payment", + "length": 0, + "no_copy": 0, + "oldfieldname": "mode_of_payment", + "oldfieldtype": "Select", + "options": "Mode of Payment", + "permlevel": 0, + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, { "allow_on_submit": 0, "bold": 0, @@ -1810,33 +1837,6 @@ "set_only_once": 0, "unique": 0 }, - { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "mode_of_payment", - "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_list_view": 0, - "label": "Mode of Payment", - "length": 0, - "no_copy": 0, - "oldfieldname": "mode_of_payment", - "oldfieldtype": "Select", - "options": "Mode of Payment", - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0 - }, { "allow_on_submit": 0, "bold": 0, @@ -3445,7 +3445,7 @@ "istable": 0, "max_attachments": 0, "menu_index": 0, - "modified": "2016-03-03 03:26:22.556219", + "modified": "2016-03-10 10:57:29.923022", "modified_by": "Administrator", "module": "Accounts", "name": "Sales Invoice", @@ -3530,6 +3530,26 @@ "share": 0, "submit": 0, "write": 1 + }, + { + "amend": 0, + "apply_user_permissions": 0, + "cancel": 0, + "create": 0, + "delete": 0, + "email": 0, + "export": 0, + "if_owner": 0, + "import": 0, + "permlevel": 1, + "print": 0, + "read": 1, + "report": 0, + "role": "All", + "set_user_permissions": 0, + "share": 0, + "submit": 0, + "write": 0 } ], "read_only": 0, From 3883e86ad79f1fd02d5b80a2a2b5db623ee85326 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Thu, 10 Mar 2016 12:01:01 +0530 Subject: [PATCH 2/4] [fix] Trial Balance report, showing rows with zero values --- .../accounts/report/financial_statements.py | 16 +++++---- .../report/trial_balance/trial_balance.py | 34 +++++++++---------- 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/erpnext/accounts/report/financial_statements.py b/erpnext/accounts/report/financial_statements.py index 0f10b946d10..3e70a0eef60 100644 --- a/erpnext/accounts/report/financial_statements.py +++ b/erpnext/accounts/report/financial_statements.py @@ -170,17 +170,19 @@ def prepare_data(accounts, balance_must_be, period_list, company_currency): return data -def filter_out_zero_value_rows(data, parent_children_map): +def filter_out_zero_value_rows(data, parent_children_map, show_zero_values=False): data_with_value = [] for d in data: - if d.get("has_value"): + if show_zero_values or d.get("has_value"): data_with_value.append(d) else: - children = [child.name for child in parent_children_map.get(d.account) or []] - for row in data: - if row.account in children and row.get("has_value"): - data_with_value.append(d) - break + # show group with zero balance, if there are balances against child + children = [child.name for child in parent_children_map.get(d.get("account")) or []] + if children: + for row in data: + if row.get("account") in children and row.get("has_value"): + data_with_value.append(d) + break return data_with_value diff --git a/erpnext/accounts/report/trial_balance/trial_balance.py b/erpnext/accounts/report/trial_balance/trial_balance.py index 822702b2e5e..e53d47e353c 100644 --- a/erpnext/accounts/report/trial_balance/trial_balance.py +++ b/erpnext/accounts/report/trial_balance/trial_balance.py @@ -4,8 +4,9 @@ from __future__ import unicode_literals import frappe from frappe import _ -from frappe.utils import cint, flt, getdate, formatdate, cstr -from erpnext.accounts.report.financial_statements import filter_accounts, set_gl_entries_by_account +from frappe.utils import flt, getdate, formatdate, cstr +from erpnext.accounts.report.financial_statements \ + import filter_accounts, set_gl_entries_by_account, filter_out_zero_value_rows value_fields = ("opening_debit", "opening_credit", "debit", "credit", "closing_debit", "closing_credit") @@ -56,7 +57,7 @@ def get_data(filters): if not accounts: return None - accounts, accounts_by_name = filter_accounts(accounts) + accounts, accounts_by_name, parent_children_map = filter_accounts(accounts) min_lft, max_rgt = frappe.db.sql("""select min(lft), max(rgt) from `tabAccount` where company=%s""", (filters.company,))[0] @@ -71,8 +72,10 @@ def get_data(filters): total_row = calculate_values(accounts, gl_entries_by_account, opening_balances, filters) accumulate_values_into_parents(accounts, accounts_by_name) - data = prepare_data(accounts, filters, total_row) - + data = prepare_data(accounts, filters, total_row, parent_children_map) + data = filter_out_zero_value_rows(data, parent_children_map, + show_zero_values=filters.get("show_zero_values")) + return data def get_opening_balances(filters): @@ -156,10 +159,8 @@ def accumulate_values_into_parents(accounts, accounts_by_name): for key in value_fields: accounts_by_name[d.parent_account][key] += d[key] -def prepare_data(accounts, filters, total_row): - show_zero_values = cint(filters.show_zero_values) +def prepare_data(accounts, filters, total_row, parent_children_map): data = [] - accounts_with_zero_value = [] for d in accounts: has_value = False row = { @@ -174,18 +175,15 @@ def prepare_data(accounts, filters, total_row): prepare_opening_and_closing(d) for key in value_fields: - row[key] = d.get(key, 0.0) - if row[key]: + row[key] = flt(d.get(key, 0.0), 3) + + if abs(row[key]) >= 0.005: + # ignore zero values has_value = True - if show_zero_values: - data.append(row) - else: - if not has_value: - accounts_with_zero_value.append(d.name) - elif d.parent_account not in accounts_with_zero_value: - data.append(row) - + row["has_value"] = has_value + data.append(row) + data.extend([{},total_row]) return data From b015f9eca29fd748a1a9bd1bd9b7c809c3e6596d Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Thu, 10 Mar 2016 12:38:48 +0530 Subject: [PATCH 3/4] [fix] [hot] web form fixtures - removed Contact, added Issues and Addresses --- erpnext/fixtures/web_form.json | 67 ------- .../setup/fixtures/web_form/addresses.json | 168 ------------------ erpnext/setup/fixtures/web_form/issues.json | 69 ------- erpnext/setup/install.py | 9 - 4 files changed, 313 deletions(-) delete mode 100644 erpnext/setup/fixtures/web_form/addresses.json delete mode 100644 erpnext/setup/fixtures/web_form/issues.json diff --git a/erpnext/fixtures/web_form.json b/erpnext/fixtures/web_form.json index a24107e38b6..a2488863db6 100644 --- a/erpnext/fixtures/web_form.json +++ b/erpnext/fixtures/web_form.json @@ -1,71 +1,4 @@ [ - { - "allow_comments": 0, - "allow_delete": 0, - "allow_edit": 0, - "allow_multiple": 0, - "breadcrumbs": null, - "doc_type": "Lead", - "docstatus": 0, - "doctype": "Web Form", - "introduction_text": "To contact us sales persons", - "is_standard": 0, - "login_required": 0, - "modified": "2015-01-22 10:43:02.928698", - "name": "contact", - "page_name": "contact", - "published": 1, - "success_message": "Thanks for contact us. We will soon get back to you.", - "success_url": "/contact", - "title": "Contact", - "web_form_fields": [ - { - "default": null, - "description": null, - "fieldname": "lead_name", - "fieldtype": "Data", - "hidden": 0, - "label": "Contact Name", - "options": null, - "read_only": 0, - "reqd": 1 - }, - { - "default": null, - "description": null, - "fieldname": "company_name", - "fieldtype": "Data", - "hidden": 0, - "label": "Organization Name", - "options": null, - "read_only": 0, - "reqd": 0 - }, - { - "default": null, - "description": null, - "fieldname": "email_id", - "fieldtype": "Data", - "hidden": 0, - "label": "Email Id", - "options": null, - "read_only": 0, - "reqd": 0 - }, - { - "default": null, - "description": null, - "fieldname": "website", - "fieldtype": "Data", - "hidden": 0, - "label": "Website", - "options": null, - "read_only": 0, - "reqd": 0 - } - ], - "web_page_link_text": null - }, { "allow_comments": 1, "allow_delete": 1, diff --git a/erpnext/setup/fixtures/web_form/addresses.json b/erpnext/setup/fixtures/web_form/addresses.json deleted file mode 100644 index 932337e4e69..00000000000 --- a/erpnext/setup/fixtures/web_form/addresses.json +++ /dev/null @@ -1,168 +0,0 @@ -[ - { - "allow_comments": 0, - "allow_delete": 0, - "allow_edit": 1, - "allow_multiple": 1, - "breadcrumbs": null, - "doc_type": "Address", - "docstatus": 0, - "doctype": "Web Form", - "introduction_text": null, - "is_standard": 1, - "login_required": 1, - "modified": "2015-11-23 08:21:53.924318", - "name": "addresses", - "page_name": "addresses", - "published": 1, - "success_message": null, - "success_url": "/addresses", - "title": "Addresses", - "web_form_fields": [ - { - "default": null, - "description": "", - "fieldname": "address_title", - "fieldtype": "Data", - "hidden": 0, - "label": "Address Title", - "options": null, - "read_only": 0, - "reqd": 0 - }, - { - "default": null, - "description": null, - "fieldname": "address_type", - "fieldtype": "Select", - "hidden": 0, - "label": "Address Type", - "options": "Billing\nShipping\nOffice\nPersonal\nPlant\nPostal\nShop\nSubsidiary\nWarehouse\nOther", - "read_only": 0, - "reqd": 1 - }, - { - "default": null, - "description": null, - "fieldname": "address_line1", - "fieldtype": "Data", - "hidden": 0, - "label": "Address Line 1", - "options": null, - "read_only": 0, - "reqd": 1 - }, - { - "default": null, - "description": null, - "fieldname": "address_line2", - "fieldtype": "Data", - "hidden": 0, - "label": "Address Line 2", - "options": null, - "read_only": 0, - "reqd": 0 - }, - { - "default": null, - "description": null, - "fieldname": "city", - "fieldtype": "Data", - "hidden": 0, - "label": "City/Town", - "options": null, - "read_only": 0, - "reqd": 1 - }, - { - "default": null, - "description": null, - "fieldname": "state", - "fieldtype": "Data", - "hidden": 0, - "label": "State", - "options": null, - "read_only": 0, - "reqd": 0 - }, - { - "default": null, - "description": null, - "fieldname": "pincode", - "fieldtype": "Data", - "hidden": 0, - "label": "Postal Code", - "options": null, - "read_only": 0, - "reqd": 0 - }, - { - "default": null, - "description": null, - "fieldname": "country", - "fieldtype": "Link", - "hidden": 0, - "label": "Country", - "options": "Country", - "read_only": 0, - "reqd": 1 - }, - { - "default": null, - "description": null, - "fieldname": null, - "fieldtype": "Column Break", - "hidden": 0, - "label": null, - "options": null, - "read_only": 0, - "reqd": 0 - }, - { - "default": null, - "description": null, - "fieldname": "email_id", - "fieldtype": "Data", - "hidden": 0, - "label": "Email Id", - "options": null, - "read_only": 0, - "reqd": 0 - }, - { - "default": null, - "description": null, - "fieldname": "phone", - "fieldtype": "Data", - "hidden": 0, - "label": "Phone", - "options": null, - "read_only": 0, - "reqd": 1 - }, - { - "default": "0", - "description": "", - "fieldname": "is_primary_address", - "fieldtype": "Check", - "hidden": 0, - "label": "Preferred Billing Address", - "options": null, - "read_only": 0, - "reqd": 0 - }, - { - "default": "0", - "description": "", - "fieldname": "is_shipping_address", - "fieldtype": "Check", - "hidden": 0, - "label": "Preferred Shipping Address", - "options": null, - "read_only": 0, - "reqd": 0 - } - ], - "web_page_link_text": null - } -] diff --git a/erpnext/setup/fixtures/web_form/issues.json b/erpnext/setup/fixtures/web_form/issues.json deleted file mode 100644 index b452affdbfc..00000000000 --- a/erpnext/setup/fixtures/web_form/issues.json +++ /dev/null @@ -1,69 +0,0 @@ -[ - { - "allow_comments": 1, - "allow_delete": 1, - "allow_edit": 1, - "allow_multiple": 1, - "breadcrumbs": "[{\"title\":\"Issues\", \"name\":\"issues\"}]", - "doc_type": "Issue", - "docstatus": 0, - "doctype": "Web Form", - "is_standard": 1, - "introduction_text": null, - "login_required": 1, - "modified": "2015-06-01 08:14:26.350792", - "name": "issues", - "page_name": "issues", - "published": 1, - "success_message": "", - "success_url": "/issues", - "title": "Issues", - "web_form_fields": [ - { - "default": null, - "description": null, - "fieldname": "subject", - "fieldtype": "Data", - "hidden": 0, - "label": "Subject", - "options": null, - "read_only": 0, - "reqd": 1 - }, - { - "default": "Open", - "description": null, - "fieldname": "status", - "fieldtype": "Select", - "hidden": null, - "label": "Status", - "options": "Open\nReplied\nHold\nClosed", - "read_only": 1, - "reqd": 0 - }, - { - "default": null, - "description": null, - "fieldname": "description", - "fieldtype": "Text", - "hidden": 0, - "label": "Description", - "options": null, - "read_only": 0, - "reqd": 0 - }, - { - "default": null, - "description": null, - "fieldname": "attachment", - "fieldtype": "Attach", - "hidden": null, - "label": "Attachment", - "options": null, - "read_only": null, - "reqd": null - } - ], - "web_page_link_text": null - } -] diff --git a/erpnext/setup/install.py b/erpnext/setup/install.py index 9a44da1a525..6a5c3f5456e 100644 --- a/erpnext/setup/install.py +++ b/erpnext/setup/install.py @@ -14,7 +14,6 @@ def after_install(): feature_setup() from frappe.desk.page.setup_wizard.setup_wizard import add_all_roles_to add_all_roles_to("Administrator") - add_web_forms() frappe.db.commit() def check_setup_wizard_not_completed(): @@ -57,11 +56,3 @@ def set_single_defaults(): frappe.db.set_default("date_format", "dd-mm-yyyy") -def add_web_forms(): - """Import web forms for Issues and Addresses""" - from frappe.modules.import_file import import_file_by_path - - import_file_by_path(frappe.get_app_path("erpnext", "setup/fixtures/web_form/issues.json"), - data_import=True) - import_file_by_path(frappe.get_app_path("erpnext", "setup/fixtures/web_form/addresses.json"), - data_import=True) From 1bca0780a4061e10f2089f0af2c6621d1eff2fbd Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Thu, 10 Mar 2016 13:18:52 +0600 Subject: [PATCH 4/4] bumped to version 6.25.3 --- erpnext/__version__.py | 2 +- erpnext/hooks.py | 2 +- setup.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/erpnext/__version__.py b/erpnext/__version__.py index 8e276e5d1b1..f8a1385a2ad 100644 --- a/erpnext/__version__.py +++ b/erpnext/__version__.py @@ -1,2 +1,2 @@ from __future__ import unicode_literals -__version__ = '6.25.2' +__version__ = '6.25.3' diff --git a/erpnext/hooks.py b/erpnext/hooks.py index e25a6235cd8..5ff795a6358 100644 --- a/erpnext/hooks.py +++ b/erpnext/hooks.py @@ -7,7 +7,7 @@ app_publisher = "Frappe Technologies Pvt. Ltd." app_description = """ERP made simple""" app_icon = "icon-th" app_color = "#e74c3c" -app_version = "6.25.2" +app_version = "6.25.3" app_email = "info@erpnext.com" app_license = "GNU General Public License (v3)" source_link = "https://github.com/frappe/erpnext" diff --git a/setup.py b/setup.py index 950f85ce070..f9e54447067 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,7 @@ from setuptools import setup, find_packages from pip.req import parse_requirements -version = "6.25.2" +version = "6.25.3" requirements = parse_requirements("requirements.txt", session="") setup(