Merge pull request #7106 from pratu16x7/doc-fixes

CRM: Customer page fixes
diff --git a/erpnext/config/schools.py b/erpnext/config/schools.py
index 7a415f0..c35c1f2 100644
--- a/erpnext/config/schools.py
+++ b/erpnext/config/schools.py
@@ -56,6 +56,41 @@
 			]
 		},
 		{
+			"label": _("Attendance"),
+			"items": [
+				{
+					"type": "doctype",
+					"name": "Student Attendance"
+				},
+				{
+					"type": "doctype",
+					"name": "Student Leave Application"
+				},
+				{
+					"type": "doctype",
+					"name": "Student Batch Attendance Tool"
+				},
+				{
+					"type": "report",
+					"is_query_report": True,
+					"name": "Absent Student Report",
+					"doctype": "Attendance"
+				},
+				{
+					"type": "report",
+					"is_query_report": True,
+					"name": "Student Batch-Wise Attendance",
+					"doctype": "Attendance"
+				},
+				{
+					"type": "report",
+					"is_query_report": True,
+					"name": "Student Monthly Attendance Sheet",
+					"doctype": "Attendance"
+				}
+			]
+		},
+		{
 			"label": _("Schedule"),
 			"items": [
 				{
@@ -65,15 +100,7 @@
 				},
 				{
 					"type": "doctype",
-					"name": "Student Attendance"
-				},
-				{
-					"type": "doctype",
 					"name": "Course Scheduling Tool"
-				},
-				{
-					"type": "doctype",
-					"name": "Student Batch Attendance Tool"
 				}
 			]
 		},
diff --git a/erpnext/docs/assets/img/crm/make-sq-from-opportunity.png b/erpnext/docs/assets/img/crm/make-sq-from-opportunity.png
new file mode 100644
index 0000000..9d41027
--- /dev/null
+++ b/erpnext/docs/assets/img/crm/make-sq-from-opportunity.png
Binary files differ
diff --git a/erpnext/docs/assets/img/crm/requirement-gathering.png b/erpnext/docs/assets/img/crm/requirement-gathering.png
new file mode 100644
index 0000000..cd631d6
--- /dev/null
+++ b/erpnext/docs/assets/img/crm/requirement-gathering.png
Binary files differ
diff --git a/erpnext/docs/assets/img/manufacturing/PO-FG-update.png b/erpnext/docs/assets/img/manufacturing/PO-FG-update.png
index b07a7cf..97ce265 100644
--- a/erpnext/docs/assets/img/manufacturing/PO-FG-update.png
+++ b/erpnext/docs/assets/img/manufacturing/PO-FG-update.png
Binary files differ
diff --git a/erpnext/docs/assets/img/manufacturing/PO-material-transfer-qty.png b/erpnext/docs/assets/img/manufacturing/PO-material-transfer-qty.png
index e8dea02..6191e13 100644
--- a/erpnext/docs/assets/img/manufacturing/PO-material-transfer-qty.png
+++ b/erpnext/docs/assets/img/manufacturing/PO-material-transfer-qty.png
Binary files differ
diff --git a/erpnext/docs/assets/img/manufacturing/PO-material-transfer-updated.png b/erpnext/docs/assets/img/manufacturing/PO-material-transfer-updated.png
index 5c20ff8..0cd0bd1 100644
--- a/erpnext/docs/assets/img/manufacturing/PO-material-transfer-updated.png
+++ b/erpnext/docs/assets/img/manufacturing/PO-material-transfer-updated.png
Binary files differ
diff --git a/erpnext/docs/assets/img/manufacturing/PO-material-transfer.png b/erpnext/docs/assets/img/manufacturing/PO-material-transfer.png
index dbdc303..c323628 100644
--- a/erpnext/docs/assets/img/manufacturing/PO-material-transfer.png
+++ b/erpnext/docs/assets/img/manufacturing/PO-material-transfer.png
Binary files differ
diff --git a/erpnext/docs/assets/img/manufacturing/PO-operations-make-ts.png b/erpnext/docs/assets/img/manufacturing/PO-operations-make-ts.png
new file mode 100644
index 0000000..07b5170
--- /dev/null
+++ b/erpnext/docs/assets/img/manufacturing/PO-operations-make-ts.png
Binary files differ
diff --git a/erpnext/docs/assets/img/manufacturing/PO-operations.png b/erpnext/docs/assets/img/manufacturing/PO-operations.png
index 6916891..4b091ce 100644
--- a/erpnext/docs/assets/img/manufacturing/PO-operations.png
+++ b/erpnext/docs/assets/img/manufacturing/PO-operations.png
Binary files differ
diff --git a/erpnext/docs/assets/img/manufacturing/PO-stop.png b/erpnext/docs/assets/img/manufacturing/PO-stop.png
index c486a68..0c82573 100644
--- a/erpnext/docs/assets/img/manufacturing/PO-stop.png
+++ b/erpnext/docs/assets/img/manufacturing/PO-stop.png
Binary files differ
diff --git a/erpnext/docs/assets/img/manufacturing/manufacturing-flow.png b/erpnext/docs/assets/img/manufacturing/manufacturing-flow.png
new file mode 100644
index 0000000..4701ad0
--- /dev/null
+++ b/erpnext/docs/assets/img/manufacturing/manufacturing-flow.png
Binary files differ
diff --git a/erpnext/docs/assets/img/manufacturing/production-order.png b/erpnext/docs/assets/img/manufacturing/production-order.png
index d1e7966..fb552f3 100644
--- a/erpnext/docs/assets/img/manufacturing/production-order.png
+++ b/erpnext/docs/assets/img/manufacturing/production-order.png
Binary files differ
diff --git a/erpnext/docs/assets/img/selling/selling-flow.png b/erpnext/docs/assets/img/selling/selling-flow.png
new file mode 100644
index 0000000..7f35f80
--- /dev/null
+++ b/erpnext/docs/assets/img/selling/selling-flow.png
Binary files differ
diff --git a/erpnext/docs/assets/img/taxes-and-charges.gif b/erpnext/docs/assets/img/taxes-and-charges.gif
new file mode 100644
index 0000000..8d0a2bc
--- /dev/null
+++ b/erpnext/docs/assets/img/taxes-and-charges.gif
Binary files differ
diff --git a/erpnext/docs/user/manual/en/CRM/opportunity.md b/erpnext/docs/user/manual/en/CRM/opportunity.md
index 9f44fdf..9248fb2 100644
--- a/erpnext/docs/user/manual/en/CRM/opportunity.md
+++ b/erpnext/docs/user/manual/en/CRM/opportunity.md
@@ -1,5 +1,5 @@
 When you know a Lead is looking for some products or services to buy, you can
-track that as an Opportunity.
+track that as an Opportunity. Also opportunity document helps user to collect the requirement of a customer/lead.
 
 You can create an Opportunity from:
 
@@ -17,11 +17,21 @@
 
 <img class="screenshot" alt="Opportunity" src="{{docs_base_url}}/assets/img/crm/lead-to-opportunity.png">
 
+#### Figure 3: Create Opportunity for Customer to Collect their Requirement
+
+<img class="screenshot" alt="Opportunity" src="{{docs_base_url}}/assets/img/crm/requirement-gathering.png">
+
+
 An Opportunity can also come from an existing Customer. You can create
 multiple Opportunities against the same Lead. In Opportunity, apart from the
 Communication, you can also add the Items for which the Lead or Contact is
 looking for.
 
+#### Make Supplier Quotation
+In some business, user collect the rates from their supplier against the customer requirement and based on the supplier rates they prepare the quotation for the customer. In ERPNext user get an option to make supplier quotation from the opportunity.
+
+<img class="screenshot" alt="Opportunity" src="{{docs_base_url}}/assets/img/crm/make-sq-from-opportunity.png">
+
 > Best Practice: Leads and Opportunities are often referred as your “Sales
 Pipeline” this is what you need to track if you want to be able to predict how
 much business you are going to get in the future. Its always a good idea to be
diff --git a/erpnext/docs/user/manual/en/manufacturing/production-order.md b/erpnext/docs/user/manual/en/manufacturing/production-order.md
index 1720db9..2f0fef3 100644
--- a/erpnext/docs/user/manual/en/manufacturing/production-order.md
+++ b/erpnext/docs/user/manual/en/manufacturing/production-order.md
@@ -1,3 +1,4 @@
+<img class="screenshot" alt="Production Order" src="{{docs_base_url}}/assets/img/manufacturing/manufacturing-flow.png">
 Production Order (also called as Work Order) is a document that is given to
 the manufacturing shop floor by the Production Planner as a signal to produce
 a certain quantity of a certain Item. Production Order also helps to generate
@@ -45,7 +46,7 @@
 * Once you have submitted your Production Order, you need to Transfer the Raw Materials to initiate the Manufacturing Process.
 * This will create a Stock Entry with all the Items required to complete this Production Order to be added to the WIP Warehouse. (this will add sub-Items with BOM as one Item or explode their children based on your setting above).
 
-* Click on 'Transfer Materials for Manufacturing'.
+* Click on 'Start'.
 
 <img class="screenshot" alt="Transfer Materials" src="{{docs_base_url}}/assets/img/manufacturing/PO-material-transfer.png">
 
@@ -63,18 +64,18 @@
 
 ### Making Time Logs
 
-* Progress in the Production Order can be tracked using [Time Log]({{docs_base_url}}/user/manual/en/projects/time-log.html)
-* Time Logs are created against Production Order Operations.
-* Drafts of Time Logs are also created based on the scheduled operations when an Production Order is Submitted.
-* To create more Time Logs against an operation select 'Make TIme Log' in the respective operation.
+* Progress in the Production Order can be tracked using [Timesheet]({{docs_base_url}}/user/manual/en/projects/timesheet/timesheet-against-production-order.html)
+* Timesheet's time slots are created against Production Order Operations.
+* Drafts of Timesheet is created based on the scheduled operations when an Production Order is Submitted.
+* To create more Timesheet against an operation click 'Make Timesheet' button.
 
-<img class="screenshot" alt="Make TL against PO" src="{{docs_base_url}}/assets/img/manufacturing/PO-operations-make-tl.png">
+<img class="screenshot" alt="Make timesheet against PO" src="{{docs_base_url}}/assets/img/manufacturing/PO-operations-make-ts.png">
 
 ###Updating Finished Goods
 
 * Once you are done with the Production Order you need to update the Finished Goods.
 * This will create a Stock Entry that will deduct all the sub-Items from the WIP Warehouse and add them to the Finished Goods Warehouse.
-* Click on 'Update Finished Goods'.
+* Click on 'Finish'.
 
 <img class="screenshot" alt="Update Finished Goods" src="{{docs_base_url}}/assets/img/manufacturing/PO-FG-update.png">
 
diff --git a/erpnext/docs/user/manual/en/selling/quotation.md b/erpnext/docs/user/manual/en/selling/quotation.md
index 6f5cc5e..1f7b06c 100644
--- a/erpnext/docs/user/manual/en/selling/quotation.md
+++ b/erpnext/docs/user/manual/en/selling/quotation.md
@@ -1,9 +1,13 @@
 During a sale, the customer may request for a written note about the products
 or services you are planning to offer, along with the prices and other terms
 of engagement. This is called a “Proposal” or an “Estimate” or a “Pro Forma
-Invoice”or a Quotation.
+Invoice”or a **Quotation**.
 
-To create a new Quotation go to:
+A typical Selling flow looks like:
+
+<img class="screenshot" alt="Make Quotation from Opportunity" src="{{docs_base_url}}/assets/img/selling/selling-flow.png">
+
+To create a new Quotation navigate to:
 
 > Selling > Quotation > New Quotation
 
@@ -13,23 +17,18 @@
 
 <img class="screenshot" alt="Make Quotation from Opportunity" src="{{docs_base_url}}/assets/img/selling/make-quote-from-opp.png">
 
-Or You can create a new Quotation and pull details from an Opportunity.
-
-<img class="screenshot" alt="Make Quotation from Opportunity" src="{{docs_base_url}}/assets/img/selling/make-quotation.gif">
-
 A Quotation contains details about:
 
   * The recipient of the Quotation
   * The Items and quantities you are offering.
-  * The rates at which they are offered. For details refer 
+  * The rates at which they are offered.
   * The taxes applicable.
   * Other charges (like shipping, insurance) if applicable.
   * The validity of contract.
   * The time of delivery.
   * Other conditions.
 
-> Tip: Images look great on Quotations. To add images to your Quotations,
-attach the corresponding image in the Item master.
+> Tip: Images look great on Quotations. Make sure your items have an image attached.
 
 ### Rates
 
@@ -41,11 +40,13 @@
 
 ### Taxes
 
-To add taxes to your Quotation, you can either select a tax template, Sales
-Taxes and Charges Template or add the taxes on your own. To understand taxes in
-detail visit [Taxes]({{docs_base_url}}/user/manual/en/setting-up/setting-up-taxes.html)
+To add taxes to your Quotation, you can select a **Sales Taxes and Charges Template** or add the taxes on your own.
 
-You can add taxes in the same manner as the Sales Taxes and Charges Template.
+For e.g
+
+<img class="screenshot" alt="Taxes and Charges" src="{{docs_base_url}}/assets/img/selling/taxes-and-charges.gif">
+
+To understand taxes in detail visit [Taxes]({{docs_base_url}}/user/manual/en/setting-up/setting-up-taxes.html).
 
 ### Terms and Conditions
 
@@ -71,19 +72,17 @@
 
 Quotation is a “Submittable” transaction. Since you send this Quotation to
 your Customer or Lead, you must freeze it so that changes are not made after
-you send the Quotation. See Document Stages.
+you send the Quotation.
 
 > Tip: Quotations can also be titled as “Proforma Invoice” or “Proposal”.
-Select the right heading in the “Print Heading” field in the “More Info”
-section. To create new Print Headings go to Setup > Branding and Printing >
-Print Headings.
+You can do this by selecting a **Print Heading** in the **Print Settings**
+section. To create new Print Headings go to Setup > Printing >
+Print Heading.
 
 ### Discount
 
 While making your sales transactions like a Quotation (or Sales Order) you
-would already have noticed that there is a “Discount” column. On the left is
-the “Price List Rate” on the right is the “Basic Rate”. You can add a
-“Discount” value to update the basic rate. To understand more about discount
-read [Discount.](http://erpnext.org/discount)
+can also give discounts to your customers. In the Discount section, add
+the discount in percentage or fixed amount. Read [Discount](https://frappe.github.io/erpnext/user/manual/en/selling/articles/applying-discount) for more explanation.
 
 {next}
diff --git a/erpnext/docs/user/manual/en/selling/sales-order.md b/erpnext/docs/user/manual/en/selling/sales-order.md
index 269473a..32e58a5 100644
--- a/erpnext/docs/user/manual/en/selling/sales-order.md
+++ b/erpnext/docs/user/manual/en/selling/sales-order.md
@@ -50,6 +50,16 @@
 This “reserved” quantity will help you project what is the quantity you need
 to purchase based on all your commitments.
 
+### Taxes
+
+To add taxes to your Quotation, you can select a **Sales Taxes and Charges Template** or add the taxes on your own.
+
+For e.g
+
+<img class="screenshot" alt="Taxes and Charges" src="{{docs_base_url}}/assets/img/selling/taxes-and-charges.gif">
+
+To understand taxes in detail visit [Taxes]({{docs_base_url}}/user/manual/en/setting-up/setting-up-taxes.html).
+
 ### Sales Team
 
 **Sales Partner:** If this Sale was booked via a Sales Partner, you can update the Sales Partner’s details with commission and other info that you can aggregate.
diff --git a/erpnext/docs/user/manual/en/using-erpnext/articles/merging-documents.md b/erpnext/docs/user/manual/en/using-erpnext/articles/merging-documents.md
index 15dd117..f03bbd8 100644
--- a/erpnext/docs/user/manual/en/using-erpnext/articles/merging-documents.md
+++ b/erpnext/docs/user/manual/en/using-erpnext/articles/merging-documents.md
@@ -1,6 +1,6 @@
 #Merging Documents
 
-For a document, of you have two records which are identical, and meant for common purpose, you can merge them into one record.
+For a document, if you have two records which are identical, and meant for common purpose, you can merge them into one record.
 
 Following are step to merge documents. Let's assume we are merging two Accounts.
 
@@ -10,7 +10,7 @@
 
 #### Step 2: Go to Account 
 
-For an Account to be merge, click on "Rename" option.
+For an Account to be merged, click on the "Rename" option.
 
 <img alt="Sales Order File Attachment" class="screenshot" src="{{docs_base_url}}/assets/img/articles/merge-docs-1.png">
 
@@ -18,7 +18,7 @@
 
 In the New Name field, enter another account name with which this account will be merged. Check "Merge with existing" option. Then press 'Rename' button to merge.
 
-Following is how merged account will appear in the Chart of Account master.
+Following is how the merged account will appear in the Chart of Accounts master.
 
 <img alt="Sales Order File Attachment" class="screenshot" src="{{docs_base_url}}/assets/img/articles/merge-docs-2.gif">
 
@@ -28,4 +28,4 @@
 
 <div class="well"> Note: Group Account cannot be merged into Child Account and vice versa.</div>
 
-<!-- markdown -->
\ No newline at end of file
+<!-- markdown -->
diff --git a/erpnext/public/js/utils.js b/erpnext/public/js/utils.js
index 39e87f8..c80d418 100644
--- a/erpnext/public/js/utils.js
+++ b/erpnext/public/js/utils.js
@@ -143,8 +143,35 @@
 			if(!cur_frm.doc.items[0].item_code) {
 				cur_frm.doc.items = cur_frm.doc.items.splice(1);
 			}
+
+			// find the doctype of the items table
+			var items_doctype = frappe.meta.get_docfield(cur_frm.doctype, 'items').options;
+			
+			// find the link fieldname from items table for the given
+			// source_doctype
+			var link_fieldname = null;
+			frappe.get_meta(items_doctype).fields.forEach(function(d) { 
+				if(d.options===opts.source_doctype) link_fieldname = d.fieldname; });
+
+			// search in existing items if the source_name is already set
+			var already_set = false;
+
+			$.each(cur_frm.doc.items, function(i, d) {
+				if(d[link_fieldname]==opts.source_name) {
+					already_set = true;
+					return false;
+				}
+			});
+
+			if(already_set) {
+				frappe.msgprint(__("You have already selected items from {0} {1}", 
+					[opts.source_doctype, opts.source_name]));
+				return;
+			}
+
 		}
 
+
 		return frappe.call({
 			// Sometimes we hit the limit for URL length of a GET request
 			// as we send the full target_doc. Hence this is a POST request.
diff --git a/erpnext/schools/doctype/assessment/assessment.js b/erpnext/schools/doctype/assessment/assessment.js
index efadbd6..e842f41 100644
--- a/erpnext/schools/doctype/assessment/assessment.js
+++ b/erpnext/schools/doctype/assessment/assessment.js
@@ -6,46 +6,46 @@
 cur_frm.add_fetch("supervisor", "instructor_name", "supervisor_name");
 cur_frm.add_fetch("student", "title", "student_name");
 
-frappe.ui.form.on("Assessment" ,{
-	student_group : function(frm) {
-		frm.set_value("results" ,"");
-		if (frm.doc.student_group) {
-			frappe.call({
-				method: "erpnext.schools.api.get_student_group_students",
-				args: {
-					"student_group": frm.doc.student_group
-				},
-				callback: function(r) {
-					if (r.message) {
-						$.each(r.message, function(i, d) {
-							var row = frappe.model.add_child(cur_frm.doc, "Assessment Result", "results");
-							row.student = d.student;
-							row.student_name = d.student_name;
-						});
-					}
-					refresh_field("results");
-				}
-			});
-		}
-	}
+frappe.ui.form.on("Assessment", {
+    student_group: function(frm) {
+        frm.set_value("results", "");
+        if (frm.doc.student_group) {
+            frappe.call({
+                method: "erpnext.schools.api.get_student_group_students",
+                args: {
+                    "student_group": frm.doc.student_group
+                },
+                callback: function(r) {
+                    if (r.message) {
+                        $.each(r.message, function(i, d) {
+                            var row = frappe.model.add_child(cur_frm.doc, "Assessment Result", "results");
+                            row.student = d.student;
+                            row.student_name = d.student_name;
+                        });
+                    }
+                    refresh_field("results");
+                }
+            });
+        }
+    }
 });
 
-frappe.ui.form.on("Assessment Result" ,{
-	result : function(frm, cdt, cdn) {
-		if(frm.doc.grading_structure){
-			var assessment_result = locals[cdt][cdn];
-			frappe.call({
-				method:"erpnext.schools.doctype.assessment.assessment.get_grade",
-				args:{
-					grading_structure: frm.doc.grading_structure,
-					result: assessment_result.result
-				},
-				callback: function(r){
-					if(r.message){
-						frappe.model.set_value(cdt, cdn, 'grade', r.message);
-					}
-				}
-			});
-		}
-	}
+frappe.ui.form.on("Assessment Result", {
+    result: function(frm, cdt, cdn) {
+        if (frm.doc.grading_structure) {
+            var assessment_result = locals[cdt][cdn];
+            frappe.call({
+                method: "erpnext.schools.doctype.assessment.assessment.get_grade",
+                args: {
+                    grading_structure: frm.doc.grading_structure,
+                    result: assessment_result.result
+                },
+                callback: function(r) {
+                    if (r.message) {
+                        frappe.model.set_value(cdt, cdn, 'grade', r.message);
+                    }
+                }
+            });
+        }
+    }
 });
\ No newline at end of file
diff --git a/erpnext/schools/doctype/assessment/assessment.py b/erpnext/schools/doctype/assessment/assessment.py
index cb307cb..003b427 100644
--- a/erpnext/schools/doctype/assessment/assessment.py
+++ b/erpnext/schools/doctype/assessment/assessment.py
@@ -10,7 +10,7 @@
 class Assessment(Document):
 	def validate(self):
 		self.validate_overlap()
-	
+
 	def validate_overlap(self):
 		"""Validates overlap for Student Group/Student Batch, Instructor, Room"""
 		
diff --git a/erpnext/schools/doctype/course_schedule/course_schedule.js b/erpnext/schools/doctype/course_schedule/course_schedule.js
index ab34ae9..04a8cde 100644
--- a/erpnext/schools/doctype/course_schedule/course_schedule.js
+++ b/erpnext/schools/doctype/course_schedule/course_schedule.js
@@ -1,137 +1,134 @@
 frappe.provide("schools")
 
-frappe.ui.form.on("Course Schedule" ,{
-	onload: function(frm) {
-		if (frm.doc.from_datetime && frm.doc.to_datetime) {
-			var from_datetime = moment(frm.doc.from_datetime);
-			var to_datetime = moment(frm.doc.to_datetime);
-			frm.doc.schedule_date = from_datetime.format(moment.defaultFormat);
-			frm.doc.from_time = from_datetime.format("HH:mm:ss");
-			frm.doc.to_time = to_datetime.format("HH:mm:ss");
-		}
-	},
-	
-	refresh :function(frm) {
-		if(!frm.doc.__islocal && frm.doc.student_group) {
-			frappe.call({
-				method: "erpnext.schools.api.check_attendance_records_exist",
-				args: {
-					"course_schedule": frm.doc.name
-				},
-				callback: function(r) {
-					if(r.message) {
-						hide_field('attendance');
-						frm.events.view_attendance(frm)
-					}
-					else {
-						frappe.call({
-							method: "erpnext.schools.api.get_student_group_students",
-							args: {
-								"student_group": frm.doc.student_group
-							},
-							callback: function(r) {
-								if (r.message) {
-									frm.events.get_students(frm, r.message)
-								}
-							}
-						});
-					}
-				}
-			});
-		}
-		else {
-			hide_field('attendance');
-		}
-	},
-	
-	view_attendance: function(frm) {
-		hide_field('attendance');
-		frm.add_custom_button(__("View attendance"), function() {
-			frappe.route_options = {
-				course_schedule: frm.doc.name
-			}
-			frappe.set_route("List", "Student Attendance");
-		});
-	},
-	
-	get_students: function(frm, students) {
-		if(!frm.students_area) {
-		frm.students_area = $('<div>')
-			.appendTo(frm.fields_dict.students_html.wrapper);
-		}
-		frm.students_editor = new schools.StudentsEditor(frm, frm.students_area, students)
-	}
+frappe.ui.form.on("Course Schedule", {
+    onload: function(frm) {
+        if (frm.doc.from_datetime && frm.doc.to_datetime) {
+            var from_datetime = moment(frm.doc.from_datetime);
+            var to_datetime = moment(frm.doc.to_datetime);
+            frm.doc.schedule_date = from_datetime.format(moment.defaultFormat);
+            frm.doc.from_time = from_datetime.format("HH:mm:ss");
+            frm.doc.to_time = to_datetime.format("HH:mm:ss");
+        }
+    },
+
+    refresh: function(frm) {
+        if (!frm.doc.__islocal && frm.doc.student_group) {
+            frappe.call({
+                method: "erpnext.schools.api.check_attendance_records_exist",
+                args: {
+                    "course_schedule": frm.doc.name
+                },
+                callback: function(r) {
+                    if (r.message) {
+                        hide_field('attendance');
+                        frm.events.view_attendance(frm)
+                    } else {
+                        frappe.call({
+                            method: "erpnext.schools.api.get_student_group_students",
+                            args: {
+                                "student_group": frm.doc.student_group
+                            },
+                            callback: function(r) {
+                                if (r.message) {
+                                    frm.events.get_students(frm, r.message)
+                                }
+                            }
+                        });
+                    }
+                }
+            });
+        } else {
+            hide_field('attendance');
+        }
+    },
+
+    view_attendance: function(frm) {
+        hide_field('attendance');
+        frm.add_custom_button(__("View attendance"), function() {
+            frappe.route_options = {
+                course_schedule: frm.doc.name
+            }
+            frappe.set_route("List", "Student Attendance");
+        });
+    },
+
+    get_students: function(frm, students) {
+        if (!frm.students_area) {
+            frm.students_area = $('<div>')
+                .appendTo(frm.fields_dict.students_html.wrapper);
+        }
+        frm.students_editor = new schools.StudentsEditor(frm, frm.students_area, students)
+    }
 });
 
 
 schools.StudentsEditor = Class.extend({
-	init: function(frm, wrapper, students) {
-		this.wrapper = wrapper;
-		this.frm = frm;
-		this.make(frm, students);
-	},
-	make: function(frm, students) {
-		var me = this;
-		
-		$(this.wrapper).empty();
-		var student_toolbar = $('<p>\
+    init: function(frm, wrapper, students) {
+        this.wrapper = wrapper;
+        this.frm = frm;
+        this.make(frm, students);
+    },
+    make: function(frm, students) {
+        var me = this;
+
+        $(this.wrapper).empty();
+        var student_toolbar = $('<p>\
 			<button class="btn btn-default btn-add btn-xs" style="margin-right: 5px;"></button>\
 			<button class="btn btn-xs btn-default btn-remove" style="margin-right: 5px;"></button>\
 			<button class="btn btn-default btn-primary btn-mark-att btn-xs"></button></p>').appendTo($(this.wrapper));
 
-		student_toolbar.find(".btn-add")
-			.html(__('Check all'))
-			.on("click", function() {
-			$(me.wrapper).find('input[type="checkbox"]').each(function(i, check) {
-				if(!$(check).is(":checked")) {
-					check.checked = true;
-				}
-			});
-		});
+        student_toolbar.find(".btn-add")
+            .html(__('Check all'))
+            .on("click", function() {
+                $(me.wrapper).find('input[type="checkbox"]').each(function(i, check) {
+                    if (!$(check).is(":checked")) {
+                        check.checked = true;
+                    }
+                });
+            });
 
-		student_toolbar.find(".btn-remove")
-			.html(__('Uncheck all'))
-			.on("click", function() {
-			$(me.wrapper).find('input[type="checkbox"]').each(function(i, check) {
-				if($(check).is(":checked")) {
-					check.checked = false;
-				}
-			});
-		});
-		
-		student_toolbar.find(".btn-mark-att")
-			.html(__('Mark Attendence'))
-			.on("click", function() {
-				var students_present = [];
-				var students_absent = [];
-				$(me.wrapper).find('input[type="checkbox"]').each(function(i, check) {
-					if($(check).is(":checked")) {
-						students_present.push(students[i]);
-					}
-					else {
-						students_absent.push(students[i]);
-					}
-				});
-				frappe.call({
-					method: "erpnext.schools.api.mark_attendance",
-					args: {
-						"students_present": students_present,
-						"students_absent": students_absent,
-						"course_schedule": frm.doc.name
-					},
-					callback: function(r) {
-						frm.events.view_attendance(frm)
-					}
-				});
-		});
+        student_toolbar.find(".btn-remove")
+            .html(__('Uncheck all'))
+            .on("click", function() {
+                $(me.wrapper).find('input[type="checkbox"]').each(function(i, check) {
+                    if ($(check).is(":checked")) {
+                        check.checked = false;
+                    }
+                });
+            });
 
-		
-		$.each(students, function(i, m) {
-			$(repl('<div class="col-sm-6">\
+        student_toolbar.find(".btn-mark-att")
+            .html(__('Mark Attendence'))
+            .on("click", function() {
+                var students_present = [];
+                var students_absent = [];
+                $(me.wrapper).find('input[type="checkbox"]').each(function(i, check) {
+                    if ($(check).is(":checked")) {
+                        students_present.push(students[i]);
+                    } else {
+                        students_absent.push(students[i]);
+                    }
+                });
+                frappe.call({
+                    method: "erpnext.schools.api.mark_attendance",
+                    args: {
+                        "students_present": students_present,
+                        "students_absent": students_absent,
+                        "course_schedule": frm.doc.name
+                    },
+                    callback: function(r) {
+                        frm.events.view_attendance(frm)
+                    }
+                });
+            });
+
+
+        $.each(students, function(i, m) {
+            $(repl('<div class="col-sm-6">\
 				<div class="checkbox">\
 				<label><input type="checkbox" class="students-check" student="%(student)s">\
 				%(student)s</label>\
-			</div></div>', {student: m.student_name})).appendTo(me.wrapper);
-		});
-	}
+			</div></div>', { student: m.student_name })).appendTo(me.wrapper);
+        });
+    }
 })
\ No newline at end of file
diff --git a/erpnext/schools/doctype/course_schedule/course_schedule.json b/erpnext/schools/doctype/course_schedule/course_schedule.json
index 4a4b2d3..122285e 100644
--- a/erpnext/schools/doctype/course_schedule/course_schedule.json
+++ b/erpnext/schools/doctype/course_schedule/course_schedule.json
@@ -478,7 +478,7 @@
  "istable": 0, 
  "max_attachments": 0, 
  "menu_index": 0, 
- "modified": "2016-11-16 16:38:00.454295", 
+ "modified": "2016-12-01 12:59:25.086606", 
  "modified_by": "Administrator", 
  "module": "Schools", 
  "name": "Course Schedule", 
@@ -490,6 +490,27 @@
    "apply_user_permissions": 0, 
    "cancel": 0, 
    "create": 1, 
+   "delete": 0, 
+   "email": 0, 
+   "export": 0, 
+   "if_owner": 0, 
+   "import": 0, 
+   "is_custom": 0, 
+   "permlevel": 0, 
+   "print": 0, 
+   "read": 1, 
+   "report": 1, 
+   "role": "Instructor", 
+   "set_user_permissions": 0, 
+   "share": 0, 
+   "submit": 0, 
+   "write": 1
+  }, 
+  {
+   "amend": 0, 
+   "apply_user_permissions": 0, 
+   "cancel": 0, 
+   "create": 1, 
    "delete": 1, 
    "email": 1, 
    "export": 1, 
diff --git a/erpnext/schools/doctype/course_scheduling_tool/course_scheduling_tool.js b/erpnext/schools/doctype/course_scheduling_tool/course_scheduling_tool.js
index b8d4562..ea62b8f 100644
--- a/erpnext/schools/doctype/course_scheduling_tool/course_scheduling_tool.js
+++ b/erpnext/schools/doctype/course_scheduling_tool/course_scheduling_tool.js
@@ -7,12 +7,15 @@
 cur_frm.add_fetch("student_group", "academic_year", "academic_year");
 cur_frm.add_fetch("student_group", "academic_term", "academic_term");
 
-frappe.ui.form.on("Course Scheduling Tool", "refresh", function(frm) {
-	frm.disable_save();
-	frm.page.set_primary_action(__("Schedule Course"), function() {
-		frappe.call({
-			method: "schedule_course",
-			doc:frm.doc
-		})
-	});
+frappe.ui.form.on("Course Scheduling Tool", {
+
+    refresh: function(frm) {
+        frm.disable_save();
+        frm.page.set_primary_action(__("Schedule Course"), function() {
+            frappe.call({
+                method: "schedule_course",
+                doc: frm.doc
+            })
+        });
+    }
 });
\ No newline at end of file
diff --git a/erpnext/schools/doctype/student/student.json b/erpnext/schools/doctype/student/student.json
index d188db3..6984d38 100644
--- a/erpnext/schools/doctype/student/student.json
+++ b/erpnext/schools/doctype/student/student.json
@@ -24,6 +24,7 @@
    "ignore_xss_filter": 0, 
    "in_filter": 0, 
    "in_list_view": 0, 
+   "in_standard_filter": 0, 
    "label": "First Name", 
    "length": 0, 
    "no_copy": 0, 
@@ -32,6 +33,7 @@
    "print_hide": 0, 
    "print_hide_if_no_value": 0, 
    "read_only": 0, 
+   "remember_last_selected_value": 0, 
    "report_hide": 0, 
    "reqd": 1, 
    "search_index": 0, 
@@ -50,6 +52,7 @@
    "ignore_xss_filter": 0, 
    "in_filter": 0, 
    "in_list_view": 0, 
+   "in_standard_filter": 0, 
    "label": "Middle Name", 
    "length": 0, 
    "no_copy": 0, 
@@ -58,6 +61,7 @@
    "print_hide": 0, 
    "print_hide_if_no_value": 0, 
    "read_only": 0, 
+   "remember_last_selected_value": 0, 
    "report_hide": 0, 
    "reqd": 0, 
    "search_index": 0, 
@@ -76,6 +80,7 @@
    "ignore_xss_filter": 0, 
    "in_filter": 0, 
    "in_list_view": 0, 
+   "in_standard_filter": 0, 
    "label": "Last Name", 
    "length": 0, 
    "no_copy": 0, 
@@ -84,6 +89,7 @@
    "print_hide": 0, 
    "print_hide_if_no_value": 0, 
    "read_only": 0, 
+   "remember_last_selected_value": 0, 
    "report_hide": 0, 
    "reqd": 0, 
    "search_index": 0, 
@@ -102,6 +108,7 @@
    "ignore_xss_filter": 0, 
    "in_filter": 0, 
    "in_list_view": 0, 
+   "in_standard_filter": 0, 
    "length": 0, 
    "no_copy": 0, 
    "permlevel": 0, 
@@ -109,6 +116,7 @@
    "print_hide": 0, 
    "print_hide_if_no_value": 0, 
    "read_only": 0, 
+   "remember_last_selected_value": 0, 
    "report_hide": 0, 
    "reqd": 0, 
    "search_index": 0, 
@@ -127,6 +135,7 @@
    "ignore_xss_filter": 0, 
    "in_filter": 0, 
    "in_list_view": 0, 
+   "in_standard_filter": 0, 
    "label": "Naming Series", 
    "length": 0, 
    "no_copy": 0, 
@@ -136,6 +145,7 @@
    "print_hide": 0, 
    "print_hide_if_no_value": 0, 
    "read_only": 0, 
+   "remember_last_selected_value": 0, 
    "report_hide": 0, 
    "reqd": 0, 
    "search_index": 0, 
@@ -154,6 +164,7 @@
    "ignore_xss_filter": 0, 
    "in_filter": 0, 
    "in_list_view": 0, 
+   "in_standard_filter": 0, 
    "label": "Student Email ID", 
    "length": 0, 
    "no_copy": 0, 
@@ -162,6 +173,7 @@
    "print_hide": 0, 
    "print_hide_if_no_value": 0, 
    "read_only": 0, 
+   "remember_last_selected_value": 0, 
    "report_hide": 0, 
    "reqd": 0, 
    "search_index": 0, 
@@ -180,6 +192,7 @@
    "ignore_xss_filter": 0, 
    "in_filter": 0, 
    "in_list_view": 0, 
+   "in_standard_filter": 0, 
    "label": "Student Mobile Number", 
    "length": 0, 
    "no_copy": 0, 
@@ -189,6 +202,7 @@
    "print_hide": 0, 
    "print_hide_if_no_value": 0, 
    "read_only": 0, 
+   "remember_last_selected_value": 0, 
    "report_hide": 0, 
    "reqd": 0, 
    "search_index": 0, 
@@ -208,6 +222,7 @@
    "ignore_xss_filter": 0, 
    "in_filter": 0, 
    "in_list_view": 1, 
+   "in_standard_filter": 0, 
    "label": "Joining Date", 
    "length": 0, 
    "no_copy": 0, 
@@ -216,6 +231,7 @@
    "print_hide": 0, 
    "print_hide_if_no_value": 0, 
    "read_only": 0, 
+   "remember_last_selected_value": 0, 
    "report_hide": 0, 
    "reqd": 0, 
    "search_index": 0, 
@@ -234,6 +250,7 @@
    "ignore_xss_filter": 0, 
    "in_filter": 0, 
    "in_list_view": 0, 
+   "in_standard_filter": 0, 
    "label": "Image", 
    "length": 0, 
    "no_copy": 0, 
@@ -242,6 +259,7 @@
    "print_hide": 0, 
    "print_hide_if_no_value": 0, 
    "read_only": 0, 
+   "remember_last_selected_value": 0, 
    "report_hide": 0, 
    "reqd": 0, 
    "search_index": 0, 
@@ -262,6 +280,7 @@
    "ignore_xss_filter": 0, 
    "in_filter": 0, 
    "in_list_view": 0, 
+   "in_standard_filter": 0, 
    "label": "Personal Details", 
    "length": 0, 
    "no_copy": 0, 
@@ -270,6 +289,7 @@
    "print_hide": 0, 
    "print_hide_if_no_value": 0, 
    "read_only": 0, 
+   "remember_last_selected_value": 0, 
    "report_hide": 0, 
    "reqd": 0, 
    "search_index": 0, 
@@ -288,6 +308,7 @@
    "ignore_xss_filter": 0, 
    "in_filter": 0, 
    "in_list_view": 0, 
+   "in_standard_filter": 0, 
    "label": "Date of Birth", 
    "length": 0, 
    "no_copy": 0, 
@@ -296,6 +317,7 @@
    "print_hide": 0, 
    "print_hide_if_no_value": 0, 
    "read_only": 0, 
+   "remember_last_selected_value": 0, 
    "report_hide": 0, 
    "reqd": 0, 
    "search_index": 0, 
@@ -314,6 +336,7 @@
    "ignore_xss_filter": 0, 
    "in_filter": 0, 
    "in_list_view": 0, 
+   "in_standard_filter": 0, 
    "label": "Blood Group", 
    "length": 0, 
    "no_copy": 0, 
@@ -323,6 +346,7 @@
    "print_hide": 0, 
    "print_hide_if_no_value": 0, 
    "read_only": 0, 
+   "remember_last_selected_value": 0, 
    "report_hide": 0, 
    "reqd": 0, 
    "search_index": 0, 
@@ -341,6 +365,7 @@
    "ignore_xss_filter": 0, 
    "in_filter": 0, 
    "in_list_view": 0, 
+   "in_standard_filter": 0, 
    "length": 0, 
    "no_copy": 0, 
    "permlevel": 0, 
@@ -348,6 +373,7 @@
    "print_hide": 0, 
    "print_hide_if_no_value": 0, 
    "read_only": 0, 
+   "remember_last_selected_value": 0, 
    "report_hide": 0, 
    "reqd": 0, 
    "search_index": 0, 
@@ -366,6 +392,7 @@
    "ignore_xss_filter": 0, 
    "in_filter": 0, 
    "in_list_view": 0, 
+   "in_standard_filter": 0, 
    "label": "Gender", 
    "length": 0, 
    "no_copy": 0, 
@@ -375,6 +402,7 @@
    "print_hide": 0, 
    "print_hide_if_no_value": 0, 
    "read_only": 0, 
+   "remember_last_selected_value": 0, 
    "report_hide": 0, 
    "reqd": 0, 
    "search_index": 0, 
@@ -393,6 +421,7 @@
    "ignore_xss_filter": 0, 
    "in_filter": 0, 
    "in_list_view": 0, 
+   "in_standard_filter": 0, 
    "label": "Nationality", 
    "length": 0, 
    "no_copy": 0, 
@@ -402,6 +431,7 @@
    "print_hide": 0, 
    "print_hide_if_no_value": 0, 
    "read_only": 0, 
+   "remember_last_selected_value": 0, 
    "report_hide": 0, 
    "reqd": 0, 
    "search_index": 0, 
@@ -420,6 +450,7 @@
    "ignore_xss_filter": 0, 
    "in_filter": 0, 
    "in_list_view": 0, 
+   "in_standard_filter": 0, 
    "label": "Student Applicant", 
    "length": 0, 
    "no_copy": 0, 
@@ -429,6 +460,7 @@
    "print_hide": 0, 
    "print_hide_if_no_value": 0, 
    "read_only": 1, 
+   "remember_last_selected_value": 0, 
    "report_hide": 0, 
    "reqd": 0, 
    "search_index": 0, 
@@ -447,6 +479,7 @@
    "ignore_xss_filter": 0, 
    "in_filter": 0, 
    "in_list_view": 0, 
+   "in_standard_filter": 0, 
    "label": "Home Address", 
    "length": 0, 
    "no_copy": 0, 
@@ -455,6 +488,7 @@
    "print_hide": 0, 
    "print_hide_if_no_value": 0, 
    "read_only": 0, 
+   "remember_last_selected_value": 0, 
    "report_hide": 0, 
    "reqd": 0, 
    "search_index": 0, 
@@ -473,6 +507,7 @@
    "ignore_xss_filter": 0, 
    "in_filter": 0, 
    "in_list_view": 0, 
+   "in_standard_filter": 0, 
    "label": "Address Line 1", 
    "length": 0, 
    "no_copy": 0, 
@@ -481,6 +516,7 @@
    "print_hide": 0, 
    "print_hide_if_no_value": 0, 
    "read_only": 0, 
+   "remember_last_selected_value": 0, 
    "report_hide": 0, 
    "reqd": 0, 
    "search_index": 0, 
@@ -499,6 +535,7 @@
    "ignore_xss_filter": 0, 
    "in_filter": 0, 
    "in_list_view": 0, 
+   "in_standard_filter": 0, 
    "label": "Address Line 2", 
    "length": 0, 
    "no_copy": 0, 
@@ -507,6 +544,7 @@
    "print_hide": 0, 
    "print_hide_if_no_value": 0, 
    "read_only": 0, 
+   "remember_last_selected_value": 0, 
    "report_hide": 0, 
    "reqd": 0, 
    "search_index": 0, 
@@ -525,6 +563,7 @@
    "ignore_xss_filter": 0, 
    "in_filter": 0, 
    "in_list_view": 0, 
+   "in_standard_filter": 0, 
    "label": "Pincode", 
    "length": 0, 
    "no_copy": 0, 
@@ -533,6 +572,7 @@
    "print_hide": 0, 
    "print_hide_if_no_value": 0, 
    "read_only": 0, 
+   "remember_last_selected_value": 0, 
    "report_hide": 0, 
    "reqd": 0, 
    "search_index": 0, 
@@ -551,6 +591,7 @@
    "ignore_xss_filter": 0, 
    "in_filter": 0, 
    "in_list_view": 0, 
+   "in_standard_filter": 0, 
    "length": 0, 
    "no_copy": 0, 
    "permlevel": 0, 
@@ -558,6 +599,7 @@
    "print_hide": 0, 
    "print_hide_if_no_value": 0, 
    "read_only": 0, 
+   "remember_last_selected_value": 0, 
    "report_hide": 0, 
    "reqd": 0, 
    "search_index": 0, 
@@ -576,6 +618,7 @@
    "ignore_xss_filter": 0, 
    "in_filter": 0, 
    "in_list_view": 0, 
+   "in_standard_filter": 0, 
    "label": "City", 
    "length": 0, 
    "no_copy": 0, 
@@ -584,6 +627,7 @@
    "print_hide": 0, 
    "print_hide_if_no_value": 0, 
    "read_only": 0, 
+   "remember_last_selected_value": 0, 
    "report_hide": 0, 
    "reqd": 0, 
    "search_index": 0, 
@@ -602,6 +646,7 @@
    "ignore_xss_filter": 0, 
    "in_filter": 0, 
    "in_list_view": 0, 
+   "in_standard_filter": 0, 
    "label": "State", 
    "length": 0, 
    "no_copy": 0, 
@@ -610,6 +655,7 @@
    "print_hide": 0, 
    "print_hide_if_no_value": 0, 
    "read_only": 0, 
+   "remember_last_selected_value": 0, 
    "report_hide": 0, 
    "reqd": 0, 
    "search_index": 0, 
@@ -628,6 +674,7 @@
    "ignore_xss_filter": 0, 
    "in_filter": 0, 
    "in_list_view": 0, 
+   "in_standard_filter": 0, 
    "label": "Guardian Details", 
    "length": 0, 
    "no_copy": 0, 
@@ -636,6 +683,7 @@
    "print_hide": 0, 
    "print_hide_if_no_value": 0, 
    "read_only": 0, 
+   "remember_last_selected_value": 0, 
    "report_hide": 0, 
    "reqd": 0, 
    "search_index": 0, 
@@ -654,6 +702,7 @@
    "ignore_xss_filter": 0, 
    "in_filter": 0, 
    "in_list_view": 0, 
+   "in_standard_filter": 0, 
    "label": "Guardians", 
    "length": 0, 
    "no_copy": 0, 
@@ -663,6 +712,7 @@
    "print_hide": 0, 
    "print_hide_if_no_value": 0, 
    "read_only": 0, 
+   "remember_last_selected_value": 0, 
    "report_hide": 0, 
    "reqd": 0, 
    "search_index": 0, 
@@ -681,6 +731,7 @@
    "ignore_xss_filter": 0, 
    "in_filter": 0, 
    "in_list_view": 0, 
+   "in_standard_filter": 0, 
    "label": "Sibling Details", 
    "length": 0, 
    "no_copy": 0, 
@@ -690,6 +741,7 @@
    "print_hide": 0, 
    "print_hide_if_no_value": 0, 
    "read_only": 0, 
+   "remember_last_selected_value": 0, 
    "report_hide": 0, 
    "reqd": 0, 
    "search_index": 0, 
@@ -708,6 +760,7 @@
    "ignore_xss_filter": 0, 
    "in_filter": 0, 
    "in_list_view": 0, 
+   "in_standard_filter": 0, 
    "label": "Siblings", 
    "length": 0, 
    "no_copy": 0, 
@@ -717,6 +770,7 @@
    "print_hide": 0, 
    "print_hide_if_no_value": 0, 
    "read_only": 0, 
+   "remember_last_selected_value": 0, 
    "report_hide": 0, 
    "reqd": 0, 
    "search_index": 0, 
@@ -736,6 +790,7 @@
    "ignore_xss_filter": 0, 
    "in_filter": 0, 
    "in_list_view": 0, 
+   "in_standard_filter": 0, 
    "label": "Title", 
    "length": 0, 
    "no_copy": 0, 
@@ -744,6 +799,7 @@
    "print_hide": 0, 
    "print_hide_if_no_value": 0, 
    "read_only": 0, 
+   "remember_last_selected_value": 0, 
    "report_hide": 0, 
    "reqd": 0, 
    "search_index": 0, 
@@ -763,7 +819,7 @@
  "istable": 0, 
  "max_attachments": 0, 
  "menu_index": 0, 
- "modified": "2016-10-26 12:24:10.533118", 
+ "modified": "2016-12-01 12:55:32.453131", 
  "modified_by": "Administrator", 
  "module": "Schools", 
  "name": "Student", 
@@ -774,6 +830,27 @@
    "amend": 0, 
    "apply_user_permissions": 0, 
    "cancel": 0, 
+   "create": 0, 
+   "delete": 0, 
+   "email": 0, 
+   "export": 0, 
+   "if_owner": 0, 
+   "import": 0, 
+   "is_custom": 0, 
+   "permlevel": 0, 
+   "print": 0, 
+   "read": 1, 
+   "report": 0, 
+   "role": "Instructor", 
+   "set_user_permissions": 0, 
+   "share": 0, 
+   "submit": 0, 
+   "write": 0
+  }, 
+  {
+   "amend": 0, 
+   "apply_user_permissions": 0, 
+   "cancel": 0, 
    "create": 1, 
    "delete": 1, 
    "email": 1, 
diff --git a/erpnext/schools/doctype/student_attendance/student_attendance.js b/erpnext/schools/doctype/student_attendance/student_attendance.js
index 6e79d52..ec2a0cb 100644
--- a/erpnext/schools/doctype/student_attendance/student_attendance.js
+++ b/erpnext/schools/doctype/student_attendance/student_attendance.js
@@ -2,10 +2,4 @@
 // For license information, please see license.txt
 
 cur_frm.add_fetch("course_schedule", "schedule_date", "date");
-cur_frm.add_fetch("course_schedule", "student_batch", "student_batch");
-
-frappe.ui.form.on('Student Attendance', {
-	refresh: function(frm) {
-
-	}
-});
+cur_frm.add_fetch("course_schedule", "student_batch", "student_batch")
\ No newline at end of file
diff --git a/erpnext/schools/doctype/student_attendance/student_attendance.json b/erpnext/schools/doctype/student_attendance/student_attendance.json
index 70fcdf3..3ea47f37 100644
--- a/erpnext/schools/doctype/student_attendance/student_attendance.json
+++ b/erpnext/schools/doctype/student_attendance/student_attendance.json
@@ -252,7 +252,7 @@
  "issingle": 0, 
  "istable": 0, 
  "max_attachments": 0, 
- "modified": "2016-11-16 16:58:35.779867", 
+ "modified": "2016-12-01 12:56:21.537215", 
  "modified_by": "Administrator", 
  "module": "Schools", 
  "name": "Student Attendance", 
@@ -265,6 +265,27 @@
    "cancel": 1, 
    "create": 1, 
    "delete": 1, 
+   "email": 0, 
+   "export": 0, 
+   "if_owner": 0, 
+   "import": 0, 
+   "is_custom": 0, 
+   "permlevel": 0, 
+   "print": 1, 
+   "read": 1, 
+   "report": 1, 
+   "role": "Instructor", 
+   "set_user_permissions": 0, 
+   "share": 0, 
+   "submit": 1, 
+   "write": 1
+  }, 
+  {
+   "amend": 1, 
+   "apply_user_permissions": 0, 
+   "cancel": 1, 
+   "create": 1, 
+   "delete": 1, 
    "email": 1, 
    "export": 1, 
    "if_owner": 0, 
diff --git a/erpnext/schools/doctype/student_batch/student_batch.json b/erpnext/schools/doctype/student_batch/student_batch.json
index 51dc541..f571d9d 100644
--- a/erpnext/schools/doctype/student_batch/student_batch.json
+++ b/erpnext/schools/doctype/student_batch/student_batch.json
@@ -75,6 +75,35 @@
    "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
+   "default": "1", 
+   "fieldname": "enabled", 
+   "fieldtype": "Check", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "ignore_xss_filter": 0, 
+   "in_filter": 0, 
+   "in_list_view": 0, 
+   "in_standard_filter": 0, 
+   "label": "Active", 
+   "length": 0, 
+   "no_copy": 0, 
+   "permlevel": 0, 
+   "precision": "", 
+   "print_hide": 0, 
+   "print_hide_if_no_value": 0, 
+   "read_only": 0, 
+   "remember_last_selected_value": 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_2", 
    "fieldtype": "Column Break", 
    "hidden": 0, 
@@ -280,7 +309,7 @@
  "issingle": 0, 
  "istable": 0, 
  "max_attachments": 0, 
- "modified": "2016-11-21 19:08:05.775954", 
+ "modified": "2016-12-01 13:18:12.024001", 
  "modified_by": "Administrator", 
  "module": "Schools", 
  "name": "Student Batch", 
@@ -307,6 +336,27 @@
    "share": 1, 
    "submit": 0, 
    "write": 1
+  }, 
+  {
+   "amend": 0, 
+   "apply_user_permissions": 0, 
+   "cancel": 0, 
+   "create": 0, 
+   "delete": 0, 
+   "email": 0, 
+   "export": 0, 
+   "if_owner": 0, 
+   "import": 0, 
+   "is_custom": 0, 
+   "permlevel": 0, 
+   "print": 0, 
+   "read": 1, 
+   "report": 0, 
+   "role": "Instructor", 
+   "set_user_permissions": 0, 
+   "share": 0, 
+   "submit": 0, 
+   "write": 0
   }
  ], 
  "quick_entry": 1, 
diff --git a/erpnext/schools/doctype/student_batch/student_batch.py b/erpnext/schools/doctype/student_batch/student_batch.py
index ec2dc79..1a0d799 100644
--- a/erpnext/schools/doctype/student_batch/student_batch.py
+++ b/erpnext/schools/doctype/student_batch/student_batch.py
@@ -8,12 +8,11 @@
 import frappe
 
 class StudentBatch(Document):
-    def autoname(self):
-        prog_abb = frappe.db.get_value("Program", self.program, "program_abbreviation")
-        if not prog_abb:
-            prog_abb = self.program
-        self.name = prog_abb + "-"+ self.student_batch_name + "-" + self.academic_year
-        
-    def validate(self):
-        validate_duplicate_student(self.students)
-        
\ No newline at end of file
+	def autoname(self):
+		prog_abb = frappe.db.get_value("Program", self.program, "program_abbreviation")
+		if not prog_abb:
+			prog_abb = self.program
+		self.name = prog_abb + "-"+ self.student_batch_name + "-" + self.academic_year
+		
+	def validate(self):
+		validate_duplicate_student(self.students)
diff --git a/erpnext/schools/doctype/student_batch_attendance_tool/student_batch_attendance_tool.js b/erpnext/schools/doctype/student_batch_attendance_tool/student_batch_attendance_tool.js
index a6d035a..6dc9181 100644
--- a/erpnext/schools/doctype/student_batch_attendance_tool/student_batch_attendance_tool.js
+++ b/erpnext/schools/doctype/student_batch_attendance_tool/student_batch_attendance_tool.js
@@ -3,126 +3,124 @@
 frappe.provide("schools")
 
 frappe.ui.form.on('Student Batch Attendance Tool', {
-	refresh: function(frm) {
-		frm.disable_save();
-		hide_field('attendance');
-	},
-	
-	student_batch :function(frm) {
-		if(frm.doc.student_batch && frm.doc.date) {
-			frappe.call({
-				method: "erpnext.schools.api.check_attendance_records_exist",
-				args: {
-					"student_batch": frm.doc.student_batch,
-					"date": frm.doc.date
-				},
-				callback: function(r) {
-					if(r.message) {
-						frappe.msgprint("Attendance already marked.");
-						hide_field('attendance');
-					}
-					else {
-						frappe.call({
-							method: "erpnext.schools.api.get_student_batch_students",
-							args: {
-								"student_batch": frm.doc.student_batch
-							},
-							callback: function(r) {
-								if (r.message) {
-									unhide_field('attendance');
-									frm.events.get_students(frm, r.message)
-								}
-							}
-						});
-					}
-				}
-			});
-		}
-	},
-	
-	date: function(frm) {
-		frm.trigger("student_batch");
-	},
-	
-	get_students: function(frm, students) {
-		if(!frm.students_area) {
-		frm.students_area = $('<div>')
-			.appendTo(frm.fields_dict.students_html.wrapper);
-		}
-		frm.students_editor = new schools.StudentsEditor(frm, frm.students_area, students)
-	}
+    refresh: function(frm) {
+        frm.disable_save();
+        hide_field('attendance');
+    },
+
+    student_batch: function(frm) {
+        if (frm.doc.student_batch && frm.doc.date) {
+            frappe.call({
+                method: "erpnext.schools.api.check_attendance_records_exist",
+                args: {
+                    "student_batch": frm.doc.student_batch,
+                    "date": frm.doc.date
+                },
+                callback: function(r) {
+                    if (r.message) {
+                        frappe.msgprint("Attendance already marked.");
+                        hide_field('attendance');
+                    } else {
+                        frappe.call({
+                            method: "erpnext.schools.api.get_student_batch_students",
+                            args: {
+                                "student_batch": frm.doc.student_batch
+                            },
+                            callback: function(r) {
+                                if (r.message) {
+                                    unhide_field('attendance');
+                                    frm.events.get_students(frm, r.message)
+                                }
+                            }
+                        });
+                    }
+                }
+            });
+        }
+    },
+
+    date: function(frm) {
+        frm.trigger("student_batch");
+    },
+
+    get_students: function(frm, students) {
+        if (!frm.students_area) {
+            frm.students_area = $('<div>')
+                .appendTo(frm.fields_dict.students_html.wrapper);
+        }
+        frm.students_editor = new schools.StudentsEditor(frm, frm.students_area, students)
+    }
 });
 
 
 schools.StudentsEditor = Class.extend({
-	init: function(frm, wrapper, students) {
-		this.wrapper = wrapper;
-		this.frm = frm;
-		this.make(frm, students);
-	},
-	make: function(frm, students) {
-		var me = this;
-		
-		$(this.wrapper).empty();
-		var student_toolbar = $('<p>\
+    init: function(frm, wrapper, students) {
+        this.wrapper = wrapper;
+        this.frm = frm;
+        this.make(frm, students);
+    },
+    make: function(frm, students) {
+        var me = this;
+
+        $(this.wrapper).empty();
+        var student_toolbar = $('<p>\
 			<button class="btn btn-default btn-add btn-xs" style="margin-right: 5px;"></button>\
 			<button class="btn btn-xs btn-default btn-remove" style="margin-right: 5px;"></button>\
 			<button class="btn btn-default btn-primary btn-mark-att btn-xs"></button></p>').appendTo($(this.wrapper));
 
-		student_toolbar.find(".btn-add")
-			.html(__('Check all'))
-			.on("click", function() {
-			$(me.wrapper).find('input[type="checkbox"]').each(function(i, check) {
-				if(!$(check).is(":checked")) {
-					check.checked = true;
-				}
-			});
-		});
+        student_toolbar.find(".btn-add")
+            .html(__('Check all'))
+            .on("click", function() {
+                $(me.wrapper).find('input[type="checkbox"]').each(function(i, check) {
+                    if (!$(check).is(":checked")) {
+                        check.checked = true;
+                    }
+                });
+            });
 
-		student_toolbar.find(".btn-remove")
-			.html(__('Uncheck all'))
-			.on("click", function() {
-			$(me.wrapper).find('input[type="checkbox"]').each(function(i, check) {
-				if($(check).is(":checked")) {
-					check.checked = false;
-				}
-			});
-		});
-		
-		student_toolbar.find(".btn-mark-att")
-			.html(__('Mark Attendence'))
-			.on("click", function() {
-				var students_present = [];
-				var students_absent = [];
-				$(me.wrapper).find('input[type="checkbox"]').each(function(i, check) {
-					if($(check).is(":checked")) {
-						students_present.push(students[i]);
-					}
-					else {
-						students_absent.push(students[i]);
-					}
-				});
-				frappe.call({
-					method: "erpnext.schools.api.mark_attendance",
-					args: {
-						"students_present": students_present,
-						"students_absent": students_absent,
-						"student_batch": frm.doc.student_batch,
-						"date": frm.doc.date
-					},
-					callback: function(r) {
-						hide_field('attendance');
-					}
-				});
-		});
+        student_toolbar.find(".btn-remove")
+            .html(__('Uncheck all'))
+            .on("click", function() {
+                $(me.wrapper).find('input[type="checkbox"]').each(function(i, check) {
+                    if ($(check).is(":checked")) {
+                        check.checked = false;
+                    }
+                });
+            });
 
-		
-		$.each(students, function(i, m) {
-			$(repl('<div class="col-sm-6">\
+        student_toolbar.find(".btn-mark-att")
+            .html(__('Mark Attendence'))
+            .on("click", function() {
+                var students_present = [];
+                var students_absent = [];
+                $(me.wrapper).find('input[type="checkbox"]').each(function(i, check) {
+                    if ($(check).is(":checked")) {
+                        students_present.push(students[i]);
+                    } else {
+                        students_absent.push(students[i]);
+                    }
+                });
+                frappe.call({
+                    method: "erpnext.schools.api.mark_attendance",
+                    args: {
+                        "students_present": students_present,
+                        "students_absent": students_absent,
+                        "student_batch": frm.doc.student_batch,
+                        "date": frm.doc.date
+                    },
+                    callback: function(r) {
+                        hide_field('attendance');
+                    }
+                });
+            });
+
+
+        $.each(students, function(i, m) {
+            $(repl('<div class="col-sm-6">\
 				<div class="checkbox">\
 				<label><input type="checkbox" class="students-check" student="%(student)s">\
 				%(student)s</label>\
-			</div></div>', {student: m.student_name})).appendTo(me.wrapper);
-		});
-	}
-});
+			</div></div>', { student: m.student_name })).appendTo(me.wrapper);
+        });
+    }
+});
\ No newline at end of file
diff --git a/erpnext/schools/doctype/student_batch_attendance_tool/student_batch_attendance_tool.json b/erpnext/schools/doctype/student_batch_attendance_tool/student_batch_attendance_tool.json
index 3361dcb..defc886 100644
--- a/erpnext/schools/doctype/student_batch_attendance_tool/student_batch_attendance_tool.json
+++ b/erpnext/schools/doctype/student_batch_attendance_tool/student_batch_attendance_tool.json
@@ -163,7 +163,7 @@
  "issingle": 1, 
  "istable": 0, 
  "max_attachments": 0, 
- "modified": "2016-11-16 17:16:43.835693", 
+ "modified": "2016-12-01 12:58:31.822014", 
  "modified_by": "Administrator", 
  "module": "Schools", 
  "name": "Student Batch Attendance Tool", 
@@ -176,6 +176,27 @@
    "cancel": 0, 
    "create": 1, 
    "delete": 0, 
+   "email": 0, 
+   "export": 0, 
+   "if_owner": 0, 
+   "import": 0, 
+   "is_custom": 0, 
+   "permlevel": 0, 
+   "print": 0, 
+   "read": 1, 
+   "report": 0, 
+   "role": "Instructor", 
+   "set_user_permissions": 0, 
+   "share": 0, 
+   "submit": 0, 
+   "write": 1
+  }, 
+  {
+   "amend": 0, 
+   "apply_user_permissions": 0, 
+   "cancel": 0, 
+   "create": 1, 
+   "delete": 0, 
    "email": 1, 
    "export": 0, 
    "if_owner": 0, 
diff --git a/erpnext/schools/doctype/student_group/student_group.js b/erpnext/schools/doctype/student_group/student_group.js
index 784f557..6f4084b 100644
--- a/erpnext/schools/doctype/student_group/student_group.js
+++ b/erpnext/schools/doctype/student_group/student_group.js
@@ -1,34 +1,36 @@
 cur_frm.add_fetch("student", "title", "student_name");
 
-frappe.ui.form.on("Student Group", "refresh", function(frm) {
-	if(!frm.doc.__islocal) {
-		frm.add_custom_button(__("Course Schedule"), function() {
-			frappe.route_options = {
-				student_group: frm.doc.name
-			}
-			frappe.set_route("List", "Course Schedule");
-		});
-		
-		frm.add_custom_button(__("Assessment"), function() {
-			frappe.route_options = {
-				student_group: frm.doc.name
-			}
-			frappe.set_route("List", "Assessment");
-		});
-	}
-});
+frappe.ui.form.on("Student Group", {
+    refresh: function(frm) {
+        if (!frm.doc.__islocal) {
+            frm.add_custom_button(__("Course Schedule"), function() {
+                frappe.route_options = {
+                    student_group: frm.doc.name
+                }
+                frappe.set_route("List", "Course Schedule");
+            });
 
-frappe.ui.form.on("Student Group", "onload", function(frm){
-	cur_frm.set_query("academic_term",function(){
-		return{
-			"filters":{
-				"academic_year": (frm.doc.academic_year)
-			}
-		};
-	});
+            frm.add_custom_button(__("Assessment"), function() {
+                frappe.route_options = {
+                    student_group: frm.doc.name
+                }
+                frappe.set_route("List", "Assessment");
+            });
+        }
+    },
+
+    onload: function(frm) {
+        cur_frm.set_query("academic_term", function() {
+            return {
+                "filters": {
+                    "academic_year": (frm.doc.academic_year)
+                }
+            };
+        });
+    }
 });
 
 //If Student Batch is entered, deduce program, academic_year and academic term from it
 cur_frm.add_fetch("student_batch", "program", "program");
 cur_frm.add_fetch("student_batch", "academic_term", "academic_term");
-cur_frm.add_fetch("student_batch", "academic_year", "academic_year");
+cur_frm.add_fetch("student_batch", "academic_year", "academic_year");
\ No newline at end of file
diff --git a/erpnext/schools/doctype/student_group/student_group.json b/erpnext/schools/doctype/student_group/student_group.json
index adab0c7..9e44f51 100644
--- a/erpnext/schools/doctype/student_group/student_group.json
+++ b/erpnext/schools/doctype/student_group/student_group.json
@@ -311,7 +311,7 @@
  "istable": 0, 
  "max_attachments": 0, 
  "menu_index": 0, 
- "modified": "2016-11-07 05:26:38.673266", 
+ "modified": "2016-12-01 12:57:17.125085", 
  "modified_by": "Administrator", 
  "module": "Schools", 
  "name": "Student Group", 
@@ -322,6 +322,27 @@
    "amend": 0, 
    "apply_user_permissions": 0, 
    "cancel": 0, 
+   "create": 0, 
+   "delete": 0, 
+   "email": 0, 
+   "export": 0, 
+   "if_owner": 0, 
+   "import": 0, 
+   "is_custom": 0, 
+   "permlevel": 0, 
+   "print": 0, 
+   "read": 1, 
+   "report": 0, 
+   "role": "Instructor", 
+   "set_user_permissions": 0, 
+   "share": 0, 
+   "submit": 0, 
+   "write": 0
+  }, 
+  {
+   "amend": 0, 
+   "apply_user_permissions": 0, 
+   "cancel": 0, 
    "create": 1, 
    "delete": 1, 
    "email": 1, 
diff --git a/erpnext/schools/doctype/student_leave_application/__init__.py b/erpnext/schools/doctype/student_leave_application/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/erpnext/schools/doctype/student_leave_application/__init__.py
diff --git a/erpnext/schools/doctype/student_leave_application/student_leave_application.js b/erpnext/schools/doctype/student_leave_application/student_leave_application.js
new file mode 100644
index 0000000..4746148
--- /dev/null
+++ b/erpnext/schools/doctype/student_leave_application/student_leave_application.js
@@ -0,0 +1,8 @@
+// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
+// For license information, please see license.txt
+
+frappe.ui.form.on('Student Leave Application', {
+	refresh: function(frm) {
+
+	}
+});
diff --git a/erpnext/schools/doctype/student_leave_application/student_leave_application.json b/erpnext/schools/doctype/student_leave_application/student_leave_application.json
new file mode 100644
index 0000000..238b134
--- /dev/null
+++ b/erpnext/schools/doctype/student_leave_application/student_leave_application.json
@@ -0,0 +1,280 @@
+{
+ "allow_copy": 0, 
+ "allow_import": 0, 
+ "allow_rename": 0, 
+ "autoname": "SLA.######", 
+ "beta": 0, 
+ "creation": "2016-11-28 15:38:54.793854", 
+ "custom": 0, 
+ "docstatus": 0, 
+ "doctype": "DocType", 
+ "document_type": "", 
+ "editable_grid": 1, 
+ "engine": "InnoDB", 
+ "fields": [
+  {
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "fieldname": "student", 
+   "fieldtype": "Link", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "ignore_xss_filter": 0, 
+   "in_filter": 0, 
+   "in_list_view": 0, 
+   "in_standard_filter": 0, 
+   "label": "Student", 
+   "length": 0, 
+   "no_copy": 0, 
+   "options": "Student", 
+   "permlevel": 0, 
+   "precision": "", 
+   "print_hide": 0, 
+   "print_hide_if_no_value": 0, 
+   "read_only": 0, 
+   "remember_last_selected_value": 0, 
+   "report_hide": 0, 
+   "reqd": 1, 
+   "search_index": 0, 
+   "set_only_once": 0, 
+   "unique": 0
+  }, 
+  {
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "fieldname": "student_name", 
+   "fieldtype": "Read Only", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "ignore_xss_filter": 0, 
+   "in_filter": 0, 
+   "in_list_view": 0, 
+   "in_standard_filter": 0, 
+   "label": "Student Name", 
+   "length": 0, 
+   "no_copy": 0, 
+   "options": "student.title", 
+   "permlevel": 0, 
+   "precision": "", 
+   "print_hide": 0, 
+   "print_hide_if_no_value": 0, 
+   "read_only": 0, 
+   "remember_last_selected_value": 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_3", 
+   "fieldtype": "Column Break", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "ignore_xss_filter": 0, 
+   "in_filter": 0, 
+   "in_list_view": 0, 
+   "in_standard_filter": 0, 
+   "label": "", 
+   "length": 0, 
+   "no_copy": 0, 
+   "permlevel": 0, 
+   "precision": "", 
+   "print_hide": 0, 
+   "print_hide_if_no_value": 0, 
+   "read_only": 0, 
+   "remember_last_selected_value": 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": "date", 
+   "fieldtype": "Date", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "ignore_xss_filter": 0, 
+   "in_filter": 0, 
+   "in_list_view": 1, 
+   "in_standard_filter": 0, 
+   "label": "Date", 
+   "length": 0, 
+   "no_copy": 0, 
+   "permlevel": 0, 
+   "precision": "", 
+   "print_hide": 0, 
+   "print_hide_if_no_value": 0, 
+   "read_only": 0, 
+   "remember_last_selected_value": 0, 
+   "report_hide": 0, 
+   "reqd": 1, 
+   "search_index": 0, 
+   "set_only_once": 0, 
+   "unique": 0
+  }, 
+  {
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "fieldname": "section_break_5", 
+   "fieldtype": "Section Break", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "ignore_xss_filter": 0, 
+   "in_filter": 0, 
+   "in_list_view": 0, 
+   "in_standard_filter": 0, 
+   "length": 0, 
+   "no_copy": 0, 
+   "permlevel": 0, 
+   "precision": "", 
+   "print_hide": 0, 
+   "print_hide_if_no_value": 0, 
+   "read_only": 0, 
+   "remember_last_selected_value": 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": "reason", 
+   "fieldtype": "Text", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "ignore_xss_filter": 0, 
+   "in_filter": 0, 
+   "in_list_view": 0, 
+   "in_standard_filter": 0, 
+   "label": "Reason", 
+   "length": 0, 
+   "no_copy": 0, 
+   "permlevel": 0, 
+   "precision": "", 
+   "print_hide": 0, 
+   "print_hide_if_no_value": 0, 
+   "read_only": 0, 
+   "remember_last_selected_value": 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, 
+   "ignore_user_permissions": 0, 
+   "ignore_xss_filter": 0, 
+   "in_filter": 0, 
+   "in_list_view": 0, 
+   "in_standard_filter": 0, 
+   "label": "Amended From", 
+   "length": 0, 
+   "no_copy": 1, 
+   "options": "Student Leave Application", 
+   "permlevel": 0, 
+   "print_hide": 1, 
+   "print_hide_if_no_value": 0, 
+   "read_only": 1, 
+   "remember_last_selected_value": 0, 
+   "report_hide": 0, 
+   "reqd": 0, 
+   "search_index": 0, 
+   "set_only_once": 0, 
+   "unique": 0
+  }
+ ], 
+ "hide_heading": 0, 
+ "hide_toolbar": 0, 
+ "idx": 0, 
+ "image_view": 0, 
+ "in_create": 0, 
+ "in_dialog": 0, 
+ "is_submittable": 1, 
+ "issingle": 0, 
+ "istable": 0, 
+ "max_attachments": 0, 
+ "modified": "2016-12-01 12:57:55.914656", 
+ "modified_by": "Administrator", 
+ "module": "Schools", 
+ "name": "Student Leave Application", 
+ "name_case": "", 
+ "owner": "Administrator", 
+ "permissions": [
+  {
+   "amend": 1, 
+   "apply_user_permissions": 0, 
+   "cancel": 1, 
+   "create": 1, 
+   "delete": 1, 
+   "email": 1, 
+   "export": 0, 
+   "if_owner": 0, 
+   "import": 0, 
+   "is_custom": 0, 
+   "permlevel": 0, 
+   "print": 1, 
+   "read": 1, 
+   "report": 1, 
+   "role": "Instructor", 
+   "set_user_permissions": 0, 
+   "share": 0, 
+   "submit": 1, 
+   "write": 1
+  }, 
+  {
+   "amend": 1, 
+   "apply_user_permissions": 0, 
+   "cancel": 1, 
+   "create": 1, 
+   "delete": 1, 
+   "email": 1, 
+   "export": 1, 
+   "if_owner": 0, 
+   "import": 0, 
+   "is_custom": 0, 
+   "permlevel": 0, 
+   "print": 1, 
+   "read": 1, 
+   "report": 1, 
+   "role": "Academics User", 
+   "set_user_permissions": 0, 
+   "share": 1, 
+   "submit": 1, 
+   "write": 1
+  }
+ ], 
+ "quick_entry": 1, 
+ "read_only": 0, 
+ "read_only_onload": 0, 
+ "sort_field": "modified", 
+ "sort_order": "DESC", 
+ "title_field": "student_name", 
+ "track_seen": 0
+}
\ No newline at end of file
diff --git a/erpnext/schools/doctype/student_leave_application/student_leave_application.py b/erpnext/schools/doctype/student_leave_application/student_leave_application.py
new file mode 100644
index 0000000..4a36590
--- /dev/null
+++ b/erpnext/schools/doctype/student_leave_application/student_leave_application.py
@@ -0,0 +1,10 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors
+# For license information, please see license.txt
+
+from __future__ import unicode_literals
+import frappe
+from frappe.model.document import Document
+
+class StudentLeaveApplication(Document):
+	pass
diff --git a/erpnext/schools/doctype/student_leave_application/test_student_leave_application.py b/erpnext/schools/doctype/student_leave_application/test_student_leave_application.py
new file mode 100644
index 0000000..ddb30ac
--- /dev/null
+++ b/erpnext/schools/doctype/student_leave_application/test_student_leave_application.py
@@ -0,0 +1,12 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
+# See license.txt
+from __future__ import unicode_literals
+
+import frappe
+import unittest
+
+# test_records = frappe.get_test_records('Student Leave Application')
+
+class TestStudentLeaveApplication(unittest.TestCase):
+	pass
diff --git a/erpnext/schools/report/absent_student_report/__init__.py b/erpnext/schools/report/absent_student_report/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/erpnext/schools/report/absent_student_report/__init__.py
diff --git a/erpnext/schools/report/absent_student_report/absent_student_report.js b/erpnext/schools/report/absent_student_report/absent_student_report.js
new file mode 100644
index 0000000..7515f22
--- /dev/null
+++ b/erpnext/schools/report/absent_student_report/absent_student_report.js
@@ -0,0 +1,15 @@
+// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
+// License: GNU General Public License v3. See license.txt
+
+
+frappe.query_reports["Absent Student Report"] = {
+	"filters": [
+		{
+			"fieldname":"date",
+			"label": __("Date"),
+			"fieldtype": "Date",
+			"default": get_today(),
+			"reqd": 1
+		}
+	]
+}
diff --git a/erpnext/schools/report/absent_student_report/absent_student_report.json b/erpnext/schools/report/absent_student_report/absent_student_report.json
new file mode 100644
index 0000000..5f3ca71
--- /dev/null
+++ b/erpnext/schools/report/absent_student_report/absent_student_report.json
@@ -0,0 +1,18 @@
+{
+ "add_total_row": 0, 
+ "apply_user_permissions": 1, 
+ "creation": "2013-05-13 14:04:03", 
+ "disabled": 0, 
+ "docstatus": 0, 
+ "doctype": "Report", 
+ "idx": 1, 
+ "is_standard": "Yes", 
+ "modified": "2016-12-01 14:28:27.184668", 
+ "modified_by": "Administrator", 
+ "module": "Schools", 
+ "name": "Absent Student Report", 
+ "owner": "Administrator", 
+ "ref_doctype": "Student Attendance", 
+ "report_name": "Absent Student Report", 
+ "report_type": "Script Report"
+}
\ No newline at end of file
diff --git a/erpnext/schools/report/absent_student_report/absent_student_report.py b/erpnext/schools/report/absent_student_report/absent_student_report.py
new file mode 100644
index 0000000..82a20aa
--- /dev/null
+++ b/erpnext/schools/report/absent_student_report/absent_student_report.py
@@ -0,0 +1,60 @@
+# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
+# License: GNU General Public License v3. See license.txt
+
+from __future__ import unicode_literals
+import frappe
+from frappe.utils import cstr, cint, getdate
+from frappe import msgprint, _
+
+def execute(filters=None):
+	if not filters: filters = {}
+
+	if not filters.get("date"):
+		msgprint(_("Please select date"), raise_exception=1)
+	
+	columns = get_columns(filters)
+
+	absent_students = get_absent_students(filters.get("date"))
+	leave_applicants = get_leave_applications(filters.get("date"))
+
+	data = []
+	for student in absent_students:
+		if not student.student in leave_applicants:
+			row = [student.student, student.student_name, student.student_batch]
+			stud_details = frappe.db.get_value("Student", student.student, ['student_email_id', 'student_mobile_number'], as_dict=True)
+			
+			if stud_details.student_email_id:
+				row+=[stud_details.student_email_id]
+			else:
+				row+= [""]
+			
+			if stud_details.student_mobile_number:
+				row+=[stud_details.student_mobile_number]
+			else:
+				row+= [""]
+				
+			data.append(row)
+	
+	return columns, data
+
+def get_columns(filters):
+	columns = [ 
+		_("Student") + ":Link/Student:90", 
+		_("Student Name") + "::150", 
+		_("Student Batch") + "::180",
+		_("Student Email ID") + "::180",
+		_("Student Mobile No.") + "::150",
+	]
+	return columns
+
+def get_absent_students(date):
+	absent_students = frappe.db.sql("""select student, student_name, student_batch from `tabStudent Attendance` 
+		where docstatus = 1 and status="Absent" and date = %s order by student_batch, student_name""", date, as_dict=1)
+	return absent_students
+
+def get_leave_applications(date):
+	leave_applicants = []
+	for student in frappe.db.sql("""select student from `tabStudent Leave Application` 
+		where docstatus = 1 and date = %s""", date):
+		leave_applicants.append(student[0])
+	return leave_applicants
\ No newline at end of file
diff --git a/erpnext/schools/report/student_batch_wise_attendance/__init__.py b/erpnext/schools/report/student_batch_wise_attendance/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/erpnext/schools/report/student_batch_wise_attendance/__init__.py
diff --git a/erpnext/schools/report/student_batch_wise_attendance/student_batch_wise_attendance.js b/erpnext/schools/report/student_batch_wise_attendance/student_batch_wise_attendance.js
new file mode 100644
index 0000000..51f7346
--- /dev/null
+++ b/erpnext/schools/report/student_batch_wise_attendance/student_batch_wise_attendance.js
@@ -0,0 +1,12 @@
+// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
+// For license information, please see license.txt
+
+frappe.query_reports["Student Batch-Wise Attendance"] = {
+    "filters": [{
+        "fieldname": "date",
+        "label": __("Date"),
+        "fieldtype": "Date",
+        "default": get_today(),
+        "reqd": 1
+    }]
+}
\ No newline at end of file
diff --git a/erpnext/schools/report/student_batch_wise_attendance/student_batch_wise_attendance.json b/erpnext/schools/report/student_batch_wise_attendance/student_batch_wise_attendance.json
new file mode 100644
index 0000000..8e5e483
--- /dev/null
+++ b/erpnext/schools/report/student_batch_wise_attendance/student_batch_wise_attendance.json
@@ -0,0 +1,18 @@
+{
+ "add_total_row": 0, 
+ "apply_user_permissions": 1, 
+ "creation": "2016-11-28 22:07:03.859124", 
+ "disabled": 0, 
+ "docstatus": 0, 
+ "doctype": "Report", 
+ "idx": 0, 
+ "is_standard": "Yes", 
+ "modified": "2016-12-01 15:48:50.120579", 
+ "modified_by": "Administrator", 
+ "module": "Schools", 
+ "name": "Student Batch-Wise Attendance", 
+ "owner": "Administrator", 
+ "ref_doctype": "Student Attendance", 
+ "report_name": "Student Batch-Wise Attendance", 
+ "report_type": "Script Report"
+}
\ No newline at end of file
diff --git a/erpnext/schools/report/student_batch_wise_attendance/student_batch_wise_attendance.py b/erpnext/schools/report/student_batch_wise_attendance/student_batch_wise_attendance.py
new file mode 100644
index 0000000..eaf090e
--- /dev/null
+++ b/erpnext/schools/report/student_batch_wise_attendance/student_batch_wise_attendance.py
@@ -0,0 +1,64 @@
+# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
+# License: GNU General Public License v3. See license.txt
+
+from __future__ import unicode_literals
+import frappe
+from frappe.utils import cstr, cint, getdate
+from frappe import msgprint, _
+
+def execute(filters=None):
+	if not filters: filters = {}
+
+	if not filters.get("date"):
+		msgprint(_("Please select date"), raise_exception=1)
+	
+	columns = get_columns(filters)
+
+	active_student_batch = get_active_student_batch()
+
+	data = []
+	for student_batch in active_student_batch:
+		row = [student_batch.name]
+		present_students = 0
+		absent_students = 0
+		student_batch_strength = get_student_batch_strength(student_batch.name)
+		student_attendance = get_student_attendance(student_batch.name, filters.get("date"))
+		if student_attendance:
+			for attendance in student_attendance:
+				if attendance.status== "Present":
+					present_students = attendance.count
+				elif attendance.status== "Absent":
+					absent_students = attendance.count
+
+		unmarked_students = student_batch_strength - (present_students + absent_students)
+		row+= [student_batch_strength, present_students, absent_students, unmarked_students]
+		data.append(row)
+
+	return columns, data
+
+def get_columns(filters):
+	columns = [ 
+		_("Student batch") + ":Link/Student Batch:250", 
+		_("Student batch Strength") + "::170", 
+		_("Present") + "::90", 
+		_("Absent") + "::90",
+		_("Not Marked") + "::90"
+	]
+	return columns
+
+def get_active_student_batch():
+	active_student_batch = frappe.db.sql("""select name from `tabStudent Batch` 
+		where active = 1 order by name""", as_dict=1)
+	return active_student_batch
+
+def get_student_batch_strength(student_batch):
+	student_batch_strength = frappe.db.sql("""select count(*) from `tabStudent Batch Student` 
+		where parent = %s""", student_batch)[0][0]
+	return student_batch_strength
+
+def get_student_attendance(student_batch, date):
+	student_attendance = frappe.db.sql("""select count(*) as count, status from `tabStudent Attendance` where \
+				student_batch= %s and date= %s and docstatus=1 and\
+				(course_schedule is Null or course_schedule='') group by status""",
+				(student_batch, date), as_dict=1)
+	return student_attendance
\ No newline at end of file
diff --git a/erpnext/schools/report/student_monthly_attendance_sheet/__init__.py b/erpnext/schools/report/student_monthly_attendance_sheet/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/erpnext/schools/report/student_monthly_attendance_sheet/__init__.py
diff --git a/erpnext/schools/report/student_monthly_attendance_sheet/student_monthly_attendance_sheet.js b/erpnext/schools/report/student_monthly_attendance_sheet/student_monthly_attendance_sheet.js
new file mode 100644
index 0000000..32c0551
--- /dev/null
+++ b/erpnext/schools/report/student_monthly_attendance_sheet/student_monthly_attendance_sheet.js
@@ -0,0 +1,42 @@
+// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
+// License: GNU General Public License v3. See license.txt
+
+
+frappe.query_reports["Student Monthly Attendance Sheet"] = {
+	"filters": [
+		{
+			"fieldname":"month",
+			"label": __("Month"),
+			"fieldtype": "Select",
+			"options": "Jan\nFeb\nMar\nApr\nMay\nJun\nJul\nAug\nSep\nOct\nNov\nDec",
+			"default": ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov",
+				"Dec"][frappe.datetime.str_to_obj(frappe.datetime.get_today()).getMonth()],
+		},
+		{
+			"fieldname":"year",
+			"label": __("Year"),
+			"fieldtype": "Select",
+			"reqd": 1
+		},
+		{
+			"fieldname":"student_batch",
+			"label": __("Student Batch"),
+			"fieldtype": "Link",
+			"options": "Student Batch",
+			"reqd": 1
+		}
+	],
+
+	"onload": function() {
+		return  frappe.call({
+			method: "erpnext.schools.report.student_monthly_attendance_sheet.student_monthly_attendance_sheet.get_attendance_years",
+			callback: function(r) {
+				var year_filter = frappe.query_report_filters_by_name.year;
+				year_filter.df.options = r.message;
+				year_filter.df.default = r.message.split("\n")[0];
+				year_filter.refresh();
+				year_filter.set_input(year_filter.df.default);
+			}
+		});
+	}
+}
diff --git a/erpnext/schools/report/student_monthly_attendance_sheet/student_monthly_attendance_sheet.json b/erpnext/schools/report/student_monthly_attendance_sheet/student_monthly_attendance_sheet.json
new file mode 100644
index 0000000..1d8f4d0
--- /dev/null
+++ b/erpnext/schools/report/student_monthly_attendance_sheet/student_monthly_attendance_sheet.json
@@ -0,0 +1,18 @@
+{
+ "add_total_row": 0, 
+ "apply_user_permissions": 1, 
+ "creation": "2013-05-13 14:04:03", 
+ "disabled": 0, 
+ "docstatus": 0, 
+ "doctype": "Report", 
+ "idx": 1, 
+ "is_standard": "Yes", 
+ "modified": "2016-12-01 14:29:53.547378", 
+ "modified_by": "Administrator", 
+ "module": "Schools", 
+ "name": "Student Monthly Attendance Sheet", 
+ "owner": "Administrator", 
+ "ref_doctype": "Student Attendance", 
+ "report_name": "Student Monthly Attendance Sheet", 
+ "report_type": "Script Report"
+}
\ No newline at end of file
diff --git a/erpnext/schools/report/student_monthly_attendance_sheet/student_monthly_attendance_sheet.py b/erpnext/schools/report/student_monthly_attendance_sheet/student_monthly_attendance_sheet.py
new file mode 100644
index 0000000..8c6006e
--- /dev/null
+++ b/erpnext/schools/report/student_monthly_attendance_sheet/student_monthly_attendance_sheet.py
@@ -0,0 +1,82 @@
+# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
+# License: GNU General Public License v3. See license.txt
+
+from __future__ import unicode_literals
+import frappe
+from frappe.utils import cstr, cint, getdate
+from frappe import msgprint, _
+from calendar import monthrange
+from erpnext.schools.api import get_student_batch_students
+
+def execute(filters=None):
+	if not filters: filters = {}
+
+	conditions, filters = get_conditions(filters)
+	columns = get_columns(filters)
+	att_map = get_attendance_list(conditions, filters)
+	students = get_student_batch_students(filters.get("student_batch"))
+	data = []
+	for stud in students:
+		row = [stud.student, stud.student_name]
+
+		total_p = total_a = 0.0
+		for day in range(filters["total_days_in_month"]):
+			status="None"
+			if att_map.get(stud.student):
+				status = att_map.get(stud.student).get(day + 1, "None")
+			status_map = {"Present": "P", "Absent": "A", "None": ""}
+			row.append(status_map[status])
+
+			if status == "Present":
+				total_p += 1
+			elif status == "Absent":
+				total_a += 1
+		
+		row += [total_p, total_a]
+		data.append(row)
+
+	return columns, data
+
+def get_columns(filters):
+	columns = [ _("Student") + ":Link/Student:90", _("Student Name") + "::150"]
+
+	for day in range(filters["total_days_in_month"]):
+		columns.append(cstr(day+1) +"::20")
+
+	columns += [_("Total Present") + ":Int:95", _("Total Absent") + ":Int:90"]
+	return columns
+
+def get_attendance_list(conditions, filters):
+	attendance_list = frappe.db.sql("""select student, day(date) as day_of_month,
+		status from `tabStudent Attendance` where docstatus = 1 %s order by student, date""" %
+		conditions, filters, as_dict=1)
+
+	att_map = {}
+	for d in attendance_list:
+		att_map.setdefault(d.student, frappe._dict()).setdefault(d.day_of_month, "")
+		att_map[d.student][d.day_of_month] = d.status
+
+	return att_map
+
+def get_conditions(filters):
+	if not (filters.get("month") and filters.get("year")):
+		msgprint(_("Please select month and year"), raise_exception=1)
+
+	filters["month"] = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov",
+		"Dec"].index(filters.month) + 1
+
+	filters["total_days_in_month"] = monthrange(cint(filters.year), filters.month)[1]
+
+	conditions = " and month(date) = %(month)s and year(date) = %(year)s"
+
+	if filters.get("student_batch"): conditions += " and student_batch = %(student_batch)s"
+
+	return conditions, filters
+
+@frappe.whitelist()
+def get_attendance_years():
+	year_list = frappe.db.sql_list("""select distinct YEAR(date) from `tabStudent Attendance` ORDER BY YEAR(date) DESC""")
+	if not year_list:
+		year_list = [getdate().year]
+
+	return "\n".join(str(year) for year in year_list)