Merge pull request #6531 from saurabh6790/je_currency_symbol_fix

[fix] currency symbol for total amount in JE
diff --git a/erpnext/accounts/doctype/sales_invoice/pos.py b/erpnext/accounts/doctype/sales_invoice/pos.py
index c62088d..6f958f5 100644
--- a/erpnext/accounts/doctype/sales_invoice/pos.py
+++ b/erpnext/accounts/doctype/sales_invoice/pos.py
@@ -15,6 +15,7 @@
 	doc = frappe.new_doc('Sales Invoice')
 	doc.is_pos = 1;
 	pos_profile = get_pos_profile(doc.company) or {}
+	if not doc.company: doc.company = pos_profile.get('company')
 	doc.update_stock = pos_profile.get('update_stock')
 
 	if pos_profile.get('name'):
diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.json b/erpnext/accounts/doctype/sales_invoice/sales_invoice.json
index a4ecb68..15a7112 100644
--- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.json
+++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.json
@@ -342,6 +342,34 @@
    "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
+   "fieldname": "project", 
+   "fieldtype": "Link", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "ignore_xss_filter": 0, 
+   "in_filter": 1, 
+   "in_list_view": 0, 
+   "label": "Project", 
+   "length": 0, 
+   "no_copy": 0, 
+   "oldfieldname": "project_name", 
+   "oldfieldtype": "Link", 
+   "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, 
+   "columns": 0, 
    "fieldname": "amended_from", 
    "fieldtype": "Link", 
    "hidden": 0, 
@@ -2878,21 +2906,22 @@
    "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
-   "fieldname": "project", 
+   "depends_on": "", 
+   "fieldname": "campaign", 
    "fieldtype": "Link", 
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
-   "in_filter": 1, 
+   "in_filter": 0, 
    "in_list_view": 0, 
-   "label": "Project", 
+   "label": "Campaign", 
    "length": 0, 
    "no_copy": 0, 
-   "oldfieldname": "project_name", 
+   "oldfieldname": "campaign", 
    "oldfieldtype": "Link", 
-   "options": "Project", 
+   "options": "Campaign", 
    "permlevel": 0, 
-   "print_hide": 0, 
+   "print_hide": 1, 
    "print_hide_if_no_value": 0, 
    "read_only": 0, 
    "report_hide": 0, 
@@ -2931,35 +2960,6 @@
    "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
-   "depends_on": "", 
-   "fieldname": "campaign", 
-   "fieldtype": "Link", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_list_view": 0, 
-   "label": "Campaign", 
-   "length": 0, 
-   "no_copy": 0, 
-   "oldfieldname": "campaign", 
-   "oldfieldtype": "Link", 
-   "options": "Campaign", 
-   "permlevel": 0, 
-   "print_hide": 1, 
-   "print_hide_if_no_value": 0, 
-   "read_only": 0, 
-   "report_hide": 0, 
-   "reqd": 0, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "unique": 0
-  }, 
-  {
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
    "fieldname": "source", 
    "fieldtype": "Link", 
    "hidden": 0, 
@@ -3867,7 +3867,7 @@
  "istable": 0, 
  "max_attachments": 0, 
  "menu_index": 0, 
- "modified": "2016-09-23 17:59:42.200474", 
+ "modified": "2016-09-24 15:54:33.104276", 
  "modified_by": "Administrator", 
  "module": "Accounts", 
  "name": "Sales Invoice", 
diff --git a/erpnext/accounts/page/pos/pos.js b/erpnext/accounts/page/pos/pos.js
index de85621..8eb2efd 100644
--- a/erpnext/accounts/page/pos/pos.js
+++ b/erpnext/accounts/page/pos/pos.js
@@ -106,11 +106,15 @@
 			me.get_data_from_server(function(){
 				me.load_data(false);
 				me.make_customer();
-				me.make_item_list();
+				me.make_item_list(true);
 				me.set_missing_values();
 			})
 		});
 
+		this.page.add_menu_item(__("Sync Offline Invoices"), function(){
+			me.sync_sales_invoice()
+		});
+
 		this.page.add_menu_item(__("POS Profile"), function() {
 			frappe.set_route('List', 'POS Profile');
 		});
@@ -278,7 +282,7 @@
 	make: function() {
 		this.make_search();
 		this.make_customer();
-		this.make_item_list();
+		this.make_item_list(true);
 		this.make_discount_field()
 	},
 
@@ -299,7 +303,7 @@
 		this.search.$input.on("keyup", function() {
 			setTimeout(function() {
 				me.items = me.get_items();
-				me.make_item_list();
+				me.make_item_list(false);
 			}, 1000);
 		});
 
@@ -381,7 +385,7 @@
 		}
 	},
 
-	make_item_list: function() {
+	make_item_list: function(index_search) {
 		var me = this;
 		if(!this.price_list) {
 			msgprint(__("Price List not found or disabled"));
@@ -395,7 +399,7 @@
 
 		if (this.items) {
 			$.each(this.items, function(index, obj) {
-				if(index < 16){
+				if(!index_search || index < 16){
 					$(frappe.render_template("pos_item", {
 						item_code: obj.name,
 						item_price: format_currency(obj.price_list_rate, obj.currency),
diff --git a/erpnext/docs/user/manual/en/buying/supplier.md b/erpnext/docs/user/manual/en/buying/supplier.md
index 45ec6b1..89107db 100644
--- a/erpnext/docs/user/manual/en/buying/supplier.md
+++ b/erpnext/docs/user/manual/en/buying/supplier.md
@@ -2,7 +2,7 @@
 
 You can create a new Supplier from:
 
-`Buying > Documents > Supplier > New Supplier`
+`Explore > Supplier > New Supplier`
 
 <img class="screenshot" alt="Supplier Master" src="{{docs_base_url}}/assets/img/buying/supplier-master.png">
 
diff --git a/erpnext/manufacturing/doctype/production_order/production_order.py b/erpnext/manufacturing/doctype/production_order/production_order.py
index d598ee2..d39c80f 100644
--- a/erpnext/manufacturing/doctype/production_order/production_order.py
+++ b/erpnext/manufacturing/doctype/production_order/production_order.py
@@ -115,7 +115,7 @@
 		'''Update status of production order if unknown'''
 		if not status:
 			status = self.get_status(status)
-			
+
 		if status != self.status:
 			self.db_set("status", status)
 
@@ -240,7 +240,7 @@
 			holidays[holiday_list] = holiday_list_days
 
 		return holidays[holiday_list]
-		
+
 	def make_time_logs(self, open_new=False):
 		"""Capacity Planning. Plan time logs based on earliest availablity of workstation after
 			Planned Start Date. Time logs will be created and remain in Draft mode and must be submitted
@@ -261,7 +261,7 @@
 			if d.workstation and d.status != 'Completed':
 				last_workstation_idx[d.workstation] = i # set last row index of workstation
 				self.set_start_end_time_for_workstation(d, workstation_list, last_workstation_idx.get(d.workstation))
-				
+
 				args = self.get_operations_data(d)
 				add_timesheet_detail(timesheet, args)
 				original_start_time = d.planned_start_time
@@ -366,7 +366,8 @@
 		if frappe.db.get_value("Item", self.production_item, "has_variants"):
 			frappe.throw(_("Production Order cannot be raised against a Item Template"), ItemHasVariantError)
 
-		validate_end_of_life(self.production_item)
+		if self.production_item:
+			validate_end_of_life(self.production_item)
 
 	def validate_qty(self):
 		if not self.qty > 0:
@@ -520,7 +521,7 @@
 	timesheet.production_order = production_order
 	return timesheet
 
-@frappe.whitelist()	
+@frappe.whitelist()
 def add_timesheet_detail(timesheet, args):
 	if isinstance(timesheet, unicode):
 		timesheet = frappe.get_doc('Timesheet', timesheet)
diff --git a/erpnext/public/css/website.css b/erpnext/public/css/website.css
index ab3beb0..2bfcd3e 100644
--- a/erpnext/public/css/website.css
+++ b/erpnext/public/css/website.css
@@ -2,6 +2,9 @@
   font-size: 18px;
   line-height: 200%;
 }
+.web-page-content {
+  margin-bottom: 30px;
+}
 .item-stock {
   margin-bottom: 10px !important;
 }
diff --git a/erpnext/public/js/shopping_cart.js b/erpnext/public/js/shopping_cart.js
index f5819a8..ace7fd8 100644
--- a/erpnext/public/js/shopping_cart.js
+++ b/erpnext/public/js/shopping_cart.js
@@ -10,7 +10,7 @@
 		$('.navbar li[data-label="User"] a')
 			.html('<i class="icon-fixed-width icon-user"></i> ' + full_name);
 	}
-	
+
 	// update login
 	shopping_cart.show_shoppingcart_dropdown();
 	shopping_cart.set_cart_count();
@@ -32,7 +32,7 @@
 			}
 		});
 	},
-	
+
 	update_cart: function(opts) {
 		if(!full_name || full_name==="Guest") {
 			if(localStorage) {
@@ -50,10 +50,10 @@
 				},
 				btn: opts.btn,
 				callback: function(r) {
-					shopping_cart.set_cart_count();	
+					shopping_cart.set_cart_count();
 					if (r.message.shopping_cart_menu) {
 						$('.shopping-cart-menu').html(r.message.shopping_cart_menu);
-					}					
+					}
 					if(opts.callback)
 						opts.callback(r);
 				}
@@ -63,11 +63,11 @@
 
 	set_cart_count: function() {
 		var cart_count = getCookie("cart_count");
-		
+
 		if(cart_count) {
-			$(".shopping-cart").toggle(true);	
-		}		
-		
+			$(".shopping-cart").toggleClass('hidden', true);
+		}
+
 		var $cart = $('.cart-icon');
 		var $badge = $cart.find("#cart-count");
 
@@ -88,7 +88,7 @@
 			$badge.remove();
 		}
 	},
-	
+
 	shopping_cart_update: function(item_code, newVal, cart_dropdown) {
 		frappe.freeze();
 		shopping_cart.update_cart({
@@ -103,20 +103,20 @@
 					$(".cart-tax-items").html(r.message.taxes);
 					if (cart_dropdown != true) {
 						$(".cart-icon").hide();
-					}					
+					}
 				}
 			},
 		});
 	},
-	
-	
+
+
 	bind_dropdown_cart_buttons: function() {
 		$(".cart-icon").on('click', '.number-spinner button', function () {
 			var btn = $(this),
 				input = btn.closest('.number-spinner').find('input'),
 				oldValue = input.val().trim(),
 				newVal = 0;
-			
+
 				if (btn.attr('data-dir') == 'up') {
 					newVal = parseInt(oldValue) + 1;
 				} else {
@@ -125,11 +125,11 @@
 					}
 			}
 			input.val(newVal);
-			var item_code = input.attr("data-item-code"); 
+			var item_code = input.attr("data-item-code");
 			shopping_cart.shopping_cart_update(item_code, newVal, true);
 			return false;
 		});
-		
+
 	},
-	
+
 });
diff --git a/erpnext/public/less/website.less b/erpnext/public/less/website.less
index 37d69e0..ce36e5f 100644
--- a/erpnext/public/less/website.less
+++ b/erpnext/public/less/website.less
@@ -8,6 +8,10 @@
 	line-height: 200%;
 }
 
+.web-page-content {
+	margin-bottom: 30px;
+}
+
 .item-stock {
 	margin-bottom: 10px !important;
 }
diff --git a/erpnext/schools/doctype/student_admission/student_admission.js b/erpnext/schools/doctype/student_admission/student_admission.js
index 48f4c46..d7f7454 100644
--- a/erpnext/schools/doctype/student_admission/student_admission.js
+++ b/erpnext/schools/doctype/student_admission/student_admission.js
@@ -8,7 +8,7 @@
 			frm.refresh_field("route");
 		}
 	},
-	
+
 	academic_year: function(frm) {
 		frm.trigger("program");
 	}
diff --git a/erpnext/schools/doctype/student_admission/student_admission.json b/erpnext/schools/doctype/student_admission/student_admission.json
index 4eae29d..77a3236 100644
--- a/erpnext/schools/doctype/student_admission/student_admission.json
+++ b/erpnext/schools/doctype/student_admission/student_admission.json
@@ -1,8 +1,8 @@
 {
  "allow_copy": 0, 
  "allow_import": 0, 
- "allow_rename": 0, 
- "autoname": "field:route", 
+ "allow_rename": 1, 
+ "autoname": "", 
  "beta": 0, 
  "creation": "2016-09-13 03:05:27.154713", 
  "custom": 0, 
@@ -121,6 +121,32 @@
    "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
+   "fieldname": "naming_series_for_student_applicant", 
+   "fieldtype": "Data", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "ignore_xss_filter": 0, 
+   "in_filter": 0, 
+   "in_list_view": 0, 
+   "label": "Naming Series (for Student Applicant)", 
+   "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, 
+   "columns": 0, 
    "fieldname": "publish", 
    "fieldtype": "Check", 
    "hidden": 0, 
@@ -189,7 +215,7 @@
    "print_hide_if_no_value": 0, 
    "read_only": 0, 
    "report_hide": 0, 
-   "reqd": 1, 
+   "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
    "unique": 0
@@ -351,6 +377,32 @@
    "search_index": 0, 
    "set_only_once": 0, 
    "unique": 0
+  }, 
+  {
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "fieldname": "eligibility", 
+   "fieldtype": "Text Editor", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "ignore_xss_filter": 0, 
+   "in_filter": 0, 
+   "in_list_view": 0, 
+   "label": "Eligibility", 
+   "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": 0, 
@@ -363,7 +415,7 @@
  "issingle": 0, 
  "istable": 0, 
  "max_attachments": 0, 
- "modified": "2016-10-03 15:08:48.020111", 
+ "modified": "2016-10-04 02:44:28.480942", 
  "modified_by": "Administrator", 
  "module": "Schools", 
  "name": "Student Admission", 
@@ -380,6 +432,7 @@
    "export": 1, 
    "if_owner": 0, 
    "import": 0, 
+   "is_custom": 0, 
    "permlevel": 0, 
    "print": 1, 
    "read": 1, 
diff --git a/erpnext/schools/doctype/student_admission/student_admission.py b/erpnext/schools/doctype/student_admission/student_admission.py
index c4384e2..3df113a 100644
--- a/erpnext/schools/doctype/student_admission/student_admission.py
+++ b/erpnext/schools/doctype/student_admission/student_admission.py
@@ -11,15 +11,18 @@
 	website = frappe._dict(
 		template = "templates/generators/student_admission.html",
 		condition_field = "publish",
-		page_title_field = "route"
+		page_title_field = "title"
 	)
 
+	def autoname(self):
+		self.name = self.get_title()
+		self.title = self.name
+
 	def get_context(self, context):
 		context.parents = [{'name': 'admissions', 'title': _('All Student Admissions') }]
-		
-	def validate(self):
-		if not self.title:
-			self.title = self.program + " admissions for " + self.academic_year
+
+	def get_title(self):
+		return _("Admissions for {0}") + self.academic_year
 
 def get_list_context(context):
 	context.title = _("Student Admissions")
diff --git a/erpnext/schools/doctype/student_applicant/student_applicant.js b/erpnext/schools/doctype/student_applicant/student_applicant.js
index 6857a66..36baa80 100644
--- a/erpnext/schools/doctype/student_applicant/student_applicant.js
+++ b/erpnext/schools/doctype/student_applicant/student_applicant.js
@@ -4,22 +4,22 @@
 			frm.add_custom_button(__("Approve"), function() {
 				frm.set_value("application_status", "Approved");
 				frm.save_or_update();
-				
-			}).addClass("btn-primary");
-			
+
+			}, 'Actions');
+
 			frm.add_custom_button(__("Reject"), function() {
 				frm.set_value("application_status", "Rejected");
 				frm.save_or_update();
-			}).addClass("btn-danger");
+			}, 'Actions');
 		}
-		
+
 		if(frm.doc.application_status== "Approved" && frm.doc.docstatus== 1 ) {
 			frm.add_custom_button(__("Enroll"), function() {
 				frm.events.enroll(frm)
 			}).addClass("btn-primary");
 		}
 	},
-	
+
 	enroll: function(frm) {
 		frappe.model.open_mapped_doc({
 			method: "erpnext.schools.api.enroll_student",
diff --git a/erpnext/schools/doctype/student_applicant/student_applicant.json b/erpnext/schools/doctype/student_applicant/student_applicant.json
index d926bd9..d691c4b 100644
--- a/erpnext/schools/doctype/student_applicant/student_applicant.json
+++ b/erpnext/schools/doctype/student_applicant/student_applicant.json
@@ -182,7 +182,7 @@
    "label": "Naming Series", 
    "length": 0, 
    "no_copy": 0, 
-   "options": "AP.", 
+   "options": "AP", 
    "permlevel": 0, 
    "precision": "", 
    "print_hide": 0, 
@@ -282,6 +282,33 @@
    "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
+   "fieldname": "student_admission", 
+   "fieldtype": "Link", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "ignore_xss_filter": 0, 
+   "in_filter": 0, 
+   "in_list_view": 0, 
+   "label": "Student Admission", 
+   "length": 0, 
+   "no_copy": 0, 
+   "options": "Student Admission", 
+   "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, 
+   "columns": 0, 
    "fieldname": "image", 
    "fieldtype": "Attach Image", 
    "hidden": 1, 
@@ -891,7 +918,7 @@
  "istable": 0, 
  "max_attachments": 0, 
  "menu_index": 0, 
- "modified": "2016-09-23 14:15:25.153128", 
+ "modified": "2016-10-05 12:34:54.897029", 
  "modified_by": "Administrator", 
  "module": "Schools", 
  "name": "Student Applicant", 
@@ -908,6 +935,7 @@
    "export": 1, 
    "if_owner": 0, 
    "import": 1, 
+   "is_custom": 0, 
    "permlevel": 0, 
    "print": 1, 
    "read": 1, 
diff --git a/erpnext/schools/doctype/student_applicant/student_applicant.py b/erpnext/schools/doctype/student_applicant/student_applicant.py
index 01ddefa..e54ea0f 100644
--- a/erpnext/schools/doctype/student_applicant/student_applicant.py
+++ b/erpnext/schools/doctype/student_applicant/student_applicant.py
@@ -8,6 +8,18 @@
 from frappe.model.document import Document
 
 class StudentApplicant(Document):
+	def autoname(self):
+		from frappe.model.naming import set_name_by_naming_series
+		if self.student_admission:
+			naming_series = frappe.db.get_value('Student Admission', self.student_admission,
+				'naming_series_for_student_applicant')
+			print naming_series
+
+			if naming_series:
+				self.naming_series = naming_series
+
+		set_name_by_naming_series(self)
+
 	def validate(self):
 		self.title = " ".join(filter(None, [self.first_name, self.middle_name, self.last_name]))
 
@@ -17,4 +29,5 @@
 			frappe.throw(_("Cannot change status as student {0} is linked with student application {1}").format(student[0].name, self.name))
 
 	def on_payment_authorized(self, *args, **kwargs):
-		self.db_set('paid', 1)
\ No newline at end of file
+		self.db_set('paid', 1)
+		self.submit()
\ No newline at end of file
diff --git a/erpnext/schools/doctype/student_applicant/student_applicant_list.js b/erpnext/schools/doctype/student_applicant/student_applicant_list.js
index 43402d8..cafb2b3 100644
--- a/erpnext/schools/doctype/student_applicant/student_applicant_list.js
+++ b/erpnext/schools/doctype/student_applicant/student_applicant_list.js
@@ -1,7 +1,11 @@
 frappe.listview_settings['Student Applicant'] = {
-	add_fields: [ "application_status"],
+	add_fields: [ "application_status", 'paid'],
+	has_indicator_for_draft: 1,
 	get_indicator: function(doc) {
-		if (doc.application_status=="Applied") {
+		if (doc.paid) {
+			return [__("Paid"), "green", "paid,=,1"];
+		}
+		else if (doc.application_status=="Applied") {
 			return [__("Applied"), "orange", "application_status,=,Applied"];
 		}
 		else if (doc.application_status=="Approved") {
diff --git a/erpnext/setup/doctype/email_digest/templates/default.html b/erpnext/setup/doctype/email_digest/templates/default.html
index 0500dc1..78acbd9 100644
--- a/erpnext/setup/doctype/email_digest/templates/default.html
+++ b/erpnext/setup/doctype/email_digest/templates/default.html
@@ -43,7 +43,8 @@
 
 <!-- issue list -->
 {% if issue_list %}
-<h4 style="{{ section_head }}">{{ _("Open Issues ") }}<span class="badge">({{ issue_count }})</span></h4>
+<h4 style="{{ section_head }}">{{ _("Open Issues ") }}
+	<span class="badge">({{ issue_count }})</span></h4>
 <div>
 {% for t in issue_list %}
     <div style="{{ line_item }}">
@@ -66,7 +67,8 @@
 
 <!-- project list -->
 {% if project_list %}
-<h4 style="{{ section_head }}">{{ _("Open Projects ") }}<span class="badge">({{ project_count }})</span></h4>
+<h4 style="{{ section_head }}">{{ _("Open Projects ") }}
+	<span class="badge">({{ project_count }})</span></h4>
 <div>
 {% for t in project_list %}
     <div style="{{ line_item }}">
@@ -92,7 +94,8 @@
 
 <!-- events -->
 {% if events %}
-<h4 style="{{ section_head }}">{{ _("Upcoming Calendar Events ") }}<span class="badge">({{ event_count }})</span></h4>
+<h4 style="{{ section_head }}">{{ _("Upcoming Calendar Events ") }}
+	<span class="badge">({{ event_count }})</span></h4>
 <div>
 {% for e in events %}
     {% if loop.index==1 or events[loop.index-1].date != e.date %}
@@ -124,7 +127,8 @@
 
 <!-- todo list -->
 {% if todo_list %}
-<h4 style="{{ section_head }}">{{ _("Open To Do ") }}<span class="badge">({{ todo_count }})</span></h4>
+<h4 style="{{ section_head }}">{{ _("Open To Do ") }}
+	<span class="badge">({{ todo_count }})</span></h4>
 <div>
 {% for t in todo_list %}
     <div style="{{ line_item }}">
diff --git a/erpnext/setup/doctype/naming_series/naming_series.py b/erpnext/setup/doctype/naming_series/naming_series.py
index d382d24..60a1270 100644
--- a/erpnext/setup/doctype/naming_series/naming_series.py
+++ b/erpnext/setup/doctype/naming_series/naming_series.py
@@ -25,6 +25,7 @@
 				options = self.get_options(d)
 			except frappe.DoesNotExistError:
 				frappe.msgprint('Unable to find DocType {0}'.format(d))
+				#frappe.pass_does_not_exist_error()
 				continue
 
 			if options:
diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.js b/erpnext/stock/doctype/stock_entry/stock_entry.js
index 7c9e1e6..85166a6 100644
--- a/erpnext/stock/doctype/stock_entry/stock_entry.js
+++ b/erpnext/stock/doctype/stock_entry/stock_entry.js
@@ -348,6 +348,7 @@
 }
 
 cur_frm.cscript.purpose = function(doc, cdt, cdn) {
+	cur_frm.fields_dict.items.grid.refresh();
 	cur_frm.cscript.toggle_related_fields(doc);
 }
 
diff --git a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.js b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.js
index c70613b..2b031d1 100644
--- a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.js
+++ b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.js
@@ -75,6 +75,9 @@
 					frappe.model.set_value(cdt, cdn, "valuation_rate", r.message.rate);
 					frappe.model.set_value(cdt, cdn, "current_qty", r.message.qty);
 					frappe.model.set_value(cdt, cdn, "current_valuation_rate", r.message.rate);
+					frappe.model.set_value(cdt, cdn, "current_amount", r.message.rate * r.message.qty);
+					frappe.model.set_value(cdt, cdn, "amount", r.message.rate * r.message.qty);
+					
 				}
 			});
 		}
@@ -92,7 +95,15 @@
 				}
 			});
 		}
-	}	
+	},
+	set_amount_quantity: function(doc, cdt, cdn) {
+		var d = frappe.model.get_doc(cdt, cdn);
+		if (d.qty & d.valuation_rate) {
+			frappe.model.set_value(cdt, cdn, "amount", flt(d.qty) * flt(d.valuation_rate));
+			frappe.model.set_value(cdt, cdn, "quantity_difference", flt(d.qty) - flt(d.current_qty));
+			frappe.model.set_value(cdt, cdn, "amount_difference", flt(d.amount) - flt(d.current_amount));
+		}
+	}
 });
 
 frappe.ui.form.on("Stock Reconciliation Item", {
@@ -104,7 +115,14 @@
 	},
 	item_code: function(frm, cdt, cdn) {
 		frm.events.set_valuation_rate_and_qty(frm, cdt, cdn);
+	},
+	qty: function(frm, cdt, cdn) {
+		frm.events.set_amount_quantity(frm, cdt, cdn);
+	},
+	valuation_rate: function(frm, cdt, cdn) {
+		frm.events.set_amount_quantity(frm, cdt, cdn);
 	}
+	
 });
 
 erpnext.stock.StockReconciliation = erpnext.stock.StockController.extend({
diff --git a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.json b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.json
index 291f14d..0c1c10c 100644
--- a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.json
+++ b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.json
@@ -389,7 +389,7 @@
  "istable": 0, 
  "max_attachments": 1, 
  "menu_index": 0, 
- "modified": "2016-09-02 04:09:18.909485", 
+ "modified": "2016-10-05 13:03:39.887647", 
  "modified_by": "Administrator", 
  "module": "Stock", 
  "name": "Stock Reconciliation", 
@@ -405,6 +405,7 @@
    "export": 0, 
    "if_owner": 0, 
    "import": 0, 
+   "is_custom": 0, 
    "permlevel": 0, 
    "print": 0, 
    "read": 1, 
diff --git a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py
index 0f5cb96..4ab49e5 100644
--- a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py
+++ b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py
@@ -27,6 +27,7 @@
 		self.remove_items_with_no_change()
 		self.validate_data()
 		self.validate_expense_account()
+		self.set_total_qty_and_amount()
 
 	def on_submit(self):
 		self.update_stock_ledger()
@@ -236,6 +237,13 @@
 		elif not frappe.db.sql("""select name from `tabStock Ledger Entry` limit 1"""):
 			if frappe.db.get_value("Account", self.expense_account, "report_type") == "Profit and Loss":
 				frappe.throw(_("Difference Account must be a Asset/Liability type account, since this Stock Reconciliation is an Opening Entry"), OpeningEntryAccountError)
+				
+	def set_total_qty_and_amount(self):
+		for d in self.get("items"):
+			d.amount = flt(d.qty) * flt(d.valuation_rate)
+			d.current_amount = flt(d.current_qty) * flt(d.current_valuation_rate)
+			d.quantity_difference = flt(d.qty) - flt(d.current_qty)
+			d.amount_difference = flt(d.amount) - flt(d.current_amount)
 
 	def get_items_for(self, warehouse):
 		self.items = []
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 efd0dee..5452aa1 100644
--- a/erpnext/stock/doctype/stock_reconciliation_item/stock_reconciliation_item.json
+++ b/erpnext/stock/doctype/stock_reconciliation_item/stock_reconciliation_item.json
@@ -173,7 +173,7 @@
    "bold": 0, 
    "collapsible": 0, 
    "columns": 2, 
-   "description": "Do not include symbols (ex. $)", 
+   "description": "", 
    "fieldname": "valuation_rate", 
    "fieldtype": "Currency", 
    "hidden": 0, 
@@ -200,6 +200,32 @@
    "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
+   "fieldname": "amount", 
+   "fieldtype": "Currency", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "ignore_xss_filter": 0, 
+   "in_filter": 0, 
+   "in_list_view": 0, 
+   "label": "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, 
+   "columns": 0, 
    "fieldname": "section_break_3", 
    "fieldtype": "Section Break", 
    "hidden": 0, 
@@ -207,6 +233,7 @@
    "ignore_xss_filter": 0, 
    "in_filter": 0, 
    "in_list_view": 0, 
+   "label": "Before reconciliation", 
    "length": 0, 
    "no_copy": 0, 
    "permlevel": 0, 
@@ -225,7 +252,7 @@
    "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
-   "description": "Before reconciliation", 
+   "description": "", 
    "fieldname": "current_qty", 
    "fieldtype": "Float", 
    "hidden": 0, 
@@ -277,9 +304,9 @@
    "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
-   "description": "Before reconciliation", 
+   "description": "", 
    "fieldname": "current_valuation_rate", 
-   "fieldtype": "Read Only", 
+   "fieldtype": "Currency", 
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
@@ -298,6 +325,135 @@
    "search_index": 0, 
    "set_only_once": 0, 
    "unique": 0
+  }, 
+  {
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "description": "", 
+   "fieldname": "current_amount", 
+   "fieldtype": "Currency", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "ignore_xss_filter": 0, 
+   "in_filter": 0, 
+   "in_list_view": 0, 
+   "label": "Current 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, 
+   "columns": 0, 
+   "fieldname": "section_break_14", 
+   "fieldtype": "Section Break", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "ignore_xss_filter": 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, 
+   "columns": 0, 
+   "fieldname": "quantity_difference", 
+   "fieldtype": "Read Only", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "ignore_xss_filter": 0, 
+   "in_filter": 0, 
+   "in_list_view": 0, 
+   "label": "Quantity Difference", 
+   "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, 
+   "columns": 0, 
+   "fieldname": "column_break_16", 
+   "fieldtype": "Column Break", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "ignore_xss_filter": 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, 
+   "columns": 0, 
+   "fieldname": "amount_difference", 
+   "fieldtype": "Currency", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "ignore_xss_filter": 0, 
+   "in_filter": 0, 
+   "in_list_view": 0, 
+   "label": "Amount Difference", 
+   "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
   }
  ], 
  "hide_heading": 0, 
@@ -311,7 +467,7 @@
  "istable": 1, 
  "max_attachments": 0, 
  "menu_index": 0, 
- "modified": "2016-09-05 07:10:19.571562", 
+ "modified": "2016-09-28 06:43:53.764287", 
  "modified_by": "Administrator", 
  "module": "Stock", 
  "name": "Stock Reconciliation Item", 
diff --git a/erpnext/stock/get_item_details.py b/erpnext/stock/get_item_details.py
index 1e3bd8a..e5dd735 100644
--- a/erpnext/stock/get_item_details.py
+++ b/erpnext/stock/get_item_details.py
@@ -328,10 +328,11 @@
 
 @frappe.whitelist()
 def get_pos_profile(company):
+	condition = "and company = '%s'"%(company) if company else ''
 	pos_profile = frappe.db.sql("""select * from `tabPOS Profile` where user = %s
-		and company = %s""", (frappe.session['user'], company), as_dict=1)
+		{cond}""".format(cond=condition), (frappe.session['user']), as_dict=1)
 
-	if not pos_profile:
+	if not pos_profile and company:
 		pos_profile = frappe.db.sql("""select * from `tabPOS Profile`
 			where ifnull(user,'') = '' and company = %s""", company, as_dict=1)
 
diff --git a/erpnext/templates/generators/student_admission.html b/erpnext/templates/generators/student_admission.html
index edb08c8..98b9b4a 100644
--- a/erpnext/templates/generators/student_admission.html
+++ b/erpnext/templates/generators/student_admission.html
@@ -19,7 +19,9 @@
 {%- if application_form_route -%}
 <p>
 	<a class='btn btn-primary'
-	href='/{{ doc.application_form_route }}?program={{ doc.program }}&academic_year={{ doc.academic_year }}&new=1'>
+	href='/{{ doc.application_form_route }}?new=1&student_admission={{ doc.name }}
+		{%- if doc.program -%}&program={{ doc.program }}{%- endif -%}
+		{%- if doc.academic_year -%}&academic_year={{ doc.academic_year }}{%- endif -%}'>
 	{{ _("Apply Now") }}</a>
 </p>
 {% endif %}
diff --git a/erpnext/templates/includes/navbar/navbar_items.html b/erpnext/templates/includes/navbar/navbar_items.html
index c7af2fd..f0c780d 100644
--- a/erpnext/templates/includes/navbar/navbar_items.html
+++ b/erpnext/templates/includes/navbar/navbar_items.html
@@ -1,7 +1,7 @@
 {% extends 'frappe/templates/includes/navbar/navbar_items.html' %}
 
 {% block navbar_right_extension %}
-	<li class="shopping-cart">
+	<li class="shopping-cart hidden">
 		<div class="cart-icon small">
 			<a class="dropdown-toggle" href="#" data-toggle="dropdown" id="navLogin">
 				Cart <span class="badge-wrapper" id="cart-count"></span>