Removed asset doctypes files from accounts module and patches
diff --git a/.eslintrc b/.eslintrc
index 4dd1216..c9a1b03 100644
--- a/.eslintrc
+++ b/.eslintrc
@@ -52,6 +52,7 @@
 		"frappe": true,
 		"erpnext": true,
 		"schools": true,
+		"education": true,
 
 		"$": true,
 		"jQuery": true,
diff --git a/.travis.yml b/.travis.yml
index 8681c03..d57b2d8 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -29,7 +29,7 @@
   - cp -r $TRAVIS_BUILD_DIR/test_sites/test_site ~/frappe-bench/sites/
 
 before_script:
-  - wget http://chromedriver.storage.googleapis.com/2.27/chromedriver_linux64.zip
+  - wget http://chromedriver.storage.googleapis.com/2.32/chromedriver_linux64.zip
   - unzip chromedriver_linux64.zip
   - sudo apt-get install libnss3
   - sudo apt-get --only-upgrade install google-chrome-stable
@@ -64,4 +64,10 @@
         - bench execute erpnext.setup.utils.enable_all_roles_and_domains
         - bench run-ui-tests --app erpnext
       env: Client Side Test
+    - # stage
+      script:
+        - wget http://build.erpnext.com/20171108_190013_955977f8_database.sql.gz
+        - bench --force restore ~/frappe-bench/20171108_190013_955977f8_database.sql.gz --mariadb-root-password travis
+        - bench migrate
+      env: Patch Testing
 
diff --git a/erpnext/__init__.py b/erpnext/__init__.py
index 30b021e..07db5e8 100644
--- a/erpnext/__init__.py
+++ b/erpnext/__init__.py
@@ -4,7 +4,7 @@
 import frappe
 from erpnext.hooks import regional_overrides
 
-__version__ = '9.2.15'
+__version__ = '9.2.17'
 
 def get_default_company(user=None):
 	'''Get default company for user'''
diff --git a/erpnext/accounts/doctype/asset/asset.json b/erpnext/accounts/doctype/asset/asset.json
deleted file mode 100644
index 7276455..0000000
--- a/erpnext/accounts/doctype/asset/asset.json
+++ /dev/null
@@ -1,1228 +0,0 @@
-{
- "allow_copy": 0, 
- "allow_guest_to_view": 0, 
- "allow_import": 1, 
- "allow_rename": 1, 
- "autoname": "field:asset_name", 
- "beta": 0, 
- "creation": "2016-03-01 17:01:27.920130", 
- "custom": 0, 
- "docstatus": 0, 
- "doctype": "DocType", 
- "document_type": "Document", 
- "editable_grid": 0, 
- "fields": [
-  {
-   "allow_bulk_edit": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "asset_name", 
-   "fieldtype": "Data", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 0, 
-   "in_standard_filter": 0, 
-   "label": "Asset Name", 
-   "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_bulk_edit": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "item_code", 
-   "fieldtype": "Link", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 0, 
-   "in_standard_filter": 1, 
-   "label": "Item Code", 
-   "length": 0, 
-   "no_copy": 0, 
-   "options": "Item", 
-   "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_bulk_edit": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "item_name", 
-   "fieldtype": "Read Only", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 0, 
-   "in_standard_filter": 0, 
-   "label": "Item Name", 
-   "length": 0, 
-   "no_copy": 0, 
-   "options": "item_code.item_name", 
-   "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_bulk_edit": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "asset_category", 
-   "fieldtype": "Link", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 1, 
-   "in_list_view": 0, 
-   "in_standard_filter": 1, 
-   "label": "Asset Category", 
-   "length": 0, 
-   "no_copy": 0, 
-   "options": "Asset Category", 
-   "permlevel": 0, 
-   "precision": "", 
-   "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, 
-   "set_only_once": 0, 
-   "unique": 0
-  }, 
-  {
-   "allow_bulk_edit": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "default": "Draft", 
-   "fieldname": "status", 
-   "fieldtype": "Select", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 1, 
-   "in_standard_filter": 1, 
-   "label": "Status", 
-   "length": 0, 
-   "no_copy": 1, 
-   "options": "Draft\nSubmitted\nPartially Depreciated\nFully Depreciated\nSold\nScrapped\nIn Repair\nOut of Order", 
-   "permlevel": 0, 
-   "precision": "", 
-   "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, 
-   "set_only_once": 0, 
-   "unique": 0
-  }, 
-  {
-   "allow_bulk_edit": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "asset_owner", 
-   "fieldtype": "Select", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 0, 
-   "in_standard_filter": 0, 
-   "label": "Asset Owner", 
-   "length": 0, 
-   "no_copy": 0, 
-   "options": "Company\nSupplier\nCustomer", 
-   "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_bulk_edit": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "depends_on": "eval:doc.asset_owner == \"Supplier\"", 
-   "fieldname": "supplier", 
-   "fieldtype": "Link", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 0, 
-   "in_standard_filter": 0, 
-   "label": "Supplier", 
-   "length": 0, 
-   "no_copy": 0, 
-   "options": "Supplier", 
-   "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_bulk_edit": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "depends_on": "eval:doc.asset_owner == \"Customer\"", 
-   "fieldname": "customer", 
-   "fieldtype": "Link", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 0, 
-   "in_standard_filter": 0, 
-   "label": "Customer", 
-   "length": 0, 
-   "no_copy": 0, 
-   "options": "Customer", 
-   "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_bulk_edit": 0, 
-   "allow_on_submit": 1, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "image", 
-   "fieldtype": "Attach Image", 
-   "hidden": 1, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 0, 
-   "in_standard_filter": 0, 
-   "label": "Image", 
-   "length": 0, 
-   "no_copy": 1, 
-   "permlevel": 0, 
-   "precision": "", 
-   "print_hide": 1, 
-   "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_bulk_edit": 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_global_search": 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_bulk_edit": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "company", 
-   "fieldtype": "Link", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 0, 
-   "in_standard_filter": 0, 
-   "label": "Company", 
-   "length": 0, 
-   "no_copy": 0, 
-   "options": "Company", 
-   "permlevel": 0, 
-   "precision": "", 
-   "print_hide": 0, 
-   "print_hide_if_no_value": 0, 
-   "read_only": 0, 
-   "remember_last_selected_value": 1, 
-   "report_hide": 0, 
-   "reqd": 1, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "unique": 0
-  }, 
-  {
-   "allow_bulk_edit": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "warehouse", 
-   "fieldtype": "Link", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 0, 
-   "in_standard_filter": 1, 
-   "label": "Warehouse", 
-   "length": 0, 
-   "no_copy": 0, 
-   "options": "Warehouse", 
-   "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_bulk_edit": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "department", 
-   "fieldtype": "Link", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 0, 
-   "in_standard_filter": 0, 
-   "label": "Department", 
-   "length": 0, 
-   "no_copy": 0, 
-   "options": "Department", 
-   "permlevel": 0, 
-   "precision": "", 
-   "print_hide": 0, 
-   "print_hide_if_no_value": 0, 
-   "read_only": 0, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 0, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "unique": 0
-  }, 
-  {
-   "allow_bulk_edit": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "purchase_date", 
-   "fieldtype": "Date", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 0, 
-   "in_standard_filter": 0, 
-   "label": "Purchase 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_bulk_edit": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "purchase_invoice", 
-   "fieldtype": "Link", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 0, 
-   "in_standard_filter": 0, 
-   "label": "Purchase Invoice", 
-   "length": 0, 
-   "no_copy": 1, 
-   "options": "Purchase Invoice", 
-   "permlevel": 0, 
-   "precision": "", 
-   "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, 
-   "set_only_once": 0, 
-   "unique": 0
-  }, 
-  {
-   "allow_bulk_edit": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "is_existing_asset", 
-   "fieldtype": "Check", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 0, 
-   "in_standard_filter": 0, 
-   "label": "Is Existing Asset", 
-   "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_bulk_edit": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "disposal_date", 
-   "fieldtype": "Date", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 0, 
-   "in_standard_filter": 0, 
-   "label": "Disposal Date", 
-   "length": 0, 
-   "no_copy": 0, 
-   "permlevel": 0, 
-   "precision": "", 
-   "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, 
-   "set_only_once": 0, 
-   "unique": 0
-  }, 
-  {
-   "allow_bulk_edit": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "journal_entry_for_scrap", 
-   "fieldtype": "Link", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 0, 
-   "in_standard_filter": 0, 
-   "label": "Journal Entry for Scrap", 
-   "length": 0, 
-   "no_copy": 1, 
-   "options": "Journal Entry", 
-   "permlevel": 0, 
-   "precision": "", 
-   "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
-  }, 
-  {
-   "allow_bulk_edit": 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_global_search": 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_bulk_edit": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "gross_purchase_amount", 
-   "fieldtype": "Currency", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 0, 
-   "in_standard_filter": 0, 
-   "label": "Gross Purchase Amount", 
-   "length": 0, 
-   "no_copy": 0, 
-   "options": "Company:company:default_currency", 
-   "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_bulk_edit": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "column_break_18", 
-   "fieldtype": "Column Break", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 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_bulk_edit": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "description": "", 
-   "fieldname": "expected_value_after_useful_life", 
-   "fieldtype": "Currency", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 0, 
-   "in_standard_filter": 0, 
-   "label": "Expected Value After Useful Life", 
-   "length": 0, 
-   "no_copy": 0, 
-   "options": "Company:company:default_currency", 
-   "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_bulk_edit": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "depends_on": "is_existing_asset", 
-   "fieldname": "opening_accumulated_depreciation", 
-   "fieldtype": "Currency", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 0, 
-   "in_standard_filter": 0, 
-   "label": "Opening Accumulated Depreciation", 
-   "length": 0, 
-   "no_copy": 1, 
-   "options": "Company:company:default_currency", 
-   "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_bulk_edit": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "section_break_20", 
-   "fieldtype": "Section Break", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 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_bulk_edit": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "calculate_depreciation", 
-   "fieldtype": "Check", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 0, 
-   "in_standard_filter": 0, 
-   "label": "Calculate Depreciation", 
-   "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_bulk_edit": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 1, 
-   "columns": 0, 
-   "depends_on": "calculate_depreciation", 
-   "fieldname": "section_break_23", 
-   "fieldtype": "Section Break", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 0, 
-   "in_standard_filter": 0, 
-   "label": "Depreciation", 
-   "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_bulk_edit": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "default": "", 
-   "depends_on": "", 
-   "fieldname": "depreciation_method", 
-   "fieldtype": "Select", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 0, 
-   "in_standard_filter": 0, 
-   "label": "Depreciation Method", 
-   "length": 0, 
-   "no_copy": 0, 
-   "options": "\nStraight Line\nDouble Declining Balance\nManual", 
-   "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_bulk_edit": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "value_after_depreciation", 
-   "fieldtype": "Currency", 
-   "hidden": 1, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 0, 
-   "in_standard_filter": 0, 
-   "label": "Value After Depreciation", 
-   "length": 0, 
-   "no_copy": 0, 
-   "options": "Company:company:default_currency", 
-   "permlevel": 0, 
-   "precision": "", 
-   "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, 
-   "set_only_once": 0, 
-   "unique": 0
-  }, 
-  {
-   "allow_bulk_edit": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "total_number_of_depreciations", 
-   "fieldtype": "Int", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 0, 
-   "in_standard_filter": 0, 
-   "label": "Total Number of Depreciations", 
-   "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_bulk_edit": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "column_break_24", 
-   "fieldtype": "Column Break", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 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_bulk_edit": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "depends_on": "eval:(doc.is_existing_asset && doc.opening_accumulated_depreciation)", 
-   "fieldname": "number_of_depreciations_booked", 
-   "fieldtype": "Int", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 0, 
-   "in_standard_filter": 0, 
-   "label": "Number of Depreciations Booked", 
-   "length": 0, 
-   "no_copy": 1, 
-   "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_bulk_edit": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "frequency_of_depreciation", 
-   "fieldtype": "Int", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 0, 
-   "in_standard_filter": 0, 
-   "label": "Frequency of Depreciation (Months)", 
-   "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_bulk_edit": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "depends_on": "", 
-   "fieldname": "next_depreciation_date", 
-   "fieldtype": "Date", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 0, 
-   "in_standard_filter": 0, 
-   "label": "Next Depreciation Date", 
-   "length": 0, 
-   "no_copy": 1, 
-   "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_bulk_edit": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "depends_on": "calculate_depreciation", 
-   "fieldname": "section_break_14", 
-   "fieldtype": "Section Break", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 0, 
-   "in_standard_filter": 0, 
-   "label": "Depreciation Schedule", 
-   "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_bulk_edit": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "schedules", 
-   "fieldtype": "Table", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 0, 
-   "in_standard_filter": 0, 
-   "label": "Depreciation Schedules", 
-   "length": 0, 
-   "no_copy": 1, 
-   "options": "Depreciation Schedule", 
-   "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_bulk_edit": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "section_break_31", 
-   "fieldtype": "Section Break", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 0, 
-   "in_standard_filter": 0, 
-   "label": "Maintenance", 
-   "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_bulk_edit": 0, 
-   "allow_on_submit": 1, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "description": "Check if Asset requires Preventive Maintenance or Calibration", 
-   "fieldname": "maintenance_required", 
-   "fieldtype": "Check", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 0, 
-   "in_standard_filter": 0, 
-   "label": "Maintenance Required", 
-   "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_bulk_edit": 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_global_search": 0, 
-   "in_list_view": 0, 
-   "in_standard_filter": 0, 
-   "label": "Amended From", 
-   "length": 0, 
-   "no_copy": 1, 
-   "options": "Asset", 
-   "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
-  }
- ], 
- "has_web_view": 0, 
- "hide_heading": 0, 
- "hide_toolbar": 0, 
- "idx": 72, 
- "image_field": "image", 
- "image_view": 0, 
- "in_create": 0, 
- "is_submittable": 1, 
- "issingle": 0, 
- "istable": 0, 
- "max_attachments": 0, 
- "modified": "2017-10-28 19:59:17.040684", 
- "modified_by": "Administrator", 
- "module": "Accounts", 
- "name": "Asset", 
- "name_case": "", 
- "owner": "Administrator", 
- "permissions": [
-  {
-   "amend": 1, 
-   "apply_user_permissions": 0, 
-   "cancel": 1, 
-   "create": 1, 
-   "delete": 1, 
-   "email": 1, 
-   "export": 1, 
-   "if_owner": 0, 
-   "import": 1, 
-   "permlevel": 0, 
-   "print": 1, 
-   "read": 1, 
-   "report": 1, 
-   "role": "Accounts User", 
-   "set_user_permissions": 0, 
-   "share": 1, 
-   "submit": 1, 
-   "write": 1
-  }
- ], 
- "quick_entry": 0, 
- "read_only": 0, 
- "read_only_onload": 1, 
- "show_name_in_global_search": 1, 
- "sort_field": "modified", 
- "sort_order": "DESC", 
- "track_changes": 0, 
- "track_seen": 0
-}
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/asset/test_asset.py b/erpnext/accounts/doctype/asset/test_asset.py
deleted file mode 100644
index 22baae3..0000000
--- a/erpnext/accounts/doctype/asset/test_asset.py
+++ /dev/null
@@ -1,343 +0,0 @@
-# -*- coding: utf-8 -*-
-# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors
-# See license.txt
-from __future__ import unicode_literals
-
-import frappe
-import unittest
-from frappe.utils import cstr, nowdate, getdate, flt
-from erpnext.assets.doctype.asset.depreciation import post_depreciation_entries, scrap_asset, restore_asset
-from erpnext.assets.doctype.asset.asset import make_sales_invoice, make_purchase_invoice
-
-class TestAsset(unittest.TestCase):
-	def setUp(self):
-		set_depreciation_settings_in_company()
-		create_asset()
-		frappe.db.sql("delete from `tabTax Rule`")
-		
-	def test_purchase_asset(self):
-		asset = frappe.get_doc("Asset", "Macbook Pro 1")
-		asset.submit()
-		
-		pi = make_purchase_invoice(asset.name, asset.item_code, asset.gross_purchase_amount, 
-			asset.company, asset.purchase_date)
-		pi.supplier = "_Test Supplier"
-		pi.insert()
-		pi.submit()
-		
-		asset.load_from_db()
-		self.assertEqual(asset.supplier, "_Test Supplier")
-		self.assertEqual(asset.purchase_date, getdate("2015-01-01"))
-		self.assertEqual(asset.purchase_invoice, pi.name)
-		
-		expected_gle = (
-			("_Test Fixed Asset - _TC", 100000.0, 0.0),
-			("Creditors - _TC", 0.0, 100000.0)
-		)
-
-		gle = frappe.db.sql("""select account, debit, credit from `tabGL Entry`
-			where voucher_type='Purchase Invoice' and voucher_no = %s
-			order by account""", pi.name)
-
-		self.assertEqual(gle, expected_gle)
-
-		pi.cancel()
-
-		asset.load_from_db()
-		self.assertEqual(asset.supplier, None)
-		self.assertEqual(asset.purchase_invoice, None)
-		
-		self.assertFalse(frappe.db.get_value("GL Entry", 
-			{"voucher_type": "Purchase Invoice", "voucher_no": pi.name}))
-		
-
-	def test_schedule_for_straight_line_method(self):
-		asset = frappe.get_doc("Asset", "Macbook Pro 1")
-
-		self.assertEqual(asset.status, "Draft")
-
-		expected_schedules = [
-			["2020-12-31", 30000, 30000],
-			["2021-03-31", 30000, 60000],
-			["2021-06-30", 30000, 90000]
-		]
-
-		schedules = [[cstr(d.schedule_date), d.depreciation_amount, d.accumulated_depreciation_amount]
-			for d in asset.get("schedules")]
-
-		self.assertEqual(schedules, expected_schedules)
-		
-	def test_schedule_for_straight_line_method_for_existing_asset(self):
-		asset = frappe.get_doc("Asset", "Macbook Pro 1")
-		asset.is_existing_asset = 1
-		asset.number_of_depreciations_booked = 1
-		asset.opening_accumulated_depreciation = 40000
-		asset.save()
-		
-		self.assertEqual(asset.status, "Draft")
-
-		expected_schedules = [
-			["2020-12-31", 25000, 65000],
-			["2021-03-31", 25000, 90000]
-		]
-
-		schedules = [[cstr(d.schedule_date), d.depreciation_amount, d.accumulated_depreciation_amount]
-			for d in asset.get("schedules")]
-
-		self.assertEqual(schedules, expected_schedules)
-
-
-	def test_schedule_for_double_declining_method(self):
-		asset = frappe.get_doc("Asset", "Macbook Pro 1")
-		asset.depreciation_method = "Double Declining Balance"
-		asset.save()
-
-		expected_schedules = [
-			["2020-12-31", 66667, 66667],
-			["2021-03-31", 22222, 88889],
-			["2021-06-30", 1111, 90000]
-		]
-
-		schedules = [[cstr(d.schedule_date), d.depreciation_amount, d.accumulated_depreciation_amount]
-			for d in asset.get("schedules")]
-
-		self.assertEqual(schedules, expected_schedules)
-		
-	def test_schedule_for_double_declining_method_for_existing_asset(self):
-		asset = frappe.get_doc("Asset", "Macbook Pro 1")
-		asset.depreciation_method = "Double Declining Balance"
-		asset.is_existing_asset = 1
-		asset.number_of_depreciations_booked = 1
-		asset.opening_accumulated_depreciation = 50000
-		asset.save()
-
-		expected_schedules = [
-			["2020-12-31", 33333, 83333],
-			["2021-03-31", 6667, 90000]
-		]
-
-		schedules = [[cstr(d.schedule_date), d.depreciation_amount, d.accumulated_depreciation_amount]
-			for d in asset.get("schedules")]
-
-		self.assertEqual(schedules, expected_schedules)
-		
-	def test_schedule_for_manual_method(self):
-		asset = frappe.get_doc("Asset", "Macbook Pro 1")
-		asset.depreciation_method = "Manual"
-		asset.schedules = []
-		for schedule_date, amount in [["2020-12-31", 40000], ["2021-06-30", 30000], ["2021-10-31", 20000]]:
-			asset.append("schedules", {
-				"schedule_date": schedule_date,
-				"depreciation_amount": amount
-			})
-		asset.save()
-
-		self.assertEqual(asset.status, "Draft")
-
-		expected_schedules = [
-			["2020-12-31", 40000, 40000],
-			["2021-06-30", 30000, 70000],
-			["2021-10-31", 20000, 90000]
-		]
-
-		schedules = [[cstr(d.schedule_date), d.depreciation_amount, d.accumulated_depreciation_amount]
-			for d in asset.get("schedules")]
-
-		self.assertEqual(schedules, expected_schedules)
-
-	def test_depreciation(self):
-		asset = frappe.get_doc("Asset", "Macbook Pro 1")
-		asset.submit()
-		asset.load_from_db()
-		self.assertEqual(asset.status, "Submitted")
-
-		frappe.db.set_value("Company", "_Test Company", "series_for_depreciation_entry", "DEPR-")
-
-		post_depreciation_entries(date="2021-01-01")
-		asset.load_from_db()
-
-		self.assertEqual(asset.status, "Partially Depreciated")
-
-		# check depreciation entry series
-		self.assertEqual(asset.get("schedules")[0].journal_entry[:4], "DEPR")
-
-		expected_gle = (
-			("_Test Accumulated Depreciations - _TC", 0.0, 30000.0),
-			("_Test Depreciations - _TC", 30000.0, 0.0)
-		)
-
-		gle = frappe.db.sql("""select account, debit, credit from `tabGL Entry`
-			where against_voucher_type='Asset' and against_voucher = %s
-			order by account""", asset.name)
-
-		self.assertEqual(gle, expected_gle)
-		self.assertEqual(asset.get("value_after_depreciation"), 70000)
-		
-	def test_depreciation_entry_cancellation(self):
-		asset = frappe.get_doc("Asset", "Macbook Pro 1")
-		asset.submit()
-		post_depreciation_entries(date="2021-01-01")
-		
-		asset.load_from_db()
-		
-		# cancel depreciation entry
-		depr_entry = asset.get("schedules")[0].journal_entry
-		self.assertTrue(depr_entry)
-		frappe.get_doc("Journal Entry", depr_entry).cancel()
-		
-		asset.load_from_db()
-		depr_entry = asset.get("schedules")[0].journal_entry
-		self.assertFalse(depr_entry)
-
-	def test_scrap_asset(self):
-		asset = frappe.get_doc("Asset", "Macbook Pro 1")
-		asset.submit()
-		post_depreciation_entries(date="2021-01-01")
-
-		scrap_asset("Macbook Pro 1")
-
-		asset.load_from_db()
-		self.assertEqual(asset.status, "Scrapped")
-		self.assertTrue(asset.journal_entry_for_scrap)
-
-		expected_gle = (
-			("_Test Accumulated Depreciations - _TC", 30000.0, 0.0),
-			("_Test Fixed Asset - _TC", 0.0, 100000.0),
-			("_Test Gain/Loss on Asset Disposal - _TC", 70000.0, 0.0)
-		)
-
-		gle = frappe.db.sql("""select account, debit, credit from `tabGL Entry`
-			where voucher_type='Journal Entry' and voucher_no = %s
-			order by account""", asset.journal_entry_for_scrap)
-
-		self.assertEqual(gle, expected_gle)
-
-		restore_asset("Macbook Pro 1")
-
-		asset.load_from_db()
-		self.assertFalse(asset.journal_entry_for_scrap)
-		self.assertEqual(asset.status, "Partially Depreciated")
-
-	def test_asset_sale(self):
-		frappe.get_doc("Asset", "Macbook Pro 1").submit()
-		post_depreciation_entries(date="2021-01-01")
-
-		si = make_sales_invoice(asset="Macbook Pro 1", item_code="Macbook Pro", company="_Test Company")
-		si.customer = "_Test Customer"
-		si.due_date = nowdate()
-		si.get("items")[0].rate = 25000
-		si.insert()
-		si.submit()
-
-		self.assertEqual(frappe.db.get_value("Asset", "Macbook Pro 1", "status"), "Sold")
-
-		expected_gle = (
-			("_Test Accumulated Depreciations - _TC", 30000.0, 0.0),
-			("_Test Depreciations - _TC", 70000.0, 0.0),
-			("_Test Fixed Asset - _TC", 0.0, 100000.0),
-			("_Test Gain/Loss on Asset Disposal - _TC", 0.0, 25000.0),
-			("Debtors - _TC", 25000.0, 0.0)
-		)
-
-		gle = frappe.db.sql("""select account, debit, credit from `tabGL Entry`
-			where voucher_type='Sales Invoice' and voucher_no = %s
-			order by account""", si.name)
-
-		self.assertEqual(gle, expected_gle)
-
-		si.cancel()
-
-		self.assertEqual(frappe.db.get_value("Asset", "Macbook Pro 1", "status"), "Partially Depreciated")
-
-	def test_asset_expected_value_after_useful_life(self):
-		asset = frappe.get_doc("Asset", "Macbook Pro 1")
-		asset.depreciation_method = "Straight Line"
-		asset.is_existing_asset = 1
-		asset.total_number_of_depreciations = 400
-		asset.gross_purchase_amount = 16866177.00
-		asset.expected_value_after_useful_life = 500000
-		asset.save()
-
-		accumulated_depreciation_after_full_schedule = \
-			max([d.accumulated_depreciation_amount for d in asset.get("schedules")])
-
-		asset_value_after_full_schedule = (flt(asset.gross_purchase_amount) -
-			flt(accumulated_depreciation_after_full_schedule))
-
-		self.assertTrue(asset.expected_value_after_useful_life >= asset_value_after_full_schedule)
-
-	def tearDown(self):
-		asset = frappe.get_doc("Asset", "Macbook Pro 1")
-
-		if asset.docstatus == 1 and asset.status not in ("Scrapped", "Sold", "Draft", "Cancelled"):
-			asset.cancel()
-
-			self.assertEqual(frappe.db.get_value("Asset", "Macbook Pro 1", "status"), "Cancelled")
-
-		frappe.delete_doc("Asset", "Macbook Pro 1")
-
-def create_asset():
-	if not frappe.db.exists("Asset Category", "Computers"):
-		create_asset_category()
-
-	if not frappe.db.exists("Item", "Macbook Pro"):
-		create_fixed_asset_item()
-	
-	asset = frappe.get_doc({
-		"doctype": "Asset",
-		"asset_name": "Macbook Pro 1",
-		"asset_category": "Computers",
-		"item_code": "Macbook Pro",
-		"company": "_Test Company",
-		"purchase_date": "2015-01-01",
-		"next_depreciation_date": "2020-12-31",
-		"gross_purchase_amount": 100000,
-		"expected_value_after_useful_life": 10000,
-		"warehouse": "_Test Warehouse - _TC"
-	})
-	try:
-		asset.save()
-	except frappe.DuplicateEntryError:
-		pass
-
-	return asset
-
-def create_asset_category():
-	asset_category = frappe.new_doc("Asset Category")
-	asset_category.asset_category_name = "Computers"
-	asset_category.total_number_of_depreciations = 3
-	asset_category.frequency_of_depreciation = 3
-	asset_category.append("accounts", {
-		"company_name": "_Test Company",
-		"fixed_asset_account": "_Test Fixed Asset - _TC",
-		"accumulated_depreciation_account": "_Test Accumulated Depreciations - _TC",
-		"depreciation_expense_account": "_Test Depreciations - _TC"
-	})
-	asset_category.insert()
-
-def create_fixed_asset_item():
-	try:
-		frappe.get_doc({
-			"doctype": "Item",
-			"item_code": "Macbook Pro",
-			"item_name": "Macbook Pro",
-			"description": "Macbook Pro Retina Display",
-			"asset_category": "Computers",
-			"item_group": "All Item Groups",
-			"stock_uom": "Nos",
-			"is_stock_item": 0,
-			"is_fixed_asset": 1
-		}).insert()		
-	except frappe.DuplicateEntryError:
-		pass
-
-def set_depreciation_settings_in_company():
-	company = frappe.get_doc("Company", "_Test Company")
-	company.accumulated_depreciation_account = "_Test Accumulated Depreciations - _TC"
-	company.depreciation_expense_account = "_Test Depreciations - _TC"
-	company.disposal_account = "_Test Gain/Loss on Asset Disposal - _TC"
-	company.depreciation_cost_center = "_Test Cost Center - _TC"
-	company.save()
-	
-	# Enable booking asset depreciation entry automatically
-	frappe.db.set_value("Accounts Settings", None, "book_asset_depreciation_entry_automatically", 1)
diff --git a/erpnext/accounts/doctype/asset_category/__init__.py b/erpnext/accounts/doctype/asset_category/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/erpnext/accounts/doctype/asset_category/__init__.py
+++ /dev/null
diff --git a/erpnext/accounts/doctype/asset_category/asset_category.js b/erpnext/accounts/doctype/asset_category/asset_category.js
deleted file mode 100644
index f3bb802..0000000
--- a/erpnext/accounts/doctype/asset_category/asset_category.js
+++ /dev/null
@@ -1,8 +0,0 @@
-// Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
-// For license information, please see license.txt
-
-frappe.ui.form.on('Asset Category', {
-	refresh: function(frm) {
-
-	}
-});
diff --git a/erpnext/accounts/doctype/asset_category/asset_category.json b/erpnext/accounts/doctype/asset_category/asset_category.json
deleted file mode 100644
index d34ec5c..0000000
--- a/erpnext/accounts/doctype/asset_category/asset_category.json
+++ /dev/null
@@ -1,295 +0,0 @@
-{
- "allow_copy": 0, 
- "allow_guest_to_view": 0, 
- "allow_import": 1, 
- "allow_rename": 1, 
- "autoname": "field:asset_category_name", 
- "beta": 0, 
- "creation": "2016-03-01 17:41:39.778765", 
- "custom": 0, 
- "docstatus": 0, 
- "doctype": "DocType", 
- "document_type": "Document", 
- "editable_grid": 0, 
- "engine": "InnoDB", 
- "fields": [
-  {
-   "allow_bulk_edit": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "asset_category_name", 
-   "fieldtype": "Data", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 1, 
-   "in_standard_filter": 0, 
-   "label": "Asset Category Name", 
-   "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_bulk_edit": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "default": "Straight Line", 
-   "fieldname": "depreciation_method", 
-   "fieldtype": "Select", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 1, 
-   "in_standard_filter": 1, 
-   "label": "Depreciation Method", 
-   "length": 0, 
-   "no_copy": 0, 
-   "options": "\nStraight Line\nDouble Declining Balance", 
-   "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_bulk_edit": 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_global_search": 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_bulk_edit": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "total_number_of_depreciations", 
-   "fieldtype": "Int", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 1, 
-   "in_standard_filter": 0, 
-   "label": "Total Number of Depreciations", 
-   "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_bulk_edit": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "frequency_of_depreciation", 
-   "fieldtype": "Int", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 1, 
-   "in_standard_filter": 0, 
-   "label": "Frequency of Depreciation (Months)", 
-   "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_bulk_edit": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "section_break_2", 
-   "fieldtype": "Section Break", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 0, 
-   "in_standard_filter": 0, 
-   "label": "Accounts", 
-   "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_bulk_edit": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "accounts", 
-   "fieldtype": "Table", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 0, 
-   "in_standard_filter": 0, 
-   "label": "Accounts", 
-   "length": 0, 
-   "no_copy": 0, 
-   "options": "Asset Category Account", 
-   "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
-  }
- ], 
- "has_web_view": 0, 
- "hide_heading": 0, 
- "hide_toolbar": 0, 
- "idx": 0, 
- "image_view": 0, 
- "in_create": 0, 
- "is_submittable": 0, 
- "issingle": 0, 
- "istable": 0, 
- "max_attachments": 0, 
- "modified": "2017-10-28 19:59:31.819567", 
- "modified_by": "Administrator", 
- "module": "Accounts", 
- "name": "Asset Category", 
- "name_case": "", 
- "owner": "Administrator", 
- "permissions": [
-  {
-   "amend": 0, 
-   "apply_user_permissions": 0, 
-   "cancel": 0, 
-   "create": 1, 
-   "delete": 1, 
-   "email": 1, 
-   "export": 1, 
-   "if_owner": 0, 
-   "import": 1, 
-   "permlevel": 0, 
-   "print": 1, 
-   "read": 1, 
-   "report": 1, 
-   "role": "Accounts User", 
-   "set_user_permissions": 0, 
-   "share": 1, 
-   "submit": 0, 
-   "write": 1
-  }, 
-  {
-   "amend": 0, 
-   "apply_user_permissions": 0, 
-   "cancel": 0, 
-   "create": 1, 
-   "delete": 1, 
-   "email": 1, 
-   "export": 1, 
-   "if_owner": 0, 
-   "import": 1, 
-   "permlevel": 0, 
-   "print": 1, 
-   "read": 1, 
-   "report": 1, 
-   "role": "Accounts Manager", 
-   "set_user_permissions": 0, 
-   "share": 1, 
-   "submit": 0, 
-   "write": 1
-  }
- ], 
- "quick_entry": 0, 
- "read_only": 0, 
- "read_only_onload": 0, 
- "show_name_in_global_search": 1, 
- "sort_field": "modified", 
- "sort_order": "DESC", 
- "track_changes": 0, 
- "track_seen": 0
-}
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/asset_category/asset_category.py b/erpnext/accounts/doctype/asset_category/asset_category.py
deleted file mode 100644
index dc454ab..0000000
--- a/erpnext/accounts/doctype/asset_category/asset_category.py
+++ /dev/null
@@ -1,10 +0,0 @@
-# -*- coding: utf-8 -*-
-# Copyright (c) 2017, 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 AssetCategory(Document):
-	pass
diff --git a/erpnext/accounts/doctype/asset_movement/__init__.py b/erpnext/accounts/doctype/asset_movement/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/erpnext/accounts/doctype/asset_movement/__init__.py
+++ /dev/null
diff --git a/erpnext/accounts/doctype/asset_movement/asset_movement.js b/erpnext/accounts/doctype/asset_movement/asset_movement.js
deleted file mode 100644
index f2d82be..0000000
--- a/erpnext/accounts/doctype/asset_movement/asset_movement.js
+++ /dev/null
@@ -1,8 +0,0 @@
-// Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
-// For license information, please see license.txt
-
-frappe.ui.form.on('Asset Movement', {
-	refresh: function(frm) {
-
-	}
-});
diff --git a/erpnext/accounts/doctype/asset_movement/asset_movement.json b/erpnext/accounts/doctype/asset_movement/asset_movement.json
deleted file mode 100644
index 7d7c127..0000000
--- a/erpnext/accounts/doctype/asset_movement/asset_movement.json
+++ /dev/null
@@ -1,315 +0,0 @@
-{
- "allow_copy": 0, 
- "allow_guest_to_view": 0, 
- "allow_import": 1, 
- "allow_rename": 0, 
- "autoname": "AM-.#####", 
- "beta": 0, 
- "creation": "2016-04-25 18:00:23.559973", 
- "custom": 0, 
- "docstatus": 0, 
- "doctype": "DocType", 
- "document_type": "", 
- "editable_grid": 0, 
- "fields": [
-  {
-   "allow_bulk_edit": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "asset", 
-   "fieldtype": "Link", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 1, 
-   "in_list_view": 1, 
-   "in_standard_filter": 1, 
-   "label": "Asset", 
-   "length": 0, 
-   "no_copy": 0, 
-   "options": "Asset", 
-   "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_bulk_edit": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "transaction_date", 
-   "fieldtype": "Datetime", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 1, 
-   "in_standard_filter": 0, 
-   "label": "Transaction 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_bulk_edit": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "company", 
-   "fieldtype": "Link", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 1, 
-   "in_standard_filter": 1, 
-   "label": "Company", 
-   "length": 0, 
-   "no_copy": 0, 
-   "options": "Company", 
-   "permlevel": 0, 
-   "precision": "", 
-   "print_hide": 0, 
-   "print_hide_if_no_value": 0, 
-   "read_only": 0, 
-   "remember_last_selected_value": 1, 
-   "report_hide": 0, 
-   "reqd": 1, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "unique": 0
-  }, 
-  {
-   "allow_bulk_edit": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "column_break_4", 
-   "fieldtype": "Column Break", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 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_bulk_edit": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "source_warehouse", 
-   "fieldtype": "Link", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 0, 
-   "in_standard_filter": 1, 
-   "label": "Source Warehouse", 
-   "length": 0, 
-   "no_copy": 0, 
-   "options": "Warehouse", 
-   "permlevel": 0, 
-   "precision": "", 
-   "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, 
-   "set_only_once": 0, 
-   "unique": 0
-  }, 
-  {
-   "allow_bulk_edit": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "target_warehouse", 
-   "fieldtype": "Link", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 1, 
-   "in_standard_filter": 1, 
-   "label": "Target Warehouse", 
-   "length": 0, 
-   "no_copy": 0, 
-   "options": "Warehouse", 
-   "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_bulk_edit": 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_global_search": 0, 
-   "in_list_view": 0, 
-   "in_standard_filter": 0, 
-   "label": "Amended From", 
-   "length": 0, 
-   "no_copy": 1, 
-   "options": "Asset Movement", 
-   "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
-  }
- ], 
- "has_web_view": 0, 
- "hide_heading": 0, 
- "hide_toolbar": 0, 
- "idx": 0, 
- "image_view": 0, 
- "in_create": 0, 
- "is_submittable": 1, 
- "issingle": 0, 
- "istable": 0, 
- "max_attachments": 0, 
- "modified": "2017-10-28 20:01:49.372952", 
- "modified_by": "Administrator", 
- "module": "Accounts", 
- "name": "Asset Movement", 
- "name_case": "", 
- "owner": "Administrator", 
- "permissions": [
-  {
-   "amend": 1, 
-   "apply_user_permissions": 0, 
-   "cancel": 1, 
-   "create": 1, 
-   "delete": 1, 
-   "email": 1, 
-   "export": 1, 
-   "if_owner": 0, 
-   "import": 0, 
-   "permlevel": 0, 
-   "print": 1, 
-   "read": 1, 
-   "report": 1, 
-   "role": "System Manager", 
-   "set_user_permissions": 0, 
-   "share": 1, 
-   "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, 
-   "permlevel": 0, 
-   "print": 1, 
-   "read": 1, 
-   "report": 1, 
-   "role": "Accounts Manager", 
-   "set_user_permissions": 0, 
-   "share": 1, 
-   "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, 
-   "permlevel": 0, 
-   "print": 1, 
-   "read": 1, 
-   "report": 1, 
-   "role": "Stock Manager", 
-   "set_user_permissions": 0, 
-   "share": 1, 
-   "submit": 1, 
-   "write": 1
-  }
- ], 
- "quick_entry": 1, 
- "read_only": 0, 
- "read_only_onload": 0, 
- "show_name_in_global_search": 0, 
- "sort_field": "modified", 
- "sort_order": "DESC", 
- "track_changes": 0, 
- "track_seen": 0
-}
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/asset_movement/asset_movement.py b/erpnext/accounts/doctype/asset_movement/asset_movement.py
deleted file mode 100644
index 5acd4f1..0000000
--- a/erpnext/accounts/doctype/asset_movement/asset_movement.py
+++ /dev/null
@@ -1,10 +0,0 @@
-# -*- coding: utf-8 -*-
-# Copyright (c) 2017, 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 AssetMovement(Document):
-	pass
diff --git a/erpnext/accounts/doctype/asset_movement/test_asset_movement.js b/erpnext/accounts/doctype/asset_movement/test_asset_movement.js
deleted file mode 100644
index b951576..0000000
--- a/erpnext/accounts/doctype/asset_movement/test_asset_movement.js
+++ /dev/null
@@ -1,23 +0,0 @@
-/* eslint-disable */
-// rename this file from _test_[name] to test_[name] to activate
-// and remove above this line
-
-QUnit.test("test: Asset Movement", function (assert) {
-	let done = assert.async();
-
-	// number of asserts
-	assert.expect(1);
-
-	frappe.run_serially([
-		// insert a new Asset Movement
-		() => frappe.tests.make('Asset Movement', [
-			// values to be set
-			{key: 'value'}
-		]),
-		() => {
-			assert.equal(cur_frm.doc.key, 'value');
-		},
-		() => done()
-	]);
-
-});
diff --git a/erpnext/accounts/doctype/asset_movement/test_asset_movement.py b/erpnext/accounts/doctype/asset_movement/test_asset_movement.py
deleted file mode 100644
index 6f750a4..0000000
--- a/erpnext/accounts/doctype/asset_movement/test_asset_movement.py
+++ /dev/null
@@ -1,10 +0,0 @@
-# -*- coding: utf-8 -*-
-# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors
-# See license.txt
-from __future__ import unicode_literals
-
-import frappe
-import unittest
-
-class TestAssetMovement(unittest.TestCase):
-	pass
diff --git a/erpnext/accounts/doctype/depreciation_schedule/depreciation_schedule.json b/erpnext/accounts/doctype/depreciation_schedule/depreciation_schedule.json
deleted file mode 100644
index 29dcdfb..0000000
--- a/erpnext/accounts/doctype/depreciation_schedule/depreciation_schedule.json
+++ /dev/null
@@ -1,226 +0,0 @@
-{
- "allow_copy": 0, 
- "allow_guest_to_view": 0, 
- "allow_import": 0, 
- "allow_rename": 1, 
- "autoname": "", 
- "beta": 0, 
- "creation": "2016-03-02 15:11:01.278862", 
- "custom": 0, 
- "docstatus": 0, 
- "doctype": "DocType", 
- "document_type": "Document", 
- "editable_grid": 1, 
- "engine": "InnoDB", 
- "fields": [
-  {
-   "allow_bulk_edit": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "schedule_date", 
-   "fieldtype": "Date", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 1, 
-   "in_standard_filter": 0, 
-   "label": "Schedule Date", 
-   "length": 0, 
-   "no_copy": 1, 
-   "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_bulk_edit": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "depreciation_amount", 
-   "fieldtype": "Currency", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 1, 
-   "in_standard_filter": 0, 
-   "label": "Depreciation Amount", 
-   "length": 0, 
-   "no_copy": 1, 
-   "options": "Company:company:default_currency", 
-   "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_bulk_edit": 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_global_search": 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_bulk_edit": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "accumulated_depreciation_amount", 
-   "fieldtype": "Currency", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 1, 
-   "in_standard_filter": 0, 
-   "label": "Accumulated Depreciation Amount", 
-   "length": 0, 
-   "no_copy": 1, 
-   "options": "Company:company:default_currency", 
-   "permlevel": 0, 
-   "precision": "", 
-   "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, 
-   "set_only_once": 0, 
-   "unique": 0
-  }, 
-  {
-   "allow_bulk_edit": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "depends_on": "eval:doc.docstatus==1", 
-   "fieldname": "journal_entry", 
-   "fieldtype": "Link", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 1, 
-   "in_standard_filter": 0, 
-   "label": "Journal Entry", 
-   "length": 0, 
-   "no_copy": 1, 
-   "options": "Journal Entry", 
-   "permlevel": 0, 
-   "precision": "", 
-   "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, 
-   "set_only_once": 0, 
-   "unique": 0
-  }, 
-  {
-   "allow_bulk_edit": 0, 
-   "allow_on_submit": 1, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "depends_on": "eval:(doc.docstatus==1 && !doc.journal_entry && doc.schedule_date <= get_today())", 
-   "fieldname": "make_depreciation_entry", 
-   "fieldtype": "Button", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 0, 
-   "in_standard_filter": 0, 
-   "label": "Make Depreciation Entry", 
-   "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
-  }
- ], 
- "has_web_view": 0, 
- "hide_heading": 0, 
- "hide_toolbar": 0, 
- "idx": 0, 
- "image_view": 0, 
- "in_create": 0, 
- "is_submittable": 0, 
- "issingle": 0, 
- "istable": 1, 
- "max_attachments": 0, 
- "modified": "2017-10-28 20:02:11.376361", 
- "modified_by": "Administrator", 
- "module": "Accounts", 
- "name": "Depreciation Schedule", 
- "name_case": "", 
- "owner": "Administrator", 
- "permissions": [], 
- "quick_entry": 1, 
- "read_only": 0, 
- "read_only_onload": 0, 
- "show_name_in_global_search": 0, 
- "sort_field": "modified", 
- "sort_order": "DESC", 
- "track_changes": 0, 
- "track_seen": 0
-}
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/depreciation_schedule/depreciation_schedule.py b/erpnext/accounts/doctype/depreciation_schedule/depreciation_schedule.py
deleted file mode 100644
index 54fba3f..0000000
--- a/erpnext/accounts/doctype/depreciation_schedule/depreciation_schedule.py
+++ /dev/null
@@ -1,10 +0,0 @@
-# -*- coding: utf-8 -*-
-# Copyright (c) 2017, 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 DepreciationSchedule(Document):
-	pass
diff --git a/erpnext/accounts/doctype/gl_entry/gl_entry.json b/erpnext/accounts/doctype/gl_entry/gl_entry.json
index 76e66d0..e27eaab 100644
--- a/erpnext/accounts/doctype/gl_entry/gl_entry.json
+++ b/erpnext/accounts/doctype/gl_entry/gl_entry.json
@@ -80,6 +80,36 @@
    "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
+   "fieldname": "due_date", 
+   "fieldtype": "Date", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "ignore_xss_filter": 0, 
+   "in_filter": 0, 
+   "in_global_search": 0, 
+   "in_list_view": 0, 
+   "in_standard_filter": 0, 
+   "label": "Due 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": 0, 
+   "search_index": 0, 
+   "set_only_once": 0, 
+   "unique": 0
+  }, 
+  {
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
    "fieldname": "account", 
    "fieldtype": "Link", 
    "hidden": 0, 
@@ -718,7 +748,7 @@
  "issingle": 0, 
  "istable": 0, 
  "max_attachments": 0, 
- "modified": "2017-08-03 12:40:09.611951", 
+ "modified": "2017-08-10 18:06:44.904081", 
  "modified_by": "Administrator", 
  "module": "Accounts", 
  "name": "GL Entry", 
diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry.js b/erpnext/accounts/doctype/journal_entry/journal_entry.js
index 9047a4e..4ce6886 100644
--- a/erpnext/accounts/doctype/journal_entry/journal_entry.js
+++ b/erpnext/accounts/doctype/journal_entry/journal_entry.js
@@ -185,8 +185,39 @@
 		})
 	},
 
+	due_date_options_cache: {},
+
 	reference_name: function(doc, cdt, cdn) {
 		var d = frappe.get_doc(cdt, cdn);
+		var me = this;
+
+		const get_invoice_due_dates = invoice_name => {
+			const options = this.due_date_options_cache[invoice_name];
+			const input = $(cur_frm.fields_dict["accounts"].wrapper).find("select[data-fieldname=reference_due_date]");
+
+			if (options) {
+				input.empty();
+				input.add_options(options);
+				frappe.model.set_value(cdt, cdn, "reference_due_date", options[0]);
+			}
+			else {
+				frappe.call({
+					method: "erpnext.accounts.doctype.journal_entry.journal_entry.get_invoice_due_dates",
+					args: {name: invoice_name},
+					callback: function(r) {
+						const options = [];
+						$.each(r.message, function(key, value) {
+							options.push(value.due_date);
+						});
+						input.empty();
+						input.add_options(options);
+						frappe.model.set_value(cdt, cdn, "reference_due_date", options[0]);
+						me.due_date_options_cache[d.reference_name] = options;
+					}
+				});
+			}
+		}
+
 		if(d.reference_name) {
 			if (d.reference_type==="Purchase Invoice" && !flt(d.debit)) {
 				this.get_outstanding('Purchase Invoice', d.reference_name, doc.company, d);
@@ -197,6 +228,9 @@
 			if (d.reference_type==="Journal Entry" && !flt(d.credit) && !flt(d.debit)) {
 				this.get_outstanding('Journal Entry', d.reference_name, doc.company, d);
 			}
+			if( in_list(["Sales Invoice", "Purchase Invoice"]), d.reference_type) {
+				get_invoice_due_dates(d.reference_name);
+			}
 		}
 	},
 
diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry.py b/erpnext/accounts/doctype/journal_entry/journal_entry.py
index cc35652..f010e67 100644
--- a/erpnext/accounts/doctype/journal_entry/journal_entry.py
+++ b/erpnext/accounts/doctype/journal_entry/journal_entry.py
@@ -436,7 +436,8 @@
 						"against_voucher": d.reference_name,
 						"remarks": self.remark,
 						"cost_center": d.cost_center,
-						"project": d.project
+						"project": d.project,
+						"due_date": d.reference_due_date
 					})
 				)
 
@@ -898,3 +899,14 @@
 		exchange_rate = bank_balance_in_company_currency / bank_balance_in_account_currency
 
 	return exchange_rate
+
+
+@frappe.whitelist()
+def get_invoice_due_dates(name):
+	result = frappe.get_list(
+		doctype='GL Entry', group_by='name, due_date',
+		filters={'voucher_no': name, "ifnull(due_date, '')": ('!=', '')},
+		fields=['due_date'], distinct=True
+	)
+
+	return result
diff --git a/erpnext/accounts/doctype/journal_entry_account/journal_entry_account.json b/erpnext/accounts/doctype/journal_entry_account/journal_entry_account.json
index 54af579..48d5ed2 100644
--- a/erpnext/accounts/doctype/journal_entry_account/journal_entry_account.json
+++ b/erpnext/accounts/doctype/journal_entry_account/journal_entry_account.json
@@ -1,5 +1,6 @@
 {
  "allow_copy": 0, 
+ "allow_guest_to_view": 0, 
  "allow_import": 0, 
  "allow_rename": 0, 
  "autoname": "hash", 
@@ -13,6 +14,7 @@
  "engine": "InnoDB", 
  "fields": [
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 1, 
    "collapsible": 0, 
@@ -46,6 +48,7 @@
    "width": "250px"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -75,6 +78,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -106,6 +110,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -141,6 +146,7 @@
    "width": "180px"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -168,6 +174,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -197,6 +204,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -226,6 +234,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -256,6 +265,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -287,6 +297,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -317,6 +328,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -345,6 +357,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -374,6 +387,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -402,6 +416,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 1, 
    "collapsible": 0, 
@@ -432,6 +447,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 1, 
    "collapsible": 0, 
@@ -464,6 +480,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -491,6 +508,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 1, 
    "collapsible": 0, 
@@ -521,6 +539,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 1, 
    "collapsible": 0, 
@@ -553,6 +572,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -581,6 +601,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -611,6 +632,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -641,6 +663,39 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "depends_on": "eval:doc.reference_type&&!in_list(doc.reference_type, ['Expense Claim', 'Asset', 'Employee Loan'])", 
+   "fieldname": "reference_due_date", 
+   "fieldtype": "Select", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "ignore_xss_filter": 0, 
+   "in_filter": 0, 
+   "in_global_search": 0, 
+   "in_list_view": 0, 
+   "in_standard_filter": 0, 
+   "label": "Reference Due Date", 
+   "length": 0, 
+   "no_copy": 0, 
+   "options": "", 
+   "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_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -671,6 +726,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -698,6 +754,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -729,6 +786,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -759,17 +817,17 @@
    "unique": 0
   }
  ], 
+ "has_web_view": 0, 
  "hide_heading": 0, 
  "hide_toolbar": 0, 
  "idx": 1, 
  "image_view": 0, 
  "in_create": 0, 
- "in_dialog": 0, 
  "is_submittable": 0, 
  "issingle": 0, 
  "istable": 1, 
  "max_attachments": 0, 
- "modified": "2017-03-02 05:02:10.102039", 
+ "modified": "2017-08-30 08:44:54.295493", 
  "modified_by": "Administrator", 
  "module": "Accounts", 
  "name": "Journal Entry Account", 
diff --git a/erpnext/accounts/doctype/payment_entry/payment_entry.js b/erpnext/accounts/doctype/payment_entry/payment_entry.js
index c5e0306..d8995a9 100644
--- a/erpnext/accounts/doctype/payment_entry/payment_entry.js
+++ b/erpnext/accounts/doctype/payment_entry/payment_entry.js
@@ -253,20 +253,24 @@
 				},
 				callback: function(r, rt) {
 					if(r.message) {
-						if(frm.doc.payment_type == "Receive") {
-							frm.set_value("paid_from", r.message.party_account);
-							frm.set_value("paid_from_account_currency", r.message.party_account_currency);
-							frm.set_value("paid_from_account_balance", r.message.account_balance);
-						} else if (frm.doc.payment_type == "Pay"){
-							frm.set_value("paid_to", r.message.party_account);
-							frm.set_value("paid_to_account_currency", r.message.party_account_currency);
-							frm.set_value("paid_to_account_balance", r.message.account_balance);
-						}
-						frm.set_value("party_balance", r.message.party_balance);
-						frm.events.get_outstanding_documents(frm);
-						frm.events.hide_unhide_fields(frm);
-						frm.events.set_dynamic_labels(frm);
-						frm.set_party_account_based_on_party = false;
+						frappe.run_serially([
+							() => {
+								if(frm.doc.payment_type == "Receive") {
+									frm.set_value("paid_from", r.message.party_account);
+									frm.set_value("paid_from_account_currency", r.message.party_account_currency);
+									frm.set_value("paid_from_account_balance", r.message.account_balance);
+								} else if (frm.doc.payment_type == "Pay"){
+									frm.set_value("paid_to", r.message.party_account);
+									frm.set_value("paid_to_account_currency", r.message.party_account_currency);
+									frm.set_value("paid_to_account_balance", r.message.account_balance);
+								}
+							},
+							() => frm.set_value("party_balance", r.message.party_balance),
+							() => frm.events.get_outstanding_documents(frm),
+							() => frm.events.hide_unhide_fields(frm),
+							() => frm.events.set_dynamic_labels(frm),
+							() => { frm.set_party_account_based_on_party = false; }
+						]);
 					}
 				}
 			});
diff --git a/erpnext/accounts/doctype/payment_entry/payment_entry.py b/erpnext/accounts/doctype/payment_entry/payment_entry.py
index 56bdfba..36ff0ac 100644
--- a/erpnext/accounts/doctype/payment_entry/payment_entry.py
+++ b/erpnext/accounts/doctype/payment_entry/payment_entry.py
@@ -8,14 +8,16 @@
 from frappe.utils import flt, comma_or, nowdate
 from erpnext.accounts.utils import get_outstanding_invoices, get_account_currency, get_balance_on
 from erpnext.accounts.party import get_party_account
-from erpnext.accounts.doctype.journal_entry.journal_entry \
-	import get_average_exchange_rate, get_default_bank_cash_account
+from erpnext.accounts.doctype.journal_entry.journal_entry import get_default_bank_cash_account
 from erpnext.setup.utils import get_exchange_rate
 from erpnext.accounts.general_ledger import make_gl_entries
 from erpnext.hr.doctype.expense_claim.expense_claim import update_reimbursed_amount
 from erpnext.controllers.accounts_controller import AccountsController
 
-class InvalidPaymentEntry(ValidationError): pass
+
+class InvalidPaymentEntry(ValidationError):
+	pass
+
 
 class PaymentEntry(AccountsController):
 	def setup_party_account_field(self):
@@ -69,10 +71,9 @@
 	def validate_duplicate_entry(self):
 		reference_names = []
 		for d in self.get("references"):
-			if (d.reference_doctype, d.reference_name) in reference_names:
+			if (d.reference_doctype, d.reference_name, d.due_date) in reference_names:
 				frappe.throw(_("Row #{0}: Duplicate entry in References {1} {2}").format(d.idx, d.reference_doctype, d.reference_name))
-			reference_names.append((d.reference_doctype, d.reference_name))
-
+			reference_names.append((d.reference_doctype, d.reference_name, d.due_date))
 
 	def validate_allocated_amount(self):
 		for d in self.get("references"):
@@ -80,7 +81,6 @@
 				if flt(d.allocated_amount) > flt(d.outstanding_amount):
 					frappe.throw(_("Row #{0}: Allocated Amount cannot be greater than outstanding amount.").format(d.idx))
 
-
 	def delink_advance_entry_references(self):
 		for reference in self.references:
 			if reference.reference_doctype in ("Sales Invoice", "Purchase Invoice"):
@@ -128,7 +128,6 @@
 
 		self.set_missing_ref_details()
 
-
 	def set_missing_ref_details(self):
 		for d in self.get("references"):
 			if d.allocated_amount:
@@ -295,7 +294,7 @@
 
 	def set_difference_amount(self):
 		base_unallocated_amount = flt(self.unallocated_amount) * (flt(self.source_exchange_rate)
-			if self.payment_type=="Receive" else flt(self.target_exchange_rate))
+			if self.payment_type == "Receive" else flt(self.target_exchange_rate))
 
 		base_party_amount = flt(self.base_total_allocated_amount) + flt(base_unallocated_amount)
 
@@ -413,7 +412,8 @@
 				gle = party_gl_dict.copy()
 				gle.update({
 					"against_voucher_type": d.reference_doctype,
-					"against_voucher": d.reference_name
+					"against_voucher": d.reference_name,
+					"due_date": d.due_date
 				})
 
 				allocated_amount_in_company_currency = flt(flt(d.allocated_amount) * flt(d.exchange_rate),
@@ -505,12 +505,10 @@
 	company_currency = frappe.db.get_value("Company", args.get("company"), "default_currency")
 
 	# Get negative outstanding sales /purchase invoices
-	total_field = "base_grand_total" if party_account_currency == company_currency else "grand_total"
-
 	negative_outstanding_invoices = []
-	if (args.get("party_type") != "Student"):
+	if args.get("party_type") not in ["Student", "Employee"]:
 		negative_outstanding_invoices = get_negative_outstanding_invoices(args.get("party_type"),
-			args.get("party"), args.get("party_account"), total_field)
+			args.get("party"), args.get("party_account"), party_account_currency, company_currency)
 
 	# Get positive outstanding sales /purchase invoices/ Fees
 	outstanding_invoices = get_outstanding_invoices(args.get("party_type"), args.get("party"),
@@ -580,28 +578,34 @@
 
 	return order_list
 
-def get_negative_outstanding_invoices(party_type, party, party_account, total_field):
-	if party_type != "Employee":
-		voucher_type = "Sales Invoice" if party_type == "Customer" else "Purchase Invoice"
-		return frappe.db.sql("""
-			select
-				"{voucher_type}" as voucher_type, name as voucher_no,
-				{total_field} as invoice_amount, outstanding_amount, posting_date,
-				due_date, conversion_rate as exchange_rate
-			from
-				`tab{voucher_type}`
-			where
-				{party_type} = %s and {party_account} = %s and docstatus = 1 and outstanding_amount < 0
-			order by
-				posting_date, name
-			""".format(**{
-				"total_field": total_field,
-				"voucher_type": voucher_type,
-				"party_type": scrub(party_type),
-				"party_account": "debit_to" if party_type=="Customer" else "credit_to"
-			}), (party, party_account), as_dict = True)
+def get_negative_outstanding_invoices(party_type, party, party_account, party_account_currency, company_currency):
+	voucher_type = "Sales Invoice" if party_type == "Customer" else "Purchase Invoice"
+	if party_account_currency == company_currency:
+		grand_total_field = "base_grand_total"
+		rounded_total_field = "base_rounded_total"
 	else:
-		return []
+		grand_total_field = "grand_total"
+		rounded_total_field = "rounded_total"
+
+	return frappe.db.sql("""
+		select
+			"{voucher_type}" as voucher_type, name as voucher_no,
+			if({rounded_total_field}, {rounded_total_field}, {grand_total_field}) as invoice_amount,
+			outstanding_amount, posting_date,
+			due_date, conversion_rate as exchange_rate
+		from
+			`tab{voucher_type}`
+		where
+			{party_type} = %s and {party_account} = %s and docstatus = 1 and outstanding_amount < 0
+		order by
+			posting_date, name
+		""".format(**{
+			"rounded_total_field": rounded_total_field,
+			"grand_total_field": grand_total_field,
+			"voucher_type": voucher_type,
+			"party_type": scrub(party_type),
+			"party_account": "debit_to" if party_type == "Customer" else "credit_to"
+		}), (party, party_account), as_dict=True)
 
 @frappe.whitelist()
 def get_party_details(company, party_type, party, date):
@@ -721,7 +725,10 @@
 	if party_amount:
 		grand_total = outstanding_amount = party_amount
 	elif dt in ("Sales Invoice", "Purchase Invoice"):
-		grand_total = doc.base_grand_total if party_account_currency == doc.company_currency else doc.grand_total
+		if party_account_currency == doc.company_currency:
+			grand_total = doc.base_rounded_total or doc.base_grand_total
+		else:
+			grand_total = doc.rounded_total or doc.grand_total
 		outstanding_amount = doc.outstanding_amount
 	elif dt in ("Expense Claim"):
 		grand_total = doc.total_sanctioned_amount
@@ -730,8 +737,10 @@
 		grand_total = doc.grand_total
 		outstanding_amount = doc.outstanding_amount
 	else:
-		total_field = "base_grand_total" if party_account_currency == doc.company_currency else "grand_total"
-		grand_total = flt(doc.get(total_field))
+		if party_account_currency == doc.company_currency:
+			grand_total = flt(doc.get("base_rounded_total") or doc.base_grand_total)
+		else:
+			grand_total = flt(doc.get("rounded_total") or doc.grand_total)
 		outstanding_amount = grand_total - flt(doc.advance_paid)
 
 	# bank or cash
@@ -766,20 +775,51 @@
 	pe.received_amount = received_amount
 	pe.allocate_payment_amount = 1
 	pe.letter_head = doc.get("letter_head")
+	args = {
+		'party_account': party_account, 'company': pe.company, 'party_type': pe.party_type,
+		'party': pe.party, 'posting_date': pe.posting_date
+	}
+	references = get_outstanding_reference_documents(args=args)
 
-	pe.append("references", {
-		"reference_doctype": dt,
-		"reference_name": dn,
-		"bill_no": doc.get("bill_no"),
-		"due_date": doc.get("due_date"),
-		"total_amount": grand_total,
-		"outstanding_amount": outstanding_amount,
-		"allocated_amount": outstanding_amount
-	})
+	for reference in references:
+		if reference.voucher_no == dn:
+			allocated_amount = min(paid_amount, reference.outstanding_amount)
+			pe.append("references", {
+				'reference_doctype': reference.voucher_type,
+				'reference_name': reference.voucher_no,
+				'due_date': reference.due_date,
+				'total_amount': reference.invoice_amount,
+				'outstanding_amount': reference.outstanding_amount,
+				'allocated_amount': allocated_amount,
+				"bill_no": reference.get("bill_no")
+			})
+			if paid_amount:
+				paid_amount -= allocated_amount
 
 	pe.setup_party_account_field()
 	pe.set_missing_values()
 	if party_account and bank:
 		pe.set_exchange_rate()
 		pe.set_amounts()
-	return pe
\ No newline at end of file
+	return pe
+
+
+def get_paid_amount(dt, dn, party_type, party, account, due_date):
+	if party_type=="Customer":
+		dr_or_cr = "credit_in_account_currency - debit_in_account_currency"
+	else:
+		dr_or_cr = "debit_in_account_currency - credit_in_account_currency"
+
+	paid_amount = frappe.db.sql("""
+		select ifnull(sum({dr_or_cr}), 0) as paid_amount
+		from `tabGL Entry`
+		where against_voucher_type = %s
+			and against_voucher = %s
+			and party_type = %s
+			and party = %s
+			and account = %s
+			and due_date = %s
+			and {dr_or_cr} > 0
+	""".format(dr_or_cr=dr_or_cr), (dt, dn, party_type, party, account, due_date))
+
+	return paid_amount[0][0] if paid_amount else 0
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/payment_entry/test_payment_entry.py b/erpnext/accounts/doctype/payment_entry/test_payment_entry.py
index 60be20d..a3a78a3 100644
--- a/erpnext/accounts/doctype/payment_entry/test_payment_entry.py
+++ b/erpnext/accounts/doctype/payment_entry/test_payment_entry.py
@@ -14,6 +14,7 @@
 
 test_dependencies = ["Item"]
 
+
 class TestPaymentEntry(unittest.TestCase):
 	def test_payment_entry_against_order(self):
 		so = make_sales_order()
@@ -40,7 +41,7 @@
 		self.assertEqual(so_advance_paid, 0)
 
 	def test_payment_entry_against_si_usd_to_usd(self):
-		si =  create_sales_invoice(customer="_Test Customer USD", debit_to="_Test Receivable USD - _TC",
+		si = create_sales_invoice(customer="_Test Customer USD", debit_to="_Test Receivable USD - _TC",
 			currency="USD", conversion_rate=50)
 		pe = get_payment_entry("Sales Invoice", si.name, bank_account="_Test Bank USD - _TC")
 		pe.reference_no = "1"
@@ -65,8 +66,20 @@
 		outstanding_amount = flt(frappe.db.get_value("Sales Invoice", si.name, "outstanding_amount"))
 		self.assertEqual(outstanding_amount, 100)
 
+	def test_payment_entry_against_si_multi_due_dates(self):
+		si = create_sales_invoice(do_not_save=1)
+		si.payment_terms_template = '_Test Payment Term Template'
+		si.insert()
+		si.submit()
+
+		pe = get_payment_entry(si.doctype, si.name)
+		pe.reference_no = "1"
+		pe.reference_date = "2016-01-01"
+		pe.insert()
+		pe.submit()
+
 	def test_payment_entry_against_pi(self):
-		pi =  make_purchase_invoice(supplier="_Test Supplier USD", debit_to="_Test Payable USD - _TC",
+		pi = make_purchase_invoice(supplier="_Test Supplier USD", debit_to="_Test Payable USD - _TC",
 			currency="USD", conversion_rate=50)
 		pe = get_payment_entry("Purchase Invoice", pi.name, bank_account="_Test Bank USD - _TC")
 		pe.reference_no = "1"
@@ -88,7 +101,7 @@
 	def test_payment_entry_against_ec(self):
 
 		payable = frappe.db.get_value('Company', "_Test Company", 'default_payable_account')
-		ec =  make_expense_claim(payable, 300, 300, "_Test Company","Travel Expenses - _TC")
+		ec = make_expense_claim(payable, 300, 300, "_Test Company", "Travel Expenses - _TC")
 		pe = get_payment_entry("Expense Claim", ec.name, bank_account="_Test Bank USD - _TC", bank_amount=300)
 		pe.reference_no = "1"
 		pe.reference_date = "2016-01-01"
@@ -108,7 +121,7 @@
 		self.assertEqual(outstanding_amount, 0)
 
 	def test_payment_entry_against_si_usd_to_inr(self):
-		si =  create_sales_invoice(customer="_Test Customer USD", debit_to="_Test Receivable USD - _TC",
+		si = create_sales_invoice(customer="_Test Customer USD", debit_to="_Test Receivable USD - _TC",
 			currency="USD", conversion_rate=50)
 		pe = get_payment_entry("Sales Invoice", si.name, party_amount=20,
 			bank_account="_Test Bank - _TC", bank_amount=900)
@@ -212,7 +225,7 @@
 
 		self.assertRaises(InvalidPaymentEntry, pe1.validate)
 
-		si1 =  create_sales_invoice()
+		si1 = create_sales_invoice()
 
 		# create full payment entry against si1
 		pe2 = get_payment_entry("Sales Invoice", si1.name, bank_account="_Test Cash - _TC")
diff --git a/erpnext/accounts/doctype/depreciation_schedule/__init__.py b/erpnext/accounts/doctype/payment_schedule/__init__.py
similarity index 100%
rename from erpnext/accounts/doctype/depreciation_schedule/__init__.py
rename to erpnext/accounts/doctype/payment_schedule/__init__.py
diff --git a/erpnext/schools/doctype/assessment_result_detail/assessment_result_detail.json b/erpnext/accounts/doctype/payment_schedule/payment_schedule.json
similarity index 79%
copy from erpnext/schools/doctype/assessment_result_detail/assessment_result_detail.json
copy to erpnext/accounts/doctype/payment_schedule/payment_schedule.json
index e7076bc..854def0 100644
--- a/erpnext/schools/doctype/assessment_result_detail/assessment_result_detail.json
+++ b/erpnext/accounts/doctype/payment_schedule/payment_schedule.json
@@ -5,7 +5,7 @@
  "allow_rename": 0, 
  "autoname": "", 
  "beta": 0, 
- "creation": "2016-12-14 17:44:35.583123", 
+ "creation": "2017-08-10 15:38:00.080575", 
  "custom": 0, 
  "docstatus": 0, 
  "doctype": "DocType", 
@@ -18,8 +18,8 @@
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
-   "columns": 4, 
-   "fieldname": "assessment_criteria", 
+   "columns": 2, 
+   "fieldname": "payment_term", 
    "fieldtype": "Link", 
    "hidden": 0, 
    "ignore_user_permissions": 0, 
@@ -28,10 +28,72 @@
    "in_global_search": 0, 
    "in_list_view": 1, 
    "in_standard_filter": 0, 
-   "label": "Assessment Criteria", 
+   "label": "Payment Term", 
    "length": 0, 
    "no_copy": 0, 
-   "options": "Assessment Criteria", 
+   "options": "Payment Term", 
+   "permlevel": 0, 
+   "precision": "", 
+   "print_hide": 1, 
+   "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_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 2, 
+   "fieldname": "description", 
+   "fieldtype": "Small Text", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "ignore_xss_filter": 0, 
+   "in_filter": 0, 
+   "in_global_search": 0, 
+   "in_list_view": 1, 
+   "in_standard_filter": 0, 
+   "label": "Description", 
+   "length": 0, 
+   "no_copy": 0, 
+   "options": "payment_term.description", 
+   "permlevel": 0, 
+   "precision": "", 
+   "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, 
+   "set_only_once": 0, 
+   "unique": 0
+  }, 
+  {
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 2, 
+   "fieldname": "due_date", 
+   "fieldtype": "Date", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "ignore_xss_filter": 0, 
+   "in_filter": 0, 
+   "in_global_search": 0, 
+   "in_list_view": 1, 
+   "in_standard_filter": 0, 
+   "label": "Due Date", 
+   "length": 0, 
+   "no_copy": 0, 
+   "options": "", 
    "permlevel": 0, 
    "precision": "", 
    "print_hide": 0, 
@@ -50,8 +112,8 @@
    "bold": 0, 
    "collapsible": 0, 
    "columns": 2, 
-   "fieldname": "maximum_score", 
-   "fieldtype": "Float", 
+   "fieldname": "invoice_portion", 
+   "fieldtype": "Percent", 
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
@@ -59,42 +121,13 @@
    "in_global_search": 0, 
    "in_list_view": 1, 
    "in_standard_filter": 0, 
-   "label": "Maximum Score", 
+   "label": "Invoice Portion", 
    "length": 0, 
    "no_copy": 0, 
+   "options": "payment_term.invoice_portion", 
    "permlevel": 0, 
    "precision": "", 
-   "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, 
-   "set_only_once": 0, 
-   "unique": 0
-  }, 
-  {
-   "allow_bulk_edit": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "column_break_2", 
-   "fieldtype": "Column Break", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 0, 
-   "in_standard_filter": 0, 
-   "label": "", 
-   "length": 0, 
-   "no_copy": 0, 
-   "permlevel": 0, 
-   "precision": "", 
-   "print_hide": 0, 
+   "print_hide": 1, 
    "print_hide_if_no_value": 0, 
    "read_only": 0, 
    "remember_last_selected_value": 0, 
@@ -110,8 +143,8 @@
    "bold": 0, 
    "collapsible": 0, 
    "columns": 2, 
-   "fieldname": "score", 
-   "fieldtype": "Float", 
+   "fieldname": "payment_amount", 
+   "fieldtype": "Currency", 
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
@@ -119,50 +152,21 @@
    "in_global_search": 0, 
    "in_list_view": 1, 
    "in_standard_filter": 0, 
-   "label": "Score", 
+   "label": "Payment Amount", 
    "length": 0, 
    "no_copy": 0, 
+   "options": "currency", 
    "permlevel": 0, 
    "precision": "", 
    "print_hide": 0, 
    "print_hide_if_no_value": 0, 
-   "read_only": 0, 
+   "read_only": 1, 
    "remember_last_selected_value": 0, 
    "report_hide": 0, 
    "reqd": 1, 
    "search_index": 0, 
    "set_only_once": 0, 
    "unique": 0
-  }, 
-  {
-   "allow_bulk_edit": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 2, 
-   "fieldname": "grade", 
-   "fieldtype": "Data", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 1, 
-   "in_standard_filter": 0, 
-   "label": "Grade", 
-   "length": 0, 
-   "no_copy": 0, 
-   "permlevel": 0, 
-   "precision": "", 
-   "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, 
-   "set_only_once": 0, 
-   "unique": 0
   }
  ], 
  "has_web_view": 0, 
@@ -175,20 +179,19 @@
  "issingle": 0, 
  "istable": 1, 
  "max_attachments": 0, 
- "modified": "2017-06-30 08:21:47.068704", 
+ "modified": "2017-11-23 12:39:02.013040", 
  "modified_by": "Administrator", 
- "module": "Schools", 
- "name": "Assessment Result Detail", 
+ "module": "Accounts", 
+ "name": "Payment Schedule", 
  "name_case": "", 
  "owner": "Administrator", 
  "permissions": [], 
  "quick_entry": 1, 
  "read_only": 0, 
  "read_only_onload": 0, 
- "restrict_to_domain": "Education", 
  "show_name_in_global_search": 0, 
  "sort_field": "modified", 
  "sort_order": "DESC", 
- "track_changes": 0, 
+ "track_changes": 1, 
  "track_seen": 0
 }
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/asset/asset.py b/erpnext/accounts/doctype/payment_schedule/payment_schedule.py
similarity index 85%
rename from erpnext/accounts/doctype/asset/asset.py
rename to erpnext/accounts/doctype/payment_schedule/payment_schedule.py
index 942a59e..4174017 100644
--- a/erpnext/accounts/doctype/asset/asset.py
+++ b/erpnext/accounts/doctype/payment_schedule/payment_schedule.py
@@ -3,8 +3,8 @@
 # For license information, please see license.txt
 
 from __future__ import unicode_literals
-import frappe
 from frappe.model.document import Document
 
-class Asset(Document):
+
+class PaymentSchedule(Document):
 	pass
diff --git a/erpnext/accounts/doctype/asset/__init__.py b/erpnext/accounts/doctype/payment_term/__init__.py
similarity index 100%
rename from erpnext/accounts/doctype/asset/__init__.py
rename to erpnext/accounts/doctype/payment_term/__init__.py
diff --git a/erpnext/accounts/doctype/asset/asset.js b/erpnext/accounts/doctype/payment_term/payment_term.js
similarity index 65%
copy from erpnext/accounts/doctype/asset/asset.js
copy to erpnext/accounts/doctype/payment_term/payment_term.js
index 6693d3b..054c2d1 100644
--- a/erpnext/accounts/doctype/asset/asset.js
+++ b/erpnext/accounts/doctype/payment_term/payment_term.js
@@ -1,8 +1,2 @@
 // Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
-
-frappe.ui.form.on('Asset', {
-	refresh: function(frm) {
-
-	}
-});
diff --git a/erpnext/schools/doctype/school_settings/school_settings.json b/erpnext/accounts/doctype/payment_term/payment_term.json
similarity index 73%
copy from erpnext/schools/doctype/school_settings/school_settings.json
copy to erpnext/accounts/doctype/payment_term/payment_term.json
index b6d9890..702319b 100644
--- a/erpnext/schools/doctype/school_settings/school_settings.json
+++ b/erpnext/accounts/doctype/payment_term/payment_term.json
@@ -3,8 +3,9 @@
  "allow_guest_to_view": 0, 
  "allow_import": 0, 
  "allow_rename": 0, 
+ "autoname": "field:payment_term_name", 
  "beta": 0, 
- "creation": "2017-04-05 13:33:04.519313", 
+ "creation": "2017-08-10 15:24:54.876365", 
  "custom": 0, 
  "docstatus": 0, 
  "doctype": "DocType", 
@@ -15,11 +16,11 @@
   {
    "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
-   "bold": 0, 
+   "bold": 1, 
    "collapsible": 0, 
    "columns": 0, 
-   "fieldname": "current_academic_year", 
-   "fieldtype": "Link", 
+   "fieldname": "payment_term_name", 
+   "fieldtype": "Data", 
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
@@ -27,10 +28,9 @@
    "in_global_search": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
-   "label": "Current Academic Year", 
+   "label": "Payment Term Name", 
    "length": 0, 
    "no_copy": 0, 
-   "options": "Academic Year", 
    "permlevel": 0, 
    "precision": "", 
    "print_hide": 0, 
@@ -46,11 +46,11 @@
   {
    "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
-   "bold": 0, 
+   "bold": 1, 
    "collapsible": 0, 
    "columns": 0, 
-   "fieldname": "current_academic_term", 
-   "fieldtype": "Link", 
+   "fieldname": "invoice_portion", 
+   "fieldtype": "Float", 
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
@@ -58,38 +58,7 @@
    "in_global_search": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
-   "label": "Current Academic Term", 
-   "length": 0, 
-   "no_copy": 0, 
-   "options": "Academic Term", 
-   "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_bulk_edit": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "attendance_freeze_date", 
-   "fieldtype": "Date", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 0, 
-   "in_standard_filter": 0, 
-   "label": "Attendance Freeze Date", 
+   "label": "Invoice Portion", 
    "length": 0, 
    "no_copy": 0, 
    "permlevel": 0, 
@@ -110,7 +79,7 @@
    "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
-   "fieldname": "column_break_4", 
+   "fieldname": "column_break_3", 
    "fieldtype": "Column Break", 
    "hidden": 0, 
    "ignore_user_permissions": 0, 
@@ -136,12 +105,11 @@
   {
    "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
-   "bold": 0, 
+   "bold": 1, 
    "collapsible": 0, 
    "columns": 0, 
-   "description": "For Batch based Student Group, the Student Batch will be validated for every Student from the Program Enrollment.", 
-   "fieldname": "validate_batch", 
-   "fieldtype": "Check", 
+   "fieldname": "due_date_based_on", 
+   "fieldtype": "Select", 
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
@@ -149,7 +117,39 @@
    "in_global_search": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
-   "label": "Validate Batch for Students in Student Group", 
+   "label": "Due Date Based On", 
+   "length": 0, 
+   "no_copy": 0, 
+   "options": "Day(s) after invoice date\nDay(s) after the end of the invoice month\nMonth(s) after the end of the invoice month", 
+   "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_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 1, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "depends_on": "eval:in_list(['Day(s) after invoice date', 'Day(s) after the end of the invoice month'], doc.due_date_based_on)", 
+   "fieldname": "credit_days", 
+   "fieldtype": "Int", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "ignore_xss_filter": 0, 
+   "in_filter": 0, 
+   "in_global_search": 0, 
+   "in_list_view": 0, 
+   "in_standard_filter": 0, 
+   "label": "Credit Days", 
    "length": 0, 
    "no_copy": 0, 
    "permlevel": 0, 
@@ -170,9 +170,9 @@
    "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
-   "description": "For Course based Student Group, the Course will be validated for every Student from the enrolled Courses in Program Enrollment.", 
-   "fieldname": "validate_course", 
-   "fieldtype": "Check", 
+   "depends_on": "eval:doc.due_date_based_on=='Month(s) after the end of the invoice month'", 
+   "fieldname": "credit_months", 
+   "fieldtype": "Int", 
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
@@ -180,7 +180,7 @@
    "in_global_search": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
-   "label": "Validate Enrolled Course for Students in Student Group", 
+   "label": "Credit Months", 
    "length": 0, 
    "no_copy": 0, 
    "permlevel": 0, 
@@ -201,7 +201,7 @@
    "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
-   "fieldname": "section_break_7", 
+   "fieldname": "section_break_6", 
    "fieldtype": "Section Break", 
    "hidden": 0, 
    "ignore_user_permissions": 0, 
@@ -227,12 +227,11 @@
   {
    "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
-   "bold": 0, 
+   "bold": 1, 
    "collapsible": 0, 
    "columns": 0, 
-   "default": "Full Name", 
-   "fieldname": "instructor_created_by", 
-   "fieldtype": "Select", 
+   "fieldname": "description", 
+   "fieldtype": "Small Text", 
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
@@ -240,10 +239,9 @@
    "in_global_search": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
-   "label": "Instructor Records to be created by", 
+   "label": "Description", 
    "length": 0, 
    "no_copy": 0, 
-   "options": "Full Name\nNaming Series\nEmployee Number", 
    "permlevel": 0, 
    "precision": "", 
    "print_hide": 0, 
@@ -264,13 +262,13 @@
  "image_view": 0, 
  "in_create": 0, 
  "is_submittable": 0, 
- "issingle": 1, 
+ "issingle": 0, 
  "istable": 0, 
  "max_attachments": 0, 
- "modified": "2017-08-25 02:36:48.744456", 
+ "modified": "2017-08-10 16:26:03.581501", 
  "modified_by": "Administrator", 
- "module": "Schools", 
- "name": "School Settings", 
+ "module": "Accounts", 
+ "name": "Payment Term", 
  "name_case": "", 
  "owner": "Administrator", 
  "permissions": [
@@ -281,24 +279,63 @@
    "create": 1, 
    "delete": 1, 
    "email": 1, 
-   "export": 0, 
+   "export": 1, 
    "if_owner": 0, 
    "import": 0, 
    "permlevel": 0, 
    "print": 1, 
    "read": 1, 
-   "report": 0, 
+   "report": 1, 
    "role": "System Manager", 
    "set_user_permissions": 0, 
    "share": 1, 
    "submit": 0, 
    "write": 1
+  }, 
+  {
+   "amend": 0, 
+   "apply_user_permissions": 0, 
+   "cancel": 0, 
+   "create": 1, 
+   "delete": 1, 
+   "email": 1, 
+   "export": 1, 
+   "if_owner": 0, 
+   "import": 0, 
+   "permlevel": 0, 
+   "print": 1, 
+   "read": 1, 
+   "report": 1, 
+   "role": "Accounts Manager", 
+   "set_user_permissions": 0, 
+   "share": 1, 
+   "submit": 0, 
+   "write": 1
+  }, 
+  {
+   "amend": 0, 
+   "apply_user_permissions": 0, 
+   "cancel": 0, 
+   "create": 1, 
+   "delete": 1, 
+   "email": 1, 
+   "export": 1, 
+   "if_owner": 0, 
+   "import": 0, 
+   "permlevel": 0, 
+   "print": 1, 
+   "read": 1, 
+   "report": 1, 
+   "role": "Accounts User", 
+   "set_user_permissions": 0, 
+   "share": 1, 
+   "submit": 0, 
+   "write": 1
   }
  ], 
  "quick_entry": 1, 
  "read_only": 0, 
  "read_only_onload": 0, 
- "restrict_to_domain": "Education", 
  "show_name_in_global_search": 0, 
  "sort_field": "modified", 
  "sort_order": "DESC", 
diff --git a/erpnext/accounts/doctype/asset/asset.py b/erpnext/accounts/doctype/payment_term/payment_term.py
similarity index 85%
copy from erpnext/accounts/doctype/asset/asset.py
copy to erpnext/accounts/doctype/payment_term/payment_term.py
index 942a59e..5d4df05 100644
--- a/erpnext/accounts/doctype/asset/asset.py
+++ b/erpnext/accounts/doctype/payment_term/payment_term.py
@@ -3,8 +3,8 @@
 # For license information, please see license.txt
 
 from __future__ import unicode_literals
-import frappe
 from frappe.model.document import Document
 
-class Asset(Document):
+
+class PaymentTerm(Document):
 	pass
diff --git a/erpnext/accounts/doctype/asset/test_asset.js b/erpnext/accounts/doctype/payment_term/test_payment_term.js
similarity index 72%
copy from erpnext/accounts/doctype/asset/test_asset.js
copy to erpnext/accounts/doctype/payment_term/test_payment_term.js
index 6119e38..b26e42a 100644
--- a/erpnext/accounts/doctype/asset/test_asset.js
+++ b/erpnext/accounts/doctype/payment_term/test_payment_term.js
@@ -2,15 +2,15 @@
 // rename this file from _test_[name] to test_[name] to activate
 // and remove above this line
 
-QUnit.test("test: Asset", function (assert) {
+QUnit.test("test: Payment Term", function (assert) {
 	let done = assert.async();
 
 	// number of asserts
 	assert.expect(1);
 
 	frappe.run_serially([
-		// insert a new Asset
-		() => frappe.tests.make('Asset', [
+		// insert a new Payment Term
+		() => frappe.tests.make('Payment Term', [
 			// values to be set
 			{key: 'value'}
 		]),
diff --git a/erpnext/accounts/doctype/asset_category/test_asset_category.py b/erpnext/accounts/doctype/payment_term/test_payment_term.py
similarity index 74%
copy from erpnext/accounts/doctype/asset_category/test_asset_category.py
copy to erpnext/accounts/doctype/payment_term/test_payment_term.py
index 4d5169a..d9baa59 100644
--- a/erpnext/accounts/doctype/asset_category/test_asset_category.py
+++ b/erpnext/accounts/doctype/payment_term/test_payment_term.py
@@ -2,9 +2,8 @@
 # Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors
 # See license.txt
 from __future__ import unicode_literals
-
-import frappe
 import unittest
 
-class TestAssetCategory(unittest.TestCase):
+
+class TestPaymentTerm(unittest.TestCase):
 	pass
diff --git a/erpnext/accounts/doctype/payment_term/test_records.json b/erpnext/accounts/doctype/payment_term/test_records.json
new file mode 100644
index 0000000..ef6e069
--- /dev/null
+++ b/erpnext/accounts/doctype/payment_term/test_records.json
@@ -0,0 +1,34 @@
+[
+  {
+    "doctype":"Payment Term",
+    "due_date_based_on":"Day(s) after invoice date",
+    "payment_term_name":"_Test N30",
+    "description":"_Test Net 30 Days",
+    "invoice_portion":50,
+    "credit_days":30
+  },
+  {
+    "doctype":"Payment Term",
+    "due_date_based_on":"Day(s) after invoice date",
+    "payment_term_name":"_Test COD",
+    "description":"_Test Cash on Delivery",
+    "invoice_portion":50,
+    "credit_days":0
+  },
+  {
+    "doctype":"Payment Term",
+    "due_date_based_on":"Month(s) after the end of the invoice month",
+    "payment_term_name":"_Test EONM",
+    "description":"_Test End of Next Month",
+    "invoice_portion":100,
+    "credit_months":1
+  },
+  {
+    "doctype":"Payment Term",
+    "due_date_based_on":"Day(s) after invoice date",
+    "payment_term_name":"_Test N30 1",
+    "description":"_Test Net 30 Days",
+    "invoice_portion":100,
+    "credit_days":30
+  }
+]
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/depreciation_schedule/__init__.py b/erpnext/accounts/doctype/payment_terms_template/__init__.py
similarity index 100%
copy from erpnext/accounts/doctype/depreciation_schedule/__init__.py
copy to erpnext/accounts/doctype/payment_terms_template/__init__.py
diff --git a/erpnext/accounts/doctype/payment_terms_template/payment_terms_template.js b/erpnext/accounts/doctype/payment_terms_template/payment_terms_template.js
new file mode 100644
index 0000000..558297f
--- /dev/null
+++ b/erpnext/accounts/doctype/payment_terms_template/payment_terms_template.js
@@ -0,0 +1,12 @@
+// Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
+// For license information, please see license.txt
+
+frappe.ui.form.on('Payment Terms Template', {
+	setup: function(frm) {
+		frm.add_fetch("payment_term", "description", "description");
+		frm.add_fetch("payment_term", "invoice_portion", "invoice_portion");
+		frm.add_fetch("payment_term", "due_date_based_on", "due_date_based_on");
+		frm.add_fetch("payment_term", "credit_days", "credit_days");
+		frm.add_fetch("payment_term", "credit_months", "credit_months");
+	}
+});
diff --git a/erpnext/schools/doctype/fee_category/fee_category.json b/erpnext/accounts/doctype/payment_terms_template/payment_terms_template.json
similarity index 75%
copy from erpnext/schools/doctype/fee_category/fee_category.json
copy to erpnext/accounts/doctype/payment_terms_template/payment_terms_template.json
index 2b55f8d..0959658 100644
--- a/erpnext/schools/doctype/fee_category/fee_category.json
+++ b/erpnext/accounts/doctype/payment_terms_template/payment_terms_template.json
@@ -1,16 +1,17 @@
 {
  "allow_copy": 0, 
  "allow_guest_to_view": 0, 
- "allow_import": 1, 
- "allow_rename": 1, 
- "autoname": "field:category_name", 
+ "allow_import": 0, 
+ "allow_rename": 0, 
+ "autoname": "field:template_name", 
  "beta": 0, 
- "creation": "2015-09-16 13:01:10.448734", 
+ "creation": "2017-08-10 15:34:28.058054", 
  "custom": 0, 
  "docstatus": 0, 
  "doctype": "DocType", 
- "document_type": "Setup", 
- "editable_grid": 0, 
+ "document_type": "", 
+ "editable_grid": 1, 
+ "engine": "InnoDB", 
  "fields": [
   {
    "allow_bulk_edit": 0, 
@@ -18,20 +19,49 @@
    "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
-   "fieldname": "category_name", 
+   "fieldname": "template_name", 
    "fieldtype": "Data", 
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
    "in_filter": 0, 
    "in_global_search": 0, 
-   "in_list_view": 1, 
+   "in_list_view": 0, 
    "in_standard_filter": 0, 
-   "label": "Name", 
+   "label": "Template Name", 
    "length": 0, 
    "no_copy": 0, 
-   "oldfieldname": "earning_name", 
-   "oldfieldtype": "Data", 
+   "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_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "fieldname": "terms", 
+   "fieldtype": "Table", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "ignore_xss_filter": 0, 
+   "in_filter": 0, 
+   "in_global_search": 0, 
+   "in_list_view": 0, 
+   "in_standard_filter": 0, 
+   "label": "Payment Terms", 
+   "length": 0, 
+   "no_copy": 0, 
+   "options": "Payment Terms Template Detail", 
    "permlevel": 0, 
    "precision": "", 
    "print_hide": 0, 
@@ -43,45 +73,11 @@
    "search_index": 0, 
    "set_only_once": 0, 
    "unique": 0
-  }, 
-  {
-   "allow_bulk_edit": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "description", 
-   "fieldtype": "Small Text", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 1, 
-   "in_standard_filter": 0, 
-   "label": "Description", 
-   "length": 0, 
-   "no_copy": 0, 
-   "oldfieldname": "description", 
-   "oldfieldtype": "Small Text", 
-   "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, 
-   "width": "300px"
   }
  ], 
  "has_web_view": 0, 
  "hide_heading": 0, 
  "hide_toolbar": 0, 
- "icon": "fa fa-flag", 
  "idx": 0, 
  "image_view": 0, 
  "in_create": 0, 
@@ -89,11 +85,10 @@
  "issingle": 0, 
  "istable": 0, 
  "max_attachments": 0, 
- "menu_index": 0, 
- "modified": "2017-11-02 17:57:18.069158", 
+ "modified": "2017-08-10 15:46:33.877884", 
  "modified_by": "Administrator", 
- "module": "Schools", 
- "name": "Fee Category", 
+ "module": "Accounts", 
+ "name": "Payment Terms Template", 
  "name_case": "", 
  "owner": "Administrator", 
  "permissions": [
@@ -111,7 +106,7 @@
    "print": 1, 
    "read": 1, 
    "report": 1, 
-   "role": "Academics User", 
+   "role": "System Manager", 
    "set_user_permissions": 0, 
    "share": 1, 
    "submit": 0, 
@@ -158,14 +153,12 @@
    "write": 1
   }
  ], 
- "quick_entry": 1, 
+ "quick_entry": 0, 
  "read_only": 0, 
  "read_only_onload": 0, 
- "restrict_to_domain": "Education", 
- "search_fields": "description", 
- "show_name_in_global_search": 1, 
+ "show_name_in_global_search": 0, 
  "sort_field": "modified", 
  "sort_order": "DESC", 
- "track_changes": 0, 
+ "track_changes": 1, 
  "track_seen": 0
 }
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/payment_terms_template/payment_terms_template.py b/erpnext/accounts/doctype/payment_terms_template/payment_terms_template.py
new file mode 100644
index 0000000..7042df0
--- /dev/null
+++ b/erpnext/accounts/doctype/payment_terms_template/payment_terms_template.py
@@ -0,0 +1,42 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2017, 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
+from frappe.utils import flt, cint
+from frappe import _
+
+
+class PaymentTermsTemplate(Document):
+	def validate(self):
+		self.validate_invoice_portion()
+		self.validate_credit_days()
+		self.check_duplicate_terms()
+
+	def validate_invoice_portion(self):
+		total_portion = 0
+		for term in self.terms:
+			total_portion += flt(term.get('invoice_portion', 0))
+
+		if flt(total_portion, 2) != 100.00:
+			frappe.msgprint(_('Combined invoice portion must equal 100%'), raise_exception=1, indicator='red')
+
+	def validate_credit_days(self):
+		for term in self.terms:
+			if cint(term.credit_days) < 0:
+				frappe.msgprint(_('Credit Days cannot be a negative number'), raise_exception=1, indicator='red')
+
+	def check_duplicate_terms(self):
+		terms = []
+		for term in self.terms:
+			term_info = (term.credit_days, term.due_date_based_on)
+			if term_info in terms:
+				frappe.msgprint(
+					_('The Payment Term at row {0} is possibly a duplicate.').format(term.idx),
+					raise_exception=1, indicator='red'
+				)
+			else:
+				terms.append(term_info)
diff --git a/erpnext/accounts/doctype/asset_category/test_asset_category.js b/erpnext/accounts/doctype/payment_terms_template/test_payment_terms_template.js
similarity index 67%
copy from erpnext/accounts/doctype/asset_category/test_asset_category.js
copy to erpnext/accounts/doctype/payment_terms_template/test_payment_terms_template.js
index 7e343b7..494a0ed 100644
--- a/erpnext/accounts/doctype/asset_category/test_asset_category.js
+++ b/erpnext/accounts/doctype/payment_terms_template/test_payment_terms_template.js
@@ -2,15 +2,15 @@
 // rename this file from _test_[name] to test_[name] to activate
 // and remove above this line
 
-QUnit.test("test: Asset Category", function (assert) {
+QUnit.test("test: Payment Terms Template", function (assert) {
 	let done = assert.async();
 
 	// number of asserts
 	assert.expect(1);
 
 	frappe.run_serially([
-		// insert a new Asset Category
-		() => frappe.tests.make('Asset Category', [
+		// insert a new Payment Terms Template
+		() => frappe.tests.make('Payment Terms Template', [
 			// values to be set
 			{key: 'value'}
 		]),
diff --git a/erpnext/accounts/doctype/payment_terms_template/test_payment_terms_template.py b/erpnext/accounts/doctype/payment_terms_template/test_payment_terms_template.py
new file mode 100644
index 0000000..6daaf1e
--- /dev/null
+++ b/erpnext/accounts/doctype/payment_terms_template/test_payment_terms_template.py
@@ -0,0 +1,72 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors
+# See license.txt
+from __future__ import unicode_literals
+import unittest
+
+import frappe
+
+
+class TestPaymentTermsTemplate(unittest.TestCase):
+	def tearDown(self):
+		frappe.delete_doc('Payment Terms Template', '_Test Payment Terms Template For Test', force=1)
+
+	def test_create_template(self):
+		template = frappe.get_doc({
+			'doctype': 'Payment Terms Template',
+			'template_name': '_Test Payment Terms Template For Test',
+			'terms': [{
+				'doctype': 'Payment Terms Template Detail',
+				'invoice_portion': 50.00,
+				'credit_days_based_on': 'Day(s) after invoice date',
+				'credit_days': 30
+			}]
+		})
+
+		self.assertRaises(frappe.ValidationError, template.insert)
+
+		template.append('terms', {
+			'doctype': 'Payment Terms Template Detail',
+			'invoice_portion': 50.00,
+			'credit_days_based_on': 'Day(s) after invoice date',
+			'credit_days': 0
+		})
+
+		template.insert()
+
+	def test_credit_days(self):
+		template = frappe.get_doc({
+			'doctype': 'Payment Terms Template',
+			'template_name': '_Test Payment Terms Template For Test',
+			'terms': [{
+				'doctype': 'Payment Terms Template Detail',
+				'invoice_portion': 100.00,
+				'credit_days_based_on': 'Day(s) after invoice date',
+				'credit_days': -30
+			}]
+		})
+
+		self.assertRaises(frappe.ValidationError, template.insert)
+
+	def test_duplicate_terms(self):
+		template = frappe.get_doc({
+			'doctype': 'Payment Terms Template',
+			'template_name': '_Test Payment Terms Template For Test',
+			'terms': [
+				{
+					'doctype': 'Payment Terms Template Detail',
+					'invoice_portion': 50.00,
+					'credit_days_based_on': 'Day(s) after invoice date',
+					'credit_days': 30
+				},
+				{
+					'doctype': 'Payment Terms Template Detail',
+					'invoice_portion': 50.00,
+					'credit_days_based_on': 'Day(s) after invoice date',
+					'credit_days': 30
+				}
+
+			]
+		})
+
+		self.assertRaises(frappe.ValidationError, template.insert)
diff --git a/erpnext/accounts/doctype/payment_terms_template/test_records.json b/erpnext/accounts/doctype/payment_terms_template/test_records.json
new file mode 100644
index 0000000..fea0b35
--- /dev/null
+++ b/erpnext/accounts/doctype/payment_terms_template/test_records.json
@@ -0,0 +1,60 @@
+[
+  {
+    "doctype":"Payment Terms Template",
+    "terms":[
+          {
+            "doctype":"Payment Terms Template Detail",
+            "due_date_based_on":"Day(s) after invoice date",
+            "idx":1,
+            "description":"Cash on Delivery",
+            "invoice_portion":50,
+            "credit_days":0,
+            "credit_months":0,
+            "payment_term":"_Test COD"
+        },
+        {
+            "doctype":"Payment Terms Template Detail",
+            "due_date_based_on":"Day(s) after invoice date",
+            "idx":2,
+            "description":"Net 30 Days ",
+            "invoice_portion":50,
+            "credit_days":30,
+            "credit_months":0,
+            "payment_term":"_Test N30"
+        }
+    ],
+    "template_name":"_Test Payment Term Template"
+  },
+  {
+    "doctype":"Payment Terms Template",
+    "terms":[
+          {
+            "doctype":"Payment Terms Template Detail",
+            "due_date_based_on":"Month(s) after the end of the invoice month",
+            "idx":1,
+            "description":"_Test End of Next Months",
+            "invoice_portion":100,
+            "credit_days":0,
+            "credit_months":1,
+            "payment_term":"_Test EONM"
+        }
+    ],
+    "template_name":"_Test Payment Term Template 1"
+  },
+  {
+    "doctype":"Payment Terms Template",
+    "terms":[
+          {
+            "doctype":"Payment Terms Template Detail",
+            "due_date_based_on":"Day(s) after invoice date",
+            "idx":1,
+            "description":"_Test Net Within 30 days",
+            "invoice_portion":100,
+            "credit_days":30,
+            "credit_months":0,
+            "payment_term":"_Test N30 1"
+        }
+    ],
+    "template_name":"_Test Payment Term Template 3"
+  }
+]
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/asset/__init__.py b/erpnext/accounts/doctype/payment_terms_template_detail/__init__.py
similarity index 100%
copy from erpnext/accounts/doctype/asset/__init__.py
copy to erpnext/accounts/doctype/payment_terms_template_detail/__init__.py
diff --git a/erpnext/schools/doctype/student_admission_program/student_admission_program.json b/erpnext/accounts/doctype/payment_terms_template_detail/payment_terms_template_detail.json
similarity index 74%
copy from erpnext/schools/doctype/student_admission_program/student_admission_program.json
copy to erpnext/accounts/doctype/payment_terms_template_detail/payment_terms_template_detail.json
index 29bb57f..f808a0f 100644
--- a/erpnext/schools/doctype/student_admission_program/student_admission_program.json
+++ b/erpnext/accounts/doctype/payment_terms_template_detail/payment_terms_template_detail.json
@@ -3,9 +3,9 @@
  "allow_guest_to_view": 0, 
  "allow_import": 0, 
  "allow_rename": 0, 
- "autoname": "", 
+ "autoname": "PTTD.#####", 
  "beta": 0, 
- "creation": "2017-09-15 12:59:43.207923", 
+ "creation": "2017-08-10 15:34:09.409562", 
  "custom": 0, 
  "docstatus": 0, 
  "doctype": "DocType", 
@@ -18,8 +18,8 @@
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "program", 
+   "columns": 2, 
+   "fieldname": "payment_term", 
    "fieldtype": "Link", 
    "hidden": 0, 
    "ignore_user_permissions": 0, 
@@ -28,10 +28,10 @@
    "in_global_search": 0, 
    "in_list_view": 1, 
    "in_standard_filter": 0, 
-   "label": "Program", 
+   "label": "Payment Term", 
    "length": 0, 
    "no_copy": 0, 
-   "options": "Program", 
+   "options": "Payment Term", 
    "permlevel": 0, 
    "precision": "", 
    "print_hide": 0, 
@@ -49,9 +49,9 @@
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "minimum_age", 
-   "fieldtype": "Date", 
+   "columns": 2, 
+   "fieldname": "description", 
+   "fieldtype": "Small Text", 
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
@@ -59,9 +59,10 @@
    "in_global_search": 0, 
    "in_list_view": 1, 
    "in_standard_filter": 0, 
-   "label": "Minimum Age", 
+   "label": "Description", 
    "length": 0, 
    "no_copy": 0, 
+   "options": "", 
    "permlevel": 0, 
    "precision": "", 
    "print_hide": 0, 
@@ -79,9 +80,10 @@
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "maximum_age", 
-   "fieldtype": "Date", 
+   "columns": 2, 
+   "default": "0", 
+   "fieldname": "invoice_portion", 
+   "fieldtype": "Percent", 
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
@@ -89,9 +91,74 @@
    "in_global_search": 0, 
    "in_list_view": 1, 
    "in_standard_filter": 0, 
-   "label": "Maximum Age", 
+   "label": "Invoice Portion", 
    "length": 0, 
    "no_copy": 0, 
+   "options": "", 
+   "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_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 2, 
+   "fieldname": "due_date_based_on", 
+   "fieldtype": "Select", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "ignore_xss_filter": 0, 
+   "in_filter": 0, 
+   "in_global_search": 0, 
+   "in_list_view": 1, 
+   "in_standard_filter": 0, 
+   "label": "Due Date Based On", 
+   "length": 0, 
+   "no_copy": 0, 
+   "options": "Day(s) after invoice date\nDay(s) after the end of the invoice month\nMonth(s) after the end of the invoice month", 
+   "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_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 2, 
+   "default": "0", 
+   "depends_on": "eval:in_list(['Day(s) after invoice date', 'Day(s) after the end of the invoice month'], doc.due_date_based_on)", 
+   "fieldname": "credit_days", 
+   "fieldtype": "Int", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "ignore_xss_filter": 0, 
+   "in_filter": 0, 
+   "in_global_search": 0, 
+   "in_list_view": 1, 
+   "in_standard_filter": 0, 
+   "label": "Credit Days", 
+   "length": 0, 
+   "no_copy": 0, 
+   "options": "", 
    "permlevel": 0, 
    "precision": "", 
    "print_hide": 0, 
@@ -110,8 +177,10 @@
    "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
-   "fieldname": "column_break_4", 
-   "fieldtype": "Column Break", 
+   "default": "0", 
+   "depends_on": "eval:doc.due_date_based_on=='Month(s) after the end of the invoice month'", 
+   "fieldname": "credit_months", 
+   "fieldtype": "Int", 
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
@@ -119,66 +188,7 @@
    "in_global_search": 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_bulk_edit": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "application_fee", 
-   "fieldtype": "Currency", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 1, 
-   "in_standard_filter": 0, 
-   "label": "Application Fee", 
-   "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_bulk_edit": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "applicant_naming_series", 
-   "fieldtype": "Data", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 1, 
-   "in_standard_filter": 0, 
-   "label": "Naming Series (for Student Applicant)", 
+   "label": "Credit Months", 
    "length": 0, 
    "no_copy": 0, 
    "permlevel": 0, 
@@ -204,10 +214,10 @@
  "issingle": 0, 
  "istable": 1, 
  "max_attachments": 0, 
- "modified": "2017-10-02 17:13:52.586218", 
+ "modified": "2017-09-26 05:21:51.738319", 
  "modified_by": "Administrator", 
- "module": "Schools", 
- "name": "Student Admission Program", 
+ "module": "Accounts", 
+ "name": "Payment Terms Template Detail", 
  "name_case": "", 
  "owner": "Administrator", 
  "permissions": [], 
diff --git a/erpnext/accounts/doctype/asset/asset.py b/erpnext/accounts/doctype/payment_terms_template_detail/payment_terms_template_detail.py
similarity index 83%
copy from erpnext/accounts/doctype/asset/asset.py
copy to erpnext/accounts/doctype/payment_terms_template_detail/payment_terms_template_detail.py
index 942a59e..54c0fda 100644
--- a/erpnext/accounts/doctype/asset/asset.py
+++ b/erpnext/accounts/doctype/payment_terms_template_detail/payment_terms_template_detail.py
@@ -3,8 +3,8 @@
 # For license information, please see license.txt
 
 from __future__ import unicode_literals
-import frappe
 from frappe.model.document import Document
 
-class Asset(Document):
+
+class PaymentTermsTemplateDetail(Document):
 	pass
diff --git a/erpnext/accounts/doctype/pos_profile/pos_profile.js b/erpnext/accounts/doctype/pos_profile/pos_profile.js
index cb52627..25aff13 100755
--- a/erpnext/accounts/doctype/pos_profile/pos_profile.js
+++ b/erpnext/accounts/doctype/pos_profile/pos_profile.js
@@ -24,11 +24,11 @@
 
 frappe.ui.form.on('POS Profile', {
 	setup: function(frm) {
-		frm.set_query("online_print_format", function() {
+		frm.set_query("print_format_for_online", function() {
 			return {
 				filters: [
 					['Print Format', 'doc_type', '=', 'Sales Invoice'],
-					['Print Format', 'print_format_type', '!=', 'Js'],
+					['Print Format', 'print_format_type', '=', 'Server'],
 				]
 			};
 		});
diff --git a/erpnext/accounts/doctype/pos_profile/pos_profile.json b/erpnext/accounts/doctype/pos_profile/pos_profile.json
index 2740ef2..6c09c6e 100644
--- a/erpnext/accounts/doctype/pos_profile/pos_profile.json
+++ b/erpnext/accounts/doctype/pos_profile/pos_profile.json
@@ -2,7 +2,7 @@
  "allow_copy": 0, 
  "allow_guest_to_view": 0, 
  "allow_import": 0, 
- "allow_rename": 0, 
+ "allow_rename": 1, 
  "autoname": "field:pos_profile_name", 
  "beta": 0, 
  "creation": "2013-05-24 12:15:51", 
@@ -315,7 +315,7 @@
    "search_index": 0, 
    "set_only_once": 0, 
    "unique": 0
-  },
+  }, 
   {
    "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
@@ -1508,7 +1508,7 @@
  "issingle": 0, 
  "istable": 0, 
  "max_attachments": 0, 
- "modified": "2017-10-27 06:45:32.957674", 
+ "modified": "2017-11-24 14:08:09.184226", 
  "modified_by": "Administrator", 
  "module": "Accounts", 
  "name": "POS Profile", 
@@ -1558,6 +1558,7 @@
  "quick_entry": 0, 
  "read_only": 0, 
  "read_only_onload": 0, 
+ "search_fields": "pos_profile_name", 
  "show_name_in_global_search": 0, 
  "sort_field": "modified", 
  "sort_order": "DESC", 
diff --git a/erpnext/accounts/doctype/pos_profile/pos_profile.py b/erpnext/accounts/doctype/pos_profile/pos_profile.py
index 6b7d99f..c70526c 100644
--- a/erpnext/accounts/doctype/pos_profile/pos_profile.py
+++ b/erpnext/accounts/doctype/pos_profile/pos_profile.py
@@ -4,30 +4,34 @@
 from __future__ import unicode_literals
 import frappe
 from frappe import msgprint, _
-from frappe.utils import cint
+from frappe.utils import cint, now
 from erpnext.accounts.doctype.sales_invoice.sales_invoice import set_account_for_mode_of_payment
 
 from frappe.model.document import Document
 
 class POSProfile(Document):
 	def validate(self):
-		# self.check_for_duplicate()
+		self.validate_default_profile()
 		self.validate_all_link_fields()
 		self.validate_duplicate_groups()
 		self.check_default_payment()
 		self.validate_customer_territory_group()
 
-	def check_for_duplicate(self):
-		res = frappe.db.sql("""select name, user from `tabPOS Profile`
-			where ifnull(user, '') = %s and name != %s and company = %s""",
-			(self.user, self.name, self.company))
-		if res:
-			if res[0][1]:
-				msgprint(_("POS Profile {0} already created for user: {1} and company {2}").format(res[0][0],
-					res[0][1], self.company), raise_exception=1)
-			else:
-				msgprint(_("Global POS Profile {0} already created for company {1}").format(res[0][0],
-					self.company), raise_exception=1)
+	def validate_default_profile(self):
+		for row in self.applicable_for_users:
+			res = frappe.db.sql("""select pf.name
+				from
+					`tabPOS Profile User` pfu, `tabPOS Profile` pf
+				where
+					pf.name = pfu.parent and pfu.user = %s and pf.name != %s and pf.company = %s
+					and pfu.default=1""", (row.user, self.name, self.company))
+
+			if row.default and res:
+				msgprint(_("Already set default in pos profile {0} for user {1}, kindly disabled default")
+					.format(res[0][0], row.user), raise_exception=1)
+			elif not row.default and not res:
+				msgprint(_("Row {0}: set atleast one default pos profile for user {1}")
+					.format(row.idx, row.user), raise_exception=1)
 
 	def validate_all_link_fields(self):
 		accounts = {"Account": [self.income_account,
@@ -95,44 +99,58 @@
 def get_series():
 	return frappe.get_meta("Sales Invoice").get_field("naming_series").options or ""
 
-@frappe.whitelist()
-def get_pos_profiles_for_user(user=None):
-	out = []
-	if not user:
-		user = frappe.session.user
+def pos_profile_query(doctype, txt, searchfield, start, page_len, filters):
+	user = frappe.session['user']
+	company = filters.get('company') or frappe.defaults.get_user_default('company')
 
-	res = frappe.db.sql('''
-		select
-			parent
+	args = {
+		'user': user,
+		'start': start,
+		'company': company,
+		'page_len': page_len,
+		'txt': '%%%s%%' % txt
+	}
+
+	pos_profile = frappe.db.sql("""select pf.name, pf.pos_profile_name
 		from
-			`tabPOS Profile User`
+			`tabPOS Profile` pf, `tabPOS Profile User` pfu
 		where
-			user = %s
-	''', (user), as_dict=1)
+			pfu.parent = pf.name and pfu.user = %(user)s and pf.company = %(company)s
+			and (pf.name like %(txt)s or pf.pos_profile_name like %(txt)s)
+			and pf.disabled = 0 limit %(start)s, %(page_len)s""", args)
 
-	if not res:
-		company = frappe.defaults.get_user_default('company')
-		res = frappe.db.sql('''
-			select
-				pos_profile_name
+	if not pos_profile:
+		del args['user']
+
+		pos_profile = frappe.db.sql("""select pf.name, pf.pos_profile_name
 			from
-				`tabPOS Profile`
+				`tabPOS Profile` pf left join `tabPOS Profile User` pfu
+			on
+				pf.name = pfu.parent
 			where
-				company = %s
-		''', (company), as_dict=1)
+				ifnull(pfu.user, '') = '' and pf.company = %(company)s and
+				(pf.name like %(txt)s or pf.pos_profile_name like %(txt)s)
+				and pf.disabled = 0""", args)
 
-		out = [r.pos_profile_name for r in res]
-
-		return out
-
-	for r in res:
-		name = frappe.db.get_value('POS Profile', r.parent, 'pos_profile_name')
-		out.append(name)
-
-	return out
+	return pos_profile
 
 @frappe.whitelist()
-def get_pos_profile(pos_profile_name=None):
-	if not pos_profile_name: return
-	name = frappe.db.get_value('POS Profile', { 'pos_profile_name': pos_profile_name })
-	return frappe.get_doc('POS Profile', name)
+def set_default_profile(pos_profile, company):
+	modified = now()
+	user = frappe.session.user
+	company = frappe.db.escape(company)
+
+	if pos_profile and company:
+		frappe.db.sql(""" update `tabPOS Profile User` pfu, `tabPOS Profile` pf
+			set
+				pfu.default = 0, pf.modified = %s, pf.modified_by = %s
+			where
+				pfu.user = %s and pf.name = pfu.parent and pf.company = %s
+				and pfu.default = 1""", (modified, user, user, company), auto_commit=1)
+
+		frappe.db.sql(""" update `tabPOS Profile User` pfu, `tabPOS Profile` pf
+			set
+				pfu.default = 1, pf.modified = %s, pf.modified_by = %s
+			where
+				pfu.user = %s and pf.name = pfu.parent and pf.company = %s and pf.name = %s
+			""", (modified, user, user, company, pos_profile), auto_commit=1)
diff --git a/erpnext/accounts/doctype/pos_profile_user/pos_profile_user.json b/erpnext/accounts/doctype/pos_profile_user/pos_profile_user.json
index 22c7f72..2fb66d2 100644
--- a/erpnext/accounts/doctype/pos_profile_user/pos_profile_user.json
+++ b/erpnext/accounts/doctype/pos_profile_user/pos_profile_user.json
@@ -18,6 +18,36 @@
    "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
+   "fieldname": "default", 
+   "fieldtype": "Check", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "ignore_xss_filter": 0, 
+   "in_filter": 0, 
+   "in_global_search": 0, 
+   "in_list_view": 1, 
+   "in_standard_filter": 0, 
+   "label": "Default", 
+   "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_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
    "fieldname": "user", 
    "fieldtype": "Link", 
    "hidden": 0, 
@@ -54,7 +84,7 @@
  "issingle": 0, 
  "istable": 0, 
  "max_attachments": 0, 
- "modified": "2017-10-27 16:46:12.784244", 
+ "modified": "2017-11-23 17:13:16.005475", 
  "modified_by": "Administrator", 
  "module": "Accounts", 
  "name": "POS Profile User", 
diff --git a/erpnext/accounts/doctype/asset_category/test_asset_category.js b/erpnext/accounts/doctype/pos_profile_user/test_pos_profile_user.js
similarity index 70%
copy from erpnext/accounts/doctype/asset_category/test_asset_category.js
copy to erpnext/accounts/doctype/pos_profile_user/test_pos_profile_user.js
index 7e343b7..5449ab7 100644
--- a/erpnext/accounts/doctype/asset_category/test_asset_category.js
+++ b/erpnext/accounts/doctype/pos_profile_user/test_pos_profile_user.js
@@ -2,15 +2,15 @@
 // rename this file from _test_[name] to test_[name] to activate
 // and remove above this line
 
-QUnit.test("test: Asset Category", function (assert) {
+QUnit.test("test: POS Profile User", function (assert) {
 	let done = assert.async();
 
 	// number of asserts
 	assert.expect(1);
 
 	frappe.run_serially([
-		// insert a new Asset Category
-		() => frappe.tests.make('Asset Category', [
+		// insert a new POS Profile User
+		() => frappe.tests.make('POS Profile User', [
 			// values to be set
 			{key: 'value'}
 		]),
diff --git a/erpnext/accounts/doctype/asset_category/test_asset_category.py b/erpnext/accounts/doctype/pos_profile_user/test_pos_profile_user.py
similarity index 74%
copy from erpnext/accounts/doctype/asset_category/test_asset_category.py
copy to erpnext/accounts/doctype/pos_profile_user/test_pos_profile_user.py
index 4d5169a..5c69ab1 100644
--- a/erpnext/accounts/doctype/asset_category/test_asset_category.py
+++ b/erpnext/accounts/doctype/pos_profile_user/test_pos_profile_user.py
@@ -3,8 +3,7 @@
 # See license.txt
 from __future__ import unicode_literals
 
-import frappe
 import unittest
 
-class TestAssetCategory(unittest.TestCase):
+class TestPOSProfileUser(unittest.TestCase):
 	pass
diff --git a/erpnext/accounts/doctype/pricing_rule/test_pricing_rule.py b/erpnext/accounts/doctype/pricing_rule/test_pricing_rule.py
index 82a3d65..3fa34e2 100644
--- a/erpnext/accounts/doctype/pricing_rule/test_pricing_rule.py
+++ b/erpnext/accounts/doctype/pricing_rule/test_pricing_rule.py
@@ -252,9 +252,11 @@
 		self.assertEquals(so.items[0].rate, 100)
 
 	def test_pricing_rule_with_margin_and_discount(self):
+		frappe.delete_doc_if_exists('Pricing Rule', '_Test Pricing Rule')
 		make_pricing_rule(selling=1, margin_type="Percentage", margin_rate_or_amount=10)
 		si = create_sales_invoice(do_not_save=True)
 		si.items[0].price_list_rate = 1000
+		si.payment_schedule = []
 		si.insert(ignore_permissions=True)
 
 		item = si.items[0]
@@ -263,6 +265,7 @@
 
 		# With discount
 		item.discount_percentage = 10
+		si.payment_schedule = []
 		si.save()
 		item = si.items[0]
 		self.assertEquals(item.rate, 990)
diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js
index ff58bec..2fbf014 100644
--- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js
+++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js
@@ -378,5 +378,5 @@
 			erpnext.buying.get_default_bom(frm);
 		}
 		frm.toggle_reqd("supplier_warehouse", frm.doc.is_subcontracted==="Yes");
-	},
+	}
 })
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json
index 9837f77..2112fa1 100755
--- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json
+++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json
@@ -2974,6 +2974,99 @@
    "unique": 0
   },
   {
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 1, 
+   "collapsible_depends_on": "eval:(!doc.is_return)", 
+   "columns": 0, 
+   "fieldname": "payment_schedule_section", 
+   "fieldtype": "Section Break", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "ignore_xss_filter": 0, 
+   "in_filter": 0, 
+   "in_global_search": 0, 
+   "in_list_view": 0, 
+   "in_standard_filter": 0, 
+   "label": "Payment Terms", 
+   "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_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "fieldname": "payment_terms_template", 
+   "fieldtype": "Link", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "ignore_xss_filter": 0, 
+   "in_filter": 0, 
+   "in_global_search": 0, 
+   "in_list_view": 0, 
+   "in_standard_filter": 0, 
+   "label": "Payment Terms Template", 
+   "length": 0, 
+   "no_copy": 0, 
+   "options": "Payment Terms Template", 
+   "permlevel": 0, 
+   "precision": "", 
+   "print_hide": 1, 
+   "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_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "fieldname": "payment_schedule", 
+   "fieldtype": "Table", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "ignore_xss_filter": 0, 
+   "in_filter": 0, 
+   "in_global_search": 0, 
+   "in_list_view": 0, 
+   "in_standard_filter": 0, 
+   "label": "Payment Schedule", 
+   "length": 0, 
+   "no_copy": 1, 
+   "options": "Payment Schedule", 
+   "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_bulk_edit": 0,
    "allow_on_submit": 0,
    "bold": 0,
@@ -3760,7 +3853,7 @@
  "istable": 0,
  "max_attachments": 0,
  "menu_index": 0,
- "modified": "2017-11-16 01:04:15.308603",
+ "modified": "2017-11-23 01:04:15.308603",
  "modified_by": "Administrator",
  "module": "Accounts",
  "name": "Purchase Invoice",
diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py
index 626dd92..0c8bfc0 100644
--- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py
+++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py
@@ -95,7 +95,7 @@
 		if not self.credit_to:
 			self.credit_to = get_party_account("Supplier", self.supplier, self.company)
 		if not self.due_date:
-			self.due_date = get_due_date(self.posting_date, "Supplier", self.supplier, self.company)
+			self.due_date = get_due_date(self.posting_date, "Supplier", self.supplier)
 
 		super(PurchaseInvoice, self).set_missing_values(for_validate)
 
@@ -362,7 +362,27 @@
 
 	def make_supplier_gl_entry(self, gl_entries):
 		grand_total = self.rounded_total or self.grand_total
-		if grand_total:
+		if self.get("payment_schedule"):
+			for d in self.get("payment_schedule"):
+				payment_amount_in_company_currency = flt(d.payment_amount * self.conversion_rate,
+					d.precision("payment_amount"))
+
+				gl_entries.append(
+					self.get_gl_dict({
+						"account": self.credit_to,
+						"party_type": "Supplier",
+						"party": self.supplier,
+						"due_date": d.due_date,
+						"against": self.against_expense_account,
+						"credit": payment_amount_in_company_currency,
+						"credit_in_account_currency": payment_amount_in_company_currency \
+							if self.party_account_currency==self.company_currency else d.payment_amount,
+						"against_voucher": self.return_against if cint(self.is_return) else self.name,
+						"against_voucher_type": self.doctype
+					}, self.party_account_currency)
+				)
+
+		elif grand_total:
 			# Didnot use base_grand_total to book rounding loss gle
 			grand_total_in_company_currency = flt(grand_total * self.conversion_rate,
 				self.precision("grand_total"))
diff --git a/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.js b/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.js
index e01dda3..5e6d95c 100644
--- a/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.js
+++ b/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.js
@@ -20,7 +20,8 @@
 				{contact_person: 'Contact 3-Test Supplier'},
 				{taxes_and_charges: 'TEST In State GST'},
 				{tc_name: 'Test Term 1'},
-				{terms: 'This is Test'}
+				{terms: 'This is Test'},
+				{payment_terms_template: '_Test Payment Term Template UI'}
 			]);
 		},
 		() => cur_frm.save(),
@@ -34,6 +35,9 @@
 			// grand_total Calculated
 			assert.ok(cur_frm.doc.grand_total==590, "Grad Total correct");
 
+			assert.ok(cur_frm.doc.payment_terms_template, "Payment Terms Template is correct");
+			assert.ok(cur_frm.doc.payment_schedule.length > 0, "Payment Term Schedule is not empty");
+
 		},
 		() => frappe.tests.click_button('Submit'),
 		() => frappe.tests.click_button('Yes'),
diff --git a/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py b/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py
index 68bd3c2..3ac521a 100644
--- a/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py
+++ b/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py
@@ -6,15 +6,16 @@
 import unittest
 import frappe, erpnext
 import frappe.model
-from frappe.utils import cint, flt, today, nowdate
+from frappe.utils import cint, flt, today, nowdate, getdate, add_days
 import frappe.defaults
 from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import set_perpetual_inventory, \
 	test_records as pr_test_records
+from erpnext.controllers.accounts_controller import get_payment_terms
 from erpnext.exceptions import InvalidCurrency
 from erpnext.stock.doctype.stock_entry.test_stock_entry import get_qty_after_transaction
 from erpnext.accounts.doctype.account.test_account import get_inventory_account
 
-test_dependencies = ["Item", "Cost Center"]
+test_dependencies = ["Item", "Cost Center", "Payment Term", "Payment Terms Template"]
 test_ignore = ["Serial No"]
 
 class TestPurchaseInvoice(unittest.TestCase):
@@ -62,6 +63,12 @@
 
 		set_perpetual_inventory(0, pi.company)
 
+	def test_terms_added_after_save(self):
+		pi = frappe.copy_doc(test_records[1])
+		pi.insert()
+		self.assertTrue(pi.payment_schedule)
+		self.assertEqual(pi.payment_schedule[0].due_date, pi.due_date)
+
 	def test_payment_entry_unlink_against_purchase_invoice(self):
 		from erpnext.accounts.doctype.payment_entry.test_payment_entry import get_payment_entry
 		unlink_payment_on_cancel_of_invoice(0)
@@ -248,6 +255,7 @@
 		self.assertEqual(pi.outstanding_amount, 1212.30)
 
 		pi.disable_rounded_total = 0
+		pi.get("payment_schedule")[0].payment_amount = 1512.0
 		pi.save()
 		self.assertEqual(pi.outstanding_amount, 1212.0)
 
@@ -263,6 +271,56 @@
 		self.assertFalse(frappe.db.sql("""select name from `tabJournal Entry Account`
 			where reference_type='Purchase Invoice' and reference_name=%s""", pi.name))
 
+	def test_invoice_with_advance_and_multi_payment_terms(self):
+		from erpnext.accounts.doctype.journal_entry.test_journal_entry \
+			import test_records as jv_test_records
+
+		jv = frappe.copy_doc(jv_test_records[1])
+		jv.insert()
+		jv.submit()
+
+		pi = frappe.copy_doc(test_records[0])
+		pi.disable_rounded_total = 1
+		pi.append("advances", {
+			"reference_type": "Journal Entry",
+			"reference_name": jv.name,
+			"reference_row": jv.get("accounts")[0].name,
+			"advance_amount": 400,
+			"allocated_amount": 300,
+			"remarks": jv.remark
+		})
+		pi.insert()
+
+		pi.update({
+			"payment_schedule": get_payment_terms("_Test Payment Term Template",
+				pi.posting_date, pi.grand_total)
+		})
+
+		pi.save()
+		pi.submit()
+		self.assertEqual(pi.payment_schedule[0].payment_amount, 756.15)
+		self.assertEqual(pi.payment_schedule[0].due_date, pi.posting_date)
+		self.assertEqual(pi.payment_schedule[1].payment_amount, 756.15)
+		self.assertEqual(pi.payment_schedule[1].due_date, add_days(pi.posting_date, 30))
+
+		pi.load_from_db()
+
+		self.assertTrue(
+			frappe.db.sql(
+				"select name from `tabJournal Entry Account` where reference_type='Purchase Invoice' and "
+				"reference_name=%s and debit_in_account_currency=300", pi.name)
+		)
+
+		self.assertEqual(pi.outstanding_amount, 1212.30)
+
+		pi.cancel()
+
+		self.assertFalse(
+			frappe.db.sql(
+				"select name from `tabJournal Entry Account` where reference_type='Purchase Invoice' and "
+				"reference_name=%s", pi.name)
+		)
+
 	def test_total_purchase_cost_for_project(self):
 		existing_purchase_cost = frappe.db.sql("""select sum(base_net_amount)
 			from `tabPurchase Invoice Item` where project = '_Test Project' and docstatus=1""")
@@ -589,6 +647,55 @@
 		self.assertEquals(pi.total_taxes_and_charges, 462.3)
 		self.assertEquals(pi.grand_total, 1712.3)	
 
+	def test_gl_entry_based_on_payment_schedule(self):
+		pi = make_purchase_invoice(do_not_save=True, supplier="_Test Supplier P")
+		pi.append("payment_schedule", {
+			"due_date": add_days(nowdate(), 15),
+			"payment_amount": 100,
+			"invoice_portion": 40.00
+		})
+		pi.append("payment_schedule", {
+			"due_date": add_days(nowdate(), 25),
+			"payment_amount": 150,
+			"invoice_portion": 60.00
+		})
+
+		pi.save()
+		pi.submit()
+
+		gl_entries = frappe.db.sql("""select account, debit, credit, due_date
+			from `tabGL Entry` where voucher_type='Purchase Invoice' and voucher_no=%s
+			order by account asc, debit asc""", pi.name, as_dict=1)
+		self.assertTrue(gl_entries)
+
+		expected_gl_entries = sorted([
+			[pi.credit_to, 0.0, 100.0, add_days(nowdate(), 15)],
+			[pi.credit_to, 0.0, 150.0, add_days(nowdate(), 25)],
+			["_Test Account Cost for Goods Sold - _TC", 250.0, 0.0, None]
+		])
+
+		for i, gle in enumerate(sorted(gl_entries, key=lambda gle: gle.account)):
+			self.assertEquals(expected_gl_entries[i][0], gle.account)
+			self.assertEquals(expected_gl_entries[i][1], gle.debit)
+			self.assertEquals(expected_gl_entries[i][2], gle.credit)
+			self.assertEquals(getdate(expected_gl_entries[i][3]), getdate(gle.due_date))
+
+	def test_make_pi_without_terms(self):
+		pi = make_purchase_invoice(do_not_save=1)
+
+		self.assertFalse(pi.get('payment_schedule'))
+
+		pi.insert()
+
+		self.assertTrue(pi.get('payment_schedule'))
+
+	def test_duplicate_due_date_in_terms(self):
+		pi = make_purchase_invoice(do_not_save=1)
+		pi.append('payment_schedule', dict(due_date='2017-01-01', invoice_portion=50.00, payment_amount=50))
+		pi.append('payment_schedule', dict(due_date='2017-01-01', invoice_portion=50.00, payment_amount=50))
+
+		self.assertRaises(frappe.ValidationError, pi.insert)
+
 def unlink_payment_on_cancel_of_invoice(enable=1):
 	accounts_settings = frappe.get_doc("Accounts Settings")
 	accounts_settings.unlink_payment_on_cancellation_of_invoice = enable
diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js
index 82d8de5..49393c6 100644
--- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js
+++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js
@@ -311,6 +311,14 @@
 	},
 
 	is_pos: function(frm){
+		this.set_pos_data();
+	},
+
+	pos_profile: function() {
+		this.set_pos_data();
+	},
+
+	set_pos_data: function() {
 		if(this.frm.doc.is_pos) {
 			if(!this.frm.doc.company) {
 				this.frm.set_value("is_pos", 0);
@@ -323,7 +331,7 @@
 					callback: function(r) {
 						if(!r.exc) {
 							if(r.message && r.message.print_format) {
-								frm.pos_print_format = r.message.print_format;
+								me.frm.pos_print_format = r.message.print_format;
 							}
 							me.frm.script_manager.trigger("update_stock");
 							frappe.model.set_default_values(me.frm.doc);
@@ -540,6 +548,19 @@
 				}
 			};
 		});
+
+		frm.set_query('pos_profile', function(doc) {
+			if(!doc.company) {
+				frappe.throw(_('Please set Company'));
+			}
+
+			return {
+				query: 'erpnext.accounts.doctype.pos_profile.pos_profile.pos_profile_query',
+				filters: {
+					company: doc.company
+				}
+			};
+		});
 	},
 	//When multiple companies are set up. in case company name is changed set default company address
 	company:function(frm){
@@ -607,3 +628,4 @@
 
 	refresh_field('total_billing_amount')
 }
+
diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.json b/erpnext/accounts/doctype/sales_invoice/sales_invoice.json
index c0ea00c..41b92c4 100644
--- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.json
+++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.json
@@ -2752,6 +2752,101 @@
    "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
+   "collapsible": 1, 
+   "collapsible_depends_on": "eval:(!doc.is_pos && !doc.is_return)", 
+   "columns": 0, 
+   "fieldname": "payment_schedule_section", 
+   "fieldtype": "Section Break", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "ignore_xss_filter": 0, 
+   "in_filter": 0, 
+   "in_global_search": 0, 
+   "in_list_view": 0, 
+   "in_standard_filter": 0, 
+   "label": "Payment Terms", 
+   "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_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "depends_on": "eval:(!doc.is_pos && !doc.is_return)", 
+   "fieldname": "payment_terms_template", 
+   "fieldtype": "Link", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "ignore_xss_filter": 0, 
+   "in_filter": 0, 
+   "in_global_search": 0, 
+   "in_list_view": 0, 
+   "in_standard_filter": 0, 
+   "label": "Payment Terms Template", 
+   "length": 0, 
+   "no_copy": 0, 
+   "options": "Payment Terms Template", 
+   "permlevel": 0, 
+   "precision": "", 
+   "print_hide": 1, 
+   "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_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "depends_on": "eval:(!doc.is_pos && !doc.is_return)", 
+   "fieldname": "payment_schedule", 
+   "fieldtype": "Table", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "ignore_xss_filter": 0, 
+   "in_filter": 0, 
+   "in_global_search": 0, 
+   "in_list_view": 0, 
+   "in_standard_filter": 0, 
+   "label": "Payment Schedule", 
+   "length": 0, 
+   "no_copy": 1, 
+   "options": "Payment Schedule", 
+   "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_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
    "collapsible": 0, 
    "collapsible_depends_on": "", 
    "columns": 0, 
@@ -3002,6 +3097,7 @@
    "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
+   "depends_on": "is_pos", 
    "fieldname": "base_change_amount", 
    "fieldtype": "Currency", 
    "hidden": 0, 
@@ -3062,6 +3158,7 @@
    "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
+   "depends_on": "is_pos", 
    "fieldname": "change_amount", 
    "fieldtype": "Currency", 
    "hidden": 0, 
@@ -3093,6 +3190,7 @@
    "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
+   "depends_on": "is_pos", 
    "fieldname": "account_for_change_amount", 
    "fieldtype": "Link", 
    "hidden": 0, 
@@ -4434,7 +4532,7 @@
  "istable": 0, 
  "max_attachments": 0, 
  "menu_index": 0, 
- "modified": "2017-11-15 01:02:36.885752", 
+ "modified": "2017-11-23 12:36:53.731902", 
  "modified_by": "Administrator", 
  "module": "Accounts", 
  "name": "Sales Invoice", 
diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py
index 8edeb99..a91b4e1 100644
--- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py
+++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py
@@ -242,12 +242,12 @@
 		if not self.debit_to:
 			self.debit_to = get_party_account("Customer", self.customer, self.company)
 		if not self.due_date and self.customer:
-			self.due_date = get_due_date(self.posting_date, "Customer", self.customer, self.company)
+			self.due_date = get_due_date(self.posting_date, "Customer", self.customer)
 
 		super(SalesInvoice, self).set_missing_values(for_validate)
 
 		if pos:
-			return {"print_format": pos.get("print_format") }
+			return {"print_format": pos.get("print_format_for_online") }
 
 	def update_time_sheet(self, sales_invoice):
 		for d in self.timesheets:
@@ -294,21 +294,23 @@
 			return
 
 		from erpnext.stock.get_item_details import get_pos_profile_item_details, get_pos_profile
-		pos = get_pos_profile(self.company)
+		if not self.pos_profile:
+			pos_profile = get_pos_profile(self.company) or {}
+			self.pos_profile = pos_profile.get('name')
+
+		pos = {}
+		if self.pos_profile:
+			pos = frappe.get_doc('POS Profile', self.pos_profile)
 
 		if not self.get('payments') and not for_validate:
-			pos_profile = frappe.get_doc('POS Profile', pos.name) if pos else None
-			update_multi_mode_option(self, pos_profile)
+			update_multi_mode_option(self, pos)
 
 		if not self.account_for_change_amount:
 			self.account_for_change_amount = frappe.db.get_value('Company', self.company, 'default_cash_account')
 
 		if pos:
-			self.pos_profile = pos.name
 			if not for_validate and not self.customer:
 				self.customer = pos.customer
-				self.mode_of_payment = pos.mode_of_payment
-				# self.set_customer_defaults()
 
 			if pos.get('account_for_change_amount'):
 				self.account_for_change_amount = pos.get('account_for_change_amount')
@@ -633,7 +635,27 @@
 
 	def make_customer_gl_entry(self, gl_entries):
 		grand_total = self.rounded_total or self.grand_total
-		if grand_total:
+		if self.get("payment_schedule"):
+			for d in self.get("payment_schedule"):
+				payment_amount_in_company_currency = flt(d.payment_amount * self.conversion_rate,
+					d.precision("payment_amount"))
+
+				gl_entries.append(
+					self.get_gl_dict({
+						"account": self.debit_to,
+						"party_type": "Customer",
+						"party": self.customer,
+						"due_date": d.due_date,
+						"against": self.against_income_account,
+						"debit": payment_amount_in_company_currency,
+						"debit_in_account_currency": payment_amount_in_company_currency \
+							if self.party_account_currency==self.company_currency else d.payment_amount,
+						"against_voucher": self.return_against if cint(self.is_return) else self.name,
+						"against_voucher_type": self.doctype
+					}, self.party_account_currency)
+				)
+
+		elif grand_total:
 			# Didnot use base_grand_total to book rounding loss gle
 			grand_total_in_company_currency = flt(grand_total * self.conversion_rate,
 				self.precision("grand_total"))
@@ -969,4 +991,4 @@
 def set_account_for_mode_of_payment(self):
 	for data in self.payments:
 		if not data.account:
-			data.account = get_bank_cash_account(data.mode_of_payment, self.company).get("account")
+			data.account = get_bank_cash_account(data.mode_of_payment, self.company).get("account")
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.js b/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.js
index 35b2558..b4be3ba 100644
--- a/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.js
+++ b/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.js
@@ -1,7 +1,7 @@
 QUnit.module('Sales Invoice');
 
 QUnit.test("test sales Invoice", function(assert) {
-	assert.expect(4);
+	assert.expect(6);
 	let done = assert.async();
 	frappe.run_serially([
 		() => {
@@ -19,7 +19,8 @@
 				{contact_person: 'Contact 1-Test Customer 1'},
 				{taxes_and_charges: 'TEST In State GST'},
 				{tc_name: 'Test Term 1'},
-				{terms: 'This is Test'}
+				{terms: 'This is Test'},
+				{payment_terms_template: '_Test Payment Term Template UI'}
 			]);
 		},
 		() => cur_frm.save(),
@@ -31,7 +32,10 @@
 			// get tax account head details
 			assert.ok(cur_frm.doc.taxes[0].account_head=='CGST - '+frappe.get_abbr(frappe.defaults.get_default('Company')), " Account Head abbr correct");
 			// grand_total Calculated
-			assert.ok(cur_frm.doc.grand_total==590, "Grad Total correct");
+			assert.ok(cur_frm.doc.grand_total==590, "Grand Total correct");
+
+			assert.ok(cur_frm.doc.payment_terms_template, "Payment Terms Template is correct");
+			assert.ok(cur_frm.doc.payment_schedule.length > 0, "Payment Term Schedule is not empty");
 
 		},
 		() => frappe.tests.click_button('Submit'),
@@ -40,4 +44,3 @@
 		() => done()
 	]);
 });
-
diff --git a/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py
index 460158b..b3a143c 100644
--- a/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py
+++ b/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py
@@ -3,8 +3,9 @@
 from __future__ import unicode_literals
 
 import frappe
+
 import unittest, copy, time
-from frappe.utils import nowdate, add_days, flt, cint
+from frappe.utils import nowdate, add_days, flt, getdate, cint
 from frappe.model.dynamic_links import get_dynamic_link_map
 from erpnext.stock.doctype.stock_entry.test_stock_entry import make_stock_entry, get_qty_after_transaction
 from erpnext.accounts.doctype.purchase_invoice.test_purchase_invoice import unlink_payment_on_cancel_of_invoice
@@ -58,6 +59,13 @@
 
 		self.assertRaises(frappe.CannotChangeConstantError, si.save)
 
+	def test_add_terms_after_save(self):
+		si = frappe.copy_doc(test_records[2])
+		si.insert()
+
+		self.assertTrue(si.payment_schedule)
+		self.assertEqual(getdate(si.payment_schedule[0].due_date), getdate(si.due_date))
+
 	def test_sales_invoice_calculation_base_currency(self):
 		si = frappe.copy_doc(test_records[2])
 		si.insert()
@@ -199,6 +207,7 @@
 		# additional discount
 		si.discount_amount = 100
 		si.apply_discount_on = 'Net Total'
+		si.payment_schedule = []
 
 		si.save()
 
@@ -211,6 +220,7 @@
 		# additional discount on grand total
 		si.discount_amount = 100
 		si.apply_discount_on = 'Grand Total'
+		si.payment_schedule = []
 
 		si.save()
 
@@ -932,20 +942,6 @@
 
 		self.assertEquals(si.get("items")[0].serial_no, dn.get("items")[0].serial_no)
 
-	def test_invoice_due_date_against_customers_credit_days(self):
-		# set customer's credit days
-		frappe.db.set_value("Customer", "_Test Customer", "credit_days_based_on", "Fixed Days")
-		frappe.db.set_value("Customer", "_Test Customer", "credit_days", 10)
-
-		si = create_sales_invoice()
-		self.assertEqual(si.due_date, add_days(nowdate(), 10))
-
-		# set customer's credit days is last day of the next month
-		frappe.db.set_value("Customer", "_Test Customer", "credit_days_based_on", "Last Day of the Next Month")
-
-		si1 = create_sales_invoice(posting_date="2015-07-05")
-		self.assertEqual(si1.due_date, "2015-08-31")
-
 	def test_return_sales_invoice(self):
 		set_perpetual_inventory()
 		make_stock_entry(item_code="_Test Item", target="_Test Warehouse - _TC", qty=50, basic_rate=100)
@@ -1325,6 +1321,40 @@
 		})
 		si.insert()
 		return si
+	
+	def test_gl_entry_based_on_payment_schedule(self):
+		si = create_sales_invoice(do_not_save=True, customer="_Test Customer P")
+		si.append("payment_schedule", {
+			"due_date": add_days(nowdate(), 15),
+			"payment_amount": 20,
+			"invoice_portion": 20.00
+		})
+		si.append("payment_schedule", {
+			"due_date": add_days(nowdate(), 45),
+			"payment_amount": 80,
+			"invoice_portion": 80.00
+		})
+		
+		si.save()
+		si.submit()
+		
+		gl_entries = frappe.db.sql("""select account, debit, credit, due_date
+			from `tabGL Entry` where voucher_type='Sales Invoice' and voucher_no=%s
+			order by account asc, debit asc""", si.name, as_dict=1)
+		self.assertTrue(gl_entries)
+
+		expected_gl_entries = sorted([
+			[si.debit_to, 20.0, 0.0, add_days(nowdate(), 15)],
+			[si.debit_to, 80.0, 0.0, add_days(nowdate(), 45)],
+			["Sales - _TC", 0.0, 100.0, None]
+		])
+
+		for i, gle in enumerate(sorted(gl_entries, key=lambda gle: gle.account)):
+			self.assertEquals(expected_gl_entries[i][0], gle.account)
+			self.assertEquals(expected_gl_entries[i][1], gle.debit)
+			self.assertEquals(expected_gl_entries[i][2], gle.credit)
+			self.assertEquals(getdate(expected_gl_entries[i][3]), getdate(gle.due_date))
+
 
 	def test_company_monthly_sales(self):
 		existing_current_month_sales = frappe.db.get_value("Company", "_Test Company", "total_monthly_sales")
@@ -1404,6 +1434,20 @@
 		self.assertEquals(si.total_taxes_and_charges, 577.05)
 		self.assertEquals(si.grand_total, 1827.05)		
 
+	def test_create_invoice_without_terms(self):
+		si = create_sales_invoice(do_not_save=1)
+		self.assertFalse(si.get('payment_schedule'))
+
+		si.insert()
+		self.assertTrue(si.get('payment_schedule'))
+
+	def test_duplicate_due_date_in_terms(self):
+		si = create_sales_invoice(do_not_save=1)
+		si.append('payment_schedule', dict(due_date='2017-01-01', invoice_portion=50.00, payment_amount=50))
+		si.append('payment_schedule', dict(due_date='2017-01-01', invoice_portion=50.00, payment_amount=50))
+
+		self.assertRaises(frappe.ValidationError, si.insert)
+
 def create_sales_invoice(**args):
 	si = frappe.new_doc("Sales Invoice")
 	args = frappe._dict(args)
@@ -1437,6 +1481,11 @@
 		si.insert()
 		if not args.do_not_submit:
 			si.submit()
+		else:
+			si.payment_schedule = []
+	else:
+		si.payment_schedule = []
+
 	return si
 
 test_dependencies = ["Journal Entry", "Contact", "Address"]
diff --git a/erpnext/accounts/doctype/sales_invoice/tests/test_sales_invoice_with_payment.js b/erpnext/accounts/doctype/sales_invoice/tests/test_sales_invoice_with_payment.js
index 736443e..14c0d55 100644
--- a/erpnext/accounts/doctype/sales_invoice/tests/test_sales_invoice_with_payment.js
+++ b/erpnext/accounts/doctype/sales_invoice/tests/test_sales_invoice_with_payment.js
@@ -19,7 +19,8 @@
 				{contact_person: 'Contact 1-Test Customer 1'},
 				{taxes_and_charges: 'TEST In State GST'},
 				{tc_name: 'Test Term 1'},
-				{terms: 'This is Test'}
+				{terms: 'This is Test'},
+				{payment_terms_template: '_Test Payment Term Template UI'}
 			]);
 		},
 		() => cur_frm.save(),
@@ -43,6 +44,7 @@
 		() => { cur_frm.set_value('paid_to','Cash - '+frappe.get_abbr(frappe.defaults.get_default('Company')));},
 		() => {cur_frm.set_value('reference_no','TEST1234');},
 		() => {cur_frm.set_value('reference_date',frappe.datetime.add_days(frappe.datetime.nowdate(), 0));},
+		() => cur_frm.set_value("payment_schedule", []),
 		() => cur_frm.save(),
 		() => {
 			// get payment details
diff --git a/erpnext/accounts/general_ledger.py b/erpnext/accounts/general_ledger.py
index c575d59..d370c49 100644
--- a/erpnext/accounts/general_ledger.py
+++ b/erpnext/accounts/general_ledger.py
@@ -3,7 +3,7 @@
 
 from __future__ import unicode_literals
 import frappe, erpnext
-from frappe.utils import flt, cstr, cint
+from frappe.utils import flt, cstr, cint, getdate
 from frappe import _
 from frappe.model.meta import get_field_precision
 from erpnext.accounts.doctype.budget.budget import validate_expense_against_budget
@@ -75,7 +75,8 @@
 			and cstr(e.get('against_voucher'))==cstr(gle.get('against_voucher')) \
 			and cstr(e.get('against_voucher_type')) == cstr(gle.get('against_voucher_type')) \
 			and cstr(e.get('cost_center')) == cstr(gle.get('cost_center')) \
-			and cstr(e.get('project')) == cstr(gle.get('project')):
+			and cstr(e.get('project')) == cstr(gle.get('project')) \
+			and getdate(e.get('due_date')) == getdate(gle.get('due_date')):
 				return e
 
 def save_entries(gl_map, adv_adj, update_outstanding, from_repost=False):
diff --git a/erpnext/accounts/party.py b/erpnext/accounts/party.py
index e6887ba..7bccfe8 100644
--- a/erpnext/accounts/party.py
+++ b/erpnext/accounts/party.py
@@ -9,7 +9,7 @@
 from frappe.defaults import get_user_permissions
 from frappe.model.utils import get_fetch_values
 from frappe.utils import (add_days, getdate, formatdate, get_first_day, date_diff,
-	add_years, get_timestamp, nowdate, flt)
+                          add_years, get_timestamp, nowdate, flt, add_months, get_last_day)
 from frappe.contacts.doctype.address.address import (get_address_display,
 	get_default_address, get_company_address)
 from frappe.contacts.doctype.contact.contact import get_contact_details, get_default_contact
@@ -51,6 +51,7 @@
 	set_other_values(out, party, party_type)
 	set_price_list(out, party, party_type, price_list)
 	out["taxes_and_charges"] = set_taxes(party.name, party_type, posting_date, company, out.customer_group, out.supplier_type)
+	out["payment_terms_template"] = get_pyt_term_template(party.name, party_type)
 
 	if not out.get("currency"):
 		out["currency"] = currency
@@ -163,7 +164,7 @@
 	out = {
 		party_type.lower(): party,
 		account_fieldname : account,
-		"due_date": get_due_date(posting_date, party_type, party, company)
+		"due_date": get_due_date(posting_date, party_type, party)
 	}
 	return out
 
@@ -262,51 +263,54 @@
 
 		if doc.get("default_currency") and party_account_currency and company_default_currency:
 			if doc.default_currency != party_account_currency and doc.default_currency != company_default_currency:
-				frappe.throw(_("Billing currency must be equal to either default comapany's currency or party account currency"))
+				frappe.throw(_("Billing currency must be equal to either default company's currency or party account currency"))
+
 
 @frappe.whitelist()
-def get_due_date(posting_date, party_type, party, company):
-	"""Set Due Date = Posting Date + Credit Days"""
+def get_due_date(posting_date, party_type, party):
+	"""Get due date from `Payment Terms Template`"""
 	due_date = None
 	if posting_date and party:
 		due_date = posting_date
-		credit_days_based_on, credit_days = get_credit_days(party_type, party, company)
-		if credit_days_based_on == "Fixed Days" and credit_days:
-			due_date = add_days(posting_date, credit_days)
-		elif credit_days_based_on == "Last Day of the Next Month":
-			due_date = (get_first_day(posting_date, 0, 2) + datetime.timedelta(-1)).strftime("%Y-%m-%d")
+		template_name = get_pyt_term_template(party, party_type)
+		if template_name:
+			due_date = get_due_date_from_template(template_name, posting_date).strftime("%Y-%m-%d")
+		else:
+			if party_type == "Supplier":
+				supplier_type = frappe.db.get_value(party_type, party, fieldname="supplier_type")
+				template_name = frappe.db.get_value("Supplier Type", supplier_type, fieldname="payment_terms")
+				if template_name:
+					due_date = get_due_date_from_template(template_name, posting_date).strftime("%Y-%m-%d")
 
 	return due_date
 
-def get_credit_days(party_type, party, company):
-	credit_days = 0
-	if party_type and party:
-		if party_type == "Customer":
-			credit_days_based_on, credit_days, customer_group = \
-				frappe.db.get_value(party_type, party, ["credit_days_based_on", "credit_days", "customer_group"])
+
+def get_due_date_from_template(template_name, posting_date):
+	"""
+	Inspects all `Payment Term`s from the a `Payment Terms Template` and returns the due
+	date after considering all the `Payment Term`s requirements.
+	:param template_name: Name of the `Payment Terms Template`
+	:return: String representing the calculated due date
+	"""
+	due_date = getdate(posting_date)
+	template = frappe.get_doc('Payment Terms Template', template_name)
+
+	for term in template.terms:
+		if term.due_date_based_on == 'Day(s) after invoice date':
+			due_date = max(due_date, add_days(due_date, term.credit_days))
+		elif term.due_date_based_on == 'Day(s) after the end of the invoice month':
+			due_date = max(due_date, add_days(get_last_day(due_date), term.credit_days))
 		else:
-			credit_days_based_on, credit_days, supplier_type = \
-				frappe.db.get_value(party_type, party, ["credit_days_based_on", "credit_days", "supplier_type"])
+			due_date = max(due_date, add_months(get_last_day(due_date), term.credit_months))
 
-	if not credit_days_based_on:
-		if party_type == "Customer" and customer_group:
-			credit_days_based_on, credit_days = \
-				frappe.db.get_value("Customer Group", customer_group, ["credit_days_based_on", "credit_days"])
-		elif party_type == "Supplier" and supplier_type:
-			credit_days_based_on, credit_days = \
-				frappe.db.get_value("Supplier Type", supplier_type, ["credit_days_based_on", "credit_days"])
+	return due_date
 
-	if not credit_days_based_on:
-		credit_days_based_on, credit_days = \
-			frappe.db.get_value("Company", company, ["credit_days_based_on", "credit_days"])
 
-	return credit_days_based_on, credit_days
-
-def validate_due_date(posting_date, due_date, party_type, party, company):
+def validate_due_date(posting_date, due_date, party_type, party):
 	if getdate(due_date) < getdate(posting_date):
 		frappe.throw(_("Due Date cannot be before Posting Date"))
 	else:
-		default_due_date = get_due_date(posting_date, party_type, party, company)
+		default_due_date = get_due_date(posting_date, party_type, party)
 		if not default_due_date:
 			return
 
@@ -316,7 +320,8 @@
 				msgprint(_("Note: Due / Reference Date exceeds allowed customer credit days by {0} day(s)")
 					.format(date_diff(due_date, default_due_date)))
 			else:
-				frappe.throw(_("Due / Reference Date cannot be after {0}").format(formatdate(default_due_date)))
+				frappe.throw(_("Due / Reference Date cannot be after {0}")
+					.format(formatdate(default_due_date)))
 
 @frappe.whitelist()
 def set_taxes(party, party_type, posting_date, company, customer_group=None, supplier_type=None,
@@ -353,6 +358,16 @@
 
 	return get_tax_template(posting_date, args)
 
+
+@frappe.whitelist()
+def get_pyt_term_template(party_name, party_type):
+	template = None
+	if party_type in ('Customer', 'Supplier'):
+		template = frappe.db.get_value(party_type, party_name, fieldname='payment_terms')
+
+	return template
+
+
 def validate_party_frozen_disabled(party_type, party_name):
 	if party_type and party_name:
 		if party_type in ("Customer", "Supplier"):
diff --git a/erpnext/accounts/report/accounts_receivable/accounts_receivable.html b/erpnext/accounts/report/accounts_receivable/accounts_receivable.html
index 8fafce6..9d872a4 100644
--- a/erpnext/accounts/report/accounts_receivable/accounts_receivable.html
+++ b/erpnext/accounts/report/accounts_receivable/accounts_receivable.html
@@ -36,8 +36,14 @@
 						<br>{%= data[i][__("Voucher No")] %}</td>
 					<td>
 						{% if(!(filters.customer || filters.supplier)) { %}
-							{%= data[i][__("Customer Name")] || data[i][__("Customer")] || data[i][__("Supplier Name")] || data[i][__("Supplier")] %}<br>{%= __("Remarks") %}: 
+							{%= data[i][__("Customer")] || data[i][__("Supplier")] %}
+							{% if(data[i][__("Customer Name")] && data[i][__("Customer Name")] != data[i][__("Customer")]) { %}
+								<br> {%= data[i][__("Customer Name")] %}
+							{% } else if(data[i][__("Supplier Name")] != data[i][__("Supplier")]) { %}
+								<br> {%= data[i][__("Supplier Name")] %}
+							{% } %}
 						{% } %}
+						<br>{%= __("Remarks") %}:
 						{%= data[i][__("Remarks")] %}
 					</td>
 					<td style="text-align: right">
@@ -66,8 +72,13 @@
 						<td>
 							{% if(!(filters.customer || filters.supplier)) { %}
 								{%= data[i][__("Customer")] || data[i][__("Supplier")] %}
-								<br>{%= __("Remarks") %}: 
+								{% if(data[i][__("Customer Name")] && data[i][__("Customer Name")] != data[i][__("Customer")]) { %}
+									<br> {%= data[i][__("Customer Name")] %}
+								{% } else if(data[i][__("Supplier Name")] != data[i][__("Supplier")]) { %}
+									<br> {%= data[i][__("Supplier Name")] %}
+								{% } %} 
 							{% } %}
+							<br>{%= __("Remarks") %}:
 							{%= data[i][__("Remarks")] %}
 						</td>
 					{% } else { %}
diff --git a/erpnext/accounts/report/accounts_receivable/accounts_receivable.py b/erpnext/accounts/report/accounts_receivable/accounts_receivable.py
index ba5b7f2..300e6a8 100644
--- a/erpnext/accounts/report/accounts_receivable/accounts_receivable.py
+++ b/erpnext/accounts/report/accounts_receivable/accounts_receivable.py
@@ -113,7 +113,7 @@
 						row += [self.get_party_name(gle.party_type, gle.party)]
 
 					# get due date
-					due_date = voucher_details.get(gle.voucher_no, {}).get("due_date", "")
+					due_date = gle.due_date or voucher_details.get(gle.voucher_no, {}).get("due_date", "")
 
 					row += [gle.voucher_type, gle.voucher_no, due_date]
 
@@ -162,8 +162,7 @@
 
 	def get_entries_till(self, report_date, party_type):
 		# returns a generator
-		return (e for e in self.get_gl_entries(party_type)
-			if getdate(e.posting_date) <= report_date)
+		return (e for e in self.get_gl_entries(party_type) if getdate(e.posting_date) <= report_date)
 
 	def is_receivable_or_payable(self, gle, dr_or_cr, future_vouchers):
 		return (
@@ -189,7 +188,8 @@
 		reverse_dr_or_cr = "credit" if dr_or_cr=="debit" else "debit"
 
 		for e in self.get_gl_entries_for(gle.party, gle.party_type, gle.voucher_type, gle.voucher_no):
-			if getdate(e.posting_date) <= report_date and e.name!=gle.name:
+			if getdate(e.posting_date) <= report_date and e.name!=gle.name \
+				and (not gle.due_date or getdate(e.due_date) == getdate(gle.due_date)):
 				amount = flt(e.get(reverse_dr_or_cr)) - flt(e.get(dr_or_cr))
 				if e.voucher_no not in return_entries:
 					payment_amount += amount
@@ -250,12 +250,12 @@
 			else:
 				select_fields = "sum(debit) as debit, sum(credit) as credit"
 
-			self.gl_entries = frappe.db.sql("""select name, posting_date, account, party_type, party,
-				voucher_type, voucher_no, against_voucher_type, against_voucher,
+			self.gl_entries = frappe.db.sql("""select name, posting_date, account, party_type, party, 
+				voucher_type, voucher_no, against_voucher_type, against_voucher, due_date,
 				account_currency, remarks, {0}
 				from `tabGL Entry`
 				where docstatus < 2 and party_type=%s and (party is not null and party != '') {1}
-				group by voucher_type, voucher_no, against_voucher_type, against_voucher, party
+				group by voucher_type, voucher_no, against_voucher_type, against_voucher, party, due_date
 				order by posting_date, party"""
 				.format(select_fields, conditions), values, as_dict=True)
 
diff --git a/erpnext/accounts/utils.py b/erpnext/accounts/utils.py
index d592816..ba5d8b3 100644
--- a/erpnext/accounts/utils.py
+++ b/erpnext/accounts/utils.py
@@ -571,11 +571,12 @@
 	# Amount should be credited
 	return flt(stock_rbnb) + flt(sys_bal)
 
+
 def get_outstanding_invoices(party_type, party, account, condition=None):
 	outstanding_invoices = []
 	precision = frappe.get_precision("Sales Invoice", "outstanding_amount")
 
-	if party_type=="Customer":
+	if party_type == "Customer":
 		dr_or_cr = "debit_in_account_currency - credit_in_account_currency"
 		payment_dr_or_cr = "payment_gl_entry.credit_in_account_currency - payment_gl_entry.debit_in_account_currency"
 	else:
@@ -585,12 +586,7 @@
 	invoice = 'Sales Invoice' if party_type == 'Customer' else 'Purchase Invoice'
 	invoice_list = frappe.db.sql("""
 		select
-			voucher_no,	voucher_type, posting_date, ifnull(sum({dr_or_cr}), 0) as invoice_amount,
-			(
-				case when (voucher_type = 'Sales Invoice' or voucher_type = 'Purchase Invoice')
-					then (select due_date from `tab{invoice}` where name = voucher_no)
-				else posting_date end
-			) as due_date,
+			voucher_no,	voucher_type, posting_date, ifnull(sum({dr_or_cr}), 0) as invoice_amount, due_date,
 			(
 				select ifnull(sum({payment_dr_or_cr}), 0)
 				from `tabGL Entry` payment_gl_entry
@@ -601,6 +597,7 @@
 					and payment_gl_entry.party_type = invoice_gl_entry.party_type
 					and payment_gl_entry.party = invoice_gl_entry.party
 					and payment_gl_entry.account = invoice_gl_entry.account
+					and payment_gl_entry.due_date = invoice_gl_entry.due_date
 					and {payment_dr_or_cr} > 0
 			) as payment_amount
 		from
@@ -612,13 +609,13 @@
 			and ((voucher_type = 'Journal Entry'
 					and (against_voucher = '' or against_voucher is null))
 				or (voucher_type not in ('Journal Entry', 'Payment Entry')))
-		group by voucher_type, voucher_no
+		group by voucher_type, voucher_no, due_date
 		having (invoice_amount - payment_amount) > 0.005
-		order by posting_date, name""".format(
-			dr_or_cr = dr_or_cr,
-			invoice = invoice,
-			payment_dr_or_cr = payment_dr_or_cr,
-			condition = condition or ""
+		order by posting_date, name, due_date""".format(
+			dr_or_cr=dr_or_cr,
+			invoice=invoice,
+			payment_dr_or_cr=payment_dr_or_cr,
+			condition=condition or ""
 		), {
 			"party_type": party_type,
 			"party": party,
@@ -626,17 +623,24 @@
 		}, as_dict=True)
 
 	for d in invoice_list:
-		outstanding_invoices.append(frappe._dict({
-			'voucher_no': d.voucher_no,
-			'voucher_type': d.voucher_type,
-			'due_date': d.due_date,
-			'posting_date': d.posting_date,
-			'invoice_amount': flt(d.invoice_amount),
-			'payment_amount': flt(d.payment_amount),
-			'outstanding_amount': flt(d.invoice_amount - d.payment_amount, precision),
-			'due_date': frappe.db.get_value(d.voucher_type, d.voucher_no,
-				"posting_date" if party_type=="Employee" else "due_date"),
-		}))
+		due_date = d.due_date or (
+			frappe.db.get_value(
+				d.voucher_type, d.voucher_no,
+				"posting_date" if party_type == "Employee" else "due_date"
+			)
+		)
+
+		outstanding_invoices.append(
+			frappe._dict({
+				'voucher_no': d.voucher_no,
+				'voucher_type': d.voucher_type,
+				'posting_date': d.posting_date,
+				'invoice_amount': flt(d.invoice_amount),
+				'payment_amount': flt(d.payment_amount),
+				'outstanding_amount': flt(d.invoice_amount - d.payment_amount, precision),
+				'due_date': due_date
+			})
+		)
 
 	outstanding_invoices = sorted(outstanding_invoices, key=lambda k: k['due_date'] or getdate(nowdate()))
 
diff --git a/erpnext/accounts/doctype/asset_category_account/__init__.py b/erpnext/assets/doctype/asset_category_account/__init__.py
similarity index 100%
rename from erpnext/accounts/doctype/asset_category_account/__init__.py
rename to erpnext/assets/doctype/asset_category_account/__init__.py
diff --git a/erpnext/accounts/doctype/asset_category_account/asset_category_account.json b/erpnext/assets/doctype/asset_category_account/asset_category_account.json
similarity index 85%
rename from erpnext/accounts/doctype/asset_category_account/asset_category_account.json
rename to erpnext/assets/doctype/asset_category_account/asset_category_account.json
index 2393327..679cc52 100644
--- a/erpnext/accounts/doctype/asset_category_account/asset_category_account.json
+++ b/erpnext/assets/doctype/asset_category_account/asset_category_account.json
@@ -1,5 +1,6 @@
 {
  "allow_copy": 0, 
+ "allow_guest_to_view": 0, 
  "allow_import": 0, 
  "allow_rename": 0, 
  "beta": 0, 
@@ -9,8 +10,10 @@
  "doctype": "DocType", 
  "document_type": "", 
  "editable_grid": 1, 
+ "engine": "InnoDB", 
  "fields": [
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -21,7 +24,9 @@
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
    "in_filter": 0, 
+   "in_global_search": 0, 
    "in_list_view": 1, 
+   "in_standard_filter": 0, 
    "label": "Company", 
    "length": 0, 
    "no_copy": 0, 
@@ -39,6 +44,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -49,7 +55,9 @@
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
    "in_filter": 0, 
+   "in_global_search": 0, 
    "in_list_view": 1, 
+   "in_standard_filter": 0, 
    "label": "Fixed Asset Account", 
    "length": 0, 
    "no_copy": 0, 
@@ -67,6 +75,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -77,7 +86,9 @@
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
    "in_filter": 0, 
+   "in_global_search": 0, 
    "in_list_view": 1, 
+   "in_standard_filter": 0, 
    "label": "Accumulated Depreciation Account", 
    "length": 0, 
    "no_copy": 0, 
@@ -95,6 +106,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -105,7 +117,9 @@
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
    "in_filter": 0, 
+   "in_global_search": 0, 
    "in_list_view": 1, 
+   "in_standard_filter": 0, 
    "label": "Depreciation Expense Account", 
    "length": 0, 
    "no_copy": 0, 
@@ -123,19 +137,19 @@
    "unique": 0
   }
  ], 
+ "has_web_view": 0, 
  "hide_heading": 0, 
  "hide_toolbar": 0, 
  "idx": 0, 
  "image_view": 0, 
  "in_create": 0, 
- "in_dialog": 0, 
  "is_submittable": 0, 
  "issingle": 0, 
  "istable": 1, 
  "max_attachments": 0, 
- "modified": "2016-11-03 15:12:55.775239", 
+ "modified": "2017-11-28 16:54:12.252271", 
  "modified_by": "Administrator", 
- "module": "Accounts", 
+ "module": "Assets", 
  "name": "Asset Category Account", 
  "name_case": "", 
  "owner": "Administrator", 
@@ -143,7 +157,9 @@
  "quick_entry": 0, 
  "read_only": 0, 
  "read_only_onload": 0, 
+ "show_name_in_global_search": 0, 
  "sort_field": "modified", 
  "sort_order": "DESC", 
+ "track_changes": 1, 
  "track_seen": 0
 }
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/asset_category_account/asset_category_account.py b/erpnext/assets/doctype/asset_category_account/asset_category_account.py
similarity index 100%
rename from erpnext/accounts/doctype/asset_category_account/asset_category_account.py
rename to erpnext/assets/doctype/asset_category_account/asset_category_account.py
diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.json b/erpnext/buying/doctype/purchase_order/purchase_order.json
index 0b62b71..ecd6e66 100644
--- a/erpnext/buying/doctype/purchase_order/purchase_order.json
+++ b/erpnext/buying/doctype/purchase_order/purchase_order.json
@@ -2441,6 +2441,98 @@
    "unique": 0
   },
   {
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "fieldname": "payment_schedule_section", 
+   "fieldtype": "Section Break", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "ignore_xss_filter": 0, 
+   "in_filter": 0, 
+   "in_global_search": 0, 
+   "in_list_view": 0, 
+   "in_standard_filter": 0, 
+   "label": "Payment Terms", 
+   "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_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "fieldname": "payment_terms_template", 
+   "fieldtype": "Link", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "ignore_xss_filter": 0, 
+   "in_filter": 0, 
+   "in_global_search": 0, 
+   "in_list_view": 0, 
+   "in_standard_filter": 0, 
+   "label": "Payment Terms Template", 
+   "length": 0, 
+   "no_copy": 0, 
+   "options": "Payment Terms Template", 
+   "permlevel": 0, 
+   "precision": "", 
+   "print_hide": 1, 
+   "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_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "fieldname": "payment_schedule", 
+   "fieldtype": "Table", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "ignore_xss_filter": 0, 
+   "in_filter": 0, 
+   "in_global_search": 0, 
+   "in_list_view": 0, 
+   "in_standard_filter": 0, 
+   "label": "Payment Schedule", 
+   "length": 0, 
+   "no_copy": 1, 
+   "options": "Payment Schedule", 
+   "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_bulk_edit": 0,
    "allow_on_submit": 0,
    "bold": 0,
@@ -3172,7 +3264,7 @@
  "issingle": 0,
  "istable": 0,
  "max_attachments": 0,
- "modified": "2017-11-15 01:03:44.591992",
+ "modified": "2017-11-23 01:03:44.591992",
  "modified_by": "Administrator",
  "module": "Buying",
  "name": "Purchase Order",
diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.py b/erpnext/buying/doctype/purchase_order/purchase_order.py
index bbaa043..fac70aa 100644
--- a/erpnext/buying/doctype/purchase_order/purchase_order.py
+++ b/erpnext/buying/doctype/purchase_order/purchase_order.py
@@ -29,7 +29,7 @@
 			'target_field': 'ordered_qty',
 			'target_parent_dt': 'Material Request',
 			'target_parent_field': 'per_ordered',
-			'target_ref_field': 'qty',
+			'target_ref_field': 'stock_qty',
 			'source_field': 'stock_qty',
 			'percent_join_field': 'material_request',
 			'overflow_type': 'order'
@@ -51,6 +51,7 @@
 		self.validate_with_previous_doc()
 		self.validate_for_subcontracting()
 		self.validate_minimum_order_qty()
+		self.validate_bom_for_subcontracting_items()
 		self.create_raw_materials_supplied("supplied_items")
 		self.set_received_qty_for_drop_ship_items()
 
@@ -95,6 +96,13 @@
 				frappe.throw(_("Item {0}: Ordered qty {1} cannot be less than minimum order qty {2} (defined in Item).").format(item_code,
 					qty, itemwise_min_order_qty.get(item_code)))
 
+	def validate_bom_for_subcontracting_items(self):
+		if self.is_subcontracted == "Yes":
+			for item in self.items:
+				if not item.bom:
+					frappe.throw(_("BOM is not specified for subcontracting item {0} at row {1}"\
+						.format(item.item_code, item.idx)))
+
 	def get_schedule_dates(self):
 		for d in self.get('items'):
 			if d.material_request_item and not d.schedule_date:
diff --git a/erpnext/buying/doctype/purchase_order/test_purchase_order.py b/erpnext/buying/doctype/purchase_order/test_purchase_order.py
index 2af5582..d31b230 100644
--- a/erpnext/buying/doctype/purchase_order/test_purchase_order.py
+++ b/erpnext/buying/doctype/purchase_order/test_purchase_order.py
@@ -8,6 +8,7 @@
 from frappe.utils import flt, add_days, nowdate
 from erpnext.buying.doctype.purchase_order.purchase_order import make_purchase_receipt, make_purchase_invoice
 
+
 class TestPurchaseOrder(unittest.TestCase):
 	def test_make_purchase_receipt(self):
 		po = create_purchase_order(do_not_submit=True)
@@ -83,6 +84,33 @@
 		self.assertEquals(pi.doctype, "Purchase Invoice")
 		self.assertEquals(len(pi.get("items", [])), 1)
 
+	def test_make_purchase_invoice_with_terms(self):
+		po = create_purchase_order(do_not_save=True)
+
+		self.assertRaises(frappe.ValidationError, make_purchase_invoice, po.name)
+
+		po.update(
+			{"payment_terms_template": "_Test Payment Term Template"}
+		)
+
+		po.save()
+		po.submit()
+
+		self.assertEqual(po.payment_schedule[0].payment_amount, 2500.0)
+		self.assertEqual(po.payment_schedule[0].due_date, po.transaction_date)
+		self.assertEqual(po.payment_schedule[1].payment_amount, 2500.0)
+		self.assertEqual(po.payment_schedule[1].due_date, add_days(po.transaction_date, 30))
+		pi = make_purchase_invoice(po.name)
+		pi.save()
+
+		self.assertEquals(pi.doctype, "Purchase Invoice")
+		self.assertEquals(len(pi.get("items", [])), 1)
+
+		self.assertEqual(pi.payment_schedule[0].payment_amount, 2500.0)
+		self.assertEqual(pi.payment_schedule[0].due_date, po.transaction_date)
+		self.assertEqual(pi.payment_schedule[1].payment_amount, 2500.0)
+		self.assertEqual(pi.payment_schedule[1].due_date, add_days(po.transaction_date, 30))
+
 	def test_subcontracting(self):
 		po = create_purchase_order(item_code="_Test FG Item", is_subcontracted="Yes")
 		self.assertEquals(len(po.get("supplied_items")), 2)
@@ -125,6 +153,35 @@
 			"group_same_items": 1
 			}).insert(ignore_permissions=True)
 
+	def test_make_po_without_terms(self):
+		po = create_purchase_order(do_not_save=1)
+
+		self.assertFalse(po.get('payment_schedule'))
+
+		po.insert()
+
+		self.assertTrue(po.get('payment_schedule'))
+
+	def test_terms_does_not_copy(self):
+		po = create_purchase_order()
+
+		self.assertTrue(po.get('payment_schedule'))
+
+		pi = make_purchase_invoice(po.name)
+
+		self.assertFalse(pi.get('payment_schedule'))
+
+	def test_terms_copied(self):
+		po = create_purchase_order(do_not_save=1)
+		po.payment_terms_template = '_Test Payment Term Template'
+		po.insert()
+		po.submit()
+		self.assertTrue(po.get('payment_schedule'))
+
+		pi = make_purchase_invoice(po.name)
+		pi.insert()
+		self.assertTrue(pi.get('payment_schedule'))
+
 		
 def get_same_items():
 	return [
diff --git a/erpnext/buying/doctype/supplier/supplier.json b/erpnext/buying/doctype/supplier/supplier.json
index 711e05d..e6cea53 100644
--- a/erpnext/buying/doctype/supplier/supplier.json
+++ b/erpnext/buying/doctype/supplier/supplier.json
@@ -597,8 +597,9 @@
    "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
-   "fieldname": "credit_days_based_on", 
-   "fieldtype": "Select", 
+   "depends_on": "", 
+   "fieldname": "payment_terms", 
+   "fieldtype": "Link", 
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
@@ -606,10 +607,10 @@
    "in_global_search": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
-   "label": "Credit Days Based On", 
+   "label": "Default Payment Terms Template", 
    "length": 0, 
    "no_copy": 0, 
-   "options": "\nFixed Days\nLast Day of the Next Month", 
+   "options": "Payment Terms Template", 
    "permlevel": 0, 
    "precision": "", 
    "print_hide": 0, 
@@ -628,36 +629,6 @@
    "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
-   "depends_on": "eval:doc.credit_days_based_on == 'Fixed Days'", 
-   "fieldname": "credit_days", 
-   "fieldtype": "Int", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 0, 
-   "in_standard_filter": 0, 
-   "label": "Credit Days", 
-   "length": 0, 
-   "no_copy": 0, 
-   "permlevel": 0, 
-   "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_bulk_edit": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
    "depends_on": "eval:!doc.__islocal", 
    "fieldname": "address_contacts", 
    "fieldtype": "Section Break", 
@@ -970,8 +941,8 @@
  "issingle": 0, 
  "istable": 0, 
  "max_attachments": 0, 
- "modified": "2017-07-06 16:40:46.935608", 
- "modified_by": "Administrator", 
+ "modified": "2017-08-31 16:10:44.049915", 
+ "modified_by": "tundebabzy@gmail.com", 
  "module": "Buying", 
  "name": "Supplier", 
  "name_case": "Title Case", 
diff --git a/erpnext/buying/doctype/supplier/test_records.json b/erpnext/buying/doctype/supplier/test_records.json
index cae4aac..7479f55 100644
--- a/erpnext/buying/doctype/supplier/test_records.json
+++ b/erpnext/buying/doctype/supplier/test_records.json
@@ -1,6 +1,18 @@
 [
  {
   "doctype": "Supplier",
+  "supplier_name": "_Test Supplier With Template 1",
+  "supplier_type": "_Test Supplier Type",
+  "payment_terms": "_Test Payment Term Template 3"
+ },
+ {
+  "doctype": "Supplier",
+  "supplier_name": "_Test Supplier P",
+  "supplier_type": "_Test Supplier Type",
+  "credit_days_based_on": "Fixed Days"
+ },
+ {
+  "doctype": "Supplier",
   "supplier_name": "_Test Supplier with Country",
   "supplier_type": "_Test Supplier Type",
   "country": "Greece"
diff --git a/erpnext/buying/doctype/supplier/test_supplier.py b/erpnext/buying/doctype/supplier/test_supplier.py
index 1d089e7..16dda5c 100644
--- a/erpnext/buying/doctype/supplier/test_supplier.py
+++ b/erpnext/buying/doctype/supplier/test_supplier.py
@@ -5,56 +5,62 @@
 
 import frappe, unittest
 from erpnext.accounts.party import get_due_date
-from erpnext.exceptions import PartyFrozen, PartyDisabled
+from erpnext.exceptions import PartyDisabled
 from frappe.test_runner import make_test_records
 
+test_dependencies = ['Payment Term', 'Payment Terms Template']
 test_records = frappe.get_test_records('Supplier')
 
+
 class TestSupplier(unittest.TestCase):
-    def test_supplier_due_date_against_supplier_credit_limit(self):
-        # Set Credit Limit based on Fixed days
-        frappe.db.set_value("Supplier", "_Test Supplier", "credit_days_based_on", "Fixed Days")
-        frappe.db.set_value("Supplier", "_Test Supplier", "credit_days", 10)
+    def test_supplier_default_payment_terms(self):
+        # Payment Term based on Days after invoice date
+        frappe.db.set_value(
+            "Supplier", "_Test Supplier With Template 1", "payment_terms", "_Test Payment Term Template 3")
 
-        due_date = get_due_date("2016-01-22", "Supplier", "_Test Supplier", "_Test Company")
-        self.assertEqual(due_date, "2016-02-01")
+        due_date = get_due_date("2016-01-22", "Supplier", "_Test Supplier With Template 1")
+        self.assertEqual(due_date, "2016-02-21")
 
-        # Set Credit Limit based on Last day next month
-        frappe.db.set_value("Supplier", "_Test Supplier", "credit_days", 0)
-        frappe.db.set_value("Supplier", "_Test Supplier", "credit_days_based_on",
-                            "Last Day of the Next Month")
+        due_date = get_due_date("2017-01-22", "Supplier", "_Test Supplier With Template 1")
+        self.assertEqual(due_date, "2017-02-21")
 
-        # Leap year
-        due_date = get_due_date("2016-01-22", "Supplier", "_Test Supplier", "_Test Company")
+        # Payment Term based on last day of month
+        frappe.db.set_value(
+            "Supplier", "_Test Supplier With Template 1", "payment_terms", "_Test Payment Term Template 1")
+
+        due_date = get_due_date("2016-01-22", "Supplier", "_Test Supplier With Template 1")
         self.assertEqual(due_date, "2016-02-29")
-        # Non Leap year
-        due_date = get_due_date("2017-01-22", "Supplier", "_Test Supplier", "_Test Company")
+
+        due_date = get_due_date("2017-01-22", "Supplier", "_Test Supplier With Template 1")
         self.assertEqual(due_date, "2017-02-28")
 
-        frappe.db.set_value("Supplier", "_Test Supplier", "credit_days_based_on", "")
+        frappe.db.set_value("Supplier", "_Test Supplier With Template 1", "payment_terms", "")
 
         # Set credit limit for the supplier type instead of supplier and evaluate the due date
-        # based on Fixed days
-        frappe.db.set_value("Supplier Type", "_Test Supplier Type", "credit_days_based_on",
-                            "Fixed Days")
-        frappe.db.set_value("Supplier Type", "_Test Supplier Type", "credit_days", 10)
+        frappe.db.set_value("Supplier Type", "_Test Supplier Type", "payment_terms", "_Test Payment Term Template 3")
 
-        due_date = get_due_date("2016-01-22", "Supplier", "_Test Supplier", "_Test Company")
-        self.assertEqual(due_date, "2016-02-01")
+        due_date = get_due_date("2016-01-22", "Supplier", "_Test Supplier With Template 1")
+        self.assertEqual(due_date, "2016-02-21")
 
-        # Set credit limit for the supplier type instead of supplier and evaluate the due date
-        # based on Last day of next month
-        frappe.db.set_value("Supplier", "_Test Supplier Type", "credit_days", 0)
-        frappe.db.set_value("Supplier Type", "_Test Supplier Type", "credit_days_based_on",
-                            "Last Day of the Next Month")
+        # Payment terms for Supplier Type instead of supplier and evaluate the due date
+        frappe.db.set_value("Supplier Type", "_Test Supplier Type", "payment_terms", "_Test Payment Term Template 1")
 
         # Leap year
-        due_date = get_due_date("2016-01-22", "Supplier", "_Test Supplier", "_Test Company")
+        due_date = get_due_date("2016-01-22", "Supplier", "_Test Supplier With Template 1")
         self.assertEqual(due_date, "2016-02-29")
-        # Non Leap year
-        due_date = get_due_date("2017-01-22", "Supplier", "_Test Supplier", "_Test Company")
+        # # Non Leap year
+        due_date = get_due_date("2017-01-22", "Supplier", "_Test Supplier With Template 1")
         self.assertEqual(due_date, "2017-02-28")
 
+        # Supplier with no default Payment Terms Template
+        frappe.db.set_value("Supplier Type", "_Test Supplier Type", "payment_terms", "")
+        frappe.db.set_value("Supplier", "_Test Supplier", "payment_terms", "")
+
+        due_date = get_due_date("2016-01-22", "Supplier", "_Test Supplier")
+        self.assertEqual(due_date, "2016-01-22")
+        # # Non Leap year
+        due_date = get_due_date("2017-01-22", "Supplier", "_Test Supplier")
+        self.assertEqual(due_date, "2017-01-22")
 
     def test_supplier_disabled(self):
         make_test_records("Item")
@@ -71,7 +77,6 @@
 
         po.save()
 
-
     def test_supplier_country(self):
         # Test that country field exists in Supplier DocType
         supplier = frappe.get_doc('Supplier', '_Test Supplier with Country')
diff --git a/erpnext/config/desktop.py b/erpnext/config/desktop.py
index d204ed8..fde19b4 100644
--- a/erpnext/config/desktop.py
+++ b/erpnext/config/desktop.py
@@ -194,12 +194,12 @@
 			"type": "list"
 		},
 		{
-			"module_name": "Student Attendance",
-			"color": "#3aacba",
+			"module_name": "Student Attendance Tool",
+			"color": "#C0392B",
 			"icon": "octicon octicon-checklist",
-			"label": _("Student Attendance"),
-			"link": "List/Student Attendance",
-			"_doctype": "Student Attendance",
+			"label": _("Student Attendance Tool"),
+			"link": "List/Student Attendance Tool",
+			"_doctype": "Student Attendance Tool",
 			"type": "list"
 		},
 		{
@@ -257,11 +257,11 @@
 			"type": "list"
 		},
 		{
-			"module_name": "Schools",
-			"color": "#DE2B37",
+			"module_name": "Education",
+			"color": "#428B46",
 			"icon": "octicon octicon-mortar-board",
 			"type": "module",
-			"label": _("Schools")
+			"label": _("Education")
 		},
 		{
 			"module_name": "Healthcare",
diff --git a/erpnext/config/schools.py b/erpnext/config/education.py
similarity index 98%
rename from erpnext/config/schools.py
rename to erpnext/config/education.py
index 1e7d1b0..08846a2 100644
--- a/erpnext/config/schools.py
+++ b/erpnext/config/education.py
@@ -217,7 +217,7 @@
 				},
 				{
 					"type": "doctype",
-					"name": "School Settings"
+					"name": "Education Settings"
 				}
 			]
 		},
diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py
index 3cefaff..fb97c91 100644
--- a/erpnext/controllers/accounts_controller.py
+++ b/erpnext/controllers/accounts_controller.py
@@ -4,7 +4,7 @@
 from __future__ import unicode_literals
 import frappe, erpnext
 from frappe import _, throw
-from frappe.utils import today, flt, cint, fmt_money, formatdate, getdate
+from frappe.utils import today, flt, cint, fmt_money, formatdate, getdate, add_days, add_months, get_last_day
 from erpnext.setup.utils import get_exchange_rate
 from erpnext.accounts.utils import get_fiscal_years, validate_fiscal_year, get_account_currency
 from erpnext.utilities.transaction_base import TransactionBase
@@ -26,11 +26,19 @@
 		return self.__company_currency
 
 	def onload(self):
-		self.get("__onload").make_payment_via_journal_entry = frappe.db.get_single_value('Accounts Settings', 'make_payment_via_journal_entry')
+		self.get("__onload").make_payment_via_journal_entry \
+			= frappe.db.get_single_value('Accounts Settings', 'make_payment_via_journal_entry')
+
+		if self.is_new():
+			relevant_docs = ("Quotation", "Purchase Order", "Sales Order",
+				"Purchase Invoice", "Sales Invoice")
+			if self.doctype in relevant_docs:
+				self.set_payment_schedule()
 
 	def validate(self):
 		if self.get("_action") and self._action != "update_after_submit":
 			self.set_missing_values(for_validate=True)
+
 		self.validate_date_with_fiscal_year()
 
 		if self.meta.get_field("currency"):
@@ -42,9 +50,7 @@
 			validate_return(self)
 			self.set_total_in_words()
 
-		if self.doctype in ("Sales Invoice", "Purchase Invoice") and not self.is_return:
-			self.validate_due_date()
-			self.validate_advance_entries()
+		self.validate_all_documents_schedule()
 
 		if self.meta.get_field("taxes_and_charges"):
 			self.validate_enabled_taxes_and_charges()
@@ -55,6 +61,26 @@
 		if self.doctype == 'Purchase Invoice':
 			self.validate_paid_amount()
 
+	def validate_invoice_documents_schedule(self):
+		self.validate_payment_schedule_dates()
+		self.set_due_date()
+		self.validate_invoice_portion()
+		self.set_payment_schedule()
+		self.validate_payment_schedule_amount()
+		self.validate_due_date()
+		self.validate_advance_entries()
+
+	def validate_non_invoice_documents_schedule(self):
+		self.validate_invoice_portion()
+		self.set_payment_schedule()
+		self.validate_payment_schedule_amount()
+
+	def validate_all_documents_schedule(self):
+		if self.doctype in ("Sales Invoice", "Purchase Invoice") and not self.is_return:
+			self.validate_invoice_documents_schedule()
+		elif self.doctype in ("Quotation", "Purchase Order", "Sales Order"):
+			self.validate_non_invoice_documents_schedule()
+
 	def before_print(self):
 		if self.doctype in ['Purchase Order', 'Sales Order']:
 			if self.get("group_same_items"):
@@ -74,11 +100,11 @@
 						self.paid_amount = 0
 						frappe.throw(_("Note: Payment Entry will not be created since 'Cash or Bank Account' was not specified"))
 			else:
-				frappe.db.set(self,'paid_amount',0)
+				frappe.db.set(self, 'paid_amount', 0)
 
 	def set_missing_values(self, for_validate=False):
 		if frappe.flags.in_test:
-			for fieldname in ["posting_date","transaction_date"]:
+			for fieldname in ["posting_date", "transaction_date"]:
 				if self.meta.get_field(fieldname) and not self.get(fieldname):
 					self.set(fieldname, today())
 					break
@@ -109,9 +135,9 @@
 			if not self.due_date:
 				frappe.throw(_("Due Date is mandatory"))
 
-			validate_due_date(self.posting_date, self.due_date, "Customer", self.customer, self.company)
+			validate_due_date(self.posting_date, self.due_date, "Customer", self.customer)
 		elif self.doctype == "Purchase Invoice":
-			validate_due_date(self.posting_date, self.due_date, "Supplier", self.supplier, self.company)
+			validate_due_date(self.posting_date, self.due_date, "Supplier", self.supplier)
 
 	def set_price_list_currency(self, buying_or_selling):
 		if self.meta.get_field("posting_date"):
@@ -619,6 +645,67 @@
 		for item in duplicate_list:
 			self.remove(item)
 
+	def set_payment_schedule(self):
+		posting_date = self.get("posting_date") or self.get("transaction_date")
+		date = self.get("due_date")
+		due_date = date or posting_date
+		grand_total = self.get("rounded_total") or self.grand_total
+
+		if not self.get("payment_schedule"):
+			if self.get("payment_terms_template"):
+				data = get_payment_terms(self.payment_terms_template, posting_date, grand_total)
+				for item in data:
+					self.append("payment_schedule", item)
+			else:
+				data = dict(due_date=due_date, invoice_portion=100, payment_amount=grand_total)
+				self.append("payment_schedule", data)
+		else:
+			for d in self.get("payment_schedule"):
+				d.payment_amount = grand_total * flt(d.invoice_portion) / 100
+
+	def set_due_date(self):
+		due_dates = [d.due_date for d in self.get("payment_schedule") if d.due_date]
+		if due_dates:
+			self.due_date = max(due_dates)
+
+	def validate_payment_schedule_dates(self):
+		dates = []
+		li = []
+		if self.due_date and getdate(self.due_date) < getdate(self.posting_date):
+			frappe.throw(_("Due Date cannot be before posting date"))
+
+		for d in self.get("payment_schedule"):
+			if getdate(d.due_date) < getdate(self.posting_date):
+				frappe.throw(_("Row {0}: Due Date cannot be before posting date").format(d.idx))
+			elif d.due_date in dates:
+				li.append('{0} in row {1}'.format(d.due_date, d.idx))
+				# frappe.throw(_("Row {0}: Duplicate due date found").format(d.idx))
+			dates.append(d.due_date)
+
+		if li:
+			duplicates = '<br>' + '<br>'.join(li)
+			frappe.throw(_("Rows with duplicate due dates in other rows were found: {list}")
+				.format(list=duplicates))
+
+	def validate_payment_schedule_amount(self):
+		if self.get("payment_schedule"):
+			total = 0
+			for d in self.get("payment_schedule"):
+				total += flt(d.payment_amount)
+
+			grand_total = self.get("rounded_total") or self.grand_total
+			if total != grand_total:
+				frappe.throw(_("Total Payment Amount in Payment Schedule must be equal to Grand / Rounded Total"))
+
+	def validate_invoice_portion(self):
+		if self.get("payment_schedule"):
+			total_portion = 0
+			for term in self.payment_schedule:
+				total_portion += flt(term.get('invoice_portion', 0))
+
+			if flt(total_portion, 2) != 100.00:
+				frappe.throw(_('Combined invoice portion must equal 100%'), indicator='red')
+
 	def is_rounded_total_disabled(self):
 		if self.meta.get_field("disable_rounded_total"):
 			return self.disable_rounded_total
@@ -796,4 +883,43 @@
 		where due_date < CURDATE() and docstatus = 1 and outstanding_amount > 0""")
 
 	frappe.db.sql(""" update `tabPurchase Invoice` set status = 'Overdue'
-		where due_date < CURDATE() and docstatus = 1 and outstanding_amount > 0""")
\ No newline at end of file
+		where due_date < CURDATE() and docstatus = 1 and outstanding_amount > 0""")
+
+@frappe.whitelist()
+def get_payment_terms(terms_template, posting_date=None, grand_total=None):
+	if not terms_template:
+		return
+
+	terms_doc = frappe.get_doc("Payment Terms Template", terms_template)
+
+	schedule = []
+	for d in terms_doc.get("terms"):
+		term_details = get_payment_term_details(d, posting_date, grand_total)
+		schedule.append(term_details)
+
+	return schedule
+
+@frappe.whitelist()
+def get_payment_term_details(term, posting_date=None, grand_total=None):
+	term_details = frappe._dict()
+	if isinstance(term, unicode):
+		term = frappe.get_doc("Payment Term", term)
+	else:
+		term_details.payment_term = term.payment_term
+	term_details.description = term.description
+	term_details.invoice_portion = term.invoice_portion
+	term_details.payment_amount = flt(term.invoice_portion) * flt(grand_total) / 100
+	if posting_date:
+		term_details.due_date = get_due_date(posting_date, term)
+	return term_details
+
+def get_due_date(posting_date, term):
+	due_date = None
+	if term.due_date_based_on == "Day(s) after invoice date":
+		due_date = add_days(posting_date, term.credit_days)
+	elif term.due_date_based_on == "Day(s) after the end of the invoice month":
+		due_date = add_days(get_last_day(posting_date), term.credit_days)
+	elif term.due_date_based_on == "Month(s) after the end of the invoice month":
+		due_date = add_months(get_last_day(posting_date), term.credit_months)
+
+	return due_date
diff --git a/erpnext/controllers/buying_controller.py b/erpnext/controllers/buying_controller.py
index a31db64..9aff118 100644
--- a/erpnext/controllers/buying_controller.py
+++ b/erpnext/controllers/buying_controller.py
@@ -171,7 +171,7 @@
 			for item in self.get("items"):
 				if self.doctype in ["Purchase Receipt", "Purchase Invoice"]:
 					item.rm_supp_cost = 0.0
-				if item.item_code in self.sub_contracted_items:
+				if item.bom and item.item_code in self.sub_contracted_items:
 					self.update_raw_materials_supplied(item, raw_material_table)
 
 					if [item.item_code, item.name] not in parent_items:
diff --git a/erpnext/controllers/sales_and_purchase_return.py b/erpnext/controllers/sales_and_purchase_return.py
index 0074560..d609b9e 100644
--- a/erpnext/controllers/sales_and_purchase_return.py
+++ b/erpnext/controllers/sales_and_purchase_return.py
@@ -256,6 +256,9 @@
 			target_doc.dn_detail = source_doc.dn_detail
 			target_doc.expense_account = source_doc.expense_account
 
+	def update_terms(source_doc, target_doc, source_parent):
+		target_doc.payment_amount = -source_doc.payment_amount
+
 	doclist = get_mapped_doc(doctype, source_name,	{
 		doctype: {
 			"doctype": doctype,
@@ -272,6 +275,10 @@
 			},
 			"postprocess": update_item
 		},
+		"Payment Schedule": {
+			"doctype": "Payment Schedule",
+			"postprocess": update_terms
+		}
 	}, target_doc, set_missing_values)
 
 	return doclist
diff --git a/erpnext/controllers/taxes_and_totals.py b/erpnext/controllers/taxes_and_totals.py
index 874ea50..8232020 100644
--- a/erpnext/controllers/taxes_and_totals.py
+++ b/erpnext/controllers/taxes_and_totals.py
@@ -341,15 +341,7 @@
 			self.doc.rounding_adjustment += flt(self.doc.rounded_total - self.doc.grand_total,
 				self.doc.precision("rounding_adjustment"))
 
-		if self.doc.meta.get_field("base_rounded_total"):
-			company_currency = erpnext.get_company_currency(self.doc.company)
-
-			self.doc.base_rounded_total = \
-				round_based_on_smallest_currency_fraction(self.doc.base_grand_total,
-					company_currency, self.doc.precision("base_rounded_total"))
-
-			self.doc.base_rounding_adjustment += flt(self.doc.base_rounded_total - self.doc.base_grand_total,
-				self.doc.precision("base_rounding_adjustment"))
+			self._set_in_company_currency(self.doc, ["rounding_adjustment", "rounded_total"])
 
 	def _cleanup(self):
 		for tax in self.doc.get("taxes"):
diff --git a/erpnext/crm/doctype/lead/lead.js b/erpnext/crm/doctype/lead/lead.js
index f2f3937..2b3b5a9 100644
--- a/erpnext/crm/doctype/lead/lead.js
+++ b/erpnext/crm/doctype/lead/lead.js
@@ -11,6 +11,7 @@
 	},
 
 	onload: function() {
+
 		if(cur_frm.fields_dict.lead_owner.df.options.match(/^User/)) {
 			cur_frm.fields_dict.lead_owner.get_query = function(doc, cdt, cdn) {
 				return { query: "frappe.core.doctype.user.user.user_query" }
@@ -61,10 +62,21 @@
 			method: "erpnext.crm.doctype.lead.lead.make_quotation",
 			frm: cur_frm
 		})
+	},
+
+	organization_lead: function() {
+		if (this.frm.doc.organization_lead == 1) {
+			this.frm.set_df_property('company_name', 'reqd', 1);
+		} else {
+			this.frm.set_df_property('company_name', 'reqd', 0);
+		}
+	},
+
+	company_name: function() {
+		if (this.frm.doc.organization_lead == 1) {
+			this.frm.set_value("lead_name", this.frm.doc.company_name);
+		}
 	}
 });
 
 $.extend(cur_frm.cscript, new erpnext.LeadController({frm: cur_frm}));
-
-
-
diff --git a/erpnext/crm/doctype/lead/lead.json b/erpnext/crm/doctype/lead/lead.json
index c9d04ac..ad61abd 100644
--- a/erpnext/crm/doctype/lead/lead.json
+++ b/erpnext/crm/doctype/lead/lead.json
@@ -18,6 +18,37 @@
    "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
+   "depends_on": "", 
+   "fieldname": "organization_lead", 
+   "fieldtype": "Check", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "ignore_xss_filter": 0, 
+   "in_filter": 0, 
+   "in_global_search": 0, 
+   "in_list_view": 0, 
+   "in_standard_filter": 0, 
+   "label": "Lead is an Organization", 
+   "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": 1, 
+   "unique": 0
+  }, 
+  {
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
    "fieldname": "lead_details", 
    "fieldtype": "Section Break", 
    "hidden": 0, 
@@ -80,6 +111,7 @@
    "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
+   "depends_on": "eval:!doc.organization_lead", 
    "fieldname": "lead_name", 
    "fieldtype": "Data", 
    "hidden": 0, 
@@ -673,6 +705,38 @@
    "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
+   "depends_on": "eval:doc.organization_lead", 
+   "fieldname": "contact_html", 
+   "fieldtype": "HTML", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "ignore_xss_filter": 0, 
+   "in_filter": 0, 
+   "in_global_search": 0, 
+   "in_list_view": 0, 
+   "in_standard_filter": 0, 
+   "label": "Contact HTML", 
+   "length": 0, 
+   "no_copy": 0, 
+   "permlevel": 0, 
+   "precision": "", 
+   "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, 
+   "set_only_once": 0, 
+   "unique": 0
+  }, 
+  {
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "depends_on": "eval:!doc.organization_lead", 
    "fieldname": "phone", 
    "fieldtype": "Data", 
    "hidden": 0, 
@@ -704,6 +768,7 @@
    "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
+   "depends_on": "eval:!doc.organization_lead", 
    "fieldname": "salutation", 
    "fieldtype": "Link", 
    "hidden": 0, 
@@ -735,6 +800,7 @@
    "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
+   "depends_on": "eval:!doc.organization_lead", 
    "fieldname": "mobile_no", 
    "fieldtype": "Data", 
    "hidden": 0, 
@@ -766,6 +832,7 @@
    "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
+   "depends_on": "eval:!doc.organization_lead", 
    "fieldname": "fax", 
    "fieldtype": "Data", 
    "hidden": 0, 
@@ -1147,7 +1214,7 @@
  "issingle": 0, 
  "istable": 0, 
  "max_attachments": 0, 
- "modified": "2017-08-21 02:28:21.581948", 
+ "modified": "2017-11-24 11:10:56.485917", 
  "modified_by": "Administrator", 
  "module": "CRM", 
  "name": "Lead", 
diff --git a/erpnext/crm/doctype/lead/lead.py b/erpnext/crm/doctype/lead/lead.py
index eb6e876..a5dfc5c 100644
--- a/erpnext/crm/doctype/lead/lead.py
+++ b/erpnext/crm/doctype/lead/lead.py
@@ -23,6 +23,7 @@
 		load_address_and_contact(self)
 
 	def validate(self):
+		self.set_lead_name()
 		self._prev = frappe._dict({
 			"contact_date": frappe.db.get_value("Lead", self.name, "contact_date") if \
 				(not cint(self.get("__islocal"))) else None,
@@ -98,6 +99,10 @@
 			"status": "Lost"
 		})
 
+	def set_lead_name(self):
+		if not self.lead_name:
+			frappe.db.set_value("Lead", self.name, "lead_name", self.organization_name)
+
 @frappe.whitelist()
 def make_customer(source_name, target_doc=None):
 	return _make_customer(source_name, target_doc)
@@ -124,11 +129,12 @@
 			}
 		}}, target_doc, set_missing_values, ignore_permissions=ignore_permissions)
 
+	print(doclist)
 	return doclist
 
 @frappe.whitelist()
 def make_opportunity(source_name, target_doc=None):
-	target_doc = get_mapped_doc("Lead", source_name, 
+	target_doc = get_mapped_doc("Lead", source_name,
 		{"Lead": {
 			"doctype": "Opportunity",
 			"field_map": {
diff --git a/erpnext/crm/doctype/lead/test_lead.js b/erpnext/crm/doctype/lead/test_lead.js
index 66d3337..0d92b4e 100644
--- a/erpnext/crm/doctype/lead/test_lead.js
+++ b/erpnext/crm/doctype/lead/test_lead.js
@@ -1,7 +1,7 @@
 QUnit.module("sales");
 
 QUnit.test("test: lead", function (assert) {
-	assert.expect(4);
+	assert.expect(10);
 	let done = assert.async();
 	let lead_name = frappe.utils.get_random(10);
 	frappe.run_serially([
@@ -40,4 +40,53 @@
 
 		() => done()
 	]);
+	frappe.run_serially([
+		// test lead creation
+		() => frappe.set_route("List", "Lead"),
+		() => frappe.new_doc("Lead"),
+		() => frappe.timeout(1),
+		() => cur_frm.set_value("organization_lead", "1"),
+		() => cur_frm.set_value("organization_name", lead_name),
+		() => cur_frm.save(),
+		() => frappe.timeout(1),
+		() => {
+			assert.ok(cur_frm.doc.lead_name.includes(lead_name),
+				'name correctly set');
+			frappe.lead_name = cur_frm.doc.name;
+		},
+		// create address and contact
+		() => frappe.click_link('Address & Contact'),
+		() => frappe.click_button('New Address'),
+		() => frappe.timeout(1),
+		() => frappe.set_control('address_line1', 'Gateway'),
+		() => frappe.set_control('city', 'Mumbai'),
+		() => cur_frm.save(),
+		() => frappe.timeout(3),
+		() => assert.equal(frappe.get_route()[1], 'Lead',
+			'back to lead form'),
+		() => frappe.click_link('Address & Contact'),
+		() => assert.ok($('.address-box').text().includes('Mumbai'),
+			'city is seen in address box'),
+
+		() => frappe.click_button('New Contact'),
+		() => frappe.timeout(1),
+		() => frappe.set_control('first_name', 'John'),
+		() => frappe.set_control('last_name', 'Doe'),
+		() => cur_frm.save(),
+		() => frappe.timeout(3),
+		() => assert.equal(frappe.get_route()[1], 'Lead',
+			'back to lead form'),
+		() => frappe.click_link('Address & Contact'),
+		() => assert.ok($('.address-box').text().includes('John'),
+			'contact is seen in contact box'),
+
+		// make customer
+		() => frappe.click_button('Make'),
+		() => frappe.click_link('customer'),
+		() => frappe.timeout(2),
+		() => assert.equal(cur_frm.doc.lead_name, frappe.lead_name,
+			'lead name correctly mapped'),
+
+		() => done()
+	]);
 });
diff --git a/erpnext/crm/doctype/lead/test_lead.py b/erpnext/crm/doctype/lead/test_lead.py
index 763e533..2781076 100644
--- a/erpnext/crm/doctype/lead/test_lead.py
+++ b/erpnext/crm/doctype/lead/test_lead.py
@@ -21,3 +21,14 @@
 		customer.company = "_Test Company"
 		customer.customer_group = "_Test Customer Group"
 		customer.insert()
+
+	def test_make_customer_from_organization(self):
+		from erpnext.crm.doctype.lead.lead import make_customer
+
+		customer = make_customer("_T-Lead-00002")
+		self.assertEquals(customer.doctype, "Customer")
+		self.assertEquals(customer.lead_name, "_T-Lead-00002")
+
+		customer.company = "_Test Company"
+		customer.customer_group = "_Test Customer Group"
+		customer.insert()
diff --git a/erpnext/crm/doctype/lead/test_records.json b/erpnext/crm/doctype/lead/test_records.json
index 01b0a99..590e200 100644
--- a/erpnext/crm/doctype/lead/test_records.json
+++ b/erpnext/crm/doctype/lead/test_records.json
@@ -23,5 +23,13 @@
   "email_id": "test_lead3@example.com",
   "lead_name": "_Test Lead 3",
   "status": "Converted"
- }
+},
+{
+ "doctype": "Lead",
+ "email_id": "test_lead4@example.com",
+ "organization_lead": 1,
+ "lead_name": "_Test Lead 4",
+ "organization_name": "_Test Lead 4",
+ "status": "Open"
+}
 ]
diff --git a/erpnext/crm/doctype/opportunity/opportunity_dashboard.py b/erpnext/crm/doctype/opportunity/opportunity_dashboard.py
index 1939c2e..bd4a6a2 100644
--- a/erpnext/crm/doctype/opportunity/opportunity_dashboard.py
+++ b/erpnext/crm/doctype/opportunity/opportunity_dashboard.py
@@ -5,6 +5,7 @@
 		'fieldname': 'prevdoc_docname',
 		'non_standard_fieldnames': {
 			'Supplier Quotation': 'opportunity',
+			'Quotation': 'opportunity'
 		},
 		'transactions': [
 			{
diff --git a/erpnext/demo/data/item_schools.json b/erpnext/demo/data/item_education.json
similarity index 100%
rename from erpnext/demo/data/item_schools.json
rename to erpnext/demo/data/item_education.json
diff --git a/erpnext/demo/demo.py b/erpnext/demo/demo.py
index 35256b5..42ef896 100644
--- a/erpnext/demo/demo.py
+++ b/erpnext/demo/demo.py
@@ -3,7 +3,7 @@
 import frappe, sys
 import erpnext
 import frappe.utils
-from erpnext.demo.user import hr, sales, purchase, manufacturing, stock, accounts, projects, fixed_asset, schools
+from erpnext.demo.user import hr, sales, purchase, manufacturing, stock, accounts, projects, fixed_asset, education
 from erpnext.demo.setup import education, manufacture, setup_data, healthcare
 """
 Make a demo
@@ -83,7 +83,7 @@
 				sales.work()
 				manufacturing.work()
 			elif domain=='Education':
-				schools.work()
+				education.work()
 
 		except:
 			frappe.db.set_global('demo_last_date', current_date)
diff --git a/erpnext/demo/setup/education.py b/erpnext/demo/setup/education.py
index a124ee7..2a894f7 100644
--- a/erpnext/demo/setup/education.py
+++ b/erpnext/demo/setup/education.py
@@ -31,7 +31,7 @@
 	frappe.db.commit()
 
 def setup_item():
-	items = json.loads(open(frappe.get_app_path('erpnext', 'demo', 'data', 'item_schools.json')).read())
+	items = json.loads(open(frappe.get_app_path('erpnext', 'demo', 'data', 'item_education.json')).read())
 	for i in items:
 		item = frappe.new_doc('Item')
 		item.update(i)
diff --git a/erpnext/demo/setup/setup_data.py b/erpnext/demo/setup/setup_data.py
index 34e9a3e..c7babc0 100644
--- a/erpnext/demo/setup/setup_data.py
+++ b/erpnext/demo/setup/setup_data.py
@@ -229,10 +229,10 @@
 		user.add_roles('HR User', 'Projects User')
 		frappe.db.set_global('demo_projects_user', user.name)
 
-	if not frappe.db.get_global('demo_schools_user'):
+	if not frappe.db.get_global('demo_education_user'):
 		user = frappe.get_doc('User', 'aromn@example.com')
 		user.add_roles('Academics User')
-		frappe.db.set_global('demo_schools_user', user.name)
+		frappe.db.set_global('demo_education_user', user.name)
 
 	#Add Expense Approver
 	user = frappe.get_doc('User', 'WanMai@example.com')
@@ -348,8 +348,10 @@
 		budget.action_if_annual_budget_exceeded = "Warn"
 		expense_ledger_count = frappe.db.count("Account", {"is_group": "0", "root_type": "Expense"})
 
-		add_random_children(budget, "accounts", rows=random.randint(10, expense_ledger_count), randomize = { 			"account": ("Account", {"is_group": "0", "root_type": "Expense"})
-		}, unique="account")
+		add_random_children(budget, "accounts", rows=random.randint(10, expense_ledger_count),
+			randomize = {
+				"account": ("Account", {"is_group": "0", "root_type": "Expense"})
+			}, unique="account")
 
 		for d in budget.accounts:
 			d.budget_amount = random.randint(5, 100) * 10000
@@ -361,6 +363,7 @@
 	company_abbr = frappe.db.get_value("Company", erpnext.get_default_company(), "abbr")
 	pos = frappe.new_doc('POS Profile')
 	pos.user = frappe.db.get_global('demo_accounts_user')
+	pos.pos_profile_name = "Demo POS Profile"
 	pos.naming_series = 'SINV-'
 	pos.update_stock = 0
 	pos.write_off_account = 'Cost of Goods Sold - '+ company_abbr
diff --git a/erpnext/demo/user/schools.py b/erpnext/demo/user/education.py
similarity index 92%
rename from erpnext/demo/user/schools.py
rename to erpnext/demo/user/education.py
index 422c31a..8c82f87 100644
--- a/erpnext/demo/user/schools.py
+++ b/erpnext/demo/user/education.py
@@ -1,3 +1,4 @@
+
 # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
 # License: GNU General Public License v3. See license.txt
 
@@ -8,13 +9,12 @@
 from frappe.utils import cstr
 from frappe.utils.make_random import get_random
 from datetime import timedelta
-from erpnext.schools.api import get_student_group_students, make_attendance_records, enroll_student, \
+from erpnext.education.api import get_student_group_students, make_attendance_records, enroll_student, \
 								get_fee_schedule, collect_fees, get_course
-from erpnext.schools.doctype.program_enrollment.program_enrollment import get_program_courses
-from erpnext.schools.doctype.student_group.student_group import get_students
+
 
 def work():
-	frappe.set_user(frappe.db.get_global('demo_schools_user'))
+	frappe.set_user(frappe.db.get_global('demo_education_user'))
 	for d in xrange(20):
 		approve_random_student_applicant()
 		enroll_random_student(frappe.flags.current_date)
diff --git a/erpnext/docs/assets/img/schools/__init__.py b/erpnext/docs/assets/img/education/__init__.py
similarity index 100%
rename from erpnext/docs/assets/img/schools/__init__.py
rename to erpnext/docs/assets/img/education/__init__.py
diff --git a/erpnext/docs/assets/img/schools/admission/__init__.py b/erpnext/docs/assets/img/education/admission/__init__.py
similarity index 100%
rename from erpnext/docs/assets/img/schools/admission/__init__.py
rename to erpnext/docs/assets/img/education/admission/__init__.py
diff --git a/erpnext/docs/assets/img/schools/admission/program-enrollment-tool.gif b/erpnext/docs/assets/img/education/admission/program-enrollment-tool.gif
similarity index 100%
rename from erpnext/docs/assets/img/schools/admission/program-enrollment-tool.gif
rename to erpnext/docs/assets/img/education/admission/program-enrollment-tool.gif
Binary files differ
diff --git a/erpnext/docs/assets/img/schools/admission/program-enrollment-tool01.gif b/erpnext/docs/assets/img/education/admission/program-enrollment-tool01.gif
similarity index 100%
rename from erpnext/docs/assets/img/schools/admission/program-enrollment-tool01.gif
rename to erpnext/docs/assets/img/education/admission/program-enrollment-tool01.gif
Binary files differ
diff --git a/erpnext/docs/assets/img/schools/admission/program-enrollment.gif b/erpnext/docs/assets/img/education/admission/program-enrollment.gif
similarity index 100%
rename from erpnext/docs/assets/img/schools/admission/program-enrollment.gif
rename to erpnext/docs/assets/img/education/admission/program-enrollment.gif
Binary files differ
diff --git a/erpnext/docs/assets/img/schools/admission/student-admission.gif b/erpnext/docs/assets/img/education/admission/student-admission.gif
similarity index 100%
rename from erpnext/docs/assets/img/schools/admission/student-admission.gif
rename to erpnext/docs/assets/img/education/admission/student-admission.gif
Binary files differ
diff --git a/erpnext/docs/assets/img/schools/admission/student-applicant-enroll.png b/erpnext/docs/assets/img/education/admission/student-applicant-enroll.png
similarity index 100%
rename from erpnext/docs/assets/img/schools/admission/student-applicant-enroll.png
rename to erpnext/docs/assets/img/education/admission/student-applicant-enroll.png
Binary files differ
diff --git a/erpnext/docs/assets/img/schools/admission/student-applicant.png b/erpnext/docs/assets/img/education/admission/student-applicant.png
similarity index 100%
rename from erpnext/docs/assets/img/schools/admission/student-applicant.png
rename to erpnext/docs/assets/img/education/admission/student-applicant.png
Binary files differ
diff --git a/erpnext/docs/assets/img/schools/admission/student-application-actions.png b/erpnext/docs/assets/img/education/admission/student-application-actions.png
similarity index 100%
rename from erpnext/docs/assets/img/schools/admission/student-application-actions.png
rename to erpnext/docs/assets/img/education/admission/student-application-actions.png
Binary files differ
diff --git a/erpnext/docs/assets/img/schools/assessment/__init__.py b/erpnext/docs/assets/img/education/assessment/__init__.py
similarity index 100%
rename from erpnext/docs/assets/img/schools/assessment/__init__.py
rename to erpnext/docs/assets/img/education/assessment/__init__.py
diff --git a/erpnext/docs/assets/img/schools/assessment/assessment-criteria.png b/erpnext/docs/assets/img/education/assessment/assessment-criteria.png
similarity index 100%
rename from erpnext/docs/assets/img/schools/assessment/assessment-criteria.png
rename to erpnext/docs/assets/img/education/assessment/assessment-criteria.png
Binary files differ
diff --git a/erpnext/docs/assets/img/schools/assessment/assessment-group-details.png b/erpnext/docs/assets/img/education/assessment/assessment-group-details.png
similarity index 100%
rename from erpnext/docs/assets/img/schools/assessment/assessment-group-details.png
rename to erpnext/docs/assets/img/education/assessment/assessment-group-details.png
Binary files differ
diff --git a/erpnext/docs/assets/img/schools/assessment/assessment-group-term.png b/erpnext/docs/assets/img/education/assessment/assessment-group-term.png
similarity index 100%
rename from erpnext/docs/assets/img/schools/assessment/assessment-group-term.png
rename to erpnext/docs/assets/img/education/assessment/assessment-group-term.png
Binary files differ
diff --git a/erpnext/docs/assets/img/schools/assessment/assessment-plan-criteria.png b/erpnext/docs/assets/img/education/assessment/assessment-plan-criteria.png
similarity index 100%
rename from erpnext/docs/assets/img/schools/assessment/assessment-plan-criteria.png
rename to erpnext/docs/assets/img/education/assessment/assessment-plan-criteria.png
Binary files differ
diff --git a/erpnext/docs/assets/img/schools/assessment/assessment-plan-details.png b/erpnext/docs/assets/img/education/assessment/assessment-plan-details.png
similarity index 100%
rename from erpnext/docs/assets/img/schools/assessment/assessment-plan-details.png
rename to erpnext/docs/assets/img/education/assessment/assessment-plan-details.png
Binary files differ
diff --git a/erpnext/docs/assets/img/schools/assessment/assessment-result-tool.png b/erpnext/docs/assets/img/education/assessment/assessment-result-tool.png
similarity index 100%
rename from erpnext/docs/assets/img/schools/assessment/assessment-result-tool.png
rename to erpnext/docs/assets/img/education/assessment/assessment-result-tool.png
Binary files differ
diff --git a/erpnext/docs/assets/img/schools/assessment/assessment-result.png b/erpnext/docs/assets/img/education/assessment/assessment-result.png
similarity index 100%
rename from erpnext/docs/assets/img/schools/assessment/assessment-result.png
rename to erpnext/docs/assets/img/education/assessment/assessment-result.png
Binary files differ
diff --git a/erpnext/docs/assets/img/schools/assessment/grading-scale.png b/erpnext/docs/assets/img/education/assessment/grading-scale.png
similarity index 100%
rename from erpnext/docs/assets/img/schools/assessment/grading-scale.png
rename to erpnext/docs/assets/img/education/assessment/grading-scale.png
Binary files differ
diff --git a/erpnext/docs/assets/img/schools/fees/__init__.py b/erpnext/docs/assets/img/education/fees/__init__.py
similarity index 100%
rename from erpnext/docs/assets/img/schools/fees/__init__.py
rename to erpnext/docs/assets/img/education/fees/__init__.py
diff --git a/erpnext/docs/assets/img/schools/fees/fee-category.png b/erpnext/docs/assets/img/education/fees/fee-category.png
similarity index 100%
rename from erpnext/docs/assets/img/schools/fees/fee-category.png
rename to erpnext/docs/assets/img/education/fees/fee-category.png
Binary files differ
diff --git a/erpnext/docs/assets/img/schools/fees/fee-structure.png b/erpnext/docs/assets/img/education/fees/fee-structure.png
similarity index 100%
rename from erpnext/docs/assets/img/schools/fees/fee-structure.png
rename to erpnext/docs/assets/img/education/fees/fee-structure.png
Binary files differ
diff --git a/erpnext/docs/assets/img/schools/fees/fees-section.png b/erpnext/docs/assets/img/education/fees/fees-section.png
similarity index 100%
rename from erpnext/docs/assets/img/schools/fees/fees-section.png
rename to erpnext/docs/assets/img/education/fees/fees-section.png
Binary files differ
diff --git a/erpnext/docs/assets/img/schools/fees/fees.png b/erpnext/docs/assets/img/education/fees/fees.png
similarity index 100%
rename from erpnext/docs/assets/img/schools/fees/fees.png
rename to erpnext/docs/assets/img/education/fees/fees.png
Binary files differ
diff --git a/erpnext/docs/assets/img/schools/home.png b/erpnext/docs/assets/img/education/home.png
similarity index 100%
rename from erpnext/docs/assets/img/schools/home.png
rename to erpnext/docs/assets/img/education/home.png
Binary files differ
diff --git a/erpnext/docs/assets/img/schools/module.png b/erpnext/docs/assets/img/education/module.png
similarity index 100%
rename from erpnext/docs/assets/img/schools/module.png
rename to erpnext/docs/assets/img/education/module.png
Binary files differ
diff --git a/erpnext/docs/assets/img/schools/schedule/__init__.py b/erpnext/docs/assets/img/education/schedule/__init__.py
similarity index 100%
rename from erpnext/docs/assets/img/schools/schedule/__init__.py
rename to erpnext/docs/assets/img/education/schedule/__init__.py
diff --git a/erpnext/docs/assets/img/schools/schedule/course-schedule-att-1.png b/erpnext/docs/assets/img/education/schedule/course-schedule-att-1.png
similarity index 100%
rename from erpnext/docs/assets/img/schools/schedule/course-schedule-att-1.png
rename to erpnext/docs/assets/img/education/schedule/course-schedule-att-1.png
Binary files differ
diff --git a/erpnext/docs/assets/img/schools/schedule/course-schedule-att.png b/erpnext/docs/assets/img/education/schedule/course-schedule-att.png
similarity index 100%
rename from erpnext/docs/assets/img/schools/schedule/course-schedule-att.png
rename to erpnext/docs/assets/img/education/schedule/course-schedule-att.png
Binary files differ
diff --git a/erpnext/docs/assets/img/schools/schedule/course-schedule.png b/erpnext/docs/assets/img/education/schedule/course-schedule.png
similarity index 100%
rename from erpnext/docs/assets/img/schools/schedule/course-schedule.png
rename to erpnext/docs/assets/img/education/schedule/course-schedule.png
Binary files differ
diff --git a/erpnext/docs/assets/img/schools/schedule/examination.png b/erpnext/docs/assets/img/education/schedule/examination.png
similarity index 100%
rename from erpnext/docs/assets/img/schools/schedule/examination.png
rename to erpnext/docs/assets/img/education/schedule/examination.png
Binary files differ
diff --git a/erpnext/docs/assets/img/schools/schedule/schedule-section.png b/erpnext/docs/assets/img/education/schedule/schedule-section.png
similarity index 100%
rename from erpnext/docs/assets/img/schools/schedule/schedule-section.png
rename to erpnext/docs/assets/img/education/schedule/schedule-section.png
Binary files differ
diff --git a/erpnext/docs/assets/img/schools/schedule/scheduling-tool.png b/erpnext/docs/assets/img/education/schedule/scheduling-tool.png
similarity index 100%
rename from erpnext/docs/assets/img/schools/schedule/scheduling-tool.png
rename to erpnext/docs/assets/img/education/schedule/scheduling-tool.png
Binary files differ
diff --git a/erpnext/docs/assets/img/schools/schedule/student-attendance.gif b/erpnext/docs/assets/img/education/schedule/student-attendance.gif
similarity index 100%
rename from erpnext/docs/assets/img/schools/schedule/student-attendance.gif
rename to erpnext/docs/assets/img/education/schedule/student-attendance.gif
Binary files differ
diff --git a/erpnext/docs/assets/img/schools/schedule/student-attendance.png b/erpnext/docs/assets/img/education/schedule/student-attendance.png
similarity index 100%
rename from erpnext/docs/assets/img/schools/schedule/student-attendance.png
rename to erpnext/docs/assets/img/education/schedule/student-attendance.png
Binary files differ
diff --git a/erpnext/docs/assets/img/schools/schedule/student-leave-application.gif b/erpnext/docs/assets/img/education/schedule/student-leave-application.gif
similarity index 100%
rename from erpnext/docs/assets/img/schools/schedule/student-leave-application.gif
rename to erpnext/docs/assets/img/education/schedule/student-leave-application.gif
Binary files differ
diff --git a/erpnext/docs/assets/img/schools/setup/Course-schedule-error.png b/erpnext/docs/assets/img/education/setup/Course-schedule-error.png
similarity index 100%
rename from erpnext/docs/assets/img/schools/setup/Course-schedule-error.png
rename to erpnext/docs/assets/img/education/setup/Course-schedule-error.png
Binary files differ
diff --git a/erpnext/docs/assets/img/schools/setup/Room-Assesment-plan.png b/erpnext/docs/assets/img/education/setup/Room-Assesment-plan.png
similarity index 100%
rename from erpnext/docs/assets/img/schools/setup/Room-Assesment-plan.png
rename to erpnext/docs/assets/img/education/setup/Room-Assesment-plan.png
Binary files differ
diff --git a/erpnext/docs/assets/img/schools/setup/__init__.py b/erpnext/docs/assets/img/education/setup/__init__.py
similarity index 100%
rename from erpnext/docs/assets/img/schools/setup/__init__.py
rename to erpnext/docs/assets/img/education/setup/__init__.py
diff --git a/erpnext/docs/assets/img/schools/setup/academic-term.png b/erpnext/docs/assets/img/education/setup/academic-term.png
similarity index 100%
rename from erpnext/docs/assets/img/schools/setup/academic-term.png
rename to erpnext/docs/assets/img/education/setup/academic-term.png
Binary files differ
diff --git a/erpnext/docs/assets/img/schools/setup/academic-year.png b/erpnext/docs/assets/img/education/setup/academic-year.png
similarity index 100%
rename from erpnext/docs/assets/img/schools/setup/academic-year.png
rename to erpnext/docs/assets/img/education/setup/academic-year.png
Binary files differ
diff --git a/erpnext/docs/assets/img/schools/setup/course-fee-program.png b/erpnext/docs/assets/img/education/setup/course-fee-program.png
similarity index 100%
rename from erpnext/docs/assets/img/schools/setup/course-fee-program.png
rename to erpnext/docs/assets/img/education/setup/course-fee-program.png
Binary files differ
diff --git a/erpnext/docs/assets/img/schools/setup/course.png b/erpnext/docs/assets/img/education/setup/course.png
similarity index 100%
rename from erpnext/docs/assets/img/schools/setup/course.png
rename to erpnext/docs/assets/img/education/setup/course.png
Binary files differ
diff --git a/erpnext/docs/assets/img/schools/setup/instructor.png b/erpnext/docs/assets/img/education/setup/instructor.png
similarity index 100%
rename from erpnext/docs/assets/img/schools/setup/instructor.png
rename to erpnext/docs/assets/img/education/setup/instructor.png
Binary files differ
diff --git a/erpnext/docs/assets/img/schools/setup/program.png b/erpnext/docs/assets/img/education/setup/program.png
similarity index 100%
rename from erpnext/docs/assets/img/schools/setup/program.png
rename to erpnext/docs/assets/img/education/setup/program.png
Binary files differ
diff --git a/erpnext/docs/assets/img/schools/setup/room.png b/erpnext/docs/assets/img/education/setup/room.png
similarity index 100%
rename from erpnext/docs/assets/img/schools/setup/room.png
rename to erpnext/docs/assets/img/education/setup/room.png
Binary files differ
diff --git a/erpnext/docs/assets/img/schools/setup/student-attendance-tool.gif b/erpnext/docs/assets/img/education/setup/student-attendance-tool.gif
similarity index 100%
rename from erpnext/docs/assets/img/schools/setup/student-attendance-tool.gif
rename to erpnext/docs/assets/img/education/setup/student-attendance-tool.gif
Binary files differ
diff --git a/erpnext/docs/assets/img/schools/setup/student-group-instructor.png b/erpnext/docs/assets/img/education/setup/student-group-instructor.png
similarity index 100%
rename from erpnext/docs/assets/img/schools/setup/student-group-instructor.png
rename to erpnext/docs/assets/img/education/setup/student-group-instructor.png
Binary files differ
diff --git a/erpnext/docs/assets/img/schools/student/__init__.py b/erpnext/docs/assets/img/education/student/__init__.py
similarity index 100%
rename from erpnext/docs/assets/img/schools/student/__init__.py
rename to erpnext/docs/assets/img/education/student/__init__.py
diff --git a/erpnext/docs/assets/img/schools/student/guardian.png b/erpnext/docs/assets/img/education/student/guardian.png
similarity index 100%
rename from erpnext/docs/assets/img/schools/student/guardian.png
rename to erpnext/docs/assets/img/education/student/guardian.png
Binary files differ
diff --git a/erpnext/docs/assets/img/schools/student/schools-settings.png b/erpnext/docs/assets/img/education/student/schools-settings.png
similarity index 100%
rename from erpnext/docs/assets/img/schools/student/schools-settings.png
rename to erpnext/docs/assets/img/education/student/schools-settings.png
Binary files differ
diff --git a/erpnext/docs/assets/img/schools/student/student group.gif b/erpnext/docs/assets/img/education/student/student group.gif
similarity index 100%
rename from erpnext/docs/assets/img/schools/student/student group.gif
rename to erpnext/docs/assets/img/education/student/student group.gif
Binary files differ
diff --git a/erpnext/docs/assets/img/schools/student/student-admission.gif b/erpnext/docs/assets/img/education/student/student-admission.gif
similarity index 100%
rename from erpnext/docs/assets/img/schools/student/student-admission.gif
rename to erpnext/docs/assets/img/education/student/student-admission.gif
Binary files differ
diff --git a/erpnext/docs/assets/img/schools/student/student-batch-validation.gif b/erpnext/docs/assets/img/education/student/student-batch-validation.gif
similarity index 100%
rename from erpnext/docs/assets/img/schools/student/student-batch-validation.gif
rename to erpnext/docs/assets/img/education/student/student-batch-validation.gif
Binary files differ
diff --git a/erpnext/docs/assets/img/schools/student/student-batch.gif b/erpnext/docs/assets/img/education/student/student-batch.gif
similarity index 100%
rename from erpnext/docs/assets/img/schools/student/student-batch.gif
rename to erpnext/docs/assets/img/education/student/student-batch.gif
Binary files differ
diff --git a/erpnext/docs/assets/img/schools/student/student-course-validation.gif b/erpnext/docs/assets/img/education/student/student-course-validation.gif
similarity index 100%
rename from erpnext/docs/assets/img/schools/student/student-course-validation.gif
rename to erpnext/docs/assets/img/education/student/student-course-validation.gif
Binary files differ
diff --git a/erpnext/docs/assets/img/schools/student/student-group-attendance.gif b/erpnext/docs/assets/img/education/student/student-group-attendance.gif
similarity index 100%
rename from erpnext/docs/assets/img/schools/student/student-group-attendance.gif
rename to erpnext/docs/assets/img/education/student/student-group-attendance.gif
Binary files differ
diff --git a/erpnext/docs/assets/img/schools/student/student-group-creation-tool.gif b/erpnext/docs/assets/img/education/student/student-group-creation-tool.gif
similarity index 100%
rename from erpnext/docs/assets/img/schools/student/student-group-creation-tool.gif
rename to erpnext/docs/assets/img/education/student/student-group-creation-tool.gif
Binary files differ
diff --git a/erpnext/docs/assets/img/schools/student/student-log.png b/erpnext/docs/assets/img/education/student/student-log.png
similarity index 100%
rename from erpnext/docs/assets/img/schools/student/student-log.png
rename to erpnext/docs/assets/img/education/student/student-log.png
Binary files differ
diff --git a/erpnext/docs/assets/img/schools/student/student.png b/erpnext/docs/assets/img/education/student/student.png
similarity index 100%
rename from erpnext/docs/assets/img/schools/student/student.png
rename to erpnext/docs/assets/img/education/student/student.png
Binary files differ
diff --git a/erpnext/docs/user/manual/en/CRM/lead.md b/erpnext/docs/user/manual/en/CRM/lead.md
index 15b1159..2a48166 100644
--- a/erpnext/docs/user/manual/en/CRM/lead.md
+++ b/erpnext/docs/user/manual/en/CRM/lead.md
@@ -43,6 +43,9 @@
 organization or individual who has given you business before (and has an Account
 in your system). A Contact is a person who belongs to the Customer.
 
+A Lead can sometimes be an organization you are trying to make a deal with. In this case you can select "Lead is an Organization" and add as many contacts within this organization as you want.
+It is useful if you are establishing a relationship with several people within the same organization.
+
 A Lead can be converted to a Customer by selecting “Customer” from the **Make**
 dropdown. Once the Customer is created, the Lead becomes “Converted” and any
 further Opportunities from the same source can be created against this
diff --git a/erpnext/docs/user/manual/en/accounts/payment-terms.md b/erpnext/docs/user/manual/en/accounts/payment-terms.md
new file mode 100644
index 0000000..4f28d0d
--- /dev/null
+++ b/erpnext/docs/user/manual/en/accounts/payment-terms.md
@@ -0,0 +1,70 @@
+# Payment Terms
+You can save your business' payment terms on ERPNext and include it in all documents in the sales/purchase cycle and ERPNext will make all the proper general ledger entries accordingly.
+
+The documents you can attach Payment Terms to are:
+- Sales Invoice
+- Purchase Invoice
+- Sales Order
+- Purchase Order
+- Quotation
+
+Note that the introduction of Payment Terms removes "Credit Days" and "Credit Days Based On" fields in Customer/Supplier master. Payment Term contains the same information and makes it more flexible to use.
+
+## Payment Terms
+Navigate to the Payment Term list page and click "New".
+> Accounts > Payment Term > New Payment Term
+
+Payment Term has the following fields:
+**Payment Term Name:** (optional) The name for this Payment Term.
+
+**Due Date Based On:** The basis by which the due date for the Payment Term is to be calculated. There are three options:
+- Day(s) after invoice date: Due date should be calculated in days with reference to the posting date of the invoice
+- Day(s) after the end of the invoice month: Due date should be calculated in days with reference to the last day of the month in which the invoice was created
+- Month(s) after the end of the invoice month: Due date should be calculated in months with reference to the last day of the month in which the invoice was created
+
+**Invoice Portion:** (optional) The portion of the total invoice amount for which this Payment Term should be applied. Value given will be regarded as percentage i.e 100 = 100%
+
+**Credit Days:** (optional) The number of days or month credit is allowed depending on the option chosen in the `Due Date Based On` field. 0 means no credit allowed.
+
+**Description:** (optional) A brief description of the Payment Term.
+
+## Payment Terms In Converted Documents
+When converting or copying documents in the sales/purchase cycle, the attached Payment Term(s) will not be copied. The reason for this is because the copied information might no longer be true. For example, a Quotation is created for a service costing $1000 on January 1 with payment term of "N 30" (Net payable within 30 days) and then sent to a customer. On the quotation, the due date on the invoice will be January 30. Let's say the customer agrees to the quotation of January 20 and you decide to make an invoice from the Quotation. If the Payment Terms from the Quotation is copied, the due date on the invoice will still wrongly read January 30. This issue also applies for recurring documents.
+
+This does not mean you have manually set Payment Terms for every document. If you want the Payment Terms to be copyable, make use of Payment Terms Template.
+
+##  Payment Terms Template
+Payment Terms Template tells ERPNext how to populate the table in the Payment Terms Schedule section of the sales/purchase document.
+ 
+You should use it if you have a set of standard Payment Terms or if you want the Payment Term(s) on a sales/purchase document to be copyable.
+
+To create a new Payment Terms Template, navigate to the Payment Term Template creation form:
+> Accounts > Payment Terms Template > New Payment Terms Template
+
+**Payment Term:** (optional) The name for this Payment Term.
+
+**Due Date Based On:** The basis by which the due date for the Payment Term is to be calculated. There are three options:
+- Day(s) after invoice date: Due date should be calculated in days with reference to the posting date of the invoice
+- Day(s) after the end of the invoice month: Due date should be calculated in days with reference to the last day of the month in which the invoice was created
+- Month(s) after the end of the invoice month: Due date should be calculated in months with reference to the last day of the month in which the invoice was created
+
+**Invoice Portion:** (optional) The portion of the total invoice amount for which this Payment Term should be applied. Value given will be regarded as percentage i.e 100 = 100%
+
+**Credit Days:** (optional) The number of days or month credit is allowed depending on the option chosen in the `Due Date Based On` field. 0 means no credit allowed.
+
+**Description:** (optional) A brief description of the Payment Term.
+
+Add as many rows as needed but make sure that the sum of the values in the `Invoice Portion` fields in all populated rows equals 100.
+
+## How to Add Payment Terms To Documents
+You can add Payments Terms in the "Payment Terms Schedule" section of the Document. Each row in the table represents a portion of the document's grand total. The table collects the following information:
+
+**Payment Term:** (optional) The name of the Payment Term document you require. If this is added, the data from the selected Payment Term will be used to populate the remaining columns in the row.
+
+**Description:** (optional) Description of the Payment Term.
+
+**Due Date:** (optional) The due date for the portion of the invoice. Set this value only if you did not specify anything in the `Payment Term` column.
+
+**Invoice Portion:** The percentage portion of the document represented in each row.
+
+**Payment Amount:** The amount due from the portion of the invoice represented by each row.
diff --git a/erpnext/docs/user/manual/en/accounts/sales-invoice.md b/erpnext/docs/user/manual/en/accounts/sales-invoice.md
index f4c4143..3ea13f0 100644
--- a/erpnext/docs/user/manual/en/accounts/sales-invoice.md
+++ b/erpnext/docs/user/manual/en/accounts/sales-invoice.md
@@ -56,6 +56,21 @@
 ERPNext will automatically create new Invoices and mail it to the Email Addresses
 you set.
 
+#### Automatically Fetching Item Batch Numbers
+
+If you are selling an item from a [Batch](/docs/user/manual/en/stock/batch),
+ERPNext will automatically fetch a batch number for you if "Update Stock" 
+is checked. The batch number will be fetched on a First Expiring First Out 
+(FEFO) basis. This is a variant of First In First Out (FIFO) that gives 
+highest priority to the soonest to expire Items. 
+
+<img class="screenshot" alt="POS Invoice" src="/docs/assets/img/accounts/sales-invoice-fetch-batch.png">
+
+Note that if the first batch in the queue cannot satisfy the order on the invoice, 
+the next batch in the queue that can satisfy the order will be selected. If there is 
+no batch that can satisfy the order, ERPNext will cancel its attempt to automatically 
+fetch a suitable batch number.
+
 #### POS Invoices
 
 Consider a scenario where retail transaction is carried out. For e.g: A retail shop.
diff --git a/erpnext/docs/user/manual/en/schools/Assessment/__init__.py b/erpnext/docs/user/manual/en/education/Assessment/__init__.py
similarity index 100%
rename from erpnext/docs/user/manual/en/schools/Assessment/__init__.py
rename to erpnext/docs/user/manual/en/education/Assessment/__init__.py
diff --git a/erpnext/docs/user/manual/en/schools/Assessment/assessment_criteria.md b/erpnext/docs/user/manual/en/education/Assessment/assessment_criteria.md
similarity index 83%
rename from erpnext/docs/user/manual/en/schools/Assessment/assessment_criteria.md
rename to erpnext/docs/user/manual/en/education/Assessment/assessment_criteria.md
index c422578..b97cfb1 100644
--- a/erpnext/docs/user/manual/en/schools/Assessment/assessment_criteria.md
+++ b/erpnext/docs/user/manual/en/education/Assessment/assessment_criteria.md
@@ -2,12 +2,12 @@
 
 Assessment Criteria is the parameter based on which you assess the Student.
 
-<img class="screenshot" alt="Assessment Criteria" src="/docs/assets/img/schools/assessment/assessment-criteria.png">
+<img class="screenshot" alt="Assessment Criteria" src="/docs/assets/img/education/assessment/assessment-criteria.png">
 
 After assessment is conducted for a Course, marks earned are entered based on the Assessment Criteria. For example, if assessment was conducted for science subject, then you can evaluate Student in Science on various criteria like Writing, Practicals, Presentation etc.
 
 Assessment Criteria is be used when scheduling Assessment Plan for Student Group and Course.
 
-<img class="screenshot" alt="Assessment Plan Criteria" src="/docs/assets/img/schools/assessment/assessment-plan-criteria.png">
+<img class="screenshot" alt="Assessment Plan Criteria" src="/docs/assets/img/education/assessment/assessment-plan-criteria.png">
 
 {next}
\ No newline at end of file
diff --git a/erpnext/docs/user/manual/en/schools/Assessment/assessment_criteria_group.md b/erpnext/docs/user/manual/en/education/Assessment/assessment_criteria_group.md
similarity index 100%
rename from erpnext/docs/user/manual/en/schools/Assessment/assessment_criteria_group.md
rename to erpnext/docs/user/manual/en/education/Assessment/assessment_criteria_group.md
diff --git a/erpnext/docs/user/manual/en/schools/Assessment/assessment_group.md b/erpnext/docs/user/manual/en/education/Assessment/assessment_group.md
similarity index 80%
rename from erpnext/docs/user/manual/en/schools/Assessment/assessment_group.md
rename to erpnext/docs/user/manual/en/education/Assessment/assessment_group.md
index 90c7b5d..ed02a53 100644
--- a/erpnext/docs/user/manual/en/schools/Assessment/assessment_group.md
+++ b/erpnext/docs/user/manual/en/education/Assessment/assessment_group.md
@@ -4,10 +4,10 @@
 
 For example, if you conduct two assessment in a academic year, then setup Assessment Group as following.
 
-<img class="screenshot" alt="Assessment Group Term" src="/docs/assets/img/schools/assessment/assessment-group-term.png">
+<img class="screenshot" alt="Assessment Group Term" src="/docs/assets/img/education/assessment/assessment-group-term.png">
 
 On the same lines, you can also define multiple Assessment Group bases on assessment conducted in your institute.
 
-<img class="screenshot" alt="Assessment Group Term" src="/docs/assets/img/schools/assessment/assessment-group-details.png">
+<img class="screenshot" alt="Assessment Group Term" src="/docs/assets/img/education/assessment/assessment-group-details.png">
 
 {next}
\ No newline at end of file
diff --git a/erpnext/docs/user/manual/en/schools/Assessment/assessment_plan.md b/erpnext/docs/user/manual/en/education/Assessment/assessment_plan.md
similarity index 82%
rename from erpnext/docs/user/manual/en/schools/Assessment/assessment_plan.md
rename to erpnext/docs/user/manual/en/education/Assessment/assessment_plan.md
index 103def1..7272279 100644
--- a/erpnext/docs/user/manual/en/schools/Assessment/assessment_plan.md
+++ b/erpnext/docs/user/manual/en/education/Assessment/assessment_plan.md
@@ -10,10 +10,10 @@
 
 4. Examiner and Supervisor
 
-<img class="screenshot" alt="Assessment Plan Details" src="/docs/assets/img/schools/assessment/assessment-plan-details.png">
+<img class="screenshot" alt="Assessment Plan Details" src="/docs/assets/img/education/assessment/assessment-plan-details.png">
 
 5. Assessment Criteria is list of criteria based which each student in will be evaluated and grades will be assigned.
 
-<img class="screenshot" alt="Assessment Plan Criteria" src="/docs/assets/img/schools/assessment/assessment-plan-criteria.png">
+<img class="screenshot" alt="Assessment Plan Criteria" src="/docs/assets/img/education/assessment/assessment-plan-criteria.png">
 
 {next}
\ No newline at end of file
diff --git a/erpnext/docs/user/manual/en/schools/Assessment/assessment_result.md b/erpnext/docs/user/manual/en/education/Assessment/assessment_result.md
similarity index 69%
rename from erpnext/docs/user/manual/en/schools/Assessment/assessment_result.md
rename to erpnext/docs/user/manual/en/education/Assessment/assessment_result.md
index dc35ca7..ed3e5fb 100644
--- a/erpnext/docs/user/manual/en/schools/Assessment/assessment_result.md
+++ b/erpnext/docs/user/manual/en/education/Assessment/assessment_result.md
@@ -1,7 +1,7 @@
 #Assessment Result
 
-Assessment Result is a log of marks/grades earned by the student for specific Assessment. Assessment Result is created in the backend based on the marks entered in the [Assessment Result Tool](/docs/user/manual/en/schools/assessment/assessment_result_tool.html).
+Assessment Result is a log of marks/grades earned by the student for specific Assessment. Assessment Result is created in the backend based on the marks entered in the [Assessment Result Tool](/docs/user/manual/en/education/assessment/assessment_result_tool.html).
 
-<img class="screenshot" alt="Assessment Result" src="/docs/assets/img/schools/assessment/assessment-result.png">
+<img class="screenshot" alt="Assessment Result" src="/docs/assets/img/education/assessment/assessment-result.png">
 
 {next}
\ No newline at end of file
diff --git a/erpnext/docs/user/manual/en/schools/Assessment/assessment_result_tool.md b/erpnext/docs/user/manual/en/education/Assessment/assessment_result_tool.md
similarity index 89%
rename from erpnext/docs/user/manual/en/schools/Assessment/assessment_result_tool.md
rename to erpnext/docs/user/manual/en/education/Assessment/assessment_result_tool.md
index bb2a2ba..88b7a7a 100644
--- a/erpnext/docs/user/manual/en/schools/Assessment/assessment_result_tool.md
+++ b/erpnext/docs/user/manual/en/education/Assessment/assessment_result_tool.md
@@ -2,7 +2,7 @@
 
 Assessment Result Tool help you entering marks earned by the Students for specific course. In this tool, based on the Assessment Plan, all the Student will be fetched into Assessment Result Tool. Also, Columns for Assessment Criteria will be where marks earned can be entered for each Student.
 
-<img class="screenshot" alt="Assessment Result Tool" src="/docs/assets/img/schools/assessment/assessment-result-tool.png">
+<img class="screenshot" alt="Assessment Result Tool" src="/docs/assets/img/education/assessment/assessment-result-tool.png">
 
 As you go on entering marks for a Student, and switch to next student, in the backend, Student Result record will be auto-created for that Student.
 
diff --git a/erpnext/docs/user/manual/en/schools/Assessment/grading_scale.md b/erpnext/docs/user/manual/en/education/Assessment/grading_scale.md
similarity index 85%
rename from erpnext/docs/user/manual/en/schools/Assessment/grading_scale.md
rename to erpnext/docs/user/manual/en/education/Assessment/grading_scale.md
index 4519112..0ad610b 100644
--- a/erpnext/docs/user/manual/en/schools/Assessment/grading_scale.md
+++ b/erpnext/docs/user/manual/en/education/Assessment/grading_scale.md
@@ -2,6 +2,6 @@
 
 In the Grading Scale, you can define various grades and threshold for them. Based on the score earned by an Student for an Assessment, Grade will be assigned.
 
-<img class="screenshot" alt="Grading Scale" src="/docs/assets/img/schools/assessment/grading-scale.png">
+<img class="screenshot" alt="Grading Scale" src="/docs/assets/img/education/assessment/grading-scale.png">
 
 {next}
\ No newline at end of file
diff --git a/erpnext/docs/user/manual/en/schools/Assessment/index.md b/erpnext/docs/user/manual/en/education/Assessment/index.md
similarity index 100%
rename from erpnext/docs/user/manual/en/schools/Assessment/index.md
rename to erpnext/docs/user/manual/en/education/Assessment/index.md
diff --git a/erpnext/docs/user/manual/en/schools/Assessment/index.txt b/erpnext/docs/user/manual/en/education/Assessment/index.txt
similarity index 100%
rename from erpnext/docs/user/manual/en/schools/Assessment/index.txt
rename to erpnext/docs/user/manual/en/education/Assessment/index.txt
diff --git a/erpnext/docs/user/manual/en/schools/Attendance/__init__.py b/erpnext/docs/user/manual/en/education/Attendance/__init__.py
similarity index 100%
rename from erpnext/docs/user/manual/en/schools/Attendance/__init__.py
rename to erpnext/docs/user/manual/en/education/Attendance/__init__.py
diff --git a/erpnext/docs/user/manual/en/schools/Attendance/index.md b/erpnext/docs/user/manual/en/education/Attendance/index.md
similarity index 100%
rename from erpnext/docs/user/manual/en/schools/Attendance/index.md
rename to erpnext/docs/user/manual/en/education/Attendance/index.md
diff --git a/erpnext/docs/user/manual/en/schools/Attendance/index.txt b/erpnext/docs/user/manual/en/education/Attendance/index.txt
similarity index 100%
rename from erpnext/docs/user/manual/en/schools/Attendance/index.txt
rename to erpnext/docs/user/manual/en/education/Attendance/index.txt
diff --git a/erpnext/docs/user/manual/en/schools/Attendance/student-attendance-tool.md b/erpnext/docs/user/manual/en/education/Attendance/student-attendance-tool.md
similarity index 88%
rename from erpnext/docs/user/manual/en/schools/Attendance/student-attendance-tool.md
rename to erpnext/docs/user/manual/en/education/Attendance/student-attendance-tool.md
index 5c4ce30..fac9d6e 100644
--- a/erpnext/docs/user/manual/en/schools/Attendance/student-attendance-tool.md
+++ b/erpnext/docs/user/manual/en/education/Attendance/student-attendance-tool.md
@@ -10,6 +10,6 @@
 
 Student detials will be autofetched and you can mark the attendance of the given date. 
 
-<img class="screenshot" alt="Student Attendance" src="/docs/assets/img/schools/setup/student-attendance-tool.gif">
+<img class="screenshot" alt="Student Attendance" src="/docs/assets/img/education/setup/student-attendance-tool.gif">
 
 {next}
\ No newline at end of file
diff --git a/erpnext/docs/user/manual/en/schools/Attendance/student-attendance.md b/erpnext/docs/user/manual/en/education/Attendance/student-attendance.md
similarity index 92%
rename from erpnext/docs/user/manual/en/schools/Attendance/student-attendance.md
rename to erpnext/docs/user/manual/en/education/Attendance/student-attendance.md
index 1b917d0..4be2831 100644
--- a/erpnext/docs/user/manual/en/schools/Attendance/student-attendance.md
+++ b/erpnext/docs/user/manual/en/education/Attendance/student-attendance.md
@@ -8,7 +8,7 @@
 
 Select the **Student, Course Schedule and Student Group** for which attendance is to be marked for the given date. Set the Status to Present/Absent and save. 
 
-<img class="screenshot" alt="Student Attendance" src="/docs/assets/img/schools/schedule/student-attendance.gif">
+<img class="screenshot" alt="Student Attendance" src="/docs/assets/img/education/schedule/student-attendance.gif">
 
 **Student Attendance tool** can be used for bulk updation of the attendance based on **Batch, Course or Activity**.
 
diff --git a/erpnext/docs/user/manual/en/schools/Attendance/student-leave-application.md b/erpnext/docs/user/manual/en/education/Attendance/student-leave-application.md
similarity index 64%
rename from erpnext/docs/user/manual/en/schools/Attendance/student-leave-application.md
rename to erpnext/docs/user/manual/en/education/Attendance/student-leave-application.md
index 5620bda..e22c6e9 100644
--- a/erpnext/docs/user/manual/en/schools/Attendance/student-leave-application.md
+++ b/erpnext/docs/user/manual/en/education/Attendance/student-leave-application.md
@@ -4,9 +4,9 @@
 
 To create a Student Leave application record, enter the Student and the date for the leave is applied and save.
 
-<img class="screenshot" alt="Student Attendance" src="/docs/assets/img/schools/schedule/student-leave-application.gif">
+<img class="screenshot" alt="Student Attendance" src="/docs/assets/img/education/schedule/student-leave-application.gif">
 
-Incase the student is not attending the school in order to participate or represent school in any event, he/she can be mark as present from the Leave Application itself. 
+Incase the student is not attending the institute in order to participate or represent institute in any event, he/she can be mark as present from the Leave Application itself. 
 
 Once a Leave Application is recorded for a student it will not be recorded in the absent student report as he has applied for a leave. 
 
diff --git a/erpnext/docs/user/manual/en/schools/__init__.py b/erpnext/docs/user/manual/en/education/__init__.py
similarity index 100%
rename from erpnext/docs/user/manual/en/schools/__init__.py
rename to erpnext/docs/user/manual/en/education/__init__.py
diff --git a/erpnext/docs/user/manual/en/schools/admission/__init__.py b/erpnext/docs/user/manual/en/education/admission/__init__.py
similarity index 100%
rename from erpnext/docs/user/manual/en/schools/admission/__init__.py
rename to erpnext/docs/user/manual/en/education/admission/__init__.py
diff --git a/erpnext/docs/user/manual/en/schools/admission/index.md b/erpnext/docs/user/manual/en/education/admission/index.md
similarity index 100%
rename from erpnext/docs/user/manual/en/schools/admission/index.md
rename to erpnext/docs/user/manual/en/education/admission/index.md
diff --git a/erpnext/docs/user/manual/en/schools/admission/index.txt b/erpnext/docs/user/manual/en/education/admission/index.txt
similarity index 100%
rename from erpnext/docs/user/manual/en/schools/admission/index.txt
rename to erpnext/docs/user/manual/en/education/admission/index.txt
diff --git a/erpnext/docs/user/manual/en/schools/admission/program-enrollment-tool.md b/erpnext/docs/user/manual/en/education/admission/program-enrollment-tool.md
similarity index 81%
rename from erpnext/docs/user/manual/en/schools/admission/program-enrollment-tool.md
rename to erpnext/docs/user/manual/en/education/admission/program-enrollment-tool.md
index 2a2fa1e..53d9d9c 100644
--- a/erpnext/docs/user/manual/en/schools/admission/program-enrollment-tool.md
+++ b/erpnext/docs/user/manual/en/education/admission/program-enrollment-tool.md
@@ -7,10 +7,10 @@
 
 1. **Student Applicants** >> List of Student Applicants will be fetched for the selected **Program** and **Academic year**.
 
-<img class="screenshot" alt="Student Applicant Enrollment" src="/docs/assets/img/schools/admission/program-enrollment-tool.gif">
+<img class="screenshot" alt="Student Applicant Enrollment" src="/docs/assets/img/education/admission/program-enrollment-tool.gif">
 
 2. **Program Enrollment** >> You can bulk update the **Program** for the students from one academic year to another in the same **Program** or a new **Program**.
 
-<img class="screenshot" alt="Student Applicant Enrollment" src="/docs/assets/img/schools/admission/program-enrollment-tool01.gif">
+<img class="screenshot" alt="Student Applicant Enrollment" src="/docs/assets/img/education/admission/program-enrollment-tool01.gif">
 
 {next}
\ No newline at end of file
diff --git a/erpnext/docs/user/manual/en/schools/admission/program-enrollment.md b/erpnext/docs/user/manual/en/education/admission/program-enrollment.md
similarity index 91%
rename from erpnext/docs/user/manual/en/schools/admission/program-enrollment.md
rename to erpnext/docs/user/manual/en/education/admission/program-enrollment.md
index cc1308c..0bf16df 100644
--- a/erpnext/docs/user/manual/en/schools/admission/program-enrollment.md
+++ b/erpnext/docs/user/manual/en/education/admission/program-enrollment.md
@@ -4,7 +4,7 @@
 
 Once a student have applied for the **Program** and the application is approved, the program enrollment is done for that student. 
 
-<img class="screenshot" alt="Student Applicant Enrollment" src="/docs/assets/img/schools/admission/program-enrollment.gif">
+<img class="screenshot" alt="Student Applicant Enrollment" src="/docs/assets/img/education/admission/program-enrollment.gif">
 
 - A student can be enrolled in multiple Course for a program in a given academeic year. 
 - Based on the Fee structure selected at the time of enrollment Fee detials are created of the student.
diff --git a/erpnext/docs/user/manual/en/schools/admission/student-applicant.md b/erpnext/docs/user/manual/en/education/admission/student-applicant.md
similarity index 85%
rename from erpnext/docs/user/manual/en/schools/admission/student-applicant.md
rename to erpnext/docs/user/manual/en/education/admission/student-applicant.md
index 22d3709..121844c 100644
--- a/erpnext/docs/user/manual/en/schools/admission/student-applicant.md
+++ b/erpnext/docs/user/manual/en/education/admission/student-applicant.md
@@ -3,7 +3,7 @@
 A Student Applicant record needs to be created when a student applies for a program at your institute.
 You can Approve or Reject a student applicant. By accepting a student applicant you can add them to the student master.
 
-<img class="screenshot" alt="Student Applicant" src="/docs/assets/img/schools/admission/student-applicant.png">
+<img class="screenshot" alt="Student Applicant" src="/docs/assets/img/education/admission/student-applicant.png">
 
 ### Application Status
 
@@ -20,11 +20,11 @@
 ### Student Enrollment
 Once the form is submitted you can either approve or reject the application form.
 
-<img class="screenshot" alt="Student Applicant Enrollment" src="/docs/assets/img/schools/admission/student-application-actions.png">
+<img class="screenshot" alt="Student Applicant Enrollment" src="/docs/assets/img/education/admission/student-application-actions.png">
 
 Once you approve a Student Applicant you can enroll them to a program. When you click the 'Enroll' buttom,
-the system shall create a student against that applicant and redirect you to the [Program Enrollment form](/docs/user/manual/en/schools/student/program-enrollment.html).
+the system shall create a student against that applicant and redirect you to the [Program Enrollment form](/docs/user/manual/en/education/student/program-enrollment.html).
 
-<img class="screenshot" alt="Student Applicant Enrollment" src="/docs/assets/img/schools/admission/student-applicant-enroll.png">
+<img class="screenshot" alt="Student Applicant Enrollment" src="/docs/assets/img/education/admission/student-applicant-enroll.png">
 
 {next}
diff --git a/erpnext/docs/user/manual/en/schools/admission/student_admission.md b/erpnext/docs/user/manual/en/education/admission/student_admission.md
similarity index 89%
rename from erpnext/docs/user/manual/en/schools/admission/student_admission.md
rename to erpnext/docs/user/manual/en/education/admission/student_admission.md
index 7a63fa7..f2b8ef6 100644
--- a/erpnext/docs/user/manual/en/schools/admission/student_admission.md
+++ b/erpnext/docs/user/manual/en/education/admission/student_admission.md
@@ -4,10 +4,10 @@
 
 To create a Student Admission record  go to :
 
-**Schools** >> **Admissions** >> **Student Admission** >>
+**education** >> **Admissions** >> **Student Admission** >>
 
 
-<img class="screenshot" alt="Student Applicant" src="/docs/assets/img/schools/admission/student-admission.gif">
+<img class="screenshot" alt="Student Applicant" src="/docs/assets/img/education/admission/student-admission.gif">
 
 Once an admission record is created, the age eligibility criteria can be determined for the every program. Similarly, you can also determine the application fee and naming series for every student applicant. If you keep the naming series blank then the default naming series will be applied for every student applicant.
 
diff --git a/erpnext/docs/user/manual/en/schools/fees/__init__.py b/erpnext/docs/user/manual/en/education/fees/__init__.py
similarity index 100%
rename from erpnext/docs/user/manual/en/schools/fees/__init__.py
rename to erpnext/docs/user/manual/en/education/fees/__init__.py
diff --git a/erpnext/docs/user/manual/en/schools/fees/fee-category.md b/erpnext/docs/user/manual/en/education/fees/fee-category.md
similarity index 78%
rename from erpnext/docs/user/manual/en/schools/fees/fee-category.md
rename to erpnext/docs/user/manual/en/education/fees/fee-category.md
index fbf43e6..8a4822f 100644
--- a/erpnext/docs/user/manual/en/schools/fees/fee-category.md
+++ b/erpnext/docs/user/manual/en/education/fees/fee-category.md
@@ -2,6 +2,6 @@
 
 List of all different type of fees collected.
 
-<img class="screenshot" alt="Fees Category" src="/docs/assets/img/schools/fees/fee-category.png">
+<img class="screenshot" alt="Fees Category" src="/docs/assets/img/education/fees/fee-category.png">
 
 {next}
\ No newline at end of file
diff --git a/erpnext/docs/user/manual/en/schools/fees/fee-structure.md b/erpnext/docs/user/manual/en/education/fees/fee-structure.md
similarity index 80%
rename from erpnext/docs/user/manual/en/schools/fees/fee-structure.md
rename to erpnext/docs/user/manual/en/education/fees/fee-structure.md
index a1dd9be..b1cc36d 100644
--- a/erpnext/docs/user/manual/en/schools/fees/fee-structure.md
+++ b/erpnext/docs/user/manual/en/education/fees/fee-structure.md
@@ -2,6 +2,6 @@
 
 A Fee Structure is a template that can be used while making fee records.
 
-<img class="screenshot" alt="Fees Structure" src="/docs/assets/img/schools/fees/fee-structure.png">
+<img class="screenshot" alt="Fees Structure" src="/docs/assets/img/education/fees/fee-structure.png">
 
 {next}
\ No newline at end of file
diff --git a/erpnext/docs/user/manual/en/education/fees/fees.md b/erpnext/docs/user/manual/en/education/fees/fees.md
new file mode 100644
index 0000000..5e0c126
--- /dev/null
+++ b/erpnext/docs/user/manual/en/education/fees/fees.md
@@ -0,0 +1,8 @@
+# Fees
+
+Maintain a record of fees collected from students.
+The [Fee Structure](/docs/user/manual/en/education/fees/fee-structure.html) is fetched based on the selected Program and Academic Term.
+
+<img class="screenshot" alt="Fees" src="/docs/assets/img/education/fees/fees.png">
+
+{next}
\ No newline at end of file
diff --git a/erpnext/docs/user/manual/en/schools/fees/index.md b/erpnext/docs/user/manual/en/education/fees/index.md
similarity index 79%
rename from erpnext/docs/user/manual/en/schools/fees/index.md
rename to erpnext/docs/user/manual/en/education/fees/index.md
index c5be5f6..d0ccb94 100644
--- a/erpnext/docs/user/manual/en/schools/fees/index.md
+++ b/erpnext/docs/user/manual/en/education/fees/index.md
@@ -2,7 +2,7 @@
 
 This section contains 'Fee' related documents.
 
-<img class="screenshot" alt="Fees Section" src="/docs/assets/img/schools/fees/fees-section.png">
+<img class="screenshot" alt="Fees Section" src="/docs/assets/img/education/fees/fees-section.png">
 
 ### Topics
 
diff --git a/erpnext/docs/user/manual/en/schools/fees/index.txt b/erpnext/docs/user/manual/en/education/fees/index.txt
similarity index 100%
rename from erpnext/docs/user/manual/en/schools/fees/index.txt
rename to erpnext/docs/user/manual/en/education/fees/index.txt
diff --git a/erpnext/docs/user/manual/en/education/index.md b/erpnext/docs/user/manual/en/education/index.md
new file mode 100644
index 0000000..36c6bbd
--- /dev/null
+++ b/erpnext/docs/user/manual/en/education/index.md
@@ -0,0 +1,8 @@
+# Education
+
+
+The Education Domain in ERPNext is designed to meet requirements of any educational Institute whether that is a school, college or any other private firm. ERPNext provides a centralized system, which can be used to maintain and update all the activities related to an Institution. It will provide a complete package for every funcationality required in any institute like Online Admission, Fees, Attendance, Examination.
+
+<img class="screenshot" alt="Fees Section" src="/docs/assets/img/education/module.png">
+
+{index}
\ No newline at end of file
diff --git a/erpnext/docs/user/manual/en/schools/index.txt b/erpnext/docs/user/manual/en/education/index.txt
similarity index 100%
rename from erpnext/docs/user/manual/en/schools/index.txt
rename to erpnext/docs/user/manual/en/education/index.txt
diff --git a/erpnext/docs/user/manual/en/schools/schedule/__init__.py b/erpnext/docs/user/manual/en/education/schedule/__init__.py
similarity index 100%
rename from erpnext/docs/user/manual/en/schools/schedule/__init__.py
rename to erpnext/docs/user/manual/en/education/schedule/__init__.py
diff --git a/erpnext/docs/user/manual/en/schools/schedule/course-schedule.md b/erpnext/docs/user/manual/en/education/schedule/course-schedule.md
similarity index 84%
rename from erpnext/docs/user/manual/en/schools/schedule/course-schedule.md
rename to erpnext/docs/user/manual/en/education/schedule/course-schedule.md
index 9f7d980..f5134d5 100644
--- a/erpnext/docs/user/manual/en/schools/schedule/course-schedule.md
+++ b/erpnext/docs/user/manual/en/education/schedule/course-schedule.md
@@ -3,13 +3,13 @@
 Course Schedule is the schedule of a session conducted by an Instructor for a particular Course.
 You can see the overall course schedule in the Calendar view.
 
-<img class="screenshot" alt="Course Schedule" src="/docs/assets/img/schools/schedule/course-schedule.png">
+<img class="screenshot" alt="Course Schedule" src="/docs/assets/img/education/schedule/course-schedule.png">
 
 ### Marking Attendance
 
 You can mark attendance for a Student Group against a Course Schedule.
 
-<img class="screenshot" alt="Course Schedule Attendance" src="/docs/assets/img/schools/schedule/course-schedule-att.png">
+<img class="screenshot" alt="Course Schedule Attendance" src="/docs/assets/img/education/schedule/course-schedule-att.png">
 
 - To make attendance, expand the attendance section.
 - Check the students who were present for that session.
@@ -20,6 +20,6 @@
 Once you have marked Attendance against a Course Schedule the Attendance section in the Course Schedule shall be hidden. 
 A View Attendance button shall appear. Click on that button to view all attendance records created against that Course Schedule.
 
-<img class="screenshot" alt="Course Schedule Attendance" src="/docs/assets/img/schools/schedule/course-schedule-att-1.png">
+<img class="screenshot" alt="Course Schedule Attendance" src="/docs/assets/img/education/schedule/course-schedule-att-1.png">
 
 {next}
\ No newline at end of file
diff --git a/erpnext/docs/user/manual/en/schools/schedule/examination.md b/erpnext/docs/user/manual/en/education/schedule/examination.md
similarity index 82%
rename from erpnext/docs/user/manual/en/schools/schedule/examination.md
rename to erpnext/docs/user/manual/en/education/schedule/examination.md
index d167e9c..d21d204 100644
--- a/erpnext/docs/user/manual/en/schools/schedule/examination.md
+++ b/erpnext/docs/user/manual/en/education/schedule/examination.md
@@ -2,7 +2,7 @@
 
 The Examination record can be used to track the exam schedule and the results of that exam.
 
-<img class="screenshot" alt="Examination" src="/docs/assets/img/schools/schedule/examination.png">
+<img class="screenshot" alt="Examination" src="/docs/assets/img/education/schedule/examination.png">
 
 
 {next}
\ No newline at end of file
diff --git a/erpnext/docs/user/manual/en/schools/schedule/index.md b/erpnext/docs/user/manual/en/education/schedule/index.md
similarity index 67%
rename from erpnext/docs/user/manual/en/schools/schedule/index.md
rename to erpnext/docs/user/manual/en/education/schedule/index.md
index 57e578b..247b0b8 100644
--- a/erpnext/docs/user/manual/en/schools/schedule/index.md
+++ b/erpnext/docs/user/manual/en/education/schedule/index.md
@@ -1,6 +1,6 @@
 # Schedule
 
-<img class="screenshot" alt="Schedule Section" src="/docs/assets/img/schools/schedule/schedule-section.png">
+<img class="screenshot" alt="Schedule Section" src="/docs/assets/img/education/schedule/schedule-section.png">
 
 ### Topics
 
diff --git a/erpnext/docs/user/manual/en/schools/schedule/index.txt b/erpnext/docs/user/manual/en/education/schedule/index.txt
similarity index 100%
rename from erpnext/docs/user/manual/en/schools/schedule/index.txt
rename to erpnext/docs/user/manual/en/education/schedule/index.txt
diff --git a/erpnext/docs/user/manual/en/schools/schedule/scheduling-tool.md b/erpnext/docs/user/manual/en/education/schedule/scheduling-tool.md
similarity index 95%
rename from erpnext/docs/user/manual/en/schools/schedule/scheduling-tool.md
rename to erpnext/docs/user/manual/en/education/schedule/scheduling-tool.md
index 9e13d6d..08a7fa9 100644
--- a/erpnext/docs/user/manual/en/schools/schedule/scheduling-tool.md
+++ b/erpnext/docs/user/manual/en/education/schedule/scheduling-tool.md
@@ -2,7 +2,7 @@
 
 This tool can be used to create 'Course Schedules'. 
 
-<img class="screenshot" alt="Scheduling Tool" src="/docs/assets/img/schools/schedule/scheduling-tool.png">
+<img class="screenshot" alt="Scheduling Tool" src="/docs/assets/img/education/schedule/scheduling-tool.png">
 
 ### Creating Course Schedules
 
diff --git a/erpnext/docs/user/manual/en/schools/setup/__init__.py b/erpnext/docs/user/manual/en/education/setup/__init__.py
similarity index 100%
rename from erpnext/docs/user/manual/en/schools/setup/__init__.py
rename to erpnext/docs/user/manual/en/education/setup/__init__.py
diff --git a/erpnext/docs/user/manual/en/schools/setup/academic-term.md b/erpnext/docs/user/manual/en/education/setup/academic-term.md
similarity index 93%
rename from erpnext/docs/user/manual/en/schools/setup/academic-term.md
rename to erpnext/docs/user/manual/en/education/setup/academic-term.md
index b52bea7..d264dca 100644
--- a/erpnext/docs/user/manual/en/schools/setup/academic-term.md
+++ b/erpnext/docs/user/manual/en/education/setup/academic-term.md
@@ -4,7 +4,7 @@
 
 The **Academic term** form in ERPNext enables you to create academic terms within in a year. Based on the term schedule enter the start and end date for the schedule and generate the term for a Academic year.
 
-<img class="screenshot" alt="Academic Term" src="/docs/assets/img/schools/setup/academic-term.png">
+<img class="screenshot" alt="Academic Term" src="/docs/assets/img/education/setup/academic-term.png">
 
 
 {next}
\ No newline at end of file
diff --git a/erpnext/docs/user/manual/en/schools/setup/academic-year.md b/erpnext/docs/user/manual/en/education/setup/academic-year.md
similarity index 62%
rename from erpnext/docs/user/manual/en/schools/setup/academic-year.md
rename to erpnext/docs/user/manual/en/education/setup/academic-year.md
index 4fc5f92..c9ea521 100644
--- a/erpnext/docs/user/manual/en/schools/setup/academic-year.md
+++ b/erpnext/docs/user/manual/en/education/setup/academic-year.md
@@ -1,10 +1,10 @@
 # Academic Year
 
-An academic year is a period of time which schools, colleges and universities use to measure a quantity of study.
+An academic year is a period of time which education, colleges and universities use to measure a quantity of study.
 
 The **Academic year** form have the Start and End date for the Academic year.
 
-<img class="screenshot" alt="Academic Year" src="/docs/assets/img/schools/setup/academic-year.png">
+<img class="screenshot" alt="Academic Year" src="/docs/assets/img/education/setup/academic-year.png">
 
 **Student group** link is given to view or add the respective groups to the Academic year.
 
diff --git a/erpnext/docs/user/manual/en/schools/setup/course.md b/erpnext/docs/user/manual/en/education/setup/course.md
similarity index 79%
rename from erpnext/docs/user/manual/en/schools/setup/course.md
rename to erpnext/docs/user/manual/en/education/setup/course.md
index dc10ed5..0d6e5ac 100644
--- a/erpnext/docs/user/manual/en/schools/setup/course.md
+++ b/erpnext/docs/user/manual/en/education/setup/course.md
@@ -4,11 +4,11 @@
 
 To create a **Course** enter the Course name and Code. Code for the course should be unique for every course. You can also link the department under which the course is conducted.
 
-<img class="screenshot" alt="Course" src="/docs/assets/img/schools/setup/course.png">
+<img class="screenshot" alt="Course" src="/docs/assets/img/education/setup/course.png">
 
 Once a **Course** is created, a course schedule can defined for the same.
 
-<img class="screenshot" alt="Course" src="/docs/assets/img/schools/setup/Course.gif">
+<img class="screenshot" alt="Course" src="/docs/assets/img/education/setup/Course.gif">
 
 The Course form is further linked to **Program, Student Group and Assessment Plan** doctypes. The links allow to view/create the related documents for a **Course**.
 
diff --git a/erpnext/docs/user/manual/en/education/setup/index.md b/erpnext/docs/user/manual/en/education/setup/index.md
new file mode 100644
index 0000000..1062c3a
--- /dev/null
+++ b/erpnext/docs/user/manual/en/education/setup/index.md
@@ -0,0 +1,9 @@
+# Setup
+
+The Setup section of education module provides facility to make some basic configuration. Below are doctypes for basic configuration.
+
+<img class="screenshot" alt="Setup Section" src="/docs/assets/img/education/setup/setup-section.png">
+
+### Topics
+
+{index}
\ No newline at end of file
diff --git a/erpnext/docs/user/manual/en/schools/setup/index.txt b/erpnext/docs/user/manual/en/education/setup/index.txt
similarity index 83%
rename from erpnext/docs/user/manual/en/schools/setup/index.txt
rename to erpnext/docs/user/manual/en/education/setup/index.txt
index 8fb9bb2..9f88c5d 100644
--- a/erpnext/docs/user/manual/en/schools/setup/index.txt
+++ b/erpnext/docs/user/manual/en/education/setup/index.txt
@@ -6,4 +6,4 @@
 student-batch-name
 academic-term
 academic-year
-school-settings
\ No newline at end of file
+education-settings
\ No newline at end of file
diff --git a/erpnext/docs/user/manual/en/schools/setup/instructor.md b/erpnext/docs/user/manual/en/education/setup/instructor.md
similarity index 66%
rename from erpnext/docs/user/manual/en/schools/setup/instructor.md
rename to erpnext/docs/user/manual/en/education/setup/instructor.md
index 6150f02..2b53ce1 100644
--- a/erpnext/docs/user/manual/en/schools/setup/instructor.md
+++ b/erpnext/docs/user/manual/en/education/setup/instructor.md
@@ -4,14 +4,14 @@
 
 You can create an Instructor and link it to the Employee master and a Departmemt.
 
-<img class="screenshot" alt="Instructor" src="/docs/assets/img/schools/setup/instructor.png">
+<img class="screenshot" alt="Instructor" src="/docs/assets/img/education/setup/instructor.png">
 
 An **Instructor** is further linked to a **Course Schedule**, where you can define the schedule for a **Course** for a give date and **Room no**.
 
-<img class="screenshot" alt="Instructor" src="/docs/assets/img/schools/setup/instructor.gif">
+<img class="screenshot" alt="Instructor" src="/docs/assets/img/education/setup/instructor.gif">
 It is also linked to **Student group** where an **Instructor** is assigned to the Student group.
 
-<img class="screenshot" alt="Instructor" src="/docs/assets/img/schools/setup/student-group-instructor.gif">
+<img class="screenshot" alt="Instructor" src="/docs/assets/img/education/setup/student-group-instructor.gif">
 
 An **Instructor** is also linked to an **Assesment Plan** for a Student group. The Instructor can be an Examiner or the supervisor for the assesment. 
 
diff --git a/erpnext/docs/user/manual/en/schools/setup/program.md b/erpnext/docs/user/manual/en/education/setup/program.md
similarity index 71%
rename from erpnext/docs/user/manual/en/schools/setup/program.md
rename to erpnext/docs/user/manual/en/education/setup/program.md
index be10166..25e390e 100644
--- a/erpnext/docs/user/manual/en/schools/setup/program.md
+++ b/erpnext/docs/user/manual/en/education/setup/program.md
@@ -4,15 +4,15 @@
 
 To create a Program go to :
 
-###Schools >> Setup >> Program >> New Program
+###education >> Setup >> Program >> New Program
 
 Enter a unique code for every **Program**. You can also link the **Program** to the department under which it is conducted.
 
-<img class="screenshot" alt="Program" src="/docs/assets/img/schools/setup/program.png">
+<img class="screenshot" alt="Program" src="/docs/assets/img/education/setup/program.png">
 
 Add the relevant Course and the Fee details for a program. 
 
-<img class="screenshot" alt="Program" src="/docs/assets/img/schools/setup/course-fee-program.png">
+<img class="screenshot" alt="Program" src="/docs/assets/img/education/setup/course-fee-program.png">
 
 The Program Doctype is further linked to the **Student applicant**, **Program enrollment, Student group, Fee structre and Fee**. The links allow to view or create the related document for a Program.
 
diff --git a/erpnext/docs/user/manual/en/schools/setup/room.md b/erpnext/docs/user/manual/en/education/setup/room.md
similarity index 72%
rename from erpnext/docs/user/manual/en/schools/setup/room.md
rename to erpnext/docs/user/manual/en/education/setup/room.md
index 43ddde9..6a1f32e 100644
--- a/erpnext/docs/user/manual/en/schools/setup/room.md
+++ b/erpnext/docs/user/manual/en/education/setup/room.md
@@ -4,14 +4,14 @@
 
 The Room doctype allows you to record the room number and the seating capacity for a classroom. Once a room is created Course schedule link is provided in the Room doctype to view or add the course schedule for the classroom. 
 
-<img class="screenshot" alt="Room" src="/docs/assets/img/schools/setup/room.png">
+<img class="screenshot" alt="Room" src="/docs/assets/img/education/setup/room.png">
 
 The course schedule validate the availability of the Room number and an alert message is shown if there is an overlap for the Room number for a given time slot.
 
-<img class="screenshot" alt="Room" src="/docs/assets/img/schools/setup/Course-schedule-error.png">
+<img class="screenshot" alt="Room" src="/docs/assets/img/education/setup/Course-schedule-error.png">
 
 The Room number is further linked to the Assesment plan. It validates the availability of examination room for the assessment to be held for a given date and time.
 
-<img class="screenshot" alt="Room" src="/docs/assets/img/schools/setup/Room-Assesment-plan.png">
+<img class="screenshot" alt="Room" src="/docs/assets/img/education/setup/Room-Assesment-plan.png">
 
 {next}
\ No newline at end of file
diff --git a/erpnext/docs/user/manual/en/education/setup/school-settings.md b/erpnext/docs/user/manual/en/education/setup/school-settings.md
new file mode 100644
index 0000000..44f9c44
--- /dev/null
+++ b/erpnext/docs/user/manual/en/education/setup/school-settings.md
@@ -0,0 +1,15 @@
+# Education Settings
+
+The Education Settings page allow you to setup basic settings like **Academic Year and Term** for the educational setup. 
+
+<img class="screenshot" alt="Student" src="/docs/assets/img/education/student/education.png">
+
+The checkbox to Validate Batch for Students in Student Group enables the Student Batch validation for every Student from the Program Enrollment for the **Batch** based on **Student Group** 
+
+<img class="screenshot" alt="Student" src="/docs/assets/img/education/student/student-batch-validation.gif">
+
+You can enable the validation of Course for every Student from the enrolled Courses in Program Enrollment,for Course based Student Group by checking the settings for **Validate Enrolled Course for Students in Student Group**
+
+<img class="screenshot" alt="Student" src="/docs/assets/img/education/student/student-course-validation.gif">
+
+{next}
\ No newline at end of file
diff --git a/erpnext/docs/user/manual/en/schools/setup/student-batch-name.md b/erpnext/docs/user/manual/en/education/setup/student-batch-name.md
similarity index 80%
rename from erpnext/docs/user/manual/en/schools/setup/student-batch-name.md
rename to erpnext/docs/user/manual/en/education/setup/student-batch-name.md
index 056f910..3b5ad41 100644
--- a/erpnext/docs/user/manual/en/schools/setup/student-batch-name.md
+++ b/erpnext/docs/user/manual/en/education/setup/student-batch-name.md
@@ -2,7 +2,7 @@
 
 Student batch is a collection of students from Student Groups. **Student batch** allows you to create **Student Group** based on a batch. When a student is enrolled for a **Program**, the Student batch is selected to enroll the student for the given Program and batch 
 
-<img class="screenshot" alt="Student" src="/docs/assets/img/schools/student/student-batch.gif">
+<img class="screenshot" alt="Student" src="/docs/assets/img/education/student/student-batch.gif">
 
 You can also get a **Student Batch-Wise Attendance** report to view the number of student present from the Batch.
 
diff --git a/erpnext/docs/user/manual/en/schools/setup/student-category.md b/erpnext/docs/user/manual/en/education/setup/student-category.md
similarity index 79%
rename from erpnext/docs/user/manual/en/schools/setup/student-category.md
rename to erpnext/docs/user/manual/en/education/setup/student-category.md
index 0d76927..cb5cbea 100644
--- a/erpnext/docs/user/manual/en/schools/setup/student-category.md
+++ b/erpnext/docs/user/manual/en/education/setup/student-category.md
@@ -6,7 +6,7 @@
 
 We can create new student category by adding a name and save it
 
-<img class="screenshot" alt="Student" src="/docs/assets/img/schools/student/student-category.gif">
+<img class="screenshot" alt="Student" src="/docs/assets/img/education/student/student-category.gif">
 
 
 {next}
\ No newline at end of file
diff --git a/erpnext/docs/user/manual/en/schools/student/__init__.py b/erpnext/docs/user/manual/en/education/student/__init__.py
similarity index 100%
rename from erpnext/docs/user/manual/en/schools/student/__init__.py
rename to erpnext/docs/user/manual/en/education/student/__init__.py
diff --git a/erpnext/docs/user/manual/en/schools/student/guardian.md b/erpnext/docs/user/manual/en/education/student/guardian.md
similarity index 70%
rename from erpnext/docs/user/manual/en/schools/student/guardian.md
rename to erpnext/docs/user/manual/en/education/student/guardian.md
index 7bbdbc2..ca34e8b 100644
--- a/erpnext/docs/user/manual/en/schools/student/guardian.md
+++ b/erpnext/docs/user/manual/en/education/student/guardian.md
@@ -2,7 +2,7 @@
 
 The Guardian doctype allows you to record the guardian details for a **Student**.
 
-<img class="screenshot" alt="Student" src="/docs/assets/img/schools/student/guardian.png">
+<img class="screenshot" alt="Student" src="/docs/assets/img/education/student/guardian.png">
 
 The email id added in the **Guardian** detail can be linked to a email group for sending newsletter or announcements.
 
diff --git a/erpnext/docs/user/manual/en/schools/student/index.md b/erpnext/docs/user/manual/en/education/student/index.md
similarity index 100%
rename from erpnext/docs/user/manual/en/schools/student/index.md
rename to erpnext/docs/user/manual/en/education/student/index.md
diff --git a/erpnext/docs/user/manual/en/schools/student/index.txt b/erpnext/docs/user/manual/en/education/student/index.txt
similarity index 100%
rename from erpnext/docs/user/manual/en/schools/student/index.txt
rename to erpnext/docs/user/manual/en/education/student/index.txt
diff --git a/erpnext/docs/user/manual/en/schools/setup/student-batch-name.md b/erpnext/docs/user/manual/en/education/student/student-batch.md
similarity index 80%
copy from erpnext/docs/user/manual/en/schools/setup/student-batch-name.md
copy to erpnext/docs/user/manual/en/education/student/student-batch.md
index 056f910..3b5ad41 100644
--- a/erpnext/docs/user/manual/en/schools/setup/student-batch-name.md
+++ b/erpnext/docs/user/manual/en/education/student/student-batch.md
@@ -2,7 +2,7 @@
 
 Student batch is a collection of students from Student Groups. **Student batch** allows you to create **Student Group** based on a batch. When a student is enrolled for a **Program**, the Student batch is selected to enroll the student for the given Program and batch 
 
-<img class="screenshot" alt="Student" src="/docs/assets/img/schools/student/student-batch.gif">
+<img class="screenshot" alt="Student" src="/docs/assets/img/education/student/student-batch.gif">
 
 You can also get a **Student Batch-Wise Attendance** report to view the number of student present from the Batch.
 
diff --git a/erpnext/docs/user/manual/en/schools/student/student-group-creation-tool.md b/erpnext/docs/user/manual/en/education/student/student-group-creation-tool.md
similarity index 83%
rename from erpnext/docs/user/manual/en/schools/student/student-group-creation-tool.md
rename to erpnext/docs/user/manual/en/education/student/student-group-creation-tool.md
index 1cd9b1e..aeedd97 100644
--- a/erpnext/docs/user/manual/en/schools/student/student-group-creation-tool.md
+++ b/erpnext/docs/user/manual/en/education/student/student-group-creation-tool.md
@@ -4,11 +4,11 @@
 
 To create Student group using this tool go to 
 
-##Schools >>Student >> Student Group creation tool
+##education >>Student >> Student Group creation tool
 
 Select the **Academic Term** and the **Program** for which a student group is to be created. 
 
-<img class="screenshot" alt="Student Group Creation Tool" src="/docs/assets/img/schools/student/student-group-creation-tool.gif">
+<img class="screenshot" alt="Student Group Creation Tool" src="/docs/assets/img/education/student/student-group-creation-tool.gif">
 
 By default the student group is created based on the **Course** only. The check box for "Separate course based Group for every Batch" allows you to create batchwise Student groups for a course.
 
diff --git a/erpnext/docs/user/manual/en/schools/student/student-group.md b/erpnext/docs/user/manual/en/education/student/student-group.md
similarity index 89%
rename from erpnext/docs/user/manual/en/schools/student/student-group.md
rename to erpnext/docs/user/manual/en/education/student/student-group.md
index cf3f82c..467fb3e 100644
--- a/erpnext/docs/user/manual/en/schools/student/student-group.md
+++ b/erpnext/docs/user/manual/en/education/student/student-group.md
@@ -6,15 +6,15 @@
 
 To create a Student Group go to:
 
-Schools >> Student >> New Student Group 
+education >> Student >> New Student Group 
 
-<img class="screenshot" alt="Student Group" src="/docs/assets/img/schools/student/Student-group.gif">
+<img class="screenshot" alt="Student Group" src="/docs/assets/img/education/student/Student-group.gif">
 
 To create a Student group based on **Batch**, select the **Progam** and **Batch**, where as to create a Student group based on **Course**, you will only have to select the Course Code. Creating a student group based on activity allows you to group of student for events and activities happening in the institute. 
 
 Once a student group is created you can mark attendance for the group. 
 
-<img class="screenshot" alt="Student Group" src="/docs/assets/img/schools/student/student-group-attendance.gif">
+<img class="screenshot" alt="Student Group" src="/docs/assets/img/education/student/student-group-attendance.gif">
 
 You can also update the **Email Group** for the Student Group. Click on Update Email Group to add all the email ids of the gaurdians in the respective email group and **Newsletter** can be created and sent to the Email group.
 
diff --git a/erpnext/docs/user/manual/en/schools/student/student-log.md b/erpnext/docs/user/manual/en/education/student/student-log.md
similarity index 72%
rename from erpnext/docs/user/manual/en/schools/student/student-log.md
rename to erpnext/docs/user/manual/en/education/student/student-log.md
index 160e39f..5c113e4 100644
--- a/erpnext/docs/user/manual/en/schools/student/student-log.md
+++ b/erpnext/docs/user/manual/en/education/student/student-log.md
@@ -4,6 +4,6 @@
 You can make a note of student activities using Student log.
 Logs can be categorised as 'General', 'Academic', 'Medical' or 'Achievement'
 
-<img class="screenshot" alt="Student" src="/docs/assets/img/schools/student/student-log.png">
+<img class="screenshot" alt="Student" src="/docs/assets/img/education/student/student-log.png">
 
 {next}
diff --git a/erpnext/docs/user/manual/en/schools/student/student.md b/erpnext/docs/user/manual/en/education/student/student.md
similarity index 84%
rename from erpnext/docs/user/manual/en/schools/student/student.md
rename to erpnext/docs/user/manual/en/education/student/student.md
index 09e4471..fce5d7b 100644
--- a/erpnext/docs/user/manual/en/schools/student/student.md
+++ b/erpnext/docs/user/manual/en/education/student/student.md
@@ -3,7 +3,7 @@
 A Student is a person who has enrolled at your institute and you have accepted their application.
 The Student doctype maintains detials like personal information, date of birth, address etc. It also records the **Guardian** and sibling details. 
 
-<img class="screenshot" alt="Student" src="/docs/assets/img/schools/student/student.png">
+<img class="screenshot" alt="Student" src="/docs/assets/img/education/student/student.png">
 The student is enrolled in a **Program** when the application is approved. Once the enrollement is done the **Student Applicant** status is update to Admitted.
 
 You can view every doctype created for a particular student. Eg : Fees, Student Group, etc
diff --git a/erpnext/docs/user/manual/en/index.txt b/erpnext/docs/user/manual/en/index.txt
index 712ab8e..34bb24e 100644
--- a/erpnext/docs/user/manual/en/index.txt
+++ b/erpnext/docs/user/manual/en/index.txt
@@ -15,3 +15,4 @@
 using-erpnext
 regional
 customize-erpnext
+education
diff --git a/erpnext/docs/user/manual/en/schools/fees/fees.md b/erpnext/docs/user/manual/en/schools/fees/fees.md
deleted file mode 100644
index f17720c..0000000
--- a/erpnext/docs/user/manual/en/schools/fees/fees.md
+++ /dev/null
@@ -1,8 +0,0 @@
-# Fees
-
-Maintain a record of fees collected from students.
-The [Fee Structure](/docs/user/manual/en/schools/fees/fee-structure.html) is fetched based on the selected Program and Academic Term.
-
-<img class="screenshot" alt="Fees" src="/docs/assets/img/schools/fees/fees.png">
-
-{next}
\ No newline at end of file
diff --git a/erpnext/docs/user/manual/en/schools/index.md b/erpnext/docs/user/manual/en/schools/index.md
deleted file mode 100644
index d317d39..0000000
--- a/erpnext/docs/user/manual/en/schools/index.md
+++ /dev/null
@@ -1,8 +0,0 @@
-# Schools
-
-
-The School Modules in ERPNext is designed to meet requirements of Schools, Colleges & Educational Institutes. This is a centralized system, which maintains and updates all the activities related to an Institution. This will ease the process of each and every aspect of a School, be it Students, Admission, Examination and Fee.
-
-<img class="screenshot" alt="Fees Section" src="/docs/assets/img/schools/module.png">
-
-{index}
\ No newline at end of file
diff --git a/erpnext/docs/user/manual/en/schools/setup/index.md b/erpnext/docs/user/manual/en/schools/setup/index.md
deleted file mode 100644
index 4e09152..0000000
--- a/erpnext/docs/user/manual/en/schools/setup/index.md
+++ /dev/null
@@ -1,9 +0,0 @@
-# Setup
-
-The Setup section of Schools module provides facility to make some basic configuration. Below are doctypes for basic configuration.
-
-<img class="screenshot" alt="Setup Section" src="/docs/assets/img/schools/setup/setup-section.png">
-
-### Topics
-
-{index}
\ No newline at end of file
diff --git a/erpnext/docs/user/manual/en/schools/setup/school-settings.md b/erpnext/docs/user/manual/en/schools/setup/school-settings.md
deleted file mode 100644
index ce9e914..0000000
--- a/erpnext/docs/user/manual/en/schools/setup/school-settings.md
+++ /dev/null
@@ -1,15 +0,0 @@
-#School Settings
-
-The Schools settings page allow you to setup basic settings like **Academic Year and Term** for the Schools setup. 
-
-<img class="screenshot" alt="Student" src="/docs/assets/img/schools/student/schools.png">
-
-The checkbox to Validate Batch for Students in Student Group enables the Student Batch validation for every Student from the Program Enrollment for the **Batch** based on **Student Group** 
-
-<img class="screenshot" alt="Student" src="/docs/assets/img/schools/student/student-batch-validation.gif">
-
-You can enable the validation of Course for every Student from the enrolled Courses in Program Enrollment,for Course based Student Group by checking the settings for **Validate Enrolled Course for Students in Student Group**
-
-<img class="screenshot" alt="Student" src="/docs/assets/img/schools/student/student-course-validation.gif">
-
-{next}
\ No newline at end of file
diff --git a/erpnext/docs/user/manual/en/schools/student/student-batch.md b/erpnext/docs/user/manual/en/schools/student/student-batch.md
deleted file mode 100644
index 056f910..0000000
--- a/erpnext/docs/user/manual/en/schools/student/student-batch.md
+++ /dev/null
@@ -1,10 +0,0 @@
-# Student Batch
-
-Student batch is a collection of students from Student Groups. **Student batch** allows you to create **Student Group** based on a batch. When a student is enrolled for a **Program**, the Student batch is selected to enroll the student for the given Program and batch 
-
-<img class="screenshot" alt="Student" src="/docs/assets/img/schools/student/student-batch.gif">
-
-You can also get a **Student Batch-Wise Attendance** report to view the number of student present from the Batch.
-
-
-{next}
diff --git a/erpnext/docs/user/manual/es/schools/Assessment/__init__.py b/erpnext/docs/user/manual/es/education/Assessment/__init__.py
similarity index 100%
rename from erpnext/docs/user/manual/es/schools/Assessment/__init__.py
rename to erpnext/docs/user/manual/es/education/Assessment/__init__.py
diff --git a/erpnext/docs/user/manual/es/schools/Assessment/assessment_criteria.md b/erpnext/docs/user/manual/es/education/Assessment/assessment_criteria.md
similarity index 85%
rename from erpnext/docs/user/manual/es/schools/Assessment/assessment_criteria.md
rename to erpnext/docs/user/manual/es/education/Assessment/assessment_criteria.md
index 92f338f..31e710a 100644
--- a/erpnext/docs/user/manual/es/schools/Assessment/assessment_criteria.md
+++ b/erpnext/docs/user/manual/es/education/Assessment/assessment_criteria.md
@@ -2,12 +2,12 @@
 
 Criterios de evaluación es el parámetro basado en el que se evalúa el estudiante.
 
-<img class="screenshot" alt="Assessment Criteria" src="/docs/assets/img/schools/assessment/assessment-criteria.png">
+<img class="screenshot" alt="Assessment Criteria" src="/docs/assets/img/education/assessment/assessment-criteria.png">
 
 Después de la evaluación para un curso, las calificaciones obtenidas se ingresan en base a los criterios de evaluación. Por ejemplo, si la evaluación se llevó a cabo para el tema de la ciencia, entonces usted puede evaluar al estudiante en ciencia en varios criterios como la escritura, prácticas, presentación, etc
 
 Los Criterios de Evaluación se usan al programar el Plan de Evaluación para el Grupo de Estudiantes y el Curso.
 
-<img class="screenshot" alt="Assessment Plan Criteria" src="/docs/assets/img/schools/assessment/assessment-plan-criteria.png">
+<img class="screenshot" alt="Assessment Plan Criteria" src="/docs/assets/img/education/assessment/assessment-plan-criteria.png">
 
 {next}
diff --git a/erpnext/docs/user/manual/es/schools/Assessment/assessment_group.md b/erpnext/docs/user/manual/es/education/Assessment/assessment_group.md
similarity index 82%
rename from erpnext/docs/user/manual/es/schools/Assessment/assessment_group.md
rename to erpnext/docs/user/manual/es/education/Assessment/assessment_group.md
index 7102888..aaabda1 100644
--- a/erpnext/docs/user/manual/es/schools/Assessment/assessment_group.md
+++ b/erpnext/docs/user/manual/es/education/Assessment/assessment_group.md
@@ -4,10 +4,10 @@
 
 Por ejemplo, si realiza dos evaluaciones en un año académico, configure el Grupo de evaluación de la siguiente manera.
 
-<img class="screenshot" alt="Assessment Group Term" src="/docs/assets/img/schools/assessment/assessment-group-term.png">
+<img class="screenshot" alt="Assessment Group Term" src="/docs/assets/img/education/assessment/assessment-group-term.png">
 
 En la misma línea, también puede definir varios Grupo de Evaluación basado sobre la evaluación llevada a cabo en su instituto.
 
-<img class="screenshot" alt="Assessment Group Term" src="/docs/assets/img/schools/assessment/assessment-group-details.png">
+<img class="screenshot" alt="Assessment Group Term" src="/docs/assets/img/education/assessment/assessment-group-details.png">
 
 {next}
diff --git a/erpnext/docs/user/manual/es/schools/Assessment/assessment_plan.md b/erpnext/docs/user/manual/es/education/Assessment/assessment_plan.md
similarity index 84%
rename from erpnext/docs/user/manual/es/schools/Assessment/assessment_plan.md
rename to erpnext/docs/user/manual/es/education/Assessment/assessment_plan.md
index 9d66c21..5661892 100644
--- a/erpnext/docs/user/manual/es/schools/Assessment/assessment_plan.md
+++ b/erpnext/docs/user/manual/es/education/Assessment/assessment_plan.md
@@ -10,10 +10,10 @@
 
 4. Examinador y Supervisor
 
-<img class="screenshot" alt="Assessment Plan Details" src="/docs/assets/img/schools/assessment/assessment-plan-details.png">
+<img class="screenshot" alt="Assessment Plan Details" src="/docs/assets/img/education/assessment/assessment-plan-details.png">
 
 5. Los Criterios de Evaluación son la lista de criterios basados ​​en que cada estudiante en será evaluado y los grados serán asignados.
 
-<img class="screenshot" alt="Assessment Plan Criteria" src="/docs/assets/img/schools/assessment/assessment-plan-criteria.png">
+<img class="screenshot" alt="Assessment Plan Criteria" src="/docs/assets/img/education/assessment/assessment-plan-criteria.png">
 
 {next}
diff --git a/erpnext/docs/user/manual/es/schools/Assessment/assessment_result.md b/erpnext/docs/user/manual/es/education/Assessment/assessment_result.md
similarity index 75%
rename from erpnext/docs/user/manual/es/schools/Assessment/assessment_result.md
rename to erpnext/docs/user/manual/es/education/Assessment/assessment_result.md
index 2d94097..67a6f9a 100644
--- a/erpnext/docs/user/manual/es/schools/Assessment/assessment_result.md
+++ b/erpnext/docs/user/manual/es/education/Assessment/assessment_result.md
@@ -1,7 +1,7 @@
 #Resultados de Evaluación
 
-El resultado de la evaluación es un registro de las calificaciones obtenidas por el estudiante para una evaluación específica. El resultado de la evaluación se crea en el backend en base a los puntos en [Herramienta de Resultados de Evaluación](/docs/user/manual/es/schools/assessment/assessment_result_tool.html).
+El resultado de la evaluación es un registro de las calificaciones obtenidas por el estudiante para una evaluación específica. El resultado de la evaluación se crea en el backend en base a los puntos en [Herramienta de Resultados de Evaluación](/docs/user/manual/es/education/assessment/assessment_result_tool.html).
 
-<img class="screenshot" alt="Assessment Result" src="/docs/assets/img/schools/assessment/assessment-result.png">
+<img class="screenshot" alt="Assessment Result" src="/docs/assets/img/education/assessment/assessment-result.png">
 
 {next}
diff --git a/erpnext/docs/user/manual/es/schools/Assessment/assessment_result_tool.md b/erpnext/docs/user/manual/es/education/Assessment/assessment_result_tool.md
similarity index 92%
rename from erpnext/docs/user/manual/es/schools/Assessment/assessment_result_tool.md
rename to erpnext/docs/user/manual/es/education/Assessment/assessment_result_tool.md
index 70e4ee3..a6a44e5 100644
--- a/erpnext/docs/user/manual/es/schools/Assessment/assessment_result_tool.md
+++ b/erpnext/docs/user/manual/es/education/Assessment/assessment_result_tool.md
@@ -3,7 +3,7 @@
 
 Herramienta de resultados de evaluación le ayuda a ingresar las calificaciones obtenidas por los estudiantes para un curso específico. En esta herramienta, basada en el plan de evaluación, todos los estudiantes van a ser filtrados dentro de la herramienta de resultados de la evaluación. También, Columnas para los Criterios de Evaluación serán donde las calificaciones ganadas pueden ser ingresadas para cada Estudiante.
 
-<img class="screenshot" alt="Assessment Result Tool" src="/docs/assets/img/schools/assessment/assessment-result-tool.png">
+<img class="screenshot" alt="Assessment Result Tool" src="/docs/assets/img/education/assessment/assessment-result-tool.png">
 
 A medida que vaya introduciendo las notas para un Estudiante y cambie al siguiente alumno, en el backend, el registro de Resultados del Estudiante se creará automáticamente para ese Estudiante.
 
diff --git a/erpnext/docs/user/manual/es/schools/Assessment/grading_scale.md b/erpnext/docs/user/manual/es/education/Assessment/grading_scale.md
similarity index 87%
rename from erpnext/docs/user/manual/es/schools/Assessment/grading_scale.md
rename to erpnext/docs/user/manual/es/education/Assessment/grading_scale.md
index 9107f92..bf362b4 100644
--- a/erpnext/docs/user/manual/es/schools/Assessment/grading_scale.md
+++ b/erpnext/docs/user/manual/es/education/Assessment/grading_scale.md
@@ -2,6 +2,6 @@
 
 En la escala de calificación, puedes definir varios grados y límites para los estudiantes. Basado en la calificación obtenida por el estudiante en la evaluación, el grado (Grade) será asignado.
 
-<img class="screenshot" alt="Grading Scale" src="/docs/assets/img/schools/assessment/grading-scale.png">
+<img class="screenshot" alt="Grading Scale" src="/docs/assets/img/education/assessment/grading-scale.png">
 
 {next}
diff --git a/erpnext/docs/user/manual/es/schools/Assessment/index.md b/erpnext/docs/user/manual/es/education/Assessment/index.md
similarity index 100%
rename from erpnext/docs/user/manual/es/schools/Assessment/index.md
rename to erpnext/docs/user/manual/es/education/Assessment/index.md
diff --git a/erpnext/docs/user/manual/es/schools/Assessment/index.txt b/erpnext/docs/user/manual/es/education/Assessment/index.txt
similarity index 100%
rename from erpnext/docs/user/manual/es/schools/Assessment/index.txt
rename to erpnext/docs/user/manual/es/education/Assessment/index.txt
diff --git a/erpnext/docs/user/manual/es/schools/__init__.py b/erpnext/docs/user/manual/es/education/__init__.py
similarity index 100%
rename from erpnext/docs/user/manual/es/schools/__init__.py
rename to erpnext/docs/user/manual/es/education/__init__.py
diff --git a/erpnext/docs/user/manual/es/schools/admission/__init__.py b/erpnext/docs/user/manual/es/education/admission/__init__.py
similarity index 100%
rename from erpnext/docs/user/manual/es/schools/admission/__init__.py
rename to erpnext/docs/user/manual/es/education/admission/__init__.py
diff --git a/erpnext/docs/user/manual/es/schools/admission/index.md b/erpnext/docs/user/manual/es/education/admission/index.md
similarity index 100%
rename from erpnext/docs/user/manual/es/schools/admission/index.md
rename to erpnext/docs/user/manual/es/education/admission/index.md
diff --git a/erpnext/docs/user/manual/es/schools/admission/index.txt b/erpnext/docs/user/manual/es/education/admission/index.txt
similarity index 100%
rename from erpnext/docs/user/manual/es/schools/admission/index.txt
rename to erpnext/docs/user/manual/es/education/admission/index.txt
diff --git a/erpnext/docs/user/manual/es/schools/admission/program-enrollment.md b/erpnext/docs/user/manual/es/education/admission/program-enrollment.md
similarity index 78%
rename from erpnext/docs/user/manual/es/schools/admission/program-enrollment.md
rename to erpnext/docs/user/manual/es/education/admission/program-enrollment.md
index 34e8996..6a24284 100644
--- a/erpnext/docs/user/manual/es/schools/admission/program-enrollment.md
+++ b/erpnext/docs/user/manual/es/education/admission/program-enrollment.md
@@ -2,6 +2,6 @@
 
 Este formulario te permite inscribir un estudiante a un programa. Un estudiante puede ser inscrito en multiples programas.
 
-<img class="screenshot" alt="Student Applicant Enrollment" src="/docs/assets/img/schools/admission/program-enrollment.png">
+<img class="screenshot" alt="Student Applicant Enrollment" src="/docs/assets/img/education/admission/program-enrollment.png">
 
 {next}
diff --git a/erpnext/docs/user/manual/es/schools/admission/student-applicant.md b/erpnext/docs/user/manual/es/education/admission/student-applicant.md
similarity index 89%
rename from erpnext/docs/user/manual/es/schools/admission/student-applicant.md
rename to erpnext/docs/user/manual/es/education/admission/student-applicant.md
index 33d8dd7..4d8723c 100644
--- a/erpnext/docs/user/manual/es/schools/admission/student-applicant.md
+++ b/erpnext/docs/user/manual/es/education/admission/student-applicant.md
@@ -3,7 +3,7 @@
 Un registro de Aplicación de Estudiante necesita ser creado cuando un estudiante aplica para un programa en su institución.
 Puedes Aprobar o Rechazar una aplicación de estudiante. Aceptando una aplicación de un estudiante puedes agregarlos al master de estudiantes.
 
-<img class="screenshot" alt="Student Applicant" src="/docs/assets/img/schools/admission/student-applicant.png">
+<img class="screenshot" alt="Student Applicant" src="/docs/assets/img/education/admission/student-applicant.png">
 
 ### Estados de la Aplicación
 
@@ -21,8 +21,8 @@
 
 
 Una vez aprobada una Aplicación de Estudiante, puedes inscribirlo a un programa. Cuando le das click al butón 'Inscribir',
-el sistema creará un estudiante usando esa aplicación y le va a redireccionar a el [Formulario de Inscripción al Programa](/docs/user/manual/es/schools/student/program-enrollment.html).
+el sistema creará un estudiante usando esa aplicación y le va a redireccionar a el [Formulario de Inscripción al Programa](/docs/user/manual/es/education/student/program-enrollment.html).
 
-<img class="screenshot" alt="Student Applicant Enrollment" src="/docs/assets/img/schools/admission/student-applicant-enroll.png">
+<img class="screenshot" alt="Student Applicant Enrollment" src="/docs/assets/img/education/admission/student-applicant-enroll.png">
 
 {next}
diff --git a/erpnext/docs/user/manual/es/schools/fees/__init__.py b/erpnext/docs/user/manual/es/education/fees/__init__.py
similarity index 100%
rename from erpnext/docs/user/manual/es/schools/fees/__init__.py
rename to erpnext/docs/user/manual/es/education/fees/__init__.py
diff --git a/erpnext/docs/user/manual/es/schools/fees/fee-category.md b/erpnext/docs/user/manual/es/education/fees/fee-category.md
similarity index 80%
rename from erpnext/docs/user/manual/es/schools/fees/fee-category.md
rename to erpnext/docs/user/manual/es/education/fees/fee-category.md
index c05b3f5..a38ba7e 100644
--- a/erpnext/docs/user/manual/es/schools/fees/fee-category.md
+++ b/erpnext/docs/user/manual/es/education/fees/fee-category.md
@@ -2,6 +2,6 @@
 
 Todos los tipos diferentes de cuotas que se cobran
 
-<img class="screenshot" alt="Fees Category" src="/docs/assets/img/schools/fees/fee-category.png">
+<img class="screenshot" alt="Fees Category" src="/docs/assets/img/education/fees/fee-category.png">
 
 {next}
diff --git a/erpnext/docs/user/manual/es/schools/fees/fee-structure.md b/erpnext/docs/user/manual/es/education/fees/fee-structure.md
similarity index 83%
rename from erpnext/docs/user/manual/es/schools/fees/fee-structure.md
rename to erpnext/docs/user/manual/es/education/fees/fee-structure.md
index 1f621d7..6fe6af9 100644
--- a/erpnext/docs/user/manual/es/schools/fees/fee-structure.md
+++ b/erpnext/docs/user/manual/es/education/fees/fee-structure.md
@@ -2,6 +2,6 @@
 
 Una Estructura de Cuota es una plantilla que puede ser usada cuando se hacen registros de cuotas.
 
-<img class="screenshot" alt="Fees Structure" src="/docs/assets/img/schools/fees/fee-structure.png">
+<img class="screenshot" alt="Fees Structure" src="/docs/assets/img/education/fees/fee-structure.png">
 
 {next}
diff --git a/erpnext/docs/user/manual/es/education/fees/fees.md b/erpnext/docs/user/manual/es/education/fees/fees.md
new file mode 100644
index 0000000..5f6eee4
--- /dev/null
+++ b/erpnext/docs/user/manual/es/education/fees/fees.md
@@ -0,0 +1,8 @@
+# Cuotas
+
+Mantiene un registro de todas las cuotas recolectadas de los estudiantes.
+La [Estructura de Cuota](/docs/user/manual/es/education/fees/fee-structure.html) es seleccionada basada en el programa seleccionada y los Términos Académicos.
+
+<img class="screenshot" alt="Fees" src="/docs/assets/img/education/fees/fees.png">
+
+{next}
diff --git a/erpnext/docs/user/manual/es/schools/fees/index.md b/erpnext/docs/user/manual/es/education/fees/index.md
similarity index 82%
rename from erpnext/docs/user/manual/es/schools/fees/index.md
rename to erpnext/docs/user/manual/es/education/fees/index.md
index e883813..c1b5bb5 100644
--- a/erpnext/docs/user/manual/es/schools/fees/index.md
+++ b/erpnext/docs/user/manual/es/education/fees/index.md
@@ -2,7 +2,7 @@
 
 Esta sección contiene todos los documentos relacionado a las 'Cuota'
 
-<img class="screenshot" alt="Fees Section" src="/docs/assets/img/schools/fees/fees-section.png">
+<img class="screenshot" alt="Fees Section" src="/docs/assets/img/education/fees/fees-section.png">
 
 ### Temas
 
diff --git a/erpnext/docs/user/manual/es/schools/fees/index.txt b/erpnext/docs/user/manual/es/education/fees/index.txt
similarity index 100%
rename from erpnext/docs/user/manual/es/schools/fees/index.txt
rename to erpnext/docs/user/manual/es/education/fees/index.txt
diff --git a/erpnext/docs/user/manual/es/schools/index.md b/erpnext/docs/user/manual/es/education/index.md
similarity index 84%
rename from erpnext/docs/user/manual/es/schools/index.md
rename to erpnext/docs/user/manual/es/education/index.md
index a1824dc..feca830 100644
--- a/erpnext/docs/user/manual/es/schools/index.md
+++ b/erpnext/docs/user/manual/es/education/index.md
@@ -1,8 +1,8 @@
-# Schools
+# Education
 
 
 Los módulos de School estan diseñados para satisfacer los requerimientos de Escuelas, Colegios e Institutos Educacionales.
 
-<img class="screenshot" alt="Fees Section" src="/docs/assets/img/schools/module.png">
+<img class="screenshot" alt="Fees Section" src="/docs/assets/img/education/module.png">
 
 {index}
diff --git a/erpnext/docs/user/manual/es/schools/index.txt b/erpnext/docs/user/manual/es/education/index.txt
similarity index 100%
rename from erpnext/docs/user/manual/es/schools/index.txt
rename to erpnext/docs/user/manual/es/education/index.txt
diff --git a/erpnext/docs/user/manual/es/schools/schedule/__init__.py b/erpnext/docs/user/manual/es/education/schedule/__init__.py
similarity index 100%
rename from erpnext/docs/user/manual/es/schools/schedule/__init__.py
rename to erpnext/docs/user/manual/es/education/schedule/__init__.py
diff --git a/erpnext/docs/user/manual/es/schools/schedule/course-schedule.md b/erpnext/docs/user/manual/es/education/schedule/course-schedule.md
similarity index 86%
rename from erpnext/docs/user/manual/es/schools/schedule/course-schedule.md
rename to erpnext/docs/user/manual/es/education/schedule/course-schedule.md
index 629c828..7bf40ff 100644
--- a/erpnext/docs/user/manual/es/schools/schedule/course-schedule.md
+++ b/erpnext/docs/user/manual/es/education/schedule/course-schedule.md
@@ -3,13 +3,13 @@
 El Horario de Curso es el horario de una sesión de un profesor para un Curso en particular.
 Puedes ver un resumen del horario del curso en la vista de Calendario.
 
-<img class="screenshot" alt="Course Schedule" src="/docs/assets/img/schools/schedule/course-schedule.png">
+<img class="screenshot" alt="Course Schedule" src="/docs/assets/img/education/schedule/course-schedule.png">
 
 ### Marcando asistencia
 
 Puedes pasar la asistencia para un grupo de estudiantes usando el Horario de Curso.
 
-<img class="screenshot" alt="Course Schedule Attendance" src="/docs/assets/img/schools/schedule/course-schedule-att.png">
+<img class="screenshot" alt="Course Schedule Attendance" src="/docs/assets/img/education/schedule/course-schedule-att.png">
 
 - Para hacer la asistencia, expandir la sección de asistencia.
 - Selecciona los estudiantes que estaban presentes para esa sesión.
@@ -20,6 +20,6 @@
 Una vez hayas marcado la asistencia usando la sección de asistencia en el Horario de un Curso, esta sección debería estar oculta.
 Un botón de Ver Asistencia debería aparecer. Click en el botón para ver todos los registros de asistencia creados para ese Horario de Curso.
 
-<img class="screenshot" alt="Course Schedule Attendance" src="/docs/assets/img/schools/schedule/course-schedule-att-1.png">
+<img class="screenshot" alt="Course Schedule Attendance" src="/docs/assets/img/education/schedule/course-schedule-att-1.png">
 
 {next}
diff --git a/erpnext/docs/user/manual/es/schools/schedule/examination.md b/erpnext/docs/user/manual/es/education/schedule/examination.md
similarity index 85%
rename from erpnext/docs/user/manual/es/schools/schedule/examination.md
rename to erpnext/docs/user/manual/es/education/schedule/examination.md
index 5f85aed..b8cef3e 100644
--- a/erpnext/docs/user/manual/es/schools/schedule/examination.md
+++ b/erpnext/docs/user/manual/es/education/schedule/examination.md
@@ -2,7 +2,7 @@
 
 El registro de examinación puede ser usado para hacer el seguimiento del horario  de los examenes y los resultados de los mismos.
 
-<img class="screenshot" alt="Examination" src="/docs/assets/img/schools/schedule/examination.png">
+<img class="screenshot" alt="Examination" src="/docs/assets/img/education/schedule/examination.png">
 
 
 {next}
diff --git a/erpnext/docs/user/manual/es/schools/schedule/index.md b/erpnext/docs/user/manual/es/education/schedule/index.md
similarity index 66%
rename from erpnext/docs/user/manual/es/schools/schedule/index.md
rename to erpnext/docs/user/manual/es/education/schedule/index.md
index f9c2c3b..016aa10 100644
--- a/erpnext/docs/user/manual/es/schools/schedule/index.md
+++ b/erpnext/docs/user/manual/es/education/schedule/index.md
@@ -1,6 +1,6 @@
 # Horario
 
-<img class="screenshot" alt="Schedule Section" src="/docs/assets/img/schools/schedule/schedule-section.png">
+<img class="screenshot" alt="Schedule Section" src="/docs/assets/img/education/schedule/schedule-section.png">
 
 ### Temas
 
diff --git a/erpnext/docs/user/manual/es/schools/schedule/index.txt b/erpnext/docs/user/manual/es/education/schedule/index.txt
similarity index 100%
rename from erpnext/docs/user/manual/es/schools/schedule/index.txt
rename to erpnext/docs/user/manual/es/education/schedule/index.txt
diff --git a/erpnext/docs/user/manual/es/schools/schedule/scheduling-tool.md b/erpnext/docs/user/manual/es/education/schedule/scheduling-tool.md
similarity index 96%
rename from erpnext/docs/user/manual/es/schools/schedule/scheduling-tool.md
rename to erpnext/docs/user/manual/es/education/schedule/scheduling-tool.md
index 070a035..55ff425 100644
--- a/erpnext/docs/user/manual/es/schools/schedule/scheduling-tool.md
+++ b/erpnext/docs/user/manual/es/education/schedule/scheduling-tool.md
@@ -2,7 +2,7 @@
 
 Esta herramienta puede ser usada para crear los Horarios de los Cursos.
 
-<img class="screenshot" alt="Scheduling Tool" src="/docs/assets/img/schools/schedule/scheduling-tool.png">
+<img class="screenshot" alt="Scheduling Tool" src="/docs/assets/img/education/schedule/scheduling-tool.png">
 
 ### Creando Horarios de Cursos
 
diff --git a/erpnext/docs/user/manual/es/schools/schedule/student-attendance.md b/erpnext/docs/user/manual/es/education/schedule/student-attendance.md
similarity index 83%
rename from erpnext/docs/user/manual/es/schools/schedule/student-attendance.md
rename to erpnext/docs/user/manual/es/education/schedule/student-attendance.md
index a06c4f2..53bd4e9 100644
--- a/erpnext/docs/user/manual/es/schools/schedule/student-attendance.md
+++ b/erpnext/docs/user/manual/es/education/schedule/student-attendance.md
@@ -2,6 +2,6 @@
 
 Mantiene los registros de la asistencia del estudiante. Los registros de asistencia pueden ser creados sobre los horarios de los cursos (Course Schedules).
 
-<img class="screenshot" alt="Student Attendance" src="/docs/assets/img/schools/schedule/student-attendance.png">
+<img class="screenshot" alt="Student Attendance" src="/docs/assets/img/education/schedule/student-attendance.png">
 
 {next}
diff --git a/erpnext/docs/user/manual/es/schools/setup/__init__.py b/erpnext/docs/user/manual/es/education/setup/__init__.py
similarity index 100%
rename from erpnext/docs/user/manual/es/schools/setup/__init__.py
rename to erpnext/docs/user/manual/es/education/setup/__init__.py
diff --git a/erpnext/docs/user/manual/es/schools/setup/academic-term.md b/erpnext/docs/user/manual/es/education/setup/academic-term.md
similarity index 71%
rename from erpnext/docs/user/manual/es/schools/setup/academic-term.md
rename to erpnext/docs/user/manual/es/education/setup/academic-term.md
index 83af58a..7a6b405 100644
--- a/erpnext/docs/user/manual/es/schools/setup/academic-term.md
+++ b/erpnext/docs/user/manual/es/education/setup/academic-term.md
@@ -1,6 +1,6 @@
 # Término Académico
 
-<img class="screenshot" alt="Academic Term" src="/docs/assets/img/schools/setup/academic-term.png">
+<img class="screenshot" alt="Academic Term" src="/docs/assets/img/education/setup/academic-term.png">
 
 
 {next}
diff --git a/erpnext/docs/user/manual/es/schools/setup/academic-year.md b/erpnext/docs/user/manual/es/education/setup/academic-year.md
similarity index 70%
rename from erpnext/docs/user/manual/es/schools/setup/academic-year.md
rename to erpnext/docs/user/manual/es/education/setup/academic-year.md
index 56a46f9..7fe2a8f 100644
--- a/erpnext/docs/user/manual/es/schools/setup/academic-year.md
+++ b/erpnext/docs/user/manual/es/education/setup/academic-year.md
@@ -1,5 +1,5 @@
 # Año Académico
 
-<img class="screenshot" alt="Academic Year" src="/docs/assets/img/schools/setup/academic-year.png">
+<img class="screenshot" alt="Academic Year" src="/docs/assets/img/education/setup/academic-year.png">
 
 {next}
diff --git a/erpnext/docs/user/manual/es/education/setup/course.md b/erpnext/docs/user/manual/es/education/setup/course.md
new file mode 100644
index 0000000..fbbce62
--- /dev/null
+++ b/erpnext/docs/user/manual/es/education/setup/course.md
@@ -0,0 +1,5 @@
+# Curso
+
+<img class="screenshot" alt="Course" src="/docs/assets/img/education/setup/course.png">
+
+{next}
diff --git a/erpnext/docs/user/manual/es/schools/setup/index.md b/erpnext/docs/user/manual/es/education/setup/index.md
similarity index 72%
rename from erpnext/docs/user/manual/es/schools/setup/index.md
rename to erpnext/docs/user/manual/es/education/setup/index.md
index 070db54..59df995 100644
--- a/erpnext/docs/user/manual/es/schools/setup/index.md
+++ b/erpnext/docs/user/manual/es/education/setup/index.md
@@ -1,6 +1,6 @@
 # Configuración
 
-<img class="screenshot" alt="Setup Section" src="/docs/assets/img/schools/setup/setup-section.png">
+<img class="screenshot" alt="Setup Section" src="/docs/assets/img/education/setup/setup-section.png">
 
 ### Temas
 
diff --git a/erpnext/docs/user/manual/es/schools/setup/index.txt b/erpnext/docs/user/manual/es/education/setup/index.txt
similarity index 100%
rename from erpnext/docs/user/manual/es/schools/setup/index.txt
rename to erpnext/docs/user/manual/es/education/setup/index.txt
diff --git a/erpnext/docs/user/manual/es/education/setup/instructor.md b/erpnext/docs/user/manual/es/education/setup/instructor.md
new file mode 100644
index 0000000..4812c15
--- /dev/null
+++ b/erpnext/docs/user/manual/es/education/setup/instructor.md
@@ -0,0 +1,5 @@
+# Instructor
+
+<img class="screenshot" alt="Instructor" src="/docs/assets/img/education/setup/instructor.png">
+
+{next}
\ No newline at end of file
diff --git a/erpnext/docs/user/manual/es/education/setup/program.md b/erpnext/docs/user/manual/es/education/setup/program.md
new file mode 100644
index 0000000..1236057
--- /dev/null
+++ b/erpnext/docs/user/manual/es/education/setup/program.md
@@ -0,0 +1,5 @@
+# Programa
+
+<img class="screenshot" alt="Program" src="/docs/assets/img/education/setup/program.png">
+
+{next}
diff --git a/erpnext/docs/user/manual/es/education/setup/room.md b/erpnext/docs/user/manual/es/education/setup/room.md
new file mode 100644
index 0000000..7750dcf
--- /dev/null
+++ b/erpnext/docs/user/manual/es/education/setup/room.md
@@ -0,0 +1,6 @@
+# Aula
+
+
+<img class="screenshot" alt="Room" src="/docs/assets/img/education/setup/room.png">
+
+{next}
diff --git a/erpnext/docs/user/manual/es/schools/student/__init__.py b/erpnext/docs/user/manual/es/education/student/__init__.py
similarity index 100%
rename from erpnext/docs/user/manual/es/schools/student/__init__.py
rename to erpnext/docs/user/manual/es/education/student/__init__.py
diff --git a/erpnext/docs/user/manual/es/schools/student/index.md b/erpnext/docs/user/manual/es/education/student/index.md
similarity index 100%
rename from erpnext/docs/user/manual/es/schools/student/index.md
rename to erpnext/docs/user/manual/es/education/student/index.md
diff --git a/erpnext/docs/user/manual/es/schools/student/index.txt b/erpnext/docs/user/manual/es/education/student/index.txt
similarity index 100%
rename from erpnext/docs/user/manual/es/schools/student/index.txt
rename to erpnext/docs/user/manual/es/education/student/index.txt
diff --git a/erpnext/docs/user/manual/es/education/student/student-batch.md b/erpnext/docs/user/manual/es/education/student/student-batch.md
new file mode 100644
index 0000000..bb7c9d5
--- /dev/null
+++ b/erpnext/docs/user/manual/es/education/student/student-batch.md
@@ -0,0 +1,8 @@
+# Lote de Estudiantes
+
+
+Un lote de estudiantes es una colección de estudiantes desde los Grupos de Estudiantes.
+
+<img class="screenshot" alt="Student" src="/docs/assets/img/education/student/student-batch.png">
+
+{next}
diff --git a/erpnext/docs/user/manual/es/schools/student/student-group-creation-tool.md b/erpnext/docs/user/manual/es/education/student/student-group-creation-tool.md
similarity index 77%
rename from erpnext/docs/user/manual/es/schools/student/student-group-creation-tool.md
rename to erpnext/docs/user/manual/es/education/student/student-group-creation-tool.md
index 2102c34..942fadf 100644
--- a/erpnext/docs/user/manual/es/schools/student/student-group-creation-tool.md
+++ b/erpnext/docs/user/manual/es/education/student/student-group-creation-tool.md
@@ -3,6 +3,6 @@
 Esta herramienta te permite crear grupos de estudiantes. Puedes especificar multiples parámetros para crearlos.
 
 
-<img class="screenshot" alt="Student Group Creation Tool" src="/docs/assets/img/schools/student/student-group-creation-tool.png">
+<img class="screenshot" alt="Student Group Creation Tool" src="/docs/assets/img/education/student/student-group-creation-tool.png">
 
 {next}
diff --git a/erpnext/docs/user/manual/es/schools/student/student-group.md b/erpnext/docs/user/manual/es/education/student/student-group.md
similarity index 90%
rename from erpnext/docs/user/manual/es/schools/student/student-group.md
rename to erpnext/docs/user/manual/es/education/student/student-group.md
index f5841cc..59dfcbc 100644
--- a/erpnext/docs/user/manual/es/schools/student/student-group.md
+++ b/erpnext/docs/user/manual/es/education/student/student-group.md
@@ -3,6 +3,6 @@
 Un Grupo de Estudiante es una colección de estudiantes tomando el mismo curso. Puedes crear calendarios para los cursos y examinaciones para un Grupo de Estudiante.
 Un Grupo de Estudiante necesita ser creado para cada curso en un año o término académico en particular.
 
-<img class="screenshot" alt="Student Group" src="/docs/assets/img/schools/student/student-group.png">
+<img class="screenshot" alt="Student Group" src="/docs/assets/img/education/student/student-group.png">
 
 {next}
diff --git a/erpnext/docs/user/manual/es/schools/student/student-log.md b/erpnext/docs/user/manual/es/education/student/student-log.md
similarity index 71%
rename from erpnext/docs/user/manual/es/schools/student/student-log.md
rename to erpnext/docs/user/manual/es/education/student/student-log.md
index 296b867..e5a5e2c 100644
--- a/erpnext/docs/user/manual/es/schools/student/student-log.md
+++ b/erpnext/docs/user/manual/es/education/student/student-log.md
@@ -3,6 +3,6 @@
 Puedes crear una nota de una actividad de un estudiante usando la bitácora de estudiante (log)
 Los registros de bitágora pueden ser categorizadas como 'General', 'Academic', 'Medical' or 'Achievement'
 
-<img class="screenshot" alt="Student" src="/docs/assets/img/schools/student/student-log.png">
+<img class="screenshot" alt="Student" src="/docs/assets/img/education/student/student-log.png">
 
 {next}
diff --git a/erpnext/docs/user/manual/es/schools/student/student.md b/erpnext/docs/user/manual/es/education/student/student.md
similarity index 78%
rename from erpnext/docs/user/manual/es/schools/student/student.md
rename to erpnext/docs/user/manual/es/education/student/student.md
index fee84c5..21724a7 100644
--- a/erpnext/docs/user/manual/es/schools/student/student.md
+++ b/erpnext/docs/user/manual/es/education/student/student.md
@@ -5,6 +5,6 @@
 
 Puedes ver todo lo relacionado a un estudiante en particular en esta página. Ejemplo: Pagos, Grupo de Estudiante, etc.
 
-<img class="screenshot" alt="Student" src="/docs/assets/img/schools/student/student.png">
+<img class="screenshot" alt="Student" src="/docs/assets/img/education/student/student.png">
 
 {next}
diff --git a/erpnext/docs/user/manual/es/index.txt b/erpnext/docs/user/manual/es/index.txt
index 00cf97b..ad85a79 100644
--- a/erpnext/docs/user/manual/es/index.txt
+++ b/erpnext/docs/user/manual/es/index.txt
@@ -1,4 +1,4 @@
 introduction
 accounts
 projects
-schools
+education
diff --git a/erpnext/docs/user/manual/es/schools/fees/fees.md b/erpnext/docs/user/manual/es/schools/fees/fees.md
deleted file mode 100644
index d6b74dc..0000000
--- a/erpnext/docs/user/manual/es/schools/fees/fees.md
+++ /dev/null
@@ -1,8 +0,0 @@
-# Cuotas
-
-Mantiene un registro de todas las cuotas recolectadas de los estudiantes.
-La [Estructura de Cuota](/docs/user/manual/es/schools/fees/fee-structure.html) es seleccionada basada en el programa seleccionada y los Términos Académicos.
-
-<img class="screenshot" alt="Fees" src="/docs/assets/img/schools/fees/fees.png">
-
-{next}
diff --git a/erpnext/docs/user/manual/es/schools/setup/course.md b/erpnext/docs/user/manual/es/schools/setup/course.md
deleted file mode 100644
index 799f9b4..0000000
--- a/erpnext/docs/user/manual/es/schools/setup/course.md
+++ /dev/null
@@ -1,5 +0,0 @@
-# Curso
-
-<img class="screenshot" alt="Course" src="/docs/assets/img/schools/setup/course.png">
-
-{next}
diff --git a/erpnext/docs/user/manual/es/schools/setup/instructor.md b/erpnext/docs/user/manual/es/schools/setup/instructor.md
deleted file mode 100644
index 1a4d351..0000000
--- a/erpnext/docs/user/manual/es/schools/setup/instructor.md
+++ /dev/null
@@ -1,5 +0,0 @@
-# Instructor
-
-<img class="screenshot" alt="Instructor" src="/docs/assets/img/schools/setup/instructor.png">
-
-{next}
\ No newline at end of file
diff --git a/erpnext/docs/user/manual/es/schools/setup/program.md b/erpnext/docs/user/manual/es/schools/setup/program.md
deleted file mode 100644
index 78895c5..0000000
--- a/erpnext/docs/user/manual/es/schools/setup/program.md
+++ /dev/null
@@ -1,5 +0,0 @@
-# Programa
-
-<img class="screenshot" alt="Program" src="/docs/assets/img/schools/setup/program.png">
-
-{next}
diff --git a/erpnext/docs/user/manual/es/schools/setup/room.md b/erpnext/docs/user/manual/es/schools/setup/room.md
deleted file mode 100644
index 92a4de7..0000000
--- a/erpnext/docs/user/manual/es/schools/setup/room.md
+++ /dev/null
@@ -1,6 +0,0 @@
-# Aula
-
-
-<img class="screenshot" alt="Room" src="/docs/assets/img/schools/setup/room.png">
-
-{next}
diff --git a/erpnext/docs/user/manual/es/schools/student/student-batch.md b/erpnext/docs/user/manual/es/schools/student/student-batch.md
deleted file mode 100644
index 4d5a17e..0000000
--- a/erpnext/docs/user/manual/es/schools/student/student-batch.md
+++ /dev/null
@@ -1,8 +0,0 @@
-# Lote de Estudiantes
-
-
-Un lote de estudiantes es una colección de estudiantes desde los Grupos de Estudiantes.
-
-<img class="screenshot" alt="Student" src="/docs/assets/img/schools/student/student-batch.png">
-
-{next}
diff --git a/erpnext/docs/user/videos/learn/education.md b/erpnext/docs/user/videos/learn/education.md
new file mode 100644
index 0000000..24b0cd0
--- /dev/null
+++ b/erpnext/docs/user/videos/learn/education.md
@@ -0,0 +1,7 @@
+# ERPNext for Education
+
+<iframe width="660" height="371" src="https://www.youtube.com/embed/f6foQOyGzdA" frameborder="0" allowfullscreen></iframe>
+
+**Duration: 39:21**
+
+This video is a recording of a webinar on how education institutes can use ERPNext Education module. It covers management of Student Applications, managing masters like Students, Programs and Courses. Also, you can manage processes like Course Scheduling, Student Assessment, Fees and Attendance.
\ No newline at end of file
diff --git a/erpnext/docs/user/videos/learn/index.md b/erpnext/docs/user/videos/learn/index.md
index dad5cc0..3bdf305 100644
--- a/erpnext/docs/user/videos/learn/index.md
+++ b/erpnext/docs/user/videos/learn/index.md
@@ -27,8 +27,8 @@
               ERPNext for Retailers</a>
             <span class="text-muted pull-right">39:21</span>
         </li>
-        <li><a href="/docs/user/videos/learn/schools.html">
-              ERPNext for Schools</a>
+        <li><a href="/docs/user/videos/learn/education.html">
+              ERPNext for Education</a>
             <span class="text-muted pull-right">39:21</span>
         </li>
     </ul>
diff --git a/erpnext/docs/user/videos/learn/schools.md b/erpnext/docs/user/videos/learn/schools.md
deleted file mode 100644
index 3553a53..0000000
--- a/erpnext/docs/user/videos/learn/schools.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# ERPNext for Schools
-
-<iframe width="660" height="371" src="https://www.youtube.com/embed/f6foQOyGzdA" frameborder="0" allowfullscreen></iframe>
-
-**Duration: 39:21**
-
-This video is a recording of a webinar on how education institutes can use ERPNext Schools module. It covers management of Student Applications, managing masters like Students, Programs and Courses. Also, you can manage processes like Course Scheduling, Student Assessment, Fees and Attendance.
\ No newline at end of file
diff --git a/erpnext/domains/education.py b/erpnext/domains/education.py
index 7a86c76..eed3545 100644
--- a/erpnext/domains/education.py
+++ b/erpnext/domains/education.py
@@ -8,7 +8,9 @@
 		'Fees',
 		'Task',
 		'ToDo',
-		'Schools'
+		'Education',
+		'Student Attendance Tool',
+		'Student Applicant'
 	],
 	'default_portal_role': 'Student',
 	'restricted_roles': [
@@ -17,21 +19,8 @@
 		'Academics User'
 	],
 	'modules': [
-		'Schools'
+		'Education'
 	],
-	'fixtures': [
-		dict(doctype='Academic Year', academic_year_name='2013-14'),
-		dict(doctype='Academic Year', academic_year_name='2014-15'),
-		dict(doctype='Academic Year', academic_year_name='2015-16'),
-		dict(doctype='Academic Year', academic_year_name='2016-17'),
-		dict(doctype='Academic Year', academic_year_name='2017-18'),
-		dict(doctype='Academic Year', academic_year_name='2018-19'),
-		dict(doctype='Academic Year', academic_year_name='2019-20'),
-		dict(doctype='Academic Term', academic_year='2016-17', term_name='Semester 1'),
-		dict(doctype='Academic Term', academic_year='2016-17', term_name='Semester 2'),
-		dict(doctype='Academic Term', academic_year='2016-17', term_name='Semester 3'),
-		dict(doctype='Academic Term', academic_year='2017-18', term_name='Semester 1'),
-		dict(doctype='Academic Term', academic_year='2017-18', term_name='Semester 2'),
-		dict(doctype='Academic Term', academic_year='2017-18', term_name='Semester 3')
-	]
+	'on_setup': 'erpnext.education.setup.setup_education'
+
 }
\ No newline at end of file
diff --git a/erpnext/domains/retail.py b/erpnext/domains/retail.py
index 1bfd65f..897c4d9 100644
--- a/erpnext/domains/retail.py
+++ b/erpnext/domains/retail.py
@@ -10,8 +10,7 @@
 		'ToDo'
 	],
 	'properties': [
-		{'doctype': 'Item', 'fieldname': 'manufacturing', 'property': 'hidden', 'value': 1},
-		{'doctype': 'Customer', 'fieldname': 'credit_limit_section', 'property': 'hidden', 'value': 1},
+		{'doctype': 'Item', 'fieldname': 'manufacturing', 'property': 'hidden', 'value': 1}
 	],
 	'set_value': [
 		['Stock Settings', None, 'show_barcode_field', 1]
diff --git a/erpnext/schools/__init__.py b/erpnext/education/__init__.py
similarity index 100%
rename from erpnext/schools/__init__.py
rename to erpnext/education/__init__.py
diff --git a/erpnext/schools/api.py b/erpnext/education/api.py
similarity index 100%
rename from erpnext/schools/api.py
rename to erpnext/education/api.py
diff --git a/erpnext/schools/doctype/__init__.py b/erpnext/education/doctype/__init__.py
similarity index 100%
rename from erpnext/schools/doctype/__init__.py
rename to erpnext/education/doctype/__init__.py
diff --git a/erpnext/schools/doctype/academic_term/__init__.py b/erpnext/education/doctype/academic_term/__init__.py
similarity index 100%
rename from erpnext/schools/doctype/academic_term/__init__.py
rename to erpnext/education/doctype/academic_term/__init__.py
diff --git a/erpnext/schools/doctype/academic_term/academic_term.js b/erpnext/education/doctype/academic_term/academic_term.js
similarity index 100%
rename from erpnext/schools/doctype/academic_term/academic_term.js
rename to erpnext/education/doctype/academic_term/academic_term.js
diff --git a/erpnext/schools/doctype/academic_term/academic_term.json b/erpnext/education/doctype/academic_term/academic_term.json
similarity index 98%
rename from erpnext/schools/doctype/academic_term/academic_term.json
rename to erpnext/education/doctype/academic_term/academic_term.json
index b4eb83d..06c5b1a 100644
--- a/erpnext/schools/doctype/academic_term/academic_term.json
+++ b/erpnext/education/doctype/academic_term/academic_term.json
@@ -175,9 +175,9 @@
  "issingle": 0, 
  "istable": 0, 
  "max_attachments": 0, 
- "modified": "2017-06-30 08:21:45.897056", 
+ "modified": "2017-11-10 19:05:58.567627", 
  "modified_by": "Administrator", 
- "module": "Schools", 
+ "module": "Education", 
  "name": "Academic Term", 
  "name_case": "", 
  "owner": "Administrator", 
diff --git a/erpnext/schools/doctype/academic_term/academic_term.py b/erpnext/education/doctype/academic_term/academic_term.py
similarity index 100%
rename from erpnext/schools/doctype/academic_term/academic_term.py
rename to erpnext/education/doctype/academic_term/academic_term.py
diff --git a/erpnext/schools/doctype/academic_term/test_academic_term.js b/erpnext/education/doctype/academic_term/test_academic_term.js
similarity index 89%
rename from erpnext/schools/doctype/academic_term/test_academic_term.js
rename to erpnext/education/doctype/academic_term/test_academic_term.js
index 688ad54..6d91e97 100644
--- a/erpnext/schools/doctype/academic_term/test_academic_term.js
+++ b/erpnext/education/doctype/academic_term/test_academic_term.js
@@ -1,5 +1,5 @@
-// Testing Setup Module in Schools
-QUnit.module('schools');
+// Testing Setup Module in Education
+QUnit.module('education');
 
 QUnit.test('Test: Academic Term', function(assert){
 	assert.expect(4);
diff --git a/erpnext/schools/doctype/academic_term/test_academic_term.py b/erpnext/education/doctype/academic_term/test_academic_term.py
similarity index 100%
rename from erpnext/schools/doctype/academic_term/test_academic_term.py
rename to erpnext/education/doctype/academic_term/test_academic_term.py
diff --git a/erpnext/schools/doctype/academic_term/test_records.json b/erpnext/education/doctype/academic_term/test_records.json
similarity index 100%
rename from erpnext/schools/doctype/academic_term/test_records.json
rename to erpnext/education/doctype/academic_term/test_records.json
diff --git a/erpnext/schools/doctype/academic_year/__init__.py b/erpnext/education/doctype/academic_year/__init__.py
similarity index 100%
rename from erpnext/schools/doctype/academic_year/__init__.py
rename to erpnext/education/doctype/academic_year/__init__.py
diff --git a/erpnext/schools/doctype/academic_year/academic_year.js b/erpnext/education/doctype/academic_year/academic_year.js
similarity index 100%
rename from erpnext/schools/doctype/academic_year/academic_year.js
rename to erpnext/education/doctype/academic_year/academic_year.js
diff --git a/erpnext/schools/doctype/academic_year/academic_year.json b/erpnext/education/doctype/academic_year/academic_year.json
similarity index 97%
rename from erpnext/schools/doctype/academic_year/academic_year.json
rename to erpnext/education/doctype/academic_year/academic_year.json
index 3d8c4f8..5df89a7 100644
--- a/erpnext/schools/doctype/academic_year/academic_year.json
+++ b/erpnext/education/doctype/academic_year/academic_year.json
@@ -113,9 +113,9 @@
  "issingle": 0, 
  "istable": 0, 
  "max_attachments": 0, 
- "modified": "2017-06-30 08:21:46.121105", 
+ "modified": "2017-11-10 19:06:08.123090", 
  "modified_by": "Administrator", 
- "module": "Schools", 
+ "module": "Education", 
  "name": "Academic Year", 
  "name_case": "", 
  "owner": "Administrator", 
diff --git a/erpnext/schools/doctype/academic_year/academic_year.py b/erpnext/education/doctype/academic_year/academic_year.py
similarity index 100%
rename from erpnext/schools/doctype/academic_year/academic_year.py
rename to erpnext/education/doctype/academic_year/academic_year.py
diff --git a/erpnext/schools/doctype/academic_year/test_academic_year.js b/erpnext/education/doctype/academic_year/test_academic_year.js
similarity index 88%
rename from erpnext/schools/doctype/academic_year/test_academic_year.js
rename to erpnext/education/doctype/academic_year/test_academic_year.js
index 7bf1772..ec2f49c 100644
--- a/erpnext/schools/doctype/academic_year/test_academic_year.js
+++ b/erpnext/education/doctype/academic_year/test_academic_year.js
@@ -1,5 +1,5 @@
-// Testing Setup Module in Schools
-QUnit.module('schools');
+// Testing Setup Module in Education
+QUnit.module('education');
 
 QUnit.test('Test: Academic Year', function(assert){
 	assert.expect(3);
diff --git a/erpnext/schools/doctype/academic_year/test_academic_year.py b/erpnext/education/doctype/academic_year/test_academic_year.py
similarity index 100%
rename from erpnext/schools/doctype/academic_year/test_academic_year.py
rename to erpnext/education/doctype/academic_year/test_academic_year.py
diff --git a/erpnext/schools/doctype/academic_year/test_records.json b/erpnext/education/doctype/academic_year/test_records.json
similarity index 100%
rename from erpnext/schools/doctype/academic_year/test_records.json
rename to erpnext/education/doctype/academic_year/test_records.json
diff --git a/erpnext/schools/doctype/assessment_criteria/__init__.py b/erpnext/education/doctype/assessment_criteria/__init__.py
similarity index 100%
rename from erpnext/schools/doctype/assessment_criteria/__init__.py
rename to erpnext/education/doctype/assessment_criteria/__init__.py
diff --git a/erpnext/schools/doctype/assessment_criteria/assessment_criteria.js b/erpnext/education/doctype/assessment_criteria/assessment_criteria.js
similarity index 100%
rename from erpnext/schools/doctype/assessment_criteria/assessment_criteria.js
rename to erpnext/education/doctype/assessment_criteria/assessment_criteria.js
diff --git a/erpnext/schools/doctype/assessment_criteria/assessment_criteria.json b/erpnext/education/doctype/assessment_criteria/assessment_criteria.json
similarity index 97%
rename from erpnext/schools/doctype/assessment_criteria/assessment_criteria.json
rename to erpnext/education/doctype/assessment_criteria/assessment_criteria.json
index 2bbd2ef..9e228fd 100644
--- a/erpnext/schools/doctype/assessment_criteria/assessment_criteria.json
+++ b/erpnext/education/doctype/assessment_criteria/assessment_criteria.json
@@ -85,9 +85,9 @@
  "issingle": 0, 
  "istable": 0, 
  "max_attachments": 0, 
- "modified": "2017-06-30 08:21:46.211641", 
+ "modified": "2017-11-10 19:08:11.311304", 
  "modified_by": "Administrator", 
- "module": "Schools", 
+ "module": "Education", 
  "name": "Assessment Criteria", 
  "name_case": "", 
  "owner": "Administrator", 
diff --git a/erpnext/schools/doctype/assessment_criteria/assessment_criteria.py b/erpnext/education/doctype/assessment_criteria/assessment_criteria.py
similarity index 100%
rename from erpnext/schools/doctype/assessment_criteria/assessment_criteria.py
rename to erpnext/education/doctype/assessment_criteria/assessment_criteria.py
diff --git a/erpnext/schools/doctype/assessment_criteria/test_assessment_criteria.js b/erpnext/education/doctype/assessment_criteria/test_assessment_criteria.js
similarity index 84%
rename from erpnext/schools/doctype/assessment_criteria/test_assessment_criteria.js
rename to erpnext/education/doctype/assessment_criteria/test_assessment_criteria.js
index 6c0540e..db4a4cf 100644
--- a/erpnext/schools/doctype/assessment_criteria/test_assessment_criteria.js
+++ b/erpnext/education/doctype/assessment_criteria/test_assessment_criteria.js
@@ -1,5 +1,5 @@
-// School Assessment module
-QUnit.module('schools');
+// Education Assessment module
+QUnit.module('education');
 
 QUnit.test('Test: Assessment Criteria', function(assert){
 	assert.expect(0);
diff --git a/erpnext/schools/doctype/assessment_criteria/test_assessment_criteria.py b/erpnext/education/doctype/assessment_criteria/test_assessment_criteria.py
similarity index 100%
rename from erpnext/schools/doctype/assessment_criteria/test_assessment_criteria.py
rename to erpnext/education/doctype/assessment_criteria/test_assessment_criteria.py
diff --git a/erpnext/schools/doctype/assessment_criteria/test_records.json b/erpnext/education/doctype/assessment_criteria/test_records.json
similarity index 100%
rename from erpnext/schools/doctype/assessment_criteria/test_records.json
rename to erpnext/education/doctype/assessment_criteria/test_records.json
diff --git a/erpnext/schools/doctype/assessment_criteria_group/__init__.py b/erpnext/education/doctype/assessment_criteria_group/__init__.py
similarity index 100%
rename from erpnext/schools/doctype/assessment_criteria_group/__init__.py
rename to erpnext/education/doctype/assessment_criteria_group/__init__.py
diff --git a/erpnext/schools/doctype/assessment_criteria_group/assessment_criteria_group.js b/erpnext/education/doctype/assessment_criteria_group/assessment_criteria_group.js
similarity index 100%
rename from erpnext/schools/doctype/assessment_criteria_group/assessment_criteria_group.js
rename to erpnext/education/doctype/assessment_criteria_group/assessment_criteria_group.js
diff --git a/erpnext/schools/doctype/assessment_criteria_group/assessment_criteria_group.json b/erpnext/education/doctype/assessment_criteria_group/assessment_criteria_group.json
similarity index 96%
rename from erpnext/schools/doctype/assessment_criteria_group/assessment_criteria_group.json
rename to erpnext/education/doctype/assessment_criteria_group/assessment_criteria_group.json
index 7aa417f..5765b4b 100644
--- a/erpnext/schools/doctype/assessment_criteria_group/assessment_criteria_group.json
+++ b/erpnext/education/doctype/assessment_criteria_group/assessment_criteria_group.json
@@ -54,9 +54,9 @@
  "issingle": 0, 
  "istable": 0, 
  "max_attachments": 0, 
- "modified": "2017-06-30 08:21:46.323964", 
+ "modified": "2017-11-10 19:11:45.334917", 
  "modified_by": "Administrator", 
- "module": "Schools", 
+ "module": "Education", 
  "name": "Assessment Criteria Group", 
  "name_case": "", 
  "owner": "Administrator", 
diff --git a/erpnext/schools/doctype/assessment_criteria_group/assessment_criteria_group.py b/erpnext/education/doctype/assessment_criteria_group/assessment_criteria_group.py
similarity index 100%
rename from erpnext/schools/doctype/assessment_criteria_group/assessment_criteria_group.py
rename to erpnext/education/doctype/assessment_criteria_group/assessment_criteria_group.py
diff --git a/erpnext/schools/doctype/assessment_criteria_group/test_assessment_criteria_group.js b/erpnext/education/doctype/assessment_criteria_group/test_assessment_criteria_group.js
similarity index 82%
rename from erpnext/schools/doctype/assessment_criteria_group/test_assessment_criteria_group.js
rename to erpnext/education/doctype/assessment_criteria_group/test_assessment_criteria_group.js
index 92dba1d..bcfcaf8 100644
--- a/erpnext/schools/doctype/assessment_criteria_group/test_assessment_criteria_group.js
+++ b/erpnext/education/doctype/assessment_criteria_group/test_assessment_criteria_group.js
@@ -1,5 +1,5 @@
-// School Assessment module
-QUnit.module('schools');
+// Education Assessment module
+QUnit.module('education');
 
 QUnit.test('Test: Assessment Criteria Group', function(assert){
 	assert.expect(0);
diff --git a/erpnext/schools/doctype/assessment_criteria_group/test_assessment_criteria_group.py b/erpnext/education/doctype/assessment_criteria_group/test_assessment_criteria_group.py
similarity index 100%
rename from erpnext/schools/doctype/assessment_criteria_group/test_assessment_criteria_group.py
rename to erpnext/education/doctype/assessment_criteria_group/test_assessment_criteria_group.py
diff --git a/erpnext/schools/doctype/assessment_group/__init__.py b/erpnext/education/doctype/assessment_group/__init__.py
similarity index 100%
rename from erpnext/schools/doctype/assessment_group/__init__.py
rename to erpnext/education/doctype/assessment_group/__init__.py
diff --git a/erpnext/schools/doctype/assessment_group/assessment_group.js b/erpnext/education/doctype/assessment_group/assessment_group.js
similarity index 100%
rename from erpnext/schools/doctype/assessment_group/assessment_group.js
rename to erpnext/education/doctype/assessment_group/assessment_group.js
diff --git a/erpnext/schools/doctype/assessment_group/assessment_group.json b/erpnext/education/doctype/assessment_group/assessment_group.json
similarity index 98%
rename from erpnext/schools/doctype/assessment_group/assessment_group.json
rename to erpnext/education/doctype/assessment_group/assessment_group.json
index 8c93bb2..56917d2 100644
--- a/erpnext/schools/doctype/assessment_group/assessment_group.json
+++ b/erpnext/education/doctype/assessment_group/assessment_group.json
@@ -234,9 +234,9 @@
  "issingle": 0, 
  "istable": 0, 
  "max_attachments": 0, 
- "modified": "2017-08-21 02:12:33.177318", 
+ "modified": "2017-11-10 19:09:25.366400", 
  "modified_by": "Administrator", 
- "module": "Schools", 
+ "module": "Education", 
  "name": "Assessment Group", 
  "name_case": "", 
  "owner": "Administrator", 
diff --git a/erpnext/schools/doctype/assessment_group/assessment_group.py b/erpnext/education/doctype/assessment_group/assessment_group.py
similarity index 100%
rename from erpnext/schools/doctype/assessment_group/assessment_group.py
rename to erpnext/education/doctype/assessment_group/assessment_group.py
diff --git a/erpnext/schools/doctype/assessment_group/assessment_group_tree.js b/erpnext/education/doctype/assessment_group/assessment_group_tree.js
similarity index 100%
rename from erpnext/schools/doctype/assessment_group/assessment_group_tree.js
rename to erpnext/education/doctype/assessment_group/assessment_group_tree.js
diff --git a/erpnext/schools/doctype/assessment_group/test_assessment_group.js b/erpnext/education/doctype/assessment_group/test_assessment_group.js
similarity index 97%
rename from erpnext/schools/doctype/assessment_group/test_assessment_group.js
rename to erpnext/education/doctype/assessment_group/test_assessment_group.js
index aa6da47..93026d2 100644
--- a/erpnext/schools/doctype/assessment_group/test_assessment_group.js
+++ b/erpnext/education/doctype/assessment_group/test_assessment_group.js
@@ -1,5 +1,5 @@
-// School Assessment module
-QUnit.module('schools');
+// Education Assessment module
+QUnit.module('education');
 
 QUnit.test('Test: Assessment Group', function(assert){
 	assert.expect(4);
diff --git a/erpnext/schools/doctype/assessment_group/test_assessment_group.py b/erpnext/education/doctype/assessment_group/test_assessment_group.py
similarity index 100%
rename from erpnext/schools/doctype/assessment_group/test_assessment_group.py
rename to erpnext/education/doctype/assessment_group/test_assessment_group.py
diff --git a/erpnext/schools/doctype/assessment_plan/__init__.py b/erpnext/education/doctype/assessment_plan/__init__.py
similarity index 100%
rename from erpnext/schools/doctype/assessment_plan/__init__.py
rename to erpnext/education/doctype/assessment_plan/__init__.py
diff --git a/erpnext/schools/doctype/assessment_plan/assessment_plan.js b/erpnext/education/doctype/assessment_plan/assessment_plan.js
similarity index 96%
rename from erpnext/schools/doctype/assessment_plan/assessment_plan.js
rename to erpnext/education/doctype/assessment_plan/assessment_plan.js
index e83c4d3..f6fceb1 100644
--- a/erpnext/schools/doctype/assessment_plan/assessment_plan.js
+++ b/erpnext/education/doctype/assessment_plan/assessment_plan.js
@@ -40,7 +40,7 @@
 	course: function(frm) {
 		if (frm.doc.course && frm.doc.maximum_assessment_score) {
 			frappe.call({
-				method: "erpnext.schools.api.get_assessment_criteria",
+				method: "erpnext.education.api.get_assessment_criteria",
 				args: {
 					course: frm.doc.course
 				},
diff --git a/erpnext/schools/doctype/assessment_plan/assessment_plan.json b/erpnext/education/doctype/assessment_plan/assessment_plan.json
similarity index 99%
rename from erpnext/schools/doctype/assessment_plan/assessment_plan.json
rename to erpnext/education/doctype/assessment_plan/assessment_plan.json
index 265612b..9dbba4f 100644
--- a/erpnext/schools/doctype/assessment_plan/assessment_plan.json
+++ b/erpnext/education/doctype/assessment_plan/assessment_plan.json
@@ -633,9 +633,9 @@
  "istable": 0, 
  "max_attachments": 0, 
  "menu_index": 0, 
- "modified": "2017-06-30 08:21:46.535547", 
+ "modified": "2017-11-10 19:12:10.383524", 
  "modified_by": "Administrator", 
- "module": "Schools", 
+ "module": "Education", 
  "name": "Assessment Plan", 
  "name_case": "", 
  "owner": "Administrator", 
diff --git a/erpnext/schools/doctype/assessment_plan/assessment_plan.py b/erpnext/education/doctype/assessment_plan/assessment_plan.py
similarity index 96%
rename from erpnext/schools/doctype/assessment_plan/assessment_plan.py
rename to erpnext/education/doctype/assessment_plan/assessment_plan.py
index 55c4148..7ad76b8 100644
--- a/erpnext/schools/doctype/assessment_plan/assessment_plan.py
+++ b/erpnext/education/doctype/assessment_plan/assessment_plan.py
@@ -16,7 +16,7 @@
 	def validate_overlap(self):
 		"""Validates overlap for Student Group, Instructor, Room"""
 		
-		from erpnext.schools.utils import validate_overlap_for
+		from erpnext.education.utils import validate_overlap_for
 
 		#Validate overlapping course schedules.
 		if self.student_group:
diff --git a/erpnext/schools/doctype/assessment_plan/test_assessment_plan.js b/erpnext/education/doctype/assessment_plan/test_assessment_plan.js
similarity index 96%
rename from erpnext/schools/doctype/assessment_plan/test_assessment_plan.js
rename to erpnext/education/doctype/assessment_plan/test_assessment_plan.js
index faa39bf..b0bff26 100644
--- a/erpnext/schools/doctype/assessment_plan/test_assessment_plan.js
+++ b/erpnext/education/doctype/assessment_plan/test_assessment_plan.js
@@ -1,5 +1,5 @@
-// Testing Assessment Module in Schools
-QUnit.module('schools');
+// Testing Assessment Module in education
+QUnit.module('education');
 
 QUnit.test('Test: Assessment Plan', function(assert){
 	assert.expect(6);
diff --git a/erpnext/schools/doctype/assessment_plan/test_assessment_plan.py b/erpnext/education/doctype/assessment_plan/test_assessment_plan.py
similarity index 100%
rename from erpnext/schools/doctype/assessment_plan/test_assessment_plan.py
rename to erpnext/education/doctype/assessment_plan/test_assessment_plan.py
diff --git a/erpnext/schools/doctype/assessment_plan_criteria/__init__.py b/erpnext/education/doctype/assessment_plan_criteria/__init__.py
similarity index 100%
rename from erpnext/schools/doctype/assessment_plan_criteria/__init__.py
rename to erpnext/education/doctype/assessment_plan_criteria/__init__.py
diff --git a/erpnext/schools/doctype/assessment_plan_criteria/assessment_plan_criteria.json b/erpnext/education/doctype/assessment_plan_criteria/assessment_plan_criteria.json
similarity index 97%
rename from erpnext/schools/doctype/assessment_plan_criteria/assessment_plan_criteria.json
rename to erpnext/education/doctype/assessment_plan_criteria/assessment_plan_criteria.json
index cf985f6..d9ad0cb 100644
--- a/erpnext/schools/doctype/assessment_plan_criteria/assessment_plan_criteria.json
+++ b/erpnext/education/doctype/assessment_plan_criteria/assessment_plan_criteria.json
@@ -115,9 +115,9 @@
  "issingle": 0, 
  "istable": 1, 
  "max_attachments": 0, 
- "modified": "2017-06-30 08:21:46.732666", 
+ "modified": "2017-11-10 19:10:50.560006", 
  "modified_by": "Administrator", 
- "module": "Schools", 
+ "module": "Education", 
  "name": "Assessment Plan Criteria", 
  "name_case": "", 
  "owner": "Administrator", 
diff --git a/erpnext/schools/doctype/assessment_plan_criteria/assessment_plan_criteria.py b/erpnext/education/doctype/assessment_plan_criteria/assessment_plan_criteria.py
similarity index 100%
rename from erpnext/schools/doctype/assessment_plan_criteria/assessment_plan_criteria.py
rename to erpnext/education/doctype/assessment_plan_criteria/assessment_plan_criteria.py
diff --git a/erpnext/schools/doctype/assessment_result/__init__.py b/erpnext/education/doctype/assessment_result/__init__.py
similarity index 100%
rename from erpnext/schools/doctype/assessment_result/__init__.py
rename to erpnext/education/doctype/assessment_result/__init__.py
diff --git a/erpnext/schools/doctype/assessment_result/assessment_result.js b/erpnext/education/doctype/assessment_result/assessment_result.js
similarity index 92%
rename from erpnext/schools/doctype/assessment_result/assessment_result.js
rename to erpnext/education/doctype/assessment_result/assessment_result.js
index 6d20896..d1115a7 100644
--- a/erpnext/schools/doctype/assessment_result/assessment_result.js
+++ b/erpnext/education/doctype/assessment_result/assessment_result.js
@@ -9,7 +9,7 @@
 	assessment_plan: function(frm) {
 		if (frm.doc.assessment_plan) {
 			frappe.call({
-				method: "erpnext.schools.api.get_assessment_details",
+				method: "erpnext.education.api.get_assessment_details",
 				args: {
 					assessment_plan: frm.doc.assessment_plan
 				},
@@ -37,7 +37,7 @@
 		}
 		else {
 			frappe.call({
-				method: "erpnext.schools.api.get_grade",
+				method: "erpnext.education.api.get_grade",
 				args: {
 					grading_scale: frm.doc.grading_scale,
 					percentage: ((d.score/d.maximum_score) * 100)
diff --git a/erpnext/schools/doctype/assessment_result/assessment_result.json b/erpnext/education/doctype/assessment_result/assessment_result.json
similarity index 99%
rename from erpnext/schools/doctype/assessment_result/assessment_result.json
rename to erpnext/education/doctype/assessment_result/assessment_result.json
index 13b927c..3912587 100644
--- a/erpnext/schools/doctype/assessment_result/assessment_result.json
+++ b/erpnext/education/doctype/assessment_result/assessment_result.json
@@ -474,9 +474,9 @@
  "issingle": 0, 
  "istable": 0, 
  "max_attachments": 0, 
- "modified": "2017-08-31 15:39:24.813328", 
+ "modified": "2017-11-10 18:58:32.114529", 
  "modified_by": "Administrator", 
- "module": "Schools", 
+ "module": "Education", 
  "name": "Assessment Result", 
  "name_case": "", 
  "owner": "Administrator", 
diff --git a/erpnext/schools/doctype/assessment_result/assessment_result.py b/erpnext/education/doctype/assessment_result/assessment_result.py
similarity index 94%
rename from erpnext/schools/doctype/assessment_result/assessment_result.py
rename to erpnext/education/doctype/assessment_result/assessment_result.py
index 3c036dd..7459d5a 100644
--- a/erpnext/schools/doctype/assessment_result/assessment_result.py
+++ b/erpnext/education/doctype/assessment_result/assessment_result.py
@@ -7,8 +7,8 @@
 from frappe import _
 from frappe.utils import flt
 from frappe.model.document import Document
-from erpnext.schools.api import get_grade
-from erpnext.schools.api import get_assessment_details
+from erpnext.education.api import get_grade
+from erpnext.education.api import get_assessment_details
 from frappe.utils.csvutils import getlink
 
 
diff --git a/erpnext/schools/doctype/assessment_result/test_assessment_result.js b/erpnext/education/doctype/assessment_result/test_assessment_result.js
similarity index 95%
rename from erpnext/schools/doctype/assessment_result/test_assessment_result.js
rename to erpnext/education/doctype/assessment_result/test_assessment_result.js
index 1ed249a..b7adfac 100644
--- a/erpnext/schools/doctype/assessment_result/test_assessment_result.js
+++ b/erpnext/education/doctype/assessment_result/test_assessment_result.js
@@ -1,5 +1,5 @@
-// School Assessment module
-QUnit.module('schools');
+// Education Assessment module
+QUnit.module('education');
 
 QUnit.test('Test: Assessment Result', function(assert){
 	assert.expect(25);
@@ -46,7 +46,7 @@
 						assert.equal(cur_frm.doc.maximum_score, assessment_plan.message.maximum_assessment_score, 'Maximum score correctly fetched');
 
 						frappe.call({
-							method: "erpnext.schools.api.get_grade",
+							method: "erpnext.education.api.get_grade",
 							args: {
 								"grading_scale": assessment_plan.message.grading_scale,
 								"percentage": cur_frm.doc.total_score
diff --git a/erpnext/schools/doctype/assessment_result/test_assessment_result.py b/erpnext/education/doctype/assessment_result/test_assessment_result.py
similarity index 91%
rename from erpnext/schools/doctype/assessment_result/test_assessment_result.py
rename to erpnext/education/doctype/assessment_result/test_assessment_result.py
index 66e611c..bf12b32 100644
--- a/erpnext/schools/doctype/assessment_result/test_assessment_result.py
+++ b/erpnext/education/doctype/assessment_result/test_assessment_result.py
@@ -5,7 +5,7 @@
 
 import frappe
 import unittest
-from erpnext.schools.api import get_grade
+from erpnext.education.api import get_grade
 
 # test_records = frappe.get_test_records('Assessment Result')
 
diff --git a/erpnext/schools/doctype/assessment_result_detail/__init__.py b/erpnext/education/doctype/assessment_result_detail/__init__.py
similarity index 100%
rename from erpnext/schools/doctype/assessment_result_detail/__init__.py
rename to erpnext/education/doctype/assessment_result_detail/__init__.py
diff --git a/erpnext/schools/doctype/assessment_result_detail/assessment_result_detail.json b/erpnext/education/doctype/assessment_result_detail/assessment_result_detail.json
similarity index 98%
rename from erpnext/schools/doctype/assessment_result_detail/assessment_result_detail.json
rename to erpnext/education/doctype/assessment_result_detail/assessment_result_detail.json
index e7076bc..85d943b 100644
--- a/erpnext/schools/doctype/assessment_result_detail/assessment_result_detail.json
+++ b/erpnext/education/doctype/assessment_result_detail/assessment_result_detail.json
@@ -175,9 +175,9 @@
  "issingle": 0, 
  "istable": 1, 
  "max_attachments": 0, 
- "modified": "2017-06-30 08:21:47.068704", 
+ "modified": "2017-11-10 19:11:14.362410", 
  "modified_by": "Administrator", 
- "module": "Schools", 
+ "module": "Education", 
  "name": "Assessment Result Detail", 
  "name_case": "", 
  "owner": "Administrator", 
diff --git a/erpnext/schools/doctype/assessment_result_detail/assessment_result_detail.py b/erpnext/education/doctype/assessment_result_detail/assessment_result_detail.py
similarity index 100%
rename from erpnext/schools/doctype/assessment_result_detail/assessment_result_detail.py
rename to erpnext/education/doctype/assessment_result_detail/assessment_result_detail.py
diff --git a/erpnext/schools/doctype/assessment_result_tool/__init__.py b/erpnext/education/doctype/assessment_result_tool/__init__.py
similarity index 100%
rename from erpnext/schools/doctype/assessment_result_tool/__init__.py
rename to erpnext/education/doctype/assessment_result_tool/__init__.py
diff --git a/erpnext/schools/doctype/assessment_result_tool/assessment_result_tool.js b/erpnext/education/doctype/assessment_result_tool/assessment_result_tool.js
similarity index 94%
rename from erpnext/schools/doctype/assessment_result_tool/assessment_result_tool.js
rename to erpnext/education/doctype/assessment_result_tool/assessment_result_tool.js
index 142bbf4..4823791 100644
--- a/erpnext/schools/doctype/assessment_result_tool/assessment_result_tool.js
+++ b/erpnext/education/doctype/assessment_result_tool/assessment_result_tool.js
@@ -25,7 +25,7 @@
 			if (!frm.doc.student_group)
 				return
 			frappe.call({
-				method: "erpnext.schools.api.get_assessment_students",
+				method: "erpnext.education.api.get_assessment_students",
 				args: {
 					"assessment_plan": frm.doc.assessment_plan,
 					"student_group": frm.doc.student_group
@@ -49,7 +49,7 @@
 		$(frm.fields_dict.result_html.wrapper).empty();
 		let assessment_plan = frm.doc.assessment_plan;
 		frappe.call({
-			method: "erpnext.schools.api.get_assessment_details",
+			method: "erpnext.education.api.get_assessment_details",
 			args: {
 				assessment_plan: assessment_plan
 			},
@@ -106,7 +106,7 @@
 					student_scores["comment"] = $(input).val();
 				});
 				frappe.call({
-					method: "erpnext.schools.api.mark_assessment_result",
+					method: "erpnext.education.api.mark_assessment_result",
 					args: {
 						"assessment_plan": frm.doc.assessment_plan,
 						"scores": student_scores
@@ -137,7 +137,7 @@
 		if (frm.doc.show_submit) {
 			frm.page.set_primary_action(__("Submit"), function() {
 				frappe.call({
-					method: "erpnext.schools.api.submit_assessment_results",
+					method: "erpnext.education.api.submit_assessment_results",
 					args: {
 						"assessment_plan": frm.doc.assessment_plan,
 						"student_group": frm.doc.student_group
diff --git a/erpnext/schools/doctype/assessment_result_tool/assessment_result_tool.json b/erpnext/education/doctype/assessment_result_tool/assessment_result_tool.json
similarity index 98%
rename from erpnext/schools/doctype/assessment_result_tool/assessment_result_tool.json
rename to erpnext/education/doctype/assessment_result_tool/assessment_result_tool.json
index 116fbad..1ea5062 100644
--- a/erpnext/schools/doctype/assessment_result_tool/assessment_result_tool.json
+++ b/erpnext/education/doctype/assessment_result_tool/assessment_result_tool.json
@@ -175,9 +175,9 @@
  "issingle": 1, 
  "istable": 0, 
  "max_attachments": 0, 
- "modified": "2017-11-08 11:51:43.247815", 
+ "modified": "2017-11-10 18:55:54.438981", 
  "modified_by": "Administrator", 
- "module": "Schools", 
+ "module": "Education", 
  "name": "Assessment Result Tool", 
  "name_case": "", 
  "owner": "Administrator", 
diff --git a/erpnext/schools/doctype/assessment_result_tool/assessment_result_tool.py b/erpnext/education/doctype/assessment_result_tool/assessment_result_tool.py
similarity index 100%
rename from erpnext/schools/doctype/assessment_result_tool/assessment_result_tool.py
rename to erpnext/education/doctype/assessment_result_tool/assessment_result_tool.py
diff --git a/erpnext/schools/doctype/assessment_result_tool/test_assessment_result_tool.js b/erpnext/education/doctype/assessment_result_tool/test_assessment_result_tool.js
similarity index 93%
rename from erpnext/schools/doctype/assessment_result_tool/test_assessment_result_tool.js
rename to erpnext/education/doctype/assessment_result_tool/test_assessment_result_tool.js
index 7d9c7d3..0bbe331 100644
--- a/erpnext/schools/doctype/assessment_result_tool/test_assessment_result_tool.js
+++ b/erpnext/education/doctype/assessment_result_tool/test_assessment_result_tool.js
@@ -1,5 +1,5 @@
-// School Assessment module
-QUnit.module('schools');
+// Education Assessment module
+QUnit.module('education');
 
 QUnit.test('Test: Assessment Result Tool', function(assert){
 	assert.expect(1);
diff --git a/erpnext/accounts/doctype/asset_category/test_asset_category.py b/erpnext/education/doctype/assessment_result_tool/test_assessment_result_tool.py
similarity index 78%
copy from erpnext/accounts/doctype/asset_category/test_asset_category.py
copy to erpnext/education/doctype/assessment_result_tool/test_assessment_result_tool.py
index 4d5169a..f784ccb 100644
--- a/erpnext/accounts/doctype/asset_category/test_asset_category.py
+++ b/erpnext/education/doctype/assessment_result_tool/test_assessment_result_tool.py
@@ -6,5 +6,5 @@
 import frappe
 import unittest
 
-class TestAssetCategory(unittest.TestCase):
+class TestAssessmentResultTool(unittest.TestCase):
 	pass
diff --git a/erpnext/schools/doctype/course/__init__.py b/erpnext/education/doctype/course/__init__.py
similarity index 100%
rename from erpnext/schools/doctype/course/__init__.py
rename to erpnext/education/doctype/course/__init__.py
diff --git a/erpnext/schools/doctype/course/course.js b/erpnext/education/doctype/course/course.js
similarity index 100%
rename from erpnext/schools/doctype/course/course.js
rename to erpnext/education/doctype/course/course.js
diff --git a/erpnext/schools/doctype/course/course.json b/erpnext/education/doctype/course/course.json
similarity index 98%
rename from erpnext/schools/doctype/course/course.json
rename to erpnext/education/doctype/course/course.json
index d2f1722..15360f8 100644
--- a/erpnext/schools/doctype/course/course.json
+++ b/erpnext/education/doctype/course/course.json
@@ -356,9 +356,9 @@
  "istable": 0, 
  "max_attachments": 0, 
  "menu_index": 0, 
- "modified": "2017-06-30 08:21:47.260549", 
+ "modified": "2017-11-10 19:06:28.909585", 
  "modified_by": "Administrator", 
- "module": "Schools", 
+ "module": "Education", 
  "name": "Course", 
  "name_case": "", 
  "owner": "Administrator", 
diff --git a/erpnext/schools/doctype/course/course.py b/erpnext/education/doctype/course/course.py
similarity index 100%
rename from erpnext/schools/doctype/course/course.py
rename to erpnext/education/doctype/course/course.py
diff --git a/erpnext/schools/doctype/course/test_course.js b/erpnext/education/doctype/course/test_course.js
similarity index 94%
rename from erpnext/schools/doctype/course/test_course.js
rename to erpnext/education/doctype/course/test_course.js
index 4866730..88fddc2 100644
--- a/erpnext/schools/doctype/course/test_course.js
+++ b/erpnext/education/doctype/course/test_course.js
@@ -1,5 +1,5 @@
-// Testing Setup Module in Schools
-QUnit.module('schools');
+// Testing Setup Module in education
+QUnit.module('education');
 
 QUnit.test('test course', function(assert) {
 	assert.expect(8);
diff --git a/erpnext/schools/doctype/course/test_course.py b/erpnext/education/doctype/course/test_course.py
similarity index 100%
rename from erpnext/schools/doctype/course/test_course.py
rename to erpnext/education/doctype/course/test_course.py
diff --git a/erpnext/schools/doctype/course/test_records.json b/erpnext/education/doctype/course/test_records.json
similarity index 100%
rename from erpnext/schools/doctype/course/test_records.json
rename to erpnext/education/doctype/course/test_records.json
diff --git a/erpnext/schools/doctype/course_assessment_criteria/__init__.py b/erpnext/education/doctype/course_assessment_criteria/__init__.py
similarity index 100%
rename from erpnext/schools/doctype/course_assessment_criteria/__init__.py
rename to erpnext/education/doctype/course_assessment_criteria/__init__.py
diff --git a/erpnext/schools/doctype/course_assessment_criteria/course_assessment_criteria.json b/erpnext/education/doctype/course_assessment_criteria/course_assessment_criteria.json
similarity index 97%
rename from erpnext/schools/doctype/course_assessment_criteria/course_assessment_criteria.json
rename to erpnext/education/doctype/course_assessment_criteria/course_assessment_criteria.json
index 73d0487..2d8c0b3 100644
--- a/erpnext/schools/doctype/course_assessment_criteria/course_assessment_criteria.json
+++ b/erpnext/education/doctype/course_assessment_criteria/course_assessment_criteria.json
@@ -115,9 +115,9 @@
  "issingle": 0, 
  "istable": 1, 
  "max_attachments": 0, 
- "modified": "2017-06-30 08:21:47.420656", 
+ "modified": "2017-11-10 19:10:44.710837", 
  "modified_by": "Administrator", 
- "module": "Schools", 
+ "module": "Education", 
  "name": "Course Assessment Criteria", 
  "name_case": "", 
  "owner": "Administrator", 
diff --git a/erpnext/schools/doctype/course_assessment_criteria/course_assessment_criteria.py b/erpnext/education/doctype/course_assessment_criteria/course_assessment_criteria.py
similarity index 100%
rename from erpnext/schools/doctype/course_assessment_criteria/course_assessment_criteria.py
rename to erpnext/education/doctype/course_assessment_criteria/course_assessment_criteria.py
diff --git a/erpnext/schools/doctype/course_schedule/__init__.py b/erpnext/education/doctype/course_schedule/__init__.py
similarity index 100%
rename from erpnext/schools/doctype/course_schedule/__init__.py
rename to erpnext/education/doctype/course_schedule/__init__.py
diff --git a/erpnext/schools/doctype/course_schedule/course_schedule.js b/erpnext/education/doctype/course_schedule/course_schedule.js
similarity index 92%
rename from erpnext/schools/doctype/course_schedule/course_schedule.js
rename to erpnext/education/doctype/course_schedule/course_schedule.js
index 7778a6e..692c2a8 100644
--- a/erpnext/schools/doctype/course_schedule/course_schedule.js
+++ b/erpnext/education/doctype/course_schedule/course_schedule.js
@@ -1,4 +1,4 @@
-frappe.provide("schools")
+frappe.provide("education");
 
 cur_frm.add_fetch("student_group", "course", "course")
 frappe.ui.form.on("Course Schedule", {
diff --git a/erpnext/schools/doctype/course_schedule/course_schedule.json b/erpnext/education/doctype/course_schedule/course_schedule.json
similarity index 99%
rename from erpnext/schools/doctype/course_schedule/course_schedule.json
rename to erpnext/education/doctype/course_schedule/course_schedule.json
index 68ef233..9049a80 100644
--- a/erpnext/schools/doctype/course_schedule/course_schedule.json
+++ b/erpnext/education/doctype/course_schedule/course_schedule.json
@@ -420,9 +420,9 @@
  "istable": 0, 
  "max_attachments": 0, 
  "menu_index": 0, 
- "modified": "2017-06-30 08:21:47.516781", 
+ "modified": "2017-11-10 19:10:28.797143", 
  "modified_by": "Administrator", 
- "module": "Schools", 
+ "module": "Education", 
  "name": "Course Schedule", 
  "name_case": "", 
  "owner": "Administrator", 
diff --git a/erpnext/schools/doctype/course_schedule/course_schedule.py b/erpnext/education/doctype/course_schedule/course_schedule.py
similarity index 96%
rename from erpnext/schools/doctype/course_schedule/course_schedule.py
rename to erpnext/education/doctype/course_schedule/course_schedule.py
index 845f5f5..5083ff6 100644
--- a/erpnext/schools/doctype/course_schedule/course_schedule.py
+++ b/erpnext/education/doctype/course_schedule/course_schedule.py
@@ -32,7 +32,7 @@
 	def validate_overlap(self):
 		"""Validates overlap for Student Group, Instructor, Room"""
 		
-		from erpnext.schools.utils import validate_overlap_for
+		from erpnext.education.utils import validate_overlap_for
 
 		#Validate overlapping course schedules.
 		if self.student_group:
diff --git a/erpnext/schools/doctype/course_schedule/course_schedule_calendar.js b/erpnext/education/doctype/course_schedule/course_schedule_calendar.js
similarity index 91%
rename from erpnext/schools/doctype/course_schedule/course_schedule_calendar.js
rename to erpnext/education/doctype/course_schedule/course_schedule_calendar.js
index 94ce720..c11405d 100644
--- a/erpnext/schools/doctype/course_schedule/course_schedule_calendar.js
+++ b/erpnext/education/doctype/course_schedule/course_schedule_calendar.js
@@ -34,5 +34,5 @@
 			"label": __("Room")
 		}
 	],
-	get_events_method: "erpnext.schools.api.get_course_schedule_events"
+	get_events_method: "erpnext.education.api.get_course_schedule_events"
 }
diff --git a/erpnext/accounts/doctype/asset_category/test_asset_category.js b/erpnext/education/doctype/course_schedule/test_course_schedule.js
similarity index 70%
copy from erpnext/accounts/doctype/asset_category/test_asset_category.js
copy to erpnext/education/doctype/course_schedule/test_course_schedule.js
index 7e343b7..5cdb67b 100644
--- a/erpnext/accounts/doctype/asset_category/test_asset_category.js
+++ b/erpnext/education/doctype/course_schedule/test_course_schedule.js
@@ -2,15 +2,15 @@
 // rename this file from _test_[name] to test_[name] to activate
 // and remove above this line
 
-QUnit.test("test: Asset Category", function (assert) {
+QUnit.test("test: Course Schedule", function (assert) {
 	let done = assert.async();
 
 	// number of asserts
 	assert.expect(1);
 
 	frappe.run_serially([
-		// insert a new Asset Category
-		() => frappe.tests.make('Asset Category', [
+		// insert a new Course Schedule
+		() => frappe.tests.make('Course Schedule', [
 			// values to be set
 			{key: 'value'}
 		]),
diff --git a/erpnext/schools/doctype/course_schedule/test_course_schedule.py b/erpnext/education/doctype/course_schedule/test_course_schedule.py
similarity index 97%
rename from erpnext/schools/doctype/course_schedule/test_course_schedule.py
rename to erpnext/education/doctype/course_schedule/test_course_schedule.py
index f131382..9ba6bd3 100644
--- a/erpnext/schools/doctype/course_schedule/test_course_schedule.py
+++ b/erpnext/education/doctype/course_schedule/test_course_schedule.py
@@ -8,7 +8,7 @@
 
 import datetime
 from frappe.utils import today, to_timedelta
-from erpnext.schools.utils import OverlapError
+from erpnext.education.utils import OverlapError
 
 # test_records = frappe.get_test_records('Course Schedule')
 
diff --git a/erpnext/schools/doctype/course_scheduling_tool/__init__.py b/erpnext/education/doctype/course_scheduling_tool/__init__.py
similarity index 100%
rename from erpnext/schools/doctype/course_scheduling_tool/__init__.py
rename to erpnext/education/doctype/course_scheduling_tool/__init__.py
diff --git a/erpnext/education/doctype/course_scheduling_tool/course_scheduling_tool.js b/erpnext/education/doctype/course_scheduling_tool/course_scheduling_tool.js
new file mode 100644
index 0000000..20503f9
--- /dev/null
+++ b/erpnext/education/doctype/course_scheduling_tool/course_scheduling_tool.js
@@ -0,0 +1,39 @@
+// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
+// For license information, please see license.txt
+
+
+frappe.ui.form.on('Course Scheduling Tool', {
+	setup(frm) {
+		frm.add_fetch('student_group', 'program', 'program');
+		frm.add_fetch('student_group', 'course', 'course');
+		frm.add_fetch('student_group', 'academic_year', 'academic_year');
+		frm.add_fetch('student_group', 'academic_term', 'academic_term');
+	},
+	refresh(frm) {
+		frm.disable_save();
+		frm.page.set_primary_action(__('Schedule Course'), () => {
+			frm.call('schedule_course')
+				.then(r => {
+					if (!r.message) {
+						frappe.throw(__('There were errors creating Course Schedule'));
+					}
+					const { course_schedules } = r.message;
+					if (course_schedules) {
+						const html = `
+						<table class="table table-bordered">
+							<caption>${__('Following course schedules were created')}</caption>
+							<thead><tr><th>${__("Course")}</th><th>${__("Date")}</th></tr></thead>
+							<tbody>
+								${course_schedules.map(
+									c => `<tr><td><a href="#Form/Course Schedule/${c.name}">${c.name}</a></td>
+									<td>${c.schedule_date}</td></tr>`
+								).join('')}
+							</tbody>
+						</table>`
+
+						frappe.msgprint(html);
+					}
+				});
+		});
+	}
+});
\ No newline at end of file
diff --git a/erpnext/schools/doctype/course_scheduling_tool/course_scheduling_tool.json b/erpnext/education/doctype/course_scheduling_tool/course_scheduling_tool.json
similarity index 98%
rename from erpnext/schools/doctype/course_scheduling_tool/course_scheduling_tool.json
rename to erpnext/education/doctype/course_scheduling_tool/course_scheduling_tool.json
index e0fc1e2..11932fe 100644
--- a/erpnext/schools/doctype/course_scheduling_tool/course_scheduling_tool.json
+++ b/erpnext/education/doctype/course_scheduling_tool/course_scheduling_tool.json
@@ -476,7 +476,7 @@
    "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
-   "fieldname": "rechedule", 
+   "fieldname": "reschedule", 
    "fieldtype": "Check", 
    "hidden": 0, 
    "ignore_user_permissions": 0, 
@@ -485,7 +485,7 @@
    "in_global_search": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
-   "label": "Rechedule", 
+   "label": "Reschedule", 
    "length": 0, 
    "no_copy": 0, 
    "permlevel": 0, 
@@ -602,9 +602,9 @@
  "istable": 0, 
  "max_attachments": 0, 
  "menu_index": 0, 
- "modified": "2017-06-30 08:21:47.696063", 
+ "modified": "2017-11-21 16:47:58.091740", 
  "modified_by": "Administrator", 
- "module": "Schools", 
+ "module": "Education", 
  "name": "Course Scheduling Tool", 
  "name_case": "", 
  "owner": "Administrator", 
diff --git a/erpnext/education/doctype/course_scheduling_tool/course_scheduling_tool.py b/erpnext/education/doctype/course_scheduling_tool/course_scheduling_tool.py
new file mode 100644
index 0000000..97c29ab
--- /dev/null
+++ b/erpnext/education/doctype/course_scheduling_tool/course_scheduling_tool.py
@@ -0,0 +1,114 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors
+# For license information, please see license.txt
+
+from __future__ import unicode_literals
+import frappe
+import calendar
+from frappe import _
+from frappe.model.document import Document
+from frappe.utils import add_days, getdate
+from erpnext.education.utils import OverlapError
+
+
+class CourseSchedulingTool(Document):
+
+	def schedule_course(self):
+		"""Creates course schedules as per specified parameters"""
+
+		course_schedules = []
+		course_schedules_errors = []
+		rescheduled = []
+		reschedule_errors = []
+
+		self.validate_mandatory()
+		self.validate_date()
+		self.instructor_name = frappe.db.get_value(
+			"Instructor", self.instructor, "instructor_name")
+
+		group_based_on, course = frappe.db.get_value(
+			"Student Group", self.student_group, ["group_based_on", "course"])
+
+		if group_based_on == "Course":
+			self.course = course
+
+		if self.reschedule:
+			rescheduled, reschedule_errors = self.delete_course_schedule(
+				rescheduled, reschedule_errors)
+
+		date = self.course_start_date
+		while date < self.course_end_date:
+			if self.day == calendar.day_name[getdate(date).weekday()]:
+				course_schedule = self.make_course_schedule(date)
+				try:
+					print('pass')
+					course_schedule.save()
+				except OverlapError:
+					print('fail')
+					course_schedules_errors.append(date)
+				else:
+					course_schedules.append(course_schedule)
+
+				date = add_days(date, 7)
+			else:
+				date = add_days(date, 1)
+
+		return dict(
+			course_schedules=course_schedules,
+			course_schedules_errors=course_schedules_errors,
+			rescheduled=rescheduled,
+			reschedule_errors=reschedule_errors
+		)
+
+	def validate_mandatory(self):
+		"""Validates all mandatory fields"""
+
+		fields = ['course', 'room', 'instructor', 'from_time',
+				  'to_time', 'course_start_date', 'course_end_date', 'day']
+		for d in fields:
+			if not self.get(d):
+				frappe.throw(_("{0} is mandatory").format(
+					self.meta.get_label(d)))
+
+	def validate_date(self):
+		"""Validates if Course Start Date is greater than Course End Date"""
+		if self.course_start_date > self.course_end_date:
+			frappe.throw(
+				"Course Start Date cannot be greater than Course End Date.")
+
+	def delete_course_schedule(self, rescheduled, reschedule_errors):
+		"""Delete all course schedule within the Date range and specified filters"""
+
+		schedules = frappe.get_list("Course Schedule",
+			fields=["name", "schedule_date"],
+			filters=[
+				["student_group", "=", self.student_group],
+				["course", "=", self.course],
+				["schedule_date", ">=", self.course_start_date],
+				["schedule_date", "<=", self.course_end_date]
+			]
+		)
+
+		for d in schedules:
+			try:
+				if self.day == calendar.day_name[getdate(d.schedule_date).weekday()]:
+					frappe.delete_doc("Course Schedule", d.name)
+					rescheduled.append(d.name)
+			except:
+				reschedule_errors.append(d.name)
+		return rescheduled, reschedule_errors
+
+	def make_course_schedule(self, date):
+		"""Makes a new Course Schedule.
+		:param date: Date on which Course Schedule will be created."""
+
+		course_schedule = frappe.new_doc("Course Schedule")
+		course_schedule.student_group = self.student_group
+		course_schedule.course = self.course
+		course_schedule.instructor = self.instructor
+		course_schedule.instructor_name = self.instructor_name
+		course_schedule.room = self.room
+		course_schedule.schedule_date = date
+		course_schedule.from_time = self.from_time
+		course_schedule.to_time = self.to_time
+		return course_schedule
diff --git a/erpnext/accounts/doctype/asset_category/test_asset_category.js b/erpnext/education/doctype/course_scheduling_tool/test_course_scheduling_tool.js
similarity index 67%
copy from erpnext/accounts/doctype/asset_category/test_asset_category.js
copy to erpnext/education/doctype/course_scheduling_tool/test_course_scheduling_tool.js
index 7e343b7..4419d18 100644
--- a/erpnext/accounts/doctype/asset_category/test_asset_category.js
+++ b/erpnext/education/doctype/course_scheduling_tool/test_course_scheduling_tool.js
@@ -2,15 +2,15 @@
 // rename this file from _test_[name] to test_[name] to activate
 // and remove above this line
 
-QUnit.test("test: Asset Category", function (assert) {
+QUnit.test("test: Course Scheduling Tool", function (assert) {
 	let done = assert.async();
 
 	// number of asserts
 	assert.expect(1);
 
 	frappe.run_serially([
-		// insert a new Asset Category
-		() => frappe.tests.make('Asset Category', [
+		// insert a new Course Scheduling Tool
+		() => frappe.tests.make('Course Scheduling Tool', [
 			// values to be set
 			{key: 'value'}
 		]),
diff --git a/erpnext/accounts/doctype/asset_category/test_asset_category.py b/erpnext/education/doctype/course_scheduling_tool/test_course_scheduling_tool.py
similarity index 78%
copy from erpnext/accounts/doctype/asset_category/test_asset_category.py
copy to erpnext/education/doctype/course_scheduling_tool/test_course_scheduling_tool.py
index 4d5169a..d921f8e 100644
--- a/erpnext/accounts/doctype/asset_category/test_asset_category.py
+++ b/erpnext/education/doctype/course_scheduling_tool/test_course_scheduling_tool.py
@@ -6,5 +6,5 @@
 import frappe
 import unittest
 
-class TestAssetCategory(unittest.TestCase):
+class TestCourseSchedulingTool(unittest.TestCase):
 	pass
diff --git a/erpnext/schools/doctype/school_settings/__init__.py b/erpnext/education/doctype/education_settings/__init__.py
similarity index 100%
rename from erpnext/schools/doctype/school_settings/__init__.py
rename to erpnext/education/doctype/education_settings/__init__.py
diff --git a/erpnext/accounts/doctype/asset/asset.js b/erpnext/education/doctype/education_settings/education_settings.js
similarity index 78%
rename from erpnext/accounts/doctype/asset/asset.js
rename to erpnext/education/doctype/education_settings/education_settings.js
index 6693d3b..764d8b4 100644
--- a/erpnext/accounts/doctype/asset/asset.js
+++ b/erpnext/education/doctype/education_settings/education_settings.js
@@ -1,7 +1,7 @@
 // Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
-frappe.ui.form.on('Asset', {
+frappe.ui.form.on('Education Settings', {
 	refresh: function(frm) {
 
 	}
diff --git a/erpnext/schools/doctype/school_settings/school_settings.json b/erpnext/education/doctype/education_settings/education_settings.json
similarity index 97%
rename from erpnext/schools/doctype/school_settings/school_settings.json
rename to erpnext/education/doctype/education_settings/education_settings.json
index b6d9890..2771ad6 100644
--- a/erpnext/schools/doctype/school_settings/school_settings.json
+++ b/erpnext/education/doctype/education_settings/education_settings.json
@@ -267,10 +267,10 @@
  "issingle": 1, 
  "istable": 0, 
  "max_attachments": 0, 
- "modified": "2017-08-25 02:36:48.744456", 
+ "modified": "2017-11-16 13:23:06.124735", 
  "modified_by": "Administrator", 
- "module": "Schools", 
- "name": "School Settings", 
+ "module": "Education", 
+ "name": "Education Settings", 
  "name_case": "", 
  "owner": "Administrator", 
  "permissions": [
diff --git a/erpnext/schools/doctype/school_settings/school_settings.py b/erpnext/education/doctype/education_settings/education_settings.py
similarity index 85%
rename from erpnext/schools/doctype/school_settings/school_settings.py
rename to erpnext/education/doctype/education_settings/education_settings.py
index 88235cf..9286efa 100644
--- a/erpnext/schools/doctype/school_settings/school_settings.py
+++ b/erpnext/education/doctype/education_settings/education_settings.py
@@ -7,7 +7,7 @@
 import frappe.defaults
 from frappe.model.document import Document
 
-school_keydict = {
+education_keydict = {
 	# "key in defaults": "key in Global Defaults"
 	"academic_year": "current_academic_year",
 	"academic_term": "current_academic_term",
@@ -15,11 +15,12 @@
 	"validate_course": "validate_course"
 }
 
-class SchoolSettings(Document):
+
+class EducationSettings(Document):
 	def on_update(self):
 		"""update defaults"""
-		for key in school_keydict:
-			frappe.db.set_default(key, self.get(school_keydict[key], ''))
+		for key in education_keydict:
+			frappe.db.set_default(key, self.get(education_keydict[key], ''))
 
 		# clear cache
 		frappe.clear_cache()
diff --git a/erpnext/schools/doctype/school_settings/test_school_settings.js b/erpnext/education/doctype/education_settings/test_education_settings.js
similarity index 64%
rename from erpnext/schools/doctype/school_settings/test_school_settings.js
rename to erpnext/education/doctype/education_settings/test_education_settings.js
index 6414056..990b0aa 100644
--- a/erpnext/schools/doctype/school_settings/test_school_settings.js
+++ b/erpnext/education/doctype/education_settings/test_education_settings.js
@@ -1,11 +1,17 @@
-// Testing Setup Module in Schools
-QUnit.module('schools');
+/* eslint-disable */
+// rename this file from _test_[name] to test_[name] to activate
+// and remove above this line
 
-QUnit.test("Test: School Settings", function(assert){
-	assert.expect(3);
+// Testing Setup Module in Education
+QUnit.module('education');
+
+QUnit.test("test: Education Settings", function (assert) {
 	let done = assert.async();
+
+	assert.expect(3);
+
 	frappe.run_serially([
-		() => frappe.set_route("List", "School Settings"),
+		() => frappe.set_route("List", "Education Settings"),
 		() => frappe.timeout(0.4),
 		() => {
 			return frappe.tests.set_form_values(cur_frm, [
@@ -22,4 +28,4 @@
 		},
 		() => done()
 	]);
-});
\ No newline at end of file
+});
diff --git a/erpnext/accounts/doctype/asset_category/test_asset_category.py b/erpnext/education/doctype/education_settings/test_education_settings.py
similarity index 79%
rename from erpnext/accounts/doctype/asset_category/test_asset_category.py
rename to erpnext/education/doctype/education_settings/test_education_settings.py
index 4d5169a..038fb6e 100644
--- a/erpnext/accounts/doctype/asset_category/test_asset_category.py
+++ b/erpnext/education/doctype/education_settings/test_education_settings.py
@@ -6,5 +6,5 @@
 import frappe
 import unittest
 
-class TestAssetCategory(unittest.TestCase):
+class TestEducationSettings(unittest.TestCase):
 	pass
diff --git a/erpnext/schools/doctype/fee_category/__init__.py b/erpnext/education/doctype/fee_category/__init__.py
similarity index 100%
rename from erpnext/schools/doctype/fee_category/__init__.py
rename to erpnext/education/doctype/fee_category/__init__.py
diff --git a/erpnext/schools/doctype/fee_category/fee_category.js b/erpnext/education/doctype/fee_category/fee_category.js
similarity index 100%
rename from erpnext/schools/doctype/fee_category/fee_category.js
rename to erpnext/education/doctype/fee_category/fee_category.js
diff --git a/erpnext/schools/doctype/fee_category/fee_category.json b/erpnext/education/doctype/fee_category/fee_category.json
similarity index 97%
rename from erpnext/schools/doctype/fee_category/fee_category.json
rename to erpnext/education/doctype/fee_category/fee_category.json
index 2b55f8d..c1bfa8e 100644
--- a/erpnext/schools/doctype/fee_category/fee_category.json
+++ b/erpnext/education/doctype/fee_category/fee_category.json
@@ -90,9 +90,9 @@
  "istable": 0, 
  "max_attachments": 0, 
  "menu_index": 0, 
- "modified": "2017-11-02 17:57:18.069158", 
+ "modified": "2017-11-10 18:56:33.824534", 
  "modified_by": "Administrator", 
- "module": "Schools", 
+ "module": "Education", 
  "name": "Fee Category", 
  "name_case": "", 
  "owner": "Administrator", 
diff --git a/erpnext/schools/doctype/fee_category/fee_category.py b/erpnext/education/doctype/fee_category/fee_category.py
similarity index 100%
rename from erpnext/schools/doctype/fee_category/fee_category.py
rename to erpnext/education/doctype/fee_category/fee_category.py
diff --git a/erpnext/accounts/doctype/asset/test_asset.js b/erpnext/education/doctype/fee_category/test_fee_category.js
similarity index 72%
copy from erpnext/accounts/doctype/asset/test_asset.js
copy to erpnext/education/doctype/fee_category/test_fee_category.js
index 6119e38..a08ed33 100644
--- a/erpnext/accounts/doctype/asset/test_asset.js
+++ b/erpnext/education/doctype/fee_category/test_fee_category.js
@@ -2,15 +2,15 @@
 // rename this file from _test_[name] to test_[name] to activate
 // and remove above this line
 
-QUnit.test("test: Asset", function (assert) {
+QUnit.test("test: Fee Category", function (assert) {
 	let done = assert.async();
 
 	// number of asserts
 	assert.expect(1);
 
 	frappe.run_serially([
-		// insert a new Asset
-		() => frappe.tests.make('Asset', [
+		// insert a new Fee Category
+		() => frappe.tests.make('Fee Category', [
 			// values to be set
 			{key: 'value'}
 		]),
diff --git a/erpnext/schools/doctype/fee_category/test_fee_category.py b/erpnext/education/doctype/fee_category/test_fee_category.py
similarity index 100%
rename from erpnext/schools/doctype/fee_category/test_fee_category.py
rename to erpnext/education/doctype/fee_category/test_fee_category.py
diff --git a/erpnext/schools/doctype/fee_category/test_records.json b/erpnext/education/doctype/fee_category/test_records.json
similarity index 100%
rename from erpnext/schools/doctype/fee_category/test_records.json
rename to erpnext/education/doctype/fee_category/test_records.json
diff --git a/erpnext/schools/doctype/fee_component/__init__.py b/erpnext/education/doctype/fee_component/__init__.py
similarity index 100%
rename from erpnext/schools/doctype/fee_component/__init__.py
rename to erpnext/education/doctype/fee_component/__init__.py
diff --git a/erpnext/schools/doctype/fee_component/fee_component.json b/erpnext/education/doctype/fee_component/fee_component.json
similarity index 97%
rename from erpnext/schools/doctype/fee_component/fee_component.json
rename to erpnext/education/doctype/fee_component/fee_component.json
index ccf1f65..f6e13c4 100644
--- a/erpnext/schools/doctype/fee_component/fee_component.json
+++ b/erpnext/education/doctype/fee_component/fee_component.json
@@ -150,9 +150,9 @@
  "issingle": 0, 
  "istable": 1, 
  "max_attachments": 0, 
- "modified": "2017-09-11 16:48:07.810959", 
+ "modified": "2017-11-10 18:58:10.254407", 
  "modified_by": "Administrator", 
- "module": "Schools", 
+ "module": "Education", 
  "name": "Fee Component", 
  "name_case": "", 
  "owner": "Administrator", 
diff --git a/erpnext/schools/doctype/fee_component/fee_component.py b/erpnext/education/doctype/fee_component/fee_component.py
similarity index 100%
rename from erpnext/schools/doctype/fee_component/fee_component.py
rename to erpnext/education/doctype/fee_component/fee_component.py
diff --git a/erpnext/schools/doctype/fee_schedule/__init__.py b/erpnext/education/doctype/fee_schedule/__init__.py
similarity index 100%
rename from erpnext/schools/doctype/fee_schedule/__init__.py
rename to erpnext/education/doctype/fee_schedule/__init__.py
diff --git a/erpnext/schools/doctype/fee_schedule/fee_schedule.js b/erpnext/education/doctype/fee_schedule/fee_schedule.js
similarity index 94%
rename from erpnext/schools/doctype/fee_schedule/fee_schedule.js
rename to erpnext/education/doctype/fee_schedule/fee_schedule.js
index d834b88..a560ea7 100644
--- a/erpnext/schools/doctype/fee_schedule/fee_schedule.js
+++ b/erpnext/education/doctype/fee_schedule/fee_schedule.js
@@ -78,7 +78,7 @@
 	fee_structure: function(frm) {
 		if (frm.doc.fee_structure) {
 			frappe.call({
-				method: "erpnext.schools.doctype.fee_schedule.fee_schedule.get_fee_structure",
+				method: "erpnext.education.doctype.fee_schedule.fee_schedule.get_fee_structure",
 				args: {
 					"target_doc": frm.doc.name,
 					"source_name": frm.doc.fee_structure
@@ -96,7 +96,7 @@
 	student_group: function(frm, cdt, cdn) {
 		var row = locals[cdt][cdn];
 		frappe.call({
-			method: "erpnext.schools.doctype.fee_schedule.fee_schedule.get_total_students",
+			method: "erpnext.education.doctype.fee_schedule.fee_schedule.get_total_students",
 			args: {
 				"student_group": row.student_group,
 				"academic_year": frm.doc.academic_year,
diff --git a/erpnext/schools/doctype/fee_schedule/fee_schedule.json b/erpnext/education/doctype/fee_schedule/fee_schedule.json
similarity index 99%
rename from erpnext/schools/doctype/fee_schedule/fee_schedule.json
rename to erpnext/education/doctype/fee_schedule/fee_schedule.json
index ab60911..a1ea9bd 100644
--- a/erpnext/schools/doctype/fee_schedule/fee_schedule.json
+++ b/erpnext/education/doctype/fee_schedule/fee_schedule.json
@@ -1029,9 +1029,9 @@
  "issingle": 0, 
  "istable": 0, 
  "max_attachments": 0, 
- "modified": "2017-11-02 17:55:22.851581", 
+ "modified": "2017-11-10 18:56:46.330631", 
  "modified_by": "Administrator", 
- "module": "Schools", 
+ "module": "Education", 
  "name": "Fee Schedule", 
  "name_case": "", 
  "owner": "Administrator", 
diff --git a/erpnext/schools/doctype/fee_schedule/fee_schedule.py b/erpnext/education/doctype/fee_schedule/fee_schedule.py
similarity index 100%
rename from erpnext/schools/doctype/fee_schedule/fee_schedule.py
rename to erpnext/education/doctype/fee_schedule/fee_schedule.py
diff --git a/erpnext/schools/doctype/fee_schedule/fee_schedule_list.js b/erpnext/education/doctype/fee_schedule/fee_schedule_list.js
similarity index 100%
rename from erpnext/schools/doctype/fee_schedule/fee_schedule_list.js
rename to erpnext/education/doctype/fee_schedule/fee_schedule_list.js
diff --git a/erpnext/schools/doctype/fee_schedule/test_fee_schedule.js b/erpnext/education/doctype/fee_schedule/test_fee_schedule.js
similarity index 100%
rename from erpnext/schools/doctype/fee_schedule/test_fee_schedule.js
rename to erpnext/education/doctype/fee_schedule/test_fee_schedule.js
diff --git a/erpnext/schools/doctype/fee_schedule/test_fee_schedule.py b/erpnext/education/doctype/fee_schedule/test_fee_schedule.py
similarity index 100%
rename from erpnext/schools/doctype/fee_schedule/test_fee_schedule.py
rename to erpnext/education/doctype/fee_schedule/test_fee_schedule.py
diff --git a/erpnext/schools/doctype/fee_schedule_program/__init__.py b/erpnext/education/doctype/fee_schedule_program/__init__.py
similarity index 100%
rename from erpnext/schools/doctype/fee_schedule_program/__init__.py
rename to erpnext/education/doctype/fee_schedule_program/__init__.py
diff --git a/erpnext/schools/doctype/fee_schedule_program/fee_schedule_program.json b/erpnext/education/doctype/fee_schedule_program/fee_schedule_program.json
similarity index 97%
rename from erpnext/schools/doctype/fee_schedule_program/fee_schedule_program.json
rename to erpnext/education/doctype/fee_schedule_program/fee_schedule_program.json
index 42cc7bf..e9a5c12 100644
--- a/erpnext/schools/doctype/fee_schedule_program/fee_schedule_program.json
+++ b/erpnext/education/doctype/fee_schedule_program/fee_schedule_program.json
@@ -115,9 +115,9 @@
  "issingle": 0, 
  "istable": 1, 
  "max_attachments": 0, 
- "modified": "2017-08-22 16:24:40.547517", 
+ "modified": "2017-11-10 19:09:02.326827", 
  "modified_by": "Administrator", 
- "module": "Schools", 
+ "module": "Education", 
  "name": "Fee Schedule Program", 
  "name_case": "", 
  "owner": "Administrator", 
diff --git a/erpnext/schools/doctype/fee_schedule_program/fee_schedule_program.py b/erpnext/education/doctype/fee_schedule_program/fee_schedule_program.py
similarity index 100%
rename from erpnext/schools/doctype/fee_schedule_program/fee_schedule_program.py
rename to erpnext/education/doctype/fee_schedule_program/fee_schedule_program.py
diff --git a/erpnext/schools/doctype/fee_schedule_student_group/__init__.py b/erpnext/education/doctype/fee_schedule_student_group/__init__.py
similarity index 100%
rename from erpnext/schools/doctype/fee_schedule_student_group/__init__.py
rename to erpnext/education/doctype/fee_schedule_student_group/__init__.py
diff --git a/erpnext/schools/doctype/fee_schedule_student_group/fee_schedule_student_group.json b/erpnext/education/doctype/fee_schedule_student_group/fee_schedule_student_group.json
similarity index 96%
rename from erpnext/schools/doctype/fee_schedule_student_group/fee_schedule_student_group.json
rename to erpnext/education/doctype/fee_schedule_student_group/fee_schedule_student_group.json
index c80e320..aed1ae5 100644
--- a/erpnext/schools/doctype/fee_schedule_student_group/fee_schedule_student_group.json
+++ b/erpnext/education/doctype/fee_schedule_student_group/fee_schedule_student_group.json
@@ -84,9 +84,9 @@
  "issingle": 0, 
  "istable": 1, 
  "max_attachments": 0, 
- "modified": "2017-08-22 16:23:12.337294", 
+ "modified": "2017-11-10 19:09:19.498184", 
  "modified_by": "Administrator", 
- "module": "Schools", 
+ "module": "Education", 
  "name": "Fee Schedule Student Group", 
  "name_case": "", 
  "owner": "Administrator", 
diff --git a/erpnext/schools/doctype/fee_schedule_student_group/fee_schedule_student_group.py b/erpnext/education/doctype/fee_schedule_student_group/fee_schedule_student_group.py
similarity index 100%
rename from erpnext/schools/doctype/fee_schedule_student_group/fee_schedule_student_group.py
rename to erpnext/education/doctype/fee_schedule_student_group/fee_schedule_student_group.py
diff --git a/erpnext/schools/doctype/fee_structure/__init__.py b/erpnext/education/doctype/fee_structure/__init__.py
similarity index 100%
rename from erpnext/schools/doctype/fee_structure/__init__.py
rename to erpnext/education/doctype/fee_structure/__init__.py
diff --git a/erpnext/schools/doctype/fee_structure/fee_structure.js b/erpnext/education/doctype/fee_structure/fee_structure.js
similarity index 93%
rename from erpnext/schools/doctype/fee_structure/fee_structure.js
rename to erpnext/education/doctype/fee_structure/fee_structure.js
index 300bdc8..812456c 100644
--- a/erpnext/schools/doctype/fee_structure/fee_structure.js
+++ b/erpnext/education/doctype/fee_structure/fee_structure.js
@@ -39,7 +39,7 @@
 
 	make_fee_schedule: function(frm) {
 		frappe.model.open_mapped_doc({
-			method: "erpnext.schools.doctype.fee_structure.fee_structure.make_fee_schedule",
+			method: "erpnext.education.doctype.fee_structure.fee_structure.make_fee_schedule",
 			frm: frm
 		});
 	}
diff --git a/erpnext/schools/doctype/fee_structure/fee_structure.json b/erpnext/education/doctype/fee_structure/fee_structure.json
similarity index 99%
rename from erpnext/schools/doctype/fee_structure/fee_structure.json
rename to erpnext/education/doctype/fee_structure/fee_structure.json
index 2ae0a48..428b1b1 100644
--- a/erpnext/schools/doctype/fee_structure/fee_structure.json
+++ b/erpnext/education/doctype/fee_structure/fee_structure.json
@@ -577,9 +577,9 @@
  "istable": 0, 
  "max_attachments": 0, 
  "menu_index": 0, 
- "modified": "2017-11-02 17:43:16.796845", 
+ "modified": "2017-11-10 18:56:59.698192", 
  "modified_by": "Administrator", 
- "module": "Schools", 
+ "module": "Education", 
  "name": "Fee Structure", 
  "name_case": "", 
  "owner": "Administrator", 
diff --git a/erpnext/schools/doctype/fee_structure/fee_structure.py b/erpnext/education/doctype/fee_structure/fee_structure.py
similarity index 100%
rename from erpnext/schools/doctype/fee_structure/fee_structure.py
rename to erpnext/education/doctype/fee_structure/fee_structure.py
diff --git a/erpnext/schools/doctype/fee_structure/test_fee_structure.js b/erpnext/education/doctype/fee_structure/test_fee_structure.js
similarity index 100%
rename from erpnext/schools/doctype/fee_structure/test_fee_structure.js
rename to erpnext/education/doctype/fee_structure/test_fee_structure.js
diff --git a/erpnext/schools/doctype/fee_structure/test_fee_structure.py b/erpnext/education/doctype/fee_structure/test_fee_structure.py
similarity index 100%
rename from erpnext/schools/doctype/fee_structure/test_fee_structure.py
rename to erpnext/education/doctype/fee_structure/test_fee_structure.py
diff --git a/erpnext/schools/doctype/fee_structure/test_records.json b/erpnext/education/doctype/fee_structure/test_records.json
similarity index 100%
rename from erpnext/schools/doctype/fee_structure/test_records.json
rename to erpnext/education/doctype/fee_structure/test_records.json
diff --git a/erpnext/schools/doctype/fees/__init__.py b/erpnext/education/doctype/fees/__init__.py
similarity index 100%
rename from erpnext/schools/doctype/fees/__init__.py
rename to erpnext/education/doctype/fees/__init__.py
diff --git a/erpnext/schools/doctype/fees/fees.js b/erpnext/education/doctype/fees/fees.js
similarity index 97%
rename from erpnext/schools/doctype/fees/fees.js
rename to erpnext/education/doctype/fees/fees.js
index 4347308..2a7218a 100644
--- a/erpnext/schools/doctype/fees/fees.js
+++ b/erpnext/education/doctype/fees/fees.js
@@ -84,7 +84,7 @@
 	student: function(frm) {
 		if (frm.doc.student) {
 			frappe.call({
-				method:"erpnext.schools.api.get_current_enrollment",
+				method:"erpnext.education.api.get_current_enrollment",
 				args: {
 					"student": frm.doc.student,
 					"academic_year": frm.doc.academic_year
@@ -147,7 +147,7 @@
 		frm.set_value("components" ,"");
 		if (frm.doc.fee_structure) {
 			frappe.call({
-				method: "erpnext.schools.api.get_fee_components",
+				method: "erpnext.education.api.get_fee_components",
 				args: {
 					"fee_structure": frm.doc.fee_structure
 				},
diff --git a/erpnext/schools/doctype/fees/fees.json b/erpnext/education/doctype/fees/fees.json
similarity index 99%
rename from erpnext/schools/doctype/fees/fees.json
rename to erpnext/education/doctype/fees/fees.json
index f34caf7..85c2471 100644
--- a/erpnext/schools/doctype/fees/fees.json
+++ b/erpnext/education/doctype/fees/fees.json
@@ -1305,9 +1305,9 @@
  "istable": 0, 
  "max_attachments": 0, 
  "menu_index": 0, 
- "modified": "2017-11-02 17:31:47.155873", 
+ "modified": "2017-11-10 18:57:12.021112", 
  "modified_by": "Administrator", 
- "module": "Schools", 
+ "module": "Education", 
  "name": "Fees", 
  "name_case": "", 
  "owner": "Administrator", 
diff --git a/erpnext/schools/doctype/fees/fees.py b/erpnext/education/doctype/fees/fees.py
similarity index 100%
rename from erpnext/schools/doctype/fees/fees.py
rename to erpnext/education/doctype/fees/fees.py
diff --git a/erpnext/schools/doctype/fees/fees_list.js b/erpnext/education/doctype/fees/fees_list.js
similarity index 100%
rename from erpnext/schools/doctype/fees/fees_list.js
rename to erpnext/education/doctype/fees/fees_list.js
diff --git a/erpnext/schools/doctype/fees/test_fees.js b/erpnext/education/doctype/fees/test_fees.js
similarity index 100%
rename from erpnext/schools/doctype/fees/test_fees.js
rename to erpnext/education/doctype/fees/test_fees.js
diff --git a/erpnext/schools/doctype/fees/test_fees.py b/erpnext/education/doctype/fees/test_fees.py
similarity index 100%
rename from erpnext/schools/doctype/fees/test_fees.py
rename to erpnext/education/doctype/fees/test_fees.py
diff --git a/erpnext/schools/doctype/grading_scale/__init__.py b/erpnext/education/doctype/grading_scale/__init__.py
similarity index 100%
rename from erpnext/schools/doctype/grading_scale/__init__.py
rename to erpnext/education/doctype/grading_scale/__init__.py
diff --git a/erpnext/schools/doctype/grading_scale/grading_scale.js b/erpnext/education/doctype/grading_scale/grading_scale.js
similarity index 100%
rename from erpnext/schools/doctype/grading_scale/grading_scale.js
rename to erpnext/education/doctype/grading_scale/grading_scale.js
diff --git a/erpnext/schools/doctype/grading_scale/grading_scale.json b/erpnext/education/doctype/grading_scale/grading_scale.json
similarity index 98%
rename from erpnext/schools/doctype/grading_scale/grading_scale.json
rename to erpnext/education/doctype/grading_scale/grading_scale.json
index fdaa8c6..67fef3e 100644
--- a/erpnext/schools/doctype/grading_scale/grading_scale.json
+++ b/erpnext/education/doctype/grading_scale/grading_scale.json
@@ -175,9 +175,9 @@
  "issingle": 0, 
  "istable": 0, 
  "max_attachments": 0, 
- "modified": "2017-06-30 08:21:48.413400", 
+ "modified": "2017-11-10 19:07:22.001040", 
  "modified_by": "Administrator", 
- "module": "Schools", 
+ "module": "Education", 
  "name": "Grading Scale", 
  "name_case": "", 
  "owner": "Administrator", 
diff --git a/erpnext/schools/doctype/grading_scale/grading_scale.py b/erpnext/education/doctype/grading_scale/grading_scale.py
similarity index 100%
rename from erpnext/schools/doctype/grading_scale/grading_scale.py
rename to erpnext/education/doctype/grading_scale/grading_scale.py
diff --git a/erpnext/schools/doctype/grading_scale/test_grading_scale.js b/erpnext/education/doctype/grading_scale/test_grading_scale.js
similarity index 97%
rename from erpnext/schools/doctype/grading_scale/test_grading_scale.js
rename to erpnext/education/doctype/grading_scale/test_grading_scale.js
index c686924..e363545 100644
--- a/erpnext/schools/doctype/grading_scale/test_grading_scale.js
+++ b/erpnext/education/doctype/grading_scale/test_grading_scale.js
@@ -1,5 +1,5 @@
-// School Assessment module
-QUnit.module('schools');
+// Education Assessment module
+QUnit.module('education');
 
 QUnit.test('Test: Grading Scale', function(assert){
 	assert.expect(3);
diff --git a/erpnext/schools/doctype/grading_scale/test_grading_scale.py b/erpnext/education/doctype/grading_scale/test_grading_scale.py
similarity index 100%
rename from erpnext/schools/doctype/grading_scale/test_grading_scale.py
rename to erpnext/education/doctype/grading_scale/test_grading_scale.py
diff --git a/erpnext/schools/doctype/grading_scale/test_records.json b/erpnext/education/doctype/grading_scale/test_records.json
similarity index 100%
rename from erpnext/schools/doctype/grading_scale/test_records.json
rename to erpnext/education/doctype/grading_scale/test_records.json
diff --git a/erpnext/schools/doctype/grading_scale_interval/__init__.py b/erpnext/education/doctype/grading_scale_interval/__init__.py
similarity index 100%
rename from erpnext/schools/doctype/grading_scale_interval/__init__.py
rename to erpnext/education/doctype/grading_scale_interval/__init__.py
diff --git a/erpnext/schools/doctype/grading_scale_interval/grading_scale_interval.json b/erpnext/education/doctype/grading_scale_interval/grading_scale_interval.json
similarity index 97%
rename from erpnext/schools/doctype/grading_scale_interval/grading_scale_interval.json
rename to erpnext/education/doctype/grading_scale_interval/grading_scale_interval.json
index cee83e3..5574e1d 100644
--- a/erpnext/schools/doctype/grading_scale_interval/grading_scale_interval.json
+++ b/erpnext/education/doctype/grading_scale_interval/grading_scale_interval.json
@@ -114,9 +114,9 @@
  "issingle": 0, 
  "istable": 1, 
  "max_attachments": 0, 
- "modified": "2017-06-30 08:21:48.532524", 
+ "modified": "2017-11-10 19:08:48.083084", 
  "modified_by": "Administrator", 
- "module": "Schools", 
+ "module": "Education", 
  "name": "Grading Scale Interval", 
  "name_case": "", 
  "owner": "Administrator", 
diff --git a/erpnext/schools/doctype/grading_scale_interval/grading_scale_interval.py b/erpnext/education/doctype/grading_scale_interval/grading_scale_interval.py
similarity index 100%
rename from erpnext/schools/doctype/grading_scale_interval/grading_scale_interval.py
rename to erpnext/education/doctype/grading_scale_interval/grading_scale_interval.py
diff --git a/erpnext/schools/doctype/guardian/__init__.py b/erpnext/education/doctype/guardian/__init__.py
similarity index 100%
rename from erpnext/schools/doctype/guardian/__init__.py
rename to erpnext/education/doctype/guardian/__init__.py
diff --git a/erpnext/schools/doctype/guardian/guardian.js b/erpnext/education/doctype/guardian/guardian.js
similarity index 100%
rename from erpnext/schools/doctype/guardian/guardian.js
rename to erpnext/education/doctype/guardian/guardian.js
diff --git a/erpnext/schools/doctype/guardian/guardian.json b/erpnext/education/doctype/guardian/guardian.json
similarity index 99%
rename from erpnext/schools/doctype/guardian/guardian.json
rename to erpnext/education/doctype/guardian/guardian.json
index bc4cf4f..500b747 100644
--- a/erpnext/schools/doctype/guardian/guardian.json
+++ b/erpnext/education/doctype/guardian/guardian.json
@@ -476,9 +476,9 @@
  "issingle": 0, 
  "istable": 0, 
  "max_attachments": 0, 
- "modified": "2017-06-30 08:21:48.630678", 
+ "modified": "2017-11-10 19:06:57.122193", 
  "modified_by": "Administrator", 
- "module": "Schools", 
+ "module": "Education", 
  "name": "Guardian", 
  "name_case": "", 
  "owner": "Administrator", 
diff --git a/erpnext/schools/doctype/guardian/guardian.py b/erpnext/education/doctype/guardian/guardian.py
similarity index 100%
rename from erpnext/schools/doctype/guardian/guardian.py
rename to erpnext/education/doctype/guardian/guardian.py
diff --git a/erpnext/schools/doctype/guardian/test_guardian.js b/erpnext/education/doctype/guardian/test_guardian.js
similarity index 93%
rename from erpnext/schools/doctype/guardian/test_guardian.js
rename to erpnext/education/doctype/guardian/test_guardian.js
index a16ba08..9bbfacd 100644
--- a/erpnext/schools/doctype/guardian/test_guardian.js
+++ b/erpnext/education/doctype/guardian/test_guardian.js
@@ -1,5 +1,5 @@
-// Testing Student Module in Schools
-QUnit.module('schools');
+// Testing Student Module in education
+QUnit.module('education');
 
 QUnit.test('Test: Guardian', function(assert){
 	assert.expect(9);
diff --git a/erpnext/schools/doctype/guardian/test_guardian.py b/erpnext/education/doctype/guardian/test_guardian.py
similarity index 100%
rename from erpnext/schools/doctype/guardian/test_guardian.py
rename to erpnext/education/doctype/guardian/test_guardian.py
diff --git a/erpnext/schools/doctype/guardian_interest/__init__.py b/erpnext/education/doctype/guardian_interest/__init__.py
similarity index 100%
rename from erpnext/schools/doctype/guardian_interest/__init__.py
rename to erpnext/education/doctype/guardian_interest/__init__.py
diff --git a/erpnext/schools/doctype/guardian_interest/guardian_interest.json b/erpnext/education/doctype/guardian_interest/guardian_interest.json
similarity index 95%
rename from erpnext/schools/doctype/guardian_interest/guardian_interest.json
rename to erpnext/education/doctype/guardian_interest/guardian_interest.json
index aae2c55..1995c55 100644
--- a/erpnext/schools/doctype/guardian_interest/guardian_interest.json
+++ b/erpnext/education/doctype/guardian_interest/guardian_interest.json
@@ -53,9 +53,9 @@
  "issingle": 0, 
  "istable": 1, 
  "max_attachments": 0, 
- "modified": "2017-06-30 08:21:48.827806", 
+ "modified": "2017-11-10 19:10:22.333454", 
  "modified_by": "Administrator", 
- "module": "Schools", 
+ "module": "Education", 
  "name": "Guardian Interest", 
  "name_case": "", 
  "owner": "Administrator", 
diff --git a/erpnext/schools/doctype/guardian_interest/guardian_interest.py b/erpnext/education/doctype/guardian_interest/guardian_interest.py
similarity index 100%
rename from erpnext/schools/doctype/guardian_interest/guardian_interest.py
rename to erpnext/education/doctype/guardian_interest/guardian_interest.py
diff --git a/erpnext/schools/doctype/guardian_student/__init__.py b/erpnext/education/doctype/guardian_student/__init__.py
similarity index 100%
rename from erpnext/schools/doctype/guardian_student/__init__.py
rename to erpnext/education/doctype/guardian_student/__init__.py
diff --git a/erpnext/schools/doctype/guardian_student/guardian_student.json b/erpnext/education/doctype/guardian_student/guardian_student.json
similarity index 97%
rename from erpnext/schools/doctype/guardian_student/guardian_student.json
rename to erpnext/education/doctype/guardian_student/guardian_student.json
index 4242c9d..2519a54 100644
--- a/erpnext/schools/doctype/guardian_student/guardian_student.json
+++ b/erpnext/education/doctype/guardian_student/guardian_student.json
@@ -113,9 +113,9 @@
  "issingle": 0, 
  "istable": 1, 
  "max_attachments": 0, 
- "modified": "2017-06-30 08:21:48.957516", 
+ "modified": "2017-11-10 19:10:15.786362", 
  "modified_by": "Administrator", 
- "module": "Schools", 
+ "module": "Education", 
  "name": "Guardian Student", 
  "name_case": "", 
  "owner": "Administrator", 
diff --git a/erpnext/schools/doctype/guardian_student/guardian_student.py b/erpnext/education/doctype/guardian_student/guardian_student.py
similarity index 100%
rename from erpnext/schools/doctype/guardian_student/guardian_student.py
rename to erpnext/education/doctype/guardian_student/guardian_student.py
diff --git a/erpnext/schools/doctype/instructor/__init__.py b/erpnext/education/doctype/instructor/__init__.py
similarity index 100%
rename from erpnext/schools/doctype/instructor/__init__.py
rename to erpnext/education/doctype/instructor/__init__.py
diff --git a/erpnext/schools/doctype/instructor/instructor.js b/erpnext/education/doctype/instructor/instructor.js
similarity index 100%
rename from erpnext/schools/doctype/instructor/instructor.js
rename to erpnext/education/doctype/instructor/instructor.js
diff --git a/erpnext/schools/doctype/instructor/instructor.json b/erpnext/education/doctype/instructor/instructor.json
similarity index 98%
rename from erpnext/schools/doctype/instructor/instructor.json
rename to erpnext/education/doctype/instructor/instructor.json
index cd0b4f1..865e07c 100644
--- a/erpnext/schools/doctype/instructor/instructor.json
+++ b/erpnext/education/doctype/instructor/instructor.json
@@ -208,9 +208,9 @@
  "istable": 0, 
  "max_attachments": 0, 
  "menu_index": 0, 
- "modified": "2017-08-25 01:03:14.602994", 
+ "modified": "2017-11-10 19:00:20.354954", 
  "modified_by": "Administrator", 
- "module": "Schools", 
+ "module": "Education", 
  "name": "Instructor", 
  "name_case": "", 
  "owner": "Administrator", 
diff --git a/erpnext/schools/doctype/instructor/instructor.py b/erpnext/education/doctype/instructor/instructor.py
similarity index 78%
rename from erpnext/schools/doctype/instructor/instructor.py
rename to erpnext/education/doctype/instructor/instructor.py
index ba179f7..44a4e4c 100644
--- a/erpnext/schools/doctype/instructor/instructor.py
+++ b/erpnext/education/doctype/instructor/instructor.py
@@ -10,9 +10,9 @@
 
 class Instructor(Document):
 	def autoname(self):
-		naming_method = frappe.db.get_value("School Settings", None, "instructor_created_by")
+		naming_method = frappe.db.get_value("Education Settings", None, "instructor_created_by")
 		if not naming_method:
-			frappe.throw(_("Please setup Instructor Naming System in School > School Settings"))
+			frappe.throw(_("Please setup Instructor Naming System in Education > Education Settings"))
 		else:
 			if naming_method == 'Naming Series':
 				self.name = make_autoname(self.naming_series + '.####')
diff --git a/erpnext/schools/doctype/instructor/test_instructor.js b/erpnext/education/doctype/instructor/test_instructor.js
similarity index 86%
rename from erpnext/schools/doctype/instructor/test_instructor.js
rename to erpnext/education/doctype/instructor/test_instructor.js
index a9e2561..c584f45 100644
--- a/erpnext/schools/doctype/instructor/test_instructor.js
+++ b/erpnext/education/doctype/instructor/test_instructor.js
@@ -1,5 +1,5 @@
-// Testing Setup Module in Schools
-QUnit.module('schools');
+// Testing Setup Module in education
+QUnit.module('education');
 
 QUnit.test('Test: Instructor', function(assert){
 	assert.expect(2);
diff --git a/erpnext/schools/doctype/instructor/test_instructor.py b/erpnext/education/doctype/instructor/test_instructor.py
similarity index 100%
rename from erpnext/schools/doctype/instructor/test_instructor.py
rename to erpnext/education/doctype/instructor/test_instructor.py
diff --git a/erpnext/schools/doctype/instructor/test_records.json b/erpnext/education/doctype/instructor/test_records.json
similarity index 100%
rename from erpnext/schools/doctype/instructor/test_records.json
rename to erpnext/education/doctype/instructor/test_records.json
diff --git a/erpnext/schools/doctype/program/__init__.py b/erpnext/education/doctype/program/__init__.py
similarity index 100%
rename from erpnext/schools/doctype/program/__init__.py
rename to erpnext/education/doctype/program/__init__.py
diff --git a/erpnext/schools/doctype/program/program.js b/erpnext/education/doctype/program/program.js
similarity index 100%
rename from erpnext/schools/doctype/program/program.js
rename to erpnext/education/doctype/program/program.js
diff --git a/erpnext/schools/doctype/program/program.json b/erpnext/education/doctype/program/program.json
similarity index 98%
rename from erpnext/schools/doctype/program/program.json
rename to erpnext/education/doctype/program/program.json
index 46581a1..05e35a2 100644
--- a/erpnext/schools/doctype/program/program.json
+++ b/erpnext/education/doctype/program/program.json
@@ -236,9 +236,9 @@
  "istable": 0, 
  "max_attachments": 0, 
  "menu_index": 0, 
- "modified": "2017-11-02 18:08:20.823972", 
+ "modified": "2017-11-10 18:56:18.413911", 
  "modified_by": "Administrator", 
- "module": "Schools", 
+ "module": "Education", 
  "name": "Program", 
  "name_case": "", 
  "owner": "Administrator", 
diff --git a/erpnext/schools/doctype/program/program.py b/erpnext/education/doctype/program/program.py
similarity index 100%
rename from erpnext/schools/doctype/program/program.py
rename to erpnext/education/doctype/program/program.py
diff --git a/erpnext/schools/doctype/program/test_program.js b/erpnext/education/doctype/program/test_program.js
similarity index 92%
rename from erpnext/schools/doctype/program/test_program.js
rename to erpnext/education/doctype/program/test_program.js
index a14fe97..dc347cf 100644
--- a/erpnext/schools/doctype/program/test_program.js
+++ b/erpnext/education/doctype/program/test_program.js
@@ -1,5 +1,5 @@
-// Testing Setup Module in Schools
-QUnit.module('schools');
+// Testing Setup Module in education
+QUnit.module('education');
 
 QUnit.test('Test: Program', function(assert){
 	assert.expect(6);
diff --git a/erpnext/schools/doctype/program/test_program.py b/erpnext/education/doctype/program/test_program.py
similarity index 100%
rename from erpnext/schools/doctype/program/test_program.py
rename to erpnext/education/doctype/program/test_program.py
diff --git a/erpnext/schools/doctype/program/test_records.json b/erpnext/education/doctype/program/test_records.json
similarity index 100%
rename from erpnext/schools/doctype/program/test_records.json
rename to erpnext/education/doctype/program/test_records.json
diff --git a/erpnext/schools/doctype/program_course/__init__.py b/erpnext/education/doctype/program_course/__init__.py
similarity index 100%
rename from erpnext/schools/doctype/program_course/__init__.py
rename to erpnext/education/doctype/program_course/__init__.py
diff --git a/erpnext/schools/doctype/program_course/program_course.json b/erpnext/education/doctype/program_course/program_course.json
similarity index 97%
rename from erpnext/schools/doctype/program_course/program_course.json
rename to erpnext/education/doctype/program_course/program_course.json
index 4922a95..c3d45d8 100644
--- a/erpnext/schools/doctype/program_course/program_course.json
+++ b/erpnext/education/doctype/program_course/program_course.json
@@ -145,9 +145,9 @@
  "istable": 1, 
  "max_attachments": 0, 
  "menu_index": 0, 
- "modified": "2017-06-30 08:21:49.313349", 
+ "modified": "2017-11-10 19:10:10.231463", 
  "modified_by": "Administrator", 
- "module": "Schools", 
+ "module": "Education", 
  "name": "Program Course", 
  "name_case": "", 
  "owner": "Administrator", 
diff --git a/erpnext/schools/doctype/program_course/program_course.py b/erpnext/education/doctype/program_course/program_course.py
similarity index 100%
rename from erpnext/schools/doctype/program_course/program_course.py
rename to erpnext/education/doctype/program_course/program_course.py
diff --git a/erpnext/schools/doctype/program_enrollment/__init__.py b/erpnext/education/doctype/program_enrollment/__init__.py
similarity index 100%
rename from erpnext/schools/doctype/program_enrollment/__init__.py
rename to erpnext/education/doctype/program_enrollment/__init__.py
diff --git a/erpnext/schools/doctype/program_enrollment/program_enrollment.js b/erpnext/education/doctype/program_enrollment/program_enrollment.js
similarity index 82%
rename from erpnext/schools/doctype/program_enrollment/program_enrollment.js
rename to erpnext/education/doctype/program_enrollment/program_enrollment.js
index 8418e85..d35f41a 100644
--- a/erpnext/schools/doctype/program_enrollment/program_enrollment.js
+++ b/erpnext/education/doctype/program_enrollment/program_enrollment.js
@@ -1,9 +1,12 @@
 // Copyright (c) 2016, Frappe and contributors
 // For license information, please see license.txt
 
-cur_frm.add_fetch('fee_structure', 'total_amount', 'amount');
 
 frappe.ui.form.on("Program Enrollment", {
+	setup: function(frm) {
+		frm.add_fetch('fee_structure', 'total_amount', 'amount');
+	},
+
 	onload: function(frm, cdt, cdn){
 		frm.set_query("academic_term", "fees", function(){
 			return{
@@ -23,7 +26,7 @@
 		if (frm.doc.program) {
 			frm.set_query("course", "courses", function(doc, cdt, cdn) {
 				return{
-					query: "erpnext.schools.doctype.program_enrollment.program_enrollment.get_program_courses",
+					query: "erpnext.education.doctype.program_enrollment.program_enrollment.get_program_courses",
 					filters: {
 						'program': frm.doc.program
 					}
@@ -33,7 +36,7 @@
 
 		frm.set_query("student", function() {
 			return{
-				query: "erpnext.schools.doctype.program_enrollment.program_enrollment.get_students",
+				query: "erpnext.education.doctype.program_enrollment.program_enrollment.get_students",
 				filters: {
 					'academic_year': frm.doc.academic_year,
 					'academic_term': frm.doc.academic_term
@@ -46,7 +49,7 @@
 		frm.events.get_courses(frm);
 		if (frm.doc.program) {
 			frappe.call({
-				method: "erpnext.schools.api.get_fee_schedule",
+				method: "erpnext.education.api.get_fee_schedule",
 				args: {
 					"program": frm.doc.program,
 					"student_category": frm.doc.student_category
diff --git a/erpnext/schools/doctype/program_enrollment/program_enrollment.json b/erpnext/education/doctype/program_enrollment/program_enrollment.json
similarity index 98%
rename from erpnext/schools/doctype/program_enrollment/program_enrollment.json
rename to erpnext/education/doctype/program_enrollment/program_enrollment.json
index f8a3b9e..9badf93 100644
--- a/erpnext/schools/doctype/program_enrollment/program_enrollment.json
+++ b/erpnext/education/doctype/program_enrollment/program_enrollment.json
@@ -403,7 +403,7 @@
    "label": "Mode of Transportation", 
    "length": 0, 
    "no_copy": 0, 
-   "options": "\nWalking\nSchool Bus\nPublic Transport\nSelf-Driving Vehicle\nPick/Drop by Guardian", 
+   "options": "\nWalking\nInstitute's Bus\nPublic Transport\nSelf-Driving Vehicle\nPick/Drop by Guardian", 
    "permlevel": 0, 
    "precision": "", 
    "print_hide": 0, 
@@ -671,9 +671,9 @@
  "istable": 0, 
  "max_attachments": 0, 
  "menu_index": 0, 
- "modified": "2017-07-10 18:16:15.810616", 
+ "modified": "2017-11-16 13:20:28.650637", 
  "modified_by": "Administrator", 
- "module": "Schools", 
+ "module": "Education", 
  "name": "Program Enrollment", 
  "name_case": "", 
  "owner": "Administrator", 
diff --git a/erpnext/schools/doctype/program_enrollment/program_enrollment.py b/erpnext/education/doctype/program_enrollment/program_enrollment.py
similarity index 96%
rename from erpnext/schools/doctype/program_enrollment/program_enrollment.py
rename to erpnext/education/doctype/program_enrollment/program_enrollment.py
index 4e67908..79772b0 100644
--- a/erpnext/schools/doctype/program_enrollment/program_enrollment.py
+++ b/erpnext/education/doctype/program_enrollment/program_enrollment.py
@@ -14,6 +14,8 @@
 		self.validate_duplication()
 		if not self.student_name:
 			self.student_name = frappe.db.get_value("Student", self.student, "title")
+		if not self.courses:
+			self.extend("courses", self.get_courses())
 	
 	def on_submit(self):
 		self.update_student_joining_date()
@@ -30,7 +32,7 @@
 		frappe.db.set_value("Student", self.student, "joining_date", date)
 		
 	def make_fee_records(self):
-		from erpnext.schools.api import get_fee_components
+		from erpnext.education.api import get_fee_components
 		fee_list = []
 		for d in self.fees:
 			fee_components = get_fee_components(d.fee_structure)
diff --git a/erpnext/accounts/doctype/asset_category/test_asset_category.js b/erpnext/education/doctype/program_enrollment/test_program_enrollment.js
similarity index 69%
copy from erpnext/accounts/doctype/asset_category/test_asset_category.js
copy to erpnext/education/doctype/program_enrollment/test_program_enrollment.js
index 7e343b7..aea81a0 100644
--- a/erpnext/accounts/doctype/asset_category/test_asset_category.js
+++ b/erpnext/education/doctype/program_enrollment/test_program_enrollment.js
@@ -2,15 +2,15 @@
 // rename this file from _test_[name] to test_[name] to activate
 // and remove above this line
 
-QUnit.test("test: Asset Category", function (assert) {
+QUnit.test("test: Program Enrollment", function (assert) {
 	let done = assert.async();
 
 	// number of asserts
 	assert.expect(1);
 
 	frappe.run_serially([
-		// insert a new Asset Category
-		() => frappe.tests.make('Asset Category', [
+		// insert a new Program Enrollment
+		() => frappe.tests.make('Program Enrollment', [
 			// values to be set
 			{key: 'value'}
 		]),
diff --git a/erpnext/schools/doctype/program_enrollment/test_program_enrollment.py b/erpnext/education/doctype/program_enrollment/test_program_enrollment.py
similarity index 100%
rename from erpnext/schools/doctype/program_enrollment/test_program_enrollment.py
rename to erpnext/education/doctype/program_enrollment/test_program_enrollment.py
diff --git a/erpnext/schools/doctype/program_enrollment_course/__init__.py b/erpnext/education/doctype/program_enrollment_course/__init__.py
similarity index 100%
rename from erpnext/schools/doctype/program_enrollment_course/__init__.py
rename to erpnext/education/doctype/program_enrollment_course/__init__.py
diff --git a/erpnext/schools/doctype/program_enrollment_course/program_enrollment_course.json b/erpnext/education/doctype/program_enrollment_course/program_enrollment_course.json
similarity index 96%
rename from erpnext/schools/doctype/program_enrollment_course/program_enrollment_course.json
rename to erpnext/education/doctype/program_enrollment_course/program_enrollment_course.json
index a5a26ab..87d9db3 100644
--- a/erpnext/schools/doctype/program_enrollment_course/program_enrollment_course.json
+++ b/erpnext/education/doctype/program_enrollment_course/program_enrollment_course.json
@@ -85,9 +85,9 @@
  "issingle": 0, 
  "istable": 1, 
  "max_attachments": 0, 
- "modified": "2017-06-30 08:21:49.637920", 
+ "modified": "2017-11-10 19:11:54.272255", 
  "modified_by": "Administrator", 
- "module": "Schools", 
+ "module": "Education", 
  "name": "Program Enrollment Course", 
  "name_case": "", 
  "owner": "Administrator", 
diff --git a/erpnext/schools/doctype/program_enrollment_course/program_enrollment_course.py b/erpnext/education/doctype/program_enrollment_course/program_enrollment_course.py
similarity index 100%
rename from erpnext/schools/doctype/program_enrollment_course/program_enrollment_course.py
rename to erpnext/education/doctype/program_enrollment_course/program_enrollment_course.py
diff --git a/erpnext/schools/doctype/program_enrollment_fee/__init__.py b/erpnext/education/doctype/program_enrollment_fee/__init__.py
similarity index 100%
rename from erpnext/schools/doctype/program_enrollment_fee/__init__.py
rename to erpnext/education/doctype/program_enrollment_fee/__init__.py
diff --git a/erpnext/schools/doctype/program_enrollment_fee/program_enrollment_fee.json b/erpnext/education/doctype/program_enrollment_fee/program_enrollment_fee.json
similarity index 98%
rename from erpnext/schools/doctype/program_enrollment_fee/program_enrollment_fee.json
rename to erpnext/education/doctype/program_enrollment_fee/program_enrollment_fee.json
index 8d2202a..0af2815 100644
--- a/erpnext/schools/doctype/program_enrollment_fee/program_enrollment_fee.json
+++ b/erpnext/education/doctype/program_enrollment_fee/program_enrollment_fee.json
@@ -173,9 +173,9 @@
  "issingle": 0, 
  "istable": 1, 
  "max_attachments": 0, 
- "modified": "2017-06-30 08:21:49.718726", 
+ "modified": "2017-11-10 19:11:07.516632", 
  "modified_by": "Administrator", 
- "module": "Schools", 
+ "module": "Education", 
  "name": "Program Enrollment Fee", 
  "name_case": "", 
  "owner": "Administrator", 
diff --git a/erpnext/schools/doctype/program_enrollment_fee/program_enrollment_fee.py b/erpnext/education/doctype/program_enrollment_fee/program_enrollment_fee.py
similarity index 100%
rename from erpnext/schools/doctype/program_enrollment_fee/program_enrollment_fee.py
rename to erpnext/education/doctype/program_enrollment_fee/program_enrollment_fee.py
diff --git a/erpnext/schools/doctype/program_enrollment_tool/__init__.py b/erpnext/education/doctype/program_enrollment_tool/__init__.py
similarity index 100%
rename from erpnext/schools/doctype/program_enrollment_tool/__init__.py
rename to erpnext/education/doctype/program_enrollment_tool/__init__.py
diff --git a/erpnext/schools/doctype/program_enrollment_tool/program_enrollment_tool.js b/erpnext/education/doctype/program_enrollment_tool/program_enrollment_tool.js
similarity index 100%
rename from erpnext/schools/doctype/program_enrollment_tool/program_enrollment_tool.js
rename to erpnext/education/doctype/program_enrollment_tool/program_enrollment_tool.js
diff --git a/erpnext/schools/doctype/program_enrollment_tool/program_enrollment_tool.json b/erpnext/education/doctype/program_enrollment_tool/program_enrollment_tool.json
similarity index 98%
rename from erpnext/schools/doctype/program_enrollment_tool/program_enrollment_tool.json
rename to erpnext/education/doctype/program_enrollment_tool/program_enrollment_tool.json
index 8f32df7..2745366 100644
--- a/erpnext/schools/doctype/program_enrollment_tool/program_enrollment_tool.json
+++ b/erpnext/education/doctype/program_enrollment_tool/program_enrollment_tool.json
@@ -328,9 +328,9 @@
  "issingle": 1, 
  "istable": 0, 
  "max_attachments": 0, 
- "modified": "2017-06-30 08:21:49.826296", 
+ "modified": "2017-11-10 19:39:54.858394", 
  "modified_by": "Administrator", 
- "module": "Schools", 
+ "module": "Education", 
  "name": "Program Enrollment Tool", 
  "name_case": "", 
  "owner": "Administrator", 
diff --git a/erpnext/schools/doctype/program_enrollment_tool/program_enrollment_tool.py b/erpnext/education/doctype/program_enrollment_tool/program_enrollment_tool.py
similarity index 97%
rename from erpnext/schools/doctype/program_enrollment_tool/program_enrollment_tool.py
rename to erpnext/education/doctype/program_enrollment_tool/program_enrollment_tool.py
index d80f2f5..d989d9f 100644
--- a/erpnext/schools/doctype/program_enrollment_tool/program_enrollment_tool.py
+++ b/erpnext/education/doctype/program_enrollment_tool/program_enrollment_tool.py
@@ -6,7 +6,7 @@
 import frappe
 from frappe import _
 from frappe.model.document import Document
-from erpnext.schools.api import enroll_student
+from erpnext.education.api import enroll_student
 
 class ProgramEnrollmentTool(Document):
 	def get_students(self):
diff --git a/erpnext/accounts/doctype/asset_category/test_asset_category.js b/erpnext/education/doctype/program_enrollment_tool/test_program_enrollment_tool.js
similarity index 67%
copy from erpnext/accounts/doctype/asset_category/test_asset_category.js
copy to erpnext/education/doctype/program_enrollment_tool/test_program_enrollment_tool.js
index 7e343b7..8d55104 100644
--- a/erpnext/accounts/doctype/asset_category/test_asset_category.js
+++ b/erpnext/education/doctype/program_enrollment_tool/test_program_enrollment_tool.js
@@ -2,15 +2,15 @@
 // rename this file from _test_[name] to test_[name] to activate
 // and remove above this line
 
-QUnit.test("test: Asset Category", function (assert) {
+QUnit.test("test: Program Enrollment Tool", function (assert) {
 	let done = assert.async();
 
 	// number of asserts
 	assert.expect(1);
 
 	frappe.run_serially([
-		// insert a new Asset Category
-		() => frappe.tests.make('Asset Category', [
+		// insert a new Program Enrollment Tool
+		() => frappe.tests.make('Program Enrollment Tool', [
 			// values to be set
 			{key: 'value'}
 		]),
diff --git a/erpnext/accounts/doctype/asset_category/test_asset_category.py b/erpnext/education/doctype/program_enrollment_tool/test_program_enrollment_tool.py
similarity index 77%
copy from erpnext/accounts/doctype/asset_category/test_asset_category.py
copy to erpnext/education/doctype/program_enrollment_tool/test_program_enrollment_tool.py
index 4d5169a..f22b3b1 100644
--- a/erpnext/accounts/doctype/asset_category/test_asset_category.py
+++ b/erpnext/education/doctype/program_enrollment_tool/test_program_enrollment_tool.py
@@ -6,5 +6,5 @@
 import frappe
 import unittest
 
-class TestAssetCategory(unittest.TestCase):
+class TestProgramEnrollmentTool(unittest.TestCase):
 	pass
diff --git a/erpnext/schools/doctype/program_enrollment_tool_student/__init__.py b/erpnext/education/doctype/program_enrollment_tool_student/__init__.py
similarity index 100%
rename from erpnext/schools/doctype/program_enrollment_tool_student/__init__.py
rename to erpnext/education/doctype/program_enrollment_tool_student/__init__.py
diff --git a/erpnext/schools/doctype/program_enrollment_tool_student/program_enrollment_tool_student.json b/erpnext/education/doctype/program_enrollment_tool_student/program_enrollment_tool_student.json
similarity index 97%
rename from erpnext/schools/doctype/program_enrollment_tool_student/program_enrollment_tool_student.json
rename to erpnext/education/doctype/program_enrollment_tool_student/program_enrollment_tool_student.json
index 50c9ac7..0dbe1b8 100644
--- a/erpnext/schools/doctype/program_enrollment_tool_student/program_enrollment_tool_student.json
+++ b/erpnext/education/doctype/program_enrollment_tool_student/program_enrollment_tool_student.json
@@ -145,9 +145,9 @@
  "issingle": 0, 
  "istable": 1, 
  "max_attachments": 0, 
- "modified": "2017-06-30 08:21:49.928790", 
+ "modified": "2017-11-10 19:09:59.530615", 
  "modified_by": "Administrator", 
- "module": "Schools", 
+ "module": "Education", 
  "name": "Program Enrollment Tool Student", 
  "name_case": "", 
  "owner": "Administrator", 
diff --git a/erpnext/schools/doctype/program_enrollment_tool_student/program_enrollment_tool_student.py b/erpnext/education/doctype/program_enrollment_tool_student/program_enrollment_tool_student.py
similarity index 100%
rename from erpnext/schools/doctype/program_enrollment_tool_student/program_enrollment_tool_student.py
rename to erpnext/education/doctype/program_enrollment_tool_student/program_enrollment_tool_student.py
diff --git a/erpnext/schools/doctype/program_fee/__init__.py b/erpnext/education/doctype/program_fee/__init__.py
similarity index 100%
rename from erpnext/schools/doctype/program_fee/__init__.py
rename to erpnext/education/doctype/program_fee/__init__.py
diff --git a/erpnext/schools/doctype/program_fee/program_fee.json b/erpnext/education/doctype/program_fee/program_fee.json
similarity index 98%
rename from erpnext/schools/doctype/program_fee/program_fee.json
rename to erpnext/education/doctype/program_fee/program_fee.json
index 673959a..d45e4bd 100644
--- a/erpnext/schools/doctype/program_fee/program_fee.json
+++ b/erpnext/education/doctype/program_fee/program_fee.json
@@ -205,9 +205,9 @@
  "issingle": 0, 
  "istable": 1, 
  "max_attachments": 0, 
- "modified": "2017-06-30 08:21:50.034899", 
+ "modified": "2017-11-10 19:07:10.426335", 
  "modified_by": "Administrator", 
- "module": "Schools", 
+ "module": "Education", 
  "name": "Program Fee", 
  "name_case": "", 
  "owner": "Administrator", 
diff --git a/erpnext/schools/doctype/program_fee/program_fee.py b/erpnext/education/doctype/program_fee/program_fee.py
similarity index 100%
rename from erpnext/schools/doctype/program_fee/program_fee.py
rename to erpnext/education/doctype/program_fee/program_fee.py
diff --git a/erpnext/schools/doctype/room/__init__.py b/erpnext/education/doctype/room/__init__.py
similarity index 100%
rename from erpnext/schools/doctype/room/__init__.py
rename to erpnext/education/doctype/room/__init__.py
diff --git a/erpnext/schools/doctype/room/room.js b/erpnext/education/doctype/room/room.js
similarity index 100%
rename from erpnext/schools/doctype/room/room.js
rename to erpnext/education/doctype/room/room.js
diff --git a/erpnext/schools/doctype/room/room.json b/erpnext/education/doctype/room/room.json
similarity index 97%
rename from erpnext/schools/doctype/room/room.json
rename to erpnext/education/doctype/room/room.json
index 8e672cc..6526766 100644
--- a/erpnext/schools/doctype/room/room.json
+++ b/erpnext/education/doctype/room/room.json
@@ -114,9 +114,9 @@
  "istable": 0, 
  "max_attachments": 0, 
  "menu_index": 0, 
- "modified": "2017-06-30 08:21:50.145058", 
+ "modified": "2017-11-10 19:04:32.237051", 
  "modified_by": "Administrator", 
- "module": "Schools", 
+ "module": "Education", 
  "name": "Room", 
  "name_case": "", 
  "owner": "Administrator", 
diff --git a/erpnext/schools/doctype/room/room.py b/erpnext/education/doctype/room/room.py
similarity index 100%
rename from erpnext/schools/doctype/room/room.py
rename to erpnext/education/doctype/room/room.py
diff --git a/erpnext/schools/doctype/room/test_records.json b/erpnext/education/doctype/room/test_records.json
similarity index 100%
rename from erpnext/schools/doctype/room/test_records.json
rename to erpnext/education/doctype/room/test_records.json
diff --git a/erpnext/schools/doctype/room/test_room.js b/erpnext/education/doctype/room/test_room.js
similarity index 87%
rename from erpnext/schools/doctype/room/test_room.js
rename to erpnext/education/doctype/room/test_room.js
index 0a93a85..fdcbe92 100644
--- a/erpnext/schools/doctype/room/test_room.js
+++ b/erpnext/education/doctype/room/test_room.js
@@ -1,5 +1,5 @@
-// Testing Setup Module in Schools
-QUnit.module('schools');
+// Testing Setup Module in Education
+QUnit.module('education');
 
 QUnit.test('Test: Room', function(assert){
 	assert.expect(3);
diff --git a/erpnext/schools/doctype/room/test_room.py b/erpnext/education/doctype/room/test_room.py
similarity index 100%
rename from erpnext/schools/doctype/room/test_room.py
rename to erpnext/education/doctype/room/test_room.py
diff --git a/erpnext/schools/doctype/school_house/__init__.py b/erpnext/education/doctype/school_house/__init__.py
similarity index 100%
rename from erpnext/schools/doctype/school_house/__init__.py
rename to erpnext/education/doctype/school_house/__init__.py
diff --git a/erpnext/schools/doctype/school_house/school_house.js b/erpnext/education/doctype/school_house/school_house.js
similarity index 100%
rename from erpnext/schools/doctype/school_house/school_house.js
rename to erpnext/education/doctype/school_house/school_house.js
diff --git a/erpnext/schools/doctype/school_house/school_house.json b/erpnext/education/doctype/school_house/school_house.json
similarity index 96%
rename from erpnext/schools/doctype/school_house/school_house.json
rename to erpnext/education/doctype/school_house/school_house.json
index e777939..8a653a9 100644
--- a/erpnext/schools/doctype/school_house/school_house.json
+++ b/erpnext/education/doctype/school_house/school_house.json
@@ -54,9 +54,9 @@
  "issingle": 0, 
  "istable": 0, 
  "max_attachments": 0, 
- "modified": "2017-06-30 08:21:50.250616", 
+ "modified": "2017-11-10 19:05:06.419022", 
  "modified_by": "Administrator", 
- "module": "Schools", 
+ "module": "Education", 
  "name": "School House", 
  "name_case": "", 
  "owner": "Administrator", 
diff --git a/erpnext/schools/doctype/school_house/school_house.py b/erpnext/education/doctype/school_house/school_house.py
similarity index 100%
rename from erpnext/schools/doctype/school_house/school_house.py
rename to erpnext/education/doctype/school_house/school_house.py
diff --git a/erpnext/accounts/doctype/asset/test_asset.js b/erpnext/education/doctype/school_house/test_school_house.js
similarity index 72%
copy from erpnext/accounts/doctype/asset/test_asset.js
copy to erpnext/education/doctype/school_house/test_school_house.js
index 6119e38..dde63ec 100644
--- a/erpnext/accounts/doctype/asset/test_asset.js
+++ b/erpnext/education/doctype/school_house/test_school_house.js
@@ -2,15 +2,15 @@
 // rename this file from _test_[name] to test_[name] to activate
 // and remove above this line
 
-QUnit.test("test: Asset", function (assert) {
+QUnit.test("test: School House", function (assert) {
 	let done = assert.async();
 
 	// number of asserts
 	assert.expect(1);
 
 	frappe.run_serially([
-		// insert a new Asset
-		() => frappe.tests.make('Asset', [
+		// insert a new School House
+		() => frappe.tests.make('School House', [
 			// values to be set
 			{key: 'value'}
 		]),
diff --git a/erpnext/schools/doctype/school_house/test_school_house.py b/erpnext/education/doctype/school_house/test_school_house.py
similarity index 100%
rename from erpnext/schools/doctype/school_house/test_school_house.py
rename to erpnext/education/doctype/school_house/test_school_house.py
diff --git a/erpnext/schools/doctype/student/__init__.py b/erpnext/education/doctype/student/__init__.py
similarity index 100%
rename from erpnext/schools/doctype/student/__init__.py
rename to erpnext/education/doctype/student/__init__.py
diff --git a/erpnext/schools/doctype/student/student.js b/erpnext/education/doctype/student/student.js
similarity index 100%
rename from erpnext/schools/doctype/student/student.js
rename to erpnext/education/doctype/student/student.js
diff --git a/erpnext/schools/doctype/student/student.json b/erpnext/education/doctype/student/student.json
similarity index 99%
rename from erpnext/schools/doctype/student/student.json
rename to erpnext/education/doctype/student/student.json
index 4961c2d..62c21d3 100644
--- a/erpnext/schools/doctype/student/student.json
+++ b/erpnext/education/doctype/student/student.json
@@ -1114,9 +1114,9 @@
  "istable": 0, 
  "max_attachments": 0, 
  "menu_index": 0, 
- "modified": "2017-07-26 19:46:26.893441", 
+ "modified": "2017-11-10 19:03:36.495785", 
  "modified_by": "Administrator", 
- "module": "Schools", 
+ "module": "Education", 
  "name": "Student", 
  "name_case": "", 
  "owner": "Administrator", 
diff --git a/erpnext/schools/doctype/student/student.py b/erpnext/education/doctype/student/student.py
similarity index 100%
rename from erpnext/schools/doctype/student/student.py
rename to erpnext/education/doctype/student/student.py
diff --git a/erpnext/schools/doctype/student/student_dashboard.py b/erpnext/education/doctype/student/student_dashboard.py
similarity index 100%
rename from erpnext/schools/doctype/student/student_dashboard.py
rename to erpnext/education/doctype/student/student_dashboard.py
diff --git a/erpnext/schools/doctype/student/student_list.js b/erpnext/education/doctype/student/student_list.js
similarity index 100%
rename from erpnext/schools/doctype/student/student_list.js
rename to erpnext/education/doctype/student/student_list.js
diff --git a/erpnext/schools/doctype/student/test_records.json b/erpnext/education/doctype/student/test_records.json
similarity index 100%
rename from erpnext/schools/doctype/student/test_records.json
rename to erpnext/education/doctype/student/test_records.json
diff --git a/erpnext/accounts/doctype/asset/test_asset.js b/erpnext/education/doctype/student/test_student.js
similarity index 74%
rename from erpnext/accounts/doctype/asset/test_asset.js
rename to erpnext/education/doctype/student/test_student.js
index 6119e38..e18d39a 100644
--- a/erpnext/accounts/doctype/asset/test_asset.js
+++ b/erpnext/education/doctype/student/test_student.js
@@ -2,15 +2,15 @@
 // rename this file from _test_[name] to test_[name] to activate
 // and remove above this line
 
-QUnit.test("test: Asset", function (assert) {
+QUnit.test("test: Student", function (assert) {
 	let done = assert.async();
 
 	// number of asserts
 	assert.expect(1);
 
 	frappe.run_serially([
-		// insert a new Asset
-		() => frappe.tests.make('Asset', [
+		// insert a new Student
+		() => frappe.tests.make('Student', [
 			// values to be set
 			{key: 'value'}
 		]),
diff --git a/erpnext/schools/doctype/student/test_student.py b/erpnext/education/doctype/student/test_student.py
similarity index 100%
rename from erpnext/schools/doctype/student/test_student.py
rename to erpnext/education/doctype/student/test_student.py
diff --git a/erpnext/schools/doctype/student_admission/__init__.py b/erpnext/education/doctype/student_admission/__init__.py
similarity index 100%
rename from erpnext/schools/doctype/student_admission/__init__.py
rename to erpnext/education/doctype/student_admission/__init__.py
diff --git a/erpnext/schools/doctype/student_admission/student_admission.js b/erpnext/education/doctype/student_admission/student_admission.js
similarity index 100%
rename from erpnext/schools/doctype/student_admission/student_admission.js
rename to erpnext/education/doctype/student_admission/student_admission.js
diff --git a/erpnext/schools/doctype/student_admission/student_admission.json b/erpnext/education/doctype/student_admission/student_admission.json
similarity index 98%
rename from erpnext/schools/doctype/student_admission/student_admission.json
rename to erpnext/education/doctype/student_admission/student_admission.json
index c35d5be..b3c10d4 100644
--- a/erpnext/schools/doctype/student_admission/student_admission.json
+++ b/erpnext/education/doctype/student_admission/student_admission.json
@@ -356,9 +356,9 @@
  "issingle": 0, 
  "istable": 0, 
  "max_attachments": 0, 
- "modified": "2017-10-02 15:16:44.386000", 
+ "modified": "2017-11-10 18:57:34.570376", 
  "modified_by": "Administrator", 
- "module": "Schools", 
+ "module": "Education", 
  "name": "Student Admission", 
  "name_case": "", 
  "owner": "Administrator", 
diff --git a/erpnext/schools/doctype/student_admission/student_admission.py b/erpnext/education/doctype/student_admission/student_admission.py
similarity index 93%
rename from erpnext/schools/doctype/student_admission/student_admission.py
rename to erpnext/education/doctype/student_admission/student_admission.py
index e166b9b..2781c9c 100644
--- a/erpnext/schools/doctype/student_admission/student_admission.py
+++ b/erpnext/education/doctype/student_admission/student_admission.py
@@ -34,7 +34,7 @@
 		"show_sidebar": True,
 		"title": _("Student Admissions"),
 		"get_list": get_admission_list,
-		"row_template": "schools/doctype/student_admission/templates/student_admission_row.html",
+		"row_template": "education/doctype/student_admission/templates/student_admission_row.html",
 	})
 
 def get_admission_list(doctype, txt, filters, limit_start, limit_page_length=20, order_by="modified"):
diff --git a/erpnext/schools/doctype/student_admission/templates/student_admission.html b/erpnext/education/doctype/student_admission/templates/student_admission.html
similarity index 100%
rename from erpnext/schools/doctype/student_admission/templates/student_admission.html
rename to erpnext/education/doctype/student_admission/templates/student_admission.html
diff --git a/erpnext/schools/doctype/student_admission/templates/student_admission_row.html b/erpnext/education/doctype/student_admission/templates/student_admission_row.html
similarity index 100%
rename from erpnext/schools/doctype/student_admission/templates/student_admission_row.html
rename to erpnext/education/doctype/student_admission/templates/student_admission_row.html
diff --git a/erpnext/schools/doctype/student_admission/test_student_admission.js b/erpnext/education/doctype/student_admission/test_student_admission.js
similarity index 94%
rename from erpnext/schools/doctype/student_admission/test_student_admission.js
rename to erpnext/education/doctype/student_admission/test_student_admission.js
index 767f237..ed794b2 100644
--- a/erpnext/schools/doctype/student_admission/test_student_admission.js
+++ b/erpnext/education/doctype/student_admission/test_student_admission.js
@@ -1,5 +1,5 @@
-// Testing Admission Module in Schools
-QUnit.module('schools');
+// Testing Admission Module in Education
+QUnit.module('education');
 
 QUnit.test('Test: Student Admission', function(assert) {
 	assert.expect(10);
diff --git a/erpnext/schools/doctype/student_admission/test_student_admission.py b/erpnext/education/doctype/student_admission/test_student_admission.py
similarity index 100%
rename from erpnext/schools/doctype/student_admission/test_student_admission.py
rename to erpnext/education/doctype/student_admission/test_student_admission.py
diff --git a/erpnext/schools/doctype/student_admission_program/__init__.py b/erpnext/education/doctype/student_admission_program/__init__.py
similarity index 100%
rename from erpnext/schools/doctype/student_admission_program/__init__.py
rename to erpnext/education/doctype/student_admission_program/__init__.py
diff --git a/erpnext/schools/doctype/student_admission_program/student_admission_program.json b/erpnext/education/doctype/student_admission_program/student_admission_program.json
similarity index 98%
rename from erpnext/schools/doctype/student_admission_program/student_admission_program.json
rename to erpnext/education/doctype/student_admission_program/student_admission_program.json
index 29bb57f..46c5fab 100644
--- a/erpnext/schools/doctype/student_admission_program/student_admission_program.json
+++ b/erpnext/education/doctype/student_admission_program/student_admission_program.json
@@ -204,9 +204,9 @@
  "issingle": 0, 
  "istable": 1, 
  "max_attachments": 0, 
- "modified": "2017-10-02 17:13:52.586218", 
+ "modified": "2017-11-10 18:57:21.174604", 
  "modified_by": "Administrator", 
- "module": "Schools", 
+ "module": "Education", 
  "name": "Student Admission Program", 
  "name_case": "", 
  "owner": "Administrator", 
diff --git a/erpnext/schools/doctype/student_admission_program/student_admission_program.py b/erpnext/education/doctype/student_admission_program/student_admission_program.py
similarity index 100%
rename from erpnext/schools/doctype/student_admission_program/student_admission_program.py
rename to erpnext/education/doctype/student_admission_program/student_admission_program.py
diff --git a/erpnext/schools/doctype/student_applicant/__init__.py b/erpnext/education/doctype/student_applicant/__init__.py
similarity index 100%
rename from erpnext/schools/doctype/student_applicant/__init__.py
rename to erpnext/education/doctype/student_applicant/__init__.py
diff --git a/erpnext/schools/doctype/student_applicant/student_applicant.js b/erpnext/education/doctype/student_applicant/student_applicant.js
similarity index 96%
rename from erpnext/schools/doctype/student_applicant/student_applicant.js
rename to erpnext/education/doctype/student_applicant/student_applicant.js
index fdf16ba..83621c5 100644
--- a/erpnext/schools/doctype/student_applicant/student_applicant.js
+++ b/erpnext/education/doctype/student_applicant/student_applicant.js
@@ -40,7 +40,7 @@
 
 	enroll: function(frm) {
 		frappe.model.open_mapped_doc({
-			method: "erpnext.schools.api.enroll_student",
+			method: "erpnext.education.api.enroll_student",
 			frm: frm
 		})
 	}
diff --git a/erpnext/schools/doctype/student_applicant/student_applicant.json b/erpnext/education/doctype/student_applicant/student_applicant.json
similarity index 99%
rename from erpnext/schools/doctype/student_applicant/student_applicant.json
rename to erpnext/education/doctype/student_applicant/student_applicant.json
index 578f84c..9c84234 100644
--- a/erpnext/schools/doctype/student_applicant/student_applicant.json
+++ b/erpnext/education/doctype/student_applicant/student_applicant.json
@@ -1058,9 +1058,9 @@
  "istable": 0, 
  "max_attachments": 0, 
  "menu_index": 0, 
- "modified": "2017-08-23 06:12:36.996978", 
+ "modified": "2017-11-10 19:08:55.049625", 
  "modified_by": "Administrator", 
- "module": "Schools", 
+ "module": "Education", 
  "name": "Student Applicant", 
  "name_case": "", 
  "owner": "Administrator", 
diff --git a/erpnext/schools/doctype/student_applicant/student_applicant.py b/erpnext/education/doctype/student_applicant/student_applicant.py
similarity index 100%
rename from erpnext/schools/doctype/student_applicant/student_applicant.py
rename to erpnext/education/doctype/student_applicant/student_applicant.py
diff --git a/erpnext/schools/doctype/student_applicant/student_applicant_list.js b/erpnext/education/doctype/student_applicant/student_applicant_list.js
similarity index 100%
rename from erpnext/schools/doctype/student_applicant/student_applicant_list.js
rename to erpnext/education/doctype/student_applicant/student_applicant_list.js
diff --git a/erpnext/schools/doctype/student_applicant/test_student_applicant.py b/erpnext/education/doctype/student_applicant/test_student_applicant.py
similarity index 100%
rename from erpnext/schools/doctype/student_applicant/test_student_applicant.py
rename to erpnext/education/doctype/student_applicant/test_student_applicant.py
diff --git a/erpnext/schools/doctype/student_applicant/tests/test_student_applicant.js b/erpnext/education/doctype/student_applicant/tests/test_student_applicant.js
similarity index 98%
rename from erpnext/schools/doctype/student_applicant/tests/test_student_applicant.js
rename to erpnext/education/doctype/student_applicant/tests/test_student_applicant.js
index a45b45a..a69ad8a 100644
--- a/erpnext/schools/doctype/student_applicant/tests/test_student_applicant.js
+++ b/erpnext/education/doctype/student_applicant/tests/test_student_applicant.js
@@ -1,5 +1,5 @@
-// Testing Admission module in Schools
-QUnit.module('schools');
+// Testing Admission module in Education
+QUnit.module('education');
 
 QUnit.test('Test: Student Applicant', function(assert){
 	assert.expect(24);
diff --git a/erpnext/schools/doctype/student_applicant/tests/test_student_applicant_dummy_data.js b/erpnext/education/doctype/student_applicant/tests/test_student_applicant_dummy_data.js
similarity index 100%
rename from erpnext/schools/doctype/student_applicant/tests/test_student_applicant_dummy_data.js
rename to erpnext/education/doctype/student_applicant/tests/test_student_applicant_dummy_data.js
diff --git a/erpnext/schools/doctype/student_applicant/tests/test_student_applicant_options.js b/erpnext/education/doctype/student_applicant/tests/test_student_applicant_options.js
similarity index 98%
rename from erpnext/schools/doctype/student_applicant/tests/test_student_applicant_options.js
rename to erpnext/education/doctype/student_applicant/tests/test_student_applicant_options.js
index d8877e6..114358f 100644
--- a/erpnext/schools/doctype/student_applicant/tests/test_student_applicant_options.js
+++ b/erpnext/education/doctype/student_applicant/tests/test_student_applicant_options.js
@@ -1,5 +1,5 @@
-// Testing Admission module in Schools
-QUnit.module('schools');
+// Testing Admission module in Education
+QUnit.module('education');
 
 QUnit.test('test student applicant', function(assert){
 	assert.expect(11);
diff --git a/erpnext/schools/doctype/student_attendance/__init__.py b/erpnext/education/doctype/student_attendance/__init__.py
similarity index 100%
rename from erpnext/schools/doctype/student_attendance/__init__.py
rename to erpnext/education/doctype/student_attendance/__init__.py
diff --git a/erpnext/schools/doctype/student_attendance/student_attendance.js b/erpnext/education/doctype/student_attendance/student_attendance.js
similarity index 100%
rename from erpnext/schools/doctype/student_attendance/student_attendance.js
rename to erpnext/education/doctype/student_attendance/student_attendance.js
diff --git a/erpnext/schools/doctype/student_attendance/student_attendance.json b/erpnext/education/doctype/student_attendance/student_attendance.json
similarity index 98%
rename from erpnext/schools/doctype/student_attendance/student_attendance.json
rename to erpnext/education/doctype/student_attendance/student_attendance.json
index aa084cc..07530b4 100644
--- a/erpnext/schools/doctype/student_attendance/student_attendance.json
+++ b/erpnext/education/doctype/student_attendance/student_attendance.json
@@ -239,9 +239,9 @@
  "issingle": 0, 
  "istable": 0, 
  "max_attachments": 0, 
- "modified": "2017-06-30 08:21:51.223266", 
+ "modified": "2017-11-10 19:09:51.041960", 
  "modified_by": "Administrator", 
- "module": "Schools", 
+ "module": "Education", 
  "name": "Student Attendance", 
  "name_case": "", 
  "owner": "Administrator", 
diff --git a/erpnext/schools/doctype/student_attendance/student_attendance.py b/erpnext/education/doctype/student_attendance/student_attendance.py
similarity index 97%
rename from erpnext/schools/doctype/student_attendance/student_attendance.py
rename to erpnext/education/doctype/student_attendance/student_attendance.py
index 6960296..06ac4fb 100644
--- a/erpnext/schools/doctype/student_attendance/student_attendance.py
+++ b/erpnext/education/doctype/student_attendance/student_attendance.py
@@ -7,7 +7,7 @@
 from frappe.model.document import Document
 from frappe import _
 from frappe.utils import cstr
-from erpnext.schools.api import get_student_group_students
+from erpnext.education.api import get_student_group_students
 
 
 class StudentAttendance(Document):
diff --git a/erpnext/schools/doctype/student_attendance/student_attendance_list.js b/erpnext/education/doctype/student_attendance/student_attendance_list.js
similarity index 100%
rename from erpnext/schools/doctype/student_attendance/student_attendance_list.js
rename to erpnext/education/doctype/student_attendance/student_attendance_list.js
diff --git a/erpnext/schools/doctype/student_attendance/test_student_attendance.js b/erpnext/education/doctype/student_attendance/test_student_attendance.js
similarity index 92%
rename from erpnext/schools/doctype/student_attendance/test_student_attendance.js
rename to erpnext/education/doctype/student_attendance/test_student_attendance.js
index af83e77..c7da6f6 100644
--- a/erpnext/schools/doctype/student_attendance/test_student_attendance.js
+++ b/erpnext/education/doctype/student_attendance/test_student_attendance.js
@@ -1,5 +1,5 @@
-// Testing Attendance Module in Schools
-QUnit.module('schools');
+// Testing Attendance Module in Education
+QUnit.module('education');
 
 QUnit.test('Test: Student Attendance', function(assert){
 	assert.expect(2);
diff --git a/erpnext/schools/doctype/student_attendance/test_student_attendance.py b/erpnext/education/doctype/student_attendance/test_student_attendance.py
similarity index 100%
rename from erpnext/schools/doctype/student_attendance/test_student_attendance.py
rename to erpnext/education/doctype/student_attendance/test_student_attendance.py
diff --git a/erpnext/schools/doctype/student_attendance_tool/__init__.py b/erpnext/education/doctype/student_attendance_tool/__init__.py
similarity index 100%
rename from erpnext/schools/doctype/student_attendance_tool/__init__.py
rename to erpnext/education/doctype/student_attendance_tool/__init__.py
diff --git a/erpnext/schools/doctype/student_attendance_tool/student_attendance_tool.js b/erpnext/education/doctype/student_attendance_tool/student_attendance_tool.js
similarity index 93%
rename from erpnext/schools/doctype/student_attendance_tool/student_attendance_tool.js
rename to erpnext/education/doctype/student_attendance_tool/student_attendance_tool.js
index 23ec408..df6d132 100644
--- a/erpnext/schools/doctype/student_attendance_tool/student_attendance_tool.js
+++ b/erpnext/education/doctype/student_attendance_tool/student_attendance_tool.js
@@ -1,6 +1,6 @@
 // Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
-frappe.provide("schools")
+frappe.provide("education");
 
 frappe.ui.form.on('Student Attendance Tool', {
 	onload: function(frm) {
@@ -33,7 +33,7 @@
 
 	student_group: function(frm) {
 		if ((frm.doc.student_group && frm.doc.date) || frm.doc.course_schedule) {
-			var method = "erpnext.schools.doctype.student_attendance_tool.student_attendance_tool.get_student_attendance_records";
+			var method = "erpnext.education.doctype.student_attendance_tool.student_attendance_tool.get_student_attendance_records";
 
 			frappe.call({
 				method: method,
@@ -64,12 +64,12 @@
 				.appendTo(frm.fields_dict.students_html.wrapper);
 		}
 		students = students || [];
-		frm.students_editor = new schools.StudentsEditor(frm, frm.students_area, students)
+		frm.students_editor = new education.StudentsEditor(frm, frm.students_area, students);
 	}
 });
 
 
-schools.StudentsEditor = Class.extend({
+education.StudentsEditor = Class.extend({
 	init: function(frm, wrapper, students) {
 		this.wrapper = wrapper;
 		this.frm = frm;
@@ -137,7 +137,7 @@
 					function() {	//ifyes
 						if(!frappe.request.ajax_count) {
 							frappe.call({
-								method: "erpnext.schools.api.mark_attendance",
+								method: "erpnext.education.api.mark_attendance",
 								freeze: true,
 								freeze_message: "Marking attendance",
 								args: {
diff --git a/erpnext/schools/doctype/student_attendance_tool/student_attendance_tool.json b/erpnext/education/doctype/student_attendance_tool/student_attendance_tool.json
similarity index 98%
rename from erpnext/schools/doctype/student_attendance_tool/student_attendance_tool.json
rename to erpnext/education/doctype/student_attendance_tool/student_attendance_tool.json
index 5c28655..26b28b3 100644
--- a/erpnext/schools/doctype/student_attendance_tool/student_attendance_tool.json
+++ b/erpnext/education/doctype/student_attendance_tool/student_attendance_tool.json
@@ -273,9 +273,9 @@
  "issingle": 1, 
  "istable": 0, 
  "max_attachments": 0, 
- "modified": "2017-11-08 11:53:27.994112", 
+ "modified": "2017-11-10 18:55:36.168044", 
  "modified_by": "Administrator", 
- "module": "Schools", 
+ "module": "Education", 
  "name": "Student Attendance Tool", 
  "name_case": "", 
  "owner": "Administrator", 
diff --git a/erpnext/schools/doctype/student_attendance_tool/student_attendance_tool.py b/erpnext/education/doctype/student_attendance_tool/student_attendance_tool.py
similarity index 100%
rename from erpnext/schools/doctype/student_attendance_tool/student_attendance_tool.py
rename to erpnext/education/doctype/student_attendance_tool/student_attendance_tool.py
diff --git a/erpnext/schools/doctype/student_attendance_tool/test_student_attendance_tool.js b/erpnext/education/doctype/student_attendance_tool/test_student_attendance_tool.js
similarity index 97%
rename from erpnext/schools/doctype/student_attendance_tool/test_student_attendance_tool.js
rename to erpnext/education/doctype/student_attendance_tool/test_student_attendance_tool.js
index 3044f20..19b32a9 100644
--- a/erpnext/schools/doctype/student_attendance_tool/test_student_attendance_tool.js
+++ b/erpnext/education/doctype/student_attendance_tool/test_student_attendance_tool.js
@@ -1,5 +1,5 @@
-// Testing Attendance Module in Schools
-QUnit.module('schools');
+// Testing Attendance Module in Education
+QUnit.module('education');
 
 QUnit.test('Test: Student Attendace Tool', function(assert){
 	assert.expect(10);
diff --git a/erpnext/accounts/doctype/asset_category/test_asset_category.py b/erpnext/education/doctype/student_attendance_tool/test_student_attendance_tool.py
similarity index 77%
copy from erpnext/accounts/doctype/asset_category/test_asset_category.py
copy to erpnext/education/doctype/student_attendance_tool/test_student_attendance_tool.py
index 4d5169a..ffc42af 100644
--- a/erpnext/accounts/doctype/asset_category/test_asset_category.py
+++ b/erpnext/education/doctype/student_attendance_tool/test_student_attendance_tool.py
@@ -6,5 +6,5 @@
 import frappe
 import unittest
 
-class TestAssetCategory(unittest.TestCase):
+class TestStudentAttendanceTool(unittest.TestCase):
 	pass
diff --git a/erpnext/schools/doctype/student_batch_name/__init__.py b/erpnext/education/doctype/student_batch_name/__init__.py
similarity index 100%
rename from erpnext/schools/doctype/student_batch_name/__init__.py
rename to erpnext/education/doctype/student_batch_name/__init__.py
diff --git a/erpnext/schools/doctype/student_batch_name/student_batch_name.js b/erpnext/education/doctype/student_batch_name/student_batch_name.js
similarity index 100%
rename from erpnext/schools/doctype/student_batch_name/student_batch_name.js
rename to erpnext/education/doctype/student_batch_name/student_batch_name.js
diff --git a/erpnext/schools/doctype/student_batch_name/student_batch_name.json b/erpnext/education/doctype/student_batch_name/student_batch_name.json
similarity index 96%
rename from erpnext/schools/doctype/student_batch_name/student_batch_name.json
rename to erpnext/education/doctype/student_batch_name/student_batch_name.json
index 6b08487..abb6436 100644
--- a/erpnext/schools/doctype/student_batch_name/student_batch_name.json
+++ b/erpnext/education/doctype/student_batch_name/student_batch_name.json
@@ -54,9 +54,9 @@
  "issingle": 0, 
  "istable": 0, 
  "max_attachments": 0, 
- "modified": "2017-06-30 08:21:51.545155", 
+ "modified": "2017-11-10 19:08:17.980349", 
  "modified_by": "Administrator", 
- "module": "Schools", 
+ "module": "Education", 
  "name": "Student Batch Name", 
  "name_case": "", 
  "owner": "Administrator", 
diff --git a/erpnext/schools/doctype/student_batch_name/student_batch_name.py b/erpnext/education/doctype/student_batch_name/student_batch_name.py
similarity index 100%
rename from erpnext/schools/doctype/student_batch_name/student_batch_name.py
rename to erpnext/education/doctype/student_batch_name/student_batch_name.py
diff --git a/erpnext/schools/doctype/student_batch_name/test_records.json b/erpnext/education/doctype/student_batch_name/test_records.json
similarity index 100%
rename from erpnext/schools/doctype/student_batch_name/test_records.json
rename to erpnext/education/doctype/student_batch_name/test_records.json
diff --git a/erpnext/schools/doctype/student_batch_name/test_student_batch_name.js b/erpnext/education/doctype/student_batch_name/test_student_batch_name.js
similarity index 83%
rename from erpnext/schools/doctype/student_batch_name/test_student_batch_name.js
rename to erpnext/education/doctype/student_batch_name/test_student_batch_name.js
index 6a10dc1..6c761b8 100644
--- a/erpnext/schools/doctype/student_batch_name/test_student_batch_name.js
+++ b/erpnext/education/doctype/student_batch_name/test_student_batch_name.js
@@ -1,5 +1,5 @@
-// Testing Setup Module in Schools
-QUnit.module('schools');
+// Testing Setup Module in Education
+QUnit.module('education');
 
 QUnit.test('Test: Student Batch Name', function(assert){
 	assert.expect(1);
diff --git a/erpnext/schools/doctype/student_batch_name/test_student_batch_name.py b/erpnext/education/doctype/student_batch_name/test_student_batch_name.py
similarity index 100%
rename from erpnext/schools/doctype/student_batch_name/test_student_batch_name.py
rename to erpnext/education/doctype/student_batch_name/test_student_batch_name.py
diff --git a/erpnext/schools/doctype/student_category/__init__.py b/erpnext/education/doctype/student_category/__init__.py
similarity index 100%
rename from erpnext/schools/doctype/student_category/__init__.py
rename to erpnext/education/doctype/student_category/__init__.py
diff --git a/erpnext/schools/doctype/student_category/student_category.js b/erpnext/education/doctype/student_category/student_category.js
similarity index 100%
rename from erpnext/schools/doctype/student_category/student_category.js
rename to erpnext/education/doctype/student_category/student_category.js
diff --git a/erpnext/schools/doctype/student_category/student_category.json b/erpnext/education/doctype/student_category/student_category.json
similarity index 96%
rename from erpnext/schools/doctype/student_category/student_category.json
rename to erpnext/education/doctype/student_category/student_category.json
index ce4cb4e..d7d4444 100644
--- a/erpnext/schools/doctype/student_category/student_category.json
+++ b/erpnext/education/doctype/student_category/student_category.json
@@ -53,9 +53,9 @@
  "issingle": 0, 
  "istable": 0, 
  "max_attachments": 0, 
- "modified": "2017-06-30 08:21:51.652539", 
+ "modified": "2017-11-10 19:09:45.783401", 
  "modified_by": "Administrator", 
- "module": "Schools", 
+ "module": "Education", 
  "name": "Student Category", 
  "name_case": "", 
  "owner": "Administrator", 
diff --git a/erpnext/schools/doctype/student_category/student_category.py b/erpnext/education/doctype/student_category/student_category.py
similarity index 100%
rename from erpnext/schools/doctype/student_category/student_category.py
rename to erpnext/education/doctype/student_category/student_category.py
diff --git a/erpnext/schools/doctype/student_category/test_student_category.js b/erpnext/education/doctype/student_category/test_student_category.js
similarity index 83%
rename from erpnext/schools/doctype/student_category/test_student_category.js
rename to erpnext/education/doctype/student_category/test_student_category.js
index 5e3109a..01f50e2 100644
--- a/erpnext/schools/doctype/student_category/test_student_category.js
+++ b/erpnext/education/doctype/student_category/test_student_category.js
@@ -1,5 +1,5 @@
-// Testing Setup Module in Schools
-QUnit.module('schools');
+// Testing Setup Module in Education
+QUnit.module('education');
 
 QUnit.test('Test: Student Category', function(assert){
 	assert.expect(1);
diff --git a/erpnext/schools/doctype/student_category/test_student_category.py b/erpnext/education/doctype/student_category/test_student_category.py
similarity index 100%
rename from erpnext/schools/doctype/student_category/test_student_category.py
rename to erpnext/education/doctype/student_category/test_student_category.py
diff --git a/erpnext/schools/doctype/student_group/__init__.py b/erpnext/education/doctype/student_group/__init__.py
similarity index 100%
rename from erpnext/schools/doctype/student_group/__init__.py
rename to erpnext/education/doctype/student_group/__init__.py
diff --git a/erpnext/schools/doctype/student_group/student_group.js b/erpnext/education/doctype/student_group/student_group.js
similarity index 92%
rename from erpnext/schools/doctype/student_group/student_group.js
rename to erpnext/education/doctype/student_group/student_group.js
index 80355a8..f3f8c88 100644
--- a/erpnext/schools/doctype/student_group/student_group.js
+++ b/erpnext/education/doctype/student_group/student_group.js
@@ -12,7 +12,7 @@
 		if (!frm.__islocal) {
 			frm.set_query("student", "students", function() {
 				return{
-					query: "erpnext.schools.doctype.student_group.student_group.fetch_students",
+					query: "erpnext.education.doctype.student_group.student_group.fetch_students",
 					filters: {
 						'academic_year': frm.doc.academic_year,
 						'group_based_on': frm.doc.group_based_on,
@@ -50,7 +50,7 @@
 			});
 			frm.add_custom_button(__("Update Email Group"), function() {
 				frappe.call({
-					method: "erpnext.schools.api.update_email_group",
+					method: "erpnext.education.api.update_email_group",
 					args: {
 						"doctype": "Student Group",
 						"name": frm.doc.name
@@ -83,7 +83,7 @@
 				}
 			});
 			frappe.call({
-				method: "erpnext.schools.doctype.student_group.student_group.get_students",
+				method: "erpnext.education.doctype.student_group.student_group.get_students",
 				args: {
 					"academic_year": frm.doc.academic_year,
 					"academic_term": frm.doc.academic_term,
diff --git a/erpnext/schools/doctype/student_group/student_group.json b/erpnext/education/doctype/student_group/student_group.json
similarity index 99%
rename from erpnext/schools/doctype/student_group/student_group.json
rename to erpnext/education/doctype/student_group/student_group.json
index 0a9b41a..37a611b 100644
--- a/erpnext/schools/doctype/student_group/student_group.json
+++ b/erpnext/education/doctype/student_group/student_group.json
@@ -459,9 +459,9 @@
  "istable": 0, 
  "max_attachments": 0, 
  "menu_index": 0, 
- "modified": "2017-06-30 08:21:51.755519", 
+ "modified": "2017-11-10 19:09:37.370864", 
  "modified_by": "Administrator", 
- "module": "Schools", 
+ "module": "Education", 
  "name": "Student Group", 
  "name_case": "", 
  "owner": "Administrator", 
diff --git a/erpnext/schools/doctype/student_group/student_group.py b/erpnext/education/doctype/student_group/student_group.py
similarity index 98%
rename from erpnext/schools/doctype/student_group/student_group.py
rename to erpnext/education/doctype/student_group/student_group.py
index 950632b..d508589 100644
--- a/erpnext/schools/doctype/student_group/student_group.py
+++ b/erpnext/education/doctype/student_group/student_group.py
@@ -6,7 +6,7 @@
 import frappe
 from frappe.model.document import Document
 from frappe import _
-from erpnext.schools.utils import validate_duplicate_student
+from erpnext.education.utils import validate_duplicate_student
 from frappe.utils import cint
 
 class StudentGroup(Document):
diff --git a/erpnext/schools/doctype/student_group/test_records.json b/erpnext/education/doctype/student_group/test_records.json
similarity index 100%
rename from erpnext/schools/doctype/student_group/test_records.json
rename to erpnext/education/doctype/student_group/test_records.json
diff --git a/erpnext/schools/doctype/student_group/test_student_group.js b/erpnext/education/doctype/student_group/test_student_group.js
similarity index 95%
rename from erpnext/schools/doctype/student_group/test_student_group.js
rename to erpnext/education/doctype/student_group/test_student_group.js
index bee5067..6673343 100644
--- a/erpnext/schools/doctype/student_group/test_student_group.js
+++ b/erpnext/education/doctype/student_group/test_student_group.js
@@ -1,5 +1,5 @@
-// Testing Student Module in Schools
-QUnit.module('schools');
+// Testing Student Module in Education
+QUnit.module('education');
 
 QUnit.test('Test: Student Group', function(assert){
 	assert.expect(2);
diff --git a/erpnext/schools/doctype/student_group/test_student_group.py b/erpnext/education/doctype/student_group/test_student_group.py
similarity index 100%
rename from erpnext/schools/doctype/student_group/test_student_group.py
rename to erpnext/education/doctype/student_group/test_student_group.py
diff --git a/erpnext/schools/doctype/student_group_creation_tool/__init__.py b/erpnext/education/doctype/student_group_creation_tool/__init__.py
similarity index 100%
rename from erpnext/schools/doctype/student_group_creation_tool/__init__.py
rename to erpnext/education/doctype/student_group_creation_tool/__init__.py
diff --git a/erpnext/schools/doctype/student_group_creation_tool/student_group_creation_tool.js b/erpnext/education/doctype/student_group_creation_tool/student_group_creation_tool.js
similarity index 100%
rename from erpnext/schools/doctype/student_group_creation_tool/student_group_creation_tool.js
rename to erpnext/education/doctype/student_group_creation_tool/student_group_creation_tool.js
diff --git a/erpnext/schools/doctype/student_group_creation_tool/student_group_creation_tool.json b/erpnext/education/doctype/student_group_creation_tool/student_group_creation_tool.json
similarity index 98%
rename from erpnext/schools/doctype/student_group_creation_tool/student_group_creation_tool.json
rename to erpnext/education/doctype/student_group_creation_tool/student_group_creation_tool.json
index a6ed989..d759b91 100644
--- a/erpnext/schools/doctype/student_group_creation_tool/student_group_creation_tool.json
+++ b/erpnext/education/doctype/student_group_creation_tool/student_group_creation_tool.json
@@ -269,9 +269,9 @@
  "issingle": 1, 
  "istable": 0, 
  "max_attachments": 0, 
- "modified": "2017-07-17 21:57:35.602091", 
+ "modified": "2017-11-10 19:40:07.862203", 
  "modified_by": "Administrator", 
- "module": "Schools", 
+ "module": "Education", 
  "name": "Student Group Creation Tool", 
  "name_case": "", 
  "owner": "Administrator", 
diff --git a/erpnext/schools/doctype/student_group_creation_tool/student_group_creation_tool.py b/erpnext/education/doctype/student_group_creation_tool/student_group_creation_tool.py
similarity index 97%
rename from erpnext/schools/doctype/student_group_creation_tool/student_group_creation_tool.py
rename to erpnext/education/doctype/student_group_creation_tool/student_group_creation_tool.py
index 649e5da..643093e 100644
--- a/erpnext/schools/doctype/student_group_creation_tool/student_group_creation_tool.py
+++ b/erpnext/education/doctype/student_group_creation_tool/student_group_creation_tool.py
@@ -6,7 +6,7 @@
 import frappe
 from frappe import _
 from frappe.model.document import Document
-from erpnext.schools.doctype.student_group.student_group import get_students
+from erpnext.education.doctype.student_group.student_group import get_students
 
 class StudentGroupCreationTool(Document):
 	def get_courses(self):
diff --git a/erpnext/schools/doctype/student_group_creation_tool/test_student_group_creation_tool.js b/erpnext/education/doctype/student_group_creation_tool/test_student_group_creation_tool.js
similarity index 98%
rename from erpnext/schools/doctype/student_group_creation_tool/test_student_group_creation_tool.js
rename to erpnext/education/doctype/student_group_creation_tool/test_student_group_creation_tool.js
index a8567b3..34c1093 100644
--- a/erpnext/schools/doctype/student_group_creation_tool/test_student_group_creation_tool.js
+++ b/erpnext/education/doctype/student_group_creation_tool/test_student_group_creation_tool.js
@@ -1,4 +1,4 @@
-QUnit.module('schools');
+QUnit.module('education');
 
 QUnit.test('Test: Student Group Creation Tool', function(assert){
 	assert.expect(5);
diff --git a/erpnext/accounts/doctype/asset_category/test_asset_category.py b/erpnext/education/doctype/student_group_creation_tool/test_student_group_creation_tool.py
similarity index 76%
copy from erpnext/accounts/doctype/asset_category/test_asset_category.py
copy to erpnext/education/doctype/student_group_creation_tool/test_student_group_creation_tool.py
index 4d5169a..9ca5658 100644
--- a/erpnext/accounts/doctype/asset_category/test_asset_category.py
+++ b/erpnext/education/doctype/student_group_creation_tool/test_student_group_creation_tool.py
@@ -6,5 +6,5 @@
 import frappe
 import unittest
 
-class TestAssetCategory(unittest.TestCase):
+class TestStudentGroupCreationTool(unittest.TestCase):
 	pass
diff --git a/erpnext/schools/doctype/student_group_creation_tool_course/__init__.py b/erpnext/education/doctype/student_group_creation_tool_course/__init__.py
similarity index 100%
rename from erpnext/schools/doctype/student_group_creation_tool_course/__init__.py
rename to erpnext/education/doctype/student_group_creation_tool_course/__init__.py
diff --git a/erpnext/schools/doctype/student_group_creation_tool_course/student_group_creation_tool_course.json b/erpnext/education/doctype/student_group_creation_tool_course/student_group_creation_tool_course.json
similarity index 98%
rename from erpnext/schools/doctype/student_group_creation_tool_course/student_group_creation_tool_course.json
rename to erpnext/education/doctype/student_group_creation_tool_course/student_group_creation_tool_course.json
index d945d4b..a749929 100644
--- a/erpnext/schools/doctype/student_group_creation_tool_course/student_group_creation_tool_course.json
+++ b/erpnext/education/doctype/student_group_creation_tool_course/student_group_creation_tool_course.json
@@ -236,9 +236,9 @@
  "issingle": 0, 
  "istable": 1, 
  "max_attachments": 0, 
- "modified": "2017-05-15 14:18:23.435415", 
+ "modified": "2017-11-10 19:08:27.657591", 
  "modified_by": "Administrator", 
- "module": "Schools", 
+ "module": "Education", 
  "name": "Student Group Creation Tool Course", 
  "name_case": "", 
  "owner": "Administrator", 
diff --git a/erpnext/schools/doctype/student_group_creation_tool_course/student_group_creation_tool_course.py b/erpnext/education/doctype/student_group_creation_tool_course/student_group_creation_tool_course.py
similarity index 100%
rename from erpnext/schools/doctype/student_group_creation_tool_course/student_group_creation_tool_course.py
rename to erpnext/education/doctype/student_group_creation_tool_course/student_group_creation_tool_course.py
diff --git a/erpnext/schools/doctype/student_group_instructor/__init__.py b/erpnext/education/doctype/student_group_instructor/__init__.py
similarity index 100%
rename from erpnext/schools/doctype/student_group_instructor/__init__.py
rename to erpnext/education/doctype/student_group_instructor/__init__.py
diff --git a/erpnext/schools/doctype/student_group_instructor/student_group_instructor.json b/erpnext/education/doctype/student_group_instructor/student_group_instructor.json
similarity index 94%
rename from erpnext/schools/doctype/student_group_instructor/student_group_instructor.json
rename to erpnext/education/doctype/student_group_instructor/student_group_instructor.json
index 541e9b3..c09d7d3 100644
--- a/erpnext/schools/doctype/student_group_instructor/student_group_instructor.json
+++ b/erpnext/education/doctype/student_group_instructor/student_group_instructor.json
@@ -13,6 +13,7 @@
  "engine": "InnoDB", 
  "fields": [
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -43,6 +44,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -71,6 +73,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -111,9 +114,9 @@
  "issingle": 0, 
  "istable": 1, 
  "max_attachments": 0, 
- "modified": "2017-04-17 16:06:05.792863", 
+ "modified": "2017-11-10 19:11:31.439735", 
  "modified_by": "Administrator", 
- "module": "Schools", 
+ "module": "Education", 
  "name": "Student Group Instructor", 
  "name_case": "", 
  "owner": "Administrator", 
diff --git a/erpnext/schools/doctype/student_group_instructor/student_group_instructor.py b/erpnext/education/doctype/student_group_instructor/student_group_instructor.py
similarity index 100%
rename from erpnext/schools/doctype/student_group_instructor/student_group_instructor.py
rename to erpnext/education/doctype/student_group_instructor/student_group_instructor.py
diff --git a/erpnext/schools/doctype/student_group_student/__init__.py b/erpnext/education/doctype/student_group_student/__init__.py
similarity index 100%
rename from erpnext/schools/doctype/student_group_student/__init__.py
rename to erpnext/education/doctype/student_group_student/__init__.py
diff --git a/erpnext/schools/doctype/student_group_student/student_group_student.json b/erpnext/education/doctype/student_group_student/student_group_student.json
similarity index 95%
rename from erpnext/schools/doctype/student_group_student/student_group_student.json
rename to erpnext/education/doctype/student_group_student/student_group_student.json
index 5fc434a..3ff339f 100644
--- a/erpnext/schools/doctype/student_group_student/student_group_student.json
+++ b/erpnext/education/doctype/student_group_student/student_group_student.json
@@ -12,6 +12,7 @@
  "editable_grid": 1, 
  "fields": [
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -42,6 +43,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -71,6 +73,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -99,6 +102,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -128,6 +132,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -168,9 +173,9 @@
  "issingle": 0, 
  "istable": 1, 
  "max_attachments": 0, 
- "modified": "2017-04-12 14:56:07.532226", 
+ "modified": "2017-11-10 19:11:39.735521", 
  "modified_by": "Administrator", 
- "module": "Schools", 
+ "module": "Education", 
  "name": "Student Group Student", 
  "name_case": "", 
  "owner": "Administrator", 
diff --git a/erpnext/schools/doctype/student_group_student/student_group_student.py b/erpnext/education/doctype/student_group_student/student_group_student.py
similarity index 100%
rename from erpnext/schools/doctype/student_group_student/student_group_student.py
rename to erpnext/education/doctype/student_group_student/student_group_student.py
diff --git a/erpnext/schools/doctype/student_guardian/__init__.py b/erpnext/education/doctype/student_guardian/__init__.py
similarity index 100%
rename from erpnext/schools/doctype/student_guardian/__init__.py
rename to erpnext/education/doctype/student_guardian/__init__.py
diff --git a/erpnext/schools/doctype/student_guardian/student_guardian.json b/erpnext/education/doctype/student_guardian/student_guardian.json
similarity index 93%
rename from erpnext/schools/doctype/student_guardian/student_guardian.json
rename to erpnext/education/doctype/student_guardian/student_guardian.json
index b5f9d88..b4844fd 100644
--- a/erpnext/schools/doctype/student_guardian/student_guardian.json
+++ b/erpnext/education/doctype/student_guardian/student_guardian.json
@@ -1,5 +1,6 @@
 {
  "allow_copy": 0, 
+ "allow_guest_to_view": 0, 
  "allow_import": 0, 
  "allow_rename": 0, 
  "beta": 0, 
@@ -11,6 +12,7 @@
  "editable_grid": 1, 
  "fields": [
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -41,6 +43,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -70,6 +73,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -100,19 +104,19 @@
    "unique": 0
   }
  ], 
+ "has_web_view": 0, 
  "hide_heading": 0, 
  "hide_toolbar": 0, 
  "idx": 0, 
  "image_view": 0, 
  "in_create": 0, 
- "in_dialog": 0, 
  "is_submittable": 0, 
  "issingle": 0, 
  "istable": 1, 
  "max_attachments": 0, 
- "modified": "2017-02-17 17:13:53.507571", 
+ "modified": "2017-11-10 19:10:57.680471", 
  "modified_by": "Administrator", 
- "module": "Schools", 
+ "module": "Education", 
  "name": "Student Guardian", 
  "name_case": "", 
  "owner": "Administrator", 
diff --git a/erpnext/schools/doctype/student_guardian/student_guardian.py b/erpnext/education/doctype/student_guardian/student_guardian.py
similarity index 100%
rename from erpnext/schools/doctype/student_guardian/student_guardian.py
rename to erpnext/education/doctype/student_guardian/student_guardian.py
diff --git a/erpnext/schools/doctype/student_language/__init__.py b/erpnext/education/doctype/student_language/__init__.py
similarity index 100%
rename from erpnext/schools/doctype/student_language/__init__.py
rename to erpnext/education/doctype/student_language/__init__.py
diff --git a/erpnext/schools/doctype/student_language/student_language.js b/erpnext/education/doctype/student_language/student_language.js
similarity index 100%
rename from erpnext/schools/doctype/student_language/student_language.js
rename to erpnext/education/doctype/student_language/student_language.js
diff --git a/erpnext/schools/doctype/student_language/student_language.json b/erpnext/education/doctype/student_language/student_language.json
similarity index 91%
rename from erpnext/schools/doctype/student_language/student_language.json
rename to erpnext/education/doctype/student_language/student_language.json
index f3b4eb1..43e6dbd 100644
--- a/erpnext/schools/doctype/student_language/student_language.json
+++ b/erpnext/education/doctype/student_language/student_language.json
@@ -1,5 +1,6 @@
 {
  "allow_copy": 0, 
+ "allow_guest_to_view": 0, 
  "allow_import": 0, 
  "allow_rename": 0, 
  "autoname": "field:language_name", 
@@ -13,6 +14,7 @@
  "engine": "InnoDB", 
  "fields": [
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -24,7 +26,7 @@
    "ignore_xss_filter": 0, 
    "in_filter": 0, 
    "in_global_search": 0, 
-   "in_list_view": 0, 
+   "in_list_view": 1, 
    "in_standard_filter": 0, 
    "label": "Language Name", 
    "length": 0, 
@@ -42,19 +44,19 @@
    "unique": 0
   }
  ], 
+ "has_web_view": 0, 
  "hide_heading": 0, 
  "hide_toolbar": 0, 
  "idx": 0, 
  "image_view": 0, 
  "in_create": 0, 
- "in_dialog": 0, 
  "is_submittable": 0, 
  "issingle": 0, 
  "istable": 0, 
  "max_attachments": 0, 
- "modified": "2017-02-22 13:03:48.600707", 
+ "modified": "2017-11-10 19:05:37.035846", 
  "modified_by": "Administrator", 
- "module": "Schools", 
+ "module": "Education", 
  "name": "Student Language", 
  "name_case": "", 
  "owner": "Administrator", 
diff --git a/erpnext/schools/doctype/student_language/student_language.py b/erpnext/education/doctype/student_language/student_language.py
similarity index 100%
rename from erpnext/schools/doctype/student_language/student_language.py
rename to erpnext/education/doctype/student_language/student_language.py
diff --git a/erpnext/accounts/doctype/asset_category/test_asset_category.js b/erpnext/education/doctype/student_language/test_student_language.js
similarity index 70%
copy from erpnext/accounts/doctype/asset_category/test_asset_category.js
copy to erpnext/education/doctype/student_language/test_student_language.js
index 7e343b7..9b25569 100644
--- a/erpnext/accounts/doctype/asset_category/test_asset_category.js
+++ b/erpnext/education/doctype/student_language/test_student_language.js
@@ -2,15 +2,15 @@
 // rename this file from _test_[name] to test_[name] to activate
 // and remove above this line
 
-QUnit.test("test: Asset Category", function (assert) {
+QUnit.test("test: Student Language", function (assert) {
 	let done = assert.async();
 
 	// number of asserts
 	assert.expect(1);
 
 	frappe.run_serially([
-		// insert a new Asset Category
-		() => frappe.tests.make('Asset Category', [
+		// insert a new Student Language
+		() => frappe.tests.make('Student Language', [
 			// values to be set
 			{key: 'value'}
 		]),
diff --git a/erpnext/schools/doctype/student_language/test_student_language.py b/erpnext/education/doctype/student_language/test_student_language.py
similarity index 100%
rename from erpnext/schools/doctype/student_language/test_student_language.py
rename to erpnext/education/doctype/student_language/test_student_language.py
diff --git a/erpnext/schools/doctype/student_leave_application/__init__.py b/erpnext/education/doctype/student_leave_application/__init__.py
similarity index 100%
rename from erpnext/schools/doctype/student_leave_application/__init__.py
rename to erpnext/education/doctype/student_leave_application/__init__.py
diff --git a/erpnext/schools/doctype/student_leave_application/student_leave_application.js b/erpnext/education/doctype/student_leave_application/student_leave_application.js
similarity index 100%
rename from erpnext/schools/doctype/student_leave_application/student_leave_application.js
rename to erpnext/education/doctype/student_leave_application/student_leave_application.js
diff --git a/erpnext/schools/doctype/student_attendance_tool/student_attendance_tool.json b/erpnext/education/doctype/student_leave_application/student_leave_application.json
similarity index 73%
copy from erpnext/schools/doctype/student_attendance_tool/student_attendance_tool.json
copy to erpnext/education/doctype/student_leave_application/student_leave_application.json
index 5c28655..93ff1ad 100644
--- a/erpnext/schools/doctype/student_attendance_tool/student_attendance_tool.json
+++ b/erpnext/education/doctype/student_leave_application/student_leave_application.json
@@ -1,10 +1,11 @@
 {
- "allow_copy": 1, 
+ "allow_copy": 0, 
  "allow_guest_to_view": 0, 
  "allow_import": 0, 
  "allow_rename": 0, 
+ "autoname": "SLA.######", 
  "beta": 0, 
- "creation": "2016-11-16 17:12:46.437539", 
+ "creation": "2016-11-28 15:38:54.793854", 
  "custom": 0, 
  "docstatus": 0, 
  "doctype": "DocType", 
@@ -18,20 +19,50 @@
    "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
-   "default": "", 
-   "fieldname": "based_on", 
-   "fieldtype": "Select", 
+   "fieldname": "student", 
+   "fieldtype": "Link", 
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
    "in_filter": 0, 
-   "in_global_search": 0, 
+   "in_global_search": 1, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
-   "label": "Based On", 
+   "label": "Student", 
    "length": 0, 
    "no_copy": 0, 
-   "options": "Student Group\nCourse Schedule", 
+   "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_bulk_edit": 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_global_search": 1, 
+   "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, 
@@ -50,40 +81,7 @@
    "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
-   "default": "Batch", 
-   "depends_on": "eval:doc.based_on == \"Student Group\"", 
-   "fieldname": "group_based_on", 
-   "fieldtype": "Select", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 0, 
-   "in_standard_filter": 0, 
-   "label": "Group Based On", 
-   "length": 0, 
-   "no_copy": 0, 
-   "options": "Batch\nCourse\nActivity", 
-   "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_bulk_edit": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "column_break_2", 
+   "fieldname": "column_break_3", 
    "fieldtype": "Column Break", 
    "hidden": 0, 
    "ignore_user_permissions": 0, 
@@ -92,6 +90,7 @@
    "in_global_search": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
+   "label": "", 
    "length": 0, 
    "no_copy": 0, 
    "permlevel": 0, 
@@ -112,20 +111,18 @@
    "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
-   "depends_on": "eval:doc.based_on ==\"Student Group\"", 
-   "fieldname": "student_group", 
-   "fieldtype": "Link", 
+   "fieldname": "from_date", 
+   "fieldtype": "Date", 
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
    "in_filter": 0, 
    "in_global_search": 0, 
    "in_list_view": 1, 
-   "in_standard_filter": 0, 
-   "label": "Student Group", 
+   "in_standard_filter": 1, 
+   "label": "From Date", 
    "length": 0, 
    "no_copy": 0, 
-   "options": "Student Group", 
    "permlevel": 0, 
    "precision": "", 
    "print_hide": 0, 
@@ -144,40 +141,7 @@
    "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
-   "depends_on": "eval:doc.based_on ==\"Course Schedule\"", 
-   "fieldname": "course_schedule", 
-   "fieldtype": "Link", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 1, 
-   "in_standard_filter": 0, 
-   "label": "Course Schedule", 
-   "length": 0, 
-   "no_copy": 0, 
-   "options": "Course Schedule", 
-   "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_bulk_edit": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "depends_on": "eval:doc.based_on ==\"Student Group\"", 
-   "fieldname": "date", 
+   "fieldname": "to_date", 
    "fieldtype": "Date", 
    "hidden": 0, 
    "ignore_user_permissions": 0, 
@@ -186,7 +150,7 @@
    "in_global_search": 0, 
    "in_list_view": 1, 
    "in_standard_filter": 0, 
-   "label": "Date", 
+   "label": "To Date", 
    "length": 0, 
    "no_copy": 0, 
    "permlevel": 0, 
@@ -207,9 +171,9 @@
    "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
-   "depends_on": "eval: (doc.course_schedule \n|| (doc.student_group && doc.date))", 
-   "fieldname": "attendance", 
-   "fieldtype": "Section Break", 
+   "description": "Will show the student as Present in Student Monthly Attendance Report", 
+   "fieldname": "mark_as_present", 
+   "fieldtype": "Check", 
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
@@ -217,7 +181,7 @@
    "in_global_search": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
-   "label": "Attendance", 
+   "label": "Mark as Present", 
    "length": 0, 
    "no_copy": 0, 
    "permlevel": 0, 
@@ -238,8 +202,8 @@
    "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
-   "fieldname": "students_html", 
-   "fieldtype": "HTML", 
+   "fieldname": "section_break_5", 
+   "fieldtype": "Section Break", 
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
@@ -247,7 +211,6 @@
    "in_global_search": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
-   "label": "Students HTML", 
    "length": 0, 
    "no_copy": 0, 
    "permlevel": 0, 
@@ -261,73 +224,134 @@
    "search_index": 0, 
    "set_only_once": 0, 
    "unique": 0
+  }, 
+  {
+   "allow_bulk_edit": 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_global_search": 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_bulk_edit": 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_global_search": 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
   }
  ], 
  "has_web_view": 0, 
- "hide_heading": 1, 
- "hide_toolbar": 1, 
+ "hide_heading": 0, 
+ "hide_toolbar": 0, 
  "idx": 0, 
  "image_view": 0, 
  "in_create": 0, 
- "is_submittable": 0, 
- "issingle": 1, 
+ "is_submittable": 1, 
+ "issingle": 0, 
  "istable": 0, 
  "max_attachments": 0, 
- "modified": "2017-11-08 11:53:27.994112", 
+ "modified": "2017-11-10 19:09:31.848381", 
  "modified_by": "Administrator", 
- "module": "Schools", 
- "name": "Student Attendance Tool", 
+ "module": "Education", 
+ "name": "Student Leave Application", 
  "name_case": "", 
  "owner": "Administrator", 
  "permissions": [
   {
-   "amend": 0, 
+   "amend": 1, 
    "apply_user_permissions": 0, 
-   "cancel": 0, 
+   "cancel": 1, 
    "create": 1, 
-   "delete": 0, 
-   "email": 0, 
+   "delete": 1, 
+   "email": 1, 
    "export": 0, 
    "if_owner": 0, 
    "import": 0, 
    "permlevel": 0, 
-   "print": 0, 
+   "print": 1, 
    "read": 1, 
-   "report": 0, 
+   "report": 1, 
    "role": "Instructor", 
    "set_user_permissions": 0, 
    "share": 0, 
-   "submit": 0, 
+   "submit": 1, 
    "write": 1
   }, 
   {
-   "amend": 0, 
+   "amend": 1, 
    "apply_user_permissions": 0, 
-   "cancel": 0, 
+   "cancel": 1, 
    "create": 1, 
-   "delete": 0, 
-   "email": 0, 
-   "export": 0, 
+   "delete": 1, 
+   "email": 1, 
+   "export": 1, 
    "if_owner": 0, 
    "import": 0, 
    "permlevel": 0, 
-   "print": 0, 
+   "print": 1, 
    "read": 1, 
-   "report": 0, 
+   "report": 1, 
    "role": "Academics User", 
    "set_user_permissions": 0, 
-   "share": 0, 
-   "submit": 0, 
+   "share": 1, 
+   "submit": 1, 
    "write": 1
   }
  ], 
- "quick_entry": 0, 
+ "quick_entry": 1, 
  "read_only": 0, 
  "read_only_onload": 0, 
  "restrict_to_domain": "Education", 
- "show_name_in_global_search": 0, 
+ "show_name_in_global_search": 1, 
  "sort_field": "modified", 
  "sort_order": "DESC", 
+ "title_field": "student_name", 
  "track_changes": 0, 
  "track_seen": 0
 }
\ No newline at end of file
diff --git a/erpnext/schools/doctype/student_leave_application/student_leave_application.py b/erpnext/education/doctype/student_leave_application/student_leave_application.py
similarity index 100%
rename from erpnext/schools/doctype/student_leave_application/student_leave_application.py
rename to erpnext/education/doctype/student_leave_application/student_leave_application.py
diff --git a/erpnext/schools/doctype/student_leave_application/test_student_leave_application.js b/erpnext/education/doctype/student_leave_application/test_student_leave_application.js
similarity index 96%
rename from erpnext/schools/doctype/student_leave_application/test_student_leave_application.js
rename to erpnext/education/doctype/student_leave_application/test_student_leave_application.js
index d7a6973..5af9f5d 100644
--- a/erpnext/schools/doctype/student_leave_application/test_student_leave_application.js
+++ b/erpnext/education/doctype/student_leave_application/test_student_leave_application.js
@@ -1,5 +1,5 @@
-// Testing Attendance Module in Schools
-QUnit.module('schools');
+// Testing Attendance Module in Education
+QUnit.module('education');
 
 QUnit.test('Test: Student Leave Application', function(assert){
 	assert.expect(4);
diff --git a/erpnext/schools/doctype/student_leave_application/test_student_leave_application.py b/erpnext/education/doctype/student_leave_application/test_student_leave_application.py
similarity index 100%
rename from erpnext/schools/doctype/student_leave_application/test_student_leave_application.py
rename to erpnext/education/doctype/student_leave_application/test_student_leave_application.py
diff --git a/erpnext/schools/doctype/student_log/__init__.py b/erpnext/education/doctype/student_log/__init__.py
similarity index 100%
rename from erpnext/schools/doctype/student_log/__init__.py
rename to erpnext/education/doctype/student_log/__init__.py
diff --git a/erpnext/schools/doctype/student_log/student_log.js b/erpnext/education/doctype/student_log/student_log.js
similarity index 100%
rename from erpnext/schools/doctype/student_log/student_log.js
rename to erpnext/education/doctype/student_log/student_log.js
diff --git a/erpnext/schools/doctype/student_admission/student_admission.json b/erpnext/education/doctype/student_log/student_log.json
similarity index 83%
copy from erpnext/schools/doctype/student_admission/student_admission.json
copy to erpnext/education/doctype/student_log/student_log.json
index c35d5be..9d55bb9 100644
--- a/erpnext/schools/doctype/student_admission/student_admission.json
+++ b/erpnext/education/doctype/student_log/student_log.json
@@ -1,16 +1,17 @@
 {
  "allow_copy": 0, 
- "allow_guest_to_view": 1, 
+ "allow_guest_to_view": 0, 
  "allow_import": 0, 
- "allow_rename": 1, 
- "autoname": "", 
+ "allow_rename": 0, 
+ "autoname": "SLog.####", 
  "beta": 0, 
- "creation": "2016-09-13 03:05:27.154713", 
+ "creation": "2016-07-29 03:27:22.451772", 
  "custom": 0, 
  "docstatus": 0, 
  "doctype": "DocType", 
- "document_type": "Document", 
+ "document_type": "", 
  "editable_grid": 1, 
+ "engine": "InnoDB", 
  "fields": [
   {
    "allow_bulk_edit": 0, 
@@ -18,18 +19,50 @@
    "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
-   "fieldname": "title", 
-   "fieldtype": "Data", 
+   "fieldname": "student", 
+   "fieldtype": "Link", 
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
    "in_filter": 0, 
    "in_global_search": 0, 
    "in_list_view": 0, 
-   "in_standard_filter": 0, 
-   "label": "Title", 
+   "in_standard_filter": 1, 
+   "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_bulk_edit": 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_global_search": 1, 
+   "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, 
@@ -48,19 +81,19 @@
    "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
-   "depends_on": "", 
-   "fieldname": "route", 
-   "fieldtype": "Data", 
+   "fieldname": "type", 
+   "fieldtype": "Select", 
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
    "in_filter": 0, 
    "in_global_search": 0, 
-   "in_list_view": 0, 
-   "in_standard_filter": 0, 
-   "label": "Route", 
+   "in_list_view": 1, 
+   "in_standard_filter": 1, 
+   "label": "Type", 
    "length": 0, 
-   "no_copy": 1, 
+   "no_copy": 0, 
+   "options": "General\nAcademic\nMedical\nAchievement", 
    "permlevel": 0, 
    "precision": "", 
    "print_hide": 0, 
@@ -71,7 +104,7 @@
    "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
-   "unique": 1
+   "unique": 0
   }, 
   {
    "allow_bulk_edit": 0, 
@@ -79,16 +112,16 @@
    "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
-   "fieldname": "application_form_route", 
-   "fieldtype": "Data", 
+   "fieldname": "date", 
+   "fieldtype": "Date", 
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
    "in_filter": 0, 
    "in_global_search": 0, 
-   "in_list_view": 0, 
+   "in_list_view": 1, 
    "in_standard_filter": 0, 
-   "label": "Application Form Route", 
+   "label": "Date", 
    "length": 0, 
    "no_copy": 0, 
    "permlevel": 0, 
@@ -98,7 +131,7 @@
    "read_only": 0, 
    "remember_last_selected_value": 0, 
    "report_hide": 0, 
-   "reqd": 1, 
+   "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
    "unique": 0
@@ -145,11 +178,11 @@
    "ignore_xss_filter": 0, 
    "in_filter": 0, 
    "in_global_search": 0, 
-   "in_list_view": 1, 
-   "in_standard_filter": 1, 
+   "in_list_view": 0, 
+   "in_standard_filter": 0, 
    "label": "Academic Year", 
    "length": 0, 
-   "no_copy": 1, 
+   "no_copy": 0, 
    "options": "Academic Year", 
    "permlevel": 0, 
    "precision": "", 
@@ -158,36 +191,6 @@
    "read_only": 0, 
    "remember_last_selected_value": 0, 
    "report_hide": 0, 
-   "reqd": 1, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "unique": 0
-  }, 
-  {
-   "allow_bulk_edit": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "admission_start_date", 
-   "fieldtype": "Date", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 0, 
-   "in_standard_filter": 0, 
-   "label": "Admission Start Date", 
-   "length": 0, 
-   "no_copy": 1, 
-   "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, 
@@ -199,8 +202,8 @@
    "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
-   "fieldname": "admission_end_date", 
-   "fieldtype": "Date", 
+   "fieldname": "academic_term", 
+   "fieldtype": "Link", 
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
@@ -208,39 +211,72 @@
    "in_global_search": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
-   "label": "Admission End Date", 
-   "length": 0, 
-   "no_copy": 1, 
-   "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_bulk_edit": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "published", 
-   "fieldtype": "Check", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 0, 
-   "in_standard_filter": 0, 
-   "label": "Publish on website", 
+   "label": "Academic Term", 
    "length": 0, 
    "no_copy": 0, 
+   "options": "Academic Term", 
+   "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_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "fieldname": "program", 
+   "fieldtype": "Link", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "ignore_xss_filter": 0, 
+   "in_filter": 0, 
+   "in_global_search": 0, 
+   "in_list_view": 0, 
+   "in_standard_filter": 0, 
+   "label": "Program", 
+   "length": 0, 
+   "no_copy": 0, 
+   "options": "Program", 
+   "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_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "fieldname": "student_batch", 
+   "fieldtype": "Link", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "ignore_xss_filter": 0, 
+   "in_filter": 0, 
+   "in_global_search": 0, 
+   "in_list_view": 0, 
+   "in_standard_filter": 0, 
+   "label": "Student Batch", 
+   "length": 0, 
+   "no_copy": 0, 
+   "options": "Student Batch Name", 
    "permlevel": 0, 
    "precision": "", 
    "print_hide": 0, 
@@ -268,7 +304,6 @@
    "in_global_search": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
-   "label": "Eligibility and Details", 
    "length": 0, 
    "no_copy": 0, 
    "permlevel": 0, 
@@ -289,47 +324,16 @@
    "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
-   "fieldname": "program_details", 
-   "fieldtype": "Table", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 0, 
-   "in_standard_filter": 0, 
-   "label": "Eligibility and Details", 
-   "length": 0, 
-   "no_copy": 0, 
-   "options": "Student Admission Program", 
-   "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_bulk_edit": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "introduction", 
+   "fieldname": "log", 
    "fieldtype": "Text Editor", 
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
    "in_filter": 0, 
-   "in_global_search": 0, 
+   "in_global_search": 1, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
-   "label": "Introduction", 
+   "label": "Log", 
    "length": 0, 
    "no_copy": 0, 
    "permlevel": 0, 
@@ -345,21 +349,20 @@
    "unique": 0
   }
  ], 
- "has_web_view": 1, 
+ "has_web_view": 0, 
  "hide_heading": 0, 
  "hide_toolbar": 0, 
  "idx": 0, 
  "image_view": 0, 
  "in_create": 0, 
- "is_published_field": "published", 
  "is_submittable": 0, 
  "issingle": 0, 
  "istable": 0, 
  "max_attachments": 0, 
- "modified": "2017-10-02 15:16:44.386000", 
+ "modified": "2017-11-10 19:04:50.483773", 
  "modified_by": "Administrator", 
- "module": "Schools", 
- "name": "Student Admission", 
+ "module": "Education", 
+ "name": "Student Log", 
  "name_case": "", 
  "owner": "Administrator", 
  "permissions": [
@@ -388,11 +391,10 @@
  "read_only": 0, 
  "read_only_onload": 0, 
  "restrict_to_domain": "Education", 
- "route": "admissions", 
- "show_name_in_global_search": 1, 
+ "show_name_in_global_search": 0, 
  "sort_field": "modified", 
  "sort_order": "DESC", 
- "title_field": "title", 
+ "title_field": "student_name", 
  "track_changes": 0, 
- "track_seen": 0
+ "track_seen": 1
 }
\ No newline at end of file
diff --git a/erpnext/schools/doctype/student_log/student_log.py b/erpnext/education/doctype/student_log/student_log.py
similarity index 100%
rename from erpnext/schools/doctype/student_log/student_log.py
rename to erpnext/education/doctype/student_log/student_log.py
diff --git a/erpnext/schools/doctype/student_log/test_student_log.js b/erpnext/education/doctype/student_log/test_student_log.js
similarity index 94%
rename from erpnext/schools/doctype/student_log/test_student_log.js
rename to erpnext/education/doctype/student_log/test_student_log.js
index 8f8d152..5775369 100644
--- a/erpnext/schools/doctype/student_log/test_student_log.js
+++ b/erpnext/education/doctype/student_log/test_student_log.js
@@ -1,5 +1,5 @@
-// Testing Student Module in Schools
-QUnit.module('schools');
+// Testing Student Module in Education
+QUnit.module('education');
 
 QUnit.test('Test: Student Log', function(assert){
 	assert.expect(9);
diff --git a/erpnext/schools/doctype/student_log/test_student_log.py b/erpnext/education/doctype/student_log/test_student_log.py
similarity index 100%
rename from erpnext/schools/doctype/student_log/test_student_log.py
rename to erpnext/education/doctype/student_log/test_student_log.py
diff --git a/erpnext/schools/doctype/student_sibling/__init__.py b/erpnext/education/doctype/student_sibling/__init__.py
similarity index 100%
rename from erpnext/schools/doctype/student_sibling/__init__.py
rename to erpnext/education/doctype/student_sibling/__init__.py
diff --git a/erpnext/schools/doctype/student_sibling/student_sibling.json b/erpnext/education/doctype/student_sibling/student_sibling.json
similarity index 95%
rename from erpnext/schools/doctype/student_sibling/student_sibling.json
rename to erpnext/education/doctype/student_sibling/student_sibling.json
index fb698d9..22b7182 100644
--- a/erpnext/schools/doctype/student_sibling/student_sibling.json
+++ b/erpnext/education/doctype/student_sibling/student_sibling.json
@@ -12,6 +12,7 @@
  "editable_grid": 0, 
  "fields": [
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -42,6 +43,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -72,6 +74,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -103,6 +106,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -131,6 +135,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -162,6 +167,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -192,6 +198,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -221,6 +228,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -261,9 +269,9 @@
  "issingle": 0, 
  "istable": 1, 
  "max_attachments": 0, 
- "modified": "2017-03-08 11:26:41.717041", 
+ "modified": "2017-11-10 19:05:24.999063", 
  "modified_by": "Administrator", 
- "module": "Schools", 
+ "module": "Education", 
  "name": "Student Sibling", 
  "name_case": "", 
  "owner": "Administrator", 
diff --git a/erpnext/schools/doctype/student_sibling/student_sibling.py b/erpnext/education/doctype/student_sibling/student_sibling.py
similarity index 100%
rename from erpnext/schools/doctype/student_sibling/student_sibling.py
rename to erpnext/education/doctype/student_sibling/student_sibling.py
diff --git a/erpnext/schools/doctype/student_siblings/__init__.py b/erpnext/education/doctype/student_siblings/__init__.py
similarity index 100%
rename from erpnext/schools/doctype/student_siblings/__init__.py
rename to erpnext/education/doctype/student_siblings/__init__.py
diff --git a/erpnext/schools/doctype/student_siblings/student_siblings.json b/erpnext/education/doctype/student_siblings/student_siblings.json
similarity index 81%
rename from erpnext/schools/doctype/student_siblings/student_siblings.json
rename to erpnext/education/doctype/student_siblings/student_siblings.json
index 4f1ed02..0fdc2fd 100644
--- a/erpnext/schools/doctype/student_siblings/student_siblings.json
+++ b/erpnext/education/doctype/student_siblings/student_siblings.json
@@ -1,5 +1,6 @@
 {
  "allow_copy": 0, 
+ "allow_guest_to_view": 0, 
  "allow_import": 0, 
  "allow_rename": 0, 
  "beta": 0, 
@@ -11,6 +12,7 @@
  "editable_grid": 1, 
  "fields": [
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -21,7 +23,9 @@
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
    "in_filter": 0, 
+   "in_global_search": 0, 
    "in_list_view": 1, 
+   "in_standard_filter": 0, 
    "label": "Name", 
    "length": 0, 
    "no_copy": 0, 
@@ -31,6 +35,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, 
@@ -38,6 +43,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -48,7 +54,9 @@
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
    "in_filter": 0, 
+   "in_global_search": 0, 
    "in_list_view": 0, 
+   "in_standard_filter": 0, 
    "label": "Gender", 
    "length": 0, 
    "no_copy": 0, 
@@ -58,6 +66,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, 
@@ -65,6 +74,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -75,7 +85,9 @@
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
    "in_filter": 0, 
+   "in_global_search": 0, 
    "in_list_view": 0, 
+   "in_standard_filter": 0, 
    "label": "Date of Birth", 
    "length": 0, 
    "no_copy": 0, 
@@ -84,6 +96,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, 
@@ -91,19 +104,19 @@
    "unique": 0
   }
  ], 
+ "has_web_view": 0, 
  "hide_heading": 0, 
  "hide_toolbar": 0, 
  "idx": 0, 
  "image_view": 0, 
  "in_create": 0, 
- "in_dialog": 0, 
  "is_submittable": 0, 
  "issingle": 0, 
  "istable": 1, 
  "max_attachments": 0, 
- "modified": "2016-09-01 14:41:23.824083", 
+ "modified": "2017-11-10 19:05:46.408887", 
  "modified_by": "Administrator", 
- "module": "Schools", 
+ "module": "Education", 
  "name": "Student Siblings", 
  "name_case": "", 
  "owner": "Administrator", 
@@ -111,7 +124,9 @@
  "quick_entry": 1, 
  "read_only": 0, 
  "read_only_onload": 0, 
+ "show_name_in_global_search": 0, 
  "sort_field": "modified", 
  "sort_order": "DESC", 
+ "track_changes": 0, 
  "track_seen": 0
 }
\ No newline at end of file
diff --git a/erpnext/schools/doctype/student_siblings/student_siblings.py b/erpnext/education/doctype/student_siblings/student_siblings.py
similarity index 100%
rename from erpnext/schools/doctype/student_siblings/student_siblings.py
rename to erpnext/education/doctype/student_siblings/student_siblings.py
diff --git a/erpnext/schools/report/__init__.py b/erpnext/education/report/__init__.py
similarity index 100%
rename from erpnext/schools/report/__init__.py
rename to erpnext/education/report/__init__.py
diff --git a/erpnext/schools/report/absent_student_report/__init__.py b/erpnext/education/report/absent_student_report/__init__.py
similarity index 100%
rename from erpnext/schools/report/absent_student_report/__init__.py
rename to erpnext/education/report/absent_student_report/__init__.py
diff --git a/erpnext/schools/report/absent_student_report/absent_student_report.js b/erpnext/education/report/absent_student_report/absent_student_report.js
similarity index 100%
rename from erpnext/schools/report/absent_student_report/absent_student_report.js
rename to erpnext/education/report/absent_student_report/absent_student_report.js
diff --git a/erpnext/schools/report/absent_student_report/absent_student_report.json b/erpnext/education/report/absent_student_report/absent_student_report.json
similarity index 86%
rename from erpnext/schools/report/absent_student_report/absent_student_report.json
rename to erpnext/education/report/absent_student_report/absent_student_report.json
index 3a2e85f..0d5eeba 100644
--- a/erpnext/schools/report/absent_student_report/absent_student_report.json
+++ b/erpnext/education/report/absent_student_report/absent_student_report.json
@@ -7,9 +7,9 @@
  "doctype": "Report", 
  "idx": 3, 
  "is_standard": "Yes", 
- "modified": "2017-02-24 20:03:01.035036", 
+ "modified": "2017-11-10 19:42:36.457449", 
  "modified_by": "Administrator", 
- "module": "Schools", 
+ "module": "Education", 
  "name": "Absent Student Report", 
  "owner": "Administrator", 
  "ref_doctype": "Student Attendance", 
diff --git a/erpnext/schools/report/absent_student_report/absent_student_report.py b/erpnext/education/report/absent_student_report/absent_student_report.py
similarity index 100%
rename from erpnext/schools/report/absent_student_report/absent_student_report.py
rename to erpnext/education/report/absent_student_report/absent_student_report.py
diff --git a/erpnext/schools/report/course_wise_assessment_report/__init__.py b/erpnext/education/report/course_wise_assessment_report/__init__.py
similarity index 100%
rename from erpnext/schools/report/course_wise_assessment_report/__init__.py
rename to erpnext/education/report/course_wise_assessment_report/__init__.py
diff --git a/erpnext/schools/report/course_wise_assessment_report/course_wise_assessment_report.html b/erpnext/education/report/course_wise_assessment_report/course_wise_assessment_report.html
similarity index 100%
rename from erpnext/schools/report/course_wise_assessment_report/course_wise_assessment_report.html
rename to erpnext/education/report/course_wise_assessment_report/course_wise_assessment_report.html
diff --git a/erpnext/schools/report/course_wise_assessment_report/course_wise_assessment_report.js b/erpnext/education/report/course_wise_assessment_report/course_wise_assessment_report.js
similarity index 100%
rename from erpnext/schools/report/course_wise_assessment_report/course_wise_assessment_report.js
rename to erpnext/education/report/course_wise_assessment_report/course_wise_assessment_report.js
diff --git a/erpnext/schools/report/course_wise_assessment_report/course_wise_assessment_report.json b/erpnext/education/report/course_wise_assessment_report/course_wise_assessment_report.json
similarity index 87%
rename from erpnext/schools/report/course_wise_assessment_report/course_wise_assessment_report.json
rename to erpnext/education/report/course_wise_assessment_report/course_wise_assessment_report.json
index 6b089d2..e153f8c 100644
--- a/erpnext/schools/report/course_wise_assessment_report/course_wise_assessment_report.json
+++ b/erpnext/education/report/course_wise_assessment_report/course_wise_assessment_report.json
@@ -7,9 +7,9 @@
  "doctype": "Report", 
  "idx": 0, 
  "is_standard": "Yes", 
- "modified": "2017-05-05 14:47:18.080385", 
+ "modified": "2017-11-10 19:41:46.641227", 
  "modified_by": "Administrator", 
- "module": "Schools", 
+ "module": "Education", 
  "name": "Course wise Assessment Report", 
  "owner": "Administrator", 
  "ref_doctype": "Assessment Result", 
diff --git a/erpnext/schools/report/course_wise_assessment_report/course_wise_assessment_report.py b/erpnext/education/report/course_wise_assessment_report/course_wise_assessment_report.py
similarity index 98%
rename from erpnext/schools/report/course_wise_assessment_report/course_wise_assessment_report.py
rename to erpnext/education/report/course_wise_assessment_report/course_wise_assessment_report.py
index 492d738..ff17238 100644
--- a/erpnext/schools/report/course_wise_assessment_report/course_wise_assessment_report.py
+++ b/erpnext/education/report/course_wise_assessment_report/course_wise_assessment_report.py
@@ -6,7 +6,7 @@
 from frappe import _
 from frappe.utils import flt
 from collections import defaultdict
-from erpnext.schools.api import get_grade
+from erpnext.education.api import get_grade
 
 
 def execute(filters=None):
diff --git a/erpnext/schools/report/student_and_guardian_contact_details/__init__.py b/erpnext/education/report/student_and_guardian_contact_details/__init__.py
similarity index 100%
rename from erpnext/schools/report/student_and_guardian_contact_details/__init__.py
rename to erpnext/education/report/student_and_guardian_contact_details/__init__.py
diff --git a/erpnext/schools/report/student_and_guardian_contact_details/student_and_guardian_contact_details.js b/erpnext/education/report/student_and_guardian_contact_details/student_and_guardian_contact_details.js
similarity index 100%
rename from erpnext/schools/report/student_and_guardian_contact_details/student_and_guardian_contact_details.js
rename to erpnext/education/report/student_and_guardian_contact_details/student_and_guardian_contact_details.js
diff --git a/erpnext/schools/report/student_and_guardian_contact_details/student_and_guardian_contact_details.json b/erpnext/education/report/student_and_guardian_contact_details/student_and_guardian_contact_details.json
similarity index 88%
rename from erpnext/schools/report/student_and_guardian_contact_details/student_and_guardian_contact_details.json
rename to erpnext/education/report/student_and_guardian_contact_details/student_and_guardian_contact_details.json
index e822549..fe7d158 100644
--- a/erpnext/schools/report/student_and_guardian_contact_details/student_and_guardian_contact_details.json
+++ b/erpnext/education/report/student_and_guardian_contact_details/student_and_guardian_contact_details.json
@@ -7,9 +7,9 @@
  "doctype": "Report", 
  "idx": 0, 
  "is_standard": "Yes", 
- "modified": "2017-03-27 18:34:08.867661", 
+ "modified": "2017-11-10 19:42:30.300729", 
  "modified_by": "Administrator", 
- "module": "Schools", 
+ "module": "Education", 
  "name": "Student and Guardian Contact Details", 
  "owner": "Administrator", 
  "ref_doctype": "Program Enrollment", 
diff --git a/erpnext/schools/report/student_and_guardian_contact_details/student_and_guardian_contact_details.py b/erpnext/education/report/student_and_guardian_contact_details/student_and_guardian_contact_details.py
similarity index 100%
rename from erpnext/schools/report/student_and_guardian_contact_details/student_and_guardian_contact_details.py
rename to erpnext/education/report/student_and_guardian_contact_details/student_and_guardian_contact_details.py
diff --git a/erpnext/schools/report/student_batch_wise_attendance/__init__.py b/erpnext/education/report/student_batch_wise_attendance/__init__.py
similarity index 100%
rename from erpnext/schools/report/student_batch_wise_attendance/__init__.py
rename to erpnext/education/report/student_batch_wise_attendance/__init__.py
diff --git a/erpnext/schools/report/student_batch_wise_attendance/student_batch_wise_attendance.js b/erpnext/education/report/student_batch_wise_attendance/student_batch_wise_attendance.js
similarity index 100%
rename from erpnext/schools/report/student_batch_wise_attendance/student_batch_wise_attendance.js
rename to erpnext/education/report/student_batch_wise_attendance/student_batch_wise_attendance.js
diff --git a/erpnext/schools/report/student_batch_wise_attendance/student_batch_wise_attendance.json b/erpnext/education/report/student_batch_wise_attendance/student_batch_wise_attendance.json
similarity index 87%
rename from erpnext/schools/report/student_batch_wise_attendance/student_batch_wise_attendance.json
rename to erpnext/education/report/student_batch_wise_attendance/student_batch_wise_attendance.json
index 7851cbb..eb547b7 100644
--- a/erpnext/schools/report/student_batch_wise_attendance/student_batch_wise_attendance.json
+++ b/erpnext/education/report/student_batch_wise_attendance/student_batch_wise_attendance.json
@@ -7,9 +7,9 @@
  "doctype": "Report", 
  "idx": 2, 
  "is_standard": "Yes", 
- "modified": "2017-02-24 20:02:33.773899", 
+ "modified": "2017-11-10 19:41:12.328346", 
  "modified_by": "Administrator", 
- "module": "Schools", 
+ "module": "Education", 
  "name": "Student Batch-Wise Attendance", 
  "owner": "Administrator", 
  "ref_doctype": "Student Attendance", 
diff --git a/erpnext/schools/report/student_batch_wise_attendance/student_batch_wise_attendance.py b/erpnext/education/report/student_batch_wise_attendance/student_batch_wise_attendance.py
similarity index 100%
rename from erpnext/schools/report/student_batch_wise_attendance/student_batch_wise_attendance.py
rename to erpnext/education/report/student_batch_wise_attendance/student_batch_wise_attendance.py
diff --git a/erpnext/schools/report/student_fee_collection/__init__.py b/erpnext/education/report/student_fee_collection/__init__.py
similarity index 100%
rename from erpnext/schools/report/student_fee_collection/__init__.py
rename to erpnext/education/report/student_fee_collection/__init__.py
diff --git a/erpnext/schools/report/student_fee_collection/student_fee_collection.json b/erpnext/education/report/student_fee_collection/student_fee_collection.json
similarity index 91%
rename from erpnext/schools/report/student_fee_collection/student_fee_collection.json
rename to erpnext/education/report/student_fee_collection/student_fee_collection.json
index 5c63765..07fc27c 100644
--- a/erpnext/schools/report/student_fee_collection/student_fee_collection.json
+++ b/erpnext/education/report/student_fee_collection/student_fee_collection.json
@@ -7,9 +7,9 @@
  "doctype": "Report", 
  "idx": 3, 
  "is_standard": "Yes", 
- "modified": "2017-10-25 11:59:26.003899", 
+ "modified": "2017-11-10 19:41:37.320224", 
  "modified_by": "Administrator", 
- "module": "Schools", 
+ "module": "Education", 
  "name": "Student Fee Collection", 
  "owner": "Administrator", 
  "query": "SELECT\n student as \"Student:Link/Student:200\",\n student_name as \"Student Name::200\",\n sum(paid_amount) as \"Paid Amount:Currency:150\",\n sum(outstanding_amount) as \"Outstanding Amount:Currency:150\",\n sum(grand_total) as \"Grand Total:Currency:150\"\nFROM\n `tabFees` \nGROUP BY\n student", 
diff --git a/erpnext/schools/report/student_monthly_attendance_sheet/__init__.py b/erpnext/education/report/student_monthly_attendance_sheet/__init__.py
similarity index 100%
rename from erpnext/schools/report/student_monthly_attendance_sheet/__init__.py
rename to erpnext/education/report/student_monthly_attendance_sheet/__init__.py
diff --git a/erpnext/schools/report/student_monthly_attendance_sheet/student_monthly_attendance_sheet.js b/erpnext/education/report/student_monthly_attendance_sheet/student_monthly_attendance_sheet.js
similarity index 89%
rename from erpnext/schools/report/student_monthly_attendance_sheet/student_monthly_attendance_sheet.js
rename to erpnext/education/report/student_monthly_attendance_sheet/student_monthly_attendance_sheet.js
index 943238e..402bb02 100644
--- a/erpnext/schools/report/student_monthly_attendance_sheet/student_monthly_attendance_sheet.js
+++ b/erpnext/education/report/student_monthly_attendance_sheet/student_monthly_attendance_sheet.js
@@ -29,7 +29,7 @@
 
 	"onload": function() {
 		return frappe.call({
-			method: "erpnext.schools.report.student_monthly_attendance_sheet.student_monthly_attendance_sheet.get_attendance_years",
+			method: "erpnext.education.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;
diff --git a/erpnext/schools/report/student_monthly_attendance_sheet/student_monthly_attendance_sheet.json b/erpnext/education/report/student_monthly_attendance_sheet/student_monthly_attendance_sheet.json
similarity index 87%
rename from erpnext/schools/report/student_monthly_attendance_sheet/student_monthly_attendance_sheet.json
rename to erpnext/education/report/student_monthly_attendance_sheet/student_monthly_attendance_sheet.json
index a6531de..e10f190 100644
--- a/erpnext/schools/report/student_monthly_attendance_sheet/student_monthly_attendance_sheet.json
+++ b/erpnext/education/report/student_monthly_attendance_sheet/student_monthly_attendance_sheet.json
@@ -7,9 +7,9 @@
  "doctype": "Report", 
  "idx": 3, 
  "is_standard": "Yes", 
- "modified": "2017-02-24 20:02:41.910358", 
+ "modified": "2017-11-10 19:42:43.376658", 
  "modified_by": "Administrator", 
- "module": "Schools", 
+ "module": "Education", 
  "name": "Student Monthly Attendance Sheet", 
  "owner": "Administrator", 
  "ref_doctype": "Student Attendance", 
diff --git a/erpnext/schools/report/student_monthly_attendance_sheet/student_monthly_attendance_sheet.py b/erpnext/education/report/student_monthly_attendance_sheet/student_monthly_attendance_sheet.py
similarity index 98%
rename from erpnext/schools/report/student_monthly_attendance_sheet/student_monthly_attendance_sheet.py
rename to erpnext/education/report/student_monthly_attendance_sheet/student_monthly_attendance_sheet.py
index d869cec..0c7baa8 100644
--- a/erpnext/schools/report/student_monthly_attendance_sheet/student_monthly_attendance_sheet.py
+++ b/erpnext/education/report/student_monthly_attendance_sheet/student_monthly_attendance_sheet.py
@@ -6,7 +6,7 @@
 from frappe.utils import cstr, cint, getdate, get_first_day, get_last_day, date_diff, add_days
 from frappe import msgprint, _
 from calendar import monthrange
-from erpnext.schools.api import get_student_group_students
+from erpnext.education.api import get_student_group_students
 
 def execute(filters=None):
 	if not filters: filters = {}
diff --git a/erpnext/education/setup.py b/erpnext/education/setup.py
new file mode 100644
index 0000000..ed1d69e
--- /dev/null
+++ b/erpnext/education/setup.py
@@ -0,0 +1,28 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
+# For license information, please see license.txt
+
+from __future__ import unicode_literals
+
+import frappe
+from erpnext.setup.utils import insert_record
+
+
+def setup_education():
+	if frappe.db.exists('Academic Year', '2015-16'):
+		# already setup
+		return
+	create_academic_sessions()
+
+def create_academic_sessions():
+	data = [
+		{"doctype": "Academic Year", "academic_year_name": "2015-16"},
+		{"doctype": "Academic Year", "academic_year_name": "2016-17"},
+		{"doctype": "Academic Year", "academic_year_name": "2017-18"},
+		{"doctype": "Academic Year", "academic_year_name": "2018-19"},
+		{"doctype": "Academic Term", "academic_year": "2016-17", "term_name": "Semester 1"},
+		{"doctype": "Academic Term", "academic_year": "2016-17", "term_name": "Semester 2"},
+		{"doctype": "Academic Term", "academic_year": "2017-18", "term_name": "Semester 1"},
+		{"doctype": "Academic Term", "academic_year": "2017-18", "term_name": "Semester 2"}
+	]
+	insert_record(data)
diff --git a/erpnext/schools/utils.py b/erpnext/education/utils.py
similarity index 100%
rename from erpnext/schools/utils.py
rename to erpnext/education/utils.py
diff --git a/erpnext/schools/web_form/__init__.py b/erpnext/education/web_form/__init__.py
similarity index 100%
rename from erpnext/schools/web_form/__init__.py
rename to erpnext/education/web_form/__init__.py
diff --git a/erpnext/schools/web_form/student_applicant/__init__.py b/erpnext/education/web_form/student_applicant/__init__.py
similarity index 100%
rename from erpnext/schools/web_form/student_applicant/__init__.py
rename to erpnext/education/web_form/student_applicant/__init__.py
diff --git a/erpnext/schools/web_form/student_applicant/student_applicant.js b/erpnext/education/web_form/student_applicant/student_applicant.js
similarity index 100%
rename from erpnext/schools/web_form/student_applicant/student_applicant.js
rename to erpnext/education/web_form/student_applicant/student_applicant.js
diff --git a/erpnext/schools/web_form/student_applicant/student_applicant.json b/erpnext/education/web_form/student_applicant/student_applicant.json
similarity index 97%
rename from erpnext/schools/web_form/student_applicant/student_applicant.json
rename to erpnext/education/web_form/student_applicant/student_applicant.json
index f87a147..b1ad754 100644
--- a/erpnext/schools/web_form/student_applicant/student_applicant.json
+++ b/erpnext/education/web_form/student_applicant/student_applicant.json
@@ -16,9 +16,9 @@
  "is_standard": 1, 
  "login_required": 1, 
  "max_attachment_size": 0, 
- "modified": "2017-02-21 04:44:46.022738", 
+ "modified": "2017-02-21 05:44:46.022738", 
  "modified_by": "Administrator", 
- "module": "Schools", 
+ "module": "Education", 
  "name": "student-applicant", 
  "owner": "Administrator", 
  "payment_button_label": "Buy Now", 
diff --git a/erpnext/schools/web_form/student_applicant/student_applicant.py b/erpnext/education/web_form/student_applicant/student_applicant.py
similarity index 100%
rename from erpnext/schools/web_form/student_applicant/student_applicant.py
rename to erpnext/education/web_form/student_applicant/student_applicant.py
diff --git a/erpnext/healthcare/doctype/consultation/consultation.js b/erpnext/healthcare/doctype/consultation/consultation.js
index 15a1c7f..8ed01c3 100644
--- a/erpnext/healthcare/doctype/consultation/consultation.js
+++ b/erpnext/healthcare/doctype/consultation/consultation.js
@@ -139,6 +139,7 @@
 	}
 	frappe.route_options = {
 		"patient": frm.doc.patient,
+		"appointment": frm.doc.appointment
 	};
 	frappe.new_doc("Vital Signs");
 };
diff --git a/erpnext/healthcare/doctype/consultation/consultation.json b/erpnext/healthcare/doctype/consultation/consultation.json
index 400703a..1eff21d 100644
--- a/erpnext/healthcare/doctype/consultation/consultation.json
+++ b/erpnext/healthcare/doctype/consultation/consultation.json
@@ -216,7 +216,7 @@
    "label": "Gender", 
    "length": 0, 
    "no_copy": 0, 
-   "options": "\nMale\nFemale", 
+   "options": "\nMale\nFemale\nOther", 
    "permlevel": 0, 
    "precision": "", 
    "print_hide": 1, 
@@ -1004,7 +1004,7 @@
  "issingle": 0, 
  "istable": 0, 
  "max_attachments": 0, 
- "modified": "2017-10-05 12:13:52.596750", 
+ "modified": "2017-11-22 14:03:30.434304", 
  "modified_by": "Administrator", 
  "module": "Healthcare", 
  "name": "Consultation", 
diff --git a/erpnext/healthcare/doctype/lab_test/lab_test.json b/erpnext/healthcare/doctype/lab_test/lab_test.json
index 8677c82..721b095 100644
--- a/erpnext/healthcare/doctype/lab_test/lab_test.json
+++ b/erpnext/healthcare/doctype/lab_test/lab_test.json
@@ -114,7 +114,7 @@
    "columns": 0, 
    "fieldname": "patient_name", 
    "fieldtype": "Data", 
-   "hidden": 1, 
+   "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
    "in_filter": 0, 
@@ -185,7 +185,7 @@
    "label": "Gender", 
    "length": 0, 
    "no_copy": 0, 
-   "options": "\nMale\nFemale", 
+   "options": "\nMale\nFemale\nOther", 
    "permlevel": 0, 
    "precision": "", 
    "print_hide": 1, 
@@ -1388,7 +1388,7 @@
  "issingle": 0, 
  "istable": 0, 
  "max_attachments": 0, 
- "modified": "2017-10-05 12:14:57.078823", 
+ "modified": "2017-11-22 14:32:27.994634", 
  "modified_by": "Administrator", 
  "module": "Healthcare", 
  "name": "Lab Test", 
diff --git a/erpnext/healthcare/doctype/patient/patient.json b/erpnext/healthcare/doctype/patient/patient.json
index 6f9f2fc..21bef30 100644
--- a/erpnext/healthcare/doctype/patient/patient.json
+++ b/erpnext/healthcare/doctype/patient/patient.json
@@ -126,7 +126,7 @@
    "label": "Gender", 
    "length": 0, 
    "no_copy": 0, 
-   "options": "\nMale\nFemale", 
+   "options": "\nMale\nFemale\nOther", 
    "permlevel": 0, 
    "precision": "", 
    "print_hide": 0, 
@@ -185,7 +185,7 @@
    "in_global_search": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
-   "label": "DOB", 
+   "label": "Date of birth", 
    "length": 0, 
    "no_copy": 0, 
    "permlevel": 0, 
@@ -359,37 +359,6 @@
    "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
-   "fieldname": "company", 
-   "fieldtype": "Link", 
-   "hidden": 1, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 0, 
-   "in_standard_filter": 0, 
-   "label": "Company", 
-   "length": 0, 
-   "no_copy": 0, 
-   "options": "Company", 
-   "permlevel": 0, 
-   "precision": "", 
-   "print_hide": 1, 
-   "print_hide_if_no_value": 0, 
-   "read_only": 0, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 1, 
-   "reqd": 0, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "unique": 0
-  }, 
-  {
-   "allow_bulk_edit": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
    "fieldname": "report_preference", 
    "fieldtype": "Select", 
    "hidden": 0, 
@@ -884,7 +853,7 @@
    "label": "Marital Status", 
    "length": 0, 
    "no_copy": 0, 
-   "options": "Single\nMarried\nDivorced\nWidow", 
+   "options": "\nSingle\nMarried\nDivorced\nWidow", 
    "permlevel": 0, 
    "precision": "", 
    "print_hide": 0, 
@@ -1274,7 +1243,7 @@
  "issingle": 0, 
  "istable": 0, 
  "max_attachments": 50, 
- "modified": "2017-10-04 17:41:03.219934", 
+ "modified": "2017-11-24 12:39:33.061005", 
  "modified_by": "Administrator", 
  "module": "Healthcare", 
  "name": "Patient", 
diff --git a/erpnext/healthcare/doctype/patient/patient.py b/erpnext/healthcare/doctype/patient/patient.py
index f4d9a43..e73482d 100644
--- a/erpnext/healthcare/doctype/patient/patient.py
+++ b/erpnext/healthcare/doctype/patient/patient.py
@@ -69,7 +69,10 @@
 		frappe.db.set_value("Patient", self.name, "disabled", 0)
 		send_registration_sms(self)
 		if(frappe.get_value("Healthcare Settings", None, "registration_fee")>0):
-			sales_invoice = make_invoice(self.name, self.company)
+			company = frappe.defaults.get_user_default('company')
+			if not company:
+				company = frappe.db.get_value("Global Defaults", None, "default_company")
+			sales_invoice = make_invoice(self.name, company)
 			sales_invoice.save(ignore_permissions=True)
 			return {'invoice': sales_invoice.name}
 
@@ -110,7 +113,7 @@
 	return sales_invoice
 
 @frappe.whitelist()
-def get_patient_detail(patient, company=None):
+def get_patient_detail(patient):
 	patient_dict = frappe.db.sql("""select * from tabPatient where name=%s""", (patient), as_dict=1)
 	if not patient_dict:
 		frappe.throw("Patient not found")
diff --git a/erpnext/healthcare/doctype/patient_appointment/patient_appointment.js b/erpnext/healthcare/doctype/patient_appointment/patient_appointment.js
index 2237ff5..a58516c 100644
--- a/erpnext/healthcare/doctype/patient_appointment/patient_appointment.js
+++ b/erpnext/healthcare/doctype/patient_appointment/patient_appointment.js
@@ -185,6 +185,7 @@
 	}
 	frappe.route_options = {
 		"patient": frm.doc.patient,
+		"appointment": frm.doc.name,
 	};
 	frappe.new_doc("Vital Signs");
 };
diff --git a/erpnext/healthcare/doctype/patient_appointment/patient_appointment.json b/erpnext/healthcare/doctype/patient_appointment/patient_appointment.json
index 1663c5b..14c48b8 100644
--- a/erpnext/healthcare/doctype/patient_appointment/patient_appointment.json
+++ b/erpnext/healthcare/doctype/patient_appointment/patient_appointment.json
@@ -171,6 +171,100 @@
    "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
+   "depends_on": "", 
+   "fieldname": "patient_name", 
+   "fieldtype": "Data", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "ignore_xss_filter": 0, 
+   "in_filter": 0, 
+   "in_global_search": 0, 
+   "in_list_view": 0, 
+   "in_standard_filter": 0, 
+   "label": "Patient Name", 
+   "length": 0, 
+   "no_copy": 0, 
+   "options": "patient.patient_name", 
+   "permlevel": 0, 
+   "precision": "", 
+   "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, 
+   "set_only_once": 0, 
+   "unique": 0
+  }, 
+  {
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "fieldname": "patient_sex", 
+   "fieldtype": "Data", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "ignore_xss_filter": 0, 
+   "in_filter": 0, 
+   "in_global_search": 0, 
+   "in_list_view": 0, 
+   "in_standard_filter": 0, 
+   "label": "Gender", 
+   "length": 0, 
+   "no_copy": 1, 
+   "options": "patient.sex", 
+   "permlevel": 0, 
+   "precision": "", 
+   "print_hide": 1, 
+   "print_hide_if_no_value": 0, 
+   "read_only": 1, 
+   "remember_last_selected_value": 0, 
+   "report_hide": 1, 
+   "reqd": 0, 
+   "search_index": 0, 
+   "set_only_once": 0, 
+   "unique": 0
+  }, 
+  {
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "fieldname": "patient_age", 
+   "fieldtype": "Data", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "ignore_xss_filter": 0, 
+   "in_filter": 0, 
+   "in_global_search": 0, 
+   "in_list_view": 0, 
+   "in_standard_filter": 0, 
+   "label": "Patient Age", 
+   "length": 0, 
+   "no_copy": 0, 
+   "options": "", 
+   "permlevel": 0, 
+   "precision": "", 
+   "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, 
+   "set_only_once": 0, 
+   "unique": 0
+  }, 
+  {
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
    "default": "Scheduled", 
    "fieldname": "status", 
    "fieldtype": "Select", 
@@ -446,158 +540,6 @@
    "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
-   "fieldname": "section_break_2", 
-   "fieldtype": "Section Break", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 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_bulk_edit": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "patient_details", 
-   "fieldtype": "Section Break", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 0, 
-   "in_standard_filter": 0, 
-   "label": "Patient Details", 
-   "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_bulk_edit": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "depends_on": "patient", 
-   "fieldname": "patient_name", 
-   "fieldtype": "Data", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 0, 
-   "in_standard_filter": 0, 
-   "label": "Patient Name", 
-   "length": 0, 
-   "no_copy": 0, 
-   "permlevel": 0, 
-   "precision": "", 
-   "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, 
-   "set_only_once": 0, 
-   "unique": 0
-  }, 
-  {
-   "allow_bulk_edit": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "patient_sex", 
-   "fieldtype": "Data", 
-   "hidden": 1, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 0, 
-   "in_standard_filter": 0, 
-   "label": "Gender", 
-   "length": 0, 
-   "no_copy": 1, 
-   "options": "patient.sex", 
-   "permlevel": 0, 
-   "precision": "", 
-   "print_hide": 1, 
-   "print_hide_if_no_value": 0, 
-   "read_only": 1, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 1, 
-   "reqd": 0, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "unique": 0
-  }, 
-  {
-   "allow_bulk_edit": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "patient_age", 
-   "fieldtype": "Data", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 0, 
-   "in_standard_filter": 0, 
-   "label": "Patient Age", 
-   "length": 0, 
-   "no_copy": 0, 
-   "options": "", 
-   "permlevel": 0, 
-   "precision": "", 
-   "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, 
-   "set_only_once": 0, 
-   "unique": 0
-  }, 
-  {
-   "allow_bulk_edit": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
    "fieldname": "company", 
    "fieldtype": "Link", 
    "hidden": 1, 
@@ -756,7 +698,7 @@
  "issingle": 0, 
  "istable": 0, 
  "max_attachments": 0, 
- "modified": "2017-10-25 23:33:36.060803", 
+ "modified": "2017-11-22 16:32:57.240736", 
  "modified_by": "Administrator", 
  "module": "Healthcare", 
  "name": "Patient Appointment", 
diff --git a/erpnext/healthcare/doctype/vital_signs/vital_signs.json b/erpnext/healthcare/doctype/vital_signs/vital_signs.json
index bab80f5..5f7fdd1 100644
--- a/erpnext/healthcare/doctype/vital_signs/vital_signs.json
+++ b/erpnext/healthcare/doctype/vital_signs/vital_signs.json
@@ -49,6 +49,37 @@
    "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
+   "fieldname": "patient_name", 
+   "fieldtype": "Data", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "ignore_xss_filter": 0, 
+   "in_filter": 0, 
+   "in_global_search": 0, 
+   "in_list_view": 0, 
+   "in_standard_filter": 0, 
+   "label": "Patient Name", 
+   "length": 0, 
+   "no_copy": 0, 
+   "options": "patient.patient_name", 
+   "permlevel": 0, 
+   "precision": "", 
+   "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, 
+   "set_only_once": 0, 
+   "unique": 0
+  }, 
+  {
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
    "fieldname": "appointment", 
    "fieldtype": "Link", 
    "hidden": 0, 
@@ -751,7 +782,7 @@
  "issingle": 0, 
  "istable": 0, 
  "max_attachments": 0, 
- "modified": "2017-10-04 16:08:36.340607", 
+ "modified": "2017-11-22 17:31:16.620650", 
  "modified_by": "Administrator", 
  "module": "Healthcare", 
  "name": "Vital Signs", 
diff --git a/erpnext/healthcare/setup.py b/erpnext/healthcare/setup.py
index 69a92b3..fca1270 100644
--- a/erpnext/healthcare/setup.py
+++ b/erpnext/healthcare/setup.py
@@ -2,6 +2,7 @@
 import frappe
 
 from frappe import _
+from erpnext.setup.utils import insert_record
 
 def setup_healthcare():
 	if frappe.db.exists('Medical Department', 'Cardiology'):
@@ -259,17 +260,3 @@
 		{"doctype": "Sensitivity", "sensitivity": _("Intermediate")}
 	]
 	insert_record(records)
-
-def insert_record(records):
-	for r in records:
-		doc = frappe.new_doc(r.get("doctype"))
-		doc.update(r)
-		try:
-			doc.insert(ignore_permissions=True)
-		except frappe.DuplicateEntryError, e:
-			# pass DuplicateEntryError and continue
-			if e.args and e.args[0]==doc.doctype and e.args[1]==doc.name:
-				# make sure DuplicateEntryError is for the exact same doc and not a related doc
-				pass
-			else:
-				raise
diff --git a/erpnext/hr/doctype/expense_claim/test_expense_claim.py b/erpnext/hr/doctype/expense_claim/test_expense_claim.py
index b813537..9b4832a 100644
--- a/erpnext/hr/doctype/expense_claim/test_expense_claim.py
+++ b/erpnext/hr/doctype/expense_claim/test_expense_claim.py
@@ -8,6 +8,7 @@
 from erpnext.hr.doctype.expense_claim.expense_claim import make_bank_entry
 
 test_records = frappe.get_test_records('Expense Claim')
+test_dependencies = ['Employee']
 
 class TestExpenseClaim(unittest.TestCase):
 	def test_total_expense_claim_for_project(self):
diff --git a/erpnext/hr/doctype/training_program/training_program.json b/erpnext/hr/doctype/training_program/training_program.json
index d9b33d5..522d5e9 100644
--- a/erpnext/hr/doctype/training_program/training_program.json
+++ b/erpnext/hr/doctype/training_program/training_program.json
@@ -2,7 +2,7 @@
  "allow_copy": 0, 
  "allow_guest_to_view": 0, 
  "allow_import": 0, 
- "allow_rename": 0, 
+ "allow_rename": 1, 
  "autoname": "field:training_program", 
  "beta": 0, 
  "creation": "2017-10-11 04:43:17.230065", 
@@ -414,7 +414,7 @@
  "issingle": 0, 
  "istable": 0, 
  "max_attachments": 0, 
- "modified": "2017-10-16 05:34:23.055153", 
+ "modified": "2017-11-27 08:12:03.649247", 
  "modified_by": "Administrator", 
  "module": "HR", 
  "name": "Training Program", 
diff --git a/erpnext/hub_node/api.py b/erpnext/hub_node/api.py
new file mode 100644
index 0000000..b32efd9
--- /dev/null
+++ b/erpnext/hub_node/api.py
@@ -0,0 +1,29 @@
+# Copyright (c) 2015, Web Notes Technologies Pvt. Ltd. and Contributors and contributors
+# For license information, please see license.txt
+
+
+import frappe, json
+from frappe.utils import now, nowdate
+from erpnext.hub_node.doctype.hub_settings.hub_settings import get_hub_settings
+
+# API wrapper
+@frappe.whitelist(allow_guest=True)
+def call_method(access_token, method, message):
+	try:
+		args = json.loads(message)
+		if args:
+			return globals()[method](access_token, args)
+		else:
+			return globals()[method](access_token)
+	except:
+		print("Client Exception")
+		print(frappe.get_traceback())
+
+def disable_and_suspend_hub_user(access_token):
+	hub_settings = get_hub_settings()
+	hub_settings.publish = 0
+	hub_settings.publish_pricing = 0
+	hub_settings.publish_availability = 0
+	hub_settings.suspended = 1
+	hub_settings.enabled = 0
+	hub_settings.save(ignore_permissions=True)
diff --git a/erpnext/manufacturing/doctype/production_order/production_order.py b/erpnext/manufacturing/doctype/production_order/production_order.py
index fce9d65..1e98f39 100644
--- a/erpnext/manufacturing/doctype/production_order/production_order.py
+++ b/erpnext/manufacturing/doctype/production_order/production_order.py
@@ -448,6 +448,8 @@
 			for item in sorted(item_dict.values(), key=lambda d: d['idx']):
 				self.append('required_items', {
 					'item_code': item.item_code,
+					'item_name': item.item_name,
+					'description': item.description,
 					'required_qty': item.qty,
 					'source_warehouse': item.source_warehouse or item.default_warehouse
 				})
diff --git a/erpnext/manufacturing/doctype/production_order/test_production_order.js b/erpnext/manufacturing/doctype/production_order/test_production_order.js
index 32cc3ef..670f0b0 100644
--- a/erpnext/manufacturing/doctype/production_order/test_production_order.js
+++ b/erpnext/manufacturing/doctype/production_order/test_production_order.js
@@ -16,7 +16,7 @@
 	frappe.run_serially([
 		// test production order
 		() => frappe.set_route("List", "Production Order"),
-		() => frappe.timeout(0.5),
+		() => frappe.timeout(3),
 
 		// Create a laptop production order
 		() => {
@@ -29,7 +29,7 @@
 				{fg_warehouse: "Finished Goods - FT"}
 			]);
 		},
-		() => frappe.timeout(2),
+		() => frappe.timeout(3),
 		() => {
 			assert.equal(cur_frm.doc.planned_operating_cost, cur_frm.doc.total_operating_cost,
 				"Total and Planned Cost is equal");
@@ -54,7 +54,7 @@
 		() => cur_frm.savesubmit(),
 		() => frappe.timeout(1),
 		() => frappe.click_button('Yes'),
-		() => frappe.timeout(1),
+		() => frappe.timeout(2.5),
 
 		// Confirm the production order timesheet, save and submit it
 		() => frappe.click_link("TS-00"),
@@ -62,12 +62,10 @@
 		() => frappe.click_button("Submit"),
 		() => frappe.timeout(1),
 		() => frappe.click_button("Yes"),
-		() => frappe.timeout(2),
+		() => frappe.timeout(2.5),
 
 		// Start the production order process
 		() => frappe.set_route("List", "Production Order"),
-		() => frappe.timeout(.5),
-		() => frappe.set_route("List", "Production Order"),
 		() => frappe.timeout(2),
 		() => frappe.click_link("Laptop"),
 		() => frappe.timeout(1),
diff --git a/erpnext/manufacturing/report/production_order_stock_report/production_order_stock_report.py b/erpnext/manufacturing/report/production_order_stock_report/production_order_stock_report.py
index bb79a49..f996323 100644
--- a/erpnext/manufacturing/report/production_order_stock_report/production_order_stock_report.py
+++ b/erpnext/manufacturing/report/production_order_stock_report/production_order_stock_report.py
@@ -15,62 +15,66 @@
 	out = []
 	
 	#Add a row for each item/qty
-	for prod_order in prod_list:
-		prod_details = frappe.db.get_value("Production Order", prod_order.name, 
-			["bom_no", "source_warehouse", "qty", "produced_qty"], as_dict=1)
-		
+	for prod_details in prod_list:
 		desc = frappe.db.get_value("BOM", prod_details.bom_no, "description")
-		
-		item_list = frappe.db.sql("""SELECT 
-				bom_item.item_code as item_code,
-				ifnull(ledger.actual_qty*bom.quantity/bom_item.stock_qty,0) as build_qty
-			FROM
-				`tabBOM` as bom, `tabBOM Item` AS bom_item
-				LEFT JOIN `tabBin` AS ledger	
-					ON bom_item.item_code = ledger.item_code 
-					AND ledger.warehouse = ifnull(%(warehouse)s,%(filterhouse)s)
-			WHERE
-				bom.name = bom_item.parent
-				and bom.name = %(bom)s 
-			GROUP BY 
-				bom_item.item_code""", 
-		{"bom": prod_details.bom_no, "warehouse": prod_details.source_warehouse, 
-			"filterhouse": filters.warehouse}, as_dict=1)
-				
-		stock_qty = 0
-		count = 0
-		buildable_qty = prod_details.qty
-		for item in item_list:
-			count = count + 1
-			if item.build_qty >= (prod_details.qty - prod_details.produced_qty):
-				stock_qty = stock_qty + 1
-			elif buildable_qty >= item.build_qty:
-				buildable_qty = item.build_qty
-					
-		if count == stock_qty:
-			build = "Y"
-		else:
-			build = "N"
-		
-		row = frappe._dict({
-			"production_order": prod_order.name,
-			"status": prod_order.status,
-			"req_items": cint(count),
-			"instock": stock_qty,
-			"description": desc,
-			"bom_no": prod_details.bom_no,
-			"qty": prod_details.qty,
-			"buildable_qty": buildable_qty,
-			"ready_to_build": build
-		})
-		
-		out.append(row)
+
+		for prod_item_details in frappe.db.get_values("Production Order Item",
+			{"parent": prod_details.name}, ["item_code", "source_warehouse"], as_dict=1):
+
+			item_list = frappe.db.sql("""SELECT
+					bom_item.item_code as item_code,
+					ifnull(ledger.actual_qty*bom.quantity/bom_item.stock_qty,0) as build_qty
+				FROM
+					`tabBOM` as bom, `tabBOM Item` AS bom_item
+					LEFT JOIN `tabBin` AS ledger
+						ON bom_item.item_code = ledger.item_code
+						AND ledger.warehouse = ifnull(%(warehouse)s,%(filterhouse)s)
+				WHERE
+					bom.name = bom_item.parent
+					and bom_item.item_code = %(item_code)s
+					and bom.name = %(bom)s
+				GROUP BY
+					bom_item.item_code""",
+			{"bom": prod_details.bom_no, "warehouse": prod_item_details.source_warehouse,
+				"filterhouse": filters.warehouse, "item_code": prod_item_details.item_code}, as_dict=1)
+
+			stock_qty = 0
+			count = 0
+			buildable_qty = prod_details.qty
+			for item in item_list:
+				count = count + 1
+				if item.build_qty >= (prod_details.qty - prod_details.produced_qty):
+					stock_qty = stock_qty + 1
+				elif buildable_qty >= item.build_qty:
+					buildable_qty = item.build_qty
+
+			if count == stock_qty:
+				build = "Y"
+			else:
+				build = "N"
+
+			row = frappe._dict({
+				"production_order": prod_details.name,
+				"status": prod_details.status,
+				"req_items": cint(count),
+				"instock": stock_qty,
+				"description": desc,
+				"source_warehouse": prod_item_details.source_warehouse,
+				"item_code": prod_item_details.item_code,
+				"bom_no": prod_details.bom_no,
+				"qty": prod_details.qty,
+				"buildable_qty": buildable_qty,
+				"ready_to_build": build
+			})
+
+			out.append(row)
 
 	return out
 	
 def get_production_orders():
-	
-	out =  frappe.get_all("Production Order", filters={"docstatus": 1, "status": ( "!=","Completed")}, fields=["name","status"], order_by='name')
+	out =  frappe.get_all("Production Order", filters={"docstatus": 1, "status": ( "!=","Completed")},
+		fields=["name","status", "bom_no", "qty", "produced_qty"], order_by='name')
+
 	return out
 	
 def get_columns():
@@ -93,6 +97,18 @@
 		"options": "",
 		"width": 230
 	}, {
+		"fieldname": "item_code",
+		"label": "Item Code",
+		"fieldtype": "Link",
+		"options": "Item",
+		"width": 110
+	},{
+		"fieldname": "source_warehouse",
+		"label": "Source Warehouse",
+		"fieldtype": "Link",
+		"options": "Warehouse",
+		"width": 110
+	},{
 		"fieldname": "qty",
 		"label": "Qty to Build",
 		"fieldtype": "Data",
diff --git a/erpnext/modules.txt b/erpnext/modules.txt
index beb1df5..090ebd0 100644
--- a/erpnext/modules.txt
+++ b/erpnext/modules.txt
@@ -13,7 +13,7 @@
 Hub Node
 Portal
 Maintenance
-Schools
+Education
 Regional
 Healthcare
 Restaurant
diff --git a/erpnext/patches.txt b/erpnext/patches.txt
index 5d3c31f..7725615 100644
--- a/erpnext/patches.txt
+++ b/erpnext/patches.txt
@@ -334,6 +334,7 @@
 execute:frappe.db.sql("update `tabEmployee` set prefered_contact_email = IFNULL(prefered_contact_email,'') ")
 execute:frappe.reload_doctype("Salary Slip")
 execute:frappe.db.sql("update `tabSalary Slip` set posting_date=creation")
+execute:frappe.reload_doc("stock", "doctype", "stock_settings")
 erpnext.patches.v8_0.create_domain_docs	#16-05-2017
 erpnext.patches.v7_1.update_portal_roles
 erpnext.patches.v7_1.set_total_amount_currency_in_je
@@ -438,7 +439,7 @@
 erpnext.patches.v8_7.fix_purchase_receipt_status
 erpnext.patches.v8_6.rename_bom_update_tool
 erpnext.patches.v8_7.set_offline_in_pos_settings #11-09-17
-erpnext.patches.v8_9.add_setup_progress_actions #08-09-2017 #26-09-2017
+erpnext.patches.v8_9.add_setup_progress_actions #08-09-2017 #26-09-2017 #22-11-2017
 erpnext.patches.v8_9.rename_company_sales_target_field
 erpnext.patches.v8_8.set_bom_rate_as_per_uom
 erpnext.patches.v8_8.add_new_fields_in_accounts_settings
@@ -448,7 +449,7 @@
 erpnext.patches.v8_9.delete_gst_doctypes_for_outside_india_accounts
 erpnext.patches.v8_9.set_default_fields_in_variant_settings
 erpnext.patches.v8_9.update_billing_gstin_for_indian_account
-erpnext.patches.v9_0.add_user_to_child_table_in_pos_profile
+erpnext.patches.v9_0.add_user_to_child_table_in_pos_profile #2017-11-28
 erpnext.patches.v9_0.set_schedule_date_for_material_request_and_purchase_order
 erpnext.patches.v9_0.student_admission_childtable_migrate
 erpnext.patches.v9_0.fix_subscription_next_date #2017-10-23
@@ -460,9 +461,15 @@
 erpnext.patches.v9_0.set_pos_profile_name
 erpnext.patches.v9_0.remove_non_existing_warehouse_from_stock_settings
 execute:frappe.delete_doc_if_exists("DocType", "Program Fee")
+erpnext.patches.v8_10.update_gl_due_date_for_pi_and_si
+erpnext.patches.v8_10.change_default_customer_credit_days
 erpnext.patches.v9_0.update_employee_loan_details
 erpnext.patches.v9_2.delete_healthcare_domain_default_items
 erpnext.patches.v9_1.create_issue_opportunity_type
 erpnext.patches.v9_2.rename_translated_domains_in_en
 erpnext.patches.v9_0.set_shipping_type_for_existing_shipping_rules
-erpnext.patches.v9_0.update_asset_module_doctypes
+erpnext.patches.v9_0.update_multi_uom_fields_in_material_request
+erpnext.patches.v10_0.rename_schools_to_education
+erpnext.patches.v9_2.repost_reserved_qty_for_production
+erpnext.patches.v9_2.remove_company_from_patient
+erpnext.patches.v9_2.set_item_name_in_production_order
\ No newline at end of file
diff --git a/erpnext/schools/__init__.py b/erpnext/patches/v10_0/__init__.py
similarity index 100%
copy from erpnext/schools/__init__.py
copy to erpnext/patches/v10_0/__init__.py
diff --git a/erpnext/patches/v10_0/rename_schools_to_education.py b/erpnext/patches/v10_0/rename_schools_to_education.py
new file mode 100644
index 0000000..85c25a8
--- /dev/null
+++ b/erpnext/patches/v10_0/rename_schools_to_education.py
@@ -0,0 +1,32 @@
+# Copyright (c) 2017, Frappe and Contributors
+# License: GNU General Public License v3. See license.txt
+
+from __future__ import unicode_literals
+import frappe
+
+def execute():
+	# rename the School module as Education
+
+	# rename the school module
+	if frappe.db.exists('Module Def', 'Schools') and not frappe.db.exists('Module Def', 'Education'):
+		frappe.rename_doc("Module Def", "Schools", "Education")
+
+	# delete the school module
+	if frappe.db.exists('Module Def', 'Schools') and frappe.db.exists('Module Def', 'Education'):
+		frappe.db.sql("""delete from `tabModule Def` where module_name = 'Schools'""")
+
+
+	# rename "School Settings" to the "Education Settings
+	if frappe.db.exists('DocType', 'School Settings'):
+		frappe.rename_doc("DocType", "School Settings", "Education Settings", force=True)
+		frappe.reload_doc("education", "doctype", "education_settings")
+
+	# delete the discussion web form if exists
+	if frappe.db.exists('Web Form', 'Discussion'):
+		frappe.db.sql("""delete from `tabWeb Form` where name = 'discussion'""")
+
+	# rename the select option field from "School Bus" to "Institute's Bus"
+	frappe.reload_doc("education", "doctype", "Program Enrollment")
+	if "mode_of_transportation" in frappe.db.get_table_columns("Program Enrollment"):
+		frappe.db.sql("""update `tabProgram Enrollment` set mode_of_transportation = "Institute's Bus"
+			where mode_of_transportation = "School Bus" """)
diff --git a/erpnext/patches/v7_0/make_guardian.py b/erpnext/patches/v7_0/make_guardian.py
index 0839c4f..519969b 100644
--- a/erpnext/patches/v7_0/make_guardian.py
+++ b/erpnext/patches/v7_0/make_guardian.py
@@ -5,9 +5,15 @@
 	if frappe.db.exists("DocType", "Student"):
 		student_table_cols = frappe.db.get_table_columns("Student")
 		if "father_name" in student_table_cols:
-			frappe.reload_doc("schools", "doctype", "student")
-			frappe.reload_doc("schools", "doctype", "guardian")
-			frappe.reload_doc("schools", "doctype", "guardian_interest")
+
+			# 'Schools' module changed to the 'Education'
+			# frappe.reload_doc("schools", "doctype", "student")
+			# frappe.reload_doc("schools", "doctype", "guardian")
+			# frappe.reload_doc("schools", "doctype", "guardian_interest")
+
+			frappe.reload_doc("education", "doctype", "student")
+			frappe.reload_doc("education", "doctype", "guardian")
+			frappe.reload_doc("education", "doctype", "guardian_interest")
 			frappe.reload_doc("hr", "doctype", "interest")
 		
 			fields = ["name", "father_name", "mother_name"]
diff --git a/erpnext/patches/v7_0/migrate_schools_to_erpnext.py b/erpnext/patches/v7_0/migrate_schools_to_erpnext.py
index f64f400..9137b5a 100644
--- a/erpnext/patches/v7_0/migrate_schools_to_erpnext.py
+++ b/erpnext/patches/v7_0/migrate_schools_to_erpnext.py
@@ -13,13 +13,20 @@
 		frappe.db.sql("""delete from `tabDesktop Icon`""")
 		
 		if not frappe.db.exists('Module Def', 'Schools') and frappe.db.exists('Module Def', 'Academics'):
-			frappe.rename_doc("Module Def", "Academics", "Schools")
+			
+			# 'Schools' module changed to the 'Education'
+			# frappe.rename_doc("Module Def", "Academics", "Schools")
+			
+			frappe.rename_doc("Module Def", "Academics", "Education")
 			
 		remove_from_installed_apps("schools")
 
 def reload_doctypes_for_schools_icons():
-	base_path = frappe.get_app_path('erpnext', 'schools', 'doctype')
+	# 'Schools' module changed to the 'Education'
+	# base_path = frappe.get_app_path('erpnext', 'schools', 'doctype')
+	
+	base_path = frappe.get_app_path('erpnext', 'education', 'doctype')
 	for doctype in os.listdir(base_path):
 		if os.path.exists(os.path.join(base_path, doctype, doctype + '.json')) \
 			and doctype not in ("fee_component", "assessment", "assessment_result"):
-			frappe.reload_doc('schools', 'doctype', doctype)
\ No newline at end of file
+			frappe.reload_doc('education', 'doctype', doctype)
\ No newline at end of file
diff --git a/erpnext/patches/v7_0/rename_examination_to_assessment.py b/erpnext/patches/v7_0/rename_examination_to_assessment.py
index 1d6e688..dc248de 100644
--- a/erpnext/patches/v7_0/rename_examination_to_assessment.py
+++ b/erpnext/patches/v7_0/rename_examination_to_assessment.py
@@ -10,8 +10,14 @@
 	if frappe.db.exists("DocType", "Examination"):
 		frappe.rename_doc("DocType", "Examination", "Assessment")
 		frappe.rename_doc("DocType", "Examination Result", "Assessment Result")
-		frappe.reload_doc("schools", "doctype", "assessment")
-		frappe.reload_doc("schools", "doctype", "assessment_result")
+
+		# 'Schools' module changed to the 'Education'
+		# frappe.reload_doc("schools", "doctype", "assessment")
+		# frappe.reload_doc("schools", "doctype", "assessment_result")
+
+		frappe.reload_doc("education", "doctype", "assessment")
+		frappe.reload_doc("education", "doctype", "assessment_result")
+
 		rename_field("Assessment", "exam_name", "assessment_name")
 		rename_field("Assessment", "exam_code", "assessment_code")
 	
diff --git a/erpnext/patches/v7_0/set_portal_settings.py b/erpnext/patches/v7_0/set_portal_settings.py
index 9bae1c5..5259d4f 100644
--- a/erpnext/patches/v7_0/set_portal_settings.py
+++ b/erpnext/patches/v7_0/set_portal_settings.py
@@ -8,7 +8,9 @@
 def execute():
 	frappe.reload_doctype('Role')
 	for dt in ("assessment", "course", "fees"):
-		frappe.reload_doc("schools", "doctype", dt)
+		# 'Schools' module changed to the 'Education'
+		# frappe.reload_doc("schools", "doctype", dt)
+		frappe.reload_doc("education", "doctype", dt)
 
 	for dt in ("domain", "has_domain", "domain_settings"):
 		frappe.reload_doc("core", "doctype", dt)
diff --git a/erpnext/patches/v7_1/set_student_guardian.py b/erpnext/patches/v7_1/set_student_guardian.py
index e64279b..0942505 100644
--- a/erpnext/patches/v7_1/set_student_guardian.py
+++ b/erpnext/patches/v7_1/set_student_guardian.py
@@ -2,9 +2,15 @@
 
 def execute():
 	if frappe.db.exists("DocType", "Guardian"):
-		frappe.reload_doc("schools", "doctype", "student")
-		frappe.reload_doc("schools", "doctype", "student_guardian")
-		frappe.reload_doc("schools", "doctype", "student_sibling")
+
+		# 'Schools' module changed to the 'Education'
+		# frappe.reload_doc("schools", "doctype", "student")
+		# frappe.reload_doc("schools", "doctype", "student_guardian")
+		# frappe.reload_doc("schools", "doctype", "student_sibling")
+
+		frappe.reload_doc("education", "doctype", "student")
+		frappe.reload_doc("education", "doctype", "student_guardian")
+		frappe.reload_doc("education", "doctype", "student_sibling")
 		if "student" not in frappe.db.get_table_columns("Guardian"):
 			return
 		guardian = frappe.get_all("Guardian", fields=["name", "student"])
diff --git a/erpnext/patches/v7_2/mark_students_active.py b/erpnext/patches/v7_2/mark_students_active.py
index 3513cde..0a2f2d3 100644
--- a/erpnext/patches/v7_2/mark_students_active.py
+++ b/erpnext/patches/v7_2/mark_students_active.py
@@ -1,5 +1,8 @@
 import frappe
 
 def execute():
-    frappe.reload_doc('schools', 'doctype', 'student_group_student')
-    frappe.db.sql("update `tabStudent Group Student` set active=1")
+	# 'Schools' module changed to the 'Education'
+	# frappe.reload_doc('schools', 'doctype', 'student_group_student')
+
+	frappe.reload_doc('education', 'doctype', 'student_group_student')
+	frappe.db.sql("update `tabStudent Group Student` set active=1")
diff --git a/erpnext/patches/v7_2/rename_evaluation_criteria.py b/erpnext/patches/v7_2/rename_evaluation_criteria.py
index a45604f..d749760 100644
--- a/erpnext/patches/v7_2/rename_evaluation_criteria.py
+++ b/erpnext/patches/v7_2/rename_evaluation_criteria.py
@@ -2,28 +2,37 @@
 from frappe.model.utils.rename_field import rename_field
 
 def execute():
+	# 'Schools' module changed to the 'Education'
+
+
 	frappe.rename_doc("DocType", "Evaluation Criteria", "Assessment Criteria", force=True)
-	frappe.reload_doc("schools", "doctype", "assessment_criteria")
+	# frappe.reload_doc("schools", "doctype", "assessment_criteria")
+	frappe.reload_doc("education", "doctype", "assessment_criteria")
 	if 'evaluation_criteria' in frappe.db.get_table_columns('Assessment Criteria'):
 		rename_field("Assessment Criteria", "evaluation_criteria", "assessment_criteria")
 
 	frappe.rename_doc("DocType", "Assessment Evaluation Criteria", "Assessment Plan Criteria", force=True)
-	frappe.reload_doc("schools", "doctype", "assessment_plan_criteria")
+	# frappe.reload_doc("schools", "doctype", "assessment_plan_criteria")
+	frappe.reload_doc("education", "doctype", "assessment_plan_criteria")
 	if 'evaluation_criteria' in frappe.db.get_table_columns('Assessment Plan'):
 		rename_field("Assessment Plan Criteria", "evaluation_criteria", "assessment_criteria")
 
-	frappe.reload_doc("schools", "doctype", "assessment_plan")
+	# frappe.reload_doc("schools", "doctype", "assessment_plan")
+	frappe.reload_doc("education", "doctype", "assessment_plan")
 	rename_field("Assessment Plan", "evaluation_criterias", "assessment_criteria")
 
-	frappe.reload_doc("schools", "doctype", "assessment_result_detail")
+	# frappe.reload_doc("schools", "doctype", "assessment_result_detail")
+	frappe.reload_doc("education", "doctype", "assessment_result_detail")
 	if 'evaluation_criteria' in frappe.db.get_table_columns('Assessment Result Detail'):
 		rename_field("Assessment Result Detail", "evaluation_criteria", "assessment_criteria")
 
 	frappe.rename_doc("DocType", "Course Evaluation Criteria", "Course Assessment Criteria", force=True)
-	frappe.reload_doc("schools", "doctype", "course_assessment_criteria")
+	# frappe.reload_doc("schools", "doctype", "course_assessment_criteria")
+	frappe.reload_doc("education", "doctype", "course_assessment_criteria")
 	if 'evaluation_criteria' in frappe.db.get_table_columns('Course Assessment Criteria'):
 		rename_field("Course Assessment Criteria", "evaluation_criteria", "assessment_criteria")
 
-	frappe.reload_doc("schools", "doctype", "course")
+	# frappe.reload_doc("schools", "doctype", "course")
+	frappe.reload_doc("education", "doctype", "course")
 	if 'evaluation_criteria' in frappe.db.get_table_columns('Course'):
 		rename_field("Course", "evaluation_criterias", "assessment_criteria")
diff --git a/erpnext/patches/v7_2/update_assessment_modules.py b/erpnext/patches/v7_2/update_assessment_modules.py
index 9075bbf..37ae7c7 100644
--- a/erpnext/patches/v7_2/update_assessment_modules.py
+++ b/erpnext/patches/v7_2/update_assessment_modules.py
@@ -8,21 +8,28 @@
 	if not frappe.db.exists("DocType", "Grading Scale Interval"):
 		frappe.rename_doc("DocType", "Grade Interval", "Grading Scale Interval", force=True)
 
-	frappe.reload_doc("schools", "doctype", "grading_scale_interval")
+	# frappe.reload_doc("schools", "doctype", "grading_scale_interval")
+	frappe.reload_doc("education", "doctype", "grading_scale_interval")
 	if "to_score" in frappe.db.get_table_columns("Grading Scale Interval"):
 		rename_field("Grading Scale Interval", "to_score", "threshold")
 
 	if not frappe.db.exists("DocType", "Assessment Plan"):
 		frappe.rename_doc("DocType", "Assessment", "Assessment Plan", force=True)
 
+	# 'Schools' module changed to the 'Education'
+	# frappe.reload_doc("schools", "doctype", "assessment_plan")
+
 	#Rename Assessment Results
-	frappe.reload_doc("schools", "doctype", "assessment_plan")
+	frappe.reload_doc("education", "doctype", "assessment_plan")
 	if "grading_structure" in frappe.db.get_table_columns("Assessment Plan"):
 		rename_field("Assessment Plan", "grading_structure", "grading_scale")
 
-	frappe.reload_doc("schools", "doctype", "assessment_result")
-	frappe.reload_doc("schools", "doctype", "assessment_result_detail")
-	frappe.reload_doc("schools", "doctype", "assessment_criteria")
+	# frappe.reload_doc("schools", "doctype", "assessment_result")
+	# frappe.reload_doc("schools", "doctype", "assessment_result_detail")
+	# frappe.reload_doc("schools", "doctype", "assessment_criteria")
+	frappe.reload_doc("education", "doctype", "assessment_result")
+	frappe.reload_doc("education", "doctype", "assessment_result_detail")
+	frappe.reload_doc("education", "doctype", "assessment_criteria")
 
 
 	for assessment in frappe.get_all("Assessment Plan", 
diff --git a/erpnext/patches/v7_2/update_attendance_docstatus.py b/erpnext/patches/v7_2/update_attendance_docstatus.py
index 6fbab01..863c0c0 100644
--- a/erpnext/patches/v7_2/update_attendance_docstatus.py
+++ b/erpnext/patches/v7_2/update_attendance_docstatus.py
@@ -1,8 +1,7 @@
 import frappe
 
 def execute():
-	frappe.reload_doctype('Student Attendance')
-	# frappe.reload_doc("schools", "doctype", "student_attendance")
+	frappe.reload_doc("education", "doctype", "student_attendance")
 	frappe.db.sql('''
 		update `tabStudent Attendance` set
 			docstatus=0
diff --git a/erpnext/patches/v7_2/update_guardian_name_in_student_master.py b/erpnext/patches/v7_2/update_guardian_name_in_student_master.py
index 6ac4073..163e7c3 100644
--- a/erpnext/patches/v7_2/update_guardian_name_in_student_master.py
+++ b/erpnext/patches/v7_2/update_guardian_name_in_student_master.py
@@ -2,8 +2,12 @@
 from frappe.model.utils.rename_field import rename_field
 
 def execute():
-    frappe.reload_doc("schools", "doctype", "student_guardian")
-    student_guardians = frappe.get_all("Student Guardian", fields=["guardian"])
-    for student_guardian in student_guardians:
-        guardian_name = frappe.db.get_value("Guardian", student_guardian.guardian, "guardian_name")
-        frappe.db.sql("update `tabStudent Guardian` set guardian_name = %s where guardian= %s", (guardian_name, student_guardian.guardian))
\ No newline at end of file
+	# 'Schools' module changed to the 'Education'
+	# frappe.reload_doc("schools", "doctype", "student_guardian")
+	frappe.reload_doc("education", "doctype", "student_guardian")
+
+	student_guardians = frappe.get_all("Student Guardian", fields=["guardian"])
+	for student_guardian in student_guardians:
+		guardian_name = frappe.db.get_value("Guardian", student_guardian.guardian, "guardian_name")
+		frappe.db.sql("update `tabStudent Guardian` set guardian_name = %s where guardian= %s",
+			(guardian_name, student_guardian.guardian))
\ No newline at end of file
diff --git a/erpnext/patches/v8_0/merge_student_batch_and_student_group.py b/erpnext/patches/v8_0/merge_student_batch_and_student_group.py
index ca71d36..fb9021f 100644
--- a/erpnext/patches/v8_0/merge_student_batch_and_student_group.py
+++ b/erpnext/patches/v8_0/merge_student_batch_and_student_group.py
@@ -11,7 +11,10 @@
 	# for converting student batch into student group
 	for doctype in ["Student Group", "Student Group Student", 'Program Enrollment',
 		"Student Group Instructor", "Student Attendance", "Student", "Student Batch Name"]:
-		frappe.reload_doc("schools", "doctype", frappe.scrub(doctype))
+		# 'Schools' module changed to the 'Education'
+		# frappe.reload_doc("schools", "doctype", frappe.scrub(doctype))
+
+		frappe.reload_doc("education", "doctype", frappe.scrub(doctype))
 
 	if frappe.db.table_exists("Student Batch"):
 		student_batches = frappe.db.sql('''select name as student_group_name, student_batch_name as batch,
diff --git a/erpnext/schools/__init__.py b/erpnext/patches/v8_10/__init__.py
similarity index 100%
copy from erpnext/schools/__init__.py
copy to erpnext/patches/v8_10/__init__.py
diff --git a/erpnext/patches/v8_10/change_default_customer_credit_days.py b/erpnext/patches/v8_10/change_default_customer_credit_days.py
new file mode 100644
index 0000000..d2bc3ec
--- /dev/null
+++ b/erpnext/patches/v8_10/change_default_customer_credit_days.py
@@ -0,0 +1,88 @@
+from __future__ import unicode_literals
+import frappe
+
+
+def execute():
+	frappe.reload_doc("selling", "doctype", "customer")
+	frappe.reload_doc("buying", "doctype", "supplier")
+	frappe.reload_doc("setup", "doctype", "supplier_type")
+	frappe.reload_doc("accounts", "doctype", "payment_term")
+	frappe.reload_doc("accounts", "doctype", "payment_terms_template_detail")
+	frappe.reload_doc("accounts", "doctype", "payment_terms_template")
+
+	payment_terms = []
+	records = []
+	for doctype in ("Customer", "Supplier", "Supplier Type"):
+		credit_days = frappe.db.sql("""
+			SELECT DISTINCT `credit_days`, `credit_days_based_on`, `name`
+			from `tab{0}`
+			where
+				(credit_days_based_on='Fixed Days' and credit_days is not null)
+				or credit_days_based_on='Last Day of the Next Month'
+		""".format(doctype))
+
+		credit_records = ((record[0], record[1], record[2]) for record in credit_days)
+		for days, based_on, party_name in credit_records:
+			if based_on == "Fixed Days":
+				pyt_template_name = 'Default Payment Term - N{0}'.format(days)
+			else:
+				pyt_template_name = 'Default Payment Term - EO2M'
+
+			if not frappe.db.exists("Payment Terms Template", pyt_template_name):
+				payment_term = make_payment_term(days, based_on)
+				template = make_template(payment_term)
+			else:
+				template = frappe.get_doc("Payment Terms Template", pyt_template_name)
+
+			payment_terms.append('WHEN `name`="%s" THEN "%s"' % (party_name, template.template_name))
+			records.append(party_name)
+
+		begin_query_str = "UPDATE `tab{0}` SET `payment_terms` = CASE ".format(doctype)
+		value_query_str = " ".join(payment_terms)
+		cond_query_str = " ELSE `payment_terms` END WHERE "
+
+		if records:
+			frappe.db.sql(
+				begin_query_str + value_query_str + cond_query_str + '`name` IN %s',
+				(records,)
+			)
+
+
+def make_template(payment_term):
+	doc = frappe.new_doc('Payment Terms Template Detail')
+	doc.payment_term = payment_term.payment_term_name
+	doc.due_date_based_on = payment_term.due_date_based_on
+	doc.invoice_portion = payment_term.invoice_portion
+	doc.description = payment_term.description
+	doc.credit_days = payment_term.credit_days
+	doc.credit_months = payment_term.credit_months
+
+	template = frappe.new_doc('Payment Terms Template')
+	template.template_name = 'Default Payment Term - {0}'.format(payment_term.payment_term_name)
+	template.append('terms', doc)
+	template.save()
+
+	return template
+
+
+def make_payment_term(days, based_on):
+	based_on_map = {
+		'Fixed Days': 'Day(s) after invoice date',
+		'Last Day of the Next Month': 'Month(s) after the end of the invoice month'
+	}
+
+	doc = frappe.new_doc('Payment Term')
+	doc.due_date_based_on = based_on_map.get(based_on)
+	doc.invoice_portion = 100
+
+	if based_on == 'Fixed Days':
+		doc.credit_days = days
+		doc.description = 'Net payable within {0} days'.format(days)
+		doc.payment_term_name = 'N{0}'.format(days)
+	else:
+		doc.credit_months = 1
+		doc.description = 'Net payable by the end of next month'
+		doc.payment_term_name = 'EO2M'
+
+	doc.save()
+	return doc
diff --git a/erpnext/patches/v8_10/update_gl_due_date_for_pi_and_si.py b/erpnext/patches/v8_10/update_gl_due_date_for_pi_and_si.py
new file mode 100644
index 0000000..8596e66
--- /dev/null
+++ b/erpnext/patches/v8_10/update_gl_due_date_for_pi_and_si.py
@@ -0,0 +1,138 @@
+from __future__ import unicode_literals
+import frappe
+
+# This will update existing GL Entries by saving its linked Purchase/Sales Invoice's
+# Journal Entry's due date as the due date for the GL Entry
+
+
+def execute():
+	frappe.reload_doc("accounts", "doctype", "gl_entry")
+
+	kwargs = get_query_kwargs()
+
+	for kwarg in kwargs:
+		for batch in get_result_in_batches(**kwarg):
+			voucher_num_col = kwarg.get('voucher_num_col', 'voucher_no')
+			voucher_type = kwarg.get('use_voucher_type') or kwarg.get('voucher_type')
+			conditions, names = build_conditions(batch, voucher_type, voucher_num_col)
+			if conditions and names:
+				start = 'UPDATE `tabGL Entry` SET `due_date` = CASE '
+				cond = ' '.join(conditions)
+				else_cond = ' ELSE `due_date` END WHERE '
+
+				frappe.db.sql(
+					start + cond + else_cond + voucher_num_col + ' IN %s',
+					values=(names,)
+				)
+
+
+def get_result_in_batches(**kwargs):
+	"""A simple generator to yield slices of GL Entry records"""
+	while True:
+		batch = get_gle_batch(**kwargs)
+		if batch:
+			yield batch
+		else:
+			return
+
+
+def get_gle_batch(**kwargs):
+	"""Returns a slice of records in GL Entry"""
+	doctype = kwargs.get('doctype')
+	fields = kwargs.get('fields')
+	limit_start = kwargs.get('limit_start')
+	limit_page_length = kwargs.get('limit_page_length')
+	filters = kwargs.get('filters')
+	or_filters = kwargs.get('or_filters')
+
+	results = frappe.get_list(
+		doctype, fields=fields, limit_start=limit_start, limit_page_length=limit_page_length,
+		filters=filters, or_filters=or_filters
+	)
+
+	return results
+
+
+def build_conditions(query_results, voucher_type, voucher_num_col):
+	"""
+	builds the string to be used is sql CASE statement. Returns the a tuple of
+	the string for the CASE statement and a tuple of applicable voucher names
+	"""
+	conditions = []
+	invoice_names = []
+
+	for result in query_results:
+		voucher_no = result.get(voucher_num_col)
+		if voucher_no:
+			invoice_names.append("%s" % (voucher_no,))
+
+	# get invoice details
+	invoice_details = frappe.get_list(
+		voucher_type, fields=['name', 'due_date'], filters={'name': ('in', invoice_names)}
+	)
+
+	if invoice_details:
+		for d in invoice_details:
+			conditions.append('WHEN `{voucher_no}`="{number}" THEN "{date}"'.format(
+				number=d.name, date=d.due_date, voucher_no=voucher_num_col))
+
+	return conditions, invoice_names
+
+
+def get_query_kwargs():
+	pi_kwargs = dict(
+		voucher_type='Purchase Invoice', doctype='GL Entry', fields=['voucher_no'],
+		limit_start=0, limit_page_length=5, filters={
+			"ifnull(due_date, '')": ('=', ''), "ifnull(party, '')": ('!=', ''),
+			'voucher_type': 'Purchase Invoice', 'credit': ('!=', '0')
+		}
+	)
+
+	si_kwargs = dict(
+		voucher_type='Sales Invoice', doctype='GL Entry', fields=['voucher_no'],
+		limit_start=0, limit_page_length=5, filters={
+			"ifnull(due_date, '')": ('=', ''), "ifnull(party, '')": ('!=', ''),
+			'voucher_type': 'Sales Invoice', 'debit': ('!=', '0')
+		}
+	)
+
+	journal_kwargs_si = dict(
+		voucher_type='Journal Entry', doctype='GL Entry', fields=['against_voucher'],
+		limit_start=0, limit_page_length=5, filters={
+			"ifnull(due_date, '')": ('=', ''), "ifnull(party, '')": ('!=', ''),
+			'voucher_type': 'Journal Entry', 'against_voucher_type': 'Sales Invoice'
+		},
+		voucher_num_col='against_voucher', use_voucher_type='Sales Invoice',
+	)
+
+	journal_kwargs_pi = dict(
+		voucher_type='Journal Entry', doctype='GL Entry', fields=['against_voucher'],
+		limit_start=0, limit_page_length=5, filters={
+			"ifnull(due_date, '')": ('=', ''), "ifnull(party, '')": ('!=', ''),
+			'voucher_type': 'Journal Entry', 'against_voucher_type': 'Purchase Invoice'
+		},
+		voucher_num_col='against_voucher', use_voucher_type='Purchase Invoice',
+	)
+
+	payment_entry_kwargs_pi = dict(
+		voucher_type='Payment Entry', doctype='GL Entry', fields=['against_voucher'],
+		limit_start=0, limit_page_length=5, filters={
+			"ifnull(due_date, '')": ('=', ''), "ifnull(party, '')": ('!=', ''),
+			'voucher_type': 'Payment Entry', 'against_voucher_type': 'Purchase Invoice'
+		},
+		voucher_num_col='against_voucher', use_voucher_type='Purchase Invoice',
+	)
+
+	payment_entry_kwargs_si = dict(
+		voucher_type='Payment Entry', doctype='GL Entry', fields=['against_voucher'],
+		limit_start=0, limit_page_length=5, filters={
+			"ifnull(due_date, '')": ('=', ''), "ifnull(party, '')": ('!=', ''),
+			'voucher_type': 'Payment Entry', 'against_voucher_type': 'Sales Invoice'
+		},
+		voucher_num_col='against_voucher', use_voucher_type='Sales Invoice',
+	)
+
+	return [
+		pi_kwargs, si_kwargs, journal_kwargs_pi, journal_kwargs_si,
+		payment_entry_kwargs_pi, payment_entry_kwargs_si
+	]
diff --git a/erpnext/patches/v8_9/add_setup_progress_actions.py b/erpnext/patches/v8_9/add_setup_progress_actions.py
index dbd0fac..fe12311 100644
--- a/erpnext/patches/v8_9/add_setup_progress_actions.py
+++ b/erpnext/patches/v8_9/add_setup_progress_actions.py
@@ -30,6 +30,8 @@
 		{"action_name": "Add Rooms", "action_doctype": "Room", "min_doc_count": 1, "is_completed": 0,
 			"domains": '["Education"]' },
 		{"action_name": "Add Users", "action_doctype": "User", "min_doc_count": 4, "is_completed": 0,
+			"domains": '[]' },
+		{"action_name": "Add Letterhead", "action_doctype": "Letter Head", "min_doc_count": 1, "is_completed": 0,
 			"domains": '[]' }
 	]
 
diff --git a/erpnext/patches/v9_0/add_user_to_child_table_in_pos_profile.py b/erpnext/patches/v9_0/add_user_to_child_table_in_pos_profile.py
index e7833c0..942f089 100644
--- a/erpnext/patches/v9_0/add_user_to_child_table_in_pos_profile.py
+++ b/erpnext/patches/v9_0/add_user_to_child_table_in_pos_profile.py
@@ -5,18 +5,34 @@
 import frappe
 
 def execute():
-	doctype = 'POS Profile'
-	frappe.reload_doc('accounts', 'doctype', doctype)
-	frappe.reload_doc('accounts', 'doctype', 'POS Profile User')
+	if frappe.db.table_exists("POS Profile User"):
+		frappe.reload_doc('accounts', 'doctype', 'pos_profile_user')
 
-	for doc in frappe.get_all(doctype):
-		_doc = frappe.get_doc(doctype, doc.name)
-		user = frappe.db.get_value(doctype, doc.name, 'user')
+		frappe.db.sql(""" update `tabPOS Profile User`,
+			(select `tabPOS Profile User`.name from `tabPOS Profile User`, `tabPOS Profile`
+				where `tabPOS Profile`.name = `tabPOS Profile User`.parent
+				group by `tabPOS Profile User`.user, `tabPOS Profile`.company) as pfu
+			set
+				`tabPOS Profile User`.default = 1
+			where `tabPOS Profile User`.name = pfu.name""")
+	else:
+		doctype = 'POS Profile'
+		frappe.reload_doc('accounts', 'doctype', doctype)
+		frappe.reload_doc('accounts', 'doctype', 'pos_profile_user')
+		frappe.reload_doc('accounts', 'doctype', 'pos_item_group')
+		frappe.reload_doc('accounts', 'doctype', 'pos_customer_group')
 
-		if not user: continue
+		for doc in frappe.get_all(doctype):
+			_doc = frappe.get_doc(doctype, doc.name)
+			user = frappe.db.get_value(doctype, doc.name, 'user')
 
-		_doc.append('applicable_for_users', {
-			'user': user
-		})
-		_doc.pos_profile_name = user + ' - ' + _doc.company
-		_doc.save()
+			if not user: continue
+
+			_doc.append('applicable_for_users', {
+				'user': user,
+				'default': 1
+			})
+			_doc.pos_profile_name = user + ' - ' + _doc.company
+			_doc.flags.ignore_validate  = True
+			_doc.flags.ignore_mandatory = True
+			_doc.save()
\ No newline at end of file
diff --git a/erpnext/patches/v9_0/copy_old_fees_field_data.py b/erpnext/patches/v9_0/copy_old_fees_field_data.py
index 4243c5b..1427820 100644
--- a/erpnext/patches/v9_0/copy_old_fees_field_data.py
+++ b/erpnext/patches/v9_0/copy_old_fees_field_data.py
@@ -5,7 +5,9 @@
 import frappe
 
 def execute():
-	frappe.reload_doc("schools", "doctype", "fees")
+	# 'Schools' module changed to the 'Education'
+	# frappe.reload_doc("schools", "doctype", "fees")
+	frappe.reload_doc("education", "doctype", "fees")
 
 	if "total_amount" not in frappe.db.get_table_columns("Fees"):
 		return
diff --git a/erpnext/patches/v9_0/student_admission_childtable_migrate.py b/erpnext/patches/v9_0/student_admission_childtable_migrate.py
index dcbbeeb..a5712c7 100644
--- a/erpnext/patches/v9_0/student_admission_childtable_migrate.py
+++ b/erpnext/patches/v9_0/student_admission_childtable_migrate.py
@@ -5,8 +5,11 @@
 import frappe
 
 def execute():
-	frappe.reload_doc('schools', 'doctype', 'Student Admission Program')
-	frappe.reload_doctype('Student Admission')
+	# 'Schools' module changed to the 'Education'
+	# frappe.reload_doc('schools', 'doctype', 'Student Admission Program')
+	# frappe.reload_doc('schools', 'doctype', 'student_admission')
+	frappe.reload_doc('education', 'doctype', 'Student Admission Program')
+	frappe.reload_doc('education', 'doctype', 'student_admission')
 
 	if "program" not in frappe.db.get_table_columns("Student Admission"):
 		return
diff --git a/erpnext/patches/v9_0/update_asset_module_doctypes.py b/erpnext/patches/v9_0/update_asset_module_doctypes.py
deleted file mode 100644
index 66eb287..0000000
--- a/erpnext/patches/v9_0/update_asset_module_doctypes.py
+++ /dev/null
@@ -1,12 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
-# License: GNU General Public License v3. See license.txt
-
-from __future__ import unicode_literals
-import frappe
-
-def execute():
-	frappe.reload_doc('assets', 'doctype', 'asset_category')
-	frappe.db.set_value("DocType", "Asset Category", "module", "Assets")
-	frappe.db.set_value("DocType", "Asset", "module", "Assets")
-	frappe.db.set_value("DocType", "Asset Movement", "module", "Assets")
-	frappe.db.set_value("DocType", "Depreciation Schedule", "module", "Assets")
\ No newline at end of file
diff --git a/erpnext/patches/v9_0/update_multi_uom_fields_in_material_request.py b/erpnext/patches/v9_0/update_multi_uom_fields_in_material_request.py
new file mode 100644
index 0000000..45610ed
--- /dev/null
+++ b/erpnext/patches/v9_0/update_multi_uom_fields_in_material_request.py
@@ -0,0 +1,12 @@
+# Copyright (c) 2017, Frappe and Contributors
+# License: GNU General Public License v3. See license.txt
+
+from __future__ import unicode_literals
+import frappe
+
+def execute():
+	frappe.reload_doctype('Material Request')
+	frappe.reload_doctype('Material Request Item')
+
+	frappe.db.sql(""" update `tabMaterial Request Item`
+		set stock_uom = uom, stock_qty = qty, conversion_factor = 1.0""")
\ No newline at end of file
diff --git a/erpnext/patches/v9_1/create_issue_opportunity_type.py b/erpnext/patches/v9_1/create_issue_opportunity_type.py
index 5b3819b..aa8bbd1 100644
--- a/erpnext/patches/v9_1/create_issue_opportunity_type.py
+++ b/erpnext/patches/v9_1/create_issue_opportunity_type.py
@@ -7,8 +7,8 @@
 
 def execute():
 	# delete custom field if exists
-	for fieldname in ('issue_type', 'opportunity_type'):
-		custom_field = frappe.db.get_value("Custom Field", {"fieldname": fieldname})
+	for doctype, fieldname in (('Issue', 'issue_type'), ('Opportunity', 'opportunity_type')):
+		custom_field = frappe.db.get_value("Custom Field", {"fieldname": fieldname, 'dt': doctype})
 		if custom_field:
 			frappe.delete_doc("Custom Field", custom_field, ignore_permissions=True)
 
diff --git a/erpnext/patches/v9_2/remove_company_from_patient.py b/erpnext/patches/v9_2/remove_company_from_patient.py
new file mode 100644
index 0000000..ad9c9c5
--- /dev/null
+++ b/erpnext/patches/v9_2/remove_company_from_patient.py
@@ -0,0 +1,5 @@
+import frappe
+
+def execute():
+	if 'company' in frappe.db.get_table_columns("Patient"):
+		frappe.db.sql("alter table `tabPatient` drop column company")
diff --git a/erpnext/patches/v9_2/repost_reserved_qty_for_production.py b/erpnext/patches/v9_2/repost_reserved_qty_for_production.py
new file mode 100644
index 0000000..27cce1d
--- /dev/null
+++ b/erpnext/patches/v9_2/repost_reserved_qty_for_production.py
@@ -0,0 +1,7 @@
+import frappe
+
+def execute():
+	bins = frappe.db.sql("select name from `tabBin` where reserved_qty_for_production > 0")
+	for d in bins:
+		bin_doc = frappe.get_doc("Bin", d[0])
+		bin_doc.update_reserved_qty_for_production()
\ No newline at end of file
diff --git a/erpnext/patches/v9_2/set_item_name_in_production_order.py b/erpnext/patches/v9_2/set_item_name_in_production_order.py
new file mode 100644
index 0000000..e0e422b
--- /dev/null
+++ b/erpnext/patches/v9_2/set_item_name_in_production_order.py
@@ -0,0 +1,11 @@
+import frappe
+
+def execute():
+
+	frappe.db.sql("""
+		update `tabBOM Item` bom, `tabProduction Order Item` po_item
+		set po_item.item_name = bom.item_name,
+			po_item.description = bom.description
+		where po_item.item_code = bom.item_code
+			and (po_item.item_name is null or po_item.description is null)
+	""")
diff --git a/erpnext/projects/doctype/task/task.py b/erpnext/projects/doctype/task/task.py
index fa56a95..52d9025 100644
--- a/erpnext/projects/doctype/task/task.py
+++ b/erpnext/projects/doctype/task/task.py
@@ -233,7 +233,7 @@
     })
     args = make_tree_args(**args)
 
-    if args.parent_task == 'task':
+    if args.parent_task == 'All Tasks':
         args.parent_task = None
 
     frappe.get_doc(args).insert()
diff --git a/erpnext/public/build.json b/erpnext/public/build.json
index 0730df9..0bcbf71 100644
--- a/erpnext/public/build.json
+++ b/erpnext/public/build.json
@@ -31,10 +31,10 @@
         "public/js/templates/item_selector.html",
         "public/js/utils/item_selector.js",
         "public/js/help_links.js",
-        "public/js/schools/student_button.html",
-        "public/js/schools/assessment_result_tool.html",
         "public/js/templates/item_quick_entry.html",
-        "public/js/utils/item_quick_entry.js"
+        "public/js/utils/item_quick_entry.js",
+        "public/js/education/student_button.html",
+        "public/js/education/assessment_result_tool.html"
     ],
     "js/item-dashboard.min.js": [
         "stock/dashboard/item_dashboard.html",
diff --git a/erpnext/public/js/controllers/accounts.js b/erpnext/public/js/controllers/accounts.js
index abd5566..860c8c1 100644
--- a/erpnext/public/js/controllers/accounts.js
+++ b/erpnext/public/js/controllers/accounts.js
@@ -20,7 +20,7 @@
 				if(frm.cscript.tax_table == "Sales Taxes and Charges") {
 					var account_type = ["Tax", "Chargeable", "Expense Account"];
 				} else {
-					var account_type = ["Tax", "Chargeable", "Income Account"];
+					var account_type = ["Tax", "Chargeable", "Income Account", "Expenses Included In Valuation"];
 				}
 
 				return {
@@ -62,15 +62,32 @@
 			frappe.model.set_value(cdt, cdn, 'account', account)
 		})
 	}
-})
+});
+
+frappe.ui.form.on("Sales Invoice", {
+	payment_terms_template: function() {
+		cur_frm.trigger("disable_due_date");
+	}
+});
 
 frappe.ui.form.on('Purchase Invoice', {
 	mode_of_payment: function(frm) {
 		get_payment_mode_account(frm, frm.doc.mode_of_payment, function(account){
 			frm.set_value('cash_bank_account', account);
 		})
+	},
+
+	payment_terms_template: function() {
+		cur_frm.trigger("disable_due_date");
 	}
-})
+});
+
+frappe.ui.form.on("Payment Schedule", {
+	payment_schedule_remove: function() {
+		cur_frm.trigger("disable_due_date");
+	},
+
+});
 
 frappe.ui.form.on('Payment Entry', {
 	mode_of_payment: function(frm) {
diff --git a/erpnext/public/js/controllers/taxes_and_totals.js b/erpnext/public/js/controllers/taxes_and_totals.js
index afdc873..c7abed8 100644
--- a/erpnext/public/js/controllers/taxes_and_totals.js
+++ b/erpnext/public/js/controllers/taxes_and_totals.js
@@ -443,16 +443,8 @@
 				this.frm.doc.currency, precision("rounded_total"));
 			this.frm.doc.rounding_adjustment += flt(this.frm.doc.rounded_total - this.frm.doc.grand_total,
 				precision("rounding_adjustment"));
-		}
-		if(frappe.meta.get_docfield(this.frm.doc.doctype, "base_rounded_total", this.frm.doc.name)) {
-			var company_currency = this.get_company_currency();
 
-			this.frm.doc.base_rounded_total =
-				round_based_on_smallest_currency_fraction(this.frm.doc.base_grand_total,
-					company_currency, precision("base_rounded_total"));
-
-			this.frm.doc.base_rounding_adjustment += flt(this.frm.doc.base_rounded_total -
-				this.frm.doc.base_grand_total, precision("rounding_adjustment"));
+			this.set_in_company_currency(this.frm.doc, ["rounding_adjustment", "rounded_total"]);
 		}
 	},
 
diff --git a/erpnext/public/js/controllers/transaction.js b/erpnext/public/js/controllers/transaction.js
index 621e9a7..92a788b 100644
--- a/erpnext/public/js/controllers/transaction.js
+++ b/erpnext/public/js/controllers/transaction.js
@@ -102,6 +102,10 @@
 			});
 		}
 
+		if(this.frm.fields_dict["payment_terms_template"]){
+			this.frm.trigger("payment_terms_template");
+		}
+
 		if(this.frm.fields_dict["taxes"]) {
 			this["taxes_remove"] = this.calculate_taxes_and_totals;
 		}
@@ -318,7 +322,8 @@
 							project: item.project || me.frm.doc.project,
 							qty: item.qty || 1,
 							stock_qty: item.stock_qty,
-							conversion_factor: item.conversion_factor
+							conversion_factor: item.conversion_factor,
+							pos_profile: me.frm.doc.doctype == 'Sales Invoice' ? me.frm.doc.pos_profile : ''
 						}
 					},
 
@@ -650,7 +655,10 @@
 			item.stock_qty = flt(item.qty * item.conversion_factor, precision("stock_qty", item));
 			refresh_field("stock_qty", item.name, item.parentfield);
 			this.toggle_conversion_factor(item);
-			if(!dont_fetch_price_list_rate) this.apply_price_list(item, true);
+			if (!dont_fetch_price_list_rate &&
+				frappe.meta.has_field(doc.doctype, "price_list_currency")) {
+				this.apply_price_list(item, true);
+			}
 		}
 	},
 
@@ -884,7 +892,8 @@
 			"name": me.frm.doc.name,
 			"is_return": cint(me.frm.doc.is_return),
 			"update_stock": in_list(['Sales Invoice', 'Purchase Invoice'], me.frm.doc.doctype) ? cint(me.frm.doc.update_stock) : 0,
-			"conversion_factor": me.frm.doc.conversion_factor
+			"conversion_factor": me.frm.doc.conversion_factor,
+			"pos_profile": me.frm.doc.doctype == 'Sales Invoice' ? me.frm.doc.pos_profile : ''
 		};
 	},
 
@@ -1155,6 +1164,46 @@
 			}
 		}
 	},
+
+	payment_terms_template: function() {
+		var me = this;
+		if(this.frm.doc.payment_terms_template && this.frm.doc.payment_schedule.length === 0) {
+			frappe.call({
+				method: "erpnext.controllers.accounts_controller.get_payment_terms",
+				args: {
+					terms_template: this.frm.doc.payment_terms_template,
+					posting_date: this.frm.doc.posting_date || this.frm.doc.transaction_date,
+					grand_total: this.frm.doc.rounded_total || this.frm.doc.grand_total
+				},
+				callback: function(r) {
+					if(r.message && !r.exc) {
+						me.frm.set_value("payment_schedule", r.message);
+					}
+				}
+			})
+		}
+	},
+
+	payment_term: function(doc, cdt, cdn) {
+		var row = locals[cdt][cdn];
+		if(row.payment_term) {
+			frappe.call({
+				method: "erpnext.controllers.accounts_controller.get_payment_term_details",
+				args: {
+					term: row.payment_term,
+					posting_date: this.frm.doc.posting_date || this.frm.doc.transaction_date,
+					grand_total: this.frm.doc.rounded_total || this.frm.doc.grand_total
+				},
+				callback: function(r) {
+					if(r.message && !r.exc) {
+						for (var d in r.message) {
+							frappe.model.set_value(cdt, cdn, d, r.message[d]);
+						}
+					}
+				}
+			})
+		}
+	}
 });
 
 erpnext.show_serial_batch_selector = function(frm, d, callback, show_dialog) {
diff --git a/erpnext/public/js/setup_wizard.js b/erpnext/public/js/setup_wizard.js
index 7c274f1..53b7108 100644
--- a/erpnext/public/js/setup_wizard.js
+++ b/erpnext/public/js/setup_wizard.js
@@ -25,7 +25,7 @@
 					{ "label": __("Manufacturing"), "value": "Manufacturing" },
 					{ "label": __("Retail"), "value": "Retail" },
 					{ "label": __("Services"), "value": "Services" },
-					{ "label": __("Education (beta)"), "value": "Education" },
+					{ "label": __("Education"), "value": "Education" },
 					{"label": __("Healthcare (beta)"), "value": "Healthcare"}
 				], reqd: 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
deleted file mode 100644
index f92f738..0000000
--- a/erpnext/schools/doctype/course_scheduling_tool/course_scheduling_tool.js
+++ /dev/null
@@ -1,20 +0,0 @@
-// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
-// For license information, please see license.txt
-
-cur_frm.add_fetch("student_group", "program", "program");
-cur_frm.add_fetch("student_group", "course", "course");
-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
-			})
-		});
-	}
-});
\ No newline at end of file
diff --git a/erpnext/schools/doctype/course_scheduling_tool/course_scheduling_tool.py b/erpnext/schools/doctype/course_scheduling_tool/course_scheduling_tool.py
deleted file mode 100644
index 4e07922..0000000
--- a/erpnext/schools/doctype/course_scheduling_tool/course_scheduling_tool.py
+++ /dev/null
@@ -1,101 +0,0 @@
-# -*- coding: utf-8 -*-
-# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors
-# For license information, please see license.txt
-
-from __future__ import unicode_literals
-import frappe
-import calendar
-from frappe import _
-from frappe.model.document import Document
-from frappe.utils import add_days, getdate
-from erpnext.schools.utils import OverlapError
-
-class CourseSchedulingTool(Document):
-	def schedule_course(self):
-		"""Creates course schedules as per specified parametes"""
-		
-		course_schedules= []
-		course_schedules_errors= []
-		rescheduled= []
-		reschedule_errors= []
-		
-		self.validate_mandatory()
-		self.validate_date()
-		self.instructor_name= frappe.db.get_value("Instructor", self.instructor, "instructor_name")
-
-		group_based_on, course = frappe.db.get_value("Student Group", self.student_group, ["group_based_on", "course"])
-		if group_based_on == "Course":
-			self.course = course	
-
-		if self.rechedule:
-			rescheduled, reschedule_errors = self.delete_course_schedule(rescheduled, reschedule_errors)
-		
-		date = self.course_start_date
-		while(date < self.course_end_date):
-			if self.day == calendar.day_name[getdate(date).weekday()]:
-				course_schedule = self.make_course_schedule(date)
-				try:
-					course_schedule.save()
-				except OverlapError:
-					course_schedules_errors.append(date)
-				else:
-					course_schedules.append(course_schedule.name + " on " + date)
-				
-				date = add_days(date, 7)
-			else:
-				date = add_days(date, 1)
-			
-		frappe.local.message_log = []
-		if course_schedules:
-			frappe.msgprint(_("Course Schedules created:") + "\n" + "\n".join(course_schedules))
-		if course_schedules_errors:
-			frappe.msgprint(_("There were errors while scheduling course on :") + "\n" + "\n".join(course_schedules_errors))
-		if rescheduled:
-			frappe.msgprint(_("Course Schedules deleted:") + "\n" + "\n".join(rescheduled))
-		if reschedule_errors:
-			frappe.msgprint(_("There were errors while deleting following schedules:") + "\n" + "\n".join(reschedule_errors))
-			
-	def validate_mandatory(self):
-		"""Validates all mandatory fields"""
-		
-		fields = ['course', 'room', 'instructor', 'from_time', 'to_time', 'course_start_date', 'course_end_date', 'day']
-		for d in  fields:
-			if not self.get(d):
-				frappe.throw(_("{0} is mandatory").format(self.meta.get_label(d)))	
-
-	def validate_date(self):
-		"""Validates if Course Start Date is greater than Course End Date"""
-		if self.course_start_date > self.course_end_date:
-			frappe.throw("Course Start Date cannot be greater than Course End Date.")
-
-	def delete_course_schedule(self, rescheduled, reschedule_errors):
-		"""Delete all course schedule within the Date range and specified filters"""
-		schedules = frappe.get_list("Course Schedule", fields=["name", "schedule_date"], filters = 
-			[["student_group", "=", self.student_group],
-			["course", "=", self.course],
-			["schedule_date", ">=", self.course_start_date], 
-			["schedule_date", "<=", self.course_end_date]])
-		for d in schedules:
-			try:
-				if self.day == calendar.day_name[getdate(d.schedule_date).weekday()]:
-					frappe.delete_doc("Course Schedule", d.name)
-					rescheduled.append(d.name)
-			except:
-				reschedule_errors.append(d.name)
-		return rescheduled, reschedule_errors
-			
-	def make_course_schedule(self, date):
-		"""Makes a new Course Schedule.
-		:param date: Date on which Course Schedule will be created."""
-		
-		course_schedule = frappe.new_doc("Course Schedule")
-		course_schedule.student_group = self.student_group
-		course_schedule.course = self.course
-		course_schedule.instructor = self.instructor
-		course_schedule.instructor_name = self.instructor_name
-		course_schedule.room = self.room
-		course_schedule.schedule_date= date
-		course_schedule.from_time= self.from_time
-		course_schedule.to_time= self.to_time
-		return course_schedule
-	
\ No newline at end of file
diff --git a/erpnext/schools/doctype/school_settings/school_settings.js b/erpnext/schools/doctype/school_settings/school_settings.js
deleted file mode 100644
index 2707c42..0000000
--- a/erpnext/schools/doctype/school_settings/school_settings.js
+++ /dev/null
@@ -1,8 +0,0 @@
-// Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
-// For license information, please see license.txt
-
-frappe.ui.form.on('School Settings', {
-	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
deleted file mode 100644
index a081e14..0000000
--- a/erpnext/schools/doctype/student_leave_application/student_leave_application.json
+++ /dev/null
@@ -1,357 +0,0 @@
-{
- "allow_copy": 0,
- "allow_guest_to_view": 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_bulk_edit": 0,
-   "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_global_search": 1,
-   "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_bulk_edit": 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_global_search": 1,
-   "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_bulk_edit": 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_global_search": 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_bulk_edit": 0,
-   "allow_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "columns": 0,
-   "fieldname": "from_date",
-   "fieldtype": "Date",
-   "hidden": 0,
-   "ignore_user_permissions": 0,
-   "ignore_xss_filter": 0,
-   "in_filter": 0,
-   "in_global_search": 0,
-   "in_list_view": 1,
-   "in_standard_filter": 1,
-   "label": "From 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_bulk_edit": 0,
-   "allow_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "columns": 0,
-   "fieldname": "to_date",
-   "fieldtype": "Date",
-   "hidden": 0,
-   "ignore_user_permissions": 0,
-   "ignore_xss_filter": 0,
-   "in_filter": 0,
-   "in_global_search": 0,
-   "in_list_view": 1,
-   "in_standard_filter": 0,
-   "label": "To 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_bulk_edit": 0,
-   "allow_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "columns": 0,
-   "description": "Will show the student as Present in Student Monthly Attendance Report",
-   "fieldname": "mark_as_present",
-   "fieldtype": "Check",
-   "hidden": 0,
-   "ignore_user_permissions": 0,
-   "ignore_xss_filter": 0,
-   "in_filter": 0,
-   "in_global_search": 0,
-   "in_list_view": 0,
-   "in_standard_filter": 0,
-   "label": "Mark as Present",
-   "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_bulk_edit": 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_global_search": 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_bulk_edit": 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_global_search": 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_bulk_edit": 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_global_search": 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
-  }
- ],
- "has_web_view": 0,
- "hide_heading": 0,
- "hide_toolbar": 0,
- "idx": 0,
- "image_view": 0,
- "in_create": 0,
- "is_submittable": 1,
- "issingle": 0,
- "istable": 0,
- "max_attachments": 0,
- "modified": "2017-07-17 21:57:57.804413",
- "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,
-   "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,
-   "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,
- "restrict_to_domain": "Education",
- "show_name_in_global_search": 1,
- "sort_field": "modified",
- "sort_order": "DESC",
- "title_field": "student_name",
- "track_changes": 0,
- "track_seen": 0
-}
\ No newline at end of file
diff --git a/erpnext/schools/doctype/student_log/student_log.json b/erpnext/schools/doctype/student_log/student_log.json
deleted file mode 100644
index 81d7026..0000000
--- a/erpnext/schools/doctype/student_log/student_log.json
+++ /dev/null
@@ -1,400 +0,0 @@
-{
- "allow_copy": 0,
- "allow_guest_to_view": 0,
- "allow_import": 0,
- "allow_rename": 0,
- "autoname": "SLog.####",
- "beta": 0,
- "creation": "2016-07-29 03:27:22.451772",
- "custom": 0,
- "docstatus": 0,
- "doctype": "DocType",
- "document_type": "",
- "editable_grid": 1,
- "engine": "InnoDB",
- "fields": [
-  {
-   "allow_bulk_edit": 0,
-   "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_global_search": 0,
-   "in_list_view": 0,
-   "in_standard_filter": 1,
-   "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_bulk_edit": 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_global_search": 1,
-   "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_bulk_edit": 0,
-   "allow_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "columns": 0,
-   "fieldname": "type",
-   "fieldtype": "Select",
-   "hidden": 0,
-   "ignore_user_permissions": 0,
-   "ignore_xss_filter": 0,
-   "in_filter": 0,
-   "in_global_search": 0,
-   "in_list_view": 1,
-   "in_standard_filter": 1,
-   "label": "Type",
-   "length": 0,
-   "no_copy": 0,
-   "options": "General\nAcademic\nMedical\nAchievement",
-   "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_bulk_edit": 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_global_search": 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": 0,
-   "search_index": 0,
-   "set_only_once": 0,
-   "unique": 0
-  },
-  {
-   "allow_bulk_edit": 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_global_search": 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_bulk_edit": 0,
-   "allow_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "columns": 0,
-   "fieldname": "academic_year",
-   "fieldtype": "Link",
-   "hidden": 0,
-   "ignore_user_permissions": 0,
-   "ignore_xss_filter": 0,
-   "in_filter": 0,
-   "in_global_search": 0,
-   "in_list_view": 0,
-   "in_standard_filter": 0,
-   "label": "Academic Year",
-   "length": 0,
-   "no_copy": 0,
-   "options": "Academic Year",
-   "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_bulk_edit": 0,
-   "allow_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "columns": 0,
-   "fieldname": "academic_term",
-   "fieldtype": "Link",
-   "hidden": 0,
-   "ignore_user_permissions": 0,
-   "ignore_xss_filter": 0,
-   "in_filter": 0,
-   "in_global_search": 0,
-   "in_list_view": 0,
-   "in_standard_filter": 0,
-   "label": "Academic Term",
-   "length": 0,
-   "no_copy": 0,
-   "options": "Academic Term",
-   "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_bulk_edit": 0,
-   "allow_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "columns": 0,
-   "fieldname": "program",
-   "fieldtype": "Link",
-   "hidden": 0,
-   "ignore_user_permissions": 0,
-   "ignore_xss_filter": 0,
-   "in_filter": 0,
-   "in_global_search": 0,
-   "in_list_view": 0,
-   "in_standard_filter": 0,
-   "label": "Program",
-   "length": 0,
-   "no_copy": 0,
-   "options": "Program",
-   "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_bulk_edit": 0,
-   "allow_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "columns": 0,
-   "fieldname": "student_batch",
-   "fieldtype": "Link",
-   "hidden": 0,
-   "ignore_user_permissions": 0,
-   "ignore_xss_filter": 0,
-   "in_filter": 0,
-   "in_global_search": 0,
-   "in_list_view": 0,
-   "in_standard_filter": 0,
-   "label": "Student Batch",
-   "length": 0,
-   "no_copy": 0,
-   "options": "Student Batch Name",
-   "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_bulk_edit": 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_global_search": 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_bulk_edit": 0,
-   "allow_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "columns": 0,
-   "fieldname": "log",
-   "fieldtype": "Text Editor",
-   "hidden": 0,
-   "ignore_user_permissions": 0,
-   "ignore_xss_filter": 0,
-   "in_filter": 0,
-   "in_global_search": 1,
-   "in_list_view": 0,
-   "in_standard_filter": 0,
-   "label": "Log",
-   "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
-  }
- ],
- "has_web_view": 0,
- "hide_heading": 0,
- "hide_toolbar": 0,
- "idx": 0,
- "image_view": 0,
- "in_create": 0,
- "is_submittable": 0,
- "issingle": 0,
- "istable": 0,
- "max_attachments": 0,
- "modified": "2017-07-17 21:57:11.024049",
- "modified_by": "Administrator",
- "module": "Schools",
- "name": "Student Log",
- "name_case": "",
- "owner": "Administrator",
- "permissions": [
-  {
-   "amend": 0,
-   "apply_user_permissions": 0,
-   "cancel": 0,
-   "create": 1,
-   "delete": 1,
-   "email": 1,
-   "export": 1,
-   "if_owner": 0,
-   "import": 0,
-   "permlevel": 0,
-   "print": 1,
-   "read": 1,
-   "report": 1,
-   "role": "Academics User",
-   "set_user_permissions": 0,
-   "share": 1,
-   "submit": 0,
-   "write": 1
-  }
- ],
- "quick_entry": 0,
- "read_only": 0,
- "read_only_onload": 0,
- "restrict_to_domain": "Education",
- "show_name_in_global_search": 0,
- "sort_field": "modified",
- "sort_order": "DESC",
- "title_field": "student_name",
- "track_changes": 0,
- "track_seen": 1
-}
\ No newline at end of file
diff --git a/erpnext/schools/web_form/discussion/__init__.py b/erpnext/schools/web_form/discussion/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/erpnext/schools/web_form/discussion/__init__.py
+++ /dev/null
diff --git a/erpnext/schools/web_form/discussion/discussion.js b/erpnext/schools/web_form/discussion/discussion.js
deleted file mode 100644
index 4130b0c..0000000
--- a/erpnext/schools/web_form/discussion/discussion.js
+++ /dev/null
@@ -1,4 +0,0 @@
-frappe.ready(function() {
-	var form = $('form[data-web-form="discussion"]'),
-		owner = form.attr('data-owner');
-})
\ No newline at end of file
diff --git a/erpnext/schools/web_form/discussion/discussion.json b/erpnext/schools/web_form/discussion/discussion.json
deleted file mode 100644
index 4a781d1..0000000
--- a/erpnext/schools/web_form/discussion/discussion.json
+++ /dev/null
@@ -1,49 +0,0 @@
-{
- "allow_comments": 1, 
- "allow_delete": 1, 
- "allow_edit": 1, 
- "allow_multiple": 1, 
- "creation": "2016-06-26 20:46:09.598755", 
- "doc_type": "Discussion", 
- "docstatus": 0, 
- "doctype": "Web Form", 
- "idx": 0, 
- "is_standard": 1, 
- "login_required": 1, 
- "modified": "2016-07-19 07:55:37.826664", 
- "modified_by": "Administrator", 
- "module": "Schools", 
- "name": "discussion", 
- "owner": "Administrator", 
- "published": 1, 
- "route": "discussion", 
- "success_url": "", 
- "title": "Discussion", 
- "web_form_fields": [
-  {
-   "fieldname": "course", 
-   "fieldtype": "Data", 
-   "hidden": 0, 
-   "label": "Course", 
-   "options": "Course", 
-   "read_only": 1, 
-   "reqd": 0
-  }, 
-  {
-   "fieldname": "subject", 
-   "fieldtype": "Text", 
-   "hidden": 0, 
-   "label": "Subject", 
-   "read_only": 0, 
-   "reqd": 1
-  }, 
-  {
-   "fieldname": "description", 
-   "fieldtype": "Text", 
-   "hidden": 0, 
-   "label": "Description", 
-   "read_only": 0, 
-   "reqd": 0
-  }
- ]
-}
\ No newline at end of file
diff --git a/erpnext/schools/web_form/discussion/discussion.py b/erpnext/schools/web_form/discussion/discussion.py
deleted file mode 100644
index 23ff052..0000000
--- a/erpnext/schools/web_form/discussion/discussion.py
+++ /dev/null
@@ -1,9 +0,0 @@
-from __future__ import unicode_literals
-
-import frappe
-
-def get_context(context=None):
-	pass
-
-def has_website_permission(doc, ptype, user, verbose=False):
-	return True
\ No newline at end of file
diff --git a/erpnext/selling/doctype/customer/customer.json b/erpnext/selling/doctype/customer/customer.json
index 52c6b6d..fd9d0a1 100644
--- a/erpnext/selling/doctype/customer/customer.json
+++ b/erpnext/selling/doctype/customer/customer.json
@@ -786,7 +786,7 @@
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 1, 
-   "collapsible_depends_on": "eval:doc.credit_days || doc.credit_limit", 
+   "collapsible_depends_on": "", 
    "columns": 0, 
    "fieldname": "credit_limit_section", 
    "fieldtype": "Section Break", 
@@ -797,7 +797,7 @@
    "in_global_search": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
-   "label": "Credit Limit", 
+   "label": "Credit Limit and Payment Terms", 
    "length": 0, 
    "no_copy": 0, 
    "permlevel": 0, 
@@ -810,70 +810,7 @@
    "search_index": 0, 
    "set_only_once": 0, 
    "unique": 0, 
-   "width": "50%"
-  }, 
-  {
-   "allow_bulk_edit": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "credit_days_based_on", 
-   "fieldtype": "Select", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 0, 
-   "in_standard_filter": 0, 
-   "label": "Credit Days Based On", 
-   "length": 0, 
-   "no_copy": 0, 
-   "options": "\nFixed Days\nLast Day of the Next Month", 
-   "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_bulk_edit": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "depends_on": "eval:doc.credit_days_based_on=='Fixed Days'", 
-   "fieldname": "credit_days", 
-   "fieldtype": "Int", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 0, 
-   "in_standard_filter": 0, 
-   "label": "Credit Days", 
-   "length": 0, 
-   "no_copy": 0, 
-   "oldfieldname": "credit_days", 
-   "oldfieldtype": "Int", 
-   "permlevel": 1, 
-   "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
+   "width": ""
   }, 
   {
    "allow_bulk_edit": 0, 
@@ -911,6 +848,69 @@
    "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "depends_on": "", 
+   "fieldname": "payment_terms", 
+   "fieldtype": "Link", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "ignore_xss_filter": 0, 
+   "in_filter": 0, 
+   "in_global_search": 0, 
+   "in_list_view": 0, 
+   "in_standard_filter": 0, 
+   "label": "Default Payment Terms Template", 
+   "length": 0, 
+   "no_copy": 0, 
+   "options": "Payment Terms Template", 
+   "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_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "default": "0", 
+   "fieldname": "bypass_credit_limit_check_at_sales_order", 
+   "fieldtype": "Check", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "ignore_xss_filter": 0, 
+   "in_filter": 0, 
+   "in_global_search": 0, 
+   "in_list_view": 0, 
+   "in_standard_filter": 0, 
+   "label": "Bypass credit limit check at Sales Order", 
+   "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_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
    "collapsible": 1, 
    "collapsible_depends_on": "customer_details", 
    "columns": 0, 
@@ -1202,7 +1202,7 @@
  "issingle": 0, 
  "istable": 0, 
  "max_attachments": 0, 
- "modified": "2017-07-24 00:55:07.445783", 
+ "modified": "2017-11-23 17:41:23.243421", 
  "modified_by": "Administrator", 
  "module": "Selling", 
  "name": "Customer", 
diff --git a/erpnext/selling/doctype/customer/customer.py b/erpnext/selling/doctype/customer/customer.py
index 64cd190..8e45921 100644
--- a/erpnext/selling/doctype/customer/customer.py
+++ b/erpnext/selling/doctype/customer/customer.py
@@ -88,30 +88,44 @@
 					address.append('links', dict(link_doctype='Customer', link_name=self.name))
 					address.save()
 
-			lead = frappe.db.get_value("Lead", self.lead_name, ["lead_name", "email_id", "phone", "mobile_no", "gender", "salutation"], as_dict=True)
+			lead = frappe.db.get_value("Lead", self.lead_name, ["organization_lead", "lead_name", "email_id", "phone", "mobile_no", "gender", "salutation"], as_dict=True)
 
 			if not lead.lead_name:
 				frappe.throw(_("Please mention the Lead Name in Lead {0}").format(self.lead_name))
 
-			lead.lead_name = lead.lead_name.split(" ")
-			lead.first_name = lead.lead_name[0]
-			lead.last_name = " ".join(lead.lead_name[1:])
+			if lead.organization_lead:
+				contact_names = frappe.get_all('Dynamic Link', filters={
+									"parenttype":"Contact",
+									"link_doctype":"Lead",
+									"link_name":self.lead_name
+								}, fields=["parent as name"])
 
-			# create contact from lead
-			contact = frappe.new_doc('Contact')
-			contact.first_name = lead.first_name
-			contact.last_name = lead.last_name
-			contact.gender = lead.gender
-			contact.salutation = lead.salutation
-			contact.email_id = lead.email_id
-			contact.phone = lead.phone
-			contact.mobile_no = lead.mobile_no
-			contact.is_primary_contact = 1
-			contact.append('links', dict(link_doctype='Customer', link_name=self.name))
-			contact.flags.ignore_permissions = self.flags.ignore_permissions
-			contact.autoname()
-			if not frappe.db.exists("Contact", contact.name):
-				contact.insert()
+				for contact_name in contact_names:
+					contact = frappe.get_doc('Contact', contact_name.get('name'))
+					if not contact.has_link('Customer', self.name):
+						contact.append('links', dict(link_doctype='Customer', link_name=self.name))
+						contact.save()
+
+			else:
+				lead.lead_name = lead.lead_name.split(" ")
+				lead.first_name = lead.lead_name[0]
+				lead.last_name = " ".join(lead.lead_name[1:])
+
+				# create contact from lead
+				contact = frappe.new_doc('Contact')
+				contact.first_name = lead.first_name
+				contact.last_name = lead.last_name
+				contact.gender = lead.gender
+				contact.salutation = lead.salutation
+				contact.email_id = lead.email_id
+				contact.phone = lead.phone
+				contact.mobile_no = lead.mobile_no
+				contact.is_primary_contact = 1
+				contact.append('links', dict(link_doctype='Customer', link_name=self.name))
+				contact.flags.ignore_permissions = self.flags.ignore_permissions
+				contact.autoname()
+				if not frappe.db.exists("Contact", contact.name):
+					contact.insert()
 
 	def validate_name_with_customer_group(self):
 		if frappe.db.exists("Customer Group", self.name):
@@ -170,23 +184,30 @@
 			throw(_("Please contact to the user who have Sales Master Manager {0} role")
 				.format(" / " + credit_controller if credit_controller else ""))
 
-def get_customer_outstanding(customer, company):
+def get_customer_outstanding(customer, company, ignore_outstanding_sales_order=False):
 	# Outstanding based on GL Entries
-	outstanding_based_on_gle = frappe.db.sql("""select sum(debit) - sum(credit)
-		from `tabGL Entry` where party_type = 'Customer' and party = %s and company=%s""", (customer, company))
+	outstanding_based_on_gle = frappe.db.sql("""
+		select sum(debit) - sum(credit)
+		from `tabGL Entry`
+		where party_type = 'Customer' and party = %s and company=%s""", (customer, company))
 
 	outstanding_based_on_gle = flt(outstanding_based_on_gle[0][0]) if outstanding_based_on_gle else 0
 
 	# Outstanding based on Sales Order
-	outstanding_based_on_so = frappe.db.sql("""
-		select sum(base_grand_total*(100 - per_billed)/100)
-		from `tabSales Order`
-		where customer=%s and docstatus = 1 and company=%s
-		and per_billed < 100 and status != 'Closed'""", (customer, company))
+	outstanding_based_on_so = 0.0
 
-	outstanding_based_on_so = flt(outstanding_based_on_so[0][0]) if outstanding_based_on_so else 0.0
+	# if credit limit check is bypassed at sales order level,
+	# we should not consider outstanding Sales Orders, when customer credit balance report is run
+	if not ignore_outstanding_sales_order:
+		outstanding_based_on_so = frappe.db.sql("""
+			select sum(base_grand_total*(100 - per_billed)/100)
+			from `tabSales Order`
+			where customer=%s and docstatus = 1 and company=%s
+			and per_billed < 100 and status != 'Closed'""", (customer, company))
 
-	# Outstanding based on Delivery Note
+		outstanding_based_on_so = flt(outstanding_based_on_so[0][0]) if outstanding_based_on_so else 0.0
+
+	# Outstanding based on Delivery Note, which are not created against Sales Order
 	unmarked_delivery_note_items = frappe.db.sql("""select
 			dn_item.name, dn_item.amount, dn.base_net_total, dn.base_grand_total
 		from `tabDelivery Note` dn, `tabDelivery Note Item` dn_item
@@ -215,7 +236,8 @@
 	credit_limit = None
 
 	if customer:
-		credit_limit, customer_group = frappe.db.get_value("Customer", customer, ["credit_limit", "customer_group"])
+		credit_limit, customer_group = frappe.db.get_value("Customer",
+			customer, ["credit_limit", "customer_group"])
 
 		if not credit_limit:
 			credit_limit = frappe.db.get_value("Customer Group", customer_group, "credit_limit")
diff --git a/erpnext/accounts/doctype/asset/test_asset.js b/erpnext/selling/doctype/customer/test_customer.js
similarity index 74%
copy from erpnext/accounts/doctype/asset/test_asset.js
copy to erpnext/selling/doctype/customer/test_customer.js
index 6119e38..65b81af 100644
--- a/erpnext/accounts/doctype/asset/test_asset.js
+++ b/erpnext/selling/doctype/customer/test_customer.js
@@ -2,15 +2,15 @@
 // rename this file from _test_[name] to test_[name] to activate
 // and remove above this line
 
-QUnit.test("test: Asset", function (assert) {
+QUnit.test("test: Customer", function (assert) {
 	let done = assert.async();
 
 	// number of asserts
 	assert.expect(1);
 
 	frappe.run_serially([
-		// insert a new Asset
-		() => frappe.tests.make('Asset', [
+		// insert a new Customer
+		() => frappe.tests.make('Customer', [
 			// values to be set
 			{key: 'value'}
 		]),
diff --git a/erpnext/selling/doctype/customer/test_customer.py b/erpnext/selling/doctype/customer/test_customer.py
index 40ed6f9..45546e3 100644
--- a/erpnext/selling/doctype/customer/test_customer.py
+++ b/erpnext/selling/doctype/customer/test_customer.py
@@ -6,6 +6,7 @@
 import frappe
 import unittest
 
+from erpnext.accounts.party import get_due_date
 from frappe.test_runner import make_test_records
 from erpnext.exceptions import PartyFrozen, PartyDisabled
 from frappe.utils import flt
@@ -13,7 +14,7 @@
 from erpnext.tests.utils import create_test_contact_and_address
 
 test_ignore = ["Price List"]
-
+test_dependencies = ['Payment Term', 'Payment Terms Template']
 test_records = frappe.get_test_records('Customer')
 
 class TestCustomer(unittest.TestCase):
@@ -181,6 +182,35 @@
 		customer.credit_limit = flt(outstanding_amt - 100)
 		self.assertRaises(frappe.ValidationError, customer.save)
 
+	def test_customer_payment_terms(self):
+		frappe.db.set_value(
+			"Customer", "_Test Customer With Template", "payment_terms", "_Test Payment Term Template 3")
+
+		due_date = get_due_date("2016-01-22", "Customer", "_Test Customer With Template")
+		self.assertEqual(due_date, "2016-02-21")
+
+		due_date = get_due_date("2017-01-22", "Customer", "_Test Customer With Template")
+		self.assertEqual(due_date, "2017-02-21")
+
+		frappe.db.set_value(
+			"Customer", "_Test Customer With Template", "payment_terms", "_Test Payment Term Template 1")
+
+		due_date = get_due_date("2016-01-22", "Customer", "_Test Customer With Template")
+		self.assertEqual(due_date, "2016-02-29")
+
+		due_date = get_due_date("2017-01-22", "Customer", "_Test Customer With Template")
+		self.assertEqual(due_date, "2017-02-28")
+
+		frappe.db.set_value("Customer", "_Test Customer With Template", "payment_terms", "")
+
+		# No default payment term template attached
+		due_date = get_due_date("2016-01-22", "Customer", "_Test Customer")
+		self.assertEqual(due_date, "2016-01-22")
+
+		due_date = get_due_date("2017-01-22", "Customer", "_Test Customer")
+		self.assertEqual(due_date, "2017-01-22")
+
+
 def get_customer_dict(customer_name):
 	return {
 		 "customer_group": "_Test Customer Group",
diff --git a/erpnext/selling/doctype/customer/test_records.json b/erpnext/selling/doctype/customer/test_records.json
index 94f14ed..a012c1b 100644
--- a/erpnext/selling/doctype/customer/test_records.json
+++ b/erpnext/selling/doctype/customer/test_records.json
@@ -1,6 +1,20 @@
 [
  {
   "customer_group": "_Test Customer Group",
+  "customer_name": "_Test Customer With Template",
+  "customer_type": "Individual",
+  "doctype": "Customer",
+  "territory": "_Test Territory"
+ },
+ {
+  "customer_group": "_Test Customer Group",
+  "customer_name": "_Test Customer P",
+  "customer_type": "Individual",
+  "doctype": "Customer",
+  "territory": "_Test Territory"
+ },
+ {
+  "customer_group": "_Test Customer Group",
   "customer_name": "_Test Customer",
   "customer_type": "Individual",
   "doctype": "Customer",
diff --git a/erpnext/selling/doctype/quotation/quotation.json b/erpnext/selling/doctype/quotation/quotation.json
index 6d8a3fe..53a3aa1 100644
--- a/erpnext/selling/doctype/quotation/quotation.json
+++ b/erpnext/selling/doctype/quotation/quotation.json
@@ -2156,6 +2156,100 @@
    "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
+   "collapsible": 0, 
+   "collapsible_depends_on": "", 
+   "columns": 0, 
+   "depends_on": "", 
+   "fieldname": "payment_schedule_section", 
+   "fieldtype": "Section Break", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "ignore_xss_filter": 0, 
+   "in_filter": 0, 
+   "in_global_search": 0, 
+   "in_list_view": 0, 
+   "in_standard_filter": 0, 
+   "label": "Payment Terms", 
+   "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_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "fieldname": "payment_terms_template", 
+   "fieldtype": "Link", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "ignore_xss_filter": 0, 
+   "in_filter": 0, 
+   "in_global_search": 0, 
+   "in_list_view": 0, 
+   "in_standard_filter": 0, 
+   "label": "Payment Terms Template", 
+   "length": 0, 
+   "no_copy": 0, 
+   "options": "Payment Terms Template", 
+   "permlevel": 0, 
+   "precision": "", 
+   "print_hide": 1, 
+   "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_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "fieldname": "payment_schedule", 
+   "fieldtype": "Table", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "ignore_xss_filter": 0, 
+   "in_filter": 0, 
+   "in_global_search": 0, 
+   "in_list_view": 0, 
+   "in_standard_filter": 0, 
+   "label": "Payment Schedule", 
+   "length": 0, 
+   "no_copy": 1, 
+   "options": "Payment Schedule", 
+   "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_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
    "collapsible": 1, 
    "collapsible_depends_on": "terms", 
    "columns": 0, 
@@ -2757,7 +2851,7 @@
  "istable": 0, 
  "max_attachments": 1, 
  "menu_index": 0, 
- "modified": "2017-11-15 01:01:16.774645", 
+ "modified": "2017-11-23 12:39:36.234663", 
  "modified_by": "Administrator", 
  "module": "Selling", 
  "name": "Quotation", 
diff --git a/erpnext/selling/doctype/quotation/test_quotation.py b/erpnext/selling/doctype/quotation/test_quotation.py
index d7d84c7..e79d46a 100644
--- a/erpnext/selling/doctype/quotation/test_quotation.py
+++ b/erpnext/selling/doctype/quotation/test_quotation.py
@@ -8,7 +8,29 @@
 
 test_dependencies = ["Product Bundle"]
 
+
 class TestQuotation(unittest.TestCase):
+	def test_make_quotation_without_terms(self):
+		quotation = make_quotation(do_not_save=1)
+		self.assertFalse(quotation.get('payment_schedule'))
+
+		quotation.insert()
+
+		self.assertTrue(quotation.payment_schedule)
+
+	def test_make_sales_order_terms_not_copied(self):
+		from erpnext.selling.doctype.quotation.quotation import make_sales_order
+
+		quotation = frappe.copy_doc(test_records[0])
+		quotation.transaction_date = nowdate()
+		quotation.valid_till = add_months(quotation.transaction_date, 1)
+		quotation.insert()
+		quotation.submit()
+
+		sales_order = make_sales_order(quotation.name)
+
+		self.assertFalse(sales_order.get('payment_schedule'))
+
 	def test_make_sales_order(self):
 		from erpnext.selling.doctype.quotation.quotation import make_sales_order
 
@@ -33,6 +55,46 @@
 		sales_order.transaction_date = nowdate()
 		sales_order.insert()
 
+	def test_make_sales_order_with_terms(self):
+		from erpnext.selling.doctype.quotation.quotation import make_sales_order
+
+		quotation = frappe.copy_doc(test_records[0])
+		quotation.transaction_date = nowdate()
+		quotation.valid_till = add_months(quotation.transaction_date, 1)
+		quotation.update(
+			{"payment_terms_template": "_Test Payment Term Template"}
+		)
+		quotation.insert()
+
+		self.assertRaises(frappe.ValidationError, make_sales_order, quotation.name)
+		quotation.save()
+		quotation.submit()
+
+		self.assertEqual(quotation.payment_schedule[0].payment_amount, 8906.00)
+		self.assertEqual(quotation.payment_schedule[0].due_date, quotation.transaction_date)
+		self.assertEqual(quotation.payment_schedule[1].payment_amount, 8906.00)
+		self.assertEqual(quotation.payment_schedule[1].due_date, add_days(quotation.transaction_date, 30))
+
+		sales_order = make_sales_order(quotation.name)
+
+		self.assertEquals(sales_order.doctype, "Sales Order")
+		self.assertEquals(len(sales_order.get("items")), 1)
+		self.assertEquals(sales_order.get("items")[0].doctype, "Sales Order Item")
+		self.assertEquals(sales_order.get("items")[0].prevdoc_docname, quotation.name)
+		self.assertEquals(sales_order.customer, "_Test Customer")
+
+		sales_order.delivery_date = "2014-01-01"
+		sales_order.naming_series = "_T-Quotation-"
+		sales_order.transaction_date = nowdate()
+		sales_order.insert()
+
+		self.assertEqual(sales_order.payment_schedule[0].payment_amount, 8906.00)
+		self.assertEqual(sales_order.payment_schedule[0].due_date, quotation.transaction_date)
+		self.assertEqual(sales_order.payment_schedule[1].payment_amount, 8906.00)
+		self.assertEqual(
+			sales_order.payment_schedule[1].due_date, add_days(quotation.transaction_date, 30)
+		)
+
 	def test_valid_till(self):
 		from erpnext.selling.doctype.quotation.quotation import make_sales_order
 
diff --git a/erpnext/selling/doctype/quotation/tests/test_quotation.js b/erpnext/selling/doctype/quotation/tests/test_quotation.js
index 1683fa5..d69d799 100644
--- a/erpnext/selling/doctype/quotation/tests/test_quotation.js
+++ b/erpnext/selling/doctype/quotation/tests/test_quotation.js
@@ -1,5 +1,5 @@
 QUnit.test("test: quotation", function (assert) {
-	assert.expect(10);
+	assert.expect(12);
 	let done = assert.async();
 	frappe.run_serially([
 		() => {
@@ -10,7 +10,8 @@
 						{"item_code": "Test Product 1"},
 						{"qty": 5}
 					]]
-				}
+				},
+				{payment_terms_template: '_Test Payment Term Template UI'}
 			]);
 		},
 		() => {
@@ -18,7 +19,7 @@
 			assert.ok(cur_frm.doc.items[0].item_name == "Test Product 1", "Added Test Product 1");
 
 			// calculate_taxes_and_totals
-			assert.ok(cur_frm.doc.grand_total === 500, "Total Amount is correct");
+			assert.ok(cur_frm.doc.grand_total === 500, String(cur_frm.doc.grand_total));
 		},
 		() => cur_frm.set_value("customer_address", "Test1-Billing"),
 		() => cur_frm.set_value("shipping_address_name", "Test1-Warehouse"),
@@ -30,6 +31,7 @@
 		() => cur_frm.doc.items[0].rate = 200,
 		() => frappe.timeout(0.3),
 		() => cur_frm.set_value("tc_name", "Test Term 1"),
+		() => cur_frm.set_value("payment_schedule", []),
 		() => frappe.timeout(0.5),
 		() => cur_frm.save(),
 		() => {
@@ -47,6 +49,9 @@
 			// Check Terms and Condtions
 			assert.ok(cur_frm.doc.tc_name == "Test Term 1", "Terms and Conditions Checked");
 
+			assert.ok(cur_frm.doc.payment_terms_template, "Payment Terms Template is correct");
+			assert.ok(cur_frm.doc.payment_schedule.length > 0, "Payment Term Schedule is not empty");
+
 		},
 		() => done()
 	]);
diff --git a/erpnext/selling/doctype/quotation/tests/test_quotation_with_discount_on_grand_total.js b/erpnext/selling/doctype/quotation/tests/test_quotation_with_discount_on_grand_total.js
index b7b5a47..aeb5d1b 100644
--- a/erpnext/selling/doctype/quotation/tests/test_quotation_with_discount_on_grand_total.js
+++ b/erpnext/selling/doctype/quotation/tests/test_quotation_with_discount_on_grand_total.js
@@ -16,13 +16,15 @@
 				]},
 				{customer_address: 'Test1-Billing'},
 				{shipping_address_name: 'Test1-Shipping'},
-				{contact_person: 'Contact 1-Test Customer 1'}
+				{contact_person: 'Contact 1-Test Customer 1'},
+				{payment_terms_template: '_Test Payment Term Template UI'}
 			]);
 		},
 		() => {
 			return frappe.tests.set_form_values(cur_frm, [
 				{apply_discount_on:'Grand Total'},
-				{additional_discount_percentage:10}
+				{additional_discount_percentage:10},
+				{payment_schedule: []}
 			]);
 		},
 		() => cur_frm.save(),
diff --git a/erpnext/selling/doctype/sales_order/sales_order.json b/erpnext/selling/doctype/sales_order/sales_order.json
index 86d042b..acd6279 100644
--- a/erpnext/selling/doctype/sales_order/sales_order.json
+++ b/erpnext/selling/doctype/sales_order/sales_order.json
@@ -2319,10 +2319,9 @@
    "label": "Packed Items", 
    "length": 0, 
    "no_copy": 0, 
-   "oldfieldname": "packing_details", 
-   "oldfieldtype": "Table", 
    "options": "Packed Item", 
    "permlevel": 0, 
+   "precision": "", 
    "print_hide": 1, 
    "print_hide_if_no_value": 0, 
    "read_only": 1, 
@@ -2337,6 +2336,99 @@
    "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
+   "collapsible": 0, 
+   "collapsible_depends_on": "", 
+   "columns": 0, 
+   "fieldname": "payment_schedule_section", 
+   "fieldtype": "Section Break", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "ignore_xss_filter": 0, 
+   "in_filter": 0, 
+   "in_global_search": 0, 
+   "in_list_view": 0, 
+   "in_standard_filter": 0, 
+   "label": "Payment Terms", 
+   "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_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "fieldname": "payment_terms_template", 
+   "fieldtype": "Link", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "ignore_xss_filter": 0, 
+   "in_filter": 0, 
+   "in_global_search": 0, 
+   "in_list_view": 0, 
+   "in_standard_filter": 0, 
+   "label": "Payment Terms Template", 
+   "length": 0, 
+   "no_copy": 0, 
+   "options": "Payment Terms Template", 
+   "permlevel": 0, 
+   "precision": "", 
+   "print_hide": 1, 
+   "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_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "fieldname": "payment_schedule", 
+   "fieldtype": "Table", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "ignore_xss_filter": 0, 
+   "in_filter": 0, 
+   "in_global_search": 0, 
+   "in_list_view": 0, 
+   "in_standard_filter": 0, 
+   "label": "Payment Schedule", 
+   "length": 0, 
+   "no_copy": 1, 
+   "options": "Payment Schedule", 
+   "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_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
    "collapsible": 1, 
    "collapsible_depends_on": "terms", 
    "columns": 0, 
@@ -3407,7 +3499,7 @@
  "issingle": 0, 
  "istable": 0, 
  "max_attachments": 0, 
- "modified": "2017-11-15 01:02:08.674118", 
+ "modified": "2017-11-23 12:39:24.362238", 
  "modified_by": "Administrator", 
  "module": "Selling", 
  "name": "Sales Order", 
diff --git a/erpnext/selling/doctype/sales_order/sales_order.py b/erpnext/selling/doctype/sales_order/sales_order.py
index a70fad1..c9e7733 100644
--- a/erpnext/selling/doctype/sales_order/sales_order.py
+++ b/erpnext/selling/doctype/sales_order/sales_order.py
@@ -14,6 +14,7 @@
 from frappe.contacts.doctype.address.address import get_company_address
 from erpnext.controllers.selling_controller import SellingController
 from erpnext.accounts.doctype.subscription.subscription import get_next_schedule_date
+from erpnext.selling.doctype.customer.customer import check_credit_limit
 
 form_grid_templates = {
 	"items": "templates/form_grid/item_grid.html"
@@ -103,7 +104,7 @@
 	def validate_delivery_date(self):
 		if self.order_type == 'Sales':
 			if not self.delivery_date:
-				self.delivery_date = max([d.delivery_date for d in self.get("items")])
+				self.delivery_date = max([d.delivery_date for d in self.get("items") if d.delivery_date])
 
 			if self.delivery_date:
 				for d in self.get("items"):
@@ -188,49 +189,68 @@
 	def update_project(self):
 		project_list = []
 		if self.project:
-				project = frappe.get_doc("Project", self.project)
-				project.flags.dont_sync_tasks = True
-				project.update_sales_costing()
-				project.save()
-				project_list.append(self.project)
+			project = frappe.get_doc("Project", self.project)
+			project.flags.dont_sync_tasks = True
+			project.update_sales_costing()
+			project.save()
+			project_list.append(self.project)
 
 	def check_credit_limit(self):
-		from erpnext.selling.doctype.customer.customer import check_credit_limit
-		check_credit_limit(self.customer, self.company)
+		# if bypass credit limit check is set to true (1) at sales order level,
+		# then we need not to check credit limit and vise versa
+		if not cint(frappe.db.get_value("Customer", self.customer, "bypass_credit_limit_check_at_sales_order")):
+			check_credit_limit(self.customer, self.company)
 
 	def check_nextdoc_docstatus(self):
 		# Checks Delivery Note
-		submit_dn = frappe.db.sql_list("""select t1.name from `tabDelivery Note` t1,`tabDelivery Note Item` t2
+		submit_dn = frappe.db.sql_list("""
+			select t1.name
+			from `tabDelivery Note` t1,`tabDelivery Note Item` t2
 			where t1.name = t2.parent and t2.against_sales_order = %s and t1.docstatus = 1""", self.name)
+
 		if submit_dn:
-			frappe.throw(_("Delivery Notes {0} must be cancelled before cancelling this Sales Order").format(comma_and(submit_dn)))
+			frappe.throw(_("Delivery Notes {0} must be cancelled before cancelling this Sales Order")
+				.format(comma_and(submit_dn)))
 
 		# Checks Sales Invoice
 		submit_rv = frappe.db.sql_list("""select t1.name
 			from `tabSales Invoice` t1,`tabSales Invoice Item` t2
 			where t1.name = t2.parent and t2.sales_order = %s and t1.docstatus = 1""",
 			self.name)
+
 		if submit_rv:
-			frappe.throw(_("Sales Invoice {0} must be cancelled before cancelling this Sales Order").format(comma_and(submit_rv)))
+			frappe.throw(_("Sales Invoice {0} must be cancelled before cancelling this Sales Order")
+				.format(comma_and(submit_rv)))
 
 		#check maintenance schedule
-		submit_ms = frappe.db.sql_list("""select t1.name from `tabMaintenance Schedule` t1,
-			`tabMaintenance Schedule Item` t2
+		submit_ms = frappe.db.sql_list("""
+			select t1.name
+			from `tabMaintenance Schedule` t1, `tabMaintenance Schedule Item` t2
 			where t2.parent=t1.name and t2.sales_order = %s and t1.docstatus = 1""", self.name)
+
 		if submit_ms:
-			frappe.throw(_("Maintenance Schedule {0} must be cancelled before cancelling this Sales Order").format(comma_and(submit_ms)))
+			frappe.throw(_("Maintenance Schedule {0} must be cancelled before cancelling this Sales Order")
+				.format(comma_and(submit_ms)))
 
 		# check maintenance visit
-		submit_mv = frappe.db.sql_list("""select t1.name from `tabMaintenance Visit` t1, `tabMaintenance Visit Purpose` t2
+		submit_mv = frappe.db.sql_list("""
+			select t1.name
+			from `tabMaintenance Visit` t1, `tabMaintenance Visit Purpose` t2
 			where t2.parent=t1.name and t2.prevdoc_docname = %s and t1.docstatus = 1""",self.name)
+
 		if submit_mv:
-			frappe.throw(_("Maintenance Visit {0} must be cancelled before cancelling this Sales Order").format(comma_and(submit_mv)))
+			frappe.throw(_("Maintenance Visit {0} must be cancelled before cancelling this Sales Order")
+				.format(comma_and(submit_mv)))
 
 		# check production order
-		pro_order = frappe.db.sql_list("""select name from `tabProduction Order`
+		pro_order = frappe.db.sql_list("""
+			select name
+			from `tabProduction Order`
 			where sales_order = %s and docstatus = 1""", self.name)
+
 		if pro_order:
-			frappe.throw(_("Production Order {0} must be cancelled before cancelling this Sales Order").format(comma_and(pro_order)))
+			frappe.throw(_("Production Order {0} must be cancelled before cancelling this Sales Order")
+				.format(comma_and(pro_order)))
 
 	def check_modified_date(self):
 		mod_db = frappe.db.get_value("Sales Order", self.name, "modified")
@@ -464,6 +484,11 @@
 			else:
 				target.po_no = source.po_no
 
+		# Since the credit limit check is bypassed at sales order level,
+		# we need to check it at delivery note
+		if cint(frappe.db.get_value("Customer", source.customer, "bypass_credit_limit_check_at_sales_order")):
+			check_credit_limit(source.customer, source.company)
+
 		target.ignore_pricing_rule = 1
 		target.run_method("set_missing_values")
 		target.run_method("calculate_taxes_and_totals")
@@ -528,6 +553,10 @@
 		target.run_method("set_missing_values")
 		target.run_method("calculate_taxes_and_totals")
 
+		# Since the credit limit check is bypassed at sales order level, we need to check it at sales invoice
+		if cint(frappe.db.get_value("Customer", source.customer, "bypass_credit_limit_check_at_sales_order")):
+			check_credit_limit(source.customer, source.company)
+
 		# set company address
 		target.update(get_company_address(target.company))
 		if target.company_address:
@@ -791,4 +820,4 @@
 			order_by='is_default desc')
 	bom = bom[0].name if bom else None
 
-	return bom
+	return bom
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/asset/test_asset.js b/erpnext/selling/doctype/sales_order/test_sales_order.js
similarity index 67%
copy from erpnext/accounts/doctype/asset/test_asset.js
copy to erpnext/selling/doctype/sales_order/test_sales_order.js
index 6119e38..57ed19b 100644
--- a/erpnext/accounts/doctype/asset/test_asset.js
+++ b/erpnext/selling/doctype/sales_order/test_sales_order.js
@@ -2,15 +2,15 @@
 // rename this file from _test_[name] to test_[name] to activate
 // and remove above this line
 
-QUnit.test("test: Asset", function (assert) {
+QUnit.test("test: Sales Order", function (assert) {
 	let done = assert.async();
 
 	// number of asserts
 	assert.expect(1);
 
-	frappe.run_serially([
-		// insert a new Asset
-		() => frappe.tests.make('Asset', [
+	frappe.run_serially('Sales Order', [
+		// insert a new Sales Order
+		() => frappe.tests.make([
 			// values to be set
 			{key: 'value'}
 		]),
diff --git a/erpnext/selling/doctype/sales_order/test_sales_order.py b/erpnext/selling/doctype/sales_order/test_sales_order.py
index da600fb..f829961 100644
--- a/erpnext/selling/doctype/sales_order/test_sales_order.py
+++ b/erpnext/selling/doctype/sales_order/test_sales_order.py
@@ -13,6 +13,7 @@
 from erpnext.selling.doctype.sales_order.sales_order import make_production_orders
 import json
 
+
 class TestSalesOrder(unittest.TestCase):
 	def tearDown(self):
 		frappe.set_user("Administrator")
@@ -60,6 +61,32 @@
 		si1 = make_sales_invoice(so.name)
 		self.assertEquals(len(si1.get("items")), 0)
 
+	def test_make_sales_invoice_with_terms(self):
+		so = make_sales_order(do_not_submit=True)
+
+		self.assertRaises(frappe.ValidationError, make_sales_invoice, so.name)
+
+		so.update({"payment_terms_template": "_Test Payment Term Template"})
+
+		so.save()
+		so.submit()
+		si = make_sales_invoice(so.name)
+
+		self.assertEquals(len(si.get("items")), len(so.get("items")))
+		self.assertEquals(len(si.get("items")), 1)
+
+		si.insert()
+
+		self.assertEqual(si.payment_schedule[0].payment_amount, 500.0)
+		self.assertEqual(si.payment_schedule[0].due_date, so.transaction_date)
+		self.assertEqual(si.payment_schedule[1].payment_amount, 500.0)
+		self.assertEqual(si.payment_schedule[1].due_date, add_days(so.transaction_date, 30))
+
+		si.submit()
+
+		si1 = make_sales_invoice(so.name)
+		self.assertEquals(len(si1.get("items")), 0)
+
 	def test_update_qty(self):
 		so = make_sales_order()
 
@@ -125,7 +152,6 @@
 		so = make_sales_order()
 		self.assertEqual(get_reserved_qty(), existing_reserved_qty + 10)
 
-
 		dn = create_dn_against_so(so.name, 15)
 		self.assertEqual(get_reserved_qty(), existing_reserved_qty)
 
@@ -181,7 +207,6 @@
 		make_stock_entry(target="_Test Warehouse - _TC", qty=10, rate=100)
 		make_stock_entry(item="_Test Item Home Desktop 100", target="_Test Warehouse - _TC", qty=10, rate=100)
 
-
 		existing_reserved_qty_item1 = get_reserved_qty("_Test Item")
 		existing_reserved_qty_item2 = get_reserved_qty("_Test Item Home Desktop 100")
 
@@ -503,10 +528,39 @@
 
 		self.assertEquals(new_so.get("items")[0].rate, flt((price_list_rate*25)/100 + price_list_rate))
 		new_so.items[0].margin_rate_or_amount = 25
+		new_so.payment_schedule = []
+		new_so.save()
 		new_so.submit()
 
 		self.assertEquals(new_so.get("items")[0].rate, flt((price_list_rate*25)/100 + price_list_rate))
 
+	def test_terms_auto_added(self):
+		so = make_sales_order(do_not_save=1)
+
+		self.assertFalse(so.get('payment_schedule'))
+
+		so.insert()
+
+		self.assertTrue(so.get('payment_schedule'))
+
+	def test_terms_not_copied(self):
+		so = make_sales_order()
+		self.assertTrue(so.get('payment_schedule'))
+
+		si = make_sales_invoice(so.name)
+		self.assertFalse(si.get('payment_schedule'))
+
+	def test_terms_copied(self):
+		so = make_sales_order(do_not_copy=1, do_not_save=1)
+		so.payment_terms_template = '_Test Payment Term Template'
+		so.insert()
+		so.submit()
+		self.assertTrue(so.get('payment_schedule'))
+
+		si = make_sales_invoice(so.name)
+		si.insert()
+		self.assertTrue(si.get('payment_schedule'))
+
 	def test_make_production_order(self):
 		# Make a new Sales Order
 		so = make_sales_order(**{
@@ -575,6 +629,10 @@
 		so.insert()
 		if not args.do_not_submit:
 			so.submit()
+		else:
+			so.payment_schedule = []
+	else:
+		so.payment_schedule = []
 
 	return so
 
diff --git a/erpnext/selling/doctype/sales_order/tests/test_sales_order.js b/erpnext/selling/doctype/sales_order/tests/test_sales_order.js
index daa8131..939261c 100644
--- a/erpnext/selling/doctype/sales_order/tests/test_sales_order.js
+++ b/erpnext/selling/doctype/sales_order/tests/test_sales_order.js
@@ -1,7 +1,7 @@
 QUnit.module('Sales Order');
 
 QUnit.test("test sales order", function(assert) {
-	assert.expect(10);
+	assert.expect(12);
 	let done = assert.async();
 	frappe.run_serially([
 		() => {
@@ -19,7 +19,8 @@
 				{contact_person: 'Contact 1-Test Customer 1'},
 				{taxes_and_charges: 'TEST In State GST'},
 				{tc_name: 'Test Term 1'},
-				{terms: 'This is Test'}
+				{terms: 'This is Test'},
+				{payment_terms_template: '_Test Payment Term Template UI'}
 			]);
 		},
 		() => {
@@ -28,7 +29,7 @@
 				{currency: 'USD'}
 			]);
 		},
-		() => frappe.timeout(1),
+		() => frappe.timeout(1.5),
 		() => {
 			// get_item_details
 			assert.ok(cur_frm.doc.items[0].item_name=='Test Product 3', "Item name correct");
@@ -36,18 +37,24 @@
 			assert.ok(cur_frm.doc.taxes_and_charges=='TEST In State GST', "Tax details correct");
 			// get tax account head details
 			assert.ok(cur_frm.doc.taxes[0].account_head=='CGST - '+frappe.get_abbr(frappe.defaults.get_default('Company')), " Account Head abbr correct");
-			// calculate totals
-			assert.ok(cur_frm.doc.items[0].price_list_rate==250, "Item 1 price_list_rate");
-			assert.ok(cur_frm.doc.net_total== 1280.75, "net total correct ");
-			assert.ok(cur_frm.doc.base_grand_total== flt(1511.29* cur_frm.doc.conversion_rate, precision('base_grand_total')), "base round total correct ");
-			assert.ok(cur_frm.doc.grand_total== 1511.29 , "grand total correct ");
-			assert.ok(cur_frm.doc.rounded_total== 1511.30, "rounded total correct ");
 		},
 		() => cur_frm.save(),
 		() => frappe.timeout(1),
 		() => cur_frm.print_doc(),
 		() => frappe.timeout(1),
 		() => {
+			// Payment Terms
+			assert.ok(cur_frm.doc.payment_terms_template, "Payment Terms Template is correct");
+			assert.ok(cur_frm.doc.payment_schedule.length > 0, "Payment Term Schedule is not empty");
+
+			// totals
+			assert.ok(cur_frm.doc.items[0].price_list_rate==250, "Item 1 price_list_rate");
+			assert.ok(cur_frm.doc.net_total== 1280.75, "net total correct ");
+			assert.ok(cur_frm.doc.base_grand_total== flt(1511.29* cur_frm.doc.conversion_rate, precision('base_grand_total')), String(flt(1511.29* cur_frm.doc.conversion_rate, precision('base_grand_total')) + ' ' + cur_frm.doc.base_grand_total));
+			assert.ok(cur_frm.doc.grand_total== 1511.29 , "grand total correct ");
+			assert.ok(cur_frm.doc.rounded_total== 1511.30, "rounded total correct ");
+
+			// print format
 			assert.ok($('.btn-print-print').is(':visible'), "Print Format Available");
 			frappe.timeout(1);
 			assert.ok($(".section-break+ .section-break .column-break:nth-child(1) .data-field:nth-child(1) .value").text().includes("Billing Street 1"), "Print Preview Works As Expected");
diff --git a/erpnext/selling/doctype/sales_order/tests/test_sales_order_with_bypass_credit_limit_check.js b/erpnext/selling/doctype/sales_order/tests/test_sales_order_with_bypass_credit_limit_check.js
new file mode 100644
index 0000000..3ffb825
--- /dev/null
+++ b/erpnext/selling/doctype/sales_order/tests/test_sales_order_with_bypass_credit_limit_check.js
@@ -0,0 +1,54 @@
+QUnit.module('Sales Order');
+
+QUnit.test("test_sales_order_with_bypass_credit_limit_check", function(assert) {
+//#PR : 10861, Author : ashish-greycube & jigneshpshah,  Email:mr.ashish.shah@gmail.com 
+	assert.expect(2);
+	let done = assert.async();
+	frappe.run_serially([
+		() => frappe.new_doc('Customer'),
+		() => frappe.timeout(1),
+		() => frappe.click_link('Edit in full page'),
+		() => cur_frm.set_value("customer_name", "Test Customer 10"),
+		() => cur_frm.set_value("credit_limit", 100.00),
+		() => cur_frm.set_value("bypass_credit_limit_check_at_sales_order", 1),
+		// save form
+		() => cur_frm.save(),
+		() => frappe.timeout(1),
+
+		() => frappe.new_doc('Item'),
+		() => frappe.timeout(1),
+		() => frappe.click_link('Edit in full page'),
+		() => cur_frm.set_value("item_code", "Test Product 10"),
+		() => cur_frm.set_value("item_group", "Products"),
+		() => cur_frm.set_value("standard_rate", 100),	
+		// save form
+		() => cur_frm.save(),
+		() => frappe.timeout(1),		
+
+		() => {
+			return frappe.tests.make('Sales Order', [
+				{customer: 'Test Customer 5'},
+				{items: [
+					[
+						{'delivery_date': frappe.datetime.add_days(frappe.defaults.get_default("year_end_date"), 1)},
+						{'qty': 5},
+						{'item_code': 'Test Product 10'},
+					]
+				]}
+
+			]);
+		},
+		() => cur_frm.save(),
+		() => frappe.tests.click_button('Submit'),
+		() => assert.equal("Confirm", cur_dialog.title,'confirmation for submit'),
+		() => frappe.tests.click_button('Yes'),
+		() => frappe.timeout(3),
+		() => {
+			
+			assert.ok(cur_frm.doc.status=="To Deliver and Bill", "It is submited. Credit limit is NOT checked for sales order");
+
+
+		},		
+		() => done()
+	]);
+});
diff --git a/erpnext/selling/doctype/sales_order/tests/test_sales_order_with_discount_on_grand_total.js b/erpnext/selling/doctype/sales_order/tests/test_sales_order_with_discount_on_grand_total.js
index 3247c85..de61a61 100644
--- a/erpnext/selling/doctype/sales_order/tests/test_sales_order_with_discount_on_grand_total.js
+++ b/erpnext/selling/doctype/sales_order/tests/test_sales_order_with_discount_on_grand_total.js
@@ -16,13 +16,15 @@
 				]},
 				{customer_address: 'Test1-Billing'},
 				{shipping_address_name: 'Test1-Shipping'},
-				{contact_person: 'Contact 1-Test Customer 1'}
+				{contact_person: 'Contact 1-Test Customer 1'},
+				{payment_terms_template: '_Test Payment Term Template UI'}
 			]);
 		},
 		() => {
 			return frappe.tests.set_form_values(cur_frm, [
 				{apply_discount_on:'Grand Total'},
-				{additional_discount_percentage:10}
+				{additional_discount_percentage:10},
+				{payment_schedule: []}
 			]);
 		},
 		() => cur_frm.save(),
diff --git a/erpnext/selling/doctype/sales_order/tests/test_sales_order_with_item_wise_discount.js b/erpnext/selling/doctype/sales_order/tests/test_sales_order_with_item_wise_discount.js
index c745374..2c48108 100644
--- a/erpnext/selling/doctype/sales_order/tests/test_sales_order_with_item_wise_discount.js
+++ b/erpnext/selling/doctype/sales_order/tests/test_sales_order_with_item_wise_discount.js
@@ -18,7 +18,8 @@
 				]},
 				{customer_address: 'Test1-Billing'},
 				{shipping_address_name: 'Test1-Shipping'},
-				{contact_person: 'Contact 1-Test Customer 1'}
+				{contact_person: 'Contact 1-Test Customer 1'},
+				{payment_terms_template: '_Test Payment Term Template UI'}
 			]);
 		},
 		() => cur_frm.save(),
diff --git a/erpnext/selling/doctype/sales_order/tests/test_sales_order_without_bypass_credit_limit_check.js b/erpnext/selling/doctype/sales_order/tests/test_sales_order_without_bypass_credit_limit_check.js
new file mode 100644
index 0000000..ea15edc
--- /dev/null
+++ b/erpnext/selling/doctype/sales_order/tests/test_sales_order_without_bypass_credit_limit_check.js
@@ -0,0 +1,59 @@
+QUnit.module('Sales Order');
+
+QUnit.test("test_sales_order_without_bypass_credit_limit_check", function(assert) {
+//#PR : 10861, Author : ashish-greycube & jigneshpshah,  Email:mr.ashish.shah@gmail.com 
+	assert.expect(2);
+	let done = assert.async();
+	frappe.run_serially([
+		() => frappe.new_doc('Customer'),
+		() => frappe.timeout(1),
+		() => frappe.click_link('Edit in full page'),
+		() => cur_frm.set_value("customer_name", "Test Customer 11"),
+		() => cur_frm.set_value("credit_limit", 100.00),
+		() => cur_frm.set_value("bypass_credit_limit_check_at_sales_order", 0),
+		// save form
+		() => cur_frm.save(),
+		() => frappe.timeout(1),
+
+		() => frappe.new_doc('Item'),
+		() => frappe.timeout(1),
+		() => frappe.click_link('Edit in full page'),
+		() => cur_frm.set_value("item_code", "Test Product 11"),
+		() => cur_frm.set_value("item_group", "Products"),
+		() => cur_frm.set_value("standard_rate", 100),	
+		// save form
+		() => cur_frm.save(),
+		() => frappe.timeout(1),		
+
+		() => {
+			return frappe.tests.make('Sales Order', [
+				{customer: 'Test Customer 11'},
+				{items: [
+					[
+						{'delivery_date': frappe.datetime.add_days(frappe.defaults.get_default("year_end_date"), 1)},
+						{'qty': 5},
+						{'item_code': 'Test Product 11'},
+					]
+				]}
+
+			]);
+		},
+		() => cur_frm.save(),
+		() => frappe.tests.click_button('Submit'),
+		() => assert.equal("Confirm", cur_dialog.title,'confirmation for submit'),
+		() => frappe.tests.click_button('Yes'),
+		() => frappe.timeout(3),
+		() => {
+		
+			if (cur_dialog.body.innerText.match(/^Credit limit has been crossed for customer.*$/)) 
+				{ 
+    				/*Match found */
+    				assert.ok(true, "Credit Limit crossed message received");
+				}
+			
+	
+		},
+		() => cur_dialog.cancel(),
+		() => done()
+	]);
+});
diff --git a/erpnext/selling/page/point_of_sale/point_of_sale.js b/erpnext/selling/page/point_of_sale/point_of_sale.js
index c7732f6..fb30235 100644
--- a/erpnext/selling/page/point_of_sale/point_of_sale.js
+++ b/erpnext/selling/page/point_of_sale/point_of_sale.js
@@ -50,12 +50,9 @@
 				this.set_online_status();
 			},
 			() => this.setup_company(),
-			() => this.setup_pos_profile(),
+
 			() => this.make_new_invoice(),
 			() => {
-				frappe.timeout(1);
-				this.make_items();
-				this.set_pos_profile_data();
 				frappe.dom.unfreeze();
 			},
 			() => this.page.set_title(__('Point of Sale'))
@@ -93,7 +90,6 @@
 		this.cart = new POSCart({
 			frm: this.frm,
 			wrapper: this.wrapper.find('.cart-container'),
-			pos_profile: this.pos_profile,
 			events: {
 				on_customer_change: (customer) => this.frm.set_value('customer', customer),
 				on_field_change: (item_code, field, value) => {
@@ -144,7 +140,7 @@
 	make_items() {
 		this.items = new POSItems({
 			wrapper: this.wrapper.find('.item-container'),
-			pos_profile: this.pos_profile,
+			frm: this.frm,
 			events: {
 				update_cart: (item, field, value) => {
 					if(!this.frm.doc.customer) {
@@ -295,74 +291,62 @@
 		})
 	}
 
-	set_pos_profile_data() {
-		if (this.pos_profile && this.pos_profile.print_format_for_online) {
-			this.frm.meta.default_print_format = this.pos_profile.print_format_for_online;
-		}
-	}
-
-	setup_pos_profile() {
+	change_pos_profile() {
 		return new Promise((resolve) => {
-
-			const load_default = () => {
-				this.pos_profile = {
-					company: this.company,
-					currency: frappe.defaults.get_default('currency'),
-					selling_price_list: frappe.defaults.get_default('selling_price_list')
-				};
-				resolve();
-			}
-
-			const on_submit = ({ pos_profile }) => {
-				this.get_pos_profile_doc(pos_profile)
-					.then(doc => {
-						this.pos_profile = doc;
-						if (!this.pos_profile) {
-							load_default();
-						}
-						resolve();
-					});
-			}
-
-			frappe.call({
-				method: 'erpnext.accounts.doctype.pos_profile.pos_profile.get_pos_profiles_for_user'
-			}).then((r) => {
-				if (r && r.message) {
-					const pos_profiles = r.message.filter(a => a);
-
-					if (pos_profiles.length === 0) {
-						load_default();
-					} else if(pos_profiles.length === 1) {
-						// load profile directly
-						on_submit({pos_profile: pos_profiles[0]});
-					} else {
-						// ask prompt
-						frappe.prompt(
-							[{ fieldtype: 'Select', label: 'POS Profile', options: pos_profiles }],
-							on_submit,
-							__('Select POS Profile')
-						);
-					}
-				} else {
-					frappe.dom.unfreeze();
-					frappe.throw(__("POS Profile is required to use Point-of-Sale"));
+			const on_submit = ({ pos_profile, set_as_default }) => {
+				if (pos_profile) {
+					this.frm.doc.pos_profile = pos_profile;
 				}
-			});
+
+				if (set_as_default) {
+					frappe.call({
+						method: "erpnext.accounts.doctype.pos_profile.pos_profile.set_default_profile",
+						args: {
+							'pos_profile': pos_profile,
+							'company': this.frm.doc.company
+						}
+					}).then(() => {
+						this.on_change_pos_profile();
+					});
+				} else {
+					this.on_change_pos_profile();
+				}
+			}
+
+			frappe.prompt(this.get_promopt_fields(),
+				on_submit,
+				__('Select POS Profile')
+			);
 		});
 	}
 
-	get_pos_profile_doc(pos_profile_name) {
-		return new Promise(resolve => {
-			frappe.call({
-				method: 'erpnext.accounts.doctype.pos_profile.pos_profile.get_pos_profile',
-				args: {
-					pos_profile_name
-				},
-				callback: (r) => {
-					resolve(r.message);
+	on_change_pos_profile() {
+		this.set_pos_profile_data()
+			.then(() => {
+				this.reset_cart();
+				if (this.items) {
+					this.items.reset_items();
 				}
 			});
-		});
+	}
+
+	get_promopt_fields() {
+		return [{
+			fieldtype: 'Link',
+			label: __('POS Profile'),
+			options: 'POS Profile',
+			get_query: () => {
+				return {
+					query: 'erpnext.accounts.doctype.pos_profile.pos_profile.pos_profile_query',
+					filters: {
+						company: this.frm.doc.company
+					}
+				};
+			}
+		}, {
+			fieldtype: 'Check',
+			label: __('Set as default')
+		}];
 	}
 
 	setup_company() {
@@ -382,49 +366,75 @@
 
 	make_new_invoice() {
 		return frappe.run_serially([
-			() => this.make_sales_invoice_frm(),
 			() => {
-				if (this.cart) {
-					this.cart.frm = this.frm;
-					this.cart.reset();
-					this.items.reset_search_field();
-				} else {
-					this.make_cart();
-				}
-				this.toggle_editing(true);
-			}
+				this.make_sales_invoice_frm()
+					.then(() => this.set_pos_profile_data())
+					.then(() => {
+						if (this.cart) {
+							this.reset_cart();
+						} else {
+							this.make_items();
+							this.make_cart();
+						}
+						this.toggle_editing(true);
+					})
+			},
 		]);
 	}
 
+	reset_cart() {
+		this.cart.frm = this.frm;
+		this.cart.reset();
+		this.items.reset_search_field();
+	}
+
 	make_sales_invoice_frm() {
 		const doctype = 'Sales Invoice';
 		return new Promise(resolve => {
 			if (this.frm) {
-				this.frm = get_frm(this.pos_profile, this.frm);
+				this.frm = get_frm(this.frm);
 				resolve();
 			} else {
 				frappe.model.with_doctype(doctype, () => {
-					this.frm = get_frm(this.pos_profile);
+					this.frm = get_frm();
 					resolve();
 				});
 			}
 		});
 
-		function get_frm(pos_profile, _frm) {
+		function get_frm(_frm) {
 			const page = $('<div>');
 			const frm = _frm || new _f.Frm(doctype, page, false);
 			const name = frappe.model.make_new_doc_and_get_name(doctype, true);
 			frm.refresh(name);
 			frm.doc.items = [];
-			if(!frm.doc.company) {
-				frm.set_value('company', pos_profile.company);
-			}
-			frm.set_value('is_pos', 1);
-			frm.meta.default_print_format = 'POS Invoice';
+			frm.doc.is_pos = 1;
 			return frm;
 		}
 	}
 
+	set_pos_profile_data() {
+		return new Promise(resolve => {
+			return this.frm.call({
+				doc: this.frm.doc,
+				method: "set_missing_values",
+			}).then((r) => {
+				if(!r.exc) {
+					if (!this.frm.doc.pos_profile) {
+						frappe.dom.unfreeze();
+						frappe.throw(__("POS Profile is required to use Point-of-Sale"));
+					}
+					this.frm.script_manager.trigger("update_stock");
+					frappe.model.set_default_values(this.frm.doc);
+					this.frm.cscript.calculate_taxes_and_totals();
+					this.frm.meta.default_print_format = r.message.print_format || 'POS Invoice';
+				}
+
+				resolve();
+			});
+		});
+	}
+
 	prepare_menu() {
 		var me = this;
 		this.page.clear_menu();
@@ -446,6 +456,10 @@
 		this.page.add_menu_item(__('POS Settings'), function() {
 			frappe.set_route('Form', 'POS Settings');
 		});
+
+		this.page.add_menu_item(__('Change POS Profile'), function() {
+			me.change_pos_profile();
+		});
 	}
 
 	set_form_action() {
@@ -466,12 +480,11 @@
 };
 
 class POSCart {
-	constructor({frm, wrapper, pos_profile, events}) {
+	constructor({frm, wrapper, events}) {
 		this.frm = frm;
 		this.item_data = {};
 		this.wrapper = wrapper;
 		this.events = events;
-		this.pos_profile = pos_profile;
 		this.make();
 		this.bind_events();
 	}
@@ -537,7 +550,7 @@
 		this.wrapper.find('.grand-total-value').text(
 			format_currency(this.frm.doc.grand_total, this.frm.currency));
 
-		const customer = this.frm.doc.customer || this.pos_profile.customer;
+		const customer = this.frm.doc.customer;
 		this.customer_field.set_value(customer);
 	}
 
@@ -625,7 +638,6 @@
 	}
 
 	make_customer_field() {
-		let customer = this.frm.doc.customer || this.pos_profile['customer'];
 		this.customer_field = frappe.ui.form.make_control({
 			df: {
 				fieldtype: 'Link',
@@ -641,9 +653,7 @@
 			render_input: true
 		});
 
-		if (customer) {
-			this.customer_field.set_value(customer);
-		}
+		this.customer_field.set_value(this.frm.doc.customer);
 	}
 
 	make_numpad() {
@@ -908,19 +918,22 @@
 }
 
 class POSItems {
-	constructor({wrapper, pos_profile, events}) {
+	constructor({wrapper, frm, events}) {
 		this.wrapper = wrapper;
-		this.pos_profile = pos_profile;
+		this.frm = frm;
 		this.items = {};
 		this.events = events;
-		this.currency = this.pos_profile.currency;
+		this.currency = this.frm.doc.currency;
 
 		this.make_dom();
 		this.make_fields();
 
 		this.init_clusterize();
 		this.bind_events();
+		this.load_items_data();
+	}
 
+	load_items_data() {
 		// bootstrap with 20 items
 		this.get_items()
 			.then(({ items }) => {
@@ -930,6 +943,12 @@
 			});
 	}
 
+	reset_items() {
+		this.wrapper.find('.pos-items').empty();
+		this.init_clusterize();
+		this.load_items_data();
+	}
+
 	make_dom() {
 		this.wrapper.html(`
 			<div class="fields">
@@ -1153,7 +1172,7 @@
 				args: {
 					start,
 					page_length,
-					'price_list': this.pos_profile.selling_price_list,
+					'price_list': this.frm.doc.selling_price_list,
 					item_group,
 					search_value
 				}
@@ -1321,6 +1340,16 @@
 		$(this.dialog.body).find('.input-with-feedback').focusin(function() {
 			me.numpad.reset_value();
 			me.fieldname = $(this).prop('dataset').fieldname;
+			if (me.frm.doc.outstanding_amount > 0 &&
+				!in_list(['write_off_amount', 'change_amount'], me.fieldname)) {
+				me.frm.doc.payments.forEach((data) => {
+					if (data.mode_of_payment == me.fieldname && !data.amount) {
+						me.dialog.set_value(me.fieldname,
+							me.frm.doc.outstanding_amount / me.frm.doc.conversion_rate);
+						return;
+					}
+				})
+			}
 		});
 	}
 
@@ -1460,4 +1489,4 @@
 		this.dialog.set_value("paid_amount", this.frm.doc.paid_amount);
 		this.dialog.set_value("outstanding_amount", this.frm.doc.outstanding_amount);
 	}
-}
+}
\ No newline at end of file
diff --git a/erpnext/selling/page/point_of_sale/tests/test_point_of_sale.js b/erpnext/selling/page/point_of_sale/tests/test_point_of_sale.js
index c70d076..79d1700 100644
--- a/erpnext/selling/page/point_of_sale/tests/test_point_of_sale.js
+++ b/erpnext/selling/page/point_of_sale/tests/test_point_of_sale.js
@@ -4,7 +4,7 @@
 
 	frappe.run_serially([
 		() => frappe.set_route('point-of-sale'),
-		() => frappe.timeout(2),
+		() => frappe.timeout(3),
 		() => frappe.set_control('customer', 'Test Customer 1'),
 		() => frappe.timeout(0.2),
 		() => cur_frm.set_value('customer', 'Test Customer 1'),
diff --git a/erpnext/selling/report/customer_credit_balance/customer_credit_balance.py b/erpnext/selling/report/customer_credit_balance/customer_credit_balance.py
index 9075c3f..ffa4180 100644
--- a/erpnext/selling/report/customer_credit_balance/customer_credit_balance.py
+++ b/erpnext/selling/report/customer_credit_balance/customer_credit_balance.py
@@ -19,14 +19,19 @@
 
 	for d in customer_list:
 		row = []
-		outstanding_amt = get_customer_outstanding(d.name, filters.get("company"))
-		credit_limit = get_credit_limit(d.name, filters.get("company"))
+
+		outstanding_amt = get_customer_outstanding(d.name, filters.get("company"),
+			ignore_outstanding_sales_order=d.bypass_credit_limit_check_at_sales_order)
+
+		credit_limit = get_credit_limit(d.name, filters.get("company"))		
+
 		bal = flt(credit_limit) - flt(outstanding_amt)
 
 		if customer_naming_type == "Naming Series":
-			row = [d.name, d.customer_name, credit_limit, outstanding_amt, bal]
+			row = [d.name, d.customer_name, credit_limit, outstanding_amt, bal,
+				d.bypass_credit_limit_check_at_sales_order]
 		else:
-			row = [d.name, credit_limit, outstanding_amt, bal]
+			row = [d.name, credit_limit, outstanding_amt, bal, d.bypass_credit_limit_check_at_sales_order]
 
 		if credit_limit:
 			data.append(row)
@@ -35,8 +40,11 @@
 
 def get_columns(customer_naming_type):
 	columns = [
-		_("Customer") + ":Link/Customer:120", _("Credit Limit") + ":Currency:120",
-		_("Outstanding Amt") + ":Currency:100", _("Credit Balance") + ":Currency:120"
+		_("Customer") + ":Link/Customer:120",
+		_("Credit Limit") + ":Currency:120",
+		_("Outstanding Amt") + ":Currency:100",
+		_("Credit Balance") + ":Currency:120",
+		_("Bypass credit check at Sales Order ") + ":Check:240"
 	]
 
 	if customer_naming_type == "Naming Series":
@@ -50,5 +58,6 @@
 	if filters.get("customer"):
 		conditions += " where name = %(customer)s"
 
-	return frappe.db.sql("""select name, customer_name from `tabCustomer` %s""" 
-		% conditions, filters, as_dict=1)
+	return frappe.db.sql("""select name, customer_name,
+		bypass_credit_limit_check_at_sales_order from `tabCustomer` %s
+	""" % conditions, filters, as_dict=1)
\ No newline at end of file
diff --git a/erpnext/selling/sales_common.js b/erpnext/selling/sales_common.js
index 97b7b99..c8b48a5 100644
--- a/erpnext/selling/sales_common.js
+++ b/erpnext/selling/sales_common.js
@@ -335,7 +335,42 @@
 		} else {
 			this.frm.set_value("company_address_display", "");
 		}
-	}
+	},
+
+	conversion_factor: function(doc, cdt, cdn, dont_fetch_price_list_rate) {
+	    this._super(doc, cdt, cdn, dont_fetch_price_list_rate);
+		if(frappe.meta.get_docfield(cdt, "stock_qty", cdn)) {
+			this.set_batch_number(cdt, cdn);
+		}
+	},
+
+	qty: function(doc, cdt, cdn) {
+	    this._super(doc, cdt, cdn);
+		this.set_batch_number(cdt, cdn);
+	},
+
+	/* Determine appropriate batch number and set it in the form.
+	* @param {string} cdt - Document Doctype
+	* @param {string} cdn - Document name
+	*/
+	set_batch_number: function(cdt, cdn) {
+		const doc = frappe.get_doc(cdt, cdn);
+		if (doc && doc.has_batch_no) {
+			this._set_batch_number(doc);
+		}
+	},
+
+	_set_batch_number: function(doc) {
+		return frappe.call({
+			method: 'erpnext.stock.doctype.batch.batch.get_batch_no',
+			args: {'item_code': doc.item_code, 'warehouse': doc.warehouse, 'qty': flt(doc.qty) * flt(doc.conversion_factor)},
+			callback: function(r) {
+				if(r.message) {
+					frappe.model.set_value(doc.doctype, doc.name, 'batch_no', r.message);
+				}
+			}
+		});
+	},
 });
 
 frappe.ui.form.on(cur_frm.doctype,"project", function(frm) {
diff --git a/erpnext/setup/doctype/party_type/party_type.json b/erpnext/setup/doctype/party_type/party_type.json
index ee4b8ea..e1814ae 100644
--- a/erpnext/setup/doctype/party_type/party_type.json
+++ b/erpnext/setup/doctype/party_type/party_type.json
@@ -1,5 +1,6 @@
 {
  "allow_copy": 0, 
+ "allow_guest_to_view": 0, 
  "allow_import": 0, 
  "allow_rename": 0, 
  "autoname": "field:party_type", 
@@ -13,6 +14,7 @@
  "engine": "InnoDB", 
  "fields": [
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -43,17 +45,17 @@
    "unique": 0
   }
  ], 
+ "has_web_view": 0, 
  "hide_heading": 0, 
  "hide_toolbar": 0, 
  "idx": 0, 
  "image_view": 0, 
- "in_create": 0, 
- "in_dialog": 0, 
+ "in_create": 1, 
  "is_submittable": 0, 
  "issingle": 0, 
  "istable": 0, 
  "max_attachments": 0, 
- "modified": "2017-02-20 13:25:04.456818", 
+ "modified": "2017-11-23 17:46:27.075001", 
  "modified_by": "Administrator", 
  "module": "Setup", 
  "name": "Party Type", 
@@ -64,8 +66,8 @@
    "amend": 0, 
    "apply_user_permissions": 0, 
    "cancel": 0, 
-   "create": 1, 
-   "delete": 1, 
+   "create": 0, 
+   "delete": 0, 
    "email": 1, 
    "export": 1, 
    "if_owner": 0, 
@@ -78,14 +80,14 @@
    "set_user_permissions": 0, 
    "share": 1, 
    "submit": 0, 
-   "write": 1
+   "write": 0
   }, 
   {
    "amend": 0, 
    "apply_user_permissions": 0, 
    "cancel": 0, 
-   "create": 1, 
-   "delete": 1, 
+   "create": 0, 
+   "delete": 0, 
    "email": 1, 
    "export": 1, 
    "if_owner": 0, 
@@ -98,14 +100,14 @@
    "set_user_permissions": 0, 
    "share": 1, 
    "submit": 0, 
-   "write": 1
+   "write": 0
   }, 
   {
    "amend": 0, 
    "apply_user_permissions": 0, 
    "cancel": 0, 
-   "create": 1, 
-   "delete": 1, 
+   "create": 0, 
+   "delete": 0, 
    "email": 1, 
    "export": 1, 
    "if_owner": 0, 
@@ -118,10 +120,10 @@
    "set_user_permissions": 0, 
    "share": 1, 
    "submit": 0, 
-   "write": 1
+   "write": 0
   }
  ], 
- "quick_entry": 1, 
+ "quick_entry": 0, 
  "read_only": 0, 
  "read_only_onload": 0, 
  "show_name_in_global_search": 1, 
diff --git a/erpnext/accounts/doctype/asset/test_asset.js b/erpnext/setup/doctype/party_type/test_party_type.js
similarity index 73%
copy from erpnext/accounts/doctype/asset/test_asset.js
copy to erpnext/setup/doctype/party_type/test_party_type.js
index 6119e38..c97dbc5 100644
--- a/erpnext/accounts/doctype/asset/test_asset.js
+++ b/erpnext/setup/doctype/party_type/test_party_type.js
@@ -2,15 +2,15 @@
 // rename this file from _test_[name] to test_[name] to activate
 // and remove above this line
 
-QUnit.test("test: Asset", function (assert) {
+QUnit.test("test: Party Type", function (assert) {
 	let done = assert.async();
 
 	// number of asserts
 	assert.expect(1);
 
 	frappe.run_serially([
-		// insert a new Asset
-		() => frappe.tests.make('Asset', [
+		// insert a new Party Type
+		() => frappe.tests.make('Party Type', [
 			// values to be set
 			{key: 'value'}
 		]),
diff --git a/erpnext/setup/doctype/supplier_type/supplier_type.json b/erpnext/setup/doctype/supplier_type/supplier_type.json
index 9b40e0f..d7d7084 100644
--- a/erpnext/setup/doctype/supplier_type/supplier_type.json
+++ b/erpnext/setup/doctype/supplier_type/supplier_type.json
@@ -1,5 +1,6 @@
 {
  "allow_copy": 0, 
+ "allow_guest_to_view": 0, 
  "allow_import": 1, 
  "allow_rename": 1, 
  "autoname": "field:supplier_type", 
@@ -12,6 +13,7 @@
  "editable_grid": 0, 
  "fields": [
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -42,6 +44,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 1, 
@@ -71,12 +74,13 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
-   "fieldname": "credit_days_based_on", 
-   "fieldtype": "Select", 
+   "fieldname": "payment_terms", 
+   "fieldtype": "Link", 
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
@@ -84,39 +88,10 @@
    "in_global_search": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
-   "label": "Credit Days Based On", 
+   "label": "Default Payment Terms Template", 
    "length": 0, 
    "no_copy": 0, 
-   "options": "\nFixed Days\nLast Day of the Next Month", 
-   "permlevel": 1, 
-   "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, 
-   "depends_on": "eval:doc.credit_days_based_on=='Fixed Days'", 
-   "fieldname": "credit_days", 
-   "fieldtype": "Int", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 0, 
-   "in_standard_filter": 0, 
-   "label": "Credit Days", 
-   "length": 0, 
-   "no_copy": 0, 
+   "options": "Payment Terms Template", 
    "permlevel": 0, 
    "precision": "", 
    "print_hide": 0, 
@@ -130,6 +105,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -158,6 +134,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -189,18 +166,18 @@
    "unique": 0
   }
  ], 
+ "has_web_view": 0, 
  "hide_heading": 0, 
  "hide_toolbar": 0, 
  "icon": "fa fa-flag", 
  "idx": 1, 
  "image_view": 0, 
  "in_create": 0, 
- "in_dialog": 0, 
  "is_submittable": 0, 
  "issingle": 0, 
  "istable": 0, 
  "max_attachments": 0, 
- "modified": "2017-02-20 13:25:25.641431", 
+ "modified": "2017-09-04 18:54:10.093500", 
  "modified_by": "Administrator", 
  "module": "Setup", 
  "name": "Supplier Type", 
diff --git a/erpnext/accounts/doctype/asset_category/test_asset_category.js b/erpnext/setup/doctype/supplier_type/test_supplier_type.js
similarity index 71%
rename from erpnext/accounts/doctype/asset_category/test_asset_category.js
rename to erpnext/setup/doctype/supplier_type/test_supplier_type.js
index 7e343b7..085dddd 100644
--- a/erpnext/accounts/doctype/asset_category/test_asset_category.js
+++ b/erpnext/setup/doctype/supplier_type/test_supplier_type.js
@@ -2,15 +2,15 @@
 // rename this file from _test_[name] to test_[name] to activate
 // and remove above this line
 
-QUnit.test("test: Asset Category", function (assert) {
+QUnit.test("test: Supplier Type", function (assert) {
 	let done = assert.async();
 
 	// number of asserts
 	assert.expect(1);
 
 	frappe.run_serially([
-		// insert a new Asset Category
-		() => frappe.tests.make('Asset Category', [
+		// insert a new Supplier Type
+		() => frappe.tests.make('Supplier Type', [
 			// values to be set
 			{key: 'value'}
 		]),
diff --git a/erpnext/setup/setup_wizard/install_fixtures.py b/erpnext/setup/setup_wizard/install_fixtures.py
index 95c562a..ed89568 100644
--- a/erpnext/setup/setup_wizard/install_fixtures.py
+++ b/erpnext/setup/setup_wizard/install_fixtures.py
@@ -44,6 +44,8 @@
 			{"action_name": "Add Rooms", "action_doctype": "Room", "min_doc_count": 1, "is_completed": 0,
 				"domains": '["Education"]' },
 			{"action_name": "Add Users", "action_doctype": "User", "min_doc_count": 4, "is_completed": 0,
+				"domains": '[]' },
+			{"action_name": "Add Letterhead", "action_doctype": "Letter Head", "min_doc_count": 1, "is_completed": 0,
 				"domains": '[]' }
 		]},
 
diff --git a/erpnext/setup/setup_wizard/sample_data.py b/erpnext/setup/setup_wizard/sample_data.py
index e58b5f2..5a2fbd3 100644
--- a/erpnext/setup/setup_wizard/sample_data.py
+++ b/erpnext/setup/setup_wizard/sample_data.py
@@ -107,16 +107,16 @@
 	if domain == 'Education':
 		tasks += [
 			{
-				"title": _("Setup your School in ERPNext"),
+				"title": _("Setup your Institute in ERPNext"),
 				"start_date": current_date,
 				"end_date": frappe.utils.add_days(current_date, 1),
-				"file": "school_masters.md"
+				"file": "education_masters.md"
 			},
 			{
 				"title": "Setup Master Data",
 				"start_date": current_date,
 				"end_date": frappe.utils.add_days(current_date, 1),
-				"file": "school_masters.md"
+				"file": "education_masters.md"
 			}]
 
 	else:
diff --git a/erpnext/setup/setup_wizard/setup_wizard.py b/erpnext/setup/setup_wizard/setup_wizard.py
index 28e617f..ec70c39 100644
--- a/erpnext/setup/setup_wizard/setup_wizard.py
+++ b/erpnext/setup/setup_wizard/setup_wizard.py
@@ -254,7 +254,9 @@
 
 		accounts = []
 		for i, name in enumerate(account_name):
-			accounts.append(make_tax_account(company, account_name[i], tax_rate[i]))
+			tax_account = make_tax_account(company, account_name[i], tax_rate[i])
+			if tax_account:
+				accounts.append(tax_account)
 
 		if accounts:
 			make_sales_and_purchase_tax_templates(accounts, template_name)
diff --git a/erpnext/setup/setup_wizard/tasks/school_masters.md b/erpnext/setup/setup_wizard/tasks/education_masters.md
similarity index 75%
rename from erpnext/setup/setup_wizard/tasks/school_masters.md
rename to erpnext/setup/setup_wizard/tasks/education_masters.md
index 9103935..d0887d2 100644
--- a/erpnext/setup/setup_wizard/tasks/school_masters.md
+++ b/erpnext/setup/setup_wizard/tasks/education_masters.md
@@ -6,4 +6,4 @@
 1. Start adding **Students**
 1. Group your students into **Batches**
 
-Watch this video to learn more about ERPNext Schools: https://www.youtube.com/watch?v=f6foQOyGzdA
+Watch this video to learn more about ERPNext Education: https://www.youtube.com/watch?v=f6foQOyGzdA
diff --git a/erpnext/setup/setup_wizard/tasks/school_import_data.md b/erpnext/setup/setup_wizard/tasks/school_import_data.md
index c465b81..1fbe049 100644
--- a/erpnext/setup/setup_wizard/tasks/school_import_data.md
+++ b/erpnext/setup/setup_wizard/tasks/school_import_data.md
@@ -1,5 +1,5 @@
 Lets import some data! 💪💪
 
-If you are already running a school, you most likely have your Students in some spreadsheet file somewhere. Import it into ERPNext with the Data Import Tool.
+If you are already running a Institute, you most likely have your Students in some spreadsheet file somewhere. Import it into ERPNext with the Data Import Tool.
 
 Watch this video to get started: https://www.youtube.com/watch?v=Ta2Xx3QoK3E
\ No newline at end of file
diff --git a/erpnext/setup/utils.py b/erpnext/setup/utils.py
index d77ebd1..ffb3aa6 100644
--- a/erpnext/setup/utils.py
+++ b/erpnext/setup/utils.py
@@ -120,3 +120,18 @@
 	frappe.get_single('Domain Settings').set_active_domains(\
 		[d.name for d in domains])
 	add_all_roles_to('Administrator')
+
+
+def insert_record(records):
+	for r in records:
+		doc = frappe.new_doc(r.get("doctype"))
+		doc.update(r)
+		try:
+			doc.insert(ignore_permissions=True)
+		except frappe.DuplicateEntryError, e:
+			# pass DuplicateEntryError and continue
+			if e.args and e.args[0]==doc.doctype and e.args[1]==doc.name:
+				# make sure DuplicateEntryError is for the exact same doc and not a related doc
+				pass
+			else:
+				raise
diff --git a/erpnext/shopping_cart/cart.py b/erpnext/shopping_cart/cart.py
index f7a7d48..fcbb63c 100644
--- a/erpnext/shopping_cart/cart.py
+++ b/erpnext/shopping_cart/cart.py
@@ -12,7 +12,9 @@
 from erpnext.accounts.utils import get_account_name
 from erpnext.utilities.product import get_qty_in_stock
 
-class WebsitePriceListMissingError(frappe.ValidationError): pass
+
+class WebsitePriceListMissingError(frappe.ValidationError):
+	pass
 
 def set_cart_count(quotation=None):
 	if cint(frappe.db.get_singles_value("Shopping Cart Settings", "enabled")):
@@ -104,6 +106,7 @@
 	apply_cart_settings(quotation=quotation)
 
 	quotation.flags.ignore_permissions = True
+	quotation.payment_schedule = []
 	if not empty_card:
 		quotation.save()
 	else:
@@ -179,6 +182,7 @@
 
 	return doc
 
+
 def _get_cart_quotation(party=None):
 	'''Return the open Quotation of type "Shopping Cart" or make a new one'''
 	if not party:
@@ -200,6 +204,7 @@
 			"status": "Draft",
 			"docstatus": 0,
 			"__islocal": 1,
+			"payment_terms_template": "_Test Payment Term Template",
 			(party.doctype.lower()): party.name
 		})
 
diff --git a/erpnext/shopping_cart/test_shopping_cart.py b/erpnext/shopping_cart/test_shopping_cart.py
index 387b57c..0c94cd8 100644
--- a/erpnext/shopping_cart/test_shopping_cart.py
+++ b/erpnext/shopping_cart/test_shopping_cart.py
@@ -8,6 +8,9 @@
 from erpnext.shopping_cart.cart import _get_cart_quotation, update_cart, get_party
 from erpnext.tests.utils import create_test_contact_and_address
 
+
+test_dependencies = ['Payment Terms Template']
+
 class TestShoppingCart(unittest.TestCase):
 	"""
 		Note:
@@ -62,7 +65,6 @@
 		self.assertEquals(quotation.get("items")[0].qty, 1)
 		self.assertEquals(quotation.get("items")[0].amount, 10)
 
-
 		# add second item
 		update_cart("_Test Item 2", 1)
 		quotation = self.test_get_cart_customer()
diff --git a/erpnext/stock/doctype/batch/batch.py b/erpnext/stock/doctype/batch/batch.py
index c58a98d..6dac647 100644
--- a/erpnext/stock/doctype/batch/batch.py
+++ b/erpnext/stock/doctype/batch/batch.py
@@ -5,7 +5,8 @@
 import frappe
 from frappe import _
 from frappe.model.document import Document
-from frappe.utils import flt
+from frappe.utils import flt, cint
+
 
 class UnableToSelectBatchError(frappe.ValidationError): pass
 
@@ -53,16 +54,19 @@
 			from `tabStock Ledger Entry`
 			where warehouse=%s and batch_no=%s""",
 			(warehouse, batch_no))[0][0] or 0)
+
 	if batch_no and not warehouse:
 		out = frappe.db.sql('''select warehouse, sum(actual_qty) as qty
 			from `tabStock Ledger Entry`
 			where batch_no=%s
 			group by warehouse''', batch_no, as_dict=1)
+
 	if not batch_no and item_code and warehouse:
 		out = frappe.db.sql('''select batch_no, sum(actual_qty) as qty
 			from `tabStock Ledger Entry`
 			where item_code = %s and warehouse=%s
 			group by batch_no''', (item_code, warehouse), as_dict=1)
+
 	return out
 
 @frappe.whitelist()
@@ -114,21 +118,42 @@
 				if flt(batch_qty) < flt(qty):
 					frappe.throw(_("Row #{0}: The batch {1} has only {2} qty. Please select another batch which has {3} qty available or split the row into multiple rows, to deliver/issue from multiple batches").format(d.idx, d.batch_no, batch_qty, d.qty))
 
-def get_batch_no(item_code, warehouse, qty, throw=False):
-	'''get the smallest batch with for the given item_code, warehouse and qty'''
+@frappe.whitelist()
+def get_batch_no(item_code, warehouse, qty=1, throw=False):
+	"""
+	Get batch number using First Expiring First Out method.
+	:param item_code: `item_code` of Item Document
+	:param warehouse: name of Warehouse to check
+	:param qty: quantity of Items
+	:return: String represent batch number of batch with sufficient quantity else an empty String
+	"""
 
 	batch_no = None
-	batches = get_batch_qty(item_code = item_code, warehouse = warehouse)
-	if batches:
-		batches = sorted(batches, lambda a, b: 1 if a.qty > b.qty else -1)
-		for b in batches:
-			if b.qty >= qty:
-				batch_no = b.batch_no
-				# found!
-				break
+	batches = get_batches(item_code, warehouse, qty, throw)
+
+	for batch in batches:
+		if cint(qty) <= cint(batch.qty):
+			batch_no = batch.batch_id
+			break
 
 	if not batch_no:
 		frappe.msgprint(_('Please select a Batch for Item {0}. Unable to find a single batch that fulfills this requirement').format(frappe.bold(item_code)))
-		if throw: raise UnableToSelectBatchError
+		if throw:
+			raise UnableToSelectBatchError
 
 	return batch_no
+
+
+def get_batches(item_code, warehouse, qty=1, throw=False):
+	batches = frappe.db.sql(
+		'select batch_id, sum(actual_qty) as qty from `tabBatch` join `tabStock Ledger Entry` '
+		'on `tabBatch`.batch_id = `tabStock Ledger Entry`.batch_no '
+		'where `tabStock Ledger Entry`.item_code = %s and  `tabStock Ledger Entry`.warehouse = %s '
+		'and (`tabBatch`.expiry_date >= CURDATE() or `tabBatch`.expiry_date IS NULL)'
+		'group by batch_id '
+		'order by `tabBatch`.expiry_date DESC, `tabBatch`.creation ASC',
+		(item_code, warehouse),
+		as_dict=True
+	)
+
+	return batches
diff --git a/erpnext/stock/doctype/batch/test_batch.py b/erpnext/stock/doctype/batch/test_batch.py
index eb3b48e..a327b2d 100644
--- a/erpnext/stock/doctype/batch/test_batch.py
+++ b/erpnext/stock/doctype/batch/test_batch.py
@@ -6,7 +6,7 @@
 from frappe.exceptions import ValidationError
 import unittest
 
-from erpnext.stock.doctype.batch.batch import get_batch_qty, UnableToSelectBatchError
+from erpnext.stock.doctype.batch.batch import get_batch_qty, UnableToSelectBatchError, get_batch_no
 
 class TestBatch(unittest.TestCase):
 
@@ -28,13 +28,13 @@
 		self.make_batch_item('ITEM-BATCH-1')
 
 		receipt = frappe.get_doc(dict(
-			doctype = 'Purchase Receipt',
-			supplier = '_Test Supplier',
-			items = [
+			doctype='Purchase Receipt',
+			supplier='_Test Supplier',
+			items=[
 				dict(
-					item_code = 'ITEM-BATCH-1',
-					qty = batch_qty,
-					rate = 10
+					item_code='ITEM-BATCH-1',
+					qty=batch_qty,
+					rate=10
 				)
 			]
 		)).insert()
@@ -74,28 +74,28 @@
 		'''Test automatic batch selection for outgoing items'''
 		batch_qty = 15
 		receipt = self.test_purchase_receipt(batch_qty)
+		item_code = 'ITEM-BATCH-1'
 
 		delivery_note = frappe.get_doc(dict(
-			doctype = 'Delivery Note',
-			customer = '_Test Customer',
-			company = receipt.company,
-			items = [
+			doctype='Delivery Note',
+			customer='_Test Customer',
+			company=receipt.company,
+			items=[
 				dict(
-					item_code = 'ITEM-BATCH-1',
-					qty = batch_qty,
-					rate = 10,
-					warehouse = receipt.items[0].warehouse
+					item_code=item_code,
+					qty=batch_qty,
+					rate=10,
+					warehouse=receipt.items[0].warehouse
 				)
 			]
 		)).insert()
 		delivery_note.submit()
 
-		# shipped with same batch
-		self.assertEquals(delivery_note.items[0].batch_no, receipt.items[0].batch_no)
-
-		# balance is 0
-		self.assertEquals(get_batch_qty(receipt.items[0].batch_no,
-			receipt.items[0].warehouse), 0)
+		# shipped from FEFO batch
+		self.assertEquals(
+			delivery_note.items[0].batch_no,
+			get_batch_no(item_code, receipt.items[0].warehouse, batch_qty)
+		)
 
 	def test_delivery_note_fail(self):
 		'''Test automatic batch selection for outgoing items'''
@@ -120,27 +120,27 @@
 
 		batch_qty = 16
 		receipt = self.test_purchase_receipt(batch_qty)
+		item_code = 'ITEM-BATCH-1'
 
 		stock_entry = frappe.get_doc(dict(
-			doctype = 'Stock Entry',
-			purpose = 'Material Issue',
-			company = receipt.company,
-			items = [
+			doctype='Stock Entry',
+			purpose='Material Issue',
+			company=receipt.company,
+			items=[
 				dict(
-					item_code = 'ITEM-BATCH-1',
-					qty = batch_qty,
-					s_warehouse = receipt.items[0].warehouse,
+					item_code=item_code,
+					qty=batch_qty,
+					s_warehouse=receipt.items[0].warehouse,
 				)
 			]
 		)).insert()
 		stock_entry.submit()
 
 		# assert same batch is selected
-		self.assertEqual(stock_entry.items[0].batch_no, receipt.items[0].batch_no)
-
-		# balance is 0
-		self.assertEquals(get_batch_qty(receipt.items[0].batch_no,
-			receipt.items[0].warehouse), 0)
+		self.assertEqual(
+			stock_entry.items[0].batch_no,
+			get_batch_no(item_code, receipt.items[0].warehouse, batch_qty)
+		)
 
 	def test_batch_split(self):
 		'''Test batch splitting'''
diff --git a/erpnext/stock/doctype/bin/bin.py b/erpnext/stock/doctype/bin/bin.py
index 626a9db..fbbe6ee 100644
--- a/erpnext/stock/doctype/bin/bin.py
+++ b/erpnext/stock/doctype/bin/bin.py
@@ -88,11 +88,10 @@
 				and item.source_warehouse = %s
 				and pro.status not in ("Stopped", "Completed")''', (self.item_code, self.warehouse))[0][0]
 
-		if self.reserved_qty_for_production:
-			self.set_projected_qty()
+		self.set_projected_qty()
 
-			self.db_set('reserved_qty_for_production', self.reserved_qty_for_production)
-			self.db_set('projected_qty', self.projected_qty)
+		self.db_set('reserved_qty_for_production', flt(self.reserved_qty_for_production))
+		self.db_set('projected_qty', self.projected_qty)
 
 
 def update_item_projected_qty(item_code):
diff --git a/erpnext/stock/doctype/material_request/material_request.py b/erpnext/stock/doctype/material_request/material_request.py
index 59075c5..da310aa 100644
--- a/erpnext/stock/doctype/material_request/material_request.py
+++ b/erpnext/stock/doctype/material_request/material_request.py
@@ -158,7 +158,7 @@
 						and material_request_item = %s and docstatus = 1""",
 						(self.name, d.name))[0][0])
 
-					if d.ordered_qty and d.ordered_qty > d.qty:
+					if d.ordered_qty and d.ordered_qty > d.stock_qty:
 						frappe.throw(_("The total Issue / Transfer quantity {0} in Material Request {1}  \
 							cannot be greater than requested quantity {2} for Item {3}").format(d.ordered_qty, d.parent, d.qty, d.item_code))
 
@@ -170,11 +170,12 @@
 
 				frappe.db.set_value(d.doctype, d.name, "ordered_qty", d.ordered_qty)
 
+		target_ref_field = 'qty' if self.material_request_type == "Manufacture" else 'stock_qty'
 		self._update_percent_field({
 			"target_dt": "Material Request Item",
 			"target_parent_dt": self.doctype,
 			"target_parent_field": "per_ordered",
-			"target_ref_field": "qty",
+			"target_ref_field": target_ref_field,
 			"target_field": "ordered_qty",
 			"name": self.name,
 		}, update_modified)
@@ -216,9 +217,9 @@
 	target_doc.run_method("calculate_taxes_and_totals")
 
 def update_item(obj, target, source_parent):
-	target.conversion_factor = 1
-	target.qty = flt(obj.qty) - flt(obj.ordered_qty)
-	target.stock_qty = target.qty
+	target.conversion_factor = obj.conversion_factor
+	target.qty = flt(flt(obj.stock_qty) - flt(obj.ordered_qty))/ target.conversion_factor
+	target.stock_qty = (target.qty * target.conversion_factor)
 
 @frappe.whitelist()
 def make_purchase_order(source_name, target_doc=None):
@@ -242,7 +243,7 @@
 				["uom", "uom"]
 			],
 			"postprocess": update_item,
-			"condition": lambda doc: doc.ordered_qty < doc.qty
+			"condition": lambda doc: doc.ordered_qty < doc.stock_qty
 		}
 	}, target_doc, postprocess)
 
@@ -353,11 +354,11 @@
 @frappe.whitelist()
 def make_stock_entry(source_name, target_doc=None):
 	def update_item(obj, target, source_parent):
-		qty = flt(obj.qty) - flt(obj.ordered_qty) \
-			if flt(obj.qty) > flt(obj.ordered_qty) else 0
+		qty = flt(flt(obj.stock_qty) - flt(obj.ordered_qty))/ target.conversion_factor \
+			if flt(obj.stock_qty) > flt(obj.ordered_qty) else 0
 		target.qty = qty
-		target.transfer_qty = qty
-		target.conversion_factor = 1
+		target.transfer_qty = qty * obj.conversion_factor
+		target.conversion_factor = obj.conversion_factor
 
 		if source_parent.material_request_type == "Material Transfer":
 			target.t_warehouse = obj.warehouse
@@ -384,7 +385,7 @@
 				"uom": "stock_uom",
 			},
 			"postprocess": update_item,
-			"condition": lambda doc: doc.ordered_qty < doc.qty
+			"condition": lambda doc: doc.ordered_qty < doc.stock_qty
 		}
 	}, target_doc, set_missing_values)
 
@@ -405,7 +406,7 @@
 				prod_order.fg_warehouse = d.warehouse
 				prod_order.wip_warehouse = default_wip_warehouse
 				prod_order.description = d.description
-				prod_order.stock_uom = d.uom
+				prod_order.stock_uom = d.stock_uom
 				prod_order.expected_delivery_date = d.schedule_date
 				prod_order.sales_order = d.sales_order
 				prod_order.bom_no = get_item_details(d.item_code).bom_no
diff --git a/erpnext/stock/doctype/material_request/test_material_request.py b/erpnext/stock/doctype/material_request/test_material_request.py
index a24957e..83971d3 100644
--- a/erpnext/stock/doctype/material_request/test_material_request.py
+++ b/erpnext/stock/doctype/material_request/test_material_request.py
@@ -6,7 +6,7 @@
 
 from __future__ import unicode_literals
 import frappe, unittest, erpnext
-from frappe.utils import flt
+from frappe.utils import flt, today
 from erpnext.stock.doctype.material_request.material_request import raise_production_orders
 
 class TestMaterialRequest(unittest.TestCase):
@@ -558,5 +558,48 @@
 			item_code= %s and warehouse= %s """, (mr.items[0].item_code, mr.items[0].warehouse))[0][0]
 		self.assertEquals(requested_qty, new_requested_qty)
 
+	def test_multi_uom_for_purchase(self):
+		from erpnext.stock.doctype.material_request.material_request import make_purchase_order
+
+		mr = frappe.copy_doc(test_records[0])
+		mr.material_request_type = 'Purchase'
+		item = mr.items[0]
+		mr.schedule_date = today()
+
+		if not frappe.db.get_value('UOM Conversion Detail',
+			 {'parent': item.item_code, 'uom': 'Kg'}):
+			 item_doc = frappe.get_doc('Item', item.item_code)
+			 item_doc.append('uoms', {
+				 'uom': 'Kg',
+				 'conversion_factor': 5
+			 })
+			 item_doc.save(ignore_permissions=True)
+
+		item.uom = 'Kg'
+		for item in mr.items:
+			item.schedule_date = mr.schedule_date
+
+		mr.insert()
+		self.assertRaises(frappe.ValidationError, make_purchase_order,
+			mr.name)
+
+		mr = frappe.get_doc("Material Request", mr.name)
+		mr.submit()
+		item = mr.items[0]
+
+		self.assertEquals(item.uom, "Kg")
+		self.assertEquals(item.conversion_factor, 5.0)
+		self.assertEquals(item.stock_qty, flt(item.qty * 5))
+
+		po = make_purchase_order(mr.name)
+		self.assertEquals(po.doctype, "Purchase Order")
+		self.assertEquals(len(po.get("items")), len(mr.get("items")))
+
+		po.supplier = '_Test Supplier'
+		po.insert()
+		po.submit()
+		mr = frappe.get_doc("Material Request", mr.name)
+		self.assertEquals(mr.per_ordered, 100)
+
 test_dependencies = ["Currency Exchange", "BOM"]
 test_records = frappe.get_test_records('Material Request')
diff --git a/erpnext/stock/doctype/material_request_item/material_request_item.json b/erpnext/stock/doctype/material_request_item/material_request_item.json
index 5bf3f27..3434b4d 100644
--- a/erpnext/stock/doctype/material_request_item/material_request_item.json
+++ b/erpnext/stock/doctype/material_request_item/material_request_item.json
@@ -1,5 +1,6 @@
 {
  "allow_copy": 0, 
+ "allow_guest_to_view": 0, 
  "allow_import": 0, 
  "allow_rename": 0, 
  "autoname": "hash", 
@@ -13,6 +14,7 @@
  "engine": "InnoDB", 
  "fields": [
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 1, 
    "collapsible": 0, 
@@ -46,6 +48,7 @@
    "width": "100px"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -73,6 +76,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -105,6 +109,7 @@
    "width": "100px"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 1, 
@@ -134,6 +139,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -166,6 +172,7 @@
    "width": "250px"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -194,6 +201,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -223,6 +231,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -251,6 +260,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -283,11 +293,12 @@
    "width": "80px"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
-   "fieldname": "uom", 
+   "fieldname": "stock_uom", 
    "fieldtype": "Link", 
    "hidden": 0, 
    "ignore_user_permissions": 0, 
@@ -299,23 +310,21 @@
    "label": "Stock UOM", 
    "length": 0, 
    "no_copy": 0, 
-   "oldfieldname": "uom", 
-   "oldfieldtype": "Link", 
    "options": "UOM", 
    "permlevel": 0, 
-   "print_hide": 0, 
+   "precision": "", 
+   "print_hide": 1, 
    "print_hide_if_no_value": 0, 
-   "print_width": "70px", 
    "read_only": 1, 
    "remember_last_selected_value": 0, 
    "report_hide": 0, 
    "reqd": 1, 
    "search_index": 0, 
    "set_only_once": 0, 
-   "unique": 0, 
-   "width": "70px"
+   "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -349,6 +358,7 @@
    "width": "100px"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -376,6 +386,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 1, 
    "collapsible": 0, 
@@ -409,6 +420,101 @@
    "width": "100px"
   }, 
   {
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "fieldname": "uom", 
+   "fieldtype": "Link", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "ignore_xss_filter": 0, 
+   "in_filter": 0, 
+   "in_global_search": 0, 
+   "in_list_view": 0, 
+   "in_standard_filter": 0, 
+   "label": "UOM", 
+   "length": 0, 
+   "no_copy": 0, 
+   "oldfieldname": "uom", 
+   "oldfieldtype": "Link", 
+   "options": "UOM", 
+   "permlevel": 0, 
+   "print_hide": 0, 
+   "print_hide_if_no_value": 0, 
+   "print_width": "70px", 
+   "read_only": 0, 
+   "remember_last_selected_value": 0, 
+   "report_hide": 0, 
+   "reqd": 1, 
+   "search_index": 0, 
+   "set_only_once": 0, 
+   "unique": 0, 
+   "width": "70px"
+  }, 
+  {
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "fieldname": "conversion_factor", 
+   "fieldtype": "Float", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "ignore_xss_filter": 0, 
+   "in_filter": 0, 
+   "in_global_search": 0, 
+   "in_list_view": 0, 
+   "in_standard_filter": 0, 
+   "label": "UOM Conversion Factor", 
+   "length": 0, 
+   "no_copy": 0, 
+   "permlevel": 0, 
+   "precision": "", 
+   "print_hide": 1, 
+   "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_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "fieldname": "stock_qty", 
+   "fieldtype": "Float", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "ignore_xss_filter": 0, 
+   "in_filter": 0, 
+   "in_global_search": 0, 
+   "in_list_view": 0, 
+   "in_standard_filter": 0, 
+   "label": "Stock Qty", 
+   "length": 0, 
+   "no_copy": 1, 
+   "permlevel": 0, 
+   "precision": "", 
+   "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
+  }, 
+  {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -437,6 +543,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -469,6 +576,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -502,6 +610,7 @@
    "width": "100px"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -532,6 +641,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -561,6 +671,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -591,6 +702,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -618,6 +730,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -650,6 +763,7 @@
    "width": "70px"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 1, 
    "bold": 0, 
    "collapsible": 0, 
@@ -682,6 +796,7 @@
    "width": "70px"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -711,6 +826,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -741,6 +857,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 1, 
    "bold": 0, 
    "collapsible": 0, 
@@ -771,17 +888,17 @@
    "unique": 0
   }
  ], 
+ "has_web_view": 0, 
  "hide_heading": 0, 
  "hide_toolbar": 0, 
  "idx": 1, 
  "image_view": 0, 
  "in_create": 0, 
- "in_dialog": 0, 
  "is_submittable": 0, 
  "issingle": 0, 
  "istable": 1, 
  "max_attachments": 0, 
- "modified": "2017-02-20 13:31:50.143583", 
+ "modified": "2017-10-25 17:18:59.974778", 
  "modified_by": "Administrator", 
  "module": "Stock", 
  "name": "Material Request Item", 
diff --git a/erpnext/stock/get_item_details.py b/erpnext/stock/get_item_details.py
index 539e8a5..63c76bc 100644
--- a/erpnext/stock/get_item_details.py
+++ b/erpnext/stock/get_item_details.py
@@ -11,6 +11,7 @@
 from frappe.model.meta import get_field_precision
 from erpnext.stock.doctype.batch.batch import get_batch_no
 
+
 @frappe.whitelist()
 def get_item_details(args):
 	"""
@@ -84,7 +85,6 @@
 		if out.has_batch_no and not args.get("batch_no"):
 			out.batch_no = get_batch_no(out.item_code, out.warehouse, out.qty)
 
-
 	if args.transaction_date and item.lead_time_days:
 		out.schedule_date = out.lead_time_date = add_days(args.transaction_date,
 			item.lead_time_days)
@@ -96,16 +96,6 @@
 
 	return out
 
-	# print(frappe._dict({
-	# 	'has_serial_no'	: out.has_serial_no,
-	# 	'has_batch_no'	: out.has_batch_no
-	# }))
-
-	# return frappe._dict({
-	# 	'has_serial_no'	: out.has_serial_no,
-	# 	'has_batch_no'	: out.has_batch_no
-	# })
-
 def process_args(args):
 	if isinstance(args, basestring):
 		args = json.loads(args)
@@ -123,6 +113,7 @@
 	set_transaction_type(args)
 	return args
 
+
 @frappe.whitelist()
 def get_item_code(barcode=None, serial_no=None):
 	if barcode:
@@ -136,6 +127,7 @@
 
 	return item_code
 
+
 def validate_item_details(args, item):
 	if not args.company:
 		throw(_("Please specify Company"))
@@ -143,14 +135,52 @@
 	from erpnext.stock.doctype.item.item import validate_end_of_life
 	validate_end_of_life(item.name, item.end_of_life, item.disabled)
 
-	if args.transaction_type=="selling" and cint(item.has_variants):
+	if args.transaction_type == "selling" and cint(item.has_variants):
 		throw(_("Item {0} is a template, please select one of its variants").format(item.name))
 
-	elif args.transaction_type=="buying" and args.doctype != "Material Request":
+	elif args.transaction_type == "buying" and args.doctype != "Material Request":
 		if args.get("is_subcontracted") == "Yes" and item.is_sub_contracted_item != 1:
 			throw(_("Item {0} must be a Sub-contracted Item").format(item.name))
 
+
 def get_basic_details(args, item):
+	"""
+	:param args: {
+			"item_code": "",
+			"warehouse": None,
+			"customer": "",
+			"conversion_rate": 1.0,
+			"selling_price_list": None,
+			"price_list_currency": None,
+			"plc_conversion_rate": 1.0,
+			"doctype": "",
+			"name": "",
+			"supplier": None,
+			"transaction_date": None,
+			"conversion_rate": 1.0,
+			"buying_price_list": None,
+			"is_subcontracted": "Yes" / "No",
+			"ignore_pricing_rule": 0/1
+			"project": "",
+			barcode: "",
+			serial_no: "",
+			warehouse: "",
+			currency: "",
+			update_stock: "",
+			price_list: "",
+			company: "",
+			order_type: "",
+			is_pos: "",
+			ignore_pricing_rule: "",
+			project: "",
+			qty: "",
+			stock_qty: "",
+			conversion_factor: ""
+		}
+	:param item: `item_code` of Item object
+	:return: frappe._dict
+	"""
+
 	if not item:
 		item = frappe.get_doc("Item", args.get("item_code"))
 
@@ -160,15 +190,21 @@
 	from frappe.defaults import get_user_default_as_list
 	user_default_warehouse_list = get_user_default_as_list('Warehouse')
 	user_default_warehouse = user_default_warehouse_list[0] \
-		if len(user_default_warehouse_list)==1 else ""
+		if len(user_default_warehouse_list) == 1 else ""
 
 	warehouse = user_default_warehouse or item.default_warehouse or args.warehouse
 
+	material_request_type = ''
+	if args.get('doctype') == "Material Request":
+		material_request_type = frappe.db.get_value('Material Request',
+			args.get('name'), 'material_request_type')
+
 	#Set the UOM to the Default Sales UOM or Default Purchase UOM if configured in the Item Master
 	if not args.uom:
 		if args.get('doctype') in ['Quotation', 'Sales Order', 'Delivery Note', 'Sales Invoice']:
 			args.uom = item.sales_uom if item.sales_uom else item.stock_uom
-		elif args.get('doctype') in ['Purchase Order', 'Purchase Receipt', 'Purchase Invoice']:
+		elif (args.get('doctype') in ['Purchase Order', 'Purchase Receipt', 'Purchase Invoice']) or \
+			(args.get('doctype') == 'Material Request' and material_request_type == 'Purchase'):
 			args.uom = item.purchase_uom if item.purchase_uom else item.stock_uom
 		else:
 			args.uom = item.stock_uom
@@ -211,7 +247,7 @@
 		out.conversion_factor = 1.0
 	else:
 		out.conversion_factor = args.conversion_factor or \
-			get_conversion_factor(item.item_code, args.uom).get("conversion_factor")  or 1.0
+			get_conversion_factor(item.item_code, args.uom).get("conversion_factor") or 1.0
 
 	args.conversion_factor = out.conversion_factor
 	out.stock_qty = out.qty * out.conversion_factor
@@ -231,6 +267,7 @@
 
 	return out
 
+
 def get_default_income_account(args, item):
 	return (item.income_account
 		or args.income_account
@@ -357,7 +394,7 @@
 	res = frappe._dict()
 
 	if not pos_profile:
-		pos_profile = get_pos_profile(company)
+		pos_profile = get_pos_profile(company, args.get('pos_profile'))
 
 	if pos_profile:
 		for fieldname in ("income_account", "cost_center", "warehouse", "expense_account"):
@@ -371,17 +408,32 @@
 	return res
 
 @frappe.whitelist()
-def get_pos_profile(company):
-	pos_profile = frappe.db.sql("""select * from `tabPOS Profile` where user = %s
-		 and company = %s""", (frappe.session['user'], company), as_dict=1)
+def get_pos_profile(company, pos_profile=None, user=None):
+	if pos_profile:
+		return frappe.get_doc('POS Profile', pos_profile)
+
+	if not user:
+		user = frappe.session['user']
+
+	pos_profile = frappe.db.sql("""select pf.*
+		from
+			`tabPOS Profile` pf, `tabPOS Profile User` pfu
+		where
+			pfu.parent = pf.name and pfu.user = %s and pf.company = %s
+			and pf.disabled = 0 and pfu.default=1""", (user, company), as_dict=1)
 
 	if not pos_profile:
-		pos_profile = frappe.db.sql("""select * from `tabPOS Profile`
-			where ifnull(user,'') = '' and company = %s""", company, as_dict=1)
+		pos_profile = frappe.db.sql("""select pf.*
+			from
+				`tabPOS Profile` pf left join `tabPOS Profile User` pfu
+			on
+				pf.name = pfu.parent
+			where
+				ifnull(pfu.user, '') = '' and pf.company = %s
+				and pf.disabled = 0""", (company), as_dict=1)
 
 	return pos_profile and pos_profile[0] or None
 
-
 def get_serial_nos_by_fifo(args):
 	if frappe.db.get_single_value("Stock Settings", "automatically_set_serial_nos_based_on_fifo"):
 		return "\n".join(frappe.db.sql_list("""select name from `tabSerial No`
@@ -532,8 +584,6 @@
 		bom = frappe.db.get_value("BOM", {"docstatus": 1, "is_default": 1, "is_active": 1, "item": item_code})
 		if bom:
 			return bom
-		else:
-			frappe.throw(_("No default BOM exists for Item {0}").format(item_code))
 
 def get_valuation_rate(item_code, warehouse=None):
 	item = frappe.get_doc("Item", item_code)
diff --git a/erpnext/stock/reorder_item.py b/erpnext/stock/reorder_item.py
index 46b8840..456b434 100644
--- a/erpnext/stock/reorder_item.py
+++ b/erpnext/stock/reorder_item.py
@@ -128,19 +128,31 @@
 				for d in items:
 					d = frappe._dict(d)
 					item = frappe.get_doc("Item", d.item_code)
+					uom = item.stock_uom
+					conversion_factor = 1.0
+
+					if request_type == 'Purchase':
+						uom = item.purchase_uom or item.stock_uom
+						if uom != item.stock_uom:
+							conversion_factor = frappe.db.get_value("UOM Conversion Detail", 
+								{'parent': item.name, 'uom': uom}, 'conversion_factor') or 1.0
+
 					mr.append("items", {
 						"doctype": "Material Request Item",
 						"item_code": d.item_code,
 						"schedule_date": add_days(nowdate(),cint(item.lead_time_days)),
-						"uom":	item.stock_uom,
+						"qty": d.reorder_qty / conversion_factor,
+						"uom": uom,
+						"stock_uom": item.stock_uom,
 						"warehouse": d.warehouse,
 						"item_name": item.item_name,
 						"description": item.description,
 						"item_group": item.item_group,
-						"qty": d.reorder_qty,
 						"brand": item.brand,
 					})
 
+				schedule_dates = [d.schedule_date for d in mr.items]
+				mr.schedule_date = max(schedule_dates or [nowdate()])
 				mr.insert()
 				mr.submit()
 				mr_list.append(mr)
diff --git a/erpnext/tests/ui/make_fixtures.js b/erpnext/tests/ui/make_fixtures.js
index 949e92b..8c9e508 100644
--- a/erpnext/tests/ui/make_fixtures.js
+++ b/erpnext/tests/ui/make_fixtures.js
@@ -217,6 +217,25 @@
 			{price_list: '_Test Price List'},
 			{price_list_rate: 200}
 		]
+	},
+	"Payment Term": {
+		"_Test Payment Term": [
+			{payment_term_name: '_Test Payment Term'},
+			{due_date_based_on: 'Day(s) after invoice date'},
+			{invoice_portion: 100},
+			{credit_days: 0}
+		]
+	},
+	"Payment Terms Template": {
+		"_Test Payment Term Template UI": [
+			{template_name: "_Test Payment Term Template UI"},
+			{terms: [
+				[
+					{payment_term: '_Test Payment Term'},
+					{invoice_portion: 100}
+				]
+			]}
+		]
 	}
 });
 
diff --git a/erpnext/tests/ui/tests.txt b/erpnext/tests/ui/tests.txt
index 3e40485..edf1d78 100644
--- a/erpnext/tests/ui/tests.txt
+++ b/erpnext/tests/ui/tests.txt
@@ -1,7 +1,8 @@
 erpnext/tests/ui/make_fixtures.js #long
 erpnext/setup/doctype/company/tests/test_company.js
-erpnext/accounts/doctype/account/test_account.js
-erpnext/accounts/doctype/account/test_make_tax_account.js
+erpnext/accounts/doctype/account/tests/test_account.js
+erpnext/accounts/doctype/account/tests/test_make_tax_account.js
+erpnext/accounts/doctype/account/tests/test_account_with_number.js
 erpnext/accounts/doctype/pricing_rule/test_pricing_rule.js
 erpnext/accounts/doctype/sales_taxes_and_charges_template/test_sales_taxes_and_charges_template.js
 erpnext/accounts/doctype/purchase_taxes_and_charges_template/test_purchase_taxes_and_charges_template.js
@@ -41,13 +42,13 @@
 erpnext/hr/doctype/leave_control_panel/test_leave_control_panel.js
 erpnext/hr/doctype/leave_allocation/test_leave_allocation.js
 erpnext/hr/doctype/leave_application/test_leave_application.js
-erpnext/schools/doctype/academic_year/test_academic_year.js
-erpnext/schools/doctype/academic_term/test_academic_term.js
-erpnext/schools/doctype/school_settings/test_school_settings.js
-erpnext/schools/doctype/student_batch_name/test_student_batch_name.js
-erpnext/schools/doctype/student_category/test_student_category.js
-erpnext/schools/doctype/room/test_room.js
-erpnext/schools/doctype/instructor/test_instructor.js
+erpnext/education/doctype/academic_year/test_academic_year.js
+erpnext/education/doctype/academic_term/test_academic_term.js
+erpnext/education/doctype/education_settings/test_education_settings.js
+erpnext/education/doctype/student_batch_name/test_student_batch_name.js
+erpnext/education/doctype/student_category/test_student_category.js
+erpnext/education/doctype/room/test_room.js
+erpnext/education/doctype/instructor/test_instructor.js
 erpnext/stock/doctype/warehouse/test_warehouse.js
 erpnext/manufacturing/doctype/production_order/test_production_order.js #long
 erpnext/accounts/page/pos/test_pos.js
@@ -95,26 +96,26 @@
 erpnext/buying/doctype/purchase_order/tests/test_purchase_order_with_taxes_and_charges.js
 erpnext/buying/doctype/purchase_order/tests/test_purchase_order_receipt.js
 erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.js
-erpnext/schools/doctype/grading_scale/test_grading_scale.js
-erpnext/schools/doctype/assessment_criteria_group/test_assessment_criteria_group.js
-erpnext/schools/doctype/assessment_criteria/test_assessment_criteria.js
-erpnext/schools/doctype/course/test_course.js
-erpnext/schools/doctype/program/test_program.js
-erpnext/schools/doctype/guardian/test_guardian.js
-erpnext/schools/doctype/student_admission/test_student_admission.js
-erpnext/schools/doctype/student_applicant/tests/test_student_applicant_dummy_data.js
-erpnext/schools/doctype/student_applicant/tests/test_student_applicant.js
-erpnext/schools/doctype/student_applicant/tests/test_student_applicant_options.js
-erpnext/schools/doctype/student_log/test_student_log.js
-erpnext/schools/doctype/student_group/test_student_group.js
-erpnext/schools/doctype/student_group_creation_tool/test_student_group_creation_tool.js
-erpnext/schools/doctype/student_leave_application/test_student_leave_application.js
-erpnext/schools/doctype/student_attendance_tool/test_student_attendance_tool.js
-erpnext/schools/doctype/student_attendance/test_student_attendance.js
-erpnext/schools/doctype/assessment_group/test_assessment_group.js
-erpnext/schools/doctype/assessment_plan/test_assessment_plan.js
-erpnext/schools/doctype/assessment_result/test_assessment_result.js
-erpnext/schools/doctype/assessment_result_tool/test_assessment_result_tool.js
+erpnext/education/doctype/grading_scale/test_grading_scale.js
+erpnext/education/doctype/assessment_criteria_group/test_assessment_criteria_group.js
+erpnext/education/doctype/assessment_criteria/test_assessment_criteria.js
+erpnext/education/doctype/course/test_course.js
+erpnext/education/doctype/program/test_program.js
+erpnext/education/doctype/guardian/test_guardian.js
+erpnext/education/doctype/student_admission/test_student_admission.js
+erpnext/education/doctype/student_applicant/tests/test_student_applicant_dummy_data.js
+erpnext/education/doctype/student_applicant/tests/test_student_applicant.js
+erpnext/education/doctype/student_applicant/tests/test_student_applicant_options.js
+erpnext/education/doctype/student_log/test_student_log.js
+erpnext/education/doctype/student_group/test_student_group.js
+erpnext/education/doctype/student_group_creation_tool/test_student_group_creation_tool.js
+erpnext/education/doctype/student_leave_application/test_student_leave_application.js
+erpnext/education/doctype/student_attendance_tool/test_student_attendance_tool.js
+erpnext/education/doctype/student_attendance/test_student_attendance.js
+erpnext/education/doctype/assessment_group/test_assessment_group.js
+erpnext/education/doctype/assessment_plan/test_assessment_plan.js
+erpnext/education/doctype/assessment_result/test_assessment_result.js
+erpnext/education/doctype/assessment_result_tool/test_assessment_result_tool.js
 erpnext/accounts/doctype/journal_entry/test_journal_entry.js
 erpnext/stock/doctype/stock_reconciliation/test_stock_reconciliation.js
 erpnext/accounts/doctype/payment_entry/tests/test_payment_entry.js
diff --git a/erpnext/utilities/user_progress.py b/erpnext/utilities/user_progress.py
index 2509511..e84377e 100644
--- a/erpnext/utilities/user_progress.py
+++ b/erpnext/utilities/user_progress.py
@@ -81,6 +81,24 @@
 				}
 			]
 		),
+
+		frappe._dict(
+			action_name='Add Letterhead',
+			domains=('Manufacturing', 'Services', 'Retail', 'Distribution', 'Education'),
+			title=_("Add Letterhead"),
+			help=_("Upload your letter head (Keep it web friendly as 900px by 100px)"),
+			fields=[
+				{"fieldtype":"Attach Image", "fieldname":"letterhead",
+					"is_private": 0,
+					"align": "center"
+				},
+			],
+			mandatory_entry=1,
+			submit_method="erpnext.utilities.user_progress_utils.create_letterhead",
+			done_state_title=_("Go to Letterheads"),
+			done_state_title_route=["List", "Letter Head"]
+		),
+
 		frappe._dict(
 			action_name='Add Suppliers',
 			domains=('Manufacturing', 'Services', 'Retail', 'Distribution'),
@@ -140,7 +158,7 @@
 			]
 		),
 
-		# School slides begin
+		# Education slides begin
 		frappe._dict(
 			action_name='Add Programs',
 			domains=("Education"),
@@ -219,7 +237,7 @@
 			done_state_title_route=["List", "Room"],
 			help_links=[]
 		),
-		# School slides end
+		# Education slides end
 
 		frappe._dict(
 			action_name='Add Users',
diff --git a/erpnext/utilities/user_progress_utils.py b/erpnext/utilities/user_progress_utils.py
index 709da57..08dd7ef 100644
--- a/erpnext/utilities/user_progress_utils.py
+++ b/erpnext/utilities/user_progress_utils.py
@@ -38,6 +38,21 @@
 				pass
 
 @frappe.whitelist()
+def create_letterhead(args_data):
+	args = json.loads(args_data)
+	letterhead = args.get("letterhead")
+	if letterhead:
+		try:
+			frappe.get_doc({
+					"doctype":"Letter Head",
+					"content":"""<div><img src="{0}" style='max-width: 100%%;'><br></div>""".format(letterhead),
+					"letter_head_name": _("Standard"),
+					"is_default": 1
+			}).insert()
+		except frappe.NameError:
+			pass
+
+@frappe.whitelist()
 def create_suppliers(args_data):
 	args = json.loads(args_data)
 	defaults = frappe.defaults.get_defaults()
@@ -117,7 +132,7 @@
 		"price_list_rate": item_price
 	}).insert()
 
-# Schools
+# Education
 @frappe.whitelist()
 def create_program(args_data):
 	args = json.loads(args_data)
diff --git a/license.txt b/license.txt
index 2a99aee..a238a97 100644
--- a/license.txt
+++ b/license.txt
@@ -663,7 +663,7 @@
 use an "about box".
 
 You should also get your employer (if you work as a programmer) or
-school, if any, to sign a "copyright disclaimer" for the program, if
+institute, if any, to sign a "copyright disclaimer" for the program, if
 necessary. For more information on this, and how to apply and follow
 the GNU GPL, see <http://www.gnu.org/licenses/>.