Merge pull request #4704 from chaoyee/develop

Update material_request.py
diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry.py b/erpnext/accounts/doctype/journal_entry/journal_entry.py
index 25b05cb..55e846b 100644
--- a/erpnext/accounts/doctype/journal_entry/journal_entry.py
+++ b/erpnext/accounts/doctype/journal_entry/journal_entry.py
@@ -209,9 +209,7 @@
 			account = self.reference_accounts[reference_name]
 
 			if reference_type in ("Sales Order", "Purchase Order"):
-				order = frappe.db.get_value(reference_type, reference_name,
-					["docstatus", "per_billed", "status", "advance_paid",
-						"base_grand_total", "grand_total", "currency"], as_dict=1)
+				order = frappe.get_doc(reference_type, reference_name)
 
 				if order.docstatus != 1:
 					frappe.throw(_("{0} {1} is not submitted").format(reference_type, reference_name))
@@ -225,12 +223,16 @@
 				account_currency = get_account_currency(account)
 				if account_currency == self.company_currency:
 					voucher_total = order.base_grand_total
+					formatted_voucher_total = fmt_money(voucher_total, order.precision("base_grand_total"),
+						currency=account_currency)
 				else:
 					voucher_total = order.grand_total
+					formatted_voucher_total = fmt_money(voucher_total, order.precision("grand_total"),
+						currency=account_currency)
 
 				if flt(voucher_total) < (flt(order.advance_paid) + total):
 					frappe.throw(_("Advance paid against {0} {1} cannot be greater \
-						than Grand Total {2}").format(reference_type, reference_name, voucher_total))
+						than Grand Total {2}").format(reference_type, reference_name, formatted_voucher_total))
 
 	def validate_invoices(self):
 		"""Validate totals and docstatus for invoices"""
@@ -797,7 +799,7 @@
 	company_currency = get_company_currency(company)
 
 	if account_currency != company_currency:
-		if reference_type in ("Sales Invoice", "Purchase Invoice") and reference_name:
+		if reference_type and reference_name and frappe.get_meta(reference_type).get_field("conversion_rate"):
 			exchange_rate = frappe.db.get_value(reference_type, reference_name, "conversion_rate")
 
 		elif account_details and account_details.account_type == "Bank" and \
diff --git a/erpnext/accounts/doctype/payment_tool/payment_tool.js b/erpnext/accounts/doctype/payment_tool/payment_tool.js
index ec15b47..e15694c 100644
--- a/erpnext/accounts/doctype/payment_tool/payment_tool.js
+++ b/erpnext/accounts/doctype/payment_tool/payment_tool.js
@@ -42,6 +42,10 @@
 	frappe.ui.form.trigger("Payment Tool", "party_type");
 });
 
+frappe.ui.form.on("Payment Tool", "party_type", function(frm) {
+	frm.set_value("received_or_paid", frm.doc.party_type=="Customer" ? "Received" : "Paid");
+});
+
 frappe.ui.form.on("Payment Tool", "party", function(frm) {
 	if(frm.doc.party_type && frm.doc.party) {
 		return frappe.call({
diff --git a/erpnext/accounts/doctype/payment_tool/payment_tool.py b/erpnext/accounts/doctype/payment_tool/payment_tool.py
index 19527d3..3648306 100644
--- a/erpnext/accounts/doctype/payment_tool/payment_tool.py
+++ b/erpnext/accounts/doctype/payment_tool/payment_tool.py
@@ -71,7 +71,9 @@
 			d2.account = self.payment_account
 			d2.account_currency = bank_account_currency
 			d2.account_type = bank_account_type
-			d2.exchange_rate = get_exchange_rate(self.payment_account, self.company)
+			d2.exchange_rate = get_exchange_rate(self.payment_account, bank_account_currency, self.company, 
+				debit=(abs(total_payment_amount) if total_payment_amount < 0 else 0), 
+				credit=(total_payment_amount if total_payment_amount > 0 else 0))
 			d2.account_balance = get_balance_on(self.payment_account)
 		
 		amount_field_bank = 'debit_in_account_currency' if total_payment_amount < 0 \
diff --git a/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.json b/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.json
index 8e9be7e..79f5f55 100644
--- a/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.json
+++ b/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.json
@@ -7,6 +7,7 @@
  "custom": 0, 
  "docstatus": 0, 
  "doctype": "DocType", 
+ "document_type": "Document", 
  "fields": [
   {
    "allow_on_submit": 0, 
@@ -972,13 +973,13 @@
    "collapsible": 0, 
    "fieldname": "target_warehouse", 
    "fieldtype": "Link", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
+   "hidden": 1, 
+   "ignore_user_permissions": 1, 
    "in_filter": 0, 
    "in_list_view": 0, 
-   "label": "Target Warehouse", 
+   "label": "Customer Warehouse (Optional)", 
    "length": 0, 
-   "no_copy": 0, 
+   "no_copy": 1, 
    "options": "Warehouse", 
    "permlevel": 0, 
    "precision": "", 
@@ -1444,7 +1445,7 @@
  "issingle": 0, 
  "istable": 1, 
  "max_attachments": 0, 
- "modified": "2016-01-06 02:23:06.432442", 
+ "modified": "2016-02-01 11:16:58.288462", 
  "modified_by": "Administrator", 
  "module": "Accounts", 
  "name": "Sales Invoice Item", 
diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.json b/erpnext/buying/doctype/purchase_order/purchase_order.json
index 277229a..2cf67c1 100644
--- a/erpnext/buying/doctype/purchase_order/purchase_order.json
+++ b/erpnext/buying/doctype/purchase_order/purchase_order.json
@@ -1601,29 +1601,6 @@
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
-   "fieldname": "advance_paid", 
-   "fieldtype": "Currency", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "in_filter": 0, 
-   "in_list_view": 0, 
-   "label": "Advance Paid", 
-   "length": 0, 
-   "no_copy": 1, 
-   "permlevel": 0, 
-   "print_hide": 1, 
-   "print_hide_if_no_value": 0, 
-   "read_only": 1, 
-   "report_hide": 0, 
-   "reqd": 0, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "unique": 0
-  }, 
-  {
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
    "fieldname": "column_break4", 
    "fieldtype": "Column Break", 
    "hidden": 0, 
@@ -1697,6 +1674,30 @@
   {
    "allow_on_submit": 0, 
    "bold": 0, 
+   "collapsible": 0, 
+   "fieldname": "advance_paid", 
+   "fieldtype": "Currency", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "in_filter": 0, 
+   "in_list_view": 0, 
+   "label": "Advance Paid", 
+   "length": 0, 
+   "no_copy": 1, 
+   "options": "party_account_currency", 
+   "permlevel": 0, 
+   "print_hide": 1, 
+   "print_hide_if_no_value": 0, 
+   "read_only": 1, 
+   "report_hide": 0, 
+   "reqd": 0, 
+   "search_index": 0, 
+   "set_only_once": 0, 
+   "unique": 0
+  }, 
+  {
+   "allow_on_submit": 0, 
+   "bold": 0, 
    "collapsible": 1, 
    "collapsible_depends_on": "terms", 
    "fieldname": "terms_section_break", 
@@ -1972,6 +1973,31 @@
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
+   "fieldname": "party_account_currency", 
+   "fieldtype": "Link", 
+   "hidden": 1, 
+   "ignore_user_permissions": 0, 
+   "in_filter": 0, 
+   "in_list_view": 0, 
+   "label": "Party Account Currency", 
+   "length": 0, 
+   "no_copy": 1, 
+   "options": "Currency", 
+   "permlevel": 0, 
+   "precision": "", 
+   "print_hide": 1, 
+   "print_hide_if_no_value": 0, 
+   "read_only": 1, 
+   "report_hide": 0, 
+   "reqd": 0, 
+   "search_index": 0, 
+   "set_only_once": 0, 
+   "unique": 0
+  }, 
+  {
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
    "fieldname": "column_break_74", 
    "fieldtype": "Column Break", 
    "hidden": 0, 
@@ -2508,7 +2534,7 @@
  "issingle": 0, 
  "istable": 0, 
  "max_attachments": 0, 
- "modified": "2016-01-15 04:13:35.179163", 
+ "modified": "2016-01-29 01:41:08.478575", 
  "modified_by": "Administrator", 
  "module": "Buying", 
  "name": "Purchase Order", 
diff --git a/erpnext/config/hr.py b/erpnext/config/hr.py
index 3942766..e147112 100644
--- a/erpnext/config/hr.py
+++ b/erpnext/config/hr.py
@@ -60,9 +60,9 @@
 			"items": [
 				{
 					"type": "doctype",
-					"name": "Process Payroll",
-					"label": _("Process Payroll"),
-					"description":_("Generate Salary Slips"),
+					"name": "Employee Attendance Tool",
+					"label": _("Employee Attendance Tool"),
+					"description":_("Mark Employee Attendance in Bulk"),
 					"hide_count": True
 				},
 				{
@@ -73,6 +73,14 @@
 				},
 				{
 					"type": "doctype",
+					"name": "Process Payroll",
+					"label": _("Process Payroll"),
+					"description":_("Generate Salary Slips"),
+					"hide_count": True
+				},
+			
+				{
+					"type": "doctype",
 					"name": "Leave Control Panel",
 					"label": _("Leave Allocation Tool"),
 					"description":_("Allocate leaves for the year."),
@@ -179,6 +187,12 @@
 				},
 				{
 					"type": "report",
+					"is_query_report": True,
+					"name": "Employee Holiday Attendance",
+					"doctype": "Employee"
+				},
+				{
+					"type": "report",
 					"name": "Employee Information",
 					"doctype": "Employee"
 				},
@@ -194,6 +208,7 @@
 					"name": "Monthly Attendance Sheet",
 					"doctype": "Attendance"
 				},
+
 			]
 		},
 		{
diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py
index 81e5f9e..9916613 100644
--- a/erpnext/controllers/accounts_controller.py
+++ b/erpnext/controllers/accounts_controller.py
@@ -4,7 +4,7 @@
 from __future__ import unicode_literals
 import frappe
 from frappe import _, throw
-from frappe.utils import today, flt, cint
+from frappe.utils import today, flt, cint, fmt_money
 from erpnext.setup.utils import get_company_currency, get_exchange_rate
 from erpnext.accounts.utils import get_fiscal_year, validate_fiscal_year, get_account_currency
 from erpnext.utilities.transaction_base import TransactionBase
@@ -386,27 +386,44 @@
 	def set_total_advance_paid(self):
 		if self.doctype == "Sales Order":
 			dr_or_cr = "credit_in_account_currency"
+			party = self.customer
 		else:
 			dr_or_cr = "debit_in_account_currency"
+			party = self.supplier
 
-		advance_paid = frappe.db.sql("""
+		advance = frappe.db.sql("""
 			select
-				sum({dr_or_cr})
+				account_currency, sum({dr_or_cr}) as amount
 			from
 				`tabJournal Entry Account`
 			where
-				reference_type = %s and reference_name = %s
+				reference_type = %s and reference_name = %s and party=%s
 				and docstatus = 1 and is_advance = "Yes"
-		""".format(dr_or_cr=dr_or_cr), (self.doctype, self.name))
+		""".format(dr_or_cr=dr_or_cr), (self.doctype, self.name, party), as_dict=1)
 
-		if advance_paid:
-			advance_paid = flt(advance_paid[0][0], self.precision("advance_paid"))
-		if flt(self.base_grand_total) >= advance_paid:
-			frappe.db.set_value(self.doctype, self.name, "advance_paid", advance_paid)
-		else:
-			frappe.throw(_("Total advance ({0}) against Order {1} cannot be greater \
-				than the Grand Total ({2})")
-			.format(advance_paid, self.name, self.base_grand_total))
+		if advance:
+			advance = advance[0]
+			advance_paid = flt(advance.amount, self.precision("advance_paid"))
+			formatted_advance_paid = fmt_money(advance_paid, precision=self.precision("advance_paid"),
+				currency=advance.account_currency)
+
+			frappe.db.set_value(self.doctype, self.name, "party_account_currency",
+				advance.account_currency)
+
+			if advance.account_currency == self.currency:
+				order_total = self.grand_total
+				formatted_order_total = fmt_money(order_total, precision=self.precision("grand_total"),
+					currency=advance.account_currency)
+			else:
+				order_total = self.base_grand_total
+				formatted_order_total = fmt_money(order_total, precision=self.precision("base_grand_total"),
+					currency=advance.account_currency)
+
+			if order_total >= advance_paid:
+				frappe.db.set_value(self.doctype, self.name, "advance_paid", advance_paid)
+			else:
+				frappe.throw(_("Total advance ({0}) against Order {1} cannot be greater than the Grand Total ({2})")
+					.format(formatted_advance_paid, self.name, formatted_order_total))
 
 	@property
 	def company_abbr(self):
diff --git a/erpnext/controllers/selling_controller.py b/erpnext/controllers/selling_controller.py
index 895f146..f340f91 100644
--- a/erpnext/controllers/selling_controller.py
+++ b/erpnext/controllers/selling_controller.py
@@ -161,7 +161,7 @@
 		for d in self.get("items"):
 			if d.qty is None:
 				frappe.throw(_("Row {0}: Qty is mandatory").format(d.idx))
-														
+
 			if self.has_product_bundle(d.item_code):
 				for p in self.get("packed_items"):
 					if p.parent_detail_docname == d.name and p.parent_item == d.item_code:
@@ -199,17 +199,17 @@
 			where so_detail = %s and docstatus = 1
 			and against_sales_order = %s
 			and parent != %s""", (so_detail, so, current_docname))
-			
-		delivered_via_si = frappe.db.sql("""select sum(si_item.qty) 
+
+		delivered_via_si = frappe.db.sql("""select sum(si_item.qty)
 			from `tabSales Invoice Item` si_item, `tabSales Invoice` si
 			where si_item.parent = si.name and si.update_stock = 1
-			and si_item.so_detail = %s and si.docstatus = 1 
+			and si_item.so_detail = %s and si.docstatus = 1
 			and si_item.sales_order = %s
 			and si.name != %s""", (so_detail, so, current_docname))
-			
+
 		total_delivered_qty = (flt(delivered_via_dn[0][0]) if delivered_via_dn else 0) \
 			+ (flt(delivered_via_si[0][0]) if delivered_via_si else 0)
-		
+
 		return total_delivered_qty
 
 	def get_so_qty_and_warehouse(self, so_detail):
@@ -230,10 +230,10 @@
 	for d in obj.get("items"):
 		if d.item_code:
 			item = frappe.db.sql("""select docstatus, is_sales_item,
-				is_service_item, income_account from tabItem where name = %s""",
+				income_account from tabItem where name = %s""",
 				d.item_code, as_dict=True)[0]
-			if item.is_sales_item == 0 and item.is_service_item == 0:
-				frappe.throw(_("Item {0} must be Sales or Service Item in {1}").format(d.item_code, d.idx))
+			if item.is_sales_item == 0:
+				frappe.throw(_("Item {0} must be a Sales Item in {1}").format(d.item_code, d.idx))
 			if getattr(d, "income_account", None) and not item.income_account:
 				frappe.db.set_value("Item", d.item_code, "income_account",
 					d.income_account)
diff --git a/erpnext/controllers/trends.py b/erpnext/controllers/trends.py
index 16387a5..6be8d96 100644
--- a/erpnext/controllers/trends.py
+++ b/erpnext/controllers/trends.py
@@ -31,10 +31,10 @@
 	for f in ["Fiscal Year", "Based On", "Period", "Company"]:
 		if not filters.get(f.lower().replace(" ", "_")):
 			frappe.throw(_("{0} is mandatory").format(f))
-			
+
 	if not frappe.db.exists("Fiscal Year", filters.get("fiscal_year")):
 		frappe.throw(_("Fiscal Year: {0} does not exists").format(filters.get("fiscal_year")))
-		
+
 	if filters.get("based_on") == filters.get("group_by"):
 		frappe.throw(_("'Based On' and 'Group By' can not be same"))
 
@@ -98,7 +98,8 @@
 						(filters.get("company"), filters.get("fiscal_year"), row[i][0],
 							data1[d][0]), as_list=1)
 
-				des[ind] = row[i]
+				des[ind] = row[i][0]
+
 				for j in range(1,len(conditions["columns"])-inc):
 					des[j+inc] = row1[0][j]
 
@@ -213,7 +214,7 @@
 	elif based_on == "Customer":
 		based_on_details["based_on_cols"] = ["Customer:Link/Customer:120", "Territory:Link/Territory:120"]
 		based_on_details["based_on_select"] = "t1.customer_name, t1.territory, "
-		based_on_details["based_on_group_by"] = 't1.customer_name'
+		based_on_details["based_on_group_by"] = 't1.customer'
 		based_on_details["addl_tables"] = ''
 
 	elif based_on == "Customer Group":
diff --git a/erpnext/crm/doctype/opportunity/opportunity.js b/erpnext/crm/doctype/opportunity/opportunity.js
index af4e387..b274216 100644
--- a/erpnext/crm/doctype/opportunity/opportunity.js
+++ b/erpnext/crm/doctype/opportunity/opportunity.js
@@ -52,8 +52,7 @@
 		this.frm.set_query("item_code", "items", function() {
 			return {
 				query: "erpnext.controllers.queries.item_query",
-				filters: me.frm.doc.enquiry_type === "Maintenance" ?
-					{"is_service_item": 1} : {"is_sales_item":1}
+				filters: {"is_sales_item": 1}
 			};
 		});
 
diff --git a/erpnext/docs/assets/img/articles/$SGrab_258.png b/erpnext/docs/assets/img/articles/$SGrab_258.png
deleted file mode 100644
index c5d59f8..0000000
--- a/erpnext/docs/assets/img/articles/$SGrab_258.png
+++ /dev/null
Binary files differ
diff --git a/erpnext/docs/assets/img/articles/$SGrab_260.png b/erpnext/docs/assets/img/articles/$SGrab_260.png
deleted file mode 100644
index 4ba692b..0000000
--- a/erpnext/docs/assets/img/articles/$SGrab_260.png
+++ /dev/null
Binary files differ
diff --git a/erpnext/docs/assets/img/articles/$SGrab_261.png b/erpnext/docs/assets/img/articles/$SGrab_261.png
deleted file mode 100644
index a8a9fa4..0000000
--- a/erpnext/docs/assets/img/articles/$SGrab_261.png
+++ /dev/null
Binary files differ
diff --git a/erpnext/docs/assets/img/articles/$SGrab_439.png b/erpnext/docs/assets/img/articles/$SGrab_439.png
deleted file mode 100644
index 2afa5fd..0000000
--- a/erpnext/docs/assets/img/articles/$SGrab_439.png
+++ /dev/null
Binary files differ
diff --git a/erpnext/docs/assets/img/articles/$SGrab_440.png b/erpnext/docs/assets/img/articles/$SGrab_440.png
deleted file mode 100644
index 6f62d34..0000000
--- a/erpnext/docs/assets/img/articles/$SGrab_440.png
+++ /dev/null
Binary files differ
diff --git a/erpnext/docs/assets/img/articles/Screen Shot 2015-04-01 at 5.32.57 pm.png b/erpnext/docs/assets/img/articles/Screen Shot 2015-04-01 at 5.32.57 pm.png
deleted file mode 100644
index 44fa23f..0000000
--- a/erpnext/docs/assets/img/articles/Screen Shot 2015-04-01 at 5.32.57 pm.png
+++ /dev/null
Binary files differ
diff --git a/erpnext/docs/assets/img/articles/Selection_00616c670.png b/erpnext/docs/assets/img/articles/Selection_00616c670.png
deleted file mode 100644
index a9b5d45..0000000
--- a/erpnext/docs/assets/img/articles/Selection_00616c670.png
+++ /dev/null
Binary files differ
diff --git a/erpnext/docs/assets/img/articles/Selection_010496ae2.png b/erpnext/docs/assets/img/articles/Selection_010496ae2.png
deleted file mode 100644
index f2e2326..0000000
--- a/erpnext/docs/assets/img/articles/Selection_010496ae2.png
+++ /dev/null
Binary files differ
diff --git a/erpnext/docs/assets/img/articles/Selection_01087d575.png b/erpnext/docs/assets/img/articles/Selection_01087d575.png
deleted file mode 100644
index 52c6e2d..0000000
--- a/erpnext/docs/assets/img/articles/Selection_01087d575.png
+++ /dev/null
Binary files differ
diff --git a/erpnext/docs/assets/img/articles/Selection_011.png b/erpnext/docs/assets/img/articles/Selection_011.png
deleted file mode 100644
index 8bf4cfa..0000000
--- a/erpnext/docs/assets/img/articles/Selection_011.png
+++ /dev/null
Binary files differ
diff --git a/erpnext/docs/assets/img/articles/Selection_01244aec7.png b/erpnext/docs/assets/img/articles/Selection_01244aec7.png
deleted file mode 100644
index 3a1c50c..0000000
--- a/erpnext/docs/assets/img/articles/Selection_01244aec7.png
+++ /dev/null
Binary files differ
diff --git a/erpnext/docs/assets/img/articles/close-1.png b/erpnext/docs/assets/img/articles/close-1.png
new file mode 100644
index 0000000..3975f71
--- /dev/null
+++ b/erpnext/docs/assets/img/articles/close-1.png
Binary files differ
diff --git a/erpnext/docs/assets/img/articles/close-2.png b/erpnext/docs/assets/img/articles/close-2.png
new file mode 100644
index 0000000..f9e63f2
--- /dev/null
+++ b/erpnext/docs/assets/img/articles/close-2.png
Binary files differ
diff --git a/erpnext/docs/assets/img/articles/discount-1.png b/erpnext/docs/assets/img/articles/discount-1.png
new file mode 100644
index 0000000..32afa1f
--- /dev/null
+++ b/erpnext/docs/assets/img/articles/discount-1.png
Binary files differ
diff --git a/erpnext/docs/assets/img/articles/discount-2.png b/erpnext/docs/assets/img/articles/discount-2.png
new file mode 100644
index 0000000..0db98ae
--- /dev/null
+++ b/erpnext/docs/assets/img/articles/discount-2.png
Binary files differ
diff --git a/erpnext/docs/assets/img/articles/discount-on-grand-total.png b/erpnext/docs/assets/img/articles/discount-on-grand-total.png
new file mode 100644
index 0000000..8c93145
--- /dev/null
+++ b/erpnext/docs/assets/img/articles/discount-on-grand-total.png
Binary files differ
diff --git a/erpnext/docs/assets/img/articles/discount-on-net-total.png b/erpnext/docs/assets/img/articles/discount-on-net-total.png
new file mode 100644
index 0000000..406d753
--- /dev/null
+++ b/erpnext/docs/assets/img/articles/discount-on-net-total.png
Binary files differ
diff --git a/erpnext/docs/assets/img/articles/sales-person-transaction-1.png b/erpnext/docs/assets/img/articles/sales-person-transaction-1.png
new file mode 100644
index 0000000..c9aa23e
--- /dev/null
+++ b/erpnext/docs/assets/img/articles/sales-person-transaction-1.png
Binary files differ
diff --git a/erpnext/docs/assets/img/articles/sales-person-transaction-2.png b/erpnext/docs/assets/img/articles/sales-person-transaction-2.png
new file mode 100644
index 0000000..39bafae
--- /dev/null
+++ b/erpnext/docs/assets/img/articles/sales-person-transaction-2.png
Binary files differ
diff --git a/erpnext/docs/assets/img/articles/sales-person-transaction-3.png b/erpnext/docs/assets/img/articles/sales-person-transaction-3.png
new file mode 100644
index 0000000..420beba
--- /dev/null
+++ b/erpnext/docs/assets/img/articles/sales-person-transaction-3.png
Binary files differ
diff --git a/erpnext/docs/assets/img/articles/sales-person-transaction-4.png b/erpnext/docs/assets/img/articles/sales-person-transaction-4.png
new file mode 100644
index 0000000..5883c76
--- /dev/null
+++ b/erpnext/docs/assets/img/articles/sales-person-transaction-4.png
Binary files differ
diff --git a/erpnext/docs/assets/img/articles/services-1.png b/erpnext/docs/assets/img/articles/services-1.png
new file mode 100644
index 0000000..974bcf6
--- /dev/null
+++ b/erpnext/docs/assets/img/articles/services-1.png
Binary files differ
diff --git a/erpnext/docs/assets/img/articles/shipping-charges-1.png b/erpnext/docs/assets/img/articles/shipping-charges-1.png
new file mode 100644
index 0000000..31c5c18
--- /dev/null
+++ b/erpnext/docs/assets/img/articles/shipping-charges-1.png
Binary files differ
diff --git a/erpnext/docs/assets/img/articles/shipping-charges-2.gif b/erpnext/docs/assets/img/articles/shipping-charges-2.gif
new file mode 100644
index 0000000..7eedbdc
--- /dev/null
+++ b/erpnext/docs/assets/img/articles/shipping-charges-2.gif
Binary files differ
diff --git a/erpnext/docs/assets/img/articles/shipping-charges-3.png b/erpnext/docs/assets/img/articles/shipping-charges-3.png
new file mode 100644
index 0000000..864c5b0
--- /dev/null
+++ b/erpnext/docs/assets/img/articles/shipping-charges-3.png
Binary files differ
diff --git a/erpnext/docs/assets/img/articles/shipping-charges-4.gif b/erpnext/docs/assets/img/articles/shipping-charges-4.gif
new file mode 100644
index 0000000..5890bb6
--- /dev/null
+++ b/erpnext/docs/assets/img/articles/shipping-charges-4.gif
Binary files differ
diff --git a/erpnext/docs/current/api/accounts/erpnext.accounts.party.html b/erpnext/docs/current/api/accounts/erpnext.accounts.party.html
index e5c8d31..3ad5432 100644
--- a/erpnext/docs/current/api/accounts/erpnext.accounts.party.html
+++ b/erpnext/docs/current/api/accounts/erpnext.accounts.party.html
@@ -316,6 +316,22 @@
     
     
 	<p class="docs-attr-name">
+        <a name="erpnext.accounts.party.validate_party_frozen_disabled" href="#erpnext.accounts.party.validate_party_frozen_disabled" class="text-muted small">
+            <i class="icon-link small" style="color: #ccc;"></i></a>
+		erpnext.accounts.party.<b>validate_party_frozen_disabled</b>
+        <i class="text-muted">(party_type, party_name)</i>
+    </p>
+	<div class="docs-attr-desc"><p><span class="text-muted">No docs</span></p>
+</div>
+	<br>
+
+	
+
+	
+        
+    
+    
+	<p class="docs-attr-name">
         <a name="erpnext.accounts.party.validate_party_gle_currency" href="#erpnext.accounts.party.validate_party_gle_currency" class="text-muted small">
             <i class="icon-link small" style="color: #ccc;"></i></a>
 		erpnext.accounts.party.<b>validate_party_gle_currency</b>
diff --git a/erpnext/docs/current/api/controllers/erpnext.controllers.accounts_controller.html b/erpnext/docs/current/api/controllers/erpnext.controllers.accounts_controller.html
index 78705e3..79e4c04 100644
--- a/erpnext/docs/current/api/controllers/erpnext.controllers.accounts_controller.html
+++ b/erpnext/docs/current/api/controllers/erpnext.controllers.accounts_controller.html
@@ -55,20 +55,6 @@
     
     
 	<p class="docs-attr-name">
-        <a name="before_recurring" href="#before_recurring" class="text-muted small">
-            <i class="icon-link small" style="color: #ccc;"></i></a>
-		<b>before_recurring</b>
-        <i class="text-muted">(self)</i>
-    </p>
-	<div class="docs-attr-desc"><p><span class="text-muted">No docs</span></p>
-</div>
-	<br>
-
-        
-        
-    
-    
-	<p class="docs-attr-name">
         <a name="calculate_taxes_and_totals" href="#calculate_taxes_and_totals" class="text-muted small">
             <i class="icon-link small" style="color: #ccc;"></i></a>
 		<b>calculate_taxes_and_totals</b>
diff --git a/erpnext/docs/current/api/controllers/erpnext.controllers.recurring_document.html b/erpnext/docs/current/api/controllers/erpnext.controllers.recurring_document.html
index b6ac163..172e191 100644
--- a/erpnext/docs/current/api/controllers/erpnext.controllers.recurring_document.html
+++ b/erpnext/docs/current/api/controllers/erpnext.controllers.recurring_document.html
@@ -85,7 +85,7 @@
         <a name="erpnext.controllers.recurring_document.make_new_document" href="#erpnext.controllers.recurring_document.make_new_document" class="text-muted small">
             <i class="icon-link small" style="color: #ccc;"></i></a>
 		erpnext.controllers.recurring_document.<b>make_new_document</b>
-        <i class="text-muted">(ref_wrapper, date_field, posting_date)</i>
+        <i class="text-muted">(reference_doc, date_field, posting_date)</i>
     </p>
 	<div class="docs-attr-desc"><p><span class="text-muted">No docs</span></p>
 </div>
diff --git a/erpnext/docs/current/api/erpnext.exceptions.html b/erpnext/docs/current/api/erpnext.exceptions.html
index 7c91646..e8f5ee1 100644
--- a/erpnext/docs/current/api/erpnext.exceptions.html
+++ b/erpnext/docs/current/api/erpnext.exceptions.html
@@ -15,21 +15,6 @@
 
 	
         
-	<h3 style="font-weight: normal;">Class <b>CustomerFrozen</b></h3>
-    
-    <p style="padding-left: 30px;"><i>Inherits from frappe.exceptions.ValidationError</i></h4>
-    
-    <div class="docs-attr-desc"><p></p>
-</div>
-    <div style="padding-left: 30px;">
-        
-    </div>
-    <hr>
-
-	
-
-	
-        
 	<h3 style="font-weight: normal;">Class <b>InvalidAccountCurrency</b></h3>
     
     <p style="padding-left: 30px;"><i>Inherits from frappe.exceptions.ValidationError</i></h4>
@@ -58,6 +43,36 @@
 
 	
 
+	
+        
+	<h3 style="font-weight: normal;">Class <b>PartyDisabled</b></h3>
+    
+    <p style="padding-left: 30px;"><i>Inherits from frappe.exceptions.ValidationError</i></h4>
+    
+    <div class="docs-attr-desc"><p></p>
+</div>
+    <div style="padding-left: 30px;">
+        
+    </div>
+    <hr>
+
+	
+
+	
+        
+	<h3 style="font-weight: normal;">Class <b>PartyFrozen</b></h3>
+    
+    <p style="padding-left: 30px;"><i>Inherits from frappe.exceptions.ValidationError</i></h4>
+    
+    <div class="docs-attr-desc"><p></p>
+</div>
+    <div style="padding-left: 30px;">
+        
+    </div>
+    <hr>
+
+	
+
 
 
 <!-- autodoc -->
\ No newline at end of file
diff --git a/erpnext/docs/current/index.html b/erpnext/docs/current/index.html
index 01071ee..ec8d954 100644
--- a/erpnext/docs/current/index.html
+++ b/erpnext/docs/current/index.html
@@ -35,7 +35,7 @@
 			Version
 		</td>
 		<td>
-			<code>6.17.0</code>
+			<code>6.18.4</code>
 		</td>
 	</tr>
 </table>
diff --git a/erpnext/docs/current/models/accounts/period_closing_voucher.html b/erpnext/docs/current/models/accounts/period_closing_voucher.html
index 1a3aac1..c14226e 100644
--- a/erpnext/docs/current/models/accounts/period_closing_voucher.html
+++ b/erpnext/docs/current/models/accounts/period_closing_voucher.html
@@ -157,7 +157,7 @@
             <td >
                 Closing Account Head
                 <p class="text-muted small">
-                    The account head under Liability or Equity, in which Profit/Loss will be booked</p>
+                    The account head under Liability, in which Profit/Loss will be booked</p>
             </td>
             <td>
                 
diff --git a/erpnext/docs/current/models/accounts/purchase_invoice.html b/erpnext/docs/current/models/accounts/purchase_invoice.html
index 1bdbcbf..b75f10a 100644
--- a/erpnext/docs/current/models/accounts/purchase_invoice.html
+++ b/erpnext/docs/current/models/accounts/purchase_invoice.html
@@ -1664,6 +1664,20 @@
     
     
 	<p class="docs-attr-name">
+        <a name="on_recurring" href="#on_recurring" class="text-muted small">
+            <i class="icon-link small" style="color: #ccc;"></i></a>
+		<b>on_recurring</b>
+        <i class="text-muted">(self, reference_doc)</i>
+    </p>
+	<div class="docs-attr-desc"><p><span class="text-muted">No docs</span></p>
+</div>
+	<br>
+
+        
+        
+    
+    
+	<p class="docs-attr-name">
         <a name="on_submit" href="#on_submit" class="text-muted small">
             <i class="icon-link small" style="color: #ccc;"></i></a>
 		<b>on_submit</b>
diff --git a/erpnext/docs/current/models/accounts/sales_invoice.html b/erpnext/docs/current/models/accounts/sales_invoice.html
index 07e3212..8e62c40 100644
--- a/erpnext/docs/current/models/accounts/sales_invoice.html
+++ b/erpnext/docs/current/models/accounts/sales_invoice.html
@@ -2247,6 +2247,20 @@
     
     
 	<p class="docs-attr-name">
+        <a name="on_recurring" href="#on_recurring" class="text-muted small">
+            <i class="icon-link small" style="color: #ccc;"></i></a>
+		<b>on_recurring</b>
+        <i class="text-muted">(self, reference_doc)</i>
+    </p>
+	<div class="docs-attr-desc"><p><span class="text-muted">No docs</span></p>
+</div>
+	<br>
+
+        
+        
+    
+    
+	<p class="docs-attr-name">
         <a name="on_submit" href="#on_submit" class="text-muted small">
             <i class="icon-link small" style="color: #ccc;"></i></a>
 		<b>on_submit</b>
diff --git a/erpnext/docs/current/models/buying/purchase_order.html b/erpnext/docs/current/models/buying/purchase_order.html
index c627191..bafaa2e 100644
--- a/erpnext/docs/current/models/buying/purchase_order.html
+++ b/erpnext/docs/current/models/buying/purchase_order.html
@@ -1538,20 +1538,6 @@
     
     
 	<p class="docs-attr-name">
-        <a name="before_recurring" href="#before_recurring" class="text-muted small">
-            <i class="icon-link small" style="color: #ccc;"></i></a>
-		<b>before_recurring</b>
-        <i class="text-muted">(self)</i>
-    </p>
-	<div class="docs-attr-desc"><p><span class="text-muted">No docs</span></p>
-</div>
-	<br>
-
-        
-        
-    
-    
-	<p class="docs-attr-name">
         <a name="check_for_stopped_or_closed_status" href="#check_for_stopped_or_closed_status" class="text-muted small">
             <i class="icon-link small" style="color: #ccc;"></i></a>
 		<b>check_for_stopped_or_closed_status</b>
diff --git a/erpnext/docs/current/models/buying/supplier.html b/erpnext/docs/current/models/buying/supplier.html
index a4e2cd4..9cabf70 100644
--- a/erpnext/docs/current/models/buying/supplier.html
+++ b/erpnext/docs/current/models/buying/supplier.html
@@ -113,11 +113,11 @@
         
         <tr >
             <td>6</td>
-            <td ><code>is_frozen</code></td>
+            <td ><code>disabled</code></td>
             <td >
                 Check</td>
             <td >
-                Is Frozen
+                Disabled
                 
             </td>
             <td></td>
@@ -177,8 +177,36 @@
             </td>
         </tr>
         
-        <tr >
+        <tr class="info">
             <td>10</td>
+            <td ><code>section_credit_limit</code></td>
+            <td >
+                Section Break</td>
+            <td >
+                Credit Limit
+                
+            </td>
+            <td></td>
+        </tr>
+        
+        <tr >
+            <td>11</td>
+            <td ><code>credit_days_based_on</code></td>
+            <td >
+                Select</td>
+            <td >
+                Credit Days Based On
+                
+            </td>
+            <td>
+                <pre>
+Fixed Days
+Last Day of the Next Month</pre>
+            </td>
+        </tr>
+        
+        <tr >
+            <td>12</td>
             <td ><code>credit_days</code></td>
             <td >
                 Int</td>
@@ -190,7 +218,7 @@
         </tr>
         
         <tr class="info">
-            <td>11</td>
+            <td>13</td>
             <td ><code>address_contacts</code></td>
             <td >
                 Section Break</td>
@@ -204,7 +232,7 @@
         </tr>
         
         <tr >
-            <td>12</td>
+            <td>14</td>
             <td ><code>address_html</code></td>
             <td >
                 HTML</td>
@@ -216,7 +244,7 @@
         </tr>
         
         <tr >
-            <td>13</td>
+            <td>15</td>
             <td ><code>column_break1</code></td>
             <td class="info">
                 Column Break</td>
@@ -228,7 +256,7 @@
         </tr>
         
         <tr >
-            <td>14</td>
+            <td>16</td>
             <td ><code>contact_html</code></td>
             <td >
                 HTML</td>
@@ -240,7 +268,7 @@
         </tr>
         
         <tr class="info">
-            <td>15</td>
+            <td>17</td>
             <td ><code>default_payable_accounts</code></td>
             <td >
                 Section Break</td>
@@ -252,7 +280,7 @@
         </tr>
         
         <tr >
-            <td>16</td>
+            <td>18</td>
             <td ><code>accounts</code></td>
             <td >
                 Table</td>
@@ -274,19 +302,19 @@
         </tr>
         
         <tr class="info">
-            <td>17</td>
+            <td>19</td>
             <td ><code>column_break2</code></td>
             <td >
                 Section Break</td>
             <td >
-                Supplier Details
+                More Information
                 
             </td>
             <td></td>
         </tr>
         
         <tr >
-            <td>18</td>
+            <td>20</td>
             <td ><code>website</code></td>
             <td >
                 Data</td>
@@ -298,7 +326,7 @@
         </tr>
         
         <tr >
-            <td>19</td>
+            <td>21</td>
             <td ><code>supplier_details</code></td>
             <td >
                 Text</td>
@@ -310,6 +338,18 @@
             <td></td>
         </tr>
         
+        <tr >
+            <td>22</td>
+            <td ><code>is_frozen</code></td>
+            <td >
+                Check</td>
+            <td >
+                Is Frozen
+                
+            </td>
+            <td></td>
+        </tr>
+        
     </tbody>
 </table>
 
diff --git a/erpnext/docs/current/models/selling/customer.html b/erpnext/docs/current/models/selling/customer.html
index d171796..c73547a 100644
--- a/erpnext/docs/current/models/selling/customer.html
+++ b/erpnext/docs/current/models/selling/customer.html
@@ -183,11 +183,11 @@
         
         <tr >
             <td>10</td>
-            <td ><code>is_frozen</code></td>
+            <td ><code>disabled</code></td>
             <td >
                 Check</td>
             <td >
-                Is Frozen
+                Disabled
                 
             </td>
             <td></td>
@@ -389,7 +389,7 @@
             <td >
                 Section Break</td>
             <td >
-                Customer Details
+                More Information
                 
             </td>
             <td>
@@ -422,8 +422,20 @@
             <td></td>
         </tr>
         
-        <tr class="info">
+        <tr >
             <td>27</td>
+            <td ><code>is_frozen</code></td>
+            <td >
+                Check</td>
+            <td >
+                Is Frozen
+                
+            </td>
+            <td></td>
+        </tr>
+        
+        <tr class="info">
+            <td>28</td>
             <td ><code>sales_team_section_break</code></td>
             <td >
                 Section Break</td>
@@ -437,7 +449,7 @@
         </tr>
         
         <tr >
-            <td>28</td>
+            <td>29</td>
             <td ><code>default_sales_partner</code></td>
             <td >
                 Link</td>
@@ -458,7 +470,7 @@
         </tr>
         
         <tr >
-            <td>29</td>
+            <td>30</td>
             <td ><code>default_commission_rate</code></td>
             <td >
                 Float</td>
@@ -470,7 +482,7 @@
         </tr>
         
         <tr class="info">
-            <td>30</td>
+            <td>31</td>
             <td ><code>sales_team_section</code></td>
             <td >
                 Section Break</td>
@@ -482,7 +494,7 @@
         </tr>
         
         <tr >
-            <td>31</td>
+            <td>32</td>
             <td ><code>sales_team</code></td>
             <td >
                 Table</td>
diff --git a/erpnext/docs/current/models/selling/sales_order.html b/erpnext/docs/current/models/selling/sales_order.html
index aadc664..229e847 100644
--- a/erpnext/docs/current/models/selling/sales_order.html
+++ b/erpnext/docs/current/models/selling/sales_order.html
@@ -1804,6 +1804,20 @@
     
     
 	<p class="docs-attr-name">
+        <a name="on_recurring" href="#on_recurring" class="text-muted small">
+            <i class="icon-link small" style="color: #ccc;"></i></a>
+		<b>on_recurring</b>
+        <i class="text-muted">(self, reference_doc)</i>
+    </p>
+	<div class="docs-attr-desc"><p><span class="text-muted">No docs</span></p>
+</div>
+	<br>
+
+        
+        
+    
+    
+	<p class="docs-attr-name">
         <a name="on_submit" href="#on_submit" class="text-muted small">
             <i class="icon-link small" style="color: #ccc;"></i></a>
 		<b>on_submit</b>
diff --git a/erpnext/docs/current/models/setup/supplier_type.html b/erpnext/docs/current/models/setup/supplier_type.html
index ee53252..fc7bf9c 100644
--- a/erpnext/docs/current/models/setup/supplier_type.html
+++ b/erpnext/docs/current/models/setup/supplier_type.html
@@ -50,8 +50,36 @@
             <td></td>
         </tr>
         
-        <tr >
+        <tr class="info">
             <td>2</td>
+            <td ><code>section_credit_limit</code></td>
+            <td >
+                Section Break</td>
+            <td >
+                Credit Limit
+                
+            </td>
+            <td></td>
+        </tr>
+        
+        <tr >
+            <td>3</td>
+            <td ><code>credit_days_based_on</code></td>
+            <td >
+                Select</td>
+            <td >
+                Credit Days Based On
+                
+            </td>
+            <td>
+                <pre>
+Fixed Days
+Last Day of the Next Month</pre>
+            </td>
+        </tr>
+        
+        <tr >
+            <td>4</td>
             <td ><code>credit_days</code></td>
             <td >
                 Int</td>
@@ -63,7 +91,7 @@
         </tr>
         
         <tr class="info">
-            <td>3</td>
+            <td>5</td>
             <td ><code>default_payable_account</code></td>
             <td >
                 Section Break</td>
@@ -75,7 +103,7 @@
         </tr>
         
         <tr >
-            <td>4</td>
+            <td>6</td>
             <td ><code>accounts</code></td>
             <td >
                 Table</td>
diff --git a/erpnext/docs/user/manual/en/accounts/articles/changing-parent-account.md b/erpnext/docs/user/manual/en/accounts/articles/changing-parent-account.md
index ccb89da..e4a33e0 100644
--- a/erpnext/docs/user/manual/en/accounts/articles/changing-parent-account.md
+++ b/erpnext/docs/user/manual/en/accounts/articles/changing-parent-account.md
@@ -14,17 +14,17 @@
 
 ####2. Edit Account
 
-<img alt="Project Default Cost Center" class="screenshot" src="{{docs_base_url}}/assets/img/articles/change-parent-2.png"> 
+<img alt="Project Default Cost Center" class="screenshot" src="{{docs_base_url}}/assets/img/articles/change-parent-1.png"> 
 
 ####3. Change Parent Account
 
 Search and select preferred Parent Account and save.
 
-<img alt="Project Default Cost Center" class="screenshot" src="{{docs_base_url}}/assets/img/articles/change-parent-3.png">
+<img alt="Project Default Cost Center" class="screenshot" src="{{docs_base_url}}/assets/img/articles/change-parent-2.png">
 
 Refresh system from Help menu to experience the change.
 
-<img alt="Project Default Cost Center" class="screenshot" src="{{docs_base_url}}/assets/img/articles/change-parent-4.png">
+<img alt="Project Default Cost Center" class="screenshot" src="{{docs_base_url}}/assets/img/articles/change-parent-3.png">
 
 <div class="well"> Note: Parent cannot be customized for the Root Accounts, like Asset, Liability, Income, Expense, Equity.</div>
 
diff --git a/erpnext/docs/user/manual/en/introduction/implementation-strategy.md b/erpnext/docs/user/manual/en/introduction/implementation-strategy.md
index bbfbbd6..bc494ca 100644
--- a/erpnext/docs/user/manual/en/introduction/implementation-strategy.md
+++ b/erpnext/docs/user/manual/en/introduction/implementation-strategy.md
@@ -21,7 +21,7 @@
 Once you are familiar with ERPNext, start entering your live data!
 
   * Clean up the account of test data or better, start a fresh install.
-  * If you just want to clear your transactions and not your master data like Item, Customer, Supplier, BOM etc, you can click delete the Company against which you have made the transactions and start with a fresh Bill of Materials. To delete a company, open the Company Record via Setup > Masters > Company and delete the company by clicking on the **Delete Company** button at the bottom.
+  * If you just want to clear your transactions and not your master data like Item, Customer, Supplier, BOM etc, you can click delete the transactions of your Company and start fresh. To do so, open the Company Record via Setup > Masters > Company and delete your Company's transactions by clicking on the **Delete Company Transactions** button at the bottom of the Company Form.
   * You can also setup a new account at [https://erpnext.com](https://erpnext.com), and use the 30-day free trial. [Find out more ways of deploying ERPNext](/introduction/getting-started-with-erpnext)
   * Setup all the modules with Customer Groups, Item Groups, Warehouses, BOMs etc.
   * Import Customers, Suppliers, Items, Contacts and Addresses using Data Import Tool.
diff --git a/erpnext/docs/user/manual/en/selling/articles/applying-discount.md b/erpnext/docs/user/manual/en/selling/articles/applying-discount.md
index 9dfc730..ad66ccc 100644
--- a/erpnext/docs/user/manual/en/selling/articles/applying-discount.md
+++ b/erpnext/docs/user/manual/en/selling/articles/applying-discount.md
@@ -1,31 +1,33 @@
-<h1>Applying Discount</h1>
+#Applying Discount
 
-There are two ways Discount can be applied on an items in the sales transactions.
+There are several ways Discount can be applied on an item in the sales transactions.
 
 #### 1. Discount on "Price List Rate" of an item
 
-In the Item table of transaction, after Price List Rate field, you will find Discount (%) field. Discount Rate applied in this field will be applicable on the Price List Rate of an item.
+You can find the Discount (%) field in the Item table. Discount (%) is applied on the Price List Rate to get the selling Rate of the Item.
 
-Before applying Discount (%). 
+<img alt="Discount Percentage" class="screenshot" src="{{docs_base_url}}/assets/img/articles/discount-1.png">
 
-![Before discount]({{docs_base_url}}/assets/img/articles/Selection_00616c670.png)
+The feature of Discount (%) is available in all sales and purchase transactions.
 
-After applying Discount (%) under Discount on Price List Rate (%) field.
+You can use Pricing Rule for auto-application of Discount (%). [Click here to learn how Pricing Rule functions.]({{docs_base_url}}/user/manual/en/accounts/pricing-rule.html)
 
-![After discount]({{docs_base_url}}/assets/img/articles/Selection_007f81dc2.png)
-     
-You can apply percent discount in all sales and purchase transactions.
+#### 2. Discount on Net Total and Grand Total
 
-#### 2. Discount on Grand Total
+In the "Additional Discount" section, you can apply discount as amount or as percentage.
 
-In transactions, after Taxes and Charges table, you will find option to enter "Additional Discount Amount". Based on Amount entered in this field, item's Basic Rate and Taxes will be recalculated.
+<img alt="Discount Percentage" class="screenshot" src="{{docs_base_url}}/assets/img/articles/discount-2.png">
 
-Before applying Additional Discount Amount,
+##### Discount on Net Total
 
-![Discount]({{docs_base_url}}/assets/img/articles/Selection_0085ca13e.png)
+If Discount Amount is applied on **Net Total**, then item's Net Rate and Net Amount is calculated as per the Discount Amount. Net Rate and Amount field will be visible only if Discount is applied using this feature.
 
-After applying Additional Discount Amount.
+<img alt="Discount Percentage" class="screenshot" src="{{docs_base_url}}/assets/img/articles/discount-on-net-total.png">
 
-![Discount Amount]({{docs_base_url}}/assets/img/articles/Selection_010496ae2.png)
+##### Discount on Grand Total
+
+If Discount Amount is applied based on the **Grand Total**, then with item's Net Rate, Net Amount as well as taxes are also re-calculated as per Discount Amount.
+
+<img alt="Discount Percentage" class="screenshot" src="{{docs_base_url}}/assets/img/articles/discount-on-grand-total.png">
 
 <!-- markdown -->
\ No newline at end of file
diff --git a/erpnext/docs/user/manual/en/selling/articles/close-sales-order.md b/erpnext/docs/user/manual/en/selling/articles/close-sales-order.md
new file mode 100644
index 0000000..3990e7d
--- /dev/null
+++ b/erpnext/docs/user/manual/en/selling/articles/close-sales-order.md
@@ -0,0 +1,19 @@
+#Close Sales Order
+
+In the submitted Sales Orders, you will find **Stop** option. Stopping Sales Order will restrict user from creating Delivery Note and Sales Invoice against it.
+
+<img alt="Close SO" class="screenshot"  src="{{docs_base_url}}/assets/img/articles/close-1.png">
+
+####Scenario
+
+An order is received for ten Wind Turbines. Sales Order is also created for ten units. Due to scarcity of stock, only seven units are delivered to the customer. Pending three units are to be delivered soon. Customer informs that they don't need to deliver pending item, as they have purchased it from other vendor.
+
+In this case, create Delivery Note and Sales Invoice will be created only for the seven units. And the Sales Order should be set as stopped.
+
+<img alt="Closed SO" class="screenshot"  src="{{docs_base_url}}/assets/img/articles/close-2.png">
+
+Once Sales Order is set as stopped, you will not have pending quantities (three in this case) reflecting in Pending to Deliver and Pending to Invoice reports. To make further transactions against Stopped Sales Order, you should first Unstop it.
+
+You will find same funtionality in the Purchase Order as well.
+
+<!-- markdown -->
\ No newline at end of file
diff --git a/erpnext/docs/user/manual/en/selling/articles/drop-shipping.md b/erpnext/docs/user/manual/en/selling/articles/drop-shipping.md
index 8c3af05..6d58e2c 100644
--- a/erpnext/docs/user/manual/en/selling/articles/drop-shipping.md
+++ b/erpnext/docs/user/manual/en/selling/articles/drop-shipping.md
@@ -1,3 +1,5 @@
+#Drop Ship
+
 **Drop shipping** is a supply chain management technique in which the retailer does not keep goods in stock. Instead they transfer customer orders and shipment details to either the manufacturer, another retailer, or a wholesaler, who then ships the goods directly to the customer
 
 In ERPNext, you can create a Drop Shipping by creating Purchase Order against Sales Order.
@@ -7,16 +9,19 @@
 #### Setup on Item Master
 
 Set **_Delivered by Supplier (Drop Ship)_** and **_Default Supplier_** in Item Master.
+
 <img class="screenshot" alt="Setup Item Master" src="{{docs_base_url}}/assets/img/selling/setup-drop-ship-on-item-master.png">
 
 #### Setup on Sales Order
 If Drop Shipping has set on Item master, it will automatically set **Supplier delivers to Customer** and **Supplier** on Salse Order Item.
 
 You can setup Drop Shipping, on Sales Order Item. Under **Drop Ship** section, set **Supplier delivers to Customer** and select **Supplier** agaist which Purchase Order will get created.
+
 <img class="screenshot" alt="Setup Drop Shipping on Sales Order Item" src="{{docs_base_url}}/assets/img/selling/setup-drop-ship-on-sales-order-item.png">
 
 #### Create Purchase Order
-After submitting a Sales Order, create Puchase Order.<br> 
+After submitting a Sales Order, create Puchase Order.
+
 <img class="screenshot" alt="Setup Drop Shipping on Sales Order Item" src="{{docs_base_url}}/assets/img/selling/drop-ship-sales-order.png">
 
 From Sales Order, all items, having **Supplier delivers to Customer**  checked or **Supplier**(matching with supplier selected on For Supplier popup) mentioned, will get mapped onto Purchase Order. 
@@ -24,11 +29,18 @@
 It will automatically set Customer, Customer Address and Contact Person.
 
 After submitting Purchase Order, to update delivery status, use **Mark as Delivered** button on Purchase Order. It will update delivery percetage and delivered quantity on Sales Order.
+
 <img class="screenshot" alt="Purchase Order for Drop Shipping" src="{{docs_base_url}}/assets/img/selling/drop-ship-purchase-order.png">
 
 <span style="color:#18B52D">**_Close_**</span>, is a new feature introduced on **Purchase Order** and **Sales Order**, to close or to mark fulfillment.
+
 <img class="screenshot" alt="Close Sales Order" src="{{docs_base_url}}/assets/img/selling/close-sales-order.png">
 
 ###Drop Shipping Print Format
 You can notify, Suppliers by sending a email after submitting Purchase Order by attaching Drop Shipping print format.
-<img class="screenshot" alt="Drop Dhip Print Format" src="{{docs_base_url}}/assets/img/selling/drop-ship-print-format.png">
\ No newline at end of file
+
+<img class="screenshot" alt="Drop Dhip Print Format" src="{{docs_base_url}}/assets/img/selling/drop-ship-print-format.png">
+
+###Video Help on Drop Ship
+
+<iframe width="660" height="371" src="https://www.youtube.com/embed/hUc0hu_XLdo" frameborder="0" allowfullscreen></iframe>
\ No newline at end of file
diff --git a/erpnext/docs/user/manual/en/selling/articles/erpnext-for-services-organization.md b/erpnext/docs/user/manual/en/selling/articles/erpnext-for-services-organization.md
index 2fafa68..f905dfd 100644
--- a/erpnext/docs/user/manual/en/selling/articles/erpnext-for-services-organization.md
+++ b/erpnext/docs/user/manual/en/selling/articles/erpnext-for-services-organization.md
@@ -1,28 +1,45 @@
-<h1>ERPNext for Service Organizations</h1>
+#ERPNext for Service Organization
 
-**Question:** At first look, ERPNext looks primarily designed for the traders and manufacturers. Is ERPNext used by service companies as well?
+**Question:** ERPNext looks primarily designed for the traders and manufacturers. Is ERPNext used by companies offering servies?
 
 **Answer:**
-About 30% of ERPNext customers comes from services background. These are companies into software development, certification services, individual consultants and many more. Being into services business ourselves, we use ERPNext to manage our sales, accounting, support and HR operations.
 
-https://conf.erpnext.com/2014/videos/umair-sayyed
+About 30% of ERPNext customers are companies into services. These are companies into software development, certification services, individual consultants and many more. Being into service business ourselves, we use ERPNext to manage our sales, accounting, support and HR operations. Check following video to learn how ERPNext uses ERPNext.
+
+<iframe width="640" height="360" src="//www.youtube.com/embed/b6r7WxJMfFA" frameborder="0" allowfullscreen=""></iframe>
 
 ###Master Setup
 
-Between the service and trading company, the most differentiating master is an item master. While trading and manufacturing business has stock item, with warehouse and other stock details, service items will have none of these details.
+The setup for a Service company differs primarily for Items. They don't maintain the Stock for Items and thus, don't have Warehouses.
 
-To create a services item, which will be non-stock item, in the Item master, you should set "Is Stock Item" field as "No".
+To create a Service (non-stock) Item, in the item master, uncheck "Maintain Stock" field.
 
-![non-stock item]({{docs_base_url}}/assets/img/articles/Screen Shot 2015-04-01 at 5.32.57 pm.png)
+<img alt="Service Item" class="screenshot"  src="{{docs_base_url}}/assets/img/articles/services-1.png">
+
+When creating Sales Order for the services, select Order Type as **Maintenance**. Sales Order of Maintenance Type needs lesser details compared to stock item's order like Delivery Note, item warehouse etc.
+
+Service company can still add stock items to mantain their fixed assets like computers, furniture and other office equipments.
 
 ###Hiding Non-required Features
 
+Since many modules like Manufacturing and Stock will not be required for the services company, you can hide those modules from:
+
+`Setup > Permissions > Show/Hide Modules`
+
+Modules unchecked here will be hidden from all the User.
+
 ####Feature Setup
 
-In Feature Setup, you can activate specific functionalities, and disable others. Based on this setting, forms and fields not required for your business will be hidden. [More on feature setup here](https://manual.erpnext.com/customize-erpnext/hiding-modules-and-features).
+Within the form, there are many fields only needed for companies into trading and manufacturing businesses. These fields can be hidden for the service company. Feature Setup is a tool where you can enable/disable specific feature. If a feature is disabled, then fields relevant to that feature is hidden from all the forms. For example, if Serial No. feature is disabled, then Serial. No. field from Item as well as from all the sales and purchase transaction will be hidden.
+
+[To learn more about Feature Setup, click here.]({{docs_base_url}}/user/manual/en/customize-erpnext/hiding-modules-and-features.html).
 
 ####Permissions
 
-ERPNext is the permission driven system. User will be able to access system based on permissions assigned to him/her. So, if user is not assigned Role related to Stock and Manufacturing module, it will be hidden from user. [More on permission management in ERPNext here](https://manual.erpnext.com/setting-up/users-and-permissions).
+ERPNext is the permission controlled system. Users access system based on permissions assigned to them. So, if user is not assigned Role related to Stock and Manufacturing module, it will be hidden from that User. [Click here to learn more about permission management.]({{docs_base_url}}/user/manual/en/setting-up/users-and-permissions.html).
+
+You can also refer to help video on User and Permissions setting in ERPNext.
+
+<iframe width="660" height="371" src="https://www.youtube.com/embed/fnBoRhBrwR4" frameborder="0" allowfullscreen></iframe>
 
 <!-- markdown -->
\ No newline at end of file
diff --git a/erpnext/docs/user/manual/en/selling/articles/index.txt b/erpnext/docs/user/manual/en/selling/articles/index.txt
index 70b4ac2..5d51607 100644
--- a/erpnext/docs/user/manual/en/selling/articles/index.txt
+++ b/erpnext/docs/user/manual/en/selling/articles/index.txt
@@ -1,6 +1,6 @@
 applying-discount
 drop-shipping
 erpnext-for-services-organization
-manage-shipping-rule
-managing-sales-persons-in-sales-transactions
-stopping-sales-order
\ No newline at end of file
+shipping-rule
+sales-persons-in-the-sales-transactions
+close-sales-order
\ No newline at end of file
diff --git a/erpnext/docs/user/manual/en/selling/articles/manage-shipping-rule.md b/erpnext/docs/user/manual/en/selling/articles/manage-shipping-rule.md
deleted file mode 100644
index c9c4f91..0000000
--- a/erpnext/docs/user/manual/en/selling/articles/manage-shipping-rule.md
+++ /dev/null
@@ -1,25 +0,0 @@
-<h1>Manage Shipping Rule</h1>
-
-Shipping Rule master help you define rules based on which shipping charge will be applied on sales transactions.
-
-Most of the companies (mainly retail) have shipping charge applied based on invoice total. If invoice value is above certain range, then shipping charge applied will be lesser. If invoice total is less, then shipping charges applied will be higher. You can setup Shipping Rule to address the requirement of varying shipping charge based on total.
-
-To setup Shipping Rule, go to:
-
-Selling/Accounts >> Setup >> Shipping Rule
-
-Here is an example of Shipping Rule master:
-
-![Shipping Rule Master]({{docs_base_url}}/assets/img/articles/$SGrab_258.png)
-
-Referring above, you will notice that shipping charges are reducing as range of total is increasing. This shipping charge will only be applied if transaction total falls under one of the above range, else not.
-
-If shipping charges are applied based on Shipping Rule, then more values like Shipping Account, Cost Center will be needed as well to add row in the Taxes and Other Charges table of sales transaction. Hence these details are tracked as well in the Shipping Rule itself.
-
-![Shipping Rule Filters]({{docs_base_url}}/assets/img/articles/$SGrab_260.png)
-
-Apart from price range, Shipping Rule will also validate if its territory and company matches with that of Customer's territory and company.
-
-Following is an example of how shipping charges are auto-applied on sales order based on Shipping Rule.
-
-![Shipping Rule Application]({{docs_base_url}}/assets/img/articles/$SGrab_261.png)
\ No newline at end of file
diff --git a/erpnext/docs/user/manual/en/selling/articles/managing-sales-persons-in-sales-transactions.md b/erpnext/docs/user/manual/en/selling/articles/managing-sales-persons-in-sales-transactions.md
deleted file mode 100644
index ae92e63..0000000
--- a/erpnext/docs/user/manual/en/selling/articles/managing-sales-persons-in-sales-transactions.md
+++ /dev/null
@@ -1,43 +0,0 @@
-<h1>Managing Sales Persons In Sales Transactions</h1>
-
-In ERPNext, Sales Person master is maintained in [tree structure](https://erpnext.com/kb/setup/managing-tree-structure-masters). Sales Person table is available in all the Sales transactions, at the bottom of  transactions form.
-
-If you have specific Sales Person attached to Customer, you can mention Sales Person details in the Customer master itself. On selection of Customer in the transactions, you will have Sales Person details auto-fetched in that transaction.
-
-####Sales Person Contribution
-
-If you have more than one sales person working together on an order, then with listing all the sales person for that order, you will also need to define contribution based on their effort. For example, Sales Person Aasif, Harish and Jivan are working on order. While Aasif and Harish followed this order throughout, Jivan got involved just in the end. Accordingly you should define % Contribution in the sales transaction as:
-
-![Sales Person]({{docs_base_url}}/assets/img/articles/Selection_01087d575.png)
-
-Where Sales Order Net Total is 30,000.
-
-<div class=well>Total % Contribution for all Sales Person must be 100%. If only one Sales Person is selected, then enter % Contribution as 100% for him/her.</div>
-
-####Sales Person Transaction Report
-
-You can check Sales Person Transaction Report from 
-
-`Selling > Standard Reports > Sales Person-wise Transaction Summary`
-
-This report will be generated based on Sales Order, Delivery Note and Sales Invoice. This report will give you total amount of sales made by an employee over a period. Based on data provided from this report, you can determine incentives and plan appraisal for an employee.
-
-![SP Report]({{docs_base_url}}/assets/img/articles/Selection_011.png)
-
-####Sales Person wise Commission
-
-ERPNext doesn't calculate commission payable to an Employee, but only provide total amount of sales made by him/her. As a work around, you can add your Sales Person as Sales Partner, as commission calculation feature is readily available in ERPNext. You can check Sales Partner's Commission report from 
-
-`Accounts > Standard Reports > Sales Partners Commission`
-
-####Disable Sales Person Feature
-
-If you don't track sales person wise performance, and doesn't wish to use this feature, you can disable it from:
-
-`Setup > Customize > Features Setup` 
-
-![Feature Setup]({{docs_base_url}}/assets/img/articles/Selection_01244aec7.png)
-
-After uncheck Sales Extras from Sales and Purchase section, refresh your ERPNext account's tab, so that forms will take effect based on your setting.
-
-<!-- markdown -->
\ No newline at end of file
diff --git a/erpnext/docs/user/manual/en/selling/articles/sales-persons-in-the-sales-transactions.md b/erpnext/docs/user/manual/en/selling/articles/sales-persons-in-the-sales-transactions.md
new file mode 100644
index 0000000..c270e13
--- /dev/null
+++ b/erpnext/docs/user/manual/en/selling/articles/sales-persons-in-the-sales-transactions.md
@@ -0,0 +1,45 @@
+#Sales Persons in the Sales Transactions
+
+In ERPNext, Sales Person master is maintained in [tree structure]({{docs_base_url}}/user/manual/en/setting-up/articles/managing-tree-structure-masters.html). Sales Person is selectable in all the sales transactions.
+
+Sales Persons can be updated in the Customer master as well. On selection of Customer in the transactions, Sales Persons as updated in the Customer will fetch into sales transaction.
+
+<img class="screenshot" alt="Sales Person Customer" src="{{docs_base_url}}/assets/img/articles/sales-person-transaction-1.png">
+
+####Sales Person Contribution
+
+If more than one sales persons are working together on an order, then contribution (%) should be set for each Sales Person.
+
+<img class="screenshot" alt="Sales Person Order" src="{{docs_base_url}}/assets/img/articles/sales-person-transaction-2.png">
+
+On saving transaction, based on the Net Total and Contriution (%), `Contribution to Net Total` will be calculated for each Sales Person.
+
+<div class=well>Total % Contribution for all Sales Person must be 100%. If only one Sales Person is selected, then % Contribution will be 100.</div>
+
+####Sales Person Transaction Report
+
+Check Sales Person's Transaction report from:
+
+`Selling > Standard Reports > Sales Personwise Transaction Summary`
+
+This report can be generated based on Sales Order, Delivery Note and Sales Invoice. It will give you total amount of sale made by an employe.
+
+<img class="screenshot" alt="Sales Person Report" src="{{docs_base_url}}/assets/img/articles/sales-person-transaction-3.png">
+
+####Sales Person wise Commission
+
+ERPNext only provide total amount of sale made by a Sales Person. If you offer commission to Sales Person, you should add Sales Person as Sales Partners in ERPNext. For Sales Partners, you can define Commission (%). On selected on Sales Partner in a sales transction, based on Net Total, Commission Amount is calculated as well. You can check Sales Partner's commission report from:
+
+`Accounts > Standard Reports > Sales Partners Commission`
+
+####Disable Sales Person Feature
+
+If you don't track Sales Person wise performance, and doesn't wish to use this feature, you can disable it from:
+
+`Setup > Customize > Features Setup`
+
+<img class="screenshot" alt="Disable Sales Person" src="{{docs_base_url}}/assets/img/articles/sales-person-transaction-4.png">
+
+On disabling this feature, fields and tables related to Sales Person will become hidden from masters and transcations.
+
+<!-- markdown -->
\ No newline at end of file
diff --git a/erpnext/docs/user/manual/en/selling/articles/shipping-rule.md b/erpnext/docs/user/manual/en/selling/articles/shipping-rule.md
new file mode 100644
index 0000000..d87ba36
--- /dev/null
+++ b/erpnext/docs/user/manual/en/selling/articles/shipping-rule.md
@@ -0,0 +1,33 @@
+#Shipping Rule
+
+Shipping Rule master helps in defining a rule based on which shipping charge is applied on a sales transactions.
+
+Most of the companies (mainly retail) have shipping charge applied based on the invoice total. If invoice value is above certain value, then shipping charge applied are lesser. If invoice value is less, then shipping charges applied are bit more than high shipping charges applied on a high value invoice. You can setup Shipping Rule to address the requirement of varying shipping charge based on the Net Total of sales transaction.
+
+To setup Shipping Rule, go to:
+
+`Selling > Setup > Shipping Rule` or `Accounts > Setup > Shipping Rule`
+
+####Shipping Rule Conditions
+
+<img alt="Shipping Rule Prices" class="screenshot"  src="{{docs_base_url}}/assets/img/articles/shipping-charges-1.png">
+
+Referring above, you will notice that shipping charges are reducing as valye is increasing. This shipping charge will only be applied if transaction total falls under one of the above range.
+
+####Valid for Countries
+
+You can set Shipping Charges valid for all the countries, or specify specific Country. If specific countries mentioned, then Shipping Charges will be applied only if Customer's country matches Country mentioned in the Shipping Rule.
+
+<img alt="Shipping Rule " class="screenshot"  src="{{docs_base_url}}/assets/img/articles/shipping-charges-2.gif">
+
+####Shipping Account
+
+If shipping charges are applied based on Shipping Rule, then more values like Shipping Account, Cost Center will be needed as well to add row in the Taxes and Other Charges table of transaction. Hence these details are tracked as well in the Shipping Rule.
+
+<img alt="Shipping Account" class="screenshot"  src="{{docs_base_url}}/assets/img/articles/shipping-charges-3.png">
+
+####Shipping Rule Application
+
+Following is an example of how shipping charges is auto-applied on Sales Order based on Shipping Rule.
+
+<img alt="Shipping Rule Application" class="screenshot"  src="{{docs_base_url}}/assets/img/articles/shipping-charges-4.gif">
\ No newline at end of file
diff --git a/erpnext/docs/user/manual/en/selling/articles/stopping-sales-order.md b/erpnext/docs/user/manual/en/selling/articles/stopping-sales-order.md
deleted file mode 100644
index 96a15de..0000000
--- a/erpnext/docs/user/manual/en/selling/articles/stopping-sales-order.md
+++ /dev/null
@@ -1,17 +0,0 @@
-<h1>Stopping a Sales Order</h1>
-
-In the submitted Sales Orders, you will find **Stop** option. Stopping Sales Order will restrict user from creating Delivery Note and Sales Invoice against it.
-
-![stop Sales Order]({{docs_base_url}}/assets/img/articles/$SGrab_439.png)
-
-####Scenario
-
-East Wind receives an order for ten laptops. Sales Order is also created for ten units. Due to scarcity of stock, only seven units are delivered to customer. Pending three units are to be delivered soon. Customer inform East Wind need not deliver pending item, as they have purchased it from other vendor.
-
-In this case, after East Wind will create Delivery Note and Sales Invoice only for the seven units of Laptop, and set Sales Order as stopped.
-
-![Sales Order Stopped]({{docs_base_url}}/assets/img/articles/$SGrab_440.png)
-
-Once Sales Order is set as stopped, you will not have pending quantities (three in this case) reflecting in Pending to Deliver and Pending to Invoice reports. To make further transactions against Stopped Sales Order, you should first Unstop it.
-
-<!-- markdown -->
\ No newline at end of file
diff --git a/erpnext/docs/user/manual/en/setting-up/articles/delete-a-company-and-all-related-transactions.md b/erpnext/docs/user/manual/en/setting-up/articles/delete-a-company-and-all-related-transactions.md
index 593c4f5..45c2767 100644
--- a/erpnext/docs/user/manual/en/setting-up/articles/delete-a-company-and-all-related-transactions.md
+++ b/erpnext/docs/user/manual/en/setting-up/articles/delete-a-company-and-all-related-transactions.md
@@ -14,6 +14,6 @@
 
 <img alt="Delete Transactions" class="screenshot" src="{{docs_base_url}}/assets/img/articles/delete-company.png">
 
-**Note:** If you want to delete the company record itself, the use the normal "Delete" button from Menu options. It will also delete Chart of Accounts, Chart of Cost Centers and Warehouse records for that company.
+**Note:** If you want to delete the company record itself, use the normal "Delete" button from Menu options. It will also delete Chart of Accounts, Chart of Cost Centers and Warehouse records for that company.
 
-<!-- markdown -->
\ No newline at end of file
+<!-- markdown -->
diff --git a/erpnext/docs/user/manual/en/setting-up/authorization-rule.md b/erpnext/docs/user/manual/en/setting-up/authorization-rule.md
index 6b79b6d..f6daa19 100644
--- a/erpnext/docs/user/manual/en/setting-up/authorization-rule.md
+++ b/erpnext/docs/user/manual/en/setting-up/authorization-rule.md
@@ -24,7 +24,7 @@
 
 **Step 4:**
 
-Select Role on whom this Authorization Rule will be applicable. As per the example considered, Sales User will be selected as Application To (Role). To be more specific you can also select Applicale To User, if you wish to apply to rule for specific Sales User, and not all Sales User. Its okay to not select Sales User, as its not mandatory.
+Select Role on whom this Authorization Rule will be applicable. As per the example considered, Sales User will be selected as Application To (Role). To be more specific you can also select Applicable To User, if you wish to apply the rule for specific Sales User, and not all Sales User. Its okay to not select Sales User, as its not mandatory.
 
 **Step 5:**
 
diff --git a/erpnext/docs/user/manual/en/setting-up/stock-reconciliation-for-non-serialized-item.md b/erpnext/docs/user/manual/en/setting-up/stock-reconciliation-for-non-serialized-item.md
index bd46bf1..630e247 100644
--- a/erpnext/docs/user/manual/en/setting-up/stock-reconciliation-for-non-serialized-item.md
+++ b/erpnext/docs/user/manual/en/setting-up/stock-reconciliation-for-non-serialized-item.md
@@ -11,7 +11,7 @@
 
 Non Serialized items are generally fast moving and low value item, hence doesn't need tracking for each unit. Items like screw, cotton waste, other consumables, stationary products can be categorized as non-serialized.
 
-> Stock Reconciliation option is available for the non serialized Items only. For seriazlized and batch items, you should create Material Receipt entry in Stock Entry form.
+> Stock Reconciliation option is available for the non serialized Items only. For serialized and batch items, you should create Material Receipt entry in Stock Entry form.
 
 ### Opening Stocks
 
@@ -35,7 +35,7 @@
 
 The csv format is case-sensitive. Do not edit the headers which are preset in the template. In the Item Code and Warehouse column, enter exact Item Code and Warehouse as created in your ERPNext account. For quatity, enter stock level you wish to set for that item, in a specific warehouse.
 
-#### **Step 3: Upload file and Enter Values in Stock Reconciliation Form
+#### Step 3: Upload file and Enter Values in Stock Reconciliation Form
 
 <img class="screenshot" alt="Stock Reconciliation" src="{{docs_base_url}}/assets/img/setup/stock-recon-2.png">
 
diff --git a/erpnext/docs/user/videos/index.md b/erpnext/docs/user/videos/index.md
index 1399258..071dedb 100644
--- a/erpnext/docs/user/videos/index.md
+++ b/erpnext/docs/user/videos/index.md
@@ -30,6 +30,6 @@
     <div class="col-sm-8">
         Watch video presentations from the ERPNext team and users from the 2014 ERPNext Conference.
         <br><br>
-		<a href="https://conf.erpnext.com">Join us at the ERPNext Conference on October 9th 2015 in Mumbai</a>
+		<a href="https://conf.erpnext.com">ERPNext Conference on October 9th 2015 in Mumbai</a>
     </div>
-</div>
\ No newline at end of file
+</div>
diff --git a/erpnext/hr/doctype/attendance/attendance.json b/erpnext/hr/doctype/attendance/attendance.json
index 78391c8..de32328 100644
--- a/erpnext/hr/doctype/attendance/attendance.json
+++ b/erpnext/hr/doctype/attendance/attendance.json
@@ -26,6 +26,7 @@
    "options": "Simple", 
    "permlevel": 0, 
    "print_hide": 0, 
+   "print_hide_if_no_value": 0, 
    "read_only": 0, 
    "report_hide": 0, 
    "reqd": 0, 
@@ -51,6 +52,7 @@
    "options": "ATT-", 
    "permlevel": 0, 
    "print_hide": 0, 
+   "print_hide_if_no_value": 0, 
    "read_only": 0, 
    "report_hide": 0, 
    "reqd": 1, 
@@ -76,6 +78,7 @@
    "options": "Employee", 
    "permlevel": 0, 
    "print_hide": 0, 
+   "print_hide_if_no_value": 0, 
    "read_only": 0, 
    "report_hide": 0, 
    "reqd": 1, 
@@ -100,6 +103,7 @@
    "oldfieldtype": "Data", 
    "permlevel": 0, 
    "print_hide": 0, 
+   "print_hide_if_no_value": 0, 
    "read_only": 0, 
    "report_hide": 0, 
    "reqd": 0, 
@@ -126,6 +130,7 @@
    "options": "\nPresent\nAbsent\nHalf Day", 
    "permlevel": 0, 
    "print_hide": 0, 
+   "print_hide_if_no_value": 0, 
    "read_only": 0, 
    "report_hide": 0, 
    "reqd": 1, 
@@ -151,6 +156,7 @@
    "options": "Leave Type", 
    "permlevel": 0, 
    "print_hide": 1, 
+   "print_hide_if_no_value": 0, 
    "read_only": 0, 
    "report_hide": 1, 
    "reqd": 0, 
@@ -173,6 +179,7 @@
    "oldfieldtype": "Column Break", 
    "permlevel": 0, 
    "print_hide": 0, 
+   "print_hide_if_no_value": 0, 
    "read_only": 0, 
    "report_hide": 0, 
    "reqd": 0, 
@@ -198,6 +205,7 @@
    "oldfieldtype": "Date", 
    "permlevel": 0, 
    "print_hide": 0, 
+   "print_hide_if_no_value": 0, 
    "read_only": 0, 
    "report_hide": 0, 
    "reqd": 1, 
@@ -223,6 +231,7 @@
    "options": "Fiscal Year", 
    "permlevel": 0, 
    "print_hide": 0, 
+   "print_hide_if_no_value": 0, 
    "read_only": 0, 
    "report_hide": 0, 
    "reqd": 1, 
@@ -248,6 +257,7 @@
    "options": "Company", 
    "permlevel": 0, 
    "print_hide": 0, 
+   "print_hide_if_no_value": 0, 
    "read_only": 0, 
    "report_hide": 0, 
    "reqd": 1, 
@@ -271,6 +281,7 @@
    "options": "Attendance", 
    "permlevel": 0, 
    "print_hide": 1, 
+   "print_hide_if_no_value": 0, 
    "read_only": 1, 
    "report_hide": 0, 
    "reqd": 0, 
@@ -289,7 +300,7 @@
  "issingle": 0, 
  "istable": 0, 
  "max_attachments": 0, 
- "modified": "2015-11-16 06:29:42.089225", 
+ "modified": "2016-01-25 15:36:36.252173", 
  "modified_by": "Administrator", 
  "module": "HR", 
  "name": "Attendance", 
diff --git a/erpnext/hr/doctype/employee_attendance_tool/__init__.py b/erpnext/hr/doctype/employee_attendance_tool/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/erpnext/hr/doctype/employee_attendance_tool/__init__.py
diff --git a/erpnext/hr/doctype/employee_attendance_tool/employee_attendance_tool.css b/erpnext/hr/doctype/employee_attendance_tool/employee_attendance_tool.css
new file mode 100644
index 0000000..d25fb22
--- /dev/null
+++ b/erpnext/hr/doctype/employee_attendance_tool/employee_attendance_tool.css
@@ -0,0 +1,21 @@
+.top-toolbar{
+	padding-bottom: 30px;
+	margin-left: -17px;
+}
+
+.bottom-toolbar{
+	margin-left: -17px;
+	margin-top: 20px;
+}
+
+.btn{
+	margin-right: 5px;
+}
+
+.marked-employee-label{
+	font-weight: normal;
+}
+
+.checkbox{
+	margin-top: -3px;
+}
\ No newline at end of file
diff --git a/erpnext/hr/doctype/employee_attendance_tool/employee_attendance_tool.js b/erpnext/hr/doctype/employee_attendance_tool/employee_attendance_tool.js
new file mode 100644
index 0000000..f29bc89
--- /dev/null
+++ b/erpnext/hr/doctype/employee_attendance_tool/employee_attendance_tool.js
@@ -0,0 +1,244 @@
+frappe.ui.form.on("Employee Attendance Tool", {
+	refresh: function(frm) {
+		frm.disable_save();
+	},
+
+	onload: function(frm) {
+		erpnext.employee_attendance_tool.load_employees(frm);
+	},
+
+	date: function(frm) {
+		erpnext.employee_attendance_tool.load_employees(frm);
+	},
+
+	department: function(frm) {
+		erpnext.employee_attendance_tool.load_employees(frm);
+	},
+
+	branch: function(frm) {
+		erpnext.employee_attendance_tool.load_employees(frm);
+	},
+
+	company: function(frm) {
+		erpnext.employee_attendance_tool.load_employees(frm);
+	}
+
+
+});
+
+
+erpnext.employee_attendance_tool = {
+	load_employees: function(frm) {
+		if(frm.doc.date) {
+			frappe.call({
+				method: "erpnext.hr.doctype.employee_attendance_tool.employee_attendance_tool.get_employees",
+				args: {
+					date: frm.doc.date,
+					department: frm.doc.department,
+					branch: frm.doc.branch,
+					company: frm.doc.company
+				},
+				callback: function(r) {
+					if(r.message['unmarked'].length > 0) {
+						unhide_field('unmarked_attendance_section')
+						if(!frm.employee_area) {
+							frm.employee_area = $('<div>')
+							.appendTo(frm.fields_dict.employees_html.wrapper);
+						}
+						frm.EmployeeSelector = new erpnext.EmployeeSelector(frm, frm.employee_area, r.message['unmarked'])
+					}
+					else{
+						hide_field('unmarked_attendance_section')
+					}
+
+					if(r.message['marked'].length > 0) {
+						unhide_field('marked_attendance_section')
+						if(!frm.marked_employee_area) {
+							frm.marked_employee_area = $('<div>')
+								.appendTo(frm.fields_dict.marked_attendance_html.wrapper);
+						}
+						frm.marked_employee = new erpnext.MarkedEmployee(frm, frm.marked_employee_area, r.message['marked'])
+					}
+					else{
+						hide_field('marked_attendance_section')
+					}
+				}
+			});
+		}
+	}
+}
+
+erpnext.MarkedEmployee = Class.extend({
+	init: function(frm, wrapper, employee) {
+		this.wrapper = wrapper;
+		this.frm = frm;
+		this.make(frm, employee);
+	},
+	make: function(frm, employee) {
+		var me = this;
+		$(this.wrapper).empty();
+
+		var row;
+		$.each(employee, function(i, m) {
+			var attendance_icon = "icon-check";
+			var color_class = "";
+			if(m.status == "Absent") {
+				attendance_icon = "icon-check-empty"
+				color_class = "text-muted";
+			}
+			else if(m.status == "Half Day") {
+				attendance_icon = "icon-check-minus"
+			}
+
+			if (i===0 || i % 4===0) {
+				row = $('<div class="row"></div>').appendTo(me.wrapper);
+			}
+
+			$(repl('<div class="col-sm-3 %(color_class)s">\
+				<label class="marked-employee-label"><span class="%(icon)s"></span>\
+				%(employee)s</label>\
+				</div>', {
+					employee: m.employee_name,
+					icon: attendance_icon,
+					color_class: color_class
+				})).appendTo(row);
+		});
+	}
+});
+
+
+erpnext.EmployeeSelector = Class.extend({
+	init: function(frm, wrapper, employee) {
+		this.wrapper = wrapper;
+		this.frm = frm;
+		this.make(frm, employee);
+	},
+	make: function(frm, employee) {
+		var me = this;
+
+		$(this.wrapper).empty();
+		var employee_toolbar = $('<div class="col-sm-12 top-toolbar">\
+			<button class="btn btn-default btn-add btn-xs"></button>\
+			<button class="btn btn-xs btn-default btn-remove"></button>\
+			</div>').appendTo($(this.wrapper));
+
+		var mark_employee_toolbar = $('<div class="col-sm-12 bottom-toolbar">\
+			<button class="btn btn-primary btn-mark-present btn-xs"></button>\
+			<button class="btn btn-default btn-mark-absent btn-xs"></button>\
+			<button class="btn btn-default btn-mark-half-day btn-xs"></button></div>')
+
+		employee_toolbar.find(".btn-add")
+			.html(__('Check all'))
+			.on("click", function() {
+				$(me.wrapper).find('input[type="checkbox"]').each(function(i, check) {
+					if(!$(check).is(":checked")) {
+						check.checked = true;
+					}
+				});
+			});
+
+		employee_toolbar.find(".btn-remove")
+			.html(__('Uncheck all'))
+			.on("click", function() {
+				$(me.wrapper).find('input[type="checkbox"]').each(function(i, check) {
+					if($(check).is(":checked")) {
+						check.checked = false;
+					}
+				});
+			});
+
+		mark_employee_toolbar.find(".btn-mark-present")
+			.html(__('Mark Present'))
+			.on("click", function() {
+				var employee_present = [];
+				$(me.wrapper).find('input[type="checkbox"]').each(function(i, check) {
+					if($(check).is(":checked")) {
+						employee_present.push(employee[i]);
+					}
+				});
+				frappe.call({
+					method: "erpnext.hr.doctype.employee_attendance_tool.employee_attendance_tool.mark_employee_attendance",
+					args:{
+						"employee_list":employee_present,
+						"status":"Present",
+						"date":frm.doc.date,
+						"company":frm.doc.company
+					},
+
+					callback: function(r) {
+						erpnext.employee_attendance_tool.load_employees(frm);
+
+					}
+				});
+			});
+
+		mark_employee_toolbar.find(".btn-mark-absent")
+			.html(__('Mark Absent'))
+			.on("click", function() {
+				var employee_absent = [];
+				$(me.wrapper).find('input[type="checkbox"]').each(function(i, check) {
+					if($(check).is(":checked")) {
+						employee_absent.push(employee[i]);
+					}
+				});
+				frappe.call({
+					method: "erpnext.hr.doctype.employee_attendance_tool.employee_attendance_tool.mark_employee_attendance",
+					args:{
+						"employee_list":employee_absent,
+						"status":"Absent",
+						"date":frm.doc.date,
+						"company":frm.doc.company
+					},
+
+					callback: function(r) {
+						erpnext.employee_attendance_tool.load_employees(frm);
+
+					}
+				});
+			});
+
+
+		mark_employee_toolbar.find(".btn-mark-half-day")
+			.html(__('Mark Half Day'))
+			.on("click", function() {
+				var employee_half_day = [];
+				$(me.wrapper).find('input[type="checkbox"]').each(function(i, check) {
+					if($(check).is(":checked")) {
+						employee_half_day.push(employee[i]);
+					}
+				});
+				frappe.call({
+					method: "erpnext.hr.doctype.employee_attendance_tool.employee_attendance_tool.mark_employee_attendance",
+					args:{
+						"employee_list":employee_half_day,
+						"status":"Half Day",
+						"date":frm.doc.date,
+						"company":frm.doc.company
+					},
+
+					callback: function(r) {
+						erpnext.employee_attendance_tool.load_employees(frm);
+
+					}
+				});
+			});
+
+
+		var row;
+		$.each(employee, function(i, m) {
+			if (i===0 || (i % 4) === 0) {
+				row = $('<div class="row"></div>').appendTo(me.wrapper);
+			}
+
+			$(repl('<div class="col-sm-3 unmarked-employee-checkbox">\
+				<div class="checkbox">\
+				<label><input type="checkbox" class="employee-check" employee="%(employee)s"/>\
+				%(employee)s</label>\
+				</div></div>', {employee: m.employee_name})).appendTo(row);
+		});
+
+		mark_employee_toolbar.appendTo($(this.wrapper));
+	}
+});
+
+
diff --git a/erpnext/hr/doctype/employee_attendance_tool/employee_attendance_tool.json b/erpnext/hr/doctype/employee_attendance_tool/employee_attendance_tool.json
new file mode 100644
index 0000000..f31bcf8
--- /dev/null
+++ b/erpnext/hr/doctype/employee_attendance_tool/employee_attendance_tool.json
@@ -0,0 +1,275 @@
+{
+ "allow_copy": 1, 
+ "allow_import": 0, 
+ "allow_rename": 0, 
+ "creation": "2016-01-27 14:59:47.849379", 
+ "custom": 0, 
+ "docstatus": 0, 
+ "doctype": "DocType", 
+ "document_type": "", 
+ "fields": [
+  {
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "default": "Today", 
+   "fieldname": "date", 
+   "fieldtype": "Date", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "in_filter": 0, 
+   "in_list_view": 0, 
+   "label": "Date", 
+   "length": 0, 
+   "no_copy": 0, 
+   "permlevel": 0, 
+   "precision": "", 
+   "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, 
+   "fieldname": "department", 
+   "fieldtype": "Link", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "in_filter": 0, 
+   "in_list_view": 0, 
+   "label": "Department", 
+   "length": 0, 
+   "no_copy": 0, 
+   "options": "Department", 
+   "permlevel": 0, 
+   "precision": "", 
+   "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, 
+   "fieldname": "column_break_3", 
+   "fieldtype": "Column Break", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "in_filter": 0, 
+   "in_list_view": 0, 
+   "label": "", 
+   "length": 0, 
+   "no_copy": 0, 
+   "permlevel": 0, 
+   "precision": "", 
+   "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, 
+   "fieldname": "branch", 
+   "fieldtype": "Link", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "in_filter": 0, 
+   "in_list_view": 0, 
+   "label": "Branch", 
+   "length": 0, 
+   "no_copy": 0, 
+   "options": "Branch", 
+   "permlevel": 0, 
+   "precision": "", 
+   "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, 
+   "fieldname": "company", 
+   "fieldtype": "Link", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "in_filter": 0, 
+   "in_list_view": 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, 
+   "report_hide": 0, 
+   "reqd": 0, 
+   "search_index": 0, 
+   "set_only_once": 0, 
+   "unique": 0
+  }, 
+  {
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "depends_on": "date", 
+   "fieldname": "unmarked_attendance_section", 
+   "fieldtype": "Section Break", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "in_filter": 0, 
+   "in_list_view": 0, 
+   "label": "Unmarked Attendance", 
+   "length": 0, 
+   "no_copy": 0, 
+   "permlevel": 0, 
+   "precision": "", 
+   "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, 
+   "fieldname": "employees_html", 
+   "fieldtype": "HTML", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "in_filter": 0, 
+   "in_list_view": 0, 
+   "label": "Employees HTML", 
+   "length": 0, 
+   "no_copy": 0, 
+   "permlevel": 0, 
+   "precision": "", 
+   "print_hide": 0, 
+   "print_hide_if_no_value": 0, 
+   "read_only": 1, 
+   "report_hide": 0, 
+   "reqd": 0, 
+   "search_index": 0, 
+   "set_only_once": 0, 
+   "unique": 0
+  }, 
+  {
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "depends_on": "date", 
+   "fieldname": "marked_attendance_section", 
+   "fieldtype": "Section Break", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "in_filter": 0, 
+   "in_list_view": 0, 
+   "label": "Marked Attendance", 
+   "length": 0, 
+   "no_copy": 0, 
+   "permlevel": 0, 
+   "precision": "", 
+   "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, 
+   "fieldname": "marked_attendance_html", 
+   "fieldtype": "HTML", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "in_filter": 0, 
+   "in_list_view": 0, 
+   "label": "Marked Attendance HTML", 
+   "length": 0, 
+   "no_copy": 0, 
+   "permlevel": 0, 
+   "precision": "", 
+   "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
+  }
+ ], 
+ "hide_heading": 1, 
+ "hide_toolbar": 1, 
+ "idx": 0, 
+ "in_create": 0, 
+ "in_dialog": 0, 
+ "is_submittable": 0, 
+ "issingle": 1, 
+ "istable": 0, 
+ "max_attachments": 0, 
+ "modified": "2016-01-29 02:14:36.034952", 
+ "modified_by": "Administrator", 
+ "module": "HR", 
+ "name": "Employee Attendance Tool", 
+ "name_case": "", 
+ "owner": "Administrator", 
+ "permissions": [
+  {
+   "amend": 0, 
+   "apply_user_permissions": 0, 
+   "cancel": 0, 
+   "create": 1, 
+   "delete": 0, 
+   "email": 0, 
+   "export": 0, 
+   "if_owner": 0, 
+   "import": 0, 
+   "permlevel": 0, 
+   "print": 0, 
+   "read": 1, 
+   "report": 0, 
+   "role": "HR Manager", 
+   "set_user_permissions": 0, 
+   "share": 0, 
+   "submit": 0, 
+   "write": 1
+  }
+ ], 
+ "read_only": 0, 
+ "read_only_onload": 0, 
+ "sort_field": "modified", 
+ "sort_order": "DESC"
+}
\ No newline at end of file
diff --git a/erpnext/hr/doctype/employee_attendance_tool/employee_attendance_tool.py b/erpnext/hr/doctype/employee_attendance_tool/employee_attendance_tool.py
new file mode 100644
index 0000000..622b0d9
--- /dev/null
+++ b/erpnext/hr/doctype/employee_attendance_tool/employee_attendance_tool.py
@@ -0,0 +1,52 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors
+# For license information, please see license.txt
+
+from __future__ import unicode_literals
+import frappe
+import copy
+import json
+from frappe.model.document import Document
+
+
+class EmployeeAttendanceTool(Document):
+	pass
+
+
+@frappe.whitelist()
+def get_employees(date, department=None, branch=None, company=None):
+	attendance_not_marked = []
+	attendance_marked = []
+	employee_list = frappe.get_list("Employee", fields=["employee", "employee_name"], filters={
+		"status": "Active", "department": department, "branch": branch, "company": company}, order_by="employee_name")
+	marked_employee = {}
+	for emp in frappe.get_list("Attendance", fields=["employee", "status"],
+							   filters={"att_date": date}):
+		marked_employee[emp['employee']] = emp['status']
+
+	for employee in employee_list:
+		employee['status'] = marked_employee.get(employee['employee'])
+		if employee['employee'] not in marked_employee:
+			attendance_not_marked.append(employee)
+		else:
+			attendance_marked.append(employee)
+	return {
+		"marked": attendance_marked,
+		"unmarked": attendance_not_marked
+	}
+
+
+@frappe.whitelist()
+def mark_employee_attendance(employee_list, status, date, company=None):
+	employee_list = json.loads(employee_list)
+	for employee in employee_list:
+		attendance = frappe.new_doc("Attendance")
+		attendance.employee = employee['employee']
+		attendance.employee_name = employee['employee_name']
+		attendance.att_date = date
+		attendance.status = status
+		if company:
+			attendance.company = company
+		else:
+			attendance.company = frappe.db.get_value("Employee", employee['employee'], "Company")
+		attendance.submit()
diff --git a/erpnext/hr/doctype/holiday/holiday.json b/erpnext/hr/doctype/holiday/holiday.json
index a7fc6a7..091dd13 100644
--- a/erpnext/hr/doctype/holiday/holiday.json
+++ b/erpnext/hr/doctype/holiday/holiday.json
@@ -22,10 +22,11 @@
    "no_copy": 0, 
    "permlevel": 0, 
    "print_hide": 0, 
+   "print_hide_if_no_value": 0, 
    "print_width": "300px", 
    "read_only": 0, 
    "report_hide": 0, 
-   "reqd": 0, 
+   "reqd": 1, 
    "search_index": 0, 
    "set_only_once": 0, 
    "unique": 0, 
@@ -48,9 +49,10 @@
    "oldfieldtype": "Date", 
    "permlevel": 0, 
    "print_hide": 0, 
+   "print_hide_if_no_value": 0, 
    "read_only": 0, 
    "report_hide": 0, 
-   "reqd": 0, 
+   "reqd": 1, 
    "search_index": 0, 
    "set_only_once": 0, 
    "unique": 0
@@ -65,12 +67,13 @@
  "issingle": 0, 
  "istable": 1, 
  "max_attachments": 0, 
- "modified": "2015-11-16 06:29:47.483435", 
+ "modified": "2016-01-27 11:52:46.864792", 
  "modified_by": "Administrator", 
  "module": "HR", 
  "name": "Holiday", 
  "owner": "Administrator", 
  "permissions": [], 
  "read_only": 0, 
- "read_only_onload": 0
+ "read_only_onload": 0, 
+ "sort_order": "ASC"
 }
\ No newline at end of file
diff --git a/erpnext/hr/report/employee_holiday_attendance/__init__.py b/erpnext/hr/report/employee_holiday_attendance/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/erpnext/hr/report/employee_holiday_attendance/__init__.py
diff --git a/erpnext/hr/report/employee_holiday_attendance/employee_holiday_attendance.js b/erpnext/hr/report/employee_holiday_attendance/employee_holiday_attendance.js
new file mode 100644
index 0000000..f1037ff
--- /dev/null
+++ b/erpnext/hr/report/employee_holiday_attendance/employee_holiday_attendance.js
@@ -0,0 +1,8 @@
+// Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors
+// For license information, please see license.txt
+
+frappe.query_reports["Employee Holiday Attendance"] = {
+	"filters": [
+
+	]
+}
diff --git a/erpnext/hr/report/employee_holiday_attendance/employee_holiday_attendance.json b/erpnext/hr/report/employee_holiday_attendance/employee_holiday_attendance.json
new file mode 100644
index 0000000..f538d30
--- /dev/null
+++ b/erpnext/hr/report/employee_holiday_attendance/employee_holiday_attendance.json
@@ -0,0 +1,18 @@
+{
+ "add_total_row": 0, 
+ "apply_user_permissions": 1, 
+ "creation": "2016-01-27 11:12:14.972452", 
+ "disabled": 0, 
+ "docstatus": 0, 
+ "doctype": "Report", 
+ "idx": 0, 
+ "is_standard": "Yes", 
+ "modified": "2016-01-27 11:12:14.972452", 
+ "modified_by": "Administrator", 
+ "module": "HR", 
+ "name": "Employee Holiday Attendance", 
+ "owner": "Administrator", 
+ "ref_doctype": "Attendance", 
+ "report_name": "Employee Holiday Attendance", 
+ "report_type": "Script Report"
+}
\ No newline at end of file
diff --git a/erpnext/hr/report/employee_holiday_attendance/employee_holiday_attendance.py b/erpnext/hr/report/employee_holiday_attendance/employee_holiday_attendance.py
new file mode 100644
index 0000000..bb68cf3
--- /dev/null
+++ b/erpnext/hr/report/employee_holiday_attendance/employee_holiday_attendance.py
@@ -0,0 +1,49 @@
+# Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors
+# For license information, please see license.txt
+
+from __future__ import unicode_literals
+import frappe
+from frappe import _
+
+
+def execute(filters=None):
+	if not filters:
+		filters = {}
+
+	columns = get_columns()
+	data = get_employees()
+	return columns, data
+
+
+def get_columns():
+	return [
+		_("Employee") + ":Link/Employee:120",
+		_("Name") + ":Data:200",
+		_("Date")+ ":Date:100",
+		_("Status") + ":Data:70",
+		_("Holiday") + ":Data:200"
+	]
+
+
+def get_employees():
+	holidays = frappe.get_all("Holiday", fields=["holiday_date", "description"])
+	holiday_names = {}
+	holidays_list = []
+
+	for holiday in holidays:
+		holidays_list.append(holiday.holiday_date)
+		holiday_names[holiday.holiday_date] = holiday.description
+	if(holidays_list):
+		employee_list = frappe.db.sql("""select
+		        employee, employee_name, att_date, status
+		    from tabAttendance
+		    where
+		        att_date in ({0})""".format(', '.join(["%s"]*len(holidays_list))),
+		    holidays_list, as_list=True)
+
+		for employee_data in employee_list:
+			employee_data.append(holiday_names[employee_data[2]])
+
+		return employee_list
+	else:
+		return None
\ No newline at end of file
diff --git a/erpnext/patches.txt b/erpnext/patches.txt
index 7b07997..f0e12e0 100644
--- a/erpnext/patches.txt
+++ b/erpnext/patches.txt
@@ -245,3 +245,4 @@
 erpnext.patches.v6_16.update_billing_status_in_dn_and_pr
 erpnext.patches.v6_16.create_manufacturer_records
 execute:frappe.db.sql("update `tabPricing Rule` set title=name where title='' or title is null") #2016-01-27
+erpnext.patches.v6_20.set_party_account_currency_in_orders
\ No newline at end of file
diff --git a/erpnext/patches/v5_2/change_item_selects_to_checks.py b/erpnext/patches/v5_2/change_item_selects_to_checks.py
index 25d596b..2665f4c 100644
--- a/erpnext/patches/v5_2/change_item_selects_to_checks.py
+++ b/erpnext/patches/v5_2/change_item_selects_to_checks.py
@@ -4,7 +4,7 @@
 
 def execute():
 	fields = ("is_stock_item", "is_asset_item", "has_batch_no", "has_serial_no",
-		"is_purchase_item", "is_sales_item", "is_service_item", "inspection_required",
+		"is_purchase_item", "is_sales_item", "inspection_required",
 		"is_pro_applicable", "is_sub_contracted_item")
 
 
diff --git a/erpnext/patches/v6_20/__init__.py b/erpnext/patches/v6_20/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/erpnext/patches/v6_20/__init__.py
diff --git a/erpnext/patches/v6_20/set_party_account_currency_in_orders.py b/erpnext/patches/v6_20/set_party_account_currency_in_orders.py
new file mode 100644
index 0000000..ae7ad95
--- /dev/null
+++ b/erpnext/patches/v6_20/set_party_account_currency_in_orders.py
@@ -0,0 +1,24 @@
+# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
+# License: GNU General Public License v3. See license.txt
+
+from __future__ import unicode_literals
+import frappe
+
+def execute():
+	for doctype in ("Sales Order", "Purchase Order"):
+		frappe.reload_doctype(doctype)
+		
+		for order in frappe.db.sql("""select name, {0} as party from `tab{1}` 
+			where advance_paid > 0 and docstatus=1"""
+			.format(("customer" if doctype=="Sales Order" else "supplier"), doctype), as_dict=1):
+			
+			party_account_currency = frappe.db.get_value("Journal Entry Account", {
+				"reference_type": doctype,
+				"reference_name": order.name,
+				"party": order.party,
+				"docstatus": 1,
+				"is_advance": "Yes"
+			}, "account_currency")
+			
+			frappe.db.set_value(doctype, order.name, "party_account_currency", party_account_currency)
+		
\ No newline at end of file
diff --git a/erpnext/projects/doctype/time_log/time_log.json b/erpnext/projects/doctype/time_log/time_log.json
index 88eae1e..fb1a710 100644
--- a/erpnext/projects/doctype/time_log/time_log.json
+++ b/erpnext/projects/doctype/time_log/time_log.json
@@ -1,950 +1,951 @@
 {
- "allow_copy": 0,
- "allow_import": 1,
- "allow_rename": 0,
- "autoname": "naming_series:",
- "creation": "2013-04-03 16:38:41",
- "custom": 0,
- "description": "Log of Activities performed by users against Tasks that can be used for tracking time, billing.",
- "docstatus": 0,
- "doctype": "DocType",
- "document_type": "Setup",
+ "allow_copy": 0, 
+ "allow_import": 1, 
+ "allow_rename": 0, 
+ "autoname": "naming_series:", 
+ "creation": "2013-04-03 16:38:41", 
+ "custom": 0, 
+ "description": "Log of Activities performed by users against Tasks that can be used for tracking time, billing.", 
+ "docstatus": 0, 
+ "doctype": "DocType", 
+ "document_type": "Setup", 
  "fields": [
   {
-   "allow_on_submit": 0,
-   "bold": 1,
-   "collapsible": 0,
-   "depends_on": "eval:!doc.for_manufacturing",
-   "fieldname": "activity_type",
-   "fieldtype": "Link",
-   "hidden": 0,
-   "ignore_user_permissions": 0,
-   "in_filter": 0,
-   "in_list_view": 0,
-   "label": "Activity Type",
-   "length": 0,
-   "no_copy": 0,
-   "options": "Activity Type",
-   "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,
+   "allow_on_submit": 0, 
+   "bold": 1, 
+   "collapsible": 0, 
+   "depends_on": "eval:!doc.for_manufacturing", 
+   "fieldname": "activity_type", 
+   "fieldtype": "Link", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "in_filter": 0, 
+   "in_list_view": 0, 
+   "label": "Activity Type", 
+   "length": 0, 
+   "no_copy": 0, 
+   "options": "Activity Type", 
+   "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,
-   "fieldname": "naming_series",
-   "fieldtype": "Select",
-   "hidden": 0,
-   "ignore_user_permissions": 0,
-   "in_filter": 0,
-   "in_list_view": 0,
-   "label": "Series",
-   "length": 0,
-   "no_copy": 0,
-   "options": "TL-",
-   "permlevel": 0,
-   "print_hide": 0,
-   "print_hide_if_no_value": 0,
-   "read_only": 0,
-   "report_hide": 0,
-   "reqd": 1,
-   "search_index": 0,
-   "set_only_once": 0,
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "fieldname": "naming_series", 
+   "fieldtype": "Select", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "in_filter": 0, 
+   "in_list_view": 0, 
+   "label": "Series", 
+   "length": 0, 
+   "no_copy": 0, 
+   "options": "TL-", 
+   "permlevel": 0, 
+   "print_hide": 0, 
+   "print_hide_if_no_value": 0, 
+   "read_only": 0, 
+   "report_hide": 0, 
+   "reqd": 1, 
+   "search_index": 0, 
+   "set_only_once": 0, 
    "unique": 0
-  },
+  }, 
   {
-   "allow_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "depends_on": "",
-   "fieldname": "project",
-   "fieldtype": "Link",
-   "hidden": 0,
-   "ignore_user_permissions": 0,
-   "in_filter": 0,
-   "in_list_view": 1,
-   "label": "Project",
-   "length": 0,
-   "no_copy": 0,
-   "options": "Project",
-   "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,
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "depends_on": "", 
+   "fieldname": "project", 
+   "fieldtype": "Link", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "in_filter": 0, 
+   "in_list_view": 0, 
+   "label": "Project", 
+   "length": 0, 
+   "no_copy": 0, 
+   "options": "Project", 
+   "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": "",
-   "fieldname": "task",
-   "fieldtype": "Link",
-   "hidden": 0,
-   "ignore_user_permissions": 0,
-   "in_filter": 0,
-   "in_list_view": 0,
-   "label": "Task",
-   "length": 0,
-   "no_copy": 0,
-   "options": "Task",
-   "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,
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "depends_on": "", 
+   "fieldname": "task", 
+   "fieldtype": "Link", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "in_filter": 0, 
+   "in_list_view": 0, 
+   "label": "Task", 
+   "length": 0, 
+   "no_copy": 0, 
+   "options": "Task", 
+   "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,
-   "fieldname": "status",
-   "fieldtype": "Select",
-   "hidden": 0,
-   "ignore_user_permissions": 0,
-   "in_filter": 0,
-   "in_list_view": 0,
-   "label": "Status",
-   "length": 0,
-   "no_copy": 0,
-   "options": "Draft\nSubmitted\nBatched for Billing\nBilled\nCancelled",
-   "permlevel": 0,
-   "print_hide": 0,
-   "print_hide_if_no_value": 0,
-   "read_only": 1,
-   "report_hide": 0,
-   "reqd": 0,
-   "search_index": 0,
-   "set_only_once": 0,
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "fieldname": "status", 
+   "fieldtype": "Select", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "in_filter": 0, 
+   "in_list_view": 0, 
+   "label": "Status", 
+   "length": 0, 
+   "no_copy": 0, 
+   "options": "Draft\nSubmitted\nBatched for Billing\nBilled\nCancelled", 
+   "permlevel": 0, 
+   "print_hide": 0, 
+   "print_hide_if_no_value": 0, 
+   "read_only": 1, 
+   "report_hide": 0, 
+   "reqd": 0, 
+   "search_index": 0, 
+   "set_only_once": 0, 
    "unique": 0
-  },
+  }, 
   {
-   "allow_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "fieldname": "column_break_2",
-   "fieldtype": "Column Break",
-   "hidden": 0,
-   "ignore_user_permissions": 0,
-   "in_filter": 0,
-   "in_list_view": 0,
-   "length": 0,
-   "no_copy": 0,
-   "permlevel": 0,
-   "precision": "",
-   "print_hide": 0,
-   "print_hide_if_no_value": 0,
-   "read_only": 0,
-   "report_hide": 0,
-   "reqd": 0,
-   "search_index": 0,
-   "set_only_once": 0,
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "fieldname": "column_break_2", 
+   "fieldtype": "Column Break", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "in_filter": 0, 
+   "in_list_view": 0, 
+   "length": 0, 
+   "no_copy": 0, 
+   "permlevel": 0, 
+   "precision": "", 
+   "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,
-   "fieldname": "from_time",
-   "fieldtype": "Datetime",
-   "hidden": 0,
-   "ignore_user_permissions": 0,
-   "in_filter": 0,
-   "in_list_view": 0,
-   "label": "From Time",
-   "length": 0,
-   "no_copy": 0,
-   "permlevel": 0,
-   "print_hide": 0,
-   "print_hide_if_no_value": 0,
-   "read_only": 0,
-   "report_hide": 0,
-   "reqd": 1,
-   "search_index": 0,
-   "set_only_once": 0,
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "fieldname": "from_time", 
+   "fieldtype": "Datetime", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "in_filter": 0, 
+   "in_list_view": 0, 
+   "label": "From Time", 
+   "length": 0, 
+   "no_copy": 0, 
+   "permlevel": 0, 
+   "print_hide": 0, 
+   "print_hide_if_no_value": 0, 
+   "read_only": 0, 
+   "report_hide": 0, 
+   "reqd": 1, 
+   "search_index": 0, 
+   "set_only_once": 0, 
    "unique": 0
-  },
+  }, 
   {
-   "allow_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "default": "0",
-   "fieldname": "hours",
-   "fieldtype": "Float",
-   "hidden": 0,
-   "ignore_user_permissions": 0,
-   "in_filter": 0,
-   "in_list_view": 1,
-   "label": "Hours",
-   "length": 0,
-   "no_copy": 0,
-   "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,
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "default": "0", 
+   "fieldname": "hours", 
+   "fieldtype": "Float", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "in_filter": 0, 
+   "in_list_view": 1, 
+   "label": "Hours", 
+   "length": 0, 
+   "no_copy": 0, 
+   "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,
-   "fieldname": "to_time",
-   "fieldtype": "Datetime",
-   "hidden": 0,
-   "ignore_user_permissions": 0,
-   "in_filter": 0,
-   "in_list_view": 0,
-   "label": "To Time",
-   "length": 0,
-   "no_copy": 0,
-   "permlevel": 0,
-   "print_hide": 0,
-   "print_hide_if_no_value": 0,
-   "read_only": 0,
-   "report_hide": 0,
-   "reqd": 1,
-   "search_index": 0,
-   "set_only_once": 0,
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "fieldname": "to_time", 
+   "fieldtype": "Datetime", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "in_filter": 0, 
+   "in_list_view": 0, 
+   "label": "To Time", 
+   "length": 0, 
+   "no_copy": 0, 
+   "permlevel": 0, 
+   "print_hide": 0, 
+   "print_hide_if_no_value": 0, 
+   "read_only": 0, 
+   "report_hide": 0, 
+   "reqd": 1, 
+   "search_index": 0, 
+   "set_only_once": 0, 
    "unique": 0
-  },
+  }, 
   {
-   "allow_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "fieldname": "billable",
-   "fieldtype": "Check",
-   "hidden": 0,
-   "ignore_user_permissions": 0,
-   "in_filter": 0,
-   "in_list_view": 0,
-   "label": "Billable",
-   "length": 0,
-   "no_copy": 0,
-   "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,
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "fieldname": "billable", 
+   "fieldtype": "Check", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "in_filter": 0, 
+   "in_list_view": 0, 
+   "label": "Billable", 
+   "length": 0, 
+   "no_copy": 0, 
+   "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,
-   "fieldname": "section_break_7",
-   "fieldtype": "Section Break",
-   "hidden": 0,
-   "ignore_user_permissions": 0,
-   "in_filter": 0,
-   "in_list_view": 0,
-   "length": 0,
-   "no_copy": 0,
-   "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,
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "fieldname": "section_break_7", 
+   "fieldtype": "Section Break", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "in_filter": 0, 
+   "in_list_view": 0, 
+   "length": 0, 
+   "no_copy": 0, 
+   "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,
-   "fieldname": "note",
-   "fieldtype": "Text Editor",
-   "hidden": 0,
-   "ignore_user_permissions": 0,
-   "in_filter": 0,
-   "in_list_view": 0,
-   "label": "Note",
-   "length": 0,
-   "no_copy": 0,
-   "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,
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "fieldname": "note", 
+   "fieldtype": "Text Editor", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "in_filter": 0, 
+   "in_list_view": 0, 
+   "label": "Note", 
+   "length": 0, 
+   "no_copy": 0, 
+   "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,
-   "fieldname": "section_break_12",
-   "fieldtype": "Section Break",
-   "hidden": 0,
-   "ignore_user_permissions": 0,
-   "in_filter": 0,
-   "in_list_view": 0,
-   "length": 0,
-   "no_copy": 0,
-   "permlevel": 0,
-   "precision": "",
-   "print_hide": 0,
-   "print_hide_if_no_value": 0,
-   "read_only": 0,
-   "report_hide": 0,
-   "reqd": 0,
-   "search_index": 0,
-   "set_only_once": 0,
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "fieldname": "section_break_12", 
+   "fieldtype": "Section Break", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "in_filter": 0, 
+   "in_list_view": 0, 
+   "length": 0, 
+   "no_copy": 0, 
+   "permlevel": 0, 
+   "precision": "", 
+   "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,
-   "fieldname": "user",
-   "fieldtype": "Link",
-   "hidden": 0,
-   "ignore_user_permissions": 0,
-   "in_filter": 0,
-   "in_list_view": 0,
-   "label": "User",
-   "length": 0,
-   "no_copy": 0,
-   "options": "User",
-   "permlevel": 0,
-   "precision": "",
-   "print_hide": 0,
-   "print_hide_if_no_value": 0,
-   "read_only": 0,
-   "report_hide": 0,
-   "reqd": 0,
-   "search_index": 0,
-   "set_only_once": 0,
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "fieldname": "user", 
+   "fieldtype": "Link", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "in_filter": 0, 
+   "in_list_view": 0, 
+   "label": "User", 
+   "length": 0, 
+   "no_copy": 0, 
+   "options": "User", 
+   "permlevel": 0, 
+   "precision": "", 
+   "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,
-   "fieldname": "employee",
-   "fieldtype": "Link",
-   "hidden": 0,
-   "ignore_user_permissions": 0,
-   "in_filter": 0,
-   "in_list_view": 0,
-   "label": "Employee",
-   "length": 0,
-   "no_copy": 0,
-   "options": "Employee",
-   "permlevel": 0,
-   "precision": "",
-   "print_hide": 0,
-   "print_hide_if_no_value": 0,
-   "read_only": 0,
-   "report_hide": 0,
-   "reqd": 0,
-   "search_index": 0,
-   "set_only_once": 0,
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "fieldname": "employee", 
+   "fieldtype": "Link", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "in_filter": 0, 
+   "in_list_view": 0, 
+   "label": "Employee", 
+   "length": 0, 
+   "no_copy": 0, 
+   "options": "Employee", 
+   "permlevel": 0, 
+   "precision": "", 
+   "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,
-   "fieldname": "column_break_3",
-   "fieldtype": "Column Break",
-   "hidden": 0,
-   "ignore_user_permissions": 0,
-   "in_filter": 0,
-   "in_list_view": 0,
-   "length": 0,
-   "no_copy": 0,
-   "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,
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "fieldname": "column_break_3", 
+   "fieldtype": "Column Break", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "in_filter": 0, 
+   "in_list_view": 0, 
+   "length": 0, 
+   "no_copy": 0, 
+   "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,
-   "fieldname": "for_manufacturing",
-   "fieldtype": "Check",
-   "hidden": 1,
-   "ignore_user_permissions": 0,
-   "in_filter": 0,
-   "in_list_view": 0,
-   "label": "For Manufacturing",
-   "length": 0,
-   "no_copy": 0,
-   "permlevel": 0,
-   "precision": "",
-   "print_hide": 0,
-   "print_hide_if_no_value": 0,
-   "read_only": 1,
-   "report_hide": 0,
-   "reqd": 0,
-   "search_index": 0,
-   "set_only_once": 0,
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "fieldname": "for_manufacturing", 
+   "fieldtype": "Check", 
+   "hidden": 1, 
+   "ignore_user_permissions": 0, 
+   "in_filter": 0, 
+   "in_list_view": 0, 
+   "label": "For Manufacturing", 
+   "length": 0, 
+   "no_copy": 0, 
+   "permlevel": 0, 
+   "precision": "", 
+   "print_hide": 0, 
+   "print_hide_if_no_value": 0, 
+   "read_only": 1, 
+   "report_hide": 0, 
+   "reqd": 0, 
+   "search_index": 0, 
+   "set_only_once": 0, 
    "unique": 0
-  },
+  }, 
   {
-   "allow_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "depends_on": "eval:doc.for_manufacturing",
-   "fieldname": "section_break_11",
-   "fieldtype": "Section Break",
-   "hidden": 0,
-   "ignore_user_permissions": 0,
-   "in_filter": 0,
-   "in_list_view": 0,
-   "length": 0,
-   "no_copy": 0,
-   "permlevel": 0,
-   "precision": "",
-   "print_hide": 0,
-   "print_hide_if_no_value": 0,
-   "read_only": 0,
-   "report_hide": 0,
-   "reqd": 0,
-   "search_index": 0,
-   "set_only_once": 0,
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "depends_on": "eval:doc.for_manufacturing", 
+   "fieldname": "section_break_11", 
+   "fieldtype": "Section Break", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "in_filter": 0, 
+   "in_list_view": 0, 
+   "length": 0, 
+   "no_copy": 0, 
+   "permlevel": 0, 
+   "precision": "", 
+   "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": "",
-   "fieldname": "production_order",
-   "fieldtype": "Link",
-   "hidden": 0,
-   "ignore_user_permissions": 0,
-   "in_filter": 0,
-   "in_list_view": 0,
-   "label": "Production Order",
-   "length": 0,
-   "no_copy": 0,
-   "options": "Production Order",
-   "permlevel": 0,
-   "precision": "",
-   "print_hide": 0,
-   "print_hide_if_no_value": 0,
-   "read_only": 1,
-   "report_hide": 0,
-   "reqd": 0,
-   "search_index": 0,
-   "set_only_once": 0,
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "depends_on": "", 
+   "fieldname": "production_order", 
+   "fieldtype": "Link", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "in_filter": 0, 
+   "in_list_view": 0, 
+   "label": "Production Order", 
+   "length": 0, 
+   "no_copy": 0, 
+   "options": "Production Order", 
+   "permlevel": 0, 
+   "precision": "", 
+   "print_hide": 0, 
+   "print_hide_if_no_value": 0, 
+   "read_only": 1, 
+   "report_hide": 0, 
+   "reqd": 0, 
+   "search_index": 0, 
+   "set_only_once": 0, 
    "unique": 0
-  },
+  }, 
   {
-   "allow_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "depends_on": "",
-   "fieldname": "operation",
-   "fieldtype": "Link",
-   "hidden": 0,
-   "ignore_user_permissions": 0,
-   "in_filter": 0,
-   "in_list_view": 0,
-   "label": "Operation",
-   "length": 0,
-   "no_copy": 0,
-   "options": "Operation",
-   "permlevel": 0,
-   "precision": "",
-   "print_hide": 0,
-   "print_hide_if_no_value": 0,
-   "read_only": 1,
-   "report_hide": 0,
-   "reqd": 0,
-   "search_index": 0,
-   "set_only_once": 0,
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "depends_on": "", 
+   "fieldname": "operation", 
+   "fieldtype": "Link", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "in_filter": 0, 
+   "in_list_view": 0, 
+   "label": "Operation", 
+   "length": 0, 
+   "no_copy": 0, 
+   "options": "Operation", 
+   "permlevel": 0, 
+   "precision": "", 
+   "print_hide": 0, 
+   "print_hide_if_no_value": 0, 
+   "read_only": 1, 
+   "report_hide": 0, 
+   "reqd": 0, 
+   "search_index": 0, 
+   "set_only_once": 0, 
    "unique": 0
-  },
+  }, 
   {
-   "allow_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "depends_on": "",
-   "fieldname": "operation_id",
-   "fieldtype": "Data",
-   "hidden": 1,
-   "ignore_user_permissions": 0,
-   "in_filter": 0,
-   "in_list_view": 0,
-   "label": "Operation ID",
-   "length": 0,
-   "no_copy": 0,
-   "options": "",
-   "permlevel": 0,
-   "precision": "",
-   "print_hide": 1,
-   "print_hide_if_no_value": 0,
-   "read_only": 1,
-   "report_hide": 0,
-   "reqd": 0,
-   "search_index": 0,
-   "set_only_once": 0,
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "depends_on": "", 
+   "fieldname": "operation_id", 
+   "fieldtype": "Data", 
+   "hidden": 1, 
+   "ignore_user_permissions": 0, 
+   "in_filter": 0, 
+   "in_list_view": 0, 
+   "label": "Operation ID", 
+   "length": 0, 
+   "no_copy": 0, 
+   "options": "", 
+   "permlevel": 0, 
+   "precision": "", 
+   "print_hide": 1, 
+   "print_hide_if_no_value": 0, 
+   "read_only": 1, 
+   "report_hide": 0, 
+   "reqd": 0, 
+   "search_index": 0, 
+   "set_only_once": 0, 
    "unique": 0
-  },
+  }, 
   {
-   "allow_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "fieldname": "column_break_14",
-   "fieldtype": "Column Break",
-   "hidden": 0,
-   "ignore_user_permissions": 0,
-   "in_filter": 0,
-   "in_list_view": 0,
-   "length": 0,
-   "no_copy": 0,
-   "permlevel": 0,
-   "precision": "",
-   "print_hide": 0,
-   "print_hide_if_no_value": 0,
-   "read_only": 0,
-   "report_hide": 0,
-   "reqd": 0,
-   "search_index": 0,
-   "set_only_once": 0,
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "fieldname": "column_break_14", 
+   "fieldtype": "Column Break", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "in_filter": 0, 
+   "in_list_view": 0, 
+   "length": 0, 
+   "no_copy": 0, 
+   "permlevel": 0, 
+   "precision": "", 
+   "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": "",
-   "fieldname": "workstation",
-   "fieldtype": "Link",
-   "hidden": 0,
-   "ignore_user_permissions": 0,
-   "in_filter": 0,
-   "in_list_view": 0,
-   "label": "Workstation",
-   "length": 0,
-   "no_copy": 0,
-   "options": "Workstation",
-   "permlevel": 0,
-   "precision": "",
-   "print_hide": 0,
-   "print_hide_if_no_value": 0,
-   "read_only": 1,
-   "report_hide": 0,
-   "reqd": 0,
-   "search_index": 0,
-   "set_only_once": 0,
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "depends_on": "", 
+   "fieldname": "workstation", 
+   "fieldtype": "Link", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "in_filter": 0, 
+   "in_list_view": 0, 
+   "label": "Workstation", 
+   "length": 0, 
+   "no_copy": 0, 
+   "options": "Workstation", 
+   "permlevel": 0, 
+   "precision": "", 
+   "print_hide": 0, 
+   "print_hide_if_no_value": 0, 
+   "read_only": 1, 
+   "report_hide": 0, 
+   "reqd": 0, 
+   "search_index": 0, 
+   "set_only_once": 0, 
    "unique": 0
-  },
+  }, 
   {
-   "allow_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "depends_on": "",
-   "description": "Operation completed for how many finished goods?",
-   "fieldname": "completed_qty",
-   "fieldtype": "Float",
-   "hidden": 0,
-   "ignore_user_permissions": 0,
-   "in_filter": 0,
-   "in_list_view": 0,
-   "label": "Completed Qty",
-   "length": 0,
-   "no_copy": 0,
-   "permlevel": 0,
-   "precision": "",
-   "print_hide": 0,
-   "print_hide_if_no_value": 0,
-   "read_only": 0,
-   "report_hide": 0,
-   "reqd": 0,
-   "search_index": 0,
-   "set_only_once": 0,
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "depends_on": "", 
+   "description": "Operation completed for how many finished goods?", 
+   "fieldname": "completed_qty", 
+   "fieldtype": "Float", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "in_filter": 0, 
+   "in_list_view": 0, 
+   "label": "Completed Qty", 
+   "length": 0, 
+   "no_copy": 0, 
+   "permlevel": 0, 
+   "precision": "", 
+   "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": "",
-   "fieldname": "section_break_24",
-   "fieldtype": "Section Break",
-   "hidden": 0,
-   "ignore_user_permissions": 0,
-   "in_filter": 0,
-   "in_list_view": 0,
-   "length": 0,
-   "no_copy": 0,
-   "permlevel": 0,
-   "precision": "",
-   "print_hide": 0,
-   "print_hide_if_no_value": 0,
-   "read_only": 0,
-   "report_hide": 0,
-   "reqd": 0,
-   "search_index": 0,
-   "set_only_once": 0,
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "depends_on": "", 
+   "fieldname": "section_break_24", 
+   "fieldtype": "Section Break", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "in_filter": 0, 
+   "in_list_view": 0, 
+   "length": 0, 
+   "no_copy": 0, 
+   "permlevel": 0, 
+   "precision": "", 
+   "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,
-   "default": "0",
-   "description": "",
-   "fieldname": "costing_rate",
-   "fieldtype": "Currency",
-   "hidden": 0,
-   "ignore_user_permissions": 0,
-   "in_filter": 0,
-   "in_list_view": 0,
-   "label": "Costing Rate based on Activity Type (per hour)",
-   "length": 0,
-   "no_copy": 0,
-   "permlevel": 0,
-   "precision": "",
-   "print_hide": 0,
-   "print_hide_if_no_value": 0,
-   "read_only": 1,
-   "report_hide": 0,
-   "reqd": 0,
-   "search_index": 0,
-   "set_only_once": 0,
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "default": "0", 
+   "description": "", 
+   "fieldname": "costing_rate", 
+   "fieldtype": "Currency", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "in_filter": 0, 
+   "in_list_view": 0, 
+   "label": "Costing Rate based on Activity Type (per hour)", 
+   "length": 0, 
+   "no_copy": 0, 
+   "permlevel": 0, 
+   "precision": "", 
+   "print_hide": 0, 
+   "print_hide_if_no_value": 0, 
+   "read_only": 1, 
+   "report_hide": 0, 
+   "reqd": 0, 
+   "search_index": 0, 
+   "set_only_once": 0, 
    "unique": 0
-  },
+  }, 
   {
-   "allow_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "default": "0",
-   "fieldname": "costing_amount",
-   "fieldtype": "Currency",
-   "hidden": 0,
-   "ignore_user_permissions": 0,
-   "in_filter": 0,
-   "in_list_view": 0,
-   "label": "Costing Amount",
-   "length": 0,
-   "no_copy": 0,
-   "permlevel": 0,
-   "precision": "",
-   "print_hide": 0,
-   "print_hide_if_no_value": 0,
-   "read_only": 1,
-   "report_hide": 0,
-   "reqd": 0,
-   "search_index": 0,
-   "set_only_once": 0,
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "default": "0", 
+   "fieldname": "costing_amount", 
+   "fieldtype": "Currency", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "in_filter": 0, 
+   "in_list_view": 0, 
+   "label": "Costing Amount", 
+   "length": 0, 
+   "no_copy": 0, 
+   "permlevel": 0, 
+   "precision": "", 
+   "print_hide": 0, 
+   "print_hide_if_no_value": 0, 
+   "read_only": 1, 
+   "report_hide": 0, 
+   "reqd": 0, 
+   "search_index": 0, 
+   "set_only_once": 0, 
    "unique": 0
-  },
+  }, 
   {
-   "allow_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "fieldname": "column_break_25",
-   "fieldtype": "Column Break",
-   "hidden": 0,
-   "ignore_user_permissions": 0,
-   "in_filter": 0,
-   "in_list_view": 0,
-   "length": 0,
-   "no_copy": 0,
-   "permlevel": 0,
-   "precision": "",
-   "print_hide": 0,
-   "print_hide_if_no_value": 0,
-   "read_only": 0,
-   "report_hide": 0,
-   "reqd": 0,
-   "search_index": 0,
-   "set_only_once": 0,
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "fieldname": "column_break_25", 
+   "fieldtype": "Column Break", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "in_filter": 0, 
+   "in_list_view": 0, 
+   "length": 0, 
+   "no_copy": 0, 
+   "permlevel": 0, 
+   "precision": "", 
+   "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,
-   "default": "0",
-   "description": "",
-   "fieldname": "billing_rate",
-   "fieldtype": "Currency",
-   "hidden": 0,
-   "ignore_user_permissions": 0,
-   "in_filter": 0,
-   "in_list_view": 0,
-   "label": "Billing Rate based on Activity Type (per hour)",
-   "length": 0,
-   "no_copy": 0,
-   "permlevel": 0,
-   "precision": "",
-   "print_hide": 0,
-   "print_hide_if_no_value": 0,
-   "read_only": 1,
-   "report_hide": 0,
-   "reqd": 0,
-   "search_index": 0,
-   "set_only_once": 0,
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "default": "0", 
+   "description": "", 
+   "fieldname": "billing_rate", 
+   "fieldtype": "Currency", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "in_filter": 0, 
+   "in_list_view": 0, 
+   "label": "Billing Rate based on Activity Type (per hour)", 
+   "length": 0, 
+   "no_copy": 0, 
+   "permlevel": 0, 
+   "precision": "", 
+   "print_hide": 0, 
+   "print_hide_if_no_value": 0, 
+   "read_only": 1, 
+   "report_hide": 0, 
+   "reqd": 0, 
+   "search_index": 0, 
+   "set_only_once": 0, 
    "unique": 0
-  },
+  }, 
   {
-   "allow_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "depends_on": "eval:doc.billable",
-   "fieldname": "additional_cost",
-   "fieldtype": "Currency",
-   "hidden": 0,
-   "ignore_user_permissions": 0,
-   "in_filter": 0,
-   "in_list_view": 0,
-   "label": "Additional Cost",
-   "length": 0,
-   "no_copy": 0,
-   "permlevel": 0,
-   "precision": "",
-   "print_hide": 0,
-   "print_hide_if_no_value": 0,
-   "read_only": 0,
-   "report_hide": 0,
-   "reqd": 0,
-   "search_index": 0,
-   "set_only_once": 0,
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "depends_on": "eval:doc.billable", 
+   "fieldname": "additional_cost", 
+   "fieldtype": "Currency", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "in_filter": 0, 
+   "in_list_view": 0, 
+   "label": "Additional Cost", 
+   "length": 0, 
+   "no_copy": 0, 
+   "permlevel": 0, 
+   "precision": "", 
+   "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,
-   "default": "0",
-   "description": "Will be updated only if Time Log is 'Billable'",
-   "fieldname": "billing_amount",
-   "fieldtype": "Currency",
-   "hidden": 0,
-   "ignore_user_permissions": 0,
-   "in_filter": 0,
-   "in_list_view": 0,
-   "label": "Billing Amount",
-   "length": 0,
-   "no_copy": 0,
-   "permlevel": 0,
-   "precision": "",
-   "print_hide": 0,
-   "print_hide_if_no_value": 0,
-   "read_only": 1,
-   "report_hide": 0,
-   "reqd": 0,
-   "search_index": 0,
-   "set_only_once": 0,
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "default": "0", 
+   "description": "Will be updated only if Time Log is 'Billable'", 
+   "fieldname": "billing_amount", 
+   "fieldtype": "Currency", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "in_filter": 0, 
+   "in_list_view": 0, 
+   "label": "Billing Amount", 
+   "length": 0, 
+   "no_copy": 0, 
+   "permlevel": 0, 
+   "precision": "", 
+   "print_hide": 0, 
+   "print_hide_if_no_value": 0, 
+   "read_only": 1, 
+   "report_hide": 0, 
+   "reqd": 0, 
+   "search_index": 0, 
+   "set_only_once": 0, 
    "unique": 0
-  },
+  }, 
   {
-   "allow_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "fieldname": "section_break_29",
-   "fieldtype": "Section Break",
-   "hidden": 0,
-   "ignore_user_permissions": 0,
-   "in_filter": 0,
-   "in_list_view": 0,
-   "length": 0,
-   "no_copy": 0,
-   "permlevel": 0,
-   "precision": "",
-   "print_hide": 0,
-   "print_hide_if_no_value": 0,
-   "read_only": 0,
-   "report_hide": 0,
-   "reqd": 0,
-   "search_index": 0,
-   "set_only_once": 0,
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "fieldname": "section_break_29", 
+   "fieldtype": "Section Break", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "in_filter": 0, 
+   "in_list_view": 0, 
+   "length": 0, 
+   "no_copy": 0, 
+   "permlevel": 0, 
+   "precision": "", 
+   "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,
-   "description": "Will be updated when batched.",
-   "fieldname": "time_log_batch",
-   "fieldtype": "Link",
-   "hidden": 0,
-   "ignore_user_permissions": 0,
-   "in_filter": 0,
-   "in_list_view": 0,
-   "label": "Time Log Batch",
-   "length": 0,
-   "no_copy": 0,
-   "options": "Time Log Batch",
-   "permlevel": 0,
-   "print_hide": 0,
-   "print_hide_if_no_value": 0,
-   "read_only": 1,
-   "report_hide": 0,
-   "reqd": 0,
-   "search_index": 0,
-   "set_only_once": 0,
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "description": "Will be updated when batched.", 
+   "fieldname": "time_log_batch", 
+   "fieldtype": "Link", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "in_filter": 0, 
+   "in_list_view": 0, 
+   "label": "Time Log Batch", 
+   "length": 0, 
+   "no_copy": 0, 
+   "options": "Time Log Batch", 
+   "permlevel": 0, 
+   "print_hide": 0, 
+   "print_hide_if_no_value": 0, 
+   "read_only": 1, 
+   "report_hide": 0, 
+   "reqd": 0, 
+   "search_index": 0, 
+   "set_only_once": 0, 
    "unique": 0
-  },
+  }, 
   {
-   "allow_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "description": "Will be updated when billed.",
-   "fieldname": "sales_invoice",
-   "fieldtype": "Link",
-   "hidden": 0,
-   "ignore_user_permissions": 0,
-   "in_filter": 0,
-   "in_list_view": 0,
-   "label": "Sales Invoice",
-   "length": 0,
-   "no_copy": 0,
-   "options": "Sales Invoice",
-   "permlevel": 0,
-   "print_hide": 0,
-   "print_hide_if_no_value": 0,
-   "read_only": 1,
-   "report_hide": 0,
-   "reqd": 0,
-   "search_index": 0,
-   "set_only_once": 0,
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "description": "Will be updated when billed.", 
+   "fieldname": "sales_invoice", 
+   "fieldtype": "Link", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "in_filter": 0, 
+   "in_list_view": 0, 
+   "label": "Sales Invoice", 
+   "length": 0, 
+   "no_copy": 0, 
+   "options": "Sales Invoice", 
+   "permlevel": 0, 
+   "print_hide": 0, 
+   "print_hide_if_no_value": 0, 
+   "read_only": 1, 
+   "report_hide": 0, 
+   "reqd": 0, 
+   "search_index": 0, 
+   "set_only_once": 0, 
    "unique": 0
-  },
+  }, 
   {
-   "allow_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "fieldname": "amended_from",
-   "fieldtype": "Link",
-   "hidden": 0,
-   "ignore_user_permissions": 1,
-   "in_filter": 0,
-   "in_list_view": 0,
-   "label": "Amended From",
-   "length": 0,
-   "no_copy": 1,
-   "options": "Time Log",
-   "permlevel": 1,
-   "print_hide": 1,
-   "print_hide_if_no_value": 0,
-   "read_only": 0,
-   "report_hide": 0,
-   "reqd": 0,
-   "search_index": 0,
-   "set_only_once": 0,
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "fieldname": "amended_from", 
+   "fieldtype": "Link", 
+   "hidden": 0, 
+   "ignore_user_permissions": 1, 
+   "in_filter": 0, 
+   "in_list_view": 0, 
+   "label": "Amended From", 
+   "length": 0, 
+   "no_copy": 1, 
+   "options": "Time Log", 
+   "permlevel": 1, 
+   "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": 1,
-   "bold": 0,
-   "collapsible": 0,
-   "fieldname": "title",
-   "fieldtype": "Data",
-   "hidden": 1,
-   "ignore_user_permissions": 0,
-   "in_filter": 0,
-   "in_list_view": 0,
-   "label": "Title",
-   "length": 0,
-   "no_copy": 1,
-   "permlevel": 0,
-   "precision": "",
-   "print_hide": 0,
-   "print_hide_if_no_value": 0,
-   "read_only": 0,
-   "report_hide": 0,
-   "reqd": 0,
-   "search_index": 0,
-   "set_only_once": 0,
+   "allow_on_submit": 1, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "fieldname": "title", 
+   "fieldtype": "Data", 
+   "hidden": 1, 
+   "ignore_user_permissions": 0, 
+   "in_filter": 0, 
+   "in_list_view": 0, 
+   "label": "Title", 
+   "length": 0, 
+   "no_copy": 1, 
+   "permlevel": 0, 
+   "precision": "", 
+   "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
   }
- ],
- "hide_heading": 0,
- "hide_toolbar": 0,
- "icon": "icon-time",
- "idx": 1,
- "in_create": 0,
- "in_dialog": 0,
- "is_submittable": 1,
- "issingle": 0,
- "istable": 0,
- "max_attachments": 0,
- "modified": "2016-01-14 04:40:47.439032",
- "modified_by": "Administrator",
- "module": "Projects",
- "name": "Time Log",
- "owner": "Administrator",
+ ], 
+ "hide_heading": 0, 
+ "hide_toolbar": 0, 
+ "icon": "icon-time", 
+ "idx": 1, 
+ "in_create": 0, 
+ "in_dialog": 0, 
+ "is_submittable": 1, 
+ "issingle": 0, 
+ "istable": 0, 
+ "max_attachments": 0, 
+ "modified": "2016-01-29 04:05:43.489154", 
+ "modified_by": "Administrator", 
+ "module": "Projects", 
+ "name": "Time Log", 
+ "owner": "Administrator", 
  "permissions": [
   {
-   "amend": 1,
-   "apply_user_permissions": 0,
-   "cancel": 1,
-   "create": 1,
-   "delete": 1,
-   "email": 1,
-   "export": 0,
-   "if_owner": 0,
-   "import": 0,
-   "permlevel": 0,
-   "print": 1,
-   "read": 1,
-   "report": 1,
-   "role": "Projects User",
-   "set_user_permissions": 0,
-   "share": 1,
-   "submit": 1,
+   "amend": 1, 
+   "apply_user_permissions": 0, 
+   "cancel": 1, 
+   "create": 1, 
+   "delete": 1, 
+   "email": 1, 
+   "export": 0, 
+   "if_owner": 0, 
+   "import": 0, 
+   "permlevel": 0, 
+   "print": 1, 
+   "read": 1, 
+   "report": 1, 
+   "role": "Projects User", 
+   "set_user_permissions": 0, 
+   "share": 1, 
+   "submit": 1, 
    "write": 1
-  },
+  }, 
   {
-   "amend": 1,
-   "apply_user_permissions": 0,
-   "cancel": 1,
-   "create": 0,
-   "delete": 1,
-   "email": 1,
-   "export": 0,
-   "if_owner": 0,
-   "import": 0,
-   "permlevel": 0,
-   "print": 1,
-   "read": 1,
-   "report": 1,
-   "role": "Projects Manager",
-   "set_user_permissions": 0,
-   "share": 1,
-   "submit": 1,
+   "amend": 1, 
+   "apply_user_permissions": 0, 
+   "cancel": 1, 
+   "create": 0, 
+   "delete": 1, 
+   "email": 1, 
+   "export": 0, 
+   "if_owner": 0, 
+   "import": 0, 
+   "permlevel": 0, 
+   "print": 1, 
+   "read": 1, 
+   "report": 1, 
+   "role": "Projects Manager", 
+   "set_user_permissions": 0, 
+   "share": 1, 
+   "submit": 1, 
    "write": 1
   }
- ],
- "read_only": 0,
- "read_only_onload": 0,
+ ], 
+ "read_only": 0, 
+ "read_only_onload": 0, 
+ "sort_order": "ASC", 
  "title_field": "title"
-}
+}
\ No newline at end of file
diff --git a/erpnext/projects/doctype/time_log/time_log_list.js b/erpnext/projects/doctype/time_log/time_log_list.js
index a2eb05c..5396928 100644
--- a/erpnext/projects/doctype/time_log/time_log_list.js
+++ b/erpnext/projects/doctype/time_log/time_log_list.js
@@ -4,6 +4,17 @@
 // render
 frappe.listview_settings['Time Log'] = {
 	add_fields: ["status", "billable", "activity_type", "task", "project", "hours", "for_manufacturing", "billing_amount"],
+	
+	get_indicator: function(doc) {
+		if (doc.status== "Batched for Billing") {
+			return [__("Batched for Billing"), "darkgrey", "status,=,Batched for Billing"]
+		} else if (doc.status== "Billed") {
+			return [__("Billed"), "green", "status,=,Billed"]
+		} else if (doc.status== "Submitted" && doc.billable) {
+			return [__("Billable"), "orange", "billable,=,1"]
+		}
+	},
+	
 	selectable: true,
 	onload: function(me) {
 		me.page.add_menu_item(__("Make Time Log Batch"), function() {
@@ -18,12 +29,20 @@
 			for(var i in selected) {
 				var d = selected[i];
 				if(!d.billable) {
-					msgprint(__("Time Log is not billable") + ": " + d.name);
+					msgprint(__("Time Log is not billable") + ": " + d.name + " - " + d.title);
+					return;
+				}
+				if(d.status=="Batched for Billing") {
+					msgprint(__("Time Log has been Batched for Billing") + ": " + d.name + " - " + d.title);
+					return;
+				}
+				if(d.status=="Billed") {
+					msgprint(__("Time Log has been Billed") + ": " + d.name + " - " + d.title);
 					return;
 				}
 				if(d.status!="Submitted") {
-					msgprint(__("Time Log Status must be Submitted."));
-					return
+					msgprint(__("Time Log Status must be Submitted.") + ": " + d.name + " - " + d.title);
+					return;
 				}
 			}
 
diff --git a/erpnext/projects/doctype/time_log_batch/time_log_batch_list.js b/erpnext/projects/doctype/time_log_batch/time_log_batch_list.js
index 9c02ac3..fe82b07 100644
--- a/erpnext/projects/doctype/time_log_batch/time_log_batch_list.js
+++ b/erpnext/projects/doctype/time_log_batch/time_log_batch_list.js
@@ -1,6 +1,8 @@
 frappe.listview_settings['Time Log Batch'] = {
 	add_fields: ["status", "total_hours"],
 	get_indicator: function(doc) {
-		return [__(doc.status), frappe.utils.guess_colour(doc.status), "status,=," + doc.status];
+		if (doc.status== "Billed") {
+			return [__("Billed"), "green", "status,=," + "Billed"]
+		}
 	}
 };
diff --git a/erpnext/selling/doctype/quotation/quotation.py b/erpnext/selling/doctype/quotation/quotation.py
index 43dd675..3c8add4 100644
--- a/erpnext/selling/doctype/quotation/quotation.py
+++ b/erpnext/selling/doctype/quotation/quotation.py
@@ -28,14 +28,9 @@
 	def validate_order_type(self):
 		super(Quotation, self).validate_order_type()
 
-		if self.order_type in ['Maintenance', 'Service']:
-			for d in self.get('items'):
-				if not frappe.db.get_value("Item", d.item_code, "is_service_item"):
-					frappe.throw(_("Item {0} must be Service Item").format(d.item_code))
-		else:
-			for d in self.get('items'):
-				if not frappe.db.get_value("Item", d.item_code, "is_sales_item"):
-					frappe.throw(_("Item {0} must be Sales Item").format(d.item_code))
+		for d in self.get('items'):
+			if not frappe.db.get_value("Item", d.item_code, "is_sales_item"):
+				frappe.throw(_("Item {0} must be Sales Item").format(d.item_code))
 
 	def validate_quotation_to(self):
 		if self.customer:
diff --git a/erpnext/selling/doctype/sales_order/sales_order.json b/erpnext/selling/doctype/sales_order/sales_order.json
index ee97334..fa21f0e 100644
--- a/erpnext/selling/doctype/sales_order/sales_order.json
+++ b/erpnext/selling/doctype/sales_order/sales_order.json
@@ -1569,7 +1569,7 @@
    "label": "Advance Paid", 
    "length": 0, 
    "no_copy": 1, 
-   "options": "Company:company:default_currency", 
+   "options": "party_account_currency", 
    "permlevel": 0, 
    "print_hide": 1, 
    "print_hide_if_no_value": 0, 
@@ -1963,6 +1963,31 @@
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
+   "fieldname": "party_account_currency", 
+   "fieldtype": "Link", 
+   "hidden": 1, 
+   "ignore_user_permissions": 0, 
+   "in_filter": 0, 
+   "in_list_view": 0, 
+   "label": "Party Account Currency", 
+   "length": 0, 
+   "no_copy": 1, 
+   "options": "Currency", 
+   "permlevel": 0, 
+   "precision": "", 
+   "print_hide": 1, 
+   "print_hide_if_no_value": 0, 
+   "read_only": 1, 
+   "report_hide": 0, 
+   "reqd": 0, 
+   "search_index": 0, 
+   "set_only_once": 0, 
+   "unique": 0
+  }, 
+  {
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
    "fieldname": "column_break_77", 
    "fieldtype": "Column Break", 
    "hidden": 0, 
@@ -2802,7 +2827,7 @@
  "issingle": 0, 
  "istable": 0, 
  "max_attachments": 0, 
- "modified": "2015-12-29 12:32:45.649349", 
+ "modified": "2016-01-27 15:16:00.560261", 
  "modified_by": "Administrator", 
  "module": "Selling", 
  "name": "Sales Order", 
diff --git a/erpnext/selling/doctype/sales_order_item/sales_order_item.json b/erpnext/selling/doctype/sales_order_item/sales_order_item.json
index 823b805..184a4f4 100644
--- a/erpnext/selling/doctype/sales_order_item/sales_order_item.json
+++ b/erpnext/selling/doctype/sales_order_item/sales_order_item.json
@@ -7,6 +7,7 @@
  "custom": 0, 
  "docstatus": 0, 
  "doctype": "DocType", 
+ "document_type": "Document", 
  "fields": [
   {
    "allow_on_submit": 0, 
@@ -874,13 +875,13 @@
    "depends_on": "eval:doc.delivered_by_supplier!=1", 
    "fieldname": "target_warehouse", 
    "fieldtype": "Link", 
-   "hidden": 0, 
+   "hidden": 1, 
    "ignore_user_permissions": 1, 
    "in_filter": 0, 
    "in_list_view": 0, 
-   "label": "Target Warehouse", 
+   "label": "Customer Warehouse (Optional)", 
    "length": 0, 
-   "no_copy": 0, 
+   "no_copy": 1, 
    "options": "Warehouse", 
    "permlevel": 0, 
    "precision": "", 
@@ -1289,7 +1290,7 @@
  "istable": 1, 
  "max_attachments": 0, 
  "menu_index": 0, 
- "modified": "2015-12-11 14:53:24.444343", 
+ "modified": "2016-02-01 11:16:40.514399", 
  "modified_by": "Administrator", 
  "module": "Selling", 
  "name": "Sales Order Item", 
diff --git a/erpnext/selling/report/sales_order_trends/sales_order_trends.py b/erpnext/selling/report/sales_order_trends/sales_order_trends.py
index 79e7381..c0a0f08 100644
--- a/erpnext/selling/report/sales_order_trends/sales_order_trends.py
+++ b/erpnext/selling/report/sales_order_trends/sales_order_trends.py
@@ -10,5 +10,4 @@
 	data = []
 	conditions = get_columns(filters, "Sales Order")
 	data = get_data(filters, conditions)
-	
-	return conditions["columns"], data 
\ No newline at end of file
+	return conditions["columns"], data
diff --git a/erpnext/selling/report/sales_person_target_variance_item_group_wise/sales_person_target_variance_item_group_wise.py b/erpnext/selling/report/sales_person_target_variance_item_group_wise/sales_person_target_variance_item_group_wise.py
index f7aa70f..d27816c 100644
--- a/erpnext/selling/report/sales_person_target_variance_item_group_wise/sales_person_target_variance_item_group_wise.py
+++ b/erpnext/selling/report/sales_person_target_variance_item_group_wise/sales_person_target_variance_item_group_wise.py
@@ -61,39 +61,65 @@
 
 #Get sales person & item group details
 def get_salesperson_details(filters):
-	return frappe.db.sql("""select sp.name, td.item_group, td.target_qty,
-		td.target_amount, sp.distribution_id
-		from `tabSales Person` sp, `tabTarget Detail` td
-		where td.parent=sp.name and td.fiscal_year=%s order by sp.name""",
-		(filters["fiscal_year"]), as_dict=1)
+	return frappe.db.sql("""
+		select
+			sp.name, td.item_group, td.target_qty, td.target_amount, sp.distribution_id
+		from
+			`tabSales Person` sp, `tabTarget Detail` td
+		where
+			td.parent=sp.name and td.fiscal_year=%s order by sp.name
+		""", (filters["fiscal_year"]), as_dict=1)
 
 #Get target distribution details of item group
 def get_target_distribution_details(filters):
 	target_details = {}
 
-	for d in frappe.db.sql("""select md.name, mdp.month, mdp.percentage_allocation
-		from `tabMonthly Distribution Percentage` mdp, `tabMonthly Distribution` md
-		where mdp.parent=md.name and md.fiscal_year=%s""", (filters["fiscal_year"]), as_dict=1):
+	for d in frappe.db.sql("""
+		select
+			md.name, mdp.month, mdp.percentage_allocation
+		from
+			`tabMonthly Distribution Percentage` mdp, `tabMonthly Distribution` md
+		where
+			mdp.parent=md.name and md.fiscal_year=%s
+		""", (filters["fiscal_year"]), as_dict=1):
 			target_details.setdefault(d.name, {}).setdefault(d.month, flt(d.percentage_allocation))
 
 	return target_details
 
 #Get achieved details from sales order
-def get_achieved_details(filters):
+def get_achieved_details(filters, sales_person, item_groups):
 	start_date, end_date = get_fiscal_year(fiscal_year = filters["fiscal_year"])[1:]
 
-	item_details = frappe.db.sql("""select soi.item_code, soi.qty, soi.base_net_amount, so.transaction_date,
-		st.sales_person, MONTHNAME(so.transaction_date) as month_name
-		from `tabSales Order Item` soi, `tabSales Order` so, `tabSales Team` st
-		where soi.parent=so.name and so.docstatus=1 and
-		st.parent=so.name and so.transaction_date>=%s and
-		so.transaction_date<=%s""" % ('%s', '%s'),
-		(start_date, end_date), as_dict=1)
+	lft, rgt = frappe.get_value("Sales Person", sales_person, ["lft", "rgt"])
+
+	item_details = frappe.db.sql("""
+		select
+			soi.item_code, sum(soi.qty * (st.allocated_percentage/100)) as qty,
+			sum(soi.base_net_amount * (st.allocated_percentage/100)) as amount,
+			st.sales_person, MONTHNAME(so.transaction_date) as month_name
+		from
+			`tabSales Order Item` soi, `tabSales Order` so, `tabSales Team` st
+		where
+			soi.parent=so.name and so.docstatus=1 and st.parent=so.name
+			and so.transaction_date>=%s and so.transaction_date<=%s
+			and exists(select name from `tabSales Person` where lft >= %s and rgt <= %s and name=st.sales_person)
+		group by
+			sales_person, item_code, month_name
+			""",
+		(start_date, end_date, lft, rgt), as_dict=1)
 
 	item_actual_details = {}
 	for d in item_details:
-		item_actual_details.setdefault(d.sales_person, {}).setdefault(\
-			get_item_group(d.item_code), []).append(d)
+		item_group = item_groups[d.item_code]
+		item_actual_details.setdefault(item_group, frappe._dict()).setdefault(d.month_name,\
+			frappe._dict({
+				"quantity" : 0,
+				"amount" : 0
+			}))
+
+		value_dict = item_actual_details[item_group][d.month_name]
+		value_dict.quantity += flt(d.qty)
+		value_dict.amount += flt(d.amount)
 
 	return item_actual_details
 
@@ -101,33 +127,32 @@
 	import datetime
 	salesperson_details = get_salesperson_details(filters)
 	tdd = get_target_distribution_details(filters)
-	achieved_details = get_achieved_details(filters)
+	item_groups = get_item_groups()
 
-	sim_map = {}
+	sales_person_achievement_dict = {}
 	for sd in salesperson_details:
+		achieved_details = get_achieved_details(filters, sd.name, item_groups)
+
 		for month_id in range(1, 13):
 			month = datetime.date(2013, month_id, 1).strftime('%B')
-			sim_map.setdefault(sd.name, {}).setdefault(sd.item_group, {})\
-				.setdefault(month, frappe._dict({
-					"target": 0.0, "achieved": 0.0
-				}))
+			sales_person_achievement_dict.setdefault(sd.name, {}).setdefault(sd.item_group, {})\
+					.setdefault(month, frappe._dict({
+							"target": 0.0, "achieved": 0.0
+						}))
 
-			tav_dict = sim_map[sd.name][sd.item_group][month]
+			sales_target_achieved = sales_person_achievement_dict[sd.name][sd.item_group][month]
 			month_percentage = tdd.get(sd.distribution_id, {}).get(month, 0) \
 				if sd.distribution_id else 100.0/12
 
-			for ad in achieved_details.get(sd.name, {}).get(sd.item_group, []):
-				if (filters["target_on"] == "Quantity"):
-					tav_dict.target = flt(sd.target_qty) * month_percentage / 100
-					if ad.month_name == month:
-							tav_dict.achieved += ad.qty
+			if (filters["target_on"] == "Quantity"):
+				sales_target_achieved.target = flt(sd.target_qty) * month_percentage / 100
+			else:
+				sales_target_achieved.target = flt(sd.target_amount) * month_percentage / 100
 
-				if (filters["target_on"] == "Amount"):
-					tav_dict.target = flt(sd.target_amount) * month_percentage / 100
-					if ad.month_name == month:
-							tav_dict.achieved += ad.base_net_amount
+			sales_target_achieved.achieved = achieved_details.get(sd.item_group, frappe._dict()).\
+					get(month, frappe._dict()).get(filters["target_on"].lower())
 
-	return sim_map
+	return sales_person_achievement_dict
 
-def get_item_group(item_name):
-	return frappe.db.get_value("Item", item_name, "item_group")
+def get_item_groups():
+	return dict(frappe.get_all("Item", fields=["name", "item_group"], as_list=True))
diff --git a/erpnext/selling/report/sales_person_wise_transaction_summary/sales_person_wise_transaction_summary.json b/erpnext/selling/report/sales_person_wise_transaction_summary/sales_person_wise_transaction_summary.json
index dabf604..0612dc0 100644
--- a/erpnext/selling/report/sales_person_wise_transaction_summary/sales_person_wise_transaction_summary.json
+++ b/erpnext/selling/report/sales_person_wise_transaction_summary/sales_person_wise_transaction_summary.json
@@ -1,12 +1,13 @@
 {
- "add_total_row": 1, 
+ "add_total_row": 0, 
  "apply_user_permissions": 1, 
  "creation": "2013-05-03 11:31:05", 
+ "disabled": 0, 
  "docstatus": 0, 
  "doctype": "Report", 
  "idx": 1, 
  "is_standard": "Yes", 
- "modified": "2014-06-03 07:18:17.312328", 
+ "modified": "2016-01-28 04:22:49.476068", 
  "modified_by": "Administrator", 
  "module": "Selling", 
  "name": "Sales Person-wise Transaction Summary", 
diff --git a/erpnext/selling/report/sales_person_wise_transaction_summary/sales_person_wise_transaction_summary.py b/erpnext/selling/report/sales_person_wise_transaction_summary/sales_person_wise_transaction_summary.py
index 65b0c08..e9930f3 100644
--- a/erpnext/selling/report/sales_person_wise_transaction_summary/sales_person_wise_transaction_summary.py
+++ b/erpnext/selling/report/sales_person_wise_transaction_summary/sales_person_wise_transaction_summary.py
@@ -4,6 +4,7 @@
 from __future__ import unicode_literals
 import frappe
 from frappe import msgprint, _
+from frappe.utils import flt
 
 def execute(filters=None):
 	if not filters: filters = {}
@@ -12,13 +13,22 @@
 	entries = get_entries(filters)
 	item_details = get_item_details()
 	data = []
+	total_contribution_amount = 0
 	for d in entries:
+		total_contribution_amount += flt(d.contribution_amt)
+
 		data.append([
 			d.name, d.customer, d.territory, d.posting_date, d.item_code,
 			item_details.get(d.item_code, {}).get("item_group"), item_details.get(d.item_code, {}).get("brand"),
 			d.qty, d.base_net_amount, d.sales_person, d.allocated_percentage, d.contribution_amt
 		])
 
+	if data:
+		total_row = [""]*len(data[0])
+		total_row[0] = _("Total")
+		total_row[-1] = total_contribution_amount
+		data.append(total_row)
+
 	return columns, data
 
 def get_columns(filters):
@@ -35,34 +45,38 @@
 def get_entries(filters):
 	date_field = filters["doc_type"] == "Sales Order" and "transaction_date" or "posting_date"
 	conditions, values = get_conditions(filters, date_field)
-	entries = frappe.db.sql("""select dt.name, dt.customer, dt.territory, dt.%s as posting_date,
-		dt_item.item_code, dt_item.qty, dt_item.base_net_amount, st.sales_person,
-		st.allocated_percentage, dt_item.base_net_amount*st.allocated_percentage/100 as contribution_amt
-		from `tab%s` dt, `tab%s Item` dt_item, `tabSales Team` st
-		where st.parent = dt.name and dt.name = dt_item.parent and st.parenttype = %s
-		and dt.docstatus = 1 %s order by st.sales_person, dt.name desc""" %
-		(date_field, filters["doc_type"], filters["doc_type"], '%s', conditions),
-		tuple([filters["doc_type"]] + values), as_dict=1)
+	entries = frappe.db.sql("""
+		select
+			dt.name, dt.customer, dt.territory, dt.%s as posting_date, dt_item.item_code,
+			dt_item.qty, dt_item.base_net_amount, st.sales_person, st.allocated_percentage,
+			dt_item.base_net_amount*st.allocated_percentage/100 as contribution_amt
+		from
+			`tab%s` dt, `tab%s Item` dt_item, `tabSales Team` st
+		where
+			st.parent = dt.name and dt.name = dt_item.parent and st.parenttype = %s
+			and dt.docstatus = 1 %s order by st.sales_person, dt.name desc
+		""" %(date_field, filters["doc_type"], filters["doc_type"], '%s', conditions),
+			tuple([filters["doc_type"]] + values), as_dict=1)
 
 	return entries
 
 def get_conditions(filters, date_field):
 	conditions = [""]
 	values = []
-	
+
 	for field in ["company", "customer", "territory"]:
 		if filters.get(field):
 			conditions.append("dt.{0}=%s".format(field))
 			values.append(filters[field])
-			
+
 	if filters.get("sales_person"):
-		conditions.append("st.sales_person=%s")
-		values.append(filters["sales_person"])
-		
+		lft, rgt = frappe.get_value("Sales Person", filters.get("sales_person"), ["lft", "rgt"])
+		conditions.append("exists(select name from `tabSales Person` where lft >= {0} and rgt <= {1} and name=st.sales_person)".format(lft, rgt))
+
 	if filters.get("from_date"):
 		conditions.append("dt.{0}>=%s".format(date_field))
 		values.append(filters["from_date"])
-		
+
 	if filters.get("to_date"):
 		conditions.append("dt.{0}<=%s".format(date_field))
 		values.append(filters["to_date"])
diff --git a/erpnext/selling/report/territory_target_variance_item_group_wise/territory_target_variance_item_group_wise.py b/erpnext/selling/report/territory_target_variance_item_group_wise/territory_target_variance_item_group_wise.py
index 7921f3e..dd34333 100644
--- a/erpnext/selling/report/territory_target_variance_item_group_wise/territory_target_variance_item_group_wise.py
+++ b/erpnext/selling/report/territory_target_variance_item_group_wise/territory_target_variance_item_group_wise.py
@@ -13,10 +13,10 @@
 
 	columns = get_columns(filters)
 	period_month_ranges = get_period_month_ranges(filters["period"], filters["fiscal_year"])
-	tim_map = get_territory_item_month_map(filters)
+	territory_item_group_dict = get_territory_item_month_map(filters)
 
 	data = []
-	for territory, territory_items in tim_map.items():
+	for territory, territory_items in territory_item_group_dict.items():
 		for item_group, monthwise_data in territory_items.items():
 			row = [territory, item_group]
 			totals = [0, 0, 0]
@@ -59,38 +59,63 @@
 
 #Get territory & item group details
 def get_territory_details(filters):
-	return frappe.db.sql("""select t.name, td.item_group, td.target_qty,
-		td.target_amount, t.distribution_id
-		from `tabTerritory` t, `tabTarget Detail` td
-		where td.parent=t.name and td.fiscal_year=%s order by t.name""",
-		(filters["fiscal_year"]), as_dict=1)
+	return frappe.db.sql("""
+		select
+			t.name, td.item_group, td.target_qty, td.target_amount, t.distribution_id
+		from
+			`tabTerritory` t, `tabTarget Detail` td
+		where
+			td.parent=t.name and td.fiscal_year=%s order by t.name
+		""", (filters["fiscal_year"]), as_dict=1)
 
 #Get target distribution details of item group
 def get_target_distribution_details(filters):
 	target_details = {}
 
-	for d in frappe.db.sql("""select md.name, mdp.month, mdp.percentage_allocation
-		from `tabMonthly Distribution Percentage` mdp, `tabMonthly Distribution` md
-		where mdp.parent=md.name and md.fiscal_year=%s""", (filters["fiscal_year"]), as_dict=1):
+	for d in frappe.db.sql("""
+		select
+			md.name, mdp.month, mdp.percentage_allocation
+		from
+			`tabMonthly Distribution Percentage` mdp, `tabMonthly Distribution` md
+		where
+			mdp.parent=md.name and md.fiscal_year=%s
+		""", (filters["fiscal_year"]), as_dict=1):
 			target_details.setdefault(d.name, {}).setdefault(d.month, flt(d.percentage_allocation))
 
 	return target_details
 
 #Get achieved details from sales order
-def get_achieved_details(filters):
+def get_achieved_details(filters, territory, item_groups):
 	start_date, end_date = get_fiscal_year(fiscal_year = filters["fiscal_year"])[1:]
 
-	item_details = frappe.db.sql("""select soi.item_code, soi.qty, soi.base_net_amount, so.transaction_date,
-		so.territory, MONTHNAME(so.transaction_date) as month_name
-		from `tabSales Order Item` soi, `tabSales Order` so
-		where soi.parent=so.name and so.docstatus=1 and so.transaction_date>=%s and
-		so.transaction_date<=%s""" % ('%s', '%s'),
-		(start_date, end_date), as_dict=1)
+	lft, rgt = frappe.db.get_value("Territory", territory, ["lft", "rgt"])
+
+	item_details = frappe.db.sql("""
+		select
+			soi.item_code, sum(soi.qty) as qty, sum(soi.base_net_amount) as amount,
+			MONTHNAME(so.transaction_date) as month_name
+		from
+			`tabSales Order Item` soi, `tabSales Order` so
+		where
+			soi.parent=so.name and so.docstatus=1
+			and so.transaction_date>=%s and so.transaction_date<=%s
+			and exists(select name from `tabTerritory` where lft >=%s and rgt <= %s and name=so.territory)
+		group by
+			month_name, item_code
+		""", (start_date, end_date, lft, rgt), as_dict=1)
 
 	item_actual_details = {}
 	for d in item_details:
-		item_actual_details.setdefault(d.territory, {}).setdefault(\
-			get_item_group(d.item_code), []).append(d)
+		item_group = item_groups[d.item_code]
+		item_actual_details.setdefault(item_group, frappe._dict())\
+			.setdefault(d.month_name, frappe._dict({
+				"quantity": 0,
+				"amount": 0
+			}))
+
+		value_dict = item_actual_details[item_group][d.month_name]
+		value_dict.quantity += flt(d.qty)
+		value_dict.amount += flt(d.amount)
 
 	return item_actual_details
 
@@ -98,35 +123,35 @@
 	import datetime
 	territory_details = get_territory_details(filters)
 	tdd = get_target_distribution_details(filters)
-	achieved_details = get_achieved_details(filters)
+	item_groups = get_item_groups()
 
-	tim_map = {}
+	territory_item_group_dict = {}
 
 	for td in territory_details:
+		achieved_details = get_achieved_details(filters, td.name, item_groups)
+
 		for month_id in range(1, 13):
 			month = datetime.date(2013, month_id, 1).strftime('%B')
 
-			tim_map.setdefault(td.name, {}).setdefault(td.item_group, {})\
+			territory_item_group_dict.setdefault(td.name, {}).setdefault(td.item_group, {})\
 				.setdefault(month, frappe._dict({
 					"target": 0.0, "achieved": 0.0
 				}))
 
-			tav_dict = tim_map[td.name][td.item_group][month]
+			target_achieved = territory_item_group_dict[td.name][td.item_group][month]
 			month_percentage = tdd.get(td.distribution_id, {}).get(month, 0) \
 				if td.distribution_id else 100.0/12
 
-			for ad in achieved_details.get(td.name, {}).get(td.item_group, []):
-				if (filters["target_on"] == "Quantity"):
-					tav_dict.target = flt(td.target_qty) * month_percentage / 100
-					if ad.month_name == month:
-							tav_dict.achieved += ad.qty
 
-				if (filters["target_on"] == "Amount"):
-					tav_dict.target = flt(td.target_amount) * month_percentage / 100
-					if ad.month_name == month:
-							tav_dict.achieved += ad.base_net_amount
+			if (filters["target_on"] == "Quantity"):
+				target_achieved.target = flt(td.target_qty) * month_percentage / 100
+			else:
+				target_achieved.target = flt(td.target_amount) * month_percentage / 100
 
-	return tim_map
+			target_achieved.achieved = achieved_details.get(td.item_group, {}).get(month, {})\
+				.get(filters["target_on"].lower())
 
-def get_item_group(item_name):
-	return frappe.db.get_value("Item", item_name, "item_group")
+	return territory_item_group_dict
+
+def get_item_groups():
+	return dict(frappe.get_all("Item", fields=["name", "item_group"], as_list=1))
diff --git a/erpnext/selling/sales_common.js b/erpnext/selling/sales_common.js
index 7f17bd3..ce64f32 100644
--- a/erpnext/selling/sales_common.js
+++ b/erpnext/selling/sales_common.js
@@ -56,9 +56,7 @@
 			this.frm.set_query("item_code", "items", function() {
 				return {
 					query: "erpnext.controllers.queries.item_query",
-					filters: (me.frm.doc.order_type === "Maintenance" ?
-						{'is_service_item': 1}:
-						{'is_sales_item': 1	})
+					filters: {'is_sales_item': 1}
 				}
 			});
 		}
@@ -82,10 +80,6 @@
 				}
 			});
 		}
-
-		if(this.frm.fields_dict.sales_team && this.frm.fields_dict.sales_team.grid.get_field("sales_person")) {
-			this.frm.set_query("sales_person", "sales_team", erpnext.queries.not_a_group_filter);
-		}
 	},
 
 	refresh: function() {
@@ -289,7 +283,7 @@
 		}
 		refresh_field('product_bundle_help');
 	},
-	
+
 	make_payment_request: function() {
 		frappe.call({
 			method:"erpnext.accounts.doctype.payment_request.payment_request.make_payment_request",
diff --git a/erpnext/setup/doctype/company/company.py b/erpnext/setup/doctype/company/company.py
index 01e5742..6689d66 100644
--- a/erpnext/setup/doctype/company/company.py
+++ b/erpnext/setup/doctype/company/company.py
@@ -27,15 +27,21 @@
 		return exists
 
 	def validate(self):
+		self.validate_abbr()
+		self.validate_default_accounts()
+		self.validate_currency()
+		
+	def validate_abbr(self):
 		self.abbr = self.abbr.strip()
+		
 		if self.get('__islocal') and len(self.abbr) > 5:
 			frappe.throw(_("Abbreviation cannot have more than 5 characters"))
 
 		if not self.abbr.strip():
 			frappe.throw(_("Abbreviation is mandatory"))
-
-		self.validate_default_accounts()
-		self.validate_currency()
+			
+		if frappe.db.sql("select abbr from tabCompany where name!=%s and abbr=%s", (self.name, self.abbr)):
+			frappe.throw(_("Abbreviation already used for another company"))
 
 	def validate_default_accounts(self):
 		for field in ["default_bank_account", "default_cash_account", "default_receivable_account", "default_payable_account",
@@ -167,7 +173,7 @@
 		frappe.defaults.clear_cache()
 
 	def abbreviate(self):
-		self.abbr = ''.join([c[0].upper() for c in self.name.split()])
+		self.abbr = ''.join([c[0].upper() for c in self.company_name.split()])
 
 	def on_trash(self):
 		"""
diff --git a/erpnext/stock/doctype/delivery_note/delivery_note.json b/erpnext/stock/doctype/delivery_note/delivery_note.json
index f001f85..5f85c01 100644
--- a/erpnext/stock/doctype/delivery_note/delivery_note.json
+++ b/erpnext/stock/doctype/delivery_note/delivery_note.json
@@ -2696,18 +2696,58 @@
  "istable": 0, 
  "max_attachments": 0, 
  "menu_index": 0, 
- "modified": "2015-12-25 16:20:39.014291", 
+ "modified": "2016-01-31 14:06:52.136821", 
  "modified_by": "Administrator", 
  "module": "Stock", 
  "name": "Delivery Note", 
  "owner": "Administrator", 
  "permissions": [
   {
+   "amend": 0, 
+   "apply_user_permissions": 0, 
+   "cancel": 0, 
+   "create": 1, 
+   "delete": 1, 
+   "email": 1, 
+   "export": 1, 
+   "if_owner": 0, 
+   "import": 0, 
+   "permlevel": 1, 
+   "print": 1, 
+   "read": 1, 
+   "report": 1, 
+   "role": "All", 
+   "set_user_permissions": 0, 
+   "share": 1, 
+   "submit": 0, 
+   "write": 0
+  }, 
+  {
    "amend": 1, 
    "apply_user_permissions": 0, 
    "cancel": 1, 
    "create": 1, 
-   "delete": 1, 
+   "delete": 0, 
+   "email": 1, 
+   "export": 1, 
+   "if_owner": 0, 
+   "import": 0, 
+   "permlevel": 0, 
+   "print": 1, 
+   "read": 1, 
+   "report": 1, 
+   "role": "Office Coordinator", 
+   "set_user_permissions": 0, 
+   "share": 1, 
+   "submit": 1, 
+   "write": 1
+  }, 
+  {
+   "amend": 1, 
+   "apply_user_permissions": 0, 
+   "cancel": 1, 
+   "create": 1, 
+   "delete": 0, 
    "email": 1, 
    "export": 0, 
    "if_owner": 0, 
@@ -2723,6 +2763,27 @@
    "write": 1
   }, 
   {
+   "amend": 0, 
+   "apply_user_permissions": 1, 
+   "cancel": 1, 
+   "create": 1, 
+   "delete": 0, 
+   "email": 1, 
+   "export": 1, 
+   "if_owner": 0, 
+   "import": 0, 
+   "permlevel": 0, 
+   "print": 1, 
+   "read": 1, 
+   "report": 1, 
+   "role": "Store Keeper", 
+   "set_user_permissions": 0, 
+   "share": 1, 
+   "submit": 1, 
+   "user_permission_doctypes": "[\"Warehouse\"]", 
+   "write": 1
+  }, 
+  {
    "amend": 1, 
    "apply_user_permissions": 0, 
    "cancel": 1, 
@@ -2744,10 +2805,10 @@
   }, 
   {
    "amend": 1, 
-   "apply_user_permissions": 0, 
+   "apply_user_permissions": 1, 
    "cancel": 1, 
    "create": 1, 
-   "delete": 1, 
+   "delete": 0, 
    "email": 1, 
    "export": 0, 
    "if_owner": 0, 
@@ -2760,6 +2821,7 @@
    "set_user_permissions": 0, 
    "share": 1, 
    "submit": 1, 
+   "user_permission_doctypes": "[\"Warehouse\"]", 
    "write": 1
   }, 
   {
@@ -2801,26 +2863,6 @@
    "share": 0, 
    "submit": 0, 
    "write": 0
-  }, 
-  {
-   "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": "Stock Manager", 
-   "set_user_permissions": 0, 
-   "share": 0, 
-   "submit": 0, 
-   "write": 1
   }
  ], 
  "read_only": 0, 
diff --git a/erpnext/stock/doctype/delivery_note/delivery_note.py b/erpnext/stock/doctype/delivery_note/delivery_note.py
index 7cb855f..0dabfa1 100644
--- a/erpnext/stock/doctype/delivery_note/delivery_note.py
+++ b/erpnext/stock/doctype/delivery_note/delivery_note.py
@@ -124,8 +124,8 @@
 				})
 
 		if cint(frappe.db.get_single_value('Selling Settings', 'maintain_same_sales_rate')) and not self.is_return:
-			self.validate_rate_with_reference_doc([["Sales Order", "sales_order", "so_detail"],
-				["Sales Invoice", "sales_invoice", "si_detail"]])
+			self.validate_rate_with_reference_doc([["Sales Order", "against_sales_order", "so_detail"],
+				["Sales Invoice", "against_sales_invoice", "si_detail"]])
 
 	def validate_proj_cust(self):
 		"""check for does customer belong to same project as entered.."""
diff --git a/erpnext/stock/doctype/delivery_note_item/delivery_note_item.json b/erpnext/stock/doctype/delivery_note_item/delivery_note_item.json
index dcafc1e..6ed16ce 100644
--- a/erpnext/stock/doctype/delivery_note_item/delivery_note_item.json
+++ b/erpnext/stock/doctype/delivery_note_item/delivery_note_item.json
@@ -7,6 +7,7 @@
  "custom": 0, 
  "docstatus": 0, 
  "doctype": "DocType", 
+ "document_type": "Document", 
  "fields": [
   {
    "allow_on_submit": 0, 
@@ -823,13 +824,13 @@
    "description": "", 
    "fieldname": "target_warehouse", 
    "fieldtype": "Link", 
-   "hidden": 0, 
+   "hidden": 1, 
    "ignore_user_permissions": 1, 
    "in_filter": 0, 
    "in_list_view": 0, 
-   "label": "To Warehouse (Optional)", 
+   "label": "Customer Warehouse (Optional)", 
    "length": 0, 
-   "no_copy": 0, 
+   "no_copy": 1, 
    "options": "Warehouse", 
    "permlevel": 0, 
    "precision": "", 
@@ -1286,7 +1287,7 @@
  "issingle": 0, 
  "istable": 1, 
  "max_attachments": 0, 
- "modified": "2016-01-07 05:59:56.448357", 
+ "modified": "2016-02-01 11:16:23.749244", 
  "modified_by": "Administrator", 
  "module": "Stock", 
  "name": "Delivery Note Item", 
diff --git a/erpnext/stock/doctype/item/item.json b/erpnext/stock/doctype/item/item.json
index b7d866d..79789b0 100644
--- a/erpnext/stock/doctype/item/item.json
+++ b/erpnext/stock/doctype/item/item.json
@@ -1467,35 +1467,6 @@
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
-   "default": "", 
-   "depends_on": "eval:doc.is_sales_item", 
-   "description": "Allow in Sales Order of type \"Service\"", 
-   "fieldname": "is_service_item", 
-   "fieldtype": "Check", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "in_filter": 1, 
-   "in_list_view": 0, 
-   "label": "Is Service Item", 
-   "length": 0, 
-   "no_copy": 0, 
-   "oldfieldname": "is_service_item", 
-   "oldfieldtype": "Select", 
-   "options": "", 
-   "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, 
    "default": "0", 
    "description": "Publish Item to hub.erpnext.com", 
    "fieldname": "publish_in_hub", 
@@ -2338,7 +2309,7 @@
  "issingle": 0, 
  "istable": 0, 
  "max_attachments": 1, 
- "modified": "2016-01-17 11:14:10.169713", 
+ "modified": "2016-01-26 05:31:58.950718", 
  "modified_by": "Administrator", 
  "module": "Stock", 
  "name": "Item", 
@@ -2358,7 +2329,6 @@
    "print": 1, 
    "read": 1, 
    "report": 1, 
-   "restrict": 0, 
    "role": "Material Master Manager", 
    "set_user_permissions": 0, 
    "share": 1, 
@@ -2379,7 +2349,6 @@
    "print": 1, 
    "read": 1, 
    "report": 1, 
-   "restrict": 0, 
    "role": "Material Manager", 
    "set_user_permissions": 0, 
    "share": 0, 
@@ -2400,7 +2369,6 @@
    "print": 1, 
    "read": 1, 
    "report": 1, 
-   "restrict": 0, 
    "role": "Material User", 
    "set_user_permissions": 0, 
    "share": 0, 
@@ -2421,7 +2389,6 @@
    "print": 0, 
    "read": 1, 
    "report": 0, 
-   "restrict": 0, 
    "role": "Sales User", 
    "set_user_permissions": 0, 
    "share": 0, 
@@ -2442,7 +2409,6 @@
    "print": 0, 
    "read": 1, 
    "report": 0, 
-   "restrict": 0, 
    "role": "Purchase User", 
    "set_user_permissions": 0, 
    "share": 0, 
@@ -2463,7 +2429,6 @@
    "print": 0, 
    "read": 1, 
    "report": 0, 
-   "restrict": 0, 
    "role": "Maintenance User", 
    "set_user_permissions": 0, 
    "share": 0, 
@@ -2484,7 +2449,6 @@
    "print": 0, 
    "read": 1, 
    "report": 0, 
-   "restrict": 0, 
    "role": "Accounts User", 
    "set_user_permissions": 0, 
    "share": 0, 
@@ -2505,7 +2469,6 @@
    "print": 0, 
    "read": 1, 
    "report": 0, 
-   "restrict": 0, 
    "role": "Manufacturing User", 
    "set_user_permissions": 0, 
    "share": 0, 
diff --git a/erpnext/stock/doctype/item/item.py b/erpnext/stock/doctype/item/item.py
index 80cba88..3e3c13e 100644
--- a/erpnext/stock/doctype/item/item.py
+++ b/erpnext/stock/doctype/item/item.py
@@ -7,7 +7,7 @@
 import urllib
 import itertools
 from frappe import msgprint, _
-from frappe.utils import cstr, flt, cint, getdate, now_datetime, formatdate
+from frappe.utils import cstr, flt, cint, getdate, now_datetime, formatdate, strip
 from frappe.website.website_generator import WebsiteGenerator
 from erpnext.setup.doctype.item_group.item_group import invalidate_cache_for, get_parent_item_groups
 from frappe.website.render import clear_cache
@@ -45,6 +45,7 @@
 		elif not self.item_code:
 			msgprint(_("Item Code is mandatory because Item is not automatically numbered"), raise_exception=1)
 
+		self.item_code = strip(self.item_code)
 		self.name = self.item_code
 
 	def before_insert(self):
diff --git a/erpnext/stock/doctype/item/test_records.json b/erpnext/stock/doctype/item/test_records.json
index f12c7cc..ca40d45 100644
--- a/erpnext/stock/doctype/item/test_records.json
+++ b/erpnext/stock/doctype/item/test_records.json
@@ -13,7 +13,6 @@
   "is_pro_applicable": 0,
   "is_purchase_item": 1,
   "is_sales_item": 1,
-  "is_service_item": 0,
   "is_stock_item": 1,
   "is_sub_contracted_item": 0,
   "item_code": "_Test Item",
@@ -46,7 +45,6 @@
   "is_pro_applicable": 0,
   "is_purchase_item": 1,
   "is_sales_item": 1,
-  "is_service_item": 0,
   "is_stock_item": 1,
   "is_sub_contracted_item": 0,
   "item_code": "_Test Item 2",
@@ -70,7 +68,6 @@
   "is_pro_applicable": 0,
   "is_purchase_item": 1,
   "is_sales_item": 1,
-  "is_service_item": 0,
   "is_stock_item": 1,
   "is_sub_contracted_item": 0,
   "item_code": "_Test Item Home Desktop 100",
@@ -100,7 +97,6 @@
   "is_pro_applicable": 0,
   "is_purchase_item": 1,
   "is_sales_item": 1,
-  "is_service_item": 0,
   "is_stock_item": 1,
   "is_sub_contracted_item": 0,
   "item_code": "_Test Item Home Desktop 200",
@@ -121,7 +117,6 @@
   "is_pro_applicable": 0,
   "is_purchase_item": 1,
   "is_sales_item": 1,
-  "is_service_item": 0,
   "is_stock_item": 0,
   "is_sub_contracted_item": 0,
   "item_code": "_Test Product Bundle Item",
@@ -143,7 +138,6 @@
   "is_pro_applicable": 1,
   "is_purchase_item": 1,
   "is_sales_item": 1,
-  "is_service_item": 0,
   "is_stock_item": 1,
   "is_sub_contracted_item": 1,
   "item_code": "_Test FG Item",
@@ -161,7 +155,6 @@
   "is_pro_applicable": 0,
   "is_purchase_item": 1,
   "is_sales_item": 1,
-  "is_service_item": 0,
   "is_stock_item": 0,
   "is_sub_contracted_item": 0,
   "item_code": "_Test Non Stock Item",
@@ -180,7 +173,6 @@
   "is_pro_applicable": 0,
   "is_purchase_item": 1,
   "is_sales_item": 1,
-  "is_service_item": 0,
   "is_stock_item": 1,
   "is_sub_contracted_item": 0,
   "item_code": "_Test Serialized Item",
@@ -199,7 +191,6 @@
   "is_pro_applicable": 0,
   "is_purchase_item": 1,
   "is_sales_item": 1,
-  "is_service_item": 0,
   "is_stock_item": 1,
   "is_sub_contracted_item": 0,
   "item_code": "_Test Serialized Item With Series",
@@ -221,7 +212,6 @@
   "is_asset_item": 0,
   "is_pro_applicable": 1,
   "is_sales_item": 1,
-  "is_service_item": 0,
   "is_stock_item": 1,
   "is_sub_contracted_item": 0,
   "item_code": "_Test Item Home Desktop Manufactured",
@@ -243,7 +233,6 @@
   "is_pro_applicable": 1,
   "is_purchase_item": 1,
   "is_sales_item": 1,
-  "is_service_item": 0,
   "is_stock_item": 1,
   "is_sub_contracted_item": 1,
   "item_code": "_Test FG Item 2",
@@ -265,7 +254,6 @@
   "is_pro_applicable": 1,
   "is_purchase_item": 1,
   "is_sales_item": 1,
-  "is_service_item": 0,
   "is_stock_item": 1,
   "is_sub_contracted_item": 1,
   "item_code": "_Test Variant Item",
diff --git a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py
index 0d9be9b..1dc5578 100644
--- a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py
+++ b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py
@@ -252,21 +252,23 @@
 	items = frappe.get_list("Bin", fields=["item_code"], filters={"warehouse": warehouse}, as_list=1)
 
 	items += frappe.get_list("Item", fields=["name"], filters= {"is_stock_item": 1, "has_serial_no": 0,
-		"has_batch_no": 0, "has_variants": 0, "default_warehouse": warehouse}, as_list=1)
+		"has_batch_no": 0, "has_variants": 0, "disabled": 0, "default_warehouse": warehouse}, as_list=1)
 
 	res = []
 	for item in set(items):
 		stock_bal = get_stock_balance(item[0], warehouse, posting_date, posting_time,
 			with_valuation_rate=True)
 
-		res.append({
-			"item_code": item[0],
-			"warehouse": warehouse,
-			"qty": stock_bal[0],
-			"valuation_rate": stock_bal[1],
-			"current_qty": stock_bal[0],
-			"current_valuation_rate": stock_bal[1]
-		})
+		if frappe.db.get_value("Item",item[0],"disabled") == 0:
+
+			res.append({
+				"item_code": item[0],
+				"warehouse": warehouse,
+				"qty": stock_bal[0],
+				"valuation_rate": stock_bal[1],
+				"current_qty": stock_bal[0],
+				"current_valuation_rate": stock_bal[1]
+			})
 
 	return res
 
diff --git a/erpnext/stock/doctype/stock_reconciliation_item/stock_reconciliation_item.json b/erpnext/stock/doctype/stock_reconciliation_item/stock_reconciliation_item.json
index ddc7087..f9d8b3d 100644
--- a/erpnext/stock/doctype/stock_reconciliation_item/stock_reconciliation_item.json
+++ b/erpnext/stock/doctype/stock_reconciliation_item/stock_reconciliation_item.json
@@ -110,7 +110,7 @@
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
-   "description": "", 
+   "description": "Do not include symbols (ex. $)", 
    "fieldname": "valuation_rate", 
    "fieldtype": "Currency", 
    "hidden": 0, 
@@ -215,7 +215,7 @@
  "istable": 1, 
  "max_attachments": 0, 
  "menu_index": 0, 
- "modified": "2015-11-30 02:34:10.385030", 
+ "modified": "2016-01-27 16:04:42.325454", 
  "modified_by": "Administrator", 
  "module": "Stock", 
  "name": "Stock Reconciliation Item", 
@@ -226,4 +226,4 @@
  "read_only_onload": 0, 
  "sort_field": "modified", 
  "sort_order": "DESC"
-}
\ No newline at end of file
+}
diff --git a/erpnext/stock/get_item_details.py b/erpnext/stock/get_item_details.py
index 1c0acce..5548350 100644
--- a/erpnext/stock/get_item_details.py
+++ b/erpnext/stock/get_item_details.py
@@ -111,11 +111,7 @@
 
 	if args.transaction_type=="selling":
 		# validate if sales item or service item
-		if args.get("order_type") == "Maintenance":
-			if item.is_service_item != 1:
-				throw(_("Item {0} must be a Service Item.").format(item.name))
-
-		elif item.is_sales_item != 1:
+		if item.is_sales_item != 1:
 			throw(_("Item {0} must be a Sales Item").format(item.name))
 
 		if cint(item.has_variants):
diff --git a/erpnext/stock/report/item_wise_price_list_rate/item_wise_price_list_rate.json b/erpnext/stock/report/item_wise_price_list_rate/item_wise_price_list_rate.json
index ec8f599..6a8ddc3 100644
--- a/erpnext/stock/report/item_wise_price_list_rate/item_wise_price_list_rate.json
+++ b/erpnext/stock/report/item_wise_price_list_rate/item_wise_price_list_rate.json
@@ -1,17 +1,19 @@
 {
- "apply_user_permissions": 1,
- "creation": "2013-09-25 10:21:15",
- "docstatus": 0,
- "doctype": "Report",
- "idx": 1,
- "is_standard": "Yes",
- "json": "{\"filters\":[[\"Item Price\",\"price_list\",\"like\",\"%\"],[\"Item Price\",\"item_code\",\"like\",\"%\"]],\"columns\":[[\"name\",\"Item Price\"],[\"price_list\",\"Item Price\"],[\"item_code\",\"Item Price\"],[\"item_name\",\"Item Price\"],[\"item_description\",\"Item Price\"],[\"price_list_rate\",\"Item Price\"],[\"buying\",\"Item Price\"],[\"selling\",\"Item Price\"],[\"currency\",\"Item Price\"]],\"sort_by\":\"Item Price.modified\",\"sort_order\":\"desc\",\"sort_by_next\":\"\",\"sort_order_next\":\"desc\"}",
- "modified": "2014-06-09 10:21:15.097955",
- "modified_by": "Administrator",
- "module": "Stock",
- "name": "Item-wise Price List Rate",
- "owner": "Administrator",
- "ref_doctype": "Price List",
- "report_name": "Item-wise Price List Rate",
+ "add_total_row": 0, 
+ "apply_user_permissions": 1, 
+ "creation": "2013-09-25 10:21:15", 
+ "disabled": 0, 
+ "docstatus": 0, 
+ "doctype": "Report", 
+ "idx": 1, 
+ "is_standard": "Yes", 
+ "json": "{\"filters\":[],\"columns\":[[\"name\",\"Item Price\"],[\"price_list\",\"Item Price\"],[\"item_code\",\"Item Price\"],[\"item_name\",\"Item Price\"],[\"item_description\",\"Item Price\"],[\"price_list_rate\",\"Item Price\"],[\"buying\",\"Item Price\"],[\"selling\",\"Item Price\"],[\"currency\",\"Item Price\"]],\"sort_by\":\"Item Price.modified\",\"sort_order\":\"desc\",\"sort_by_next\":null,\"sort_order_next\":\"desc\"}", 
+ "modified": "2016-02-01 14:31:04.075909", 
+ "modified_by": "Administrator", 
+ "module": "Stock", 
+ "name": "Item-wise Price List Rate", 
+ "owner": "Administrator", 
+ "ref_doctype": "Item Price", 
+ "report_name": "Item-wise Price List Rate", 
  "report_type": "Report Builder"
-}
+}
\ No newline at end of file
diff --git a/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.js b/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.js
index 91b1f67..650429c 100644
--- a/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.js
+++ b/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.js
@@ -107,7 +107,7 @@
 
 cur_frm.fields_dict['items'].grid.get_field('item_code').get_query = function(doc, cdt, cdn) {
 	return {
-		filters:{ 'is_service_item': 1 }
+		filters:{ 'is_sales_item': 1 }
 	}
 }
 
diff --git a/erpnext/support/doctype/maintenance_visit/maintenance_visit.js b/erpnext/support/doctype/maintenance_visit/maintenance_visit.js
index 52141a8..51ba62a 100644
--- a/erpnext/support/doctype/maintenance_visit/maintenance_visit.js
+++ b/erpnext/support/doctype/maintenance_visit/maintenance_visit.js
@@ -81,7 +81,7 @@
 
 cur_frm.fields_dict['purposes'].grid.get_field('item_code').get_query = function(doc, cdt, cdn) {
 	return{
-    	filters:{ 'is_service_item': 1}
+    	filters:{ 'is_sales_item': 1}
   	}
 }