Merge branch 'master' of git://github.com/webnotes/erpnext
diff --git a/erpnext/patches/remove_previous_field_property_setter.py b/erpnext/patches/remove_previous_field_property_setter.py
new file mode 100644
index 0000000..677188e
--- /dev/null
+++ b/erpnext/patches/remove_previous_field_property_setter.py
@@ -0,0 +1,6 @@
+import webnotes
+def execute():
+	webnotes.conn.sql("""\
+		DELETE FROM `tabProperty Setter`
+		WHERE property='previous_field'
+	""")
diff --git a/erpnext/patches/update_0_idx.py b/erpnext/patches/update_0_idx.py
new file mode 100644
index 0000000..9c31f1d
--- /dev/null
+++ b/erpnext/patches/update_0_idx.py
@@ -0,0 +1,9 @@
+import webnotes
+def execute():
+	doc_type_list = webnotes.conn.sql("""SELECT DISTINCT parent FROM `tabDocField` where idx=0""")
+	for doc_type in doc_type_list:
+		if doc_type and doc_type[0]:
+			webnotes.conn.sql("""\
+				UPDATE `tabDocField` SET idx=idx+1
+				WHERE parent=%s
+			""", doc_type[0])
diff --git a/erpnext/setup/doctype/email_digest/email_digest.py b/erpnext/setup/doctype/email_digest/email_digest.py
index 5b76024..3498a7f 100644
--- a/erpnext/setup/doctype/email_digest/email_digest.py
+++ b/erpnext/setup/doctype/email_digest/email_digest.py
@@ -121,6 +121,8 @@
 				#webnotes.msgprint(query)
 				#webnotes.msgprint(res)
 				result[query] = (res and len(res)==1) and res[0] or (res and res or None)
+				if result[query] is None:
+					del result[query]
 		
 		return result
 
@@ -586,7 +588,7 @@
 			},
 
 			'bank_balance': {
-				'table': 'bank_balance' in result and table({
+				'table': 'bank_balance' in result and result['bank_balance'] and table({
 					'head': 'Bank Balance',
 					'body': [
 						[
@@ -662,8 +664,15 @@
 					table_list.append(\
 						"<div style='font-size: 16px; color: grey'>[" + \
 							k.capitalize() + \
-							"]<br />Missing: Ledger of type 'Bank or Cash'\
+							"]<br />Missing: Account of type 'Bank or Cash'\
 						</div>")
+				elif k=='bank_balance':
+					table_list.append(\
+						"<div style='font-size: 16px; color: grey'>[" + \
+							"Bank Balance" + \
+							"]<br />Alert: GL Entry not found for Account of type 'Bank or Cash'\
+						</div>")
+					
 		
 		i = 0
 		result = []