Merge branch 'warehouse_blank_issue_for_non_stock_account' of https://github.com/rohitwaghchaure/erpnext_develop into rohitwaghchaure-warehouse_blank_issue_for_non_stock_account
diff --git a/erpnext/__init__.py b/erpnext/__init__.py
index e0ce4fb..1850146 100644
--- a/erpnext/__init__.py
+++ b/erpnext/__init__.py
@@ -2,7 +2,7 @@
 from __future__ import unicode_literals
 import frappe
 
-__version__ = '7.0.4'
+__version__ = '7.0.5'
 
 def get_default_company(user=None):
 	'''Get default company for user'''
diff --git a/erpnext/maintenance/doctype/maintenance_schedule/maintenance_schedule.py b/erpnext/maintenance/doctype/maintenance_schedule/maintenance_schedule.py
index 9821246..4cbccaf 100644
--- a/erpnext/maintenance/doctype/maintenance_schedule/maintenance_schedule.py
+++ b/erpnext/maintenance/doctype/maintenance_schedule/maintenance_schedule.py
@@ -58,7 +58,7 @@
 			if no_email_sp:
 				frappe.msgprint(
 					frappe._("Setting Events to {0}, since the Employee attached to the below Sales Persons does not have a User ID{1}").format(
-						doc.owner, "<br>"+no_email_sp.join("<br>")
+						self.owner, "<br>"+no_email_sp.join("<br>")
 				))
 
 			scheduled_date = frappe.db.sql("""select scheduled_date from
@@ -153,7 +153,7 @@
 			elif not d.sales_person:
 				throw(_("Please select Incharge Person's name"))
 
-			if getdate(d.start_date) > getdate(d.end_date):
+			if getdate(d.start_date) >= getdate(d.end_date):
 				throw(_("Start date should be less than end date for Item {0}").format(d.item_code))
 
 	def validate_sales_order(self):
diff --git a/erpnext/patches.txt b/erpnext/patches.txt
index fdbaf59..6971e0d 100644
--- a/erpnext/patches.txt
+++ b/erpnext/patches.txt
@@ -279,7 +279,7 @@
 erpnext.patches.v7_0.update_mins_to_first_response
 erpnext.patches.v6_20x.repost_valuation_rate_for_negative_inventory
 erpnext.patches.v7_0.system_settings_setup_complete
-erpnext.patches.v7_0.set_naming_series_for_timesheet
+erpnext.patches.v7_0.set_naming_series_for_timesheet #2016-07-27
 execute:frappe.reload_doc('projects', 'doctype', 'project')
 execute:frappe.reload_doc('projects', 'doctype', 'project_user')
 erpnext.patches.v7_0.convert_timelogbatch_to_timesheet
diff --git a/erpnext/patches/v7_0/calculate_total_costing_amount.py b/erpnext/patches/v7_0/calculate_total_costing_amount.py
index 3163517..4da839f 100644
--- a/erpnext/patches/v7_0/calculate_total_costing_amount.py
+++ b/erpnext/patches/v7_0/calculate_total_costing_amount.py
@@ -11,5 +11,6 @@
 			ts.update_cost()
 			ts.calculate_total_amounts()
 			ts.flags.ignore_validate = True
+			ts.flags.ignore_mandatory = True
 			ts.flags.ignore_validate_update_after_submit = True
 			ts.save()
diff --git a/erpnext/patches/v7_0/rename_fee_amount_to_fee_component.py b/erpnext/patches/v7_0/rename_fee_amount_to_fee_component.py
index 662a260..5cb6a3b 100644
--- a/erpnext/patches/v7_0/rename_fee_amount_to_fee_component.py
+++ b/erpnext/patches/v7_0/rename_fee_amount_to_fee_component.py
@@ -7,9 +7,10 @@
 from frappe.model.utils.rename_field import rename_field
 
 def execute():
-	frappe.rename_doc("DocType", "Fee Amount", "Fee Component")
-	for dt in ("Fees", "Fee Structure"):
-		frappe.reload_doctype(dt)
-		rename_field(dt, "amount", "components")
+	if frappe.db.exists("DocType", "Fee Amount"):
+		frappe.rename_doc("DocType", "Fee Amount", "Fee Component")
+		for dt in ("Fees", "Fee Structure"):
+			frappe.reload_doctype(dt)
+			rename_field(dt, "amount", "components")
 		
 	
\ No newline at end of file
diff --git a/erpnext/schools/doctype/fee_structure/fee_structure.py b/erpnext/schools/doctype/fee_structure/fee_structure.py
index b4fc279..b71c507 100644
--- a/erpnext/schools/doctype/fee_structure/fee_structure.py
+++ b/erpnext/schools/doctype/fee_structure/fee_structure.py
@@ -13,6 +13,6 @@
 	def calculate_total(self):
 		"""Calculates total amount."""
 		self.total_amount = 0
-		for d in self.amount:
+		for d in self.components:
 			self.total_amount += d.amount