Merge pull request #5963 from neilLasrado/assessment

Assessment Groups
diff --git a/erpnext/__init__.py b/erpnext/__init__.py
index f4f4532..6bb9a1f 100644
--- a/erpnext/__init__.py
+++ b/erpnext/__init__.py
@@ -2,7 +2,7 @@
 from __future__ import unicode_literals
 import frappe
 
-__version__ = '7.0.18'
+__version__ = '7.0.20'
 
 def get_default_company(user=None):
 	'''Get default company for user'''
diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry.py b/erpnext/accounts/doctype/journal_entry/journal_entry.py
index 94709a7..4e00c32 100644
--- a/erpnext/accounts/doctype/journal_entry/journal_entry.py
+++ b/erpnext/accounts/doctype/journal_entry/journal_entry.py
@@ -772,6 +772,9 @@
 	company_currency = get_company_currency(company)
 	account_details = frappe.db.get_value("Account", account, ["account_type", "account_currency"], as_dict=1)
 
+	if not account_details:
+		return
+
 	if account_details.account_type == "Receivable":
 		party_type = "Customer"
 	elif account_details.account_type == "Payable":
diff --git a/erpnext/accounts/doctype/payment_entry/payment_entry.js b/erpnext/accounts/doctype/payment_entry/payment_entry.js
index d155ecd..e2e8340 100644
--- a/erpnext/accounts/doctype/payment_entry/payment_entry.js
+++ b/erpnext/accounts/doctype/payment_entry/payment_entry.js
@@ -95,13 +95,13 @@
 			frm.doc.paid_to_account_currency != company_currency &&
 			frm.doc.paid_from_account_currency != frm.doc.paid_to_account_currency));
 
-			frm.toggle_display("base_paid_amount", frm.doc.paid_from_account_currency != company_currency);
+		frm.toggle_display("base_paid_amount", frm.doc.paid_from_account_currency != company_currency);
 
 		frm.toggle_display("base_received_amount", (frm.doc.paid_to_account_currency != company_currency &&
 			frm.doc.paid_from_account_currency != frm.doc.paid_to_account_currency));
 
-		frm.toggle_display("received_amount",
-			frm.doc.paid_from_account_currency != frm.doc.paid_to_account_currency)
+		frm.toggle_display("received_amount", (frm.doc.payment_type=="Internal Transfer" ||
+			frm.doc.paid_from_account_currency != frm.doc.paid_to_account_currency))
 
 		frm.toggle_display(["base_total_allocated_amount"],
 			(frm.doc.paid_amount && frm.doc.received_amount && frm.doc.base_total_allocated_amount &&
@@ -601,9 +601,17 @@
 		if(frm.doc.party) {
 			var party_amount = frm.doc.payment_type=="Receive" ?
 				frm.doc.paid_amount : frm.doc.received_amount;
+				
+			var total_deductions = frappe.utils.sum($.map(frm.doc.deductions || [],
+				function(d) { return flt(d.amount) }));
 
-			if(frm.doc.total_allocated_amount < party_amount)
-				unallocated_amount = party_amount - frm.doc.total_allocated_amount;
+			if(frm.doc.total_allocated_amount < party_amount) {
+				if(frm.doc.payment_type == "Receive") {
+					unallocated_amount = party_amount - (frm.doc.total_allocated_amount - total_deductions);
+				} else {
+					unallocated_amount = party_amount - (frm.doc.total_allocated_amount + total_deductions);
+				}
+			}
 		}
 		frm.set_value("unallocated_amount", unallocated_amount);
 
diff --git a/erpnext/accounts/doctype/payment_entry/payment_entry.py b/erpnext/accounts/doctype/payment_entry/payment_entry.py
index 175ebda..c5cf092 100644
--- a/erpnext/accounts/doctype/payment_entry/payment_entry.py
+++ b/erpnext/accounts/doctype/payment_entry/payment_entry.py
@@ -247,8 +247,13 @@
 		if self.party:
 			party_amount = self.paid_amount if self.payment_type=="Receive" else self.received_amount
 			
+			total_deductions = sum([flt(d.amount) for d in self.get("deductions")])
+			
 			if self.total_allocated_amount < party_amount:
-				self.unallocated_amount = party_amount - self.total_allocated_amount
+				if self.payment_type == "Receive":
+					self.unallocated_amount = party_amount - (self.total_allocated_amount - total_deductions)
+				else:
+					self.unallocated_amount = party_amount - (self.total_allocated_amount + total_deductions)
 				
 	def set_difference_amount(self):
 		base_unallocated_amount = flt(self.unallocated_amount) * (flt(self.source_exchange_rate) 
diff --git a/erpnext/accounts/doctype/pos_profile/pos_profile.json b/erpnext/accounts/doctype/pos_profile/pos_profile.json
index a7e49dd..cb637d2 100644
--- a/erpnext/accounts/doctype/pos_profile/pos_profile.json
+++ b/erpnext/accounts/doctype/pos_profile/pos_profile.json
@@ -8,6 +8,7 @@
  "custom": 0, 
  "docstatus": 0, 
  "doctype": "DocType", 
+ "editable_grid": 0, 
  "fields": [
   {
    "allow_on_submit": 0, 
@@ -832,7 +833,7 @@
  "issingle": 0, 
  "istable": 0, 
  "max_attachments": 0, 
- "modified": "2016-06-13 21:20:13.805101", 
+ "modified": "2016-08-06 17:05:59.990031", 
  "modified_by": "Administrator", 
  "module": "Accounts", 
  "name": "POS Profile", 
@@ -879,7 +880,7 @@
    "write": 0
   }
  ], 
- "quick_entry": 1, 
+ "quick_entry": 0, 
  "read_only": 0, 
  "read_only_onload": 0, 
  "sort_field": "modified", 
diff --git a/erpnext/accounts/doctype/sales_invoice/pos.py b/erpnext/accounts/doctype/sales_invoice/pos.py
index 9f64e07..53144cb 100644
--- a/erpnext/accounts/doctype/sales_invoice/pos.py
+++ b/erpnext/accounts/doctype/sales_invoice/pos.py
@@ -91,7 +91,7 @@
 
 def get_mode_of_payment(doc):
 	return frappe.db.sql(""" select mpa.default_account, mpa.parent, mp.type as type from `tabMode of Payment Account` mpa,
-		 `tabMode of Payment` mp where mpa.parent = mp.name and company = %(company)s""", {'company': doc.company}, as_dict=1)
+		 `tabMode of Payment` mp where mpa.parent = mp.name and mpa.company = %(company)s""", {'company': doc.company}, as_dict=1)
 
 def update_tax_table(doc):
 	taxes = get_taxes_and_charges('Sales Taxes and Charges Template', doc.taxes_and_charges)
@@ -108,13 +108,14 @@
 
 		item.price_list_rate = frappe.db.get_value('Item Price', {'item_code': item.name,
 									'price_list': doc.selling_price_list}, 'price_list_rate') or 0
-		item.default_warehouse = pos_profile.get('warehouse') or item.default_warehouse or None
+		item.default_warehouse = pos_profile.get('warehouse') or \
+			get_item_warehouse_for_company(doc.company, item.default_warehouse) or None
 		item.expense_account = pos_profile.get('expense_account') or item.expense_account
 		item.income_account = pos_profile.get('income_account') or item_doc.income_account
 		item.cost_center = pos_profile.get('cost_center') or item_doc.selling_cost_center
 		item.actual_qty = frappe.db.get_value('Bin', {'item_code': item.name,
 								'warehouse': item.default_warehouse}, 'actual_qty') or 0
-		item.serial_nos = get_serial_nos(item, pos_profile)
+		item.serial_nos = get_serial_nos(item, pos_profile, doc.company)
 		item.batch_nos = frappe.db.sql_list("""select name from `tabBatch` where ifnull(expiry_date, '4000-10-10') > curdate()
 			and item = %(item_code)s""", {'item_code': item.item_code})
 
@@ -122,13 +123,19 @@
 
 	return item_list
 
-def get_serial_nos(item, pos_profile):
+def get_item_warehouse_for_company(company, warehouse):
+	if frappe.db.get_value('Warehouse', warehouse, 'company') != company:
+		warehouse = None
+	return warehouse
+
+def get_serial_nos(item, pos_profile, company):
 	cond = "1=1"
 	if pos_profile.get('update_stock') and pos_profile.get('warehouse'):
 		cond = "warehouse = '{0}'".format(pos_profile.get('warehouse'))
 
 	serial_nos = frappe.db.sql("""select name, warehouse from `tabSerial No` where {0}
-				and item_code = %(item_code)s""".format(cond), {'item_code': item.item_code}, as_dict=1)
+				and item_code = %(item_code)s and company = %(company)s
+				""".format(cond), {'item_code': item.item_code, 'company': company}, as_dict=1)
 
 	serial_no_list = {}
 	for serial_no in serial_nos:
@@ -214,9 +221,9 @@
 		save_invoice(e, si_doc, name)
 
 def save_invoice(e, si_doc, name):
-		si_doc.docstatus = 0
-		si_doc.name = ''
-		si_doc.save(ignore_permissions=True)
+	if not frappe.db.exists('Sales Invoice', {'offline_pos_name': name}):
+		si_doc.flags.ignore_mandatory = True
+		si_doc.insert()
 		make_scheduler_log(e, si_doc.name)
 
 def make_scheduler_log(e, sales_invoice):
diff --git a/erpnext/accounts/page/pos/pos.js b/erpnext/accounts/page/pos/pos.js
index 1830103..8444dbe 100644
--- a/erpnext/accounts/page/pos/pos.js
+++ b/erpnext/accounts/page/pos/pos.js
@@ -177,6 +177,7 @@
 		doc = JSON.parse(localStorage.getItem('doc'))
 		if(this.frm.doc.payments.length == 0){
 			this.frm.doc.payments = doc.payments;
+			this.calculate_outstanding_amount();
 		}
 
 		if(this.frm.doc.customer){
@@ -869,6 +870,7 @@
 				for(key in data){
 					if(data[key].docstatus == 1 && index < 50){
 						index++
+						data[key].docstatus = 0;
 						return data
 					}
 				}
diff --git a/erpnext/accounts/report/accounts_receivable/accounts_receivable.py b/erpnext/accounts/report/accounts_receivable/accounts_receivable.py
index 3a594c8..843937f 100644
--- a/erpnext/accounts/report/accounts_receivable/accounts_receivable.py
+++ b/erpnext/accounts/report/accounts_receivable/accounts_receivable.py
@@ -52,10 +52,10 @@
 		if not "range3" in self.filters:
 			self.filters["range3"] = "90"
 			
-		for label in ("0-{range1}".format(**self.filters),
-			"{range1}-{range2}".format(**self.filters),
-			"{range2}-{range3}".format(**self.filters),
-			"{range3}-{above}".format(range3=self.filters.range3, above=_("Above"))):
+		for label in ("0-{range1}".format(range1=self.filters["range1"]),
+			"{range1}-{range2}".format(range1=self.filters["range1"]+1, range2=self.filters["range2"]),
+			"{range2}-{range3}".format(range2=self.filters["range2"]+1, range3=self.filters["range3"]),
+			"{range3}-{above}".format(range3=self.filters["range3"] + 1, above=_("Above"))):
 				columns.append({
 					"label": label,
 					"fieldtype": "Currency",
diff --git a/erpnext/buying/doctype/request_for_quotation/request_for_quotation.js b/erpnext/buying/doctype/request_for_quotation/request_for_quotation.js
index 5eafb81..d126eb0 100644
--- a/erpnext/buying/doctype/request_for_quotation/request_for_quotation.js
+++ b/erpnext/buying/doctype/request_for_quotation/request_for_quotation.js
@@ -30,7 +30,7 @@
 	},
 
 	onload: function(frm) {
-		frm.add_fetch('standard_reply', 'response', 'response');
+		frm.add_fetch('standard_reply', 'response', 'message_for_supplier');
 
 		if(!frm.doc.message_for_supplier) {
 			frm.set_value("message_for_supplier", __("Please supply the specified items at the best possible rates"))
diff --git a/erpnext/buying/doctype/request_for_quotation/request_for_quotation.json b/erpnext/buying/doctype/request_for_quotation/request_for_quotation.json
index 2ce5c5c..e48e1dc 100644
--- a/erpnext/buying/doctype/request_for_quotation/request_for_quotation.json
+++ b/erpnext/buying/doctype/request_for_quotation/request_for_quotation.json
@@ -9,6 +9,7 @@
  "docstatus": 0, 
  "doctype": "DocType", 
  "document_type": "Document", 
+ "editable_grid": 0, 
  "fields": [
   {
    "allow_on_submit": 0, 
@@ -296,7 +297,7 @@
    "options": "Standard Reply", 
    "permlevel": 0, 
    "precision": "", 
-   "print_hide": 0, 
+   "print_hide": 1, 
    "print_hide_if_no_value": 0, 
    "read_only": 0, 
    "report_hide": 0, 
@@ -638,7 +639,7 @@
  "issingle": 0, 
  "istable": 0, 
  "max_attachments": 0, 
- "modified": "2016-06-30 01:57:49.233065", 
+ "modified": "2016-08-01 08:45:39.777405", 
  "modified_by": "Administrator", 
  "module": "Buying", 
  "name": "Request for Quotation", 
diff --git a/erpnext/config/docs.py b/erpnext/config/docs.py
index 07d14b6..d1a54e8 100644
--- a/erpnext/config/docs.py
+++ b/erpnext/config/docs.py
@@ -12,7 +12,7 @@
 to extend ERPNext functionality.
 
 ERPNext is Open Source under the GNU General Public Licence v3 and has been
-listed as one of the Best Open Source Softwares in the world by my online
+listed as one of the Best Open Source Softwares in the world by many online
 blogs."""
 
 docs_version = "6.x.x"
diff --git a/erpnext/docs/assets/img/accounts/opening-2.png b/erpnext/docs/assets/img/accounts/opening-2.png
new file mode 100644
index 0000000..866e351
--- /dev/null
+++ b/erpnext/docs/assets/img/accounts/opening-2.png
Binary files differ
diff --git a/erpnext/docs/assets/img/accounts/opening-3.png b/erpnext/docs/assets/img/accounts/opening-3.png
new file mode 100644
index 0000000..18dcf18
--- /dev/null
+++ b/erpnext/docs/assets/img/accounts/opening-3.png
Binary files differ
diff --git a/erpnext/docs/assets/img/accounts/opening-4.png b/erpnext/docs/assets/img/accounts/opening-4.png
new file mode 100644
index 0000000..f9ac607
--- /dev/null
+++ b/erpnext/docs/assets/img/accounts/opening-4.png
Binary files differ
diff --git a/erpnext/docs/assets/img/accounts/opening-5.png b/erpnext/docs/assets/img/accounts/opening-5.png
new file mode 100644
index 0000000..3722fd1
--- /dev/null
+++ b/erpnext/docs/assets/img/accounts/opening-5.png
Binary files differ
diff --git a/erpnext/docs/assets/img/accounts/opening-6.png b/erpnext/docs/assets/img/accounts/opening-6.png
new file mode 100644
index 0000000..52b08f7
--- /dev/null
+++ b/erpnext/docs/assets/img/accounts/opening-6.png
Binary files differ
diff --git a/erpnext/docs/assets/img/accounts/opening-7.png b/erpnext/docs/assets/img/accounts/opening-7.png
new file mode 100644
index 0000000..9a63504
--- /dev/null
+++ b/erpnext/docs/assets/img/accounts/opening-7.png
Binary files differ
diff --git a/erpnext/docs/assets/img/accounts/perpetual-1.png b/erpnext/docs/assets/img/accounts/perpetual-1.png
new file mode 100644
index 0000000..d9e9342
--- /dev/null
+++ b/erpnext/docs/assets/img/accounts/perpetual-1.png
Binary files differ
diff --git a/erpnext/docs/assets/img/collaboration-tools/__init__.py b/erpnext/docs/assets/img/collaboration-tools/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/erpnext/docs/assets/img/collaboration-tools/__init__.py
diff --git a/erpnext/docs/assets/img/collaboration-tools/assign-1.png b/erpnext/docs/assets/img/collaboration-tools/assign-1.png
new file mode 100644
index 0000000..3dc6e1b
--- /dev/null
+++ b/erpnext/docs/assets/img/collaboration-tools/assign-1.png
Binary files differ
diff --git a/erpnext/docs/assets/img/collaboration-tools/assign-2.png b/erpnext/docs/assets/img/collaboration-tools/assign-2.png
new file mode 100644
index 0000000..51148e5
--- /dev/null
+++ b/erpnext/docs/assets/img/collaboration-tools/assign-2.png
Binary files differ
diff --git a/erpnext/docs/assets/img/collaboration-tools/assign-3.png b/erpnext/docs/assets/img/collaboration-tools/assign-3.png
new file mode 100644
index 0000000..767f421
--- /dev/null
+++ b/erpnext/docs/assets/img/collaboration-tools/assign-3.png
Binary files differ
diff --git a/erpnext/docs/assets/img/collaboration-tools/assign-4.png b/erpnext/docs/assets/img/collaboration-tools/assign-4.png
new file mode 100644
index 0000000..ff0b650
--- /dev/null
+++ b/erpnext/docs/assets/img/collaboration-tools/assign-4.png
Binary files differ
diff --git a/erpnext/docs/assets/img/collaboration-tools/calendar-1.png b/erpnext/docs/assets/img/collaboration-tools/calendar-1.png
new file mode 100644
index 0000000..2c8da07
--- /dev/null
+++ b/erpnext/docs/assets/img/collaboration-tools/calendar-1.png
Binary files differ
diff --git a/erpnext/docs/assets/img/collaboration-tools/calendar-2.gif b/erpnext/docs/assets/img/collaboration-tools/calendar-2.gif
new file mode 100644
index 0000000..8d224ad
--- /dev/null
+++ b/erpnext/docs/assets/img/collaboration-tools/calendar-2.gif
Binary files differ
diff --git a/erpnext/docs/assets/img/collaboration-tools/calendar-3.png b/erpnext/docs/assets/img/collaboration-tools/calendar-3.png
new file mode 100644
index 0000000..02c6bf4
--- /dev/null
+++ b/erpnext/docs/assets/img/collaboration-tools/calendar-3.png
Binary files differ
diff --git a/erpnext/docs/assets/img/collaboration-tools/calendar-4.png b/erpnext/docs/assets/img/collaboration-tools/calendar-4.png
new file mode 100644
index 0000000..da0fb67
--- /dev/null
+++ b/erpnext/docs/assets/img/collaboration-tools/calendar-4.png
Binary files differ
diff --git a/erpnext/docs/assets/img/collaboration-tools/calendar-5.png b/erpnext/docs/assets/img/collaboration-tools/calendar-5.png
new file mode 100644
index 0000000..df8346e
--- /dev/null
+++ b/erpnext/docs/assets/img/collaboration-tools/calendar-5.png
Binary files differ
diff --git a/erpnext/docs/assets/img/collaboration-tools/calendar-6.png b/erpnext/docs/assets/img/collaboration-tools/calendar-6.png
new file mode 100644
index 0000000..d59eeb6
--- /dev/null
+++ b/erpnext/docs/assets/img/collaboration-tools/calendar-6.png
Binary files differ
diff --git a/erpnext/docs/assets/img/collaboration-tools/calendar-7.png b/erpnext/docs/assets/img/collaboration-tools/calendar-7.png
new file mode 100644
index 0000000..ac7a93c
--- /dev/null
+++ b/erpnext/docs/assets/img/collaboration-tools/calendar-7.png
Binary files differ
diff --git a/erpnext/docs/assets/img/collaboration-tools/chat-1.png b/erpnext/docs/assets/img/collaboration-tools/chat-1.png
new file mode 100644
index 0000000..addc145
--- /dev/null
+++ b/erpnext/docs/assets/img/collaboration-tools/chat-1.png
Binary files differ
diff --git a/erpnext/docs/assets/img/collaboration-tools/chat-2.png b/erpnext/docs/assets/img/collaboration-tools/chat-2.png
new file mode 100644
index 0000000..c560596
--- /dev/null
+++ b/erpnext/docs/assets/img/collaboration-tools/chat-2.png
Binary files differ
diff --git a/erpnext/docs/assets/img/collaboration-tools/comments-1.png b/erpnext/docs/assets/img/collaboration-tools/comments-1.png
new file mode 100644
index 0000000..826fe90
--- /dev/null
+++ b/erpnext/docs/assets/img/collaboration-tools/comments-1.png
Binary files differ
diff --git a/erpnext/docs/assets/img/collaboration-tools/note-1.png b/erpnext/docs/assets/img/collaboration-tools/note-1.png
new file mode 100644
index 0000000..ab61672
--- /dev/null
+++ b/erpnext/docs/assets/img/collaboration-tools/note-1.png
Binary files differ
diff --git a/erpnext/docs/assets/img/collaboration-tools/share-1.gif b/erpnext/docs/assets/img/collaboration-tools/share-1.gif
new file mode 100644
index 0000000..94fe84f
--- /dev/null
+++ b/erpnext/docs/assets/img/collaboration-tools/share-1.gif
Binary files differ
diff --git a/erpnext/docs/assets/img/collaboration-tools/tags-1.png b/erpnext/docs/assets/img/collaboration-tools/tags-1.png
new file mode 100644
index 0000000..0adaf30
--- /dev/null
+++ b/erpnext/docs/assets/img/collaboration-tools/tags-1.png
Binary files differ
diff --git a/erpnext/docs/assets/img/collaboration-tools/tags-2.png b/erpnext/docs/assets/img/collaboration-tools/tags-2.png
new file mode 100644
index 0000000..f635ed6
--- /dev/null
+++ b/erpnext/docs/assets/img/collaboration-tools/tags-2.png
Binary files differ
diff --git a/erpnext/docs/assets/old_images/erpnext/accounting-for-stock-1.png b/erpnext/docs/assets/old_images/erpnext/accounting-for-stock-1.png
deleted file mode 100644
index 462c3f1..0000000
--- a/erpnext/docs/assets/old_images/erpnext/accounting-for-stock-1.png
+++ /dev/null
Binary files differ
diff --git a/erpnext/docs/assets/old_images/erpnext/assets-1.png b/erpnext/docs/assets/old_images/erpnext/assets-1.png
deleted file mode 100644
index 19b3328..0000000
--- a/erpnext/docs/assets/old_images/erpnext/assets-1.png
+++ /dev/null
Binary files differ
diff --git a/erpnext/docs/assets/old_images/erpnext/assets-2.png b/erpnext/docs/assets/old_images/erpnext/assets-2.png
deleted file mode 100644
index f0b0262..0000000
--- a/erpnext/docs/assets/old_images/erpnext/assets-2.png
+++ /dev/null
Binary files differ
diff --git a/erpnext/docs/assets/old_images/erpnext/assets-3.png b/erpnext/docs/assets/old_images/erpnext/assets-3.png
deleted file mode 100644
index fd0a9a5..0000000
--- a/erpnext/docs/assets/old_images/erpnext/assets-3.png
+++ /dev/null
Binary files differ
diff --git a/erpnext/docs/assets/old_images/erpnext/assets-4.png b/erpnext/docs/assets/old_images/erpnext/assets-4.png
deleted file mode 100644
index 4727484..0000000
--- a/erpnext/docs/assets/old_images/erpnext/assets-4.png
+++ /dev/null
Binary files differ
diff --git a/erpnext/docs/assets/old_images/erpnext/assets-5.png b/erpnext/docs/assets/old_images/erpnext/assets-5.png
deleted file mode 100644
index 8beaa57..0000000
--- a/erpnext/docs/assets/old_images/erpnext/assets-5.png
+++ /dev/null
Binary files differ
diff --git a/erpnext/docs/assets/old_images/erpnext/assign-remove.png b/erpnext/docs/assets/old_images/erpnext/assign-remove.png
deleted file mode 100644
index 2973ec0..0000000
--- a/erpnext/docs/assets/old_images/erpnext/assign-remove.png
+++ /dev/null
Binary files differ
diff --git a/erpnext/docs/assets/old_images/erpnext/assign-todo.png b/erpnext/docs/assets/old_images/erpnext/assign-todo.png
deleted file mode 100644
index c63b943..0000000
--- a/erpnext/docs/assets/old_images/erpnext/assign-todo.png
+++ /dev/null
Binary files differ
diff --git a/erpnext/docs/assets/old_images/erpnext/assign-user.png b/erpnext/docs/assets/old_images/erpnext/assign-user.png
deleted file mode 100644
index 4a34fe8..0000000
--- a/erpnext/docs/assets/old_images/erpnext/assign-user.png
+++ /dev/null
Binary files differ
diff --git a/erpnext/docs/assets/old_images/erpnext/assigned-to-icon.png b/erpnext/docs/assets/old_images/erpnext/assigned-to-icon.png
deleted file mode 100644
index 9604a02..0000000
--- a/erpnext/docs/assets/old_images/erpnext/assigned-to-icon.png
+++ /dev/null
Binary files differ
diff --git a/erpnext/docs/assets/old_images/erpnext/assigned-to.png b/erpnext/docs/assets/old_images/erpnext/assigned-to.png
deleted file mode 100644
index 01a3875..0000000
--- a/erpnext/docs/assets/old_images/erpnext/assigned-to.png
+++ /dev/null
Binary files differ
diff --git a/erpnext/docs/assets/old_images/erpnext/calender-email-digest.png b/erpnext/docs/assets/old_images/erpnext/calender-email-digest.png
deleted file mode 100644
index 4d7a6cb..0000000
--- a/erpnext/docs/assets/old_images/erpnext/calender-email-digest.png
+++ /dev/null
Binary files differ
diff --git a/erpnext/docs/assets/old_images/erpnext/calender-event-lead.png b/erpnext/docs/assets/old_images/erpnext/calender-event-lead.png
deleted file mode 100644
index ff04fb4..0000000
--- a/erpnext/docs/assets/old_images/erpnext/calender-event-lead.png
+++ /dev/null
Binary files differ
diff --git a/erpnext/docs/assets/old_images/erpnext/calender-event-manually.png b/erpnext/docs/assets/old_images/erpnext/calender-event-manually.png
deleted file mode 100644
index 0174f52..0000000
--- a/erpnext/docs/assets/old_images/erpnext/calender-event-manually.png
+++ /dev/null
Binary files differ
diff --git a/erpnext/docs/assets/old_images/erpnext/calender-event-notification.png b/erpnext/docs/assets/old_images/erpnext/calender-event-notification.png
deleted file mode 100644
index c86c5f5..0000000
--- a/erpnext/docs/assets/old_images/erpnext/calender-event-notification.png
+++ /dev/null
Binary files differ
diff --git a/erpnext/docs/assets/old_images/erpnext/calender-event-permission.png b/erpnext/docs/assets/old_images/erpnext/calender-event-permission.png
deleted file mode 100644
index f5b21f1..0000000
--- a/erpnext/docs/assets/old_images/erpnext/calender-event-permission.png
+++ /dev/null
Binary files differ
diff --git a/erpnext/docs/assets/old_images/erpnext/calender-event-recurring.png b/erpnext/docs/assets/old_images/erpnext/calender-event-recurring.png
deleted file mode 100644
index 174f154..0000000
--- a/erpnext/docs/assets/old_images/erpnext/calender-event-recurring.png
+++ /dev/null
Binary files differ
diff --git a/erpnext/docs/assets/old_images/erpnext/forms.png b/erpnext/docs/assets/old_images/erpnext/forms.png
deleted file mode 100644
index 0c4af1a..0000000
--- a/erpnext/docs/assets/old_images/erpnext/forms.png
+++ /dev/null
Binary files differ
diff --git a/erpnext/docs/assets/old_images/erpnext/image-temp-opening.png b/erpnext/docs/assets/old_images/erpnext/image-temp-opening.png
deleted file mode 100644
index 52d0d5a..0000000
--- a/erpnext/docs/assets/old_images/erpnext/image-temp-opening.png
+++ /dev/null
Binary files differ
diff --git a/erpnext/docs/assets/old_images/erpnext/message-list.png b/erpnext/docs/assets/old_images/erpnext/message-list.png
deleted file mode 100644
index e5034a5..0000000
--- a/erpnext/docs/assets/old_images/erpnext/message-list.png
+++ /dev/null
Binary files differ
diff --git a/erpnext/docs/assets/old_images/erpnext/message-to.png b/erpnext/docs/assets/old_images/erpnext/message-to.png
deleted file mode 100644
index ecd75b4..0000000
--- a/erpnext/docs/assets/old_images/erpnext/message-to.png
+++ /dev/null
Binary files differ
diff --git a/erpnext/docs/assets/old_images/erpnext/note-permission.png b/erpnext/docs/assets/old_images/erpnext/note-permission.png
deleted file mode 100644
index a3cbc25..0000000
--- a/erpnext/docs/assets/old_images/erpnext/note-permission.png
+++ /dev/null
Binary files differ
diff --git a/erpnext/docs/assets/old_images/erpnext/note.png b/erpnext/docs/assets/old_images/erpnext/note.png
deleted file mode 100644
index 58bc180..0000000
--- a/erpnext/docs/assets/old_images/erpnext/note.png
+++ /dev/null
Binary files differ
diff --git a/erpnext/docs/assets/old_images/erpnext/opening-entry-2.png b/erpnext/docs/assets/old_images/erpnext/opening-entry-2.png
deleted file mode 100644
index 57e0fb3..0000000
--- a/erpnext/docs/assets/old_images/erpnext/opening-entry-2.png
+++ /dev/null
Binary files differ
diff --git a/erpnext/docs/assets/old_images/erpnext/tags-in-list.png b/erpnext/docs/assets/old_images/erpnext/tags-in-list.png
deleted file mode 100644
index 257ab5f..0000000
--- a/erpnext/docs/assets/old_images/erpnext/tags-in-list.png
+++ /dev/null
Binary files differ
diff --git a/erpnext/docs/assets/old_images/erpnext/todo-close.png b/erpnext/docs/assets/old_images/erpnext/todo-close.png
deleted file mode 100644
index 5ef0b2a..0000000
--- a/erpnext/docs/assets/old_images/erpnext/todo-close.png
+++ /dev/null
Binary files differ
diff --git a/erpnext/docs/assets/old_images/erpnext/todo-list.png b/erpnext/docs/assets/old_images/erpnext/todo-list.png
deleted file mode 100644
index fc65ced..0000000
--- a/erpnext/docs/assets/old_images/erpnext/todo-list.png
+++ /dev/null
Binary files differ
diff --git a/erpnext/docs/assets/old_images/erpnext/trial-balance-1.png b/erpnext/docs/assets/old_images/erpnext/trial-balance-1.png
deleted file mode 100644
index a4322e9..0000000
--- a/erpnext/docs/assets/old_images/erpnext/trial-balance-1.png
+++ /dev/null
Binary files differ
diff --git a/erpnext/docs/index.html b/erpnext/docs/index.html
index 99ef849..c0f9228 100644
--- a/erpnext/docs/index.html
+++ b/erpnext/docs/index.html
@@ -38,7 +38,7 @@
 to extend ERPNext functionality.</p>
 
 <p>ERPNext is Open Source under the GNU General Public Licence v3 and has been
-listed as one of the Best Open Source Softwares in the world by my online
+listed as one of the Best Open Source Softwares in the world by many online
 blogs.</p>
 
   </div>
diff --git a/erpnext/docs/user/manual/en/accounts/index.txt b/erpnext/docs/user/manual/en/accounts/index.txt
index f06bb19..d7c405a 100644
--- a/erpnext/docs/user/manual/en/accounts/index.txt
+++ b/erpnext/docs/user/manual/en/accounts/index.txt
@@ -1,21 +1,19 @@
-journal-entry
-sales-invoice
-purchase-invoice
-payment-request
 chart-of-accounts
+opening-accounts
+sales-invoice
+point-of-sale-pos-invoice
+purchase-invoice
+journal-entry
 payment-entry
+multi-currency-accounting
 advance-payment-entry
 payment-request
 credit-limit
-opening-entry
 accounting-reports
 accounting-entries
 managing-fixed-assets
 budgeting
-opening-accounts
-item-wise-tax
-point-of-sale-pos-invoice
-multi-currency-accounting
+item-wise-taxation
 recurring-orders-and-invoices
 pricing-rule
 tools
diff --git a/erpnext/docs/user/manual/en/accounts/item-wise-tax.md b/erpnext/docs/user/manual/en/accounts/item-wise-taxation.md
similarity index 99%
rename from erpnext/docs/user/manual/en/accounts/item-wise-tax.md
rename to erpnext/docs/user/manual/en/accounts/item-wise-taxation.md
index 8c1fc86..bc51de9 100644
--- a/erpnext/docs/user/manual/en/accounts/item-wise-tax.md
+++ b/erpnext/docs/user/manual/en/accounts/item-wise-taxation.md
@@ -1,4 +1,3 @@
-
 Taxes selected in the Tax and Other Charges in transactions are applied on all the items. If you need different taxes applied on items selected in the same transaction, you should setup you item and tax master as explained in the steps below.
 
 ####Step 1: Mention Tax Applicable in the Item master
diff --git a/erpnext/docs/user/manual/en/accounts/opening-accounts.md b/erpnext/docs/user/manual/en/accounts/opening-accounts.md
index fc86cdd..11e4acb 100644
--- a/erpnext/docs/user/manual/en/accounts/opening-accounts.md
+++ b/erpnext/docs/user/manual/en/accounts/opening-accounts.md
@@ -1,82 +1,99 @@
-	Now that you have completed most of the setup, its time to start moving in!
+#Updating Opening Balance in Accounts
 
-There are two important sets of data you need to enter before you start your
-operations.
+If you are a new company you can start using ERPNext accounting module by going to chart of accounts. However, if you are migrating from a legacy accounting system like Tally or a Fox Pro based software
 
-  * Opening Account balances.
-  * Opening Stock balances.
+We recommend that you start using accounting in a new financial year, but you could start midway too. To setup your accounts, you will need the following for the “day” you start using accounting in ERPNext:
 
-To setup your accounts and stock correctly you will need accurate data to work
-with. Make sure you have the data setup for this.
+* Opening capital accounts - like your shareholder’s (or owner’) capital, loans, bank balances on that day.
 
-### Opening Accounts
+* List of outstanding sales and purchase invoices (Payables and Receivables).
 
-We usually recommend that you start using accounting in a new financial year,
-but you could start midway too. To setup your accounts, you will need the
-following for the “day” you start using accounting in ERPNext:
+If you were using another accounting software before, firstly you should close financial statements in that software. The closing balance of the accounts should be updated as an opening balance in the ERPNext. Before starting to update opening balance, ensure that your [Chart of Accounts]({{docs_base_url}}/user/manual/en/accounts/chart-of-accounts.html) has all the Accounts required.
 
-Opening capital accounts - like your shareholder’s (or owner’) capital, loans,
-bank balances on that day. List of outstanding sales and purchase invoices
-(Payables and Receivables).
+> Opening entry is only for Balance Sheet accounts and not for the Accounts in the Profit and Loss statement.
 
-Based on Voucher Type
+  * For all assets (excluding Accounts Receivables): This entry will contain all your assets except the amounts you are expecting from your Customers against outstanding Sales Invoices. You will have to update your receivables by making an individual entry for each Invoice (this is because, the system will help you track the invoices which are yet to be paid). You can credit the sum of all these debits against the **Temporary Opening** account.
+  
+  * For all liabilities: Similarly you need to pass a Journal Entry for your Opening Liabilities (except for the bills you have to pay) against **Temporary Opening** account.
 
-You can select accounts based on the voucher type. In such a scenario, your balance sheet should be balanced.
+###Opening Entry
+
+####Step 1: New Journal Entry
+
+To open new Journal Entry, go to:
+
+`Explore > Accounts > Journal Entry`
+
+####Step 2: Entry Type
+
+If Entry Type is selected as Opening Entry, all the Balance Sheet Accounts will be auto-fetched in the Journal Entry.
 
 <img class="screenshot" alt="Opening Account" src="{{docs_base_url}}/assets/img/accounts/opening-account-1.png">
 
- Also, note that if there are more than 300 ledgers, the system will crash. Thus to avoid such a situation, you can open accounts by using temporary accounts.
+####Step 3: Posting Date
 
-#### Temporary Accounts
+Select Posting Date on which Accounts Opening Balance will be updated.
 
-A nice way to simplify opening is to use a temporary account just for opening. These accounts will become zero once all your old invoices and opening balances of bank, debt stock etc are entered. In the standard chart of accounts, a **Temporary Opening** account is created under assets
+####Step 4: Enter Debit/Credit Value
 
-#### The Opening Entry
+For each Account, enter opening value in the Debit or Credit column. As per the double entry valuation system, Total Debit value in a entry must be equal to Total Credit value.
 
-In ERPNext Opening Accounts are setup by submitting a special Journal Entries
-(Journal Entry).
+<img class="screenshot" alt="Opening Account" src="{{docs_base_url}}/assets/img/accounts/opening-6.png">
 
-Note: Make sure to set “Is Opening” as “Yes” in the More Info section.
+####Step 5: Is Opening
 
-> Setup > Opening Accounts and Stock > Opening Accounting Entries.
+Set field `Is Opening` as `Yes`.
 
-Complete Journal Entries on the Debit and Credit side.
+<img class="screenshot" alt="Opening Account" src="{{docs_base_url}}/assets/img/accounts/opening-3.png">
 
-![Opening Entry]({{docs_base_url}}/assets/old_images/erpnext/opening-entry-1.png)
+####Step 6: Save and Submit
 
- To update opening balance is to make Journal Entry for an individual/group of accounts.
+After enter opening balance for each account, Save and Submit Journal Entry. To check if Opening Balance for an account is updated correctly, you can check Trial Balance report.
 
-For example, if you want to update balance in three bank accounts, then make Journal Entrys in this manner.
+###Selecting Accounts Manually
 
-![Opening Temp Entry]({{docs_base_url}}/assets/old_images/erpnext/image-temp-opening.png)
+If your Balance Sheet has many Accounts, then updating Account Opening balance from single Journal Entry can lead to performance issues. In such a scenario, you can multiple Journal Entries to update opening balance in all the Accounts.
 
-![Opening Entry]({{docs_base_url}}/assets/old_images/erpnext/opening-entry-2.png)
+If you are updating account opening balance in few accounts at a time, you can use **Temporary Opening** account for balancing purpose. In the standard chart of accounts, a Temporary Opening Account is auto-created under Assets.
 
-Temporary Asset and Liability account is used for balancing purpose. When you update opening balance in Liability Account, you can use Temporary Asset Account for balancing.
+<img class="screenshot" alt="Opening Account" src="{{docs_base_url}}/assets/img/accounts/opening-7.png">
 
-This way, you can update opening balance in Asset and Liability accounts.
+In the Journal Entry, manually select an Account for which opening balance is to be updated. For each Account, enter opening balance value in the Debit or Credit column, based on it's Account Type (Asset or Liability).
 
-You can make two Opening Journal Entrys:
+For example, if you want to update balance in bank accounts, create Journal Entry as following.
 
-  * For all assets (excluding Accounts Receivables): This entry will contain all your assets except the amounts you are expecting from your Customers against outstanding Sales Invoices. You will have to update your receivables by making an individual entry for each Invoice (this is because, the system will help you track the invoices which are yet to be paid). You can credit the sum of all these debits against the **Temporary Opening** account.
-  * For all liabilities: Similarly you need to pass a Journal Entry for your Opening Liabilities (except for the bills you have to pay) against **Temporary Opening** account.
-  * In this method you can update opening balance of specific balancesheet accounts and not for all.
-  * Opening entry is only for balance sheet accounts and not for expense or Income accounts.
+<img class="screenshot" alt="Opening Account" src="{{docs_base_url}}/assets/img/accounts/opening-2.png">
+
+Once all your invoices are entered, your **Temporary Opening** account will have a balance of zero!
+
+###Trial Balance
 
 After completing the accounting entries, the trial balance report will look like the one given below:
 
-![Trial Balance]({{docs_base_url}}/assets/old_images/erpnext/trial-balance-1.png)
+<img class="screenshot" alt="Opening Account" src="{{docs_base_url}}/assets/img/accounts/opening-4.png">
 
-#### Outstanding Invoices
+###Stock Opening
 
-After your Opening Journal Entrys are made, you will need to enter each Sales Invoice and Purchase Invoice that is yet to be paid.
+To track stock balance in the Chart of Account, an Account is created for each Warehouse.
 
-Since you have already booked the income or expense on these invoices in the previous period, select the temp opening account **Temporary Opening** in the “Income” and “Expense” accounts.
+`Chart of Accounts > Assets > Current Asset > StocK Assets > (Warehouse Account)`
+
+<img class="screenshot" alt="Opening Account" src="{{docs_base_url}}/assets/img/accounts/opening-5.png">
+
+To update stock opening balance, create [Stock Reconciliation entry]({{docs_base_url}}/user/manual/en/stock/opening-stock.html). Based on the valuation of items's update in the Warehouse, balance will be updated in the Warehouse account.
+
+###Fixed Asset Opening
+
+Opening balance for the fixed asset account should be updated via Journal Entry. Assets which are not fully depreciated should be added in the [Asset master]({{docs_base_url}}/user/manual/en/accounts/managing-fixed-assets.html). For adding Assets in your possession, ensure to check **Is Existing Asset** field.
+
+### Outstanding Invoices
+
+After opening Journal Entries are made, you will need to enter each Sales Invoice and Purchase Invoice that is yet to be paid.
+
+Since you have already booked the income or expense on these invoices in the previous period, select **Temporary Opening** in the “Income” and “Expense” accounts.
 
 > Note: Make sure to set each invoice as “Is Opening”!
 
 If you don’t care what items are in that invoice, just make a dummy item entry in the Invoice. Item code in the Invoice is not necessary, so it should not be such a problem.
 
-Once all your invoices are entered, your **Temporary Opening** account will have a balance of zero!
-
 {next}
diff --git a/erpnext/docs/user/manual/en/accounts/opening-entry.md b/erpnext/docs/user/manual/en/accounts/opening-entry.md
deleted file mode 100644
index da0b0f9..0000000
--- a/erpnext/docs/user/manual/en/accounts/opening-entry.md
+++ /dev/null
@@ -1,7 +0,0 @@
-If you are a new company you can start using ERPNext accounting module by
-going to chart of accounts.
-
-However, if you are migrating from a legacy accounting system like Tally or a
-Fox Pro based software, please visit [Opening Entry.]({{docs_base_url}}/user/manual/en/accounts/opening-accounts.html)
-
-{next}
diff --git a/erpnext/docs/user/manual/en/accounts/point-of-sale-pos-invoice.md b/erpnext/docs/user/manual/en/accounts/point-of-sale-pos-invoice.md
index b0b6bcc..6a697b1 100644
--- a/erpnext/docs/user/manual/en/accounts/point-of-sale-pos-invoice.md
+++ b/erpnext/docs/user/manual/en/accounts/point-of-sale-pos-invoice.md
@@ -6,7 +6,7 @@
 
 ###Offline POS
 
-POS transactions are generally quick, hence should have as less dependency as possible. In ERPNext, you can create POS Invoices even when not connected to the internet.
+In the retails business, invoicing needs to done very quickly, hence should less dependency. In the ERPNext, you can create POS Invoices, even when not connected to the internet.
 
 POS Invoices created in the offline mode will be saved locally in the browser. If internet connection is lost which creating POS Invoice, you will still be able can proceed forward. Once internet connection is available again, offline invoices will be synced, and pushed onto your ERPNext account. To learn more on how POS Invoices can be created when offline, [check here.](https://frappe.io/blog/blog/erpnext-features/offline-pos-in-erpnext-7)
 
diff --git a/erpnext/docs/user/manual/en/setting-up/print/index.txt b/erpnext/docs/user/manual/en/setting-up/print/index.txt
index 59aedee..80b5946 100644
--- a/erpnext/docs/user/manual/en/setting-up/print/index.txt
+++ b/erpnext/docs/user/manual/en/setting-up/print/index.txt
@@ -4,4 +4,5 @@
 letter-head
 address-template
 terms-and-conditions
-cheque-print-template
\ No newline at end of file
+cheque-print-template
+multi-lingual-print-format
\ No newline at end of file
diff --git a/erpnext/docs/user/manual/en/setting-up/print/multi-lingual-print-format.md b/erpnext/docs/user/manual/en/setting-up/print/multi-lingual-print-format.md
new file mode 100644
index 0000000..a15834c
--- /dev/null
+++ b/erpnext/docs/user/manual/en/setting-up/print/multi-lingual-print-format.md
@@ -0,0 +1,47 @@
+#Multi-lngual Print Formats
+
+User can print the customer's and supplier's document in their local language. For an example if I have customers from germany, france who want quotation in german, french language will be possible with these feature.
+
+####Set Language
+
+In the Customer master, select default Language. Say default language for the Customer is <b>deutsch</b>.
+
+<img src="{{docs_base_url}}/assets/img/multilingual_print_format/set_customer_default_lang.png" class="screenshot">
+
+Same way, you can also set default language in the Supplier master.
+
+<img src="{{docs_base_url}}/assets/img/multilingual_print_format/set_supplier_default_lang.png" class="screenshot">
+
+####Print Preview in the Party's Language
+
+In the Print Preview of a transaction, values will be translated into party's language.
+
+Customer Quotation print preview in customer's default language.
+
+<img src="{{ docs_base_url }}/assets/img/multilingual_print_format/customer_quotation.png" class="screenshot">
+
+Supplier Quotation print preview in supplier's default language.
+
+<img src="{{ docs_base_url }}/assets/img/multilingual_print_format/supplier_quotation.png" class="screenshot">
+
+####What to do if want to print with another language?
+
+User can have option to select alternate language on print view.
+
+<img src="{{ docs_base_url }}/assets/img/multilingual_print_format/alternate_language.png" class="screenshot">
+
+####Custom Translation
+
+User can set their custom translations using translation form. For example user want to set description of the product in customer's language(Italiano). For that create new translation with language as Italiano, enter source data and Translated information.
+
+`Setup > Settings > Translation List > New`
+
+<img src="{{ docs_base_url }}/assets/img/multilingual_print_format/translation.png" class="screenshot">
+
+The translation is applied when user select language as Italiano on supplier quotation's print preview.
+
+<img src="{{ docs_base_url }}/assets/img/multilingual_print_format/custom_translation.png" class="screenshot">
+
+
+
+
diff --git a/erpnext/docs/user/manual/en/stock/accounting-of-inventory-stock/migrate-to-perpetual-inventory.md b/erpnext/docs/user/manual/en/stock/accounting-of-inventory-stock/migrate-to-perpetual-inventory.md
index ffc5f40..38ae897 100644
--- a/erpnext/docs/user/manual/en/stock/accounting-of-inventory-stock/migrate-to-perpetual-inventory.md
+++ b/erpnext/docs/user/manual/en/stock/accounting-of-inventory-stock/migrate-to-perpetual-inventory.md
@@ -1,8 +1,8 @@
-Existing Users, need to follow some steps to activate the new Perpetual
-Inventory system. As Perpetual Inventory always maintains a sync between stock
-and account balance, it is not possible to enable it with existing Warehouse
-setup. You have to create a whole new set of Warehouses, each linked to
-relevant account.
+Perpetual Inventory Valuation is activated by default in the system.
+
+For the users who are currently following periodic inventory valuation system, and wish to migrate to perpetual inventory valuation system, please follow the steps explained below.
+
+As Perpetual Inventory always maintains a sync between stock and account balance, it is not possible to enable it with existing Warehouse setup. You have to create a whole new set of Warehouses, each linked to relevant account.
 
 Steps:
 
@@ -18,21 +18,14 @@
     * Cost Center
   * Activate Perpetual Inventory
 
-> Setup > Accounts Settings > Make Accounting Entry For Every Stock Movement
-
-![Activation]({{docs_base_url}}/assets/old_images/erpnext/accounting-for-stock-1.png)  
+	`Explore > Accounts > Accounts Settings`
+	
+	<img class="screenshot" alt="Perpetual Inventory" src="{{docs_base_url}}/assets/img/accounts/perpetual-1.png">
   
 
   * Create Stock Entry (Material Transfer) to transfer available stock from existing warehouse to new warehouse. As stock will be available in the new warehouse, you should select the new warehouse for all the future transactions.
 
-System will not post any accounting entries for existing stock transactions
-submitted prior to the activation of Perpetual Inventory as those old
-warehouses will not be linked to any account. If you create any new
-transaction or modify/amend existing transactions, with old warehouse, there
-will be no corresponding accounting entries. You have to manually sync stock
-and account balance through Journal Entry.
+System will not post any accounting entries for existing stock transactions submitted prior to the activation of Perpetual Inventory as those old warehouses will not be linked to any account. If you create any new transaction or modify/amend existing transactions, with old warehouse, there will be no corresponding accounting entries. You have to manually sync stock and account balance through Journal Entry.
 
-> Note: If you are already using old Perpetual Inventory system, it will be
-deactivated automatically. You need to follow the above steps to reactivate
-it.
+> Note: If you are already using old Perpetual Inventory system, it will be deactivated automatically. You need to follow the above steps to reactivate it.
 
diff --git a/erpnext/docs/user/manual/en/stock/accounting-of-inventory-stock/perpetual-inventory.md b/erpnext/docs/user/manual/en/stock/accounting-of-inventory-stock/perpetual-inventory.md
index 80970bf..c31d1ac 100644
--- a/erpnext/docs/user/manual/en/stock/accounting-of-inventory-stock/perpetual-inventory.md
+++ b/erpnext/docs/user/manual/en/stock/accounting-of-inventory-stock/perpetual-inventory.md
@@ -19,7 +19,7 @@
     * Stock Adjustment Account
     * Expenses Included In Valuation
     * Cost Center
-  2. In perpetual inventory, the system will maintain seperate account balance for each warehouse under separate account head. To create that account head, enter "Create Account Under" in Warehouse master.
+  2. In perpetual inventory, the system will maintain separate account balance for each warehouse under separate account head. To create that account head, enter "Create Account Under" in Warehouse master.
 
   3. Activate Perpetual Inventory
 
@@ -370,4 +370,4 @@
 
 <img alt="Stock" class="screenshot" src="{{docs_base_url}}/assets/old_images/erpnext/accounting-for-stock-14.png">
 
-{ next }
\ No newline at end of file
+{next}
\ No newline at end of file
diff --git a/erpnext/docs/user/manual/en/using-erpnext/assignment.md b/erpnext/docs/user/manual/en/using-erpnext/assignment.md
index 6ecd377..72b03b7 100644
--- a/erpnext/docs/user/manual/en/using-erpnext/assignment.md
+++ b/erpnext/docs/user/manual/en/using-erpnext/assignment.md
@@ -2,7 +2,7 @@
 
 For example, if Sales Order needs to be approved/submitted by Sales Manager, first draft user can allocate that Sales Order to Sales Manager. On allocating document to Sales Manager, it will be added to that user's ToDo list. Same way, allocation can also be done to Material User and Account user who needs to create Delivery Note and Sales Invoice respectively against this Sales Note.
 
-<div class=well>Permissions restriction cannot be done based on Assigned To</div>
+<div class=well>Permissions restriction cannot be done based on Assigned To.</div>
 
 Following are the steps to assign document to another user.
 
@@ -10,30 +10,27 @@
 
 Assign to option is located at the footer of document. Clicking on Assignment Icon on the tool bar will fast-forward you to footer of same document.
 
-![Assigned To Icon]({{docs_base_url}}/assets/old_images/erpnext/assigned-to-icon.png)
-
-
-![Assigned To]({{docs_base_url}}/assets/old_images/erpnext/assigned-to.png)
+<img class="screenshot" alt="Assign" src="{{docs_base_url}}/assets/img/collaboration-tools/assign-1.png">
 
 #### Step 2: Assign to User
 
 In the Assign To section, you will find option to select User to whom this document will be assigned to. You can assign one document to multiple people at a time.
 
-![Assign User]({{docs_base_url}}/assets/old_images/erpnext/assign-user.png)
+<img class="screenshot" alt="Assign" src="{{docs_base_url}}/assets/img/collaboration-tools/assign-2.png">
 
-With assignment, you can also leave a comment for the review of asignee.
+With assignment, you can also leave a comment for the review of assignee.
 
 ####ToDo List of Assignee
 
 This transaction will appear in the To-do list of the ser in “Todo” section.
 
-![Assign Todo]({{docs_base_url}}/assets/old_images/erpnext/assign-todo.png)
+<img class="screenshot" alt="Assign" src="{{docs_base_url}}/assets/img/collaboration-tools/assign-3.png">
 
 ####Removing Assignment
 
 User will be able to remove assignment by clicking on "Assignment Completed" button in the document.
 
-![Assign Remove]({{docs_base_url}}/assets/old_images/erpnext/assign-remove.png)
+<img class="screenshot" alt="Assign" src="{{docs_base_url}}/assets/img/collaboration-tools/assign-4.png">
 
 Once assignment is set as completed, Status of its ToDo record will be set as Closed.
 
diff --git a/erpnext/docs/user/manual/en/using-erpnext/chat.md b/erpnext/docs/user/manual/en/using-erpnext/chat.md
new file mode 100644
index 0000000..ed155d8
--- /dev/null
+++ b/erpnext/docs/user/manual/en/using-erpnext/chat.md
@@ -0,0 +1,14 @@
+You can send and receive messages from the system by using the Messages tool. 
+
+`Explore > Tools > Chat`
+
+If you send a message to a user, and the user is logged in, it will appear as a popup message and the unread messages counter in the top toolbar will be
+updated.
+
+<img class="screenshot" alt="Assign" src="{{docs_base_url}}/assets/img/collaboration-tools/chat-1.png">
+
+You can choose to send message to all the users, or to specific user.
+
+<img class="screenshot" alt="Assign" src="{{docs_base_url}}/assets/img/collaboration-tools/chat-2.png">
+
+{next}
diff --git a/erpnext/docs/user/manual/en/using-erpnext/collaborating-around-forms.md b/erpnext/docs/user/manual/en/using-erpnext/collaborating-around-forms.md
index 7418d73..7ffec76 100644
--- a/erpnext/docs/user/manual/en/using-erpnext/collaborating-around-forms.md
+++ b/erpnext/docs/user/manual/en/using-erpnext/collaborating-around-forms.md
@@ -1,19 +1,24 @@
+Following are the tools in each document using which you can collaborate with other Users in your ERPNext account.
+
 ### Assigned to
 
-You can email any transaction from the system by clicking on the “Assigned to”
-button in the right sidebar. A log of all your sent emails will be maintained
-in Communication.
-
-![Forms]({{docs_base_url}}/assets/old_images/erpnext/forms.png)
+If some document requires an action from User, you can Assign that document to that User. On assignment, User to whom document is assigned is intimated via email. To learn about Assign To feature, [click here.]({{docs_base_url}}/user/manual/en/using-erpnext/assignment.html)
 
 ### Comments
 
 Comments are a great way to add information about a transaction that is not a
-part of the transactions. Like some background information etc. Comments can
-be added in the right sidebar.
+part of the transactions. Like some background information etc.
+
+<img class="screenshot" alt="Assign" src="{{docs_base_url}}/assets/img/collaboration-tools/comments-1.png">
+
+###Share
+
+You can share document with the specific User. If Document is shared with the specific User, he/she will be able to access it, even if that User doesn't have permission to access that document or Document Type.
+
+<img class="screenshot" alt="Assign" src="{{docs_base_url}}/assets/img/collaboration-tools/share-1.gif">
 
 ### Tags
 
-[Read more about Tags]({{docs_base_url}}/user/manual/en/using-erpnext/tags.html)  
+[Read more about Tags]({{docs_base_url}}/user/manual/en/using-erpnext/tags.html)
 
 {next}
diff --git a/erpnext/docs/user/manual/en/using-erpnext/index.txt b/erpnext/docs/user/manual/en/using-erpnext/index.txt
index 63f4a64..c3a6aa4 100644
--- a/erpnext/docs/user/manual/en/using-erpnext/index.txt
+++ b/erpnext/docs/user/manual/en/using-erpnext/index.txt
@@ -1,10 +1,9 @@
 to-do
 collaborating-around-forms
-messages
+chat
 notes
 calendar
 assignment
 tags
 articles
-pos-view
-multilingual_print_format
+pos-view
\ No newline at end of file
diff --git a/erpnext/docs/user/manual/en/using-erpnext/messages.md b/erpnext/docs/user/manual/en/using-erpnext/messages.md
deleted file mode 100644
index dfa0526..0000000
--- a/erpnext/docs/user/manual/en/using-erpnext/messages.md
+++ /dev/null
@@ -1,12 +0,0 @@
-You can send and receive messages from the system by using the Messages tool.
-If you send a message to a user, and the user is logged in, it will appear as
-a popup message and the unread messages counter in the top toolbar will be
-updated.
-
-![Message List]({{docs_base_url}}/assets/old_images/erpnext/message-list.png)
-
-You can choose to send message to all the users, or to specific user.
-
-![Messsage To]({{docs_base_url}}/assets/old_images/erpnext/message-to.png)
-
-{next}
diff --git a/erpnext/docs/user/manual/en/using-erpnext/multilingual_print_format.md b/erpnext/docs/user/manual/en/using-erpnext/multilingual_print_format.md
deleted file mode 100644
index bb48278..0000000
--- a/erpnext/docs/user/manual/en/using-erpnext/multilingual_print_format.md
+++ /dev/null
@@ -1,50 +0,0 @@
-####What is Multlingual Print Format?
-
-User can print the customer's and supplier's document in their local language. For an example if I have customers from germany, france who want quotation in german, french language will be possible with these feature.
-
-####How does it work?
-Set print language for customer, supplier on their respective form.
-
-`Selling -> Customer -> Customer List -> Click on New`
-
-Here user has set default language for customer Adalbert as <b>deutsch</b>.
-
-<img src="{{ docs_base_url }}/assets/img/multilingual_print_format/set_customer_default_lang.png" class="screenshot">
-
-`Buying -> Supplier -> Supplier List -> Click on New`
-
-Here user has set default language for supplier Piero as <b>Italiano</b>.
-<img src="{{ docs_base_url }}/assets/img/multilingual_print_format/set_supplier_default_lang.png" class="screenshot">
-
-When user click on print icon on the document, system will load the print preview in their default language.
-
-Customer quotation standard print preview in customer's default language.
-
-<img src="{{ docs_base_url }}/assets/img/multilingual_print_format/customer_quotation.png" class="screenshot">
-
-Supplier quotation standard print preview in supplier's default language.
-
-<img src="{{ docs_base_url }}/assets/img/multilingual_print_format/supplier_quotation.png" class="screenshot">
-
-####What to do if want to print with another language?
-
-User can have option to select alternate language on print view.
-
-<img src="{{ docs_base_url }}/assets/img/multilingual_print_format/alternate_language.png" class="screenshot">
-
-
-####Custom Translation
-
-User can set their custom translations using translation form. For example user want to set description of the product in customer's language(Italiano). For that create new translation with language as Italiano, enter source data and Translated information.
-
-`Setup -> Settings -> Translation List -> Click on New`
-
-<img src="{{ docs_base_url }}/assets/img/multilingual_print_format/translation.png" class="screenshot">
-
-The translation is applied when user select language as Italiano on supplier quotation's print prieview.
-
-<img src="{{ docs_base_url }}/assets/img/multilingual_print_format/custom_translation.png" class="screenshot">
-
-
-
-
diff --git a/erpnext/docs/user/manual/en/using-erpnext/notes.md b/erpnext/docs/user/manual/en/using-erpnext/notes.md
index cc88aec..64e7acb 100644
--- a/erpnext/docs/user/manual/en/using-erpnext/notes.md
+++ b/erpnext/docs/user/manual/en/using-erpnext/notes.md
@@ -1,21 +1,17 @@
 You can store your long notes under this section. It can contain your partner lists, frequently used passwords, terms and conditions, or any other document which needs to be shared. Following are the steps to create new Note.
 
-####Go to Note
-
-`Home > Note > New`
+`Explore > Note > New`
 
 ####Notes Details
 
 Enter Title and Context.
 
-![Note]({{docs_base_url}}/assets/old_images/erpnext/note.png)
+<img class="screenshot" alt="Note New" src="{{docs_base_url}}/assets/img/collaboration-tools/note-1.png">
 
 ####Set Permissions to select Users
 
-To make Note accessible for all, check "Public" under links section. If specific Note is to be made accessible to specific user, they shall be selected in the Share With table.
+To make Note accessible for all, check "Public" under links section. Else you can share it with the specific User by using Share feature.
 
-![Note Permission]({{docs_base_url}}/assets/old_images/erpnext/note-permission.png)
-
-<div class=well>Notes can also be used as a knowledge base internally. You can also attach file in the Notes, and make it accessible to specific set of users only.</div>
+<img class="screenshot" alt="Note New" src="{{docs_base_url}}/assets/img/collaboration-tools/share-1.gif">
 
 {next}
diff --git a/erpnext/docs/user/manual/en/using-erpnext/tags.md b/erpnext/docs/user/manual/en/using-erpnext/tags.md
index 6f6c983..0446a32 100644
--- a/erpnext/docs/user/manual/en/using-erpnext/tags.md
+++ b/erpnext/docs/user/manual/en/using-erpnext/tags.md
@@ -1,5 +1,9 @@
-Like Assignments and Comments, you can also add your own tags to each type of transactions. These tags can help you search a document and also classify it. ERPNext will also show you all the important tags in the document list.
+Like Assignments and Comments, you can also add your own tags to each type of transactions. These tags can help you search a document and also classify it. 
 
-![Tags]({{docs_base_url}}/assets/old_images/erpnext/tags-in-list.png)
+<img class="screenshot" alt="Assign" src="{{docs_base_url}}/assets/img/collaboration-tools/tags-1.png">
+
+ERPNext will also show you all the important tags in the document list.
+
+<img class="screenshot" alt="Assign" src="{{docs_base_url}}/assets/img/collaboration-tools/tags-2.png">
 
 {next}
diff --git a/erpnext/docs/user/manual/en/using-erpnext/to-do.md b/erpnext/docs/user/manual/en/using-erpnext/to-do.md
index 03f84d5..295e79a 100644
--- a/erpnext/docs/user/manual/en/using-erpnext/to-do.md
+++ b/erpnext/docs/user/manual/en/using-erpnext/to-do.md
@@ -1,10 +1,9 @@
-To Do is a simple tool where all the activities [assigned](https://erpnext.com/collaboration-tools/assignment) to you and assigned
-by you are listed. You can also add your own to-do items in the list.
+To Do is a simple tool where all the activities [assigned]({{docs_base_url}}/user/manual/en/using-erpnext/assignments.html) to you and assigned by you are listed. You can also add your own to-do items in the list.
 
-![Todo List]({{docs_base_url}}/assets/old_images/erpnext/todo-list.png)
+<img class="screenshot" alt="Assign" src="{{docs_base_url}}/assets/img/collaboration-tools/assign-3.png">
 
-When task is completed, you should simply remove assignment from the assigned document. With this, task will be removed from your Todo list as well. For Todo which are not assigned via document, you can set their status as Closed from the Todo record itself.
+When task is completed, you should simply remove assignment from the assigned document. With this, task will be removed from your Todo list as well. For Todo which are not assigned via document, you can set their status as Closed from the Todo master itself.
 
-![Todo Close]({{docs_base_url}}/assets/old_images/erpnext/todo-close.png)
+<img class="screenshot" alt="Assign" src="{{docs_base_url}}/assets/img/collaboration-tools/assign-4.png">
 
 {next}
diff --git a/erpnext/hr/doctype/leave_application/leave_application.py b/erpnext/hr/doctype/leave_application/leave_application.py
index fee39aa..838d8f7 100755
--- a/erpnext/hr/doctype/leave_application/leave_application.py
+++ b/erpnext/hr/doctype/leave_application/leave_application.py
@@ -36,6 +36,7 @@
 		self.validate_max_days()
 		self.show_block_day_warning()
 		self.validate_block_days()
+		self.validate_salary_processed_days()
 		self.validate_leave_approver()
 
 	def on_update(self):
@@ -95,6 +96,15 @@
 			frappe.throw(_("Leave cannot be applied/cancelled before {0}, as leave balance has already been carry-forwarded in the future leave allocation record {1}")
 				.format(formatdate(future_allocation[0].from_date), future_allocation[0].name))
 
+	def validate_salary_processed_days(self):
+		last_processed_pay_slip = frappe.db.sql("""select start_date, end_date from `tabSalary Slip`
+						where docstatus != 2 and employee = %s and ((%s between start_date and end_date) or (%s between start_date and end_date)) order by modified desc limit 1""",(self.employee, self.to_date, self.from_date))
+
+		if last_processed_pay_slip:
+			frappe.throw(_("Salary already processed for period between {0} and {1}, Leave application period cannot be between this date range.").
+					format(formatdate(last_processed_pay_slip[0][0]), formatdate(last_processed_pay_slip[0][1])))
+
+
 	def show_block_day_warning(self):
 		block_dates = get_applicable_block_dates(self.from_date, self.to_date,
 			self.employee, self.company, all_lists=True)
diff --git a/erpnext/manufacturing/doctype/production_order/production_order.js b/erpnext/manufacturing/doctype/production_order/production_order.js
index d42f735..9b97bd1 100644
--- a/erpnext/manufacturing/doctype/production_order/production_order.js
+++ b/erpnext/manufacturing/doctype/production_order/production_order.js
@@ -38,7 +38,7 @@
 			frm.trigger('show_progress');
 		}
 		
-		if(frm.doc.docstatus == 1){
+		if(frm.doc.docstatus == 1 && frm.doc.status != 'Stopped'){
 			frm.add_custom_button(__('Make Timesheet'), function(){
 				frappe.model.open_mapped_doc({
 					method: "erpnext.manufacturing.doctype.production_order.production_order.make_new_timesheet",
@@ -124,20 +124,20 @@
 			}
 
 			// opertions
-			if ((doc.operations || []).length) {
+			if (((doc.operations || []).length) && frm.doc.status != 'Stopped') {
 				frm.add_custom_button(__('Timesheet'), function() {
 					frappe.route_options = {"production_order": frm.doc.name};
 					frappe.set_route("List", "Timesheet");
 				}, __("View"));
 			}
 
-			if (flt(doc.material_transferred_for_manufacturing) < flt(doc.qty)) {
+			if ((flt(doc.material_transferred_for_manufacturing) < flt(doc.qty)) && frm.doc.status != 'Stopped') {
 				var btn = frm.add_custom_button(__('Start'),
 					cur_frm.cscript['Transfer Raw Materials']);
 				btn.addClass('btn-primary');
 			}
 
-			if (flt(doc.produced_qty) < flt(doc.material_transferred_for_manufacturing)) {
+			if ((flt(doc.produced_qty) < flt(doc.material_transferred_for_manufacturing)) && frm.doc.status != 'Stopped') {
 				var btn = frm.add_custom_button(__('Finish'),
 					cur_frm.cscript['Update Finished Goods']);
 
diff --git a/erpnext/manufacturing/doctype/production_order/production_order.py b/erpnext/manufacturing/doctype/production_order/production_order.py
index 0f6dae6..2bf3204 100644
--- a/erpnext/manufacturing/doctype/production_order/production_order.py
+++ b/erpnext/manufacturing/doctype/production_order/production_order.py
@@ -105,7 +105,7 @@
 
 	def stop_unstop(self, status):
 		""" Called from client side on Stop/Unstop event"""
-		self.update_status(status)
+		status = self.update_status(status)
 		self.update_planned_qty()
 		frappe.msgprint(_("Production Order status is {0}").format(status))
 		self.notify_update()
@@ -114,13 +114,15 @@
 	def update_status(self, status=None):
 		'''Update status of production order if unknown'''
 		if not status:
-			status = self.get_status()
+			status = self.get_status(status)
 			
 		if status != self.status:
 			self.db_set("status", status)
 
 		self.update_required_items()
 
+		return status
+
 	def get_status(self, status=None):
 		'''Return the status based on stock entries against this production order'''
 		if not status:
diff --git a/erpnext/projects/doctype/timesheet/timesheet.js b/erpnext/projects/doctype/timesheet/timesheet.js
index e2e6459..a780ab4 100644
--- a/erpnext/projects/doctype/timesheet/timesheet.js
+++ b/erpnext/projects/doctype/timesheet/timesheet.js
@@ -6,15 +6,17 @@
 	setup: function(frm) {
 		frm.get_field('time_logs').grid.editable_fields = [
 			{fieldname: 'billable', columns: 1},
+			{fieldname: 'project', columns: 3},
 			{fieldname: 'activity_type', columns: 2},
 			{fieldname: 'from_time', columns: 3},
-			{fieldname: 'hours', columns: 1},
-			{fieldname: 'project', columns: 3}
+			{fieldname: 'hours', columns: 1}
 		];
 
 		frm.fields_dict.employee.get_query = function() {
 			return {
-				query:"erpnext.projects.doctype.timesheet.timesheet.get_employee_list"
+				filters:{
+					'status': 'Active'
+				}
 			}
 		}
 
diff --git a/erpnext/projects/doctype/timesheet/timesheet.json b/erpnext/projects/doctype/timesheet/timesheet.json
index c035cd3..16d71d8 100644
--- a/erpnext/projects/doctype/timesheet/timesheet.json
+++ b/erpnext/projects/doctype/timesheet/timesheet.json
@@ -1,6 +1,6 @@
 {
  "allow_copy": 0, 
- "allow_import": 0, 
+ "allow_import": 1, 
  "allow_rename": 0, 
  "autoname": "naming_series:", 
  "beta": 0, 
@@ -662,7 +662,7 @@
  "issingle": 0, 
  "istable": 0, 
  "max_attachments": 0, 
- "modified": "2016-07-26 00:01:56.055046", 
+ "modified": "2016-08-01 08:54:31.840829", 
  "modified_by": "Administrator", 
  "module": "Projects", 
  "name": "Timesheet", 
diff --git a/erpnext/projects/doctype/timesheet/timesheet.py b/erpnext/projects/doctype/timesheet/timesheet.py
index a1b757c..abcffad 100644
--- a/erpnext/projects/doctype/timesheet/timesheet.py
+++ b/erpnext/projects/doctype/timesheet/timesheet.py
@@ -94,7 +94,7 @@
 			if self.production_order and flt(data.completed_qty) == 0:
 				frappe.throw(_("Row {0}: Completed Qty must be greater than zero.").format(data.idx))
 
-			if self.production_order and flt(pending_qty) < flt(data.completed_qty):
+			if self.production_order and flt(pending_qty) < flt(data.completed_qty) and flt(pending_qty) > 0:
 				frappe.throw(_("Row {0}: Completed Qty cannot be more than {1} for operation {2}").format(data.idx, pending_qty, data.operation),
 					OverProductionLoggedError)
 
@@ -290,10 +290,3 @@
 			["costing_rate", "billing_rate"], as_dict=True)
 
 	return rate[0] if rate else {}
-
-@frappe.whitelist()
-def get_employee_list(doctype, txt, searchfield, start, page_len, filters):
-	return frappe.db.sql("""select distinct employee, employee_name
-		from `tabSalary Structure` where salary_slip_based_on_timesheet=1
-		and employee like %(txt)s or employee_name like %(txt)s limit %(start)s, %(page_len)s""", 
-		{'txt': "%%%s%%"% txt, 'start': start, 'page_len': page_len})
diff --git a/erpnext/projects/doctype/timesheet_detail/timesheet_detail.json b/erpnext/projects/doctype/timesheet_detail/timesheet_detail.json
index 7604ded..f847e64 100644
--- a/erpnext/projects/doctype/timesheet_detail/timesheet_detail.json
+++ b/erpnext/projects/doctype/timesheet_detail/timesheet_detail.json
@@ -22,7 +22,7 @@
    "ignore_xss_filter": 0, 
    "in_filter": 0, 
    "in_list_view": 0, 
-   "label": "Billable", 
+   "label": "Bill", 
    "length": 0, 
    "no_copy": 0, 
    "permlevel": 0, 
@@ -121,7 +121,7 @@
    "ignore_xss_filter": 0, 
    "in_filter": 0, 
    "in_list_view": 0, 
-   "label": "Hours", 
+   "label": "Hrs", 
    "length": 0, 
    "no_copy": 0, 
    "permlevel": 0, 
@@ -532,7 +532,7 @@
  "issingle": 0, 
  "istable": 1, 
  "max_attachments": 0, 
- "modified": "2016-07-26 00:07:58.267131", 
+ "modified": "2016-08-06 03:14:31.691605", 
  "modified_by": "Administrator", 
  "module": "Projects", 
  "name": "Timesheet Detail", 
diff --git a/erpnext/projects/web_form/tasks/tasks.json b/erpnext/projects/web_form/tasks/tasks.json
index 1d952fc..98a2055 100644
--- a/erpnext/projects/web_form/tasks/tasks.json
+++ b/erpnext/projects/web_form/tasks/tasks.json
@@ -11,14 +11,14 @@
  "idx": 0, 
  "is_standard": 1, 
  "login_required": 1, 
- "modified": "2016-07-07 06:04:30.979390", 
+ "modified": "2016-08-06 11:59:21.494549", 
  "modified_by": "Administrator", 
  "module": "Projects", 
  "name": "tasks", 
  "owner": "Administrator", 
  "published": 1, 
  "route": "tasks", 
- "success_url": "/projects?project=Collaborative Project Management", 
+ "success_url": "", 
  "title": "Task", 
  "web_form_fields": [
   {
diff --git a/erpnext/projects/web_form/tasks/tasks.py b/erpnext/projects/web_form/tasks/tasks.py
index 6f387fe..e97f36d 100644
--- a/erpnext/projects/web_form/tasks/tasks.py
+++ b/erpnext/projects/web_form/tasks/tasks.py
@@ -5,6 +5,8 @@
 def get_context(context):
 	if frappe.form_dict.project:
 		context.parents = [{'title': frappe.form_dict.project, 'route': '/projects?project='+ frappe.form_dict.project}]
+		context.success_url = "/projects?project=" + frappe.form_dict.project
 		
 	elif context.doc and context.doc.get('project'):
-		context.parents = [{'title': context.doc.project, 'route': '/projects?project='+ context.doc.project}]
\ No newline at end of file
+		context.parents = [{'title': context.doc.project, 'route': '/projects?project='+ context.doc.project}]
+		context.success_url = "/projects?project=" + context.doc.project
diff --git a/erpnext/schools/api.py b/erpnext/schools/api.py
index 26577b4..4649d0c 100644
--- a/erpnext/schools/api.py
+++ b/erpnext/schools/api.py
@@ -94,13 +94,13 @@
 	return fee_structure[0].name if fee_structure else None
 
 @frappe.whitelist()
-def get_fee_amount(fee_structure):
-	"""Returns Fee Amount.
+def get_fee_components(fee_structure):
+	"""Returns Fee Components.
 
 	:param fee_structure: Fee Structure.
 	"""
 	if fee_structure:
-		fs = frappe.get_list("Fee Amount", fields=["fees_category", "amount"] , filters={"parent": fee_structure}, order_by= "idx")
+		fs = frappe.get_list("Fee Component", fields=["fees_category", "amount"] , filters={"parent": fee_structure}, order_by= "idx")
 		return fs
 
 @frappe.whitelist()
diff --git a/erpnext/schools/doctype/fee_structure/fee_structure.js b/erpnext/schools/doctype/fee_structure/fee_structure.js
index e3d4544..391c935 100644
--- a/erpnext/schools/doctype/fee_structure/fee_structure.js
+++ b/erpnext/schools/doctype/fee_structure/fee_structure.js
@@ -1,8 +1,8 @@
-frappe.ui.form.on("Fee Amount", {
+frappe.ui.form.on("Fee Component", {
 	amount: function(frm) {
 		total_amount = 0;
-		for(var i=0;i<frm.doc.amount.length;i++) {
-			total_amount += frm.doc.amount[i].amount;
+		for(var i=0;i<frm.doc.components.length;i++) {
+			total_amount += frm.doc.components[i].amount;
 		}
 		frm.set_value("total_amount", total_amount);
 	}
diff --git a/erpnext/schools/doctype/fees/fees.js b/erpnext/schools/doctype/fees/fees.js
index 0e9ad76..22c6d8a 100644
--- a/erpnext/schools/doctype/fees/fees.js
+++ b/erpnext/schools/doctype/fees/fees.js
@@ -46,34 +46,39 @@
 	},
 
 	fee_structure: function(frm) {
-		frm.set_value("amount" ,"");
+		frm.set_value("components" ,"");
 		if (frm.doc.fee_structure) {
 			frappe.call({
-				method: "erpnext.schools.api.get_fee_amount",
+				method: "erpnext.schools.api.get_fee_components",
 				args: {
 					"fee_structure": frm.doc.fee_structure
 				},
 				callback: function(r) {
 					if (r.message) {
 						$.each(r.message, function(i, d) {
-							var row = frappe.model.add_child(frm.doc, "Fee Amount", "amount");
+							var row = frappe.model.add_child(frm.doc, "Fee Component", "components");
 							row.fees_category = d.fees_category;
 							row.amount = d.amount;
 						});
 					}
-					refresh_field("amount");
+					refresh_field("components");
+					frm.trigger("calculate_total_amount");
 				}
 			});
 		}
+	},
+	
+	calculate_total_amount: function(frm) {
+		total_amount = 0;
+		for(var i=0;i<frm.doc.components.length;i++) {
+			total_amount += frm.doc.components[i].amount;
+		}
+		frm.set_value("total_amount", total_amount);
 	}
 });
 
-frappe.ui.form.on("Fee Amount", {
+frappe.ui.form.on("Fee Component", {
 	amount: function(frm) {
-		total_amount = 0;
-		for(var i=0;i<frm.doc.amount.length;i++) {
-			total_amount += frm.doc.amount[i].amount;
-		}
-		frm.set_value("total_amount", total_amount);
+		frm.trigger("calculate_total_amount");
 	}
 });
diff --git a/erpnext/schools/doctype/program_enrollment/program_enrollment.py b/erpnext/schools/doctype/program_enrollment/program_enrollment.py
index ca193dd..a15a070 100644
--- a/erpnext/schools/doctype/program_enrollment/program_enrollment.py
+++ b/erpnext/schools/doctype/program_enrollment/program_enrollment.py
@@ -27,11 +27,11 @@
 		frappe.db.set_value("Student", self.student, "joining_date", date)
 		
 	def make_fee_records(self):
-		from erpnext.schools.api import get_fee_amount
+		from erpnext.schools.api import get_fee_components
 		fee_list = []
 		for d in self.fees:
-			fee_amount = get_fee_amount(d.fee_structure)
-			if fee_amount:
+			fee_components = get_fee_components(d.fee_structure)
+			if fee_components:
 				fees = frappe.new_doc("Fees")
 				fees.update({
 					"student": self.student,
@@ -42,7 +42,7 @@
 					"due_date": d.due_date,
 					"student_name": self.student_name,
 					"program_enrollment": self.name,
-					"amount": fee_amount
+					"components": fee_components
 				})
 				
 				fees.save()