Merge branch 'develop'
diff --git a/erpnext/__version__.py b/erpnext/__version__.py
index 8e276e5..f8a1385 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/accounts/doctype/sales_invoice/sales_invoice.json b/erpnext/accounts/doctype/sales_invoice/sales_invoice.json
index 2f57a5b..8d7ba3f 100644
--- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.json
+++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.json
@@ -372,6 +372,33 @@
    "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, 
+   "collapsible": 0, 
    "fieldname": "company", 
    "fieldtype": "Link", 
    "hidden": 0, 
@@ -1814,33 +1841,6 @@
    "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, 
-   "collapsible": 0, 
    "depends_on": "is_pos", 
    "fieldname": "cash_bank_account", 
    "fieldtype": "Link", 
@@ -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, 
diff --git a/erpnext/accounts/report/financial_statements.py b/erpnext/accounts/report/financial_statements.py
index 0f10b94..3e70a0e 100644
--- a/erpnext/accounts/report/financial_statements.py
+++ b/erpnext/accounts/report/financial_statements.py
@@ -170,17 +170,19 @@
 		
 	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 822702b..e53d47e 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 @@
 	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 @@
 	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 @@
 			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 @@
 		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
diff --git a/erpnext/fixtures/web_form.json b/erpnext/fixtures/web_form.json
index a24107e38b..a248886 100644
--- a/erpnext/fixtures/web_form.json
+++ b/erpnext/fixtures/web_form.json
@@ -1,72 +1,5 @@
 [
  {
-  "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, 
   "allow_edit": 1, 
diff --git a/erpnext/hooks.py b/erpnext/hooks.py
index e25a623..5ff795a 100644
--- a/erpnext/hooks.py
+++ b/erpnext/hooks.py
@@ -7,7 +7,7 @@
 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/erpnext/setup/fixtures/web_form/addresses.json b/erpnext/setup/fixtures/web_form/addresses.json
deleted file mode 100644
index 932337e..0000000
--- 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 b452aff..0000000
--- 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 9a44da1..6a5c3f5 100644
--- a/erpnext/setup/install.py
+++ b/erpnext/setup/install.py
@@ -14,7 +14,6 @@
 	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 @@
 
 	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)
diff --git a/setup.py b/setup.py
index 950f85c..f9e5444 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(