Merge branch 'master' of github.com:frappe/erpnext into hotfix
diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md
index 04e8d88..511b682 100644
--- a/.github/CONTRIBUTING.md
+++ b/.github/CONTRIBUTING.md
@@ -1,67 +1,36 @@
-## General Overview
+### Introduction (first timers)
 
-There are three branches where all the work happens: 
+Thank you for your interest in raising an Issue with ERPNext. An Issue could mean a bug report or a request for a missing feature. By raising a bug report, you are contributing to the development of ERPNext and this is the first step of participating in the community. Bug reports are very helpful for developers as they quickly fix the issue before other users start facing it.
 
-* **master** - This is the production / stable branch for releases.
-* **develop** - This is bleeding edge with features and fixes. Non critical bug fixes and new features go here. All updates to master also get pushed to develop.
-* **hotfix** - Urgent bug fixes go here. This is merged into master for releases.
+Feature requests are also a great way to take the product forward. New ideas can come in any user scenario and the issue list also acts a roadmap of future features.
 
-## Release Cycles
+When you are raising an Issue, you should keep a few things in mind. Remember that the developer does not have access to your machine so you must give all the information you can while raising an Issue. If you are suggesting a feature, you should be very clear about what you want.
 
-Usually, hotfix / develop is pushed to master roughly every week.
+The Issue list is not the right place to ask a question or start a general discussion. If you want to do that , then the right place is the forum [https://discuss.erpnext.com](https://discuss.erpnext.com).
 
-If we are close to a major release, then all bugfixes get pushed to hotfix and a release is done every week or as necessary.
+### Reply and Closing Policy
 
-***
+If your issue is not clear or does not meet the guidelines, then it will be closed. If it is closed, please supply the information asked and re-open it.
 
+### General Issue Guidelines
 
-## Contributing
+1. **Search existing Issues:** Before raising a Issue, search if it has been raised before. Maybe add a 👍 or give additional help by creating a mockup if it is not already created.
+1. **Report each issue separately:** Don't club multiple, unreleated issues in one note.
+1. **Brief:** Please don't include long explanations. Use screenshots and bullet points instead of descriptive paragraphs.
 
-Contributing to ERPNext is not very different from the usual Pull Request workflow on GitHub.
+### Bug Report Guidelines
 
-### Prerequisites : 
+1. **Steps to Reproduce:** The bug report must have a list of steps needed to reproduce a bug. If we cannot reproduce it, then we cannot solve it.
+1. **Version Number:** Please add the version number in your report. Often a bug is fixed in the latest version
+1. **Clear Title:** Add a clear subject to your bug report like "Unable to submit Purchase Order without Basic Rate" instead of just "Cannot Submit"
+1. **Screenshots:** Screenshots are a great way of communicating the issues. Try adding annotations or using LiceCAP to take a screencast in `gif`.
 
-* You need to know [Git and Github basics](https://try.github.io/levels/1/challenges/1)
-* You need to have a Fork of the [ERPNext repo](https://github.com/frappe/erpnext) in your personal Github account 
-* You need to add a [remote](#glossary) for your Forked repository. `git remote add origin [your-erpnext-repo-url]`
+### Feature Request Guidelines
 
-### The Process: 
+1. **Clarity:** Clearly specify how do you want the feature to behave. Don't just say "I would like multiple PDF formats", say that "Ability to add multiple print formats for customers with different languages".
+1. **Solution:** Try and identify how the feature should look like.
+1. **Mockups:** Mockups are a great way to explain your requirement.
 
-1. Make sure you're in the right branch. **develop** for adding features /  fixing issues and **hotfix** for urgent bug fixes
-2. Make your changes
-3. Create and checkout a new branch for the changes you've made. `git checkout -b [branch-name]`
-4. Add and commit your changes `git commit -am "[commit-message]"
-5. If you have been working on sometime for a long time, you should [rebase](#glossary) your branch with main develop branch. `git pull upstream develop --rebase` where `upstream` is the remote name of our repo
-6. Now, push your changes to your fork. `git push origin [branch-name]`   
-If you rebased your commits, you will have to [force push](http://vignette2.wikia.nocookie.net/starwars/images/e/ea/Yodapush.png/revision/latest?cb=20130205190454) `git push origin [branch-name] --force`
-7. You should now be able to see your pushed branch on Github, now create a pull request against the branch that you want to merge to.
-8. Wait for us to review it
+### What if my Issue is closed
 
-### Your Pull Request Should have
-
-1. Clear explanation of the use case
-1. Screenshots / Screecast GIF
-1. Test Cases (if applicable)
-1. Update to documentation
-
-### Common Problems: 
-
-* During rebase you might face _merge conflicts_. A merge conflict occurs when you have made changes to the same file that someone else has, in the commits you're pulling. You need to resolve these conflicts by picking which code you want to keep, yours or theirs. You can use `git mergetool` for help.
-* Sometimes you don't have a local branch to which you want to make changes to. In that case you first run `git fetch` followed by `git checkout --track -b upstream/[branch-name]`
- 
-
-### Good practices: 
-
-* You should rebase your branch with the branch you plan to make a Pull Request (PR) to as often as you can. 
-* Your commit messages should be precise and explain exactly what the commit does. Same goes for the Pull Request title.
-* When making a PR make sure that all your code is committed properly by checking the diffs.
-* If you're working on different things at the same time, make sure you make separate branches for each.
-* Don't create new DocTypes unless absolutely necessary. If you find that there is a another DocType with a similar functionality, then please try and extend that functionality.
-* DRY. Don't Repeat Yourself. Before writing up a similar function /feature make sure it doesn't exist in the codebase already. 
-* Tabs, not spaces.
-
-
-### Glossary
-
-* remote - A remote is a connection to a Github repo. You should have two remotes, one that points to your repo and one to ours. 
-* rebase - When you rebase a branch, you pull commits from your remote branch and move your commits on top of it. This allows you to update your branch with the latest changes without losing  your changes.
+Don't worry, take the feedback, supply the correct information and re-open it!
diff --git a/README.md b/README.md
index 4f59339..1fae1ce 100644
--- a/README.md
+++ b/README.md
@@ -38,6 +38,15 @@
 
 ---
 
+## Contributing
+
+1. [Issue Guidelines](https://github.com/frappe/erpnext/wiki/Issue-Guidelines)
+1. [Pull Request Requirements](https://github.com/frappe/erpnext/wiki/Contribution-Guidelines)
+1. [Translations](https://translate.erpnext.com)
+1. [Chart of Accounts](https://charts.erpnext.com)
+
+---
+
 ## Logo and Trademark
 
 The brand name ERPNext and the logo are trademarks of Frappe Technologies Pvt. Ltd.
diff --git a/erpnext/__init__.py b/erpnext/__init__.py
index ce9a142..f80b7bf 100644
--- a/erpnext/__init__.py
+++ b/erpnext/__init__.py
@@ -2,7 +2,7 @@
 from __future__ import unicode_literals
 import frappe
 
-__version__ = '8.0.3'
+__version__ = '8.0.29'
 
 def get_default_company(user=None):
 	'''Get default company for user'''
@@ -25,6 +25,14 @@
 	if company:
 		return frappe.db.get_value('Company', company, 'default_currency')
 
+def get_company_currency(company):
+	'''Returns the default company currency'''
+	if not frappe.flags.company_currency:
+		frappe.flags.company_currency = {}
+	if not company in frappe.flags.company_currency:
+		frappe.flags.company_currency[company] = frappe.db.get_value('Company', company, 'default_currency')
+	return frappe.flags.company_currency[company]
+
 def set_perpetual_inventory(enable=1):
 	accounts_settings = frappe.get_doc("Accounts Settings")
 	accounts_settings.auto_accounting_for_stock = enable
diff --git a/erpnext/accounts/doctype/account/account.py b/erpnext/accounts/doctype/account/account.py
index 11f376d..189d377 100644
--- a/erpnext/accounts/doctype/account/account.py
+++ b/erpnext/accounts/doctype/account/account.py
@@ -188,9 +188,9 @@
 					account_balance = get_balance_on(self.name)
 
 				if account_balance != stock_balance:
-					frappe.throw(_('Account balance ({0}) and stock value ({1}) must be same')\
-						.format(fmt_money(account_balance, self.account_currency),
-							fmt_money(stock_balance, self.account_currency)))
+					frappe.throw(_('Account balance ({0}) for {1} and stock value ({2}) for warehouse {3} must be same')
+						.format(fmt_money(account_balance, currency=self.account_currency), self.name, 
+							fmt_money(stock_balance, currency=self.account_currency), self.warehouse))
 
 		elif self.warehouse:
 			self.warehouse = None
diff --git a/erpnext/accounts/doctype/account/chart_of_accounts/chart_of_accounts.py b/erpnext/accounts/doctype/account/chart_of_accounts/chart_of_accounts.py
index c7d1291..a5c551f 100644
--- a/erpnext/accounts/doctype/account/chart_of_accounts/chart_of_accounts.py
+++ b/erpnext/accounts/doctype/account/chart_of_accounts/chart_of_accounts.py
@@ -125,13 +125,14 @@
 	account_tree = {}
 
 	# fill in tree starting with root accounts (those with no parent)
-	build_account_tree(account_tree, None, all_accounts)
+	if all_accounts:
+		build_account_tree(account_tree, None, all_accounts)
 	return account_tree
 	
 def build_account_tree(tree, parent, all_accounts):
 	# find children
-	parent_account = parent.name if parent else None
-	children  = [acc for acc in all_accounts if acc.parent_account == parent_account]
+	parent_account = parent.name if parent else ""
+	children = [acc for acc in all_accounts if cstr(acc.parent_account) == parent_account]
 			
 	# if no children, but a group account
 	if not children and parent.is_group:
diff --git a/erpnext/accounts/doctype/account/chart_of_accounts/verified/id_chart_of_accounts.json b/erpnext/accounts/doctype/account/chart_of_accounts/verified/id_chart_of_accounts.json
index ae2c630..b37e171 100644
--- a/erpnext/accounts/doctype/account/chart_of_accounts/verified/id_chart_of_accounts.json
+++ b/erpnext/accounts/doctype/account/chart_of_accounts/verified/id_chart_of_accounts.json
@@ -22,20 +22,10 @@
                 }, 
                 "1120.000 Bank ": {
                     "1121.000 Bank Rupiah": {
-                        "1121.0010 Bank 1": {
-                            "account_type": "Bank"
-                        }, 
-                        "1121.0020 Bank 2": {
-                            "account_type": "Bank"
-                        }
+						"is_group": 1
                     }, 
                     "1122.000 Bank Other Currency": {
-                        "1122.0010 Bank 1": {
-                            "account_type": "Bank"
-                        }, 
-                        "1122.0020 Bank 2": {
-                            "account_type": "Bank"
-                        }
+						"is_group": 1
                     }, 
                     "account_type": "Bank"
                 }, 
diff --git a/erpnext/accounts/doctype/accounts_settings/accounts_settings.json b/erpnext/accounts/doctype/accounts_settings/accounts_settings.json
index 7a4d40d..4f268a2 100644
--- a/erpnext/accounts/doctype/accounts_settings/accounts_settings.json
+++ b/erpnext/accounts/doctype/accounts_settings/accounts_settings.json
@@ -1,5 +1,6 @@
 {
  "allow_copy": 0, 
+ "allow_guest_to_view": 0, 
  "allow_import": 0, 
  "allow_rename": 0, 
  "beta": 0, 
@@ -25,7 +26,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": "Make Accounting Entry For Every Stock Movement", 
    "length": 0, 
    "no_copy": 0, 
@@ -33,6 +36,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, 
@@ -51,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": "Accounts Frozen Upto", 
    "length": 0, 
    "no_copy": 0, 
@@ -59,6 +65,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, 
@@ -77,7 +84,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": "Role Allowed to Set Frozen Accounts & Edit Frozen Entries", 
    "length": 0, 
    "no_copy": 0, 
@@ -86,6 +95,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, 
@@ -103,7 +113,9 @@
    "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, 
@@ -111,6 +123,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, 
@@ -129,7 +142,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": "Credit Controller", 
    "length": 0, 
    "no_copy": 0, 
@@ -138,6 +153,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, 
@@ -155,7 +171,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": "Check Supplier Invoice Number Uniqueness", 
    "length": 0, 
    "no_copy": 0, 
@@ -164,6 +182,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, 
@@ -181,7 +200,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": "Make Payment via Journal Entry", 
    "length": 0, 
    "no_copy": 0, 
@@ -190,6 +211,7 @@
    "print_hide": 0, 
    "print_hide_if_no_value": 0, 
    "read_only": 0, 
+   "remember_last_selected_value": 0, 
    "report_hide": 0, 
    "reqd": 0, 
    "search_index": 0, 
@@ -208,7 +230,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": "Unlink Payment on Cancellation of Invoice", 
    "length": 0, 
    "no_copy": 0, 
@@ -217,6 +241,37 @@
    "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, 
+   "default": "1", 
+   "fieldname": "book_asset_depreciation_entry_automatically", 
+   "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": "Book Asset Depreciation Entry Automatically", 
+   "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, 
@@ -224,18 +279,18 @@
    "unique": 0
   }
  ], 
+ "has_web_view": 0, 
  "hide_heading": 0, 
  "hide_toolbar": 0, 
- "icon": "fa fa-cog", 
+ "icon": "icon-cog", 
  "idx": 1, 
  "image_view": 0, 
  "in_create": 0, 
- "in_dialog": 0, 
  "is_submittable": 0, 
  "issingle": 1, 
  "istable": 0, 
  "max_attachments": 0, 
- "modified": "2016-10-20 16:12:38.595075", 
+ "modified": "2017-04-18 13:35:59.166250", 
  "modified_by": "Administrator", 
  "module": "Accounts", 
  "name": "Accounts Settings", 
@@ -251,7 +306,6 @@
    "export": 0, 
    "if_owner": 0, 
    "import": 0, 
-   "is_custom": 0, 
    "permlevel": 0, 
    "print": 1, 
    "read": 1, 
@@ -266,6 +320,8 @@
  "quick_entry": 1, 
  "read_only": 0, 
  "read_only_onload": 0, 
+ "show_name_in_global_search": 0, 
  "sort_order": "ASC", 
+ "track_changes": 1, 
  "track_seen": 0
 }
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/accounts_settings/accounts_settings.py b/erpnext/accounts/doctype/accounts_settings/accounts_settings.py
index 5f569a8..52e1b63 100644
--- a/erpnext/accounts/doctype/accounts_settings/accounts_settings.py
+++ b/erpnext/accounts/doctype/accounts_settings/accounts_settings.py
@@ -21,10 +21,13 @@
 				company.save()
 
 			# Create account head for warehouses
-			warehouse_list = frappe.db.sql("select name, company from tabWarehouse", as_dict=1)
+			warehouse_list = frappe.db.sql("""select name, company from tabWarehouse 
+				where disabled=0""", as_dict=1)
 			warehouse_with_no_company = [d.name for d in warehouse_list if not d.company]
 			if warehouse_with_no_company:
-				frappe.throw(_("Company is missing in warehouses {0}").format(comma_and(warehouse_with_no_company)))
+				frappe.throw(_("Company is missing in warehouses {0}")
+					.format(comma_and(warehouse_with_no_company)))
+					
 			for wh in warehouse_list:
 				wh_doc = frappe.get_doc("Warehouse", wh.name)
 				wh_doc.flags.ignore_permissions = True
diff --git a/erpnext/accounts/doctype/asset/asset.js b/erpnext/accounts/doctype/asset/asset.js
index 664ed4d..a1b3dd3 100644
--- a/erpnext/accounts/doctype/asset/asset.js
+++ b/erpnext/accounts/doctype/asset/asset.js
@@ -45,7 +45,7 @@
 					erpnext.asset.scrap_asset(frm);
 				});
 				
-				frm.add_custom_button("Sale Asset", function() {
+				frm.add_custom_button("Sell Asset", function() {
 					erpnext.asset.make_sales_invoice(frm);
 				});
 				
diff --git a/erpnext/accounts/doctype/asset/asset.py b/erpnext/accounts/doctype/asset/asset.py
index aa2768b..070461e 100644
--- a/erpnext/accounts/doctype/asset/asset.py
+++ b/erpnext/accounts/doctype/asset/asset.py
@@ -114,8 +114,17 @@
 
 	def set_accumulated_depreciation(self):
 		accumulated_depreciation = flt(self.opening_accumulated_depreciation)
-		for d in self.get("schedules"):
-			accumulated_depreciation  += flt(d.depreciation_amount, d.precision("depreciation_amount"))
+		value_after_depreciation = flt(self.value_after_depreciation)
+		for i, d in enumerate(self.get("schedules")):
+			depreciation_amount = flt(d.depreciation_amount, d.precision("depreciation_amount"))
+			value_after_depreciation -= flt(depreciation_amount)
+
+			if i==len(self.get("schedules"))-1 and self.depreciation_method == "Straight Line":
+				depreciation_amount += flt(value_after_depreciation - flt(self.expected_value_after_useful_life),
+					d.precision("depreciation_amount"))
+
+			d.depreciation_amount = depreciation_amount
+			accumulated_depreciation += d.depreciation_amount
 			d.accumulated_depreciation_amount = flt(accumulated_depreciation, d.precision("accumulated_depreciation_amount"))
 
 	def get_depreciation_amount(self, depreciable_value):
diff --git a/erpnext/accounts/doctype/asset/depreciation.py b/erpnext/accounts/doctype/asset/depreciation.py
index 15c155c..397342d 100644
--- a/erpnext/accounts/doctype/asset/depreciation.py
+++ b/erpnext/accounts/doctype/asset/depreciation.py
@@ -8,6 +8,10 @@
 from frappe.utils import flt, today, getdate
 
 def post_depreciation_entries(date=None):
+	# Return if automatic booking of asset depreciation is disabled
+	if not frappe.db.get_value("Accounts Settings", None, "book_asset_depreciation_entry_automatically"):
+		return
+		
 	if not date:
 		date = today()
 	for asset in get_depreciable_assets(date):
diff --git a/erpnext/accounts/doctype/asset/test_asset.py b/erpnext/accounts/doctype/asset/test_asset.py
index 51496b9..a45cdce 100644
--- a/erpnext/accounts/doctype/asset/test_asset.py
+++ b/erpnext/accounts/doctype/asset/test_asset.py
@@ -5,7 +5,7 @@
 
 import frappe
 import unittest
-from frappe.utils import cstr, nowdate, getdate
+from frappe.utils import cstr, nowdate, getdate, flt
 from erpnext.accounts.doctype.asset.depreciation import post_depreciation_entries, scrap_asset, restore_asset
 from erpnext.accounts.doctype.asset.asset import make_sales_invoice, make_purchase_invoice
 
@@ -166,6 +166,23 @@
 
 		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")
@@ -226,6 +243,23 @@
 
 		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")
 
@@ -297,4 +331,7 @@
 	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()
\ No newline at end of file
+	company.save()
+	
+	# Enable booking asset depreciation entry automatically
+	frappe.db.set_value("Accounts Settings", None, "book_asset_depreciation_entry_automatically", 1)
\ No newline at end of file
diff --git a/erpnext/schools/doctype/assessment_code/__init__.py b/erpnext/accounts/doctype/bank_guarantee/__init__.py
similarity index 100%
copy from erpnext/schools/doctype/assessment_code/__init__.py
copy to erpnext/accounts/doctype/bank_guarantee/__init__.py
diff --git a/erpnext/accounts/doctype/bank_guarantee/bank_guarantee.js b/erpnext/accounts/doctype/bank_guarantee/bank_guarantee.js
new file mode 100644
index 0000000..4993202
--- /dev/null
+++ b/erpnext/accounts/doctype/bank_guarantee/bank_guarantee.js
@@ -0,0 +1,30 @@
+// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
+// For license information, please see license.txt
+
+frappe.ui.form.on('Bank Guarantee', {
+	refresh: function(frm) {
+		cur_frm.set_query("account", function() {
+			return {
+				"filters": {
+					"account_type": "Bank",
+					"is_group": 0
+				}
+			};
+		});
+		cur_frm.set_query("project", function() {
+			return {
+				"filters": {
+					"customer": cur_frm.doc.customer
+				}
+			};
+		});
+	},
+	start_date: function(frm) {
+		end_date = frappe.datetime.add_days(cur_frm.doc.start_date, cur_frm.doc.validity - 1);
+		cur_frm.set_value("end_date", end_date);
+	},
+	validity: function(frm) {
+		end_date = frappe.datetime.add_days(cur_frm.doc.start_date, cur_frm.doc.validity - 1);
+		cur_frm.set_value("end_date", end_date);
+	}
+});
\ No newline at end of file
diff --git a/erpnext/schools/doctype/student_batch/student_batch.json b/erpnext/accounts/doctype/bank_guarantee/bank_guarantee.json
similarity index 67%
rename from erpnext/schools/doctype/student_batch/student_batch.json
rename to erpnext/accounts/doctype/bank_guarantee/bank_guarantee.json
index 1b7239b..807c544 100644
--- a/erpnext/schools/doctype/student_batch/student_batch.json
+++ b/erpnext/accounts/doctype/bank_guarantee/bank_guarantee.json
@@ -1,35 +1,37 @@
 {
  "allow_copy": 0, 
- "allow_import": 1, 
- "allow_rename": 1, 
- "autoname": "", 
+ "allow_guest_to_view": 0, 
+ "allow_import": 0, 
+ "allow_rename": 0, 
+ "autoname": "BG-.#####", 
  "beta": 0, 
- "creation": "2016-07-21 15:49:53.776461", 
+ "creation": "2016-12-17 10:43:35.731631", 
  "custom": 0, 
  "docstatus": 0, 
  "doctype": "DocType", 
- "document_type": "", 
+ "document_type": "Document", 
  "editable_grid": 1, 
  "engine": "InnoDB", 
  "fields": [
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
-   "fieldname": "student_batch_name", 
+   "fieldname": "customer", 
    "fieldtype": "Link", 
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
    "in_filter": 0, 
-   "in_global_search": 1, 
+   "in_global_search": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
-   "label": "Student Batch Name", 
+   "label": "Customer", 
    "length": 0, 
    "no_copy": 0, 
-   "options": "Student Batch Name", 
+   "options": "Customer", 
    "permlevel": 0, 
    "precision": "", 
    "print_hide": 0, 
@@ -43,11 +45,12 @@
    "unique": 0
   }, 
   {
-   "allow_on_submit": 0, 
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 1, 
    "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
-   "fieldname": "academic_year", 
+   "fieldname": "project", 
    "fieldtype": "Link", 
    "hidden": 0, 
    "ignore_user_permissions": 0, 
@@ -55,41 +58,11 @@
    "in_filter": 0, 
    "in_global_search": 0, 
    "in_list_view": 0, 
-   "in_standard_filter": 1, 
-   "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": 1, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "unique": 0
-  }, 
-  {
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "default": "1", 
-   "fieldname": "enabled", 
-   "fieldtype": "Check", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 0, 
    "in_standard_filter": 0, 
-   "label": "Active", 
+   "label": "Project", 
    "length": 0, 
    "no_copy": 0, 
+   "options": "Project", 
    "permlevel": 0, 
    "precision": "", 
    "print_hide": 0, 
@@ -103,11 +76,73 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
-   "fieldname": "column_break_2", 
+   "fieldname": "account", 
+   "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": "Bank Account", 
+   "length": 0, 
+   "no_copy": 0, 
+   "options": "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
+  }, 
+  {
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "fieldname": "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": "Amount", 
+   "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": "column_break_6", 
    "fieldtype": "Column Break", 
    "hidden": 0, 
    "ignore_user_permissions": 0, 
@@ -131,23 +166,23 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
-   "fieldname": "program", 
-   "fieldtype": "Link", 
+   "fieldname": "start_date", 
+   "fieldtype": "Date", 
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
    "in_filter": 0, 
-   "in_global_search": 1, 
+   "in_global_search": 0, 
    "in_list_view": 0, 
-   "in_standard_filter": 1, 
-   "label": "Program", 
+   "in_standard_filter": 0, 
+   "label": "Start Date", 
    "length": 0, 
    "no_copy": 0, 
-   "options": "Program", 
    "permlevel": 0, 
    "precision": "", 
    "print_hide": 0, 
@@ -161,11 +196,163 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
-   "fieldname": "academic_term", 
+   "description": "", 
+   "fieldname": "validity", 
+   "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": "Validity in Days", 
+   "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": "end_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": "End 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": 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": "bank_guarantee_number", 
+   "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": "Bank Guarantee Number", 
+   "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": 1
+  }, 
+  {
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 1, 
+   "columns": 0, 
+   "fieldname": "section_break_10", 
+   "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": "More Information", 
+   "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": "more_information", 
+   "fieldtype": "Text Editor", 
+   "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": "Notes", 
+   "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, 
@@ -173,134 +360,15 @@
    "in_filter": 0, 
    "in_global_search": 0, 
    "in_list_view": 0, 
-   "in_standard_filter": 1, 
-   "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_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "section_break_6", 
-   "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": "Students", 
+   "label": "Amended From", 
    "length": 0, 
-   "no_copy": 0, 
+   "no_copy": 1, 
+   "options": "Bank Guarantee", 
    "permlevel": 0, 
-   "precision": "", 
-   "print_hide": 0, 
+   "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_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "students", 
-   "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": "Students", 
-   "length": 0, 
-   "no_copy": 0, 
-   "options": "Student Batch 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": 0, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "unique": 0
-  }, 
-  {
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "section_break_8", 
-   "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": "Instructors", 
-   "length": 0, 
-   "no_copy": 0, 
-   "permlevel": 0, 
-   "precision": "", 
-   "print_hide": 0, 
-   "print_hide_if_no_value": 0, 
-   "read_only": 0, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 0, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "unique": 0
-  }, 
-  {
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "instructors", 
-   "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": "Instructors", 
-   "length": 0, 
-   "no_copy": 0, 
-   "options": "Student Batch Instructor", 
-   "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": 0, 
@@ -309,20 +377,20 @@
    "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, 
+ "is_submittable": 1, 
  "issingle": 0, 
  "istable": 0, 
  "max_attachments": 0, 
- "modified": "2017-02-17 17:17:00.460594", 
+ "modified": "2017-04-25 13:31:49.627831", 
  "modified_by": "Administrator", 
- "module": "Schools", 
- "name": "Student Batch", 
+ "module": "Accounts", 
+ "name": "Bank Guarantee", 
  "name_case": "", 
  "owner": "Administrator", 
  "permissions": [
@@ -331,49 +399,50 @@
    "apply_user_permissions": 0, 
    "cancel": 0, 
    "create": 1, 
-   "delete": 1, 
+   "delete": 0, 
    "email": 1, 
    "export": 1, 
    "if_owner": 0, 
-   "import": 1, 
+   "import": 0, 
    "permlevel": 0, 
    "print": 1, 
    "read": 1, 
    "report": 1, 
-   "role": "Academics User", 
+   "role": "Accounts User", 
    "set_user_permissions": 0, 
    "share": 1, 
-   "submit": 0, 
+   "submit": 1, 
    "write": 1
   }, 
   {
    "amend": 0, 
    "apply_user_permissions": 0, 
-   "cancel": 0, 
-   "create": 0, 
-   "delete": 0, 
-   "email": 0, 
-   "export": 0, 
+   "cancel": 1, 
+   "create": 1, 
+   "delete": 1, 
+   "email": 1, 
+   "export": 1, 
    "if_owner": 0, 
    "import": 0, 
    "permlevel": 0, 
-   "print": 0, 
+   "print": 1, 
    "read": 1, 
-   "report": 0, 
-   "role": "Instructor", 
+   "report": 1, 
+   "role": "Accounts Manager", 
    "set_user_permissions": 0, 
-   "share": 0, 
-   "submit": 0, 
-   "write": 0
+   "share": 1, 
+   "submit": 1, 
+   "write": 1
   }
  ], 
  "quick_entry": 1, 
  "read_only": 0, 
  "read_only_onload": 0, 
+ "search_fields": "customer", 
  "show_name_in_global_search": 0, 
  "sort_field": "modified", 
  "sort_order": "DESC", 
- "title_field": "", 
+ "title_field": "customer", 
  "track_changes": 0, 
  "track_seen": 0
 }
\ No newline at end of file
diff --git a/erpnext/schools/doctype/assessment_code/assessment_code.py b/erpnext/accounts/doctype/bank_guarantee/bank_guarantee.py
similarity index 87%
rename from erpnext/schools/doctype/assessment_code/assessment_code.py
rename to erpnext/accounts/doctype/bank_guarantee/bank_guarantee.py
index 175564e..71647b9 100644
--- a/erpnext/schools/doctype/assessment_code/assessment_code.py
+++ b/erpnext/accounts/doctype/bank_guarantee/bank_guarantee.py
@@ -6,5 +6,5 @@
 import frappe
 from frappe.model.document import Document
 
-class AssessmentCode(Document):
+class BankGuarantee(Document):
 	pass
diff --git a/erpnext/schools/doctype/student_batch/test_student_batch.py b/erpnext/accounts/doctype/bank_guarantee/test_bank_guarantee.py
similarity index 64%
rename from erpnext/schools/doctype/student_batch/test_student_batch.py
rename to erpnext/accounts/doctype/bank_guarantee/test_bank_guarantee.py
index 55796ee..0e56991 100644
--- a/erpnext/schools/doctype/student_batch/test_student_batch.py
+++ b/erpnext/accounts/doctype/bank_guarantee/test_bank_guarantee.py
@@ -6,7 +6,7 @@
 import frappe
 import unittest
 
-# test_records = frappe.get_test_records('Student Batch')
+# test_records = frappe.get_test_records('Bank Guarantee')
 
-class TestStudentBatch(unittest.TestCase):
+class TestBankGuarantee(unittest.TestCase):
 	pass
diff --git a/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.js b/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.js
index 956f15a..7c94455 100644
--- a/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.js
+++ b/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.js
@@ -3,13 +3,13 @@
 
 frappe.ui.form.on("Bank Reconciliation", {
 	setup: function(frm) {
-		frm.get_docfield("payment_entries").allow_bulk_edit = 1;
 		frm.add_fetch("bank_account", "account_currency", "account_currency");
 	},
 
 	onload: function(frm) {
-		var default_bank_account =  locals[":Company"][frappe.defaults.get_user_default("Company")]["default_bank_account"];
 
+		let default_bank_account =  frappe.defaults.get_user_default("Company")? 
+			locals[":Company"][frappe.defaults.get_user_default("Company")]["default_bank_account"]: "";
 		frm.set_value("bank_account", default_bank_account);
 
 		frm.set_query("bank_account", function() {
diff --git a/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.json b/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.json
index b83dc7c..0294219 100644
--- a/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.json
+++ b/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.json
@@ -1,5 +1,6 @@
 {
  "allow_copy": 1, 
+ "allow_guest_to_view": 0, 
  "allow_import": 0, 
  "allow_rename": 0, 
  "beta": 0, 
@@ -7,11 +8,15 @@
  "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, 
    "description": "Select account head of the bank where cheque was deposited.", 
    "fieldname": "bank_account", 
    "fieldtype": "Link", 
@@ -19,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": "Bank Account", 
    "length": 0, 
    "no_copy": 0, 
@@ -28,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, 
@@ -35,16 +43,20 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
+   "columns": 0, 
    "fieldname": "account_currency", 
    "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": "Account Currency", 
    "length": 0, 
    "no_copy": 0, 
@@ -53,6 +65,7 @@
    "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, 
@@ -60,16 +73,20 @@
    "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": 0, 
    "label": "From Date", 
    "length": 0, 
    "no_copy": 0, 
@@ -77,6 +94,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, 
@@ -84,16 +102,20 @@
    "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, 
@@ -101,6 +123,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, 
@@ -108,16 +131,20 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
+   "columns": 0, 
    "fieldname": "include_reconciled_entries", 
    "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": "Include Reconciled Entries", 
    "length": 0, 
    "no_copy": 0, 
@@ -125,6 +152,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, 
@@ -132,16 +160,20 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
+   "columns": 0, 
    "fieldname": "get_payment_entries", 
    "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": "Get Payment Entries", 
    "length": 0, 
    "no_copy": 0, 
@@ -150,6 +182,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, 
@@ -157,16 +190,20 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 1, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
+   "columns": 0, 
    "fieldname": "payment_entries", 
    "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 Entries", 
    "length": 0, 
    "no_copy": 0, 
@@ -175,6 +212,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, 
@@ -182,16 +220,20 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
+   "columns": 0, 
    "fieldname": "update_clearance_date", 
    "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": "Update Clearance Date", 
    "length": 0, 
    "no_copy": 0, 
@@ -200,6 +242,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, 
@@ -207,16 +250,20 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
+   "columns": 0, 
    "fieldname": "total_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": "Total Amount", 
    "length": 0, 
    "no_copy": 0, 
@@ -225,6 +272,7 @@
    "print_hide": 0, 
    "print_hide_if_no_value": 0, 
    "read_only": 1, 
+   "remember_last_selected_value": 0, 
    "report_hide": 0, 
    "reqd": 0, 
    "search_index": 0, 
@@ -232,19 +280,19 @@
    "unique": 0
   }
  ], 
+ "has_web_view": 0, 
  "hide_heading": 1, 
  "hide_toolbar": 1, 
  "icon": "fa fa-check", 
  "idx": 1, 
  "image_view": 0, 
  "in_create": 0, 
- "in_dialog": 0, 
  "is_submittable": 0, 
  "issingle": 1, 
  "istable": 0, 
  "max_attachments": 0, 
  "menu_index": 0, 
- "modified": "2016-06-28 13:11:09.396353", 
+ "modified": "2017-04-21 16:58:26.902732", 
  "modified_by": "Administrator", 
  "module": "Accounts", 
  "name": "Bank Reconciliation", 
@@ -274,7 +322,8 @@
  "quick_entry": 1, 
  "read_only": 1, 
  "read_only_onload": 0, 
+ "show_name_in_global_search": 0, 
  "sort_order": "ASC", 
- "track_seen": 0, 
- "version": 0
+ "track_changes": 0, 
+ "track_seen": 0
 }
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/gl_entry/gl_entry.json b/erpnext/accounts/doctype/gl_entry/gl_entry.json
index cb3aea0..b1a4129 100644
--- a/erpnext/accounts/doctype/gl_entry/gl_entry.json
+++ b/erpnext/accounts/doctype/gl_entry/gl_entry.json
@@ -1,5 +1,6 @@
 {
  "allow_copy": 0, 
+ "allow_guest_to_view": 0, 
  "allow_import": 0, 
  "allow_rename": 0, 
  "autoname": "GL.#######", 
@@ -12,6 +13,7 @@
  "editable_grid": 0, 
  "fields": [
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -22,6 +24,7 @@
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
    "in_filter": 1, 
+   "in_global_search": 0, 
    "in_list_view": 1, 
    "in_standard_filter": 0, 
    "label": "Posting Date", 
@@ -41,6 +44,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -51,6 +55,7 @@
    "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", 
@@ -70,6 +75,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -80,6 +86,7 @@
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
    "in_filter": 1, 
+   "in_global_search": 0, 
    "in_list_view": 1, 
    "in_standard_filter": 1, 
    "label": "Account", 
@@ -100,6 +107,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -110,6 +118,7 @@
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
    "in_filter": 0, 
+   "in_global_search": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Party Type", 
@@ -128,6 +137,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -138,6 +148,7 @@
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
    "in_filter": 0, 
+   "in_global_search": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 1, 
    "label": "Party", 
@@ -156,6 +167,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -166,6 +178,7 @@
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
    "in_filter": 1, 
+   "in_global_search": 0, 
    "in_list_view": 1, 
    "in_standard_filter": 0, 
    "label": "Cost Center", 
@@ -186,6 +199,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -196,6 +210,7 @@
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
    "in_filter": 0, 
+   "in_global_search": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Debit Amount", 
@@ -217,6 +232,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -227,6 +243,7 @@
    "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 Amount", 
@@ -248,6 +265,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -258,6 +276,7 @@
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
    "in_filter": 0, 
+   "in_global_search": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Account Currency", 
@@ -277,6 +296,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -287,6 +307,7 @@
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
    "in_filter": 0, 
+   "in_global_search": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Debit Amount in Account Currency", 
@@ -306,6 +327,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -316,6 +338,7 @@
    "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 Amount in Account Currency", 
@@ -335,6 +358,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -345,6 +369,7 @@
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
    "in_filter": 1, 
+   "in_global_search": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Against", 
@@ -364,6 +389,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -374,6 +400,7 @@
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
    "in_filter": 0, 
+   "in_global_search": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Against Voucher Type", 
@@ -394,6 +421,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -404,6 +432,7 @@
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
    "in_filter": 1, 
+   "in_global_search": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Against Voucher", 
@@ -424,6 +453,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -434,6 +464,7 @@
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
    "in_filter": 1, 
+   "in_global_search": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Voucher Type", 
@@ -454,6 +485,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -464,6 +496,7 @@
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
    "in_filter": 1, 
+   "in_global_search": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 1, 
    "label": "Voucher No", 
@@ -484,6 +517,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -494,6 +528,7 @@
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
    "in_filter": 0, 
+   "in_global_search": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Project", 
@@ -513,6 +548,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -523,6 +559,7 @@
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
    "in_filter": 1, 
+   "in_global_search": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Remarks", 
@@ -542,6 +579,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -552,6 +590,7 @@
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
    "in_filter": 1, 
+   "in_global_search": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Is Opening", 
@@ -572,6 +611,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -582,6 +622,7 @@
    "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 Advance", 
@@ -602,6 +643,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -612,6 +654,7 @@
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
    "in_filter": 1, 
+   "in_global_search": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Fiscal Year", 
@@ -632,6 +675,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -642,6 +686,7 @@
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
    "in_filter": 1, 
+   "in_global_search": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Company", 
@@ -662,18 +707,18 @@
    "unique": 0
   }
  ], 
+ "has_web_view": 0, 
  "hide_heading": 0, 
  "hide_toolbar": 0, 
  "icon": "fa fa-list", 
  "idx": 1, 
  "image_view": 0, 
  "in_create": 1, 
- "in_dialog": 0, 
  "is_submittable": 0, 
  "issingle": 0, 
  "istable": 0, 
  "max_attachments": 0, 
- "modified": "2016-12-15 14:44:41.098790", 
+ "modified": "2017-04-27 13:18:06.617940", 
  "modified_by": "Administrator", 
  "module": "Accounts", 
  "name": "GL Entry", 
@@ -689,7 +734,6 @@
    "export": 1, 
    "if_owner": 0, 
    "import": 0, 
-   "is_custom": 0, 
    "permlevel": 0, 
    "print": 1, 
    "read": 1, 
@@ -710,7 +754,6 @@
    "export": 1, 
    "if_owner": 0, 
    "import": 0, 
-   "is_custom": 0, 
    "permlevel": 0, 
    "print": 1, 
    "read": 1, 
@@ -731,7 +774,6 @@
    "export": 1, 
    "if_owner": 0, 
    "import": 0, 
-   "is_custom": 0, 
    "permlevel": 0, 
    "print": 0, 
    "read": 1, 
@@ -744,10 +786,12 @@
   }
  ], 
  "quick_entry": 1, 
- "read_only": 0, 
+ "read_only": 1, 
  "read_only_onload": 0, 
  "search_fields": "voucher_no,account,posting_date,against_voucher", 
+ "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/gl_entry/gl_entry.py b/erpnext/accounts/doctype/gl_entry/gl_entry.py
index ce60298..304af37 100644
--- a/erpnext/accounts/doctype/gl_entry/gl_entry.py
+++ b/erpnext/accounts/doctype/gl_entry/gl_entry.py
@@ -2,13 +2,12 @@
 # License: GNU General Public License v3. See license.txt
 
 from __future__ import unicode_literals
-import frappe
+import frappe, erpnext
 from frappe import _
 from frappe.utils import flt, fmt_money, getdate, formatdate
 from frappe.model.document import Document
 from erpnext.accounts.party import validate_party_gle_currency, validate_party_frozen_disabled
 from erpnext.accounts.utils import get_account_currency
-from erpnext.setup.doctype.company.company import get_company_currency
 from erpnext.accounts.utils import get_fiscal_year
 from erpnext.exceptions import InvalidAccountCurrency
 
@@ -19,7 +18,7 @@
 		self.flags.ignore_submit_comment = True
 		self.check_mandatory()
 		self.validate_and_set_fiscal_year()
-		
+
 		if not self.flags.from_repost:
 			self.pl_must_have_cost_center()
 			self.check_pl_account()
@@ -32,7 +31,7 @@
 		if not from_repost:
 			self.validate_account_details(adv_adj)
 			check_freezing_date(self.posting_date, adv_adj)
-			
+
 		validate_frozen_account(self.account, adv_adj)
 		validate_balance_type(self.account, adv_adj)
 
@@ -56,7 +55,7 @@
 			elif account_type == "Payable":
 				frappe.throw(_("{0} {1}: Supplier is required against Payable account {2}")
 					.format(self.voucher_type, self.voucher_no, self.account))
-				
+
 		# Zero value transaction is not allowed
 		if not (flt(self.debit) or flt(self.credit)):
 			frappe.throw(_("{0} {1}: Either debit or credit amount is required for {2}")
@@ -116,7 +115,7 @@
 		validate_party_frozen_disabled(self.party_type, self.party)
 
 	def validate_currency(self):
-		company_currency = get_company_currency(self.company)
+		company_currency = erpnext.get_company_currency(self.company)
 		account_currency = get_account_currency(self.account)
 
 		if not self.account_currency:
@@ -124,7 +123,7 @@
 
 		if account_currency != self.account_currency:
 			frappe.throw(_("{0} {1}: Accounting Entry for {2} can only be made in currency: {3}")
-				.format(self.voucher_type, self.voucher_no, self.account, 
+				.format(self.voucher_type, self.voucher_no, self.account,
 				(account_currency or company_currency)), InvalidAccountCurrency)
 
 		if self.party_type and self.party:
diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry.json b/erpnext/accounts/doctype/journal_entry/journal_entry.json
index deb252c..fb93121 100644
--- a/erpnext/accounts/doctype/journal_entry/journal_entry.json
+++ b/erpnext/accounts/doctype/journal_entry/journal_entry.json
@@ -1,5 +1,6 @@
 {
  "allow_copy": 0, 
+ "allow_guest_to_view": 0, 
  "allow_import": 1, 
  "allow_rename": 0, 
  "autoname": "naming_series:", 
@@ -1325,19 +1326,19 @@
    "unique": 0
   }
  ], 
+ "has_web_view": 0, 
  "hide_heading": 0, 
  "hide_toolbar": 0, 
  "icon": "fa fa-file-text", 
  "idx": 176, 
  "image_view": 0, 
  "in_create": 0, 
- "in_dialog": 0, 
  "is_submittable": 1, 
  "issingle": 0, 
  "istable": 0, 
  "max_attachments": 0, 
  "menu_index": 0, 
- "modified": "2017-02-17 16:17:48.991851", 
+ "modified": "2017-04-10 12:07:44.599804", 
  "modified_by": "Administrator", 
  "module": "Accounts", 
  "name": "Journal Entry", 
@@ -1412,6 +1413,6 @@
  "sort_field": "modified", 
  "sort_order": "DESC", 
  "title_field": "title", 
- "track_changes": 0, 
+ "track_changes": 1, 
  "track_seen": 0
 }
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry.py b/erpnext/accounts/doctype/journal_entry/journal_entry.py
index 06724b1..34d9de7 100644
--- a/erpnext/accounts/doctype/journal_entry/journal_entry.py
+++ b/erpnext/accounts/doctype/journal_entry/journal_entry.py
@@ -2,12 +2,11 @@
 # License: GNU General Public License v3. See license.txt
 
 from __future__ import unicode_literals
-import frappe, json
+import frappe, erpnext, json
 from frappe.utils import cstr, flt, fmt_money, formatdate
 from frappe import msgprint, _, scrub
 from erpnext.controllers.accounts_controller import AccountsController
 from erpnext.accounts.utils import get_balance_on, get_account_currency
-from erpnext.setup.utils import get_company_currency
 from erpnext.accounts.party import get_party_account
 from erpnext.hr.doctype.expense_claim.expense_claim import update_reimbursed_amount
 from erpnext.hr.doctype.employee_loan.employee_loan import update_disbursement_status
@@ -73,6 +72,7 @@
 		self.update_expense_claim()
 		self.update_employee_loan()
 		self.unlink_advance_entry_reference()
+		self.unlink_asset_reference()
 
 	def unlink_advance_entry_reference(self):
 		for d in self.get("accounts"):
@@ -82,6 +82,18 @@
 				d.reference_type = ''
 				d.reference_name = ''
 				d.db_update()
+				
+	def unlink_asset_reference(self):
+		for d in self.get("accounts"):
+			if d.reference_type=="Asset" and d.reference_name:
+				asset = frappe.get_doc("Asset", d.reference_name)
+				for s in asset.get("schedules"):
+					if s.journal_entry == self.name:
+						s.db_set("journal_entry", None)
+						asset.value_after_depreciation += s.depreciation_amount
+
+						asset.db_set("value_after_depreciation", asset.value_after_depreciation)
+						asset.set_status()
 
 	def validate_party(self):
 		for d in self.get("accounts"):
@@ -325,11 +337,11 @@
 			if d.account_currency == self.company_currency:
 				d.exchange_rate = 1
 			elif not d.exchange_rate or d.exchange_rate == 1 or \
-				(d.reference_type in ("Sales Invoice", "Purchase Invoice") 
+				(d.reference_type in ("Sales Invoice", "Purchase Invoice")
 				and d.reference_name and self.posting_date):
-				
+
 					# Modified to include the posting date for which to retreive the exchange rate
-					d.exchange_rate = get_exchange_rate(self.posting_date, d.account, d.account_currency, 
+					d.exchange_rate = get_exchange_rate(self.posting_date, d.account, d.account_currency,
 						self.company, d.reference_type, d.reference_name, d.debit, d.credit, d.exchange_rate)
 
 			if not d.exchange_rate:
@@ -502,7 +514,7 @@
 
 	def update_expense_claim(self):
 		for d in self.accounts:
-			if d.reference_type=="Expense Claim" and d.party:
+			if d.reference_type=="Expense Claim" and d.reference_name:
 				doc = frappe.get_doc("Expense Claim", d.reference_name)
 				update_reimbursed_amount(doc)
 
@@ -656,7 +668,7 @@
 	if args.get("party_account"):
 		# Modified to include the posting date for which the exchange rate is required.
 		# Assumed to be the posting date in the reference document
-		exchange_rate = get_exchange_rate(ref_doc.get("posting_date") or ref_doc.get("transaction_date"), 
+		exchange_rate = get_exchange_rate(ref_doc.get("posting_date") or ref_doc.get("transaction_date"),
 			args.get("party_account"), args.get("party_account_currency"),
 			ref_doc.company, ref_doc.doctype, ref_doc.name)
 
@@ -692,8 +704,8 @@
 		bank_row.update(bank_account)
 		# Modified to include the posting date for which the exchange rate is required.
 		# Assumed to be the posting date of the reference date
-		bank_row.exchange_rate = get_exchange_rate(ref_doc.get("posting_date") 
-			or ref_doc.get("transaction_date"), bank_account["account"], 
+		bank_row.exchange_rate = get_exchange_rate(ref_doc.get("posting_date")
+			or ref_doc.get("transaction_date"), bank_account["account"],
 			bank_account["account_currency"], ref_doc.company)
 
 	bank_row.cost_center = cost_center
@@ -746,7 +758,7 @@
 	if isinstance(args, basestring):
 		args = json.loads(args)
 
-	company_currency = get_company_currency(args.get("company"))
+	company_currency = erpnext.get_company_currency(args.get("company"))
 
 	if args.get("doctype") == "Journal Entry":
 		condition = " and party=%(party)s" if args.get("party") else ""
@@ -805,7 +817,7 @@
 	if not frappe.has_permission("Account"):
 		frappe.msgprint(_("No Permission"), raise_exception=1)
 
-	company_currency = get_company_currency(company)
+	company_currency = erpnext.get_company_currency(company)
 	account_details = frappe.db.get_value("Account", account, ["account_type", "account_currency"], as_dict=1)
 
 	if not account_details:
@@ -853,7 +865,7 @@
 	if not account_currency:
 		account_currency = account_details.account_currency
 
-	company_currency = get_company_currency(company)
+	company_currency = erpnext.get_company_currency(company)
 
 	if account_currency != company_currency:
 		if reference_type in ("Sales Invoice", "Purchase Invoice") and reference_name:
diff --git a/erpnext/accounts/doctype/payment_entry/payment_entry.js b/erpnext/accounts/doctype/payment_entry/payment_entry.js
index 50bfbd3..2eef79c 100644
--- a/erpnext/accounts/doctype/payment_entry/payment_entry.js
+++ b/erpnext/accounts/doctype/payment_entry/payment_entry.js
@@ -147,6 +147,7 @@
 		var currency_field = (frm.doc.payment_type=="Receive") ? "paid_from_account_currency" : "paid_to_account_currency"
 		frm.set_df_property("total_allocated_amount", "options", currency_field);
 		frm.set_df_property("unallocated_amount", "options", currency_field);
+		frm.set_df_property("party_balance", "options", currency_field);
 
 		frm.set_currency_labels(["total_amount", "outstanding_amount", "allocated_amount"],
 			party_account_currency, "references");
diff --git a/erpnext/accounts/doctype/payment_entry/payment_entry.json b/erpnext/accounts/doctype/payment_entry/payment_entry.json
index 7fac377..7c6ed84 100644
--- a/erpnext/accounts/doctype/payment_entry/payment_entry.json
+++ b/erpnext/accounts/doctype/payment_entry/payment_entry.json
@@ -1675,7 +1675,7 @@
  "issingle": 0, 
  "istable": 0, 
  "max_attachments": 0, 
- "modified": "2017-03-14 17:12:48.816644", 
+ "modified": "2017-04-10 12:06:22.176045", 
  "modified_by": "Administrator", 
  "module": "Accounts", 
  "name": "Payment Entry", 
@@ -1730,6 +1730,6 @@
  "sort_field": "modified", 
  "sort_order": "DESC", 
  "title_field": "title", 
- "track_changes": 0, 
+ "track_changes": 1, 
  "track_seen": 0
 }
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/payment_request/payment_request.json b/erpnext/accounts/doctype/payment_request/payment_request.json
index c1580f6..738206c 100644
--- a/erpnext/accounts/doctype/payment_request/payment_request.json
+++ b/erpnext/accounts/doctype/payment_request/payment_request.json
@@ -1,5 +1,6 @@
 {
  "allow_copy": 0, 
+ "allow_guest_to_view": 0, 
  "allow_import": 0, 
  "allow_rename": 0, 
  "autoname": "naming_series:", 
@@ -13,6 +14,7 @@
  "engine": "InnoDB", 
  "fields": [
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -43,6 +45,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -72,6 +75,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -103,6 +107,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -132,6 +137,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -161,6 +167,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -189,6 +196,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -219,6 +227,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -249,6 +258,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -280,6 +290,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -311,6 +322,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -341,6 +353,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -369,6 +382,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -398,6 +412,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -428,6 +443,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -457,6 +473,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -486,6 +503,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 1, 
@@ -516,6 +534,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -546,6 +565,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -576,6 +596,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -605,6 +626,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -635,6 +657,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -665,6 +688,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -694,17 +718,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": 1, 
  "issingle": 0, 
  "istable": 0, 
  "max_attachments": 0, 
- "modified": "2017-02-23 05:03:37.464863", 
+ "modified": "2017-05-08 12:09:25.759145", 
  "modified_by": "Administrator", 
  "module": "Accounts", 
  "name": "Payment Request", 
diff --git a/erpnext/accounts/doctype/payment_request/payment_request.py b/erpnext/accounts/doctype/payment_request/payment_request.py
index fdb598e..4694ef8 100644
--- a/erpnext/accounts/doctype/payment_request/payment_request.py
+++ b/erpnext/accounts/doctype/payment_request/payment_request.py
@@ -14,9 +14,14 @@
 
 class PaymentRequest(Document):
 	def validate(self):
+		self.validate_reference_document()
 		self.validate_payment_request()
 		self.validate_currency()
 
+	def validate_reference_document(self):
+		if not self.reference_doctype or not self.reference_name:
+			frappe.throw(_("To create a Payment Request reference document is required"))
+
 	def validate_payment_request(self):
 		if frappe.db.get_value("Payment Request", {"reference_name": self.reference_name,
 			"name": ("!=", self.name), "status": ("not in", ["Initiated", "Paid"]), "docstatus": 1}, "name"):
diff --git a/erpnext/accounts/doctype/pricing_rule/pricing_rule.py b/erpnext/accounts/doctype/pricing_rule/pricing_rule.py
index 93685db..71897d4 100644
--- a/erpnext/accounts/doctype/pricing_rule/pricing_rule.py
+++ b/erpnext/accounts/doctype/pricing_rule/pricing_rule.py
@@ -23,6 +23,8 @@
 		self.validate_price_or_discount()
 		self.validate_max_discount()
 
+		if not self.margin_type: self.margin_rate_or_amount = 0.0
+
 	def validate_mandatory(self):
 		for field in ["apply_on", "applicable_for"]:
 			tocheck = frappe.scrub(self.get(field) or "")
@@ -144,7 +146,7 @@
 	
 	if args.ignore_pricing_rule or not args.item_code:
 		if frappe.db.exists(args.doctype, args.name) and args.get("pricing_rule"):
-			item_details = remove_pricing_rule(args, item_details)
+			item_details = remove_pricing_rule_for_item(args.get("pricing_rule"), item_details)
 		return item_details
 
 	if not (args.item_group and args.brand):
@@ -178,19 +180,20 @@
 		item_details.margin_rate_or_amount = pricing_rule.margin_rate_or_amount
 		if pricing_rule.price_or_discount == "Price":
 			item_details.update({
-				"price_list_rate": pricing_rule.price/flt(args.conversion_rate) \
+				"price_list_rate": (pricing_rule.price/flt(args.conversion_rate)) * args.conversion_factor or 1.0 \
 					if args.conversion_rate else 0.0,
 				"discount_percentage": 0.0
 			})
 		else:
 			item_details.discount_percentage = pricing_rule.discount_percentage
 	elif args.get('pricing_rule'):
-		item_details = remove_pricing_rule(args, item_details)
+		item_details = remove_pricing_rule_for_item(args.get("pricing_rule"), item_details)
 
 	return item_details
 
-def remove_pricing_rule(args, item_details):
-	pricing_rule = frappe.db.get_value('Pricing Rule', args.get('pricing_rule'), ['price_or_discount', 'margin_type'], as_dict=1)
+def remove_pricing_rule_for_item(pricing_rule, item_details):
+	pricing_rule = frappe.db.get_value('Pricing Rule', pricing_rule, 
+		['price_or_discount', 'margin_type'], as_dict=1)
 	if pricing_rule and pricing_rule.price_or_discount == 'Discount Percentage':
 		item_details.discount_percentage = 0.0
 
@@ -198,8 +201,22 @@
 		item_details.margin_rate_or_amount = 0.0
 		item_details.margin_type = None
 
+	if item_details.pricing_rule:
+		item_details.pricing_rule = None
 	return item_details
 
+@frappe.whitelist()
+def remove_pricing_rules(item_list):
+	if isinstance(item_list, basestring):
+		item_list = json.loads(item_list)
+	
+	out = []	
+	for item in item_list:
+		item = frappe._dict(item)
+		out.append(remove_pricing_rule_for_item(item.get("pricing_rule"), item))
+		
+	return out
+	
 def get_pricing_rules(args):
 	def _get_tree_conditions(parenttype, allow_blank=True):
 		field = frappe.scrub(parenttype)
@@ -268,9 +285,10 @@
 
 def filter_pricing_rules(args, pricing_rules):
 	# filter for qty
+	stock_qty = args.get('qty') * args.get('conversion_factor', 1)
 	if pricing_rules:
-		pricing_rules = filter(lambda x: (flt(args.get("qty"))>=flt(x.min_qty)
-			and (flt(args.get("qty"))<=x.max_qty if x.max_qty else True)), pricing_rules)
+		pricing_rules = filter(lambda x: (flt(stock_qty)>=flt(x.min_qty)
+			and (flt(stock_qty)<=x.max_qty if x.max_qty else True)), pricing_rules)
 
 		# add variant_of property in pricing rule
 		for p in pricing_rules:
diff --git a/erpnext/accounts/doctype/pricing_rule/test_pricing_rule.py b/erpnext/accounts/doctype/pricing_rule/test_pricing_rule.py
index 814c5c0..31b1d46 100644
--- a/erpnext/accounts/doctype/pricing_rule/test_pricing_rule.py
+++ b/erpnext/accounts/doctype/pricing_rule/test_pricing_rule.py
@@ -5,6 +5,9 @@
 from __future__ import unicode_literals
 import unittest
 import frappe
+from erpnext.selling.doctype.sales_order.test_sales_order import make_sales_order
+from erpnext.stock.get_item_details import get_item_details
+from frappe import MandatoryError
 
 class TestPricingRule(unittest.TestCase):
 	def test_pricing_rule_for_discount(self):
@@ -203,3 +206,46 @@
 
 		details = get_item_details(args)
 		self.assertEquals(details.get("discount_percentage"), 17.5)
+
+	def test_pricing_rule_for_stock_qty(self):
+		frappe.db.sql("delete from `tabPricing Rule`")
+
+		test_record = {
+			"doctype": "Pricing Rule",
+			"title": "_Test Pricing Rule",
+			"apply_on": "Item Code",
+			"item_code": "_Test Item",
+			"selling": 1,
+			"price_or_discount": "Discount Percentage",
+			"price": 0,
+			"min_qty": 5,
+			"max_qty": 7,
+			"discount_percentage": 17.5,
+			"company": "_Test Company"
+		}
+		frappe.get_doc(test_record.copy()).insert()
+
+		if not frappe.db.get_value('UOM Conversion Detail',
+			{'parent': '_Test Item', 'uom': 'box'}):
+			item = frappe.get_doc('Item', '_Test Item')
+			item.append('uoms', {
+				'uom': 'Box',
+				'conversion_factor': 5
+			})
+			item.save(ignore_permissions=True)
+
+		# With pricing rule
+		so = make_sales_order(item_code="_Test Item", qty=1, uom="Box", do_not_submit=True)
+		so.items[0].price_list_rate = 100
+		so.submit()
+		so = frappe.get_doc('Sales Order', so.name)
+		self.assertEquals(so.items[0].discount_percentage, 17.5)
+		self.assertEquals(so.items[0].rate, 82.5)
+
+		# Without pricing rule
+		so = make_sales_order(item_code="_Test Item", qty=2, uom="Box", do_not_submit=True)
+		so.items[0].price_list_rate = 100
+		so.submit()
+		so = frappe.get_doc('Sales Order', so.name)
+		self.assertEquals(so.items[0].discount_percentage, 0)
+		self.assertEquals(so.items[0].rate, 100)
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js
index 6ee9e66..b48fb20 100644
--- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js
+++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js
@@ -2,8 +2,7 @@
 // License: GNU General Public License v3. See license.txt
 
 frappe.provide("erpnext.accounts");
-{% include 'erpnext/buying/doctype/purchase_common/purchase_common.js' %};
-
+{% include 'erpnext/public/js/controllers/buying.js' %};
 
 erpnext.accounts.PurchaseInvoice = erpnext.buying.BuyingController.extend({
 	setup: function(doc) {
@@ -50,29 +49,38 @@
 		}
 
 		if(doc.docstatus===0) {
-			cur_frm.add_custom_button(__('Purchase Order'), function() {
+			var me = this;
+			this.frm.add_custom_button(__('Purchase Order'), function() {
 				erpnext.utils.map_current_doc({
 					method: "erpnext.buying.doctype.purchase_order.purchase_order.make_purchase_invoice",
 					source_doctype: "Purchase Order",
+					target: me.frm,
+					setters: {
+						supplier: me.frm.doc.supplier || undefined,
+					},
 					get_query_filters: {
-						supplier: cur_frm.doc.supplier || undefined,
 						docstatus: 1,
 						status: ["!=", "Closed"],
 						per_billed: ["<", 99.99],
-						company: cur_frm.doc.company
+						company: me.frm.doc.company
 					}
 				})
 			}, __("Get items from"));
 
-			cur_frm.add_custom_button(__('Purchase Receipt'), function() {
+			this.frm.add_custom_button(__('Purchase Receipt'), function() {
 				erpnext.utils.map_current_doc({
 					method: "erpnext.stock.doctype.purchase_receipt.purchase_receipt.make_purchase_invoice",
 					source_doctype: "Purchase Receipt",
+					target: me.frm,
+					date_field: "posting_date",
+					setters: {
+						supplier: me.frm.doc.supplier || undefined,
+					},
 					get_query_filters: {
-						supplier: cur_frm.doc.supplier || undefined,
 						docstatus: 1,
 						status: ["!=", "Closed"],
-						company: cur_frm.doc.company
+						company: me.frm.doc.company,
+						is_return: 0
 					}
 				})
 			}, __("Get items from"));
@@ -121,7 +129,7 @@
 		hide_fields(this.frm.doc);
 		if(cint(this.frm.doc.is_paid)) {
 			if(!this.frm.doc.company) {
-				cur_frm.set_value("is_paid", 0)
+				this.frm.set_value("is_paid", 0)
 				msgprint(__("Please specify Company to proceed"));
 			}
 		}
diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json
index 26c4fa9..ba73a15 100755
--- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json
+++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json
@@ -13,6 +13,7 @@
  "editable_grid": 0, 
  "fields": [
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 1, 
    "bold": 0, 
    "collapsible": 0, 
@@ -43,6 +44,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -74,6 +76,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -105,6 +108,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 1, 
    "collapsible": 0, 
@@ -136,6 +140,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -166,6 +171,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -195,6 +201,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -224,6 +231,7 @@
    "width": "50%"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -253,6 +261,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -284,6 +293,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -315,6 +325,7 @@
    "width": "100px"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -334,7 +345,7 @@
    "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, 
@@ -345,6 +356,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -376,6 +388,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 1, 
@@ -406,6 +419,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -437,6 +451,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -465,6 +480,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -495,6 +511,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -525,6 +542,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -555,6 +573,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -586,6 +605,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 1, 
@@ -615,6 +635,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -644,6 +665,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -673,6 +695,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -702,6 +725,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -730,6 +754,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -758,6 +783,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -786,6 +812,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -814,6 +841,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -845,6 +873,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -874,6 +903,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 1, 
@@ -903,6 +933,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -934,6 +965,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -966,6 +998,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -993,6 +1026,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1022,6 +1056,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1051,6 +1086,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1080,6 +1116,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1108,6 +1145,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1138,6 +1176,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1168,6 +1207,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1199,6 +1239,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1226,6 +1267,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1256,6 +1298,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1288,6 +1331,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1315,6 +1359,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1345,6 +1390,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1376,6 +1422,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1406,6 +1453,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1437,6 +1485,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1468,6 +1517,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1497,6 +1547,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1527,6 +1578,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1558,6 +1610,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1589,6 +1642,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1620,6 +1674,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1648,6 +1703,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1679,6 +1735,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1710,6 +1767,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1740,6 +1798,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 1, 
@@ -1770,6 +1829,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1801,6 +1861,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1831,6 +1892,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1859,6 +1921,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1888,6 +1951,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1918,6 +1982,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1946,6 +2011,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1977,6 +2043,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2008,6 +2075,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2037,6 +2105,7 @@
    "width": "50%"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2068,6 +2137,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2098,6 +2168,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2129,6 +2200,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2160,6 +2232,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 1, 
@@ -2191,6 +2264,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2221,6 +2295,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2251,6 +2326,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2279,6 +2355,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2310,6 +2387,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2340,6 +2418,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 1, 
@@ -2371,6 +2450,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2400,6 +2480,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2430,6 +2511,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2458,6 +2540,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2488,6 +2571,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2518,6 +2602,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 1, 
@@ -2549,6 +2634,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2579,6 +2665,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2610,6 +2697,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 1, 
@@ -2640,6 +2728,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2669,6 +2758,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2697,6 +2787,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2726,6 +2817,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2757,6 +2849,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2789,6 +2882,7 @@
    "width": "50px"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2819,6 +2913,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 1, 
@@ -2848,6 +2943,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 1, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2878,6 +2974,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 1, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2909,6 +3006,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2938,6 +3036,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 1, 
@@ -2968,6 +3067,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -3000,6 +3100,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -3030,6 +3131,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -3063,6 +3165,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -3093,6 +3196,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -3120,6 +3224,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -3151,6 +3256,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -3181,6 +3287,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -3212,6 +3319,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 1, 
@@ -3243,6 +3351,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 1, 
    "bold": 0, 
    "collapsible": 0, 
@@ -3273,6 +3382,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 1, 
    "bold": 0, 
    "collapsible": 0, 
@@ -3304,6 +3414,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 1, 
    "bold": 0, 
    "collapsible": 0, 
@@ -3334,6 +3445,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 1, 
    "bold": 0, 
    "collapsible": 0, 
@@ -3364,6 +3476,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 1, 
    "bold": 0, 
    "collapsible": 0, 
@@ -3394,6 +3507,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 1, 
    "bold": 0, 
    "collapsible": 0, 
@@ -3425,6 +3539,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 1, 
    "bold": 0, 
    "collapsible": 0, 
@@ -3455,6 +3570,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 1, 
    "bold": 0, 
    "collapsible": 0, 
@@ -3485,6 +3601,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -3513,6 +3630,7 @@
    "width": "50%"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -3543,6 +3661,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -3573,6 +3692,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 1, 
    "bold": 0, 
    "collapsible": 0, 
@@ -3603,6 +3723,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -3646,7 +3767,7 @@
  "istable": 0, 
  "max_attachments": 0, 
  "menu_index": 0, 
- "modified": "2017-03-15 14:29:51.957287", 
+ "modified": "2017-05-17 10:35:40.729350", 
  "modified_by": "Administrator", 
  "module": "Accounts", 
  "name": "Purchase Invoice", 
@@ -3762,6 +3883,6 @@
  "sort_order": "DESC", 
  "timeline_field": "supplier", 
  "title_field": "title", 
- "track_changes": 0, 
+ "track_changes": 1, 
  "track_seen": 0
 }
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py
index dd3b4ba..530d08a 100644
--- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py
+++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py
@@ -2,10 +2,9 @@
 # License: GNU General Public License v3. See license.txt
 
 from __future__ import unicode_literals
-import frappe
+import frappe, erpnext
 from frappe.utils import cint, formatdate, flt, getdate
 from frappe import _, throw
-from erpnext.setup.utils import get_company_currency
 import frappe.defaults
 
 from erpnext.controllers.buying_controller import BuyingController
@@ -15,6 +14,7 @@
 from erpnext.controllers.stock_controller import get_warehouse_account
 from erpnext.accounts.general_ledger import make_gl_entries, merge_similar_entries, delete_gl_entries
 from erpnext.accounts.doctype.gl_entry.gl_entry import update_outstanding_amt
+from erpnext.buying.utils import check_for_closed_status
 
 form_grid_templates = {
 	"items": "templates/form_grid/item_grid.html"
@@ -93,7 +93,7 @@
 		super(PurchaseInvoice, self).set_missing_values(for_validate)
 
 	def check_conversion_rate(self):
-		default_currency = get_company_currency(self.company)
+		default_currency = erpnext.get_company_currency(self.company)
 		if not default_currency:
 			throw(_('Please enter default currency in Company Master'))
 		if (self.currency == default_currency and flt(self.conversion_rate) != 1.00) or not self.conversion_rate or (self.currency != default_currency and flt(self.conversion_rate) == 1.00):
@@ -113,12 +113,11 @@
 
 	def check_for_closed_status(self):
 		check_list = []
-		pc_obj = frappe.get_doc('Purchase Common')
 
 		for d in self.get('items'):
 			if d.purchase_order and not d.purchase_order in check_list and not d.purchase_receipt:
 				check_list.append(d.purchase_order)
-				pc_obj.check_for_closed_status('Purchase Order', d.purchase_order)
+				check_for_closed_status('Purchase Order', d.purchase_order)
 
 	def validate_with_previous_doc(self):
 		super(PurchaseInvoice, self).validate_with_previous_doc({
@@ -205,7 +204,7 @@
 		if frappe.db.get_value("Buying Settings", None, "po_required") == 'Yes':
 			for d in self.get('items'):
 				if not d.purchase_order:
-					throw(_("Purchse Order number required for Item {0}").format(d.item_code))
+					throw(_("Purchase Order number required for Item {0}").format(d.item_code))
 
 	def pr_required(self):
 		stock_items = self.get_stock_items()
@@ -629,10 +628,12 @@
 				pi = frappe.db.sql('''select name from `tabPurchase Invoice`
 					where
 						bill_no = %(bill_no)s
+						and supplier = %(supplier)s
 						and name != %(name)s
 						and docstatus < 2
 						and posting_date between %(year_start_date)s and %(year_end_date)s''', {
 							"bill_no": self.bill_no,
+							"supplier": self.supplier,
 							"name": self.name,
 							"year_start_date": fiscal_year.year_start_date,
 							"year_end_date": fiscal_year.year_end_date
diff --git a/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.json b/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.json
index 6102d3e..36e5a1d 100755
--- a/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.json
+++ b/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.json
@@ -1,5 +1,6 @@
 {
  "allow_copy": 0, 
+ "allow_guest_to_view": 0, 
  "allow_import": 0, 
  "allow_rename": 0, 
  "autoname": "hash", 
@@ -340,6 +341,36 @@
    "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
+   "fieldname": "stock_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": "Stock UOM", 
+   "length": 0, 
+   "no_copy": 0, 
+   "options": "UOM", 
+   "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_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
    "fieldname": "col_break2", 
    "fieldtype": "Column Break", 
    "hidden": 0, 
@@ -424,6 +455,35 @@
    "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": 0, 
+   "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_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
    "fieldname": "sec_break1", 
    "fieldtype": "Section Break", 
    "hidden": 0, 
@@ -1362,11 +1422,11 @@
    "unique": 0
   }, 
   {
-   "allow_on_submit": 1, 
+   "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
-   "fieldname": "is_sample_item", 
+   "fieldname": "allow_zero_valuation_rate", 
    "fieldtype": "Check", 
    "hidden": 0, 
    "ignore_user_permissions": 0, 
@@ -1375,7 +1435,7 @@
    "in_global_search": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
-   "label": "Is Sample Item", 
+   "label": "Allow Zero Valuation Rate", 
    "length": 0, 
    "no_copy": 1, 
    "permlevel": 0, 
@@ -1448,7 +1508,7 @@
    "remember_last_selected_value": 0, 
    "report_hide": 0, 
    "reqd": 0, 
-   "search_index": 1, 
+   "search_index": 0, 
    "set_only_once": 0, 
    "unique": 0
   }, 
@@ -1869,17 +1929,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-17 16:28:26.719053", 
+ "modified": "2017-04-19 11:54:16.112134", 
  "modified_by": "Administrator", 
  "module": "Accounts", 
  "name": "Purchase Invoice Item", 
@@ -1893,4 +1953,4 @@
  "sort_order": "DESC", 
  "track_changes": 0, 
  "track_seen": 0
-}
\ No newline at end of file
+}
diff --git a/erpnext/accounts/doctype/sales_invoice/pos.py b/erpnext/accounts/doctype/sales_invoice/pos.py
index 59766bd..a899cde 100644
--- a/erpnext/accounts/doctype/sales_invoice/pos.py
+++ b/erpnext/accounts/doctype/sales_invoice/pos.py
@@ -32,7 +32,7 @@
 		'doc': doc,
 		'default_customer': pos_profile.get('customer'),
 		'items': get_items_list(pos_profile),
-		'item_groups': get_item_group(pos_profile),
+		'item_groups': get_item_groups(pos_profile),
 		'customers': customers,
 		'address': get_customers_address(customers),
 		'serial_no_data': get_serial_no_data(pos_profile, doc.company),
@@ -132,7 +132,7 @@
 	if pos_profile.get('item_groups'):
 		# Get items based on the item groups defined in the POS profile
 		for d in pos_profile.get('item_groups'):
-			item_groups.extend(get_child_nodes('Item Group', d.item_group))
+			item_groups.extend([d.name for d in get_child_nodes('Item Group', d.item_group)])
 		cond = "item_group in (%s)"%(', '.join(['%s']*len(item_groups)))
 
 	return frappe.db.sql(""" 
@@ -146,14 +146,19 @@
 			disabled = 0 and has_variants = 0 and is_sales_item = 1 and {cond}
 		""".format(cond=cond), tuple(item_groups), as_dict=1)
 
-def get_item_group(pos_profile):
+def get_item_groups(pos_profile):
+	item_group_dict = {}
 	if pos_profile.get('item_groups'):
 		item_groups = []
 		for d in pos_profile.get('item_groups'):
 			item_groups.extend(get_child_nodes('Item Group', d.item_group))
-		return item_groups
 	else:
-		return frappe.db.sql_list("""Select name from `tabItem Group` order by name""")
+		item_groups = frappe.db.sql("""Select name,
+			lft, rgt from `tabItem Group` order by lft""", as_dict=1)
+
+	for data in item_groups:
+		item_group_dict[data.name] = [data.lft, data.rgt]
+	return item_group_dict
 
 def get_customers_list(pos_profile):
 	cond = "1=1"
@@ -161,7 +166,7 @@
 	if pos_profile.get('customer_groups'):
 		# Get customers based on the customer groups defined in the POS profile
 		for d in pos_profile.get('customer_groups'):
-			customer_groups.extend(get_child_nodes('Customer Group', d.customer_group))
+			customer_groups.extend([d.name for d in get_child_nodes('Customer Group', d.customer_group)])
 		cond = "customer_group in (%s)"%(', '.join(['%s']*len(customer_groups)))
 
 	return frappe.db.sql(""" select name, customer_name, customer_group,
@@ -182,12 +187,13 @@
 			address_data = address[0]
 			address_data.update({'full_name': data.customer_name})
 			customer_address[data.name] = address_data
+
 	return customer_address
 
 def get_child_nodes(group_type, root):
 	lft, rgt = frappe.db.get_value(group_type, root, ["lft", "rgt"])
-	return frappe.db.sql_list(""" Select name from `tab{tab}` where
-			lft >= {lft} and rgt <= {rgt}""".format(tab=group_type, lft=lft, rgt=rgt))
+	return frappe.db.sql(""" Select name, lft, rgt from `tab{tab}` where
+			lft >= {lft} and rgt <= {rgt} order by lft""".format(tab=group_type, lft=lft, rgt=rgt), as_dict=1)
 
 def get_serial_no_data(pos_profile, company):
 	# get itemwise serial no data
@@ -295,9 +301,9 @@
 			if not frappe.db.exists('Sales Invoice', {'offline_pos_name': name}):
 				validate_records(doc)
 				si_doc = frappe.new_doc('Sales Invoice')
-				si_doc.due_date = doc.get('posting_date')
 				si_doc.offline_pos_name = name
 				si_doc.update(doc)
+				si_doc.due_date = doc.get('posting_date')
 				submit_invoice(si_doc, name, doc)
 				name_list.append(name)
 			else:
@@ -319,8 +325,10 @@
 		if not frappe.db.exists('Customer', name):
 			name = add_customer(name)
 		data = json.loads(data)
+		make_contact(data, name)
 		make_address(data, name)
 		customer_list.append(name)
+	frappe.db.commit()
 	return customer_list
 
 def add_customer(name):
@@ -334,14 +342,40 @@
 	frappe.db.commit()
 	return customer_doc.name
 
+def make_contact(args,customer):
+	if args.get('email_id') or args.get('phone'):
+		name = frappe.db.get_value('Dynamic Link',
+			{'link_doctype': 'Customer', 'link_name': customer, 'parenttype': 'Contact'}, 'parent')
+
+		args = {
+			'email_id': args.get('email_id'),
+			'phone': args.get('phone')
+		}
+
+		doc = frappe.new_doc('Contact')
+		if name:
+			doc = frappe.get_doc('Contact', name)
+
+		doc.update(args)
+		if not name:
+			doc.first_name = customer
+			doc.append('links',{
+				'link_doctype': 'Customer',
+				'link_name': customer
+			})
+		doc.save(ignore_permissions=True)
+
 def make_address(args, customer):
 	if not args.get('address_line1'): return
 	
-	name = args.get('name') or get_customers_address(customer)[customer].get("name")
+	name = args.get('name')
+
+	if not name:
+		data = get_customers_address(customer)
+		name = data[customer].get('name') if data else None
 
 	if name:
-		address = frappe.get_doc('Address', name) 
-		frappe.errprint(address)
+		address = frappe.get_doc('Address', name)
 	else:
 		address = frappe.new_doc('Address')
 		address.country = frappe.db.get_value('Company', args.get('company'), 'country')
@@ -400,4 +434,5 @@
 	if not frappe.db.exists('Sales Invoice', {'offline_pos_name': name}):
 		si_doc.docstatus = 0
 		si_doc.flags.ignore_mandatory = True
+		si_doc.due_date = si_doc.posting_date
 		si_doc.insert()
diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js
index e8163f0..007afe4 100644
--- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js
+++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js
@@ -112,33 +112,44 @@
 	},
 
 	sales_order_btn: function() {
-		this.$sales_order_btn = cur_frm.add_custom_button(__('Sales Order'),
+		var me = this;
+		this.$sales_order_btn = this.frm.add_custom_button(__('Sales Order'),
 			function() {
 				erpnext.utils.map_current_doc({
 					method: "erpnext.selling.doctype.sales_order.sales_order.make_sales_invoice",
 					source_doctype: "Sales Order",
+					target: me.frm,
+					setters: {
+						customer: me.frm.doc.customer || undefined,
+					},
 					get_query_filters: {
 						docstatus: 1,
 						status: ["!=", "Closed"],
 						per_billed: ["<", 99.99],
-						customer: cur_frm.doc.customer || undefined,
-						company: cur_frm.doc.company
+						company: me.frm.doc.company
 					}
 				})
 			}, __("Get items from"));
 	},
 
 	delivery_note_btn: function() {
-		this.$delivery_note_btn = cur_frm.add_custom_button(__('Delivery Note'),
+		var me = this;
+		this.$delivery_note_btn = this.frm.add_custom_button(__('Delivery Note'),
 			function() {
 				erpnext.utils.map_current_doc({
 					method: "erpnext.stock.doctype.delivery_note.delivery_note.make_sales_invoice",
 					source_doctype: "Delivery Note",
+					target: me.frm,
+					date_field: "posting_date",
+					setters: {
+						customer: me.frm.doc.customer || undefined
+					},
 					get_query: function() {
 						var filters = {
-							company: cur_frm.doc.company
+							docstatus: 1,
+							company: me.frm.doc.company
 						};
-						if(cur_frm.doc.customer) filters["customer"] = cur_frm.doc.customer;
+						if(me.frm.doc.customer) filters["customer"] = me.frm.doc.customer;
 						return {
 							query: "erpnext.controllers.queries.get_delivery_notes_to_be_billed",
 							filters: filters
diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.json b/erpnext/accounts/doctype/sales_invoice/sales_invoice.json
index df2f34d..0de23e5 100644
--- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.json
+++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.json
@@ -7,13 +7,14 @@
  "beta": 0, 
  "creation": "2013-05-24 19:29:05", 
  "custom": 0, 
- "default_print_format": "Sample Print", 
+ "default_print_format": "", 
  "docstatus": 0, 
  "doctype": "DocType", 
  "document_type": "", 
  "editable_grid": 0, 
  "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": 1, 
    "bold": 0, 
    "collapsible": 0, 
@@ -73,6 +75,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 1, 
    "collapsible": 0, 
@@ -104,6 +107,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 1, 
    "collapsible": 0, 
@@ -135,6 +139,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 1, 
    "collapsible": 0, 
@@ -166,6 +171,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -195,6 +201,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -225,6 +232,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -256,6 +264,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -286,6 +295,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -315,6 +325,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -343,6 +354,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -374,6 +386,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 1, 
    "collapsible": 0, 
@@ -405,6 +418,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -435,6 +449,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -454,7 +469,7 @@
    "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, 
@@ -465,6 +480,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -496,6 +512,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -526,6 +543,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -556,6 +574,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -587,6 +606,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 1, 
@@ -617,6 +637,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -646,6 +667,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -674,6 +696,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -703,6 +726,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -731,6 +755,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -759,6 +784,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -788,6 +814,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -816,6 +843,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -846,6 +874,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -875,6 +904,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -905,6 +935,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -935,6 +966,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 1, 
@@ -965,6 +997,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -996,6 +1029,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1028,6 +1062,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1056,6 +1091,7 @@
    "width": "50%"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1087,6 +1123,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1116,6 +1153,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1146,6 +1184,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1174,6 +1213,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1204,6 +1244,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1234,6 +1275,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1265,6 +1307,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1294,6 +1337,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1323,6 +1367,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1351,6 +1396,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 1, 
@@ -1382,6 +1428,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1412,6 +1459,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1442,6 +1490,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1469,6 +1518,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1499,6 +1549,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1530,6 +1581,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1557,6 +1609,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1586,6 +1639,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1616,6 +1670,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1646,6 +1701,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1677,6 +1733,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1704,6 +1761,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1734,6 +1792,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1761,6 +1820,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1792,6 +1852,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1821,6 +1882,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1848,6 +1910,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1879,6 +1942,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1907,6 +1971,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1936,6 +2001,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 1, 
@@ -1966,6 +2032,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1997,6 +2064,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2027,6 +2095,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2054,6 +2123,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2083,6 +2153,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2112,6 +2183,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2142,6 +2214,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2173,6 +2246,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2204,6 +2278,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2235,6 +2310,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2264,6 +2340,7 @@
    "width": "50%"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 1, 
    "collapsible": 0, 
@@ -2295,6 +2372,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 1, 
    "collapsible": 0, 
@@ -2326,6 +2404,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2356,6 +2435,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2387,6 +2467,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2418,6 +2499,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 1, 
@@ -2449,6 +2531,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2479,6 +2562,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2510,6 +2594,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2541,6 +2626,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2573,6 +2659,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2603,6 +2690,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2631,6 +2719,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2661,6 +2750,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2689,6 +2779,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2721,6 +2812,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2749,6 +2841,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2779,6 +2872,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2807,6 +2901,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2837,6 +2932,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2867,6 +2963,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 1, 
@@ -2898,6 +2995,7 @@
    "width": "50%"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2928,6 +3026,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2958,6 +3057,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2987,6 +3087,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -3016,6 +3117,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -3046,6 +3148,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -3076,6 +3179,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 1, 
@@ -3107,6 +3211,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -3138,6 +3243,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -3168,6 +3274,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 1, 
@@ -3197,6 +3304,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 1, 
    "bold": 0, 
    "collapsible": 0, 
@@ -3228,6 +3336,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -3257,6 +3366,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -3285,6 +3395,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 1, 
    "bold": 0, 
    "collapsible": 0, 
@@ -3316,6 +3427,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 1, 
@@ -3346,6 +3458,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -3378,6 +3491,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -3406,6 +3520,7 @@
    "width": "50%"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -3437,6 +3552,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -3468,6 +3584,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 1, 
@@ -3498,6 +3615,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -3530,6 +3648,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -3560,6 +3679,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -3593,6 +3713,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -3622,6 +3743,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -3651,6 +3773,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -3679,6 +3802,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -3709,6 +3833,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 1, 
@@ -3740,6 +3865,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -3771,6 +3897,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -3800,6 +3927,7 @@
    "width": "50%"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -3830,6 +3958,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -3861,6 +3990,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 1, 
@@ -3890,6 +4020,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 1, 
    "bold": 0, 
    "collapsible": 0, 
@@ -3921,6 +4052,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 1, 
@@ -3952,6 +4084,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -3981,6 +4114,7 @@
    "width": "50%"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 1, 
    "bold": 0, 
    "collapsible": 0, 
@@ -4011,6 +4145,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 1, 
    "bold": 0, 
    "collapsible": 0, 
@@ -4042,6 +4177,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 1, 
    "bold": 0, 
    "collapsible": 0, 
@@ -4073,6 +4209,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 1, 
    "bold": 0, 
    "collapsible": 0, 
@@ -4103,6 +4240,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 1, 
    "bold": 0, 
    "collapsible": 0, 
@@ -4133,6 +4271,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 1, 
    "bold": 0, 
    "collapsible": 0, 
@@ -4163,6 +4302,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 1, 
    "bold": 0, 
    "collapsible": 0, 
@@ -4194,6 +4334,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 1, 
    "bold": 0, 
    "collapsible": 0, 
@@ -4225,6 +4366,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -4256,6 +4398,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -4285,6 +4428,7 @@
    "width": "50%"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 1, 
    "bold": 0, 
    "collapsible": 0, 
@@ -4315,6 +4459,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 1, 
    "bold": 0, 
    "collapsible": 0, 
@@ -4345,6 +4490,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -4375,6 +4521,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -4417,7 +4564,7 @@
  "istable": 0, 
  "max_attachments": 0, 
  "menu_index": 0, 
- "modified": "2017-03-29 05:09:56.656338", 
+ "modified": "2017-05-17 10:34:44.412147", 
  "modified_by": "Administrator", 
  "module": "Accounts", 
  "name": "Sales Invoice", 
@@ -4513,6 +4660,6 @@
  "sort_order": "DESC", 
  "timeline_field": "customer", 
  "title_field": "title", 
- "track_changes": 0, 
+ "track_changes": 1, 
  "track_seen": 0
 }
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py
index b1fe0be..6e3990a 100644
--- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py
+++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py
@@ -17,6 +17,7 @@
 from erpnext.projects.doctype.timesheet.timesheet import get_projectwise_timesheet_data
 from erpnext.accounts.doctype.asset.depreciation \
 	import get_disposal_account_and_cost_center, get_gl_entries_on_asset_disposal
+from erpnext.stock.doctype.batch.batch import set_batch_nos
 
 form_grid_templates = {
 	"items": "templates/form_grid/item_grid.html"
@@ -52,7 +53,7 @@
 
 	def validate(self):
 		super(SalesInvoice, self).validate()
-		self.validate_posting_time()
+		self.validate_auto_set_posting_time()
 		self.so_dn_required()
 		self.validate_proj_cust()
 		self.validate_with_previous_doc()
@@ -78,6 +79,10 @@
 
 		if not self.is_opening:
 			self.is_opening = 'No'
+			
+		if self._action != 'submit' and self.update_stock and not self.is_return:
+			set_batch_nos(self, 'warehouse', True)
+			
 
 		self.set_against_income_account()
 		self.validate_c_form()
@@ -87,7 +92,7 @@
 		self.set_billing_hours_and_amount()
 		self.update_timesheet_billing_for_project()
 		self.set_status()
-
+	
 	def before_save(self):
 		set_account_for_mode_of_payment(self)
 
@@ -330,7 +335,7 @@
 			frappe.throw(_("Debit To account must be a Receivable account"))
 
 		self.party_account_currency = account.account_currency
-		
+
 	def clear_unallocated_mode_of_payments(self):
 		self.set("payments", self.get("payments", {"amount": ["not in", [0, None, ""]]}))
 
@@ -341,13 +346,23 @@
 		super(SalesInvoice, self).validate_with_previous_doc({
 			"Sales Order": {
 				"ref_dn_field": "sales_order",
-				"compare_fields": [["customer", "="], ["company", "="], ["project", "="],
-					["currency", "="]],
+				"compare_fields": [["customer", "="], ["company", "="], ["project", "="], ["currency", "="]]
+			},
+			"Sales Order Item": {
+				"ref_dn_field": "so_detail",
+				"compare_fields": [["item_code", "="], ["uom", "="], ["conversion_factor", "="]],
+				"is_child_table": True,
+				"allow_duplicate_prev_row_id": True
 			},
 			"Delivery Note": {
 				"ref_dn_field": "delivery_note",
-				"compare_fields": [["customer", "="], ["company", "="], ["project", "="],
-					["currency", "="]],
+				"compare_fields": [["customer", "="], ["company", "="], ["project", "="], ["currency", "="]]
+			},
+			"Delivery Note Item": {
+				"ref_dn_field": "dn_detail",
+				"compare_fields": [["item_code", "="], ["uom", "="], ["conversion_factor", "="]],
+				"is_child_table": True,
+				"allow_duplicate_prev_row_id": True
 			},
 		})
 
@@ -368,6 +383,12 @@
 	def add_remarks(self):
 		if not self.remarks: self.remarks = 'No Remarks'
 
+	def validate_auto_set_posting_time(self):
+		# Don't auto set the posting date and time if invoice is amended
+		if self.is_new() and self.amended_from:
+			self.set_posting_time = 1
+
+		self.validate_posting_time()
 
 	def so_dn_required(self):
 		"""check in manage account if sales order / delivery note required or not."""
@@ -535,7 +556,7 @@
 	def make_gl_entries(self, gl_entries=None, repost_future_gle=True, from_repost=False):
 		if not self.grand_total:
 			return
-			
+
 		if not gl_entries:
 			gl_entries = self.get_gl_entries()
 
@@ -681,7 +702,7 @@
 								else payment_mode.amount
 						}, payment_mode_account_currency)
 					)
-				
+
 	def make_gle_for_change_amount(self, gl_entries):
 		if cint(self.is_pos) and self.change_amount:
 			if self.account_for_change_amount:
@@ -698,7 +719,7 @@
 						"against_voucher_type": self.doctype
 					}, self.party_account_currency)
 				)
-				
+
 				gl_entries.append(
 					self.get_gl_dict({
 						"account": self.account_for_change_amount,
@@ -708,7 +729,7 @@
 				)
 			else:
 				frappe.throw(_("Select change amount account"), title="Mandatory Field")
-		
+
 	def make_write_off_gl_entry(self, gl_entries):
 		# write off entries, applicable if only pos
 		if self.write_off_account and self.write_off_amount:
@@ -792,7 +813,7 @@
 	def update_item(source_doc, target_doc, source_parent):
 		target_doc.qty = flt(source_doc.qty) - flt(source_doc.delivered_qty)
 		target_doc.stock_qty = target_doc.qty * flt(source_doc.conversion_factor)
-		
+
 		target_doc.base_amount = target_doc.qty * flt(source_doc.base_rate)
 		target_doc.amount = target_doc.qty * flt(source_doc.rate)
 
@@ -810,7 +831,8 @@
 				"parent": "against_sales_invoice",
 				"serial_no": "serial_no",
 				"sales_order": "against_sales_order",
-				"so_detail": "so_detail"
+				"so_detail": "so_detail",
+				"cost_center": "cost_center"
 			},
 			"postprocess": update_item,
 			"condition": lambda doc: doc.delivered_by_supplier!=1
@@ -839,4 +861,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")
\ No newline at end of file
+			data.account = get_bank_cash_account(data.mode_of_payment, self.company).get("account")
diff --git a/erpnext/accounts/doctype/sales_invoice/test_records.json b/erpnext/accounts/doctype/sales_invoice/test_records.json
index 732c446..0b7b76d 100644
--- a/erpnext/accounts/doctype/sales_invoice/test_records.json
+++ b/erpnext/accounts/doctype/sales_invoice/test_records.json
@@ -147,9 +147,9 @@
     "price_list_rate": 50,
     "qty": 10,
     "rate": 50,
-	"uom": "_Test UOM",
+	"uom": "_Test UOM 1",
 	"conversion_factor": 1,
-    "stock_uom": "_Test UOM"
+    "stock_uom": "_Test UOM 1"
    },
    {
     "cost_center": "_Test Cost Center - _TC",
@@ -273,9 +273,9 @@
     "parentfield": "items",
     "price_list_rate": 62.5,
     "qty": 10,
-	"uom": "_Test UOM",
-	"conversion_factor": 1,
-    "stock_uom": "_Test UOM"
+	  "uom": "_Test UOM 1",
+	  "conversion_factor": 1,
+    "stock_uom": "_Test UOM 1"
 	
    },
    {
diff --git a/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py
index 305b689..0ada847 100644
--- a/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py
+++ b/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py
@@ -1043,6 +1043,25 @@
 		#check outstanding after advance cancellation
 		self.assertEqual(flt(si.outstanding_amount), flt(si.grand_total + si.total_advance, si.precision("outstanding_amount")))
 
+	def test_multiple_uom_in_selling(self):
+		si = frappe.copy_doc(test_records[1])
+
+		si.items[0].uom = "_Test UOM 1"
+		si.items[0].conversion_factor = None
+		si.items[0].price_list_rate = None
+		si.save()
+
+		expected_values = {
+			"keys": ["price_list_rate", "stock_uom", "uom", "conversion_factor", "rate", "amount",
+				"base_price_list_rate", "base_rate", "base_amount"],
+			"_Test Item": [1000, "_Test UOM", "_Test UOM 1", 10.0, 1000, 1000, 1000, 1000, 1000]
+		}
+
+		# check if the conversion_factor and price_list_rate is calculated according to uom
+		for d in si.get("items"):
+			for i, k in enumerate(expected_values["keys"]):
+				self.assertEquals(d.get(k), expected_values[d.item_code][i])
+
 def create_sales_invoice(**args):
 	si = frappe.new_doc("Sales Invoice")
 	args = frappe._dict(args)
diff --git a/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.json b/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.json
index 721785e..9f7085a 100644
--- a/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.json
+++ b/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.json
@@ -13,6 +13,7 @@
  "editable_grid": 1, 
  "fields": [
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -41,6 +42,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 1, 
    "collapsible": 0, 
@@ -72,6 +74,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, 
@@ -129,6 +133,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -157,6 +162,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 1, 
@@ -186,6 +192,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -218,6 +225,7 @@
    "width": "200px"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -246,6 +254,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -276,6 +285,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -305,6 +315,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -333,6 +344,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 1, 
    "collapsible": 0, 
@@ -363,6 +375,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -392,6 +405,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -419,6 +433,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -449,6 +464,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -478,6 +494,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -507,6 +524,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -535,6 +553,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -566,6 +585,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -597,6 +617,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 1, 
@@ -626,65 +647,7 @@
    "unique": 0
   }, 
   {
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "depends_on": "price_list_rate", 
-   "fieldname": "discount_percentage", 
-   "fieldtype": "Percent", 
-   "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": "Discount on Price List Rate (%)", 
-   "length": 0, 
-   "no_copy": 0, 
-   "oldfieldname": "adj_rate", 
-   "oldfieldtype": "Float", 
-   "permlevel": 0, 
-   "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_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "column_break_19", 
-   "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, 
@@ -716,6 +679,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -746,12 +710,13 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
-   "depends_on": "eval:doc.margin_type && doc.price_list_rate", 
-   "fieldname": "total_margin", 
+   "depends_on": "eval:doc.margin_type && doc.price_list_rate && doc.margin_rate_or_amount", 
+   "fieldname": "rate_with_margin", 
    "fieldtype": "Currency", 
    "hidden": 0, 
    "ignore_user_permissions": 0, 
@@ -760,7 +725,7 @@
    "in_global_search": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
-   "label": "Total Margin", 
+   "label": "Rate With Margin", 
    "length": 0, 
    "no_copy": 0, 
    "permlevel": 0, 
@@ -776,6 +741,69 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "fieldname": "column_break_19", 
+   "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": "price_list_rate", 
+   "fieldname": "discount_percentage", 
+   "fieldtype": "Percent", 
+   "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": "Discount (%) on Price List Rate with Margin", 
+   "length": 0, 
+   "no_copy": 0, 
+   "oldfieldname": "adj_rate", 
+   "oldfieldtype": "Float", 
+   "permlevel": 0, 
+   "precision": "2", 
+   "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, 
@@ -803,6 +831,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 1, 
    "collapsible": 0, 
@@ -834,6 +863,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -865,6 +895,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -892,6 +923,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -923,6 +955,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -954,6 +987,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -983,6 +1017,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1011,6 +1046,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1041,6 +1077,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1071,6 +1108,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1099,6 +1137,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1129,6 +1168,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1159,6 +1199,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 1, 
@@ -1189,6 +1230,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1218,6 +1260,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 1, 
@@ -1246,6 +1289,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1279,6 +1323,7 @@
    "width": "120px"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1309,6 +1354,7 @@
    "width": "120px"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1336,6 +1382,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1370,6 +1417,7 @@
    "width": "120px"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 1, 
@@ -1400,6 +1448,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1431,6 +1480,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1461,6 +1511,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1492,6 +1543,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1521,6 +1573,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1548,11 +1601,12 @@
    "unique": 0
   }, 
   {
-   "allow_on_submit": 1, 
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
-   "fieldname": "is_sample_item", 
+   "fieldname": "allow_zero_valuation_rate", 
    "fieldtype": "Check", 
    "hidden": 0, 
    "ignore_user_permissions": 0, 
@@ -1561,7 +1615,7 @@
    "in_global_search": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
-   "label": "Is Sample Item", 
+   "label": "Allow Zero Valuation Rate", 
    "length": 0, 
    "no_copy": 1, 
    "permlevel": 0, 
@@ -1577,6 +1631,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1607,6 +1662,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1639,6 +1695,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1669,6 +1726,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1699,6 +1757,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 1, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1730,6 +1789,7 @@
    "width": "150px"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 1, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1760,6 +1820,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 1, 
@@ -1789,6 +1850,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1820,6 +1882,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1850,6 +1913,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1878,6 +1942,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1909,6 +1974,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1939,6 +2005,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1969,6 +2036,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1998,6 +2066,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2028,6 +2097,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2056,6 +2126,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 1, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2094,7 +2165,7 @@
  "issingle": 0, 
  "istable": 1, 
  "max_attachments": 0, 
- "modified": "2017-03-30 16:26:36.507924", 
+ "modified": "2017-05-10 17:14:42.681757", 
  "modified_by": "Administrator", 
  "module": "Accounts", 
  "name": "Sales Invoice Item", 
diff --git a/erpnext/accounts/doctype/shipping_rule/shipping_rule.py b/erpnext/accounts/doctype/shipping_rule/shipping_rule.py
index 80e4fb7..7faaf11 100644
--- a/erpnext/accounts/doctype/shipping_rule/shipping_rule.py
+++ b/erpnext/accounts/doctype/shipping_rule/shipping_rule.py
@@ -4,11 +4,10 @@
 # For license information, please see license.txt
 
 from __future__ import unicode_literals
-import frappe
+import frappe, erpnext
 from frappe import _, msgprint, throw
 from frappe.utils import flt, fmt_money
 from frappe.model.document import Document
-from erpnext.setup.utils import get_company_currency
 
 class OverlappingConditionError(frappe.ValidationError): pass
 class FromGreaterThanToError(frappe.ValidationError): pass
@@ -77,7 +76,7 @@
 						overlaps.append([d1, d2])
 
 		if overlaps:
-			company_currency = get_company_currency(self.company)
+			company_currency = erpnext.get_company_currency(self.company)
 			msgprint(_("Overlapping conditions found between:"))
 			messages = []
 			for d1, d2 in overlaps:
diff --git a/erpnext/accounts/general_ledger.py b/erpnext/accounts/general_ledger.py
index 4c5535d..c9345f2 100644
--- a/erpnext/accounts/general_ledger.py
+++ b/erpnext/accounts/general_ledger.py
@@ -123,10 +123,10 @@
 
 	debit_credit_diff = flt(debit_credit_diff, precision)
 	
-	if gl_map[0]["voucher_type"] == "Journal Entry":
+	if gl_map[0]["voucher_type"] in ("Journal Entry", "Payment Entry"):
 		allowance = 5.0 / (10**precision)
 	else:
-		allowance = 1
+		allowance = .5
 	
 	if abs(debit_credit_diff) >= allowance:
 		frappe.throw(_("Debit and Credit not equal for {0} #{1}. Difference is {2}.")
diff --git a/erpnext/accounts/page/pos/pos.js b/erpnext/accounts/page/pos/pos.js
index 75ffc50..da4a3b7 100644
--- a/erpnext/accounts/page/pos/pos.js
+++ b/erpnext/accounts/page/pos/pos.js
@@ -78,8 +78,16 @@
 
 	make_menu_list: function () {
 		var me = this;
-
 		this.page.clear_menu();
+
+		// for mobile
+		this.page.add_menu_item(__("Pay"), function () {
+			me.validate();
+			me.update_paid_amount_status(true);
+			me.create_invoice();
+			me.make_payment();
+		}).addClass('visible-xs');
+
 		this.page.add_menu_item(__("New Sales Invoice"), function () {
 			me.save_previous_entry();
 			me.create_new();
@@ -327,6 +335,7 @@
 		this.name = null;
 		this.load_data(true);
 		this.setup();
+		this.set_default_customer()
 	},
 
 	load_data: function (load_doc) {
@@ -360,6 +369,16 @@
 		}
 	},
 
+	set_default_customer: function() {
+		if (this.default_customer && !this.frm.doc.customer) {
+			this.party_field.$input.val(this.default_customer);
+			this.frm.doc.customer = this.default_customer;
+			this.numeric_keypad.show();
+			this.toggle_list_customer(false)
+			this.toggle_item_cart(true)
+		}
+	},
+
 	set_transaction_defaults: function (party) {
 		var me = this;
 		this.party = party;
@@ -407,8 +426,8 @@
 		});
 
 		this.search_item_group = this.wrapper.find('.search-item-group');
-
-		var dropdown_html = me.item_groups.map(function(item_group) {
+		sorted_item_groups = this.get_sorted_item_groups()
+		var dropdown_html = sorted_item_groups.map(function(item_group) {
 			return "<li><a class='option' data-value='"+item_group+"'>"+item_group+"</a></li>";
 		}).join("");
 
@@ -437,6 +456,15 @@
 		})
 	},
 
+	get_sorted_item_groups: function() {
+		list = {}
+		$.each(this.item_groups, function(i, data) {
+			list[i] = data[0]
+		})
+
+		return Object.keys(list).sort(function(a,b){return list[a]-list[b]})
+	},
+
 	toggle_more_btn: function() {
 		if(!this.items || this.items.length <= this.page_len) {
 			this.wrapper.find(".btn-more").hide();
@@ -666,11 +694,6 @@
 			me.toggle_delete_button();
 		}
 
-		if (this.default_customer && !this.frm.doc.customer) {
-			this.party_field.$input.val(this.default_customer);
-			this.frm.doc.customer = this.default_customer;
-		}
-
 		this.party_field.awesomeplete =
 			new Awesomplete(this.party_field.$input.get(0), {
 				minChars: 0,
@@ -773,7 +796,8 @@
 
 	add_customer: function() {
 		this.frm.doc.customer = "";
-		this.update_customer(true)
+		this.update_customer(true);
+		this.numeric_keypad.show();
 	},
 
 	update_customer: function (new_customer) {
@@ -851,6 +875,7 @@
 		this.customer_doc.set_primary_action(__("Save"), function () {
 			me.make_offline_customer(new_customer);
 			me.pos_bill.show();
+			me.list_customers.hide();
 		});
 	},
 
@@ -951,6 +976,7 @@
 						item_price: format_currency(me.price_list_data[obj.name], me.frm.doc.currency),
 						item_name: obj.name === obj.item_name ? "" : obj.item_name,
 						item_image: obj.image,
+						item_stock: __('Stock Qty') + ": " + me.get_actual_qty(obj),
 						color: frappe.get_palette(obj.item_name),
 						abbr: frappe.get_abbr(obj.item_name)
 					})).tooltip().appendTo($wrap);
@@ -1090,9 +1116,9 @@
 		// $(me.wrapper).find(".pos-item-wrapper").on("click", function () {
 		$(this.wrapper).on("click", ".pos-item-wrapper", function () {
 			me.item_code = '';
+			me.customer_validate();
 			if($(me.pos_bill).is(":hidden")) return;
 
-			me.customer_validate();
 			if (me.frm.doc.docstatus == 0) {
 				me.items = me.get_items($(this).attr("data-item-code"))
 				me.add_to_cart();
@@ -1355,7 +1381,7 @@
 				discount_percentage: d.discount_percentage || 0.0,
 				actual_qty: me.actual_qty_dict[d.item_code] || 0.0,
 				projected_qty: d.projected_qty,
-				rate: format_number(d.rate, me.frm.doc.currency),
+				rate: format_currency(d.rate, me.frm.doc.currency),
 				enabled: me.pos_profile_data["allow_user_to_edit_rate"] ? true : false,
 				amount: format_currency(d.amount, me.frm.doc.currency),
 				selected_class: (me.item_code == d.item_code) ? "active" : ""
@@ -1767,7 +1793,7 @@
 		var me = this;
 		return $.grep(this.pricing_rules, function (data) {
 			if (item.qty >= data.min_qty && (item.qty <= (data.max_qty ? data.max_qty : item.qty))) {
-				if (data.item_code == item.item_code || in_list(['All Item Groups', item.item_group], data.item_group) || item.brand == data.brand) {
+				if (me.validate_item_condition(data, item)) {
 					if (in_list(['Customer', 'Customer Group', 'Territory', 'Campaign'], data.applicable_for)) {
 						return me.validate_condition(data)
 					} else {
@@ -1778,6 +1804,26 @@
 		})
 	},
 
+	validate_item_condition: function (data, item) {
+		var apply_on = frappe.model.scrub(data.apply_on);
+
+		return (data.apply_on == 'Item Group')
+			? this.validate_item_group(data.item_group, item.item_group) : (data[apply_on] == item[apply_on]);
+	},
+
+	validate_item_group: function (pr_item_group, cart_item_group) {
+		//pr_item_group = pricing rule's item group
+		//cart_item_group = cart item's item group
+		//this.item_groups has information about item group's lft and rgt
+		//for example: {'Foods': [12, 19]}
+
+		pr_item_group = this.item_groups[pr_item_group]
+		cart_item_group = this.item_groups[cart_item_group]
+
+		return (cart_item_group[0] >= pr_item_group[0] &&
+			cart_item_group[1] <= pr_item_group[1])
+	},
+
 	validate_condition: function (data) {
 		//This method check condition based on applicable for
 		condition = this.get_mapper_for_pricing_rule(data)[data.applicable_for]
@@ -1856,4 +1902,4 @@
 			frappe.throw(__("LocalStorage is full , did not save"))
 		}
 	}
-})
\ No newline at end of file
+})
diff --git a/erpnext/accounts/party.py b/erpnext/accounts/party.py
index 8aedf78..f0c29bc 100644
--- a/erpnext/accounts/party.py
+++ b/erpnext/accounts/party.py
@@ -151,13 +151,6 @@
 	}
 	return out
 
-def get_company_currency():
-	company_currency = frappe._dict()
-	for d in frappe.get_all("Company", fields=["name", "default_currency"]):
-		company_currency.setdefault(d.name, d.default_currency)
-
-	return company_currency
-
 @frappe.whitelist()
 def get_party_account(party_type, party, company):
 	"""Returns the account for the given `party`.
@@ -348,7 +341,7 @@
 
 		elif party_type == "Employee":
 			if frappe.db.get_value("Employee", party_name, "status") == "Left":
-				frappe.msgprint(_("{0} {1} is not active").format(party_type, party_name), PartyDisabled, alert=True)
+				frappe.msgprint(_("{0} {1} is not active").format(party_type, party_name), alert=True)
 
 def get_timeline_data(doctype, name):
 	'''returns timeline data for the past one year'''
diff --git a/erpnext/accounts/print_format/point_of_sale/point_of_sale.json b/erpnext/accounts/print_format/point_of_sale/point_of_sale.json
index f7d5f63..b413321 100644
--- a/erpnext/accounts/print_format/point_of_sale/point_of_sale.json
+++ b/erpnext/accounts/print_format/point_of_sale/point_of_sale.json
@@ -7,10 +7,10 @@
  "docstatus": 0, 
  "doctype": "Print Format", 
  "font": "Default", 
- "html": "<style>\n\t.print-format table, .print-format tr, \n\t.print-format td, .print-format div, .print-format p {\n\t\tfont-family: Monospace;\n\t\tline-height: 200%;\n\t\tvertical-align: middle;\n\t}\n\t@media screen {\n\t\t.print-format {\n\t\t\twidth: 4in;\n\t\t\tpadding: 0.25in;\n\t\t\tmin-height: 8in;\n\t\t}\n\t}\n</style>\n\n<p class=\"text-center\">\n\t{{ company }}<br>\n\t{{  __(\"POS No : \") }}{{offline_pos_name}}<br>\n</p>\n<p>\n\t<b>{{ __(\"Date\") }}:</b> {{ dateutil.global_date_format(posting_date) }}<br>\n</p>\n\n<hr>\n<table class=\"table table-condensed cart no-border\">\n\t<thead>\n\t\t<tr>\n\t\t\t<th width=\"50%\">{{ __(\"Item\") }}</b></th>\n\t\t\t<th width=\"25%\" class=\"text-right\">{{ __(\"Qty\") }}</th>\n\t\t\t<th width=\"25%\" class=\"text-right\">{{ __(\"Amount\") }}</th>\n\t\t</tr>\n\t</thead>\n\t<tbody>\n\t\t{% for item in items %}\n\t\t<tr>\n\t\t\t<td>\n\t\t\t\t{{ item.item_name }}\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">{{ format_number(item.qty, precision(\"difference\")) }}<br>@ {{ format_currency(item.rate, currency) }}</td>\n\t\t\t<td class=\"text-right\">{{ format_currency(item.amount, currency) }}</td>\n\t\t</tr>\n\t\t{% endfor %}\n\t</tbody>\n</table>\n\n<table class=\"table table-condensed no-border\">\n\t<tbody>\n\t\t<tr>\n\t\t\t<td class=\"text-right\" style=\"width: 70%\">\n\t\t\t\t{{ __(\"Net Total\") }}\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">\n\t\t\t\t{{ format_currency(total, currency) }}\n\t\t\t</td>\n\t\t</tr>\n\t\t{% for row in taxes %}\n\t\t{% if not row.included_in_print_rate %}\n\t\t<tr>\n\t\t\t<td class=\"text-right\" style=\"width: 70%\">\n\t\t\t\t{{ row.description }}\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">\n\t\t\t\t{{ format_currency(row.tax_amount, currency) }}\n\t\t\t</td>\n\t\t</tr>\n\t\t{% endif %}\n\t\t{% endfor %}\n\t\t{% if discount_amount %}\n\t\t<tr>\n\t\t\t<td class=\"text-right\" style=\"width: 75%\">\n\t\t\t\t{{ __(\"Discount\") }}\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">\n\t\t\t\t{{ format_currency(discount_amount, currency) }}\n\t\t\t</td>\n\t\t</tr>\n\t\t{% endif %}\n\t\t<tr>\n\t\t\t<td class=\"text-right\" style=\"width: 75%\">\n\t\t\t\t<b>{{ __(\"Grand Total\") }}</b>\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">\n\t\t\t\t{{ format_currency(grand_total, currency) }}\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td class=\"text-right\" style=\"width: 75%\">\n\t\t\t\t<b>{{ __(\"Paid Amount\") }}</b>\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">\n\t\t\t\t{{ format_currency(paid_amount, currency) }}\n\t\t\t</td>\n\t\t</tr>\n\t</tbody>\n</table>\n\n\n<hr>\n<p>{{ terms }}</p>\n<p class=\"text-center\">{{ __(\"Thank you, please visit again.\") }}</p>", 
+ "html": "<style>\n\t.print-format table, .print-format tr, \n\t.print-format td, .print-format div, .print-format p {\n\t\tfont-family: Monospace;\n\t\tline-height: 200%;\n\t\tvertical-align: middle;\n\t}\n\t@media screen {\n\t\t.print-format {\n\t\t\twidth: 4in;\n\t\t\tpadding: 0.25in;\n\t\t\tmin-height: 8in;\n\t\t}\n\t}\n</style>\n\n<p class=\"text-center\">\n\t{{ company }}<br>\n\t{{  __(\"POS No : \") }} {{ offline_pos_name }}<br>\n</p>\n<p>\n\t<b>{{ __(\"Date\") }}:</b> {{ dateutil.global_date_format(posting_date) }}<br>\n</p>\n\n<hr>\n<table class=\"table table-condensed cart no-border\">\n\t<thead>\n\t\t<tr>\n\t\t\t<th width=\"50%\">{{ __(\"Item\") }}</b></th>\n\t\t\t<th width=\"25%\" class=\"text-right\">{{ __(\"Qty\") }}</th>\n\t\t\t<th width=\"25%\" class=\"text-right\">{{ __(\"Amount\") }}</th>\n\t\t</tr>\n\t</thead>\n\t<tbody>\n\t\t{% for item in items %}\n\t\t<tr>\n\t\t\t<td>\n\t\t\t\t{{ item.item_name }}\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">{{ format_number(item.qty, null,precision(\"difference\")) }}<br>@ {{ format_currency(item.rate, currency) }}</td>\n\t\t\t<td class=\"text-right\">{{ format_currency(item.amount, currency) }}</td>\n\t\t</tr>\n\t\t{% endfor %}\n\t</tbody>\n</table>\n\n<table class=\"table table-condensed no-border\">\n\t<tbody>\n\t\t<tr>\n\t\t\t<td class=\"text-right\" style=\"width: 70%\">\n\t\t\t\t{{ __(\"Net Total\") }}\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">\n\t\t\t\t{{ format_currency(total, currency) }}\n\t\t\t</td>\n\t\t</tr>\n\t\t{% for row in taxes %}\n\t\t{% if not row.included_in_print_rate %}\n\t\t<tr>\n\t\t\t<td class=\"text-right\" style=\"width: 70%\">\n\t\t\t\t{{ row.description }}\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">\n\t\t\t\t{{ format_currency(row.tax_amount, currency) }}\n\t\t\t</td>\n\t\t</tr>\n\t\t{% endif %}\n\t\t{% endfor %}\n\t\t{% if discount_amount %}\n\t\t<tr>\n\t\t\t<td class=\"text-right\" style=\"width: 75%\">\n\t\t\t\t{{ __(\"Discount\") }}\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">\n\t\t\t\t{{ format_currency(discount_amount, currency) }}\n\t\t\t</td>\n\t\t</tr>\n\t\t{% endif %}\n\t\t<tr>\n\t\t\t<td class=\"text-right\" style=\"width: 75%\">\n\t\t\t\t<b>{{ __(\"Grand Total\") }}</b>\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">\n\t\t\t\t{{ format_currency(grand_total, currency) }}\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td class=\"text-right\" style=\"width: 75%\">\n\t\t\t\t<b>{{ __(\"Paid Amount\") }}</b>\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">\n\t\t\t\t{{ format_currency(paid_amount, currency) }}\n\t\t\t</td>\n\t\t</tr>\n\t</tbody>\n</table>\n\n\n<hr>\n<p>{{ terms }}</p>\n<p class=\"text-center\">{{ __(\"Thank you, please visit again.\") }}</p>", 
  "idx": 0, 
  "line_breaks": 0, 
- "modified": "2017-01-12 14:56:12.571032", 
+ "modified": "2017-04-19 13:28:05.129504", 
  "modified_by": "Administrator", 
  "module": "Accounts", 
  "name": "Point of Sale", 
diff --git a/erpnext/accounts/report/accounts_receivable/accounts_receivable.html b/erpnext/accounts/report/accounts_receivable/accounts_receivable.html
index f463c07..ba847c0 100644
--- a/erpnext/accounts/report/accounts_receivable/accounts_receivable.html
+++ b/erpnext/accounts/report/accounts_receivable/accounts_receivable.html
@@ -1,6 +1,9 @@
+{% var letterhead= filters.letter_head || frappe.get_doc(":Company", filters.company).default_letter_head || frappe.defaults.get_default("letter_head"); %}
+{% if(letterhead) { %} 
 <div style="margin-bottom: 7px;" class="text-center">
-	{%= frappe.boot.letter_heads[frappe.get_doc(":Company", filters.company).default_letter_head || frappe.defaults.get_default("letter_head")] %}
+	{%= frappe.boot.letter_heads[letterhead].header %}
 </div>
+{% } %}
 <h2 class="text-center">{%= __(report.report_name) %}</h2>
 <h4 class="text-center">{%= filters.customer || filters.supplier %} </h4>
 <h5 class="text-center">
diff --git a/erpnext/accounts/report/accounts_receivable/accounts_receivable.js b/erpnext/accounts/report/accounts_receivable/accounts_receivable.js
index 9bc5c2f..f98d037 100644
--- a/erpnext/accounts/report/accounts_receivable/accounts_receivable.js
+++ b/erpnext/accounts/report/accounts_receivable/accounts_receivable.js
@@ -17,6 +17,21 @@
 			"options": "Customer"
 		},
 		{
+			"fieldname":"customer_group",
+			"label": __("Customer Group"),
+			"fieldtype": "Link",
+			"options": "Customer Group"
+		},
+		{
+			"fieldname":"credit_days_based_on",
+			"label": __("Credit Days Based On"),
+			"fieldtype": "Select",
+			"options": "" + NEWLINE + "Fixed Days" + NEWLINE + "Last Day of the Next Month"
+		},
+		{
+			"fieldtype": "Break",
+		},
+		{
 			"fieldname":"report_date",
 			"label": __("As on Date"),
 			"fieldtype": "Date",
@@ -30,9 +45,6 @@
 			"default": "Posting Date"
 		},
 		{
-			"fieldtype": "Break",
-		},
-		{
 			"fieldname":"range1",
 			"label": __("Ageing Range 1"),
 			"fieldtype": "Int",
diff --git a/erpnext/accounts/report/accounts_receivable/accounts_receivable.py b/erpnext/accounts/report/accounts_receivable/accounts_receivable.py
index 6d1e168..62d0d5a 100644
--- a/erpnext/accounts/report/accounts_receivable/accounts_receivable.py
+++ b/erpnext/accounts/report/accounts_receivable/accounts_receivable.py
@@ -71,7 +71,10 @@
 			"width": 100
 		})
 		if args.get("party_type") == "Customer":
-			columns += [_("Territory") + ":Link/Territory:80"]
+			columns += [
+				_("Territory") + ":Link/Territory:80", 
+				_("Customer Group") + ":Link/Customer Group:120"
+			]
 		if args.get("party_type") == "Supplier":
 			columns += [_("Supplier Type") + ":Link/Supplier Type:80"]
 			
@@ -139,7 +142,7 @@
 
 					# customer territory / supplier type
 					if args.get("party_type") == "Customer":
-						row += [self.get_territory(gle.party)]
+						row += [self.get_territory(gle.party), self.get_customer_group(gle.party)]
 					if args.get("party_type") == "Supplier":
 						row += [self.get_supplier_type(gle.party)]
 
@@ -186,6 +189,9 @@
 
 	def get_territory(self, party_name):
 		return self.get_party_map("Customer").get(party_name, {}).get("territory") or ""
+		
+	def get_customer_group(self, party_name):
+		return self.get_party_map("Customer").get(party_name, {}).get("customer_group") or ""
 
 	def get_supplier_type(self, party_name):
 		return self.get_party_map("Supplier").get(party_name, {}).get("supplier_type") or ""
@@ -193,12 +199,12 @@
 	def get_party_map(self, party_type):
 		if not hasattr(self, "party_map"):
 			if party_type == "Customer":
-				self.party_map = dict(((r.name, r) for r in frappe.db.sql("""select {0}, {1}, {2} from `tab{3}`"""
-					.format("name", "customer_name", "territory", party_type), as_dict=True)))
-
+				select_fields = "name, customer_name, territory, customer_group"
 			elif party_type == "Supplier":
-				self.party_map = dict(((r.name, r) for r in frappe.db.sql("""select {0}, {1}, {2} from `tab{3}`"""
-					.format("name", "supplier_name", "supplier_type", party_type), as_dict=True)))
+				select_fields = "name, supplier_name, supplier_type"
+			
+			self.party_map = dict(((r.name, r) for r in frappe.db.sql("select {0} from `tab{1}`"
+				.format(select_fields, party_type), as_dict=True)))
 
 		return self.party_map
 
@@ -251,6 +257,19 @@
 			conditions.append("party=%s")
 			values.append(self.filters.get(party_type_field))
 
+		if party_type_field=="customer":
+			if self.filters.get("customer_group"):
+				lft, rgt = frappe.db.get_value("Customer Group", 
+					self.filters.get("customer_group"), ["lft", "rgt"])
+			
+				conditions.append("""party in (select name from tabCustomer 
+					where exists(select name from `tabCustomer Group` where lft >= {0} and rgt <= {1} 
+						and name=tabCustomer.customer_group))""".format(lft, rgt))
+						
+			if self.filters.get("credit_days_based_on"):
+				conditions.append("party in (select name from tabCustomer where credit_days_based_on=%s)")
+				values.append(self.filters.get("credit_days_based_on"))
+
 		return " and ".join(conditions), values
 
 	def get_gl_entries_for(self, party, party_type, against_voucher_type, against_voucher):
diff --git a/erpnext/accounts/report/accounts_receivable_summary/accounts_receivable_summary.js b/erpnext/accounts/report/accounts_receivable_summary/accounts_receivable_summary.js
index 5cc0566..a18c1a7 100644
--- a/erpnext/accounts/report/accounts_receivable_summary/accounts_receivable_summary.js
+++ b/erpnext/accounts/report/accounts_receivable_summary/accounts_receivable_summary.js
@@ -17,6 +17,21 @@
 			"options": "Customer"
 		},
 		{
+			"fieldname":"customer_group",
+			"label": __("Customer Group"),
+			"fieldtype": "Link",
+			"options": "Customer Group"
+		},
+		{
+			"fieldname":"credit_days_based_on",
+			"label": __("Credit Days Based On"),
+			"fieldtype": "Select",
+			"options": "" + NEWLINE + "Fixed Days" + NEWLINE + "Last Day of the Next Month"
+		},
+		{
+			"fieldtype": "Break",
+		},
+		{
 			"fieldname":"report_date",
 			"label": __("Date"),
 			"fieldtype": "Date",
@@ -30,9 +45,6 @@
 			"default": "Posting Date"
 		},
 		{
-			"fieldtype": "Break",
-		},
-		{
 			"fieldname":"range1",
 			"label": __("Ageing Range 1"),
 			"fieldtype": "Int",
diff --git a/erpnext/accounts/report/accounts_receivable_summary/accounts_receivable_summary.py b/erpnext/accounts/report/accounts_receivable_summary/accounts_receivable_summary.py
index 8c627b6..81bcccb 100644
--- a/erpnext/accounts/report/accounts_receivable_summary/accounts_receivable_summary.py
+++ b/erpnext/accounts/report/accounts_receivable_summary/accounts_receivable_summary.py
@@ -27,7 +27,10 @@
 			str(self.filters.range3) + _("-Above") + ":Currency/currency:100"]
 
 		if args.get("party_type") == "Customer":
-			columns += [_("Territory") + ":Link/Territory:80"]
+			columns += [
+				_("Territory") + ":Link/Territory:80", 
+				_("Customer Group") + ":Link/Customer Group:120"
+			]
 		if args.get("party_type") == "Supplier":
 			columns += [_("Supplier Type") + ":Link/Supplier Type:80"]
 			
@@ -58,7 +61,7 @@
 			]
 
 			if args.get("party_type") == "Customer":
-				row += [self.get_territory(party)]
+				row += [self.get_territory(party), self.get_customer_group(party)]
 			if args.get("party_type") == "Supplier":
 				row += [self.get_supplier_type(party)]
 				
@@ -107,7 +110,7 @@
 		if args.get("party_type") == "Supplier":
 			cols += ["supplier_type", "remarks"]
 		if args.get("party_type") == "Customer":
-			cols += ["territory", "remarks"]
+			cols += ["territory", "customer_group", "remarks"]
 
 		return self.make_data_dict(cols, voucherwise_data)
 
diff --git a/erpnext/accounts/report/balance_sheet/balance_sheet.js b/erpnext/accounts/report/balance_sheet/balance_sheet.js
index a20d47c..760fa64 100644
--- a/erpnext/accounts/report/balance_sheet/balance_sheet.js
+++ b/erpnext/accounts/report/balance_sheet/balance_sheet.js
@@ -3,6 +3,13 @@
 
 frappe.require("assets/erpnext/js/financial_statements.js", function() {
 	frappe.query_reports["Balance Sheet"] = erpnext.financial_statements;
+
+	frappe.query_reports["Balance Sheet"]["filters"].push({
+		"fieldname": "accumulated_values",
+		"label": __("Accumulated Values"),
+		"fieldtype": "Check",
+		"default": 1
+	});
 });
 
 
diff --git a/erpnext/accounts/report/balance_sheet/balance_sheet.py b/erpnext/accounts/report/balance_sheet/balance_sheet.py
index 4325afc..2db4ef8 100644
--- a/erpnext/accounts/report/balance_sheet/balance_sheet.py
+++ b/erpnext/accounts/report/balance_sheet/balance_sheet.py
@@ -8,11 +8,20 @@
 from erpnext.accounts.report.financial_statements import (get_period_list, get_columns, get_data)
 
 def execute(filters=None):
-	period_list = get_period_list(filters.from_fiscal_year, filters.to_fiscal_year, filters.periodicity, filters.company)
+	period_list = get_period_list(filters.from_fiscal_year, filters.to_fiscal_year, 
+		filters.periodicity, company=filters.company)
 
-	asset = get_data(filters.company, "Asset", "Debit", period_list, only_current_fiscal_year=False)
-	liability = get_data(filters.company, "Liability", "Credit", period_list, only_current_fiscal_year=False)
-	equity = get_data(filters.company, "Equity", "Credit", period_list, only_current_fiscal_year=False)
+	asset = get_data(filters.company, "Asset", "Debit", period_list, 
+		only_current_fiscal_year=False, filters=filters,
+		accumulated_values=filters.accumulated_values)
+		
+	liability = get_data(filters.company, "Liability", "Credit", period_list, 
+		only_current_fiscal_year=False, filters=filters,
+		accumulated_values=filters.accumulated_values)
+		
+	equity = get_data(filters.company, "Equity", "Credit", period_list, 
+		only_current_fiscal_year=False, filters=filters,
+		accumulated_values=filters.accumulated_values)
 
 	provisional_profit_loss, total_credit = get_provisional_profit_loss(asset, liability, equity,
 		period_list, filters.company)
@@ -43,9 +52,9 @@
 	if total_credit:
 		data.append(total_credit)		
 
-	columns = get_columns(filters.periodicity, period_list, company=filters.company)
+	columns = get_columns(filters.periodicity, period_list, filters.accumulated_values, company=filters.company)
 	
-	chart = get_chart_data(columns, asset, liability, equity)
+	chart = get_chart_data(filters, columns, asset, liability, equity)
 
 	return columns, data, message, chart
 
@@ -102,12 +111,13 @@
 		opening_balance -= flt(liability[0].get("opening_balance", 0), float_precision)
 	if equity:
 		opening_balance -= flt(equity[0].get("opening_balance", 0), float_precision)
-
+		
+	opening_balance = flt(opening_balance, float_precision)
 	if opening_balance:
 		return _("Previous Financial Year is not closed"),opening_balance
 	return None,None
 		
-def get_chart_data(columns, asset, liability, equity):
+def get_chart_data(filters, columns, asset, liability, equity):
 	x_intervals = ['x'] + [d.get("label") for d in columns[2:]]
 	
 	asset_data, liability_data, equity_data = [], [], []
@@ -128,9 +138,14 @@
 	if equity_data:
 		columns.append(["Equity"] + equity_data)
 
-	return {
+	chart = {
 		"data": {
 			'x': 'x',
 			'columns': columns
 		}
 	}
+
+	if not filters.accumulated_values:
+		chart["chart_type"] = "bar"
+
+	return chart
\ No newline at end of file
diff --git a/erpnext/accounts/report/bank_clearance_summary/bank_clearance_summary.js b/erpnext/accounts/report/bank_clearance_summary/bank_clearance_summary.js
index ac3366c..e4f0384 100644
--- a/erpnext/accounts/report/bank_clearance_summary/bank_clearance_summary.js
+++ b/erpnext/accounts/report/bank_clearance_summary/bank_clearance_summary.js
@@ -22,7 +22,8 @@
 			"fieldtype": "Link",
 			"options": "Account",
 			"reqd": 1,
-			"default": locals[":Company"][frappe.defaults.get_user_default("Company")]["default_bank_account"],
+			"default": frappe.defaults.get_user_default("Company")? 
+				locals[":Company"][frappe.defaults.get_user_default("Company")]["default_bank_account"]: "",
 			"get_query": function() {
 				return {
 					"query": "erpnext.controllers.queries.get_account_list",
diff --git a/erpnext/accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.js b/erpnext/accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.js
index ca8e50b..e420fb9 100644
--- a/erpnext/accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.js
+++ b/erpnext/accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.js
@@ -8,7 +8,8 @@
 			"label": __("Bank Account"),
 			"fieldtype": "Link",
 			"options": "Account",
-			"default": locals[":Company"][frappe.defaults.get_user_default("Company")]["default_bank_account"],
+			"default": frappe.defaults.get_user_default("Company")? 
+				locals[":Company"][frappe.defaults.get_user_default("Company")]["default_bank_account"]: "",
 			"reqd": 1,
 			"get_query": function() {
 				return {
diff --git a/erpnext/accounts/report/cash_flow/cash_flow.py b/erpnext/accounts/report/cash_flow/cash_flow.py
index d2c8c3e..f55d192 100644
--- a/erpnext/accounts/report/cash_flow/cash_flow.py
+++ b/erpnext/accounts/report/cash_flow/cash_flow.py
@@ -11,7 +11,7 @@
 
 def execute(filters=None):
 	period_list = get_period_list(filters.from_fiscal_year, filters.to_fiscal_year, 
-		filters.periodicity, filters.company)
+		filters.periodicity, filters.accumulated_values, filters.company)
 
 	operation_accounts = {
 		"section_name": "Operations",
diff --git a/erpnext/accounts/report/financial_statements.html b/erpnext/accounts/report/financial_statements.html
index 6959e5d..cd92139 100644
--- a/erpnext/accounts/report/financial_statements.html
+++ b/erpnext/accounts/report/financial_statements.html
@@ -13,12 +13,16 @@
 		height: 37px;
 	}
 </style>
+{% var letterhead= filters.letter_head || frappe.get_doc(":Company", filters.company).default_letter_head || frappe.defaults.get_default("letter_head"); %}
+{% if(letterhead) { %} 
 <div style="margin-bottom: 7px;" class="text-center">
-	{%= frappe.boot.letter_heads[frappe.get_doc(":Company", filters.company).default_letter_head || frappe.defaults.get_default("letter_head")] %}
+	{%= frappe.boot.letter_heads[letterhead].header %}
 </div>
+{% } %}
 <h2 class="text-center">{%= __(report.report_name) %}</h2>
-<h4 class="text-center">{%= filters.company %}</h3>
-<h4 class="text-center">{%= filters.fiscal_year %}</h3>
+<h3 class="text-center">{%= filters.company %}</h3>
+<h3 class="text-center">{%= filters.fiscal_year %}</h3>
+<h5 class="text-center">{%=  __("Currency") %} : {%= erpnext.get_currency(filters.company) %} </h4>
 {% if (filters.from_date) { %}
 	<h4 class="text-center">{%= dateutil.str_to_user(filters.from_date) %} - {%= dateutil.str_to_user(filters.to_date) %}</h3>
 {% } %}
@@ -47,7 +51,7 @@
 					<td class="text-right">
 						{% var fieldname = report.columns[i].field; %}
 						{% if (!is_null(row[fieldname])) { %}
-							{%= format_currency(row[fieldname], row.currency) %}
+							{%= format_number(row[fieldname], null)%}
 						{% } %}
 					</td>
 				{% } %}
diff --git a/erpnext/accounts/report/financial_statements.py b/erpnext/accounts/report/financial_statements.py
index 80b0bf2..41d0e48 100644
--- a/erpnext/accounts/report/financial_statements.py
+++ b/erpnext/accounts/report/financial_statements.py
@@ -4,9 +4,13 @@
 from __future__ import unicode_literals
 import frappe
 from frappe import _
-from frappe.utils import flt, getdate, get_first_day, add_months, add_days, formatdate
+from frappe.utils import (flt, getdate, get_first_day, get_last_day, date_diff,
+	add_months, add_days, formatdate, cint)
+from erpnext.accounts.utils import get_fiscal_year
 
-def get_period_list(from_fiscal_year, to_fiscal_year, periodicity, company):
+
+def get_period_list(from_fiscal_year, to_fiscal_year, periodicity, accumulated_values=False, 
+	company=None, reset_period_on_fy_change=True):
 	"""Get a list of dict {"from_date": from_date, "to_date": to_date, "key": key, "label": label}
 		Periodicity can be (Yearly, Quarterly, Monthly)"""
 
@@ -48,7 +52,8 @@
 			# if a fiscal year ends before a 12 month period
 			period.to_date = year_end_date
 
-		period.to_date_fiscal_year = get_date_fiscal_year(period.to_date, company)
+		period.to_date_fiscal_year = get_fiscal_year(period.to_date, company=company)[0]
+		period.from_date_fiscal_year_start_date = get_fiscal_year(period.from_date, company=company)[1]
 
 		period_list.append(period)
 
@@ -58,11 +63,17 @@
 	# common processing
 	for opts in period_list:
 		key = opts["to_date"].strftime("%b_%Y").lower()
-		if periodicity == "Monthly":
+		if periodicity == "Monthly" and not accumulated_values:
 			label = formatdate(opts["to_date"], "MMM YYYY")
 		else:
-			label = get_label(periodicity, opts["from_date"], opts["to_date"])
-			
+			if not accumulated_values:
+				label = get_label(periodicity, opts["from_date"], opts["to_date"])
+			else:
+				if reset_period_on_fy_change:
+					label = get_label(periodicity, opts.from_date_fiscal_year_start_date, opts["to_date"])
+				else:
+					label = get_label(periodicity, period_list[0].from_date, opts["to_date"])
+
 		opts.update({
 			"key": key.replace(" ", "_").replace("-", "_"),
 			"label": label,
@@ -139,16 +150,13 @@
 
 				if entry.posting_date <= period.to_date:
 					if (accumulated_values or entry.posting_date >= period.from_date) and \
-						(not ignore_accumulated_values_for_fy or entry.fiscal_year == period.to_date_fiscal_year):
+						(not ignore_accumulated_values_for_fy or 
+							entry.fiscal_year == period.to_date_fiscal_year):
 						d[period.key] = d.get(period.key, 0.0) + flt(entry.debit) - flt(entry.credit)
 
 			if entry.posting_date < period_list[0].year_start_date:
 				d["opening_balance"] = d.get("opening_balance", 0.0) + flt(entry.debit) - flt(entry.credit)
 				
-def get_date_fiscal_year(date, company):
-	from erpnext.accounts.utils import get_fiscal_year
-	return get_fiscal_year(date, company=company)[0]
-
 def accumulate_values_into_parents(accounts, accounts_by_name, period_list, accumulated_values):
 	"""accumulate children's values in parent accounts"""
 	for d in reversed(accounts):
diff --git a/erpnext/accounts/report/general_ledger/general_ledger.html b/erpnext/accounts/report/general_ledger/general_ledger.html
index 7552eed..b0ca19f 100644
--- a/erpnext/accounts/report/general_ledger/general_ledger.html
+++ b/erpnext/accounts/report/general_ledger/general_ledger.html
@@ -1,8 +1,19 @@
+{% var letterhead= filters.letter_head || frappe.get_doc(":Company", filters.company).default_letter_head || frappe.defaults.get_default("letter_head"); %}
+{% if(letterhead) { %} 
 <div style="margin-bottom: 7px;" class="text-center">
-	{%= frappe.boot.letter_heads[filters.letter_head || frappe.get_doc(":Company", filters.company).default_letter_head || frappe.defaults.get_default("letter_head")] %}
+	{%= frappe.boot.letter_heads[letterhead].header %}
 </div>
+{% } %}
 <h2 class="text-center">{%= __("Statement of Account") %}</h2>
-<h4 class="text-center">{%= (filters.party || filters.account) && ((filters.party || filters.account) + ", ")  || "" %} {%= filters.company %}</h4>
+<h4 class="text-center">
+	{% if (filters.party_name) { %}
+		{%= filters.party_name %}
+	{% } else if (filters.party) { %}
+		{%= filters.party %}
+	{% } else if (filters.account) { %}
+		{%= filters.account %}
+	{% } %}
+</h4>
 <h5 class="text-center">
 	{%= dateutil.str_to_user(filters.from_date) %}
 	{%= __("to") %}
diff --git a/erpnext/accounts/report/general_ledger/general_ledger.js b/erpnext/accounts/report/general_ledger/general_ledger.js
index a422871..b519965 100644
--- a/erpnext/accounts/report/general_ledger/general_ledger.js
+++ b/erpnext/accounts/report/general_ledger/general_ledger.js
@@ -74,9 +74,28 @@
 					frappe.throw(__("Please select Party Type first"));
 				}
 				return party_type;
+			},
+			change: function() {
+				var party_type = frappe.query_report_filters_by_name.party_type.get_value();
+				var party = frappe.query_report_filters_by_name.party.get_value();
+				if(!party_type || !party) {
+					frappe.query_report_filters_by_name.party_name.set_value("");
+					return;
+				}
+
+				var fieldname = party_type.toLowerCase() + "_name";
+				frappe.db.get_value(party_type, party, fieldname, function(value) {
+					frappe.query_report_filters_by_name.party_name.set_value(value[fieldname]);
+				});
 			}
 		},
 		{
+			"fieldname":"party_name",
+			"label": __("Party Name"),
+			"fieldtype": "Data",
+			"hidden": 1
+		},
+		{
 			"fieldname":"group_by_voucher",
 			"label": __("Group by Voucher"),
 			"fieldtype": "Check",
diff --git a/erpnext/accounts/report/general_ledger/general_ledger.py b/erpnext/accounts/report/general_ledger/general_ledger.py
index d09ac70..5d1aabe 100644
--- a/erpnext/accounts/report/general_ledger/general_ledger.py
+++ b/erpnext/accounts/report/general_ledger/general_ledger.py
@@ -66,7 +66,8 @@
 			if gle_currency:
 				account_currency = gle_currency
 			else:
-				account_currency = frappe.db.get_value(filters.party_type, filters.party, "default_currency")
+				account_currency = None if filters.party_type == "Employee" else \
+					frappe.db.get_value(filters.party_type, filters.party, "default_currency")
 
 		filters["account_currency"] = account_currency or filters.company_currency
 
diff --git a/erpnext/accounts/report/gross_profit/gross_profit.py b/erpnext/accounts/report/gross_profit/gross_profit.py
index 48c6d9a..4b28f1f 100644
--- a/erpnext/accounts/report/gross_profit/gross_profit.py
+++ b/erpnext/accounts/report/gross_profit/gross_profit.py
@@ -12,7 +12,7 @@
 
 def execute(filters=None):
 	if not filters: filters = frappe._dict()
-	company_currency = frappe.db.get_value("Company", filters.company, "default_currency")
+	filters.currency = frappe.db.get_value("Company", filters.company, "default_currency")
 
 	gross_profit_data = GrossProfitGenerator(filters)
 
@@ -50,7 +50,7 @@
 		for col in group_wise_columns.get(scrub(filters.group_by)):
 			row.append(src.get(col))
 
-		row.append(company_currency)
+		row.append(filters.currency)
 		data.append(row)
 
 	return columns, data
@@ -218,14 +218,18 @@
 	def get_average_buying_rate(self, row, item_code):
 		if not item_code in self.average_buying_rate:
 			if item_code in self.non_stock_items:
-				self.average_buying_rate[item_code] = flt(frappe.db.sql("""select sum(base_net_amount) / sum(qty * conversion_factor)
+				self.average_buying_rate[item_code] = flt(frappe.db.sql("""
+					select sum(base_net_amount) / sum(qty * conversion_factor)
 					from `tabPurchase Invoice Item`
 					where item_code = %s and docstatus=1""", item_code)[0][0])
 			else:
 				average_buying_rate = get_incoming_rate(row)
 				if not average_buying_rate:
-					average_buying_rate = get_valuation_rate(item_code, row.warehouse, allow_zero_rate=True)
-				self.average_buying_rate[item_code] =  average_buying_rate
+					average_buying_rate = get_valuation_rate(item_code, row.warehouse,
+						row.parenttype, row.parent, allow_zero_rate=True, 
+						currency=self.filters.currency)
+
+				self.average_buying_rate[item_code] =  flt(average_buying_rate)
 
 		return self.average_buying_rate[item_code]
 
@@ -235,7 +239,7 @@
 			select (a.base_rate / a.conversion_factor)
 			from `tabPurchase Invoice Item` a
 			where a.item_code = %s and a.docstatus=1
-			and modified <= %s 
+			and modified <= %s
 			order by a.modified desc limit 1""", (item_code,self.filters.to_date))
 		else:
 			last_purchase_rate = frappe.db.sql("""
@@ -253,7 +257,7 @@
 			conditions += " and posting_date >= %(from_date)s"
 		if self.filters.to_date:
 			conditions += " and posting_date <= %(to_date)s"
-					
+
 		if self.filters.group_by=="Sales Person":
 			sales_person_cols = ", sales.sales_person, sales.allocated_amount, sales.incentives"
 			sales_team_table = "left join `tabSales Team` sales on sales.parent = `tabSales Invoice`.name"
@@ -269,7 +273,7 @@
 				`tabSales Invoice Item`.dn_detail, `tabSales Invoice Item`.delivery_note, `tabSales Invoice Item`.stock_qty as qty,
 				`tabSales Invoice Item`.base_net_rate, `tabSales Invoice Item`.base_net_amount, `tabSales Invoice Item`.name as "item_row"
 				{sales_person_cols}
-			from 
+			from
 				`tabSales Invoice`
 				inner join `tabSales Invoice Item` on `tabSales Invoice Item`.parent = `tabSales Invoice`.name
 				{sales_team_table}
@@ -277,7 +281,7 @@
 				`tabSales Invoice`.docstatus = 1 and `tabSales Invoice`.is_return != 1 {conditions} {match_cond}
 			order by
 				`tabSales Invoice`.posting_date desc, `tabSales Invoice`.posting_time desc"""
-			.format(conditions=conditions, sales_person_cols=sales_person_cols, 
+			.format(conditions=conditions, sales_person_cols=sales_person_cols,
 				sales_team_table=sales_team_table, match_cond = get_match_cond('Sales Invoice')), self.filters, as_dict=1)
 
 	def load_stock_ledger_entries(self):
diff --git a/erpnext/accounts/report/profit_and_loss_statement/profit_and_loss_statement.py b/erpnext/accounts/report/profit_and_loss_statement/profit_and_loss_statement.py
index 02dc870..95085b9 100644
--- a/erpnext/accounts/report/profit_and_loss_statement/profit_and_loss_statement.py
+++ b/erpnext/accounts/report/profit_and_loss_statement/profit_and_loss_statement.py
@@ -9,12 +9,15 @@
 
 def execute(filters=None):
 	period_list = get_period_list(filters.from_fiscal_year, filters.to_fiscal_year, 
-		filters.periodicity, filters.company)
+		filters.periodicity, filters.accumulated_values, filters.company)
 
 	income = get_data(filters.company, "Income", "Credit", period_list, filters = filters,
-		accumulated_values=filters.accumulated_values, ignore_closing_entries=True, ignore_accumulated_values_for_fy= True)
+		accumulated_values=filters.accumulated_values, 
+		ignore_closing_entries=True, ignore_accumulated_values_for_fy= True)
+		
 	expense = get_data(filters.company, "Expense", "Debit", period_list, filters=filters,
-		accumulated_values=filters.accumulated_values, ignore_closing_entries=True, ignore_accumulated_values_for_fy= True)
+		accumulated_values=filters.accumulated_values, 
+		ignore_closing_entries=True, ignore_accumulated_values_for_fy= True)
 
 	net_profit_loss = get_net_profit_loss(income, expense, period_list, filters.company)
 
diff --git a/erpnext/accounts/report/purchase_register/purchase_register.py b/erpnext/accounts/report/purchase_register/purchase_register.py
index 47f79f1..1a63a9d 100644
--- a/erpnext/accounts/report/purchase_register/purchase_register.py
+++ b/erpnext/accounts/report/purchase_register/purchase_register.py
@@ -20,7 +20,7 @@
 	invoice_expense_map, invoice_tax_map = get_invoice_tax_map(invoice_list,
 		invoice_expense_map, expense_accounts)
 	invoice_po_pr_map = get_invoice_po_pr_map(invoice_list)
-	supplier_details = get_supplier_deatils(invoice_list)
+	supplier_details = get_supplier_details(invoice_list)
 	
 	company_currency = frappe.db.get_value("Company", filters.company, "default_currency")
 
@@ -205,7 +205,7 @@
 
 	return account_map
 
-def get_supplier_deatils(invoice_list):
+def get_supplier_details(invoice_list):
 	supplier_details = {}
 	suppliers = list(set([inv.supplier for inv in invoice_list]))
 	for supp in frappe.db.sql("""select name, supplier_type from `tabSupplier`
diff --git a/erpnext/accounts/report/sales_register/sales_register.py b/erpnext/accounts/report/sales_register/sales_register.py
index 4dc8f8c..1ef17ac 100644
--- a/erpnext/accounts/report/sales_register/sales_register.py
+++ b/erpnext/accounts/report/sales_register/sales_register.py
@@ -7,7 +7,7 @@
 from frappe import msgprint, _
 
 def execute(filters=None):
-	if not filters: filters = {}
+	if not filters: filters = frappe._dict({})
 
 	invoice_list = get_invoices(filters)
 	columns, income_accounts, tax_accounts = get_columns(invoice_list)
diff --git a/erpnext/accounts/report/trial_balance/trial_balance.py b/erpnext/accounts/report/trial_balance/trial_balance.py
index 5f606e4..9eea472 100644
--- a/erpnext/accounts/report/trial_balance/trial_balance.py
+++ b/erpnext/accounts/report/trial_balance/trial_balance.py
@@ -2,7 +2,7 @@
 # License: GNU General Public License v3. See license.txt
 
 from __future__ import unicode_literals
-import frappe
+import frappe, erpnext
 from frappe import _
 from frappe.utils import flt, getdate, formatdate, cstr
 from erpnext.accounts.report.financial_statements \
@@ -53,6 +53,7 @@
 def get_data(filters):
 	accounts = frappe.db.sql("""select name, parent_account, account_name, root_type, report_type, lft, rgt
 		from `tabAccount` where company=%s order by lft""", filters.company, as_dict=True)
+	company_currency = erpnext.get_company_currency(filters.company)
 
 	if not accounts:
 		return None
@@ -69,10 +70,10 @@
 
 	opening_balances = get_opening_balances(filters)
 
-	total_row = calculate_values(accounts, gl_entries_by_account, opening_balances, filters)
+	total_row = calculate_values(accounts, gl_entries_by_account, opening_balances, filters, company_currency)
 	accumulate_values_into_parents(accounts, accounts_by_name)
 
-	data = prepare_data(accounts, filters, total_row, parent_children_map)
+	data = prepare_data(accounts, filters, total_row, parent_children_map, company_currency)
 	data = filter_out_zero_value_rows(data, parent_children_map, 
 		show_zero_values=filters.get("show_zero_values"))
 		
@@ -119,7 +120,7 @@
 
 	return opening
 
-def calculate_values(accounts, gl_entries_by_account, opening_balances, filters):
+def calculate_values(accounts, gl_entries_by_account, opening_balances, filters, company_currency):
 	init = {
 		"opening_debit": 0.0,
 		"opening_credit": 0.0,
@@ -137,7 +138,8 @@
 		"credit": 0.0,
 		"parent_account": None,
 		"indent": 0,
-		"has_value": True
+		"has_value": True,
+		"currency": company_currency
 	}
 
 	for d in accounts:
@@ -164,9 +166,8 @@
 			for key in value_fields:
 				accounts_by_name[d.parent_account][key] += d[key]
 
-def prepare_data(accounts, filters, total_row, parent_children_map):
+def prepare_data(accounts, filters, total_row, parent_children_map, company_currency):
 	data = []
-	company_currency = frappe.db.get_value("Company", filters.company, "default_currency")
 	
 	for d in accounts:
 		has_value = False
diff --git a/erpnext/accounts/utils.py b/erpnext/accounts/utils.py
index 854f302..1721fa9 100644
--- a/erpnext/accounts/utils.py
+++ b/erpnext/accounts/utils.py
@@ -4,14 +4,13 @@
 from __future__ import unicode_literals
 
 import frappe
+import frappe.defaults
 from frappe.utils import nowdate, cstr, flt, cint, now, getdate
 from frappe import throw, _
-from frappe.utils import formatdate
+from frappe.utils import formatdate, get_number_format_info
 
 # imported to enable erpnext.accounts.utils.get_account_currency
 from erpnext.accounts.doctype.account.account import get_account_currency
-import frappe.defaults
-from erpnext.accounts.report.financial_statements import sort_root_accounts
 
 class FiscalYearError(frappe.ValidationError): pass
 
@@ -537,15 +536,14 @@
 
 	return difference
 
-def get_currency_precision(currency=None):
-	if not currency:
-		currency = frappe.db.get_value("Company",
-			frappe.db.get_default("Company"), "default_currency", cache=True)
-	currency_format = frappe.db.get_value("Currency", currency, "number_format", cache=True)
-
-	from frappe.utils import get_number_format_info
-	return get_number_format_info(currency_format)[2]
-
+def get_currency_precision():	
+	precision = cint(frappe.db.get_default("currency_precision"))
+	if not precision:
+		number_format = frappe.db.get_default("number_format") or "#,###.##"
+		precision = get_number_format_info(number_format)[2]
+	
+	return precision
+	
 def get_stock_rbnb_difference(posting_date, company):
 	stock_items = frappe.db.sql_list("""select distinct item_code
 		from `tabStock Ledger Entry` where company=%s""", company)
@@ -653,6 +651,8 @@
 
 @frappe.whitelist()
 def get_children():
+	from erpnext.accounts.report.financial_statements import sort_root_accounts
+	
 	args = frappe.local.form_dict
 	doctype, company = args['doctype'], args['company']
 	fieldname = frappe.db.escape(doctype.lower().replace(' ','_'))
diff --git a/erpnext/buying/doctype/purchase_common/README.md b/erpnext/buying/doctype/purchase_common/README.md
deleted file mode 100644
index bedec2a..0000000
--- a/erpnext/buying/doctype/purchase_common/README.md
+++ /dev/null
@@ -1 +0,0 @@
-Common scripts for purchase transactions.
\ No newline at end of file
diff --git a/erpnext/buying/doctype/purchase_common/__init__.py b/erpnext/buying/doctype/purchase_common/__init__.py
deleted file mode 100644
index baffc48..0000000
--- a/erpnext/buying/doctype/purchase_common/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from __future__ import unicode_literals
diff --git a/erpnext/buying/doctype/purchase_common/purchase_common.json b/erpnext/buying/doctype/purchase_common/purchase_common.json
deleted file mode 100644
index fd08d08..0000000
--- a/erpnext/buying/doctype/purchase_common/purchase_common.json
+++ /dev/null
@@ -1,26 +0,0 @@
-{
- "allow_copy": 0, 
- "allow_import": 0, 
- "allow_rename": 0, 
- "creation": "2012-03-27 14:35:51", 
- "custom": 0, 
- "docstatus": 0, 
- "doctype": "DocType", 
- "fields": [], 
- "hide_heading": 0, 
- "hide_toolbar": 0, 
- "idx": 1, 
- "in_create": 0, 
- "in_dialog": 0, 
- "is_submittable": 0, 
- "issingle": 1, 
- "istable": 0, 
- "modified": "2013-12-20 19:23:27", 
- "modified_by": "Administrator", 
- "module": "Buying", 
- "name": "Purchase Common", 
- "owner": "Administrator", 
- "permissions": [], 
- "read_only": 0, 
- "read_only_onload": 0
-}
\ No newline at end of file
diff --git a/erpnext/buying/doctype/purchase_common/purchase_common.py b/erpnext/buying/doctype/purchase_common/purchase_common.py
deleted file mode 100644
index 844a655..0000000
--- a/erpnext/buying/doctype/purchase_common/purchase_common.py
+++ /dev/null
@@ -1,105 +0,0 @@
-# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
-# License: GNU General Public License v3. See license.txt
-
-from __future__ import unicode_literals
-import frappe, json
-from frappe.utils import flt, cstr, cint
-from frappe import _
-
-from erpnext.stock.doctype.item.item import get_last_purchase_details
-from erpnext.controllers.buying_controller import BuyingController
-
-class PurchaseCommon(BuyingController):
-	def update_last_purchase_rate(self, obj, is_submit):
-		"""updates last_purchase_rate in item table for each item"""
-
-		import frappe.utils
-		this_purchase_date = frappe.utils.getdate(obj.get('posting_date') or obj.get('transaction_date'))
-
-		for d in obj.get("items"):
-			# get last purchase details
-			last_purchase_details = get_last_purchase_details(d.item_code, obj.name)
-
-			# compare last purchase date and this transaction's date
-			last_purchase_rate = None
-			if last_purchase_details and \
-					(last_purchase_details.purchase_date > this_purchase_date):
-				last_purchase_rate = last_purchase_details['base_rate']
-			elif is_submit == 1:
-				# even if this transaction is the latest one, it should be submitted
-				# for it to be considered for latest purchase rate
-				if flt(d.conversion_factor):
-					last_purchase_rate = flt(d.base_rate) / flt(d.conversion_factor)
-				else:
-					frappe.throw(_("UOM Conversion factor is required in row {0}").format(d.idx))
-
-			# update last purchsae rate
-			if last_purchase_rate:
-				frappe.db.sql("""update `tabItem` set last_purchase_rate = %s where name = %s""",
-					(flt(last_purchase_rate), d.item_code))
-
-	def validate_for_items(self, obj):
-		items = []
-		for d in obj.get("items"):
-			if not d.qty:
-				if obj.doctype == "Purchase Receipt" and d.rejected_qty:
-					continue
-				frappe.throw(_("Please enter quantity for Item {0}").format(d.item_code))
-
-			# udpate with latest quantities
-			bin = frappe.db.sql("""select projected_qty from `tabBin` where
-				item_code = %s and warehouse = %s""", (d.item_code, d.warehouse), as_dict=1)
-
-			f_lst ={'projected_qty': bin and flt(bin[0]['projected_qty']) or 0, 'ordered_qty': 0, 'received_qty' : 0}
-			if d.doctype in ('Purchase Receipt Item', 'Purchase Invoice Item'):
-				f_lst.pop('received_qty')
-			for x in f_lst :
-				if d.meta.get_field(x):
-					d.set(x, f_lst[x])
-
-			item = frappe.db.sql("""select is_stock_item,
-				is_sub_contracted_item, end_of_life, disabled from `tabItem` where name=%s""",
-				d.item_code, as_dict=1)[0]
-
-			from erpnext.stock.doctype.item.item import validate_end_of_life
-			validate_end_of_life(d.item_code, item.end_of_life, item.disabled)
-
-			# validate stock item
-			if item.is_stock_item==1 and d.qty and not d.warehouse and not d.delivered_by_supplier:
-				frappe.throw(_("Warehouse is mandatory for stock Item {0} in row {1}").format(d.item_code, d.idx))
-
-			items.append(cstr(d.item_code))
-
-		if items and len(items) != len(set(items)) and \
-			not cint(frappe.db.get_single_value("Buying Settings", "allow_multiple_items") or 0):
-			frappe.throw(_("Same item cannot be entered multiple times."))
-
-	def check_for_closed_status(self, doctype, docname):
-		status = frappe.db.get_value(doctype, docname, "status")
-
-		if status == "Closed":
-			frappe.throw(_("{0} {1} status is {2}").format(doctype, docname, status), frappe.InvalidStatusError)
-			
-@frappe.whitelist()
-def get_linked_material_requests(items):
-	items = json.loads(items)
-	mr_list = []
-	for item in items:
-		material_request = frappe.db.sql("""SELECT distinct mr.name AS mr_name, 
-				(mr_item.qty - mr_item.ordered_qty) AS qty, 
-				mr_item.item_code AS item_code,
-				mr_item.name AS mr_item 
-			FROM `tabMaterial Request` mr, `tabMaterial Request Item` mr_item
-			WHERE mr.name = mr_item.parent
-				AND mr_item.item_code = %(item)s 
-				AND mr.material_request_type = 'Purchase'
-				AND mr.per_ordered < 99.99
-				AND mr.docstatus = 1
-				AND mr.status != 'Stopped'
-                        ORDER BY mr_item.item_code ASC""",{"item": item}, as_dict=1)
-		if material_request:
-			mr_list.append(material_request)
-	
-	return mr_list
-	
-	
\ No newline at end of file
diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.js b/erpnext/buying/doctype/purchase_order/purchase_order.js
index 5b16cd6..cfd3336 100644
--- a/erpnext/buying/doctype/purchase_order/purchase_order.js
+++ b/erpnext/buying/doctype/purchase_order/purchase_order.js
@@ -3,7 +3,7 @@
 
 frappe.provide("erpnext.buying");
 
-{% include 'erpnext/buying/doctype/purchase_common/purchase_common.js' %};
+{% include 'erpnext/public/js/controllers/buying.js' %};
 
 frappe.ui.form.on("Purchase Order", {
 	setup: function(frm) {
@@ -153,30 +153,37 @@
 	},
 
 	add_from_mappers: function() {
-		cur_frm.add_custom_button(__('Material Request'),
+		var me = this;
+		this.frm.add_custom_button(__('Material Request'),
 			function() {
 				erpnext.utils.map_current_doc({
 					method: "erpnext.stock.doctype.material_request.material_request.make_purchase_order",
 					source_doctype: "Material Request",
+					target: me.frm,
+					setters: {
+						company: me.frm.doc.company
+					},
 					get_query_filters: {
 						material_request_type: "Purchase",
 						docstatus: 1,
 						status: ["!=", "Stopped"],
 						per_ordered: ["<", 99.99],
-						company: cur_frm.doc.company
 					}
 				})
 			}, __("Add items from"));
 
-		cur_frm.add_custom_button(__('Supplier Quotation'),
+		this.frm.add_custom_button(__('Supplier Quotation'),
 			function() {
 				erpnext.utils.map_current_doc({
 					method: "erpnext.buying.doctype.supplier_quotation.supplier_quotation.make_purchase_order",
 					source_doctype: "Supplier Quotation",
+					target: me.frm,
+					setters: {
+						company: me.frm.doc.company
+					},
 					get_query_filters: {
 						docstatus: 1,
 						status: ["!=", "Stopped"],
-						company: cur_frm.doc.company
 					}
 				})
 			}, __("Add items from"));
diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.json b/erpnext/buying/doctype/purchase_order/purchase_order.json
index e776b3e..ecce118 100644
--- a/erpnext/buying/doctype/purchase_order/purchase_order.json
+++ b/erpnext/buying/doctype/purchase_order/purchase_order.json
@@ -1,5 +1,6 @@
 {
  "allow_copy": 0, 
+ "allow_guest_to_view": 0, 
  "allow_import": 1, 
  "allow_rename": 0, 
  "autoname": "naming_series:", 
@@ -341,7 +342,7 @@
    "remember_last_selected_value": 1, 
    "report_hide": 0, 
    "reqd": 1, 
-   "search_index": 1, 
+   "search_index": 0, 
    "set_only_once": 0, 
    "unique": 0
   }, 
@@ -1207,6 +1208,8 @@
    "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": "Link to material requests", 
@@ -3185,18 +3188,18 @@
    "unique": 0
   }
  ], 
+ "has_web_view": 0, 
  "hide_heading": 0, 
  "hide_toolbar": 0, 
  "icon": "fa fa-file-text", 
  "idx": 105, 
  "image_view": 0, 
  "in_create": 0, 
- "in_dialog": 0, 
  "is_submittable": 1, 
  "issingle": 0, 
  "istable": 0, 
  "max_attachments": 0, 
- "modified": "2017-02-28 18:20:15.650815", 
+ "modified": "2017-04-18 18:49:49.535066", 
  "modified_by": "Administrator", 
  "module": "Buying", 
  "name": "Purchase Order", 
@@ -3294,4 +3297,4 @@
  "title_field": "title", 
  "track_changes": 0, 
  "track_seen": 0
-}
+}
\ No newline at end of file
diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.py b/erpnext/buying/doctype/purchase_order/purchase_order.py
index 796e0f2..e7b0d1a 100644
--- a/erpnext/buying/doctype/purchase_order/purchase_order.py
+++ b/erpnext/buying/doctype/purchase_order/purchase_order.py
@@ -11,6 +11,8 @@
 from erpnext.stock.doctype.item.item import get_last_purchase_details
 from erpnext.stock.stock_balance import update_bin_qty, get_ordered_qty
 from frappe.desk.notifications import clear_doctype_notifications
+from erpnext.buying.utils import (validate_for_items, check_for_closed_status,
+	update_last_purchase_rate)
 
 
 form_grid_templates = {
@@ -37,9 +39,8 @@
 		super(PurchaseOrder, self).validate()
 
 		self.set_status()
-		pc_obj = frappe.get_doc('Purchase Common')
-		pc_obj.validate_for_items(self)
-		self.check_for_closed_status(pc_obj)
+		validate_for_items(self)
+		self.check_for_closed_status()
 
 		self.validate_uom_is_integer("uom", "qty")
 		self.validate_uom_is_integer("stock_uom", ["qty", "required_qty"])
@@ -58,7 +59,8 @@
 			},
 			"Supplier Quotation Item": {
 				"ref_dn_field": "supplier_quotation_item",
-				"compare_fields": [["rate", "="], ["project", "="], ["item_code", "="]],
+				"compare_fields": [["rate", "="], ["project", "="], ["item_code", "="], 
+					["uom", "="], ["conversion_factor", "="]],
 				"is_child_table": True
 			}
 		})
@@ -111,12 +113,12 @@
 							= d.rate = item_last_purchase_rate
 
 	# Check for Closed status
-	def check_for_closed_status(self, pc_obj):
+	def check_for_closed_status(self):
 		check_list =[]
 		for d in self.get('items'):
 			if d.meta.get_field('material_request') and d.material_request and d.material_request not in check_list:
 				check_list.append(d.material_request)
-				pc_obj.check_for_closed_status('Material Request', d.material_request)
+				check_for_closed_status('Material Request', d.material_request)
 
 	def update_requested_qty(self):
 		material_request_map = {}
@@ -155,7 +157,7 @@
 		if date_diff and date_diff[0][0]:
 			msgprint(_("{0} {1} has been modified. Please refresh.").format(self.doctype, self.name),
 				raise_exception=True)
-				
+
 	def update_status(self, status):
 		self.check_modified_date()
 		self.set_status(update=True, status=status)
@@ -168,8 +170,6 @@
 		if self.is_against_so():
 			self.update_status_updater()
 
-		purchase_controller = frappe.get_doc("Purchase Common")
-
 		self.update_prevdoc_status()
 		self.update_requested_qty()
 		self.update_ordered_qty()
@@ -177,7 +177,7 @@
 		frappe.get_doc('Authorization Control').validate_approving_authority(self.doctype,
 			self.company, self.base_grand_total)
 
-		purchase_controller.update_last_purchase_rate(self, is_submit = 1)
+		update_last_purchase_rate(self, is_submit = 1)
 
 	def on_cancel(self):
 		if self.is_against_so():
@@ -186,8 +186,7 @@
 		if self.has_drop_ship_item():
 			self.update_delivered_qty_in_sales_order()
 
-		pc_obj = frappe.get_doc('Purchase Common')
-		self.check_for_closed_status(pc_obj)
+		self.check_for_closed_status()
 
 		frappe.db.set(self,'status','Cancelled')
 
@@ -197,7 +196,7 @@
 		self.update_requested_qty()
 		self.update_ordered_qty()
 
-		pc_obj.update_last_purchase_rate(self, is_submit = 0)
+		update_last_purchase_rate(self, is_submit = 0)
 
 	def on_update(self):
 		pass
@@ -303,7 +302,7 @@
 		target.amount = flt(obj.amount) - flt(obj.billed_amt)
 		target.base_amount = target.amount * flt(source_parent.conversion_rate)
 		target.qty = target.amount / flt(obj.rate) if (flt(obj.rate) and flt(obj.billed_amt)) else flt(obj.qty)
-		
+
 		item = frappe.db.get_value("Item", target.item_code, ["item_group", "buying_cost_center"], as_dict=1)
 		target.cost_center = frappe.db.get_value("Project", obj.project, "cost_center") \
 			or item.buying_cost_center \
@@ -342,7 +341,8 @@
 	stock_entry.purchase_order = purchase_order.name
 	stock_entry.supplier = purchase_order.supplier
 	stock_entry.supplier_name = purchase_order.supplier_name
-	stock_entry.supplier_address = purchase_order.address_display
+	stock_entry.supplier_address = purchase_order.supplier_address
+	stock_entry.address_display = purchase_order.address_display
 	stock_entry.company = purchase_order.company
 	stock_entry.from_bom = 1
 	po_item = [d for d in purchase_order.items if d.item_code == item_code][0]
diff --git a/erpnext/buying/doctype/purchase_order/purchase_order_dashboard.py b/erpnext/buying/doctype/purchase_order/purchase_order_dashboard.py
index 5e460df..50382d5 100644
--- a/erpnext/buying/doctype/purchase_order/purchase_order_dashboard.py
+++ b/erpnext/buying/doctype/purchase_order/purchase_order_dashboard.py
@@ -3,6 +3,10 @@
 def get_data():
 	return {
 		'fieldname': 'purchase_order',
+		'non_standard_fieldnames': {
+			'Journal Entry': 'reference_name',
+			'Payment Entry': 'reference_name'
+		},
 		'internal_links': {
 			'Material Request': ['items', 'material_request'],
 			'Supplier Quotation': ['items', 'supplier_quotation'],
@@ -14,12 +18,16 @@
 				'items': ['Purchase Receipt', 'Purchase Invoice']
 			},
 			{
+				'label': _('Payment'),
+				'items': ['Payment Entry', 'Journal Entry']
+			},
+			{
 				'label': _('Reference'),
 				'items': ['Material Request', 'Supplier Quotation', 'Project']
 			},
 			{
 				'label': _('Sub-contracting'),
 				'items': ['Stock Entry']
-			},
+			}
 		]
 	}
\ No newline at end of file
diff --git a/erpnext/buying/doctype/purchase_order_item/purchase_order_item.json b/erpnext/buying/doctype/purchase_order_item/purchase_order_item.json
index 12d0da8..b269cb8 100755
--- a/erpnext/buying/doctype/purchase_order_item/purchase_order_item.json
+++ b/erpnext/buying/doctype/purchase_order_item/purchase_order_item.json
@@ -1,5 +1,6 @@
 {
  "allow_copy": 0, 
+ "allow_guest_to_view": 0, 
  "allow_import": 0, 
  "allow_rename": 0, 
  "autoname": "hash", 
@@ -98,7 +99,7 @@
    "remember_last_selected_value": 0, 
    "report_hide": 0, 
    "reqd": 1, 
-   "search_index": 1, 
+   "search_index": 0, 
    "set_only_once": 0, 
    "unique": 0
   }, 
@@ -156,7 +157,7 @@
    "remember_last_selected_value": 0, 
    "report_hide": 0, 
    "reqd": 1, 
-   "search_index": 1, 
+   "search_index": 0, 
    "set_only_once": 0, 
    "unique": 0
   }, 
@@ -799,6 +800,7 @@
    "oldfieldtype": "Currency", 
    "options": "Company:company:default_currency", 
    "permlevel": 0, 
+   "precision": "", 
    "print_hide": 1, 
    "print_hide_if_no_value": 0, 
    "print_width": "100px", 
@@ -1647,17 +1649,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-17 16:44:55.434162", 
+ "modified": "2017-04-25 18:49:08.604055", 
  "modified_by": "Administrator", 
  "module": "Buying", 
  "name": "Purchase Order Item", 
diff --git a/erpnext/buying/doctype/request_for_quotation/request_for_quotation.js b/erpnext/buying/doctype/request_for_quotation/request_for_quotation.js
index 59ad092..593f667 100644
--- a/erpnext/buying/doctype/request_for_quotation/request_for_quotation.js
+++ b/erpnext/buying/doctype/request_for_quotation/request_for_quotation.js
@@ -2,7 +2,7 @@
 // License: GNU General Public License v3. See license.txt
 
 
-{% include 'erpnext/buying/doctype/purchase_common/purchase_common.js' %};
+{% include 'erpnext/public/js/controllers/buying.js' %};
 
 cur_frm.add_fetch('contact', 'email_id', 'email_id')
 
@@ -48,7 +48,7 @@
 				});
 			});
 		}
-		
+
 	},
 
 	make_suppplier_quotation: function(frm) {
@@ -124,24 +124,28 @@
 
 erpnext.buying.RequestforQuotationController = erpnext.buying.BuyingController.extend({
 	refresh: function() {
+		var me = this;
 		this._super();
 		if (this.frm.doc.docstatus===0) {
-			cur_frm.add_custom_button(__('Material Request'),
+			this.frm.add_custom_button(__('Material Request'),
 				function() {
 					erpnext.utils.map_current_doc({
 						method: "erpnext.stock.doctype.material_request.material_request.make_request_for_quotation",
 						source_doctype: "Material Request",
+						target: me.frm,
+						setters: {
+							company: me.frm.doc.company
+						},
 						get_query_filters: {
 							material_request_type: "Purchase",
 							docstatus: 1,
 							status: ["!=", "Stopped"],
-							per_ordered: ["<", 99.99],
-							company: cur_frm.doc.company
+							per_ordered: ["<", 99.99]
 						}
 					})
 				}, __("Get items from"));
 				// Get items from open Material Requests based on supplier
-				cur_frm.add_custom_button(__('Possible Supplier'), function() {
+				this.frm.add_custom_button(__('Possible Supplier'), function() {
 					// Create a dialog window for the user to pick their supplier
 					var d = new frappe.ui.Dialog({
 						title: __('Select Possible Supplier'),
@@ -150,32 +154,35 @@
 						{fieldname: 'ok_button', fieldtype:'Button', label:'Get Items from Material Requests'},
 						]
 					});
-					
+
 					// On the user clicking the ok button
 					d.fields_dict.ok_button.input.onclick = function() {
 						var btn = d.fields_dict.ok_button.input;
 						var v = d.get_values();
 						if(v) {
 							$(btn).set_working();
-							
+
 							erpnext.utils.map_current_doc({
 								method: "erpnext.buying.doctype.request_for_quotation.request_for_quotation.get_item_from_material_requests_based_on_supplier",
 								source_name: v.supplier,
+								target: me.frm,
+								setters: {
+									company: me.frm.doc.company
+								},
 								get_query_filters: {
 									material_request_type: "Purchase",
 									docstatus: 1,
 									status: ["!=", "Stopped"],
-									per_ordered: ["<", 99.99],
-									company: cur_frm.doc.company
+									per_ordered: ["<", 99.99]
 								}
 							});
 							$(btn).done_working();
 							d.hide();
 						}
-					}	
+					}
 					d.show();
 				}, __("Get items from"));
-				
+
 		}
 	},
 
diff --git a/erpnext/buying/doctype/request_for_quotation/request_for_quotation.py b/erpnext/buying/doctype/request_for_quotation/request_for_quotation.py
index ab9efae..9109239 100644
--- a/erpnext/buying/doctype/request_for_quotation/request_for_quotation.py
+++ b/erpnext/buying/doctype/request_for_quotation/request_for_quotation.py
@@ -14,13 +14,14 @@
 from erpnext.accounts.party import get_party_account_currency, get_party_details
 from erpnext.stock.doctype.material_request.material_request import set_missing_values
 from erpnext.controllers.buying_controller import BuyingController
+from erpnext.buying.utils import validate_for_items
 
 STANDARD_USERS = ("Guest", "Administrator")
 
 class RequestforQuotation(BuyingController):
 	def validate(self):
 		self.validate_duplicate_supplier()
-		self.validate_common()
+		validate_for_items(self)
 		self.update_email_id()
 
 	def validate_duplicate_supplier(self):
@@ -28,10 +29,6 @@
 		if len(supplier_list) != len(set(supplier_list)):
 			frappe.throw(_("Same supplier has been entered multiple times"))
 
-	def validate_common(self):
-		pc = frappe.get_doc('Purchase Common')
-		pc.validate_for_items(self)
-
 	def update_email_id(self):
 		for rfq_supplier in self.suppliers:
 			if not rfq_supplier.email_id:
@@ -130,7 +127,7 @@
 		self.send_email(data, sender, subject, message, attachments)
 
 	def send_email(self, data, sender, subject, message, attachments):
-		make(subject = subject, content=message,recipients=data.email_id, 
+		make(subject = subject, content=message,recipients=data.email_id,
 			sender=sender,attachments = attachments, send_email=True,
 		     	doctype=self.doctype, name=self.name)["name"]
 
@@ -250,26 +247,26 @@
 		args = doc.get('suppliers')[cint(supplier_idx) - 1]
 		doc.update_supplier_part_no(args)
 		return doc
-		
+
 @frappe.whitelist()
 def get_item_from_material_requests_based_on_supplier(source_name, target_doc = None):
 	mr_items_list = frappe.db.sql("""
 		SELECT
 			mr.name, mr_item.item_code
 		FROM
-			`tabItem` as item, 
-			`tabItem Supplier` as item_supp, 
-			`tabMaterial Request Item` as mr_item, 
-			`tabMaterial Request`  as mr 
-		WHERE item_supp.supplier = %(supplier)s 
-			AND item.name = item_supp.parent 
-			AND mr_item.parent = mr.name 
-			AND mr_item.item_code = item.name 
-			AND mr.status != "Stopped" 
-			AND mr.material_request_type = "Purchase" 
-			AND mr.docstatus = 1 
+			`tabItem` as item,
+			`tabItem Supplier` as item_supp,
+			`tabMaterial Request Item` as mr_item,
+			`tabMaterial Request`  as mr
+		WHERE item_supp.supplier = %(supplier)s
+			AND item.name = item_supp.parent
+			AND mr_item.parent = mr.name
+			AND mr_item.item_code = item.name
+			AND mr.status != "Stopped"
+			AND mr.material_request_type = "Purchase"
+			AND mr.docstatus = 1
 			AND mr.per_ordered < 99.99""", {"supplier": source_name}, as_dict=1)
-	
+
 	material_requests = {}
 	for d in mr_items_list:
 		material_requests.setdefault(d.name, []).append(d.item_code)
@@ -293,5 +290,5 @@
 				]
 			}
 		}, target_doc)
-		
+
 	return target_doc
diff --git a/erpnext/buying/doctype/supplier/supplier.json b/erpnext/buying/doctype/supplier/supplier.json
index 9adb42b..746dd22 100644
--- a/erpnext/buying/doctype/supplier/supplier.json
+++ b/erpnext/buying/doctype/supplier/supplier.json
@@ -15,6 +15,7 @@
  "engine": "InnoDB", 
  "fields": [
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -45,6 +46,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -76,6 +78,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 1, 
    "collapsible": 0, 
@@ -106,6 +109,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -136,6 +140,37 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "fieldname": "tax_id", 
+   "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": "Tax ID", 
+   "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, 
@@ -165,6 +200,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -193,6 +229,7 @@
    "width": "50%"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -224,6 +261,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -254,6 +292,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 1, 
    "collapsible": 0, 
@@ -284,6 +323,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 1, 
@@ -313,6 +353,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -342,6 +383,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -370,6 +412,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -399,6 +442,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 1, 
@@ -428,6 +472,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -458,6 +503,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -487,6 +533,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -518,6 +565,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -546,6 +594,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -574,6 +623,7 @@
    "width": "50%"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -602,6 +652,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 1, 
@@ -631,12 +682,13 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
    "depends_on": "", 
-   "description": "Mention if non-standard receivable account", 
+   "description": "Mention if non-standard payable account", 
    "fieldname": "accounts", 
    "fieldtype": "Table", 
    "hidden": 0, 
@@ -662,6 +714,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 1, 
@@ -692,6 +745,7 @@
    "width": "50%"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -722,6 +776,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -753,6 +808,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -794,7 +850,7 @@
  "issingle": 0, 
  "istable": 0, 
  "max_attachments": 0, 
- "modified": "2017-03-14 17:04:17.785461", 
+ "modified": "2017-05-17 12:21:21.218428", 
  "modified_by": "Administrator", 
  "module": "Buying", 
  "name": "Supplier", 
diff --git a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.js b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.js
index 5ed210c..6bcbdba 100644
--- a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.js
+++ b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.js
@@ -2,7 +2,7 @@
 // License: GNU General Public License v3. See license.txt
 
 // attach required files
-{% include 'erpnext/buying/doctype/purchase_common/purchase_common.js' %};
+{% include 'erpnext/public/js/controllers/buying.js' %};
 
 frappe.ui.form.on('Suppier Quotation', {
 	setup: function() {
@@ -14,6 +14,7 @@
 
 erpnext.buying.SupplierQuotationController = erpnext.buying.BuyingController.extend({
 	refresh: function() {
+		var me = this;
 		this._super();
 		if (this.frm.doc.docstatus === 1) {
 			cur_frm.add_custom_button(__("Purchase Order"), this.make_purchase_order,
@@ -24,18 +25,21 @@
 
 		}
 		else if (this.frm.doc.docstatus===0) {
-			
-			cur_frm.add_custom_button(__('Material Request'),
+
+			this.frm.add_custom_button(__('Material Request'),
 				function() {
 					erpnext.utils.map_current_doc({
 						method: "erpnext.stock.doctype.material_request.material_request.make_supplier_quotation",
 						source_doctype: "Material Request",
+						target: me.frm,
+						setters: {
+							company: me.frm.doc.company
+						},
 						get_query_filters: {
 							material_request_type: "Purchase",
 							docstatus: 1,
 							status: ["!=", "Stopped"],
-							per_ordered: ["<", 99.99],
-							company: cur_frm.doc.company
+							per_ordered: ["<", 99.99]
 						}
 					})
 				}, __("Get items from"));
diff --git a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.py b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.py
index 30899c8..1cb5a18 100644
--- a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.py
+++ b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.py
@@ -8,6 +8,7 @@
 from frappe.model.mapper import get_mapped_doc
 
 from erpnext.controllers.buying_controller import BuyingController
+from erpnext.buying.utils import validate_for_items
 
 form_grid_templates = {
 	"items": "templates/form_grid/item_grid.html"
@@ -24,7 +25,7 @@
 		validate_status(self.status, ["Draft", "Submitted", "Stopped",
 			"Cancelled"])
 
-		self.validate_common()
+		validate_for_items(self)
 		self.validate_with_previous_doc()
 		self.validate_uom_is_integer("uom", "qty")
 
@@ -50,11 +51,6 @@
 			}
 		})
 
-
-	def validate_common(self):
-		pc = frappe.get_doc('Purchase Common')
-		pc.validate_for_items(self)
-
 def get_list_context(context=None):
 	from erpnext.controllers.website_list_for_contact import get_list_context
 	list_context = get_list_context(context)
diff --git a/erpnext/buying/page/purchase_analytics/purchase_analytics.js b/erpnext/buying/page/purchase_analytics/purchase_analytics.js
index 3e6f23b..10d1321 100644
--- a/erpnext/buying/page/purchase_analytics/purchase_analytics.js
+++ b/erpnext/buying/page/purchase_analytics/purchase_analytics.js
@@ -35,11 +35,7 @@
 				item_key: "supplier",
 				parent_field: "parent_supplier_type",
 				formatter: function(item) {
-					// return repl('<a href="#Report/stock-invoices/customer=%(enc_value)s">%(value)s</a>', {
-					// 		value: item.name,
-					// 		enc_value: encodeURIComponent(item.name)
-					// 	});
-					return item.name;
+					return item.supplier_name ? item.supplier_name + " (" + item.name + ")" : item.name;
 				}
 			},
 			"Supplier": {
@@ -47,7 +43,7 @@
 				show: false,
 				item_key: "supplier",
 				formatter: function(item) {
-					return item.name;
+					return item.supplier_name ? item.supplier_name + " (" + item.name + ")" : item.name;
 				}
 			},
 			"Item Group": {
diff --git a/erpnext/buying/utils.py b/erpnext/buying/utils.py
new file mode 100644
index 0000000..9ad1c5c
--- /dev/null
+++ b/erpnext/buying/utils.py
@@ -0,0 +1,103 @@
+# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
+# License: GNU General Public License v3. See license.txt
+
+from __future__ import unicode_literals
+import frappe
+from frappe.utils import flt, cstr, cint
+from frappe import _
+import json
+
+from erpnext.stock.doctype.item.item import get_last_purchase_details
+from erpnext.stock.doctype.item.item import validate_end_of_life
+
+def update_last_purchase_rate(doc, is_submit):
+	"""updates last_purchase_rate in item table for each item"""
+
+	import frappe.utils
+	this_purchase_date = frappe.utils.getdate(doc.get('posting_date') or doc.get('transaction_date'))
+
+	for d in doc.get("items"):
+		# get last purchase details
+		last_purchase_details = get_last_purchase_details(d.item_code, doc.name)
+
+		# compare last purchase date and this transaction's date
+		last_purchase_rate = None
+		if last_purchase_details and \
+				(last_purchase_details.purchase_date > this_purchase_date):
+			last_purchase_rate = last_purchase_details['base_rate']
+		elif is_submit == 1:
+			# even if this transaction is the latest one, it should be submitted
+			# for it to be considered for latest purchase rate
+			if flt(d.conversion_factor):
+				last_purchase_rate = flt(d.base_rate) / flt(d.conversion_factor)
+			else:
+				frappe.throw(_("UOM Conversion factor is required in row {0}").format(d.idx))
+
+		# update last purchsae rate
+		if last_purchase_rate:
+			frappe.db.sql("""update `tabItem` set last_purchase_rate = %s where name = %s""",
+				(flt(last_purchase_rate), d.item_code))
+
+def validate_for_items(doc):
+	items = []
+	for d in doc.get("items"):
+		if not d.qty:
+			if doc.doctype == "Purchase Receipt" and d.rejected_qty:
+				continue
+			frappe.throw(_("Please enter quantity for Item {0}").format(d.item_code))
+
+		# update with latest quantities
+		bin = frappe.db.sql("""select projected_qty from `tabBin` where
+			item_code = %s and warehouse = %s""", (d.item_code, d.warehouse), as_dict=1)
+
+		f_lst ={'projected_qty': bin and flt(bin[0]['projected_qty']) or 0, 'ordered_qty': 0, 'received_qty' : 0}
+		if d.doctype in ('Purchase Receipt Item', 'Purchase Invoice Item'):
+			f_lst.pop('received_qty')
+		for x in f_lst :
+			if d.meta.get_field(x):
+				d.set(x, f_lst[x])
+
+		item = frappe.db.sql("""select is_stock_item,
+			is_sub_contracted_item, end_of_life, disabled from `tabItem` where name=%s""",
+			d.item_code, as_dict=1)[0]
+
+		validate_end_of_life(d.item_code, item.end_of_life, item.disabled)
+
+		# validate stock item
+		if item.is_stock_item==1 and d.qty and not d.warehouse and not d.get("delivered_by_supplier"):
+			frappe.throw(_("Warehouse is mandatory for stock Item {0} in row {1}").format(d.item_code, d.idx))
+
+		items.append(cstr(d.item_code))
+
+	if items and len(items) != len(set(items)) and \
+		not cint(frappe.db.get_single_value("Buying Settings", "allow_multiple_items") or 0):
+		frappe.throw(_("Same item cannot be entered multiple times."))
+
+def check_for_closed_status(doctype, docname):
+	status = frappe.db.get_value(doctype, docname, "status")
+
+	if status == "Closed":
+		frappe.throw(_("{0} {1} status is {2}").format(doctype, docname, status), frappe.InvalidStatusError)
+
+@frappe.whitelist()
+def get_linked_material_requests(items):
+	items = json.loads(items)
+	mr_list = []
+	for item in items:
+		material_request = frappe.db.sql("""SELECT distinct mr.name AS mr_name, 
+				(mr_item.qty - mr_item.ordered_qty) AS qty, 
+				mr_item.item_code AS item_code,
+				mr_item.name AS mr_item 
+			FROM `tabMaterial Request` mr, `tabMaterial Request Item` mr_item
+			WHERE mr.name = mr_item.parent
+				AND mr_item.item_code = %(item)s 
+				AND mr.material_request_type = 'Purchase'
+				AND mr.per_ordered < 99.99
+				AND mr.docstatus = 1
+				AND mr.status != 'Stopped'
+                        ORDER BY mr_item.item_code ASC""",{"item": item}, as_dict=1)
+		if material_request:
+			mr_list.append(material_request)
+	
+	return mr_list
+
diff --git a/erpnext/config/accounts.py b/erpnext/config/accounts.py
index d9faf6d..02aa14b 100644
--- a/erpnext/config/accounts.py
+++ b/erpnext/config/accounts.py
@@ -159,6 +159,11 @@
 					"is_query_report": True,
 					"doctype": "Journal Entry"
 				},
+				{
+					"type": "doctype",
+					"name": "Bank Guarantee",
+					"doctype": "Bank Guarantee"
+				},
 			]
 		},
 		{
diff --git a/erpnext/config/crm.py b/erpnext/config/crm.py
index 9935aef..e51275c 100644
--- a/erpnext/config/crm.py
+++ b/erpnext/config/crm.py
@@ -33,6 +33,12 @@
 			"icon": "fa fa-list",
 			"items": [
 				{
+					"type": "report",
+					"is_query_report": True,
+					"name": "Lead Details",
+					"doctype": "Lead"
+				},
+				{
 					"type": "page",
 					"name": "sales-funnel",
 					"label": _("Sales Funnel"),
@@ -40,15 +46,15 @@
 				},
 				{
 					"type": "report",
-					"name": "Minutes to First Response for Opportunity",
-					"doctype": "Opportunity",
+					"name": "Prospects Engaged But Not Converted",
+					"doctype": "Lead",
 					"is_query_report": True
 				},
 				{
 					"type": "report",
-					"is_query_report": True,
-					"name": "Lead Details",
-					"doctype": "Lead"
+					"name": "Minutes to First Response for Opportunity",
+					"doctype": "Opportunity",
+					"is_query_report": True
 				},
 				{
 					"type": "report",
@@ -62,6 +68,18 @@
 					"name": "Inactive Customers",
 					"doctype": "Sales Order"
 				},
+				{
+					"type": "report",
+					"is_query_report": True,
+					"name": "Campaign Efficiency",
+					"doctype": "Lead"
+				},
+				{
+					"type": "report",
+					"is_query_report": True,
+					"name": "Lead Owner Efficiency",
+					"doctype": "Lead"
+				}
 			]
 		},
 		{
diff --git a/erpnext/config/schools.py b/erpnext/config/schools.py
index 7e97602..c54f808 100644
--- a/erpnext/config/schools.py
+++ b/erpnext/config/schools.py
@@ -20,10 +20,6 @@
 				},
 				{
 					"type": "doctype",
-					"name": "Student Batch"
-				},
-				{
-					"type": "doctype",
 					"name": "Student Group"
 				},
 				{
@@ -58,10 +54,6 @@
 				{
 					"type": "doctype",
 					"name": "Program Enrollment Tool"
-				},
-				{
-					"type": "doctype",
-					"name": "Student Batch Creation Tool"
 				}
 			]
 		},
@@ -106,7 +98,7 @@
 				{
 					"type": "doctype",
 					"name": "Course Schedule",
-					"route": "Calendar/Course Schedule"
+					"route": "List/Course Schedule/Calendar"
 				},
 				{
 					"type": "doctype",
@@ -205,6 +197,10 @@
 				{
 					"type": "doctype",
 					"name": "Academic Year"
+				},
+				{
+					"type": "doctype",
+					"name": "School Settings"
 				}
 			]
 		},
diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py
index 61b82e5..3a3e873 100644
--- a/erpnext/controllers/accounts_controller.py
+++ b/erpnext/controllers/accounts_controller.py
@@ -2,10 +2,10 @@
 # License: GNU General Public License v3. See license.txt
 
 from __future__ import unicode_literals
-import frappe
+import frappe, erpnext
 from frappe import _, throw
 from frappe.utils import today, flt, cint, fmt_money, formatdate, getdate
-from erpnext.setup.utils import get_company_currency, get_exchange_rate
+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
 from erpnext.controllers.recurring_document import convert_to_recurring, validate_recurring_document
@@ -22,7 +22,7 @@
 	@property
 	def company_currency(self):
 		if not hasattr(self, "__company_currency"):
-			self.__company_currency = get_company_currency(self.company)
+			self.__company_currency = erpnext.get_company_currency(self.company)
 
 		return self.__company_currency
 
@@ -186,15 +186,19 @@
 
 					ret = get_item_details(args)
 
-
 					for fieldname, value in ret.items():
 						if item.meta.get_field(fieldname) and value is not None:
 							if (item.get(fieldname) is None or fieldname in force_item_fields):
 								item.set(fieldname, value)
 
-							elif fieldname == "cost_center" and not item.get("cost_center"):
+							elif fieldname in ['cost_center', 'conversion_factor'] and not item.get(fieldname):
 								item.set(fieldname, value)
 
+							elif fieldname == "serial_no":
+								stock_qty = item.get("stock_qty") * -1 if item.get("stock_qty") < 0 else item.get("stock_qty")
+								if stock_qty != len(item.get('serial_no').split('\n')):
+									item.set(fieldname, value)
+
 							elif fieldname == "conversion_factor" and not item.get("conversion_factor"):
 								item.set(fieldname, value)
 
diff --git a/erpnext/controllers/buying_controller.py b/erpnext/controllers/buying_controller.py
index a1c7185..5bc8bb3 100644
--- a/erpnext/controllers/buying_controller.py
+++ b/erpnext/controllers/buying_controller.py
@@ -6,9 +6,10 @@
 from frappe import _, msgprint
 from frappe.utils import flt,cint, cstr
 
-from erpnext.setup.utils import get_company_currency
 from erpnext.accounts.party import get_party_details
 from erpnext.stock.get_item_details import get_conversion_factor
+from erpnext.buying.utils import validate_for_items
+from erpnext.stock.stock_ledger import get_valuation_rate
 
 from erpnext.controllers.stock_controller import StockController
 
@@ -40,9 +41,7 @@
 			# self.validate_purchase_return()
 			self.validate_rejected_warehouse()
 			self.validate_accepted_rejected_qty()
-
-			pc_obj = frappe.get_doc('Purchase Common')
-			pc_obj.validate_for_items(self)
+			validate_for_items(self)
 
 			#sub-contracting
 			self.validate_for_subcontracting()
@@ -88,9 +87,8 @@
 
 	def set_total_in_words(self):
 		from frappe.utils import money_in_words
-		company_currency = get_company_currency(self.company)
 		if self.meta.get_field("base_in_words"):
-			self.base_in_words = money_in_words(self.base_grand_total, company_currency)
+			self.base_in_words = money_in_words(self.base_grand_total, self.company_currency)
 		if self.meta.get_field("in_words"):
 			self.in_words = money_in_words(self.grand_total, self.currency)
 
@@ -225,9 +223,8 @@
 					"serial_no": rm.serial_no
 				})
 				if not rm.rate:
-					from erpnext.stock.stock_ledger import get_valuation_rate
-					rm.rate = get_valuation_rate(bom_item.item_code, self.supplier_warehouse, 
-						self.doctype, self.name)
+					rm.rate = get_valuation_rate(bom_item.item_code, self.supplier_warehouse,
+						self.doctype, self.name, currency=self.company_currency)
 			else:
 				rm.rate = bom_item.rate
 
diff --git a/erpnext/controllers/item_variant.py b/erpnext/controllers/item_variant.py
index c21ee00..53421b7 100644
--- a/erpnext/controllers/item_variant.py
+++ b/erpnext/controllers/item_variant.py
@@ -42,10 +42,8 @@
 
 	copy_attributes_to_variant(template, variant)
 
-	variant.append("manufacturers", {
-		"manufacturer": manufacturer,
-		"manufacturer_part_no": manufacturer_part_no
-	})
+	variant.manufacturer = manufacturer
+	variant.manufacturer_part_no = manufacturer_part_no
 
 	variant.item_code = append_number_if_name_exists('Item', template.name)
 
diff --git a/erpnext/controllers/queries.py b/erpnext/controllers/queries.py
index 88600e8..0fc08c1 100644
--- a/erpnext/controllers/queries.py
+++ b/erpnext/controllers/queries.py
@@ -222,19 +222,21 @@
 				"_txt": txt.replace('%', '')
 			})
 
-def get_delivery_notes_to_be_billed(doctype, txt, searchfield, start, page_len, filters):
-	return frappe.db.sql("""select `tabDelivery Note`.name, `tabDelivery Note`.customer_name
+def get_delivery_notes_to_be_billed(doctype, txt, searchfield, start, page_len, filters, as_dict):
+	return frappe.db.sql("""
+		select `tabDelivery Note`.name, `tabDelivery Note`.customer, `tabDelivery Note`.posting_date
 		from `tabDelivery Note`
 		where `tabDelivery Note`.`%(key)s` like %(txt)s and
-			`tabDelivery Note`.docstatus = 1 and status not in ("Stopped", "Closed") %(fcond)s
+			`tabDelivery Note`.docstatus = 1 and `tabDelivery Note`.is_return = 0 
+			and status not in ("Stopped", "Closed") %(fcond)s
 			and (`tabDelivery Note`.per_billed < 100 or `tabDelivery Note`.grand_total = 0)
 			%(mcond)s order by `tabDelivery Note`.`%(key)s` asc
-			limit %(start)s, %(page_len)s""" % {
-				"key": searchfield,
-				"fcond": get_filters_cond(doctype, filters, []),
-				"mcond": get_match_cond(doctype),
-				"start": "%(start)s", "page_len": "%(page_len)s", "txt": "%(txt)s"
-			}, { "start": start, "page_len": page_len, "txt": ("%%%s%%" % txt) })
+	""" % {
+		"key": searchfield,
+		"fcond": get_filters_cond(doctype, filters, []),
+		"mcond": get_match_cond(doctype),
+		"txt": "%(txt)s"
+	}, { "txt": ("%%%s%%" % txt) }, as_dict=as_dict)
 
 def get_batch_no(doctype, txt, searchfield, start, page_len, filters):
 	cond = ""
@@ -360,7 +362,8 @@
 	sub_query = """ select round(`tabBin`.actual_qty, 2) from `tabBin`
 		where `tabBin`.warehouse = `tabWarehouse`.name
 		{bin_conditions} """.format(
-		bin_conditions=get_filters_cond(doctype, filter_dict.get("Bin"), bin_conditions))
+		bin_conditions=get_filters_cond(doctype, filter_dict.get("Bin"), 
+			bin_conditions, ignore_permissions=True))
 
 	response = frappe.db.sql("""select `tabWarehouse`.name,
 		CONCAT_WS(" : ", "Actual Qty", ifnull( ({sub_query}), 0) ) as actual_qty
diff --git a/erpnext/controllers/sales_and_purchase_return.py b/erpnext/controllers/sales_and_purchase_return.py
index 4ea2a5f..d2f894a 100644
--- a/erpnext/controllers/sales_and_purchase_return.py
+++ b/erpnext/controllers/sales_and_purchase_return.py
@@ -53,8 +53,8 @@
 
 	valid_items = frappe._dict()
 
-	select_fields = "item_code, qty, parenttype" if doc.doctype=="Purchase Invoice" \
-		else "item_code, qty, serial_no, batch_no, parenttype"
+	select_fields = "item_code, qty, rate, parenttype" if doc.doctype=="Purchase Invoice" \
+		else "item_code, qty, rate, serial_no, batch_no, parenttype"
 
 	if doc.doctype in ['Purchase Invoice', 'Purchase Receipt']:
 		select_fields += ",rejected_qty, received_qty"
@@ -82,10 +82,15 @@
 			else:
 				ref = valid_items.get(d.item_code, frappe._dict())
 				validate_quantity(doc, d, ref, valid_items, already_returned_items)
-
-				if ref.batch_no and d.batch_no not in ref.batch_no:
+				
+				if ref.rate and doc.doctype in ("Delivery Note", "Sales Invoice") and flt(d.rate) > ref.rate:
+					frappe.throw(_("Row # {0}: Rate cannot be greater than the rate used in {1} {2}")
+						.format(d.idx, doc.doctype, doc.return_against))
+							
+				elif ref.batch_no and d.batch_no not in ref.batch_no:
 					frappe.throw(_("Row # {0}: Batch No must be same as {1} {2}")
 						.format(d.idx, doc.doctype, doc.return_against))
+						
 				elif ref.serial_no:
 					if not d.serial_no:
 						frappe.throw(_("Row # {0}: Serial No is mandatory").format(d.idx))
@@ -106,30 +111,32 @@
 
 def validate_quantity(doc, args, ref, valid_items, already_returned_items):
 	fields = ['qty']
-	if doc.doctype in ['Purchase Invoice', 'Purchase Receipt']:
+	if doc.doctype in ['Purchase Receipt', 'Purchase Invoice']:
 		fields.extend(['received_qty', 'rejected_qty'])
 
 	already_returned_data = already_returned_items.get(args.item_code) or {}
 
 	for column in fields:
-		return_qty = flt(already_returned_data.get(column, 0)) if len(already_returned_data) > 0 else 0
-		referenced_qty = ref.get(column)
-		max_return_qty = flt(referenced_qty) - return_qty
+		returned_qty = flt(already_returned_data.get(column, 0)) if len(already_returned_data) > 0 else 0
+		reference_qty = ref.get(column)
+		max_returnable_qty = flt(reference_qty) - returned_qty
 		label = column.replace('_', ' ').title()
-
-		if flt(args.get(column)) > 0:
-			frappe.throw(_("{0} must be negative in return document").format(label))
-		elif return_qty >= referenced_qty and flt(args.get(column)) != 0:
-			frappe.throw(_("Item {0} has already been returned").format(args.item_code), StockOverReturnError)
-		elif abs(args.get(column)) > max_return_qty:
-			frappe.throw(_("Row # {0}: Cannot return more than {1} for Item {2}")
-				.format(args.idx, referenced_qty, args.item_code), StockOverReturnError)
+		if reference_qty:	
+			if flt(args.get(column)) > 0:
+				frappe.throw(_("{0} must be negative in return document").format(label))
+			elif returned_qty >= reference_qty and args.get(column):
+				frappe.throw(_("Item {0} has already been returned")
+					.format(args.item_code), StockOverReturnError)
+			elif abs(args.get(column)) > max_returnable_qty:
+				frappe.throw(_("Row # {0}: Cannot return more than {1} for Item {2}")
+					.format(args.idx, reference_qty, args.item_code), StockOverReturnError)
 
 def get_ref_item_dict(valid_items, ref_item_row):
 	from erpnext.stock.doctype.serial_no.serial_no import get_serial_nos
 	
 	valid_items.setdefault(ref_item_row.item_code, frappe._dict({
 		"qty": 0,
+		"rate": 0,
 		"rejected_qty": 0,
 		"received_qty": 0,
 		"serial_no": [],
@@ -137,6 +144,7 @@
 	}))
 	item_dict = valid_items[ref_item_row.item_code]
 	item_dict["qty"] += ref_item_row.qty
+	item_dict["rate"] = ref_item_row.get("rate", 0)
 
 	if ref_item_row.parenttype in ['Purchase Invoice', 'Purchase Receipt']:
 		item_dict["received_qty"] += ref_item_row.received_qty
diff --git a/erpnext/controllers/selling_controller.py b/erpnext/controllers/selling_controller.py
index 5f50ae3..10b3607 100644
--- a/erpnext/controllers/selling_controller.py
+++ b/erpnext/controllers/selling_controller.py
@@ -4,11 +4,9 @@
 from __future__ import unicode_literals
 import frappe
 from frappe.utils import cint, flt, cstr, comma_or
-from erpnext.setup.utils import get_company_currency
 from frappe import _, throw
 from erpnext.stock.get_item_details import get_bin_details
 from erpnext.stock.utils import get_incoming_rate
-from erpnext.stock.stock_ledger import get_valuation_rate
 from erpnext.stock.get_item_details import get_conversion_factor
 
 from erpnext.controllers.stock_controller import StockController
@@ -43,7 +41,7 @@
 
 		# set contact and address details for customer, if they are not mentioned
 		self.set_missing_lead_customer_details()
-		self.set_price_list_and_item_details()
+		self.set_price_list_and_item_details(for_validate=for_validate)
 
 	def set_missing_lead_customer_details(self):
 		if getattr(self, "customer", None):
@@ -62,9 +60,9 @@
 				posting_date=self.get('transaction_date') or self.get('posting_date'),
 				company=self.company))
 
-	def set_price_list_and_item_details(self):
+	def set_price_list_and_item_details(self, for_validate=False):
 		self.set_price_list_currency("Selling")
-		self.set_missing_item_details()
+		self.set_missing_item_details(for_validate=for_validate)
 
 	def apply_shipping_rule(self):
 		if self.shipping_rule:
@@ -113,13 +111,11 @@
 
 	def set_total_in_words(self):
 		from frappe.utils import money_in_words
-		company_currency = get_company_currency(self.company)
-
 		disable_rounded_total = cint(frappe.db.get_value("Global Defaults", None, "disable_rounded_total"))
 
 		if self.meta.get_field("base_in_words"):
 			self.base_in_words = money_in_words(disable_rounded_total and
-				abs(self.base_grand_total) or abs(self.base_rounded_total), company_currency)
+				abs(self.base_grand_total) or abs(self.base_rounded_total), self.company_currency)
 		if self.meta.get_field("in_words"):
 			self.in_words = money_in_words(disable_rounded_total and
 				abs(self.grand_total) or abs(self.rounded_total), self.currency)
@@ -170,11 +166,11 @@
 			if d.meta.get_field("stock_qty"):
 				if not d.conversion_factor:
 					frappe.throw(_("Row {0}: Conversion Factor is mandatory").format(d.idx))
-				d.stock_qty = flt(d.qty) * flt(d.conversion_factor)			
+				d.stock_qty = flt(d.qty) * flt(d.conversion_factor)
 
 	def validate_selling_price(self):
 		def throw_message(item_name, rate, ref_rate_field):
-			frappe.throw(_("""Selling price for item {0} is lower than its {1}. Selling price should be atleast {2}""")
+			frappe.throw(_("""Selling rate for item {0} is lower than its {1}. Selling rate should be atleast {2}""")
 				.format(item_name, ref_rate_field, rate))
 
 		if not frappe.db.get_single_value("Selling Settings", "validate_selling_price"):
@@ -182,18 +178,19 @@
 
 		for it in self.get("items"):
 			last_purchase_rate, is_stock_item = frappe.db.get_value("Item", it.item_code, ["last_purchase_rate", "is_stock_item"])
-
-			if flt(it.base_rate) < flt(last_purchase_rate):
-				throw_message(it.item_name, last_purchase_rate, "last purchase rate")
+			last_purchase_rate_in_sales_uom = last_purchase_rate / (it.conversion_factor or 1)
+			if flt(it.base_rate) < flt(last_purchase_rate_in_sales_uom):
+				throw_message(it.item_name, last_purchase_rate_in_sales_uom, "last purchase rate")
 
 			last_valuation_rate = frappe.db.sql("""
 				SELECT valuation_rate FROM `tabStock Ledger Entry` WHERE item_code = %s
 				AND warehouse = %s AND valuation_rate > 0
 				ORDER BY posting_date DESC, posting_time DESC, name DESC LIMIT 1
 				""", (it.item_code, it.warehouse))
-
-			if is_stock_item and flt(it.base_rate) < flt(last_valuation_rate):
-				throw_message(it.name, last_valuation_rate, "valuation rate")
+			if last_valuation_rate:
+				last_valuation_rate_in_sales_uom = last_valuation_rate[0][0] / (it.conversion_factor or 1)
+				if is_stock_item and flt(it.base_rate) < flt(last_valuation_rate_in_sales_uom):
+					throw_message(it.name, last_valuation_rate_in_sales_uom, "valuation rate")
 
 
 	def get_item_list(self):
@@ -207,7 +204,7 @@
 					if p.parent_detail_docname == d.name and p.parent_item == d.item_code:
 						# the packing details table's qty is already multiplied with parent's qty
 						il.append(frappe._dict({
-							'warehouse': p.warehouse,
+							'warehouse': p.warehouse or d.warehouse,
 							'item_code': p.item_code,
 							'qty': flt(p.qty),
 							'uom': p.uom,
diff --git a/erpnext/controllers/status_updater.py b/erpnext/controllers/status_updater.py
index 55bcaf3..cede8f4 100644
--- a/erpnext/controllers/status_updater.py
+++ b/erpnext/controllers/status_updater.py
@@ -19,7 +19,7 @@
 		["Converted", "has_customer"],
 	],
 	"Opportunity": [
-		["Quotation", "has_quotation"],
+		["Quotation", "has_active_quotation"],
 		["Converted", "has_ordered_quotation"],
 		["Lost", "eval:self.status=='Lost'"],
 		["Lost", "has_lost_quotation"],
@@ -46,8 +46,8 @@
 		["Draft", None],
 		["Submitted", "eval:self.docstatus==1"],
 		["Return", "eval:self.is_return==1 and self.docstatus==1"],
-		["Credit Note Issued", "eval:self.outstanding_amount < 0 and self.docstatus==1"],
-		["Paid", "eval:self.outstanding_amount==0 and self.docstatus==1 and self.is_return==0"],
+		["Paid", "eval:self.outstanding_amount<=0 and self.docstatus==1 and self.is_return==0"],
+		["Credit Note Issued", "eval:self.outstanding_amount < 0 and self.docstatus==1 and self.is_return==0 and get_value('Sales Invoice', {'is_return': 1, 'return_against': self.name, 'docstatus': 1})"],
 		["Unpaid", "eval:self.outstanding_amount > 0 and getdate(self.due_date) >= getdate(nowdate()) and self.docstatus==1"],
 		["Overdue", "eval:self.outstanding_amount > 0 and getdate(self.due_date) < getdate(nowdate()) and self.docstatus==1"],
 		["Cancelled", "eval:self.docstatus==2"],
@@ -56,8 +56,8 @@
 		["Draft", None],
 		["Submitted", "eval:self.docstatus==1"],
 		["Return", "eval:self.is_return==1 and self.docstatus==1"],
-		["Debit Note Issued", "eval:self.outstanding_amount < 0 and self.docstatus==1"],
-		["Paid", "eval:self.outstanding_amount==0 and self.docstatus==1 and self.is_return==0"],
+		["Paid", "eval:self.outstanding_amount<=0 and self.docstatus==1 and self.is_return==0"],
+		["Debit Note Issued", "eval:self.outstanding_amount < 0 and self.docstatus==1 and self.is_return==0 and get_value('Purchase Invoice', {'is_return': 1, 'return_against': self.name, 'docstatus': 1})"],
 		["Unpaid", "eval:self.outstanding_amount > 0 and getdate(self.due_date) >= getdate(nowdate()) and self.docstatus==1"],
 		["Overdue", "eval:self.outstanding_amount > 0 and getdate(self.due_date) < getdate(nowdate()) and self.docstatus==1"],
 		["Cancelled", "eval:self.docstatus==2"],
@@ -119,7 +119,8 @@
 					self.status = s[0]
 					break
 				elif s[1].startswith("eval:"):
-					if eval(s[1][5:]):
+					if frappe.safe_eval(s[1][5:], None, { "self": self.as_dict(), "getdate": getdate, 
+							"nowdate": nowdate, "get_value": frappe.db.get_value }):
 						self.status = s[0]
 						break
 				elif getattr(self, s[1])():
diff --git a/erpnext/controllers/stock_controller.py b/erpnext/controllers/stock_controller.py
index add882c..3649cc1 100644
--- a/erpnext/controllers/stock_controller.py
+++ b/erpnext/controllers/stock_controller.py
@@ -54,14 +54,14 @@
 
 						self.check_expense_account(item_row)
 
-						# If item is not a sample item 
+						# If the item does not have the allow zero valuation rate flag set
 						# and ( valuation rate not mentioned in an incoming entry
-						# or incoming entry not found while delivering the item), 
+						# or incoming entry not found while delivering the item),
 						# try to pick valuation rate from previous sle or Item master and update in SLE
 						# Otherwise, throw an exception
 
 						if not sle.stock_value_difference and self.doctype != "Stock Reconciliation" \
-							and not item_row.get("is_sample_item"):
+							and not item_row.get("allow_zero_valuation_rate"):
 
 							sle = self.update_stock_ledger_entries(sle)
 
@@ -96,25 +96,25 @@
 		return process_gl_map(gl_list)
 
 	def update_stock_ledger_entries(self, sle):
-		sle.valuation_rate = get_valuation_rate(sle.item_code, sle.warehouse, 
-			self.doctype, self.name)
+		sle.valuation_rate = get_valuation_rate(sle.item_code, sle.warehouse,
+			self.doctype, self.name, currency=self.company_currency)
 
 		sle.stock_value = flt(sle.qty_after_transaction) * flt(sle.valuation_rate)
 		sle.stock_value_difference = flt(sle.actual_qty) * flt(sle.valuation_rate)
-		
+
 		if sle.name:
 			frappe.db.sql("""
-				update 
-					`tabStock Ledger Entry` 
-				set 
+				update
+					`tabStock Ledger Entry`
+				set
 					stock_value = %(stock_value)s,
-					valuation_rate = %(valuation_rate)s, 
-					stock_value_difference = %(stock_value_difference)s 
-				where 
+					valuation_rate = %(valuation_rate)s,
+					stock_value_difference = %(stock_value_difference)s
+				where
 					name = %(name)s""", (sle))
-					
+
 		return sle
-					
+
 	def get_voucher_details(self, default_expense_account, default_cost_center, sle_map):
 		if self.doctype == "Stock Reconciliation":
 			return [frappe._dict({ "name": voucher_detail_no, "expense_account": default_expense_account,
@@ -163,9 +163,9 @@
 	def get_stock_ledger_details(self):
 		stock_ledger = {}
 		stock_ledger_entries = frappe.db.sql("""
-			select 
+			select
 				name, warehouse, stock_value_difference, valuation_rate,
-				voucher_detail_no, item_code, posting_date, posting_time, 
+				voucher_detail_no, item_code, posting_date, posting_time,
 				actual_qty, qty_after_transaction
 			from
 				`tabStock Ledger Entry`
@@ -177,6 +177,19 @@
 				stock_ledger.setdefault(sle.voucher_detail_no, []).append(sle)
 		return stock_ledger
 
+	def make_batches(self, warehouse_field):
+		'''Create batches if required. Called before submit'''
+		for d in self.items:
+			if d.get(warehouse_field) and not d.batch_no:
+				has_batch_no, create_new_batch = frappe.db.get_value('Item', d.item_code, ['has_batch_no', 'create_new_batch'])
+				if has_batch_no and create_new_batch:
+					d.batch_no = frappe.get_doc(dict(
+						doctype='Batch',
+						item=d.item_code,
+						supplier=getattr(self, 'supplier', None),
+						reference_doctype=self.doctype,
+						reference_name=self.name)).insert().name
+
 	def make_adjustment_entry(self, expected_gle, voucher_obj):
 		from erpnext.accounts.utils import get_stock_and_account_difference
 		account_list = [d.account for d in expected_gle]
diff --git a/erpnext/controllers/taxes_and_totals.py b/erpnext/controllers/taxes_and_totals.py
index 0e02df8..c1c1fd7 100644
--- a/erpnext/controllers/taxes_and_totals.py
+++ b/erpnext/controllers/taxes_and_totals.py
@@ -3,10 +3,9 @@
 
 from __future__ import unicode_literals
 import json
-import frappe
+import frappe, erpnext
 from frappe import _, scrub
 from frappe.utils import cint, flt, round_based_on_smallest_currency_fraction
-from erpnext.setup.utils import get_company_currency
 from erpnext.controllers.accounts_controller import validate_conversion_rate, \
 	validate_taxes_and_charges, validate_inclusive_tax
 
@@ -38,7 +37,7 @@
 
 	def validate_conversion_rate(self):
 		# validate conversion rate
-		company_currency = get_company_currency(self.doc.company)
+		company_currency = erpnext.get_company_currency(self.doc.company)
 		if not self.doc.currency or self.doc.currency == company_currency:
 			self.doc.currency = company_currency
 			self.doc.conversion_rate = 1.0
@@ -60,9 +59,10 @@
 						(1.0 - (item.discount_percentage / 100.0)), item.precision("rate"))
 
 				if item.doctype in ['Quotation Item', 'Sales Order Item', 'Delivery Note Item', 'Sales Invoice Item']:
-					item.total_margin = self.calculate_margin(item)
-					item.rate = flt(item.total_margin * (1.0 - (item.discount_percentage / 100.0)), item.precision("rate"))\
-						if item.total_margin > 0 else item.rate
+					item.rate_with_margin = self.calculate_margin(item)
+
+					item.rate = flt(item.rate_with_margin * (1.0 - (item.discount_percentage / 100.0)), item.precision("rate"))\
+						if item.rate_with_margin > 0 else item.rate
 
 				item.net_rate = item.rate
 				item.amount = flt(item.rate * item.qty,	item.precision("amount"))
@@ -327,7 +327,7 @@
 			self.doc.rounded_total = round_based_on_smallest_currency_fraction(self.doc.grand_total,
 				self.doc.currency, self.doc.precision("rounded_total"))
 		if self.doc.meta.get_field("base_rounded_total"):
-			company_currency = get_company_currency(self.doc.company)
+			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,
@@ -405,11 +405,14 @@
 			self.doc.total_advance = flt(total_allocated_amount, self.doc.precision("total_advance"))
 
 			if self.doc.party_account_currency == self.doc.currency:
-				invoice_total = self.doc.grand_total
-			else:
-				invoice_total = flt(self.doc.grand_total * self.doc.conversion_rate,
+				invoice_total = flt(self.doc.grand_total - flt(self.doc.write_off_amount), 
 					self.doc.precision("grand_total"))
-
+			else:
+				base_write_off_amount = flt(flt(self.doc.write_off_amount) * self.doc.conversion_rate, 
+					self.doc.precision("base_write_off_amount"))
+				invoice_total = flt(self.doc.grand_total * self.doc.conversion_rate, 
+					self.doc.precision("grand_total")) - base_write_off_amount
+				
 			if invoice_total > 0 and self.doc.total_advance > invoice_total:
 				frappe.throw(_("Advance amount cannot be greater than {0} {1}")
 					.format(self.doc.party_account_currency, invoice_total))
@@ -462,6 +465,8 @@
 				payment.base_amount = flt(payment.amount * self.doc.conversion_rate)
 				paid_amount += payment.amount
 				base_paid_amount += payment.base_amount
+		elif not self.doc.is_return:
+			self.doc.set('payments', [])
 
 		self.doc.paid_amount = flt(paid_amount, self.doc.precision("paid_amount"))
 		self.doc.base_paid_amount = flt(base_paid_amount, self.doc.precision("base_paid_amount"))
@@ -484,7 +489,7 @@
 				self.doc.precision("base_write_off_amount"))
 
 	def calculate_margin(self, item):
-		total_margin = 0.0
+		rate_with_margin = 0.0
 		if item.price_list_rate:
 			if item.pricing_rule and not self.doc.ignore_pricing_rule:
 				pricing_rule = frappe.get_doc('Pricing Rule', item.pricing_rule)
@@ -493,6 +498,6 @@
 
 			if item.margin_type and item.margin_rate_or_amount:
 				margin_value = item.margin_rate_or_amount if item.margin_type == 'Amount' else flt(item.price_list_rate) * flt(item.margin_rate_or_amount) / 100
-				total_margin = flt(item.price_list_rate) + flt(margin_value)
+				rate_with_margin = flt(item.price_list_rate) + flt(margin_value)
 
-		return total_margin
+		return rate_with_margin
diff --git a/erpnext/controllers/tests/test_mapper.py b/erpnext/controllers/tests/test_mapper.py
new file mode 100644
index 0000000..0e2d6d0
--- /dev/null
+++ b/erpnext/controllers/tests/test_mapper.py
@@ -0,0 +1,73 @@
+from __future__ import unicode_literals
+import unittest
+import frappe
+
+import random, json
+import frappe.utils
+from frappe.utils import nowdate
+from frappe.model import mapper
+from frappe.test_runner import make_test_records
+
+class TestMapper(unittest.TestCase):
+	def test_map_docs(self):
+		'''Test mapping of multiple source docs on a single target doc'''
+
+		make_test_records("Item")
+		items = frappe.get_all("Item", fields = ["name", "item_code"], filters = {'is_sales_item': 1, 'has_variants': 0})
+		customers = frappe.get_all("Customer")
+		if items and customers:
+			# Make source docs (quotations) and a target doc (sales order)
+			customer = random.choice(customers).name
+			qtn1, item_list_1 = self.make_quotation(items, customer)
+			qtn2, item_list_2 = self.make_quotation(items, customer)
+			so, item_list_3 = self.make_sales_order()
+
+		# Map source docs to target with corresponding mapper method
+		method = "erpnext.selling.doctype.quotation.quotation.make_sales_order"
+		updated_so = mapper.map_docs(method, json.dumps([qtn1.name, qtn2.name]), so)
+
+		# Assert that all inserted items are present in updated sales order
+		src_items = item_list_1 + item_list_2 + item_list_3
+		self.assertEqual(set([d.item_code for d in src_items]),
+			set([d.item_code for d in updated_so.items]))
+
+	def get_random_items(self, items, limit):
+		'''Get a number of random items from a list of given items'''
+		random_items = []
+		for i in range(0, limit):
+			random_items.append(random.choice(items))
+		return random_items
+
+	def make_quotation(self, items, customer):
+		item_list = self.get_random_items(items, 3)
+		qtn = frappe.get_doc({
+			"doctype": "Quotation",
+			"quotation_to": "Customer",
+			"customer": customer,
+			"order_type": "Sales"
+		})
+		for item in item_list:
+			qtn.append("items", {"qty": "2", "item_code": item.item_code})
+
+		qtn.submit()
+		return qtn, item_list
+
+	def make_sales_order(self):
+		item = frappe.get_doc({
+			"base_amount": 1000.0,
+			"base_rate": 100.0,
+			"description": "CPU",
+			"doctype": "Sales Order Item",
+			"item_code": "_Test Item Home Desktop 100",
+			"item_name": "CPU",
+			"parentfield": "items",
+			"qty": 10.0,
+			"rate": 100.0,
+			"warehouse": "_Test Warehouse - _TC",
+			"stock_uom": "_Test UOM",
+			"conversion_factor": 1.0,
+			"uom": "_Test UOM"
+		})
+		so = frappe.get_doc(frappe.get_test_records('Sales Order')[0])
+		so.insert(ignore_permissions=True)
+		return so, [item]
diff --git a/erpnext/controllers/website_list_for_contact.py b/erpnext/controllers/website_list_for_contact.py
index 6ca20c3..b078036 100644
--- a/erpnext/controllers/website_list_for_contact.py
+++ b/erpnext/controllers/website_list_for_contact.py
@@ -18,7 +18,7 @@
 		"get_list": get_transaction_list
 	}
 
-def get_transaction_list(doctype, txt=None, filters=None, limit_start=0, limit_page_length=20):
+def get_transaction_list(doctype, txt=None, filters=None, limit_start=0, limit_page_length=20, order_by="modified"):
 	from frappe.www.list import get_list
 	user = frappe.session.user
 	key = None
diff --git a/erpnext/crm/doctype/opportunity/opportunity.json b/erpnext/crm/doctype/opportunity/opportunity.json
index 90be781..3f7a814 100644
--- a/erpnext/crm/doctype/opportunity/opportunity.json
+++ b/erpnext/crm/doctype/opportunity/opportunity.json
@@ -574,7 +574,7 @@
    "ignore_xss_filter": 0, 
    "in_filter": 0, 
    "in_global_search": 0, 
-   "in_list_view": 1, 
+   "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Territory", 
    "length": 0, 
@@ -1152,7 +1152,7 @@
  "issingle": 0, 
  "istable": 0, 
  "max_attachments": 0, 
- "modified": "2017-03-12 21:55:21.598112", 
+ "modified": "2017-04-04 01:21:02.165730", 
  "modified_by": "Administrator", 
  "module": "CRM", 
  "name": "Opportunity", 
diff --git a/erpnext/crm/doctype/opportunity/opportunity.py b/erpnext/crm/doctype/opportunity/opportunity.py
index 913d2e4..8a21e7c 100644
--- a/erpnext/crm/doctype/opportunity/opportunity.py
+++ b/erpnext/crm/doctype/opportunity/opportunity.py
@@ -84,20 +84,31 @@
 	def on_trash(self):
 		self.delete_events()
 
-	def has_quotation(self):
-		return frappe.db.get_value("Quotation Item", {"prevdoc_docname": self.name, "docstatus": 1})
+	def has_active_quotation(self):
+		return frappe.db.sql("""
+			select q.name 
+			from `tabQuotation` q, `tabQuotation Item` qi
+			where q.name = qi.parent and q.docstatus=1 and qi.prevdoc_docname =%s 
+			and q.status not in ('Lost', 'Closed')""", self.name)
 
 	def has_ordered_quotation(self):
-		return frappe.db.sql("""select q.name from `tabQuotation` q, `tabQuotation Item` qi
-			where q.name = qi.parent and q.docstatus=1 and qi.prevdoc_docname =%s and q.status = 'Ordered'""", self.name)
+		return frappe.db.sql("""
+			select q.name 
+			from `tabQuotation` q, `tabQuotation Item` qi
+			where q.name = qi.parent and q.docstatus=1 and qi.prevdoc_docname =%s 
+			and q.status = 'Ordered'""", self.name)
 
 	def has_lost_quotation(self):
-		return frappe.db.sql("""
+		lost_quotation = frappe.db.sql("""
 			select q.name
 			from `tabQuotation` q, `tabQuotation Item` qi
 			where q.name = qi.parent and q.docstatus=1
 				and qi.prevdoc_docname =%s and q.status = 'Lost'
 			""", self.name)
+		if lost_quotation:
+			if self.has_active_quotation():
+				return False
+			return True
 
 	def validate_cust_name(self):
 		if self.customer:
@@ -194,11 +205,12 @@
 				quotation.transaction_date)
 
 		quotation.conversion_rate = exchange_rate
-		
+
 		# get default taxes
 		taxes = get_default_taxes_and_charges("Sales Taxes and Charges Template")
-		quotation.extend("taxes", taxes)
-		
+		if taxes:
+			quotation.extend("taxes", taxes)
+
 		quotation.run_method("set_missing_values")
 		quotation.run_method("calculate_taxes_and_totals")
 
diff --git a/erpnext/schools/doctype/assessment_code/__init__.py b/erpnext/crm/report/campaign_efficiency/__init__.py
similarity index 100%
copy from erpnext/schools/doctype/assessment_code/__init__.py
copy to erpnext/crm/report/campaign_efficiency/__init__.py
diff --git a/erpnext/crm/report/campaign_efficiency/campaign_efficiency.js b/erpnext/crm/report/campaign_efficiency/campaign_efficiency.js
new file mode 100644
index 0000000..2b25f1d
--- /dev/null
+++ b/erpnext/crm/report/campaign_efficiency/campaign_efficiency.js
@@ -0,0 +1,19 @@
+// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
+// For license information, please see license.txt
+frappe.query_reports["Campaign Efficiency"] = {
+		"filters": [
+			{
+				"fieldname": "from_date",
+				"label": __("From Date"),
+				"fieldtype": "Date",
+				"default": frappe.defaults.get_user_default("year_start_date"),
+			},
+			{
+				"fieldname": "to_date",
+				"label": __("To Date"),
+				"fieldtype": "Date",
+				"default": frappe.defaults.get_user_default("year_end_date"),
+			}
+		]
+	};
+
diff --git a/erpnext/crm/report/campaign_efficiency/campaign_efficiency.json b/erpnext/crm/report/campaign_efficiency/campaign_efficiency.json
new file mode 100644
index 0000000..986d9f3
--- /dev/null
+++ b/erpnext/crm/report/campaign_efficiency/campaign_efficiency.json
@@ -0,0 +1,30 @@
+{
+ "add_total_row": 0, 
+ "apply_user_permissions": 1, 
+ "creation": "2017-04-17 00:20:27.248275", 
+ "disabled": 0, 
+ "docstatus": 0, 
+ "doctype": "Report", 
+ "idx": 0, 
+ "is_standard": "Yes", 
+ "letter_head": "", 
+ "modified": "2017-04-17 00:20:27.248275", 
+ "modified_by": "Administrator", 
+ "module": "CRM", 
+ "name": "Campaign Efficiency", 
+ "owner": "Administrator", 
+ "ref_doctype": "Lead", 
+ "report_name": "Campaign Efficiency", 
+ "report_type": "Script Report", 
+ "roles": [
+  {
+   "role": "Sales User"
+  }, 
+  {
+   "role": "Sales Manager"
+  }, 
+  {
+   "role": "System Manager"
+  }
+ ]
+}
\ No newline at end of file
diff --git a/erpnext/crm/report/campaign_efficiency/campaign_efficiency.py b/erpnext/crm/report/campaign_efficiency/campaign_efficiency.py
new file mode 100644
index 0000000..b20fe15
--- /dev/null
+++ b/erpnext/crm/report/campaign_efficiency/campaign_efficiency.py
@@ -0,0 +1,89 @@
+# Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors
+# For license information, please see license.txt
+
+from __future__ import unicode_literals
+import frappe
+from frappe import _
+
+def execute(filters=None):
+	columns, data = [], []
+	columns=get_columns()
+	data=get_lead_data(filters, "Campaign Name")
+	return columns, data
+	
+def get_columns():
+	return [
+		_("Campaign Name") + ":data:130", 
+		_("Lead Count") + ":Int:80",
+		_("Opp Count") + ":Int:80",
+		_("Quot Count") + ":Int:80", 
+		_("Order Count") + ":Int:100",
+		_("Order Value") + ":Float:100",
+		_("Opp/Lead %") + ":Float:100",
+		_("Quot/Lead %") + ":Float:100",
+		_("Order/Quot %") + ":Float:100"
+	]
+	
+def get_lead_data(filters, based_on):
+	based_on_field = frappe.scrub(based_on)
+	conditions = get_filter_conditions(filters)
+	
+	lead_details = frappe.db.sql("""
+		select {based_on_field}, name
+		from `tabLead` 
+		where {based_on_field} is not null and {based_on_field} != '' {conditions} 
+	""".format(based_on_field=based_on_field, conditions=conditions), filters, as_dict=1)
+	
+	lead_map = frappe._dict()
+	for d in lead_details:
+		lead_map.setdefault(d.get(based_on_field), []).append(d.name)
+	
+	data = []
+	for based_on_value, leads in lead_map.items():
+		row = {
+			based_on: based_on_value,
+			"Lead Count": len(leads)
+		}
+		row["Quot Count"]= get_lead_quotation_count(leads)
+		row["Opp Count"] = get_lead_opp_count(leads)
+		row["Order Count"] = get_quotation_ordered_count(leads)
+		row["Order Value"] = get_order_amount(leads)
+		
+		row["Opp/Lead %"] = row["Opp Count"] / row["Lead Count"] * 100
+		row["Quot/Lead %"] = row["Quot Count"] / row["Lead Count"] * 100
+		
+		row["Order/Quot %"] = row["Order Count"] / (row["Quot Count"] or 1) * 100
+			
+		data.append(row)
+		
+	return data
+	
+def get_filter_conditions(filters):
+	conditions=""
+	if filters.from_date:
+		conditions += " and date(creation) >= %(from_date)s"
+	if filters.to_date:
+		conditions += " and date(creation) <= %(to_date)s"
+	
+	return conditions
+	
+def get_lead_quotation_count(leads):
+	return frappe.db.sql("""select count(name) from `tabQuotation` 
+		where lead in (%s)""" % ', '.join(["%s"]*len(leads)), tuple(leads))[0][0]
+	
+def get_lead_opp_count(leads):
+	return frappe.db.sql("""select count(name) from `tabOpportunity` 
+	where lead in (%s)""" % ', '.join(["%s"]*len(leads)), tuple(leads))[0][0]
+	
+def get_quotation_ordered_count(leads):
+	return frappe.db.sql("""select count(name) 
+		from `tabQuotation` where status = 'Ordered'
+		and lead in (%s)""" % ', '.join(["%s"]*len(leads)), tuple(leads))[0][0]
+	
+def get_order_amount(leads):
+	return frappe.db.sql("""select sum(base_net_amount) 
+		from `tabSales Order Item`
+		where prevdoc_docname in (
+			select name from `tabQuotation` where status = 'Ordered' 
+			and lead in (%s)
+		)""" % ', '.join(["%s"]*len(leads)), tuple(leads))[0][0]
\ No newline at end of file
diff --git a/erpnext/schools/doctype/assessment_code/__init__.py b/erpnext/crm/report/lead_owner_efficiency/__init__.py
similarity index 100%
copy from erpnext/schools/doctype/assessment_code/__init__.py
copy to erpnext/crm/report/lead_owner_efficiency/__init__.py
diff --git a/erpnext/crm/report/lead_owner_efficiency/lead_owner_efficiency.js b/erpnext/crm/report/lead_owner_efficiency/lead_owner_efficiency.js
new file mode 100644
index 0000000..bbfd6ac
--- /dev/null
+++ b/erpnext/crm/report/lead_owner_efficiency/lead_owner_efficiency.js
@@ -0,0 +1,17 @@
+// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
+// For license information, please see license.txt
+	frappe.query_reports["Lead Owner Efficiency"] = {
+		"filters": [
+			{
+				"fieldname": "from_date",
+				"label": __("From Date"),
+				"fieldtype": "Date",
+				"default": frappe.defaults.get_user_default("year_start_date"),
+			},
+			{
+				"fieldname": "to_date",
+				"label": __("To Date"),
+				"fieldtype": "Date",
+				"default": frappe.defaults.get_user_default("year_end_date"),
+			}
+		]};
diff --git a/erpnext/crm/report/lead_owner_efficiency/lead_owner_efficiency.json b/erpnext/crm/report/lead_owner_efficiency/lead_owner_efficiency.json
new file mode 100644
index 0000000..b6dadef
--- /dev/null
+++ b/erpnext/crm/report/lead_owner_efficiency/lead_owner_efficiency.json
@@ -0,0 +1,30 @@
+{
+ "add_total_row": 0, 
+ "apply_user_permissions": 1, 
+ "creation": "2017-04-17 00:39:39.885905", 
+ "disabled": 0, 
+ "docstatus": 0, 
+ "doctype": "Report", 
+ "idx": 0, 
+ "is_standard": "Yes", 
+ "letter_head": "", 
+ "modified": "2017-04-17 00:45:10.139004", 
+ "modified_by": "Administrator", 
+ "module": "CRM", 
+ "name": "Lead Owner Efficiency", 
+ "owner": "Administrator", 
+ "ref_doctype": "Lead", 
+ "report_name": "Lead Owner Efficiency", 
+ "report_type": "Script Report", 
+ "roles": [
+  {
+   "role": "Sales User"
+  }, 
+  {
+   "role": "Sales Manager"
+  }, 
+  {
+   "role": "System Manager"
+  }
+ ]
+}
\ No newline at end of file
diff --git a/erpnext/crm/report/lead_owner_efficiency/lead_owner_efficiency.py b/erpnext/crm/report/lead_owner_efficiency/lead_owner_efficiency.py
new file mode 100644
index 0000000..8134bc2
--- /dev/null
+++ b/erpnext/crm/report/lead_owner_efficiency/lead_owner_efficiency.py
@@ -0,0 +1,26 @@
+# Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors
+# For license information, please see license.txt
+
+from __future__ import unicode_literals
+import frappe
+from frappe import _
+from erpnext.crm.report.campaign_efficiency.campaign_efficiency import get_lead_data
+
+def execute(filters=None):
+	columns, data = [], []
+	columns=get_columns()
+	data=get_lead_data(filters, "Lead Owner")
+	return columns, data
+	
+def get_columns():
+	return [
+		_("Lead Owner") + ":Data:130", 
+		_("Lead Count") + ":Int:80",
+		_("Opp Count") + ":Int:80",
+		_("Quot Count") + ":Int:80", 
+		_("Order Count") + ":Int:100",
+		_("Order Value") + ":Float:100",
+		_("Opp/Lead %") + ":Float:100",
+		_("Quot/Lead %") + ":Float:100",
+		_("Order/Quot %") + ":Float:100"
+	]
\ No newline at end of file
diff --git a/erpnext/schools/doctype/assessment_code/__init__.py b/erpnext/crm/report/prospects_engaged_but_not_converted/__init__.py
similarity index 100%
copy from erpnext/schools/doctype/assessment_code/__init__.py
copy to erpnext/crm/report/prospects_engaged_but_not_converted/__init__.py
diff --git a/erpnext/crm/report/prospects_engaged_but_not_converted/prospects_engaged_but_not_converted.js b/erpnext/crm/report/prospects_engaged_but_not_converted/prospects_engaged_but_not_converted.js
new file mode 100644
index 0000000..6f37719
--- /dev/null
+++ b/erpnext/crm/report/prospects_engaged_but_not_converted/prospects_engaged_but_not_converted.js
@@ -0,0 +1,25 @@
+// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
+// For license information, please see license.txt
+
+frappe.query_reports["Prospects Engaged But Not Converted"] = {
+	"filters": [
+		{
+			"fieldname": "lead",
+			"label": __("Lead"),
+			"fieldtype": "Link",
+			"options": "Lead"
+		},
+		{
+			"fieldname": "no_of_interaction",
+			"label": __("Number of Interaction"),
+			"fieldtype": "Int",
+			"default": 1
+		},
+		{
+			"fieldname": "lead_age",
+			"label": __("Minimum Lead Age (Days)"),
+			"fieldtype": "Int",
+			"default": 60
+		},
+	]
+}
diff --git a/erpnext/crm/report/prospects_engaged_but_not_converted/prospects_engaged_but_not_converted.json b/erpnext/crm/report/prospects_engaged_but_not_converted/prospects_engaged_but_not_converted.json
new file mode 100644
index 0000000..9a21e0b
--- /dev/null
+++ b/erpnext/crm/report/prospects_engaged_but_not_converted/prospects_engaged_but_not_converted.json
@@ -0,0 +1,29 @@
+{
+ "add_total_row": 0, 
+ "apply_user_permissions": 1, 
+ "creation": "2017-04-04 08:25:40.491063", 
+ "disabled": 0, 
+ "docstatus": 0, 
+ "doctype": "Report", 
+ "idx": 0, 
+ "is_standard": "Yes", 
+ "modified": "2017-04-04 10:00:10.253224", 
+ "modified_by": "Administrator", 
+ "module": "CRM", 
+ "name": "Prospects Engaged But Not Converted", 
+ "owner": "Administrator", 
+ "ref_doctype": "Lead", 
+ "report_name": "Prospects Engaged But Not Converted", 
+ "report_type": "Script Report", 
+ "roles": [
+  {
+   "role": "Sales User"
+  }, 
+  {
+   "role": "Sales Manager"
+  }, 
+  {
+   "role": "System Manager"
+  }
+ ]
+}
\ No newline at end of file
diff --git a/erpnext/crm/report/prospects_engaged_but_not_converted/prospects_engaged_but_not_converted.py b/erpnext/crm/report/prospects_engaged_but_not_converted/prospects_engaged_but_not_converted.py
new file mode 100644
index 0000000..36a4ad6
--- /dev/null
+++ b/erpnext/crm/report/prospects_engaged_but_not_converted/prospects_engaged_but_not_converted.py
@@ -0,0 +1,74 @@
+# Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors
+# For license information, please see license.txt
+
+from __future__ import unicode_literals
+import frappe
+from frappe import _
+from frappe.utils import add_days, now
+
+def execute(filters=None):
+	columns, data = [], []
+	set_defaut_value_for_filters(filters)
+	columns = get_columns()
+	data = get_data(filters)
+
+	return columns, data
+
+def set_defaut_value_for_filters(filters):
+	if not filters.get('no_of_interaction'): filters["no_of_interaction"] = 1
+	if not filters.get('lead_age'): filters["lead_age"] = 60
+
+def get_columns():
+	return [
+		_("Lead") + ":Link/Lead:100",
+		_("Name") + "::100",
+		_("Organization") + "::100",
+		_("Reference Document") + "::150",
+		_("Reference Name") + ":Dynamic Link/"+_("Reference Document")+":120",
+		_("Last Communication") + ":Data:200",
+		_("Last Communication Date") + ":Date:180"
+	]
+
+def get_data(filters):
+	lead_details = []
+	lead_filters = get_lead_filters(filters)
+
+	for lead in frappe.get_all('Lead', fields = ['name', 'lead_name', 'company_name'], filters=lead_filters):
+		data = frappe.db.sql("""
+			select 
+				`tabCommunication`.reference_doctype, `tabCommunication`.reference_name, 
+				`tabCommunication`.content, `tabCommunication`.communication_date
+			from 
+				(
+					(select name, lead from `tabOpportunity` where lead = %(lead)s)
+				union 
+					(select name, lead from `tabQuotation` where lead = %(lead)s)
+				union
+					(select name, lead from `tabIssue` where lead = %(lead)s and status!='Closed')
+				union
+					(select %(lead)s, %(lead)s)
+				)
+				as ref_document, `tabCommunication`
+			where
+				`tabCommunication`.reference_name = ref_document.name and
+				`tabCommunication`.sent_or_received = 'Received'
+			order by
+				ref_document.lead, `tabCommunication`.creation desc limit %(limit)s""",
+			{'lead': lead.name, 'limit': filters.get('no_of_interaction')})
+
+		for lead_info in data:
+			lead_data = [lead.name, lead.lead_name, lead.company_name] + list(lead_info)
+			lead_details.append(lead_data)
+
+	return lead_details
+
+def get_lead_filters(filters):
+	lead_creation_date = get_creation_date_based_on_lead_age(filters)
+	lead_filters = [["status", "!=", "Converted"], ["creation", ">", lead_creation_date]]
+
+	if filters.get('lead'):
+		lead_filters.append(["name", "=", filters.get('lead')])
+	return lead_filters
+
+def get_creation_date_based_on_lead_age(filters):
+	return add_days(now(), (filters.get('lead_age') * -1))
\ No newline at end of file
diff --git a/erpnext/demo/setup/setup_data.py b/erpnext/demo/setup/setup_data.py
index 400b076..3675f0f 100644
--- a/erpnext/demo/setup/setup_data.py
+++ b/erpnext/demo/setup/setup_data.py
@@ -63,6 +63,13 @@
 			"language": "english"
 		})
 
+		company = erpnext.get_default_company()
+
+		if company:
+			company_doc = frappe.get_doc("Company", company)
+			company_doc.db_set('default_payroll_payable_account',
+				frappe.db.get_value('Account', dict(account_name='Payroll Payable')))
+
 def setup_demo_page():
 	# home page should always be "start"
 	website_settings = frappe.get_doc("Website Settings", "Website Settings")
diff --git a/erpnext/demo/user/fixed_asset.py b/erpnext/demo/user/fixed_asset.py
index bf3199e..b2db39c 100644
--- a/erpnext/demo/user/fixed_asset.py
+++ b/erpnext/demo/user/fixed_asset.py
@@ -18,6 +18,9 @@
 		# fixed_asset.work() already run
 		return
 		
+	# Enable booking asset depreciation entry automatically
+	frappe.db.set_value("Accounts Settings", None, "book_asset_depreciation_entry_automatically", 1)
+		
 	# post depreciation entries as on today
 	post_depreciation_entries()
 	
diff --git a/erpnext/demo/user/hr.py b/erpnext/demo/user/hr.py
index 2536602..0b644c4 100644
--- a/erpnext/demo/user/hr.py
+++ b/erpnext/demo/user/hr.py
@@ -34,14 +34,16 @@
 		process_payroll.salary_slip_based_on_timesheet = 0
 		process_payroll.create_salary_slips()
 		process_payroll.submit_salary_slips()
-		process_payroll.make_journal_entry(reference_date=frappe.flags.current_date,
-			reference_number=random_string(10))
+		process_payroll.make_accural_jv_entry()
+		# process_payroll.make_journal_entry(reference_date=frappe.flags.current_date,
+		# 	reference_number=random_string(10))
 
 		process_payroll.salary_slip_based_on_timesheet = 1
 		process_payroll.create_salary_slips()
 		process_payroll.submit_salary_slips()
-		process_payroll.make_journal_entry(reference_date=frappe.flags.current_date,
-			reference_number=random_string(10))
+		process_payroll.make_accural_jv_entry()
+		# process_payroll.make_journal_entry(reference_date=frappe.flags.current_date,
+		# 	reference_number=random_string(10))
 
 	if frappe.db.get_global('demo_hr_user'):
 		make_timesheet_records()
diff --git a/erpnext/docs/assets/img/accounts/bank-guarantee.png b/erpnext/docs/assets/img/accounts/bank-guarantee.png
new file mode 100644
index 0000000..dda016a
--- /dev/null
+++ b/erpnext/docs/assets/img/accounts/bank-guarantee.png
Binary files differ
diff --git a/erpnext/docs/assets/img/accounts/exempted-item.png b/erpnext/docs/assets/img/accounts/exempted-item.png
new file mode 100644
index 0000000..926806b
--- /dev/null
+++ b/erpnext/docs/assets/img/accounts/exempted-item.png
Binary files differ
diff --git a/erpnext/docs/assets/img/accounts/item-wise-tax.png b/erpnext/docs/assets/img/accounts/item-wise-tax.png
new file mode 100644
index 0000000..9fe06ec
--- /dev/null
+++ b/erpnext/docs/assets/img/accounts/item-wise-tax.png
Binary files differ
diff --git a/erpnext/docs/assets/img/accounts/pos-customer.png b/erpnext/docs/assets/img/accounts/pos-customer.png
index c3cbb8a..20bce38 100644
--- a/erpnext/docs/assets/img/accounts/pos-customer.png
+++ b/erpnext/docs/assets/img/accounts/pos-customer.png
Binary files differ
diff --git a/erpnext/docs/assets/img/accounts/pos-email.png b/erpnext/docs/assets/img/accounts/pos-email.png
new file mode 100644
index 0000000..31aa086
--- /dev/null
+++ b/erpnext/docs/assets/img/accounts/pos-email.png
Binary files differ
diff --git a/erpnext/docs/assets/img/accounts/tax-calulation.png b/erpnext/docs/assets/img/accounts/tax-calulation.png
new file mode 100644
index 0000000..f22d5d3
--- /dev/null
+++ b/erpnext/docs/assets/img/accounts/tax-calulation.png
Binary files differ
diff --git a/erpnext/docs/assets/img/accounts/tax-master.png b/erpnext/docs/assets/img/accounts/tax-master.png
new file mode 100644
index 0000000..c08439b
--- /dev/null
+++ b/erpnext/docs/assets/img/accounts/tax-master.png
Binary files differ
diff --git a/erpnext/stock/doctype/package_code/__init__.py b/erpnext/docs/assets/img/crm/report/__init__.py
similarity index 100%
rename from erpnext/stock/doctype/package_code/__init__.py
rename to erpnext/docs/assets/img/crm/report/__init__.py
diff --git a/erpnext/docs/assets/img/crm/report/customer_address_and_contact.png b/erpnext/docs/assets/img/crm/report/customer_address_and_contact.png
new file mode 100644
index 0000000..3f92edb
--- /dev/null
+++ b/erpnext/docs/assets/img/crm/report/customer_address_and_contact.png
Binary files differ
diff --git a/erpnext/docs/assets/img/crm/report/inactive_customers.png b/erpnext/docs/assets/img/crm/report/inactive_customers.png
new file mode 100644
index 0000000..75330fd
--- /dev/null
+++ b/erpnext/docs/assets/img/crm/report/inactive_customers.png
Binary files differ
diff --git a/erpnext/docs/assets/img/crm/report/lead.png b/erpnext/docs/assets/img/crm/report/lead.png
new file mode 100644
index 0000000..92a3d70
--- /dev/null
+++ b/erpnext/docs/assets/img/crm/report/lead.png
Binary files differ
diff --git a/erpnext/docs/assets/img/crm/report/minutes_to_first_response.png b/erpnext/docs/assets/img/crm/report/minutes_to_first_response.png
new file mode 100644
index 0000000..1831382
--- /dev/null
+++ b/erpnext/docs/assets/img/crm/report/minutes_to_first_response.png
Binary files differ
diff --git a/erpnext/docs/assets/img/crm/report/prospects_engaged_but_not_converted.png b/erpnext/docs/assets/img/crm/report/prospects_engaged_but_not_converted.png
new file mode 100644
index 0000000..8406b68
--- /dev/null
+++ b/erpnext/docs/assets/img/crm/report/prospects_engaged_but_not_converted.png
Binary files differ
diff --git a/erpnext/docs/assets/img/crm/report/sales_funnel.png b/erpnext/docs/assets/img/crm/report/sales_funnel.png
new file mode 100644
index 0000000..0796441
--- /dev/null
+++ b/erpnext/docs/assets/img/crm/report/sales_funnel.png
Binary files differ
diff --git a/erpnext/docs/assets/img/taxes-and-charges.gif b/erpnext/docs/assets/img/selling/taxes-and-charges.gif
similarity index 100%
rename from erpnext/docs/assets/img/taxes-and-charges.gif
rename to erpnext/docs/assets/img/selling/taxes-and-charges.gif
Binary files differ
diff --git a/erpnext/docs/assets/img/setup/integrations/payment_gateway_account_stripe.png b/erpnext/docs/assets/img/setup/integrations/payment_gateway_account_stripe.png
new file mode 100644
index 0000000..8ecf8df
--- /dev/null
+++ b/erpnext/docs/assets/img/setup/integrations/payment_gateway_account_stripe.png
Binary files differ
diff --git a/erpnext/docs/assets/img/setup/integrations/stripe_coa.png b/erpnext/docs/assets/img/setup/integrations/stripe_coa.png
new file mode 100644
index 0000000..27e79c5
--- /dev/null
+++ b/erpnext/docs/assets/img/setup/integrations/stripe_coa.png
Binary files differ
diff --git a/erpnext/docs/assets/img/setup/integrations/stripe_setting.png b/erpnext/docs/assets/img/setup/integrations/stripe_setting.png
new file mode 100644
index 0000000..b6aa124
--- /dev/null
+++ b/erpnext/docs/assets/img/setup/integrations/stripe_setting.png
Binary files differ
diff --git a/erpnext/docs/assets/img/stock/batch.png b/erpnext/docs/assets/img/stock/batch.png
deleted file mode 100644
index 406acbd..0000000
--- a/erpnext/docs/assets/img/stock/batch.png
+++ /dev/null
Binary files differ
diff --git a/erpnext/docs/assets/img/stock/batch_view.png b/erpnext/docs/assets/img/stock/batch_view.png
new file mode 100644
index 0000000..d670fc9
--- /dev/null
+++ b/erpnext/docs/assets/img/stock/batch_view.png
Binary files differ
diff --git a/erpnext/docs/assets/img/stock/item_setup_for_batch.png b/erpnext/docs/assets/img/stock/item_setup_for_batch.png
new file mode 100644
index 0000000..ed4eb21
--- /dev/null
+++ b/erpnext/docs/assets/img/stock/item_setup_for_batch.png
Binary files differ
diff --git a/erpnext/docs/assets/img/users-and-permissions/reset-roles-permisison-for-page-report.png b/erpnext/docs/assets/img/users-and-permissions/reset-roles-permisison-for-page-report.png
new file mode 100644
index 0000000..aec9293
--- /dev/null
+++ b/erpnext/docs/assets/img/users-and-permissions/reset-roles-permisison-for-page-report.png
Binary files differ
diff --git a/erpnext/docs/assets/img/users-and-permissions/role-permission-for-page-and-report.png b/erpnext/docs/assets/img/users-and-permissions/role-permission-for-page-and-report.png
new file mode 100644
index 0000000..69b31d6
--- /dev/null
+++ b/erpnext/docs/assets/img/users-and-permissions/role-permission-for-page-and-report.png
Binary files differ
diff --git a/erpnext/docs/assets/img/users-and-permissions/roles-for-page.png b/erpnext/docs/assets/img/users-and-permissions/roles-for-page.png
new file mode 100644
index 0000000..f28c6d7
--- /dev/null
+++ b/erpnext/docs/assets/img/users-and-permissions/roles-for-page.png
Binary files differ
diff --git a/erpnext/docs/assets/img/users-and-permissions/roles-for-report.png b/erpnext/docs/assets/img/users-and-permissions/roles-for-report.png
new file mode 100644
index 0000000..1f8fd4e
--- /dev/null
+++ b/erpnext/docs/assets/img/users-and-permissions/roles-for-report.png
Binary files differ
diff --git a/erpnext/docs/assets/old_images/erpnext/item-wise-tax-calc.png b/erpnext/docs/assets/old_images/erpnext/item-wise-tax-calc.png
deleted file mode 100644
index cd3a08f..0000000
--- a/erpnext/docs/assets/old_images/erpnext/item-wise-tax-calc.png
+++ /dev/null
Binary files differ
diff --git a/erpnext/docs/assets/old_images/erpnext/item-wise-tax-master.png b/erpnext/docs/assets/old_images/erpnext/item-wise-tax-master.png
deleted file mode 100644
index 95983c5..0000000
--- a/erpnext/docs/assets/old_images/erpnext/item-wise-tax-master.png
+++ /dev/null
Binary files differ
diff --git a/erpnext/docs/assets/old_images/erpnext/item-wise-tax.png b/erpnext/docs/assets/old_images/erpnext/item-wise-tax.png
deleted file mode 100644
index 374fab6..0000000
--- a/erpnext/docs/assets/old_images/erpnext/item-wise-tax.png
+++ /dev/null
Binary files differ
diff --git a/erpnext/docs/license.html b/erpnext/docs/license.html
index 1d50b78..4740c5c 100644
--- a/erpnext/docs/license.html
+++ b/erpnext/docs/license.html
@@ -640,8 +640,8 @@
 the exclusion of warranty; and each file should have at least the
 "copyright" line and a pointer to where the full notice is found.</p>
 
-<pre><code>    &lt;one line="" to="" give="" the="" program's="" name="" and="" a="" brief="" idea="" of="" what="" it="" does.=""&gt;
-    Copyright (C) &lt;year&gt;  &lt;name of="" author=""&gt;
+<pre><code>    &lt;one line to give the program's name and a brief idea of what it does.&gt;
+    Copyright (C) &lt;year&gt;  &lt;name of author&gt;
 
     This program is free software: you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
diff --git a/erpnext/docs/user/manual/en/CRM/crm_reports.md b/erpnext/docs/user/manual/en/CRM/crm_reports.md
new file mode 100644
index 0000000..4ff9aa5
--- /dev/null
+++ b/erpnext/docs/user/manual/en/CRM/crm_reports.md
@@ -0,0 +1,40 @@
+CRM module's reports helps users to get the information about the prospects. Using Following reports, user can analyze the data about prospect's history with a company and will helps user to build strong relationships with them.
+
+###Lead Details
+It has data about the leads and their contact and address details.
+<img alt="Lead Details" class="screenshot"
+    src="{{docs_base_url}}/assets/img/crm/report/lead.png">
+
+###Sales Funnel
+By using the sales funnel report, and by quantifying the number of prospects at each stage of the process, you can get an idea of your potential customers.
+
+More than this, by looking at the way these numbers change over time, you can identify problems in the sales pipeline and take any corrective action at the early stage.
+
+For example, if you notice that very few communications with the prospects has taken place in a month which might indicate a decrease in the sales. From the next month, organization should make sure that more communications has to take place with the prospects.
+
+<img alt="Lead Details" class="screenshot"
+    src="{{docs_base_url}}/assets/img/crm/report/sales_funnel.png">
+
+###Prospects Engaged But Not Converted
+Using this report, user gets the information about the leads who has shown interest in the business with you but due to some reason they were not converted into the customers.
+
+<img alt="Lead Details" class="screenshot"
+    src="{{docs_base_url}}/assets/img/crm/report/prospects_engaged_but_not_converted.png">
+
+###Minutes to First Response for Opportunity
+Immediacy is so important – and so valued 
+In this internet area, we all expect a quicker response time to any of our query. This report gives you the information about the first response time given to an opportunities or issues. Using this report, the organization can improve their first response time to the prospects which can help to the better sales in the future.
+
+<img alt="Lead Details" class="screenshot"
+    src="{{docs_base_url}}/assets/img/crm/report/minutes_to_first_response.png">
+
+###Customer Addresses And Contacts
+It has data about the customers and their contact and address details.
+<img alt="Lead Details" class="screenshot"
+    src="{{docs_base_url}}/assets/img/crm/report/customer_address_and_contact.png">
+
+###Inactive Customers
+This report shows the list of customers who has not purchased since long time.
+
+<img alt="Lead Details" class="screenshot"
+    src="{{docs_base_url}}/assets/img/crm/report/inactive_customers.png">
diff --git a/erpnext/docs/user/manual/en/CRM/index.txt b/erpnext/docs/user/manual/en/CRM/index.txt
index 204123a..2fe3f4d 100644
--- a/erpnext/docs/user/manual/en/CRM/index.txt
+++ b/erpnext/docs/user/manual/en/CRM/index.txt
@@ -3,4 +3,5 @@
 opportunity
 contact
 newsletter
+crm_reports
 setup
\ No newline at end of file
diff --git a/erpnext/docs/user/manual/en/accounts/bank-guarantee.md b/erpnext/docs/user/manual/en/accounts/bank-guarantee.md
new file mode 100644
index 0000000..db60300
--- /dev/null
+++ b/erpnext/docs/user/manual/en/accounts/bank-guarantee.md
@@ -0,0 +1,9 @@
+A Bank Guarantee is a guarantee from a lending institution such as a bank ensuring the liabilities of a debtor will be met. In other words, if the debtor fails to settle a debt, the bank covers it. A Bank Guarantee enables the customer, or debtor, to acquire goods, buy equipment or draw down loans, and thereby expand business activity.
+
+A client may ask you to provide a Bank Guarantee from a third party such as a bank. This guarantee is for a specified amount, which is usually a percentage of the total value of the contract. The Bank Guarantee is valid for a specified duration after which it expires and must be returned to you by the client.
+
+This document allows you to track Bank Guarantees given to clients. You can set Email Alerts as the Bank Guarantee expiry date approaches to remind yourself to get the Bank Guarantee back from your client. 
+
+<img class="screenshot" alt="Bank Guarantee" src="{{docs_base_url}}/assets/img/accounts/bank-guarantee.png">
+
+{next}
diff --git a/erpnext/docs/user/manual/en/accounts/index.txt b/erpnext/docs/user/manual/en/accounts/index.txt
index 6ba9337..6a0da3a 100644
--- a/erpnext/docs/user/manual/en/accounts/index.txt
+++ b/erpnext/docs/user/manual/en/accounts/index.txt
@@ -10,6 +10,7 @@
 advance-payment-entry
 payment-request
 credit-limit
+bank-guarantee
 accounting-reports
 accounting-entries
 managing-fixed-assets
diff --git a/erpnext/docs/user/manual/en/accounts/item-wise-taxation.md b/erpnext/docs/user/manual/en/accounts/item-wise-taxation.md
index bc51de9..1750f41 100644
--- a/erpnext/docs/user/manual/en/accounts/item-wise-taxation.md
+++ b/erpnext/docs/user/manual/en/accounts/item-wise-taxation.md
@@ -1,29 +1,35 @@
-Taxes selected in the Tax and Other Charges in transactions are applied on all the items. If you need different taxes applied on items selected in the same transaction, you should setup you item and tax master as explained in the steps below.
+In the sales and purchase transactions, you can apply taxes and other charges on the items. For the ease of applying taxes, you can fetch values from the [Sales Taxes and Charges master](/contents//setting-up/setting-up-taxes). Taxes and charges are applied equally on all the items. For example, if tax GST 16% is added in the tax table, then it will be applied on all the items. However, if you need to have different tax rate applied on some of the items, following is how you should setup Items and Sales Taxes and Other Charges master in your ERPNext account.
+
+Let's assume that we are creating a Sales Order. We have Sales Taxes and Charges master for GST 16%. Out of all the Sales Items, on one item, only 12% GST will be applied, while one more item is exempted from the tax.
 
 ####Step 1: Mention Tax Applicable in the Item master
 
-Item master has tax table where you can list taxes which will be applied on it.
+Items on which differential tax rate is applied, you should mention tax rate for that item in the Item master itself. Item master has tax table where you can list taxes which will be applied on it.
 
-![Item wise Tax]({{docs_base_url}}/assets/old_images/erpnext/item-wise-tax.png)
+> Tax rate mentioned in the item master gets preference over tax rate entered in the transactions.
 
-Tax rate mentioned in the item master gets preference over tax rate entered in the transactions. 
+Here is the example of Item on which 12% GST is applied only.
 
-For example, if you provide tax rate for VAT as 10% for item ABC, where for same VAT ledger 12% rate is entered in the Sales Order/Invoice, for item ABC, tax rate applied would be 10%, as mentioned in the item master.
+<img class="screenshot" alt="Opening Account" src="{{docs_base_url}}/assets/img/accounts/item-wise-tax.png">
+
+For the item which is exempted from GST totally, mention 0% as tax rate in the Item master.
+
+<img class="screenshot" alt="Opening Account" src="{{docs_base_url}}/assets/img/accounts/exempted-item.png">
 
 ####Step 2: Setup Taxes and Other Charges
 
-In Taxes and Other Charges master, you should select all the applicable taxes which could be applicable on item.
+In Sales Taxes and Other Charges master, select GST 16% account and mention Tax Rate as 16. This tax rate will be applied on all the Items selected in the Sales Order, unless specific Tax Rate is defined in the Item master.
 
-For example, if few items has VAT 5 applied on them, other has Service Tax applied, and some other has Excise Duty applicable, then you tax master should have all these taxes selected.
+<img class="screenshot" alt="Opening Account" src="{{docs_base_url}}/assets/img/accounts/tax-master.png">
 
-![item wise tax master]({{docs_base_url}}/assets/old_images/erpnext/item-wise-tax-master.png)
+<div class="well">If you want to have tax rate always applied from the Item master, then you should update Rate for the tax account as zero in the Taxes and Charges master.</div>
 
-####Step 3: Set Tax Rate as Zero in Taxes and Charges Template
+####Step 3: Tax Calculation in transaction	
 
-In the Taxes and Other Charges master, tax rate will be updated as ZERO. It means, tax rate applicable on items will be pulled from the respective Item master. While for other items, 0% tax will be applied, means no other taxes will be applied on that item.
+In the Sales Order, we have selected many Items. For the items mentioned in blue, tax rate is applied based on tax rate mentioned in the taxes table. For the items highlited in red, tax rate has fetched for them from the respective item master.
 
-Based on the above setting, you will have taxes applied on items as mentioned in the respective item master. Check following for an instance.
+<img class="screenshot" alt="Opening Account" src="{{docs_base_url}}/assets/img/accounts/tax-calulation.png">
 
-![item wise tax calculation]({{docs_base_url}}/assets/old_images/erpnext/item-wise-tax-calc.png)
+Please note that item's tax rate will be pulled from the item master only if you have update same tax account (GST 16% in this case) in both Item master and tax master.
 
 {next}
diff --git a/erpnext/docs/user/manual/en/accounts/managing-fixed-assets.md b/erpnext/docs/user/manual/en/accounts/managing-fixed-assets.md
index efbe95f..e82ec92 100644
--- a/erpnext/docs/user/manual/en/accounts/managing-fixed-assets.md
+++ b/erpnext/docs/user/manual/en/accounts/managing-fixed-assets.md
@@ -64,7 +64,7 @@
 
 ## Sell an Asset
 
-To sale an asset, open the asset record and create a Sales Invoice by clicking on "Sale Asset". On submission of the Sales Invoice, following entries will take place:
+To sell an asset, open the asset record and create a Sales Invoice by clicking on "Sell Asset". On submission of the Sales Invoice, following entries will take place:
 
 - "Receivable Account" (Debtors) will be debited by the sales amount.
 - "Fixed Asset Account" will be credited by the purchase amount of asset.
diff --git a/erpnext/docs/user/manual/en/accounts/point-of-sale-pos-invoice.md b/erpnext/docs/user/manual/en/accounts/point-of-sale-pos-invoice.md
index 64fa22c..0c7e591 100644
--- a/erpnext/docs/user/manual/en/accounts/point-of-sale-pos-invoice.md
+++ b/erpnext/docs/user/manual/en/accounts/point-of-sale-pos-invoice.md
@@ -27,7 +27,7 @@
 
 ### Customer
 
-You can select one of the existing Customer from the Customer master. If Customer doesn't exist in the Customer master, enter Customer Name in the POS Invoice view itself. On creation of POS Invoice, Customer will be auto-created in the Customer master.
+In POS, user can select the existing customer during making an order or create the new customer. This features works in the offline mode also. User can also add the customer details like contact number, address details etc on the form. The customer which has been created from the POS will be synced when the internet connection is active.
 
 <img class="screenshot" alt="POS Customer" src="{{docs_base_url}}/assets/img/accounts/pos-customer.png">
 
@@ -105,4 +105,9 @@
 
 To see entries after “Submit”, click on “View Ledger”.
 
+### Email
+User can send email from the POS, after submission of an order, user has to click on menu > email
+<img class="screenshot" alt="POS Payment" src="{{docs_base_url}}/assets/img/accounts/pos-email.png">
+After sync of an order, email sent to the customer with the print of the bill in the attachment
+
 {next}
diff --git a/erpnext/docs/user/manual/en/manufacturing/production-order.md b/erpnext/docs/user/manual/en/manufacturing/production-order.md
index 2f0fef3..685a2ca 100644
--- a/erpnext/docs/user/manual/en/manufacturing/production-order.md
+++ b/erpnext/docs/user/manual/en/manufacturing/production-order.md
@@ -1,7 +1,7 @@
 <img class="screenshot" alt="Production Order" src="{{docs_base_url}}/assets/img/manufacturing/manufacturing-flow.png">
-Production Order (also called as Work Order) is a document that is given to
+A Production Order (also known as a Work Order) is a document that is given to
 the manufacturing shop floor by the Production Planner as a signal to produce
-a certain quantity of a certain Item. Production Order also helps to generate
+a certain quantity of a certain Item. The Production Order also helps to generate
 the material requirements (Stock Entry) for the Item to be produced from its
 **Bill of Materials**.
 
@@ -62,12 +62,19 @@
 
 <img class="screenshot" alt="Stock Entry for PO" src="{{docs_base_url}}/assets/img/manufacturing/PO-material-transfer-updated.png">
 
+#### Material Transfer through Stock Entry
+Use cases for this option are:
+* If material transfer is done in bulk and/or is not required to be tracked against a particular Production Order
+* If the responsibility for Material Transfer and Production Entry lies with two separate users
+
+If this is the case, you can select the Skip Material Transfer check box, which will allow you to make the “Manufacture” Stock Entry directly by clicking on the ‘Finish’ button.
+
 ### Making Time Logs
 
 * Progress in the Production Order can be tracked using [Timesheet]({{docs_base_url}}/user/manual/en/projects/timesheet/timesheet-against-production-order.html)
 * Timesheet's time slots are created against Production Order Operations.
-* Drafts of Timesheet is created based on the scheduled operations when an Production Order is Submitted.
-* To create more Timesheet against an operation click 'Make Timesheet' button.
+* Drafts of Timesheet are created based on the scheduled operations when an Production Order is Submitted.
+* To create more Timesheets against an operation click 'Make Timesheet' button.
 
 <img class="screenshot" alt="Make timesheet against PO" src="{{docs_base_url}}/assets/img/manufacturing/PO-operations-make-ts.png">
 
@@ -88,7 +95,7 @@
 ### Stopping a Production Order
 
 * When you stop a Production Order its status is changed to Stop indicating that all production process against that Production Order is to be ceased.
-* To stop the Production Order click on the 'stop' Button
+* To stop the Production Order click on the 'Stop' Button
 
   1. On Submitting the Production Order, the system will reserve a slot for each of the Production Order Operations serially after the planned start date based on the workstation availability. The Workstation availability depends on the Workstation timings, holiday list and if some other Production Order Operation was scheduled in that slot. You can mention the number of days for the system to try scheduling the operations in the Manufacturing Settings. This is set to 30 Days by default. If the operation requires time exceeding the available slot, system shall ask you to break the operations. Once the scheduling is done system shall create Time Logs and save them. You can Modify them and submit them later.
   2. You can also create additional time logs against an Operation. For doing so select the respective operation and click on 'Make Time Log'
@@ -98,7 +105,7 @@
 
 <img class="screenshot" alt="PO - stop" src="{{docs_base_url}}/assets/img/manufacturing/PO-stop.png">
 
-* You can Also re-start a stopped Production Order.
+* You can also re-start a stopped Production Order.
 
 > Note : In order to make a Production Order against an Item you must specify 'Yes' to "Allow Production Order" on the Item form.
 
diff --git a/erpnext/docs/user/manual/en/selling/setup/sales-partner.md b/erpnext/docs/user/manual/en/selling/setup/sales-partner.md
index 1174969..b876205 100644
--- a/erpnext/docs/user/manual/en/selling/setup/sales-partner.md
+++ b/erpnext/docs/user/manual/en/selling/setup/sales-partner.md
@@ -1,6 +1,6 @@
 People who assist you in getting business are termed as Sales Partners. Sales Partners can be represented by different names in ERPNext. You can call them Channel Partner, Distributor, Dealer, Agent, Retailer, Implementation Partner, Reseller etc.
 
-For each Sales Partner, you can define commission offer to them. When Sales Partner is selected in transactions, there commission is calculated over Net Total of Sales Order/Invoice or Delivery Note.
+For each Sales Partner, you can define commission offer to them. When Sales Partner is selected in transactions, their commission is calculated over Net Total of Sales Order/Invoice or Delivery Note.
 
 You can track Sales Personwise commission in the report under Selling module.
 
diff --git a/erpnext/docs/user/manual/en/setting-up/email/email-account.md b/erpnext/docs/user/manual/en/setting-up/email/email-account.md
index 0fafa53..f020362 100644
--- a/erpnext/docs/user/manual/en/setting-up/email/email-account.md
+++ b/erpnext/docs/user/manual/en/setting-up/email/email-account.md
@@ -8,7 +8,7 @@
 
 ERPNext will create templates for a bunch of email accounts by default. Not all of them are enabled. To enable them, you must set your account details.
 
-There are 2 types of email accounts, outgoing and incoming. Outgoing email accounts use an SMTP service to send emails and emails are retrived from your inbox using a POP service. Most email providers such as GMail, Outlook or Yahoo provide these services.
+There are 2 types of email accounts, outgoing and incoming. Outgoing email accounts use an SMTP service to send emails and emails are retrived from your inbox using a IMAP or POP service. Most email providers such as GMail, Outlook or Yahoo provide these services.
 
 <img class="screenshot" alt="Defining Criteria" src="{{docs_base_url}}/assets/img/setup/email/email-account-list.png">
 
@@ -28,7 +28,7 @@
 
 ### How ERPNext handles replies
 
-In ERPNext when you send an email to a contact like a customer, the sender will be the user who sent the email. In the **Reply-To** property, the Email Address will be of the default incoming account (like `replies@yourcompany.com`). ERPNext will automatically extract these emails from the incoming account and tag it to the relvant communication
+In ERPNext when you send an email to a contact like a customer, the sender will be the user who sent the email. In the **Reply-To** property, the Email Address will be of the default incoming account (like `replies@yourcompany.com`). ERPNext will automatically extract these emails from the incoming account and tag it to the relevant communication
 
 ### Notification for unreplied messages
 
diff --git a/erpnext/docs/user/manual/en/setting-up/integrations/stripe-integration.md b/erpnext/docs/user/manual/en/setting-up/integrations/stripe-integration.md
new file mode 100644
index 0000000..05f70f0
--- /dev/null
+++ b/erpnext/docs/user/manual/en/setting-up/integrations/stripe-integration.md
@@ -0,0 +1,30 @@
+#Setting up Stripe
+
+To setup Stripe,
+`Explore > Integrations > Stripe Settings`
+
+#### Setup  Stripe 
+
+To enable Stripe payment service, you need to configure parameters like Publishable Key, Secret Key
+<img class="screenshot" alt="Razorpay Settings" src="{{docs_base_url}}/assets/img/setup/integrations/stripe_setting.png">
+
+On enabling service, the system will create Payment Gateway record and Account head in chart of account with account type as Bank.
+
+<img class="screenshot" alt="Stripe COA" src="{{docs_base_url}}/assets/img/setup/integrations/stripe_coa.png">
+
+Also it will create Payment Gateway Account entry. Payment Gateway Account is configuration hub from this you can set account head from existing COA, default Payment Request email body template.
+
+<img class="screenshot" alt="Payment Gateway Account" src="{{docs_base_url}}/assets/img/setup/integrations/payment_gateway_account_stripe.png">
+
+After configuring Payment Gateway Account your system is able to accept online payments.
+
+####Supporting transaction currencies
+	"AED", "ALL", "ANG", "ARS", "AUD", "AWG", "BBD", "BDT", "BIF", "BMD", "BND",
+	"BOB", "BRL", "BSD", "BWP", "BZD", "CAD", "CHF", "CLP", "CNY", "COP", "CRC", "CVE", "CZK", "DJF",
+	"DKK", "DOP", "DZD", "EGP", "ETB", "EUR", "FJD", "FKP", "GBP", "GIP", "GMD", "GNF", "GTQ", "GYD",
+	"HKD", "HNL", "HRK", "HTG", "HUF", "IDR", "ILS", "INR", "ISK", "JMD", "JPY", "KES", "KHR", "KMF",
+	"KRW", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "MAD", "MDL", "MNT", "MOP", "MRO", "MUR", "MVR",
+	"MWK", "MXN", "MYR", "NAD", "NGN", "NIO", "NOK", "NPR", "NZD", "PAB", "PEN", "PGK", "PHP", "PKR",
+	"PLN", "PYG", "QAR", "RUB", "SAR", "SBD", "SCR", "SEK", "SGD", "SHP", "SLL", "SOS", "STD", "SVC",
+	"SZL", "THB", "TOP", "TTD", "TWD", "TZS", "UAH", "UGX", "USD", "UYU", "UZS", "VND", "VUV", "WST",
+	"XAF", "XOF", "XPF", "YER", "ZAR"
diff --git a/erpnext/docs/user/manual/en/setting-up/settings/module-settings.md b/erpnext/docs/user/manual/en/setting-up/settings/module-settings.md
index ecfb282..3e2a109 100644
--- a/erpnext/docs/user/manual/en/setting-up/settings/module-settings.md
+++ b/erpnext/docs/user/manual/en/setting-up/settings/module-settings.md
@@ -2,7 +2,7 @@
 
 You can globally switch off certain desktop module via:
 
-> Setup > Settings > Show or Hide Modules
+> Setup > Permissions > Show / Hide Modules
 
 For example if you are in the services business, you want to hide the Manufacturing Module, you can do this via **Show or Hide Modules**
 
diff --git a/erpnext/docs/user/manual/en/setting-up/users-and-permissions/index.txt b/erpnext/docs/user/manual/en/setting-up/users-and-permissions/index.txt
index b00f32a..74243df 100644
--- a/erpnext/docs/user/manual/en/setting-up/users-and-permissions/index.txt
+++ b/erpnext/docs/user/manual/en/setting-up/users-and-permissions/index.txt
@@ -1,4 +1,5 @@
 adding-users
 role-based-permissions
 user-permissions
+role-permisison-for-page-and-report
 sharing
diff --git a/erpnext/docs/user/manual/en/setting-up/users-and-permissions/role-permisison-for-page-and-report.md b/erpnext/docs/user/manual/en/setting-up/users-and-permissions/role-permisison-for-page-and-report.md
new file mode 100644
index 0000000..3a26a32
--- /dev/null
+++ b/erpnext/docs/user/manual/en/setting-up/users-and-permissions/role-permisison-for-page-and-report.md
@@ -0,0 +1,25 @@
+# Role Permission for Page and Report
+
+In ERPNext, user can make his custom user interface using Page and the custom report using Report Builder or Query Report. ERPNext has role-based-permission system where user can assign roles to the user. And the same role can be assigned to the page and report, to access them.
+
+If user has enabled the developer mode, then they can add the roles directly in the page and report record. But in that case, the permissions will also be reflected in the json file for the page / report.
+
+### For Page
+<img alt="Assign roles to the page" class="screenshot" src="{{docs_base_url}}/assets/img/users-and-permissions/roles-for-page.png">
+
+### For Report
+<img alt="Assign roles to the report" class="screenshot" src="{{docs_base_url}}/assets/img/users-and-permissions/roles-for-report.png">
+
+## Tool for custom roles assignment
+
+If developer mode is disabled, then user can assign the roles to the page and report, using "Role Permission for Page and Report" page.
+
+To access, goto Setup > Permissions > Role Permission for Page and Report
+
+<img alt="Tools to assign custom roles to the page" class="screenshot" src="{{docs_base_url}}/assets/img/users-and-permissions/role-permission-for-page-and-report.png">
+
+### Reset to defaults
+
+Using "Reset to Default" button, user can remove the custom permissions applied on a page or report. Then default permissions will be applicable on that page or report.
+
+<img alt="Reset the default roles" class="screenshot" src="{{docs_base_url}}/assets/img/users-and-permissions/reset-roles-permisison-for-page-report.png">
diff --git a/erpnext/docs/user/manual/en/stock/batch.md b/erpnext/docs/user/manual/en/stock/batch.md
index 7e2198f..73309f4 100644
--- a/erpnext/docs/user/manual/en/stock/batch.md
+++ b/erpnext/docs/user/manual/en/stock/batch.md
@@ -1,27 +1,45 @@
-Batch inventory feature in ERPNext allows you to group multiple units of an item, 
+Batch feature in ERPNext allows you to group multiple units of an item,
 and assign them a unique value/number/tag called Batch No.
 
-The practice of stocking based on batch is mainly followed in the pharmaceutical industry. 
-Medicines/drugs produced in a particular batched is assigned a unique id. 
-This helps them updating and tracking manufacturing and expiry date for all the units produced under specific batch.
+This is done based on the Item. If the Item is batched, then a Batch number must be mentioned in every stock transaction. Batch numbers can be maintained manually or automatically
 
-> Note: To set item as a batch item, "Has Batch No" field should be updated as Yes in the Item master.
+### Item Setup
 
-On every stock transaction (Purchase Receipt, Delivery Note, POS Invoice) made for batch item, 
-you should provide item's Batch No. 
+To set item as a batch item, "Has Batch No" field should be checked in the Item master.
+
+If you want automatic batch creation at the time of Purchase Receipt, you must check "Create New Batches Automatically"
+
+<img class="screenshot" alt="Item Setup for Batches" src="{{docs_base_url}}/assets/img/stock/item_setup_for_batch.png">
+
+### Creating Batches
+
+If you have not selected "Create New Batches Automatically", you will have to make Batches Manually as you go along.
 
 To create new Batch No. master for an item, go to:
 
 > Stock > Setup > Batch > New
 
-Batch master is created before creation of Purchase Receipt. 
-Hence eveytime there is Purchase Receipt or Production entry being made for a batch item, 
-you will first create its Batch No, and then select it in Purcase order or Production Entry.
+### Splitting and Moving Batches
 
-<img class="screenshot" alt="batch" src="{{docs_base_url}}/assets/img/stock/batch.png">
+When you open a batch, you will see all the quantities relating this that batch on the page.
 
-> Note: In stock transactions, Batch IDs will be filtered based on Item Code, Warehouse, 
-Batch Expiry Date (compared with Posting date of a transaction) and Actual Qty in Warehouse. 
+<img class="screenshot" alt="Batch View" src="{{docs_base_url}}/assets/img/stock/batch_view.png">
+
+To move the batch from one warehouse to another, you can click on the move button.
+
+You can also split the batch into smaller one by clicking on "Split". This will create a new Batch based on this Batch and the quantities will be split between the batches.
+
+### Transacting Items with Batches
+
+Batch master is created before creation of Purchase Receipt.
+Hence eveytime there is Purchase Receipt or Production Order being made for a batch item,
+you will first create its Batch No, and then select it in Purchase order or Production Entry.
+
+On every stock transaction (Purchase Receipt, Delivery Note, POS Invoice) made for batch item,
+you should provide item's Batch No.
+
+> Note: In stock transactions, Batch IDs will be filtered based on Item Code, Warehouse,
+Batch Expiry Date (compared with Posting date of a transaction) and Actual Qty in Warehouse.
 While searching for Batch ID  without value in Warehouse field, then Actual Qty filter won't be applied.
 
 {next}
diff --git a/erpnext/docs/user/manual/en/stock/item/purchase-details.md b/erpnext/docs/user/manual/en/stock/item/purchase-details.md
index 5749178..47983df 100644
--- a/erpnext/docs/user/manual/en/stock/item/purchase-details.md
+++ b/erpnext/docs/user/manual/en/stock/item/purchase-details.md
@@ -1,4 +1,4 @@
-# purchase details
+# Purchase Details
 
 # How Do I Track Warranty Status?
 
diff --git a/erpnext/docs/user/manual/en/using-erpnext/assignment.md b/erpnext/docs/user/manual/en/using-erpnext/assignment.md
index 72b03b7..e78a112 100644
--- a/erpnext/docs/user/manual/en/using-erpnext/assignment.md
+++ b/erpnext/docs/user/manual/en/using-erpnext/assignment.md
@@ -22,7 +22,7 @@
 
 ####ToDo List of Assignee
 
-This transaction will appear in the To-do list of the ser in “Todo” section.
+This transaction will appear in the To-do list of the user in “Todo” section.
 
 <img class="screenshot" alt="Assign" src="{{docs_base_url}}/assets/img/collaboration-tools/assign-3.png">
 
@@ -32,6 +32,6 @@
 
 <img class="screenshot" alt="Assign" src="{{docs_base_url}}/assets/img/collaboration-tools/assign-4.png">
 
-Once assignment is set as completed, Status of its ToDo record will be set as Closed.
+Once assignment is set as completed, the Status of its ToDo record will be set as Closed.
 
 {next}
diff --git a/erpnext/hooks.py b/erpnext/hooks.py
index f4b87d2..af4dd3b 100644
--- a/erpnext/hooks.py
+++ b/erpnext/hooks.py
@@ -12,7 +12,7 @@
 app_license = "GNU General Public License (v3)"
 source_link = "https://github.com/frappe/erpnext"
 
-develop_version = '8.0.0-beta'
+develop_version = '8.x.x-beta'
 
 error_report_email = "support@erpnext.com"
 
@@ -148,8 +148,8 @@
 	"User": {
 		"after_insert": "frappe.email.doctype.contact.contact.update_contact",
 		"validate": "erpnext.hr.doctype.employee.employee.validate_employee_role",
-		"on_update": "erpnext.hr.doctype.employee.employee.update_user_permissions",
-		"on_update": "frappe.geo.address_and_contact.set_default_role"
+		"on_update": ["erpnext.hr.doctype.employee.employee.update_user_permissions",
+			"erpnext.portal.utils.set_default_role"]
 	},
 	("Sales Taxes and Charges Template", 'Price List'): {
 		"on_update": "erpnext.shopping_cart.doctype.shopping_cart_settings.shopping_cart_settings.validate_cart_settings"
diff --git a/erpnext/hr/doctype/attendance/attendance.py b/erpnext/hr/doctype/attendance/attendance.py
index 72fa47d..458b2dd 100644
--- a/erpnext/hr/doctype/attendance/attendance.py
+++ b/erpnext/hr/doctype/attendance/attendance.py
@@ -35,9 +35,11 @@
 			frappe.throw(_("No leave record found for employee {0} for {1}").format(self.employee, self.attendance_date))
 
 	def validate_attendance_date(self):
+		date_of_joining = frappe.db.get_value("Employee", self.employee, "date_of_joining")
+
 		if getdate(self.attendance_date) > getdate(nowdate()):
 			frappe.throw(_("Attendance can not be marked for future dates"))
-		elif getdate(self.attendance_date) < frappe.db.get_value("Employee", self.employee, "date_of_joining"):
+		elif date_of_joining and getdate(self.attendance_date) < getdate(date_of_joining):
 			frappe.throw(_("Attendance date can not be less than employee's joining date"))
 
 	def validate_employee(self):
diff --git a/erpnext/hr/doctype/employee/employee.json b/erpnext/hr/doctype/employee/employee.json
index 35a2807..c53e497 100644
--- a/erpnext/hr/doctype/employee/employee.json
+++ b/erpnext/hr/doctype/employee/employee.json
@@ -417,7 +417,7 @@
    "no_copy": 0, 
    "oldfieldname": "gender", 
    "oldfieldtype": "Select", 
-   "options": "\nMale\nFemale", 
+   "options": "\nMale\nFemale\nOther", 
    "permlevel": 0, 
    "print_hide": 0, 
    "print_hide_if_no_value": 0, 
@@ -2431,4 +2431,4 @@
  "title_field": "employee_name", 
  "track_changes": 1, 
  "track_seen": 0
-}
\ No newline at end of file
+}
diff --git a/erpnext/hr/doctype/employee/employee.py b/erpnext/hr/doctype/employee/employee.py
index 13aa524..a078ef2 100755
--- a/erpnext/hr/doctype/employee/employee.py
+++ b/erpnext/hr/doctype/employee/employee.py
@@ -157,7 +157,7 @@
 		delete_events(self.doctype, self.name)
 
 	def validate_prefered_email(self):
-		if not self.get(scrub(self.prefered_contact_email)):
+		if self.prefered_contact_email and not self.get(scrub(self.prefered_contact_email)):
 			frappe.msgprint(_("Please enter " + self.prefered_contact_email))
 
 
diff --git a/erpnext/hr/doctype/employee_attendance_tool/employee_attendance_tool.js b/erpnext/hr/doctype/employee_attendance_tool/employee_attendance_tool.js
index de8e17c..c0c0ef0 100644
--- a/erpnext/hr/doctype/employee_attendance_tool/employee_attendance_tool.js
+++ b/erpnext/hr/doctype/employee_attendance_tool/employee_attendance_tool.js
@@ -4,6 +4,7 @@
 	},
 	
 	onload: function(frm) {
+		frm.doc.department = frm.doc.branch = frm.doc.company = "All";
 		frm.set_value("date", get_today());
 		erpnext.employee_attendance_tool.load_employees(frm);
 	},
diff --git a/erpnext/hr/doctype/employee_attendance_tool/employee_attendance_tool.py b/erpnext/hr/doctype/employee_attendance_tool/employee_attendance_tool.py
index 7438737..6ddb722 100644
--- a/erpnext/hr/doctype/employee_attendance_tool/employee_attendance_tool.py
+++ b/erpnext/hr/doctype/employee_attendance_tool/employee_attendance_tool.py
@@ -13,11 +13,18 @@
 
 
 @frappe.whitelist()
-def get_employees(date, department=None, branch=None, company=None):
+def get_employees(date, department = None, branch = None, company = None):
 	attendance_not_marked = []
 	attendance_marked = []
-	employee_list = frappe.get_list("Employee", fields=["employee", "employee_name"], filters={
-		"status": "Active", "department": department, "branch": branch, "company": company}, order_by="employee_name")
+	filters = {"status": "Active"}
+	if department != "All":
+		filters["department"] = department
+	if branch != "All":
+		filters["branch"] = branch
+	if company != "All":
+		filters["company"] = company
+
+	employee_list = frappe.get_list("Employee", fields=["employee", "employee_name"], filters=filters, order_by="employee_name")
 	marked_employee = {}
 	for emp in frappe.get_list("Attendance", fields=["employee", "status"],
 							   filters={"attendance_date": date}):
diff --git a/erpnext/hr/doctype/employee_loan/employee_loan.js b/erpnext/hr/doctype/employee_loan/employee_loan.js
index 2f87acf..71b6356 100644
--- a/erpnext/hr/doctype/employee_loan/employee_loan.js
+++ b/erpnext/hr/doctype/employee_loan/employee_loan.js
@@ -79,7 +79,7 @@
 	},
 
 	employee_loan_application: function(frm) {
-		return frm.call({
+		return frappe.call({
 			method: "erpnext.hr.doctype.employee_loan.employee_loan.get_employee_loan_application",
 			args: {
 				"employee_loan_application": frm.doc.employee_loan_application
diff --git a/erpnext/hr/doctype/employee_loan/employee_loan.json b/erpnext/hr/doctype/employee_loan/employee_loan.json
index 7606e92..35c735a 100644
--- a/erpnext/hr/doctype/employee_loan/employee_loan.json
+++ b/erpnext/hr/doctype/employee_loan/employee_loan.json
@@ -14,6 +14,7 @@
  "engine": "InnoDB", 
  "fields": [
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -44,6 +45,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -74,6 +76,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -104,6 +107,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -134,6 +138,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, 
@@ -222,10 +229,12 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
+   "default": "Sanctioned", 
    "fieldname": "status", 
    "fieldtype": "Select", 
    "hidden": 0, 
@@ -237,7 +246,7 @@
    "in_standard_filter": 0, 
    "label": "Status", 
    "length": 0, 
-   "no_copy": 0, 
+   "no_copy": 1, 
    "options": "Sanctioned\nPartially Disbursed\nFully Disbursed\nRepaid/Closed", 
    "permlevel": 0, 
    "precision": "", 
@@ -252,6 +261,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -281,6 +291,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -310,6 +321,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -340,6 +352,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -371,6 +384,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -400,6 +414,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -428,6 +443,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -459,6 +475,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -490,6 +507,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -522,6 +540,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 1, 
@@ -551,6 +570,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, 
@@ -639,6 +661,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -669,6 +692,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -699,6 +723,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -728,6 +753,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -758,6 +784,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -787,6 +814,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -818,6 +846,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -846,6 +875,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -877,6 +907,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -916,7 +947,7 @@
  "issingle": 0, 
  "istable": 0, 
  "max_attachments": 0, 
- "modified": "2017-03-30 12:59:40.650035", 
+ "modified": "2017-05-02 13:52:30.884154", 
  "modified_by": "Administrator", 
  "module": "HR", 
  "name": "Employee Loan", 
diff --git a/erpnext/hr/doctype/employee_loan/employee_loan.py b/erpnext/hr/doctype/employee_loan/employee_loan.py
index 7e16ec1..dadd769 100644
--- a/erpnext/hr/doctype/employee_loan/employee_loan.py
+++ b/erpnext/hr/doctype/employee_loan/employee_loan.py
@@ -132,7 +132,7 @@
 def get_employee_loan_application(employee_loan_application):
 	employee_loan = frappe.get_doc("Employee Loan Application", employee_loan_application)
 	if employee_loan:
-		return employee_loan
+		return employee_loan.as_dict()
 
 @frappe.whitelist()
 def make_jv_entry(employee_loan, company, employee_loan_account, employee, loan_amount, payment_account):
diff --git a/erpnext/hr/doctype/employee_loan_application/employee_loan_application.py b/erpnext/hr/doctype/employee_loan_application/employee_loan_application.py
index 74a65e2..0c29e0d 100644
--- a/erpnext/hr/doctype/employee_loan_application/employee_loan_application.py
+++ b/erpnext/hr/doctype/employee_loan_application/employee_loan_application.py
@@ -5,7 +5,7 @@
 from __future__ import unicode_literals
 import frappe, math
 from frappe import _
-from frappe.utils import flt
+from frappe.utils import flt, rounded
 from frappe.model.mapper import get_mapped_doc
 from frappe.model.document import Document
 
@@ -28,12 +28,28 @@
 
 		if self.repayment_method == "Repay Fixed Amount per Period":
 			monthly_interest_rate = flt(self.rate_of_interest) / (12 *100)
-			self.repayment_periods = math.ceil((math.log(self.repayment_amount) - math.log(self.repayment_amount - \
-									(self.loan_amount*monthly_interest_rate)))/(math.log(1+monthly_interest_rate)))
+			if monthly_interest_rate:
+				self.repayment_periods = math.ceil((math.log(self.repayment_amount) - 
+					math.log(self.repayment_amount - (self.loan_amount*monthly_interest_rate))) /
+					(math.log(1 + monthly_interest_rate)))
+			else:
+				self.repayment_periods = self.loan_amount / self.repayment_amount
 
-		self.total_payable_amount = self.repayment_amount * self.repayment_periods
-		self.total_payable_interest = self.total_payable_amount - self.loan_amount
+		self.calculate_payable_amount()
+		
+	def calculate_payable_amount(self):
+		balance_amount = self.loan_amount
+		self.total_payable_amount = 0
+		self.total_payable_interest = 0
 
+		while(balance_amount > 0):
+			interest_amount = rounded(balance_amount * flt(self.rate_of_interest) / (12*100))
+			balance_amount = rounded(balance_amount + interest_amount - self.repayment_amount)
+
+			self.total_payable_interest += interest_amount
+			
+		self.total_payable_amount = self.loan_amount + self.total_payable_interest
+		
 @frappe.whitelist()
 def make_employee_loan(source_name, target_doc = None):
 	doclist = get_mapped_doc("Employee Loan Application", source_name, {
diff --git a/erpnext/hr/doctype/employee_loan_application/test_employee_loan_application.py b/erpnext/hr/doctype/employee_loan_application/test_employee_loan_application.py
index 1d157d6..789b5d4 100644
--- a/erpnext/hr/doctype/employee_loan_application/test_employee_loan_application.py
+++ b/erpnext/hr/doctype/employee_loan_application/test_employee_loan_application.py
@@ -39,13 +39,13 @@
 	def test_loan_totals(self):
 		loan_application = frappe.get_doc("Employee Loan Application", {"employee":self.employee})
 		self.assertEquals(loan_application.repayment_amount, 11445)
-		self.assertEquals(loan_application.total_payable_interest, 24680)
-		self.assertEquals(loan_application.total_payable_amount, 274680)
+		self.assertEquals(loan_application.total_payable_interest, 24657)
+		self.assertEquals(loan_application.total_payable_amount, 274657)
 
 		loan_application.repayment_method = "Repay Fixed Amount per Period"
 		loan_application.repayment_amount = 15000
 		loan_application.save()
 
 		self.assertEquals(loan_application.repayment_periods, 18)
-		self.assertEquals(loan_application.total_payable_interest, 20000)
-		self.assertEquals(loan_application.total_payable_amount, 270000)
\ No newline at end of file
+		self.assertEquals(loan_application.total_payable_interest, 18506)
+		self.assertEquals(loan_application.total_payable_amount, 268506)
\ No newline at end of file
diff --git a/erpnext/hr/doctype/expense_claim/expense_claim.js b/erpnext/hr/doctype/expense_claim/expense_claim.js
index 4961208..95877cf 100644
--- a/erpnext/hr/doctype/expense_claim/expense_claim.js
+++ b/erpnext/hr/doctype/expense_claim/expense_claim.js
@@ -18,14 +18,20 @@
 		});
 	},
 	
-	expense_type: function(frm, cdt, cdn) {
+	expense_type: function(doc, cdt, cdn) {
 		var d = locals[cdt][cdn];
+		if(!doc.company) {
+			d.expense_type = "";
+			frappe.msgprint(__("Please set the Company"));
+			this.frm.refresh_fields()
+			return;
+		}
 
 		return frappe.call({
 			method: "erpnext.hr.doctype.expense_claim.expense_claim.get_expense_claim_account",
 			args: {
 				"expense_claim_type": d.expense_type,
-				"company": frm.company
+				"company": doc.company
 			},
 			callback: function(r) {
 				if (r.message) {
diff --git a/erpnext/hr/doctype/expense_claim/expense_claim.json b/erpnext/hr/doctype/expense_claim/expense_claim.json
index 5b41154..6f74388 100644
--- a/erpnext/hr/doctype/expense_claim/expense_claim.json
+++ b/erpnext/hr/doctype/expense_claim/expense_claim.json
@@ -934,7 +934,7 @@
  "istable": 0, 
  "max_attachments": 0, 
  "menu_index": 0, 
- "modified": "2017-03-08 06:28:46.142302", 
+ "modified": "2017-04-10 12:15:20.363859", 
  "modified_by": "Administrator", 
  "module": "HR", 
  "name": "Expense Claim", 
diff --git a/erpnext/hr/doctype/process_payroll/process_payroll.py b/erpnext/hr/doctype/process_payroll/process_payroll.py
index 915985c..7ca94b8 100644
--- a/erpnext/hr/doctype/process_payroll/process_payroll.py
+++ b/erpnext/hr/doctype/process_payroll/process_payroll.py
@@ -112,14 +112,14 @@
 
 
 	def create_log(self, ss_list):
-		if not ss_list:
+		if not ss_list or len(ss_list) < 1: 
 			log = "<p>" + _("No employee for the above selected criteria OR salary slip already created") + "</p>"
 		else:
 			log = frappe.render_template("templates/includes/salary_slip_log.html",
 						dict(ss_list=ss_list,
 							keys=sorted(ss_list[0].keys()),
 							title=_('Created Salary Slips')))
-			return log
+		return log
 
 	def get_sal_slip_list(self, ss_status, as_dict=False):
 		"""
diff --git a/erpnext/hr/doctype/salary_component/salary_component.py b/erpnext/hr/doctype/salary_component/salary_component.py
index c02d952..35d274c 100644
--- a/erpnext/hr/doctype/salary_component/salary_component.py
+++ b/erpnext/hr/doctype/salary_component/salary_component.py
@@ -5,7 +5,7 @@
 from __future__ import unicode_literals
 import frappe
 from frappe.model.document import Document
-from frappe import _
+from frappe.model.naming import append_number_if_name_exists
 
 class SalaryComponent(Document):
 	def validate(self):
@@ -13,12 +13,10 @@
 
 	def validate_abbr(self):
 		if not self.salary_component_abbr:
-			self.salary_component_abbr = ''.join([c[0] for c in self.salary_component.split()]).upper()
+			self.salary_component_abbr = ''.join([c[0] for c in
+				self.salary_component.split()]).upper()
 
 		self.salary_component_abbr = self.salary_component_abbr.strip()
 
-		if self.get('__islocal') and len(self.salary_component_abbr) > 5:
-			frappe.throw(_("Abbreviation cannot have more than 5 characters"))
-
-		if frappe.db.sql("select salary_component_abbr from `tabSalary Component` where name!=%s and salary_component_abbr=%s", (self.name, self.salary_component_abbr)):
-			frappe.throw(_("Abbreviation {0} already used for another salary component").format(self.salary_component_abbr))
\ No newline at end of file
+		self.salary_component_abbr = append_number_if_name_exists('Salary Component',
+			self.salary_component_abbr, 'salary_component_abbr', separator='_')
\ No newline at end of file
diff --git a/erpnext/hr/doctype/salary_detail/salary_detail.json b/erpnext/hr/doctype/salary_detail/salary_detail.json
index 99c705a..d131295 100644
--- a/erpnext/hr/doctype/salary_detail/salary_detail.json
+++ b/erpnext/hr/doctype/salary_detail/salary_detail.json
@@ -1,5 +1,6 @@
 {
  "allow_copy": 0, 
+ "allow_guest_to_view": 0, 
  "allow_import": 0, 
  "allow_rename": 0, 
  "beta": 0, 
@@ -21,7 +22,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": "Component", 
    "length": 0, 
    "no_copy": 0, 
@@ -31,6 +34,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, 
@@ -49,7 +53,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": "Abbr", 
    "length": 0, 
    "no_copy": 0, 
@@ -59,6 +65,65 @@
    "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_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_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "description": "If selected, the value specified or calculated in this component will not contribute to the earnings or deductions. However, it's value can be referenced by other components that can be added or deducted. ", 
+   "fieldname": "statistical_component", 
+   "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": "Statistical Component", 
+   "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, 
@@ -76,7 +141,9 @@
    "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, 
@@ -84,6 +151,7 @@
    "print_hide": 0, 
    "print_hide_if_no_value": 0, 
    "read_only": 0, 
+   "remember_last_selected_value": 0, 
    "report_hide": 0, 
    "reqd": 0, 
    "search_index": 0, 
@@ -102,7 +170,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": "Condition", 
    "length": 0, 
    "no_copy": 0, 
@@ -111,6 +181,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, 
@@ -130,7 +201,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": "Amount based on formula", 
    "length": 0, 
    "no_copy": 0, 
@@ -140,6 +213,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, 
@@ -160,7 +234,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": "Formula", 
    "length": 0, 
    "no_copy": 0, 
@@ -169,6 +245,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, 
@@ -187,7 +264,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": "Amount", 
    "length": 0, 
    "no_copy": 0, 
@@ -197,6 +276,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, 
@@ -215,7 +295,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": "Depends on Leave Without Pay", 
    "length": 0, 
    "no_copy": 0, 
@@ -224,6 +306,7 @@
    "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, 
@@ -242,7 +325,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": "Default Amount", 
    "length": 0, 
    "no_copy": 0, 
@@ -252,6 +337,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, 
@@ -270,7 +356,9 @@
    "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, 
@@ -278,6 +366,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, 
@@ -296,7 +385,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": "Condition and Formula Help", 
    "length": 0, 
    "no_copy": 0, 
@@ -306,6 +397,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, 
@@ -313,18 +405,18 @@
    "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-20 05:29:26.373992", 
- "modified_by": "Administrator", 
+ "modified": "2017-04-13 00:47:33.980646", 
+ "modified_by": "chude.osiegbu@manqala.com", 
  "module": "HR", 
  "name": "Salary Detail", 
  "name_case": "", 
@@ -333,7 +425,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/hr/doctype/salary_slip/salary_slip.js b/erpnext/hr/doctype/salary_slip/salary_slip.js
index bf86aba..09c5337 100644
--- a/erpnext/hr/doctype/salary_slip/salary_slip.js
+++ b/erpnext/hr/doctype/salary_slip/salary_slip.js
@@ -39,7 +39,7 @@
 	refresh: function(frm) {
 		frm.trigger("toggle_fields")
 		frm.trigger("toggle_reqd_fields")
-		salary_detail_fields = ['formula', 'abbr']
+		salary_detail_fields = ['formula', 'abbr', 'statistical_component']
 		cur_frm.fields_dict['earnings'].grid.set_column_disp(salary_detail_fields,false);
 		cur_frm.fields_dict['deductions'].grid.set_column_disp(salary_detail_fields,false);
 	},	
@@ -138,7 +138,6 @@
 			refresh_field('amount', tbl[i].name, 'earnings');
 		}
 		total_earn += flt(tbl[i].amount);
-		
 	}
 	doc.gross_pay = total_earn;
 	refresh_many(['amount','gross_pay']);
diff --git a/erpnext/hr/doctype/salary_slip/salary_slip.py b/erpnext/hr/doctype/salary_slip/salary_slip.py
index 34b729f..e18fc27 100644
--- a/erpnext/hr/doctype/salary_slip/salary_slip.py
+++ b/erpnext/hr/doctype/salary_slip/salary_slip.py
@@ -2,13 +2,12 @@
 # License: GNU General Public License v3. See license.txt
 
 from __future__ import unicode_literals
-import frappe
+import frappe, erpnext
 
 from frappe.utils import add_days, cint, cstr, flt, getdate, rounded, date_diff, money_in_words
 from frappe.model.naming import make_autoname
 
 from frappe import msgprint, _
-from erpnext.setup.utils import get_company_currency
 from erpnext.hr.doctype.process_payroll.process_payroll import get_start_end_dates
 from erpnext.hr.doctype.employee.employee import get_holiday_list_for_employee
 from erpnext.utilities.transaction_base import TransactionBase
@@ -33,7 +32,7 @@
 		# if self.salary_slip_based_on_timesheet or not self.net_pay:
 		self.calculate_net_pay()
 
-		company_currency = get_company_currency(self.company)
+		company_currency = erpnext.get_company_currency(self.company)
 		self.total_in_words = money_in_words(self.rounded_total, company_currency)
 
 		if frappe.db.get_single_value("HR Settings", "max_working_hours_against_timesheet"):
@@ -55,7 +54,7 @@
 		for key in ('earnings', 'deductions'):
 			for struct_row in self._salary_structure_doc.get(key):
 				amount = self.eval_condition_and_formula(struct_row, data)
-				if amount:
+				if amount and struct_row.statistical_component == 0:
 					self.update_component_row(struct_row, amount, key)
 
 	def update_component_row(self, struct_row, amount, key):
@@ -77,30 +76,31 @@
 	def eval_condition_and_formula(self, d, data):
 		try:
 			if d.condition:
-				if not eval(d.condition, None, data):
+				if not frappe.safe_eval(d.condition, None, data):
 					return None
 			amount = d.amount
 			if d.amount_based_on_formula:
 				if d.formula:
-					amount = eval(d.formula, None, data)
+					amount = frappe.safe_eval(d.formula, None, data)
 			if amount:
 				data[d.abbr] = amount
 
 			return amount
 
 		except NameError as err:
-		    frappe.throw(_("Name error: {0}".format(err)))
+			frappe.throw(_("Name error: {0}".format(err)))
 		except SyntaxError as err:
-		    frappe.throw(_("Syntax error in formula or condition: {0}".format(err)))
+			frappe.throw(_("Syntax error in formula or condition: {0}".format(err)))
 		except Exception, e:
-		    frappe.throw(_("Error in formula or condition: {0}".format(e)))
-		    raise
+			frappe.throw(_("Error in formula or condition: {0}".format(e)))
+			raise
 
 	def get_data_for_eval(self):
 		'''Returns data for evaluating formula'''
 		data = frappe._dict()
 
-		data.update(frappe.get_doc("Salary Structure Employee", {"employee": self.employee}).as_dict())
+		data.update(frappe.get_doc("Salary Structure Employee",
+			{"employee": self.employee, "parent": self.salary_structure}).as_dict())
 
 		data.update(frappe.get_doc("Employee", self.employee).as_dict())
 		data.update(self.as_dict())
@@ -322,11 +322,15 @@
 	def sum_components(self, component_type, total_field):
 		joining_date, relieving_date = frappe.db.get_value("Employee", self.employee,
 			["date_of_joining", "relieving_date"])
+		
 		if not relieving_date:
 			relieving_date = getdate(self.end_date)
 
+		if not joining_date:
+			frappe.throw(_("Please set the Date Of Joining for employee {0}").format(frappe.bold(self.employee_name)))
+
 		for d in self.get(component_type):
-			if ((cint(d.depends_on_lwp) == 1 and not self.salary_slip_based_on_timesheet) or\
+			if self.salary_structure and ((cint(d.depends_on_lwp) == 1 and not self.salary_slip_based_on_timesheet) or\
 			getdate(self.start_date) < joining_date or getdate(self.end_date) > relieving_date):
 
 				d.amount = rounded((flt(d.default_amount) * flt(self.payment_days)
@@ -348,7 +352,7 @@
 
 		self.sum_components('earnings', 'gross_pay')
 		self.sum_components('deductions', 'total_deduction')
-		
+
 		self.set_loan_repayment()
 
 		self.net_pay = flt(self.gross_pay) - (flt(self.total_deduction) + flt(self.total_loan_repayment))
@@ -356,11 +360,11 @@
 			self.precision("net_pay") if disable_rounded_total else 0)
 
 	def set_loan_repayment(self):
-		employee_loan = frappe.db.sql("""select sum(principal_amount) as principal_amount, sum(interest_amount) as interest_amount, 
+		employee_loan = frappe.db.sql("""select sum(principal_amount) as principal_amount, sum(interest_amount) as interest_amount,
 						sum(total_payment) as total_loan_repayment from `tabRepayment Schedule`
 						where payment_date between %s and %s and parent in (select name from `tabEmployee Loan`
 						where employee = %s and repay_from_salary = 1 and docstatus = 1)""",
-						(self.start_date, self.end_date, self.employee), as_dict=True)				
+						(self.start_date, self.end_date, self.employee), as_dict=True)
 		if employee_loan:
 			self.principal_amount = employee_loan[0].principal_amount
 			self.interest_amount = employee_loan[0].interest_amount
diff --git a/erpnext/hr/doctype/salary_structure/salary_structure.py b/erpnext/hr/doctype/salary_structure/salary_structure.py
index 12f8335..dc1c04d 100644
--- a/erpnext/hr/doctype/salary_structure/salary_structure.py
+++ b/erpnext/hr/doctype/salary_structure/salary_structure.py
@@ -33,7 +33,8 @@
 		for employee in self.get('employees'):
 			joining_date, relieving_date = frappe.db.get_value("Employee", employee.employee,
 				["date_of_joining", "relieving_date"])
-			if employee.from_date and getdate(employee.from_date) < joining_date:
+
+			if employee.from_date and joining_date and getdate(employee.from_date) < joining_date:
 				frappe.throw(_("From Date {0} for Employee {1} cannot be before employee's joining Date {2}")
 					    .format(employee.from_date, employee.employee, joining_date))
 
diff --git a/erpnext/hr/doctype/vehicle_log/vehicle_log.js b/erpnext/hr/doctype/vehicle_log/vehicle_log.js
index 1ccf347..818a595 100644
--- a/erpnext/hr/doctype/vehicle_log/vehicle_log.js
+++ b/erpnext/hr/doctype/vehicle_log/vehicle_log.js
@@ -6,7 +6,7 @@
 		vehicle_log=frappe.model.get_doc(cdt,cdn);
 		if (vehicle_log.license_plate) {
 			frappe.call({
-				method: "erpnext.fleet_management.doctype.vehicle_log.vehicle_log.get_make_model",
+				method: "erpnext.hr.doctype.vehicle_log.vehicle_log.get_make_model",
 				args: {
 					license_plate: vehicle_log.license_plate
 				},
@@ -16,10 +16,18 @@
 				}
 			})
 		}
+
+		if(frm.doc.docstatus == 1) {
+			frm.add_custom_button(__('Expense Claim'), function() {
+				frm.events.expense_claim(frm)
+			}, __("Make"));
+			frm.page.set_inner_btn_group_as_primary(__("Make"));
+		}
 	},
+
 	expense_claim: function(frm){
 			frappe.call({
-				method: "erpnext.fleet_management.doctype.vehicle_log.vehicle_log.make_expense_claim",
+				method: "erpnext.hr.doctype.vehicle_log.vehicle_log.make_expense_claim",
 				args:{
 					docname: frm.doc.name
 				},
diff --git a/erpnext/hr/doctype/vehicle_log/vehicle_log.json b/erpnext/hr/doctype/vehicle_log/vehicle_log.json
index 3610da4..fde34d7 100644
--- a/erpnext/hr/doctype/vehicle_log/vehicle_log.json
+++ b/erpnext/hr/doctype/vehicle_log/vehicle_log.json
@@ -1,5 +1,6 @@
 {
  "allow_copy": 0, 
+ "allow_guest_to_view": 0, 
  "allow_import": 0, 
  "allow_rename": 0, 
  "autoname": "naming_series:", 
@@ -12,6 +13,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, 
@@ -71,6 +74,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -101,6 +105,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -131,6 +136,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -159,6 +165,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -187,6 +194,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -216,6 +224,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -245,6 +254,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -274,6 +284,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -303,6 +314,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -332,6 +344,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 1, 
@@ -361,6 +374,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -390,6 +404,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -419,6 +434,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -447,6 +463,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -477,6 +494,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -506,6 +524,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 1, 
@@ -519,7 +538,7 @@
    "in_global_search": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
-   "label": "Service_Details", 
+   "label": "Service Details", 
    "length": 0, 
    "no_copy": 0, 
    "permlevel": 0, 
@@ -535,6 +554,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -565,64 +585,7 @@
    "unique": 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_on_submit": 1, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "depends_on": "eval:doc.docstatus==1", 
-   "fieldname": "expense_claim", 
-   "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 Expense Claim", 
-   "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, 
@@ -652,17 +615,17 @@
    "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": 1, 
  "issingle": 0, 
  "istable": 0, 
  "max_attachments": 0, 
- "modified": "2017-02-17 16:53:17.975663", 
+ "modified": "2017-05-15 13:17:59.575317", 
  "modified_by": "Administrator", 
  "module": "HR", 
  "name": "Vehicle Log", 
diff --git a/erpnext/hr/report/salary_register/salary_register.html b/erpnext/hr/report/salary_register/salary_register.html
index 2a9cd3e..d7bf6a7 100644
--- a/erpnext/hr/report/salary_register/salary_register.html
+++ b/erpnext/hr/report/salary_register/salary_register.html
@@ -2,7 +2,7 @@
 	{%= frappe.boot.letter_heads[filters.letter_head || frappe.defaults.get_default("letter_head")] %}
 </div>
 <h2 class="text-center">{%= __(report.report_name) %}</h2>
-<h5 class="text-center">From {%= filters.date_range[0] %} to {%= filters.date_range[1] %}</h5>
+<h5 class="text-center">{{ __("From") }} {%= filters.date_range[0] %} {{ __("to") }} {%= filters.date_range[1] %}</h5>
 <hr>
 <table class="table table-bordered">
 	<thead>
@@ -34,4 +34,4 @@
 		{% } %}
 	</tbody>
 </table>
-<p class="text-right text-muted">Printed On {%= dateutil.str_to_user(dateutil.get_datetime_as_string()) %}</p>
+<p class="text-right text-muted">{{ __("Printed On") }} {%= dateutil.str_to_user(dateutil.get_datetime_as_string()) %}</p>
diff --git a/erpnext/hr/report/vehicle_expenses/vehicle_expenses.js b/erpnext/hr/report/vehicle_expenses/vehicle_expenses.js
index 8a05c81..486d259 100644
--- a/erpnext/hr/report/vehicle_expenses/vehicle_expenses.js
+++ b/erpnext/hr/report/vehicle_expenses/vehicle_expenses.js
@@ -22,18 +22,6 @@
 						query_report.trigger_refresh();
 					});
 				}
-			},
-			{
-				"fieldname": "from_date",
-				"label": __("From Date"),
-				"fieldtype": "Date",
-				"default": frappe.defaults.get_user_default("year_start_date"),
-			},
-			{
-				"fieldname": "to_date",
-				"label": __("To Date"),
-				"fieldtype": "Date",
-				"default": frappe.defaults.get_user_default("year_end_date"),
 			}
 		]
 	}
diff --git a/erpnext/hr/report/vehicle_expenses/vehicle_expenses.py b/erpnext/hr/report/vehicle_expenses/vehicle_expenses.py
index a03b7f3..63e5f3c 100644
--- a/erpnext/hr/report/vehicle_expenses/vehicle_expenses.py
+++ b/erpnext/hr/report/vehicle_expenses/vehicle_expenses.py
@@ -3,41 +3,41 @@
 
 from __future__ import unicode_literals
 import frappe
+import erpnext
 from frappe import _
 from frappe.utils import flt,cstr
 from erpnext.accounts.report.financial_statements import get_period_list
 
 def execute(filters=None):
-	period_list = get_period_list(2016, 2016,"Monthly")
-	for period in period_list:
-		pass
 	columns, data = [], []
-	columns=get_columns()
-	data=get_log_data(filters)
-	chart=get_chart_data(data,period_list)
+	if filters.get('fiscal_year'):
+		company = erpnext.get_default_company()
+		period_list = get_period_list(filters.get('fiscal_year'), filters.get('fiscal_year'),"Monthly", company)
+		columns=get_columns()
+		data=get_log_data(filters)
+		chart=get_chart_data(data,period_list)
 	return columns, data, None, chart
-	
+
 def get_columns():
 	columns = [_("License") + ":Link/Vehicle:100", _("Make") + ":data:50",
-				_("Model") + ":data:50", _("Location") + ":data:100",
-				_("Log") + ":Link/Vehicle Log:100", _("Odometer") + ":Int:80",
-				_("Date") + ":Date:100", _("Fuel Qty") + ":Float:80",
-				_("Fuel Price") + ":Float:100",_("Service Expense") + ":Float:100"
+		_("Model") + ":data:50", _("Location") + ":data:100",
+		_("Log") + ":Link/Vehicle Log:100", _("Odometer") + ":Int:80",
+		_("Date") + ":Date:100", _("Fuel Qty") + ":Float:80",
+		_("Fuel Price") + ":Float:100",_("Service Expense") + ":Float:100"
 	]
 	return columns
 
 def get_log_data(filters):
-	conditions=""
-	if filters.from_date:
-		conditions += " and date >= %(from_date)s"
-	if filters.to_date:
-		conditions += " and date <= %(to_date)s"
-	data = frappe.db.sql("""select vhcl.license_plate as "License",vhcl.make as "Make",vhcl.model as "Model",
-							vhcl.location as "Location",log.name as "Log",log.odometer as "Odometer",log.date as "Date",
-							log.fuel_qty as "Fuel Qty",log.price as "Fuel Price"
-							from `tabVehicle` vhcl,`tabVehicle Log` log
-							where vhcl.license_plate = log.license_plate and log.docstatus = 1 %s
-							order by date""" % (conditions,),filters, as_dict=1)
+	fy = frappe.db.get_value('Fiscal Year', filters.get('fiscal_year'), ['year_start_date', 'year_end_date'], as_dict=True)
+	data = frappe.db.sql("""select 
+			vhcl.license_plate as "License", vhcl.make as "Make", vhcl.model as "Model",
+			vhcl.location as "Location", log.name as "Log", log.odometer as "Odometer", 
+			log.date as "Date", log.fuel_qty as "Fuel Qty", log.price as "Fuel Price"
+		from 
+			`tabVehicle` vhcl,`tabVehicle Log` log
+		where 
+			vhcl.license_plate = log.license_plate and log.docstatus = 1 and date between %s and %s
+		order by date""" ,(fy.year_start_date, fy.year_end_date), as_dict=1)
 	dl=list(data)
 	for row in dl:
 		row["Service Expense"]= get_service_expense(row["Log"])
@@ -45,8 +45,8 @@
 	
 def get_service_expense(logname):
 	expense_amount = frappe.db.sql("""select sum(expense_amount) 
-										from `tabVehicle Log` log,`tabVehicle Service` ser 
-										where ser.parent=log.name and log.name=%s""",logname)
+		from `tabVehicle Log` log,`tabVehicle Service` ser 
+		where ser.parent=log.name and log.name=%s""",logname)
 	return flt(expense_amount[0][0]) if expense_amount else 0
 	
 def get_chart_data(data,period_list):
diff --git a/erpnext/maintenance/doctype/maintenance_schedule/maintenance_schedule.js b/erpnext/maintenance/doctype/maintenance_schedule/maintenance_schedule.js
index 9639e7f..da7d133 100644
--- a/erpnext/maintenance/doctype/maintenance_schedule/maintenance_schedule.js
+++ b/erpnext/maintenance/doctype/maintenance_schedule/maintenance_schedule.js
@@ -33,10 +33,13 @@
 					erpnext.utils.map_current_doc({
 						method: "erpnext.selling.doctype.sales_order.sales_order.make_maintenance_schedule",
 						source_doctype: "Sales Order",
+						target: me.frm,
+						setters: {
+							customer: me.frm.doc.customer || undefined,
+							order_type: me.frm.doc.order_type,
+						},
 						get_query_filters: {
 							docstatus: 1,
-							order_type: me.frm.doc.order_type,
-							customer: me.frm.doc.customer || undefined,
 							company: me.frm.doc.company
 						}
 					});
diff --git a/erpnext/maintenance/doctype/maintenance_schedule/maintenance_schedule.py b/erpnext/maintenance/doctype/maintenance_schedule/maintenance_schedule.py
index 5f82967..36e375d 100644
--- a/erpnext/maintenance/doctype/maintenance_schedule/maintenance_schedule.py
+++ b/erpnext/maintenance/doctype/maintenance_schedule/maintenance_schedule.py
@@ -163,7 +163,7 @@
 					`tabMaintenance Schedule Item` msi where msi.parent=ms.name and
 					msi.sales_order=%s and ms.docstatus=1""", d.sales_order)
 				if chk:
-					throw(_("Maintenance Schedule {0} exists against {0}").format(chk[0][0], d.sales_order))
+					throw(_("Maintenance Schedule {0} exists against {1}").format(chk[0][0], d.sales_order))
 
 	def validate(self):
 		self.validate_maintenance_detail()
diff --git a/erpnext/maintenance/doctype/maintenance_visit/maintenance_visit.js b/erpnext/maintenance/doctype/maintenance_visit/maintenance_visit.js
index 62cdf86..e1f501b 100644
--- a/erpnext/maintenance/doctype/maintenance_visit/maintenance_visit.js
+++ b/erpnext/maintenance/doctype/maintenance_visit/maintenance_visit.js
@@ -27,41 +27,53 @@
 	refresh: function() {
 		frappe.dynamic_link = {doc: this.frm.doc, fieldname: 'customer', doctype: 'Customer'}
 
+		var me = this;
+
 		if (this.frm.doc.docstatus===0) {
-			cur_frm.add_custom_button(__('Maintenance Schedule'),
+			this.frm.add_custom_button(__('Maintenance Schedule'),
 				function() {
 					erpnext.utils.map_current_doc({
 						method: "erpnext.maintenance.doctype.maintenance_schedule.maintenance_schedule.make_maintenance_visit",
 						source_doctype: "Maintenance Schedule",
+						target: me.frm,
+						setters: {
+							customer: me.frm.doc.customer || undefined,
+						},
 						get_query_filters: {
 							docstatus: 1,
-							customer: cur_frm.doc.customer || undefined,
-							company: cur_frm.doc.company
+							company: me.frm.doc.company
 						}
 					})
 				}, __("Get items from"));
-			cur_frm.add_custom_button(__('Warranty Claim'),
+			this.frm.add_custom_button(__('Warranty Claim'),
 				function() {
 					erpnext.utils.map_current_doc({
 						method: "erpnext.support.doctype.warranty_claim.warranty_claim.make_maintenance_visit",
 						source_doctype: "Warranty Claim",
+						target: me.frm,
+						date_field: "complaint_date",
+						setters: {
+							customer: me.frm.doc.customer || undefined,
+						},
 						get_query_filters: {
 							status: ["in", "Open, Work in Progress"],
-							customer: cur_frm.doc.customer || undefined,
-							company: cur_frm.doc.company
+							company: me.frm.doc.company
 						}
 					})
 				}, __("Get items from"));
-			cur_frm.add_custom_button(__('Sales Order'),
+			this.frm.add_custom_button(__('Sales Order'),
 				function() {
 					erpnext.utils.map_current_doc({
 						method: "erpnext.selling.doctype.sales_order.sales_order.make_maintenance_visit",
 						source_doctype: "Sales Order",
+						target: me.frm,
+						setters: {
+							customer: me.frm.doc.customer || undefined,
+						},
 						get_query_filters: {
 							docstatus: 1,
-							order_type: cur_frm.doc.order_type,
-							customer: cur_frm.doc.customer || undefined,
-							company: cur_frm.doc.company
+							company: me.frm.doc.company,
+							order_type: me.frm.doc.order_type,
 						}
 					})
 				}, __("Get items from"));
diff --git a/erpnext/manufacturing/doctype/bom/bom.js b/erpnext/manufacturing/doctype/bom/bom.js
index 5181cf4..576e46d 100644
--- a/erpnext/manufacturing/doctype/bom/bom.js
+++ b/erpnext/manufacturing/doctype/bom/bom.js
@@ -33,9 +33,7 @@
 			});
 		}
 
-		if(frm.doc.docstatus==2) {
-			// show duplicate button when BOM is cancelled,
-			// its not very intuitive
+		if(frm.doc.docstatus!=0) {
 			frm.add_custom_button(__("Duplicate"), function() {
 				frm.copy_doc();
 			});
diff --git a/erpnext/manufacturing/doctype/bom/bom.json b/erpnext/manufacturing/doctype/bom/bom.json
index 9fa2a81..c42403c 100644
--- a/erpnext/manufacturing/doctype/bom/bom.json
+++ b/erpnext/manufacturing/doctype/bom/bom.json
@@ -1,5 +1,6 @@
 {
  "allow_copy": 0, 
+ "allow_guest_to_view": 0, 
  "allow_import": 1, 
  "allow_rename": 0, 
  "beta": 0, 
@@ -1574,18 +1575,18 @@
    "unique": 0
   }
  ], 
+ "has_web_view": 0, 
  "hide_heading": 0, 
  "hide_toolbar": 0, 
  "icon": "fa fa-sitemap", 
  "idx": 1, 
  "image_view": 0, 
  "in_create": 0, 
- "in_dialog": 0, 
  "is_submittable": 1, 
  "issingle": 0, 
  "istable": 0, 
  "max_attachments": 0, 
- "modified": "2017-02-21 13:10:27.394012", 
+ "modified": "2017-04-10 12:13:59.630780", 
  "modified_by": "Administrator", 
  "module": "Manufacturing", 
  "name": "BOM", 
@@ -1659,6 +1660,6 @@
  "show_name_in_global_search": 1, 
  "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/manufacturing/doctype/bom/bom.py b/erpnext/manufacturing/doctype/bom/bom.py
index abb2817..b8a8ae8 100644
--- a/erpnext/manufacturing/doctype/bom/bom.py
+++ b/erpnext/manufacturing/doctype/bom/bom.py
@@ -281,12 +281,15 @@
 
 		return bom_list
 
-	def traverse_tree(self, bom_list=[]):
+	def traverse_tree(self, bom_list=None):
 		def _get_children(bom_no):
 			return [cstr(d[0]) for d in frappe.db.sql("""select bom_no from `tabBOM Item`
 				where parent = %s and ifnull(bom_no, '') != ''""", bom_no)]
 
 		count = 0
+		if not bom_list:
+			bom_list = []
+		
 		if self.name not in bom_list:
 			bom_list.append(self.name)
 
diff --git a/erpnext/manufacturing/doctype/bom/bom_item_preview.html b/erpnext/manufacturing/doctype/bom/bom_item_preview.html
index 9db19a0..c782f7b 100644
--- a/erpnext/manufacturing/doctype/bom/bom_item_preview.html
+++ b/erpnext/manufacturing/doctype/bom/bom_item_preview.html
@@ -15,7 +15,9 @@
 		<a style="margin-right: 7px; margin-bottom: 7px" class="btn btn-default btn-xs" href="#Form/BOM/{{ data.value }}">
 			{{ __("Open BOM {0}", [data.value.bold()]) }}</a>
 		{% endif %}
+		{% if data.item_code %}
 		<a class="btn btn-default btn-xs" href="#Form/Item/{{ data.item_code }}">
 			{{ __("Open Item {0}", [data.item_code.bold()]) }}</a>
+		{% endif %}
 	</p>
 </div>
\ No newline at end of file
diff --git a/erpnext/manufacturing/doctype/production_order/production_order.js b/erpnext/manufacturing/doctype/production_order/production_order.js
index 1217790..d2540de 100644
--- a/erpnext/manufacturing/doctype/production_order/production_order.js
+++ b/erpnext/manufacturing/doctype/production_order/production_order.js
@@ -72,15 +72,17 @@
 		message = title;
 
 		// pending qty
-		var pending_complete = frm.doc.material_transferred_for_manufacturing - frm.doc.produced_qty;
-		if(pending_complete) {
-			var title = __('{0} items in progress', [pending_complete]);
-			bars.push({
-				'title': title,
-				'width': ((pending_complete / frm.doc.qty * 100) - added_min)  + '%',
-				'progress_class': 'progress-bar-warning'
-			})
-			message = message + '. ' + title;
+		if(!frm.doc.skip_transfer){
+			var pending_complete = frm.doc.material_transferred_for_manufacturing - frm.doc.produced_qty;
+			if(pending_complete) {
+				var title = __('{0} items in progress', [pending_complete]);
+				bars.push({
+					'title': title,
+					'width': ((pending_complete / frm.doc.qty * 100) - added_min)  + '%',
+					'progress_class': 'progress-bar-warning'
+				})
+				message = message + '. ' + title;
+			}
 		}
 		frm.dashboard.add_progress(__('Status'), bars, message);
 	}
@@ -122,21 +124,32 @@
 				frm.add_custom_button(__('Re-open'), cur_frm.cscript['Unstop Production Order'], __("Status"));
 			}
 
-			if ((flt(doc.material_transferred_for_manufacturing) < flt(doc.qty)) && frm.doc.status != 'Stopped') {
+			if(!frm.doc.skip_transfer){
+				if ((flt(doc.material_transferred_for_manufacturing) < flt(doc.qty)) && frm.doc.status != 'Stopped') {
 				frm.has_start_btn = true;
 				var btn = frm.add_custom_button(__('Start'),
 					cur_frm.cscript['Transfer Raw Materials']);
 				btn.addClass('btn-primary');
+				}
 			}
 
-			if ((flt(doc.produced_qty) < flt(doc.material_transferred_for_manufacturing)) && frm.doc.status != 'Stopped') {
-				frm.has_finish_btn = true;
-				var btn = frm.add_custom_button(__('Finish'),
-					cur_frm.cscript['Update Finished Goods']);
+			if(!frm.doc.skip_transfer){
+				if ((flt(doc.produced_qty) < flt(doc.material_transferred_for_manufacturing)) && frm.doc.status != 'Stopped') {
+					frm.has_finish_btn = true;
+					var btn = frm.add_custom_button(__('Finish'),
+						cur_frm.cscript['Update Finished Goods']);
 
-				if(doc.material_transferred_for_manufacturing==doc.qty) {
-					// all materials transferred for manufacturing,
-					// make this primary
+					if(doc.material_transferred_for_manufacturing==doc.qty) {
+						// all materials transferred for manufacturing,
+						// make this primary
+						btn.addClass('btn-primary');
+					}
+				}
+			} else {
+				if ((flt(doc.produced_qty) < flt(doc.qty)) && frm.doc.status != 'Stopped') {
+					frm.has_finish_btn = true;
+					var btn = frm.add_custom_button(__('Finish'),
+						cur_frm.cscript['Update Finished Goods']);
 					btn.addClass('btn-primary');
 				}
 			}
@@ -218,7 +231,7 @@
 					project: doc.project
 					},
 			callback: function(r) {
-				$.each(["description", "stock_uom", "bom_no"], function(i, field) {
+				$.each(["description", "stock_uom", "project", "bom_no"], function(i, field) {
 					cur_frm.set_value(field, r.message[field]);
 				});
 
@@ -235,9 +248,13 @@
 
 	make_se: function(purpose) {
 		var me = this;
-		var max = (purpose === "Manufacture") ?
-			flt(this.frm.doc.material_transferred_for_manufacturing) - flt(this.frm.doc.produced_qty) :
-			flt(this.frm.doc.qty) - flt(this.frm.doc.material_transferred_for_manufacturing);
+		if(!this.frm.doc.skip_transfer){
+			var max = (purpose === "Manufacture") ?
+				flt(this.frm.doc.material_transferred_for_manufacturing) - flt(this.frm.doc.produced_qty) :
+				flt(this.frm.doc.qty) - flt(this.frm.doc.material_transferred_for_manufacturing);
+		} else {
+			var max = flt(this.frm.doc.qty) - flt(this.frm.doc.produced_qty);
+		}
 
 		frappe.prompt({fieldtype:"Float", label: __("Qty for {0}", [purpose]), fieldname:"qty",
 			description: __("Max: {0}", [max]), 'default': max },
@@ -315,4 +332,4 @@
 			['Project', 'status', 'not in', 'Completed, Cancelled']
 		]
 	}
-}
+}
\ No newline at end of file
diff --git a/erpnext/manufacturing/doctype/production_order/production_order.json b/erpnext/manufacturing/doctype/production_order/production_order.json
index 79ef969..8d28907 100644
--- a/erpnext/manufacturing/doctype/production_order/production_order.json
+++ b/erpnext/manufacturing/doctype/production_order/production_order.json
@@ -324,8 +324,38 @@
    "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
+   "description": "Check if material transfer entry is not required", 
+   "fieldname": "skip_transfer", 
+   "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": "Skip Material Transfer", 
+   "length": 0, 
+   "no_copy": 0, 
+   "permlevel": 0, 
+   "precision": "", 
+   "print_hide": 0, 
+   "print_hide_if_no_value": 0, 
+   "read_only": 0, 
+   "remember_last_selected_value": 0, 
+   "report_hide": 0, 
+   "reqd": 0, 
+   "search_index": 0, 
+   "set_only_once": 0, 
+   "unique": 0
+  }, 
+  {
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
    "default": "0", 
-   "depends_on": "eval:doc.docstatus==1", 
+   "depends_on": "eval:doc.docstatus==1 && doc.skip_transfer==0", 
    "description": "", 
    "fieldname": "material_transferred_for_manufacturing", 
    "fieldtype": "Float", 
@@ -1316,7 +1346,7 @@
  "issingle": 0, 
  "istable": 0, 
  "max_attachments": 0, 
- "modified": "2017-03-28 19:19:08.559879", 
+ "modified": "2017-04-21 16:31:19.509721", 
  "modified_by": "Administrator", 
  "module": "Manufacturing", 
  "name": "Production Order", 
@@ -1369,6 +1399,6 @@
  "show_name_in_global_search": 0, 
  "sort_order": "ASC", 
  "title_field": "production_item", 
- "track_changes": 0, 
+ "track_changes": 1, 
  "track_seen": 0
-}
+}
\ No newline at end of file
diff --git a/erpnext/manufacturing/doctype/production_order/production_order.py b/erpnext/manufacturing/doctype/production_order/production_order.py
index 2d9a067..ff1082d 100644
--- a/erpnext/manufacturing/doctype/production_order/production_order.py
+++ b/erpnext/manufacturing/doctype/production_order/production_order.py
@@ -498,6 +498,7 @@
 			frappe.throw(_("Default BOM for {0} not found for Project {1}").format(item, project))
 		frappe.throw(_("Default BOM for {0} not found").format(item))
 
+	res['project'] = frappe.db.get_value('BOM', res['bom_no'], 'project')
 	res.update(check_if_scrap_warehouse_mandatory(res["bom_no"]))
 
 	return res
@@ -534,7 +535,7 @@
 		stock_entry.from_warehouse = production_order.wip_warehouse
 		stock_entry.to_warehouse = production_order.fg_warehouse
 		additional_costs = get_additional_costs(production_order, fg_qty=stock_entry.fg_completed_qty)
-		stock_entry.project = frappe.db.get_value("Stock Entry",{"production_order": production_order_id,"purpose": "Material Transfer for Manufacture"}, "project")
+		stock_entry.project = production_order.project
 		stock_entry.set("additional_costs", additional_costs)
 
 	stock_entry.get_items()
diff --git a/erpnext/patches.txt b/erpnext/patches.txt
index cb8ba03..ac91f60 100644
--- a/erpnext/patches.txt
+++ b/erpnext/patches.txt
@@ -379,6 +379,20 @@
 erpnext.patches.v7_2.update_attendance_docstatus
 erpnext.patches.v7_2.move_dates_from_salary_structure_to_employee
 erpnext.patches.v7_2.make_all_assessment_group
-erpnext.patches.v8_0.manufacturer_childtable_migrate
 erpnext.patches.v8_0.repost_reserved_qty_for_multiple_sales_uom
-erpnext.patches.v8_0.addresses_linked_to_lead
\ No newline at end of file
+erpnext.patches.v8_0.addresses_linked_to_lead
+execute:frappe.delete_doc('DocType', 'Purchase Common')
+erpnext.patches.v8_0.update_stock_qty_value_in_purchase_invoice
+erpnext.patches.v8_0.update_supplier_address_in_stock_entry
+erpnext.patches.v8_0.rename_is_sample_item_to_allow_zero_valuation_rate
+erpnext.patches.v8_0.set_null_to_serial_nos_for_disabled_sales_invoices
+erpnext.patches.v8_0.enable_booking_asset_depreciation_automatically
+erpnext.patches.v8_0.set_project_copied_from
+erpnext.patches.v8_0.update_status_as_paid_for_completed_expense_claim
+erpnext.patches.v7_2.stock_uom_in_selling
+erpnext.patches.v8_0.revert_manufacturers_table_from_item
+erpnext.patches.v8_0.disable_instructor_role
+erpnext.patches.v8_0.merge_student_batch_and_student_group
+erpnext.patches.v8_0.rename_total_margin_to_rate_with_margin # 11-05-2017
+erpnext.patches.v8_0.fix_status_for_invoices_with_negative_outstanding
+erpnext.patches.v8_0.make_payments_table_blank_for_non_pos_invoice
diff --git a/erpnext/patches/v4_0/import_country_codes.py b/erpnext/patches/v4_0/import_country_codes.py
index 4fda960..5e9f3b4 100644
--- a/erpnext/patches/v4_0/import_country_codes.py
+++ b/erpnext/patches/v4_0/import_country_codes.py
@@ -4,7 +4,7 @@
 from __future__ import unicode_literals
 import frappe
 from frappe.geo.country_info import get_all
-from erpnext.setup.install import import_country_and_currency
+from frappe.utils.install import import_country_and_currency
 
 def execute():
 	frappe.reload_doc("setup", "doctype", "country")
diff --git a/erpnext/patches/v4_0/update_users_report_view_settings.py b/erpnext/patches/v4_0/update_users_report_view_settings.py
index c0b38ef..6f216f5 100644
--- a/erpnext/patches/v4_0/update_users_report_view_settings.py
+++ b/erpnext/patches/v4_0/update_users_report_view_settings.py
@@ -3,7 +3,7 @@
 
 from __future__ import unicode_literals
 
-from frappe.model import update_users_report_view_settings
+from frappe.model.utils.rename_field import update_users_report_view_settings
 from erpnext.patches.v4_0.fields_to_be_renamed import rename_map
 
 def execute():
diff --git a/erpnext/patches/v4_2/add_currency_turkish_lira.py b/erpnext/patches/v4_2/add_currency_turkish_lira.py
index 42dc82c..dac1fe9 100644
--- a/erpnext/patches/v4_2/add_currency_turkish_lira.py
+++ b/erpnext/patches/v4_2/add_currency_turkish_lira.py
@@ -3,9 +3,8 @@
 
 from __future__ import unicode_literals
 import frappe
-from frappe.geo.country_info import get_country_info
-from erpnext.setup.install import add_country_and_currency
 
 def execute():
+	return
 	country = get_country_info(country="Turkey")
 	add_country_and_currency("Turkey", country)
diff --git a/erpnext/patches/v4_2/default_website_style.py b/erpnext/patches/v4_2/default_website_style.py
index cdf0a7a..d168c86 100644
--- a/erpnext/patches/v4_2/default_website_style.py
+++ b/erpnext/patches/v4_2/default_website_style.py
@@ -1,8 +1,8 @@
 from __future__ import unicode_literals
 import frappe
-from frappe.www.style_settings import default_properties
 
 def execute():
+	return
 	frappe.reload_doc('website', 'doctype', 'style_settings')
 	style_settings = frappe.get_doc("Style Settings", "Style Settings")
 	if not style_settings.apply_style:
diff --git a/erpnext/patches/v7_1/update_portal_roles.py b/erpnext/patches/v7_1/update_portal_roles.py
index 506adb9..72e9434 100644
--- a/erpnext/patches/v7_1/update_portal_roles.py
+++ b/erpnext/patches/v7_1/update_portal_roles.py
@@ -13,7 +13,6 @@
 	# set customer, supplier roles
 	for c in frappe.get_all('Contact', fields=['user'], filters={'ifnull(user, "")': ('!=', '')}):
 		user = frappe.get_doc('User', c.user)
-		user.set_default_roles()
 		user.flags.ignore_validate = True
 		user.flags.ignore_mandatory = True
 		user.save()
diff --git a/erpnext/patches/v7_2/mark_students_active.py b/erpnext/patches/v7_2/mark_students_active.py
index 12057ed..3513cde 100644
--- a/erpnext/patches/v7_2/mark_students_active.py
+++ b/erpnext/patches/v7_2/mark_students_active.py
@@ -1,7 +1,5 @@
 import frappe
 
 def execute():
-    frappe.reload_doc('schools', 'doctype', 'student_batch_student')
     frappe.reload_doc('schools', 'doctype', 'student_group_student')
-    frappe.db.sql("update `tabStudent Batch Student` set active=1")
     frappe.db.sql("update `tabStudent Group Student` set active=1")
diff --git a/erpnext/patches/v8_0/disable_instructor_role.py b/erpnext/patches/v8_0/disable_instructor_role.py
new file mode 100644
index 0000000..94ebd9c
--- /dev/null
+++ b/erpnext/patches/v8_0/disable_instructor_role.py
@@ -0,0 +1,17 @@
+# 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():
+	""" 
+		disable the instructor role for companies with domain other than
+		Education.
+	"""
+
+	domains = frappe.db.sql_list("select domain from tabCompany")
+	if "Education" not in domains:
+		role = frappe.get_doc("Role", "Instructor")
+		role.disabled = 1
+		role.save(ignore_permissions=True)
\ No newline at end of file
diff --git a/erpnext/patches/v8_0/enable_booking_asset_depreciation_automatically.py b/erpnext/patches/v8_0/enable_booking_asset_depreciation_automatically.py
new file mode 100644
index 0000000..1088d70
--- /dev/null
+++ b/erpnext/patches/v8_0/enable_booking_asset_depreciation_automatically.py
@@ -0,0 +1,9 @@
+# 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.db.set_value("Accounts Settings", None, 
+		"book_asset_depreciation_entry_automatically", 1)
\ No newline at end of file
diff --git a/erpnext/patches/v8_0/fix_status_for_invoices_with_negative_outstanding.py b/erpnext/patches/v8_0/fix_status_for_invoices_with_negative_outstanding.py
new file mode 100644
index 0000000..2e7f360
--- /dev/null
+++ b/erpnext/patches/v8_0/fix_status_for_invoices_with_negative_outstanding.py
@@ -0,0 +1,23 @@
+# Copyright (c) 2017, Frappe and Contributors
+# License: GNU General Public License v3. See license.txt
+
+from __future__ import unicode_literals
+import frappe
+
+def execute():
+	for dt, status in [["Sales Invoice", "Credit Note Issued"], ["Purchase Invoice", "Debit Note Issued"]]:
+		invoices = frappe.db.sql("""
+			select name 
+			from `tab{0}`
+			where 
+				status = %s
+				and outstanding_amount < 0
+				and docstatus=1
+				and is_return=0
+		""".format(dt), status)
+		
+		for inv in invoices:
+			return_inv = frappe.db.sql("""select name from `tab{0}` 
+				where is_return=1 and return_against=%s and docstatus=1""".format(dt), inv[0])
+			if not return_inv:
+				frappe.db.sql("update `tab{0}` set status='Paid' where name = %s".format(dt), inv[0])
\ No newline at end of file
diff --git a/erpnext/patches/v8_0/make_payments_table_blank_for_non_pos_invoice.py b/erpnext/patches/v8_0/make_payments_table_blank_for_non_pos_invoice.py
new file mode 100644
index 0000000..9750fb7
--- /dev/null
+++ b/erpnext/patches/v8_0/make_payments_table_blank_for_non_pos_invoice.py
@@ -0,0 +1,15 @@
+# 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_doctype('Sales Invoice')
+
+	frappe.db.sql("""
+		delete from 
+			`tabSales Invoice Payment` 
+		where 
+			parent in (select name from `tabSales Invoice` where is_pos = 0)
+	""")
\ No newline at end of file
diff --git a/erpnext/patches/v8_0/manufacturer_childtable_migrate.py b/erpnext/patches/v8_0/manufacturer_childtable_migrate.py
deleted file mode 100644
index 6d566b4..0000000
--- a/erpnext/patches/v8_0/manufacturer_childtable_migrate.py
+++ /dev/null
@@ -1,25 +0,0 @@
-# Copyright (c) 2017, Frappe and Contributors
-# License: GNU General Public License v3. See license.txt
-
-from __future__ import unicode_literals
-import frappe
-
-def execute():
-
-    # reading from json and writing it to mariadb
-    # reload_doc needed here with information because new table introduced
-    frappe.reload_doc('stock', 'doctype', 'item_manufacturer')
-    # reload_doctype is a simpler concept of reload_doc
-    frappe.reload_doctype('Item')
-
-    item_manufacturers = frappe.get_all("Item", fields=["name", "manufacturer", "manufacturer_part_no"])
-    for item in item_manufacturers:
-        if item.manufacturer or item.manufacturer_part_no:
-            item_doc = frappe.get_doc("Item", item.name)
-            item_doc.append("manufacturers", {
-                "manufacturer": item.manufacturer,
-                "manufacturer_part_no": item.manufacturer_part_no
-            })
-            item_doc.flags.ignore_validate = True
-            item_doc.flags.ignore_mandatory = True
-            item_doc.save()
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
new file mode 100644
index 0000000..742457f
--- /dev/null
+++ b/erpnext/patches/v8_0/merge_student_batch_and_student_group.py
@@ -0,0 +1,57 @@
+# Copyright (c) 2017, Frappe and Contributors
+# License: GNU General Public License v3. See license.txt
+
+from __future__ import unicode_literals
+import frappe
+from frappe.model.utils.rename_field import *
+from frappe.model.mapper import get_mapped_doc
+
+
+def execute():
+
+	# for converting student batch into student group
+	frappe.reload_doctype("Student Group")
+	student_batches = frappe.db.sql('''select name as student_group_name, student_batch_name as batch,
+		program, academic_year, academic_term from `tabStudent Batch`''', as_dict=1)
+
+	for student_batch in student_batches:
+		# create student batch name if does not exists !!
+		if student_batch.get("batch") and not frappe.db.exists("Student Batch Name", student_batch.get("batch")):
+			frappe.get_doc({
+				"doctype": "Student Batch Name",
+				"batch_name": student_batch.get("batch")
+			}).insert(ignore_permissions=True)
+
+		student_batch.update({"doctype":"Student Group", "group_based_on": "Batch"})
+		doc = frappe.get_doc(student_batch)
+		student_list = frappe.db.sql('''select student, student_name, active from `tabStudent Batch Student`
+			where parent=%s''', (doc.name), as_dict=1)
+		for i, student in enumerate(student_list):
+			student.update({"group_roll_number": i+1})
+
+		if student_list:
+			doc.extend("students", student_list)
+
+		instructor_list = frappe.db.sql('''select instructor, instructor_name from `tabStudent Batch Instructor`
+			where parent=%s''', (doc.name), as_dict=1)
+		if instructor_list:
+			doc.extend("instructors", instructor_list)
+		doc.save()
+
+	# delete the student batch and child-table
+	frappe.delete_doc("DocType", "Student Batch", force=1)
+	frappe.delete_doc("DocType", "Student Batch Student", force=1)
+	frappe.delete_doc("DocType", "Student Batch Instructor", force=1)
+
+	# delete the student batch creation tool
+	frappe.delete_doc("DocType", "Student Batch Creation Tool", force=1)
+
+	# delete the student batch creation tool
+	frappe.delete_doc("DocType", "Attendance Tool Student", force=1)
+
+	# change the student batch to student group in the student attendance
+	frappe.reload_doctype("Student Attendance")
+
+	table_columns = frappe.db.get_table_columns("Student Attendance")
+	if "student_batch" in table_columns:
+		rename_field("Student Attendance", "student_batch", "student_group")
diff --git a/erpnext/patches/v8_0/rename_is_sample_item_to_allow_zero_valuation_rate.py b/erpnext/patches/v8_0/rename_is_sample_item_to_allow_zero_valuation_rate.py
new file mode 100644
index 0000000..e517df5
--- /dev/null
+++ b/erpnext/patches/v8_0/rename_is_sample_item_to_allow_zero_valuation_rate.py
@@ -0,0 +1,13 @@
+from __future__ import unicode_literals
+import frappe
+from frappe.model.utils.rename_field import rename_field
+
+def execute():
+	
+	doc_list = ["Purchase Invoice Item", "Stock Entry Detail", "Delivery Note Item", 
+		"Purchase Receipt Item", "Sales Invoice Item"]
+	
+	for doctype in doc_list:
+		frappe.reload_doctype(doctype)
+		if "is_sample_item" in frappe.db.get_table_columns(doctype):
+			rename_field(doctype, "is_sample_item", "allow_zero_valuation_rate")
\ No newline at end of file
diff --git a/erpnext/patches/v8_0/rename_total_margin_to_rate_with_margin.py b/erpnext/patches/v8_0/rename_total_margin_to_rate_with_margin.py
new file mode 100644
index 0000000..3fc477e
--- /dev/null
+++ b/erpnext/patches/v8_0/rename_total_margin_to_rate_with_margin.py
@@ -0,0 +1,24 @@
+from __future__ import unicode_literals
+import frappe
+
+from frappe.model.utils.rename_field import rename_field
+
+def execute():
+	""" 
+		Rename Total Margin field to Rate With Margin in
+		"Sales Order Item", "Sales Invoice Item", "Delivery Note Item",
+		"Quotation Item"
+	"""
+
+	for d in ("Sales Order Item", "Sales Invoice Item",
+		"Delivery Note Item", "Quotation Item"):
+		frappe.reload_doctype(d)
+		rename_field_if_exists(d, "total_margin", "rate_with_margin")
+
+
+def rename_field_if_exists(doctype, old_fieldname, new_fieldname):
+	try:
+		rename_field(doctype, old_fieldname, new_fieldname)
+	except Exception, e:
+		if e.args[0] != 1054:
+			raise
diff --git a/erpnext/patches/v8_0/revert_manufacturers_table_from_item.py b/erpnext/patches/v8_0/revert_manufacturers_table_from_item.py
new file mode 100644
index 0000000..60cbb33
--- /dev/null
+++ b/erpnext/patches/v8_0/revert_manufacturers_table_from_item.py
@@ -0,0 +1,22 @@
+# 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():
+	if frappe.db.exists("DocType", "Item Manufacturer"):
+		frappe.reload_doctype("Item")
+		item_manufacturers = frappe.db.sql("""
+			select parent, manufacturer, manufacturer_part_no 
+			from `tabItem Manufacturer`
+		""", as_dict=1)
+		
+		for im in item_manufacturers:
+			frappe.db.sql("""
+				update tabItem 
+				set manufacturer=%s, manufacturer_part_no=%s
+				where name=%s
+			""", (im.manufacturer, im.manufacturer_part_no, im.parent))
+		
+		frappe.delete_doc("DocType", "Item Manufacturer")
\ No newline at end of file
diff --git a/erpnext/patches/v8_0/set_null_to_serial_nos_for_disabled_sales_invoices.py b/erpnext/patches/v8_0/set_null_to_serial_nos_for_disabled_sales_invoices.py
new file mode 100644
index 0000000..197d6de
--- /dev/null
+++ b/erpnext/patches/v8_0/set_null_to_serial_nos_for_disabled_sales_invoices.py
@@ -0,0 +1,14 @@
+# 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
+from erpnext.stock.stock_balance import update_bin_qty, get_reserved_qty
+
+def execute():
+	frappe.db.sql("""
+		update 
+			`tabSales Invoice Item` 
+		set serial_no = NULL
+		where 
+			parent in (select name from `tabSales Invoice` where update_stock = 0 and docstatus = 1)""")
\ No newline at end of file
diff --git a/erpnext/patches/v8_0/set_project_copied_from.py b/erpnext/patches/v8_0/set_project_copied_from.py
new file mode 100644
index 0000000..d428797
--- /dev/null
+++ b/erpnext/patches/v8_0/set_project_copied_from.py
@@ -0,0 +1,11 @@
+from __future__ import unicode_literals
+import frappe
+
+def execute():
+	frappe.reload_doctype("Project")
+	
+	frappe.db.sql('''
+		UPDATE `tabProject`
+		SET copied_from=name
+		WHERE copied_from is NULL
+	''')
\ No newline at end of file
diff --git a/erpnext/patches/v8_0/update_status_as_paid_for_completed_expense_claim.py b/erpnext/patches/v8_0/update_status_as_paid_for_completed_expense_claim.py
new file mode 100644
index 0000000..19d27b2
--- /dev/null
+++ b/erpnext/patches/v8_0/update_status_as_paid_for_completed_expense_claim.py
@@ -0,0 +1,19 @@
+# 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():
+	""" set status as Paid in Expense Claim if total_sactioned_amount 
+		and total_amount_reimbursed is equal """
+	
+	frappe.reload_doctype('Expense Claim')
+
+	frappe.db.sql("""
+		update 
+			`tabExpense Claim`
+		set status = 'Paid'
+		where 
+			total_sanctioned_amount = total_amount_reimbursed
+	""")
diff --git a/erpnext/patches/v8_0/update_stock_qty_value_in_purchase_invoice.py b/erpnext/patches/v8_0/update_stock_qty_value_in_purchase_invoice.py
new file mode 100644
index 0000000..be5cf3a
--- /dev/null
+++ b/erpnext/patches/v8_0/update_stock_qty_value_in_purchase_invoice.py
@@ -0,0 +1,9 @@
+# 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_doc('accounts', 'doctype', 'purchase_invoice_item')
+	frappe.db.sql("update `tabPurchase Invoice Item` set stock_qty = qty, stock_uom = uom")
\ No newline at end of file
diff --git a/erpnext/patches/v8_0/update_supplier_address_in_stock_entry.py b/erpnext/patches/v8_0/update_supplier_address_in_stock_entry.py
new file mode 100644
index 0000000..a217304
--- /dev/null
+++ b/erpnext/patches/v8_0/update_supplier_address_in_stock_entry.py
@@ -0,0 +1,22 @@
+# Copyright (c) 2017, Frappe and Contributors
+# License: GNU General Public License v3. See license.txt
+
+from __future__ import unicode_literals
+import frappe
+
+def execute():
+	# copy supplier_address to address_display, and set supplier_address to blank
+
+	stock_entries = frappe.db.sql(""" select name, purchase_order, supplier_address from `tabStock Entry`
+		where ifnull(supplier_address, '') <> ''""", as_dict=True)
+
+	frappe.reload_doc('stock', 'doctype', 'stock_entry')
+
+	for stock_entry in stock_entries:
+		# move supplier address to address_display, and fetch the supplier address from purchase order
+
+		se = frappe.get_doc("Stock Entry", stock_entry.get("name"))
+		se.address_display = stock_entry.get("supplier_address")
+		se.supplier_address = frappe.db.get_value("Purchase Order", stock_entry.get("purchase_order"),"supplier_address") or None
+
+		se.db_update()
diff --git a/erpnext/portal/utils.py b/erpnext/portal/utils.py
new file mode 100644
index 0000000..8115c1f
--- /dev/null
+++ b/erpnext/portal/utils.py
@@ -0,0 +1,20 @@
+import frappe
+
+def set_default_role(doc, method):
+	'''Set customer, supplier, student based on email'''
+	if frappe.flags.setting_role or frappe.flags.in_migrate:
+		return
+
+	roles = frappe.get_roles(doc.name)
+
+	contact_name = frappe.get_value('Contact', dict(email_id=doc.email))
+	if contact_name:
+		contact = frappe.get_doc('Contact', contact_name)
+		for link in contact.links:
+			frappe.flags.setting_role = True
+			if link.link_doctype=='Customer' and 'Customer' not in roles:
+				doc.add_roles('Customer')
+			elif link.link_doctype=='Supplier' and 'Supplier' not in roles:
+				doc.add_roles('Supplier')
+	elif frappe.get_value('Student', dict(student_email_id=doc.email)) and 'Student' not in roles:
+		doc.add_roles('Student')
diff --git a/erpnext/projects/doctype/project/project.json b/erpnext/projects/doctype/project/project.json
index e809328..32a3ffd 100644
--- a/erpnext/projects/doctype/project/project.json
+++ b/erpnext/projects/doctype/project/project.json
@@ -1,5 +1,6 @@
 {
  "allow_copy": 0, 
+ "allow_guest_to_view": 0, 
  "allow_import": 1, 
  "allow_rename": 1, 
  "autoname": "field:project_name", 
@@ -556,6 +557,35 @@
   {
    "allow_on_submit": 0, 
    "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "fieldname": "copied_from", 
+   "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": "Copied From", 
+   "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_on_submit": 0, 
+   "bold": 0, 
    "collapsible": 1, 
    "columns": 0, 
    "fieldname": "section_break0", 
@@ -1052,7 +1082,7 @@
    "search_index": 0, 
    "set_only_once": 0, 
    "unique": 0
-  },   
+  }, 
   {
    "allow_on_submit": 0, 
    "bold": 0, 
@@ -1174,19 +1204,19 @@
    "unique": 0
   }
  ], 
+ "has_web_view": 0, 
  "hide_heading": 0, 
  "hide_toolbar": 0, 
  "icon": "fa fa-puzzle-piece", 
  "idx": 29, 
  "image_view": 0, 
  "in_create": 0, 
- "in_dialog": 0, 
  "is_submittable": 0, 
  "issingle": 0, 
  "istable": 0, 
  "max_attachments": 4, 
- "modified": "2017-02-17 17:24:04.146872", 
- "modified_by": "Administrator", 
+ "modified": "2017-04-19 13:16:32.462005", 
+ "modified_by": "faris@erpnext.com", 
  "module": "Projects", 
  "name": "Project", 
  "owner": "Administrator", 
@@ -1261,4 +1291,4 @@
  "timeline_field": "customer", 
  "track_changes": 0, 
  "track_seen": 1
-}
+}
\ No newline at end of file
diff --git a/erpnext/projects/doctype/project/project.py b/erpnext/projects/doctype/project/project.py
index 289b7dd..0345f05 100644
--- a/erpnext/projects/doctype/project/project.py
+++ b/erpnext/projects/doctype/project/project.py
@@ -205,6 +205,42 @@
 	def on_update(self):
 		self.load_tasks()
 		self.sync_tasks()
+		self.update_dependencies_on_duplicated_project()
+	
+	def update_dependencies_on_duplicated_project(self):
+		if self.flags.dont_sync_tasks: return
+		if not self.copied_from:
+			self.copied_from = self.name
+
+		if self.name != self.copied_from and self.get('__unsaved'):
+			# duplicated project
+			dependency_map = {}
+			for task in self.tasks:
+				_task = frappe.db.get_value(
+					'Task',
+					{"subject": task.title, "project": self.copied_from},
+					['name', 'depends_on_tasks'],
+					as_dict=True
+				)
+
+				if _task is None:
+					continue
+
+				name = _task.name
+				depends_on_tasks = _task.depends_on_tasks
+
+				depends_on_tasks = [x for x in depends_on_tasks.split(',') if x]
+				dependency_map[task.title] = [ x['subject'] for x in frappe.get_list(
+					'Task Depends On', {"parent": name}, ['subject'])]
+
+			for key, value in dependency_map.iteritems():
+				task_name = frappe.db.get_value('Task', {"subject": key, "project": self.name })
+				task_doc = frappe.get_doc('Task', task_name)
+
+				for dt in value:
+					dt_name = frappe.db.get_value('Task', {"subject": dt, "project": self.name })
+					task_doc.append('depends_on', {"task": dt_name})
+				task_doc.save()
 
 def get_timeline_data(doctype, name):
 	'''Return timeline for attendance'''
@@ -214,7 +250,7 @@
 			and docstatus < 2
 			group by date(from_time)''', name))
 
-def get_project_list(doctype, txt, filters, limit_start, limit_page_length=20):
+def get_project_list(doctype, txt, filters, limit_start, limit_page_length=20, order_by="modified"):
 	return frappe.db.sql('''select distinct project.*
 		from tabProject project, `tabProject User` project_user
 		where
diff --git a/erpnext/projects/doctype/project/project_list.js b/erpnext/projects/doctype/project/project_list.js
index 437bf60..0f715bf 100644
--- a/erpnext/projects/doctype/project/project_list.js
+++ b/erpnext/projects/doctype/project/project_list.js
@@ -1,5 +1,5 @@
 frappe.listview_settings['Project'] = {
-	add_fields: ["status", "priority", "is_active", "percent_complete", "expected_end_date"],
+	add_fields: ["status", "priority", "is_active", "percent_complete", "expected_end_date", "project_name"],
 	filters:[["status","=", "Open"]],
 	get_indicator: function(doc) {
 		if(doc.status=="Open" && doc.percent_complete) {
diff --git a/erpnext/projects/doctype/task/task.py b/erpnext/projects/doctype/task/task.py
index 44c81a6..43240b2 100644
--- a/erpnext/projects/doctype/task/task.py
+++ b/erpnext/projects/doctype/task/task.py
@@ -53,9 +53,9 @@
 			frappe.throw(_("Progress % for a task cannot be more than 100."))
 
 	def update_depends_on(self):
-		depends_on_tasks = ""
+		depends_on_tasks = self.depends_on_tasks or ""
 		for d in self.depends_on:
-			if d.task:
+			if d.task and not d.task in depends_on_tasks:
 				depends_on_tasks += d.task + ","
 		self.depends_on_tasks = depends_on_tasks
 
diff --git a/erpnext/projects/doctype/timesheet/timesheet.py b/erpnext/projects/doctype/timesheet/timesheet.py
index 490a707..154f0d0 100644
--- a/erpnext/projects/doctype/timesheet/timesheet.py
+++ b/erpnext/projects/doctype/timesheet/timesheet.py
@@ -382,9 +382,13 @@
 
 def get_conditions(filters):
 	conditions = []
-	abbr = {'employee': 'tabTimesheet', 'project': 'tabTimesheet Detail'}
 	for key in filters:
 		if filters.get(key):
-			conditions.append("`%s`.%s = '%s'"%(abbr.get(key), key, filters.get(key)))
+			if frappe.get_meta("Timesheet").has_field(key):
+				dt = 'tabTimesheet'
+			elif frappe.get_meta("Timesheet Detail").has_field(key):
+				dt = 'tabTimesheet Detail'
+				
+			conditions.append("`%s`.%s = '%s'"%(dt, key, filters.get(key)))
 
 	return " and {}".format(" and ".join(conditions)) if conditions else ""
diff --git a/erpnext/public/css/erpnext.css b/erpnext/public/css/erpnext.css
index 7b6e5a1..86dec05 100644
--- a/erpnext/public/css/erpnext.css
+++ b/erpnext/public/css/erpnext.css
@@ -270,6 +270,11 @@
   border: 1px solid #d1d8dd;
   border-top: none;
 }
+@media (max-width: 767px) {
+  body[data-route="pos"] .item-cart-items {
+    height: 30vh;
+  }
+}
 body[data-route="pos"] .no-items-message {
   min-height: 200px;
   display: flex;
@@ -297,6 +302,9 @@
 body[data-route="pos"] .item-list .image-field {
   height: 140px;
 }
+body[data-route="pos"] .item-list .image-field .placeholder-text {
+  font-size: 50px;
+}
 body[data-route="pos"] .item-list .pos-item-wrapper {
   position: relative;
 }
diff --git a/erpnext/public/css/website.css b/erpnext/public/css/website.css
index 0370dd0..0245675 100644
--- a/erpnext/public/css/website.css
+++ b/erpnext/public/css/website.css
@@ -26,8 +26,6 @@
   background-size: cover;
   background-repeat: no-repeat;
   background-position: center top;
-  border-radius-top: 4px;
-  border-radius-right: 4px;
 }
 .product-image.missing-image {
   width: 100%;
@@ -36,8 +34,6 @@
   background-size: cover;
   background-repeat: no-repeat;
   background-position: center top;
-  border-radius-top: 4px;
-  border-radius-right: 4px;
   position: relative;
   background-color: #EBEFF2;
 }
@@ -45,9 +41,6 @@
   font-size: 32px;
   color: #d1d8dd;
 }
-.product-text {
-  padding: 15px 0px;
-}
 .product-search {
   margin-bottom: 15px;
 }
@@ -246,6 +239,15 @@
   padding: 15px;
   word-wrap: break-word;
   height: 75px;
+  display: block;
+  /* Fallback for non-webkit */
+  display: -webkit-box;
+  max-width: 100%;
+  margin: 0 auto;
+  -webkit-line-clamp: 3;
+  -webkit-box-orient: vertical;
+  overflow: hidden;
+  text-overflow: ellipsis;
 }
 .product-image-wrapper {
   padding-bottom: 40px;
diff --git a/erpnext/buying/doctype/purchase_common/purchase_common.js b/erpnext/public/js/controllers/buying.js
similarity index 96%
rename from erpnext/buying/doctype/purchase_common/purchase_common.js
rename to erpnext/public/js/controllers/buying.js
index 6867dd0..a8c80fe 100644
--- a/erpnext/buying/doctype/purchase_common/purchase_common.js
+++ b/erpnext/public/js/controllers/buying.js
@@ -113,7 +113,7 @@
 			frappe.model.round_floats_in(item, ["qty", "received_qty"]);
 
 			if(!doc.is_return && this.validate_negative_quantity(cdt, cdn, item, ["qty", "received_qty"])){ return }
-			
+
 			if(!item.rejected_qty && item.qty) {
 				item.received_qty = item.qty;
 			}
@@ -138,14 +138,14 @@
 		frappe.model.round_floats_in(item, ["received_qty", "rejected_qty"]);
 
 		if(!doc.is_return && this.validate_negative_quantity(cdt, cdn, item, ["received_qty", "rejected_qty"])){ return }
-		
+
 		item.qty = flt(item.received_qty - item.rejected_qty, precision("qty", item));
 		this.qty(doc, cdt, cdn);
 	},
 
 	validate_negative_quantity: function(cdt, cdn, item, fieldnames){
 		if(!item || !fieldnames) { return }
-		
+
 		var is_negative_qty = false;
 		for(var i = 0; i<fieldnames.length; i++) {
 			if(item[fieldnames[i]] < 0){
@@ -219,12 +219,12 @@
 						my_items.push(cur_frm.doc.items[i].item_code);
 					}
 				}
-				frappe.call({	
-					method: "erpnext.buying.doctype.purchase_common.purchase_common.get_linked_material_requests",
+				frappe.call({
+					method: "erpnext.buying.utils.get_linked_material_requests",
 					args:{
-						items: my_items						
-					}, 
-					callback: function(r) { 
+						items: my_items
+					},
+					callback: function(r) {
 						var i = 0;
 						var item_length = cur_frm.doc.items.length;
 						while (i < item_length) {
@@ -239,32 +239,32 @@
 									d.qty = d.qty  - my_qty;
 									cur_frm.doc.items[i].stock_qty = my_qty*cur_frm.doc.items[i].conversion_factor;
 									cur_frm.doc.items[i].qty = my_qty;
-									
+
 									frappe.msgprint("Assigning " + d.mr_name + " to " + d.item_code + " (row " + cur_frm.doc.items[i].idx + ")");
 									if (qty > 0)
 									{
 										frappe.msgprint("Splitting " + qty + " units of " + d.item_code);
 										var newrow = frappe.model.add_child(cur_frm.doc, cur_frm.doc.items[i].doctype, "items");
 										item_length++;
-										
+
 										for (key in cur_frm.doc.items[i])
 										{
 											newrow[key] = cur_frm.doc.items[i][key];
 										}
-										
+
 										newrow.idx = item_length;
 										newrow["stock_qty"] = newrow.conversion_factor*qty;
 										newrow["qty"] = qty;
-										
+
 										newrow["material_request"] = "";
 										newrow["material_request_item"] = "";
-										
+
 									}
-									
-									
-									
+
+
+
 								}
-							
+
 							});
 							i++;
 						}
diff --git a/erpnext/public/js/controllers/taxes_and_totals.js b/erpnext/public/js/controllers/taxes_and_totals.js
index 6f55a44..849275f 100644
--- a/erpnext/public/js/controllers/taxes_and_totals.js
+++ b/erpnext/public/js/controllers/taxes_and_totals.js
@@ -5,17 +5,17 @@
 	setup: function() {},
 	apply_pricing_rule_on_item: function(item){
 		if(item.margin_type == "Percentage"){
-			item.total_margin = flt(item.price_list_rate) 
+			item.rate_with_margin = flt(item.price_list_rate) 
 				+ flt(item.price_list_rate) * ( flt(item.margin_rate_or_amount) / 100);
-		}else{
-			item.total_margin = flt(item.price_list_rate) + flt(item.margin_rate_or_amount);
+		} else {
+			item.rate_with_margin = flt(item.price_list_rate) + flt(item.margin_rate_or_amount);
 		}
 
-		item.rate = flt(item.total_margin , precision("rate", item));
+		item.rate = flt(item.rate_with_margin , precision("rate", item));
 
 		if(item.discount_percentage){
-			discount_value = flt(item.total_margin) * flt(item.discount_percentage) / 100;
-			item.rate = flt((item.total_margin) - (discount_value), precision('rate', item));
+			discount_value = flt(item.rate_with_margin) * flt(item.discount_percentage) / 100;
+			item.rate = flt((item.rate_with_margin) - (discount_value), precision('rate', item));
 		}
 	},
 
@@ -594,6 +594,8 @@
 				paid_amount += data.amount;
 				base_paid_amount += data.base_amount;
 			})
+		} else if(!this.frm.doc.is_return){
+			this.frm.doc.payments = [];
 		}
 
 		this.frm.doc.paid_amount = flt(paid_amount, precision("paid_amount"));
diff --git a/erpnext/public/js/controllers/transaction.js b/erpnext/public/js/controllers/transaction.js
index 1c9c0ab..44bf21d 100644
--- a/erpnext/public/js/controllers/transaction.js
+++ b/erpnext/public/js/controllers/transaction.js
@@ -6,12 +6,31 @@
 		this._super();
 		frappe.ui.form.on(this.frm.doctype + " Item", "rate", function(frm, cdt, cdn) {
 			var item = frappe.get_doc(cdt, cdn);
+			var has_margin_field = frappe.meta.has_field(cdt, 'margin_type');
+
 			frappe.model.round_floats_in(item, ["rate", "price_list_rate"]);
 
 			if(item.price_list_rate) {
-				item.discount_percentage = flt((1 - item.rate / item.price_list_rate) * 100.0, precision("discount_percentage", item));
+				if(item.rate > item.price_list_rate && has_margin_field) {
+					// if rate is greater than price_list_rate, set margin
+					// or set discount
+					item.discount_percentage = 0;
+					item.margin_type = 'Percentage';
+					item.margin_rate_or_amount = flt(Math.abs(1 - item.rate / item.price_list_rate) * 100.0, 
+						precision("discount_percentage", item));
+					item.rate_with_margin = item.rate; 
+				} else {
+					item.discount_percentage = flt((1 - item.rate / item.price_list_rate) * 100.0, 
+						precision("discount_percentage", item));
+					item.margin_type = '';
+					item.margin_rate_or_amount = 0;
+					item.rate_with_margin = 0;
+				}
 			} else {
 				item.discount_percentage = 0.0;
+				item.margin_type = '';
+				item.margin_rate_or_amount = 0;
+				item.rate_with_margin = 0;
 			}
 
 			cur_frm.cscript.set_gross_profit(item);
@@ -97,7 +116,7 @@
 			});
 
 			if(this.frm.doc.company && !this.frm.doc.amended_from) {
-				this.frm.script_manager.trigger("company");
+				this.frm.trigger("company");
 			}
 		}
 
@@ -260,6 +279,7 @@
 							customer: me.frm.doc.customer,
 							supplier: me.frm.doc.supplier,
 							currency: me.frm.doc.currency,
+							update_stock: in_list(['Sales Invoice', 'Purchase Invoice'], me.frm.doc.doctype) ? cint(me.frm.doc.update_stock) : 0,
 							conversion_rate: me.frm.doc.conversion_rate,
 							price_list: me.frm.doc.selling_price_list ||
 								 me.frm.doc.buying_price_list,
@@ -274,14 +294,16 @@
 							doctype: me.frm.doc.doctype,
 							name: me.frm.doc.name,
 							project: item.project || me.frm.doc.project,
-							qty: item.qty,
-							stock_qty: item.stock_qty
+							qty: item.qty || 1,
+							stock_qty: item.stock_qty,
+							conversion_factor: item.conversion_factor
 						}
 					},
 
 					callback: function(r) {
 						if(!r.exc) {
 							me.frm.script_manager.trigger("price_list_rate", cdt, cdn);
+							me.toggle_conversion_factor(item);
 						}
 					}
 				});
@@ -295,7 +317,7 @@
 
 		if (item.serial_no) {
 			if (!item.item_code) {
-				this.frm.script_manager.trigger("item_code", cdt, cdn);
+				this.frm.trigger("item_code", cdt, cdn);
 			}
 			else {
 				var sr_no = [];
@@ -497,6 +519,7 @@
 	},
 
 	get_exchange_rate: function(transaction_date, from_currency, to_currency, callback) {
+		if (!transaction_date || !from_currency || !to_currency) return;
 		return frappe.call({
 			method: "erpnext.setup.utils.get_exchange_rate",
 			args: {
@@ -560,18 +583,26 @@
 		}
 	},
 
-	conversion_factor: function(doc, cdt, cdn) {
+	conversion_factor: function(doc, cdt, cdn, dont_fetch_price_list_rate) {
 		if(frappe.meta.get_docfield(cdt, "stock_qty", cdn)) {
 			var item = frappe.get_doc(cdt, cdn);
 			frappe.model.round_floats_in(item, ["qty", "conversion_factor"]);
 			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);
 		}
 	},
 
+	toggle_conversion_factor: function(item) {
+		// toggle read only property for conversion factor field if the uom and stock uom are same
+		this.frm.fields_dict.items.grid.toggle_enable("conversion_factor",
+			(item.uom != item.stock_uom)? true: false)
+	},
+
 	qty: function(doc, cdt, cdn) {
+		this.conversion_factor(doc, cdt, cdn, true);
 		this.apply_pricing_rule(frappe.get_doc(cdt, cdn), true);
-		this.conversion_factor(doc, cdt, cdn);
 	},
 
 	set_dynamic_labels: function() {
@@ -716,7 +747,33 @@
 	},
 
 	ignore_pricing_rule: function() {
-		this.apply_pricing_rule();
+		if(this.frm.doc.ignore_pricing_rule) {
+			var me = this;
+			var item_list = [];
+			
+			$.each(this.frm.doc["items"] || [], function(i, d) {
+				if (d.item_code) {
+					item_list.push({
+						"doctype": d.doctype,
+						"name": d.name,
+						"pricing_rule": d.pricing_rule
+					})
+				}
+			});
+			return this.frm.call({
+				method: "erpnext.accounts.doctype.pricing_rule.pricing_rule.remove_pricing_rules",
+				args: { item_list: item_list },
+				callback: function(r) {
+					if (!r.exc && r.message) {
+						me._set_values_for_item_list(r.message);
+						me.calculate_taxes_and_totals();
+						if(me.frm.doc.apply_discount_on) me.frm.trigger("apply_discount_on")
+					}
+				}
+			});
+		} else {
+			this.apply_pricing_rule();
+		}
 	},
 
 	apply_pricing_rule: function(item, calculate_taxes_and_totals) {
@@ -726,7 +783,6 @@
 			if(calculate_taxes_and_totals) me.calculate_taxes_and_totals();
 			return;
 		}
-
 		return this.frm.call({
 			method: "erpnext.accounts.doctype.pricing_rule.pricing_rule.apply_pricing_rule",
 			args: {	args: args },
@@ -762,7 +818,9 @@
 			"ignore_pricing_rule": me.frm.doc.ignore_pricing_rule,
 			"doctype": me.frm.doc.doctype,
 			"name": me.frm.doc.name,
-			"is_return": cint(me.frm.doc.is_return)
+			"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
 		};
 	},
 
@@ -781,7 +839,8 @@
 					"parent": d.parent,
 					"pricing_rule": d.pricing_rule,
 					"warehouse": d.warehouse,
-					"serial_no": d.serial_no
+					"serial_no": d.serial_no,
+					"conversion_factor": d.conversion_factor || 1.0
 				});
 
 				// if doctype is Quotation Item / Sales Order Iten then add Margin Type and rate in item_list
@@ -808,16 +867,13 @@
 		for(var i=0, l=children.length; i<l; i++) {
 			var d = children[i];
 			var existing_pricing_rule = frappe.model.get_value(d.doctype, d.name, "pricing_rule");
-
 			for(var k in d) {
 				var v = d[k];
 				if (["doctype", "name"].indexOf(k)===-1) {
 					if(k=="price_list_rate") {
 						if(flt(v) != flt(d.price_list_rate)) price_list_rate_changed = true;
 					}
-					if(v) {
-						frappe.model.set_value(d.doctype, d.name, k, v);
-					}
+					frappe.model.set_value(d.doctype, d.name, k, v);
 				}
 			}
 
@@ -1081,4 +1137,4 @@
 
 		return method
 	},
-});
\ No newline at end of file
+});
diff --git a/erpnext/public/js/financial_statements.js b/erpnext/public/js/financial_statements.js
index 7115205..66daf0d 100644
--- a/erpnext/public/js/financial_statements.js
+++ b/erpnext/public/js/financial_statements.js
@@ -26,13 +26,14 @@
 	},
 	"open_general_ledger": function(data) {
 		if (!data.account) return;
+		var project = $.grep(frappe.query_report.filters, function(e){ return e.df.fieldname == 'project'; })
 
 		frappe.route_options = {
 			"account": data.account,
 			"company": frappe.query_report_filters_by_name.company.get_value(),
 			"from_date": data.from_date || data.year_start_date,
 			"to_date": data.to_date || data.year_end_date,
-			"project": $.grep(frappe.query_report.filters, function(e){ return e.df.fieldname == 'project'; })[0].$input.val()
+			"project": (project && project.length > 0) ? project[0].$input.val() : ""
 		};
 		frappe.set_route("query-report", "General Ledger");
 	},
diff --git a/erpnext/public/js/payment/pos_payment.html b/erpnext/public/js/payment/pos_payment.html
index e94f3a5..185d748 100644
--- a/erpnext/public/js/payment/pos_payment.html
+++ b/erpnext/public/js/payment/pos_payment.html
@@ -1,20 +1,20 @@
 <div class="pos_payment row">
 	<div class="row" style="padding: 0px 30px;">
-		<h3>Total Amount: <span class="label label-default" style="font-size:20px;padding:5px">{%= format_currency(grand_total, currency) %}</span></h3>
+		<h3>{{ __("Total Amount") }}: <span class="label label-default" style="font-size:20px;padding:5px">{%= format_currency(grand_total, currency) %}</span></h3>
 	</div>
 	<div class="row amount-row">
 		<div class="col-xs-6 col-sm-3 text-center">
-			<p class="amount-label"> Paid <h3 class="paid_amount">{%= format_currency(paid_amount, currency) %}</h3></p>
+			<p class="amount-label"> {{ __("Paid") }} <h3 class="paid_amount">{%= format_currency(paid_amount, currency) %}</h3></p>
 		</div>
 		<div class="col-xs-6 col-sm-3 text-center">
-			<p class="amount-label"> Outstanding <h3 class="outstanding_amount">{%= format_currency(outstanding_amount, currency) %} </h3></p>
+			<p class="amount-label"> {{ __("Outstanding") }} <h3 class="outstanding_amount">{%= format_currency(outstanding_amount, currency) %} </h3></p>
 		</div>
 		<div class="col-xs-6 col-sm-3 text-center">
-			<p class="amount-label"> Change <input class="form-control text-right change_amount bold" type="text" idx="change_amount" value="{{format_number(change_amount, 2)}}">
+			<p class="amount-label"> {{ __("Change") }} <input class="form-control text-right change_amount bold" type="text" idx="change_amount" value="{{format_number(change_amount, null, 2)}}">
 			</p>
 		</div>
 		<div class="col-xs-6 col-sm-3 text-center">
-			<p class="amount-label"> Write off <input class="form-control text-right write_off_amount bold" type="text" idx="write_off_amount" value="{{format_number(write_off_amount, 2)}}">
+			<p class="amount-label"> {{ __("Write off") }} <input class="form-control text-right write_off_amount bold" type="text" idx="write_off_amount" value="{{format_number(write_off_amount, null, 2)}}">
 			</p>
 		</div>
 	</div>
@@ -33,7 +33,7 @@
 				</div>
 			{% } %}
 			<div class="row">
-				<button type="button"  class="btn btn-default delete-btn">Del</button>
+				<button type="button"  class="btn btn-default delete-btn">{{ __("Del") }}</button>
 				<button type="button"  class="btn btn-default pos-keyboard-key">0</button>
 				<button type="button"  class="btn btn-default pos-keyboard-key">.</button>
 			</div>
diff --git a/erpnext/public/js/pos/pos.html b/erpnext/public/js/pos/pos.html
index e356d87..181a41f 100644
--- a/erpnext/public/js/pos/pos.html
+++ b/erpnext/public/js/pos/pos.html
@@ -17,7 +17,7 @@
 						<div class="no-items-message text-extra-muted">
 							<span class="text-center">
 								<i class="fa fa-2x fa-shopping-cart"></i>
-								<p>Tap items to add them here</p>
+								<p>{{ __("Tap items to add them here") }}</p>
 							</span>
 						</div>
 						<div class="items">
@@ -68,7 +68,7 @@
 
 				</div>
 				<div class="col-xs-6 numeric_keypad hidden-xs" style="display:none">
-					{% var chartData = ["Qty", "Disc", "Price"] %} {% for(var i=0; i
+					{% var chartData = [__("Qty"), __("Disc"), __("Price")] %} {% for(var i=0; i
 					<3; i++) { %} <div class="row text-right">
 						{% for(var j=i*3; j
 						<(i+1)*3; j++) { %} <button type="button" class="btn btn-default numeric-keypad" val="{{j+1}}">{{j+1}}</button>
@@ -77,10 +77,10 @@
 				</div>
 				{% } %}
 				<div class="row text-right">
-					<button type="button" class="btn btn-default numeric-keypad numeric-del">Del</button>
+					<button type="button" class="btn btn-default numeric-keypad numeric-del">{{ __("Del") }}</button>
 					<button type="button" class="btn btn-default numeric-keypad" val="0">0</button>
 					<button type="button" class="btn btn-default numeric-keypad" val=".">.</button>
-					<button type="button" class="btn btn-primary numeric-keypad pos-pay">Pay</button>
+					<button type="button" class="btn btn-primary numeric-keypad pos-pay">{{ __("Pay") }}</button>
 				</div>
 			</div>
 		</div>
@@ -97,7 +97,7 @@
 			<div class="no-items-message text-extra-muted">
 				<span class="text-center">
 					<i class="fa fa-2x fa-user"></i>
-					<p>No Customers yet!</p>
+					<p>{{ __("No Customers yet!") }}</p>
 				</span>
 			</div>
 		</div>
@@ -112,7 +112,7 @@
 			<div class="pos-list-row pos-bill-header text-muted h6">
 				<div class="cell subject search-item-group">
 					<div class="dropdown">
-						<a class="text-muted dropdown-toggle" data-toggle="dropdown"><span class="dropdown-text">All Item Groups</span><i class="caret"></i></a>
+						<a class="text-muted dropdown-toggle" data-toggle="dropdown"><span class="dropdown-text">{{ __("All Item Groups") }}</span><i class="caret"></i></a>
 						<ul class="dropdown-menu">
 						</ul>
 					</div>
diff --git a/erpnext/public/js/pos/pos_item.html b/erpnext/public/js/pos/pos_item.html
index fbc380b..816dc3a 100644
--- a/erpnext/public/js/pos/pos_item.html
+++ b/erpnext/public/js/pos/pos_item.html
@@ -1,7 +1,7 @@
 <div class="pos-item-wrapper image-view-item" data-item-code="{{item_code}}">
 	<div class="image-view-header doclist-row">
 		<div class="list-value">
-			<a class="grey list-id" data-name="{{item_code}}" title="{{ item_name || item_code}}">{{item_name || item_code}}</a>
+			<a class="grey list-id" data-name="{{item_code}}" title="{{ item_name || item_code}}">{{item_name || item_code}}<br>({{ _(item_stock) }})</a>
 		</div>
 	</div>
 	<div class="image-view-body">
diff --git a/erpnext/public/js/pos/pos_selected_item.html b/erpnext/public/js/pos/pos_selected_item.html
index 65e4ef1..a4bc49d 100644
--- a/erpnext/public/js/pos/pos_selected_item.html
+++ b/erpnext/public/js/pos/pos_selected_item.html
@@ -1,22 +1,22 @@
 <div class="pos-selected-item-action" data-item-code="{%= item_code %}">
 	<div class="pos-list-row">
-		<div class="cell">Quantity:</div>
+		<div class="cell">{{ __("Quantity") }}:</div>
 		<input type="tel" class="form-control cell pos-item-qty" value="{%= qty %}"/>
 	</div>
 	<div class="pos-list-row">
-		<div class="cell">Price List Rate:</div>
+		<div class="cell">{{ __("Price List Rate") }}:</div>
 		<input type="tel" class="form-control cell" disabled value="{%= price_list_rate %}"/>
 	</div>
 	<div class="pos-list-row">
-		<div class="cell">Discount:</div>
+		<div class="cell">{{ __("Discount") }}:</div>
 		<input type="tel" class="form-control cell pos-item-disc" value="{%= discount_percentage %}">
 	</div>
 	<div class="pos-list-row">
-		<div class="cell">Price:</div>
+		<div class="cell">{{ __("Price") }}:</div>
 		<input type="tel" class="form-control cell pos-item-price" value="{%= rate %}"/>
 	</div> 
 	<div class="pos-list-row">
-		<div class="cell">Amount:</div>
+		<div class="cell">{{ __("Amount") }}:</div>
 		<input type="tel" class="form-control cell pos-amount" value="{%= amount %}"/>
 	</div>
 </div>
\ No newline at end of file
diff --git a/erpnext/public/js/schools/student_button.html b/erpnext/public/js/schools/student_button.html
index 4196808..3cf2592 100644
--- a/erpnext/public/js/schools/student_button.html
+++ b/erpnext/public/js/schools/student_button.html
@@ -3,7 +3,7 @@
         <label>
             <input 
                 type="checkbox"
-                data-idx="{{idx}}" 
+                data-group_roll_number="{{group_roll_number}}" 
                 data-student="{{student}}"
                 data-student-name="{{student_name}}"
                 class="students-check" 
@@ -11,7 +11,7 @@
                 checked
                 {% endif %}
                 >
-            {{ idx }} - {{ student_name }}
+            {{ group_roll_number }} - {{ student_name }}
         </label>
     </div>
 </div>
\ No newline at end of file
diff --git a/erpnext/public/js/sms_manager.js b/erpnext/public/js/sms_manager.js
index a06c43c..d6293ea 100644
--- a/erpnext/public/js/sms_manager.js
+++ b/erpnext/public/js/sms_manager.js
@@ -21,9 +21,9 @@
 		}
 
 		if (in_list(['Quotation', 'Sales Order', 'Delivery Note', 'Sales Invoice'], doc.doctype))
-			this.show(doc.contact_person, 'customer', doc.customer, '', default_msg[doc.doctype]);
+			this.show(doc.contact_person, 'Customer', doc.customer, '', default_msg[doc.doctype]);
 		else if (in_list(['Purchase Order', 'Purchase Receipt'], doc.doctype))
-			this.show(doc.contact_person, 'supplier', doc.supplier, '', default_msg[doc.doctype]);
+			this.show(doc.contact_person, 'Supplier', doc.supplier, '', default_msg[doc.doctype]);
 		else if (doc.doctype == 'Lead')
 			this.show('', '', '', doc.mobile_no, default_msg[doc.doctype]);
 		else if (doc.doctype == 'Opportunity')
@@ -33,13 +33,13 @@
 
 	};
 
-	this.get_contact_number = function(contact, key, value) {
+	this.get_contact_number = function(contact, ref_doctype, ref_name) {
 		frappe.call({
 			method: "erpnext.setup.doctype.sms_settings.sms_settings.get_contact_number",
 			args: {
-				contact_name:contact,
-				value:value,
-				key:key
+				contact_name: contact,
+				ref_doctype: ref_doctype,
+				ref_name: ref_name
 			},
 			callback: function(r) {
 				if(r.exc) { msgprint(r.exc); return; }
@@ -49,13 +49,13 @@
 		});
 	};
 
-	this.show = function(contact, key, value, mobile_nos, message) {
+	this.show = function(contact, ref_doctype, ref_name, mobile_nos, message) {
 		this.message = message;
 		if (mobile_nos) {
 			me.number = mobile_nos;
 			me.show_dialog();
 		} else if (contact){
-			this.get_contact_number(contact, key, value)
+			this.get_contact_number(contact, ref_doctype, ref_name)
 		} else {
 			me.show_dialog();
 		}
diff --git a/erpnext/public/js/templates/address_list.html b/erpnext/public/js/templates/address_list.html
index f9a317f..02b44b8 100644
--- a/erpnext/public/js/templates/address_list.html
+++ b/erpnext/public/js/templates/address_list.html
@@ -2,7 +2,7 @@
 <div class="clearfix"></div>
 {% for(var i=0, l=addr_list.length; i<l; i++) { %}
     <p class="h6">
-        {%= i+1 %}. {%= addr_list[i].address_type!="Other" ? addr_list[i].address_type : addr_list[i].address_title %}
+        {%= i+1 %}. {%= addr_list[i].address_type!="Other" ? __(addr_list[i].address_type) : addr_list[i].address_title %}
         {% if(addr_list[i].is_primary_address) { %}
             <span class="text-muted">({%= __("Primary") %})</span>{% } %}
         {% if(addr_list[i].is_shipping_address) { %}
diff --git a/erpnext/public/js/utils.js b/erpnext/public/js/utils.js
index 8865b50..3a2254e 100644
--- a/erpnext/public/js/utils.js
+++ b/erpnext/public/js/utils.js
@@ -114,63 +114,68 @@
 		}
 	}
 	var _map = function() {
-		// remove first item row if empty
 		if($.isArray(cur_frm.doc.items) && cur_frm.doc.items.length > 0) {
+			// remove first item row if empty
 			if(!cur_frm.doc.items[0].item_code) {
 				cur_frm.doc.items = cur_frm.doc.items.splice(1);
 			}
 
 			// find the doctype of the items table
 			var items_doctype = frappe.meta.get_docfield(cur_frm.doctype, 'items').options;
-			
+
 			// find the link fieldname from items table for the given
 			// source_doctype
 			var link_fieldname = null;
-			frappe.get_meta(items_doctype).fields.forEach(function(d) { 
+			frappe.get_meta(items_doctype).fields.forEach(function(d) {
 				if(d.options===opts.source_doctype) link_fieldname = d.fieldname; });
 
 			// search in existing items if the source_name is already set and full qty fetched
 			var already_set = false;
 			var item_qty_map = {};
-			
-			$.each(cur_frm.doc.items, function(i, d) {
-				if(d[link_fieldname]==opts.source_name) {
-					already_set = true;
-					if (item_qty_map[d.item_code])
-						item_qty_map[d.item_code] += flt(d.qty);
-					else
-						item_qty_map[d.item_code] = flt(d.qty);
-				}
-			});
-			
-			if(already_set) {
-				frappe.model.with_doc(opts.source_doctype, opts.source_name, function(r) {
-					var source_doc = frappe.model.get_doc(opts.source_doctype, opts.source_name);
-					$.each(source_doc.items || [], function(i, row) {
-						if(row.qty > flt(item_qty_map[row.item_code])) {
-							already_set = false;
-							return false;
-						}
-					})
-				})
 
-				if(already_set) {
-					frappe.msgprint(__("You have already selected items from {0} {1}", 
-						[opts.source_doctype, opts.source_name]));
-					return;
-				}
+			$.each(cur_frm.doc.items, function(i, d) {
+				opts.source_name.forEach(function(src) {
+					if(d[link_fieldname]==src) {
+						already_set = true;
+						if (item_qty_map[d.item_code])
+							item_qty_map[d.item_code] += flt(d.qty);
+						else
+							item_qty_map[d.item_code] = flt(d.qty);
+					}
+				});
+			});
+
+			if(already_set) {
+				opts.source_name.forEach(function(src) {
+					frappe.model.with_doc(opts.source_doctype, src, function(r) {
+						var source_doc = frappe.model.get_doc(opts.source_doctype, src);
+						$.each(source_doc.items || [], function(i, row) {
+							if(row.qty > flt(item_qty_map[row.item_code])) {
+								already_set = false;
+								return false;
+							}
+						})
+					})
+
+					if(already_set) {
+						frappe.msgprint(__("You have already selected items from {0} {1}",
+							[opts.source_doctype, src]));
+						return;
+					}
+
+				})
 			}
 		}
 
-
 		return frappe.call({
 			// Sometimes we hit the limit for URL length of a GET request
 			// as we send the full target_doc. Hence this is a POST request.
 			type: "POST",
-			method: opts.method,
+			method: 'frappe.model.mapper.map_docs',
 			args: {
-				"source_name": opts.source_name,
-				"target_doc": cur_frm.doc
+				"method": opts.method,
+				"source_names": opts.source_name,
+				"target_doc": cur_frm.doc,
 			},
 			callback: function(r) {
 				if(!r.exc) {
@@ -181,29 +186,26 @@
 		});
 	}
 	if(opts.source_doctype) {
-		var d = new frappe.ui.Dialog({
-			title: __("Get From ") + __(opts.source_doctype),
-			fields: [
-				{
-					fieldtype: "Link",
-					label: __(opts.source_doctype),
-					fieldname: opts.source_doctype,
-					options: opts.source_doctype,
-					get_query: opts.get_query,
-					reqd:1
-				},
-			]
+		var d = new frappe.ui.form.MultiSelectDialog({
+			doctype: opts.source_doctype,
+			target: opts.target,
+			date_field: opts.date_field || undefined,
+			setters: opts.setters,
+			get_query: opts.get_query,
+			action: function(selections, args) {
+				let values = selections;
+				if(values.length === 0){
+					frappe.msgprint(__("Please select Quotations"))
+					return;
+				}
+				opts.source_name = values;
+				opts.setters = args;
+				d.dialog.hide();
+				_map();
+			},
 		});
-		d.set_primary_action(__('Get Items'), function() {
-			var values = d.get_values();
-			if(!values)
-				return;
-			opts.source_name = values[opts.source_doctype];
-			d.hide();
-			_map();
-		})
-		d.show();
 	} else if(opts.source_name) {
+		opts.source_name = [opts.source_name];
 		_map();
 	}
 }
diff --git a/erpnext/public/js/utils/party.js b/erpnext/public/js/utils/party.js
index d132f92..19fe277 100644
--- a/erpnext/public/js/utils/party.js
+++ b/erpnext/public/js/utils/party.js
@@ -90,7 +90,7 @@
 			}
 		})
 	} else {
-		frm.set_value(display_field, null);
+		frm.set_value(display_field, '');
 	}
 };
 
diff --git a/erpnext/public/less/erpnext.less b/erpnext/public/less/erpnext.less
index c06bdf9..f6482eb 100644
--- a/erpnext/public/less/erpnext.less
+++ b/erpnext/public/less/erpnext.less
@@ -321,6 +321,10 @@
 		overflow: auto;
 		border: 1px solid @border-color;
 		border-top: none;
+
+		@media (max-width: @screen-xs) {
+			height: 30vh;
+		}
 	}
 
 	.no-items-message {
@@ -351,6 +355,10 @@
 
 		.image-field {
 			height: 140px;
+			
+			.placeholder-text {
+				font-size: 50px;
+			}
 		}
 
 		.pos-item-wrapper {
diff --git a/erpnext/public/less/website.less b/erpnext/public/less/website.less
index b733dab..79a89a0 100644
--- a/erpnext/public/less/website.less
+++ b/erpnext/public/less/website.less
@@ -36,8 +36,6 @@
 	background-size: cover;
 	background-repeat: no-repeat;
 	background-position: center top;
-	border-radius-top: 4px;
-	border-radius-right: 4px;
 }
 
 .product-image.missing-image {
@@ -51,10 +49,6 @@
 	color: @border-color;
 }
 
-.product-text {
-	padding: 15px 0px;
-}
-
 .product-search {
 	margin-bottom: 15px;
 }
@@ -316,6 +310,14 @@
 	padding: 15px;
 	word-wrap: break-word;
 	height: 75px;
+	display: block; /* Fallback for non-webkit */
+	display: -webkit-box;
+	max-width: 100%;
+	margin: 0 auto;
+	-webkit-line-clamp: 3;
+	-webkit-box-orient: vertical;
+	overflow: hidden;
+	text-overflow: ellipsis;
 }
 
 .product-image-wrapper {
diff --git a/erpnext/schools/api.py b/erpnext/schools/api.py
index 623b1e0..43d2438 100644
--- a/erpnext/schools/api.py
+++ b/erpnext/schools/api.py
@@ -33,26 +33,26 @@
 	return program_enrollment
 
 @frappe.whitelist()
-def check_attendance_records_exist(course_schedule=None, student_batch=None, date=None):
-	"""Check if Attendance Records are made against the specified Course Schedule or Student Batch for given date.
+def check_attendance_records_exist(course_schedule=None, student_group=None, date=None):
+	"""Check if Attendance Records are made against the specified Course Schedule or Student Group for given date.
 
 	:param course_schedule: Course Schedule.
-	:param student_batch: Student Batch.
+	:param student_group: Student Group.
 	:param date: Date.
 	"""
 	if course_schedule:
 		return frappe.get_list("Student Attendance", filters={"course_schedule": course_schedule})
 	else:
-		return frappe.get_list("Student Attendance", filters={"student_batch": student_batch, "date": date})
+		return frappe.get_list("Student Attendance", filters={"student_group": student_group, "date": date})
 
 @frappe.whitelist()
-def mark_attendance(students_present, students_absent, course_schedule=None, student_batch=None, date=None):
+def mark_attendance(students_present, students_absent, course_schedule=None, student_group=None, date=None):
 	"""Creates Multiple Attendance Records.
 
 	:param students_present: Students Present JSON.
 	:param students_absent: Students Absent JSON.
 	:param course_schedule: Course Schedule.
-	:param student_batch: Student Batch.
+	:param student_group: Student Group.
 	:param date: Date.
 	"""
 	 
@@ -60,15 +60,15 @@
 	absent = json.loads(students_absent)
 	
 	for d in present:
-		make_attendance_records(d["student"], d["student_name"], "Present", course_schedule, student_batch, date)
+		make_attendance_records(d["student"], d["student_name"], "Present", course_schedule, student_group, date)
 
 	for d in absent:
-		make_attendance_records(d["student"], d["student_name"], "Absent", course_schedule, student_batch, date)
+		make_attendance_records(d["student"], d["student_name"], "Absent", course_schedule, student_group, date)
 
 	frappe.db.commit()
 	frappe.msgprint(_("Attendance has been marked successfully."))
 
-def make_attendance_records(student, student_name, status, course_schedule=None, student_batch=None, date=None):
+def make_attendance_records(student, student_name, status, course_schedule=None, student_group=None, date=None):
 	"""Creates/Update Attendance Record.
 
 	:param student: Student.
@@ -79,7 +79,7 @@
 	student_attendance_list = frappe.get_list("Student Attendance", fields = ['name'], filters = {
 		"student": student,
 		"course_schedule": course_schedule,
-		"student_batch": student_batch,
+		"student_group": student_group,
 		"date": date
 	})
 		
@@ -90,7 +90,7 @@
 	student_attendance.student = student
 	student_attendance.student_name = student_name
 	student_attendance.course_schedule = course_schedule
-	student_attendance.student_batch = student_batch
+	student_attendance.student_group = student_group
 	student_attendance.date = date
 	student_attendance.status = status
 	student_attendance.save()
@@ -106,23 +106,13 @@
 	return guardians
 
 @frappe.whitelist()
-def get_student_batch_students(student_batch):
-	"""Returns List of student, student_name, idx in Student Batch.
-
-	:param student_batch: Student Batch.
-	"""
-	students = frappe.get_list("Student Batch Student", fields=["student", "student_name", "idx"] , 
-		filters={"parent": student_batch, "active": 1}, order_by= "idx")
-	return students
-
-@frappe.whitelist()
 def get_student_group_students(student_group):
 	"""Returns List of student, student_name in Student Group.
 
 	:param student_group: Student Group.
 	"""
 	students = frappe.get_list("Student Group Student", fields=["student", "student_name"] , 
-		filters={"parent": student_group, "active": 1}, order_by= "idx")
+		filters={"parent": student_group, "active": 1}, order_by= "group_roll_number")
 	return students
 
 @frappe.whitelist()
@@ -199,12 +189,9 @@
 		fields=["assessment_criteria", "weightage"], filters={"parent": course}, order_by= "idx")
 
 @frappe.whitelist()
-def get_assessment_students(assessment_plan, student_group=None, student_batch=None):
-	student_list = []
-	if student_group:
-		student_list = get_student_group_students(student_group)
-	elif student_batch:
-		student_list = get_student_batch_students(student_batch)
+def get_assessment_students(assessment_plan, student_group):
+	
+	student_list = get_student_group_students(student_group)
 	for i, student in enumerate(student_list):
 		result = get_result(student.student, assessment_plan)
 		if result:
@@ -286,8 +273,6 @@
 		email_group.save()
 	email_list = []
 	students = []
-	if doctype == "Student Batch":
-		students = get_student_batch_students(name)
 	if doctype == "Student Group":
 		students = get_student_group_students(name)
 	for stud in students:
diff --git a/erpnext/schools/doctype/assessment_code/assessment_code.js b/erpnext/schools/doctype/assessment_code/assessment_code.js
deleted file mode 100644
index 143791b..0000000
--- a/erpnext/schools/doctype/assessment_code/assessment_code.js
+++ /dev/null
@@ -1,8 +0,0 @@
-// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
-// For license information, please see license.txt
-
-frappe.ui.form.on('Assessment Code', {
-	refresh: function(frm) {
-
-	}
-});
diff --git a/erpnext/schools/doctype/assessment_code/assessment_code.json b/erpnext/schools/doctype/assessment_code/assessment_code.json
deleted file mode 100644
index d3acf7a..0000000
--- a/erpnext/schools/doctype/assessment_code/assessment_code.json
+++ /dev/null
@@ -1,89 +0,0 @@
-{
- "allow_copy": 0, 
- "allow_import": 1, 
- "allow_rename": 1, 
- "autoname": "field:assessment_code", 
- "beta": 0, 
- "creation": "2017-02-13 19:33:43.843028", 
- "custom": 0, 
- "docstatus": 0, 
- "doctype": "DocType", 
- "document_type": "", 
- "editable_grid": 1, 
- "engine": "InnoDB", 
- "fields": [
-  {
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "assessment_code", 
-   "fieldtype": "Data", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_list_view": 0, 
-   "in_standard_filter": 0, 
-   "label": "Assessment Code", 
-   "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
-  }
- ], 
- "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-13 19:33:47.037170", 
- "modified_by": "Administrator", 
- "module": "Schools", 
- "name": "Assessment Code", 
- "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": 1, 
- "read_only": 0, 
- "read_only_onload": 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/assessment_code/test_assessment_code.py b/erpnext/schools/doctype/assessment_code/test_assessment_code.py
deleted file mode 100644
index d6ccb8f..0000000
--- a/erpnext/schools/doctype/assessment_code/test_assessment_code.py
+++ /dev/null
@@ -1,12 +0,0 @@
-# -*- coding: utf-8 -*-
-# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
-# See license.txt
-from __future__ import unicode_literals
-
-import frappe
-import unittest
-
-# test_records = frappe.get_test_records('Assessment Code')
-
-class TestAssessmentCode(unittest.TestCase):
-	pass
diff --git a/erpnext/schools/doctype/assessment_plan/assessment_plan.js b/erpnext/schools/doctype/assessment_plan/assessment_plan.js
index 9685e0e..3c9ab80 100644
--- a/erpnext/schools/doctype/assessment_plan/assessment_plan.js
+++ b/erpnext/schools/doctype/assessment_plan/assessment_plan.js
@@ -2,16 +2,16 @@
 // For license information, please see license.txt
 
 cur_frm.add_fetch("student_group", "course", "course");
-cur_frm.add_fetch("student_group", "student_batch", "student_batch");
 cur_frm.add_fetch("examiner", "instructor_name", "examiner_name");
 cur_frm.add_fetch("supervisor", "instructor_name", "supervisor_name");
 
 frappe.ui.form.on("Assessment Plan", {
         refresh: function(frm) {
-        if (!frm.doc.__islocal) {
+        if (frm.doc.docstatus == 1) {
             frm.add_custom_button(__("Assessment Result"), function() {
                 frappe.route_options = {
-                    assessment_plan: frm.doc.name
+                    assessment_plan: frm.doc.name,
+                    student_group: frm.doc.student_group
                 }
                 frappe.set_route("Form", "Assessment Result Tool");
             });
diff --git a/erpnext/schools/doctype/assessment_plan/assessment_plan.json b/erpnext/schools/doctype/assessment_plan/assessment_plan.json
index a5bcc70..697a0d4 100644
--- a/erpnext/schools/doctype/assessment_plan/assessment_plan.json
+++ b/erpnext/schools/doctype/assessment_plan/assessment_plan.json
@@ -1,5 +1,6 @@
 {
  "allow_copy": 0, 
+ "allow_guest_to_view": 0, 
  "allow_import": 1, 
  "allow_rename": 0, 
  "autoname": "field:assessment_name", 
@@ -13,6 +14,7 @@
  "engine": "InnoDB", 
  "fields": [
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -42,23 +44,24 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
-   "fieldname": "assessment_code", 
+   "fieldname": "student_group", 
    "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": "Assessment Code", 
+   "in_global_search": 1, 
+   "in_list_view": 1, 
+   "in_standard_filter": 1, 
+   "label": "Student Group", 
    "length": 0, 
    "no_copy": 0, 
-   "options": "Assessment Code", 
+   "options": "Student Group", 
    "permlevel": 0, 
    "precision": "", 
    "print_hide": 0, 
@@ -72,64 +75,7 @@
    "unique": 0
   }, 
   {
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "assessment_group", 
-   "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": "Assessment Group", 
-   "length": 0, 
-   "no_copy": 0, 
-   "options": "Assessment Group", 
-   "permlevel": 0, 
-   "precision": "", 
-   "print_hide": 0, 
-   "print_hide_if_no_value": 0, 
-   "read_only": 0, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 0, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "unique": 0
-  }, 
-  {
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "column_break_2", 
-   "fieldtype": "Column Break", 
-   "hidden": 0, 
-   "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, 
@@ -160,6 +106,67 @@
    "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, 
+   "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": "assessment_group", 
+   "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": "Assessment Group", 
+   "length": 0, 
+   "no_copy": 0, 
+   "options": "Assessment Group", 
+   "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, 
@@ -189,6 +196,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -219,122 +227,7 @@
    "unique": 0
   }, 
   {
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "section_break_10", 
-   "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_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "student_group", 
-   "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": "Student Group", 
-   "length": 0, 
-   "no_copy": 0, 
-   "options": "Student Group", 
-   "permlevel": 0, 
-   "precision": "", 
-   "print_hide": 0, 
-   "print_hide_if_no_value": 0, 
-   "read_only": 0, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 0, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "unique": 0
-  }, 
-  {
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "column_break_10", 
-   "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_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": 1, 
-   "in_list_view": 0, 
-   "in_standard_filter": 0, 
-   "label": "Student Batch", 
-   "length": 0, 
-   "no_copy": 0, 
-   "options": "Student Batch", 
-   "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, 
@@ -366,6 +259,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -396,6 +290,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -426,6 +321,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -456,6 +352,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -485,6 +382,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -513,6 +411,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -542,6 +441,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -571,6 +471,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -601,6 +502,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -630,6 +532,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -658,6 +561,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -688,6 +592,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -717,18 +622,18 @@
    "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": 1, 
  "issingle": 0, 
  "istable": 0, 
  "max_attachments": 0, 
  "menu_index": 0, 
- "modified": "2017-02-13 19:34:09.724549", 
+ "modified": "2017-05-02 12:54:11.991616", 
  "modified_by": "Administrator", 
  "module": "Schools", 
  "name": "Assessment Plan", 
diff --git a/erpnext/schools/doctype/assessment_plan/assessment_plan.py b/erpnext/schools/doctype/assessment_plan/assessment_plan.py
index 31e96aa..7f83c01 100644
--- a/erpnext/schools/doctype/assessment_plan/assessment_plan.py
+++ b/erpnext/schools/doctype/assessment_plan/assessment_plan.py
@@ -9,21 +9,15 @@
 
 class AssessmentPlan(Document):
 	def validate(self):
-		if not (self.student_batch or self.student_group):
-			frappe.throw(_("Please select Student Group or Student Batch"))
-		self.validate_student_batch()
 		self.validate_overlap()
 		self.validate_max_score()
 
 	def validate_overlap(self):
-		"""Validates overlap for Student Group/Student Batch, Instructor, Room"""
+		"""Validates overlap for Student Group, Instructor, Room"""
 		
 		from erpnext.schools.utils import validate_overlap_for
 
 		#Validate overlapping course schedules.
-		if self.student_batch:
-			validate_overlap_for(self, "Course Schedule", "student_batch")
-
 		if self.student_group:
 			validate_overlap_for(self, "Course Schedule", "student_group")
 		
@@ -31,19 +25,12 @@
 		validate_overlap_for(self, "Course Schedule", "room")
 
 		#validate overlapping assessment schedules.
-		if self.student_batch:
-			validate_overlap_for(self, "Assessment Plan", "student_batch")
-		
 		if self.student_group:
 			validate_overlap_for(self, "Assessment Plan", "student_group")
 		
 		validate_overlap_for(self, "Assessment Plan", "room")
 		validate_overlap_for(self, "Assessment Plan", "supervisor", self.supervisor)
 
-	def validate_student_batch(self):
-		if self.student_group:
-			self.student_batch = frappe.db.get_value("Student Group", self.student_group, "student_batch")
-
 	def validate_max_score(self):
 		max_score = 0
 		for d in self.assessment_criteria:
diff --git a/erpnext/schools/doctype/assessment_result_tool/assessment_result_tool.js b/erpnext/schools/doctype/assessment_result_tool/assessment_result_tool.js
index 8fd670e..3cadea6 100644
--- a/erpnext/schools/doctype/assessment_result_tool/assessment_result_tool.js
+++ b/erpnext/schools/doctype/assessment_result_tool/assessment_result_tool.js
@@ -1,22 +1,26 @@
+
 // Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
 // For license information, please see license.txt
 
 cur_frm.add_fetch("assessment_plan", "student_group", "student_group");
-cur_frm.add_fetch("assessment_plan", "student_batch", "student_batch");
 
 frappe.ui.form.on('Assessment Result Tool', {
-    refresh: function(frm) {
-       frm.disable_save();
-	   frm.page.clear_indicator();
-    },
+	refresh: function(frm) {
+		if (frappe.route_options) {
+			frm.set_value("student_group", frappe.route_options.student_group);
+			frm.set_value("assessment_plan", frappe.route_options.assessment_plan);
+			frappe.route_options = null;
+		}
+		frm.disable_save();
+		frm.page.clear_indicator();
+	},
 
 	assessment_plan: function(frm) {
-		if(!(frm.doc.student_batch || frm.doc.student_group)) return;
+		if(!frm.doc.student_group) return;
 		frappe.call({
 			method: "erpnext.schools.api.get_assessment_students",
 			args: {
 				"assessment_plan": frm.doc.assessment_plan,
-				"student_batch": frm.doc.student_batch,
 				"student_group": frm.doc.student_group
 			},
 			callback: function(r) {
diff --git a/erpnext/schools/doctype/assessment_result_tool/assessment_result_tool.json b/erpnext/schools/doctype/assessment_result_tool/assessment_result_tool.json
index 87dff4d..d82aaf5 100644
--- a/erpnext/schools/doctype/assessment_result_tool/assessment_result_tool.json
+++ b/erpnext/schools/doctype/assessment_result_tool/assessment_result_tool.json
@@ -1,5 +1,6 @@
 {
  "allow_copy": 1, 
+ "allow_guest_to_view": 0, 
  "allow_import": 0, 
  "allow_rename": 0, 
  "beta": 0, 
@@ -12,6 +13,7 @@
  "engine": "InnoDB", 
  "fields": [
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -23,6 +25,7 @@
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
    "in_filter": 0, 
+   "in_global_search": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Assessment Plan", 
@@ -42,6 +45,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -52,6 +56,7 @@
    "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, 
@@ -69,6 +74,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -79,6 +85,7 @@
    "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 Group", 
@@ -92,41 +99,13 @@
    "read_only": 1, 
    "remember_last_selected_value": 0, 
    "report_hide": 0, 
-   "reqd": 0, 
+   "reqd": 1, 
    "search_index": 0, 
    "set_only_once": 0, 
    "unique": 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_list_view": 0, 
-   "in_standard_filter": 0, 
-   "label": "Student Batch", 
-   "length": 0, 
-   "no_copy": 0, 
-   "options": "Student Batch", 
-   "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, 
@@ -138,6 +117,7 @@
    "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, 
@@ -155,6 +135,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -165,6 +146,7 @@
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
    "in_filter": 0, 
+   "in_global_search": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Result HTML", 
@@ -183,17 +165,17 @@
    "unique": 0
   }
  ], 
+ "has_web_view": 0, 
  "hide_heading": 1, 
  "hide_toolbar": 1, 
  "idx": 0, 
  "image_view": 0, 
  "in_create": 0, 
- "in_dialog": 0, 
  "is_submittable": 0, 
  "issingle": 1, 
  "istable": 0, 
  "max_attachments": 0, 
- "modified": "2017-01-05 15:45:59.338722", 
+ "modified": "2017-05-02 15:12:30.953036", 
  "modified_by": "Administrator", 
  "module": "Schools", 
  "name": "Assessment Result Tool", 
@@ -210,7 +192,6 @@
    "export": 0, 
    "if_owner": 0, 
    "import": 0, 
-   "is_custom": 0, 
    "permlevel": 0, 
    "print": 1, 
    "read": 1, 
@@ -225,6 +206,7 @@
  "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, 
diff --git a/erpnext/schools/doctype/attendance_tool_student/__init__.py b/erpnext/schools/doctype/attendance_tool_student/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/erpnext/schools/doctype/attendance_tool_student/__init__.py
+++ /dev/null
diff --git a/erpnext/schools/doctype/attendance_tool_student/attendance_tool_student.json b/erpnext/schools/doctype/attendance_tool_student/attendance_tool_student.json
deleted file mode 100644
index 731de83..0000000
--- a/erpnext/schools/doctype/attendance_tool_student/attendance_tool_student.json
+++ /dev/null
@@ -1,114 +0,0 @@
-{
- "allow_copy": 0, 
- "allow_import": 0, 
- "allow_rename": 0, 
- "beta": 0, 
- "creation": "2015-11-10 16:28:51.366668", 
- "custom": 0, 
- "docstatus": 0, 
- "doctype": "DocType", 
- "document_type": "", 
- "editable_grid": 1, 
- "fields": [
-  {
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "fieldname": "student", 
-   "fieldtype": "Link", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_list_view": 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, 
-   "report_hide": 0, 
-   "reqd": 1, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "unique": 0
-  }, 
-  {
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "fieldname": "student_name", 
-   "fieldtype": "Data", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_list_view": 1, 
-   "label": "Student Name", 
-   "length": 0, 
-   "no_copy": 0, 
-   "permlevel": 0, 
-   "precision": "", 
-   "print_hide": 0, 
-   "print_hide_if_no_value": 0, 
-   "read_only": 1, 
-   "report_hide": 0, 
-   "reqd": 0, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "unique": 0
-  }, 
-  {
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "fieldname": "status", 
-   "fieldtype": "Select", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_list_view": 0, 
-   "label": "Status", 
-   "length": 0, 
-   "no_copy": 0, 
-   "options": "Absent\nPresent\n", 
-   "permlevel": 0, 
-   "precision": "", 
-   "print_hide": 0, 
-   "print_hide_if_no_value": 0, 
-   "read_only": 0, 
-   "report_hide": 0, 
-   "reqd": 0, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "unique": 0
-  }
- ], 
- "hide_heading": 0, 
- "hide_toolbar": 0, 
- "idx": 0, 
- "image_view": 0, 
- "in_create": 0, 
- "in_dialog": 0, 
- "is_submittable": 0, 
- "issingle": 0, 
- "istable": 1, 
- "max_attachments": 0, 
- "modified": "2016-07-21 12:30:02.983801", 
- "modified_by": "Administrator", 
- "module": "Schools", 
- "name": "Attendance Tool Student", 
- "name_case": "", 
- "owner": "Administrator", 
- "permissions": [], 
- "quick_entry": 0, 
- "read_only": 0, 
- "read_only_onload": 0, 
- "sort_field": "modified", 
- "sort_order": "DESC", 
- "track_seen": 0
-}
\ No newline at end of file
diff --git a/erpnext/schools/doctype/attendance_tool_student/attendance_tool_student.py b/erpnext/schools/doctype/attendance_tool_student/attendance_tool_student.py
deleted file mode 100644
index 99a89d9..0000000
--- a/erpnext/schools/doctype/attendance_tool_student/attendance_tool_student.py
+++ /dev/null
@@ -1,10 +0,0 @@
-# -*- coding: utf-8 -*-
-# Copyright (c) 2015, Frappe Technologies and contributors
-# For license information, please see license.txt
-
-from __future__ import unicode_literals
-import frappe
-from frappe.model.document import Document
-
-class AttendanceToolStudent(Document):
-	pass
diff --git a/erpnext/schools/doctype/course/.txt b/erpnext/schools/doctype/course/.txt
deleted file mode 100644
index e69de29..0000000
--- a/erpnext/schools/doctype/course/.txt
+++ /dev/null
diff --git a/erpnext/schools/doctype/course/course.js b/erpnext/schools/doctype/course/course.js
index c667eca..f84c59f 100644
--- a/erpnext/schools/doctype/course/course.js
+++ b/erpnext/schools/doctype/course/course.js
@@ -1,30 +1,18 @@
 frappe.ui.form.on("Course", "refresh", function(frm) {
 	if(!cur_frm.doc.__islocal) {
 		frm.add_custom_button(__("Program"), function() {
-			frappe.route_options = {
-				"Program Course.course": frm.doc.name
-			}
 			frappe.set_route("List", "Program");
 		});
 		
 		frm.add_custom_button(__("Student Group"), function() {
-			frappe.route_options = {
-				course: frm.doc.name
-			}
 			frappe.set_route("List", "Student Group");
 		});
 		
 		frm.add_custom_button(__("Course Schedule"), function() {
-			frappe.route_options = {
-				course: frm.doc.name
-			}
 			frappe.set_route("List", "Course Schedule");
 		});
 		
 		frm.add_custom_button(__("Assessment Plan"), function() {
-			frappe.route_options = {
-				course: frm.doc.name
-			}
 			frappe.set_route("List", "Assessment Plan");
 		});
 	}
diff --git a/erpnext/schools/doctype/course/course.json b/erpnext/schools/doctype/course/course.json
index d1ca261..b6eda12 100644
--- a/erpnext/schools/doctype/course/course.json
+++ b/erpnext/schools/doctype/course/course.json
@@ -1,8 +1,9 @@
 {
  "allow_copy": 0, 
+ "allow_guest_to_view": 0, 
  "allow_import": 1, 
  "allow_rename": 1, 
- "autoname": "field:course_name", 
+ "autoname": "field:course_code", 
  "beta": 0, 
  "creation": "2015-09-07 12:39:55.181893", 
  "custom": 0, 
@@ -24,7 +25,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": "Course Name", 
    "length": 0, 
@@ -46,16 +47,46 @@
    "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
-   "fieldname": "course_code", 
-   "fieldtype": "Data", 
+   "fieldname": "department", 
+   "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": "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_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "fieldname": "parent_course", 
+   "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": "Course Code", 
+   "label": "Parent Course (Leave blank, if this isn't part of Parent Course)", 
    "length": 0, 
    "no_copy": 0, 
    "permlevel": 0, 
@@ -103,7 +134,7 @@
    "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
-   "fieldname": "course_abbreviation", 
+   "fieldname": "course_code", 
    "fieldtype": "Data", 
    "hidden": 0, 
    "ignore_user_permissions": 0, 
@@ -112,7 +143,7 @@
    "in_global_search": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
-   "label": "Course Abbreviation", 
+   "label": "Course Code", 
    "length": 0, 
    "no_copy": 0, 
    "permlevel": 0, 
@@ -122,7 +153,7 @@
    "read_only": 0, 
    "remember_last_selected_value": 0, 
    "report_hide": 0, 
-   "reqd": 0, 
+   "reqd": 1, 
    "search_index": 0, 
    "set_only_once": 0, 
    "unique": 0
@@ -132,19 +163,18 @@
    "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
-   "fieldname": "department", 
-   "fieldtype": "Link", 
+   "fieldname": "course_abbreviation", 
+   "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": 1, 
-   "label": "Department", 
+   "in_standard_filter": 0, 
+   "label": "Course Abbreviation", 
    "length": 0, 
    "no_copy": 0, 
-   "options": "Department", 
    "permlevel": 0, 
    "precision": "", 
    "print_hide": 0, 
@@ -304,18 +334,18 @@
    "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, 
  "menu_index": 0, 
- "modified": "2017-02-17 17:22:36.450073", 
+ "modified": "2017-04-12 20:44:42.048564", 
  "modified_by": "Administrator", 
  "module": "Schools", 
  "name": "Course", 
@@ -366,7 +396,7 @@
  "quick_entry": 0, 
  "read_only": 0, 
  "read_only_onload": 0, 
- "search_fields": "department", 
+ "search_fields": "course_name", 
  "show_name_in_global_search": 1, 
  "sort_field": "modified", 
  "sort_order": "DESC", 
diff --git a/erpnext/schools/doctype/course/course.py b/erpnext/schools/doctype/course/course.py
index 0ac11ec..69d2fca 100644
--- a/erpnext/schools/doctype/course/course.py
+++ b/erpnext/schools/doctype/course/course.py
@@ -15,6 +15,6 @@
 		if self.assessment_criteria:
 			total_weightage = 0
 			for criteria in self.assessment_criteria:
-				total_weightage += criteria.weightage
+				total_weightage += criteria.weightage or 0
 			if total_weightage != 100:
 				frappe.throw(_("Total Weightage of all Assessment Criteria must be 100%"))
diff --git a/erpnext/schools/doctype/course_assessment_criteria/course_assessment_criteria.json b/erpnext/schools/doctype/course_assessment_criteria/course_assessment_criteria.json
index 6646d20..652aa0d 100644
--- a/erpnext/schools/doctype/course_assessment_criteria/course_assessment_criteria.json
+++ b/erpnext/schools/doctype/course_assessment_criteria/course_assessment_criteria.json
@@ -1,5 +1,6 @@
 {
  "allow_copy": 0, 
+ "allow_guest_to_view": 0, 
  "allow_import": 0, 
  "allow_rename": 0, 
  "autoname": "", 
@@ -23,6 +24,7 @@
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
    "in_filter": 0, 
+   "in_global_search": 0, 
    "in_list_view": 1, 
    "in_standard_filter": 0, 
    "label": "Assessment Criteria", 
@@ -52,6 +54,7 @@
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
    "in_filter": 0, 
+   "in_global_search": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "", 
@@ -80,6 +83,7 @@
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
    "in_filter": 0, 
+   "in_global_search": 0, 
    "in_list_view": 1, 
    "in_standard_filter": 0, 
    "label": "Weightage", 
@@ -92,23 +96,23 @@
    "read_only": 0, 
    "remember_last_selected_value": 0, 
    "report_hide": 0, 
-   "reqd": 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, 
- "in_dialog": 0, 
  "is_submittable": 0, 
  "issingle": 0, 
  "istable": 1, 
  "max_attachments": 0, 
- "modified": "2017-02-01 18:01:40.682674", 
+ "modified": "2017-04-21 20:04:26.621419", 
  "modified_by": "Administrator", 
  "module": "Schools", 
  "name": "Course Assessment Criteria", 
@@ -118,6 +122,7 @@
  "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, 
diff --git a/erpnext/schools/doctype/course_schedule/course_schedule.js b/erpnext/schools/doctype/course_schedule/course_schedule.js
index 12e8522..6521469 100644
--- a/erpnext/schools/doctype/course_schedule/course_schedule.js
+++ b/erpnext/schools/doctype/course_schedule/course_schedule.js
@@ -1,5 +1,6 @@
 frappe.provide("schools")
 
+cur_frm.add_fetch("student_group", "course", "course")
 frappe.ui.form.on("Course Schedule", {
     refresh: function(frm) {
         if (!frm.doc.__islocal) {
diff --git a/erpnext/schools/doctype/course_schedule/course_schedule.json b/erpnext/schools/doctype/course_schedule/course_schedule.json
index d678d28..f70db4e 100644
--- a/erpnext/schools/doctype/course_schedule/course_schedule.json
+++ b/erpnext/schools/doctype/course_schedule/course_schedule.json
@@ -1,5 +1,6 @@
 {
  "allow_copy": 0, 
+ "allow_guest_to_view": 0, 
  "allow_import": 1, 
  "allow_rename": 0, 
  "autoname": "naming_series:", 
@@ -13,36 +14,7 @@
  "engine": "InnoDB", 
  "fields": [
   {
-   "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": 1, 
-   "in_list_view": 0, 
-   "in_standard_filter": 0, 
-   "label": "Student Batch", 
-   "length": 0, 
-   "no_copy": 0, 
-   "options": "Student Batch", 
-   "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, 
@@ -67,12 +39,13 @@
    "read_only": 0, 
    "remember_last_selected_value": 0, 
    "report_hide": 0, 
-   "reqd": 0, 
+   "reqd": 1, 
    "search_index": 0, 
    "set_only_once": 0, 
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -103,6 +76,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -133,6 +107,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -161,6 +136,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -192,6 +168,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -222,6 +199,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -250,6 +228,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -280,6 +259,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -310,6 +290,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -338,6 +319,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -367,6 +349,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -396,6 +379,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -425,18 +409,18 @@
    "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, 
  "menu_index": 0, 
- "modified": "2017-02-17 17:14:46.074804", 
+ "modified": "2017-05-02 12:12:35.785061", 
  "modified_by": "Administrator", 
  "module": "Schools", 
  "name": "Course Schedule", 
diff --git a/erpnext/schools/doctype/course_schedule/course_schedule.py b/erpnext/schools/doctype/course_schedule/course_schedule.py
index 7550ab1..845f5f5 100644
--- a/erpnext/schools/doctype/course_schedule/course_schedule.py
+++ b/erpnext/schools/doctype/course_schedule/course_schedule.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+	# -*- coding: utf-8 -*-
 # Copyright (c) 2015, Frappe Technologies and contributors
 # For license information, please see license.txt
 
@@ -11,42 +11,30 @@
 	def validate(self):
 		self.instructor_name = frappe.db.get_value("Instructor", self.instructor, "instructor_name")
 		self.set_title()
-		self.validate_mandatory()
 		self.validate_course()
-		self.set_student_batch()
 		self.validate_date()
 		self.validate_overlap()
 	
 	def set_title(self):
 		"""Set document Title"""
 		self.title = self.course + " by " + (self.instructor_name if self.instructor_name else self.instructor)
-
-	def validate_mandatory(self):
-		if not (self.student_batch or self.student_group):
-			frappe.throw(_("""Student Batch or Student Group is mandatory"""))
 	
 	def validate_course(self):
-		if self.student_group:
-			self.course= frappe.db.get_value("Student Group", self.student_group, "course")
-	
-	def set_student_batch(self):
-		if self.student_group:
-			self.student_batch = frappe.db.get_value("Student Group", self.student_group, "student_batch")
-	
+		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
+
 	def validate_date(self):
 		"""Validates if from_time is greater than to_time"""
 		if self.from_time > self.to_time:
 			frappe.throw(_("From Time cannot be greater than To Time."))
 	
 	def validate_overlap(self):
-		"""Validates overlap for Student Group/Student Batch, Instructor, Room"""
+		"""Validates overlap for Student Group, Instructor, Room"""
 		
 		from erpnext.schools.utils import validate_overlap_for
 
 		#Validate overlapping course schedules.
-		if self.student_batch:
-			validate_overlap_for(self, "Course Schedule", "student_batch")
-
 		if self.student_group:
 			validate_overlap_for(self, "Course Schedule", "student_group")
 		
@@ -54,9 +42,6 @@
 		validate_overlap_for(self, "Course Schedule", "room")
 
 		#validate overlapping assessment schedules.
-		if self.student_batch:
-			validate_overlap_for(self, "Assessment Plan", "student_batch")
-		
 		if self.student_group:
 			validate_overlap_for(self, "Assessment Plan", "student_group")
 		
diff --git a/erpnext/schools/doctype/course_schedule/test_course_schedule.py b/erpnext/schools/doctype/course_schedule/test_course_schedule.py
index e9fce4b..6a3456f 100644
--- a/erpnext/schools/doctype/course_schedule/test_course_schedule.py
+++ b/erpnext/schools/doctype/course_schedule/test_course_schedule.py
@@ -24,28 +24,28 @@
 		cs1 = make_course_schedule_test_record(simulate= True)
 		
 		cs2 = make_course_schedule_test_record(from_time= cs1.from_time, to_time= cs1.to_time, 
-			student_group="TC2-TP-2014-2015-2014-2015 (_Test Academic Term)", room="RM0002", do_not_save= 1)
+			student_group="Course-TC101-2014-2015 (_Test Academic Term)", room="RM0002", do_not_save= 1)
 		self.assertRaises(OverlapError, cs2.save)
 
 	def test_room_conflict(self):
 		cs1 = make_course_schedule_test_record(simulate= True)
 		
 		cs2 = make_course_schedule_test_record(from_time= cs1.from_time, to_time= cs1.to_time, 
-			student_group="TC2-TP-2014-2015-2014-2015 (_Test Academic Term)", instructor="_T-Instructor-00002", do_not_save= 1)
+			student_group="Course-TC101-2014-2015 (_Test Academic Term)", instructor="_T-Instructor-00002", do_not_save= 1)
 		self.assertRaises(OverlapError, cs2.save)
 		
 	def test_no_conflict(self):
 		cs1 = make_course_schedule_test_record(simulate= True)
 		
 		make_course_schedule_test_record(from_time= cs1.from_time, to_time= cs1.to_time, 
-			student_group="TC2-TP-2014-2015-2014-2015 (_Test Academic Term)", instructor="_T-Instructor-00002", room="RM0002")
+			student_group="Course-TC102-2014-2015 (_Test Academic Term)", instructor="_T-Instructor-00002", room="RM0002")
 
 def make_course_schedule_test_record(**args):
 	args = frappe._dict(args)
 
 	course_schedule = frappe.new_doc("Course Schedule")
-	course_schedule.student_group = args.student_group or "TC-TP-2014-2015-2014-2015 (_Test Academic Term)"
-	course_schedule.course = args.course or "_Test Course"
+	course_schedule.student_group = args.student_group or "Course-TC101-2014-2015 (_Test Academic Term)"
+	course_schedule.course = args.course or "TC101"
 	course_schedule.instructor = args.instructor or "_T-Instructor-00001"
 	course_schedule.room = args.room or "RM0001"
 	
diff --git a/erpnext/schools/doctype/course_scheduling_tool/course_scheduling_tool.js b/erpnext/schools/doctype/course_scheduling_tool/course_scheduling_tool.js
index ea62b8f..b835ce0 100644
--- a/erpnext/schools/doctype/course_scheduling_tool/course_scheduling_tool.js
+++ b/erpnext/schools/doctype/course_scheduling_tool/course_scheduling_tool.js
@@ -2,7 +2,6 @@
 // For license information, please see license.txt
 
 cur_frm.add_fetch("student_group", "program", "program");
-cur_frm.add_fetch("student_group", "student_batch", "student_batch");
 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");
diff --git a/erpnext/schools/doctype/course_scheduling_tool/course_scheduling_tool.json b/erpnext/schools/doctype/course_scheduling_tool/course_scheduling_tool.json
index a66960e..944b3d5 100644
--- a/erpnext/schools/doctype/course_scheduling_tool/course_scheduling_tool.json
+++ b/erpnext/schools/doctype/course_scheduling_tool/course_scheduling_tool.json
@@ -1,5 +1,6 @@
 {
  "allow_copy": 1, 
+ "allow_guest_to_view": 0, 
  "allow_import": 0, 
  "allow_rename": 0, 
  "beta": 0, 
@@ -12,35 +13,7 @@
  "engine": "InnoDB", 
  "fields": [
   {
-   "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_list_view": 0, 
-   "in_standard_filter": 0, 
-   "label": "Student Batch", 
-   "length": 0, 
-   "no_copy": 0, 
-   "options": "Student Batch", 
-   "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, 
@@ -51,6 +24,7 @@
    "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 Group", 
@@ -64,12 +38,13 @@
    "read_only": 0, 
    "remember_last_selected_value": 0, 
    "report_hide": 0, 
-   "reqd": 0, 
+   "reqd": 1, 
    "search_index": 0, 
    "set_only_once": 0, 
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -80,6 +55,7 @@
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
    "in_filter": 0, 
+   "in_global_search": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Course", 
@@ -99,91 +75,7 @@
    "unique": 0
   }, 
   {
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "column_break_3", 
-   "fieldtype": "Column Break", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_list_view": 0, 
-   "in_standard_filter": 0, 
-   "length": 0, 
-   "no_copy": 0, 
-   "permlevel": 0, 
-   "precision": "", 
-   "print_hide": 0, 
-   "print_hide_if_no_value": 0, 
-   "read_only": 0, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 0, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "unique": 0
-  }, 
-  {
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "academic_year", 
-   "fieldtype": "Link", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 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": 1, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 0, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "unique": 0
-  }, 
-  {
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "academic_term", 
-   "fieldtype": "Link", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 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": 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, 
@@ -194,6 +86,7 @@
    "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", 
@@ -213,16 +106,18 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
-   "fieldname": "section_break_6", 
-   "fieldtype": "Section Break", 
+   "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, 
@@ -240,6 +135,98 @@
    "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": 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": "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": 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_6", 
+   "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, 
@@ -250,6 +237,7 @@
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
    "in_filter": 0, 
+   "in_global_search": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Instructor", 
@@ -269,6 +257,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -279,6 +268,7 @@
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
    "in_filter": 0, 
+   "in_global_search": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Instructor Name", 
@@ -298,6 +288,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -308,6 +299,7 @@
    "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, 
@@ -325,6 +317,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -335,6 +328,7 @@
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
    "in_filter": 0, 
+   "in_global_search": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Room", 
@@ -354,6 +348,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -364,6 +359,7 @@
    "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, 
@@ -381,6 +377,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -392,6 +389,7 @@
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
    "in_filter": 0, 
+   "in_global_search": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "From Time", 
@@ -410,6 +408,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -421,6 +420,7 @@
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
    "in_filter": 0, 
+   "in_global_search": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Course Start Date", 
@@ -440,6 +440,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -450,6 +451,7 @@
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
    "in_filter": 0, 
+   "in_global_search": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Day", 
@@ -469,6 +471,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -479,6 +482,7 @@
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
    "in_filter": 0, 
+   "in_global_search": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Rechedule", 
@@ -497,6 +501,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -507,6 +512,7 @@
    "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, 
@@ -524,6 +530,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -534,6 +541,7 @@
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
    "in_filter": 0, 
+   "in_global_search": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "To TIme", 
@@ -552,6 +560,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -563,6 +572,7 @@
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
    "in_filter": 0, 
+   "in_global_search": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Course End Date", 
@@ -581,18 +591,18 @@
    "unique": 0
   }
  ], 
+ "has_web_view": 0, 
  "hide_heading": 1, 
  "hide_toolbar": 1, 
  "idx": 0, 
  "image_view": 0, 
  "in_create": 0, 
- "in_dialog": 0, 
  "is_submittable": 0, 
  "issingle": 1, 
  "istable": 0, 
  "max_attachments": 0, 
  "menu_index": 0, 
- "modified": "2016-11-21 16:58:29.295922", 
+ "modified": "2017-05-02 12:25:35.428490", 
  "modified_by": "Administrator", 
  "module": "Schools", 
  "name": "Course Scheduling Tool", 
@@ -609,7 +619,6 @@
    "export": 0, 
    "if_owner": 0, 
    "import": 0, 
-   "is_custom": 0, 
    "permlevel": 0, 
    "print": 0, 
    "read": 1, 
@@ -624,7 +633,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/schools/doctype/course_scheduling_tool/course_scheduling_tool.py b/erpnext/schools/doctype/course_scheduling_tool/course_scheduling_tool.py
index 86fefe2..4e07922 100644
--- a/erpnext/schools/doctype/course_scheduling_tool/course_scheduling_tool.py
+++ b/erpnext/schools/doctype/course_scheduling_tool/course_scheduling_tool.py
@@ -22,10 +22,11 @@
 		self.validate_mandatory()
 		self.validate_date()
 		self.instructor_name= frappe.db.get_value("Instructor", self.instructor, "instructor_name")
-		
-		if self.student_group:
-			self.course= frappe.db.get_value("Student Group", self.student_group, "course")
-		
+
+		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)
 		
@@ -57,9 +58,6 @@
 	def validate_mandatory(self):
 		"""Validates all mandatory fields"""
 		
-		if not (self.student_batch or self.student_group):
-			frappe.throw(_("""Student Batch or Student Group is mandatory"""))
-		
 		fields = ['course', 'room', 'instructor', 'from_time', 'to_time', 'course_start_date', 'course_end_date', 'day']
 		for d in  fields:
 			if not self.get(d):
@@ -74,7 +72,6 @@
 		"""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],
-			["student_batch", "=", self.student_batch],
 			["course", "=", self.course],
 			["schedule_date", ">=", self.course_start_date], 
 			["schedule_date", "<=", self.course_end_date]])
@@ -93,7 +90,6 @@
 		
 		course_schedule = frappe.new_doc("Course Schedule")
 		course_schedule.student_group = self.student_group
-		course_schedule.student_batch = self.student_batch
 		course_schedule.course = self.course
 		course_schedule.instructor = self.instructor
 		course_schedule.instructor_name = self.instructor_name
@@ -102,4 +98,4 @@
 		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/fees/fees.py b/erpnext/schools/doctype/fees/fees.py
index d2540f7..7e660af 100644
--- a/erpnext/schools/doctype/fees/fees.py
+++ b/erpnext/schools/doctype/fees/fees.py
@@ -18,7 +18,7 @@
 			self.total_amount += d.amount
 		self.outstanding_amount = self.total_amount
 
-def get_fee_list(doctype, txt, filters, limit_start, limit_page_length=20):
+def get_fee_list(doctype, txt, filters, limit_start, limit_page_length=20, order_by="modified"):
 	user = frappe.session.user
 	student = frappe.db.sql("select name from `tabStudent` where student_email_id= %s", user)
 	if student:
diff --git a/erpnext/schools/doctype/grading_scale/grading_scale.py b/erpnext/schools/doctype/grading_scale/grading_scale.py
index 4abff96..e981f9f 100644
--- a/erpnext/schools/doctype/grading_scale/grading_scale.py
+++ b/erpnext/schools/doctype/grading_scale/grading_scale.py
@@ -17,4 +17,4 @@
 			else:
 				thresholds.append(cint(d.threshold))
 		if 0 not in thresholds:
-			frappe.throw(_("Please define grade for treshold 0%"))
\ No newline at end of file
+			frappe.throw(_("Please define grade for Threshold 0%"))
\ No newline at end of file
diff --git a/erpnext/schools/doctype/program/program.js b/erpnext/schools/doctype/program/program.js
index 7b9f920..cc09d0e 100644
--- a/erpnext/schools/doctype/program/program.js
+++ b/erpnext/schools/doctype/program/program.js
@@ -1,43 +1,27 @@
 // Copyright (c) 2015, Frappe Technologies and contributors
 // For license information, please see license.txt
 
-cur_frm.add_fetch("course", "course_code", "course_code");
 cur_frm.add_fetch('fee_structure', 'total_amount', 'amount');
 
 frappe.ui.form.on("Program", "refresh", function(frm) {
 	if(!frm.doc.__islocal) {
 		frm.add_custom_button(__("Student Applicant"), function() {
-			frappe.route_options = {
-				program: frm.doc.name
-			}
 			frappe.set_route("List", "Student Applicant");
 		});
 		
 		frm.add_custom_button(__("Program Enrollment"), function() {
-			frappe.route_options = {
-				program: frm.doc.name
-			}
 			frappe.set_route("List", "Program Enrollment");
 		});
 		
 		frm.add_custom_button(__("Student Group"), function() {
-			frappe.route_options = {
-				program: frm.doc.name
-			}
 			frappe.set_route("List", "Student Group");
 		});
 		
 		frm.add_custom_button(__("Fee Structure"), function() {
-			frappe.route_options = {
-				program: frm.doc.name
-			}
 			frappe.set_route("List", "Fee Structure");
 		});
 		
 		frm.add_custom_button(__("Fees"), function() {
-			frappe.route_options = {
-				program: frm.doc.name
-			}
 			frappe.set_route("List", "Fees");
 		});
 	}
diff --git a/erpnext/schools/doctype/program/program.json b/erpnext/schools/doctype/program/program.json
index cac2964..672994b 100644
--- a/erpnext/schools/doctype/program/program.json
+++ b/erpnext/schools/doctype/program/program.json
@@ -1,8 +1,9 @@
 {
  "allow_copy": 0, 
+ "allow_guest_to_view": 0, 
  "allow_import": 1, 
  "allow_rename": 1, 
- "autoname": "field:program_name", 
+ "autoname": "field:program_code", 
  "beta": 0, 
  "creation": "2015-09-07 12:54:03.609282", 
  "custom": 0, 
@@ -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": "Program Name", 
    "length": 0, 
@@ -42,92 +44,7 @@
    "unique": 0
   }, 
   {
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "program_code", 
-   "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": "Program Code", 
-   "length": 0, 
-   "no_copy": 0, 
-   "permlevel": 0, 
-   "precision": "", 
-   "print_hide": 0, 
-   "print_hide_if_no_value": 0, 
-   "read_only": 0, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 0, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "unique": 0
-  }, 
-  {
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "program_abbreviation", 
-   "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": "Program Abbreviation", 
-   "length": 0, 
-   "no_copy": 0, 
-   "permlevel": 0, 
-   "precision": "", 
-   "print_hide": 0, 
-   "print_hide_if_no_value": 0, 
-   "read_only": 0, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 0, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "unique": 0
-  }, 
-  {
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "column_break_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, 
@@ -158,6 +75,96 @@
    "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": "program_code", 
+   "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": "Program Code", 
+   "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": "program_abbreviation", 
+   "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": "Program Abbreviation", 
+   "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, 
@@ -187,6 +194,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -217,6 +225,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -246,6 +255,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -276,18 +286,18 @@
    "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, 
  "menu_index": 0, 
- "modified": "2017-02-17 17:22:14.107052", 
+ "modified": "2017-05-12 15:39:15.542274", 
  "modified_by": "Administrator", 
  "module": "Schools", 
  "name": "Program", 
@@ -318,7 +328,7 @@
  "quick_entry": 0, 
  "read_only": 0, 
  "read_only_onload": 0, 
- "search_fields": "department", 
+ "search_fields": "program_name", 
  "show_name_in_global_search": 1, 
  "sort_field": "modified", 
  "sort_order": "DESC", 
diff --git a/erpnext/schools/doctype/program/program.py b/erpnext/schools/doctype/program/program.py
index 0ece961..f626880 100644
--- a/erpnext/schools/doctype/program/program.py
+++ b/erpnext/schools/doctype/program/program.py
@@ -7,10 +7,4 @@
 from frappe.model.document import Document
 
 class Program(Document):
-	def validate(self):
-		self.validate_course()
-		
-	def validate_course(self):
-		for d in self.courses:
-			if not d.course_code:
-				d.course_code = frappe.db.get_value("Course", d.course, "course_code")
+	pass
\ No newline at end of file
diff --git a/erpnext/schools/doctype/program/test_records.json b/erpnext/schools/doctype/program/test_records.json
index b2374d6..e5eda70 100644
--- a/erpnext/schools/doctype/program/test_records.json
+++ b/erpnext/schools/doctype/program/test_records.json
@@ -1,10 +1,12 @@
 [
 	{
 		"program_name": "_Test Program",
-		"program_abbreviation": "TP"
+		"program_code": "_TP1",
+		"program_abbreviation": "TP1"
 	},
 	{
 		"program_name": "_Test Program 2",
+		"program_code": "_TP2",
 		"program_abbreviation": "TP2"
 	}
 ]
diff --git a/erpnext/schools/doctype/program_course/program_course.json b/erpnext/schools/doctype/program_course/program_course.json
index c19b613..8c82666 100644
--- a/erpnext/schools/doctype/program_course/program_course.json
+++ b/erpnext/schools/doctype/program_course/program_course.json
@@ -1,5 +1,6 @@
 {
  "allow_copy": 0, 
+ "allow_guest_to_view": 0, 
  "allow_import": 0, 
  "allow_rename": 0, 
  "beta": 0, 
@@ -46,36 +47,6 @@
    "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": 1, 
-   "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_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
    "fieldname": "column_break_3", 
    "fieldtype": "Column Break", 
    "hidden": 0, 
@@ -104,7 +75,7 @@
    "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
-   "fieldname": "course_code", 
+   "fieldname": "course_name", 
    "fieldtype": "Data", 
    "hidden": 0, 
    "ignore_user_permissions": 0, 
@@ -113,9 +84,10 @@
    "in_global_search": 0, 
    "in_list_view": 1, 
    "in_standard_filter": 0, 
-   "label": "Course Code", 
+   "label": "Course Name", 
    "length": 0, 
    "no_copy": 0, 
+   "options": "course.course_name", 
    "permlevel": 0, 
    "precision": "", 
    "print_hide": 0, 
@@ -140,7 +112,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": "Required", 
    "length": 0, 
@@ -158,18 +130,18 @@
    "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, 
  "menu_index": 0, 
- "modified": "2017-02-17 17:16:10.315691", 
+ "modified": "2017-04-07 17:59:12.504949", 
  "modified_by": "Administrator", 
  "module": "Schools", 
  "name": "Program Course", 
diff --git a/erpnext/schools/doctype/program_enrollment/program_enrollment.js b/erpnext/schools/doctype/program_enrollment/program_enrollment.js
index 96c8f96..207e6a1 100644
--- a/erpnext/schools/doctype/program_enrollment/program_enrollment.js
+++ b/erpnext/schools/doctype/program_enrollment/program_enrollment.js
@@ -3,7 +3,35 @@
 
 cur_frm.add_fetch('fee_structure', 'total_amount', 'amount');
 
-frappe.ui.form.on("Program Enrollment", {
+frappe.ui.form.on("Program Enrollment", {	
+	onload: function(frm, cdt, cdn){
+		frm.set_query("academic_term", "fees", function(){
+			return{
+				"filters":{
+					"academic_year": (frm.doc.academic_year)
+				}
+			};
+		});
+				
+		frm.fields_dict['fees'].grid.get_field('fee_structure').get_query = function(doc, cdt, cdn) {
+			var d = locals[cdt][cdn];
+			return {
+				filters: {'academic_term': d.academic_term}
+			}
+		};
+
+		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",
+					filters: {
+						'program': frm.doc.program	
+					}
+				}
+			});
+		}
+	},
+
 	program: function(frm) {
 		if (frm.doc.program) {
 			frappe.call({
@@ -24,22 +52,25 @@
 	student_category: function() {
 		frappe.ui.form.trigger("Program Enrollment", "program");
 	},
-	
-	onload: function(frm, cdt, cdn){
-		cur_frm.set_query("academic_term", "fees", function(){
-			return{
-				"filters":{
-					"academic_year": (frm.doc.academic_year)
+
+	get_courses: function(frm) {
+		if (frm.doc.program) {
+			frm.set_value("courses",[]);
+			frappe.call({
+				method: "get_courses",
+				doc:frm.doc,
+				callback: function(r) {
+					if(r.message) {
+						frm.set_value("courses", r.message);
+					}
+					else {
+						frappe.msgprint(__("There is no mandatory course for the program {0}",[frm.doc.program]));
+					}
 				}
-			};
-		});
-				
-		cur_frm.fields_dict['fees'].grid.get_field('fee_structure').get_query = function(doc, cdt, cdn) {
-			var d = locals[cdt][cdn];
-			return {
-				filters: {'academic_term': d.academic_term}
-			}
-		};
-		
+			})
+		}
+		else {
+			frappe.throw(__("Select the Program to fetch mandatory courses."))
+		}
 	}
 });
diff --git a/erpnext/schools/doctype/program_enrollment/program_enrollment.json b/erpnext/schools/doctype/program_enrollment/program_enrollment.json
index b1941c7..a07b3ee 100644
--- a/erpnext/schools/doctype/program_enrollment/program_enrollment.json
+++ b/erpnext/schools/doctype/program_enrollment/program_enrollment.json
@@ -1,7 +1,7 @@
 {
  "allow_copy": 0, 
  "allow_guest_to_view": 0, 
- "allow_import": 0, 
+ "allow_import": 1, 
  "allow_rename": 0, 
  "autoname": "PE.#####", 
  "beta": 0, 
@@ -14,6 +14,7 @@
  "engine": "InnoDB", 
  "fields": [
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -44,6 +45,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -74,154 +76,7 @@
    "unique": 0
   }, 
   {
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "student_category", 
-   "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 Category", 
-   "length": 0, 
-   "no_copy": 0, 
-   "options": "Student Category", 
-   "permlevel": 0, 
-   "precision": "", 
-   "print_hide": 0, 
-   "print_hide_if_no_value": 0, 
-   "read_only": 0, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 0, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "unique": 0
-  }, 
-  {
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "school_house", 
-   "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": "School House", 
-   "length": 0, 
-   "no_copy": 0, 
-   "options": "School House", 
-   "permlevel": 0, 
-   "precision": "", 
-   "print_hide": 0, 
-   "print_hide_if_no_value": 0, 
-   "read_only": 0, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 0, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "unique": 0
-  }, 
-  {
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "column_break_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_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": 1, 
-   "in_standard_filter": 1, 
-   "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": 1, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "unique": 0
-  }, 
-  {
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "student_batch_name", 
-   "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": "Batch Name", 
-   "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, 
@@ -252,6 +107,38 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 1, 
+   "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, 
@@ -282,12 +169,13 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
-   "fieldname": "section_break_7", 
-   "fieldtype": "Section Break", 
+   "fieldname": "column_break_4", 
+   "fieldtype": "Column Break", 
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
@@ -295,7 +183,6 @@
    "in_global_search": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
-   "label": "", 
    "length": 0, 
    "no_copy": 0, 
    "permlevel": 0, 
@@ -311,6 +198,252 @@
    "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": 1, 
+   "in_standard_filter": 1, 
+   "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": 1, 
+   "search_index": 0, 
+   "set_only_once": 0, 
+   "unique": 0
+  }, 
+  {
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 1, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "fieldname": "student_batch_name", 
+   "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": "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": "student_category", 
+   "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 Category", 
+   "length": 0, 
+   "no_copy": 0, 
+   "options": "Student Category", 
+   "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": "school_house", 
+   "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": "School House", 
+   "length": 0, 
+   "no_copy": 0, 
+   "options": "School House", 
+   "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": "enrolled_courses", 
+   "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": "Enrolled courses", 
+   "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": "get_courses", 
+   "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": "Get Courses", 
+   "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, 
+   "fieldname": "courses", 
+   "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": "Courses", 
+   "length": 0, 
+   "no_copy": 0, 
+   "options": "Program Enrollment Course", 
+   "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_7", 
+   "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": "Fees", 
+   "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, 
@@ -342,6 +475,7 @@
    "width": ""
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -371,6 +505,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -412,7 +547,7 @@
  "istable": 0, 
  "max_attachments": 0, 
  "menu_index": 0, 
- "modified": "2017-03-29 15:30:03.359985", 
+ "modified": "2017-04-24 18:22:43.567607", 
  "modified_by": "Administrator", 
  "module": "Schools", 
  "name": "Program Enrollment", 
diff --git a/erpnext/schools/doctype/program_enrollment/program_enrollment.py b/erpnext/schools/doctype/program_enrollment/program_enrollment.py
index 02c6fe7..feb4c2f 100644
--- a/erpnext/schools/doctype/program_enrollment/program_enrollment.py
+++ b/erpnext/schools/doctype/program_enrollment/program_enrollment.py
@@ -6,6 +6,7 @@
 import frappe
 from frappe import msgprint, _
 from frappe.model.document import Document
+from frappe.desk.reportview import get_match_cond, get_filters_cond
 from frappe.utils import comma_and
 
 class ProgramEnrollment(Document):
@@ -53,4 +54,26 @@
 		if fee_list:
 			fee_list = ["""<a href="#Form/Fees/%s" target="_blank">%s</a>""" % \
 				(fee, fee) for fee in fee_list]
-			msgprint(_("Fee Records Created - {0}").format(comma_and(fee_list)))
\ No newline at end of file
+			msgprint(_("Fee Records Created - {0}").format(comma_and(fee_list)))
+
+	def get_courses(self):
+		return frappe.db.sql('''select course, course_name from `tabProgram Course` where parent = %s and required = 1''', (self.program), as_dict=1)
+
+
+@frappe.whitelist()
+def get_program_courses(doctype, txt, searchfield, start, page_len, filters):
+	if filters.get('program'):
+		return frappe.db.sql("""select course, course_name from `tabProgram Course`
+			where  parent = %(program)s and course like %(txt)s {match_cond}
+			order by
+				if(locate(%(_txt)s, course), locate(%(_txt)s, course), 99999),
+				idx desc,
+				`tabProgram Course`.course asc
+			limit {start}, {page_len}""".format(
+				match_cond=get_match_cond(doctype),
+				start=start,
+				page_len=page_len), {
+					"txt": "%{0}%".format(txt),
+					"_txt": txt.replace('%', ''),
+					"program": filters['program']
+				})
diff --git a/erpnext/schools/doctype/assessment_code/__init__.py b/erpnext/schools/doctype/program_enrollment_course/__init__.py
similarity index 100%
rename from erpnext/schools/doctype/assessment_code/__init__.py
rename to erpnext/schools/doctype/program_enrollment_course/__init__.py
diff --git a/erpnext/stock/doctype/item_manufacturer/item_manufacturer.json b/erpnext/schools/doctype/program_enrollment_course/program_enrollment_course.json
similarity index 80%
rename from erpnext/stock/doctype/item_manufacturer/item_manufacturer.json
rename to erpnext/schools/doctype/program_enrollment_course/program_enrollment_course.json
index aa34691..5c5e220 100644
--- a/erpnext/stock/doctype/item_manufacturer/item_manufacturer.json
+++ b/erpnext/schools/doctype/program_enrollment_course/program_enrollment_course.json
@@ -4,7 +4,7 @@
  "allow_import": 0, 
  "allow_rename": 0, 
  "beta": 0, 
- "creation": "2017-03-24 14:05:42.026237", 
+ "creation": "2017-04-10 19:28:19.616308", 
  "custom": 0, 
  "docstatus": 0, 
  "doctype": "DocType", 
@@ -17,7 +17,7 @@
    "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
-   "fieldname": "manufacturer", 
+   "fieldname": "course", 
    "fieldtype": "Link", 
    "hidden": 0, 
    "ignore_user_permissions": 0, 
@@ -26,10 +26,10 @@
    "in_global_search": 0, 
    "in_list_view": 1, 
    "in_standard_filter": 0, 
-   "label": "Manufacturer", 
+   "label": "Course", 
    "length": 0, 
    "no_copy": 0, 
-   "options": "Manufacturer", 
+   "options": "Course", 
    "permlevel": 0, 
    "precision": "", 
    "print_hide": 0, 
@@ -47,7 +47,7 @@
    "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
-   "fieldname": "manufacturer_part_no", 
+   "fieldname": "course_name", 
    "fieldtype": "Data", 
    "hidden": 0, 
    "ignore_user_permissions": 0, 
@@ -56,14 +56,15 @@
    "in_global_search": 0, 
    "in_list_view": 1, 
    "in_standard_filter": 0, 
-   "label": "Manufacturer Part Number", 
+   "label": "Course Name", 
    "length": 0, 
    "no_copy": 0, 
+   "options": "course.course_name", 
    "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": 0, 
@@ -82,12 +83,12 @@
  "issingle": 0, 
  "istable": 1, 
  "max_attachments": 0, 
- "modified": "2017-03-24 14:33:56.726460", 
- "modified_by": "d.ottenbreit@eso-electronic.de", 
- "module": "Stock", 
- "name": "Item Manufacturer", 
+ "modified": "2017-04-12 11:49:50.433280", 
+ "modified_by": "Administrator", 
+ "module": "Schools", 
+ "name": "Program Enrollment Course", 
  "name_case": "", 
- "owner": "d.ottenbreit@eso-electronic.de", 
+ "owner": "Administrator", 
  "permissions": [], 
  "quick_entry": 1, 
  "read_only": 0, 
diff --git a/erpnext/stock/doctype/package_code/package_code.py b/erpnext/schools/doctype/program_enrollment_course/program_enrollment_course.py
similarity index 85%
rename from erpnext/stock/doctype/package_code/package_code.py
rename to erpnext/schools/doctype/program_enrollment_course/program_enrollment_course.py
index 1d989c0..e1f564e 100644
--- a/erpnext/stock/doctype/package_code/package_code.py
+++ b/erpnext/schools/doctype/program_enrollment_course/program_enrollment_course.py
@@ -6,5 +6,5 @@
 import frappe
 from frappe.model.document import Document
 
-class PackageCode(Document):
+class ProgramEnrollmentCourse(Document):
 	pass
diff --git a/erpnext/schools/doctype/program_enrollment_tool/program_enrollment_tool.py b/erpnext/schools/doctype/program_enrollment_tool/program_enrollment_tool.py
index 1747bad..d80f2f5 100644
--- a/erpnext/schools/doctype/program_enrollment_tool/program_enrollment_tool.py
+++ b/erpnext/schools/doctype/program_enrollment_tool/program_enrollment_tool.py
@@ -11,11 +11,11 @@
 class ProgramEnrollmentTool(Document):
 	def get_students(self):
 		if not self.get_students_from:
-			frappe.throw(_("Mandatory feild - Get Students From"))
+			frappe.throw(_("Mandatory field - Get Students From"))
 		elif not self.program:
-			frappe.throw(_("Mandatory feild - Program"))
+			frappe.throw(_("Mandatory field - Program"))
 		elif not self.academic_year:
-			frappe.throw(_("Mandatory feild - Academic Year"))
+			frappe.throw(_("Mandatory field - Academic Year"))
 		else:
 			if self.get_students_from == "Student Applicants":
 				students = frappe.db.sql("select name as student_applicant, title as student_name from \
diff --git a/erpnext/schools/doctype/student_batch/__init__.py b/erpnext/schools/doctype/school_settings/__init__.py
similarity index 100%
rename from erpnext/schools/doctype/student_batch/__init__.py
rename to erpnext/schools/doctype/school_settings/__init__.py
diff --git a/erpnext/stock/doctype/package_code/package_code.js b/erpnext/schools/doctype/school_settings/school_settings.js
similarity index 79%
rename from erpnext/stock/doctype/package_code/package_code.js
rename to erpnext/schools/doctype/school_settings/school_settings.js
index 6bc1969..2707c42 100644
--- a/erpnext/stock/doctype/package_code/package_code.js
+++ b/erpnext/schools/doctype/school_settings/school_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('Package Code', {
+frappe.ui.form.on('School Settings', {
 	refresh: function(frm) {
 
 	}
diff --git a/erpnext/schools/doctype/student_batch_creation_tool/student_batch_creation_tool.json b/erpnext/schools/doctype/school_settings/school_settings.json
similarity index 64%
rename from erpnext/schools/doctype/student_batch_creation_tool/student_batch_creation_tool.json
rename to erpnext/schools/doctype/school_settings/school_settings.json
index d94c480..8607a76 100644
--- a/erpnext/schools/doctype/student_batch_creation_tool/student_batch_creation_tool.json
+++ b/erpnext/schools/doctype/school_settings/school_settings.json
@@ -1,9 +1,10 @@
 {
- "allow_copy": 1, 
+ "allow_copy": 0, 
+ "allow_guest_to_view": 0, 
  "allow_import": 0, 
  "allow_rename": 0, 
  "beta": 0, 
- "creation": "2016-11-14 18:20:12.160405", 
+ "creation": "2017-04-05 13:33:04.519313", 
  "custom": 0, 
  "docstatus": 0, 
  "doctype": "DocType", 
@@ -12,19 +13,21 @@
  "engine": "InnoDB", 
  "fields": [
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
-   "fieldname": "academic_year", 
+   "fieldname": "current_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", 
+   "label": "Current Academic Year", 
    "length": 0, 
    "no_copy": 0, 
    "options": "Academic Year", 
@@ -41,22 +44,24 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
-   "fieldname": "program", 
+   "fieldname": "current_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": "Program", 
+   "label": "Current Academic Term", 
    "length": 0, 
    "no_copy": 0, 
-   "options": "Program", 
+   "options": "Academic Term", 
    "permlevel": 0, 
    "precision": "", 
    "print_hide": 0, 
@@ -70,22 +75,23 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
-   "fieldname": "student_batch_name", 
-   "fieldtype": "Link", 
+   "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": "Student Batch Name", 
+   "label": "Attendance Freeze Date", 
    "length": 0, 
    "no_copy": 0, 
-   "options": "Student Batch Name", 
    "permlevel": 0, 
    "precision": "", 
    "print_hide": 0, 
@@ -99,22 +105,53 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
-   "fieldname": "make_student_batch", 
-   "fieldtype": "Button", 
+   "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, 
-   "label": "Make Student Batch", 
    "length": 0, 
    "no_copy": 0, 
-   "options": "make_batch", 
+   "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": "1", 
+   "fieldname": "validation_from_pe", 
+   "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": "Validate the Student Group from Program Enrollment", 
+   "length": 0, 
+   "no_copy": 0, 
    "permlevel": 0, 
    "precision": "", 
    "print_hide": 0, 
@@ -128,20 +165,20 @@
    "unique": 0
   }
  ], 
- "hide_heading": 1, 
- "hide_toolbar": 1, 
+ "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": 1, 
  "istable": 0, 
  "max_attachments": 0, 
- "modified": "2016-11-21 16:47:56.823988", 
+ "modified": "2017-04-27 15:37:00.159072", 
  "modified_by": "Administrator", 
  "module": "Schools", 
- "name": "Student Batch Creation Tool", 
+ "name": "School Settings", 
  "name_case": "", 
  "owner": "Administrator", 
  "permissions": [
@@ -149,28 +186,29 @@
    "amend": 0, 
    "apply_user_permissions": 0, 
    "cancel": 0, 
-   "create": 0, 
-   "delete": 0, 
+   "create": 1, 
+   "delete": 1, 
    "email": 1, 
    "export": 0, 
    "if_owner": 0, 
    "import": 0, 
-   "is_custom": 0, 
    "permlevel": 0, 
    "print": 1, 
    "read": 1, 
    "report": 0, 
-   "role": "Academics User", 
+   "role": "System Manager", 
    "set_user_permissions": 0, 
    "share": 1, 
    "submit": 0, 
    "write": 1
   }
  ], 
- "quick_entry": 0, 
+ "quick_entry": 1, 
  "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/schools/doctype/school_settings/school_settings.py b/erpnext/schools/doctype/school_settings/school_settings.py
new file mode 100644
index 0000000..6d8efb4
--- /dev/null
+++ b/erpnext/schools/doctype/school_settings/school_settings.py
@@ -0,0 +1,27 @@
+# -*- 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
+import frappe.defaults
+from frappe.model.document import Document
+
+school_keydict = {
+	# "key in defaults": "key in Global Defaults"
+	"academic_year": "current_academic_year",
+	"academic_term": "current_academic_term",
+	"student_validation_setting": "validation_from_pe",
+}
+
+class SchoolSettings(Document):
+	def on_update(self):
+		"""update defaults"""
+		for key in school_keydict:
+			frappe.db.set_default(key, self.get(school_keydict[key], ''))
+
+		# clear cache
+		frappe.clear_cache()
+
+	def get_defaults(self):
+		return frappe.defaults.get_defaults()
diff --git a/erpnext/schools/doctype/student/student.json b/erpnext/schools/doctype/student/student.json
index c685fcb..1654c3b 100644
--- a/erpnext/schools/doctype/student/student.json
+++ b/erpnext/schools/doctype/student/student.json
@@ -497,7 +497,7 @@
    "label": "Gender", 
    "length": 0, 
    "no_copy": 0, 
-   "options": "\nMale\nFemale", 
+   "options": "\nMale\nFemale\nOther", 
    "permlevel": 0, 
    "precision": "", 
    "print_hide": 0, 
@@ -1135,4 +1135,4 @@
  "title_field": "title", 
  "track_changes": 0, 
  "track_seen": 0
-}
\ No newline at end of file
+}
diff --git a/erpnext/schools/doctype/student/student_dashboard.py b/erpnext/schools/doctype/student/student_dashboard.py
index ca2a660..cd2314e 100644
--- a/erpnext/schools/doctype/student/student_dashboard.py
+++ b/erpnext/schools/doctype/student/student_dashboard.py
@@ -7,7 +7,7 @@
 		'fieldname': 'student',
 		'transactions': [
 			{
-				'items': ['Student Log', 'Student Batch', 'Student Group', 'Program Enrollment']
+				'items': ['Student Log', 'Student Group', 'Program Enrollment']
 			},
 			{
 				'items': ['Fees', 'Assessment Result', 'Student Attendance', 'Student Leave Application']
diff --git a/erpnext/schools/doctype/student/test_records.json b/erpnext/schools/doctype/student/test_records.json
index e280794..36da06f 100644
--- a/erpnext/schools/doctype/student/test_records.json
+++ b/erpnext/schools/doctype/student/test_records.json
@@ -3,7 +3,7 @@
 		"first_name": "_Test",
 		"middle_name": "Student",
 		"last_name": "Name",
-		"program": "_Test Program",
+		"program": "TC101",
 		"date_of_birth": "2000-01-01",
 		"gender": "Male",
 		"blood_group": "A+"
@@ -13,7 +13,7 @@
 		"first_name": "_Test",
 		"middle_name": "Student",
 		"last_name": "Name 1",
-		"program": "_Test Program",
+		"program": "TC101",
 		"date_of_birth": "2000-01-01",
 		"gender": "Male",
 		"blood_group": "A+"
@@ -23,7 +23,7 @@
 		"first_name": "_Test",
 		"middle_name": "Student",
 		"last_name": "Name 2",
-		"program": "_Test Program",
+		"program": "TC101",
 		"date_of_birth": "2000-01-01",
 		"gender": "Male",
 		"blood_group": "A+"
diff --git a/erpnext/schools/doctype/student_attendance/student_attendance.js b/erpnext/schools/doctype/student_attendance/student_attendance.js
index ec2a0cb..f025a1a 100644
--- a/erpnext/schools/doctype/student_attendance/student_attendance.js
+++ b/erpnext/schools/doctype/student_attendance/student_attendance.js
@@ -2,4 +2,4 @@
 // For license information, please see license.txt
 
 cur_frm.add_fetch("course_schedule", "schedule_date", "date");
-cur_frm.add_fetch("course_schedule", "student_batch", "student_batch")
\ No newline at end of file
+cur_frm.add_fetch("course_schedule", "student_group", "student_group")
\ No newline at end of file
diff --git a/erpnext/schools/doctype/student_attendance/student_attendance.json b/erpnext/schools/doctype/student_attendance/student_attendance.json
index e5a4075..83a07d5 100644
--- a/erpnext/schools/doctype/student_attendance/student_attendance.json
+++ b/erpnext/schools/doctype/student_attendance/student_attendance.json
@@ -1,5 +1,6 @@
 {
  "allow_copy": 0, 
+ "allow_guest_to_view": 0, 
  "allow_import": 1, 
  "allow_rename": 0, 
  "autoname": "SA.######", 
@@ -13,6 +14,7 @@
  "engine": "InnoDB", 
  "fields": [
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -43,6 +45,7 @@
    "unique": 0
   }, 
   {
+   "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, 
@@ -102,6 +106,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -130,6 +135,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -160,23 +166,24 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
-   "fieldname": "student_batch", 
+   "fieldname": "student_group", 
    "fieldtype": "Link", 
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
    "in_filter": 0, 
-   "in_global_search": 1,
+   "in_global_search": 1, 
    "in_list_view": 0, 
    "in_standard_filter": 1, 
-   "label": "Student Batch", 
+   "label": "Student Group", 
    "length": 0, 
    "no_copy": 0, 
-   "options": "Student Batch", 
+   "options": "Student Group", 
    "permlevel": 0, 
    "precision": "", 
    "print_hide": 0, 
@@ -190,6 +197,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -219,48 +227,19 @@
    "search_index": 0, 
    "set_only_once": 0, 
    "unique": 0
-  }, 
-  {
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "amended_from", 
-   "fieldtype": "Link", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 0, 
-   "in_standard_filter": 0, 
-   "label": "Amended From", 
-   "length": 0, 
-   "no_copy": 1, 
-   "options": "Student Attendance", 
-   "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, 
- "in_dialog": 0, 
  "is_submittable": 0, 
  "issingle": 0, 
  "istable": 0, 
  "max_attachments": 0, 
- "modified": "2017-02-21 01:15:20.989687", 
+ "modified": "2017-05-01 12:02:01.116733", 
  "modified_by": "Administrator", 
  "module": "Schools", 
  "name": "Student Attendance", 
diff --git a/erpnext/schools/doctype/student_attendance/student_attendance.py b/erpnext/schools/doctype/student_attendance/student_attendance.py
index 8a72e70..2688123 100644
--- a/erpnext/schools/doctype/student_attendance/student_attendance.py
+++ b/erpnext/schools/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_batch_students, get_student_group_students
+from erpnext.schools.api import get_student_group_students
 
 
 class StudentAttendance(Document):
@@ -23,27 +23,23 @@
 			self.date = frappe.db.get_value("Course Schedule", self.course_schedule, "schedule_date")
 	
 	def validate_mandatory(self):
-		if not (self.student_batch or self.course_schedule):
-			frappe.throw(_("""Student Batch or Course Schedule is mandatory"""))
+		if not (self.student_group or self.course_schedule):
+			frappe.throw(_("""Student Group or Course Schedule is mandatory"""))
 	
 	def validate_course_schedule(self):
 		if self.course_schedule:
-			self.student_batch = frappe.db.get_value("Course Schedule", self.course_schedule, "student_batch")
+			self.student_group = frappe.db.get_value("Course Schedule", self.course_schedule, "student_group")
 	
 	def validate_student(self):
 		if self.course_schedule:
 			student_group = frappe.db.get_value("Course Schedule", self.course_schedule, "student_group")
-			student_group_students = []
-			for d in get_student_group_students(student_group):
-				student_group_students.append(d.student)
-			if student_group and self.student not in student_group_students:
-				frappe.throw(_("""Student {0}: {1} does not belong to Student Group {2}""".format(self.student, self.student_name, student_group)))
 		else:
-			student_batch_students = []
-			for d in get_student_batch_students(self.student_batch):
-				student_batch_students.append(d.student)
-			if self.student not in student_batch_students:
-				frappe.throw(_("""Student {0}: {1} does not belong to Student Batch {2}""".format(self.student, self.student_name, self.student_batch)))
+			student_group = self.student_group
+		student_group_students = []
+		for d in get_student_group_students(student_group):
+			student_group_students.append(d.student)
+		if student_group and self.student not in student_group_students:
+			frappe.throw(_('''Student {0}: {1} does not belong to Student Group {2}'''.format(self.student, self.student_name, student_group)))
 
 	def validate_duplication(self):
 		"""Check if the Attendance Record is Unique"""
@@ -54,9 +50,9 @@
 				(self.student, cstr(self.course_schedule), self.name))
 		else:
 			attendance_records= frappe.db.sql("""select name from `tabStudent Attendance` where \
-				student= %s and student_batch= %s and date= %s and name != %s and \
+				student= %s and student_group= %s and date= %s and name != %s and \
 				(course_schedule is Null or course_schedule='')""",
-				(self.student, self.student_batch, self.date, self.name))
+				(self.student, self.student_group, self.date, self.name))
 			
 		if attendance_records:
 			frappe.throw(_("Attendance Record {0} exists against Student {1}")
diff --git a/erpnext/schools/doctype/student_attendance/untitled.txt b/erpnext/schools/doctype/student_attendance/untitled.txt
deleted file mode 100644
index b2f4c36..0000000
--- a/erpnext/schools/doctype/student_attendance/untitled.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-# -*- coding: utf-8 -*-
-# Copyright (c) 2015, Frappe Technologies and contributors
-# For license information, please see license.txt
-
-from __future__ import unicode_literals
-import frappe
-from frappe.model.document import Document
-from frappe import _
-
-class Studentattendance(Document):
-	def validate(self):
-		self.validate_duplication()
-		
-	def validate_duplication(self):
-		attendance_records= frappe.db.sql("""select name from `tabStudent attendance` where \
-			student= %s and course_schedule= %s and name != %s""",
-			(self.student, self.course_schedule, self.name))
-		if attendance_records:
-			frappe.throw(_("attendance Record {0} exists against Student {1} for Course Schedule {2}")
-				.format(attendance_records[0][0], self.student, self.course_schedule))
diff --git a/erpnext/schools/doctype/student_attendance_tool/student_attendance_tool.js b/erpnext/schools/doctype/student_attendance_tool/student_attendance_tool.js
index fd37a15..6f8c6cd 100644
--- a/erpnext/schools/doctype/student_attendance_tool/student_attendance_tool.js
+++ b/erpnext/schools/doctype/student_attendance_tool/student_attendance_tool.js
@@ -8,22 +8,22 @@
 	},
 
 	based_on: function(frm) {
-		if (frm.doc.based_on == "Student Batch") {
+		if (frm.doc.based_on == "Student Group") {
 			frm.set_value("course_schedule", "");
 		} else {
-			frm.set_value("student_batch", "");
+			frm.set_value("student_group", "");
 		}
 	},
 
-	student_batch: function(frm) {
-		if ((frm.doc.student_batch && frm.doc.date) || frm.doc.course_schedule) {
+	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";
 
 			frappe.call({
 				method: method,
 				args: {
 					based_on: frm.doc.based_on,
-					student_batch: frm.doc.student_batch,
+					student_group: frm.doc.student_group,
 					date: frm.doc.date,
 					course_schedule: frm.doc.course_schedule
 				},
@@ -35,11 +35,11 @@
 	},
 
 	date: function(frm) {
-		frm.trigger("student_batch");
+		frm.trigger("student_group");
 	},
 
 	course_schedule: function(frm) {
-		frm.trigger("student_batch");
+		frm.trigger("student_group");
 	},
 
 	get_students: function(frm, students) {
@@ -47,6 +47,7 @@
 			frm.students_area = $('<div>')
 				.appendTo(frm.fields_dict.students_html.wrapper);
 		}
+		students = students || [];
 		frm.students_editor = new schools.StudentsEditor(frm, frm.students_area, students)
 	}
 });
@@ -56,7 +57,11 @@
 	init: function(frm, wrapper, students) {
 		this.wrapper = wrapper;
 		this.frm = frm;
-		this.make(frm, students);
+		if(students.length > 0) {
+			this.make(frm, students);
+		} else {
+			this.show_empty_state();
+		}
 	},
 	make: function(frm, students) {
 		var me = this;
@@ -89,12 +94,12 @@
 
 		var get_present_student = function(student) {
 			return students.filter(function(s) {
-				return s.idx === idx;
+				return s.group_roll_number === group_roll_number;
 			})
 		}
-		var get_absent_student = function(idx) {
+		var get_absent_student = function(group_roll_number) {
 			return students.filter(function(s) {
-				return s.idx === idx;
+				return s.group_roll_number === group_roll_number;
 			})
 		}
 
@@ -108,7 +113,7 @@
 					studs.push({
 						student: $check.data().student,
 						student_name: $check.data().studentName,
-						idx: $check.data().idx,
+						group_roll_number: $check.data().group_roll_number,
 						disabled: $check.prop("disabled"),
 						checked: $check.is(":checked")
 					});
@@ -127,16 +132,18 @@
 					function() {	//ifyes
 						frappe.call({
 							method: "erpnext.schools.api.mark_attendance",
+							freeze: true,
+							freeze_message: "Marking attendance",
 							args: {
 								"students_present": students_present,
 								"students_absent": students_absent,
-								"student_batch": frm.doc.student_batch,
+								"student_group": frm.doc.student_group,
 								"course_schedule": frm.doc.course_schedule,
 								"date": frm.doc.date
 							},
 							callback: function(r) {
 								$(me.wrapper.find(".btn-mark-att")).attr("disabled", false);
-								frm.trigger("student_batch");
+								frm.trigger("student_group");
 							}
 						});
 					},
@@ -150,11 +157,19 @@
 			return frappe.render_template("student_button", {
 				student: student.student,
 				student_name: student.student_name,
-				idx: student.idx,
+				group_roll_number: student.group_roll_number,
 				status: student.status
 			})
 		});
 
 		$(htmls.join("")).appendTo(me.wrapper);
+	},
+
+	show_empty_state: function() {
+		$(this.wrapper).html(
+			`<div class="text-center text-muted" style="line-height: 100px;">
+				${__("No Students in")} ${this.frm.doc.student_group}
+			</div>`
+		);
 	}
 });
\ No newline at end of file
diff --git a/erpnext/schools/doctype/student_attendance_tool/student_attendance_tool.json b/erpnext/schools/doctype/student_attendance_tool/student_attendance_tool.json
index 51b015c..291e027 100644
--- a/erpnext/schools/doctype/student_attendance_tool/student_attendance_tool.json
+++ b/erpnext/schools/doctype/student_attendance_tool/student_attendance_tool.json
@@ -1,5 +1,6 @@
 {
  "allow_copy": 1, 
+ "allow_guest_to_view": 0, 
  "allow_import": 0, 
  "allow_rename": 0, 
  "beta": 0, 
@@ -12,6 +13,7 @@
  "engine": "InnoDB", 
  "fields": [
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -29,7 +31,7 @@
    "label": "Based On", 
    "length": 0, 
    "no_copy": 0, 
-   "options": "Student Batch\nCourse Schedule", 
+   "options": "Student Group\nCourse Schedule", 
    "permlevel": 0, 
    "precision": "", 
    "print_hide": 0, 
@@ -43,6 +45,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -71,12 +74,13 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
-   "depends_on": "eval:doc.based_on ==\"Student Batch\"", 
-   "fieldname": "student_batch", 
+   "depends_on": "eval:doc.based_on ==\"Student Group\"", 
+   "fieldname": "student_group", 
    "fieldtype": "Link", 
    "hidden": 0, 
    "ignore_user_permissions": 0, 
@@ -85,10 +89,10 @@
    "in_global_search": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
-   "label": "Student Batch", 
+   "label": "Student Group", 
    "length": 0, 
    "no_copy": 0, 
-   "options": "Student Batch", 
+   "options": "Student Group", 
    "permlevel": 0, 
    "precision": "", 
    "print_hide": 0, 
@@ -102,6 +106,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -133,11 +138,12 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
-   "depends_on": "eval:doc.based_on ==\"Student Batch\"", 
+   "depends_on": "eval:doc.based_on ==\"Student Group\"", 
    "fieldname": "date", 
    "fieldtype": "Date", 
    "hidden": 0, 
@@ -163,11 +169,12 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
-   "depends_on": "eval: (doc.course_schedule \n|| (doc.student_batch && doc.date))", 
+   "depends_on": "eval: (doc.course_schedule \n|| (doc.student_group && doc.date))", 
    "fieldname": "attendance", 
    "fieldtype": "Section Break", 
    "hidden": 0, 
@@ -193,6 +200,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -222,17 +230,17 @@
    "unique": 0
   }
  ], 
+ "has_web_view": 0, 
  "hide_heading": 1, 
  "hide_toolbar": 1, 
  "idx": 0, 
  "image_view": 0, 
  "in_create": 0, 
- "in_dialog": 0, 
  "is_submittable": 0, 
  "issingle": 1, 
  "istable": 0, 
  "max_attachments": 0, 
- "modified": "2017-02-21 01:15:11.435110", 
+ "modified": "2017-05-01 15:09:55.740005", 
  "modified_by": "Administrator", 
  "module": "Schools", 
  "name": "Student Attendance Tool", 
diff --git a/erpnext/schools/doctype/student_attendance_tool/student_attendance_tool.py b/erpnext/schools/doctype/student_attendance_tool/student_attendance_tool.py
index 0734747..be26440 100644
--- a/erpnext/schools/doctype/student_attendance_tool/student_attendance_tool.py
+++ b/erpnext/schools/doctype/student_attendance_tool/student_attendance_tool.py
@@ -10,29 +10,28 @@
 	pass
 
 @frappe.whitelist()
-def get_student_attendance_records(based_on, date=None, student_batch=None, course_schedule=None):
+def get_student_attendance_records(based_on, date=None, student_group=None, course_schedule=None):
 	student_list = []
 	student_attendance_list = []
 
 	if based_on=="Course Schedule":
 		student_group = frappe.db.get_value("Course Schedule", course_schedule, "student_group")
 		if student_group:
-			student_list = frappe.get_list("Student Group Student", fields=["student", "student_name", "idx"] , \
-			filters={"parent": student_group, "active": 1}, order_by= "idx")
-		else:
-			student_batch = frappe.db.get_value("Course Schedule", course_schedule, "student_batch")
+			student_list = frappe.get_list("Student Group Student", fields=["student", "student_name", "group_roll_number"] , \
+			filters={"parent": student_group, "active": 1}, order_by= "group_roll_number")
+
 	if not student_list: 
-		student_list = frappe.get_list("Student Batch Student", fields=["student", "student_name", "idx"] , 
-			filters={"parent": student_batch, "active": 1}, order_by= "idx")
+		student_list = frappe.get_list("Student Group Student", fields=["student", "student_name", "group_roll_number"] , 
+			filters={"parent": student_group, "active": 1}, order_by= "group_roll_number")
 	
 	if course_schedule:
-		student_attendance_list= frappe.db.sql("""select student, status from `tabStudent Attendance` where \
-			course_schedule= %s""", (course_schedule), as_dict=1)
+		student_attendance_list= frappe.db.sql('''select student, status from `tabStudent Attendance` where \
+			course_schedule= %s''', (course_schedule), as_dict=1)
 	else:
-		student_attendance_list= frappe.db.sql("""select student, status from `tabStudent Attendance` where \
-			student_batch= %s and date= %s and \
-			(course_schedule is Null or course_schedule='')""",
-			(student_batch, date), as_dict=1)
+		student_attendance_list= frappe.db.sql('''select student, status from `tabStudent Attendance` where \
+			student_group= %s and date= %s and \
+			(course_schedule is Null or course_schedule='')''',
+			(student_group, date), as_dict=1)
 	
 	for attendance in student_attendance_list:
 		for student in student_list:
diff --git a/erpnext/schools/doctype/student_batch/student_batch.js b/erpnext/schools/doctype/student_batch/student_batch.js
deleted file mode 100644
index 7fad5d7..0000000
--- a/erpnext/schools/doctype/student_batch/student_batch.js
+++ /dev/null
@@ -1,37 +0,0 @@
-// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
-// For license information, please see license.txt
-
-frappe.ui.form.on('Student Batch', {
-	refresh: function(frm) {
-		if (!frm.doc.__islocal) {
-			frm.add_custom_button(__("Update Email Group"), function() {
-				frappe.call({
-					method: "erpnext.schools.api.update_email_group",
-					args: {
-						"doctype": "Student Batch",
-						"name": frm.doc.name
-					}
-				});
-			});
-			frm.add_custom_button(__("Newsletter"), function() {
-				frappe.route_options = {
-					email_group: frm.doc.name
-				}
-				frappe.set_route("List", "Newsletter");
-			});
-		}
-	},
-	
-	onload: function(frm){
-		cur_frm.set_query("academic_term",function(){
-			return{
-				"filters":{
-					"academic_year": (frm.doc.academic_year)
-				}
-			};
-		});
-	}
-	
-});
-
-cur_frm.add_fetch("student", "title", "student_name");
diff --git a/erpnext/schools/doctype/student_batch/student_batch.py b/erpnext/schools/doctype/student_batch/student_batch.py
deleted file mode 100644
index 9c0f3d7..0000000
--- a/erpnext/schools/doctype/student_batch/student_batch.py
+++ /dev/null
@@ -1,24 +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
-from frappe.model.document import Document
-from erpnext.schools.utils import validate_duplicate_student
-import frappe
-from frappe import _
-
-class StudentBatch(Document):
-	def autoname(self):
-		prog_abb = frappe.db.get_value("Program", self.program, "program_abbreviation")
-		if not prog_abb:
-			prog_abb = self.program
-		self.name = prog_abb + "-"+ self.student_batch_name + "-" + self.academic_year
-		
-	def validate(self):
-		validate_duplicate_student(self.students)
-		self.validate_name()
-		
-	def validate_name(self):
-		if frappe.db.exists("Student Group", self.name):
-			frappe.throw(_("""Student Group exists with same name"""))
diff --git a/erpnext/schools/doctype/student_batch_creation_tool/__init__.py b/erpnext/schools/doctype/student_batch_creation_tool/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/erpnext/schools/doctype/student_batch_creation_tool/__init__.py
+++ /dev/null
diff --git a/erpnext/schools/doctype/student_batch_creation_tool/student_batch_creation_tool.js b/erpnext/schools/doctype/student_batch_creation_tool/student_batch_creation_tool.js
deleted file mode 100644
index 3167174..0000000
--- a/erpnext/schools/doctype/student_batch_creation_tool/student_batch_creation_tool.js
+++ /dev/null
@@ -1,8 +0,0 @@
-// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
-// For license information, please see license.txt
-
-frappe.ui.form.on('Student Batch Creation Tool', {
-	refresh: function(frm) {
-		frm.disable_save();
-	}
-});
diff --git a/erpnext/schools/doctype/student_batch_creation_tool/student_batch_creation_tool.py b/erpnext/schools/doctype/student_batch_creation_tool/student_batch_creation_tool.py
deleted file mode 100644
index deda137..0000000
--- a/erpnext/schools/doctype/student_batch_creation_tool/student_batch_creation_tool.py
+++ /dev/null
@@ -1,27 +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
-from frappe.model.document import Document
-
-class StudentBatchCreationTool(Document):
-	def make_batch(self):
-		if self.academic_year and self.program and self.student_batch_name:
-			students = frappe.get_list("Program Enrollment", fields=["student", "student_name"],
-				 filters={"academic_year":self.academic_year, "program": self.program, "student_batch_name": self.student_batch_name},
-				 order_by= "student_name")
-			if students:
-				student_batch = frappe.new_doc("Student Batch")
-				student_batch.update({
-					"academic_year": self.academic_year,
-					"program": self.program,
-					"student_batch_name": self.student_batch_name,
-					"students": students
-				})
-				student_batch.save()
-				frappe.msgprint("Student Batch created.")
-			else:
-				frappe.msgprint("No students found.")
-
diff --git a/erpnext/schools/doctype/student_batch_instructor/student_batch_instructor.py b/erpnext/schools/doctype/student_batch_instructor/student_batch_instructor.py
deleted file mode 100644
index 19a759d..0000000
--- a/erpnext/schools/doctype/student_batch_instructor/student_batch_instructor.py
+++ /dev/null
@@ -1,10 +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
-from frappe.model.document import Document
-
-class StudentBatchInstructor(Document):
-	pass
diff --git a/erpnext/schools/doctype/student_batch_name/test_records.json b/erpnext/schools/doctype/student_batch_name/test_records.json
new file mode 100644
index 0000000..bf365c6
--- /dev/null
+++ b/erpnext/schools/doctype/student_batch_name/test_records.json
@@ -0,0 +1,8 @@
+[
+	{
+		"batch_name": "_Batch 1"
+	},
+	{
+		"batch_name": "_Batch 2"
+	}
+]
\ No newline at end of file
diff --git a/erpnext/schools/doctype/student_batch_student/__init__.py b/erpnext/schools/doctype/student_batch_student/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/erpnext/schools/doctype/student_batch_student/__init__.py
+++ /dev/null
diff --git a/erpnext/schools/doctype/student_batch_student/student_batch_student.json b/erpnext/schools/doctype/student_batch_student/student_batch_student.json
deleted file mode 100644
index 3558cc8..0000000
--- a/erpnext/schools/doctype/student_batch_student/student_batch_student.json
+++ /dev/null
@@ -1,148 +0,0 @@
-{
- "allow_copy": 0, 
- "allow_import": 0, 
- "allow_rename": 0, 
- "beta": 0, 
- "creation": "2016-07-22 03:27:20.120023", 
- "custom": 0, 
- "docstatus": 0, 
- "doctype": "DocType", 
- "document_type": "", 
- "editable_grid": 1, 
- "fields": [
-  {
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "student", 
-   "fieldtype": "Link", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_list_view": 1, 
-   "in_standard_filter": 0, 
-   "label": "Student", 
-   "length": 0, 
-   "no_copy": 0, 
-   "options": "Student", 
-   "permlevel": 0, 
-   "precision": "", 
-   "print_hide": 0, 
-   "print_hide_if_no_value": 0, 
-   "read_only": 0, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 1, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "unique": 0
-  }, 
-  {
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "column_break_2", 
-   "fieldtype": "Column Break", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_list_view": 0, 
-   "in_standard_filter": 0, 
-   "length": 0, 
-   "no_copy": 0, 
-   "permlevel": 0, 
-   "precision": "", 
-   "print_hide": 0, 
-   "print_hide_if_no_value": 0, 
-   "read_only": 0, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 0, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "unique": 0
-  }, 
-  {
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "student_name", 
-   "fieldtype": "Data", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_list_view": 1, 
-   "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": 1, 
-   "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, 
-   "default": "1", 
-   "fieldname": "active", 
-   "fieldtype": "Check", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_list_view": 1, 
-   "in_standard_filter": 0, 
-   "label": "Active", 
-   "length": 0, 
-   "no_copy": 0, 
-   "permlevel": 0, 
-   "precision": "", 
-   "print_hide": 0, 
-   "print_hide_if_no_value": 0, 
-   "read_only": 0, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 0, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "unique": 0
-  }
- ], 
- "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-03 05:26:35.518004", 
- "modified_by": "Administrator", 
- "module": "Schools", 
- "name": "Student Batch Student", 
- "name_case": "", 
- "owner": "Administrator", 
- "permissions": [], 
- "quick_entry": 1, 
- "read_only": 0, 
- "read_only_onload": 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_batch_student/student_batch_student.py b/erpnext/schools/doctype/student_batch_student/student_batch_student.py
deleted file mode 100644
index 542f3c4..0000000
--- a/erpnext/schools/doctype/student_batch_student/student_batch_student.py
+++ /dev/null
@@ -1,10 +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
-from frappe.model.document import Document
-
-class StudentBatchStudent(Document):
-	pass
diff --git a/erpnext/schools/doctype/student_group/student_group.js b/erpnext/schools/doctype/student_group/student_group.js
index 1dcbc3a..ed94690 100644
--- a/erpnext/schools/doctype/student_group/student_group.js
+++ b/erpnext/schools/doctype/student_group/student_group.js
@@ -1,19 +1,23 @@
 cur_frm.add_fetch("student", "title", "student_name");
 
 frappe.ui.form.on("Student Group", {
+	onload: function(frm) {
+		frm.set_query("academic_term", function() {
+			return {
+				"filters": {
+					"academic_year": (frm.doc.academic_year)
+				}
+			};
+		});
+	},
+
 	refresh: function(frm) {
 		if (!frm.doc.__islocal) {
 			frm.add_custom_button(__("Course Schedule"), function() {
-				frappe.route_options = {
-					student_group: frm.doc.name
-				}
 				frappe.set_route("List", "Course Schedule");
 			});
 
 			frm.add_custom_button(__("Assessment Plan"), function() {
-				frappe.route_options = {
-					student_group: frm.doc.name
-				}
 				frappe.set_route("List", "Assessment Plan");
 			});
 			frm.add_custom_button(__("Update Email Group"), function() {
@@ -26,26 +30,59 @@
 				});
 			});
 			frm.add_custom_button(__("Newsletter"), function() {
-				frappe.route_options = {
-					email_group: frm.doc.name
-				}
 				frappe.set_route("List", "Newsletter");
 			});
 		}
 	},
+	
+	group_based_on: function(frm) {
+		if (frm.doc.group_based_on == "Batch") {
+			frm.doc.course = null;
+		}
+	},
 
-	onload: function(frm) {
-		frm.set_query("academic_term", function() {
-			return {
-				"filters": {
-					"academic_year": (frm.doc.academic_year)
+	get_students: function(frm) {
+		if (frm.doc.group_based_on == "Batch" || frm.doc.group_based_on == "Course") {
+			var student_list = [];
+			var max_roll_no = 0;
+			$.each(frm.doc.students, function(i,d) {
+				student_list.push(d.student);
+				if (d.group_roll_number>max_roll_no) {
+					max_roll_no = d.group_roll_number;
 				}
-			};
-		});
+			});
+			frappe.call({
+				method: "erpnext.schools.doctype.student_group.student_group.get_students",
+				args: {
+					"academic_year": frm.doc.academic_year,
+					"academic_term": frm.doc.academic_term,
+					"group_based_on": frm.doc.group_based_on,
+					"program": frm.doc.program,
+					"batch" : frm.doc.batch,
+					"course": frm.doc.course	
+				},
+				callback: function(r) {
+					if(r.message) {
+						$.each(r.message, function(i, d) {
+							if(!in_list(student_list, d.student)) {
+								var s = frm.add_child("students");
+								s.student = d.student;
+								s.student_name = d.student_name;
+								if (d.active === 0) {
+									s.active = 0;
+								}
+								s.group_roll_number = ++max_roll_no;
+							}
+						});
+						refresh_field("students");
+						frm.save();
+					} else {
+						frappe.msgprint(__("Student Group is already updated."))
+					}
+				}
+			})	
+		} else {
+			frappe.msgprint(__("Select students manually for the Activity based Group"));
+		}
 	}
-});
-
-//If Student Batch is entered, deduce program, academic_year and academic term from it
-cur_frm.add_fetch("student_batch", "program", "program");
-cur_frm.add_fetch("student_batch", "academic_term", "academic_term");
-cur_frm.add_fetch("student_batch", "academic_year", "academic_year");
\ No newline at end of file
+});
\ No newline at end of file
diff --git a/erpnext/schools/doctype/student_group/student_group.json b/erpnext/schools/doctype/student_group/student_group.json
index cf42e24..a82ac0f 100644
--- a/erpnext/schools/doctype/student_group/student_group.json
+++ b/erpnext/schools/doctype/student_group/student_group.json
@@ -1,8 +1,9 @@
 {
  "allow_copy": 0, 
+ "allow_guest_to_view": 0, 
  "allow_import": 1, 
  "allow_rename": 1, 
- "autoname": "", 
+ "autoname": "field:student_group_name", 
  "beta": 0, 
  "creation": "2015-09-07 12:55:52.072792", 
  "custom": 0, 
@@ -13,36 +14,7 @@
  "engine": "InnoDB", 
  "fields": [
   {
-   "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": 1, 
-   "in_list_view": 0, 
-   "in_standard_filter": 0, 
-   "label": "Student Batch", 
-   "length": 0, 
-   "no_copy": 0, 
-   "options": "Student Batch", 
-   "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, 
@@ -54,7 +26,7 @@
    "ignore_xss_filter": 0, 
    "in_filter": 0, 
    "in_global_search": 0, 
-   "in_list_view": 1, 
+   "in_list_view": 0, 
    "in_standard_filter": 1, 
    "label": "Academic Year", 
    "length": 0, 
@@ -73,111 +45,24 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
-   "fieldname": "academic_term", 
-   "fieldtype": "Link", 
+   "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": 1, 
-   "in_standard_filter": 1, 
-   "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": 1, 
-   "unique": 0
-  }, 
-  {
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "column_break_3", 
-   "fieldtype": "Column Break", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 0, 
    "in_standard_filter": 0, 
+   "label": "Group Based on", 
    "length": 0, 
    "no_copy": 0, 
-   "permlevel": 0, 
-   "precision": "", 
-   "print_hide": 0, 
-   "print_hide_if_no_value": 0, 
-   "read_only": 0, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 0, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "unique": 0
-  }, 
-  {
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "program", 
-   "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": "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": 1, 
-   "unique": 0
-  }, 
-  {
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "course", 
-   "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": "Course", 
-   "length": 0, 
-   "no_copy": 0, 
-   "options": "Course", 
+   "options": "\nBatch\nCourse\nActivity", 
    "permlevel": 0, 
    "precision": "", 
    "print_hide": 0, 
@@ -187,10 +72,42 @@
    "report_hide": 0, 
    "reqd": 1, 
    "search_index": 0, 
-   "set_only_once": 1, 
+   "set_only_once": 0, 
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "depends_on": "", 
+   "fieldname": "student_group_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": "Student Group 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, 
@@ -221,11 +138,169 @@
    "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_term", 
+   "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": "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, 
+   "depends_on": "", 
+   "fieldname": "program", 
+   "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": "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, 
+   "depends_on": "", 
+   "fieldname": "batch", 
+   "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": "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, 
+   "depends_on": "eval:doc.group_based_on == 'Course'", 
+   "fieldname": "course", 
+   "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": "Course", 
+   "length": 0, 
+   "no_copy": 0, 
+   "options": "Course", 
+   "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, 
+   "depends_on": "eval:!doc.__islocal", 
    "fieldname": "section_break_6", 
    "fieldtype": "Section Break", 
    "hidden": 0, 
@@ -251,6 +326,37 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "fieldname": "get_students", 
+   "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": "Get Students", 
+   "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, 
@@ -281,12 +387,13 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
-   "fieldname": "amended_from", 
-   "fieldtype": "Link", 
+   "fieldname": "section_break_12", 
+   "fieldtype": "Section Break", 
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
@@ -294,14 +401,45 @@
    "in_global_search": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
-   "label": "Amended From", 
+   "label": "Instructors", 
    "length": 0, 
-   "no_copy": 1, 
-   "options": "Student Group", 
+   "no_copy": 0, 
    "permlevel": 0, 
-   "print_hide": 1, 
+   "precision": "", 
+   "print_hide": 0, 
    "print_hide_if_no_value": 0, 
-   "read_only": 1, 
+   "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": "instructors", 
+   "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": "Instructors", 
+   "length": 0, 
+   "no_copy": 0, 
+   "options": "Student Group Instructor", 
+   "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, 
@@ -310,18 +448,18 @@
    "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, 
  "menu_index": 0, 
- "modified": "2017-02-17 17:16:31.682311", 
+ "modified": "2017-04-28 11:46:51.946103", 
  "modified_by": "Administrator", 
  "module": "Schools", 
  "name": "Student Group", 
@@ -372,7 +510,7 @@
  "quick_entry": 0, 
  "read_only": 0, 
  "read_only_onload": 0, 
- "search_fields": "program, course", 
+ "search_fields": "program, batch, course", 
  "show_name_in_global_search": 0, 
  "sort_field": "modified", 
  "sort_order": "DESC", 
diff --git a/erpnext/schools/doctype/student_group/student_group.py b/erpnext/schools/doctype/student_group/student_group.py
index 996f518..81e0ed9 100644
--- a/erpnext/schools/doctype/student_group/student_group.py
+++ b/erpnext/schools/doctype/student_group/student_group.py
@@ -7,50 +7,84 @@
 from frappe.model.document import Document
 from frappe import _
 from erpnext.schools.utils import validate_duplicate_student
-from erpnext.schools.api import get_student_batch_students
 
 class StudentGroup(Document):
-	def autoname(self):
-		self.name = frappe.db.get_value("Course", self.course, "course_abbreviation")
-		if not self.name:
-			self.name = self.course
-		if self.student_batch:
-			self.name += "-" + self.student_batch
-		else:
-			prog_abb = frappe.db.get_value("Program", self.program, "program_abbreviation")
-			if not prog_abb:
-				prog_abb = self.program
-			if prog_abb:
-				self.name += "-" + prog_abb
-			if self.academic_year:
-				self.name += "-" + self.academic_year
-		if self.academic_term:
-			self.name += "-" + self.academic_term
-	
 	def validate(self):
+		self.validate_mandatory_fields()
 		self.validate_strength()
-		self.validate_student_name()
-		self.validate_name()
-		if self.student_batch:
-			self.validate_student_batch()
+		if frappe.defaults.get_defaults().student_validation_setting: 
+			self.validate_students()
+		self.validate_roll_no()
 		validate_duplicate_student(self.students)
 
+	def validate_mandatory_fields(self):
+		if self.group_based_on == "Course" and not self.course:
+			frappe.throw(_("Please select Course"))
+		if self.group_based_on == "Course" and (not self.program and self.batch):
+			frappe.throw(_("Please select Program"))
+		if self.group_based_on == "Batch" and not self.program:
+			frappe.throw(_("Please select Program"))
+
 	def validate_strength(self):
 		if self.max_strength and len(self.students) > self.max_strength:
 			frappe.throw(_("""Cannot enroll more than {0} students for this student group.""").format(self.max_strength))
 
-	def validate_student_name(self):
+	def validate_students(self):
+		program_enrollment = get_program_enrollment(self.academic_year, self.academic_term, self.program, self.batch, self.course)
+		students = [d.student for d in program_enrollment] if program_enrollment else None
 		for d in self.students:
-			d.student_name = frappe.db.get_value("Student", d.student, "title")
-	
-	def validate_name(self):
-		if frappe.db.exists("Student Batch", self.name):
-			frappe.throw(_("""Student Batch exists with same name"""))
+			if self.group_based_on != "Activity" and d.student not in students and d.active == 1:
+				frappe.throw(_("{0} - {1} is not enrolled in the given {2}".format(d.group_roll_number, d.student_name, self.group_based_on)))
+			if not frappe.db.get_value("Student", d.student, "enabled") and d.active:
+				frappe.throw(_("{0} - {1} is inactive student".format(d.group_roll_number, d.student_name)))
 
-	def validate_student_batch(self):
-		student_batch_students = []
-		for d in get_student_batch_students(self.student_batch):
-			student_batch_students.append(d.student)
+	def validate_roll_no(self):
+		roll_no_list = []
 		for d in self.students:
-			if d.student not in student_batch_students:
-				frappe.throw(_("""Student {0}: {1} does not belong to Student Batch {2}""".format(d.student, d.student_name, self.student_batch)))
\ No newline at end of file
+			if d.group_roll_number in roll_no_list:
+				frappe.throw(_("Duplicate roll number for student {0}".format(d.student_name)))
+			else:
+				roll_no_list.append(d.group_roll_number)
+
+@frappe.whitelist()
+def get_students(academic_year, group_based_on, academic_term=None, program=None, batch=None, course=None):
+	enrolled_students = get_program_enrollment(academic_year, academic_term, program, batch, course)
+
+	if enrolled_students:
+		student_list = []
+		for s in enrolled_students:
+			if frappe.db.get_value("Student", s.student, "enabled"):
+				s.update({"active": 1})
+			else:
+				s.update({"active": 0})
+			student_list.append(s)
+		return student_list
+	else:
+		frappe.throw(_("No students found"))
+
+def get_program_enrollment(academic_year, academic_term=None, program=None, batch=None, course=None):
+	
+	condition1 = " "
+	condition2 = " "
+	if academic_term:
+		condition1 += " and pe.academic_term = %(academic_term)s"
+	if program:
+		condition1 += " and pe.program = %(program)s"
+	if batch:
+		condition1 += " and pe.student_batch_name = %(batch)s"
+	if course:
+		condition1 += " and pe.name = pec.parent and pec.course = %(course)s"
+		condition2 = ", `tabProgram Enrollment Course` pec"
+
+	return frappe.db.sql('''
+		select 
+			pe.student, pe.student_name 
+		from 
+			`tabProgram Enrollment` pe {condition2}
+		where
+			pe.academic_year = %(academic_year)s  {condition1}
+		order by
+			pe.student_name asc
+		'''.format(condition1=condition1, condition2=condition2),
+		({"academic_year": academic_year, "academic_term":academic_term, "program": program, "batch": batch, "course": course}), as_dict=1)
+
diff --git a/erpnext/schools/doctype/student_group/test_records.json b/erpnext/schools/doctype/student_group/test_records.json
index 27cd181..c36c9b2 100644
--- a/erpnext/schools/doctype/student_group/test_records.json
+++ b/erpnext/schools/doctype/student_group/test_records.json
@@ -1,13 +1,29 @@
 [
 	{
-		"program": "_Test Program",
-		"course": "_Test Course",
+		"student_group_name": "Batch-_TP1-_Batch 1-2014-2015 (_Test Academic Term)",
+		"group_based_on": "Batch",
+		"program": "_TP1",
+		"batch": "_Batch 1",
 		"academic_year": "2014-2015",
 		"academic_term": "2014-2015 (_Test Academic Term)"
 	},
 	{
-		"program": "_Test Program",
-		"course": "_Test Course 2",
+		"student_group_name": "Course-TC101-2014-2015 (_Test Academic Term)",
+		"group_based_on": "Course",
+		"course": "TC101",
+		"academic_year": "2014-2015",
+		"academic_term": "2014-2015 (_Test Academic Term)"
+	},
+	{
+		"student_group_name": "Course-TC102-2014-2015 (_Test Academic Term)",
+		"group_based_on": "Course",
+		"course": "TC102",
+		"academic_year": "2014-2015",
+		"academic_term": "2014-2015 (_Test Academic Term)"
+	},
+	{
+		"student_group_name": "Activity-2014-2015 (_Test Academic Term)",
+		"group_based_on": "Activity",
 		"academic_year": "2014-2015",
 		"academic_term": "2014-2015 (_Test Academic Term)"
 	}
diff --git a/erpnext/schools/doctype/student_group_creation_tool/student_group_creation_tool.js b/erpnext/schools/doctype/student_group_creation_tool/student_group_creation_tool.js
index 9c796bb..dd909b2 100644
--- a/erpnext/schools/doctype/student_group_creation_tool/student_group_creation_tool.js
+++ b/erpnext/schools/doctype/student_group_creation_tool/student_group_creation_tool.js
@@ -6,20 +6,27 @@
 			doc:frm.doc
 		})
 	});
-	
+	frappe.realtime.on("student_group_creation_progress", function(data) {
+			if(data.progress) {
+				frappe.hide_msgprint(true);
+				frappe.show_progress(__("Creating student groups"), data.progress[0],data.progress[1]);
+			}
+	});
 });
 
 frappe.ui.form.on("Student Group Creation Tool", "get_courses", function(frm) {
 	frm.set_value("courses",[]);
-	frappe.call({
-		method: "get_courses",
-		doc:frm.doc,
-		callback: function(r) {
-			if(r.message) {
-				frm.set_value("courses", r.message);
+	if (frm.doc.academic_year && frm.doc.program) {
+		frappe.call({
+			method: "get_courses",
+			doc:frm.doc,
+			callback: function(r) {
+				if(r.message) {
+					frm.set_value("courses", r.message);
+				}
 			}
-		}
-	})
+		})
+	}
 });
 
 frappe.ui.form.on("Student Group Creation Tool", "onload", function(frm){
diff --git a/erpnext/schools/doctype/student_group_creation_tool/student_group_creation_tool.json b/erpnext/schools/doctype/student_group_creation_tool/student_group_creation_tool.json
index dd011c3..2d543ac 100644
--- a/erpnext/schools/doctype/student_group_creation_tool/student_group_creation_tool.json
+++ b/erpnext/schools/doctype/student_group_creation_tool/student_group_creation_tool.json
@@ -1,5 +1,6 @@
 {
  "allow_copy": 1, 
+ "allow_guest_to_view": 0, 
  "allow_import": 0, 
  "allow_rename": 0, 
  "beta": 0, 
@@ -9,18 +10,23 @@
  "doctype": "DocType", 
  "document_type": "", 
  "editable_grid": 0, 
+ "engine": "InnoDB", 
  "fields": [
   {
+   "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, 
@@ -30,6 +36,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, 
@@ -37,16 +44,21 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
+   "columns": 0, 
+   "description": "Leave blank if you make students groups per year", 
    "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, 
@@ -56,23 +68,28 @@
    "print_hide": 0, 
    "print_hide_if_no_value": 0, 
    "read_only": 0, 
+   "remember_last_selected_value": 0, 
    "report_hide": 0, 
-   "reqd": 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": "get_courses", 
    "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": "Get Courses", 
    "length": 0, 
    "no_copy": 0, 
@@ -81,6 +98,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, 
@@ -88,16 +106,20 @@
    "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, 
@@ -105,6 +127,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, 
@@ -112,17 +135,21 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
-   "description": "Leave blank if you wish to fetch all courses for selected academic term", 
+   "columns": 0, 
+   "description": "", 
    "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, 
@@ -132,6 +159,39 @@
    "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": "Leave unchecked if you don't want to consider batch while making course based groups. ", 
+   "fieldname": "separate_groups", 
+   "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": "Separate course based Group for every Batch", 
+   "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, 
@@ -139,16 +199,20 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
+   "columns": 0, 
    "fieldname": "section_break_4", 
    "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, 
@@ -156,6 +220,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, 
@@ -163,16 +228,20 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
+   "columns": 0, 
    "fieldname": "courses", 
    "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": "Courses", 
    "length": 0, 
    "no_copy": 0, 
@@ -182,6 +251,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, 
@@ -189,17 +259,17 @@
    "unique": 0
   }
  ], 
+ "has_web_view": 0, 
  "hide_heading": 1, 
  "hide_toolbar": 1, 
  "idx": 0, 
  "image_view": 0, 
  "in_create": 0, 
- "in_dialog": 0, 
  "is_submittable": 0, 
  "issingle": 1, 
  "istable": 0, 
  "max_attachments": 0, 
- "modified": "2016-07-25 06:40:46.107131", 
+ "modified": "2017-05-15 12:43:32.317942", 
  "modified_by": "Administrator", 
  "module": "Schools", 
  "name": "Student Group Creation Tool", 
@@ -230,7 +300,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/schools/doctype/student_group_creation_tool/student_group_creation_tool.py b/erpnext/schools/doctype/student_group_creation_tool/student_group_creation_tool.py
index 65cf755..a236508 100644
--- a/erpnext/schools/doctype/student_group_creation_tool/student_group_creation_tool.py
+++ b/erpnext/schools/doctype/student_group_creation_tool/student_group_creation_tool.py
@@ -9,40 +9,63 @@
 
 class StudentGroupCreationTool(Document):
 	def get_courses(self):
-		if self.program:
-			courses = frappe.db.sql("""select course, course_code, parent as program, "student_group_name"
-				from `tabProgram Course` where academic_term= %s and parent= %s""",
-				(self.academic_term, self.program), as_dict=1)
+		group_list = []
+
+		batches = frappe.db.sql('''select name as batch from `tabStudent Batch Name`''', as_dict=1)
+		for batch in batches:
+			group_list.append({"group_based_on":"Batch", "batch":batch.batch})
+
+		courses = frappe.db.sql('''select course, course_name from `tabProgram Course` where parent=%s''',
+			(self.program), as_dict=1)
+		if self.separate_groups:
+			from itertools import product
+			course_list = product(courses,batches)
+			for course in course_list:
+				temp_dict = {}
+				temp_dict.update({"group_based_on":"Course"})
+				temp_dict.update(course[0])
+				temp_dict.update(course[1])
+				group_list.append(temp_dict)
 		else:
-			courses = frappe.db.sql("""select course, course_code, parent as program, "student_group_name"
-				from `tabProgram Course` where academic_term= %s""",
-				self.academic_term, as_dict=1)
+			for course in courses:
+				course.update({"group_based_on":"Course"})
+				group_list.append(course)
 
-		for d in courses:
-			if d.course_code:
-				d.student_group_name = d.course_code + "-" + self.academic_year
-			else:
-				d.student_group_name = None
+		for group in group_list:
+			if group.get("group_based_on") == "Batch":
+				student_group_name = self.program + "/" + group.get("batch") + "/" + (self.academic_term if self.academic_term else self.academic_year)
+				group.update({"student_group_name": student_group_name})
+			elif group.get("group_based_on") == "Course":
+				student_group_name = group.get("course") + "/" + self.program + ("/" + group.get("batch") if group.get("batch") else "") + "/" + (self.academic_term if self.academic_term else self.academic_year)
+				group.update({"student_group_name": student_group_name})
 
-		return courses
+		return group_list
 
 	def create_student_groups(self):
 		if not self.courses:
 			frappe.throw(_("""No Student Groups created."""))
 
+		l = len(self.courses)
 		for d in self.courses:
-			if not d.course:
-				frappe.throw(_("""Course is mandatory in row {0}""".format(d.idx)))
-
 			if not d.student_group_name:
 				frappe.throw(_("""Student Group Name is mandatory in row {0}""".format(d.idx)))
 
+			if d.group_based_on == "Course" and not d.course:
+				frappe.throw(_("""Course is mandatory in row {0}""".format(d.idx)))
+
+			if d.group_based_on == "Batch" and not d.batch:
+				frappe.throw(_("""Batch is mandatory in row {0}""".format(d.idx)))
+
+			frappe.publish_realtime('student_group_creation_progress', {"progress": [d.idx, l]}, user=frappe.session.user)
+
 			student_group = frappe.new_doc("Student Group")
-			student_group.group_name = d.student_group_name
+			student_group.student_group_name = d.student_group_name
+			student_group.group_based_on = d.group_based_on
+			student_group.program = self.program
 			student_group.course = d.course
-			student_group.max_strength = d.max_strength
+			student_group.batch = d.batch
 			student_group.academic_term = self.academic_term
 			student_group.academic_year = self.academic_year
 			student_group.save()
 
-		frappe.msgprint(_("Student Groups created."))
+		frappe.msgprint(_("{0} Student Groups created.".format(l)))
diff --git a/erpnext/schools/doctype/student_group_creation_tool_course/student_group_creation_tool_course.json b/erpnext/schools/doctype/student_group_creation_tool_course/student_group_creation_tool_course.json
index 88466b6..d945d4b 100644
--- a/erpnext/schools/doctype/student_group_creation_tool_course/student_group_creation_tool_course.json
+++ b/erpnext/schools/doctype/student_group_creation_tool_course/student_group_creation_tool_course.json
@@ -1,5 +1,6 @@
 {
  "allow_copy": 0, 
+ "allow_guest_to_view": 0, 
  "allow_import": 0, 
  "allow_rename": 0, 
  "beta": 0, 
@@ -9,18 +10,54 @@
  "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": "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": 1, 
+   "in_standard_filter": 0, 
+   "label": "Group Based On", 
+   "length": 0, 
+   "no_copy": 0, 
+   "options": "\nBatch\nCourse", 
+   "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": "course", 
    "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", 
    "length": 0, 
    "no_copy": 0, 
@@ -30,32 +67,7 @@
    "print_hide": 0, 
    "print_hide_if_no_value": 0, 
    "read_only": 0, 
-   "report_hide": 0, 
-   "reqd": 1, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "unique": 0
-  }, 
-  {
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "fieldname": "course_code", 
-   "fieldtype": "Read Only", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_list_view": 0, 
-   "label": "Course Code", 
-   "length": 0, 
-   "no_copy": 0, 
-   "options": "course.course_code", 
-   "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, 
@@ -63,16 +75,51 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
+   "columns": 0, 
+   "fieldname": "batch", 
+   "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": "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": "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, 
@@ -80,6 +127,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, 
@@ -87,16 +135,20 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
+   "columns": 0, 
    "fieldname": "student_group_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": "Student Group Name", 
    "length": 0, 
    "no_copy": 0, 
@@ -105,6 +157,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, 
@@ -112,16 +165,51 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
+   "columns": 0, 
+   "fieldname": "course_code", 
+   "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": "Course Code", 
+   "length": 0, 
+   "no_copy": 0, 
+   "options": "course.course_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": "max_strength", 
    "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": "Max Strength", 
    "length": 0, 
    "no_copy": 0, 
@@ -130,6 +218,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, 
@@ -137,17 +226,17 @@
    "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-07-25 06:40:49.000588", 
+ "modified": "2017-05-15 14:18:23.435415", 
  "modified_by": "Administrator", 
  "module": "Schools", 
  "name": "Student Group Creation Tool Course", 
@@ -157,7 +246,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/schools/doctype/student_batch_instructor/__init__.py b/erpnext/schools/doctype/student_group_instructor/__init__.py
similarity index 100%
rename from erpnext/schools/doctype/student_batch_instructor/__init__.py
rename to erpnext/schools/doctype/student_group_instructor/__init__.py
diff --git a/erpnext/schools/doctype/student_batch_instructor/student_batch_instructor.json b/erpnext/schools/doctype/student_group_instructor/student_group_instructor.json
similarity index 88%
rename from erpnext/schools/doctype/student_batch_instructor/student_batch_instructor.json
rename to erpnext/schools/doctype/student_group_instructor/student_group_instructor.json
index 29680fb..541e9b3 100644
--- a/erpnext/schools/doctype/student_batch_instructor/student_batch_instructor.json
+++ b/erpnext/schools/doctype/student_group_instructor/student_group_instructor.json
@@ -1,9 +1,10 @@
 {
  "allow_copy": 0, 
+ "allow_guest_to_view": 0, 
  "allow_import": 0, 
  "allow_rename": 0, 
  "beta": 0, 
- "creation": "2016-11-21 19:04:48.211565", 
+ "creation": "2017-04-17 16:06:01.406768", 
  "custom": 0, 
  "docstatus": 0, 
  "doctype": "DocType", 
@@ -22,6 +23,7 @@
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
    "in_filter": 0, 
+   "in_global_search": 0, 
    "in_list_view": 1, 
    "in_standard_filter": 0, 
    "label": "Instructor", 
@@ -51,6 +53,7 @@
    "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, 
@@ -78,6 +81,7 @@
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
    "in_filter": 0, 
+   "in_global_search": 0, 
    "in_list_view": 1, 
    "in_standard_filter": 0, 
    "label": "Instructor Name", 
@@ -97,27 +101,29 @@
    "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-21 19:08:07.680320", 
+ "modified": "2017-04-17 16:06:05.792863", 
  "modified_by": "Administrator", 
  "module": "Schools", 
- "name": "Student Batch Instructor", 
+ "name": "Student Group Instructor", 
  "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/stock/doctype/package_code/package_code.py b/erpnext/schools/doctype/student_group_instructor/student_group_instructor.py
similarity index 85%
copy from erpnext/stock/doctype/package_code/package_code.py
copy to erpnext/schools/doctype/student_group_instructor/student_group_instructor.py
index 1d989c0..b6cc588 100644
--- a/erpnext/stock/doctype/package_code/package_code.py
+++ b/erpnext/schools/doctype/student_group_instructor/student_group_instructor.py
@@ -6,5 +6,5 @@
 import frappe
 from frappe.model.document import Document
 
-class PackageCode(Document):
+class StudentGroupInstructor(Document):
 	pass
diff --git a/erpnext/schools/doctype/student_group_student/student_group_student.json b/erpnext/schools/doctype/student_group_student/student_group_student.json
index 5ca7b66..5fc434a 100644
--- a/erpnext/schools/doctype/student_group_student/student_group_student.json
+++ b/erpnext/schools/doctype/student_group_student/student_group_student.json
@@ -1,5 +1,6 @@
 {
  "allow_copy": 0, 
+ "allow_guest_to_view": 0, 
  "allow_import": 0, 
  "allow_rename": 0, 
  "beta": 0, 
@@ -21,6 +22,7 @@
    "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", 
@@ -44,39 +46,13 @@
    "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_list_view": 0, 
-   "in_standard_filter": 0, 
-   "length": 0, 
-   "no_copy": 0, 
-   "permlevel": 0, 
-   "precision": "", 
-   "print_hide": 0, 
-   "print_hide_if_no_value": 0, 
-   "read_only": 0, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 0, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "unique": 0
-  }, 
-  {
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
    "fieldname": "student_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": "Student Name", 
@@ -99,6 +75,63 @@
    "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, 
+   "length": 0, 
+   "no_copy": 0, 
+   "permlevel": 0, 
+   "precision": "", 
+   "print_hide": 0, 
+   "print_hide_if_no_value": 0, 
+   "read_only": 0, 
+   "remember_last_selected_value": 0, 
+   "report_hide": 0, 
+   "reqd": 0, 
+   "search_index": 0, 
+   "set_only_once": 0, 
+   "unique": 0
+  }, 
+  {
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "fieldname": "group_roll_number", 
+   "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": "Group Roll Number", 
+   "length": 0, 
+   "no_copy": 0, 
+   "permlevel": 0, 
+   "precision": "", 
+   "print_hide": 0, 
+   "print_hide_if_no_value": 0, 
+   "read_only": 0, 
+   "remember_last_selected_value": 0, 
+   "report_hide": 0, 
+   "reqd": 0, 
+   "search_index": 0, 
+   "set_only_once": 0, 
+   "unique": 0
+  }, 
+  {
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
    "default": "1", 
    "fieldname": "active", 
    "fieldtype": "Check", 
@@ -106,6 +139,7 @@
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
    "in_filter": 0, 
+   "in_global_search": 0, 
    "in_list_view": 1, 
    "in_standard_filter": 0, 
    "label": "Active", 
@@ -124,17 +158,17 @@
    "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-01-27 14:49:54.533005", 
+ "modified": "2017-04-12 14:56:07.532226", 
  "modified_by": "Administrator", 
  "module": "Schools", 
  "name": "Student Group Student", 
@@ -144,6 +178,7 @@
  "quick_entry": 0, 
  "read_only": 0, 
  "read_only_onload": 0, 
+ "show_name_in_global_search": 0, 
  "sort_field": "modified", 
  "sort_order": "DESC", 
  "track_changes": 0, 
diff --git a/erpnext/schools/doctype/student_group_student/student_group_student.py b/erpnext/schools/doctype/student_group_student/student_group_student.py
index 1fe4ea1..820e301 100644
--- a/erpnext/schools/doctype/student_group_student/student_group_student.py
+++ b/erpnext/schools/doctype/student_group_student/student_group_student.py
@@ -7,4 +7,4 @@
 from frappe.model.document import Document
 
 class StudentGroupStudent(Document):
-	pass
+	pass
\ No newline at end of file
diff --git a/erpnext/schools/report/absent_student_report/absent_student_report.py b/erpnext/schools/report/absent_student_report/absent_student_report.py
index ba2b7ad..0949831 100644
--- a/erpnext/schools/report/absent_student_report/absent_student_report.py
+++ b/erpnext/schools/report/absent_student_report/absent_student_report.py
@@ -20,7 +20,7 @@
 	data = []
 	for student in absent_students:
 		if not student.student in leave_applicants:
-			row = [student.student, student.student_name, student.student_batch]
+			row = [student.student, student.student_name, student.student_group]
 			stud_details = frappe.db.get_value("Student", student.student, ['student_email_id', 'student_mobile_number'], as_dict=True)
 			
 			if stud_details.student_email_id:
@@ -41,15 +41,15 @@
 	columns = [ 
 		_("Student") + ":Link/Student:90", 
 		_("Student Name") + "::150", 
-		_("Student Batch") + "::180",
+		_("Student Group") + "::180",
 		_("Student Email Address") + "::180",
 		_("Student Mobile No.") + "::150",
 	]
 	return columns
 
 def get_absent_students(date):
-	absent_students = frappe.db.sql("""select student, student_name, student_batch from `tabStudent Attendance` 
-		where status="Absent" and date = %s order by student_batch, student_name""", date, as_dict=1)
+	absent_students = frappe.db.sql("""select student, student_name, student_group from `tabStudent Attendance` 
+		where status="Absent" and date = %s order by student_group, student_name""", date, as_dict=1)
 	return absent_students
 
 def get_leave_applications(date):
diff --git a/erpnext/schools/report/student_batch_wise_attendance/student_batch_wise_attendance.py b/erpnext/schools/report/student_batch_wise_attendance/student_batch_wise_attendance.py
index d8df3a0..646e3f7 100644
--- a/erpnext/schools/report/student_batch_wise_attendance/student_batch_wise_attendance.py
+++ b/erpnext/schools/report/student_batch_wise_attendance/student_batch_wise_attendance.py
@@ -14,15 +14,15 @@
 	
 	columns = get_columns(filters)
 
-	active_student_batch = get_active_student_batch()
+	active_student_group = get_active_student_group()
 
 	data = []
-	for student_batch in active_student_batch:
-		row = [student_batch.name]
+	for student_group in active_student_group:
+		row = [student_group.name]
 		present_students = 0
 		absent_students = 0
-		student_batch_strength = get_student_batch_strength(student_batch.name)
-		student_attendance = get_student_attendance(student_batch.name, filters.get("date"))
+		student_group_strength = get_student_group_strength(student_group.name)
+		student_attendance = get_student_attendance(student_group.name, filters.get("date"))
 		if student_attendance:
 			for attendance in student_attendance:
 				if attendance.status== "Present":
@@ -30,35 +30,35 @@
 				elif attendance.status== "Absent":
 					absent_students = attendance.count
 
-		unmarked_students = student_batch_strength - (present_students + absent_students)
-		row+= [student_batch_strength, present_students, absent_students, unmarked_students]
+		unmarked_students = student_group_strength - (present_students + absent_students)
+		row+= [student_group_strength, present_students, absent_students, unmarked_students]
 		data.append(row)
 
 	return columns, data
 
 def get_columns(filters):
 	columns = [ 
-		_("Student batch") + ":Link/Student Batch:250", 
-		_("Student batch Strength") + "::170", 
+		_("Student Group") + ":Link/Student Group:250", 
+		_("Student Group Strength") + "::170", 
 		_("Present") + "::90", 
 		_("Absent") + "::90",
 		_("Not Marked") + "::90"
 	]
 	return columns
 
-def get_active_student_batch():
-	active_student_batch = frappe.db.sql("""select name from `tabStudent Batch` 
-		where enabled = 1 order by name""", as_dict=1)
-	return active_student_batch
+def get_active_student_group():
+	active_student_groups = frappe.db.sql("""select name from `tabStudent Group` where group_based_on = "Batch" 
+		and academic_year=%s order by name""", (frappe.defaults.get_defaults().academic_year), as_dict=1)
+	return active_student_groups
 
-def get_student_batch_strength(student_batch):
-	student_batch_strength = frappe.db.sql("""select count(*) from `tabStudent Batch Student` 
-		where parent = %s and active=1""", student_batch)[0][0]
-	return student_batch_strength
+def get_student_group_strength(student_group):
+	student_group_strength = frappe.db.sql("""select count(*) from `tabStudent Group Student` 
+		where parent = %s and active=1""", student_group)[0][0]
+	return student_group_strength
 
-def get_student_attendance(student_batch, date):
+def get_student_attendance(student_group, date):
 	student_attendance = frappe.db.sql("""select count(*) as count, status from `tabStudent Attendance` where \
-				student_batch= %s and date= %s and\
+				student_group= %s and date= %s and\
 				(course_schedule is Null or course_schedule='') group by status""",
-				(student_batch, date), as_dict=1)
+				(student_group, date), as_dict=1)
 	return student_attendance
\ No newline at end of file
diff --git a/erpnext/schools/report/student_monthly_attendance_sheet/student_monthly_attendance_sheet.js b/erpnext/schools/report/student_monthly_attendance_sheet/student_monthly_attendance_sheet.js
index 8d914cb..57927fa 100644
--- a/erpnext/schools/report/student_monthly_attendance_sheet/student_monthly_attendance_sheet.js
+++ b/erpnext/schools/report/student_monthly_attendance_sheet/student_monthly_attendance_sheet.js
@@ -19,10 +19,10 @@
             "reqd": 1
         },
         {
-            "fieldname": "student_batch",
-            "label": __("Student Batch"),
+            "fieldname": "student_group",
+            "label": __("Student Group"),
             "fieldtype": "Link",
-            "options": "Student Batch",
+            "options": "Student Group",
             "reqd": 1
         }
     ],
diff --git a/erpnext/schools/report/student_monthly_attendance_sheet/student_monthly_attendance_sheet.py b/erpnext/schools/report/student_monthly_attendance_sheet/student_monthly_attendance_sheet.py
index f906034..91f6c36 100644
--- a/erpnext/schools/report/student_monthly_attendance_sheet/student_monthly_attendance_sheet.py
+++ b/erpnext/schools/report/student_monthly_attendance_sheet/student_monthly_attendance_sheet.py
@@ -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_batch_students
+from erpnext.schools.api import get_student_group_students
 
 def execute(filters=None):
 	if not filters: filters = {}
@@ -15,9 +15,9 @@
 	to_date = get_last_day(filters["month"] + '-' + filters["year"])
 	total_days_in_month = date_diff(to_date, from_date) +1
 	columns = get_columns(total_days_in_month)
-	students = get_student_batch_students(filters.get("student_batch"))
+	students = get_student_group_students(filters.get("student_group"))
 	students_list = get_students_list(students)
-	att_map = get_attendance_list(from_date, to_date, filters.get("student_batch"), students_list)
+	att_map = get_attendance_list(from_date, to_date, filters.get("student_group"), students_list)
 	data = []
 	for stud in students:
 		row = [stud.student, stud.student_name]
@@ -51,12 +51,12 @@
 		student_list.append(stud.student)
 	return student_list
 
-def get_attendance_list(from_date, to_date, student_batch, students_list):
-	attendance_list = frappe.db.sql("""select student, date, status 
-		from `tabStudent Attendance` where student_batch = %s 
+def get_attendance_list(from_date, to_date, student_group, students_list):
+	attendance_list = frappe.db.sql('''select student, date, status 
+		from `tabStudent Attendance` where student_group = %s 
 		and date between %s and %s
-		order by student, date""",
-		(student_batch, from_date, to_date), as_dict=1)
+		order by student, date''',
+		(student_group, from_date, to_date), as_dict=1)
 	att_map = {}
 	students_with_leave_application = get_students_with_leave_application(from_date, to_date, students_list)
 	for d in attendance_list:
@@ -97,7 +97,7 @@
 
 @frappe.whitelist()
 def get_attendance_years():
-	year_list = frappe.db.sql_list("""select distinct YEAR(date) from `tabStudent Attendance` ORDER BY YEAR(date) DESC""")
+	year_list = frappe.db.sql_list('''select distinct YEAR(date) from `tabStudent Attendance` ORDER BY YEAR(date) DESC''')
 	if not year_list:
 		year_list = [getdate().year]
 	return "\n".join(str(year) for year in year_list)
diff --git a/erpnext/schools/utils.py b/erpnext/schools/utils.py
index 3adbae4..2ca46d5 100644
--- a/erpnext/schools/utils.py
+++ b/erpnext/schools/utils.py
@@ -9,9 +9,9 @@
 class OverlapError(frappe.ValidationError): pass
 
 def validate_overlap_for(doc, doctype, fieldname, value=None):
-	"""Checks overlap for specified feild.
+	"""Checks overlap for specified field.
 	
-	:param fieldname: Checks Overlap for this feild 
+	:param fieldname: Checks Overlap for this field 
 	"""
 	
 	existing = get_overlap_for(doc, doctype, fieldname, value)
@@ -20,9 +20,9 @@
 			doc.meta.get_label(fieldname) if not value else fieldname , value or doc.get(fieldname)), OverlapError)
 	
 def get_overlap_for(doc, doctype, fieldname, value=None):
-	"""Returns overlaping document for specified feild.
+	"""Returns overlaping document for specified field.
 	
-	:param fieldname: Checks Overlap for this feild 
+	:param fieldname: Checks Overlap for this field 
 	"""
 
 	existing = frappe.db.sql("""select name, from_time, to_time from `tab{0}`
diff --git a/erpnext/selling/doctype/customer/customer_list.js b/erpnext/selling/doctype/customer/customer_list.js
index 09c3e93..38fc9ad 100644
--- a/erpnext/selling/doctype/customer/customer_list.js
+++ b/erpnext/selling/doctype/customer/customer_list.js
@@ -1,3 +1,3 @@
 frappe.listview_settings['Customer'] = {
-	add_fields: ["customer_name", "territory", "customer_group", "customer_type"],
+	add_fields: ["customer_name", "territory", "customer_group", "customer_type", "image"],
 };
diff --git a/erpnext/selling/doctype/customer/test_customer.py b/erpnext/selling/doctype/customer/test_customer.py
index 0d74d23..40ed6f9 100644
--- a/erpnext/selling/doctype/customer/test_customer.py
+++ b/erpnext/selling/doctype/customer/test_customer.py
@@ -54,25 +54,30 @@
 			self.assertEquals(value, details.get(key))
 
 	def test_rename(self):
+		# delete communication linked to these 2 customers
 		for name in ("_Test Customer 1", "_Test Customer 1 Renamed"):
 			frappe.db.sql("""delete from `tabCommunication`
 				where communication_type='Comment' and reference_doctype=%s and reference_name=%s""",
 				("Customer", name))
 
+		# add comments
 		comment = frappe.get_doc("Customer", "_Test Customer 1").add_comment("Comment", "Test Comment for Rename")
 
+		# rename
 		frappe.rename_doc("Customer", "_Test Customer 1", "_Test Customer 1 Renamed")
 
+		# check if customer renamed
 		self.assertTrue(frappe.db.exists("Customer", "_Test Customer 1 Renamed"))
 		self.assertFalse(frappe.db.exists("Customer", "_Test Customer 1"))
 
-		# test that comment gets renamed
+		# test that comment gets linked to renamed doc
 		self.assertEquals(frappe.db.get_value("Communication", {
 			"communication_type": "Comment",
 			"reference_doctype": "Customer",
 			"reference_name": "_Test Customer 1 Renamed"
 		}), comment.name)
 
+		# rename back to original
 		frappe.rename_doc("Customer", "_Test Customer 1 Renamed", "_Test Customer 1")
 
 	def test_freezed_customer(self):
diff --git a/erpnext/selling/doctype/installation_note/installation_note.js b/erpnext/selling/doctype/installation_note/installation_note.js
index d4b2179..9aff74a 100644
--- a/erpnext/selling/doctype/installation_note/installation_note.js
+++ b/erpnext/selling/doctype/installation_note/installation_note.js
@@ -42,18 +42,23 @@
 	},
 
 	refresh: function() {
+		var me = this;
 		if (this.frm.doc.docstatus===0) {
-			cur_frm.add_custom_button(__('From Delivery Note'),
+			this.frm.add_custom_button(__('From Delivery Note'),
 				function() {
 					erpnext.utils.map_current_doc({
 						method: "erpnext.stock.doctype.delivery_note.delivery_note.make_installation_note",
 						source_doctype: "Delivery Note",
+						target: me.frm,
+						date_field: "posting_date",
+						setters: {
+							customer: me.frm.doc.customer || undefined,
+						},
 						get_query_filters: {
 							docstatus: 1,
 							status: ["not in", ["Stopped", "Closed"]],
 							per_installed: ["<", 99.99],
-							customer: cur_frm.doc.customer || undefined,
-							company: cur_frm.doc.company
+							company: me.frm.doc.company
 						}
 					})
 				}, "fa fa-download", "btn-default"
diff --git a/erpnext/selling/doctype/quotation/quotation.js b/erpnext/selling/doctype/quotation/quotation.js
index 9c37365..940daaa 100644
--- a/erpnext/selling/doctype/quotation/quotation.js
+++ b/erpnext/selling/doctype/quotation/quotation.js
@@ -25,6 +25,8 @@
 	refresh: function(doc, dt, dn) {
 		this._super(doc, dt, dn);
 
+		var me = this;
+
 		if(doc.docstatus == 1 && doc.status!=='Lost') {
 			cur_frm.add_custom_button(__('Make Sales Order'),
 				cur_frm.cscript['Make Sales Order']);
@@ -36,17 +38,24 @@
 		}
 
 		if (this.frm.doc.docstatus===0) {
-			cur_frm.add_custom_button(__('Opportunity'),
+			this.frm.add_custom_button(__('Opportunity'),
 				function() {
+					var setters = {};
+					if(me.frm.doc.customer) {
+						setters.customer = me.frm.doc.customer || undefined;
+					} else if (me.frm.doc.lead) {
+						setters.lead = me.frm.doc.lead || undefined;
+					}
 					erpnext.utils.map_current_doc({
 						method: "erpnext.crm.doctype.opportunity.opportunity.make_quotation",
 						source_doctype: "Opportunity",
+						target: me.frm,
+						setters: setters,
 						get_query_filters: {
 							status: ["not in", ["Lost", "Closed"]],
-							enquiry_type: cur_frm.doc.order_type,
-							customer: cur_frm.doc.customer || undefined,
-							lead: cur_frm.doc.lead || undefined,
-							company: cur_frm.doc.company
+							company: me.frm.doc.company,
+							// cannot set enquiry_type as setter, as the fieldname is order_type
+							enquiry_type: me.frm.doc.order_type,
 						}
 					})
 				}, __("Get items from"), "btn-default");
diff --git a/erpnext/selling/doctype/quotation/quotation.json b/erpnext/selling/doctype/quotation/quotation.json
index ee194f3..2f2a7ed 100644
--- a/erpnext/selling/doctype/quotation/quotation.json
+++ b/erpnext/selling/doctype/quotation/quotation.json
@@ -1,5 +1,6 @@
 {
  "allow_copy": 0, 
+ "allow_guest_to_view": 0, 
  "allow_import": 1, 
  "allow_rename": 0, 
  "autoname": "naming_series:", 
@@ -12,6 +13,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": 1, 
    "bold": 0, 
    "collapsible": 0, 
@@ -71,6 +74,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -102,6 +106,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -134,6 +139,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 1, 
    "collapsible": 0, 
@@ -166,6 +172,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 1, 
    "collapsible": 0, 
@@ -198,6 +205,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 1, 
    "collapsible": 0, 
@@ -226,6 +234,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -255,6 +264,7 @@
    "width": "50%"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -287,6 +297,7 @@
    "width": "150px"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -320,6 +331,7 @@
    "width": "150px"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -352,6 +364,7 @@
    "width": "100px"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -384,6 +397,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 1, 
@@ -415,6 +429,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -444,6 +459,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -474,6 +490,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -506,6 +523,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -534,6 +552,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -562,6 +581,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -591,6 +611,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -620,6 +641,7 @@
    "width": "50%"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -649,6 +671,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -677,6 +700,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -710,6 +734,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -740,6 +765,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 1, 
@@ -769,6 +795,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -801,6 +828,7 @@
    "width": "100px"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -834,6 +862,7 @@
    "width": "100px"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -862,6 +891,7 @@
    "width": "50%"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -894,6 +924,7 @@
    "width": "100px"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -923,6 +954,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -953,6 +985,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -981,6 +1014,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1011,6 +1045,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1036,13 +1071,14 @@
    "read_only": 0, 
    "remember_last_selected_value": 0, 
    "report_hide": 0, 
-   "reqd": 0, 
+   "reqd": 1, 
    "search_index": 0, 
    "set_only_once": 0, 
    "unique": 0, 
    "width": "40px"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1070,6 +1106,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1100,6 +1137,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1132,6 +1170,7 @@
    "width": "100px"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1159,6 +1198,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1189,6 +1229,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1218,6 +1259,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1248,6 +1290,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1279,6 +1322,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1306,6 +1350,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1336,6 +1381,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1363,6 +1409,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1394,6 +1441,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1423,6 +1471,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1450,6 +1499,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1481,6 +1531,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1508,6 +1559,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1537,6 +1589,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 1, 
@@ -1567,6 +1620,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1598,6 +1652,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1628,6 +1683,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1656,6 +1712,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1685,6 +1742,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1714,6 +1772,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1744,6 +1803,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1776,6 +1836,7 @@
    "width": "200px"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1808,6 +1869,7 @@
    "width": "200px"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1840,6 +1902,7 @@
    "width": "200px"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1869,6 +1932,7 @@
    "width": "50%"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1901,6 +1965,7 @@
    "width": "200px"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 1, 
    "collapsible": 0, 
@@ -1933,6 +1998,7 @@
    "width": "200px"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1964,6 +2030,7 @@
    "width": "200px"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 1, 
@@ -1995,6 +2062,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2026,6 +2094,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2056,6 +2125,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 1, 
@@ -2085,6 +2155,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 1, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2116,6 +2187,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 1, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2147,6 +2219,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2175,6 +2248,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2204,6 +2278,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 1, 
@@ -2234,6 +2309,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2265,6 +2341,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2296,6 +2373,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 1, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2327,6 +2405,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2356,6 +2435,7 @@
    "width": "50%"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2388,6 +2468,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2418,6 +2499,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2448,19 +2530,19 @@
    "unique": 0
   }
  ], 
+ "has_web_view": 0, 
  "hide_heading": 0, 
  "hide_toolbar": 0, 
  "icon": "fa fa-shopping-cart", 
  "idx": 82, 
  "image_view": 0, 
  "in_create": 0, 
- "in_dialog": 0, 
  "is_submittable": 1, 
  "issingle": 0, 
  "istable": 0, 
  "max_attachments": 1, 
  "menu_index": 0, 
- "modified": "2017-02-20 13:22:18.466192", 
+ "modified": "2017-05-15 13:05:39.469590", 
  "modified_by": "Administrator", 
  "module": "Selling", 
  "name": "Quotation", 
diff --git a/erpnext/selling/doctype/quotation/quotation.py b/erpnext/selling/doctype/quotation/quotation.py
index d32fe77..b102e1d 100644
--- a/erpnext/selling/doctype/quotation/quotation.py
+++ b/erpnext/selling/doctype/quotation/quotation.py
@@ -44,7 +44,9 @@
 	def update_opportunity(self):
 		for opportunity in list(set([d.prevdoc_docname for d in self.get("items")])):
 			if opportunity:
-				frappe.get_doc("Opportunity", opportunity).set_status(update=True)
+				opp = frappe.get_doc("Opportunity", opportunity)
+				opp.status = None
+				opp.set_status(update=True)
 
 	def declare_order_lost(self, arg):
 		if not self.has_sales_order():
@@ -102,7 +104,7 @@
 		target.run_method("calculate_taxes_and_totals")
 
 	def update_item(obj, target, source_parent):
-		target.stock_qty = flt(obj.qty) * flt(obj.conversion_factor)	
+		target.stock_qty = flt(obj.qty) * flt(obj.conversion_factor)
 
 	doclist = get_mapped_doc("Quotation", source_name, {
 			"Quotation": {
diff --git a/erpnext/selling/doctype/quotation/test_quotation.py b/erpnext/selling/doctype/quotation/test_quotation.py
index 36cc472..640c026 100644
--- a/erpnext/selling/doctype/quotation/test_quotation.py
+++ b/erpnext/selling/doctype/quotation/test_quotation.py
@@ -37,7 +37,7 @@
 		from erpnext.selling.doctype.sales_order.sales_order \
 			import make_delivery_note, make_sales_invoice
 
-		total_margin = flt((1500*18.75)/100 + 1500)
+		rate_with_margin = flt((1500*18.75)/100 + 1500)
 
 		test_records[0]['items'][0]['price_list_rate'] = 1500
 		test_records[0]['items'][0]['margin_type'] = 'Percentage'
@@ -46,7 +46,7 @@
 		quotation = frappe.copy_doc(test_records[0])
 		quotation.insert()
 
-		self.assertEquals(quotation.get("items")[0].rate, total_margin)
+		self.assertEquals(quotation.get("items")[0].rate, rate_with_margin)
 		self.assertRaises(frappe.ValidationError, make_sales_order, quotation.name)
 		quotation.submit()
 
@@ -56,16 +56,16 @@
 		sales_order.transaction_date = "2016-01-01"
 		sales_order.insert()
 
-		self.assertEquals(quotation.get("items")[0].rate, total_margin)
+		self.assertEquals(quotation.get("items")[0].rate, rate_with_margin)
 
 		sales_order.submit()
 
 		dn = make_delivery_note(sales_order.name)
-		self.assertEquals(quotation.get("items")[0].rate, total_margin)
+		self.assertEquals(quotation.get("items")[0].rate, rate_with_margin)
 		dn.save()
 
 		si = make_sales_invoice(sales_order.name)
-		self.assertEquals(quotation.get("items")[0].rate, total_margin)
+		self.assertEquals(quotation.get("items")[0].rate, rate_with_margin)
 		si.save()
 
 test_records = frappe.get_test_records('Quotation')
diff --git a/erpnext/selling/doctype/quotation/test_records.json b/erpnext/selling/doctype/quotation/test_records.json
index 8a37dbb..5637fb9 100644
--- a/erpnext/selling/doctype/quotation/test_records.json
+++ b/erpnext/selling/doctype/quotation/test_records.json
@@ -23,9 +23,9 @@
     "parentfield": "items", 
     "qty": 10.0, 
     "rate": 100.0,
-	"uom": "_Test UOM",
-    "stock_uom": "_Test UOM",
-	"conversion_factor": 1.0
+	  "uom": "_Test UOM 1",
+    "stock_uom": "_Test UOM 1",
+	  "conversion_factor": 1.0
    }
   ], 
   "quotation_to": "Customer", 
diff --git a/erpnext/selling/doctype/quotation_item/quotation_item.json b/erpnext/selling/doctype/quotation_item/quotation_item.json
index cccef9c..794494d 100644
--- a/erpnext/selling/doctype/quotation_item/quotation_item.json
+++ b/erpnext/selling/doctype/quotation_item/quotation_item.json
@@ -14,6 +14,7 @@
  "engine": "InnoDB", 
  "fields": [
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 1, 
    "collapsible": 0, 
@@ -47,6 +48,7 @@
    "width": "150px"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -75,6 +77,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -102,6 +105,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -128,12 +132,13 @@
    "remember_last_selected_value": 0, 
    "report_hide": 0, 
    "reqd": 1, 
-   "search_index": 1, 
+   "search_index": 0, 
    "set_only_once": 0, 
    "unique": 0, 
    "width": "150px"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 1, 
@@ -163,6 +168,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -195,6 +201,7 @@
    "width": "300px"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -223,6 +230,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -252,6 +260,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -282,6 +291,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -310,6 +320,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 1, 
    "collapsible": 0, 
@@ -342,6 +353,7 @@
    "width": "100px"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -375,6 +387,7 @@
    "width": "100px"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -402,6 +415,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -432,6 +446,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -461,6 +476,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -490,6 +506,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -518,6 +535,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -551,6 +569,7 @@
    "width": "100px"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -584,6 +603,7 @@
    "width": "100px"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 1, 
@@ -613,67 +633,7 @@
    "unique": 0
   }, 
   {
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "depends_on": "price_list_rate", 
-   "fieldname": "discount_percentage", 
-   "fieldtype": "Percent", 
-   "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": "Discount on Price List Rate (%)", 
-   "length": 0, 
-   "no_copy": 0, 
-   "oldfieldname": "adj_rate", 
-   "oldfieldtype": "Float", 
-   "permlevel": 0, 
-   "print_hide": 1, 
-   "print_hide_if_no_value": 0, 
-   "print_width": "100px", 
-   "read_only": 0, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 0, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "unique": 0, 
-   "width": "100px"
-  }, 
-  {
-   "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, 
@@ -705,6 +665,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -735,12 +696,13 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
-   "depends_on": "eval:doc.margin_type && doc.price_list_rate", 
-   "fieldname": "total_margin", 
+   "depends_on": "eval:doc.margin_type && doc.price_list_rate && doc.margin_rate_or_amount", 
+   "fieldname": "rate_with_margin", 
    "fieldtype": "Currency", 
    "hidden": 0, 
    "ignore_user_permissions": 0, 
@@ -749,7 +711,7 @@
    "in_global_search": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
-   "label": "Total Margin", 
+   "label": "Rate With Margin", 
    "length": 0, 
    "no_copy": 0, 
    "permlevel": 0, 
@@ -765,6 +727,70 @@
    "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, 
+   "depends_on": "price_list_rate", 
+   "fieldname": "discount_percentage", 
+   "fieldtype": "Percent", 
+   "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": "Discount (%) on Price List Rate with Margin", 
+   "length": 0, 
+   "no_copy": 0, 
+   "oldfieldname": "adj_rate", 
+   "oldfieldtype": "Float", 
+   "permlevel": 0, 
+   "print_hide": 1, 
+   "print_hide_if_no_value": 0, 
+   "print_width": "100px", 
+   "read_only": 0, 
+   "remember_last_selected_value": 0, 
+   "report_hide": 0, 
+   "reqd": 0, 
+   "search_index": 0, 
+   "set_only_once": 0, 
+   "unique": 0, 
+   "width": "100px"
+  }, 
+  {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -792,6 +818,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 1, 
    "collapsible": 0, 
@@ -813,6 +840,7 @@
    "oldfieldtype": "Currency", 
    "options": "currency", 
    "permlevel": 0, 
+   "precision": "", 
    "print_hide": 0, 
    "print_hide_if_no_value": 0, 
    "print_width": "100px", 
@@ -826,6 +854,7 @@
    "width": "100px"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -855,6 +884,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -888,6 +918,7 @@
    "width": "100px"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -918,6 +949,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -945,6 +977,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -978,6 +1011,7 @@
    "width": "100px"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1007,6 +1041,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1040,6 +1075,7 @@
    "width": "100px"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1070,6 +1106,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1099,6 +1136,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 1, 
@@ -1129,6 +1167,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1159,6 +1198,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1187,6 +1227,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1216,6 +1257,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1246,6 +1288,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1275,6 +1318,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1303,6 +1347,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1336,6 +1381,7 @@
    "width": "150px"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1369,6 +1415,7 @@
    "width": "150px"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1399,6 +1446,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1426,6 +1474,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 1, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1456,6 +1505,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1483,11 +1533,12 @@
    "remember_last_selected_value": 0, 
    "report_hide": 0, 
    "reqd": 0, 
-   "search_index": 1, 
+   "search_index": 0, 
    "set_only_once": 0, 
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1515,7 +1566,7 @@
    "remember_last_selected_value": 0, 
    "report_hide": 0, 
    "reqd": 0, 
-   "search_index": 1, 
+   "search_index": 0, 
    "set_only_once": 0, 
    "unique": 0, 
    "width": "150px"
@@ -1532,7 +1583,7 @@
  "istable": 1, 
  "max_attachments": 0, 
  "menu_index": 0, 
- "modified": "2017-03-30 19:35:44.119169", 
+ "modified": "2017-05-10 17:14:45.736424", 
  "modified_by": "Administrator", 
  "module": "Selling", 
  "name": "Quotation Item", 
diff --git a/erpnext/selling/doctype/sales_order/sales_order.js b/erpnext/selling/doctype/sales_order/sales_order.js
index dc7d73d..5a4de0b 100644
--- a/erpnext/selling/doctype/sales_order/sales_order.js
+++ b/erpnext/selling/doctype/sales_order/sales_order.js
@@ -3,8 +3,6 @@
 
 {% include 'erpnext/selling/sales_common.js' %}
 
-cur_frm.add_fetch('customer', 'tax_id', 'tax_id');
-
 frappe.ui.form.on("Sales Order", {
 	setup: function(frm) {
 		$.extend(frm.cscript, new erpnext.selling.SalesOrderController({frm: frm}));
@@ -14,6 +12,7 @@
 			'Material Request': 'Material Request',
 			'Purchase Order': 'Purchase Order'
 		}
+		frm.add_fetch('customer', 'tax_id', 'tax_id');
 	},
 	onload: function(frm) {
 		erpnext.queries.setup_queries(frm, "Warehouse", function() {
@@ -137,12 +136,15 @@
 					erpnext.utils.map_current_doc({
 						method: "erpnext.selling.doctype.quotation.quotation.make_sales_order",
 						source_doctype: "Quotation",
+						target: me.frm,
+						setters: {
+							customer: me.frm.doc.customer || undefined,
+							order_type: me.frm.doc.order_type,
+						},
 						get_query_filters: {
+							company: me.frm.doc.company,
 							docstatus: 1,
 							status: ["!=", "Lost"],
-							order_type: me.frm.doc.order_type,
-							customer: me.frm.doc.customer || undefined,
-							company: me.frm.doc.company
 						}
 					})
 				}, __("Get items from"));
diff --git a/erpnext/selling/doctype/sales_order/sales_order.json b/erpnext/selling/doctype/sales_order/sales_order.json
index b118e55..7621f4c 100644
--- a/erpnext/selling/doctype/sales_order/sales_order.json
+++ b/erpnext/selling/doctype/sales_order/sales_order.json
@@ -313,7 +313,7 @@
    "remember_last_selected_value": 1, 
    "report_hide": 0, 
    "reqd": 1, 
-   "search_index": 1, 
+   "search_index": 0, 
    "set_only_once": 0, 
    "unique": 0, 
    "width": "150px"
@@ -371,13 +371,13 @@
    "oldfieldname": "delivery_date", 
    "oldfieldtype": "Date", 
    "permlevel": 0, 
-   "print_hide": 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": 1, 
+   "search_index": 0, 
    "set_only_once": 0, 
    "unique": 0, 
    "width": "160px"
@@ -791,7 +791,7 @@
    "remember_last_selected_value": 0, 
    "report_hide": 0, 
    "reqd": 0, 
-   "search_index": 1, 
+   "search_index": 0, 
    "set_only_once": 0, 
    "unique": 0
   }, 
@@ -821,7 +821,7 @@
    "remember_last_selected_value": 0, 
    "report_hide": 0, 
    "reqd": 0, 
-   "search_index": 1, 
+   "search_index": 0, 
    "set_only_once": 0, 
    "unique": 0
   }, 
@@ -2321,7 +2321,7 @@
    "remember_last_selected_value": 0, 
    "report_hide": 0, 
    "reqd": 0, 
-   "search_index": 1, 
+   "search_index": 0, 
    "set_only_once": 0, 
    "unique": 0
   }, 
@@ -2896,7 +2896,7 @@
    "remember_last_selected_value": 0, 
    "report_hide": 0, 
    "reqd": 0, 
-   "search_index": 1, 
+   "search_index": 0, 
    "set_only_once": 0, 
    "unique": 0, 
    "width": "150px"
@@ -3516,7 +3516,7 @@
  "issingle": 0, 
  "istable": 0, 
  "max_attachments": 0, 
- "modified": "2017-03-29 04:38:25.247179", 
+ "modified": "2017-04-18 20:02:54.895559", 
  "modified_by": "Administrator", 
  "module": "Selling", 
  "name": "Sales Order", 
@@ -3652,6 +3652,6 @@
  "sort_order": "DESC", 
  "timeline_field": "customer", 
  "title_field": "title", 
- "track_changes": 0, 
+ "track_changes": 1, 
  "track_seen": 0
 }
\ No newline at end of file
diff --git a/erpnext/selling/doctype/sales_order/sales_order.py b/erpnext/selling/doctype/sales_order/sales_order.py
index f5bc7db..c55dc9f 100644
--- a/erpnext/selling/doctype/sales_order/sales_order.py
+++ b/erpnext/selling/doctype/sales_order/sales_order.py
@@ -175,7 +175,7 @@
 		self.update_prevdoc_status('cancel')
 
 		frappe.db.set(self, 'status', 'Cancelled')
-		
+
 	def update_project(self):
 		project_list = []
 		if self.project:
@@ -183,7 +183,7 @@
 				project.flags.dont_sync_tasks = True
 				project.update_sales_costing()
 				project.save()
-				project_list.append(self.project)				
+				project_list.append(self.project)
 
 	def check_credit_limit(self):
 		from erpnext.selling.doctype.customer.customer import check_credit_limit
@@ -427,6 +427,11 @@
 		target.amount = (flt(source.qty) - flt(source.delivered_qty)) * flt(source.rate)
 		target.qty = flt(source.qty) - flt(source.delivered_qty)
 
+		item = frappe.db.get_value("Item", target.item_code, ["item_group", "selling_cost_center"], as_dict=1)
+		target.cost_center = frappe.db.get_value("Project", source_parent.project, "cost_center") \
+			or item.selling_cost_center \
+			or frappe.db.get_value("Item Group", item.item_group, "default_cost_center")
+
 	target_doc = get_mapped_doc("Sales Order", source_name, {
 		"Sales Order": {
 			"doctype": "Delivery Note",
diff --git a/erpnext/selling/doctype/sales_order/sales_order_dashboard.py b/erpnext/selling/doctype/sales_order/sales_order_dashboard.py
index 51f81f8..a0ed034 100644
--- a/erpnext/selling/doctype/sales_order/sales_order_dashboard.py
+++ b/erpnext/selling/doctype/sales_order/sales_order_dashboard.py
@@ -5,6 +5,9 @@
 		'fieldname': 'sales_order',
 		'non_standard_fieldnames': {
 			'Delivery Note': 'against_sales_order',
+			'Journal Entry': 'reference_name',
+			'Payment Entry': 'reference_name',
+			'Payment Request': 'reference_name'
 		},
 		'internal_links': {
 			'Quotation': ['items', 'prevdoc_docname']
@@ -30,5 +33,9 @@
 				'label': _('Reference'),
 				'items': ['Quotation']
 			},
+			{
+				'label': _('Payment'),
+				'items': ['Payment Entry', 'Payment Request', 'Journal Entry']
+			},
 		]
 	}
\ No newline at end of file
diff --git a/erpnext/selling/doctype/sales_order/test_sales_order.py b/erpnext/selling/doctype/sales_order/test_sales_order.py
index c18ae0c..0417e5e 100644
--- a/erpnext/selling/doctype/sales_order/test_sales_order.py
+++ b/erpnext/selling/doctype/sales_order/test_sales_order.py
@@ -529,8 +529,8 @@
 			"item_code": args.item or args.item_code or "_Test Item",
 			"warehouse": args.warehouse,
 			"qty": args.qty or 10,
-			"rate": args.rate or 100,
-			"conversion_factor": 1.0,
+			"uom": args.uom or None,
+			"rate": args.rate or 100
 		})
 
 	if not args.do_not_save:
diff --git a/erpnext/selling/doctype/sales_order_item/sales_order_item.json b/erpnext/selling/doctype/sales_order_item/sales_order_item.json
index 479f04e..2aae911 100644
--- a/erpnext/selling/doctype/sales_order_item/sales_order_item.json
+++ b/erpnext/selling/doctype/sales_order_item/sales_order_item.json
@@ -14,6 +14,7 @@
  "engine": "InnoDB", 
  "fields": [
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 1, 
    "collapsible": 0, 
@@ -47,6 +48,7 @@
    "width": "150px"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -75,6 +77,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -102,6 +105,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -134,6 +138,7 @@
    "width": "150"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 1, 
@@ -163,6 +168,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -195,6 +201,7 @@
    "width": "300px"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -223,6 +230,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -252,6 +260,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -282,6 +291,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -310,6 +320,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -342,6 +353,7 @@
    "width": "100px"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -375,6 +387,7 @@
    "width": "70px"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -402,6 +415,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -432,6 +446,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -461,6 +476,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -490,6 +506,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -518,6 +535,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -551,6 +569,7 @@
    "width": "70px"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -584,6 +603,7 @@
    "width": "100px"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 1, 
@@ -613,67 +633,7 @@
    "unique": 0
   }, 
   {
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "depends_on": "price_list_rate", 
-   "fieldname": "discount_percentage", 
-   "fieldtype": "Percent", 
-   "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": "Discount on Price List Rate (%)", 
-   "length": 0, 
-   "no_copy": 0, 
-   "oldfieldname": "adj_rate", 
-   "oldfieldtype": "Float", 
-   "permlevel": 0, 
-   "print_hide": 1, 
-   "print_hide_if_no_value": 0, 
-   "print_width": "70px", 
-   "read_only": 0, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 0, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "unique": 0, 
-   "width": "70px"
-  }, 
-  {
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "column_break_19", 
-   "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, 
@@ -705,6 +665,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -735,12 +696,13 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
-   "depends_on": "eval:doc.margin_type && doc.price_list_rate", 
-   "fieldname": "total_margin", 
+   "depends_on": "eval:doc.margin_type && doc.price_list_rate && doc.margin_rate_or_amount", 
+   "fieldname": "rate_with_margin", 
    "fieldtype": "Currency", 
    "hidden": 0, 
    "ignore_user_permissions": 0, 
@@ -749,7 +711,7 @@
    "in_global_search": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
-   "label": "Total Margin", 
+   "label": "Rate With Margin", 
    "length": 0, 
    "no_copy": 0, 
    "permlevel": 0, 
@@ -765,6 +727,70 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "fieldname": "column_break_19", 
+   "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": "price_list_rate", 
+   "fieldname": "discount_percentage", 
+   "fieldtype": "Percent", 
+   "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": "Discount (%) on Price List Rate with Margin", 
+   "length": 0, 
+   "no_copy": 0, 
+   "oldfieldname": "adj_rate", 
+   "oldfieldtype": "Float", 
+   "permlevel": 0, 
+   "print_hide": 1, 
+   "print_hide_if_no_value": 0, 
+   "print_width": "70px", 
+   "read_only": 0, 
+   "remember_last_selected_value": 0, 
+   "report_hide": 0, 
+   "reqd": 0, 
+   "search_index": 0, 
+   "set_only_once": 0, 
+   "unique": 0, 
+   "width": "70px"
+  }, 
+  {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -781,6 +807,7 @@
    "length": 0, 
    "no_copy": 0, 
    "permlevel": 0, 
+   "precision": "2", 
    "print_hide": 0, 
    "print_hide_if_no_value": 0, 
    "read_only": 0, 
@@ -792,6 +819,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -826,6 +854,7 @@
    "width": "100px"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -860,6 +889,7 @@
    "width": "100px"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -887,6 +917,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -920,6 +951,7 @@
    "width": "100px"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -953,6 +985,7 @@
    "width": "100px"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -982,6 +1015,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1010,6 +1044,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1040,6 +1075,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1070,6 +1106,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1098,6 +1135,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1128,6 +1166,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1158,6 +1197,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 1, 
@@ -1188,6 +1228,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1217,6 +1258,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 1, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1247,6 +1289,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1275,6 +1318,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1309,6 +1353,7 @@
    "width": "150px"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1340,6 +1385,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1371,6 +1417,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1397,11 +1444,12 @@
    "remember_last_selected_value": 0, 
    "report_hide": 0, 
    "reqd": 0, 
-   "search_index": 1, 
+   "search_index": 0, 
    "set_only_once": 0, 
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1429,11 +1477,12 @@
    "remember_last_selected_value": 0, 
    "report_hide": 0, 
    "reqd": 0, 
-   "search_index": 1, 
+   "search_index": 0, 
    "set_only_once": 0, 
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 1, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1464,6 +1513,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1491,6 +1541,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 1, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1523,6 +1574,7 @@
    "width": "70px"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 1, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1553,6 +1605,7 @@
    "width": "70px"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1582,6 +1635,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1614,6 +1668,7 @@
    "width": "100px"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1644,6 +1699,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1673,6 +1729,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1703,6 +1760,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1733,6 +1791,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1766,6 +1825,7 @@
    "width": "50px"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1799,6 +1859,7 @@
    "width": "50px"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1829,6 +1890,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1871,7 +1933,7 @@
  "istable": 1, 
  "max_attachments": 0, 
  "menu_index": 0, 
- "modified": "2017-03-30 16:18:49.367870", 
+ "modified": "2017-05-10 17:14:48.277982", 
  "modified_by": "Administrator", 
  "module": "Selling", 
  "name": "Sales Order Item", 
diff --git a/erpnext/selling/page/sales_analytics/sales_analytics.js b/erpnext/selling/page/sales_analytics/sales_analytics.js
index 73793d4..bb47f98 100644
--- a/erpnext/selling/page/sales_analytics/sales_analytics.js
+++ b/erpnext/selling/page/sales_analytics/sales_analytics.js
@@ -34,14 +34,16 @@
 				show: true,
 				item_key: "customer",
 				parent_field: "parent_customer_group",
-				formatter: function(item) { return item.customer_name || item.name; }
+				formatter: function(item) {
+					return item.customer_name? item.customer_name + " (" + item.name + ")" : item.name; 
+				}
 			},
 			"Customer": {
 				label: __("Customer"),
 				show: false,
 				item_key: "customer",
 				formatter: function(item) {
-					return item.customer_name || item.name;
+					return item.customer_name? item.customer_name + " (" + item.name + ")" : item.name;
 				}
 			},
 			"Item Group": {
@@ -67,7 +69,7 @@
 				item_key: "customer",
 				parent_field: "parent_territory",
 				formatter: function(item) {
-					return item.name;
+					return item.customer_name? item.customer_name + " (" + item.name + ")" : item.name;
 				}
 			}
 		}
diff --git a/erpnext/selling/page/sales_funnel/sales_funnel.js b/erpnext/selling/page/sales_funnel/sales_funnel.js
index 67ba1c8..e37e88d 100644
--- a/erpnext/selling/page/sales_funnel/sales_funnel.js
+++ b/erpnext/selling/page/sales_funnel/sales_funnel.js
@@ -163,6 +163,10 @@
 	draw_legend: function(x_mid, y_mid, width, height, title) {
 		var context = this.elements.context;
 
+		if(y_mid == 0) {
+			y_mid = 7;
+		}
+
 		// draw line
 		context.beginPath();
 		context.moveTo(x_mid, y_mid);
diff --git a/erpnext/selling/sales_common.js b/erpnext/selling/sales_common.js
index da9c771..7154343 100644
--- a/erpnext/selling/sales_common.js
+++ b/erpnext/selling/sales_common.js
@@ -337,14 +337,6 @@
 		})
 	},
 
-	rate: function(doc, cdt, cdn){
-		// if user changes the rate then set margin Rate or amount to 0
-		item = locals[cdt][cdn];
-		item.margin_type = "";
-		item.margin_rate_or_amount = 0.0;
-		cur_frm.refresh_fields();
-	},
-
 	margin_rate_or_amount: function(doc, cdt, cdn) {
 		// calculated the revised total margin and rate on margin rate changes
 		item = locals[cdt][cdn];
diff --git a/erpnext/setup/doctype/company/company.js b/erpnext/setup/doctype/company/company.js
index 0b0a020..ca60b11 100644
--- a/erpnext/setup/doctype/company/company.js
+++ b/erpnext/setup/doctype/company/company.js
@@ -13,7 +13,10 @@
 			frm.set_df_property("abbr", "read_only", 1);
 		}
 
+		frm.toggle_display('address_html', !frm.doc.__islocal);
 		if(!frm.doc.__islocal) {
+			frappe.geo.render_address_and_contact(frm);
+
 			frm.toggle_enable("default_currency", (frm.doc.__onload &&
 				!frm.doc.__onload.transactions_exist));
 
diff --git a/erpnext/setup/doctype/company/company.json b/erpnext/setup/doctype/company/company.json
index 60268a9..c5e8c5c 100644
--- a/erpnext/setup/doctype/company/company.json
+++ b/erpnext/setup/doctype/company/company.json
@@ -14,6 +14,7 @@
  "editable_grid": 0, 
  "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, 
@@ -73,6 +75,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -104,6 +107,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -133,6 +137,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -160,6 +165,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -189,6 +195,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -217,6 +224,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -247,6 +255,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -277,6 +286,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -306,6 +316,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -335,6 +346,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -363,6 +375,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -392,6 +405,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -422,6 +436,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -453,6 +468,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -484,6 +500,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -513,6 +530,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -545,6 +563,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -575,6 +594,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -607,6 +627,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -637,6 +658,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -667,6 +689,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -697,6 +720,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -726,6 +750,7 @@
    "width": "50%"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -758,6 +783,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -788,6 +814,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -818,6 +845,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -849,6 +877,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -879,6 +908,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -907,6 +937,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -937,6 +968,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -969,6 +1001,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -997,6 +1030,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1027,6 +1061,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1058,6 +1093,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1087,6 +1123,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1116,6 +1153,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1145,6 +1183,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1173,6 +1212,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1202,6 +1242,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1231,6 +1272,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1261,6 +1303,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1291,6 +1334,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1319,6 +1363,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1349,6 +1394,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1379,6 +1425,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1408,12 +1455,13 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
-   "fieldname": "address", 
-   "fieldtype": "Small Text", 
+   "fieldname": "address_html", 
+   "fieldtype": "HTML", 
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
@@ -1421,12 +1469,10 @@
    "in_global_search": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
-   "label": "Address", 
    "length": 0, 
    "no_copy": 0, 
-   "oldfieldname": "address", 
-   "oldfieldtype": "Small Text", 
    "permlevel": 0, 
+   "precision": "", 
    "print_hide": 0, 
    "print_hide_if_no_value": 0, 
    "read_only": 0, 
@@ -1438,6 +1484,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1467,6 +1514,7 @@
    "width": "50%"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1498,6 +1546,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1529,6 +1578,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1560,6 +1610,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1590,6 +1641,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1621,6 +1673,7 @@
    "width": "50%"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1652,6 +1705,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1693,7 +1747,7 @@
  "istable": 0, 
  "max_attachments": 0, 
  "menu_index": 0, 
- "modified": "2017-03-14 17:04:38.115970", 
+ "modified": "2017-05-09 11:06:33.629948", 
  "modified_by": "Administrator", 
  "module": "Setup", 
  "name": "Company", 
@@ -1847,4 +1901,4 @@
  "sort_order": "ASC", 
  "track_changes": 1, 
  "track_seen": 0
-}
+}
\ No newline at end of file
diff --git a/erpnext/setup/doctype/company/company.py b/erpnext/setup/doctype/company/company.py
index dd7bca9..9f355f7 100644
--- a/erpnext/setup/doctype/company/company.py
+++ b/erpnext/setup/doctype/company/company.py
@@ -10,9 +10,11 @@
 
 
 from frappe.model.document import Document
+from frappe.geo.address_and_contact import load_address_and_contact
 
 class Company(Document):
 	def onload(self):
+		load_address_and_contact(self, "company")
 		self.get("__onload")["transactions_exist"] = self.check_if_transactions_exist()
 
 	def check_if_transactions_exist(self):
@@ -79,7 +81,7 @@
 		if not frappe.local.flags.ignore_chart_of_accounts:
 			self.set_default_accounts()
 			if self.default_cash_account:
-				self.mode_of_payment()
+				self.set_mode_of_payment_account()
 
 		if self.default_currency:
 			frappe.db.set_value("Currency", self.default_currency, "enabled", 1)
@@ -123,7 +125,7 @@
 			{"company": self.name, "account_type": "Receivable", "is_group": 0}))
 		frappe.db.set(self, "default_payable_account", frappe.db.get_value("Account",
 			{"company": self.name, "account_type": "Payable", "is_group": 0}))
-			
+
 	def validate_coa_input(self):
 		if self.create_chart_of_accounts_based_on == "Existing Company":
 			self.chart_of_accounts = None
@@ -166,7 +168,7 @@
 		if account:
 			self.db_set(fieldname, account)
 
-	def mode_of_payment(self):
+	def set_mode_of_payment_account(self):
 		cash = frappe.db.get_value('Mode of Payment', {'type': 'Cash'}, 'name')
 		if cash and not frappe.db.get_value('Mode of Payment Account', {'company': self.name}):
 			mode_of_payment = frappe.get_doc('Mode of Payment', cash)
@@ -282,7 +284,7 @@
 			if len(parts) == 1 or parts[1].lower() == old.lower():
 				frappe.rename_doc(dt, d[0], parts[0] + " - " + new)
 
-	for dt in ["Account", "Cost Center", "Warehouse"]:
+	for dt in ["Warehouse", "Account", "Cost Center"]:
 		_rename_record(dt)
 		frappe.db.commit()
 
@@ -294,7 +296,3 @@
 		parts.append(company_abbr)
 
 	return " - ".join(parts)
-
-def get_company_currency(company):
-	return frappe.local_cache("company_currency", company,
-		lambda: frappe.db.get_value("Company", company, "default_currency"))
diff --git a/erpnext/setup/doctype/email_digest/email_digest.py b/erpnext/setup/doctype/email_digest/email_digest.py
index a7dfa7c..b66fd4d 100644
--- a/erpnext/setup/doctype/email_digest/email_digest.py
+++ b/erpnext/setup/doctype/email_digest/email_digest.py
@@ -10,7 +10,7 @@
 from dateutil.relativedelta import relativedelta
 from frappe.core.doctype.user.user import STANDARD_USERS
 import frappe.desk.notifications
-from erpnext.accounts.utils import get_balance_on, get_count_on, get_currency_precision
+from erpnext.accounts.utils import get_balance_on, get_count_on
 
 user_specific_content = ["calendar_events", "todo_list"]
 
diff --git a/erpnext/setup/doctype/naming_series/naming_series.py b/erpnext/setup/doctype/naming_series/naming_series.py
index a9832de..536b72f 100644
--- a/erpnext/setup/doctype/naming_series/naming_series.py
+++ b/erpnext/setup/doctype/naming_series/naming_series.py
@@ -8,6 +8,7 @@
 from frappe import msgprint, throw, _
 
 from frappe.model.document import Document
+from frappe.model.naming import parse_naming_series
 from frappe.permissions import get_doctypes_with_read
 
 class NamingSeriesNotSetError(frappe.ValidationError): pass
@@ -136,17 +137,18 @@
 	def get_current(self, arg=None):
 		"""get series current"""
 		if self.prefix:
+			prefix = self.parse_naming_series()
 			self.current_value = frappe.db.get_value("Series",
-				self.prefix.split('.')[0], "current", order_by = "name")
+				prefix, "current", order_by = "name")
 
 	def insert_series(self, series):
 		"""insert series if missing"""
-		if not frappe.db.exists('Series', series):
+		if not frappe.db.get_value('Series', series, 'name', order_by="name"):
 			frappe.db.sql("insert into tabSeries (name, current) values (%s, 0)", (series))
 
 	def update_series_start(self):
 		if self.prefix:
-			prefix = self.prefix.split('.')[0]
+			prefix = self.parse_naming_series()
 			self.insert_series(prefix)
 			frappe.db.sql("update `tabSeries` set current = %s where name = %s",
 				(self.current_value, prefix))
@@ -154,6 +156,17 @@
 		else:
 			msgprint(_("Please select prefix first"))
 
+	def parse_naming_series(self):
+		parts = self.prefix.split('.')
+		# If series contain date format like INV.YYYY.MM.#####
+		if len(parts) > 2:
+			del parts[-1] # Removed ### from the series
+			prefix = parse_naming_series(parts)
+		else:
+			prefix = parts[0]
+
+		return prefix
+
 def set_by_naming_series(doctype, fieldname, naming_series, hide_name_field=True):
 	from frappe.custom.doctype.property_setter.property_setter import make_property_setter
 	if naming_series:
diff --git a/erpnext/setup/doctype/sms_settings/sms_settings.py b/erpnext/setup/doctype/sms_settings/sms_settings.py
index 2888942..a8b59be 100644
--- a/erpnext/setup/doctype/sms_settings/sms_settings.py
+++ b/erpnext/setup/doctype/sms_settings/sms_settings.py
@@ -40,10 +40,15 @@
 	return sender_name
 
 @frappe.whitelist()
-def get_contact_number(contact_name, value, key):
+def get_contact_number(contact_name, ref_doctype, ref_name):
 	"returns mobile number of the contact"
-	number = frappe.db.sql("""select mobile_no, phone from tabContact where name=%s and %s=%s""" %
-		('%s', frappe.db.escape(key), '%s'), (contact_name, value))
+	number = frappe.db.sql("""select mobile_no, phone from tabContact 
+		where name=%s 
+			and exists(
+				select name from `tabDynamic Link` where link_doctype=%s and link_name=%s
+			)
+	""", (contact_name, ref_doctype, ref_name))
+	
 	return number and (number[0][0] or number[0][1]) or ''
 
 @frappe.whitelist()
diff --git a/erpnext/setup/doctype/territory/territory.json b/erpnext/setup/doctype/territory/territory.json
index 030f936..b123d5e 100644
--- a/erpnext/setup/doctype/territory/territory.json
+++ b/erpnext/setup/doctype/territory/territory.json
@@ -79,7 +79,7 @@
    "bold": 1, 
    "collapsible": 0, 
    "columns": 0, 
-   "description": "Only leaf nodes are allowed in transaction", 
+   "description": "", 
    "fieldname": "is_group", 
    "fieldtype": "Check", 
    "hidden": 0, 
@@ -478,4 +478,4 @@
  "sort_order": "DESC", 
  "track_changes": 0, 
  "track_seen": 0
-}
\ No newline at end of file
+}
diff --git a/erpnext/setup/setup_wizard/domainify.py b/erpnext/setup/setup_wizard/domainify.py
index 69aaf75..0069e88 100644
--- a/erpnext/setup/setup_wizard/domainify.py
+++ b/erpnext/setup/setup_wizard/domainify.py
@@ -11,7 +11,7 @@
 			'desktop_icons': ['Item', 'BOM', 'Customer', 'Supplier', 'Sales Order',
 				'Production Order',  'Stock Entry', 'Purchase Order', 'Task', 'Buying', 'Selling',
 				 'Accounts', 'HR', 'ToDo'],
-			'remove_roles': ['Academics User'],
+			'remove_roles': ['Academics User', 'Instructor'],
 			'properties': [
 				{'doctype': 'Item', 'fieldname': 'manufacturing', 'property': 'collapsible_depends_on', 'value': 'is_stock_item'},
 			],
@@ -24,7 +24,7 @@
 		'Retail': {
 			'desktop_icons': ['POS', 'Item', 'Customer', 'Sales Invoice',  'Purchase Order',
 			'Warranty Claim', 'Accounts', 'Task', 'Buying', 'ToDo'],
-			'remove_roles': ['Manufacturing User', 'Manufacturing Manager', 'Academics User'],
+			'remove_roles': ['Manufacturing User', 'Manufacturing Manager', 'Academics User', 'Instructor'],
 			'properties': [
 				{'doctype': 'Item', 'fieldname': 'manufacturing', 'property': 'hidden', 'value': 1},
 				{'doctype': 'Customer', 'fieldname': 'credit_limit_section', 'property': 'hidden', 'value': 1},
@@ -38,7 +38,7 @@
 		'Distribution': {
 			'desktop_icons': ['Item', 'Customer', 'Supplier', 'Lead', 'Sales Order', 'Task',
 				 'Sales Invoice', 'CRM', 'Selling', 'Buying', 'Stock', 'Accounts', 'HR', 'ToDo'],
-			'remove_roles': ['Manufacturing User', 'Manufacturing Manager', 'Academics User'],
+			'remove_roles': ['Manufacturing User', 'Manufacturing Manager', 'Academics User', 'Instructor'],
 			'set_value': [
 				['Stock Settings', None, 'show_barcode_field', 1]
 			],
@@ -48,7 +48,7 @@
 		'Services': {
 			'desktop_icons': ['Project', 'Timesheet', 'Customer', 'Sales Order', 'Sales Invoice',
 				'Lead', 'Opportunity', 'Task', 'Expense Claim', 'Employee', 'HR', 'ToDo'],
-			'remove_roles': ['Manufacturing User', 'Manufacturing Manager', 'Academics User'],
+			'remove_roles': ['Manufacturing User', 'Manufacturing Manager', 'Academics User', 'Instructor'],
 			'properties': [
 				{'doctype': 'Item', 'fieldname': 'is_stock_item', 'property': 'default', 'value': 0},
 			],
@@ -62,7 +62,7 @@
 				'Fees',  'Task', 'ToDo', 'Schools'],
 			'allow_roles': ['Academics User', 'Accounts User', 'Accounts Manager', 'Item Manager',
 				'Website Manager', 'HR User', 'HR Manager', 'Purchase User', 'Purchase Manager',
-				'Student', 'Projects User'],
+				'Student', 'Projects User', 'Instructor'],
 			'default_portal_role': 'Student'
 		},
 	}
diff --git a/erpnext/setup/setup_wizard/setup_wizard.py b/erpnext/setup/setup_wizard/setup_wizard.py
index 26509ed..940d35c 100644
--- a/erpnext/setup/setup_wizard/setup_wizard.py
+++ b/erpnext/setup/setup_wizard/setup_wizard.py
@@ -89,7 +89,7 @@
 			'default_currency':args.get('currency'),
 			'country': args.get('country'),
 			'create_chart_of_accounts_based_on': 'Standard Template',
-			'chart_of_accounts': args.get(('chart_of_accounts')),
+			'chart_of_accounts': args.get('chart_of_accounts'),
 			'domain': args.get('domain')
 		}).insert()
 
@@ -177,6 +177,7 @@
 	selling_settings.cust_master_name = "Customer Name"
 	selling_settings.so_required = "No"
 	selling_settings.dn_required = "No"
+	selling_settings.allow_multiple_items = 1
 	selling_settings.save()
 
 	buying_settings = frappe.get_doc("Buying Settings")
@@ -184,6 +185,7 @@
 	buying_settings.po_required = "No"
 	buying_settings.pr_required = "No"
 	buying_settings.maintain_same_rate = 1
+	buying_settings.allow_multiple_items = 1
 	buying_settings.save()
 
 	notification_control = frappe.get_doc("Notification Control")
@@ -569,6 +571,7 @@
 	for i in xrange(1,6):
 		if args.get("program_" + str(i)):
 			program = frappe.new_doc("Program")
+			program.program_code = args.get("program_" + str(i))
 			program.program_name = args.get("program_" + str(i))
 			try:
 				program.save()
@@ -579,6 +582,7 @@
 	for i in xrange(1,6):
 		if args.get("course_" + str(i)):
 			course = frappe.new_doc("Course")
+			course.course_code = args.get("course_" + str(i))
 			course.course_name = args.get("course_" + str(i))
 			try:
 				course.save()
@@ -605,5 +609,3 @@
 				room.save()
 			except frappe.DuplicateEntryError:
 				pass
-
-
diff --git a/erpnext/setup/utils.py b/erpnext/setup/utils.py
index cb63837..55a0fd3 100644
--- a/erpnext/setup/utils.py
+++ b/erpnext/setup/utils.py
@@ -3,19 +3,10 @@
 
 from __future__ import unicode_literals
 import frappe
-from frappe import _, throw
+from frappe import _
 from frappe.utils import flt
 from frappe.utils import get_datetime_str, nowdate
 
-def get_company_currency(company):
-	currency = frappe.db.get_value("Company", company, "default_currency", cache=True)
-	if not currency:
-		currency = frappe.db.get_default("currency")
-	if not currency:
-		throw(_('Please specify Default Currency in Company Master and Global Defaults'))
-
-	return currency
-
 def get_root_of(doctype):
 	"""Get root element of a DocType with a tree structure"""
 	result = frappe.db.sql_list("""select name from `tab%s`
diff --git a/erpnext/shopping_cart/product.py b/erpnext/shopping_cart/product.py
index d7afc3b..1999a4a 100644
--- a/erpnext/shopping_cart/product.py
+++ b/erpnext/shopping_cart/product.py
@@ -67,7 +67,7 @@
 		price = frappe.get_all("Item Price", fields=["price_list_rate", "currency"],
 			filters={"price_list": price_list, "item_code": item_code})
 
-		if not price:
+		if template_item_code and not price:
 			price = frappe.get_all("Item Price", fields=["price_list_rate", "currency"],
 				filters={"price_list": price_list, "item_code": template_item_code})
 
diff --git a/erpnext/startup/notifications.py b/erpnext/startup/notifications.py
index 58458c6..57067a8 100644
--- a/erpnext/startup/notifications.py
+++ b/erpnext/startup/notifications.py
@@ -2,9 +2,10 @@
 # License: GNU General Public License v3. See license.txt
 
 from __future__ import unicode_literals
+import frappe
 
 def get_notification_config():
-	return { "for_doctype":
+	notification_for_doctype =  { "for_doctype":
 		{
 			"Issue": {"status": "Open"},
 			"Warranty Claim": {"status": "Open"},
@@ -57,3 +58,10 @@
 			"Timesheet": {"status": "Draft"}
 		}
 	}
+
+	doctype = [d for d in notification_for_doctype.get('for_doctype')]
+	for doc in frappe.get_all('DocType',
+		fields= ["name"], filters = {"name": ("not in", doctype), 'is_submittable': 1}):
+		notification_for_doctype["for_doctype"][doc.name] = {"docstatus": 0}
+
+	return notification_for_doctype
diff --git a/erpnext/startup/report_data_map.py b/erpnext/startup/report_data_map.py
index ffdc66d..e4bbd87 100644
--- a/erpnext/startup/report_data_map.py
+++ b/erpnext/startup/report_data_map.py
@@ -241,7 +241,7 @@
 		}
 	},
 	"Purchase Invoice Item": {
-		"columns": ["name", "parent", "item_code", "(qty * conversion_factor) as qty", "base_net_amount"],
+		"columns": ["name", "parent", "item_code", "stock_qty as qty", "base_net_amount"],
 		"conditions": ["docstatus=1", "ifnull(parent, '')!=''"],
 		"order_by": "parent",
 		"links": {
diff --git a/erpnext/stock/dashboard/item_dashboard_list.html b/erpnext/stock/dashboard/item_dashboard_list.html
index c1792a9..63f2480 100644
--- a/erpnext/stock/dashboard/item_dashboard_list.html
+++ b/erpnext/stock/dashboard/item_dashboard_list.html
@@ -22,7 +22,7 @@
 							</span>
 						</span>
 					</span>
-					<span class="inline-graph-half" title="{{ __("Acutal Qty {0} / Waiting Qty {1}", [d.actual_qty, d.pending_qty]) }}">
+					<span class="inline-graph-half" title="{{ __("Actual Qty {0} / Waiting Qty {1}", [d.actual_qty, d.pending_qty]) }}">
 						<span class="inline-graph-count">
 							{{ d.actual_qty }} {{ (d.pending_qty > 0) ? ("(" + d.pending_qty+ ")") : "" }}
 						</span>
@@ -54,4 +54,4 @@
 			</div>
 		</div>
 	</div>
-{% endfor %}
\ No newline at end of file
+{% endfor %}
diff --git a/erpnext/stock/doctype/batch/batch.js b/erpnext/stock/doctype/batch/batch.js
index 2cfdb63..8a3906e 100644
--- a/erpnext/stock/doctype/batch/batch.js
+++ b/erpnext/stock/doctype/batch/batch.js
@@ -1,12 +1,137 @@
 // Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
 // License: GNU General Public License v3. See license.txt
 
-cur_frm.fields_dict['item'].get_query = function(doc, cdt, cdn) {
-	return {
-		query: "erpnext.controllers.queries.item_query",
-		filters:{
-			'is_stock_item': 1,
-			'has_batch_no': 1
+frappe.ui.form.on('Batch', {
+	setup: (frm) => {
+		frm.fields_dict['item'].get_query = function(doc, cdt, cdn) {
+			return {
+				query: "erpnext.controllers.queries.item_query",
+				filters:{
+					'is_stock_item': 1,
+					'has_batch_no': 1
+				}
+			}
+		}
+	},
+	refresh: (frm) => {
+		if(!frm.is_new()) {
+			frm.add_custom_button(__("View Ledger"), () => {
+				frappe.route_options = {
+					batch_no: frm.doc.name
+				};
+				frappe.set_route("query-report", "Stock Ledger");
+			});
+			frm.trigger('make_dashboard');
+		}
+	},
+	make_dashboard: (frm) => {
+		if(!frm.is_new()) {
+			frappe.call({
+				method: 'erpnext.stock.doctype.batch.batch.get_batch_qty',
+				args: {batch_no: frm.doc.name},
+				callback: (r) => {
+					if(!r.message) {
+						return;
+					}
+
+					var section = frm.dashboard.add_section(`<h5 style="margin-top: 0px;">
+						${ __("Stock Levels") }</a></h5>`);
+
+					// sort by qty
+					r.message.sort(function(a, b) { a.qty > b.qty ? 1 : -1 });
+
+					var rows = $('<div></div>').appendTo(section);
+
+					// show
+					(r.message || []).forEach(function(d) {
+						if(d.qty > 0) {
+							$(`<div class='row' style='margin-bottom: 10px;'>
+								<div class='col-sm-3 small' style='padding-top: 3px;'>${d.warehouse}</div>
+								<div class='col-sm-3 small text-right' style='padding-top: 3px;'>${d.qty}</div>
+								<div class='col-sm-6'>
+									<button class='btn btn-default btn-xs btn-move' style='margin-right: 7px;'
+										data-qty = "${d.qty}"
+										data-warehouse = "${d.warehouse}">
+										${__('Move')}</button>
+									<button class='btn btn-default btn-xs btn-split'
+										data-qty = "${d.qty}"
+										data-warehouse = "${d.warehouse}">
+										${__('Split')}</button>
+								</div>
+							</div>`).appendTo(rows);
+						}
+					});
+
+					// move - ask for target warehouse and make stock entry
+					rows.find('.btn-move').on('click', function() {
+						var $btn = $(this);
+						frappe.prompt({
+								fieldname: 'to_warehouse',
+								label: __('To Warehouse'),
+								fieldtype: 'Link',
+								options: 'Warehouse'
+							},
+							(data) => {
+								frappe.call({
+									method: 'erpnext.stock.doctype.stock_entry.stock_entry_utils.make_stock_entry',
+									args: {
+										item_code: frm.doc.item,
+										batch_no: frm.doc.name,
+										qty: $btn.attr('data-qty'),
+										from_warehouse: $btn.attr('data-warehouse'),
+										to_warehouse: data.to_warehouse
+									},
+									callback: (r) => {
+										frappe.show_alert(__('Stock Entry {0} created',
+											['<a href="#Form/Stock Entry/'+r.message.name+'">' + r.message.name+ '</a>']));
+										frm.refresh();
+									},
+								});
+							},
+							__('Select Target Warehouse'),
+							__('Move')
+						)
+					});
+
+					// split - ask for new qty and batch ID (optional)
+					// and make stock entry via batch.batch_split
+					rows.find('.btn-split').on('click', function() {
+						var $btn = $(this);
+						frappe.prompt([{
+								fieldname: 'qty',
+								label: __('New Batch Qty'),
+								fieldtype: 'Float',
+								'default': $btn.attr('data-qty')
+							},
+							{
+								fieldname: 'new_batch_id',
+								label: __('New Batch ID (Optional)'),
+								fieldtype: 'Data',
+							}],
+							(data) => {
+								frappe.call({
+									method: 'erpnext.stock.doctype.batch.batch.split_batch',
+									args: {
+										item_code: frm.doc.item,
+										batch_no: frm.doc.name,
+										qty: data.qty,
+										warehouse: $btn.attr('data-warehouse'),
+										new_batch_id: data.new_batch_id
+									},
+									callback: (r) => {
+										frm.refresh();
+									},
+								});
+							},
+							__('Split Batch'),
+							__('Split')
+						)
+					})
+
+					frm.dashboard.show();
+				}
+			});
 		}
 	}
-}
+})
+
diff --git a/erpnext/stock/doctype/batch/batch.json b/erpnext/stock/doctype/batch/batch.json
index ef31cfd..b4a1405 100644
--- a/erpnext/stock/doctype/batch/batch.json
+++ b/erpnext/stock/doctype/batch/batch.json
@@ -1,8 +1,9 @@
 {
  "allow_copy": 0, 
+ "allow_guest_to_view": 0, 
  "allow_import": 1, 
  "allow_rename": 0, 
- "autoname": "field:batch_id", 
+ "autoname": "", 
  "beta": 0, 
  "creation": "2013-03-05 14:50:38", 
  "custom": 0, 
@@ -17,12 +18,14 @@
    "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
+   "depends_on": "eval:doc.__islocal", 
    "fieldname": "batch_id", 
    "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": "Batch ID", 
@@ -36,7 +39,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
@@ -52,6 +55,7 @@
    "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", 
@@ -76,12 +80,73 @@
    "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": 0, 
+   "permlevel": 0, 
+   "precision": "", 
+   "print_hide": 0, 
+   "print_hide_if_no_value": 0, 
+   "read_only": 0, 
+   "remember_last_selected_value": 0, 
+   "report_hide": 0, 
+   "reqd": 0, 
+   "search_index": 0, 
+   "set_only_once": 0, 
+   "unique": 0
+  }, 
+  {
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "depends_on": "eval:doc.parent_batch", 
+   "fieldname": "parent_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": "Parent Batch", 
+   "length": 0, 
+   "no_copy": 0, 
+   "options": "Batch", 
+   "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_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, 
@@ -109,6 +174,7 @@
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
    "in_filter": 0, 
+   "in_global_search": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Expiry Date", 
@@ -132,12 +198,160 @@
    "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
+   "fieldname": "source", 
+   "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": "Source", 
+   "length": 0, 
+   "no_copy": 0, 
+   "permlevel": 0, 
+   "precision": "", 
+   "print_hide": 0, 
+   "print_hide_if_no_value": 0, 
+   "read_only": 0, 
+   "remember_last_selected_value": 0, 
+   "report_hide": 0, 
+   "reqd": 0, 
+   "search_index": 0, 
+   "set_only_once": 0, 
+   "unique": 0
+  }, 
+  {
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "fieldname": "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": 1, 
+   "remember_last_selected_value": 0, 
+   "report_hide": 0, 
+   "reqd": 0, 
+   "search_index": 0, 
+   "set_only_once": 0, 
+   "unique": 0
+  }, 
+  {
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "fieldname": "column_break_9", 
+   "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_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "fieldname": "reference_doctype", 
+   "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": "Source Document Type", 
+   "length": 0, 
+   "no_copy": 0, 
+   "options": "DocType", 
+   "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_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "fieldname": "reference_name", 
+   "fieldtype": "Dynamic 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": "Source Document Name", 
+   "length": 0, 
+   "no_copy": 0, 
+   "options": "reference_doctype", 
+   "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_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
    "fieldname": "section_break_7", 
    "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, 
@@ -165,6 +379,7 @@
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
    "in_filter": 0, 
+   "in_global_search": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Batch Description", 
@@ -185,18 +400,19 @@
    "width": "300px"
   }
  ], 
+ "has_web_view": 0, 
  "hide_heading": 0, 
  "hide_toolbar": 0, 
  "icon": "fa fa-archive", 
  "idx": 1, 
+ "image_field": "image", 
  "image_view": 0, 
  "in_create": 0, 
- "in_dialog": 0, 
  "is_submittable": 0, 
  "issingle": 0, 
  "istable": 0, 
  "max_attachments": 5, 
- "modified": "2016-11-07 05:50:33.973883", 
+ "modified": "2017-04-20 03:22:19.888058", 
  "modified_by": "Administrator", 
  "module": "Stock", 
  "name": "Batch", 
@@ -212,7 +428,6 @@
    "export": 0, 
    "if_owner": 0, 
    "import": 0, 
-   "is_custom": 0, 
    "permlevel": 0, 
    "print": 1, 
    "read": 1, 
@@ -224,9 +439,12 @@
    "write": 1
   }
  ], 
- "quick_entry": 0, 
+ "quick_entry": 1, 
  "read_only": 0, 
  "read_only_onload": 0, 
+ "show_name_in_global_search": 0, 
+ "sort_order": "DESC", 
  "title_field": "item", 
+ "track_changes": 0, 
  "track_seen": 0
 }
\ No newline at end of file
diff --git a/erpnext/stock/doctype/batch/batch.py b/erpnext/stock/doctype/batch/batch.py
index 157b094..909095e 100644
--- a/erpnext/stock/doctype/batch/batch.py
+++ b/erpnext/stock/doctype/batch/batch.py
@@ -5,8 +5,29 @@
 import frappe
 from frappe import _
 from frappe.model.document import Document
+from frappe.utils import flt
+
+class UnableToSelectBatchError(frappe.ValidationError): pass
 
 class Batch(Document):
+	def autoname(self):
+		'''Generate random ID for batch if not specified'''
+		if not self.batch_id:
+			if frappe.db.get_value('Item', self.item, 'create_new_batch'):
+				temp = None
+				while not temp:
+					temp = frappe.generate_hash()[:7].upper()
+					if frappe.db.exists('Batch', temp):
+						temp = None
+
+				self.batch_id = temp
+			else:
+				frappe.throw(_('Batch ID is mandatory'), frappe.MandatoryError)
+
+		self.name = self.batch_id
+
+	def onload(self):
+		self.image = frappe.db.get_value('Item', self.item, 'image')
 
 	def validate(self):
 		self.item_has_batch_enabled()
@@ -14,3 +35,91 @@
 	def item_has_batch_enabled(self):
 		if frappe.db.get_value("Item",self.item,"has_batch_no") == 0:
 			frappe.throw(_("The selected item cannot have Batch"))
+
+@frappe.whitelist()
+def get_batch_qty(batch_no=None, warehouse=None, item_code=None):
+	'''Returns batch actual qty if warehouse is passed,
+		or returns dict of qty by warehouse if warehouse is None
+
+	The user must pass either batch_no or batch_no + warehouse or item_code + warehouse
+
+	:param batch_no: Optional - give qty for this batch no
+	:param warehouse: Optional - give qty for this warehouse
+	:param item_code: Optional - give qty for this item'''
+	frappe.has_permission('Batch', throw=True)
+	out = 0
+	if batch_no and warehouse:
+		out = float(frappe.db.sql("""select sum(actual_qty)
+			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()
+def split_batch(batch_no, item_code, warehouse, qty, new_batch_id = None):
+	'''Split the batch into a new batch'''
+	batch = frappe.get_doc(dict(doctype='Batch', item=item_code, batch_id=new_batch_id)).insert()
+	stock_entry = frappe.get_doc(dict(
+		doctype='Stock Entry',
+		purpose='Repack',
+		items=[
+			dict(
+				item_code = item_code,
+				qty = float(qty or 0),
+				s_warehouse = warehouse,
+				batch_no = batch_no
+			),
+			dict(
+				item_code = item_code,
+				qty = float(qty or 0),
+				t_warehouse = warehouse,
+				batch_no = batch.name
+			),
+		]
+	))
+	stock_entry.insert()
+	stock_entry.submit()
+
+	return batch.name
+
+def set_batch_nos(doc, warehouse_field, throw = False):
+	'''Automatically select `batch_no` for outgoing items in item table'''
+	for d in doc.items:
+		has_batch_no = frappe.db.get_value('Item', d.item_code, 'has_batch_no')
+		warehouse = d.get(warehouse_field, None)
+		if has_batch_no and warehouse and d.qty > 0:
+			if not d.batch_no:
+				d.batch_no = get_batch_no(d.item_code, warehouse, d.qty, throw)
+			else:
+				batch_qty = get_batch_qty(batch_no=d.batch_no, warehouse=warehouse)
+				if flt(batch_qty) < flt(d.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'''
+	
+	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
+	
+	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
+
+	return batch_no
\ No newline at end of file
diff --git a/erpnext/stock/doctype/batch/test_batch.py b/erpnext/stock/doctype/batch/test_batch.py
index e519f5f..e63e949 100644
--- a/erpnext/stock/doctype/batch/test_batch.py
+++ b/erpnext/stock/doctype/batch/test_batch.py
@@ -6,10 +6,148 @@
 from frappe.exceptions import ValidationError
 import unittest
 
+from erpnext.stock.doctype.batch.batch import get_batch_qty, UnableToSelectBatchError
+
 class TestBatch(unittest.TestCase):
 	def test_item_has_batch_enabled(self):
 		self.assertRaises(ValidationError, frappe.get_doc({
 			"doctype": "Batch",
 			"name": "_test Batch",
 			"item": "_Test Item"
-		}).save)
\ No newline at end of file
+		}).save)
+
+	def make_batch_item(self):
+		from erpnext.stock.doctype.item.test_item import make_item
+		if not frappe.db.exists('ITEM-BATCH-1'):
+			make_item('ITEM-BATCH-1', dict(has_batch_no = 1, create_new_batch = 1))
+
+	def test_purchase_receipt(self, batch_qty = 100):
+		'''Test automated batch creation from Purchase Receipt'''
+		self.make_batch_item()
+
+		receipt = frappe.get_doc(dict(
+			doctype = 'Purchase Receipt',
+			supplier = '_Test Supplier',
+			items = [
+				dict(
+					item_code = 'ITEM-BATCH-1',
+					qty = batch_qty,
+					rate = 10
+				)
+			]
+		)).insert()
+		receipt.submit()
+
+		self.assertTrue(receipt.items[0].batch_no)
+		self.assertEquals(get_batch_qty(receipt.items[0].batch_no,
+			receipt.items[0].warehouse), batch_qty)
+
+		return receipt
+
+	def test_stock_entry_incoming(self):
+		'''Test batch creation via Stock Entry (Production Order)'''
+
+		self.make_batch_item()
+
+		stock_entry = frappe.get_doc(dict(
+			doctype = 'Stock Entry',
+			purpose = 'Material Receipt',
+			company = '_Test Company',
+			items = [
+				dict(
+					item_code = 'ITEM-BATCH-1',
+					qty = 90,
+					t_warehouse = '_Test Warehouse - _TC',
+					cost_center = 'Main - _TC',
+					rate = 10
+				)
+			]
+		)).insert()
+		stock_entry.submit()
+
+		self.assertTrue(stock_entry.items[0].batch_no)
+		self.assertEquals(get_batch_qty(stock_entry.items[0].batch_no, stock_entry.items[0].t_warehouse), 90)
+
+	def test_delivery_note(self):
+		'''Test automatic batch selection for outgoing items'''
+		batch_qty = 15
+		receipt = self.test_purchase_receipt(batch_qty)
+
+		delivery_note = frappe.get_doc(dict(
+			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
+				)
+			]
+		)).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)
+
+	def test_delivery_note_fail(self):
+		'''Test automatic batch selection for outgoing items'''
+		receipt = self.test_purchase_receipt(100)
+		delivery_note = frappe.get_doc(dict(
+			doctype = 'Delivery Note',
+			customer = '_Test Customer',
+			company = receipt.company,
+			items = [
+				dict(
+					item_code = 'ITEM-BATCH-1',
+					qty = 5000,
+					rate = 10,
+					warehouse = receipt.items[0].warehouse
+				)
+			]
+		))
+		self.assertRaises(UnableToSelectBatchError, delivery_note.insert)
+
+	def test_stock_entry_outgoing(self):
+		'''Test automatic batch selection for outgoing stock entry'''
+
+		batch_qty = 16
+		receipt = self.test_purchase_receipt(batch_qty)
+
+		stock_entry = frappe.get_doc(dict(
+			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,
+				)
+			]
+		)).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)
+
+	def test_batch_split(self):
+		'''Test batch splitting'''
+		receipt = self.test_purchase_receipt()
+		from erpnext.stock.doctype.batch.batch import split_batch
+
+		new_batch = split_batch(receipt.items[0].batch_no, 'ITEM-BATCH-1', receipt.items[0].warehouse, 22)
+
+		self.assertEquals(get_batch_qty(receipt.items[0].batch_no, receipt.items[0].warehouse), 78)
+		self.assertEquals(get_batch_qty(new_batch, receipt.items[0].warehouse), 22)
+
+
diff --git a/erpnext/stock/doctype/delivery_note/delivery_note.js b/erpnext/stock/doctype/delivery_note/delivery_note.js
index 5d4537e..eb8a750 100644
--- a/erpnext/stock/doctype/delivery_note/delivery_note.js
+++ b/erpnext/stock/doctype/delivery_note/delivery_note.js
@@ -39,7 +39,7 @@
 		});
 
 		if (sys_defaults.auto_accounting_for_stock) {
-			frm.set_query('expense_account', 'items', function(frm) {
+			frm.set_query('expense_account', 'items', function(doc, cdt, cdn) {
 				return {
 					filters: {
 						"report_type": "Profit and Loss",
@@ -49,7 +49,7 @@
 				}
 			});
 
-			frm.set_query('cost_center', 'items', function(frm) {
+			frm.set_query('cost_center', 'items', function(doc, cdt, cdn) {
 				return {
 					filters: {
 						'company': doc.company,
@@ -119,13 +119,16 @@
 						erpnext.utils.map_current_doc({
 							method: "erpnext.selling.doctype.sales_order.sales_order.make_delivery_note",
 							source_doctype: "Sales Order",
+							target: me.frm,
+							setters: {
+								customer: me.frm.doc.customer || undefined,
+							},
 							get_query_filters: {
 								docstatus: 1,
 								status: ["!=", "Closed"],
 								per_delivered: ["<", 99.99],
+								company: me.frm.doc.company,
 								project: me.frm.doc.project || undefined,
-								customer: me.frm.doc.customer || undefined,
-								company: me.frm.doc.company
 							}
 						})
 					}, __("Get items from"));
diff --git a/erpnext/stock/doctype/delivery_note/delivery_note.json b/erpnext/stock/doctype/delivery_note/delivery_note.json
index dc6de95..9d49b57 100644
--- a/erpnext/stock/doctype/delivery_note/delivery_note.json
+++ b/erpnext/stock/doctype/delivery_note/delivery_note.json
@@ -13,6 +13,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 @@
    "width": "50%"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 1, 
    "bold": 0, 
    "collapsible": 0, 
@@ -102,6 +105,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -133,6 +137,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -164,6 +169,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 1, 
    "collapsible": 0, 
@@ -193,6 +199,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, 
@@ -254,6 +262,7 @@
    "width": "150px"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -282,42 +291,13 @@
    "remember_last_selected_value": 1, 
    "report_hide": 0, 
    "reqd": 1, 
-   "search_index": 1, 
+   "search_index": 0, 
    "set_only_once": 0, 
    "unique": 0, 
    "width": "150px"
   }, 
   {
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "depends_on": "eval:doc.docstatus==0", 
-   "fieldname": "set_posting_time", 
-   "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": "Edit Posting Date and Time", 
-   "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, 
@@ -352,6 +332,7 @@
    "width": "100px"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -386,6 +367,38 @@
    "width": "100px"
   }, 
   {
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "depends_on": "eval:doc.docstatus==0", 
+   "fieldname": "set_posting_time", 
+   "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": "Edit Posting Date and Time", 
+   "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": 0, 
+   "search_index": 0, 
+   "set_only_once": 0, 
+   "unique": 0
+  }, 
+  {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -418,6 +431,7 @@
    "width": "100px"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -451,6 +465,7 @@
    "width": "100px"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -480,6 +495,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -511,6 +527,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 1, 
@@ -541,6 +558,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -570,6 +588,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -598,6 +617,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -627,6 +647,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -655,6 +676,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -683,6 +705,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -712,6 +735,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -741,6 +765,7 @@
    "width": "50%"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -771,6 +796,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -800,6 +826,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -828,6 +855,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -853,11 +881,12 @@
    "remember_last_selected_value": 0, 
    "report_hide": 0, 
    "reqd": 0, 
-   "search_index": 1, 
+   "search_index": 0, 
    "set_only_once": 0, 
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -883,11 +912,12 @@
    "remember_last_selected_value": 0, 
    "report_hide": 0, 
    "reqd": 0, 
-   "search_index": 1, 
+   "search_index": 0, 
    "set_only_once": 0, 
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 1, 
@@ -917,6 +947,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -948,6 +979,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -980,6 +1012,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1007,6 +1040,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1038,6 +1072,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1067,6 +1102,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1097,6 +1133,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1125,6 +1162,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1155,6 +1193,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1186,6 +1225,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 1, 
@@ -1217,6 +1257,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1248,6 +1289,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1276,6 +1318,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1303,6 +1346,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1333,6 +1377,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1366,6 +1411,7 @@
    "width": "150px"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1393,6 +1439,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1423,6 +1470,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1452,6 +1500,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1482,6 +1531,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1514,6 +1564,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1541,6 +1592,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1571,6 +1623,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1598,6 +1651,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1629,6 +1683,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1658,6 +1713,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1685,6 +1741,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1718,6 +1775,7 @@
    "width": "150px"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1746,6 +1804,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1775,6 +1834,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 1, 
@@ -1805,6 +1865,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1836,6 +1897,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1866,6 +1928,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1893,6 +1956,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1922,6 +1986,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1951,6 +2016,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1981,6 +2047,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2014,6 +2081,7 @@
    "width": "150px"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2047,6 +2115,7 @@
    "width": "150px"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2080,6 +2149,7 @@
    "width": "200px"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2108,6 +2178,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2141,6 +2212,7 @@
    "width": "150px"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 1, 
    "collapsible": 0, 
@@ -2174,6 +2246,7 @@
    "width": "150px"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2207,6 +2280,7 @@
    "width": "150px"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 1, 
@@ -2238,6 +2312,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2269,6 +2344,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2299,6 +2375,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 1, 
@@ -2329,6 +2406,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2361,6 +2439,7 @@
    "width": "150px"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2390,6 +2469,7 @@
    "width": "50%"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2423,6 +2503,7 @@
    "width": "100px"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2457,6 +2538,7 @@
    "width": "100px"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 1, 
@@ -2487,6 +2569,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2514,11 +2597,12 @@
    "remember_last_selected_value": 0, 
    "report_hide": 0, 
    "reqd": 0, 
-   "search_index": 1, 
+   "search_index": 0, 
    "set_only_once": 0, 
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2551,6 +2635,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2582,6 +2667,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2612,6 +2698,7 @@
    "width": "50%"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2641,6 +2728,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 1, 
@@ -2670,6 +2758,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 1, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2701,6 +2790,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 1, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2732,6 +2822,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2761,6 +2852,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2789,6 +2881,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 1, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2819,6 +2912,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 1, 
@@ -2847,6 +2941,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2881,6 +2976,7 @@
    "width": "150px"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2908,11 +3004,12 @@
    "remember_last_selected_value": 0, 
    "report_hide": 0, 
    "reqd": 0, 
-   "search_index": 1, 
+   "search_index": 0, 
    "set_only_once": 0, 
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2941,6 +3038,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2968,6 +3066,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -3000,6 +3099,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -3030,6 +3130,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -3060,6 +3161,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 1, 
@@ -3091,6 +3193,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -3124,6 +3227,7 @@
    "width": "150px"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -3153,6 +3257,7 @@
    "width": "50%"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -3185,6 +3290,7 @@
    "width": "100px"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -3216,6 +3322,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 1, 
@@ -3245,6 +3352,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 1, 
    "bold": 0, 
    "collapsible": 0, 
@@ -3288,7 +3396,7 @@
  "istable": 0, 
  "max_attachments": 0, 
  "menu_index": 0, 
- "modified": "2017-03-29 04:55:45.044810", 
+ "modified": "2017-05-17 10:34:30.190081", 
  "modified_by": "Administrator", 
  "module": "Stock", 
  "name": "Delivery Note", 
@@ -3404,6 +3512,6 @@
  "sort_order": "DESC", 
  "timeline_field": "customer", 
  "title_field": "title", 
- "track_changes": 0, 
+ "track_changes": 1, 
  "track_seen": 0
 }
\ No newline at end of file
diff --git a/erpnext/stock/doctype/delivery_note/delivery_note.py b/erpnext/stock/doctype/delivery_note/delivery_note.py
index 5e8f5c9..441b637 100644
--- a/erpnext/stock/doctype/delivery_note/delivery_note.py
+++ b/erpnext/stock/doctype/delivery_note/delivery_note.py
@@ -11,7 +11,7 @@
 from frappe.model.mapper import get_mapped_doc
 from erpnext.controllers.selling_controller import SellingController
 from frappe.desk.notifications import clear_doctype_notifications
-
+from erpnext.stock.doctype.batch.batch import set_batch_nos
 
 form_grid_templates = {
 	"items": "templates/form_grid/item_grid.html"
@@ -106,6 +106,9 @@
 		self.validate_uom_is_integer("uom", "qty")
 		self.validate_with_previous_doc()
 
+		if self._action != 'submit' and not self.is_return:
+			set_batch_nos(self, 'warehouse', True)
+
 		from erpnext.stock.doctype.packed_item.packed_item import make_packing_list
 		make_packing_list(self)
 
@@ -114,18 +117,31 @@
 		if not self.installation_status: self.installation_status = 'Not Installed'
 
 	def validate_with_previous_doc(self):
-		for fn in (("Sales Order", "against_sales_order", "so_detail"),
-				("Sales Invoice", "against_sales_invoice", "si_detail")):
-			if filter(None, [getattr(d, fn[1], None) for d in self.get("items")]):
-				super(DeliveryNote, self).validate_with_previous_doc({
-					fn[0]: {
-						"ref_dn_field": fn[1],
-						"compare_fields": [["customer", "="], ["company", "="], ["project", "="],
-							["currency", "="]],
-					},
-				})
+		super(DeliveryNote, self).validate_with_previous_doc({
+			"Sales Order": {
+				"ref_dn_field": "against_sales_order",
+				"compare_fields": [["customer", "="], ["company", "="], ["project", "="], ["currency", "="]]
+			},
+			"Sales Order Item": {
+				"ref_dn_field": "so_detail",
+				"compare_fields": [["item_code", "="], ["uom", "="], ["conversion_factor", "="]],
+				"is_child_table": True,
+				"allow_duplicate_prev_row_id": True
+			},
+			"Sales Invoice": {
+				"ref_dn_field": "against_sales_invoice",
+				"compare_fields": [["customer", "="], ["company", "="], ["project", "="], ["currency", "="]]
+			},
+			"Sales Invoice Item": {
+				"ref_dn_field": "si_detail",
+				"compare_fields": [["item_code", "="], ["uom", "="], ["conversion_factor", "="]],
+				"is_child_table": True,
+				"allow_duplicate_prev_row_id": True
+			},
+		})
 
-		if cint(frappe.db.get_single_value('Selling Settings', 'maintain_same_sales_rate')) and not self.is_return:
+		if cint(frappe.db.get_single_value('Selling Settings', 'maintain_same_sales_rate')) \
+				and not self.is_return:
 			self.validate_rate_with_reference_doc([["Sales Order", "against_sales_order", "so_detail"],
 				["Sales Invoice", "against_sales_invoice", "si_detail"]])
 
@@ -382,7 +398,8 @@
 				"parent": "delivery_note",
 				"so_detail": "so_detail",
 				"against_sales_order": "sales_order",
-				"serial_no": "serial_no"
+				"serial_no": "serial_no",
+				"cost_center": "cost_center"
 			},
 			"postprocess": update_item,
 			"filter": lambda d: abs(d.qty) - abs(invoiced_qty_map.get(d.name, 0))<=0
diff --git a/erpnext/stock/doctype/delivery_note_item/delivery_note_item.json b/erpnext/stock/doctype/delivery_note_item/delivery_note_item.json
index 2bae099..a441a7f 100644
--- a/erpnext/stock/doctype/delivery_note_item/delivery_note_item.json
+++ b/erpnext/stock/doctype/delivery_note_item/delivery_note_item.json
@@ -14,6 +14,7 @@
  "engine": "InnoDB", 
  "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, 
@@ -75,6 +77,7 @@
    "width": "150px"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -86,7 +89,7 @@
    "ignore_xss_filter": 0, 
    "in_filter": 0, 
    "in_global_search": 1, 
-   "in_list_view": 1, 
+   "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Item Name", 
    "length": 0, 
@@ -107,6 +110,7 @@
    "width": "150px"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -134,6 +138,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": 1, 
@@ -191,6 +197,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -223,6 +230,7 @@
    "width": "300px"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -251,6 +259,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -280,6 +289,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -310,6 +320,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -338,6 +349,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -370,6 +382,7 @@
    "width": "100px"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -381,7 +394,7 @@
    "ignore_xss_filter": 0, 
    "in_filter": 0, 
    "in_global_search": 0, 
-   "in_list_view": 1, 
+   "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Stock UOM", 
    "length": 0, 
@@ -403,6 +416,7 @@
    "width": "50px"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -430,6 +444,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -441,7 +456,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": "UOM", 
    "length": 0, 
@@ -460,6 +475,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -489,6 +505,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -518,6 +535,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -546,6 +564,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -579,6 +598,7 @@
    "width": "100px"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -612,6 +632,7 @@
    "width": "100px"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 1, 
@@ -641,67 +662,7 @@
    "unique": 0
   }, 
   {
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "depends_on": "price_list_rate", 
-   "fieldname": "discount_percentage", 
-   "fieldtype": "Float", 
-   "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": "Discount on Price List Rate (%)", 
-   "length": 0, 
-   "no_copy": 0, 
-   "oldfieldname": "adj_rate", 
-   "oldfieldtype": "Float", 
-   "permlevel": 0, 
-   "print_hide": 1, 
-   "print_hide_if_no_value": 0, 
-   "print_width": "100px", 
-   "read_only": 0, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 0, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "unique": 0, 
-   "width": "100px"
-  }, 
-  {
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "column_break_19", 
-   "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, 
@@ -733,6 +694,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -763,12 +725,13 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
-   "depends_on": "eval:doc.margin_type && doc.price_list_rate", 
-   "fieldname": "total_margin", 
+   "depends_on": "eval:doc.margin_type && doc.price_list_rate && doc.margin_rate_or_amount", 
+   "fieldname": "rate_with_margin", 
    "fieldtype": "Currency", 
    "hidden": 0, 
    "ignore_user_permissions": 0, 
@@ -777,7 +740,7 @@
    "in_global_search": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
-   "label": "Total Margin", 
+   "label": "Rate With Margin", 
    "length": 0, 
    "no_copy": 0, 
    "permlevel": 0, 
@@ -793,6 +756,70 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "fieldname": "column_break_19", 
+   "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": "price_list_rate", 
+   "fieldname": "discount_percentage", 
+   "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": "Discount (%) on Price List Rate with Margin", 
+   "length": 0, 
+   "no_copy": 0, 
+   "oldfieldname": "adj_rate", 
+   "oldfieldtype": "Float", 
+   "permlevel": 0, 
+   "print_hide": 1, 
+   "print_hide_if_no_value": 0, 
+   "print_width": "100px", 
+   "read_only": 0, 
+   "remember_last_selected_value": 0, 
+   "report_hide": 0, 
+   "reqd": 0, 
+   "search_index": 0, 
+   "set_only_once": 0, 
+   "unique": 0, 
+   "width": "100px"
+  }, 
+  {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -820,6 +847,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -853,6 +881,7 @@
    "width": "150px"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -886,6 +915,7 @@
    "width": "100px"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -913,6 +943,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -946,6 +977,7 @@
    "width": "150px"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -979,6 +1011,7 @@
    "width": "100px"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1008,6 +1041,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1036,6 +1070,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1066,6 +1101,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1096,6 +1132,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1124,6 +1161,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1154,6 +1192,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1184,6 +1223,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1212,6 +1252,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1245,6 +1286,7 @@
    "width": "100px"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1277,6 +1319,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1308,6 +1351,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1336,6 +1380,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1366,6 +1411,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1397,6 +1443,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 1, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1429,6 +1476,7 @@
    "width": "150px"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 1, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1461,6 +1509,7 @@
    "width": "150px"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1493,6 +1542,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1526,6 +1576,7 @@
    "width": "150px"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1556,6 +1607,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1583,6 +1635,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1613,6 +1666,7 @@
    "width": "120px"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1644,11 +1698,12 @@
    "width": "120px"
   }, 
   {
-   "allow_on_submit": 1, 
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
-   "fieldname": "is_sample_item", 
+   "fieldname": "allow_zero_valuation_rate", 
    "fieldtype": "Check", 
    "hidden": 0, 
    "ignore_user_permissions": 0, 
@@ -1657,7 +1712,7 @@
    "in_global_search": 0, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
-   "label": "Is Sample Item", 
+   "label": "Allow Zero Valuation Rate", 
    "length": 0, 
    "no_copy": 1, 
    "permlevel": 0, 
@@ -1673,6 +1728,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1702,6 +1758,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1731,6 +1788,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1763,6 +1821,7 @@
    "width": "150px"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1792,6 +1851,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1824,6 +1884,7 @@
    "width": "150px"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1854,6 +1915,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 1, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1894,7 +1956,7 @@
  "issingle": 0, 
  "istable": 1, 
  "max_attachments": 0, 
- "modified": "2017-03-30 19:34:42.305637", 
+ "modified": "2017-05-10 17:14:50.456930", 
  "modified_by": "Administrator", 
  "module": "Stock", 
  "name": "Delivery Note Item", 
diff --git a/erpnext/stock/doctype/item/item.js b/erpnext/stock/doctype/item/item.js
index 3402619..460f1c3 100644
--- a/erpnext/stock/doctype/item/item.js
+++ b/erpnext/stock/doctype/item/item.js
@@ -65,7 +65,8 @@
 			frm.page.set_inner_btn_group_as_primary(__("Make"));
 		}
 		if (frm.doc.variant_of) {
-			frm.set_intro(__("This Item is a Variant of {0} (Template). Attributes will be copied over from the template unless 'No Copy' is set", [frm.doc.variant_of]), true);
+			frm.set_intro(__("This Item is a Variant of {0} (Template). Attributes will be copied over from the template unless 'No Copy' is set", 
+				[frm.doc.variant_of]), true);
 		}
 
 		if (frappe.defaults.get_default("item_naming_by")!="Naming Series" || frm.doc.variant_of) {
@@ -96,6 +97,8 @@
 			}
 			frappe.set_route('Form', 'Item', new_item.name);
 		});
+
+		frm.trigger('make_variant_fields_read_only');
 	},
 
 	validate: function(frm){
@@ -106,6 +109,16 @@
 		refresh_field("image_view");
 	},
 
+	make_variant_fields_read_only: function(frm) {
+		if(frm.doc.variant_of) {
+			frm.meta.fields.forEach(function(df) {
+				if (!df.no_copy) {
+					frm.toggle_enable(df.fieldname, false);
+				}
+			});
+		}
+	},
+
 	is_fixed_asset: function(frm) {
 		if (frm.doc.is_fixed_asset) {
 			frm.set_value("is_stock_item", 0);
diff --git a/erpnext/stock/doctype/item/item.json b/erpnext/stock/doctype/item/item.json
index 97e5748..25f3055 100644
--- a/erpnext/stock/doctype/item/item.json
+++ b/erpnext/stock/doctype/item/item.json
@@ -1,3164 +1,3323 @@
 {
- "allow_copy": 0,
- "allow_guest_to_view": 0,
- "allow_import": 1,
- "allow_rename": 1,
- "autoname": "field:item_code",
- "beta": 0,
- "creation": "2013-05-03 10:45:46",
- "custom": 0,
- "default_print_format": "Standard",
- "description": "A Product or a Service that is bought, sold or kept in stock.",
- "docstatus": 0,
- "doctype": "DocType",
- "document_type": "Setup",
- "editable_grid": 1,
- "engine": "InnoDB",
+ "allow_copy": 0, 
+ "allow_guest_to_view": 0, 
+ "allow_import": 1, 
+ "allow_rename": 1, 
+ "autoname": "field:item_code", 
+ "beta": 0, 
+ "creation": "2013-05-03 10:45:46", 
+ "custom": 0, 
+ "default_print_format": "", 
+ "description": "A Product or a Service that is bought, sold or kept in stock.", 
+ "docstatus": 0, 
+ "doctype": "DocType", 
+ "document_type": "Setup", 
+ "editable_grid": 1, 
+ "engine": "InnoDB", 
  "fields": [
   {
-   "allow_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "columns": 0,
-   "fieldname": "name_and_description_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": "",
-   "length": 0,
-   "no_copy": 0,
-   "oldfieldtype": "Section Break",
-   "options": "fa fa-flag",
-   "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,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "fieldname": "name_and_description_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": "", 
+   "length": 0, 
+   "no_copy": 0, 
+   "oldfieldtype": "Section Break", 
+   "options": "fa fa-flag", 
+   "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_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "columns": 0,
-   "fieldname": "naming_series",
-   "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": "Series",
-   "length": 0,
-   "no_copy": 0,
-   "options": "ITEM-",
-   "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,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "fieldname": "naming_series", 
+   "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": "Series", 
+   "length": 0, 
+   "no_copy": 0, 
+   "options": "ITEM-", 
+   "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_on_submit": 0,
-   "bold": 1,
-   "collapsible": 0,
-   "columns": 0,
-   "description": "",
-   "fieldname": "item_code",
-   "fieldtype": "Data",
-   "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": "Item Code",
-   "length": 0,
-   "no_copy": 0,
-   "oldfieldname": "item_code",
-   "oldfieldtype": "Data",
-   "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,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 1, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "description": "", 
+   "fieldname": "item_code", 
+   "fieldtype": "Data", 
+   "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": "Item Code", 
+   "length": 0, 
+   "no_copy": 0, 
+   "oldfieldname": "item_code", 
+   "oldfieldtype": "Data", 
+   "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_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "columns": 0,
-   "depends_on": "variant_of",
-   "description": "If item is a variant of another item then description, image, pricing, taxes etc will be set from the template unless explicitly specified",
-   "fieldname": "variant_of",
-   "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": "Variant Of",
-   "length": 0,
-   "no_copy": 0,
-   "options": "Item",
-   "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,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "depends_on": "variant_of", 
+   "description": "If item is a variant of another item then description, image, pricing, taxes etc will be set from the template unless explicitly specified", 
+   "fieldname": "variant_of", 
+   "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": "Variant Of", 
+   "length": 0, 
+   "no_copy": 0, 
+   "options": "Item", 
+   "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_on_submit": 0,
-   "bold": 1,
-   "collapsible": 0,
-   "columns": 0,
-   "fieldname": "item_name",
-   "fieldtype": "Data",
-   "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": "Item Name",
-   "length": 0,
-   "no_copy": 0,
-   "oldfieldname": "item_name",
-   "oldfieldtype": "Data",
-   "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": 1,
-   "set_only_once": 0,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 1, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "fieldname": "item_name", 
+   "fieldtype": "Data", 
+   "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": "Item Name", 
+   "length": 0, 
+   "no_copy": 0, 
+   "oldfieldname": "item_name", 
+   "oldfieldtype": "Data", 
+   "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": 1, 
+   "set_only_once": 0, 
    "unique": 0
-  },
+  }, 
   {
-   "allow_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "columns": 0,
-   "fieldname": "barcode",
-   "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": "Barcode",
-   "length": 0,
-   "no_copy": 1,
-   "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,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "fieldname": "barcode", 
+   "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": "Barcode", 
+   "length": 0, 
+   "no_copy": 1, 
+   "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_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "columns": 0,
-   "description": "",
-   "fieldname": "item_group",
-   "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": "Item Group",
-   "length": 0,
-   "no_copy": 0,
-   "oldfieldname": "item_group",
-   "oldfieldtype": "Link",
-   "options": "Item Group",
-   "permlevel": 0,
-   "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,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "description": "", 
+   "fieldname": "item_group", 
+   "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": "Item Group", 
+   "length": 0, 
+   "no_copy": 0, 
+   "oldfieldname": "item_group", 
+   "oldfieldtype": "Link", 
+   "options": "Item Group", 
+   "permlevel": 0, 
+   "print_hide": 0, 
+   "print_hide_if_no_value": 0, 
+   "read_only": 0, 
+   "remember_last_selected_value": 0, 
+   "report_hide": 0, 
+   "reqd": 1, 
+   "search_index": 0, 
+   "set_only_once": 0, 
    "unique": 0
-  },
+  }, 
   {
-   "allow_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "columns": 0,
-   "description": "",
-   "fieldname": "stock_uom",
-   "fieldtype": "Link",
-   "hidden": 0,
-   "ignore_user_permissions": 1,
-   "ignore_xss_filter": 0,
-   "in_filter": 0,
-   "in_global_search": 0,
-   "in_list_view": 0,
-   "in_standard_filter": 0,
-   "label": "Default Unit of Measure",
-   "length": 0,
-   "no_copy": 0,
-   "oldfieldname": "stock_uom",
-   "oldfieldtype": "Link",
-   "options": "UOM",
-   "permlevel": 0,
-   "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,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "description": "", 
+   "fieldname": "stock_uom", 
+   "fieldtype": "Link", 
+   "hidden": 0, 
+   "ignore_user_permissions": 1, 
+   "ignore_xss_filter": 0, 
+   "in_filter": 0, 
+   "in_global_search": 0, 
+   "in_list_view": 0, 
+   "in_standard_filter": 0, 
+   "label": "Default Unit of Measure", 
+   "length": 0, 
+   "no_copy": 0, 
+   "oldfieldname": "stock_uom", 
+   "oldfieldtype": "Link", 
+   "options": "UOM", 
+   "permlevel": 0, 
+   "print_hide": 0, 
+   "print_hide_if_no_value": 0, 
+   "read_only": 0, 
+   "remember_last_selected_value": 0, 
+   "report_hide": 0, 
+   "reqd": 1, 
+   "search_index": 0, 
+   "set_only_once": 0, 
    "unique": 0
-  },
+  }, 
   {
-   "allow_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "columns": 0,
-   "fieldname": "column_break0",
-   "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,
-   "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,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "fieldname": "column_break0", 
+   "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, 
+   "print_hide": 0, 
+   "print_hide_if_no_value": 0, 
+   "read_only": 0, 
+   "remember_last_selected_value": 0, 
+   "report_hide": 0, 
+   "reqd": 0, 
+   "search_index": 0, 
+   "set_only_once": 0, 
    "unique": 0
-  },
+  }, 
   {
-   "allow_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "columns": 0,
-   "fieldname": "disabled",
-   "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": "Disabled",
-   "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,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "fieldname": "disabled", 
+   "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": "Disabled", 
+   "length": 0, 
+   "no_copy": 0, 
+   "permlevel": 0, 
+   "precision": "", 
+   "print_hide": 0, 
+   "print_hide_if_no_value": 0, 
+   "read_only": 0, 
+   "remember_last_selected_value": 0, 
+   "report_hide": 0, 
+   "reqd": 0, 
+   "search_index": 0, 
+   "set_only_once": 0, 
    "unique": 0
-  },
+  }, 
   {
-   "allow_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "columns": 0,
-   "default": "1",
-   "description": "",
-   "fieldname": "is_stock_item",
-   "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": "Maintain Stock",
-   "length": 0,
-   "no_copy": 0,
-   "oldfieldname": "is_stock_item",
-   "oldfieldtype": "Select",
-   "options": "",
-   "permlevel": 0,
-   "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,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "default": "1", 
+   "description": "", 
+   "fieldname": "is_stock_item", 
+   "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": "Maintain Stock", 
+   "length": 0, 
+   "no_copy": 0, 
+   "oldfieldname": "is_stock_item", 
+   "oldfieldtype": "Select", 
+   "options": "", 
+   "permlevel": 0, 
+   "print_hide": 0, 
+   "print_hide_if_no_value": 0, 
+   "read_only": 0, 
+   "remember_last_selected_value": 0, 
+   "report_hide": 0, 
+   "reqd": 1, 
+   "search_index": 0, 
+   "set_only_once": 0, 
    "unique": 0
-  },
+  }, 
   {
-   "allow_on_submit": 0,
-   "bold": 1,
-   "collapsible": 0,
-   "columns": 0,
-   "depends_on": "eval:(doc.__islocal&&doc.is_stock_item && !doc.has_serial_no && !doc.has_batch_no)",
-   "fieldname": "opening_stock",
-   "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": "Opening Stock",
-   "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,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 1, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "depends_on": "eval:(doc.__islocal&&doc.is_stock_item && !doc.has_serial_no && !doc.has_batch_no)", 
+   "fieldname": "opening_stock", 
+   "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": "Opening Stock", 
+   "length": 0, 
+   "no_copy": 0, 
+   "permlevel": 0, 
+   "precision": "", 
+   "print_hide": 0, 
+   "print_hide_if_no_value": 0, 
+   "read_only": 0, 
+   "remember_last_selected_value": 0, 
+   "report_hide": 0, 
+   "reqd": 0, 
+   "search_index": 0, 
+   "set_only_once": 0, 
    "unique": 0
-  },
+  }, 
   {
-   "allow_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "columns": 0,
-   "depends_on": "eval:(doc.is_stock_item && !doc.has_serial_no && !doc.has_batch_no)",
-   "fieldname": "valuation_rate",
-   "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": "Valuation Rate",
-   "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,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "depends_on": "eval:(doc.is_stock_item && !doc.has_serial_no && !doc.has_batch_no)", 
+   "fieldname": "valuation_rate", 
+   "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": "Valuation Rate", 
+   "length": 0, 
+   "no_copy": 0, 
+   "permlevel": 0, 
+   "precision": "", 
+   "print_hide": 0, 
+   "print_hide_if_no_value": 0, 
+   "read_only": 0, 
+   "remember_last_selected_value": 0, 
+   "report_hide": 0, 
+   "reqd": 0, 
+   "search_index": 0, 
+   "set_only_once": 0, 
    "unique": 0
-  },
+  }, 
   {
-   "allow_on_submit": 0,
-   "bold": 1,
-   "collapsible": 0,
-   "columns": 0,
-   "fieldname": "standard_rate",
-   "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": "Standard Selling Rate",
-   "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,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 1, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "fieldname": "standard_rate", 
+   "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": "Standard Selling Rate", 
+   "length": 0, 
+   "no_copy": 0, 
+   "permlevel": 0, 
+   "precision": "", 
+   "print_hide": 0, 
+   "print_hide_if_no_value": 0, 
+   "read_only": 0, 
+   "remember_last_selected_value": 0, 
+   "report_hide": 0, 
+   "reqd": 0, 
+   "search_index": 0, 
+   "set_only_once": 0, 
    "unique": 0
-  },
+  }, 
   {
-   "allow_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "columns": 0,
-   "fieldname": "is_fixed_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 Fixed 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,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "fieldname": "is_fixed_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 Fixed 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_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "columns": 0,
-   "fieldname": "device_package_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": 0,
-   "label": "Device Package Code",
-   "length": 0,
-   "no_copy": 0,
-   "options": "Package Code",
-   "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,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "depends_on": "is_fixed_asset", 
+   "fieldname": "asset_category", 
+   "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": "Asset Category", 
+   "length": 0, 
+   "no_copy": 0, 
+   "options": "Asset Category", 
+   "permlevel": 0, 
+   "precision": "", 
+   "print_hide": 0, 
+   "print_hide_if_no_value": 0, 
+   "read_only": 0, 
+   "remember_last_selected_value": 0, 
+   "report_hide": 0, 
+   "reqd": 0, 
+   "search_index": 0, 
+   "set_only_once": 0, 
    "unique": 0
-  },
+  }, 
   {
-   "allow_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "columns": 0,
-   "depends_on": "is_fixed_asset",
-   "fieldname": "asset_category",
-   "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": "Asset Category",
-   "length": 0,
-   "no_copy": 0,
-   "options": "Asset Category",
-   "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,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "depends_on": "eval:!doc.__islocal", 
+   "description": "", 
+   "fieldname": "tolerance", 
+   "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": "Allow over delivery or receipt upto this percent", 
+   "length": 0, 
+   "no_copy": 0, 
+   "oldfieldname": "tolerance", 
+   "oldfieldtype": "Currency", 
+   "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_on_submit": 0,
-   "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": 0,
-   "options": "image",
-   "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,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "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": 0, 
+   "options": "image", 
+   "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_on_submit": 0,
-   "bold": 0,
-   "collapsible": 1,
-   "columns": 0,
-   "fieldname": "section_break_11",
-   "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": "Description",
-   "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,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 1, 
+   "columns": 0, 
+   "fieldname": "section_break_11", 
+   "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": "Description", 
+   "length": 0, 
+   "no_copy": 0, 
+   "permlevel": 0, 
+   "precision": "", 
+   "print_hide": 0, 
+   "print_hide_if_no_value": 0, 
+   "read_only": 0, 
+   "remember_last_selected_value": 0, 
+   "report_hide": 0, 
+   "reqd": 0, 
+   "search_index": 0, 
+   "set_only_once": 0, 
    "unique": 0
-  },
+  }, 
   {
-   "allow_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "columns": 0,
-   "fieldname": "brand",
-   "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": "Brand",
-   "length": 0,
-   "no_copy": 0,
-   "oldfieldname": "brand",
-   "oldfieldtype": "Link",
-   "options": "Brand",
-   "permlevel": 0,
-   "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,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "fieldname": "brand", 
+   "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": "Brand", 
+   "length": 0, 
+   "no_copy": 0, 
+   "oldfieldname": "brand", 
+   "oldfieldtype": "Link", 
+   "options": "Brand", 
+   "permlevel": 0, 
+   "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_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "columns": 0,
-   "fieldname": "description",
-   "fieldtype": "Text Editor",
-   "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": "Description",
-   "length": 0,
-   "no_copy": 0,
-   "oldfieldname": "description",
-   "oldfieldtype": "Text",
-   "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,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "fieldname": "description", 
+   "fieldtype": "Text Editor", 
+   "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": "Description", 
+   "length": 0, 
+   "no_copy": 0, 
+   "oldfieldname": "description", 
+   "oldfieldtype": "Text", 
+   "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_on_submit": 0,
-   "bold": 0,
-   "collapsible": 1,
-   "collapsible_depends_on": "is_stock_item",
-   "columns": 0,
-   "depends_on": "is_stock_item",
-   "fieldname": "inventory",
-   "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": "Inventory",
-   "length": 0,
-   "no_copy": 0,
-   "oldfieldtype": "Section Break",
-   "options": "fa fa-truck",
-   "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,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 1, 
+   "collapsible_depends_on": "is_stock_item", 
+   "columns": 0, 
+   "depends_on": "is_stock_item", 
+   "fieldname": "inventory", 
+   "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": "Inventory", 
+   "length": 0, 
+   "no_copy": 0, 
+   "oldfieldtype": "Section Break", 
+   "options": "fa fa-truck", 
+   "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_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "columns": 0,
-   "depends_on": "is_stock_item",
-   "description": "",
-   "fieldname": "default_warehouse",
-   "fieldtype": "Link",
-   "hidden": 0,
-   "ignore_user_permissions": 1,
-   "ignore_xss_filter": 0,
-   "in_filter": 0,
-   "in_global_search": 0,
-   "in_list_view": 0,
-   "in_standard_filter": 0,
-   "label": "Default Warehouse",
-   "length": 0,
-   "no_copy": 0,
-   "oldfieldname": "default_warehouse",
-   "oldfieldtype": "Link",
-   "options": "Warehouse",
-   "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,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "depends_on": "is_stock_item", 
+   "description": "", 
+   "fieldname": "default_warehouse", 
+   "fieldtype": "Link", 
+   "hidden": 0, 
+   "ignore_user_permissions": 1, 
+   "ignore_xss_filter": 0, 
+   "in_filter": 0, 
+   "in_global_search": 0, 
+   "in_list_view": 0, 
+   "in_standard_filter": 0, 
+   "label": "Default Warehouse", 
+   "length": 0, 
+   "no_copy": 0, 
+   "oldfieldname": "default_warehouse", 
+   "oldfieldtype": "Link", 
+   "options": "Warehouse", 
+   "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_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "columns": 0,
-   "default": "2099-12-31",
-   "depends_on": "is_stock_item",
-   "fieldname": "end_of_life",
-   "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": "End of Life",
-   "length": 0,
-   "no_copy": 0,
-   "oldfieldname": "end_of_life",
-   "oldfieldtype": "Date",
-   "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,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "default": "2099-12-31", 
+   "depends_on": "is_stock_item", 
+   "fieldname": "end_of_life", 
+   "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": "End of Life", 
+   "length": 0, 
+   "no_copy": 0, 
+   "oldfieldname": "end_of_life", 
+   "oldfieldtype": "Date", 
+   "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_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "columns": 0,
-   "default": "",
-   "depends_on": "eval:doc.is_stock_item",
-   "fieldname": "has_batch_no",
-   "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": "Has Batch No",
-   "length": 0,
-   "no_copy": 0,
-   "oldfieldname": "has_batch_no",
-   "oldfieldtype": "Select",
-   "options": "",
-   "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,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "default": "Purchase", 
+   "fieldname": "default_material_request_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": "Default Material Request Type", 
+   "length": 0, 
+   "no_copy": 0, 
+   "options": "Purchase\nMaterial Transfer\nMaterial Issue\nManufacture", 
+   "permlevel": 0, 
+   "precision": "", 
+   "print_hide": 0, 
+   "print_hide_if_no_value": 0, 
+   "read_only": 0, 
+   "remember_last_selected_value": 0, 
+   "report_hide": 0, 
+   "reqd": 0, 
+   "search_index": 0, 
+   "set_only_once": 0, 
    "unique": 0
-  },
+  }, 
   {
-   "allow_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "columns": 0,
-   "default": "",
-   "depends_on": "eval:doc.is_stock_item",
-   "description": "Selecting \"Yes\" will give a unique identity to each entity of this item which can be viewed in the Serial No master.",
-   "fieldname": "has_serial_no",
-   "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": "Has Serial No",
-   "length": 0,
-   "no_copy": 0,
-   "oldfieldname": "has_serial_no",
-   "oldfieldtype": "Select",
-   "options": "",
-   "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_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "columns": 0,
-   "depends_on": "has_serial_no",
-   "description": "Example: ABCD.#####\nIf series is set and Serial No is not mentioned in transactions, then automatic serial number will be created based on this series. If you always want to explicitly mention Serial Nos for this item. leave this blank.",
-   "fieldname": "serial_no_series",
-   "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": "Serial Number Series",
-   "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_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "columns": 0,
-   "default": "Purchase",
-   "fieldname": "default_material_request_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": "Default Material Request Type",
-   "length": 0,
-   "no_copy": 0,
-   "options": "Purchase\nMaterial Transfer\nMaterial Issue\nManufacture",
-   "permlevel": 0,
-   "precision": "",
-   "print_hide": 0,
-   "print_hide_if_no_value": 0,
-   "read_only": 0,
-   "remember_last_selected_value": 0,
-   "report_hide": 0,
-   "reqd": 0,
-   "search_index": 0,
-   "set_only_once": 0,
-   "unique": 0
-  },
-  {
-   "allow_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "columns": 0,
-   "depends_on": "is_stock_item",
-   "fieldname": "column_break1",
-   "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,
-   "oldfieldtype": "Column Break",
-   "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": "is_stock_item", 
+   "fieldname": "column_break1", 
+   "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, 
+   "oldfieldtype": "Column Break", 
+   "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, 
    "width": "50%"
-  },
+  }, 
   {
-   "allow_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "columns": 0,
-   "depends_on": "is_stock_item",
-   "description": "",
-   "fieldname": "tolerance",
-   "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": "Allow over delivery or receipt upto this percent",
-   "length": 0,
-   "no_copy": 0,
-   "oldfieldname": "tolerance",
-   "oldfieldtype": "Currency",
-   "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,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "depends_on": "is_stock_item", 
+   "fieldname": "valuation_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": "Valuation Method", 
+   "length": 0, 
+   "no_copy": 0, 
+   "options": "\nFIFO\nMoving Average", 
+   "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_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "columns": 0,
-   "depends_on": "is_stock_item",
-   "fieldname": "valuation_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": "Valuation Method",
-   "length": 0,
-   "no_copy": 0,
-   "options": "\nFIFO\nMoving Average",
-   "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,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "depends_on": "eval:doc.is_stock_item", 
+   "fieldname": "warranty_period", 
+   "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": "Warranty Period (in days)", 
+   "length": 0, 
+   "no_copy": 0, 
+   "oldfieldname": "warranty_period", 
+   "oldfieldtype": "Data", 
+   "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_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "columns": 0,
-   "depends_on": "eval:doc.is_stock_item",
-   "fieldname": "warranty_period",
-   "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": "Warranty Period (in days)",
-   "length": 0,
-   "no_copy": 0,
-   "oldfieldname": "warranty_period",
-   "oldfieldtype": "Data",
-   "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,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "depends_on": "is_stock_item", 
+   "description": "", 
+   "fieldname": "net_weight", 
+   "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": "Net Weight", 
+   "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_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "columns": 0,
-   "depends_on": "is_stock_item",
-   "description": "",
-   "fieldname": "net_weight",
-   "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": "Net Weight",
-   "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,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "depends_on": "eval:doc.is_stock_item", 
+   "fieldname": "weight_uom", 
+   "fieldtype": "Link", 
+   "hidden": 0, 
+   "ignore_user_permissions": 1, 
+   "ignore_xss_filter": 0, 
+   "in_filter": 0, 
+   "in_global_search": 0, 
+   "in_list_view": 0, 
+   "in_standard_filter": 0, 
+   "label": "Weight UOM", 
+   "length": 0, 
+   "no_copy": 0, 
+   "options": "UOM", 
+   "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_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "columns": 0,
-   "depends_on": "eval:doc.is_stock_item",
-   "fieldname": "weight_uom",
-   "fieldtype": "Link",
-   "hidden": 0,
-   "ignore_user_permissions": 1,
-   "ignore_xss_filter": 0,
-   "in_filter": 0,
-   "in_global_search": 0,
-   "in_list_view": 0,
-   "in_standard_filter": 0,
-   "label": "Weight UOM",
-   "length": 0,
-   "no_copy": 0,
-   "options": "UOM",
-   "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,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 1, 
+   "columns": 0, 
+   "depends_on": "is_stock_item", 
+   "description": "", 
+   "fieldname": "reorder_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": "Auto re-order", 
+   "length": 0, 
+   "no_copy": 0, 
+   "options": "fa fa-rss", 
+   "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_on_submit": 0,
-   "bold": 0,
-   "collapsible": 1,
-   "columns": 0,
-   "depends_on": "is_stock_item",
-   "description": "",
-   "fieldname": "reorder_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": "Auto re-order",
-   "length": 0,
-   "no_copy": 0,
-   "options": "fa fa-rss",
-   "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,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "depends_on": "", 
+   "description": "Will also apply for variants unless overrridden", 
+   "fieldname": "reorder_levels", 
+   "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": "Reorder level based on Warehouse", 
+   "length": 0, 
+   "no_copy": 0, 
+   "options": "Item Reorder", 
+   "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_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "columns": 0,
-   "depends_on": "",
-   "description": "Will also apply for variants unless overrridden",
-   "fieldname": "reorder_levels",
-   "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": "Reorder level based on Warehouse",
-   "length": 0,
-   "no_copy": 0,
-   "options": "Item Reorder",
-   "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,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 1, 
+   "columns": 0, 
+   "depends_on": "", 
+   "fieldname": "unit_of_measure_conversion", 
+   "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": "Units of Measure", 
+   "length": 0, 
+   "no_copy": 0, 
+   "permlevel": 0, 
+   "precision": "", 
+   "print_hide": 0, 
+   "print_hide_if_no_value": 0, 
+   "read_only": 0, 
+   "remember_last_selected_value": 0, 
+   "report_hide": 0, 
+   "reqd": 0, 
+   "search_index": 0, 
+   "set_only_once": 0, 
    "unique": 0
-  },
+  }, 
   {
-   "allow_on_submit": 0,
-   "bold": 0,
-   "collapsible": 1,
-   "columns": 0,
-   "depends_on": "",
-   "fieldname": "unit_of_measure_conversion",
-   "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": "Units of Measure",
-   "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,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "depends_on": "", 
+   "description": "Will also apply for variants", 
+   "fieldname": "uoms", 
+   "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": "UOMs", 
+   "length": 0, 
+   "no_copy": 1, 
+   "oldfieldname": "uom_conversion_details", 
+   "oldfieldtype": "Table", 
+   "options": "UOM Conversion Detail", 
+   "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_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "columns": 0,
-   "depends_on": "",
-   "description": "Will also apply for variants",
-   "fieldname": "uoms",
-   "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": "UOMs",
-   "length": 0,
-   "no_copy": 1,
-   "oldfieldname": "uom_conversion_details",
-   "oldfieldtype": "Table",
-   "options": "UOM Conversion Detail",
-   "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,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 1, 
+   "collapsible_depends_on": "eval:doc.has_batch_no || doc.has_serial_no", 
+   "columns": 0, 
+   "depends_on": "is_stock_item", 
+   "fieldname": "serial_nos_and_batches", 
+   "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": "Serial Nos and Batches", 
+   "length": 0, 
+   "no_copy": 0, 
+   "permlevel": 0, 
+   "precision": "", 
+   "print_hide": 0, 
+   "print_hide_if_no_value": 0, 
+   "read_only": 0, 
+   "remember_last_selected_value": 0, 
+   "report_hide": 0, 
+   "reqd": 0, 
+   "search_index": 0, 
+   "set_only_once": 0, 
    "unique": 0
-  },
+  }, 
   {
-   "allow_on_submit": 0,
-   "bold": 0,
-   "collapsible": 1,
-   "collapsible_depends_on": "attributes",
-   "columns": 0,
-   "depends_on": "",
-   "fieldname": "variants_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": "Variants",
-   "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,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "default": "", 
+   "depends_on": "eval:doc.is_stock_item", 
+   "fieldname": "has_batch_no", 
+   "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": "Has Batch No", 
+   "length": 0, 
+   "no_copy": 0, 
+   "oldfieldname": "has_batch_no", 
+   "oldfieldtype": "Select", 
+   "options": "", 
+   "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_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "columns": 0,
-   "default": "0",
-   "depends_on": "eval:!doc.variant_of",
-   "description": "If this item has variants, then it cannot be selected in sales orders etc.",
-   "fieldname": "has_variants",
-   "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": "Has Variants",
-   "length": 0,
-   "no_copy": 1,
-   "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,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "depends_on": "has_batch_no", 
+   "description": "", 
+   "fieldname": "create_new_batch", 
+   "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": "Automatically Create New Batch", 
+   "length": 0, 
+   "no_copy": 0, 
+   "permlevel": 0, 
+   "precision": "", 
+   "print_hide": 0, 
+   "print_hide_if_no_value": 0, 
+   "read_only": 0, 
+   "remember_last_selected_value": 0, 
+   "report_hide": 0, 
+   "reqd": 0, 
+   "search_index": 0, 
+   "set_only_once": 0, 
    "unique": 0
-  },
+  }, 
   {
-   "allow_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "columns": 0,
-   "default": "Item Attribute",
-   "depends_on": "has_variants",
-   "fieldname": "variant_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": "Variant Based On",
-   "length": 0,
-   "no_copy": 0,
-   "options": "Item Attribute\nManufacturer",
-   "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,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "fieldname": "column_break_37", 
+   "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_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "columns": 0,
-   "depends_on": "eval:doc.has_variants && doc.variant_based_on==='Item Attribute'",
-   "fieldname": "attributes",
-   "fieldtype": "Table",
-   "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": "Attributes",
-   "length": 0,
-   "no_copy": 1,
-   "options": "Item Variant Attribute",
-   "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,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "default": "", 
+   "depends_on": "eval:doc.is_stock_item", 
+   "description": "", 
+   "fieldname": "has_serial_no", 
+   "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": "Has Serial No", 
+   "length": 0, 
+   "no_copy": 0, 
+   "oldfieldname": "has_serial_no", 
+   "oldfieldtype": "Select", 
+   "options": "", 
+   "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_on_submit": 0,
-   "bold": 0,
-   "collapsible": 1,
-   "columns": 0,
-   "fieldname": "purchase_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": "Purchase Details",
-   "length": 0,
-   "no_copy": 0,
-   "oldfieldtype": "Section Break",
-   "options": "fa fa-shopping-cart",
-   "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,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "depends_on": "has_serial_no", 
+   "description": "Example: ABCD.#####\nIf series is set and Serial No is not mentioned in transactions, then automatic serial number will be created based on this series. If you always want to explicitly mention Serial Nos for this item. leave this blank.", 
+   "fieldname": "serial_no_series", 
+   "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": "Serial Number Series", 
+   "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_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "columns": 0,
-   "default": "1",
-   "fieldname": "is_purchase_item",
-   "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 Purchase Item",
-   "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,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 1, 
+   "collapsible_depends_on": "attributes", 
+   "columns": 0, 
+   "depends_on": "", 
+   "fieldname": "variants_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": "Variants", 
+   "length": 0, 
+   "no_copy": 0, 
+   "permlevel": 0, 
+   "precision": "", 
+   "print_hide": 0, 
+   "print_hide_if_no_value": 0, 
+   "read_only": 0, 
+   "remember_last_selected_value": 0, 
+   "report_hide": 0, 
+   "reqd": 0, 
+   "search_index": 0, 
+   "set_only_once": 0, 
    "unique": 0
-  },
+  }, 
   {
-   "allow_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "columns": 0,
-   "default": "0.00",
-   "depends_on": "is_stock_item",
-   "description": "",
-   "fieldname": "min_order_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": "Minimum Order Qty",
-   "length": 0,
-   "no_copy": 0,
-   "oldfieldname": "min_order_qty",
-   "oldfieldtype": "Currency",
-   "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,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "default": "0", 
+   "depends_on": "eval:!doc.variant_of", 
+   "description": "If this item has variants, then it cannot be selected in sales orders etc.", 
+   "fieldname": "has_variants", 
+   "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": "Has Variants", 
+   "length": 0, 
+   "no_copy": 1, 
+   "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_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "columns": 0,
-   "fieldname": "safety_stock",
-   "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": "Safety Stock",
-   "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,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "default": "Item Attribute", 
+   "depends_on": "has_variants", 
+   "fieldname": "variant_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": "Variant Based On", 
+   "length": 0, 
+   "no_copy": 0, 
+   "options": "Item Attribute\nManufacturer", 
+   "permlevel": 0, 
+   "precision": "", 
+   "print_hide": 0, 
+   "print_hide_if_no_value": 0, 
+   "read_only": 0, 
+   "remember_last_selected_value": 0, 
+   "report_hide": 0, 
+   "reqd": 0, 
+   "search_index": 0, 
+   "set_only_once": 0, 
    "unique": 0
-  },
+  }, 
   {
-   "allow_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "columns": 0,
-   "depends_on": "",
-   "description": "Average time taken by the supplier to deliver",
-   "fieldname": "lead_time_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": "Lead Time in days",
-   "length": 0,
-   "no_copy": 0,
-   "oldfieldname": "lead_time_days",
-   "oldfieldtype": "Int",
-   "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,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "depends_on": "eval:doc.has_variants && doc.variant_based_on==='Item Attribute'", 
+   "fieldname": "attributes", 
+   "fieldtype": "Table", 
+   "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": "Attributes", 
+   "length": 0, 
+   "no_copy": 1, 
+   "options": "Item Variant Attribute", 
+   "permlevel": 0, 
+   "precision": "", 
+   "print_hide": 0, 
+   "print_hide_if_no_value": 0, 
+   "read_only": 0, 
+   "remember_last_selected_value": 0, 
+   "report_hide": 0, 
+   "reqd": 0, 
+   "search_index": 0, 
+   "set_only_once": 0, 
    "unique": 0
-  },
+  }, 
   {
-   "allow_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "columns": 0,
-   "depends_on": "",
-   "description": "",
-   "fieldname": "buying_cost_center",
-   "fieldtype": "Link",
-   "hidden": 0,
-   "ignore_user_permissions": 1,
-   "ignore_xss_filter": 0,
-   "in_filter": 0,
-   "in_global_search": 0,
-   "in_list_view": 0,
-   "in_standard_filter": 0,
-   "label": "Default Buying Cost Center",
-   "length": 0,
-   "no_copy": 0,
-   "oldfieldname": "cost_center",
-   "oldfieldtype": "Link",
-   "options": "Cost Center",
-   "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,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 1, 
+   "columns": 0, 
+   "fieldname": "purchase_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": "Purchase Details", 
+   "length": 0, 
+   "no_copy": 0, 
+   "oldfieldtype": "Section Break", 
+   "options": "fa fa-shopping-cart", 
+   "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_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "columns": 0,
-   "depends_on": "",
-   "description": "",
-   "fieldname": "expense_account",
-   "fieldtype": "Link",
-   "hidden": 0,
-   "ignore_user_permissions": 1,
-   "ignore_xss_filter": 0,
-   "in_filter": 0,
-   "in_global_search": 0,
-   "in_list_view": 0,
-   "in_standard_filter": 0,
-   "label": "Default Expense Account",
-   "length": 0,
-   "no_copy": 0,
-   "oldfieldname": "purchase_account",
-   "oldfieldtype": "Link",
-   "options": "Account",
-   "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,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "default": "1", 
+   "fieldname": "is_purchase_item", 
+   "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 Purchase Item", 
+   "length": 0, 
+   "no_copy": 0, 
+   "permlevel": 0, 
+   "precision": "", 
+   "print_hide": 0, 
+   "print_hide_if_no_value": 0, 
+   "read_only": 0, 
+   "remember_last_selected_value": 0, 
+   "report_hide": 0, 
+   "reqd": 0, 
+   "search_index": 0, 
+   "set_only_once": 0, 
    "unique": 0
-  },
+  }, 
   {
-   "allow_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "columns": 0,
-   "depends_on": "",
-   "fieldname": "last_purchase_rate",
-   "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": "Last Purchase Rate",
-   "length": 0,
-   "no_copy": 1,
-   "oldfieldname": "last_purchase_rate",
-   "oldfieldtype": "Currency",
-   "permlevel": 0,
-   "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,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "default": "0.00", 
+   "depends_on": "is_stock_item", 
+   "description": "", 
+   "fieldname": "min_order_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": "Minimum Order Qty", 
+   "length": 0, 
+   "no_copy": 0, 
+   "oldfieldname": "min_order_qty", 
+   "oldfieldtype": "Currency", 
+   "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_on_submit": 0,
-   "bold": 0,
-   "collapsible": 1,
-   "columns": 0,
-   "fieldname": "manufacturer_part_numbers",
-   "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": "Manufacturer Part Numbers",
-   "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,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "fieldname": "safety_stock", 
+   "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": "Safety Stock", 
+   "length": 0, 
+   "no_copy": 0, 
+   "permlevel": 0, 
+   "precision": "", 
+   "print_hide": 0, 
+   "print_hide_if_no_value": 0, 
+   "read_only": 0, 
+   "remember_last_selected_value": 0, 
+   "report_hide": 0, 
+   "reqd": 0, 
+   "search_index": 0, 
+   "set_only_once": 0, 
    "unique": 0
-  },
+  }, 
   {
-   "allow_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "columns": 0,
-   "fieldname": "manufacturers",
-   "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": "Item Manufacturers",
-   "length": 0,
-   "no_copy": 0,
-   "options": "Item Manufacturer",
-   "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,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "depends_on": "", 
+   "description": "Average time taken by the supplier to deliver", 
+   "fieldname": "lead_time_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": "Lead Time in days", 
+   "length": 0, 
+   "no_copy": 0, 
+   "oldfieldname": "lead_time_days", 
+   "oldfieldtype": "Int", 
+   "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_on_submit": 0,
-   "bold": 0,
-   "collapsible": 1,
-   "columns": 0,
-   "depends_on": "",
-   "fieldname": "supplier_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": "Supplier 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,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "depends_on": "", 
+   "description": "", 
+   "fieldname": "buying_cost_center", 
+   "fieldtype": "Link", 
+   "hidden": 0, 
+   "ignore_user_permissions": 1, 
+   "ignore_xss_filter": 0, 
+   "in_filter": 0, 
+   "in_global_search": 0, 
+   "in_list_view": 0, 
+   "in_standard_filter": 0, 
+   "label": "Default Buying Cost Center", 
+   "length": 0, 
+   "no_copy": 0, 
+   "oldfieldname": "cost_center", 
+   "oldfieldtype": "Link", 
+   "options": "Cost Center", 
+   "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_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "columns": 0,
-   "depends_on": "",
-   "fieldname": "default_supplier",
-   "fieldtype": "Link",
-   "hidden": 0,
-   "ignore_user_permissions": 1,
-   "ignore_xss_filter": 0,
-   "in_filter": 0,
-   "in_global_search": 0,
-   "in_list_view": 0,
-   "in_standard_filter": 0,
-   "label": "Default Supplier",
-   "length": 0,
-   "no_copy": 0,
-   "options": "Supplier",
-   "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,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "depends_on": "", 
+   "description": "", 
+   "fieldname": "expense_account", 
+   "fieldtype": "Link", 
+   "hidden": 0, 
+   "ignore_user_permissions": 1, 
+   "ignore_xss_filter": 0, 
+   "in_filter": 0, 
+   "in_global_search": 0, 
+   "in_list_view": 0, 
+   "in_standard_filter": 0, 
+   "label": "Default Expense Account", 
+   "length": 0, 
+   "no_copy": 0, 
+   "oldfieldname": "purchase_account", 
+   "oldfieldtype": "Link", 
+   "options": "Account", 
+   "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_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "columns": 0,
-   "fieldname": "delivered_by_supplier",
-   "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": "Delivered by Supplier (Drop Ship)",
-   "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": 0,
-   "search_index": 0,
-   "set_only_once": 0,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "depends_on": "", 
+   "fieldname": "last_purchase_rate", 
+   "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": "Last Purchase Rate", 
+   "length": 0, 
+   "no_copy": 1, 
+   "oldfieldname": "last_purchase_rate", 
+   "oldfieldtype": "Currency", 
+   "permlevel": 0, 
+   "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_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "columns": 0,
-   "depends_on": "",
-   "fieldname": "column_break2",
-   "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": "Item Code for Suppliers",
-   "length": 0,
-   "no_copy": 0,
-   "oldfieldtype": "Column Break",
-   "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": 1, 
+   "columns": 0, 
+   "depends_on": "", 
+   "fieldname": "supplier_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": "Supplier 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": "", 
+   "fieldname": "default_supplier", 
+   "fieldtype": "Link", 
+   "hidden": 0, 
+   "ignore_user_permissions": 1, 
+   "ignore_xss_filter": 0, 
+   "in_filter": 0, 
+   "in_global_search": 0, 
+   "in_list_view": 0, 
+   "in_standard_filter": 0, 
+   "label": "Default Supplier", 
+   "length": 0, 
+   "no_copy": 0, 
+   "options": "Supplier", 
+   "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, 
+   "fieldname": "delivered_by_supplier", 
+   "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": "Delivered by Supplier (Drop Ship)", 
+   "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": 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": "manufacturer", 
+   "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": "Manufacturer", 
+   "length": 0, 
+   "no_copy": 0, 
+   "options": "Manufacturer", 
+   "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": "", 
+   "fieldname": "manufacturer_part_no", 
+   "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": "Manufacturer Part Number", 
+   "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": "", 
+   "fieldname": "column_break2", 
+   "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": "Item Code for Suppliers", 
+   "length": 0, 
+   "no_copy": 0, 
+   "oldfieldtype": "Column Break", 
+   "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, 
    "width": "50%"
-  },
+  }, 
   {
-   "allow_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "columns": 0,
-   "depends_on": "",
-   "fieldname": "supplier_items",
-   "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": "Supplier Items",
-   "length": 0,
-   "no_copy": 0,
-   "options": "Item Supplier",
-   "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,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "depends_on": "", 
+   "fieldname": "supplier_items", 
+   "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": "Supplier Items", 
+   "length": 0, 
+   "no_copy": 0, 
+   "options": "Item Supplier", 
+   "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_on_submit": 0,
-   "bold": 0,
-   "collapsible": 1,
-   "columns": 0,
-   "fieldname": "foreign_trade_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": "Foreign Trade 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,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 1, 
+   "columns": 0, 
+   "fieldname": "foreign_trade_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": "Foreign Trade 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_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "columns": 0,
-   "fieldname": "country_of_origin",
-   "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": "Country of Origin",
-   "length": 0,
-   "no_copy": 0,
-   "options": "Country",
-   "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,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "fieldname": "country_of_origin", 
+   "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": "Country of Origin", 
+   "length": 0, 
+   "no_copy": 0, 
+   "options": "Country", 
+   "permlevel": 0, 
+   "precision": "", 
+   "print_hide": 0, 
+   "print_hide_if_no_value": 0, 
+   "read_only": 0, 
+   "remember_last_selected_value": 0, 
+   "report_hide": 0, 
+   "reqd": 0, 
+   "search_index": 0, 
+   "set_only_once": 0, 
    "unique": 0
-  },
+  }, 
   {
-   "allow_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "columns": 0,
-   "fieldname": "column_break_59",
-   "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,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "fieldname": "column_break_59", 
+   "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_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "columns": 0,
-   "fieldname": "customs_tariff_number",
-   "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": "Customs Tariff Number",
-   "length": 0,
-   "no_copy": 0,
-   "options": "Customs Tariff Number",
-   "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,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "fieldname": "customs_tariff_number", 
+   "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": "Customs Tariff Number", 
+   "length": 0, 
+   "no_copy": 0, 
+   "options": "Customs Tariff Number", 
+   "permlevel": 0, 
+   "precision": "", 
+   "print_hide": 0, 
+   "print_hide_if_no_value": 0, 
+   "read_only": 0, 
+   "remember_last_selected_value": 0, 
+   "report_hide": 0, 
+   "reqd": 0, 
+   "search_index": 0, 
+   "set_only_once": 0, 
    "unique": 0
-  },
+  }, 
   {
-   "allow_on_submit": 0,
-   "bold": 0,
-   "collapsible": 1,
-   "columns": 0,
-   "fieldname": "sales_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": "Sales Details",
-   "length": 0,
-   "no_copy": 0,
-   "oldfieldtype": "Section Break",
-   "options": "fa fa-tag",
-   "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,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 1, 
+   "columns": 0, 
+   "fieldname": "sales_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": "Sales Details", 
+   "length": 0, 
+   "no_copy": 0, 
+   "oldfieldtype": "Section Break", 
+   "options": "fa fa-tag", 
+   "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_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "columns": 0,
-   "default": "1",
-   "fieldname": "is_sales_item",
-   "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 Sales Item",
-   "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,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "default": "1", 
+   "fieldname": "is_sales_item", 
+   "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 Sales Item", 
+   "length": 0, 
+   "no_copy": 0, 
+   "permlevel": 0, 
+   "precision": "", 
+   "print_hide": 0, 
+   "print_hide_if_no_value": 0, 
+   "read_only": 0, 
+   "remember_last_selected_value": 0, 
+   "report_hide": 0, 
+   "reqd": 0, 
+   "search_index": 0, 
+   "set_only_once": 0, 
    "unique": 0
-  },
+  }, 
   {
-   "allow_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "columns": 0,
-   "default": "0",
-   "description": "Publish Item to hub.erpnext.com",
-   "fieldname": "publish_in_hub",
-   "fieldtype": "Check",
-   "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": "Publish in Hub",
-   "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,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "default": "0", 
+   "description": "Publish Item to hub.erpnext.com", 
+   "fieldname": "publish_in_hub", 
+   "fieldtype": "Check", 
+   "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": "Publish in Hub", 
+   "length": 0, 
+   "no_copy": 0, 
+   "permlevel": 0, 
+   "precision": "", 
+   "print_hide": 0, 
+   "print_hide_if_no_value": 0, 
+   "read_only": 0, 
+   "remember_last_selected_value": 0, 
+   "report_hide": 0, 
+   "reqd": 0, 
+   "search_index": 0, 
+   "set_only_once": 0, 
    "unique": 0
-  },
+  }, 
   {
-   "allow_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "columns": 0,
-   "default": "0",
-   "fieldname": "synced_with_hub",
-   "fieldtype": "Check",
-   "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": "Synced With Hub",
-   "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,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "default": "0", 
+   "fieldname": "synced_with_hub", 
+   "fieldtype": "Check", 
+   "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": "Synced With Hub", 
+   "length": 0, 
+   "no_copy": 0, 
+   "permlevel": 0, 
+   "precision": "", 
+   "print_hide": 0, 
+   "print_hide_if_no_value": 0, 
+   "read_only": 0, 
+   "remember_last_selected_value": 0, 
+   "report_hide": 0, 
+   "reqd": 0, 
+   "search_index": 0, 
+   "set_only_once": 0, 
    "unique": 0
-  },
+  }, 
   {
-   "allow_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "columns": 0,
-   "depends_on": "",
-   "fieldname": "income_account",
-   "fieldtype": "Link",
-   "hidden": 0,
-   "ignore_user_permissions": 1,
-   "ignore_xss_filter": 0,
-   "in_filter": 0,
-   "in_global_search": 0,
-   "in_list_view": 0,
-   "in_standard_filter": 0,
-   "label": "Default Income Account",
-   "length": 0,
-   "no_copy": 0,
-   "options": "Account",
-   "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,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "depends_on": "", 
+   "fieldname": "income_account", 
+   "fieldtype": "Link", 
+   "hidden": 0, 
+   "ignore_user_permissions": 1, 
+   "ignore_xss_filter": 0, 
+   "in_filter": 0, 
+   "in_global_search": 0, 
+   "in_list_view": 0, 
+   "in_standard_filter": 0, 
+   "label": "Default Income Account", 
+   "length": 0, 
+   "no_copy": 0, 
+   "options": "Account", 
+   "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_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "columns": 0,
-   "depends_on": "",
-   "fieldname": "selling_cost_center",
-   "fieldtype": "Link",
-   "hidden": 0,
-   "ignore_user_permissions": 1,
-   "ignore_xss_filter": 0,
-   "in_filter": 0,
-   "in_global_search": 0,
-   "in_list_view": 0,
-   "in_standard_filter": 0,
-   "label": "Default Selling Cost Center",
-   "length": 0,
-   "no_copy": 0,
-   "options": "Cost Center",
-   "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,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "depends_on": "", 
+   "fieldname": "selling_cost_center", 
+   "fieldtype": "Link", 
+   "hidden": 0, 
+   "ignore_user_permissions": 1, 
+   "ignore_xss_filter": 0, 
+   "in_filter": 0, 
+   "in_global_search": 0, 
+   "in_list_view": 0, 
+   "in_standard_filter": 0, 
+   "label": "Default Selling Cost Center", 
+   "length": 0, 
+   "no_copy": 0, 
+   "options": "Cost Center", 
+   "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_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "columns": 0,
-   "depends_on": "",
-   "fieldname": "column_break3",
-   "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": "Customer Item Codes",
-   "length": 0,
-   "no_copy": 0,
-   "oldfieldtype": "Column Break",
-   "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": "", 
+   "fieldname": "column_break3", 
+   "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": "Customer Item Codes", 
+   "length": 0, 
+   "no_copy": 0, 
+   "oldfieldtype": "Column Break", 
+   "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, 
    "width": "50%"
-  },
+  }, 
   {
-   "allow_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "columns": 0,
-   "depends_on": "",
-   "description": "",
-   "fieldname": "customer_items",
-   "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": "Customer Items",
-   "length": 0,
-   "no_copy": 0,
-   "options": "Item Customer Detail",
-   "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,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "depends_on": "", 
+   "description": "", 
+   "fieldname": "customer_items", 
+   "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": "Customer Items", 
+   "length": 0, 
+   "no_copy": 0, 
+   "options": "Item Customer Detail", 
+   "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_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "columns": 0,
-   "depends_on": "",
-   "fieldname": "max_discount",
-   "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": "Max Discount (%)",
-   "length": 0,
-   "no_copy": 0,
-   "oldfieldname": "max_discount",
-   "oldfieldtype": "Currency",
-   "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,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "depends_on": "", 
+   "fieldname": "max_discount", 
+   "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": "Max Discount (%)", 
+   "length": 0, 
+   "no_copy": 0, 
+   "oldfieldname": "max_discount", 
+   "oldfieldtype": "Currency", 
+   "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_on_submit": 0,
-   "bold": 0,
-   "collapsible": 1,
-   "columns": 0,
-   "fieldname": "item_tax_section_break",
-   "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": "Item Tax",
-   "length": 0,
-   "no_copy": 0,
-   "oldfieldtype": "Section Break",
-   "options": "fa fa-money",
-   "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,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 1, 
+   "columns": 0, 
+   "fieldname": "item_tax_section_break", 
+   "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": "Item Tax", 
+   "length": 0, 
+   "no_copy": 0, 
+   "oldfieldtype": "Section Break", 
+   "options": "fa fa-money", 
+   "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_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "columns": 0,
-   "description": "Will also apply for variants",
-   "fieldname": "taxes",
-   "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": "Taxes",
-   "length": 0,
-   "no_copy": 0,
-   "oldfieldname": "item_tax",
-   "oldfieldtype": "Table",
-   "options": "Item Tax",
-   "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,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "description": "Will also apply for variants", 
+   "fieldname": "taxes", 
+   "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": "Taxes", 
+   "length": 0, 
+   "no_copy": 0, 
+   "oldfieldname": "item_tax", 
+   "oldfieldtype": "Table", 
+   "options": "Item Tax", 
+   "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_on_submit": 0,
-   "bold": 0,
-   "collapsible": 1,
-   "columns": 0,
-   "fieldname": "inspection_criteria",
-   "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": "Inspection Criteria",
-   "length": 0,
-   "no_copy": 0,
-   "oldfieldtype": "Section Break",
-   "options": "fa fa-search",
-   "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,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 1, 
+   "columns": 0, 
+   "fieldname": "inspection_criteria", 
+   "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": "Inspection Criteria", 
+   "length": 0, 
+   "no_copy": 0, 
+   "oldfieldtype": "Section Break", 
+   "options": "fa fa-search", 
+   "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_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "columns": 0,
-   "default": "",
-   "fieldname": "inspection_required_before_purchase",
-   "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": "Inspection Required before Purchase",
-   "length": 0,
-   "no_copy": 0,
-   "oldfieldname": "inspection_required",
-   "oldfieldtype": "Select",
-   "options": "",
-   "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,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "default": "", 
+   "fieldname": "inspection_required_before_purchase", 
+   "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": "Inspection Required before Purchase", 
+   "length": 0, 
+   "no_copy": 0, 
+   "oldfieldname": "inspection_required", 
+   "oldfieldtype": "Select", 
+   "options": "", 
+   "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_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "columns": 0,
-   "fieldname": "inspection_required_before_delivery",
-   "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": "Inspection Required before Delivery",
-   "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,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "fieldname": "inspection_required_before_delivery", 
+   "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": "Inspection Required before Delivery", 
+   "length": 0, 
+   "no_copy": 0, 
+   "permlevel": 0, 
+   "precision": "", 
+   "print_hide": 0, 
+   "print_hide_if_no_value": 0, 
+   "read_only": 0, 
+   "remember_last_selected_value": 0, 
+   "report_hide": 0, 
+   "reqd": 0, 
+   "search_index": 0, 
+   "set_only_once": 0, 
    "unique": 0
-  },
+  }, 
   {
-   "allow_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "columns": 0,
-   "depends_on": "eval:(doc.inspection_required_before_purchase || doc.inspection_required_before_delivery)",
-   "description": "Will also apply to variants",
-   "fieldname": "quality_parameters",
-   "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": "Quality Parameters",
-   "length": 0,
-   "no_copy": 0,
-   "oldfieldname": "item_specification_details",
-   "oldfieldtype": "Table",
-   "options": "Item Quality Inspection Parameter",
-   "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,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "depends_on": "eval:(doc.inspection_required_before_purchase || doc.inspection_required_before_delivery)", 
+   "description": "Will also apply to variants", 
+   "fieldname": "quality_parameters", 
+   "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": "Quality Parameters", 
+   "length": 0, 
+   "no_copy": 0, 
+   "oldfieldname": "item_specification_details", 
+   "oldfieldtype": "Table", 
+   "options": "Item Quality Inspection Parameter", 
+   "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_on_submit": 0,
-   "bold": 0,
-   "collapsible": 1,
-   "columns": 0,
-   "depends_on": "is_stock_item",
-   "fieldname": "manufacturing",
-   "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": "Manufacturing",
-   "length": 0,
-   "no_copy": 0,
-   "oldfieldtype": "Section Break",
-   "options": "fa fa-cogs",
-   "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,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 1, 
+   "columns": 0, 
+   "depends_on": "is_stock_item", 
+   "fieldname": "manufacturing", 
+   "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": "Manufacturing", 
+   "length": 0, 
+   "no_copy": 0, 
+   "oldfieldtype": "Section Break", 
+   "options": "fa fa-cogs", 
+   "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_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "columns": 0,
-   "depends_on": "",
-   "fieldname": "default_bom",
-   "fieldtype": "Link",
-   "hidden": 0,
-   "ignore_user_permissions": 1,
-   "ignore_xss_filter": 0,
-   "in_filter": 0,
-   "in_global_search": 0,
-   "in_list_view": 0,
-   "in_standard_filter": 0,
-   "label": "Default BOM",
-   "length": 0,
-   "no_copy": 1,
-   "oldfieldname": "default_bom",
-   "oldfieldtype": "Link",
-   "options": "BOM",
-   "permlevel": 0,
-   "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,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "depends_on": "", 
+   "fieldname": "default_bom", 
+   "fieldtype": "Link", 
+   "hidden": 0, 
+   "ignore_user_permissions": 1, 
+   "ignore_xss_filter": 0, 
+   "in_filter": 0, 
+   "in_global_search": 0, 
+   "in_list_view": 0, 
+   "in_standard_filter": 0, 
+   "label": "Default BOM", 
+   "length": 0, 
+   "no_copy": 1, 
+   "oldfieldname": "default_bom", 
+   "oldfieldtype": "Link", 
+   "options": "BOM", 
+   "permlevel": 0, 
+   "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_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "columns": 0,
-   "default": "",
-   "description": "If subcontracted to a vendor",
-   "fieldname": "is_sub_contracted_item",
-   "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": "Supply Raw Materials for Purchase",
-   "length": 0,
-   "no_copy": 0,
-   "oldfieldname": "is_sub_contracted_item",
-   "oldfieldtype": "Select",
-   "options": "",
-   "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,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "default": "", 
+   "description": "If subcontracted to a vendor", 
+   "fieldname": "is_sub_contracted_item", 
+   "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": "Supply Raw Materials for Purchase", 
+   "length": 0, 
+   "no_copy": 0, 
+   "oldfieldname": "is_sub_contracted_item", 
+   "oldfieldtype": "Select", 
+   "options": "", 
+   "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_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "columns": 0,
-   "fieldname": "column_break_74",
-   "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,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "fieldname": "column_break_74", 
+   "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_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "columns": 0,
-   "fieldname": "customer_code",
-   "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": "Customer Code",
-   "length": 0,
-   "no_copy": 1,
-   "permlevel": 0,
-   "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,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "fieldname": "customer_code", 
+   "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": "Customer Code", 
+   "length": 0, 
+   "no_copy": 1, 
+   "permlevel": 0, 
+   "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_on_submit": 0,
-   "bold": 0,
-   "collapsible": 1,
-   "columns": 0,
-   "fieldname": "website_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": "Website",
-   "length": 0,
-   "no_copy": 0,
-   "options": "fa fa-globe",
-   "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,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 1, 
+   "columns": 0, 
+   "fieldname": "website_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": "Website", 
+   "length": 0, 
+   "no_copy": 0, 
+   "options": "fa fa-globe", 
+   "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_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "columns": 0,
-   "depends_on": "eval:!doc.variant_of",
-   "fieldname": "show_in_website",
-   "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": "Show in Website",
-   "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,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "depends_on": "eval:!doc.variant_of", 
+   "fieldname": "show_in_website", 
+   "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": "Show in Website", 
+   "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_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "columns": 0,
-   "depends_on": "variant_of",
-   "fieldname": "show_variant_in_website",
-   "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": "Show in Website (Variant)",
-   "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,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "depends_on": "variant_of", 
+   "fieldname": "show_variant_in_website", 
+   "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": "Show in Website (Variant)", 
+   "length": 0, 
+   "no_copy": 0, 
+   "permlevel": 0, 
+   "precision": "", 
+   "print_hide": 0, 
+   "print_hide_if_no_value": 0, 
+   "read_only": 0, 
+   "remember_last_selected_value": 0, 
+   "report_hide": 0, 
+   "reqd": 0, 
+   "search_index": 0, 
+   "set_only_once": 0, 
    "unique": 0
-  },
+  }, 
   {
-   "allow_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "columns": 0,
-   "depends_on": "show_in_website",
-   "fieldname": "route",
-   "fieldtype": "Small 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": "Route",
-   "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,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "depends_on": "eval: doc.show_in_website || doc.show_variant_in_website", 
+   "fieldname": "route", 
+   "fieldtype": "Small 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": "Route", 
+   "length": 0, 
+   "no_copy": 0, 
+   "permlevel": 0, 
+   "precision": "", 
+   "print_hide": 0, 
+   "print_hide_if_no_value": 0, 
+   "read_only": 0, 
+   "remember_last_selected_value": 0, 
+   "report_hide": 0, 
+   "reqd": 0, 
+   "search_index": 0, 
+   "set_only_once": 0, 
    "unique": 0
-  },
+  }, 
   {
-   "allow_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "columns": 0,
-   "depends_on": "show_in_website",
-   "description": "Items with higher weightage will be shown higher",
-   "fieldname": "weightage",
-   "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": "Weightage",
-   "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": 1,
-   "set_only_once": 0,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "depends_on": "eval: doc.show_in_website || doc.show_variant_in_website", 
+   "description": "Items with higher weightage will be shown higher", 
+   "fieldname": "weightage", 
+   "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": "Weightage", 
+   "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": 1, 
+   "set_only_once": 0, 
    "unique": 0
-  },
+  }, 
   {
-   "allow_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "columns": 0,
-   "depends_on": "show_in_website",
-   "description": "Show a slideshow at the top of the page",
-   "fieldname": "slideshow",
-   "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": "Slideshow",
-   "length": 0,
-   "no_copy": 0,
-   "options": "Website Slideshow",
-   "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,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "depends_on": "eval: doc.show_in_website || doc.show_variant_in_website", 
+   "description": "Show a slideshow at the top of the page", 
+   "fieldname": "slideshow", 
+   "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": "Slideshow", 
+   "length": 0, 
+   "no_copy": 0, 
+   "options": "Website Slideshow", 
+   "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_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "columns": 0,
-   "depends_on": "show_in_website",
-   "description": "Item Image (if not slideshow)",
-   "fieldname": "website_image",
-   "fieldtype": "Attach",
-   "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": "Image",
-   "length": 0,
-   "no_copy": 0,
-   "options": "",
-   "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,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "depends_on": "eval: doc.show_in_website || doc.show_variant_in_website", 
+   "description": "Item Image (if not slideshow)", 
+   "fieldname": "website_image", 
+   "fieldtype": "Attach", 
+   "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": "Image", 
+   "length": 0, 
+   "no_copy": 0, 
+   "options": "", 
+   "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_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "columns": 0,
-   "fieldname": "thumbnail",
-   "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": "Thumbnail",
-   "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,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "fieldname": "thumbnail", 
+   "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": "Thumbnail", 
+   "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_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "columns": 0,
-   "fieldname": "cb72",
-   "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,
-   "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,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "fieldname": "cb72", 
+   "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, 
+   "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": "show_in_website",
-   "description": "Show \"In Stock\" or \"Not in Stock\" based on stock available in this warehouse.",
-   "fieldname": "website_warehouse",
-   "fieldtype": "Link",
-   "hidden": 0,
-   "ignore_user_permissions": 1,
-   "ignore_xss_filter": 0,
-   "in_filter": 0,
-   "in_global_search": 0,
-   "in_list_view": 0,
-   "in_standard_filter": 0,
-   "label": "Website Warehouse",
-   "length": 0,
-   "no_copy": 0,
-   "options": "Warehouse",
-   "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,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "depends_on": "eval: doc.show_in_website || doc.show_variant_in_website", 
+   "description": "Show \"In Stock\" or \"Not in Stock\" based on stock available in this warehouse.", 
+   "fieldname": "website_warehouse", 
+   "fieldtype": "Link", 
+   "hidden": 0, 
+   "ignore_user_permissions": 1, 
+   "ignore_xss_filter": 0, 
+   "in_filter": 0, 
+   "in_global_search": 0, 
+   "in_list_view": 0, 
+   "in_standard_filter": 0, 
+   "label": "Website Warehouse", 
+   "length": 0, 
+   "no_copy": 0, 
+   "options": "Warehouse", 
+   "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_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "columns": 0,
-   "depends_on": "show_in_website",
-   "description": "List this Item in multiple groups on the website.",
-   "fieldname": "website_item_groups",
-   "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": "Website Item Groups",
-   "length": 0,
-   "no_copy": 0,
-   "options": "Website Item Group",
-   "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,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "depends_on": "eval: doc.show_in_website || doc.show_variant_in_website", 
+   "description": "List this Item in multiple groups on the website.", 
+   "fieldname": "website_item_groups", 
+   "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": "Website Item Groups", 
+   "length": 0, 
+   "no_copy": 0, 
+   "options": "Website Item Group", 
+   "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_on_submit": 0,
-   "bold": 0,
-   "collapsible": 1,
-   "collapsible_depends_on": "website_specifications",
-   "columns": 0,
-   "depends_on": "show_in_website",
-   "fieldname": "sb72",
-   "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": "Website Specifications",
-   "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,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 1, 
+   "collapsible_depends_on": "website_specifications", 
+   "columns": 0, 
+   "depends_on": "eval: doc.show_in_website || doc.show_variant_in_website", 
+   "fieldname": "sb72", 
+   "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": "Website Specifications", 
+   "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_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "columns": 0,
-   "depends_on": "show_in_website",
-   "fieldname": "copy_from_item_group",
-   "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": "Copy From Item Group",
-   "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,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "depends_on": "eval: doc.show_in_website || doc.show_variant_in_website", 
+   "fieldname": "copy_from_item_group", 
+   "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": "Copy From Item Group", 
+   "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_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "columns": 0,
-   "depends_on": "show_in_website",
-   "fieldname": "website_specifications",
-   "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": "Website Specifications",
-   "length": 0,
-   "no_copy": 0,
-   "options": "Item Website Specification",
-   "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,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "depends_on": "eval: doc.show_in_website || doc.show_variant_in_website", 
+   "fieldname": "website_specifications", 
+   "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": "Website Specifications", 
+   "length": 0, 
+   "no_copy": 0, 
+   "options": "Item Website Specification", 
+   "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_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "columns": 0,
-   "depends_on": "show_in_website",
-   "fieldname": "web_long_description",
-   "fieldtype": "Text Editor",
-   "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": "Website Description",
-   "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,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "depends_on": "eval: doc.show_in_website || doc.show_variant_in_website", 
+   "fieldname": "web_long_description", 
+   "fieldtype": "Text Editor", 
+   "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": "Website Description", 
+   "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_on_submit": 0,
-   "bold": 0,
-   "collapsible": 0,
-   "columns": 0,
-   "fieldname": "total_projected_qty",
-   "fieldtype": "Float",
-   "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": "Total Projected Qty",
-   "length": 0,
-   "no_copy": 0,
-   "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,
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "fieldname": "total_projected_qty", 
+   "fieldtype": "Float", 
+   "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": "Total Projected Qty", 
+   "length": 0, 
+   "no_copy": 0, 
+   "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
   }
- ],
- "has_web_view": 0,
- "hide_heading": 0,
- "hide_toolbar": 0,
- "icon": "fa fa-tag",
- "idx": 2,
- "image_field": "image",
- "image_view": 0,
- "in_create": 0,
- "is_submittable": 0,
- "issingle": 0,
- "istable": 0,
- "max_attachments": 1,
- "modified": "2017-03-26 13:47:49.087140",
- "modified_by": "Administrator",
+ ], 
+ "has_web_view": 0, 
+ "hide_heading": 0, 
+ "hide_toolbar": 0, 
+ "icon": "fa fa-tag", 
+ "idx": 2, 
+ "image_field": "image", 
+ "image_view": 0, 
+ "in_create": 0, 
+ "is_submittable": 0, 
+ "issingle": 0, 
+ "istable": 0, 
+ "max_attachments": 1, 
+ "modified": "2017-05-15 11:49:47.525859", 
+ "modified_by": "Administrator", 
  "module": "Stock", 
- "name": "Item",
- "owner": "Administrator",
+ "name": "Item", 
+ "owner": "Administrator", 
  "permissions": [
   {
-   "amend": 0,
-   "apply_user_permissions": 0,
-   "cancel": 0,
-   "create": 1,
-   "delete": 1,
-   "email": 1,
-   "export": 0,
-   "if_owner": 0,
-   "import": 1,
-   "permlevel": 0,
-   "print": 1,
-   "read": 1,
-   "report": 1,
-   "role": "Item Manager",
-   "set_user_permissions": 0,
-   "share": 1,
-   "submit": 0,
+   "amend": 0, 
+   "apply_user_permissions": 0, 
+   "cancel": 0, 
+   "create": 1, 
+   "delete": 1, 
+   "email": 1, 
+   "export": 0, 
+   "if_owner": 0, 
+   "import": 1, 
+   "permlevel": 0, 
+   "print": 1, 
+   "read": 1, 
+   "report": 1, 
+   "role": "Item Manager", 
+   "set_user_permissions": 0, 
+   "share": 1, 
+   "submit": 0, 
    "write": 1
-  },
+  }, 
   {
-   "amend": 0,
-   "apply_user_permissions": 0,
-   "cancel": 0,
-   "create": 0,
-   "delete": 0,
-   "email": 1,
-   "export": 0,
-   "if_owner": 0,
-   "import": 0,
-   "permlevel": 0,
-   "print": 1,
-   "read": 1,
-   "report": 1,
-   "role": "Stock Manager",
-   "set_user_permissions": 0,
-   "share": 0,
-   "submit": 0,
+   "amend": 0, 
+   "apply_user_permissions": 0, 
+   "cancel": 0, 
+   "create": 0, 
+   "delete": 0, 
+   "email": 1, 
+   "export": 0, 
+   "if_owner": 0, 
+   "import": 0, 
+   "permlevel": 0, 
+   "print": 1, 
+   "read": 1, 
+   "report": 1, 
+   "role": "Stock Manager", 
+   "set_user_permissions": 0, 
+   "share": 0, 
+   "submit": 0, 
    "write": 0
-  },
+  }, 
   {
-   "amend": 0,
-   "apply_user_permissions": 0,
-   "cancel": 0,
-   "create": 0,
-   "delete": 0,
-   "email": 1,
-   "export": 0,
-   "if_owner": 0,
-   "import": 0,
-   "permlevel": 0,
-   "print": 1,
-   "read": 1,
-   "report": 1,
-   "role": "Stock User",
-   "set_user_permissions": 0,
-   "share": 0,
-   "submit": 0,
+   "amend": 0, 
+   "apply_user_permissions": 0, 
+   "cancel": 0, 
+   "create": 0, 
+   "delete": 0, 
+   "email": 1, 
+   "export": 0, 
+   "if_owner": 0, 
+   "import": 0, 
+   "permlevel": 0, 
+   "print": 1, 
+   "read": 1, 
+   "report": 1, 
+   "role": "Stock User", 
+   "set_user_permissions": 0, 
+   "share": 0, 
+   "submit": 0, 
    "write": 0
-  },
+  }, 
   {
-   "amend": 0,
-   "apply_user_permissions": 0,
-   "cancel": 0,
-   "create": 0,
-   "delete": 0,
-   "email": 0,
-   "export": 0,
-   "if_owner": 0,
-   "import": 0,
-   "permlevel": 0,
-   "print": 0,
-   "read": 1,
-   "report": 0,
-   "role": "Sales User",
-   "set_user_permissions": 0,
-   "share": 0,
-   "submit": 0,
+   "amend": 0, 
+   "apply_user_permissions": 0, 
+   "cancel": 0, 
+   "create": 0, 
+   "delete": 0, 
+   "email": 0, 
+   "export": 0, 
+   "if_owner": 0, 
+   "import": 0, 
+   "permlevel": 0, 
+   "print": 0, 
+   "read": 1, 
+   "report": 0, 
+   "role": "Sales User", 
+   "set_user_permissions": 0, 
+   "share": 0, 
+   "submit": 0, 
    "write": 0
-  },
+  }, 
   {
-   "amend": 0,
-   "apply_user_permissions": 0,
-   "cancel": 0,
-   "create": 0,
-   "delete": 0,
-   "email": 0,
-   "export": 0,
-   "if_owner": 0,
-   "import": 0,
-   "permlevel": 0,
-   "print": 0,
-   "read": 1,
-   "report": 0,
-   "role": "Purchase User",
-   "set_user_permissions": 0,
-   "share": 0,
-   "submit": 0,
+   "amend": 0, 
+   "apply_user_permissions": 0, 
+   "cancel": 0, 
+   "create": 0, 
+   "delete": 0, 
+   "email": 0, 
+   "export": 0, 
+   "if_owner": 0, 
+   "import": 0, 
+   "permlevel": 0, 
+   "print": 0, 
+   "read": 1, 
+   "report": 0, 
+   "role": "Purchase User", 
+   "set_user_permissions": 0, 
+   "share": 0, 
+   "submit": 0, 
    "write": 0
-  },
+  }, 
   {
-   "amend": 0,
-   "apply_user_permissions": 0,
-   "cancel": 0,
-   "create": 0,
-   "delete": 0,
-   "email": 0,
-   "export": 0,
-   "if_owner": 0,
-   "import": 0,
-   "permlevel": 0,
-   "print": 0,
-   "read": 1,
-   "report": 0,
-   "role": "Maintenance User",
-   "set_user_permissions": 0,
-   "share": 0,
-   "submit": 0,
+   "amend": 0, 
+   "apply_user_permissions": 0, 
+   "cancel": 0, 
+   "create": 0, 
+   "delete": 0, 
+   "email": 0, 
+   "export": 0, 
+   "if_owner": 0, 
+   "import": 0, 
+   "permlevel": 0, 
+   "print": 0, 
+   "read": 1, 
+   "report": 0, 
+   "role": "Maintenance User", 
+   "set_user_permissions": 0, 
+   "share": 0, 
+   "submit": 0, 
    "write": 0
-  },
+  }, 
   {
-   "amend": 0,
-   "apply_user_permissions": 0,
-   "cancel": 0,
-   "create": 0,
-   "delete": 0,
-   "email": 0,
-   "export": 0,
-   "if_owner": 0,
-   "import": 0,
-   "permlevel": 0,
-   "print": 0,
-   "read": 1,
-   "report": 0,
-   "role": "Accounts User",
-   "set_user_permissions": 0,
-   "share": 0,
-   "submit": 0,
+   "amend": 0, 
+   "apply_user_permissions": 0, 
+   "cancel": 0, 
+   "create": 0, 
+   "delete": 0, 
+   "email": 0, 
+   "export": 0, 
+   "if_owner": 0, 
+   "import": 0, 
+   "permlevel": 0, 
+   "print": 0, 
+   "read": 1, 
+   "report": 0, 
+   "role": "Accounts User", 
+   "set_user_permissions": 0, 
+   "share": 0, 
+   "submit": 0, 
    "write": 0
-  },
+  }, 
   {
-   "amend": 0,
-   "apply_user_permissions": 0,
-   "cancel": 0,
-   "create": 0,
-   "delete": 0,
-   "email": 0,
-   "export": 0,
-   "if_owner": 0,
-   "import": 0,
-   "permlevel": 0,
-   "print": 0,
-   "read": 1,
-   "report": 0,
-   "role": "Manufacturing User",
-   "set_user_permissions": 0,
-   "share": 0,
-   "submit": 0,
+   "amend": 0, 
+   "apply_user_permissions": 0, 
+   "cancel": 0, 
+   "create": 0, 
+   "delete": 0, 
+   "email": 0, 
+   "export": 0, 
+   "if_owner": 0, 
+   "import": 0, 
+   "permlevel": 0, 
+   "print": 0, 
+   "read": 1, 
+   "report": 0, 
+   "role": "Manufacturing User", 
+   "set_user_permissions": 0, 
+   "share": 0, 
+   "submit": 0, 
    "write": 0
   }
- ],
- "quick_entry": 1,
- "read_only": 0,
- "read_only_onload": 0,
- "search_fields": "item_name,description,item_group,customer_code",
- "show_name_in_global_search": 1,
- "sort_field": "idx desc, modified desc",
- "sort_order": "DESC",
- "title_field": "item_name",
- "track_changes": 1,
+ ], 
+ "quick_entry": 1, 
+ "read_only": 0, 
+ "read_only_onload": 0, 
+ "search_fields": "item_name,description,item_group,customer_code", 
+ "show_name_in_global_search": 1, 
+ "sort_field": "idx desc, modified desc", 
+ "sort_order": "DESC", 
+ "title_field": "item_name", 
+ "track_changes": 1, 
  "track_seen": 0
-}
+}
\ No newline at end of file
diff --git a/erpnext/stock/doctype/item/item.py b/erpnext/stock/doctype/item/item.py
index 4d0c3ac..ef85dd9 100644
--- a/erpnext/stock/doctype/item/item.py
+++ b/erpnext/stock/doctype/item/item.py
@@ -7,7 +7,8 @@
 import json
 import itertools
 from frappe import msgprint, _
-from frappe.utils import cstr, flt, cint, getdate, now_datetime, formatdate, strip, get_timestamp
+from frappe.utils import (cstr, flt, cint, getdate, now_datetime, formatdate,
+	strip, get_timestamp, random_string)
 from frappe.website.website_generator import WebsiteGenerator
 from erpnext.setup.doctype.item_group.item_group import invalidate_cache_for, get_parent_item_groups
 from frappe.website.render import clear_cache
@@ -85,6 +86,7 @@
 		self.validate_has_variants()
 		self.validate_attributes()
 		self.validate_variant_attributes()
+		self.copy_variant_attributes()
 		self.validate_website_image()
 		self.make_thumbnail()
 		self.validate_fixed_asset()
@@ -142,7 +144,8 @@
 
 	def make_route(self):
 		if not self.route:
-			return cstr(frappe.db.get_value('Item Group', self.item_group, 'route')) + '/' + self.scrub(self.item_name)
+			return cstr(frappe.db.get_value('Item Group', self.item_group,
+				'route')) + '/' + self.scrub(self.item_name + '-' + random_string(5))
 
 	def get_parents(self, context):
 		item_group, route = frappe.db.get_value('Item Group', self.item_group, ['name', 'route'])
@@ -323,7 +326,7 @@
 
 	def set_disabled_attributes(self, context):
 		"""Disable selection options of attribute combinations that do not result in a variant"""
-		if not self.attributes:
+		if not self.attributes or not self.has_variants:
 			return
 
 		context.disabled_attributes = {}
@@ -614,7 +617,9 @@
 				template_item.save()
 
 	def update_variants(self):
-		if self.has_variants and not self.flags.dont_update_variants:
+		if self.flags.dont_update_variants: 
+			return
+		if self.has_variants:
 			updated = []
 			variants = frappe.db.get_all("Item", fields=["item_code"], filters={"variant_of": self.name })
 			for d in variants:
@@ -623,7 +628,7 @@
 				variant.save()
 				updated.append(d.item_code)
 			if updated:
-				frappe.msgprint(_("Item Variants {0} updated").format(", ".join(updated)))
+				frappe.msgprint(_("Item Variants {0} updated").format(", ".join(updated)))			
 
 	def validate_has_variants(self):
 		if not self.has_variants and frappe.db.get_value("Item", self.name, "has_variants"):
@@ -668,6 +673,12 @@
 
 			validate_item_variant_attributes(self, args)
 
+	def copy_variant_attributes(self):
+		'''Copy attributes from template (if they have been changed before saving)'''
+		if self.variant_of:
+			template = frappe.get_doc('Item', self.variant_of)
+			copy_attributes_to_variant(template, self)
+
 def get_timeline_data(doctype, name):
 	'''returns timeline data based on stock ledger entry'''
 	out = {}
diff --git a/erpnext/stock/doctype/item/item_list.js b/erpnext/stock/doctype/item/item_list.js
index 40319e5..cc46177 100644
--- a/erpnext/stock/doctype/item/item_list.js
+++ b/erpnext/stock/doctype/item/item_list.js
@@ -11,7 +11,7 @@
 		} else if (doc.end_of_life && doc.end_of_life < frappe.datetime.get_today()) {
 			return [__("Expired"), "grey", "end_of_life,<,Today"];
 		} else if (doc.has_variants) {
-			return [__("Template"), "blue", "has_variants,=,Yes"];
+			return [__("Template"), "orange", "has_variants,=,Yes"];
 		} else if (doc.variant_of) {
 			return [__("Variant"), "green", "variant_of,=," + doc.variant_of];
 		}
diff --git a/erpnext/stock/doctype/item/test_item.py b/erpnext/stock/doctype/item/test_item.py
index 57805fb..2a8e434 100644
--- a/erpnext/stock/doctype/item/test_item.py
+++ b/erpnext/stock/doctype/item/test_item.py
@@ -217,15 +217,15 @@
 		variant = get_variant(template.name, manufacturer=manufacturer.name)
 		self.assertEquals(variant.item_code, '_Test Variant Mfg-1')
 		self.assertEquals(variant.description, '_Test Variant Mfg')
-		self.assertEquals(variant.get("manufacturers")[0].manufacturer, 'MSG1')
+		self.assertEquals(variant.manufacturer, 'MSG1')
 		variant.insert()
 
 		variant = get_variant(template.name, manufacturer=manufacturer.name,
 			manufacturer_part_no='007')
 		self.assertEquals(variant.item_code, '_Test Variant Mfg-2')
 		self.assertEquals(variant.description, '_Test Variant Mfg')
-		self.assertEquals(variant.get("manufacturers")[0].manufacturer, 'MSG1')
-		self.assertEquals(variant.get("manufacturers")[0].manufacturer_part_no, '007')
+		self.assertEquals(variant.manufacturer, 'MSG1')
+		self.assertEquals(variant.manufacturer_part_no, '007')
 
 
 def make_item_variant():
diff --git a/erpnext/stock/doctype/item/test_records.json b/erpnext/stock/doctype/item/test_records.json
index aad8ed0..2a1520e 100644
--- a/erpnext/stock/doctype/item/test_records.json
+++ b/erpnext/stock/doctype/item/test_records.json
@@ -24,6 +24,16 @@
     "warehouse_reorder_qty": 20
    }
   ],
+  "uoms": [
+    {
+      "uom": "_Test UOM",
+      "conversion_factor": 1.0
+    },
+    {
+      "uom": "_Test UOM 1",
+      "conversion_factor": 10.0
+    }
+  ],
   "stock_uom": "_Test UOM",
   "show_in_website": 1,
   "website_warehouse": "_Test Warehouse - _TC"
diff --git a/erpnext/stock/doctype/item_manufacturer/__init__.py b/erpnext/stock/doctype/item_manufacturer/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/erpnext/stock/doctype/item_manufacturer/__init__.py
+++ /dev/null
diff --git a/erpnext/stock/doctype/item_manufacturer/item_manufacturer.py b/erpnext/stock/doctype/item_manufacturer/item_manufacturer.py
deleted file mode 100644
index 933f7cc..0000000
--- a/erpnext/stock/doctype/item_manufacturer/item_manufacturer.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 ItemManufacturer(Document):
-	pass
diff --git a/erpnext/stock/doctype/material_request/material_request.js b/erpnext/stock/doctype/material_request/material_request.js
index 3a5a351..58c16e1 100644
--- a/erpnext/stock/doctype/material_request/material_request.js
+++ b/erpnext/stock/doctype/material_request/material_request.js
@@ -1,7 +1,7 @@
 // Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
 // License: GNU General Public License v3. See license.txt
 
-{% include 'erpnext/buying/doctype/purchase_common/purchase_common.js' %};
+{% include 'erpnext/public/js/controllers/buying.js' %};
 
 frappe.ui.form.on('Material Request', {
 	setup: function(frm) {
@@ -95,16 +95,19 @@
 		}
 
 		if (this.frm.doc.docstatus===0) {
-			cur_frm.add_custom_button(__('Sales Order'),
+			this.frm.add_custom_button(__('Sales Order'),
 				function() {
 					erpnext.utils.map_current_doc({
 						method: "erpnext.selling.doctype.sales_order.sales_order.make_material_request",
 						source_doctype: "Sales Order",
+						target: me.frm,
+						setters: {
+							company: me.frm.doc.company
+						},
 						get_query_filters: {
 							docstatus: 1,
 							status: ["!=", "Closed"],
 							per_delivered: ["<", 99.99],
-							company: cur_frm.doc.company
 						}
 					})
 				}, __("Get items from"));
diff --git a/erpnext/stock/doctype/material_request/material_request.py b/erpnext/stock/doctype/material_request/material_request.py
index ca25414..82c4c19 100644
--- a/erpnext/stock/doctype/material_request/material_request.py
+++ b/erpnext/stock/doctype/material_request/material_request.py
@@ -13,7 +13,7 @@
 from erpnext.stock.stock_balance import update_bin_qty, get_indented_qty
 from erpnext.controllers.buying_controller import BuyingController
 from erpnext.manufacturing.doctype.production_order.production_order import get_item_details
-
+from erpnext.buying.utils import check_for_closed_status, validate_for_items
 
 form_grid_templates = {
 	"items": "templates/form_grid/material_request_grid.html"
@@ -72,12 +72,9 @@
 		from erpnext.controllers.status_updater import validate_status
 		validate_status(self.status, ["Draft", "Submitted", "Stopped", "Cancelled"])
 
-		pc_obj = frappe.get_doc('Purchase Common')
-		pc_obj.validate_for_items(self)
+		validate_for_items(self)
 
 		# self.set_title()
-
-
 		# self.validate_qty_against_so()
 		# NOTE: Since Item BOM and FG quantities are combined, using current data, it cannot be validated
 		# Though the creation of Material Request from a Production Plan can be rethought to fix this
@@ -112,9 +109,7 @@
 		self.update_requested_qty()
 
 	def on_cancel(self):
-		pc_obj = frappe.get_doc('Purchase Common')
-
-		pc_obj.check_for_closed_status(self.doctype, self.name)
+		check_for_closed_status(self.doctype, self.name)
 
 		self.update_requested_qty()
 
diff --git a/erpnext/stock/doctype/package_code/package_code.json b/erpnext/stock/doctype/package_code/package_code.json
deleted file mode 100644
index 48efbe1..0000000
--- a/erpnext/stock/doctype/package_code/package_code.json
+++ /dev/null
@@ -1,142 +0,0 @@
-{
- "allow_copy": 0, 
- "allow_guest_to_view": 0, 
- "allow_import": 0, 
- "allow_rename": 0, 
- "beta": 0, 
- "creation": "2017-03-23 13:33:14.884692", 
- "custom": 0, 
- "docstatus": 0, 
- "doctype": "DocType", 
- "document_type": "", 
- "editable_grid": 1, 
- "engine": "InnoDB", 
- "fields": [
-  {
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "code", 
-   "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": "Code", 
-   "length": 0, 
-   "no_copy": 0, 
-   "permlevel": 0, 
-   "precision": "", 
-   "print_hide": 0, 
-   "print_hide_if_no_value": 0, 
-   "read_only": 0, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 1, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "unique": 0
-  }, 
-  {
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "description", 
-   "fieldtype": "Small 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": "Description", 
-   "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-03-28 09:09:32.260877", 
- "modified_by": "Administrator", 
- "module": "Stock", 
- "name": "Package Code", 
- "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": "Stock Manager", 
-   "set_user_permissions": 0, 
-   "share": 1, 
-   "submit": 0, 
-   "write": 1
-  }, 
-  {
-   "amend": 0, 
-   "apply_user_permissions": 0, 
-   "cancel": 0, 
-   "create": 1, 
-   "delete": 0, 
-   "email": 1, 
-   "export": 1, 
-   "if_owner": 0, 
-   "import": 0, 
-   "permlevel": 0, 
-   "print": 1, 
-   "read": 1, 
-   "report": 1, 
-   "role": "Stock User", 
-   "set_user_permissions": 0, 
-   "share": 1, 
-   "submit": 0, 
-   "write": 1
-  }
- ], 
- "quick_entry": 1, 
- "read_only": 0, 
- "read_only_onload": 0, 
- "search_fields": "code", 
- "show_name_in_global_search": 0, 
- "sort_field": "modified", 
- "sort_order": "DESC", 
- "title_field": "code", 
- "track_changes": 0, 
- "track_seen": 0
-}
\ No newline at end of file
diff --git a/erpnext/stock/doctype/package_code/test_package_code.py b/erpnext/stock/doctype/package_code/test_package_code.py
deleted file mode 100644
index 0e1b67d..0000000
--- a/erpnext/stock/doctype/package_code/test_package_code.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 TestDevicePackageCode(unittest.TestCase):
-	pass
diff --git a/erpnext/stock/doctype/price_list/price_list.js b/erpnext/stock/doctype/price_list/price_list.js
index 23ac6fd..c362b5a 100644
--- a/erpnext/stock/doctype/price_list/price_list.js
+++ b/erpnext/stock/doctype/price_list/price_list.js
@@ -1,13 +1,14 @@
 // Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
 // License: GNU General Public License v3. See license.txt
 
-$.extend(cur_frm.cscript, {
-	refresh: function() {
-		cur_frm.add_custom_button(__("Add / Edit Prices"), function() {
+frappe.ui.form.on("Price List", {
+	refresh: function(frm) {
+		let me = this;
+		frm.add_custom_button(__("Add / Edit Prices"), function() {
 			frappe.route_options = {
-				"price_list": cur_frm.doc.name
+				"price_list": frm.doc.name
 			};
 			frappe.set_route("Report", "Item Price");
 		}, "fa fa-money");
 	}
-});
+});
\ No newline at end of file
diff --git a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.js b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.js
index f9370b4..5c97e7c 100644
--- a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.js
+++ b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.js
@@ -1,7 +1,7 @@
 // Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
 // License: GNU General Public License v3. See license.txt
 
-{% include 'erpnext/buying/doctype/purchase_common/purchase_common.js' %};
+{% include 'erpnext/public/js/controllers/buying.js' %};
 
 frappe.provide("erpnext.stock");
 
@@ -43,6 +43,7 @@
 	},
 
 	refresh: function() {
+		var me = this;
 		this._super();
 		if(this.frm.doc.docstatus===1) {
 			this.show_stock_ledger();
@@ -53,17 +54,20 @@
 
 		if(!this.frm.doc.is_return && this.frm.doc.status!="Closed") {
 			if(this.frm.doc.docstatus==0) {
-				cur_frm.add_custom_button(__('Purchase Order'),
+				this.frm.add_custom_button(__('Purchase Order'),
 					function() {
 						erpnext.utils.map_current_doc({
 							method: "erpnext.buying.doctype.purchase_order.purchase_order.make_purchase_receipt",
 							source_doctype: "Purchase Order",
+							target: me.frm,
+							setters: {
+								supplier: me.frm.doc.supplier || undefined,
+							},
 							get_query_filters: {
-								supplier: cur_frm.doc.supplier || undefined,
 								docstatus: 1,
 								status: ["!=", "Closed"],
 								per_received: ["<", 99.99],
-								company: cur_frm.doc.company
+								company: me.frm.doc.company
 							}
 						})
 				}, __("Get items from"));
diff --git a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.json b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.json
index 73367e3..e3e106f 100755
--- a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.json
+++ b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.json
@@ -13,6 +13,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, 
@@ -72,6 +74,7 @@
    "width": "50%"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 1, 
    "bold": 0, 
    "collapsible": 0, 
@@ -102,6 +105,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -134,6 +138,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 1, 
    "collapsible": 0, 
@@ -167,6 +172,7 @@
    "width": "150px"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 1, 
    "collapsible": 0, 
@@ -196,6 +202,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -226,36 +233,7 @@
    "width": "50%"
   }, 
   {
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "depends_on": "eval:doc.docstatus==0", 
-   "fieldname": "set_posting_time", 
-   "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": "Edit Posting Date and Time", 
-   "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, 
@@ -290,6 +268,7 @@
    "width": "100px"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -324,6 +303,38 @@
    "width": "100px"
   }, 
   {
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "depends_on": "eval:doc.docstatus==0", 
+   "fieldname": "set_posting_time", 
+   "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": "Edit Posting Date and Time", 
+   "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": 0, 
+   "search_index": 0, 
+   "set_only_once": 0, 
+   "unique": 0
+  }, 
+  {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -352,12 +363,13 @@
    "remember_last_selected_value": 1, 
    "report_hide": 0, 
    "reqd": 1, 
-   "search_index": 1, 
+   "search_index": 0, 
    "set_only_once": 0, 
    "unique": 0, 
    "width": "150px"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -387,6 +399,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -418,6 +431,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 1, 
@@ -447,6 +461,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -476,6 +491,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -505,6 +521,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -534,6 +551,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -562,6 +580,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -590,6 +609,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -618,6 +638,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -646,6 +667,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -677,6 +699,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -706,6 +729,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 1, 
@@ -735,6 +759,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -766,6 +791,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -798,6 +824,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -828,6 +855,7 @@
    "width": "50%"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -857,6 +885,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -887,6 +916,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -917,6 +947,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -945,6 +976,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -975,6 +1007,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1006,6 +1039,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1036,6 +1070,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1064,6 +1099,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1094,6 +1130,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1127,6 +1164,7 @@
    "width": "150px"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1154,6 +1192,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1184,6 +1223,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1215,6 +1255,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1246,6 +1287,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1278,6 +1320,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1309,6 +1352,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1338,6 +1382,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1369,6 +1414,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1400,6 +1446,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1431,6 +1478,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1462,6 +1510,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1491,6 +1540,7 @@
    "width": "50%"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1522,6 +1572,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1553,6 +1604,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1583,6 +1635,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 1, 
@@ -1613,6 +1666,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1644,6 +1698,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1674,6 +1729,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1702,6 +1758,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1731,6 +1788,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1761,6 +1819,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1789,6 +1848,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1820,6 +1880,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1851,6 +1912,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1882,6 +1944,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1910,6 +1973,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1941,6 +2005,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1971,6 +2036,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 1, 
@@ -2002,6 +2068,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2033,6 +2100,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2063,6 +2131,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 1, 
@@ -2095,6 +2164,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2128,6 +2198,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2162,6 +2233,7 @@
    "width": "50px"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2193,6 +2265,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2223,6 +2296,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2253,6 +2327,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 1, 
@@ -2283,6 +2358,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2317,6 +2393,7 @@
    "width": "150px"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2349,6 +2426,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2382,6 +2460,7 @@
    "width": "150px"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2412,6 +2491,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2442,6 +2522,7 @@
    "width": "50%"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2471,6 +2552,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 1, 
@@ -2500,6 +2582,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 1, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2529,6 +2612,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 1, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2560,6 +2644,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2589,6 +2674,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2621,6 +2707,7 @@
    "width": "30%"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2651,6 +2738,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2679,6 +2767,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 1, 
@@ -2709,6 +2798,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2739,6 +2829,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2768,6 +2859,7 @@
    "width": "50%"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2801,6 +2893,7 @@
    "width": "100px"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -2846,7 +2939,7 @@
  "istable": 0, 
  "max_attachments": 0, 
  "menu_index": 0, 
- "modified": "2017-03-14 16:10:58.769483", 
+ "modified": "2017-05-17 10:35:15.908575", 
  "modified_by": "Administrator", 
  "module": "Stock", 
  "name": "Purchase Receipt", 
@@ -2962,6 +3055,6 @@
  "sort_order": "DESC", 
  "timeline_field": "supplier", 
  "title_field": "title", 
- "track_changes": 0, 
+ "track_changes": 1, 
  "track_seen": 0
 }
\ No newline at end of file
diff --git a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py
index b89987c..055b9c4 100644
--- a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py
+++ b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py
@@ -12,6 +12,7 @@
 from erpnext.controllers.buying_controller import BuyingController
 from erpnext.accounts.utils import get_account_currency
 from frappe.desk.notifications import clear_doctype_notifications
+from erpnext.buying.utils import check_for_closed_status, update_last_purchase_rate
 
 form_grid_templates = {
 	"items": "templates/form_grid/item_grid.html"
@@ -49,20 +50,21 @@
 		self.validate_posting_time()
 		super(PurchaseReceipt, self).validate()
 
-		if not self._action=="submit":
+		if self._action=="submit":
+			self.make_batches('warehouse')
+		else:
 			self.set_status()
+
 		self.po_required()
 		self.validate_with_previous_doc()
 		self.validate_uom_is_integer("uom", ["qty", "received_qty"])
 		self.validate_uom_is_integer("stock_uom", "stock_qty")
 
-		pc_obj = frappe.get_doc('Purchase Common')
-		self.check_for_closed_status(pc_obj)
+		self.check_for_closed_status()
 
 		if getdate(self.posting_date) > getdate(nowdate()):
 			throw(_("Posting Date cannot be future date"))
 
-
 	def validate_with_previous_doc(self):
 		super(PurchaseReceipt, self).validate_with_previous_doc({
 			"Purchase Order": {
@@ -98,17 +100,16 @@
 		return po_qty, po_warehouse
 
 	# Check for Closed status
-	def check_for_closed_status(self, pc_obj):
+	def check_for_closed_status(self):
 		check_list =[]
 		for d in self.get('items'):
-			if d.meta.get_field('purchase_order') and d.purchase_order and d.purchase_order not in check_list:
+			if (d.meta.get_field('purchase_order') and d.purchase_order
+				and d.purchase_order not in check_list):
 				check_list.append(d.purchase_order)
-				pc_obj.check_for_closed_status('Purchase Order', d.purchase_order)
+				check_for_closed_status('Purchase Order', d.purchase_order)
 
 	# on submit
 	def on_submit(self):
-		purchase_controller = frappe.get_doc("Purchase Common")
-
 		# Check for Approving Authority
 		frappe.get_doc('Authorization Control').validate_approving_authority(self.doctype,
 			self.company, self.base_grand_total)
@@ -120,7 +121,7 @@
 		self.update_billing_status()
 
 		if not self.is_return:
-			purchase_controller.update_last_purchase_rate(self, 1)
+			update_last_purchase_rate(self, 1)
 
 		# Updating stock ledger should always be called after updating prevdoc status,
 		# because updating ordered qty in bin depends upon updated ordered qty in PO
@@ -140,9 +141,7 @@
 			frappe.throw(_("Purchase Invoice {0} is already submitted").format(self.submit_rv[0][0]))
 
 	def on_cancel(self):
-		pc_obj = frappe.get_doc('Purchase Common')
-
-		self.check_for_closed_status(pc_obj)
+		self.check_for_closed_status()
 		# Check if Purchase Invoice has been submitted against current Purchase Order
 		submitted = frappe.db.sql("""select t1.name
 			from `tabPurchase Invoice` t1,`tabPurchase Invoice Item` t2
@@ -157,7 +156,7 @@
 		self.update_billing_status()
 
 		if not self.is_return:
-			pc_obj.update_last_purchase_rate(self, 0)
+			update_last_purchase_rate(self, 0)
 
 		# Updating stock ledger should always be called after updating prevdoc status,
 		# because updating ordered qty in bin depends upon updated ordered qty in PO
@@ -170,9 +169,6 @@
 				bin = frappe.db.sql("select actual_qty from `tabBin` where item_code = %s and warehouse = %s", (d.rm_item_code, self.supplier_warehouse), as_dict = 1)
 				d.current_stock = bin and flt(bin[0]['actual_qty']) or 0
 
-	def get_rate(self,arg):
-		return frappe.get_doc('Purchase Common').get_rate(arg,self)
-
 	def get_gl_entries(self, warehouse_account=None):
 		from erpnext.accounts.general_ledger import process_gl_map
 
diff --git a/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.json b/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.json
index 5159625..e18e532 100755
--- a/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.json
+++ b/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.json
@@ -1,1995 +1,1996 @@
 {
- "allow_copy": 0, 
- "allow_import": 0, 
- "allow_rename": 0, 
- "autoname": "hash", 
- "beta": 0, 
- "creation": "2013-05-24 19:29:10", 
- "custom": 0, 
- "docstatus": 0, 
- "doctype": "DocType", 
- "document_type": "Document", 
- "editable_grid": 1, 
+ "allow_copy": 0,
+ "allow_guest_to_view": 0,
+ "allow_import": 0,
+ "allow_rename": 0,
+ "autoname": "hash",
+ "beta": 0,
+ "creation": "2013-05-24 19:29:10",
+ "custom": 0,
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Document",
+ "editable_grid": 1,
  "fields": [
   {
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "barcode", 
-   "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": "Barcode", 
-   "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, 
+   "allow_on_submit": 0,
+   "bold": 0,
+   "collapsible": 0,
+   "columns": 0,
+   "fieldname": "barcode",
+   "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": "Barcode",
+   "length": 0,
+   "no_copy": 0,
+   "permlevel": 0,
+   "precision": "",
+   "print_hide": 0,
+   "print_hide_if_no_value": 0,
+   "read_only": 0,
+   "remember_last_selected_value": 0,
+   "report_hide": 0,
+   "reqd": 0,
+   "search_index": 0,
+   "set_only_once": 0,
    "unique": 0
-  }, 
+  },
   {
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "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, 
+   "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,
+   "length": 0,
+   "no_copy": 0,
+   "permlevel": 0,
+   "precision": "",
+   "print_hide": 0,
+   "print_hide_if_no_value": 0,
+   "read_only": 0,
+   "remember_last_selected_value": 0,
+   "report_hide": 0,
+   "reqd": 0,
+   "search_index": 0,
+   "set_only_once": 0,
    "unique": 0
-  }, 
+  },
   {
-   "allow_on_submit": 0, 
-   "bold": 1, 
-   "collapsible": 0, 
-   "columns": 3, 
-   "fieldname": "item_code", 
-   "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": 0, 
-   "label": "Item Code", 
-   "length": 0, 
-   "no_copy": 0, 
-   "oldfieldname": "item_code", 
-   "oldfieldtype": "Link", 
-   "options": "Item", 
-   "permlevel": 0, 
-   "print_hide": 0, 
-   "print_hide_if_no_value": 0, 
-   "print_width": "100px", 
-   "read_only": 0, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 1, 
-   "search_index": 1, 
-   "set_only_once": 0, 
-   "unique": 0, 
+   "allow_on_submit": 0,
+   "bold": 1,
+   "collapsible": 0,
+   "columns": 3,
+   "fieldname": "item_code",
+   "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": 0,
+   "label": "Item Code",
+   "length": 0,
+   "no_copy": 0,
+   "oldfieldname": "item_code",
+   "oldfieldtype": "Link",
+   "options": "Item",
+   "permlevel": 0,
+   "print_hide": 0,
+   "print_hide_if_no_value": 0,
+   "print_width": "100px",
+   "read_only": 0,
+   "remember_last_selected_value": 0,
+   "report_hide": 0,
+   "reqd": 1,
+   "search_index": 1,
+   "set_only_once": 0,
+   "unique": 0,
    "width": "100px"
-  }, 
+  },
   {
-   "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, 
-   "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, 
+   "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,
+   "length": 0,
+   "no_copy": 0,
+   "permlevel": 0,
+   "precision": "",
+   "print_hide": 0,
+   "print_hide_if_no_value": 0,
+   "read_only": 0,
+   "remember_last_selected_value": 0,
+   "report_hide": 0,
+   "reqd": 0,
+   "search_index": 0,
+   "set_only_once": 0,
    "unique": 0
-  }, 
+  },
   {
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "item_name", 
-   "fieldtype": "Data", 
-   "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": "Item Name", 
-   "length": 0, 
-   "no_copy": 0, 
-   "oldfieldname": "item_name", 
-   "oldfieldtype": "Data", 
-   "permlevel": 0, 
-   "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, 
+   "allow_on_submit": 0,
+   "bold": 0,
+   "collapsible": 0,
+   "columns": 0,
+   "fieldname": "item_name",
+   "fieldtype": "Data",
+   "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": "Item Name",
+   "length": 0,
+   "no_copy": 0,
+   "oldfieldname": "item_name",
+   "oldfieldtype": "Data",
+   "permlevel": 0,
+   "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_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 1, 
-   "columns": 0, 
-   "fieldname": "section_break_4", 
-   "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": "Description", 
-   "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, 
+   "allow_on_submit": 0,
+   "bold": 0,
+   "collapsible": 1,
+   "columns": 0,
+   "fieldname": "section_break_4",
+   "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": "Description",
+   "length": 0,
+   "no_copy": 0,
+   "permlevel": 0,
+   "precision": "",
+   "print_hide": 0,
+   "print_hide_if_no_value": 0,
+   "read_only": 0,
+   "remember_last_selected_value": 0,
+   "report_hide": 0,
+   "reqd": 0,
+   "search_index": 0,
+   "set_only_once": 0,
    "unique": 0
-  }, 
+  },
   {
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "description", 
-   "fieldtype": "Text Editor", 
-   "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": "Description", 
-   "length": 0, 
-   "no_copy": 0, 
-   "oldfieldname": "description", 
-   "oldfieldtype": "Text", 
-   "permlevel": 0, 
-   "print_hide": 0, 
-   "print_hide_if_no_value": 0, 
-   "print_width": "300px", 
-   "read_only": 0, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 1, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "unique": 0, 
+   "allow_on_submit": 0,
+   "bold": 0,
+   "collapsible": 0,
+   "columns": 0,
+   "fieldname": "description",
+   "fieldtype": "Text Editor",
+   "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": "Description",
+   "length": 0,
+   "no_copy": 0,
+   "oldfieldname": "description",
+   "oldfieldtype": "Text",
+   "permlevel": 0,
+   "print_hide": 0,
+   "print_hide_if_no_value": 0,
+   "print_width": "300px",
+   "read_only": 0,
+   "remember_last_selected_value": 0,
+   "report_hide": 0,
+   "reqd": 1,
+   "search_index": 0,
+   "set_only_once": 0,
+   "unique": 0,
    "width": "300px"
-  }, 
+  },
   {
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "col_break1", 
-   "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, 
-   "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, 
+   "allow_on_submit": 0,
+   "bold": 0,
+   "collapsible": 0,
+   "columns": 0,
+   "fieldname": "col_break1",
+   "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,
+   "print_hide": 0,
+   "print_hide_if_no_value": 0,
+   "read_only": 0,
+   "remember_last_selected_value": 0,
+   "report_hide": 0,
+   "reqd": 0,
+   "search_index": 0,
+   "set_only_once": 0,
    "unique": 0
-  }, 
+  },
   {
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "image", 
-   "fieldtype": "Attach", 
-   "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": 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, 
+   "allow_on_submit": 0,
+   "bold": 0,
+   "collapsible": 0,
+   "columns": 0,
+   "fieldname": "image",
+   "fieldtype": "Attach",
+   "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": 0,
+   "permlevel": 0,
+   "precision": "",
+   "print_hide": 0,
+   "print_hide_if_no_value": 0,
+   "read_only": 0,
+   "remember_last_selected_value": 0,
+   "report_hide": 0,
+   "reqd": 0,
+   "search_index": 0,
+   "set_only_once": 0,
    "unique": 0
-  }, 
+  },
   {
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "image_view", 
-   "fieldtype": "Image", 
-   "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": "Image View", 
-   "length": 0, 
-   "no_copy": 0, 
-   "options": "image", 
-   "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, 
+   "allow_on_submit": 0,
+   "bold": 0,
+   "collapsible": 0,
+   "columns": 0,
+   "fieldname": "image_view",
+   "fieldtype": "Image",
+   "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": "Image View",
+   "length": 0,
+   "no_copy": 0,
+   "options": "image",
+   "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_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "received_and_accepted", 
-   "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": "Received and Accepted", 
-   "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, 
+   "allow_on_submit": 0,
+   "bold": 0,
+   "collapsible": 0,
+   "columns": 0,
+   "fieldname": "received_and_accepted",
+   "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": "Received and Accepted",
+   "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_on_submit": 0, 
-   "bold": 1, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "received_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": "Recd Quantity", 
-   "length": 0, 
-   "no_copy": 0, 
-   "oldfieldname": "received_qty", 
-   "oldfieldtype": "Currency", 
-   "permlevel": 0, 
-   "print_hide": 1, 
-   "print_hide_if_no_value": 0, 
-   "print_width": "100px", 
-   "read_only": 0, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 1, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "unique": 0, 
+   "allow_on_submit": 0,
+   "bold": 1,
+   "collapsible": 0,
+   "columns": 0,
+   "fieldname": "received_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": "Recd Quantity",
+   "length": 0,
+   "no_copy": 0,
+   "oldfieldname": "received_qty",
+   "oldfieldtype": "Currency",
+   "permlevel": 0,
+   "print_hide": 1,
+   "print_hide_if_no_value": 0,
+   "print_width": "100px",
+   "read_only": 0,
+   "remember_last_selected_value": 0,
+   "report_hide": 0,
+   "reqd": 1,
+   "search_index": 0,
+   "set_only_once": 0,
+   "unique": 0,
    "width": "100px"
-  }, 
+  },
   {
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 2, 
-   "fieldname": "qty", 
-   "fieldtype": "Float", 
-   "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": "Accepted Quantity", 
-   "length": 0, 
-   "no_copy": 0, 
-   "oldfieldname": "qty", 
-   "oldfieldtype": "Currency", 
-   "permlevel": 0, 
-   "print_hide": 0, 
-   "print_hide_if_no_value": 0, 
-   "print_width": "100px", 
-   "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": 2,
+   "fieldname": "qty",
+   "fieldtype": "Float",
+   "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": "Accepted Quantity",
+   "length": 0,
+   "no_copy": 0,
+   "oldfieldname": "qty",
+   "oldfieldtype": "Currency",
+   "permlevel": 0,
+   "print_hide": 0,
+   "print_hide_if_no_value": 0,
+   "print_width": "100px",
+   "read_only": 0,
+   "remember_last_selected_value": 0,
+   "report_hide": 0,
+   "reqd": 0,
+   "search_index": 0,
+   "set_only_once": 0,
+   "unique": 0,
    "width": "100px"
-  }, 
+  },
   {
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "rejected_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": "Rejected Quantity", 
-   "length": 0, 
-   "no_copy": 0, 
-   "oldfieldname": "rejected_qty", 
-   "oldfieldtype": "Currency", 
-   "permlevel": 0, 
-   "print_hide": 1, 
-   "print_hide_if_no_value": 0, 
-   "print_width": "100px", 
-   "read_only": 0, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 0, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "unique": 0, 
+   "allow_on_submit": 0,
+   "bold": 0,
+   "collapsible": 0,
+   "columns": 0,
+   "fieldname": "rejected_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": "Rejected Quantity",
+   "length": 0,
+   "no_copy": 0,
+   "oldfieldname": "rejected_qty",
+   "oldfieldtype": "Currency",
+   "permlevel": 0,
+   "print_hide": 1,
+   "print_hide_if_no_value": 0,
+   "print_width": "100px",
+   "read_only": 0,
+   "remember_last_selected_value": 0,
+   "report_hide": 0,
+   "reqd": 0,
+   "search_index": 0,
+   "set_only_once": 0,
+   "unique": 0,
    "width": "100px"
-  }, 
+  },
   {
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "col_break2", 
-   "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, 
-   "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, 
+   "allow_on_submit": 0,
+   "bold": 0,
+   "collapsible": 0,
+   "columns": 0,
+   "fieldname": "col_break2",
+   "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,
+   "print_hide": 0,
+   "print_hide_if_no_value": 0,
+   "read_only": 0,
+   "remember_last_selected_value": 0,
+   "report_hide": 0,
+   "reqd": 0,
+   "search_index": 0,
+   "set_only_once": 0,
    "unique": 0
-  }, 
+  },
   {
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "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": 1, 
-   "print_hide_if_no_value": 0, 
-   "print_width": "100px", 
-   "read_only": 0, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 1, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "unique": 0, 
+   "allow_on_submit": 0,
+   "bold": 0,
+   "collapsible": 0,
+   "columns": 0,
+   "fieldname": "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": 1,
+   "print_hide_if_no_value": 0,
+   "print_width": "100px",
+   "read_only": 0,
+   "remember_last_selected_value": 0,
+   "report_hide": 0,
+   "reqd": 1,
+   "search_index": 0,
+   "set_only_once": 0,
+   "unique": 0,
    "width": "100px"
-  }, 
+  },
   {
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "stock_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": "Stock UOM", 
-   "length": 0, 
-   "no_copy": 0, 
-   "oldfieldname": "stock_uom", 
-   "oldfieldtype": "Data", 
-   "options": "UOM", 
-   "permlevel": 0, 
-   "print_hide": 1, 
-   "print_hide_if_no_value": 0, 
-   "print_width": "100px", 
-   "read_only": 1, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 1, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "unique": 0, 
+   "allow_on_submit": 0,
+   "bold": 0,
+   "collapsible": 0,
+   "columns": 0,
+   "fieldname": "stock_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": "Stock UOM",
+   "length": 0,
+   "no_copy": 0,
+   "oldfieldname": "stock_uom",
+   "oldfieldtype": "Data",
+   "options": "UOM",
+   "permlevel": 0,
+   "print_hide": 1,
+   "print_hide_if_no_value": 0,
+   "print_width": "100px",
+   "read_only": 1,
+   "remember_last_selected_value": 0,
+   "report_hide": 0,
+   "reqd": 1,
+   "search_index": 0,
+   "set_only_once": 0,
+   "unique": 0,
    "width": "100px"
-  }, 
+  },
   {
-   "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": "Conversion Factor", 
-   "length": 0, 
-   "no_copy": 0, 
-   "oldfieldname": "conversion_factor", 
-   "oldfieldtype": "Currency", 
-   "permlevel": 0, 
-   "print_hide": 1, 
-   "print_hide_if_no_value": 0, 
-   "print_width": "100px", 
-   "read_only": 0, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 1, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "unique": 0, 
+   "allow_on_submit": 0,
+   "bold": 0,
+   "collapsible": 0,
+   "columns": 0,
+   "fieldname": "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": "Conversion Factor",
+   "length": 0,
+   "no_copy": 0,
+   "oldfieldname": "conversion_factor",
+   "oldfieldtype": "Currency",
+   "permlevel": 0,
+   "print_hide": 1,
+   "print_hide_if_no_value": 0,
+   "print_width": "100px",
+   "read_only": 0,
+   "remember_last_selected_value": 0,
+   "report_hide": 0,
+   "reqd": 1,
+   "search_index": 0,
+   "set_only_once": 0,
+   "unique": 0,
    "width": "100px"
-  }, 
+  },
   {
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "rate_and_amount", 
-   "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": "Rate and Amount", 
-   "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, 
+   "allow_on_submit": 0,
+   "bold": 0,
+   "collapsible": 0,
+   "columns": 0,
+   "fieldname": "rate_and_amount",
+   "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": "Rate and Amount",
+   "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_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "price_list_rate", 
-   "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": "Price List Rate", 
-   "length": 0, 
-   "no_copy": 0, 
-   "options": "currency", 
-   "permlevel": 0, 
-   "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, 
+   "allow_on_submit": 0,
+   "bold": 0,
+   "collapsible": 0,
+   "columns": 0,
+   "fieldname": "price_list_rate",
+   "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": "Price List Rate",
+   "length": 0,
+   "no_copy": 0,
+   "options": "currency",
+   "permlevel": 0,
+   "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_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "depends_on": "price_list_rate", 
-   "fieldname": "discount_percentage", 
-   "fieldtype": "Percent", 
-   "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": "Discount on Price List Rate (%)", 
-   "length": 0, 
-   "no_copy": 0, 
-   "permlevel": 0, 
-   "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, 
+   "allow_on_submit": 0,
+   "bold": 0,
+   "collapsible": 0,
+   "columns": 0,
+   "depends_on": "price_list_rate",
+   "fieldname": "discount_percentage",
+   "fieldtype": "Percent",
+   "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": "Discount on Price List Rate (%)",
+   "length": 0,
+   "no_copy": 0,
+   "permlevel": 0,
+   "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_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "col_break3", 
-   "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, 
-   "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, 
+   "allow_on_submit": 0,
+   "bold": 0,
+   "collapsible": 0,
+   "columns": 0,
+   "fieldname": "col_break3",
+   "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,
+   "print_hide": 0,
+   "print_hide_if_no_value": 0,
+   "read_only": 0,
+   "remember_last_selected_value": 0,
+   "report_hide": 0,
+   "reqd": 0,
+   "search_index": 0,
+   "set_only_once": 0,
    "unique": 0
-  }, 
+  },
   {
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "base_price_list_rate", 
-   "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": "Price List Rate (Company Currency)", 
-   "length": 0, 
-   "no_copy": 0, 
-   "options": "Company:company:default_currency", 
-   "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, 
+   "allow_on_submit": 0,
+   "bold": 0,
+   "collapsible": 0,
+   "columns": 0,
+   "fieldname": "base_price_list_rate",
+   "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": "Price List Rate (Company Currency)",
+   "length": 0,
+   "no_copy": 0,
+   "options": "Company:company:default_currency",
+   "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
-  }, 
+  },
   {
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "sec_break1", 
-   "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, 
-   "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, 
+   "allow_on_submit": 0,
+   "bold": 0,
+   "collapsible": 0,
+   "columns": 0,
+   "fieldname": "sec_break1",
+   "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,
+   "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": 1, 
-   "collapsible": 0, 
-   "columns": 3, 
-   "fieldname": "rate", 
-   "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": "Rate", 
-   "length": 0, 
-   "no_copy": 0, 
-   "oldfieldname": "import_rate", 
-   "oldfieldtype": "Currency", 
-   "options": "currency", 
-   "permlevel": 0, 
-   "print_hide": 0, 
-   "print_hide_if_no_value": 0, 
-   "print_width": "100px", 
-   "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": 1,
+   "collapsible": 0,
+   "columns": 3,
+   "fieldname": "rate",
+   "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": "Rate",
+   "length": 0,
+   "no_copy": 0,
+   "oldfieldname": "import_rate",
+   "oldfieldtype": "Currency",
+   "options": "currency",
+   "permlevel": 0,
+   "print_hide": 0,
+   "print_hide_if_no_value": 0,
+   "print_width": "100px",
+   "read_only": 0,
+   "remember_last_selected_value": 0,
+   "report_hide": 0,
+   "reqd": 0,
+   "search_index": 0,
+   "set_only_once": 0,
+   "unique": 0,
    "width": "100px"
-  }, 
+  },
   {
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "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": "Amount", 
-   "length": 0, 
-   "no_copy": 0, 
-   "oldfieldname": "import_amount", 
-   "oldfieldtype": "Currency", 
-   "options": "currency", 
-   "permlevel": 0, 
-   "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, 
+   "allow_on_submit": 0,
+   "bold": 0,
+   "collapsible": 0,
+   "columns": 0,
+   "fieldname": "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": "Amount",
+   "length": 0,
+   "no_copy": 0,
+   "oldfieldname": "import_amount",
+   "oldfieldtype": "Currency",
+   "options": "currency",
+   "permlevel": 0,
+   "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_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "col_break4", 
-   "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, 
-   "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, 
+   "allow_on_submit": 0,
+   "bold": 0,
+   "collapsible": 0,
+   "columns": 0,
+   "fieldname": "col_break4",
+   "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,
+   "print_hide": 0,
+   "print_hide_if_no_value": 0,
+   "read_only": 0,
+   "remember_last_selected_value": 0,
+   "report_hide": 0,
+   "reqd": 0,
+   "search_index": 0,
+   "set_only_once": 0,
    "unique": 0
-  }, 
+  },
   {
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "base_rate", 
-   "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": "Rate (Company Currency)", 
-   "length": 0, 
-   "no_copy": 0, 
-   "oldfieldname": "purchase_rate", 
-   "oldfieldtype": "Currency", 
-   "options": "Company:company:default_currency", 
-   "permlevel": 0, 
-   "print_hide": 1, 
-   "print_hide_if_no_value": 0, 
-   "print_width": "100px", 
-   "read_only": 1, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 1, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "unique": 0, 
+   "allow_on_submit": 0,
+   "bold": 0,
+   "collapsible": 0,
+   "columns": 0,
+   "fieldname": "base_rate",
+   "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": "Rate (Company Currency)",
+   "length": 0,
+   "no_copy": 0,
+   "oldfieldname": "purchase_rate",
+   "oldfieldtype": "Currency",
+   "options": "Company:company:default_currency",
+   "permlevel": 0,
+   "print_hide": 1,
+   "print_hide_if_no_value": 0,
+   "print_width": "100px",
+   "read_only": 1,
+   "remember_last_selected_value": 0,
+   "report_hide": 0,
+   "reqd": 1,
+   "search_index": 0,
+   "set_only_once": 0,
+   "unique": 0,
    "width": "100px"
-  }, 
+  },
   {
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "base_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": "Amount (Company Currency)", 
-   "length": 0, 
-   "no_copy": 0, 
-   "oldfieldname": "amount", 
-   "oldfieldtype": "Currency", 
-   "options": "Company:company:default_currency", 
-   "permlevel": 0, 
-   "print_hide": 1, 
-   "print_hide_if_no_value": 0, 
-   "print_width": "100px", 
-   "read_only": 1, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 0, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "unique": 0, 
+   "allow_on_submit": 0,
+   "bold": 0,
+   "collapsible": 0,
+   "columns": 0,
+   "fieldname": "base_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": "Amount (Company Currency)",
+   "length": 0,
+   "no_copy": 0,
+   "oldfieldname": "amount",
+   "oldfieldtype": "Currency",
+   "options": "Company:company:default_currency",
+   "permlevel": 0,
+   "print_hide": 1,
+   "print_hide_if_no_value": 0,
+   "print_width": "100px",
+   "read_only": 1,
+   "remember_last_selected_value": 0,
+   "report_hide": 0,
+   "reqd": 0,
+   "search_index": 0,
+   "set_only_once": 0,
+   "unique": 0,
    "width": "100px"
-  }, 
+  },
   {
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "pricing_rule", 
-   "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": "Pricing Rule", 
-   "length": 0, 
-   "no_copy": 0, 
-   "options": "Pricing Rule", 
-   "permlevel": 0, 
-   "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, 
+   "allow_on_submit": 0,
+   "bold": 0,
+   "collapsible": 0,
+   "columns": 0,
+   "fieldname": "pricing_rule",
+   "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": "Pricing Rule",
+   "length": 0,
+   "no_copy": 0,
+   "options": "Pricing Rule",
+   "permlevel": 0,
+   "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_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "section_break_29", 
-   "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, 
+   "allow_on_submit": 0,
+   "bold": 0,
+   "collapsible": 0,
+   "columns": 0,
+   "fieldname": "section_break_29",
+   "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_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "net_rate", 
-   "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": "Net Rate", 
-   "length": 0, 
-   "no_copy": 0, 
-   "options": "currency", 
-   "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, 
+   "allow_on_submit": 0,
+   "bold": 0,
+   "collapsible": 0,
+   "columns": 0,
+   "fieldname": "net_rate",
+   "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": "Net Rate",
+   "length": 0,
+   "no_copy": 0,
+   "options": "currency",
+   "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_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 2, 
-   "fieldname": "net_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": "Net Amount", 
-   "length": 0, 
-   "no_copy": 0, 
-   "options": "currency", 
-   "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, 
+   "allow_on_submit": 0,
+   "bold": 0,
+   "collapsible": 0,
+   "columns": 2,
+   "fieldname": "net_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": "Net Amount",
+   "length": 0,
+   "no_copy": 0,
+   "options": "currency",
+   "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_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "column_break_32", 
-   "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, 
+   "allow_on_submit": 0,
+   "bold": 0,
+   "collapsible": 0,
+   "columns": 0,
+   "fieldname": "column_break_32",
+   "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_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "base_net_rate", 
-   "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": "Net Rate (Company Currency)", 
-   "length": 0, 
-   "no_copy": 0, 
-   "options": "Company:company:default_currency", 
-   "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, 
+   "allow_on_submit": 0,
+   "bold": 0,
+   "collapsible": 0,
+   "columns": 0,
+   "fieldname": "base_net_rate",
+   "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": "Net Rate (Company Currency)",
+   "length": 0,
+   "no_copy": 0,
+   "options": "Company:company:default_currency",
+   "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_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "base_net_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": "Net Amount (Company Currency)", 
-   "length": 0, 
-   "no_copy": 0, 
-   "options": "Company:company:default_currency", 
-   "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, 
+   "allow_on_submit": 0,
+   "bold": 0,
+   "collapsible": 0,
+   "columns": 0,
+   "fieldname": "base_net_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": "Net Amount (Company Currency)",
+   "length": 0,
+   "no_copy": 0,
+   "options": "Company:company:default_currency",
+   "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_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "warehouse_and_reference", 
-   "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": "Warehouse and Reference", 
-   "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, 
+   "allow_on_submit": 0,
+   "bold": 0,
+   "collapsible": 0,
+   "columns": 0,
+   "fieldname": "warehouse_and_reference",
+   "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": "Warehouse and Reference",
+   "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_on_submit": 0, 
-   "bold": 1, 
-   "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": 1, 
-   "in_standard_filter": 0, 
-   "label": "Accepted Warehouse", 
-   "length": 0, 
-   "no_copy": 0, 
-   "oldfieldname": "warehouse", 
-   "oldfieldtype": "Link", 
-   "options": "Warehouse", 
-   "permlevel": 0, 
-   "print_hide": 1, 
-   "print_hide_if_no_value": 0, 
-   "print_width": "100px", 
-   "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": 1,
+   "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": 1,
+   "in_standard_filter": 0,
+   "label": "Accepted Warehouse",
+   "length": 0,
+   "no_copy": 0,
+   "oldfieldname": "warehouse",
+   "oldfieldtype": "Link",
+   "options": "Warehouse",
+   "permlevel": 0,
+   "print_hide": 1,
+   "print_hide_if_no_value": 0,
+   "print_width": "100px",
+   "read_only": 0,
+   "remember_last_selected_value": 0,
+   "report_hide": 0,
+   "reqd": 0,
+   "search_index": 0,
+   "set_only_once": 0,
+   "unique": 0,
    "width": "100px"
-  }, 
+  },
   {
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "rejected_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": 0, 
-   "label": "Rejected Warehouse", 
-   "length": 0, 
-   "no_copy": 1, 
-   "oldfieldname": "rejected_warehouse", 
-   "oldfieldtype": "Link", 
-   "options": "Warehouse", 
-   "permlevel": 0, 
-   "print_hide": 1, 
-   "print_hide_if_no_value": 0, 
-   "print_width": "100px", 
-   "read_only": 0, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 0, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "unique": 0, 
+   "allow_on_submit": 0,
+   "bold": 0,
+   "collapsible": 0,
+   "columns": 0,
+   "fieldname": "rejected_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": 0,
+   "label": "Rejected Warehouse",
+   "length": 0,
+   "no_copy": 1,
+   "oldfieldname": "rejected_warehouse",
+   "oldfieldtype": "Link",
+   "options": "Warehouse",
+   "permlevel": 0,
+   "print_hide": 1,
+   "print_hide_if_no_value": 0,
+   "print_width": "100px",
+   "read_only": 0,
+   "remember_last_selected_value": 0,
+   "report_hide": 0,
+   "reqd": 0,
+   "search_index": 0,
+   "set_only_once": 0,
+   "unique": 0,
    "width": "100px"
-  }, 
+  },
   {
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "depends_on": "eval:!doc.__islocal", 
-   "fieldname": "quality_inspection", 
-   "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": "Quality Inspection", 
-   "length": 0, 
-   "no_copy": 1, 
-   "oldfieldname": "qa_no", 
-   "oldfieldtype": "Link", 
-   "options": "Quality Inspection", 
-   "permlevel": 0, 
-   "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, 
+   "allow_on_submit": 0,
+   "bold": 0,
+   "collapsible": 0,
+   "columns": 0,
+   "depends_on": "eval:!doc.__islocal",
+   "fieldname": "quality_inspection",
+   "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": "Quality Inspection",
+   "length": 0,
+   "no_copy": 1,
+   "oldfieldname": "qa_no",
+   "oldfieldtype": "Link",
+   "options": "Quality Inspection",
+   "permlevel": 0,
+   "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_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "column_break_40", 
-   "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, 
+   "allow_on_submit": 0,
+   "bold": 0,
+   "collapsible": 0,
+   "columns": 0,
+   "fieldname": "column_break_40",
+   "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_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "purchase_order", 
-   "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 Order", 
-   "length": 0, 
-   "no_copy": 1, 
-   "oldfieldname": "prevdoc_docname", 
-   "oldfieldtype": "Link", 
-   "options": "Purchase Order", 
-   "permlevel": 0, 
-   "print_hide": 1, 
-   "print_hide_if_no_value": 0, 
-   "print_width": "150px", 
-   "read_only": 1, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 0, 
-   "search_index": 1, 
-   "set_only_once": 0, 
-   "unique": 0, 
+   "allow_on_submit": 0,
+   "bold": 0,
+   "collapsible": 0,
+   "columns": 0,
+   "fieldname": "purchase_order",
+   "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 Order",
+   "length": 0,
+   "no_copy": 1,
+   "oldfieldname": "prevdoc_docname",
+   "oldfieldtype": "Link",
+   "options": "Purchase Order",
+   "permlevel": 0,
+   "print_hide": 1,
+   "print_hide_if_no_value": 0,
+   "print_width": "150px",
+   "read_only": 1,
+   "remember_last_selected_value": 0,
+   "report_hide": 0,
+   "reqd": 0,
+   "search_index": 1,
+   "set_only_once": 0,
+   "unique": 0,
    "width": "150px"
-  }, 
+  },
   {
-   "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": 0, 
-   "in_standard_filter": 0, 
-   "label": "Required By", 
-   "length": 0, 
-   "no_copy": 0, 
-   "oldfieldname": "schedule_date", 
-   "oldfieldtype": "Date", 
-   "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, 
+   "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": 0,
+   "in_standard_filter": 0,
+   "label": "Required By",
+   "length": 0,
+   "no_copy": 0,
+   "oldfieldname": "schedule_date",
+   "oldfieldtype": "Date",
+   "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
-  }, 
+  },
   {
-   "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": "Qty as per Stock UOM", 
-   "length": 0, 
-   "no_copy": 0, 
-   "oldfieldname": "stock_qty", 
-   "oldfieldtype": "Currency", 
-   "permlevel": 0, 
-   "print_hide": 1, 
-   "print_hide_if_no_value": 0, 
-   "print_width": "100px", 
-   "read_only": 1, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 0, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "unique": 0, 
+   "allow_on_submit": 0,
+   "bold": 0,
+   "collapsible": 0,
+   "columns": 0,
+   "fieldname": "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": "Qty as per Stock UOM",
+   "length": 0,
+   "no_copy": 0,
+   "oldfieldname": "stock_qty",
+   "oldfieldtype": "Currency",
+   "permlevel": 0,
+   "print_hide": 1,
+   "print_hide_if_no_value": 0,
+   "print_width": "100px",
+   "read_only": 1,
+   "remember_last_selected_value": 0,
+   "report_hide": 0,
+   "reqd": 0,
+   "search_index": 0,
+   "set_only_once": 0,
+   "unique": 0,
    "width": "100px"
-  }, 
+  },
   {
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "section_break_45", 
-   "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, 
+   "allow_on_submit": 0,
+   "bold": 0,
+   "collapsible": 0,
+   "columns": 0,
+   "fieldname": "section_break_45",
+   "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_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "serial_no", 
-   "fieldtype": "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": "Serial No", 
-   "length": 0, 
-   "no_copy": 1, 
-   "oldfieldname": "serial_no", 
-   "oldfieldtype": "Text", 
-   "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, 
+   "allow_on_submit": 0,
+   "bold": 0,
+   "collapsible": 0,
+   "columns": 0,
+   "fieldname": "serial_no",
+   "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": "Serial No",
+   "length": 0,
+   "no_copy": 1,
+   "oldfieldname": "serial_no",
+   "oldfieldtype": "Text",
+   "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_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "batch_no", 
-   "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": "Batch No", 
-   "length": 0, 
-   "no_copy": 0, 
-   "oldfieldname": "batch_no", 
-   "oldfieldtype": "Link", 
-   "options": "Batch", 
-   "permlevel": 0, 
-   "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, 
+   "allow_on_submit": 0,
+   "bold": 0,
+   "collapsible": 0,
+   "columns": 0,
+   "fieldname": "batch_no",
+   "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": "Batch No",
+   "length": 0,
+   "no_copy": 0,
+   "oldfieldname": "batch_no",
+   "oldfieldtype": "Link",
+   "options": "Batch",
+   "permlevel": 0,
+   "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_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "column_break_48", 
-   "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, 
+   "allow_on_submit": 0,
+   "bold": 0,
+   "collapsible": 0,
+   "columns": 0,
+   "fieldname": "column_break_48",
+   "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_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "rejected_serial_no", 
-   "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": "Rejected Serial No", 
-   "length": 0, 
-   "no_copy": 1, 
-   "permlevel": 0, 
-   "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, 
+   "allow_on_submit": 0,
+   "bold": 0,
+   "collapsible": 0,
+   "columns": 0,
+   "fieldname": "rejected_serial_no",
+   "fieldtype": "Small 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": "Rejected Serial No",
+   "length": 0,
+   "no_copy": 1,
+   "permlevel": 0,
+   "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_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "section_break_50", 
-   "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, 
+   "allow_on_submit": 0,
+   "bold": 0,
+   "collapsible": 0,
+   "columns": 0,
+   "fieldname": "section_break_50",
+   "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_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "project", 
-   "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": "Project", 
-   "length": 0, 
-   "no_copy": 0, 
-   "options": "Project", 
-   "permlevel": 0, 
-   "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, 
+   "allow_on_submit": 0,
+   "bold": 0,
+   "collapsible": 0,
+   "columns": 0,
+   "fieldname": "project",
+   "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": "Project",
+   "length": 0,
+   "no_copy": 0,
+   "options": "Project",
+   "permlevel": 0,
+   "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_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "default": ":Company", 
-   "depends_on": "eval:cint(sys_defaults.auto_accounting_for_stock)", 
-   "fieldname": "cost_center", 
-   "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": "Cost Center", 
-   "length": 0, 
-   "no_copy": 0, 
-   "options": "Cost Center", 
-   "permlevel": 0, 
-   "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, 
+   "allow_on_submit": 0,
+   "bold": 0,
+   "collapsible": 0,
+   "columns": 0,
+   "default": ":Company",
+   "depends_on": "eval:cint(sys_defaults.auto_accounting_for_stock)",
+   "fieldname": "cost_center",
+   "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": "Cost Center",
+   "length": 0,
+   "no_copy": 0,
+   "options": "Cost Center",
+   "permlevel": 0,
+   "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_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "purchase_order_item", 
-   "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": "Purchase Order Item", 
-   "length": 0, 
-   "no_copy": 1, 
-   "oldfieldname": "prevdoc_detail_docname", 
-   "oldfieldtype": "Data", 
-   "permlevel": 0, 
-   "print_hide": 1, 
-   "print_hide_if_no_value": 0, 
-   "print_width": "150px", 
-   "read_only": 1, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 0, 
-   "search_index": 1, 
-   "set_only_once": 0, 
-   "unique": 0, 
+   "allow_on_submit": 0,
+   "bold": 0,
+   "collapsible": 0,
+   "columns": 0,
+   "fieldname": "purchase_order_item",
+   "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": "Purchase Order Item",
+   "length": 0,
+   "no_copy": 1,
+   "oldfieldname": "prevdoc_detail_docname",
+   "oldfieldtype": "Data",
+   "permlevel": 0,
+   "print_hide": 1,
+   "print_hide_if_no_value": 0,
+   "print_width": "150px",
+   "read_only": 1,
+   "remember_last_selected_value": 0,
+   "report_hide": 0,
+   "reqd": 0,
+   "search_index": 1,
+   "set_only_once": 0,
+   "unique": 0,
    "width": "150px"
-  }, 
+  },
   {
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "col_break5", 
-   "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, 
-   "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, 
+   "allow_on_submit": 0,
+   "bold": 0,
+   "collapsible": 0,
+   "columns": 0,
+   "fieldname": "col_break5",
+   "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,
+   "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": 1, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "is_sample_item", 
-   "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 Sample Item", 
-   "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, 
+   "allow_on_submit": 0,
+   "bold": 0,
+   "collapsible": 0,
+   "columns": 0,
+   "fieldname": "allow_zero_valuation_rate",
+   "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": "Allow Zero Valuation Rate",
+   "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_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "bom", 
-   "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": "BOM", 
-   "length": 0, 
-   "no_copy": 1, 
-   "options": "BOM", 
-   "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, 
+   "allow_on_submit": 0,
+   "bold": 0,
+   "collapsible": 0,
+   "columns": 0,
+   "fieldname": "bom",
+   "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": "BOM",
+   "length": 0,
+   "no_copy": 1,
+   "options": "BOM",
+   "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_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "billed_amt", 
-   "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": "Billed Amt", 
-   "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, 
+   "allow_on_submit": 0,
+   "bold": 0,
+   "collapsible": 0,
+   "columns": 0,
+   "fieldname": "billed_amt",
+   "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": "Billed Amt",
+   "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_on_submit": 1, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "landed_cost_voucher_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": "Landed Cost Voucher Amount", 
-   "length": 0, 
-   "no_copy": 1, 
-   "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, 
+   "allow_on_submit": 1,
+   "bold": 0,
+   "collapsible": 0,
+   "columns": 0,
+   "fieldname": "landed_cost_voucher_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": "Landed Cost Voucher Amount",
+   "length": 0,
+   "no_copy": 1,
+   "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
-  }, 
+  },
   {
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "brand", 
-   "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": "Brand", 
-   "length": 0, 
-   "no_copy": 0, 
-   "oldfieldname": "brand", 
-   "oldfieldtype": "Link", 
-   "options": "Brand", 
-   "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, 
+   "allow_on_submit": 0,
+   "bold": 0,
+   "collapsible": 0,
+   "columns": 0,
+   "fieldname": "brand",
+   "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": "Brand",
+   "length": 0,
+   "no_copy": 0,
+   "oldfieldname": "brand",
+   "oldfieldtype": "Link",
+   "options": "Brand",
+   "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
-  }, 
+  },
   {
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "description": "", 
-   "fieldname": "item_group", 
-   "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": "Item Group", 
-   "length": 0, 
-   "no_copy": 0, 
-   "oldfieldname": "item_group", 
-   "oldfieldtype": "Link", 
-   "options": "Item Group", 
-   "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": 1, 
-   "set_only_once": 0, 
+   "allow_on_submit": 0,
+   "bold": 0,
+   "collapsible": 0,
+   "columns": 0,
+   "description": "",
+   "fieldname": "item_group",
+   "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": "Item Group",
+   "length": 0,
+   "no_copy": 0,
+   "oldfieldname": "item_group",
+   "oldfieldtype": "Link",
+   "options": "Item Group",
+   "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
-  }, 
+  },
   {
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "rm_supp_cost", 
-   "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": "Raw Materials Supplied Cost", 
-   "length": 0, 
-   "no_copy": 1, 
-   "oldfieldname": "rm_supp_cost", 
-   "oldfieldtype": "Currency", 
-   "options": "Company:company:default_currency", 
-   "permlevel": 0, 
-   "print_hide": 1, 
-   "print_hide_if_no_value": 0, 
-   "print_width": "150px", 
-   "read_only": 1, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 0, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "unique": 0, 
+   "allow_on_submit": 0,
+   "bold": 0,
+   "collapsible": 0,
+   "columns": 0,
+   "fieldname": "rm_supp_cost",
+   "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": "Raw Materials Supplied Cost",
+   "length": 0,
+   "no_copy": 1,
+   "oldfieldname": "rm_supp_cost",
+   "oldfieldtype": "Currency",
+   "options": "Company:company:default_currency",
+   "permlevel": 0,
+   "print_hide": 1,
+   "print_hide_if_no_value": 0,
+   "print_width": "150px",
+   "read_only": 1,
+   "remember_last_selected_value": 0,
+   "report_hide": 0,
+   "reqd": 0,
+   "search_index": 0,
+   "set_only_once": 0,
+   "unique": 0,
    "width": "150px"
-  }, 
+  },
   {
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "item_tax_amount", 
-   "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": "Item Tax Amount", 
-   "length": 0, 
-   "no_copy": 1, 
-   "oldfieldname": "item_tax_amount", 
-   "oldfieldtype": "Currency", 
-   "options": "Company:company:default_currency", 
-   "permlevel": 0, 
-   "print_hide": 1, 
-   "print_hide_if_no_value": 0, 
-   "print_width": "150px", 
-   "read_only": 1, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 0, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "unique": 0, 
+   "allow_on_submit": 0,
+   "bold": 0,
+   "collapsible": 0,
+   "columns": 0,
+   "fieldname": "item_tax_amount",
+   "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": "Item Tax Amount",
+   "length": 0,
+   "no_copy": 1,
+   "oldfieldname": "item_tax_amount",
+   "oldfieldtype": "Currency",
+   "options": "Company:company:default_currency",
+   "permlevel": 0,
+   "print_hide": 1,
+   "print_hide_if_no_value": 0,
+   "print_width": "150px",
+   "read_only": 1,
+   "remember_last_selected_value": 0,
+   "report_hide": 0,
+   "reqd": 0,
+   "search_index": 0,
+   "set_only_once": 0,
+   "unique": 0,
    "width": "150px"
-  }, 
+  },
   {
-   "allow_on_submit": 1, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "valuation_rate", 
-   "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": "Valuation Rate", 
-   "length": 0, 
-   "no_copy": 1, 
-   "oldfieldname": "valuation_rate", 
-   "oldfieldtype": "Currency", 
-   "options": "Company:company:default_currency", 
-   "permlevel": 0, 
-   "print_hide": 1, 
-   "print_hide_if_no_value": 0, 
-   "print_width": "80px", 
-   "read_only": 1, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 0, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "unique": 0, 
+   "allow_on_submit": 1,
+   "bold": 0,
+   "collapsible": 0,
+   "columns": 0,
+   "fieldname": "valuation_rate",
+   "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": "Valuation Rate",
+   "length": 0,
+   "no_copy": 1,
+   "oldfieldname": "valuation_rate",
+   "oldfieldtype": "Currency",
+   "options": "Company:company:default_currency",
+   "permlevel": 0,
+   "print_hide": 1,
+   "print_hide_if_no_value": 0,
+   "print_width": "80px",
+   "read_only": 1,
+   "remember_last_selected_value": 0,
+   "report_hide": 0,
+   "reqd": 0,
+   "search_index": 0,
+   "set_only_once": 0,
+   "unique": 0,
    "width": "80px"
-  }, 
+  },
   {
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "description": "Tax detail table fetched from item master as a string and stored in this field.\nUsed for Taxes and Charges", 
-   "fieldname": "item_tax_rate", 
-   "fieldtype": "Code", 
-   "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": "Item Tax Rate", 
-   "length": 0, 
-   "no_copy": 0, 
-   "oldfieldname": "item_tax_rate", 
-   "oldfieldtype": "Small Text", 
-   "permlevel": 0, 
-   "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, 
+   "allow_on_submit": 0,
+   "bold": 0,
+   "collapsible": 0,
+   "columns": 0,
+   "description": "Tax detail table fetched from item master as a string and stored in this field.\nUsed for Taxes and Charges",
+   "fieldname": "item_tax_rate",
+   "fieldtype": "Code",
+   "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": "Item Tax Rate",
+   "length": 0,
+   "no_copy": 0,
+   "oldfieldname": "item_tax_rate",
+   "oldfieldtype": "Small Text",
+   "permlevel": 0,
+   "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_on_submit": 1, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "page_break", 
-   "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": "Page Break", 
-   "length": 0, 
-   "no_copy": 0, 
-   "oldfieldname": "page_break", 
-   "oldfieldtype": "Check", 
-   "permlevel": 0, 
-   "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, 
+   "allow_on_submit": 1,
+   "bold": 0,
+   "collapsible": 0,
+   "columns": 0,
+   "fieldname": "page_break",
+   "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": "Page Break",
+   "length": 0,
+   "no_copy": 0,
+   "oldfieldname": "page_break",
+   "oldfieldtype": "Check",
+   "permlevel": 0,
+   "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
   }
- ], 
- "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:59.778417", 
- "modified_by": "Administrator", 
- "module": "Stock", 
- "name": "Purchase Receipt Item", 
- "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, 
+ ],
+ "has_web_view": 0,
+ "hide_heading": 0,
+ "hide_toolbar": 0,
+ "idx": 1,
+ "image_view": 0,
+ "in_create": 0,
+ "is_submittable": 0,
+ "issingle": 0,
+ "istable": 1,
+ "max_attachments": 0,
+ "modified": "2017-04-19 11:54:00.260886",
+ "modified_by": "Administrator",
+ "module": "Stock",
+ "name": "Purchase Receipt Item",
+ "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/stock/doctype/serial_no/serial_no.py b/erpnext/stock/doctype/serial_no/serial_no.py
index 71ce0f8..bc9b893 100644
--- a/erpnext/stock/doctype/serial_no/serial_no.py
+++ b/erpnext/stock/doctype/serial_no/serial_no.py
@@ -165,7 +165,7 @@
 			for item in frappe.db.sql("""select name, serial_no from `tab%s`
 				where serial_no like '%%%s%%'""" % (dt[0], frappe.db.escape(old))):
 
-				serial_nos = map(lambda i: i==old and new or i, item[1].split('\n'))
+				serial_nos = map(lambda i: new if i.upper()==old.upper() else i, item[1].split('\n'))
 				frappe.db.sql("""update `tab%s` set serial_no = %s
 					where name=%s""" % (dt[0], '%s', '%s'),
 					('\n'.join(serial_nos), item[0]))
diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.js b/erpnext/stock/doctype/stock_entry/stock_entry.js
index 864f9b1..4e381ea 100644
--- a/erpnext/stock/doctype/stock_entry/stock_entry.js
+++ b/erpnext/stock/doctype/stock_entry/stock_entry.js
@@ -229,6 +229,10 @@
 		this.frm.set_indicator_formatter('item_code',
 			function(doc) { return (doc.qty<=doc.actual_qty) ? "green" : "orange" })
 
+		this.frm.add_fetch("purchase_order", "supplier", "supplier");
+
+		frappe.dynamic_link = { doc: this.frm.doc, fieldname: 'supplier', doctype: 'Supplier' }
+		this.frm.set_query("supplier_address", erpnext.queries.address_query)
 	},
 
 	onload_post_render: function() {
@@ -509,7 +513,8 @@
 		} else {
 			doc.customer = doc.customer_name = doc.customer_address =
 				doc.delivery_note_no = doc.sales_invoice_no = doc.supplier =
-				doc.supplier_name = doc.supplier_address = doc.purchase_receipt_no = null;
+				doc.supplier_name = doc.supplier_address = doc.purchase_receipt_no = 
+				doc.address_display = null;
 		}
 		if(doc.purpose == "Material Receipt") {
 			this.frm.set_value("from_bom", 0);
@@ -520,5 +525,9 @@
 			doc.purpose!='Material Issue');
 
 		this.frm.fields_dict["items"].grid.set_column_disp("additional_cost", doc.purpose!='Material Issue');
+	},
+
+	supplier: function(doc) {
+		erpnext.utils.get_party_details(this.frm, null, null, null);
 	}
 });
\ No newline at end of file
diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.json b/erpnext/stock/doctype/stock_entry/stock_entry.json
index a6dd825..fd0863b 100644
--- a/erpnext/stock/doctype/stock_entry/stock_entry.json
+++ b/erpnext/stock/doctype/stock_entry/stock_entry.json
@@ -14,6 +14,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": 1, 
    "bold": 0, 
    "collapsible": 0, 
@@ -73,6 +75,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -104,6 +107,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 1, 
    "collapsible": 0, 
@@ -136,6 +140,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -167,6 +172,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -199,6 +205,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -230,6 +237,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -262,6 +270,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -292,6 +301,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -324,6 +334,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -354,6 +365,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -384,36 +396,7 @@
    "width": "50%"
   }, 
   {
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "depends_on": "eval:doc.docstatus==0", 
-   "fieldname": "set_posting_time", 
-   "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": "Edit Posting Date and Time", 
-   "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, 
@@ -446,6 +429,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -477,6 +461,38 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "depends_on": "eval:doc.docstatus==0", 
+   "fieldname": "set_posting_time", 
+   "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": "Edit Posting Date and Time", 
+   "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": 0, 
+   "search_index": 0, 
+   "set_only_once": 0, 
+   "unique": 0
+  }, 
+  {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -506,6 +522,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -536,6 +553,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -568,6 +586,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -595,6 +614,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -626,6 +646,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -656,6 +677,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -684,6 +706,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -715,6 +738,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -742,6 +766,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -773,6 +798,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -801,6 +827,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -832,6 +859,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -863,6 +891,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -891,6 +920,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -921,6 +951,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -949,6 +980,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -979,6 +1011,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1009,6 +1042,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 1, 
@@ -1039,6 +1073,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1069,6 +1104,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1099,6 +1135,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 1, 
@@ -1128,6 +1165,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1160,6 +1198,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 1, 
    "collapsible": 0, 
@@ -1191,13 +1230,14 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
    "depends_on": "eval:doc.purpose==\"Purchase Return\" || doc.purpose==\"Subcontract\"", 
    "fieldname": "supplier_address", 
-   "fieldtype": "Small Text", 
+   "fieldtype": "Link", 
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
@@ -1210,6 +1250,7 @@
    "no_copy": 1, 
    "oldfieldname": "supplier_address", 
    "oldfieldtype": "Small Text", 
+   "options": "Address", 
    "permlevel": 0, 
    "print_hide": 0, 
    "print_hide_if_no_value": 0, 
@@ -1222,6 +1263,37 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
+   "collapsible": 0, 
+   "columns": 0, 
+   "fieldname": "address_display", 
+   "fieldtype": "Small 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": "Address", 
+   "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, 
@@ -1250,6 +1322,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1282,6 +1355,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 1, 
    "collapsible": 0, 
@@ -1313,6 +1387,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1344,6 +1419,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 1, 
@@ -1373,6 +1449,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 1, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1404,6 +1481,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1434,6 +1512,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 1, 
@@ -1463,6 +1542,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1493,6 +1573,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1523,6 +1604,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1552,6 +1634,7 @@
    "width": "50%"
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1582,6 +1665,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1613,6 +1697,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -1654,7 +1739,7 @@
  "issingle": 0, 
  "istable": 0, 
  "max_attachments": 0, 
- "modified": "2017-03-14 16:11:11.741704", 
+ "modified": "2017-05-17 10:35:58.696189", 
  "modified_by": "Administrator", 
  "module": "Stock", 
  "name": "Stock Entry", 
@@ -1749,6 +1834,6 @@
  "sort_field": "modified", 
  "sort_order": "DESC", 
  "title_field": "title", 
- "track_changes": 0, 
+ "track_changes": 1, 
  "track_seen": 0
 }
\ No newline at end of file
diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.py b/erpnext/stock/doctype/stock_entry/stock_entry.py
index 107c85c..169bfd9 100644
--- a/erpnext/stock/doctype/stock_entry/stock_entry.py
+++ b/erpnext/stock/doctype/stock_entry/stock_entry.py
@@ -9,6 +9,7 @@
 from erpnext.stock.utils import get_incoming_rate
 from erpnext.stock.stock_ledger import get_previous_sle, NegativeStockError
 from erpnext.stock.get_item_details import get_bin_details, get_default_cost_center, get_conversion_factor
+from erpnext.stock.doctype.batch.batch import get_batch_no, set_batch_nos
 from erpnext.manufacturing.doctype.bom.bom import validate_bom_no
 import json
 
@@ -48,6 +49,11 @@
 		self.validate_with_material_request()
 		self.validate_batch()
 
+		if self._action == 'submit':
+			self.make_batches('t_warehouse')
+		else:
+			set_batch_nos(self, 's_warehouse', True)
+
 		self.set_actual_qty()
 		self.calculate_rate_and_amount(update_finished_item_rate=False)
 
@@ -86,8 +92,10 @@
 			if item.item_code not in stock_items:
 				frappe.throw(_("{0} is not a stock Item").format(item.item_code))
 
-			item_details = self.get_item_details(frappe._dict({"item_code": item.item_code,
-				"company": self.company, "project": self.project, "uom": item.uom}), for_update=True)
+			item_details = self.get_item_details(frappe._dict(
+				{"item_code": item.item_code, "company": self.company,
+				"project": self.project, "uom": item.uom, 's_warehouse': item.s_warehouse}),
+				for_update=True)
 
 			for f in ("uom", "stock_uom", "description", "item_name", "expense_account",
 				"cost_center", "conversion_factor"):
@@ -462,7 +470,9 @@
 
 	def get_item_details(self, args=None, for_update=False):
 		item = frappe.db.sql("""select stock_uom, description, image, item_name,
-			expense_account, buying_cost_center, item_group from `tabItem`
+				expense_account, buying_cost_center, item_group, has_serial_no,
+				has_batch_no
+			from `tabItem`
 			where name = %s
 				and disabled=0
 				and (end_of_life is null or end_of_life='0000-00-00' or end_of_life > %s)""",
@@ -472,7 +482,7 @@
 
 		item = item[0]
 
-		ret = {
+		ret = frappe._dict({
 			'uom'			      	: item.stock_uom,
 			'stock_uom'			  	: item.stock_uom,
 			'description'		  	: item.description,
@@ -486,8 +496,10 @@
 			'batch_no'				: '',
 			'actual_qty'			: 0,
 			'basic_rate'			: 0,
-			'serial_no'				: ''
-		}
+			'serial_no'				: '',
+			'has_serial_no'			: item.has_serial_no,
+			'has_batch_no'			: item.has_batch_no
+		})
 		for d in [["Account", "expense_account", "default_expense_account"],
 			["Cost Center", "cost_center", "cost_center"]]:
 				company = frappe.db.get_value(d[0], ret.get(d[1]), "company")
@@ -507,6 +519,11 @@
 		stock_and_rate = args.get('warehouse') and get_warehouse_details(args) or {}
 		ret.update(stock_and_rate)
 
+		# automatically select batch for outgoing item
+		if (args.get('s_warehouse', None) and args.get('qty') and
+			ret.get('has_batch_no') and not args.get('batch_no')):
+			args.batch_no = get_batch_no(args['item_code'], args['s_warehouse'], args['qty'])
+
 		return ret
 
 	def get_items(self):
diff --git a/erpnext/stock/doctype/stock_entry/stock_entry_utils.py b/erpnext/stock/doctype/stock_entry/stock_entry_utils.py
index e58042d..e1ec3ee 100644
--- a/erpnext/stock/doctype/stock_entry/stock_entry_utils.py
+++ b/erpnext/stock/doctype/stock_entry/stock_entry_utils.py
@@ -6,6 +6,20 @@
 
 @frappe.whitelist()
 def make_stock_entry(**args):
+	'''Helper function to make a Stock Entry
+
+	:item_code: Item to be moved
+	:qty: Qty to be moved
+	:from_warehouse: Optional
+	:to_warehouse: Optional
+	:rate: Optional
+	:serial_no: Optional
+	:batch_no: Optional
+	:posting_date: Optional
+	:posting_time: Optional
+	:do_not_save: Optional flag
+	:do_not_submit: Optional flag
+	'''
 	s = frappe.new_doc("Stock Entry")
 	args = frappe._dict(args)
 
@@ -71,6 +85,7 @@
 		"basic_rate": args.rate or args.basic_rate,
 		"conversion_factor": 1.0,
 		"serial_no": args.serial_no,
+		'batch_no': args.batch_no,
 		'cost_center': args.cost_center,
 		'expense_account': args.expense_account
 	})
diff --git a/erpnext/stock/doctype/stock_entry/test_stock_entry.py b/erpnext/stock/doctype/stock_entry/test_stock_entry.py
index 79df591..b16dee9 100644
--- a/erpnext/stock/doctype/stock_entry/test_stock_entry.py
+++ b/erpnext/stock/doctype/stock_entry/test_stock_entry.py
@@ -44,30 +44,30 @@
 
 		make_stock_entry(item_code=item_code, target=warehouse, qty=1, basic_rate=10)
 		sle = get_sle(item_code = item_code, warehouse = warehouse)[0]
-		self.assertEqual([[1, 10]], eval(sle.stock_queue))
+		self.assertEqual([[1, 10]], frappe.safe_eval(sle.stock_queue))
 
 		# negative qty
 		make_stock_entry(item_code=item_code, source=warehouse, qty=2, basic_rate=10)
 		sle = get_sle(item_code = item_code, warehouse = warehouse)[0]
 
-		self.assertEqual([[-1, 10]], eval(sle.stock_queue))
+		self.assertEqual([[-1, 10]], frappe.safe_eval(sle.stock_queue))
 
 		# further negative
 		make_stock_entry(item_code=item_code, source=warehouse, qty=1)
 		sle = get_sle(item_code = item_code, warehouse = warehouse)[0]
 
-		self.assertEqual([[-2, 10]], eval(sle.stock_queue))
+		self.assertEqual([[-2, 10]], frappe.safe_eval(sle.stock_queue))
 
 		# move stock to positive
 		make_stock_entry(item_code=item_code, target=warehouse, qty=3, basic_rate=20)
 		sle = get_sle(item_code = item_code, warehouse = warehouse)[0]
-		self.assertEqual([[1, 20]], eval(sle.stock_queue))
+		self.assertEqual([[1, 20]], frappe.safe_eval(sle.stock_queue))
 
 		# incoming entry with diff rate
 		make_stock_entry(item_code=item_code, target=warehouse, qty=1, basic_rate=30)
 		sle = get_sle(item_code = item_code, warehouse = warehouse)[0]
 
-		self.assertEqual([[1, 20],[1, 30]], eval(sle.stock_queue))
+		self.assertEqual([[1, 20],[1, 30]], frappe.safe_eval(sle.stock_queue))
 
 		frappe.db.set_default("allow_negative_stock", 0)
 
diff --git a/erpnext/stock/doctype/stock_entry_detail/stock_entry_detail.json b/erpnext/stock/doctype/stock_entry_detail/stock_entry_detail.json
index 9b808f0..4d96c42 100644
--- a/erpnext/stock/doctype/stock_entry_detail/stock_entry_detail.json
+++ b/erpnext/stock/doctype/stock_entry_detail/stock_entry_detail.json
@@ -1,1240 +1,1241 @@
 {
- "allow_copy": 0, 
- "allow_import": 0, 
- "allow_rename": 0, 
- "autoname": "hash", 
- "beta": 0, 
- "creation": "2013-03-29 18:22:12", 
- "custom": 0, 
- "docstatus": 0, 
- "doctype": "DocType", 
- "document_type": "Other", 
- "editable_grid": 1, 
- "engine": "InnoDB", 
+ "allow_copy": 0,
+ "allow_guest_to_view": 0,
+ "allow_import": 0,
+ "allow_rename": 0,
+ "autoname": "hash",
+ "beta": 0,
+ "creation": "2013-03-29 18:22:12",
+ "custom": 0,
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Other",
+ "editable_grid": 1,
+ "engine": "InnoDB",
  "fields": [
   {
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "barcode", 
-   "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": "Barcode", 
-   "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, 
+   "allow_on_submit": 0,
+   "bold": 0,
+   "collapsible": 0,
+   "columns": 0,
+   "fieldname": "barcode",
+   "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": "Barcode",
+   "length": 0,
+   "no_copy": 0,
+   "permlevel": 0,
+   "precision": "",
+   "print_hide": 0,
+   "print_hide_if_no_value": 0,
+   "read_only": 0,
+   "remember_last_selected_value": 0,
+   "report_hide": 0,
+   "reqd": 0,
+   "search_index": 0,
+   "set_only_once": 0,
    "unique": 0
-  }, 
+  },
   {
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "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, 
+   "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,
+   "length": 0,
+   "no_copy": 0,
+   "permlevel": 0,
+   "precision": "",
+   "print_hide": 0,
+   "print_hide_if_no_value": 0,
+   "read_only": 0,
+   "remember_last_selected_value": 0,
+   "report_hide": 0,
+   "reqd": 0,
+   "search_index": 0,
+   "set_only_once": 0,
    "unique": 0
-  }, 
+  },
   {
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 2, 
-   "fieldname": "s_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": 0, 
-   "label": "Source Warehouse", 
-   "length": 0, 
-   "no_copy": 0, 
-   "oldfieldname": "s_warehouse", 
-   "oldfieldtype": "Link", 
-   "options": "Warehouse", 
-   "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, 
+   "allow_on_submit": 0,
+   "bold": 0,
+   "collapsible": 0,
+   "columns": 2,
+   "fieldname": "s_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": 0,
+   "label": "Source Warehouse",
+   "length": 0,
+   "no_copy": 0,
+   "oldfieldname": "s_warehouse",
+   "oldfieldtype": "Link",
+   "options": "Warehouse",
+   "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_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "col_break1", 
-   "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, 
-   "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, 
+   "allow_on_submit": 0,
+   "bold": 0,
+   "collapsible": 0,
+   "columns": 0,
+   "fieldname": "col_break1",
+   "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,
+   "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": 2, 
-   "fieldname": "t_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": 0, 
-   "label": "Target Warehouse", 
-   "length": 0, 
-   "no_copy": 0, 
-   "oldfieldname": "t_warehouse", 
-   "oldfieldtype": "Link", 
-   "options": "Warehouse", 
-   "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, 
+   "allow_on_submit": 0,
+   "bold": 0,
+   "collapsible": 0,
+   "columns": 2,
+   "fieldname": "t_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": 0,
+   "label": "Target Warehouse",
+   "length": 0,
+   "no_copy": 0,
+   "oldfieldname": "t_warehouse",
+   "oldfieldtype": "Link",
+   "options": "Warehouse",
+   "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_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "sec_break1", 
-   "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, 
-   "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, 
+   "allow_on_submit": 0,
+   "bold": 0,
+   "collapsible": 0,
+   "columns": 0,
+   "fieldname": "sec_break1",
+   "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,
+   "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": 1, 
-   "collapsible": 0, 
-   "columns": 3, 
-   "fieldname": "item_code", 
-   "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": 0, 
-   "label": "Item Code", 
-   "length": 0, 
-   "no_copy": 0, 
-   "oldfieldname": "item_code", 
-   "oldfieldtype": "Link", 
-   "options": "Item", 
-   "permlevel": 0, 
-   "print_hide": 0, 
-   "print_hide_if_no_value": 0, 
-   "read_only": 0, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 1, 
-   "search_index": 1, 
-   "set_only_once": 0, 
+   "allow_on_submit": 0,
+   "bold": 1,
+   "collapsible": 0,
+   "columns": 3,
+   "fieldname": "item_code",
+   "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": 0,
+   "label": "Item Code",
+   "length": 0,
+   "no_copy": 0,
+   "oldfieldname": "item_code",
+   "oldfieldtype": "Link",
+   "options": "Item",
+   "permlevel": 0,
+   "print_hide": 0,
+   "print_hide_if_no_value": 0,
+   "read_only": 0,
+   "remember_last_selected_value": 0,
+   "report_hide": 0,
+   "reqd": 1,
+   "search_index": 1,
+   "set_only_once": 0,
    "unique": 0
-  }, 
+  },
   {
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "col_break2", 
-   "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, 
-   "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, 
+   "allow_on_submit": 0,
+   "bold": 0,
+   "collapsible": 0,
+   "columns": 0,
+   "fieldname": "col_break2",
+   "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,
+   "print_hide": 0,
+   "print_hide_if_no_value": 0,
+   "read_only": 0,
+   "remember_last_selected_value": 0,
+   "report_hide": 0,
+   "reqd": 0,
+   "search_index": 0,
+   "set_only_once": 0,
    "unique": 0
-  }, 
+  },
   {
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "item_name", 
-   "fieldtype": "Data", 
-   "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": "Item Name", 
-   "length": 0, 
-   "no_copy": 0, 
-   "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, 
+   "allow_on_submit": 0,
+   "bold": 0,
+   "collapsible": 0,
+   "columns": 0,
+   "fieldname": "item_name",
+   "fieldtype": "Data",
+   "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": "Item Name",
+   "length": 0,
+   "no_copy": 0,
+   "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
-  }, 
+  },
   {
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 1, 
-   "columns": 0, 
-   "fieldname": "section_break_8", 
-   "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": "Description", 
-   "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, 
+   "allow_on_submit": 0,
+   "bold": 0,
+   "collapsible": 1,
+   "columns": 0,
+   "fieldname": "section_break_8",
+   "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": "Description",
+   "length": 0,
+   "no_copy": 0,
+   "permlevel": 0,
+   "precision": "",
+   "print_hide": 0,
+   "print_hide_if_no_value": 0,
+   "read_only": 0,
+   "remember_last_selected_value": 0,
+   "report_hide": 0,
+   "reqd": 0,
+   "search_index": 0,
+   "set_only_once": 0,
    "unique": 0
-  }, 
+  },
   {
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "description", 
-   "fieldtype": "Text Editor", 
-   "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": "Description", 
-   "length": 0, 
-   "no_copy": 0, 
-   "oldfieldname": "description", 
-   "oldfieldtype": "Text", 
-   "permlevel": 0, 
-   "print_hide": 0, 
-   "print_hide_if_no_value": 0, 
-   "print_width": "300px", 
-   "read_only": 0, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 0, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "unique": 0, 
+   "allow_on_submit": 0,
+   "bold": 0,
+   "collapsible": 0,
+   "columns": 0,
+   "fieldname": "description",
+   "fieldtype": "Text Editor",
+   "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": "Description",
+   "length": 0,
+   "no_copy": 0,
+   "oldfieldname": "description",
+   "oldfieldtype": "Text",
+   "permlevel": 0,
+   "print_hide": 0,
+   "print_hide_if_no_value": 0,
+   "print_width": "300px",
+   "read_only": 0,
+   "remember_last_selected_value": 0,
+   "report_hide": 0,
+   "reqd": 0,
+   "search_index": 0,
+   "set_only_once": 0,
+   "unique": 0,
    "width": "300px"
-  }, 
+  },
   {
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "column_break_10", 
-   "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, 
+   "allow_on_submit": 0,
+   "bold": 0,
+   "collapsible": 0,
+   "columns": 0,
+   "fieldname": "column_break_10",
+   "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_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "image", 
-   "fieldtype": "Attach", 
-   "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": 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, 
+   "allow_on_submit": 0,
+   "bold": 0,
+   "collapsible": 0,
+   "columns": 0,
+   "fieldname": "image",
+   "fieldtype": "Attach",
+   "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": 0,
+   "permlevel": 0,
+   "precision": "",
+   "print_hide": 0,
+   "print_hide_if_no_value": 0,
+   "read_only": 0,
+   "remember_last_selected_value": 0,
+   "report_hide": 0,
+   "reqd": 0,
+   "search_index": 0,
+   "set_only_once": 0,
    "unique": 0
-  }, 
+  },
   {
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "image_view", 
-   "fieldtype": "Image", 
-   "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": "Image View", 
-   "length": 0, 
-   "no_copy": 0, 
-   "options": "image", 
-   "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, 
+   "allow_on_submit": 0,
+   "bold": 0,
+   "collapsible": 0,
+   "columns": 0,
+   "fieldname": "image_view",
+   "fieldtype": "Image",
+   "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": "Image View",
+   "length": 0,
+   "no_copy": 0,
+   "options": "image",
+   "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_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "quantity_and_rate", 
-   "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": "Quantity and Rate", 
-   "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, 
+   "allow_on_submit": 0,
+   "bold": 0,
+   "collapsible": 0,
+   "columns": 0,
+   "fieldname": "quantity_and_rate",
+   "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": "Quantity and Rate",
+   "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_on_submit": 0, 
-   "bold": 1, 
-   "collapsible": 0, 
-   "columns": 3, 
-   "fieldname": "qty", 
-   "fieldtype": "Float", 
-   "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": "Qty", 
-   "length": 0, 
-   "no_copy": 0, 
-   "oldfieldname": "qty", 
-   "oldfieldtype": "Currency", 
-   "permlevel": 0, 
-   "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, 
+   "allow_on_submit": 0,
+   "bold": 1,
+   "collapsible": 0,
+   "columns": 3,
+   "fieldname": "qty",
+   "fieldtype": "Float",
+   "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": "Qty",
+   "length": 0,
+   "no_copy": 0,
+   "oldfieldname": "qty",
+   "oldfieldtype": "Currency",
+   "permlevel": 0,
+   "print_hide": 0,
+   "print_hide_if_no_value": 0,
+   "read_only": 0,
+   "remember_last_selected_value": 0,
+   "report_hide": 0,
+   "reqd": 1,
+   "search_index": 0,
+   "set_only_once": 0,
    "unique": 0
-  }, 
+  },
   {
-   "allow_on_submit": 0, 
-   "bold": 1, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "basic_rate", 
-   "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": "Basic Rate (as per Stock UOM)", 
-   "length": 0, 
-   "no_copy": 0, 
-   "oldfieldname": "incoming_rate", 
-   "oldfieldtype": "Currency", 
-   "options": "Company:company:default_currency", 
-   "permlevel": 0, 
-   "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, 
+   "allow_on_submit": 0,
+   "bold": 1,
+   "collapsible": 0,
+   "columns": 0,
+   "fieldname": "basic_rate",
+   "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": "Basic Rate (as per Stock UOM)",
+   "length": 0,
+   "no_copy": 0,
+   "oldfieldname": "incoming_rate",
+   "oldfieldtype": "Currency",
+   "options": "Company:company:default_currency",
+   "permlevel": 0,
+   "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_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "basic_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": "Basic Amount", 
-   "length": 0, 
-   "no_copy": 0, 
-   "options": "Company:company:default_currency", 
-   "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, 
+   "allow_on_submit": 0,
+   "bold": 0,
+   "collapsible": 0,
+   "columns": 0,
+   "fieldname": "basic_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": "Basic Amount",
+   "length": 0,
+   "no_copy": 0,
+   "options": "Company:company:default_currency",
+   "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_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "additional_cost", 
-   "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": "Additional Cost", 
-   "length": 0, 
-   "no_copy": 0, 
-   "options": "Company:company:default_currency", 
-   "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, 
+   "allow_on_submit": 0,
+   "bold": 0,
+   "collapsible": 0,
+   "columns": 0,
+   "fieldname": "additional_cost",
+   "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": "Additional Cost",
+   "length": 0,
+   "no_copy": 0,
+   "options": "Company:company:default_currency",
+   "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_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "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": "Amount", 
-   "length": 0, 
-   "no_copy": 0, 
-   "oldfieldname": "amount", 
-   "oldfieldtype": "Currency", 
-   "options": "Company:company:default_currency", 
-   "permlevel": 0, 
-   "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, 
+   "allow_on_submit": 0,
+   "bold": 0,
+   "collapsible": 0,
+   "columns": 0,
+   "fieldname": "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": "Amount",
+   "length": 0,
+   "no_copy": 0,
+   "oldfieldname": "amount",
+   "oldfieldtype": "Currency",
+   "options": "Company:company:default_currency",
+   "permlevel": 0,
+   "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_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "valuation_rate", 
-   "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": "Valuation Rate", 
-   "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, 
+   "allow_on_submit": 0,
+   "bold": 0,
+   "collapsible": 0,
+   "columns": 0,
+   "fieldname": "valuation_rate",
+   "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": "Valuation Rate",
+   "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_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "col_break3", 
-   "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, 
-   "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, 
+   "allow_on_submit": 0,
+   "bold": 0,
+   "collapsible": 0,
+   "columns": 0,
+   "fieldname": "col_break3",
+   "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,
+   "print_hide": 0,
+   "print_hide_if_no_value": 0,
+   "read_only": 0,
+   "remember_last_selected_value": 0,
+   "report_hide": 0,
+   "reqd": 0,
+   "search_index": 0,
+   "set_only_once": 0,
    "unique": 0
-  }, 
+  },
   {
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "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, 
-   "read_only": 0, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 1, 
-   "search_index": 0, 
-   "set_only_once": 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,
+   "read_only": 0,
+   "remember_last_selected_value": 0,
+   "report_hide": 0,
+   "reqd": 1,
+   "search_index": 0,
+   "set_only_once": 0,
    "unique": 0
-  }, 
+  },
   {
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "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": "Conversion Factor", 
-   "length": 0, 
-   "no_copy": 0, 
-   "oldfieldname": "conversion_factor", 
-   "oldfieldtype": "Currency", 
-   "permlevel": 0, 
-   "print_hide": 1, 
-   "print_hide_if_no_value": 0, 
-   "read_only": 1, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 1, 
-   "search_index": 0, 
-   "set_only_once": 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": "Conversion Factor",
+   "length": 0,
+   "no_copy": 0,
+   "oldfieldname": "conversion_factor",
+   "oldfieldtype": "Currency",
+   "permlevel": 0,
+   "print_hide": 1,
+   "print_hide_if_no_value": 0,
+   "read_only": 1,
+   "remember_last_selected_value": 0,
+   "report_hide": 0,
+   "reqd": 1,
+   "search_index": 0,
+   "set_only_once": 0,
    "unique": 0
-  }, 
+  },
   {
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "stock_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": "Stock UOM", 
-   "length": 0, 
-   "no_copy": 0, 
-   "oldfieldname": "stock_uom", 
-   "oldfieldtype": "Link", 
-   "options": "UOM", 
-   "permlevel": 0, 
-   "print_hide": 1, 
-   "print_hide_if_no_value": 0, 
-   "read_only": 1, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 1, 
-   "search_index": 0, 
-   "set_only_once": 0, 
+   "allow_on_submit": 0,
+   "bold": 0,
+   "collapsible": 0,
+   "columns": 0,
+   "fieldname": "stock_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": "Stock UOM",
+   "length": 0,
+   "no_copy": 0,
+   "oldfieldname": "stock_uom",
+   "oldfieldtype": "Link",
+   "options": "UOM",
+   "permlevel": 0,
+   "print_hide": 1,
+   "print_hide_if_no_value": 0,
+   "read_only": 1,
+   "remember_last_selected_value": 0,
+   "report_hide": 0,
+   "reqd": 1,
+   "search_index": 0,
+   "set_only_once": 0,
    "unique": 0
-  }, 
+  },
   {
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "transfer_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": "Qty as per Stock UOM", 
-   "length": 0, 
-   "no_copy": 0, 
-   "oldfieldname": "transfer_qty", 
-   "oldfieldtype": "Currency", 
-   "permlevel": 0, 
-   "print_hide": 1, 
-   "print_hide_if_no_value": 0, 
-   "read_only": 1, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 1, 
-   "search_index": 0, 
-   "set_only_once": 0, 
+   "allow_on_submit": 0,
+   "bold": 0,
+   "collapsible": 0,
+   "columns": 0,
+   "fieldname": "transfer_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": "Qty as per Stock UOM",
+   "length": 0,
+   "no_copy": 0,
+   "oldfieldname": "transfer_qty",
+   "oldfieldtype": "Currency",
+   "permlevel": 0,
+   "print_hide": 1,
+   "print_hide_if_no_value": 0,
+   "read_only": 1,
+   "remember_last_selected_value": 0,
+   "report_hide": 0,
+   "reqd": 1,
+   "search_index": 0,
+   "set_only_once": 0,
    "unique": 0
-  }, 
+  },
   {
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "serial_no_batch", 
-   "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": "Serial No / Batch", 
-   "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, 
+   "allow_on_submit": 0,
+   "bold": 0,
+   "collapsible": 0,
+   "columns": 0,
+   "fieldname": "serial_no_batch",
+   "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": "Serial No / Batch",
+   "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_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "serial_no", 
-   "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": "Serial No", 
-   "length": 0, 
-   "no_copy": 1, 
-   "oldfieldname": "serial_no", 
-   "oldfieldtype": "Text", 
-   "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, 
+   "allow_on_submit": 0,
+   "bold": 0,
+   "collapsible": 0,
+   "columns": 0,
+   "fieldname": "serial_no",
+   "fieldtype": "Small 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": "Serial No",
+   "length": 0,
+   "no_copy": 1,
+   "oldfieldname": "serial_no",
+   "oldfieldtype": "Text",
+   "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_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "col_break4", 
-   "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, 
-   "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, 
+   "allow_on_submit": 0,
+   "bold": 0,
+   "collapsible": 0,
+   "columns": 0,
+   "fieldname": "col_break4",
+   "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,
+   "print_hide": 0,
+   "print_hide_if_no_value": 0,
+   "read_only": 0,
+   "remember_last_selected_value": 0,
+   "report_hide": 0,
+   "reqd": 0,
+   "search_index": 0,
+   "set_only_once": 0,
    "unique": 0
-  }, 
+  },
   {
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "batch_no", 
-   "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": "Batch No", 
-   "length": 0, 
-   "no_copy": 0, 
-   "oldfieldname": "batch_no", 
-   "oldfieldtype": "Link", 
-   "options": "Batch", 
-   "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, 
+   "allow_on_submit": 0,
+   "bold": 0,
+   "collapsible": 0,
+   "columns": 0,
+   "fieldname": "batch_no",
+   "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": "Batch No",
+   "length": 0,
+   "no_copy": 0,
+   "oldfieldname": "batch_no",
+   "oldfieldtype": "Link",
+   "options": "Batch",
+   "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_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "accounting", 
-   "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": "Accounting", 
-   "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, 
+   "allow_on_submit": 0,
+   "bold": 0,
+   "collapsible": 0,
+   "columns": 0,
+   "fieldname": "accounting",
+   "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": "Accounting",
+   "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_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "depends_on": "eval:cint(sys_defaults.auto_accounting_for_stock)", 
-   "fieldname": "expense_account", 
-   "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": "Difference Account", 
-   "length": 0, 
-   "no_copy": 0, 
-   "options": "Account", 
-   "permlevel": 0, 
-   "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, 
+   "allow_on_submit": 0,
+   "bold": 0,
+   "collapsible": 0,
+   "columns": 0,
+   "depends_on": "eval:cint(sys_defaults.auto_accounting_for_stock)",
+   "fieldname": "expense_account",
+   "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": "Difference Account",
+   "length": 0,
+   "no_copy": 0,
+   "options": "Account",
+   "permlevel": 0,
+   "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_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "col_break5", 
-   "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, 
-   "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, 
+   "allow_on_submit": 0,
+   "bold": 0,
+   "collapsible": 0,
+   "columns": 0,
+   "fieldname": "col_break5",
+   "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,
+   "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, 
-   "default": ":Company", 
-   "depends_on": "eval:cint(sys_defaults.auto_accounting_for_stock)", 
-   "fieldname": "cost_center", 
-   "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": "Cost Center", 
-   "length": 0, 
-   "no_copy": 0, 
-   "options": "Cost Center", 
-   "permlevel": 0, 
-   "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, 
+   "allow_on_submit": 0,
+   "bold": 0,
+   "collapsible": 0,
+   "columns": 0,
+   "default": ":Company",
+   "depends_on": "eval:cint(sys_defaults.auto_accounting_for_stock)",
+   "fieldname": "cost_center",
+   "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": "Cost Center",
+   "length": 0,
+   "no_copy": 0,
+   "options": "Cost Center",
+   "permlevel": 0,
+   "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_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "more_info", 
-   "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": "More Information", 
-   "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, 
+   "allow_on_submit": 0,
+   "bold": 0,
+   "collapsible": 0,
+   "columns": 0,
+   "fieldname": "more_info",
+   "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": "More Information",
+   "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_on_submit": 1, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "is_sample_item", 
-   "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 Sample Item", 
-   "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, 
+   "allow_on_submit": 1,
+   "bold": 0,
+   "collapsible": 0,
+   "columns": 0,
+   "fieldname": "allow_zero_valuation_rate",
+   "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": "Allow Zero Valuation Rate",
+   "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_on_submit": 1, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "actual_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": "Actual Qty (at source/target)", 
-   "length": 0, 
-   "no_copy": 1, 
-   "oldfieldname": "actual_qty", 
-   "oldfieldtype": "Read Only", 
-   "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": 1, 
-   "set_only_once": 0, 
+   "allow_on_submit": 1,
+   "bold": 0,
+   "collapsible": 0,
+   "columns": 0,
+   "fieldname": "actual_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": "Actual Qty (at source/target)",
+   "length": 0,
+   "no_copy": 1,
+   "oldfieldname": "actual_qty",
+   "oldfieldtype": "Read Only",
+   "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": 1,
+   "set_only_once": 0,
    "unique": 0
-  }, 
+  },
   {
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "description": "BOM No. for a Finished Good Item", 
-   "fieldname": "bom_no", 
-   "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": "BOM No", 
-   "length": 0, 
-   "no_copy": 0, 
-   "options": "BOM", 
-   "permlevel": 0, 
-   "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, 
+   "allow_on_submit": 0,
+   "bold": 0,
+   "collapsible": 0,
+   "columns": 0,
+   "description": "BOM No. for a Finished Good Item",
+   "fieldname": "bom_no",
+   "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": "BOM No",
+   "length": 0,
+   "no_copy": 0,
+   "options": "BOM",
+   "permlevel": 0,
+   "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_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "col_break6", 
-   "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, 
-   "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, 
+   "allow_on_submit": 0,
+   "bold": 0,
+   "collapsible": 0,
+   "columns": 0,
+   "fieldname": "col_break6",
+   "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,
+   "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, 
-   "description": "Material Request used to make this Stock Entry", 
-   "fieldname": "material_request", 
-   "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": "Material Request", 
-   "length": 0, 
-   "no_copy": 1, 
-   "options": "Material Request", 
-   "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, 
+   "allow_on_submit": 0,
+   "bold": 0,
+   "collapsible": 0,
+   "columns": 0,
+   "description": "Material Request used to make this Stock Entry",
+   "fieldname": "material_request",
+   "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": "Material Request",
+   "length": 0,
+   "no_copy": 1,
+   "options": "Material Request",
+   "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
-  }, 
+  },
   {
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "material_request_item", 
-   "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": "Material Request Item", 
-   "length": 0, 
-   "no_copy": 1, 
-   "options": "Material Request Item", 
-   "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, 
+   "allow_on_submit": 0,
+   "bold": 0,
+   "collapsible": 0,
+   "columns": 0,
+   "fieldname": "material_request_item",
+   "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": "Material Request Item",
+   "length": 0,
+   "no_copy": 1,
+   "options": "Material Request Item",
+   "permlevel": 0,
+   "print_hide": 1,
+   "print_hide_if_no_value": 0,
+   "read_only": 1,
+   "remember_last_selected_value": 0,
+   "report_hide": 0,
+   "reqd": 0,
+   "search_index": 0,
+   "set_only_once": 0,
    "unique": 0
   }
- ], 
- "hide_heading": 0, 
- "hide_toolbar": 0, 
- "idx": 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:25.233622", 
- "modified_by": "Administrator", 
- "module": "Stock", 
- "name": "Stock Entry Detail", 
- "owner": "Administrator", 
- "permissions": [], 
- "quick_entry": 0, 
- "read_only": 0, 
- "read_only_onload": 0, 
- "show_name_in_global_search": 0, 
- "sort_order": "ASC", 
- "track_changes": 0, 
+ ],
+ "has_web_view": 0,
+ "hide_heading": 0,
+ "hide_toolbar": 0,
+ "idx": 1,
+ "image_view": 0,
+ "in_create": 0,
+ "is_submittable": 0,
+ "issingle": 0,
+ "istable": 1,
+ "max_attachments": 0,
+ "modified": "2017-04-21 02:56:48.306627",
+ "modified_by": "Administrator",
+ "module": "Stock",
+ "name": "Stock Entry Detail",
+ "owner": "Administrator",
+ "permissions": [],
+ "quick_entry": 0,
+ "read_only": 0,
+ "read_only_onload": 0,
+ "show_name_in_global_search": 0,
+ "sort_order": "ASC",
+ "track_changes": 0,
  "track_seen": 0
 }
\ No newline at end of file
diff --git a/erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.py b/erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.py
index 00e3abe..55a307c 100644
--- a/erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.py
+++ b/erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.py
@@ -58,7 +58,7 @@
 
 	def validate_item(self):
 		item_det = frappe.db.sql("""select name, has_batch_no, docstatus,
-			is_stock_item, has_variants, stock_uom
+			is_stock_item, has_variants, stock_uom, create_new_batch
 			from tabItem where name=%s""", self.item_code, as_dict=True)
 
 		if not item_det:
@@ -75,7 +75,7 @@
 				if not self.batch_no:
 					frappe.throw(_("Batch number is mandatory for Item {0}").format(self.item_code))
 				elif not frappe.db.get_value("Batch",{"item": self.item_code, "name": self.batch_no}):
-						frappe.throw(_("{0} is not a valid Batch Number for Item {1}").format(self.batch_no, self.item_code))
+					frappe.throw(_("{0} is not a valid Batch Number for Item {1}").format(self.batch_no, self.item_code))
 
 			elif item_det.has_batch_no ==0 and self.batch_no:
 					frappe.throw(_("The Item {0} cannot have Batch").format(self.item_code))
@@ -116,7 +116,7 @@
 			self.fiscal_year = get_fiscal_year(self.posting_date, company=self.company)[0]
 		else:
 			from erpnext.accounts.utils import validate_fiscal_year
-			validate_fiscal_year(self.posting_date, self.fiscal_year, self.company, 
+			validate_fiscal_year(self.posting_date, self.fiscal_year, self.company,
 				self.meta.get_label("posting_date"), self)
 
 	def block_transactions_against_group_warehouse(self):
diff --git a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.js b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.js
index 7ed4ede..636b2af 100644
--- a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.js
+++ b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.js
@@ -152,7 +152,6 @@
 
 	setup: function() {
 		var me = this;
-		this.frm.get_docfield("items").allow_bulk_edit = 1;
 
 		this.setup_posting_date_time_check();
 
diff --git a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.json b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.json
index b830a6c..84ab7c3 100644
--- a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.json
+++ b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.json
@@ -10,9 +10,11 @@
  "description": "This tool helps you to update or fix the quantity and valuation of stock in the system. It is typically used to synchronise the system values and what actually exists in your warehouses.", 
  "docstatus": 0, 
  "doctype": "DocType", 
+ "document_type": "Document", 
  "editable_grid": 0, 
  "fields": [
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -43,6 +45,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -72,6 +75,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -101,6 +105,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -128,6 +133,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -159,6 +165,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -189,6 +196,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -218,6 +226,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -246,6 +255,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 1, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -276,6 +286,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -304,6 +315,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -334,6 +346,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -364,6 +377,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -392,6 +406,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -420,6 +435,7 @@
    "unique": 0
   }, 
   {
+   "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
@@ -461,7 +477,7 @@
  "istable": 0, 
  "max_attachments": 1, 
  "menu_index": 0, 
- "modified": "2017-03-15 15:03:08.579943", 
+ "modified": "2017-04-21 16:58:53.475787", 
  "modified_by": "Administrator", 
  "module": "Stock", 
  "name": "Stock Reconciliation", 
diff --git a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py
index a7480e8..d710949 100644
--- a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py
+++ b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py
@@ -143,13 +143,11 @@
 
 			# item should not be serialized
 			if item.has_serial_no == 1:
-				raise frappe.ValidationError, _("Serialized Item {0} cannot be updated \
-					using Stock Reconciliation").format(item_code)
+				raise frappe.ValidationError, _("Serialized Item {0} cannot be updated using Stock Reconciliation, please use Stock Entry").format(item_code)
 
 			# item managed batch-wise not allowed
 			if item.has_batch_no == 1:
-				raise frappe.ValidationError, _("Item: {0} managed batch-wise, can not be reconciled using \
-					Stock Reconciliation, instead use Stock Entry").format(item_code)
+				raise frappe.ValidationError, _("Batched Item {0} cannot be updated using Stock Reconciliation, instead use Stock Entry").format(item_code)
 
 			# docstatus should be < 2
 			validate_cancelled_item(item_code, item.docstatus, verbose=0)
diff --git a/erpnext/stock/get_item_details.py b/erpnext/stock/get_item_details.py
index 958da16..18db8f9 100644
--- a/erpnext/stock/get_item_details.py
+++ b/erpnext/stock/get_item_details.py
@@ -9,6 +9,7 @@
 from erpnext.accounts.doctype.pricing_rule.pricing_rule import get_pricing_rule_for_item, set_transaction_type
 from erpnext.setup.utils import get_exchange_rate
 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):
@@ -73,8 +74,16 @@
 
 	out.update(get_pricing_rule_for_item(args))
 
-	if args.get("doctype") in ("Sales Invoice", "Delivery Note") and out.stock_qty > 0:
-		out.serial_no = get_serial_no(out)
+	if (args.get("doctype") == "Delivery Note" or 
+		(args.get("doctype") == "Sales Invoice" and args.get('update_stock'))) \
+		and out.warehouse and out.stock_qty > 0:
+		
+		if out.has_serial_no:
+			out.serial_no = get_serial_no(out)
+
+		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,
@@ -154,14 +163,15 @@
 		"income_account": get_default_income_account(args, item),
 		"expense_account": get_default_expense_account(args, item),
 		"cost_center": get_default_cost_center(args, item),
+		'has_serial_no': item.has_serial_no,
+		'has_batch_no': item.has_batch_no,
 		"batch_no": None,
 		"item_tax_rate": json.dumps(dict(([d.tax_type, d.tax_rate] for d in
 			item.get("taxes")))),
 		"uom": item.stock_uom,
 		"min_order_qty": flt(item.min_order_qty) if args.doctype == "Material Request" else "",
-		"conversion_factor": 1.0,
 		"qty": args.qty or 1.0,
-		"stock_qty": 1.0,
+		"stock_qty": args.qty or 1.0,
 		"price_list_rate": 0.0,
 		"base_price_list_rate": 0.0,
 		"rate": 0.0,
@@ -172,14 +182,27 @@
 		"net_amount": 0.0,
 		"discount_percentage": 0.0,
 		"supplier": item.default_supplier,
+		"update_stock": args.get("update_stock") if args.get('doctype') in ['Sales Invoice', 'Purchase Invoice'] else 0,
 		"delivered_by_supplier": item.delivered_by_supplier if args.get("doctype") in ["Sales Order", "Sales Invoice"] else 0,
 		"is_fixed_asset": item.is_fixed_asset
 	})
 
+	# calculate conversion factor
+	if item.stock_uom == args.uom:
+		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
+
+	args.conversion_factor = out.conversion_factor
+	out.stock_qty = out.qty * out.conversion_factor
+
 	# if default specified in item is for another company, fetch from company
-	for d in [["Account", "income_account", "default_income_account"],
+	for d in [
+		["Account", "income_account", "default_income_account"],
 		["Account", "expense_account", "default_expense_account"],
-		["Cost Center", "cost_center", "cost_center"], ["Warehouse", "warehouse", ""]]:
+		["Cost Center", "cost_center", "cost_center"],
+		["Warehouse", "warehouse", ""]]:
 			company = frappe.db.get_value(d[0], out.get(d[1]), "company")
 			if not out[d[1]] or (company and args.company != company):
 				out[d[1]] = frappe.db.get_value("Company", args.company, d[2]) if d[2] else None
@@ -227,6 +250,8 @@
 		out.price_list_rate = flt(price_list_rate) * flt(args.plc_conversion_rate) \
 			/ flt(args.conversion_rate)
 
+		out.price_list_rate = flt(out.price_list_rate * (args.conversion_factor or 1.0))
+
 		if not out.price_list_rate and args.transaction_type=="buying":
 			from erpnext.stock.doctype.item.item import get_last_purchase_details
 			out.update(get_last_purchase_details(item_doc.name,
@@ -270,7 +295,7 @@
 		if not frappe.db.get_value("Price List",
 			{"name": args.price_list, args.transaction_type: 1, "enabled": 1}):
 			throw(_("Price List {0} is disabled or does not exist").format(args.price_list))
-	else:
+	elif not args.get("supplier"):
 		throw(_("Price List not selected"))
 
 def validate_conversion_rate(args, meta):
@@ -327,11 +352,10 @@
 
 @frappe.whitelist()
 def get_pos_profile(company):
-	condition = "and company = '%s'"%(company) if company else ''
 	pos_profile = frappe.db.sql("""select * from `tabPOS Profile` where user = %s
-		{cond}""".format(cond=condition), (frappe.session['user']), as_dict=1)
+		 and company = %s""", (frappe.session['user'], company), as_dict=1)
 
-	if not pos_profile and company:
+	if not pos_profile:
 		pos_profile = frappe.db.sql("""select * from `tabPOS Profile`
 			where ifnull(user,'') = '' and company = %s""", company, as_dict=1)
 
@@ -348,15 +372,6 @@
 				"qty": abs(cint(args.stock_qty))
 			}))
 
-def get_actual_batch_qty(batch_no,warehouse,item_code):
-	actual_batch_qty = 0
-	if batch_no:
-		actual_batch_qty = flt(frappe.db.sql("""select sum(actual_qty)
-			from `tabStock Ledger Entry`
-			where warehouse=%s and item_code=%s and batch_no=%s""",
-			(warehouse, item_code, batch_no))[0][0])
-	return actual_batch_qty
-
 @frappe.whitelist()
 def get_conversion_factor(item_code, uom):
 	variant_of = frappe.db.get_value("Item", item_code, "variant_of")
@@ -392,10 +407,10 @@
 	return bin_details_and_serial_nos
 
 @frappe.whitelist()
-def get_batch_qty(batch_no,warehouse,item_code):
-	actual_batch_qty = get_actual_batch_qty(batch_no,warehouse,item_code)
+def get_batch_qty(batch_no, warehouse, item_code):
+	from erpnext.stock.doctype.batch import batch
 	if batch_no:
-		return {'actual_batch_qty': actual_batch_qty}
+		return {'actual_batch_qty': batch.get_batch_qty(batch_no, warehouse)}
 
 @frappe.whitelist()
 def apply_price_list(args, as_doc=False):
@@ -533,6 +548,9 @@
 		args = json.loads(args)
 		args = frappe._dict(args)
 
+	if args.get('doctype') == 'Sales Invoice' and not args.get('update_stock'):
+		return ""
+
 	if args.get('warehouse') and args.get('stock_qty') and args.get('item_code'):
 
 		if frappe.get_value('Item', {'item_code': args.item_code}, "has_serial_no") == 1:
diff --git a/erpnext/stock/page/stock_balance/stock_balance.js b/erpnext/stock/page/stock_balance/stock_balance.js
index 3cf93fa..16a85fa 100644
--- a/erpnext/stock/page/stock_balance/stock_balance.js
+++ b/erpnext/stock/page/stock_balance/stock_balance.js
@@ -48,7 +48,7 @@
 				{fieldname: 'projected_qty', label: __('Projected qty')},
 				{fieldname: 'reserved_qty', label: __('Reserved for sale')},
 				{fieldname: 'reserved_qty_for_production', label: __('Reserved for manufacturing')},
-				{fieldname: 'actual_qty', label: __('Acutal qty in stock')},
+				{fieldname: 'actual_qty', label: __('Actual qty in stock')},
 			]
 		},
 		change: function(sort_by, sort_order) {
@@ -93,4 +93,4 @@
 	});
 
 
-}
\ No newline at end of file
+}
diff --git a/erpnext/stock/report/ordered_items_to_be_delivered/ordered_items_to_be_delivered.json b/erpnext/stock/report/ordered_items_to_be_delivered/ordered_items_to_be_delivered.json
index 1ec1578..f82a52b 100644
--- a/erpnext/stock/report/ordered_items_to_be_delivered/ordered_items_to_be_delivered.json
+++ b/erpnext/stock/report/ordered_items_to_be_delivered/ordered_items_to_be_delivered.json
@@ -7,12 +7,12 @@
  "doctype": "Report", 
  "idx": 3, 
  "is_standard": "Yes", 
- "modified": "2017-02-24 20:04:38.689198", 
+ "modified": "2017-04-28 12:18:15.362019", 
  "modified_by": "Administrator", 
  "module": "Stock", 
  "name": "Ordered Items To Be Delivered", 
  "owner": "Administrator", 
- "query": "select \n `tabSales Order`.`name` as \"Sales Order:Link/Sales Order:120\",\n `tabSales Order`.`customer` as \"Customer:Link/Customer:120\",\n `tabSales Order`.`customer_name` as \"Customer Name::150\",\n `tabSales Order`.`transaction_date` as \"Date:Date\",\n `tabSales Order`.`project` as \"Project\",\n `tabSales Order Item`.item_code as \"Item:Link/Item:120\",\n `tabSales Order Item`.qty as \"Qty:Float:140\",\n `tabSales Order Item`.delivered_qty as \"Delivered Qty:Float:140\",\n (`tabSales Order Item`.qty - ifnull(`tabSales Order Item`.delivered_qty, 0)) as \"Qty to Deliver:Float:140\",\n `tabSales Order Item`.base_rate as \"Rate:Float:140\",\n `tabSales Order Item`.base_amount as \"Amount:Float:140\",\n ((`tabSales Order Item`.qty - ifnull(`tabSales Order Item`.delivered_qty, 0))*`tabSales Order Item`.base_rate) as \"Amount to Deliver:Float:140\",\n `tabBin`.actual_qty as \"Available Qty:Float:120\",\n `tabBin`.projected_qty as \"Projected Qty:Float:120\",\n `tabSales Order`.`delivery_date` as \"Expected Delivery Date:Date:120\",\n `tabSales Order Item`.item_name as \"Item Name::150\",\n `tabSales Order Item`.description as \"Description::200\",\n `tabSales Order Item`.item_group as \"Item Group:Link/Item Group:120\",\n `tabSales Order Item`.warehouse as \"Warehouse:Link/Warehouse:200\"\nfrom\n `tabSales Order` JOIN `tabSales Order Item` \n LEFT JOIN `tabBin` ON (`tabBin`.item_code = `tabSales Order Item`.item_code\n and `tabBin`.warehouse = `tabSales Order Item`.warehouse)\nwhere\n `tabSales Order Item`.`parent` = `tabSales Order`.`name`\n and `tabSales Order`.docstatus = 1\n and `tabSales Order`.status not in (\"Stopped\", \"Closed\")\n and ifnull(`tabSales Order Item`.delivered_qty,0) < ifnull(`tabSales Order Item`.qty,0)\norder by `tabSales Order`.transaction_date asc", 
+ "query": "select \n `tabSales Order`.`name` as \"Sales Order:Link/Sales Order:120\",\n `tabSales Order`.`customer` as \"Customer:Link/Customer:120\",\n `tabSales Order`.`customer_name` as \"Customer Name::150\",\n `tabSales Order`.`transaction_date` as \"Date:Date\",\n `tabSales Order`.`project` as \"Project:Link/Project:120\",\n `tabSales Order Item`.item_code as \"Item:Link/Item:120\",\n `tabSales Order Item`.qty as \"Qty:Float:140\",\n `tabSales Order Item`.delivered_qty as \"Delivered Qty:Float:140\",\n (`tabSales Order Item`.qty - ifnull(`tabSales Order Item`.delivered_qty, 0)) as \"Qty to Deliver:Float:140\",\n `tabSales Order Item`.base_rate as \"Rate:Float:140\",\n `tabSales Order Item`.base_amount as \"Amount:Float:140\",\n ((`tabSales Order Item`.qty - ifnull(`tabSales Order Item`.delivered_qty, 0))*`tabSales Order Item`.base_rate) as \"Amount to Deliver:Float:140\",\n `tabBin`.actual_qty as \"Available Qty:Float:120\",\n `tabBin`.projected_qty as \"Projected Qty:Float:120\",\n `tabSales Order`.`delivery_date` as \"Expected Delivery Date:Date:120\",\n `tabSales Order Item`.item_name as \"Item Name::150\",\n `tabSales Order Item`.description as \"Description::200\",\n `tabSales Order Item`.item_group as \"Item Group:Link/Item Group:120\",\n `tabSales Order Item`.warehouse as \"Warehouse:Link/Warehouse:200\"\nfrom\n `tabSales Order` JOIN `tabSales Order Item` \n LEFT JOIN `tabBin` ON (`tabBin`.item_code = `tabSales Order Item`.item_code\n and `tabBin`.warehouse = `tabSales Order Item`.warehouse)\nwhere\n `tabSales Order Item`.`parent` = `tabSales Order`.`name`\n and `tabSales Order`.docstatus = 1\n and `tabSales Order`.status not in (\"Stopped\", \"Closed\")\n and ifnull(`tabSales Order Item`.delivered_qty,0) < ifnull(`tabSales Order Item`.qty,0)\norder by `tabSales Order`.transaction_date asc", 
  "ref_doctype": "Delivery Note", 
  "report_name": "Ordered Items To Be Delivered", 
  "report_type": "Query Report", 
diff --git a/erpnext/stock/report/stock_balance/stock_balance.py b/erpnext/stock/report/stock_balance/stock_balance.py
index 2db741d..d14dba4 100644
--- a/erpnext/stock/report/stock_balance/stock_balance.py
+++ b/erpnext/stock/report/stock_balance/stock_balance.py
@@ -63,7 +63,7 @@
 		frappe.throw(_("'From Date' is required"))
 
 	if filters.get("to_date"):
-		conditions += " and sle.posting_date <= '%s'" % frappe.db.escape(filters["to_date"])
+		conditions += " and sle.posting_date <= '%s'" % frappe.db.escape(filters.get("to_date"))
 	else:
 		frappe.throw(_("'To Date' is required"))
 
@@ -108,8 +108,8 @@
 
 def get_item_warehouse_map(filters):
 	iwb_map = {}
-	from_date = getdate(filters["from_date"])
-	to_date = getdate(filters["to_date"])
+	from_date = getdate(filters.get("from_date"))
+	to_date = getdate(filters.get("to_date"))
 
 	sle = get_stock_ledger_entries(filters)
 
@@ -174,7 +174,7 @@
 	value = ()
 	if filters.get("item_code"):
 		condition = "where item_code=%s"
-		value = (filters["item_code"],)
+		value = (filters.get("item_code"),)
 
 	items = frappe.db.sql("""select name, item_name, stock_uom, item_group, brand, description
 		from tabItem {condition}""".format(condition=condition), value, as_dict=1)
diff --git a/erpnext/stock/report/stock_ledger/stock_ledger.js b/erpnext/stock/report/stock_ledger/stock_ledger.js
index fb60157..ce357db 100644
--- a/erpnext/stock/report/stock_ledger/stock_ledger.js
+++ b/erpnext/stock/report/stock_ledger/stock_ledger.js
@@ -38,6 +38,12 @@
 			"options": "Item"
 		},
 		{
+			"fieldname":"batch_no",
+			"label": __("Batch No"),
+			"fieldtype": "Link",
+			"options": "Batch"
+		},
+		{
 			"fieldname":"brand",
 			"label": __("Brand"),
 			"fieldtype": "Link",
diff --git a/erpnext/stock/report/stock_ledger/stock_ledger.py b/erpnext/stock/report/stock_ledger/stock_ledger.py
index 69fb490..ec55cec 100644
--- a/erpnext/stock/report/stock_ledger/stock_ledger.py
+++ b/erpnext/stock/report/stock_ledger/stock_ledger.py
@@ -10,9 +10,9 @@
 	sl_entries = get_stock_ledger_entries(filters)
 	item_details = get_item_details(filters)
 	opening_row = get_opening_balance(filters, columns)
-	
+
 	data = []
-	
+
 	if opening_row:
 		data.append(opening_row)
 
@@ -25,7 +25,7 @@
 			(sle.incoming_rate if sle.actual_qty > 0 else 0.0),
 			sle.valuation_rate, sle.stock_value, sle.voucher_type, sle.voucher_no,
 			sle.batch_no, sle.serial_no, sle.company])
-			
+
 	return columns, data
 
 def get_columns():
@@ -76,6 +76,8 @@
 		conditions.append(get_warehouse_condition(filters.get("warehouse")))
 	if filters.get("voucher_no"):
 		conditions.append("voucher_no=%(voucher_no)s")
+	if filters.get("batch_no"):
+		conditions.append("batch_no=%(batch_no)s")
 
 	return "and {}".format(" and ".join(conditions)) if conditions else ""
 
@@ -90,14 +92,14 @@
 		"posting_date": filters.from_date,
 		"posting_time": "00:00:00"
 	})
-	
+
 	row = [""]*len(columns)
 	row[1] = _("'Opening'")
 	for i, v in ((9, 'qty_after_transaction'), (11, 'valuation_rate'), (12, 'stock_value')):
 			row[i] = last_entry.get(v, 0)
-		
+
 	return row
-	
+
 def get_warehouse_condition(warehouse):
 	warehouse_details = frappe.db.get_value("Warehouse", warehouse, ["lft", "rgt"], as_dict=1)
 	if warehouse_details:
diff --git a/erpnext/stock/stock_ledger.py b/erpnext/stock/stock_ledger.py
index 948a626..d5f64b1 100644
--- a/erpnext/stock/stock_ledger.py
+++ b/erpnext/stock/stock_ledger.py
@@ -2,7 +2,7 @@
 # License: GNU General Public License v3. See license.txt
 from __future__ import unicode_literals
 
-import frappe
+import frappe, erpnext
 from frappe import _
 from frappe.utils import cint, flt, cstr, now
 from erpnext.stock.utils import get_valuation_method
@@ -258,14 +258,16 @@
 
 			if not self.valuation_rate and actual_qty > 0:
 				self.valuation_rate = sle.incoming_rate
-				
-			# Get valuation rate from previous SLE or Item master, if item is not a sample item
+
+			# Get valuation rate from previous SLE or Item master, if item does not have the 
+			# allow zero valuration rate flag set
 			if not self.valuation_rate and sle.voucher_detail_no:
-				is_sample_item = self.check_if_sample_item(sle.voucher_type, sle.voucher_detail_no)
-				if not is_sample_item:
-					self.valuation_rate = get_valuation_rate(sle.item_code, sle.warehouse, 
-						sle.voucher_type, sle.voucher_no, self.allow_zero_rate)
-		
+				allow_zero_valuation_rate = self.check_if_allow_zero_valuation_rate(sle.voucher_type, sle.voucher_detail_no)
+				if not allow_zero_valuation_rate:
+					self.valuation_rate = get_valuation_rate(sle.item_code, sle.warehouse,
+						sle.voucher_type, sle.voucher_no, self.allow_zero_rate,
+						currency=erpnext.get_company_currency(sle.company))
+
 	def get_fifo_values(self, sle):
 		incoming_rate = flt(sle.incoming_rate)
 		actual_qty = flt(sle.actual_qty)
@@ -289,13 +291,14 @@
 			while qty_to_pop:
 				if not self.stock_queue:
 					# Get valuation rate from last sle if exists or from valuation rate field in item master
-					is_sample_item = self.check_if_sample_item(sle.voucher_type, sle.voucher_detail_no)
-					if not is_sample_item:
-						_rate = get_valuation_rate(sle.item_code, sle.warehouse, 
-							sle.voucher_type, sle.voucher_no, self.allow_zero_rate)
+					allow_zero_valuation_rate = self.check_if_allow_zero_valuation_rate(sle.voucher_type, sle.voucher_detail_no)
+					if not allow_zero_valuation_rate:
+						_rate = get_valuation_rate(sle.item_code, sle.warehouse,
+							sle.voucher_type, sle.voucher_no, self.allow_zero_rate,
+							currency=erpnext.get_company_currency(sle.company))
 					else:
 						_rate = 0
-						
+
 					self.stock_queue.append([0, _rate])
 
 				index = None
@@ -341,11 +344,11 @@
 
 		if not self.stock_queue:
 			self.stock_queue.append([0, sle.incoming_rate or sle.outgoing_rate or self.valuation_rate])
-			
-	def check_if_sample_item(self, voucher_type, voucher_detail_no):
+
+	def check_if_allow_zero_valuation_rate(self, voucher_type, voucher_detail_no):
 		ref_item_dt = voucher_type + (" Detail" if voucher_type == "Stock Entry" else " Item")
-		return frappe.db.get_value(ref_item_dt, voucher_detail_no, "is_sample_item")
-		
+		return frappe.db.get_value(ref_item_dt, voucher_detail_no, "allow_zero_valuation_rate")
+
 	def get_sle_before_datetime(self):
 		"""get previous stock ledger entry before current time-bucket"""
 		return get_stock_ledger_entries(self.args, "<", "desc", "limit 1", for_update=False)
@@ -419,7 +422,8 @@
 			"order": order
 		}, previous_sle, as_dict=1, debug=debug)
 
-def get_valuation_rate(item_code, warehouse, voucher_type, voucher_no, allow_zero_rate=False):
+def get_valuation_rate(item_code, warehouse, voucher_type, voucher_no,
+	allow_zero_rate=False, currency=None):
 	# Get valuation rate from last sle for the same item and warehouse
 	last_valuation_rate = frappe.db.sql("""select valuation_rate
 		from `tabStock Ledger Entry`
@@ -441,6 +445,11 @@
 		# syste does not found any SLE, then take valuation rate from Item
 		valuation_rate = frappe.db.get_value("Item", item_code, "valuation_rate")
 
+	if not valuation_rate:
+		# try in price list
+		valuation_rate = frappe.db.get_value('Item Price',
+			dict(item_code=item_code, buying=1, currency=currency), 'price_list_rate')
+
 	if not allow_zero_rate and not valuation_rate \
 			and cint(frappe.db.get_value("Accounts Settings", None, "auto_accounting_for_stock")):
 		frappe.local.message_log = []
diff --git a/erpnext/support/doctype/issue/issue.json b/erpnext/support/doctype/issue/issue.json
index 476e3a8..6ee0e85 100644
--- a/erpnext/support/doctype/issue/issue.json
+++ b/erpnext/support/doctype/issue/issue.json
@@ -1,5 +1,6 @@
 {
  "allow_copy": 0, 
+ "allow_guest_to_view": 0, 
  "allow_import": 1, 
  "allow_rename": 1, 
  "autoname": "naming_series:", 
@@ -285,7 +286,7 @@
    "columns": 0, 
    "depends_on": "", 
    "fieldname": "description", 
-   "fieldtype": "Text", 
+   "fieldtype": "Text Editor", 
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
@@ -607,7 +608,7 @@
    "columns": 0, 
    "depends_on": "eval:!doc.__islocal", 
    "fieldname": "resolution_details", 
-   "fieldtype": "Small Text", 
+   "fieldtype": "Text Editor", 
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
@@ -808,18 +809,18 @@
    "unique": 0
   }
  ], 
+ "has_web_view": 0, 
  "hide_heading": 0, 
  "hide_toolbar": 0, 
  "icon": "fa fa-ticket", 
  "idx": 7, 
  "image_view": 0, 
  "in_create": 0, 
- "in_dialog": 0, 
  "is_submittable": 0, 
  "issingle": 0, 
  "istable": 0, 
  "max_attachments": 0, 
- "modified": "2017-02-20 13:32:31.898423", 
+ "modified": "2017-04-05 21:42:23.740187", 
  "modified_by": "Administrator", 
  "module": "Support", 
  "name": "Issue", 
diff --git a/erpnext/templates/generators/item_group.html b/erpnext/templates/generators/item_group.html
index f027644..d710cb0 100644
--- a/erpnext/templates/generators/item_group.html
+++ b/erpnext/templates/generators/item_group.html
@@ -33,14 +33,14 @@
 		</div>
 		<div class="text-center item-group-nav-buttons">
 			{% if frappe.form_dict.start|int > 0 %}
-			<a class="btn btn-default" href="/{{ pathname }}?start={{ frappe.form_dict.start|int - page_length }}">Prev</a>
+			<a class="btn btn-default" href="/{{ pathname }}?start={{ frappe.form_dict.start|int - page_length }}">{{ __("Prev") }}</a>
 			{% endif %}
 			{% if items|length > page_length %}
-			<a class="btn btn-default" href="/{{ pathname }}?start={{ frappe.form_dict.start|int + page_length }}">Next</a>
+			<a class="btn btn-default" href="/{{ pathname }}?start={{ frappe.form_dict.start|int + page_length }}">{{ __("Next") }}</a>
 			{% endif %}
 		</div>
 		{% else %}
-			<div class="text-muted">No items listed.</div>
+			<div class="text-muted">{{ __("No items listed") }}.</div>
 		{% endif %}
 	</div>
 </div>
diff --git a/erpnext/templates/includes/footer/footer_extension.html b/erpnext/templates/includes/footer/footer_extension.html
index 897a804..5d706a4 100644
--- a/erpnext/templates/includes/footer/footer_extension.html
+++ b/erpnext/templates/includes/footer/footer_extension.html
@@ -12,7 +12,7 @@
 frappe.ready(function() {
 	$("#footer-subscribe-button").click(function() {
 
-		if($("#footer-subscribe-email").val()) {
+		if($("#footer-subscribe-email").val() && valid_email($("#footer-subscribe-email").val())) {
 			$("#footer-subscribe-email").attr('disabled', true);
 			$("#footer-subscribe-button").html("Sending...")
 				.attr("disabled", true);
@@ -31,7 +31,7 @@
 			});
 		}
 		else
-			frappe.msgprint(frappe._("Please enter email address"))
+			frappe.msgprint(frappe._("Please enter valid email address"))
 	});
 });
 </script>
diff --git a/erpnext/templates/includes/navbar/navbar_items.html b/erpnext/templates/includes/navbar/navbar_items.html
index 87dea8f..faf8adf 100644
--- a/erpnext/templates/includes/navbar/navbar_items.html
+++ b/erpnext/templates/includes/navbar/navbar_items.html
@@ -4,7 +4,7 @@
 	<li class="shopping-cart hidden">
 		<div class="cart-icon">
 			<a class="dropdown-toggle" href="#" data-toggle="dropdown" id="navLogin">
-				Cart <span class="badge-wrapper" id="cart-count"></span>
+				{{ _("Cart") }} <span class="badge-wrapper" id="cart-count"></span>
 			</a>
 			<div id="cart-overlay" class="dropdown-menu shopping-cart-menu"></div>
 		</div>
diff --git a/erpnext/templates/includes/product_page.js b/erpnext/templates/includes/product_page.js
index b37f7aa..4d1446b 100644
--- a/erpnext/templates/includes/product_page.js
+++ b/erpnext/templates/includes/product_page.js
@@ -12,7 +12,7 @@
 			item_code: get_item_code()
 		},
 		callback: function(r) {
-			$(".item-cart").toggleClass("hide", (!!!r.message.price || !!!r.message.stock));
+			$(".item-cart").toggleClass("hide", (!!!r.message.price || !!!r.message.in_stock));
 			if(r.message && r.message.price) {
 				$(".item-price")
 					.html(r.message.price.formatted_price + " per " + r.message.uom);
diff --git a/erpnext/templates/includes/projects/project_search_box.html b/erpnext/templates/includes/projects/project_search_box.html
index ab02f0c..96eb10c 100644
--- a/erpnext/templates/includes/projects/project_search_box.html
+++ b/erpnext/templates/includes/projects/project_search_box.html
@@ -1,19 +1,19 @@
 <div class="project-search text-muted pull-right">
-	<input type="text" id="project-search" placeholder="Quick Search">	
-	<i class="octicon octicon-search"></i> 	
+	<input type="text" id="project-search" placeholder="Quick Search">
+	<i class="octicon octicon-search"></i>
 </div>
 <div class="clearfix pull-right" style="width:300px;">
-	<h4 class="project-search-results pull-left"></h4> 
-	<p class="pull-right"> 
-		<a style="display: none; padding-left:5px;" href="/projects?project={{doc.name}}" class="octicon octicon-x 			text-extra-muted clear" title="Clear Search" ></a> 
-	</p> 
+	<h4 class="project-search-results pull-left"></h4>
+	<p class="pull-right">
+		<a style="display: none; padding-left:5px;" href="/projects?project={{doc.name}}" class="octicon octicon-x 			text-extra-muted clear" title="Clear Search" ></a>
+	</p>
 </div>
 
 <script>
 frappe.ready(function() {
 	if(get_url_arg("q")){
 	var txt = get_url_arg("q");
-	$(".project-search-results").html("Search results for : " + txt);
+	$(".project-search-results").html("Search results for : " + encodeURIComponent(txt));
 	$(".clear").toggle(true);
 	}
 	var thread = null;
diff --git a/erpnext/templates/includes/projects/project_tasks.html b/erpnext/templates/includes/projects/project_tasks.html
index e978a7d..c978576 100644
--- a/erpnext/templates/includes/projects/project_tasks.html
+++ b/erpnext/templates/includes/projects/project_tasks.html
@@ -6,7 +6,7 @@
 				<span class="indicator {{ "red" if task.status=="Open" else "green" if task.status=="Closed" else "darkgrey" }}" title="{{ task.status }}"  > {{ task.subject }}</span> 
 	 				<div class="small text-muted item-timestamp"
 	 					title="{{ frappe.utils.pretty_date(task.modified) }}">
-	 					modified {{ frappe.utils.pretty_date(task.modified) }}
+	 					{{ __("modified") }} {{ frappe.utils.pretty_date(task.modified) }}
 	 				</div>
 			</div>
 			<div class='col-xs-1'>{% if task.todo %}
diff --git a/erpnext/templates/includes/projects/project_timesheets.html b/erpnext/templates/includes/projects/project_timesheets.html
index fb44017..3a9aecd 100644
--- a/erpnext/templates/includes/projects/project_timesheets.html
+++ b/erpnext/templates/includes/projects/project_timesheets.html
@@ -5,7 +5,7 @@
 			<div class='col-xs-9'>
 				<span class="indicator {{ "blue" if timesheet.info.status=="Submitted" else "red" if timesheet.info.status=="Draft" else "darkgrey" }}" title="{{ timesheet.info.status }}"  > {{ timesheet.info.name }} </span> 
 				<div class="small text-muted item-timestamp">
-				From {{ frappe.format_date(timesheet.from_time) }} to {{ frappe.format_date(timesheet.to_time) }}
+				{{ __("From") }} {{ frappe.format_date(timesheet.from_time) }} {{ __("to") }} {{ frappe.format_date(timesheet.to_time) }}
 			</div>
 			</div>
 				<div class='col-xs-1 gravatar-top'>
diff --git a/erpnext/templates/includes/rfq.js b/erpnext/templates/includes/rfq.js
index 46357d4..3b45cbe 100644
--- a/erpnext/templates/includes/rfq.js
+++ b/erpnext/templates/includes/rfq.js
@@ -34,7 +34,7 @@
 			me.qty = parseFloat($(this).val()) || 0;
 			me.rate = parseFloat($(repl('.rfq-rate[data-idx=%(idx)s]',{'idx': me.idx})).val());
 			me.update_qty_rate();
-			$(this).val(format_number(me.qty, 2));
+			$(this).val(format_number(me.qty, doc.number_format, 2));
 		})
 	},
 
@@ -45,7 +45,7 @@
 			me.rate = parseFloat($(this).val()) || 0;
 			me.qty = parseFloat($(repl('.rfq-qty[data-idx=%(idx)s]',{'idx': me.idx})).val());
 			me.update_qty_rate();
-			$(this).val(format_number(me.rate, 2));
+			$(this).val(format_number(me.rate, doc.number_format, 2));
 		})
 	},
 
diff --git a/erpnext/templates/pages/cart.html b/erpnext/templates/pages/cart.html
index 6cff5b1..fb0c05f 100644
--- a/erpnext/templates/pages/cart.html
+++ b/erpnext/templates/pages/cart.html
@@ -60,7 +60,7 @@
 				{{doc.terms}}
 			</div>
 			<div class="cart-link">
-				<a href="#" onclick="show_terms();return false;">*Terms and Conditions</a>
+				<a href="#" onclick="show_terms();return false;">*{{ __("Terms and Conditions") }}</a>
 			</div>
 		{% endif %}
 
diff --git a/erpnext/templates/pages/demo.html b/erpnext/templates/pages/demo.html
index 108319f..f94a7c4 100644
--- a/erpnext/templates/pages/demo.html
+++ b/erpnext/templates/pages/demo.html
@@ -44,7 +44,7 @@
 {% endblock %}
 
 {% block title %}
-{{ _("Login") }}
+{{ _("ERPNext Demo") }}
 {% endblock %}
 
 {% block page_content %}
diff --git a/erpnext/templates/pages/product_search.html b/erpnext/templates/pages/product_search.html
index c7134b0..d00f535 100644
--- a/erpnext/templates/pages/product_search.html
+++ b/erpnext/templates/pages/product_search.html
@@ -10,7 +10,7 @@
 <script>
 frappe.ready(function() {
 	var txt = get_url_arg("search");
-	$(".search-results").html("{{ _('Search results for') }}: " + txt);
+	$(".search-results").html("{{ _('Search results for') }}: " + encodeURIComponent(txt));
 	window.search = txt;
 	window.start = 0;
 	window.get_product_list();
diff --git a/erpnext/templates/pages/product_search.py b/erpnext/templates/pages/product_search.py
index c0c39cf..49f321d 100644
--- a/erpnext/templates/pages/product_search.py
+++ b/erpnext/templates/pages/product_search.py
@@ -3,7 +3,7 @@
 
 from __future__ import unicode_literals
 import frappe
-from frappe.utils import cstr, nowdate
+from frappe.utils import cstr, nowdate, cint
 from erpnext.setup.doctype.item_group.item_group import get_item_for_list_in_html
 
 no_cache = 1
@@ -20,10 +20,9 @@
 	query = """select name, item_name, item_code, route, website_image, thumbnail, item_group,
 			description, web_long_description as website_description
 		from `tabItem`
-		where show_in_website = 1
+		where (show_in_website = 1 or show_variant_in_website = 1)
 			and disabled=0
-			and (end_of_life is null or end_of_life='0000-00-00' or end_of_life > %(today)s)
-			and (variant_of is null or variant_of = '')"""
+			and (end_of_life is null or end_of_life='0000-00-00' or end_of_life > %(today)s)"""
 
 	# search term condition
 	if search:
@@ -34,7 +33,7 @@
 		search = "%" + cstr(search) + "%"
 
 	# order by
-	query += """ order by weightage desc, idx desc, modified desc limit %s, %s""" % (start, limit)
+	query += """ order by weightage desc, idx desc, modified desc limit %s, %s""" % (cint(start), cint(limit))
 
 	data = frappe.db.sql(query, {
 		"search": search,
diff --git a/erpnext/templates/pages/task_info.html b/erpnext/templates/pages/task_info.html
index f386ce8..6cfac28 100644
--- a/erpnext/templates/pages/task_info.html
+++ b/erpnext/templates/pages/task_info.html
@@ -19,9 +19,9 @@
 	<div class="col-sm-4">
 		<div class="page-header-actions-block" data-html-block="header-actions">
 			<button type="submit" class="btn btn-primary btn-sm btn-form-submit">
-	    		Update</button>
+	    		{{ __("Update") }}</button>
 	    		<a href="tasks" class="btn btn-default btn-sm">
-	    		Cancel</a>
+	    		{{ __("Cancel") }}</a>
 		</div>
     </div>
 </div>
@@ -36,45 +36,45 @@
 		<div class="row">
 			<div class="col-sm-12" style="max-width: 500px;">
 				<div class="form-group">
-					<label for="project" class="control-label text-muted small">Project</label>
+					<label for="project" class="control-label text-muted small">{{ __("Project") }}</label>
 						<input type="text" class="form-control" name="project" readonly value= "{{ doc.project }}">
 				</div>
 
 				<div class="form-group">
-					<label for="subject" class="control-label text-muted small">Subject</label>
+					<label for="subject" class="control-label text-muted small">{{ __("Subject") }}</label>
 					<input type="text" class="form-control" name="subject" readonly value="{{ doc.subject }}">
 				</div>
 
 				<div class="form-group">
-					<label for="description" class="control-label text-muted small">Details</label>
+					<label for="description" class="control-label text-muted small">{{ __("Details") }}</label>
 					<textarea class="form-control" style="height: 200px;" name="description">{{ doc.description }}</textarea>
 				</div>
 
 				<div class="form-group">
-					<label for="priority" class="control-label text-muted small">Priority</label>
+					<label for="priority" class="control-label text-muted small">{{ __("Priority") }}</label>
 					<input type="text" class="form-control" name="priority" readonly value="{{ doc.priority }}">
 				</div>
 
 				<div class="form-group">
-					<label for="exp_start_date" class="control-label text-muted small">Expected Start Date</label>
+					<label for="exp_start_date" class="control-label text-muted small">{{ __("Expected Start Date") }}</label>
 					<input type="text" class="form-control hasDatepicker" name="exp_start_date" readonly value="{{ doc.exp_start_date }}">
 				</div>
 
 				<div class="form-group">
-					<label for="exp_end_date" class="control-label text-muted small">Expected End Date</label>
+					<label for="exp_end_date" class="control-label text-muted small">{{ __("Expected End Date") }}</label>
 					<input type="text" class="form-control hasDatepicker" name="exp_end_date" readonly value="{{ doc.exp_end_date }}">
 				</div>
 
 				<div class="form-group">
-					<label for="status" class="control-label text-muted small">Status</label>
+					<label for="status" class="control-label text-muted small">{{ __("Status") }}</label>
 					<select class="form-control" name="status" id="status" data-label="Status" data-fieldtype="Select">
 						<option value="Open" selected="selected">
-							Open</option><option value="Working">
-							Working</option><option value="Pending Review">
-							Pending Review</option><option value="Overdue">
-							Overdue</option><option value="Closed">
-							Closed</option><option value="Cancelled">
-							Cancelled</option>
+							{{ __("Open") }}</option><option value="Working">
+							{{ __("Working") }}</option><option value="Pending Review">
+							{{ __("Pending Review") }}</option><option value="Overdue">
+							{{ __("Overdue") }}</option><option value="Closed">
+							{{ __("Closed") }}</option><option value="Cancelled">
+							{{ __("Cancelled") }}</option>
 					</select>
 				</div>
 			</div>
@@ -83,22 +83,22 @@
 </div>
 
 <div class="comments">
-	<h3>Comments</h3>
+	<h3>{{ __("Comments") }}</h3>
 	<div class="no-comment">
 		{% for comment in comments %}
 			<p class="text-muted">{{comment.sender_full_name}}:
-				{{comment.subject}} on 									   				{{comment.creation.strftime('%Y-%m-%d')}}</p>
+				{{comment.subject}} {{ __("on") }} 									   				{{comment.creation.strftime('%Y-%m-%d')}}</p>
 		{% endfor %}
 	</div>
 	<div class="comment-form-wrapper">
-		<a class="add-comment btn btn-default btn-sm">Add Comment</a>
+		<a class="add-comment btn btn-default btn-sm">{{ __("Add Comment") }}</a>
 		<div style="display: none;" id="comment-form">
-			<p>Add Comment</p>
+			<p>{{ __("Add Comment") }}</p>
 			<form>
 				<fieldset>
 					<textarea class="form-control" name="comment" rows="5" placeholder="Comment"></textarea>
 					<p>
-						<button class="btn btn-primary btn-sm" id="submit-comment">Submit</button>
+						<button class="btn btn-primary btn-sm" id="submit-comment">{{ __("Submit") }}</button>
 					</p>
 				</fieldset>
 			</form>
diff --git a/erpnext/templates/pages/timelog_info.html b/erpnext/templates/pages/timelog_info.html
index 8b2fa6a..22ea3e4 100644
--- a/erpnext/templates/pages/timelog_info.html
+++ b/erpnext/templates/pages/timelog_info.html
@@ -19,28 +19,28 @@
 	<div class="page-content-block">
 		<div class="row">
 			<div class="col-sm-12" style="max-width: 500px;">
-				<label for="project" class="control-label text-muted small">Project</label>
+				<label for="project" class="control-label text-muted small">{{ __("Project") }}</label>
 				<input type="text" class="form-control" name="project" readonly value= "{{ doc.project }}">
 
-				<label for="activity_type" class="control-label text-muted small">Activity Type</label>
+				<label for="activity_type" class="control-label text-muted small">{{ __("Activity Type") }}</label>
 				<input type="text" class="form-control" name="activity_type" readonly value= "{{ doc.activity_type }}">
 
-				<label for="task" class="control-label text-muted small">Task</label>
+				<label for="task" class="control-label text-muted small">{{ __("Task") }}</label>
 				<input type="text" class="form-control" name="task" readonly value= "{{ doc.task }}">
 
-				<label for="from_time" class="control-label text-muted small">From Time</label>
+				<label for="from_time" class="control-label text-muted small">{{ __("From Time") }}</label>
 				<input type="text" class="form-control" name="from_time" readonly value= "{{ doc.from_time }}">
 
-				<label for="to_time" class="control-label text-muted small">To Time</label>
+				<label for="to_time" class="control-label text-muted small">{{ __("To Time") }}</label>
 				<input type="text" class="form-control" name="to_time" readonly value= "{{ doc.to_time }}">
 
-				<label for="to_time" class="control-label text-muted small">Hours</label>
+				<label for="to_time" class="control-label text-muted small">{{ __("Hours") }}</label>
 				<input type="text" class="form-control" name="Hours" readonly value= "{{ doc.hours }}">
 
-				<label for="status" class="control-label text-muted small">Status</label>
+				<label for="status" class="control-label text-muted small">{{ __("Status") }}</label>
 				<input type="text" class="form-control" name="status" readonly value= "{{ doc.status }}">
 
-				<label for="Note" class="control-label text-muted small">Note</label>
+				<label for="Note" class="control-label text-muted small">{{ __("Note") }}</label>
 				<textarea class="form-control" name="Hours" readonly> {{ doc.note }} </textarea>
 			</div>
 		</div>
diff --git a/erpnext/translations/de.csv b/erpnext/translations/de.csv
index 95d2837..d5d65ac 100644
--- a/erpnext/translations/de.csv
+++ b/erpnext/translations/de.csv
@@ -49,7 +49,7 @@
 apps/erpnext/erpnext/hr/doctype/process_payroll/process_payroll.py +179,Accural Journal Entry Submitted,Accural Journal Entry Eingereicht
 DocType: Pricing Rule,Apply On,Anwenden auf
 DocType: Item Price,Multiple Item prices.,Mehrere verschiedene Artikelpreise
-,Purchase Order Items To Be Received,Eingehende Lieferantenauftrags-Artikel
+,Purchase Order Items To Be Received,Eingehende Bestellungs-Artikel
 DocType: SMS Center,All Supplier Contact,Alle Lieferantenkontakte
 DocType: Support Settings,Support Settings,Support-Einstellungen
 DocType: SMS Parameter,Parameter,Parameter
@@ -325,7 +325,7 @@
 apps/erpnext/erpnext/buying/doctype/purchase_order/purchase_order.js +877,Material Request,Materialanfrage
 DocType: Bank Reconciliation,Update Clearance Date,Abwicklungsdatum aktualisieren
 DocType: Item,Purchase Details,Einkaufsdetails
-apps/erpnext/erpnext/stock/doctype/stock_entry/stock_entry.py +348,Item {0} not found in 'Raw Materials Supplied' table in Purchase Order {1},"Artikel {0} in Tabelle ""Rohmaterialien geliefert"" des Lieferantenauftrags {1} nicht gefunden"
+apps/erpnext/erpnext/stock/doctype/stock_entry/stock_entry.py +348,Item {0} not found in 'Raw Materials Supplied' table in Purchase Order {1},"Artikel {0} in Tabelle ""Rohmaterialien geliefert"" der Bestellung {1} nicht gefunden"
 DocType: Employee,Relation,Beziehung
 DocType: Shipping Rule,Worldwide Shipping,Weltweiter Versand
 DocType: Student Guardian,Mother,Mutter
@@ -784,7 +784,7 @@
 
 #### Description of Columns
 
-1. Calculation Type: 
+1. Calculation Type:
     - This can be on **Net Total** (that is the sum of basic amount).
     - **On Previous Row Total / Amount** (for cumulative taxes or charges). If you select this option, the tax will be applied as a percentage of the previous row (in the tax table) amount or total.
     - **Actual** (as mentioned).
@@ -795,15 +795,15 @@
 6. Amount: Tax amount.
 7. Total: Cumulative total to this point.
 8. Enter Row: If based on ""Previous Row Total"" you can select the row number which will be taken as a base for this calculation (default is the previous row).
-9. Is this Tax included in Basic Rate?: If you check this, it means that this tax will not be shown below the item table, but will be included in the Basic Rate in your main item table. This is useful where you want give a flat price (inclusive of all taxes) price to customers.","Standard-Steuer-Vorlage, die für alle Kauftransaktionen angewandt werden kann. Diese Vorlage kann eine Liste der Steuern und auch anderer Kosten wie ""Versand"", ""Versicherung"", ""Handhabung"" usw. enthalten. 
+9. Is this Tax included in Basic Rate?: If you check this, it means that this tax will not be shown below the item table, but will be included in the Basic Rate in your main item table. This is useful where you want give a flat price (inclusive of all taxes) price to customers.","Standard-Steuer-Vorlage, die für alle Kauftransaktionen angewandt werden kann. Diese Vorlage kann eine Liste der Steuern und auch anderer Kosten wie ""Versand"", ""Versicherung"", ""Handhabung"" usw. enthalten.
 
- #### Hinweis 
+ #### Hinweis
 
 Der Steuersatz, den sie hier definieren, wird der Standardsteuersatz für alle Artikel. Wenn es Artikel mit davon abweichenden Steuersätzen gibt, müssen diese in der Tabelle ""Artikelsteuer"" im Artikelstamm hinzugefügt werden.
 
- #### Beschreibung der Spalten 
+ #### Beschreibung der Spalten
 
-1. Berechnungsart: 
+1. Berechnungsart:
 - Dies kann sein ""Auf Nettosumme"" (das ist die Summe der Grundbeträge).
 - ""Auf vorherige Zeilensumme/-Betrag"" (für kumulative Steuern oder Abgaben). Wenn diese Option ausgewählt wird, wird die Steuer als Prozentsatz der vorherigen Zeilesumme/des vorherigen Zeilenbetrags (in der Steuertabelle) angewendet.
 - ""Unmittelbar"" (wie bereits erwähnt).
@@ -890,7 +890,7 @@
 apps/erpnext/erpnext/buying/doctype/purchase_common/purchase_common.py +81,{0} {1} status is {2},{0} {1} Status ist {2}
 DocType: Employee,Provide Email Address registered in company,Geben Sie E-Mail-Adresse in Unternehmen registriert
 DocType: Shopping Cart Settings,Enable Checkout,Aktivieren Kasse
-apps/erpnext/erpnext/config/learn.py +202,Purchase Order to Payment,Vom Lieferantenauftrag zur Zahlung
+apps/erpnext/erpnext/config/learn.py +202,Purchase Order to Payment,Von Bestellung zur Zahlung
 apps/erpnext/erpnext/stock/page/stock_balance/stock_balance.js +48,Projected Qty,Geplante Menge
 DocType: Sales Invoice,Payment Due Date,Zahlungsstichtag
 apps/erpnext/erpnext/stock/doctype/item/item.js +340,Item Variant {0} already exists with same attributes,Artikelvariante {0} mit denselben Attributen existiert bereits
@@ -1002,7 +1002,7 @@
 DocType: Job Opening,Publish on website,Veröffentlichen Sie auf der Website
 apps/erpnext/erpnext/config/stock.py +17,Shipments to customers.,Lieferungen an Kunden
 apps/erpnext/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py +623,Supplier Invoice Date cannot be greater than Posting Date,Lieferant Rechnungsdatum kann nicht größer sein als Datum der Veröffentlichung
-DocType: Purchase Invoice Item,Purchase Order Item,Lieferantenauftrags-Artikel
+DocType: Purchase Invoice Item,Purchase Order Item,Bestell-Artikel
 apps/erpnext/erpnext/accounts/doctype/account/chart_of_accounts/verified/standard_chart_of_accounts.py +130,Indirect Income,Indirekte Erträge
 DocType: Student Attendance Tool,Student Attendance Tool,Schülerteilnahme Werkzeug
 DocType: Cheque Print Template,Date Settings,Datums-Einstellungen
@@ -1017,10 +1017,10 @@
 DocType: Pricing Rule,Max Qty,Maximalmenge
 apps/erpnext/erpnext/accounts/doctype/c_form/c_form.py +30,"Row {0}: Invoice {1} is invalid, it might be cancelled / does not exist. \
 						Please enter a valid Invoice","Row {0}: Rechnung {1} ist ungültig, könnte es abgebrochen werden / nicht vorhanden. \ Bitte geben Sie eine gültige Rechnung"
-apps/erpnext/erpnext/accounts/doctype/journal_entry/journal_entry.py +120,Row {0}: Payment against Sales/Purchase Order should always be marked as advance,"Zeile {0}: ""Zahlung zu Kunden-/Lieferantenauftrag"" sollte immer als ""Vorkasse"" eingestellt werden"
+apps/erpnext/erpnext/accounts/doctype/journal_entry/journal_entry.py +120,Row {0}: Payment against Sales/Purchase Order should always be marked as advance,"Zeile {0}: ""Zahlung zu Kundenauftrag / Bestellung"" sollte immer als ""Vorkasse"" eingestellt werden"
 apps/erpnext/erpnext/setup/setup_wizard/industry_type.py +16,Chemical,Chemische Industrie
 DocType: Salary Component Account,Default Bank / Cash account will be automatically updated in Salary Journal Entry when this mode is selected.,"Standard Bank / Geldkonto wird automatisch in Gehalts Journal Entry aktualisiert werden, wenn dieser Modus ausgewählt ist."
-apps/erpnext/erpnext/schools/doctype/grading_structure/grading_structure.py +24,"The intervals for Grade Code {0} overlaps with the grade intervals for other grades. 
+apps/erpnext/erpnext/schools/doctype/grading_structure/grading_structure.py +24,"The intervals for Grade Code {0} overlaps with the grade intervals for other grades.
                     Please check intervals {0} and {1} and try again",Die Intervalle für Grade-Code {0} überlappt mit der Note Intervalle für andere Typen. Bitte überprüfen Sie Intervalle {0} und {1} und versuchen Sie es erneut
 DocType: BOM,Raw Material Cost(Company Currency),Rohstoffkosten (Gesellschaft Währung)
 apps/erpnext/erpnext/stock/doctype/stock_entry/stock_entry.py +715,All items have already been transferred for this Production Order.,Alle Artikel wurden schon für diesen Fertigungsauftrag übernommen.
@@ -1290,7 +1290,7 @@
 DocType: Student Applicant,AP,AP
 DocType: Purchase Invoice Item,BOM,Stückliste
 apps/erpnext/erpnext/setup/doctype/item_group/item_group.js +37,This is a root item group and cannot be edited.,Dies ist eine Root-Artikelgruppe und kann nicht bearbeitet werden.
-DocType: Journal Entry Account,Purchase Order,Lieferantenauftrag
+DocType: Journal Entry Account,Purchase Order,Bestellung
 DocType: Vehicle,Fuel UOM,Kraftstoff UOM
 DocType: Warehouse,Warehouse Contact Info,Kontaktinformation des Lager
 DocType: Payment Entry,Write Off Difference Amount,Write Off Differenzbetrag
@@ -1541,7 +1541,7 @@
 DocType: Loan Type,Maximum Loan Amount,Maximale Darlehensbetrag
 DocType: Pricing Rule,Pricing Rule,Preisregel
 DocType: Budget,Action if Annual Budget Exceeded,Erwünschte Aktion bei überschrittenem jährlichem Budget
-apps/erpnext/erpnext/config/learn.py +197,Material Request to Purchase Order,Von der Materialanfrage zum Lieferantenauftrag
+apps/erpnext/erpnext/config/learn.py +197,Material Request to Purchase Order,Von der Materialanfrage zur Bestellung
 DocType: Shopping Cart Settings,Payment Success URL,Payment Success URL
 apps/erpnext/erpnext/controllers/sales_and_purchase_return.py +80,Row # {0}: Returned Item {1} does not exists in {2} {3},Zeile # {0}: Zurückgegebener Artikel {1} existiert nicht in {2} {3}
 DocType: Purchase Receipt,PREC-,PREC-
@@ -1552,7 +1552,7 @@
 DocType: C-Form,III,III
 apps/erpnext/erpnext/config/stock.py +305,Opening Stock Balance,Eröffnungsbestände
 apps/erpnext/erpnext/stock/doctype/item_attribute/item_attribute.py +58,{0} must appear only once,{0} darf nur einmal vorkommen
-apps/erpnext/erpnext/stock/doctype/stock_entry/stock_entry.py +359,Not allowed to tranfer more {0} than {1} against Purchase Order {2},Übertragung von mehr {0} als {1} mit Lieferantenauftrag {2} nicht erlaubt
+apps/erpnext/erpnext/stock/doctype/stock_entry/stock_entry.py +359,Not allowed to tranfer more {0} than {1} against Purchase Order {2},Übertragung von mehr {0} als {1} gegen Bestellung {2} nicht erlaubt
 apps/erpnext/erpnext/hr/doctype/leave_control_panel/leave_control_panel.py +59,Leaves Allocated Successfully for {0},Erfolgreich zugewiesene Abwesenheiten für {0}
 apps/erpnext/erpnext/stock/doctype/packing_slip/packing_slip.py +40,No Items to pack,Keine Artikel zum Verpacken
 DocType: Shipping Rule Condition,From Value,Von-Wert
@@ -1730,7 +1730,7 @@
 apps/erpnext/erpnext/crm/doctype/opportunity/opportunity.py +32,Opportunity From field is mandatory,"Feld ""Chance von"" ist zwingend erforderlich"
 DocType: Email Digest,Annual Expenses,Jährliche Kosten
 DocType: Item,Variants,Varianten
-apps/erpnext/erpnext/selling/doctype/sales_order/sales_order.js +994,Make Purchase Order,Lieferantenauftrag erstellen
+apps/erpnext/erpnext/selling/doctype/sales_order/sales_order.js +994,Make Purchase Order,Bestellung erstellen
 DocType: SMS Center,Send To,Senden an
 apps/erpnext/erpnext/hr/doctype/leave_application/leave_application.py +152,There is not enough leave balance for Leave Type {0},Es gibt nicht genügend verfügbaren Urlaub für Urlaubstyp {0}
 DocType: Payment Reconciliation Payment,Allocated amount,Zugewiesene Menge
@@ -2333,7 +2333,7 @@
 apps/erpnext/erpnext/hr/doctype/employee/employee.py +119,Contract End Date must be greater than Date of Joining,Vertragsende muss weiter in der Zukunft liegen als Eintrittsdatum sein
 DocType: Delivery Note,DN-,DN-
 DocType: Sales Partner,A third party distributor / dealer / commission agent / affiliate / reseller who sells the companies products for a commission.,"Ein Drittanbieter/Händler/Kommissionär/verbundenes Unternehmen/Wiederverkäufer, der die Produkte auf Provisionsbasis verkauft."
-apps/erpnext/erpnext/accounts/doctype/journal_entry/journal_entry.py +364,{0} against Purchase Order {1},{0} zu Lieferantenauftrag {1}
+apps/erpnext/erpnext/accounts/doctype/journal_entry/journal_entry.py +364,{0} against Purchase Order {1},{0} zu Bestellung {1}
 DocType: SMS Settings,"Enter static url parameters here (Eg. sender=ERPNext, username=ERPNext, password=1234 etc.)","Statische URL-Parameter hier eingeben (z. B. Absender=ERPNext, Benutzername=ERPNext, Passwort=1234 usw.)"
 DocType: Task,Actual Start Date (via Time Sheet),Das tatsächliche Startdatum (durch Zeiterfassung)
 apps/erpnext/erpnext/portal/doctype/homepage/homepage.py +15,This is an example website auto-generated from ERPNext,"Dies ist eine Beispiel-Webseite, von ERPNext automatisch generiert"
@@ -2346,7 +2346,7 @@
 
 #### Description of Columns
 
-1. Calculation Type: 
+1. Calculation Type:
     - This can be on **Net Total** (that is the sum of basic amount).
     - **On Previous Row Total / Amount** (for cumulative taxes or charges). If you select this option, the tax will be applied as a percentage of the previous row (in the tax table) amount or total.
     - **Actual** (as mentioned).
@@ -2358,15 +2358,15 @@
 7. Total: Cumulative total to this point.
 8. Enter Row: If based on ""Previous Row Total"" you can select the row number which will be taken as a base for this calculation (default is the previous row).
 9. Consider Tax or Charge for: In this section you can specify if the tax / charge is only for valuation (not a part of total) or only for total (does not add value to the item) or for both.
-10. Add or Deduct: Whether you want to add or deduct the tax.","Standard-Steuer-Vorlage, die für alle Kauftransaktionen angewandt werden kann. Diese Vorlage kann eine Liste der Steuern und auch anderer Kosten wie ""Versand"", ""Versicherung"", ""Handhabung"" usw. enthalten. 
+10. Add or Deduct: Whether you want to add or deduct the tax.","Standard-Steuer-Vorlage, die für alle Kauftransaktionen angewandt werden kann. Diese Vorlage kann eine Liste der Steuern und auch anderer Kosten wie ""Versand"", ""Versicherung"", ""Handhabung"" usw. enthalten.
 
- #### Hinweis 
+ #### Hinweis
 
 Der Steuersatz, den sie hier definieren, wird der Standardsteuersatz für alle Artikel. Wenn es Artikel mit davon abweichenden Steuersätzen gibt, müssen diese in der Tabelle ""Artikelsteuer"" im Artikelstamm hinzugefügt werden.
 
- #### Beschreibung der Spalten 
+ #### Beschreibung der Spalten
 
-1. Berechnungsart: 
+1. Berechnungsart:
 - Dies kann sein ""Auf Nettosumme"" (das ist die Summe der Grundbeträge).
 - ""Auf vorherige Zeilensumme/-Betrag"" (für kumulative Steuern oder Abgaben). Wenn diese Option ausgewählt wird, wird die Steuer als Prozentsatz der vorherigen Zeilesumme/des vorherigen Zeilenbetrags (in der Steuertabelle) angewendet.
 - ""Unmittelbar"" (wie bereits erwähnt).
@@ -2480,7 +2480,7 @@
 apps/erpnext/erpnext/accounts/report/accounts_receivable/accounts_receivable.html +17,Ref,Ref.
 DocType: Budget,Cost Center,Kostenstelle
 apps/erpnext/erpnext/stock/report/stock_ledger/stock_ledger.py +36,Voucher #,Beleg #
-DocType: Notification Control,Purchase Order Message,Lieferantenauftrags-Nachricht
+DocType: Notification Control,Purchase Order Message,Bestellungs-Nachricht
 DocType: Tax Rule,Shipping Country,Zielland der Lieferung
 DocType: Selling Settings,Hide Customer's Tax Id from Sales Transactions,Ausblenden Kundensteuernummer aus Verkaufstransaktionen
 DocType: Upload Attendance,Upload HTML,HTML hochladen
@@ -2490,7 +2490,7 @@
 DocType: Employee Education,Class / Percentage,Klasse / Anteil
 apps/erpnext/erpnext/setup/setup_wizard/install_fixtures.py +96,Head of Marketing and Sales,Leiter Marketing und Vertrieb
 apps/erpnext/erpnext/setup/setup_wizard/install_fixtures.py +34,Income Tax,Einkommensteuer
-apps/erpnext/erpnext/accounts/doctype/pricing_rule/pricing_rule.js +15,"If selected Pricing Rule is made for 'Price', it will overwrite Price List. Pricing Rule price is the final price, so no further discount should be applied. Hence, in transactions like Sales Order, Purchase Order etc, it will be fetched in 'Rate' field, rather than 'Price List Rate' field.","Wenn für ""Preis"" eine Preisregel ausgewählt wurde, wird die Preisliste überschrieben. Der Preis aus der Preisregel ist der endgültige Preis, es sollte also kein weiterer Rabatt gewährt werden. Daher wird er in Transaktionen wie Kundenauftrag, Lieferantenauftrag etc., vorrangig aus dem Feld ""Preis"" gezogen, und dann erst aus dem Feld ""Preisliste""."
+apps/erpnext/erpnext/accounts/doctype/pricing_rule/pricing_rule.js +15,"If selected Pricing Rule is made for 'Price', it will overwrite Price List. Pricing Rule price is the final price, so no further discount should be applied. Hence, in transactions like Sales Order, Purchase Order etc, it will be fetched in 'Rate' field, rather than 'Price List Rate' field.","Wenn für ""Preis"" eine Preisregel ausgewählt wurde, wird die Preisliste überschrieben. Der Preis aus der Preisregel ist der endgültige Preis, es sollte also kein weiterer Rabatt gewährt werden. Daher wird er in Transaktionen wie Kundenauftrag, Bestellung etc., vorrangig aus dem Feld ""Preis"" gezogen, und dann erst aus dem Feld ""Preisliste""."
 apps/erpnext/erpnext/config/selling.py +174,Track Leads by Industry Type.,Leads nach Branchentyp nachverfolgen
 DocType: Item Supplier,Item Supplier,Artikellieferant
 apps/erpnext/erpnext/accounts/doctype/sales_invoice/sales_invoice.js +423,Please enter Item Code to get batch no,Bitte die Artikelnummer eingeben um die Chargennummer zu erhalten
@@ -2580,7 +2580,7 @@
 1. Ways of addressing disputes, indemnity, liability, etc.
 1. Address and Contact of your Company.","Allgemeine Geschäftsbedingungen, die bei Ver- und Einkäufen verwendet werden können.
 
- Beispiele: 
+ Beispiele:
 
 1. Gültigkeit des Angebots.
 2. Zahlungsbedingungen (Vorkasse, auf Rechnung, Teilweise Vorkasse usw.)
@@ -2589,7 +2589,7 @@
 5. Garantie, falls vorhanden.
 6. Rückgabebedingungen.
 7. Lieferbedingungen, falls zutreffend.
-8. Beschwerdemanagement, Schadensersatz, Haftung usw. 
+8. Beschwerdemanagement, Schadensersatz, Haftung usw.
 9. Adresse und Kontaktdaten des Unternehmens."
 DocType: Attendance,Leave Type,Urlaubstyp
 DocType: Purchase Invoice,Supplier Invoice Details,Lieferant Rechnungsdetails
@@ -2879,7 +2879,7 @@
 apps/erpnext/erpnext/stock/doctype/stock_entry/stock_entry.py +160,Source and target warehouse cannot be same for row {0},Ausgangs- und Eingangslager können nicht gleich sein für die Zeile {0}
 apps/erpnext/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py +243,"Difference Account must be a Asset/Liability type account, since this Stock Reconciliation is an Opening Entry","Differenzkonto muss ein Vermögens-/Verbindlichkeiten-Konto sein, da dieser Lagerabgleich eine Eröffnungsbuchung ist"
 apps/erpnext/erpnext/hr/doctype/employee_loan/employee_loan.py +107,Disbursed Amount cannot be greater than Loan Amount {0},Zahlter Betrag kann nicht größer sein als Darlehensbetrag {0}
-apps/erpnext/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py +86,Purchase Order number required for Item {0},Lieferantenauftragsnummer ist für den Artikel {0} erforderlich
+apps/erpnext/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py +86,Purchase Order number required for Item {0},Bestellnummer ist für den Artikel {0} erforderlich
 apps/erpnext/erpnext/selling/doctype/sales_order/sales_order.js +871,Production Order not created,Fertigungsauftrag nicht erstellt
 apps/erpnext/erpnext/stock/report/itemwise_recommended_reorder_level/itemwise_recommended_reorder_level.py +18,'From Date' must be after 'To Date',"""Von-Datum"" muss nach ""Bis-Datum"" liegen"
 apps/erpnext/erpnext/schools/doctype/student_applicant/student_applicant.py +29,Cannot change status as student {0} is linked with student application {1},Kann nicht den Status als Student ändern {0} ist mit Studenten Anwendung verknüpft {1}
@@ -2986,7 +2986,7 @@
 apps/erpnext/erpnext/demo/setup/setup_data.py +314,Calls,Anrufe
 DocType: Project,Total Costing Amount (via Time Logs),Gesamtkostenbetrag (über Zeitprotokolle)
 DocType: Purchase Order Item Supplied,Stock UOM,Lagermaßeinheit
-apps/erpnext/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py +226,Purchase Order {0} is not submitted,Lieferantenauftrag {0} wurde nicht übertragen
+apps/erpnext/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py +226,Purchase Order {0} is not submitted,Bestellung {0} wurde nicht übertragen
 DocType: Customs Tariff Number,Tariff Number,Tarifnummer
 apps/erpnext/erpnext/stock/doctype/item/item.js +39,Projected,Geplant
 apps/erpnext/erpnext/stock/doctype/serial_no/serial_no.py +218,Serial No {0} does not belong to Warehouse {1},Seriennummer {0} gehört nicht zu Lager {1}
@@ -3086,7 +3086,7 @@
 DocType: Cheque Print Template,Starting position from top edge,Ausgangsposition von der Oberkante
 apps/erpnext/erpnext/buying/doctype/request_for_quotation/request_for_quotation.py +29,Same supplier has been entered multiple times,Same Anbieter wurde mehrmals eingegeben
 apps/erpnext/erpnext/accounts/report/profitability_analysis/profitability_analysis.py +152,Gross Profit / Loss,Bruttogewinn / Verlust
-DocType: Purchase Order Item Supplied,Purchase Order Item Supplied,Lieferantenauftrags-Artikel geliefert
+DocType: Purchase Order Item Supplied,Purchase Order Item Supplied,Bestell-Artikel geliefert
 apps/erpnext/erpnext/public/js/setup_wizard.js +83,Company Name cannot be Company,Firmenname kann keine Firma sein
 apps/erpnext/erpnext/config/setup.py +27,Letter Heads for print templates.,Briefköpfe für Druckvorlagen
 apps/erpnext/erpnext/config/setup.py +32,Titles for print templates e.g. Proforma Invoice.,"Bezeichnungen für Druckvorlagen, z. B. Proforma-Rechnung"
@@ -3103,7 +3103,7 @@
 apps/erpnext/erpnext/accounts/general_ledger.py +145,Please mention Round Off Cost Center in Company,Bitte Abschlusskostenstelle in Firma vermerken
 DocType: Purchase Invoice,Terms,Geschäftsbedingungen
 DocType: Academic Term,Term Name,Zeit Namen
-DocType: Buying Settings,Purchase Order Required,Lieferantenauftrag erforderlich
+DocType: Buying Settings,Purchase Order Required,Bestellung erforderlich
 ,Item-wise Sales History,Artikelbezogene Verkaufshistorie
 DocType: Expense Claim,Total Sanctioned Amount,Summe genehmigter Beträge
 ,Purchase Analytics,Einkaufsanalyse
@@ -3842,7 +3842,7 @@
 apps/erpnext/erpnext/accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.py +34,Bank Statement balance as per General Ledger,Kontoauszug Bilanz nach Hauptbuch
 DocType: Job Applicant,Applicant Name,Bewerbername
 DocType: Authorization Rule,Customer / Item Name,Kunde / Artikelname
-DocType: Product Bundle,"Aggregate group of **Items** into another **Item**. This is useful if you are bundling a certain **Items** into a package and you maintain stock of the packed **Items** and not the aggregate **Item**. 
+DocType: Product Bundle,"Aggregate group of **Items** into another **Item**. This is useful if you are bundling a certain **Items** into a package and you maintain stock of the packed **Items** and not the aggregate **Item**.
 
 The package **Item** will have ""Is Stock Item"" as ""No"" and ""Is Sales Item"" as ""Yes"".
 
@@ -3876,7 +3876,7 @@
 apps/erpnext/erpnext/accounts/doctype/pricing_rule/pricing_rule.py +71,Max discount allowed for item: {0} is {1}%,Max erlaubter Rabatt für Artikel: {0} ist {1}%
 apps/erpnext/erpnext/accounts/report/asset_depreciations_and_balances/asset_depreciations_and_balances.py +173,Net Asset value as on,Nettoinventarwert als auf
 DocType: Account,Receivable,Forderung
-apps/erpnext/erpnext/selling/doctype/sales_order/sales_order.py +278,Row #{0}: Not allowed to change Supplier as Purchase Order already exists,"Zeile #{0}: Es ist nicht erlaubt den Lieferanten zu wechseln, da bereits ein Lieferantenauftrag vorhanden ist"
+apps/erpnext/erpnext/selling/doctype/sales_order/sales_order.py +278,Row #{0}: Not allowed to change Supplier as Purchase Order already exists,"Zeile #{0}: Es ist nicht erlaubt den Lieferanten zu wechseln, da bereits eine Bestellung vorhanden ist"
 DocType: Accounts Settings,Role that is allowed to submit transactions that exceed credit limits set.,"Rolle, welche Transaktionen, die das gesetzte Kreditlimit überschreiten, übertragen darf."
 apps/erpnext/erpnext/selling/doctype/sales_order/sales_order.js +904,Select Items to Manufacture,Wählen Sie die Elemente Herstellung
 apps/erpnext/erpnext/accounts/page/pos/pos.js +909,"Master data syncing, it might take some time","Stammdaten-Synchronisierung, kann es einige Zeit dauern,"
@@ -3977,7 +3977,7 @@
 DocType: Purchase Invoice,Raw Materials Supplied,Gelieferte Rohmaterialien
 DocType: Purchase Invoice,Recurring Print Format,Wiederkehrendes Druckformat
 DocType: C-Form,Series,Nummernkreise
-apps/erpnext/erpnext/selling/doctype/sales_order/sales_order.py +61,Expected Delivery Date cannot be before Purchase Order Date,Voraussichtlicher Liefertermin kann nicht vor dem Datum des Lieferantenauftrags liegen
+apps/erpnext/erpnext/selling/doctype/sales_order/sales_order.py +61,Expected Delivery Date cannot be before Purchase Order Date,Voraussichtlicher Liefertermin kann nicht vor dem Datum der Bestellung liegen
 DocType: Appraisal,Appraisal Template,Bewertungsvorlage
 DocType: Item Group,Item Classification,Artikeleinteilung
 apps/erpnext/erpnext/setup/setup_wizard/install_fixtures.py +93,Business Development Manager,Leiter der kaufmännischen Abteilung
@@ -4195,7 +4195,7 @@
 apps/erpnext/erpnext/accounts/doctype/fiscal_year/fiscal_year.py +82,Year start date or end date is overlapping with {0}. To avoid please set company,Jahresbeginn oder Enddatum überlappt mit {0}. Um dies zu verhindern setzen Sie eine Firma.
 apps/erpnext/erpnext/maintenance/doctype/maintenance_schedule/maintenance_schedule.py +157,Start date should be less than end date for Item {0},Startdatum sollte für den Artikel {0} vor dem Enddatum liegen
 DocType: Item,"Example: ABCD.#####
-If series is set and Serial No is not mentioned in transactions, then automatic serial number will be created based on this series. If you always want to explicitly mention Serial Nos for this item. leave this blank.","Beispiel: ABCD.##### 
+If series is set and Serial No is not mentioned in transactions, then automatic serial number will be created based on this series. If you always want to explicitly mention Serial Nos for this item. leave this blank.","Beispiel: ABCD.#####
  Wenn ""Serie"" eingestellt ist und ""Seriennummer"" in den Transaktionen nicht aufgeführt ist, dann wird eine Seriennummer automatisch auf der Grundlage dieser Serie erstellt. Wenn immer explizit Seriennummern für diesen Artikel aufgeführt werden sollen, muss das Feld leer gelassen werden."
 DocType: Upload Attendance,Upload Attendance,Anwesenheit hochladen
 apps/erpnext/erpnext/stock/doctype/stock_entry/stock_entry.js +302,BOM and Manufacturing Quantity are required,Stückliste und Fertigungsmenge werden benötigt
@@ -4286,7 +4286,7 @@
 apps/erpnext/erpnext/stock/doctype/stock_entry/stock_entry.py +517,Posting date and posting time is mandatory,Buchungsdatum und Buchungszeit sind zwingend erfoderlich
 apps/erpnext/erpnext/config/buying.py +76,Tax template for buying transactions.,Steuervorlage für Einkaufstransaktionen
 ,Item Prices,Artikelpreise
-DocType: Purchase Order,In Words will be visible once you save the Purchase Order.,"""In Worten"" wird sichtbar, sobald Sie den Lieferantenauftrag speichern."
+DocType: Purchase Order,In Words will be visible once you save the Purchase Order.,"""In Worten"" wird sichtbar, sobald Sie die Bestellung speichern."
 DocType: Period Closing Voucher,Period Closing Voucher,Periodenabschlussbeleg
 apps/erpnext/erpnext/config/selling.py +67,Price List master.,Preislisten-Vorlagen
 DocType: Task,Review Date,Überprüfungsdatum
diff --git a/erpnext/translations/en-GB.csv b/erpnext/translations/en-GB.csv
new file mode 100644
index 0000000..8b13789
--- /dev/null
+++ b/erpnext/translations/en-GB.csv
@@ -0,0 +1 @@
+
diff --git a/erpnext/translations/es.csv b/erpnext/translations/es.csv
index bdf3ea6..5e5ba73 100644
--- a/erpnext/translations/es.csv
+++ b/erpnext/translations/es.csv
@@ -65,7 +65,7 @@
 apps/erpnext/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js +665,Quantity,Cantidad
 apps/erpnext/erpnext/accounts/doctype/journal_entry/journal_entry.py +534,Accounts table cannot be blank.,La tabla de cuentas no puede estar en blanco
 apps/erpnext/erpnext/accounts/doctype/account/chart_of_accounts/verified/standard_chart_of_accounts.py +152,Loans (Liabilities),Préstamos (pasivos)
-DocType: Employee Education,Year of Passing,Año de graduación
+DocType: Employee Education,Year of Passing,Año de fallecimiento
 apps/erpnext/erpnext/maintenance/doctype/maintenance_schedule/maintenance_schedule.py +69,"Reference: %s, Item Code: %s and Customer: %s","Referencia:% s, Código del artículo:% s y el Cliente:% s"
 DocType: Item,Country of Origin,País de origen
 apps/erpnext/erpnext/templates/form_grid/stock_entry_grid.html +26,In Stock,En inventario
@@ -111,12 +111,12 @@
 apps/erpnext/erpnext/accounts/utils.py +74,{0} {1} not in any active Fiscal Year.,{0} {1} no en cualquier año fiscal activa.
 DocType: Packed Item,Parent Detail docname,Detalle principal docname
 apps/erpnext/erpnext/public/js/setup_wizard.js +303,Kg,Kilogramo
-DocType: Student Log,Log,Iniciar sesión
+DocType: Student Log,Log,Log
 apps/erpnext/erpnext/config/hr.py +45,Opening for a Job.,Apertura de un puesto
 DocType: Item Attribute,Increment,Incremento
 apps/erpnext/erpnext/public/js/stock_analytics.js +62,Select Warehouse...,Seleccione Almacén ...
 apps/erpnext/erpnext/setup/setup_wizard/industry_type.py +6,Advertising,Publicidad
-apps/erpnext/erpnext/accounts/doctype/mode_of_payment/mode_of_payment.py +22,Same Company is entered more than once,Igual Company se introduce más de una vez
+apps/erpnext/erpnext/accounts/doctype/mode_of_payment/mode_of_payment.py +22,Same Company is entered more than once,La misma Compañia es ingresada mas de una vez
 DocType: Employee,Married,Casado
 apps/erpnext/erpnext/accounts/party.py +38,Not permitted for {0},No está permitido para {0}
 apps/erpnext/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js +556,Get items from,Obtener artículos de
@@ -130,7 +130,7 @@
 apps/erpnext/erpnext/accounts/doctype/asset/asset.py +87,Next Depreciation Date cannot be before Purchase Date,Siguiente Depreciación La fecha no puede ser anterior a la fecha de compra
 DocType: SMS Center,All Sales Person,Todos los vendedores
 DocType: Monthly Distribution,**Monthly Distribution** helps you distribute the Budget/Target across months if you have seasonality in your business.,** ** Distribución mensual ayuda a distribuir el presupuesto / Target a través de meses si tiene la estacionalidad de su negocio.
-apps/erpnext/erpnext/accounts/page/pos/pos.js +1598,Not items found,No artículos encontrados
+apps/erpnext/erpnext/accounts/page/pos/pos.js +1598,Not items found,No se encontraron artículos
 apps/erpnext/erpnext/hr/doctype/salary_slip/salary_slip.py +178,Salary Structure Missing,Falta Estructura salarial
 DocType: Lead,Person Name,Nombre de persona
 DocType: Sales Invoice Item,Sales Invoice Item,Producto de factura de venta
@@ -152,7 +152,7 @@
 DocType: SMS Log,SMS Log,Registros SMS
 apps/erpnext/erpnext/projects/report/project_wise_stock_tracking/project_wise_stock_tracking.py +27,Cost of Delivered Items,Costo de productos entregados
 apps/erpnext/erpnext/hr/doctype/holiday_list/holiday_list.py +38,The holiday on {0} is not between From Date and To Date,El día de fiesta en {0} no es entre De la fecha y Hasta la fecha
-DocType: Student Log,Student Log,Iniciar estudiante
+DocType: Student Log,Student Log,Bitácora del Estudiante
 DocType: Quality Inspection,Get Specification Details,Obtener especificaciones
 DocType: Lead,Interested,Interesado
 apps/erpnext/erpnext/accounts/report/general_ledger/general_ledger.py +170,Opening,Apertura
@@ -187,7 +187,7 @@
 apps/erpnext/erpnext/public/js/setup_wizard.js +300,Consumable,Consumible
 DocType: Employee,B-,B-
 DocType: Upload Attendance,Import Log,Importar registro
-DocType: Production Planning Tool,Pull Material Request of type Manufacture based on the above criteria,Tire Solicitud de materiales de tipo Fabricación en base a los criterios anteriores
+DocType: Production Planning Tool,Pull Material Request of type Manufacture based on the above criteria,Traer Solicitud de materiales de tipo Fabricación en base a los criterios anteriores
 DocType: Training Result Employee,Grade,Grado
 DocType: Sales Invoice Item,Delivered By Supplier,Entregado por proveedor
 DocType: SMS Center,All Contact,Todos los Contactos
@@ -229,7 +229,7 @@
 DocType: Serial No,Maintenance Status,Estado del mantenimiento
 apps/erpnext/erpnext/accounts/doctype/gl_entry/gl_entry.py +57,{0} {1}: Supplier is required against Payable account {2},{0} {1}: se requiere un proveedor para la cuenta por pagar {2}
 apps/erpnext/erpnext/config/selling.py +52,Items and Pricing,Productos y precios
-apps/erpnext/erpnext/projects/doctype/project/project_dashboard.html +2,Total hours: {0},Total horas: {0}
+apps/erpnext/erpnext/projects/doctype/project/project_dashboard.html +2,Total hours: {0},Horas totales: {0}
 apps/erpnext/erpnext/accounts/report/trial_balance/trial_balance.py +43,From Date should be within the Fiscal Year. Assuming From Date = {0},La fecha 'Desde' tiene que pertenecer al rango del año fiscal = {0}
 DocType: Customer,Individual,Individual
 DocType: Interest,Academics User,académicos usuario
@@ -238,7 +238,7 @@
 apps/erpnext/erpnext/config/maintenance.py +12,Plan for maintenance visits.,Plan para las visitas
 DocType: SMS Settings,Enter url parameter for message,Introduzca el parámetro url para el mensaje
 DocType: POS Profile,Customer Groups,Grupos de clientes
-DocType: Guardian,Students,Los estudiantes
+DocType: Guardian,Students,Estudiantes
 apps/erpnext/erpnext/config/selling.py +91,Rules for applying pricing and discount.,Reglas para la aplicación de distintos precios y descuentos sobre los productos.
 apps/erpnext/erpnext/stock/doctype/price_list/price_list.py +14,Price List must be applicable for Buying or Selling,La lista de precios debe ser aplicable para las compras o ventas
 apps/erpnext/erpnext/selling/doctype/installation_note/installation_note.py +79,Installation date cannot be before delivery date for Item {0},La fecha de instalación no puede ser antes de la fecha de entrega para el elemento {0}
@@ -265,7 +265,7 @@
 apps/erpnext/erpnext/controllers/taxes_and_totals.py +414,Advance amount cannot be greater than {0} {1},cantidad de avance no puede ser mayor que {0} {1}
 DocType: Naming Series,Series List for this Transaction,Lista de secuencias para esta transacción
 DocType: Company,Default Payroll Payable Account,La nómina predeterminada de la cuenta por pagar
-apps/erpnext/erpnext/schools/doctype/student_batch/student_batch.js +7,Update Email Group,Grupo alerta por correo electrónico
+apps/erpnext/erpnext/schools/doctype/student_batch/student_batch.js +7,Update Email Group,Editar Grupo de Correo Electrónico
 DocType: Sales Invoice,Is Opening Entry,Es una entrada de apertura
 DocType: Customer Group,Mention if non-standard receivable account applicable,Indique si una cuenta por cobrar no estándar es  aplicable
 DocType: Course Schedule,Instructor Name,Nombre instructor
@@ -277,11 +277,11 @@
 DocType: Delivery Note Item,Against Sales Invoice Item,Contra la factura de venta del producto
 ,Production Orders in Progress,Órdenes de producción en progreso
 apps/erpnext/erpnext/accounts/report/cash_flow/cash_flow.py +39,Net Cash from Financing,Efectivo neto de financiación
-apps/erpnext/erpnext/accounts/page/pos/pos.js +2179,"LocalStorage is full , did not save","LocalStorage está lleno, no salvó"
+apps/erpnext/erpnext/accounts/page/pos/pos.js +2179,"LocalStorage is full , did not save","Almacenamiento Local esta lleno, no se guardó"
 DocType: Lead,Address & Contact,Dirección y Contacto
 DocType: Leave Allocation,Add unused leaves from previous allocations,Añadir las hojas no utilizados de las asignaciones anteriores
 apps/erpnext/erpnext/controllers/recurring_document.py +230,Next Recurring {0} will be created on {1},La próxima recurrencia {0} se creará el {1}
-DocType: Sales Partner,Partner website,sitio web de colaboradores
+DocType: Sales Partner,Partner website,Sitio web de colaboradores
 apps/erpnext/erpnext/stock/dashboard/item_dashboard.js +105,Add Item,Añadir artículo
 ,Contact Name,Nombre de contacto
 DocType: Course Assessment Criteria,Course Assessment Criteria,Criterios de evaluación del curso
@@ -316,7 +316,7 @@
 apps/erpnext/erpnext/setup/setup_wizard/install_fixtures.py +97,Software Developer,Desarrollador de Software.
 DocType: Item,Minimum Order Qty,Cantidad mínima de la orden
 DocType: Pricing Rule,Supplier Type,Tipo de proveedor
-DocType: Course Scheduling Tool,Course Start Date,Curso Fecha de Inicio
+DocType: Course Scheduling Tool,Course Start Date,Fecha de inicio del Curso
 ,Student Batch-Wise Attendance,Discontinuo asistencia de los estudiantes
 DocType: POS Profile,Allow user to edit Rate,Permitir al usuario editar Tasa
 DocType: Item,Publish in Hub,Publicar en el Hub
@@ -528,7 +528,7 @@
 apps/erpnext/erpnext/projects/doctype/task/task.py +46,Cannot close task as its dependant task {0} is not closed.,No se puede cerrar la tarea que depende de {0} ya que no está cerrada.
 apps/erpnext/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.py +433,Please enter Warehouse for which Material Request will be raised,"Por favor, ingrese el almacén en el cual la requisición de materiales sera despachada"
 DocType: Production Order,Additional Operating Cost,Costos adicionales de operación
-apps/erpnext/erpnext/setup/setup_wizard/industry_type.py +20,Cosmetics,Productos cosméticos
+apps/erpnext/erpnext/setup/setup_wizard/industry_type.py +20,Cosmetics,Cosméticos
 apps/erpnext/erpnext/stock/doctype/item/item.py +535,"To merge, following properties must be same for both items","Para fusionar, la siguientes propiedades deben ser las mismas en ambos productos"
 DocType: Shipping Rule,Net Weight,Peso neto
 DocType: Employee,Emergency Phone,Teléfono de emergencia
@@ -584,7 +584,7 @@
 DocType: C-Form Invoice Detail,Grand Total,Total
 DocType: Training Event,Course,Curso
 DocType: Timesheet,Payslip,recibo de sueldo
-apps/erpnext/erpnext/public/js/pos/pos.html +4,Item Cart,Cesta de artículos
+apps/erpnext/erpnext/public/js/pos/pos.html +4,Item Cart,Articulo de Carrito de Compras
 apps/erpnext/erpnext/accounts/doctype/fiscal_year/fiscal_year.py +38,Fiscal Year Start Date should not be greater than Fiscal Year End Date,La fecha de inicio no puede ser mayor que la fecha final del año fiscal
 DocType: Issue,Resolution,Resolución
 DocType: C-Form,IV,IV
@@ -611,7 +611,7 @@
 DocType: Training Result Employee,Training Result Employee,Empleado Formación Resultado
 DocType: Warehouse,A logical Warehouse against which stock entries are made.,Un Almacén lógico contra el que se crean las entradas de inventario
 DocType: Repayment Schedule,Principal Amount,Cantidad principal
-DocType: Employee Loan Application,Total Payable Interest,El interés total a pagar
+DocType: Employee Loan Application,Total Payable Interest,Interés Total a Pagar
 DocType: Sales Invoice Timesheet,Sales Invoice Timesheet,Factura de venta de partes de horas
 apps/erpnext/erpnext/accounts/doctype/journal_entry/journal_entry.py +106,Reference No & Reference Date is required for {0},Se requiere de No. de referencia y fecha para {0}
 DocType: Process Payroll,Select Payment Account to make Bank Entry,Seleccionar la cuenta de pago para hacer la entrada del Banco
@@ -634,7 +634,7 @@
 DocType: Sales Invoice,Sales Taxes and Charges,Impuestos y cargos sobre ventas
 DocType: Employee,Organization Profile,Perfil de la organización
 DocType: Student,Sibling Details,Detalles de hermanos
-DocType: Vehicle Service,Vehicle Service,Servicio en el vehículo
+DocType: Vehicle Service,Vehicle Service,Servicio del Vehículo
 apps/erpnext/erpnext/config/setup.py +101,Automatically triggers the feedback request based on conditions.,desencadena automáticamente la solicitud de realimentación sobre la base de condiciones.
 DocType: Employee,Reason for Resignation,Motivo de la renuncia
 apps/erpnext/erpnext/config/hr.py +147,Template for performance appraisals.,Plantilla para evaluaciones de desempeño.
@@ -690,7 +690,7 @@
 DocType: Item,Material Transfer,Transferencia de material
 apps/erpnext/erpnext/accounts/report/trial_balance/trial_balance.py +210,Opening (Dr),Apertura (Deb)
 apps/erpnext/erpnext/controllers/sales_and_purchase_return.py +39,Posting timestamp must be after {0},Fecha y hora de contabilización deberá ser posterior a {0}
-DocType: Employee Loan,Total Interest Payable,El interés total a pagar
+DocType: Employee Loan,Total Interest Payable,Interés total a pagar
 DocType: Landed Cost Taxes and Charges,Landed Cost Taxes and Charges,"Impuestos, cargos y costos de destino estimados"
 DocType: Production Order Operation,Actual Start Time,Hora de inicio real
 DocType: BOM Operation,Operation Time,Tiempo de operación
@@ -711,7 +711,7 @@
 DocType: Interest,Interest,Interesar
 apps/erpnext/erpnext/selling/doctype/customer/customer_dashboard.py +10,Pre Sales,Pre ventas
 DocType: Purchase Receipt,Other Details,Otros detalles
-apps/erpnext/erpnext/accounts/report/delivered_items_to_be_billed/delivered_items_to_be_billed.py +18,Suplier,suplier
+apps/erpnext/erpnext/accounts/report/delivered_items_to_be_billed/delivered_items_to_be_billed.py +18,Suplier,Proveedor
 DocType: Account,Accounts,Cuentas
 DocType: Vehicle,Odometer Value (Last),Valor del cuentakilómetros (Última)
 apps/erpnext/erpnext/setup/setup_wizard/install_fixtures.py +71,Marketing,Marketing
@@ -749,7 +749,7 @@
 apps/erpnext/erpnext/accounts/doctype/account/chart_of_accounts/verified/standard_chart_of_accounts.py +10,Current Assets,Activo circulante
 apps/erpnext/erpnext/stock/doctype/stock_entry/stock_entry.py +87,{0} is not a stock Item,{0} no es un artículo en existencia
 DocType: Mode of Payment Account,Default Account,Cuenta predeterminada
-DocType: Payment Entry,Received Amount (Company Currency),Cantidad recibida (Compañía de divisas)
+DocType: Payment Entry,Received Amount (Company Currency),Cantidad recibida (Divisa de Compañia)
 apps/erpnext/erpnext/crm/doctype/opportunity/opportunity.py +156,Lead must be set if Opportunity is made from Lead,La Iniciativa se debe establecer si la oportunidad está hecha desde las Iniciativas
 apps/erpnext/erpnext/hr/doctype/holiday_list/holiday_list.py +29,Please select weekly off day,Por favor seleccione el día libre de la semana
 DocType: Production Order Operation,Planned End Time,Tiempo de finalización planeado
@@ -852,7 +852,7 @@
 DocType: Warehouse,Tree Details,Detalles del árbol
 DocType: Training Event,Event Status,Estado de eventos
 ,Support Analytics,Soporte analítico
-apps/erpnext/erpnext/accounts/doctype/payment_request/payment_request.py +339,"If you have any questions, please get back to us.","Si usted tiene alguna pregunta, por favor volver a nosotros."
+apps/erpnext/erpnext/accounts/doctype/payment_request/payment_request.py +339,"If you have any questions, please get back to us.","Si usted tiene alguna pregunta, por favor consultenos."
 DocType: Item,Website Warehouse,Almacén para el sitio web
 DocType: Payment Reconciliation,Minimum Invoice Amount,Volumen mínimo Factura
 apps/erpnext/erpnext/accounts/doctype/gl_entry/gl_entry.py +112,{0} {1}: Cost Center {2} does not belong to Company {3},{0} {1}: El centro de costos {2} no pertenece a la empresa {3}
@@ -896,10 +896,10 @@
 DocType: Sales Invoice,Payment Due Date,Fecha de pago
 apps/erpnext/erpnext/stock/doctype/item/item.js +340,Item Variant {0} already exists with same attributes,Artículo Variant {0} ya existe con los mismos atributos
 apps/erpnext/erpnext/stock/report/stock_ledger/stock_ledger.py +95,'Opening',&#39;Apertura&#39;
-apps/erpnext/erpnext/setup/doctype/email_digest/templates/default.html +130,Open To Do,Abierto a hacer
+apps/erpnext/erpnext/setup/doctype/email_digest/templates/default.html +130,Open To Do,Lista de tareas abiertas
 DocType: Notification Control,Delivery Note Message,Mensaje en nota de entrega
 DocType: Expense Claim,Expenses,Gastos
-DocType: Item Variant Attribute,Item Variant Attribute,Artículo Variant Atributo
+DocType: Item Variant Attribute,Item Variant Attribute,Atributo de Variante de Producto
 ,Purchase Receipt Trends,Tendencias de recibos de compra
 DocType: Process Payroll,Bimonthly,Bimensual
 DocType: Vehicle Service,Brake Pad,Pastilla de freno
@@ -995,7 +995,7 @@
 DocType: Salary Slip,Total in words,Total en palabras
 DocType: Material Request Item,Lead Time Date,Hora de la Iniciativa
 DocType: Guardian,Guardian Name,Nombre tutor
-DocType: Cheque Print Template,Has Print Format,Formato de impresión tiene
+DocType: Cheque Print Template,Has Print Format,Tiene Formato de Impresión
 DocType: Employee Loan,Sanctioned,Sancionada
 apps/erpnext/erpnext/accounts/page/pos/pos.js +72, is mandatory. Maybe Currency Exchange record is not created for ,es obligatorio. Posiblemente el registro de cambio de divisa no ha sido creado para
 apps/erpnext/erpnext/stock/doctype/stock_entry/stock_entry.py +103,Row #{0}: Please specify Serial No for Item {1},"Línea #{0}: Por favor, especifique el número de serie para el producto {1}"
@@ -1047,7 +1047,7 @@
 DocType: Lead,Next Contact Date,Siguiente fecha de contacto
 apps/erpnext/erpnext/stock/report/batch_wise_balance_history/batch_wise_balance_history.py +35,Opening Qty,Cant. de apertura
 apps/erpnext/erpnext/accounts/doctype/sales_invoice/sales_invoice.py +424,Please enter Account for Change Amount,"Por favor, introduzca la cuenta para el Cambio Monto"
-DocType: Student Batch,Student Batch Name,Lote Nombre del estudiante
+DocType: Student Batch,Student Batch Name,Nombre de Lote del Estudiante
 DocType: Holiday List,Holiday List Name,Nombre de festividad
 DocType: Repayment Schedule,Balance Loan Amount,Saldo del Préstamo Monto
 apps/erpnext/erpnext/schools/doctype/course_scheduling_tool/course_scheduling_tool.js +14,Schedule Course,Calendario de Cursos
@@ -1086,7 +1086,7 @@
 apps/erpnext/erpnext/hr/doctype/expense_claim/expense_claim.js +115,You are the Expense Approver for this record. Please Update the 'Status' and Save,"Usted es el supervisor de gastos para este registro. Por favor, actualice el estado y guarde"
 DocType: Serial No,Creation Document No,Creación del documento No
 DocType: Issue,Issue,Asunto
-DocType: Asset,Scrapped,desechado
+DocType: Asset,Scrapped,Desechado
 apps/erpnext/erpnext/accounts/doctype/mode_of_payment/mode_of_payment.py +28,Account does not match with Company,La cuenta no coincide con la empresa
 apps/erpnext/erpnext/config/stock.py +195,"Attributes for Item Variants. e.g Size, Color etc.","Atributos para  Elementos variables. por ejemplo, tamaño, color, etc."
 DocType: Purchase Invoice,Returns,Devoluciones
@@ -1178,7 +1178,7 @@
 DocType: Sales Invoice Item,UOM Conversion Factor,Factor de Conversión de Unidad de Medida
 apps/erpnext/erpnext/stock/doctype/stock_entry/stock_entry.js +24,Please enter Item Code to get Batch Number,"Por favor, introduzca el código de artículo para obtener el número de lote"
 DocType: Stock Settings,Default Item Group,Grupo de artículos predeterminado
-DocType: Employee Loan,Partially Disbursed,parcialmente Desembolso
+DocType: Employee Loan,Partially Disbursed,Parcialmente Desembolsado
 DocType: Grading Structure,Grading System Name,Nombre del sistema de clasificación
 apps/erpnext/erpnext/config/buying.py +38,Supplier database.,Base de datos de proveedores.
 DocType: Account,Balance Sheet,Hoja de balance
@@ -1200,7 +1200,7 @@
 DocType: Holiday,Holiday,Vacaciones
 DocType: Support Settings,Close Issue After Days,Cerrar Problema Después Días
 DocType: Leave Control Panel,Leave blank if considered for all branches,Dejar en blanco si se considera para todas las sucursales
-apps/erpnext/erpnext/accounts/doctype/c_form/c_form.py +21,C-form is not applicable for Invoice: {0},C-forma no es aplicable para la factura: {0}
+apps/erpnext/erpnext/accounts/doctype/c_form/c_form.py +21,C-form is not applicable for Invoice: {0},Formulario-C no es aplicable para la factura: {0}
 DocType: Payment Reconciliation,Unreconciled Payment Details,Detalles de pagos no conciliados
 DocType: Global Defaults,Current Fiscal Year,Año fiscal actual
 DocType: Purchase Order,Group same items,Grupo mismos artículos
@@ -1223,7 +1223,7 @@
 DocType: Grading Scale,Intervals,intervalos
 apps/erpnext/erpnext/stock/report/stock_ageing/stock_ageing.py +41,Earliest,Primeras
 apps/erpnext/erpnext/stock/doctype/item/item.py +509,"An Item Group exists with same name, please change the item name or rename the item group","Existe un grupo de elementos con el mismo nombre , por favor, cambie el nombre del artículo , o cambiar el nombre del grupo de artículos"
-apps/erpnext/erpnext/schools/report/absent_student_report/absent_student_report.py +46,Student Mobile No.,Nº de Estudiantes móvil
+apps/erpnext/erpnext/schools/report/absent_student_report/absent_student_report.py +46,Student Mobile No.,Número de Móvil del Estudiante.
 apps/erpnext/erpnext/setup/setup_wizard/setup_wizard.py +473,Rest Of The World,Resto del mundo
 apps/erpnext/erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.py +81,The Item {0} cannot have Batch,El producto {0} no puede contener lotes
 ,Budget Variance Report,Variación de Presupuesto
@@ -1235,7 +1235,7 @@
 apps/erpnext/erpnext/accounts/doctype/account/chart_of_accounts/verified/standard_chart_of_accounts.py +170,Retained Earnings,UTILIDADES RETENIDAS
 DocType: Vehicle Log,Service Detail,Detalle del servicio
 DocType: BOM,Item Description,Descripción del producto
-DocType: Student Sibling,Student Sibling,hermano del estudiante
+DocType: Student Sibling,Student Sibling,Hermano del Estudiante
 DocType: Purchase Invoice,Is Recurring,Es recurrente
 DocType: Purchase Invoice,Supplied Items,Productos suministrados
 DocType: Student,STUD.,SEMENTAL.
@@ -1308,7 +1308,7 @@
 apps/erpnext/erpnext/accounts/doctype/account/chart_of_accounts/verified/standard_chart_of_accounts.py +41,Capital Equipments,BIENES DE CAPITAL
 apps/erpnext/erpnext/accounts/doctype/pricing_rule/pricing_rule.js +31,"Pricing Rule is first selected based on 'Apply On' field, which can be Item, Item Group or Brand.","La 'regla precios' es seleccionada primero basada en el campo 'Aplicar En' que puede ser un artículo, grupo de artículos o marca."
 DocType: Hub Settings,Seller Website,Sitio web del vendedor
-DocType: Item,ITEM-,ÍT-
+DocType: Item,ITEM-,ITEM-
 apps/erpnext/erpnext/controllers/selling_controller.py +152,Total allocated percentage for sales team should be 100,Porcentaje del total asignado para el equipo de ventas debe ser de 100
 apps/erpnext/erpnext/manufacturing/doctype/production_order/production_order.py +112,Production Order status is {0},El estado de la orden de producción es {0}
 DocType: Appraisal Goal,Goal,Meta/Objetivo
@@ -1362,11 +1362,11 @@
 apps/erpnext/erpnext/demo/setup/setup_data.py +315,Food,Comida
 apps/erpnext/erpnext/accounts/report/accounts_payable/accounts_payable.js +51,Ageing Range 3,Rango de antigüedad 3
 DocType: Maintenance Schedule Item,No of Visits,Número de visitas
-apps/erpnext/erpnext/schools/doctype/student_attendance_tool/student_attendance_tool.js +102,Mark Attendence,Marcos Attendence
+apps/erpnext/erpnext/schools/doctype/student_attendance_tool/student_attendance_tool.js +102,Mark Attendence,Marcar Asistencia
 apps/erpnext/erpnext/schools/doctype/student_applicant/student_applicant.js +32,Enrolling student,estudiante que se inscribe
 apps/erpnext/erpnext/accounts/doctype/period_closing_voucher/period_closing_voucher.py +33,Currency of the Closing Account must be {0},La divisa / moneda de la cuenta de cierre debe ser {0}
 apps/erpnext/erpnext/hr/doctype/appraisal_template/appraisal_template.py +21,Sum of points for all goals should be 100. It is {0},La suma de puntos para los objetivos debe ser 100. y es {0}
-DocType: Project,Start and End Dates,Las fechas de inicio y fin
+DocType: Project,Start and End Dates,Fechas de Inicio y Fin
 ,Delivered Items To Be Billed,Envios por facturar
 apps/erpnext/erpnext/manufacturing/doctype/bom/bom_item_preview.html +16,Open BOM {0},Abrir la lista de materiales {0}
 apps/erpnext/erpnext/stock/doctype/serial_no/serial_no.py +60,Warehouse cannot be changed for Serial No.,Almacén no se puede cambiar para el N º de serie
@@ -1391,7 +1391,7 @@
 apps/erpnext/erpnext/hr/doctype/expense_claim/expense_claim.py +56,Approval Status must be 'Approved' or 'Rejected',"El estado de esta solicitud debe ser ""Aprobado"" o ""Rechazado"""
 DocType: Purchase Invoice,Contact Person,Persona de contacto
 apps/erpnext/erpnext/projects/doctype/task/task.py +37,'Expected Start Date' can not be greater than 'Expected End Date','Fecha esperada de inicio' no puede ser mayor que 'Fecha esperada de finalización'
-DocType: Course Scheduling Tool,Course End Date,Curso Fecha de finalización
+DocType: Course Scheduling Tool,Course End Date,Fecha de finalización del curso
 DocType: Holiday List,Holidays,Vacaciones
 DocType: Sales Order Item,Planned Quantity,Cantidad planificada
 DocType: Purchase Invoice Item,Item Tax Amount,Total impuestos de producto
@@ -1400,7 +1400,7 @@
 DocType: Employee,Prefered Email,preferido por correo electrónico
 apps/erpnext/erpnext/accounts/report/cash_flow/cash_flow.py +33,Net Change in Fixed Asset,Cambio neto en activos fijos
 DocType: Leave Control Panel,Leave blank if considered for all designations,Dejar en blanco si es considerado para todos los puestos
-apps/erpnext/erpnext/accounts/doctype/account/account.py +176,Warehouse is mandatory for non group Accounts of type Stock,Almacén es obligatorio para las cuentas no grupales de tipo de archivo
+apps/erpnext/erpnext/accounts/doctype/account/account.py +176,Warehouse is mandatory for non group Accounts of type Stock,Almacén es obligatorio para las cuentas no grupales de tipo Stock
 apps/erpnext/erpnext/controllers/accounts_controller.py +669,Charge of type 'Actual' in row {0} cannot be included in Item Rate,Cambiar a tipo 'Actual' en la línea {0} no puede ser incluido en el precio
 apps/erpnext/erpnext/manufacturing/doctype/production_order/production_order.js +243,Max: {0},Máximo: {0}
 apps/erpnext/erpnext/projects/report/daily_timesheet_summary/daily_timesheet_summary.py +24,From Datetime,A partir de fecha y hora
@@ -1428,7 +1428,7 @@
 DocType: HR Settings,Employee Settings,Configuración de empleado
 ,Batch-Wise Balance History,Historial de saldo por lotes
 apps/erpnext/erpnext/accounts/doctype/cheque_print_template/cheque_print_template.js +73,Print settings updated in respective print format,Los ajustes de impresión actualizados en formato de impresión respectivo
-DocType: Package Code,Package Code,Código paquete
+DocType: Package Code,Package Code,Código de paquete
 apps/erpnext/erpnext/setup/setup_wizard/install_fixtures.py +67,Apprentice,Aprendiz
 apps/erpnext/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py +103,Negative Quantity is not allowed,No se permiten cantidades negativas
 DocType: Purchase Invoice Item,"Tax detail table fetched from item master as a string and stored in this field.
@@ -1447,14 +1447,14 @@
 apps/erpnext/erpnext/accounts/report/trial_balance/trial_balance.js +60,Show unclosed fiscal year's P&L balances,Mostrar P &amp; L saldos sin cerrar el año fiscal
 DocType: Shipping Rule,Shipping Account,Cuenta de envíos
 apps/erpnext/erpnext/accounts/doctype/gl_entry/gl_entry.py +93,{0} {1}: Account {2} is inactive,{0} {1}: La cuenta {2} está inactiva
-apps/erpnext/erpnext/utilities/activation.py +83,Make Sales Orders to help you plan your work and deliver on-time,Hacen pedidos de cliente para ayudarle a planificar su trabajo y entrega del tiempo de funcionamiento
+apps/erpnext/erpnext/utilities/activation.py +83,Make Sales Orders to help you plan your work and deliver on-time,Hacer Ordenes de Ventas para ayudar a planificar tu trabajo y entregar en tiempo
 DocType: Quality Inspection,Readings,Lecturas
 DocType: Stock Entry,Total Additional Costs,Total de costos adicionales
 DocType: Course Schedule,SH,SH
 DocType: BOM,Scrap Material Cost(Company Currency),El costo del desecho de materiales (Compañía de divisas)
 apps/erpnext/erpnext/public/js/setup_wizard.js +300,Sub Assemblies,Sub-Ensamblajes
 DocType: Asset,Asset Name,Nombre de activos
-DocType: Project,Task Weight,Peso de tareas
+DocType: Project,Task Weight,Peso de la Tarea
 DocType: Shipping Rule Condition,To Value,Para el valor
 DocType: Asset Movement,Stock Manager,Gerente de almacén
 apps/erpnext/erpnext/stock/doctype/stock_entry/stock_entry.py +135,Source warehouse is mandatory for row {0},El almacén de origen es obligatorio para la línea {0}
@@ -1467,7 +1467,7 @@
 apps/erpnext/erpnext/setup/setup_wizard/install_fixtures.py +87,Analyst,Analista
 DocType: Item,Inventory,inventario
 DocType: Item,Sales Details,Detalles de ventas
-DocType: Quality Inspection,QI-,qi
+DocType: Quality Inspection,QI-,QI-
 DocType: Opportunity,With Items,Con productos
 apps/erpnext/erpnext/stock/report/batch_wise_balance_history/batch_wise_balance_history.py +36,In Qty,En cantidad
 DocType: Notification Control,Expense Claim Rejected,Reembolso de gastos rechazado
@@ -1487,7 +1487,7 @@
 apps/erpnext/erpnext/stock/doctype/item/item.py +237,Asset Category is mandatory for Fixed Asset item,Categoría activo es obligatorio para la partida del activo fijo
 apps/erpnext/erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.py +145,No records found in the Payment table,No se encontraron registros en la tabla de pagos
 apps/erpnext/erpnext/schools/utils.py +19,This {0} conflicts with {1} for {2} {3},Este {0} conflictos con {1} de {2} {3}
-DocType: Student Attendance Tool,Students HTML,Los estudiantes HTML
+DocType: Student Attendance Tool,Students HTML,HTML de Estudiantes
 apps/erpnext/erpnext/public/js/setup_wizard.js +60,Financial Year Start Date,Inicio del ejercicio contable
 DocType: POS Profile,Apply Discount,Aplicar Descuento
 DocType: Employee External Work History,Total Experience,Experiencia total
@@ -1563,7 +1563,7 @@
 DocType: Quality Inspection Reading,Reading 4,Lectura 4
 apps/erpnext/erpnext/manufacturing/doctype/production_order/production_order.py +498,Default BOM for {0} not found for Project {1},BOM por defecto para {0} no encontrado para Proyecto {1}
 apps/erpnext/erpnext/config/hr.py +127,Claims for company expense.,Peticiones para gastos de compañía
-apps/erpnext/erpnext/utilities/activation.py +119,"Students are at the heart of the system, add all your students","Los estudiantes están en el corazón del sistema, se suman todos sus estudiantes"
+apps/erpnext/erpnext/utilities/activation.py +119,"Students are at the heart of the system, add all your students","Los estudiantes son el corazón del sistema, agrega todos tus estudiantes"
 apps/erpnext/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.py +81,Row #{0}: Clearance date {1} cannot be before Cheque Date {2},Fila # {0}: Fecha de Liquidación {1} no puede ser anterior Cheque Fecha {2}
 DocType: Company,Default Holiday List,Lista de vacaciones / festividades predeterminadas
 apps/erpnext/erpnext/projects/doctype/timesheet/timesheet.py +187,Row {0}: From Time and To Time of {1} is overlapping with {2},Fila {0}: Del tiempo y Tiempo de {1} se solapan con {2}
@@ -1614,7 +1614,7 @@
 DocType: Party Account,Party Account,Cuenta asignada
 apps/erpnext/erpnext/config/setup.py +122,Human Resources,Recursos humanos
 DocType: Lead,Upper Income,Ingresos superior
-DocType: Item Manufacturer,Item Manufacturer,artículo Fabricante
+DocType: Item Manufacturer,Item Manufacturer,Fabricante del artículo
 apps/erpnext/erpnext/schools/doctype/student_applicant/student_applicant.js +13,Reject,Rechazar
 DocType: Journal Entry Account,Debit in Company Currency,Divisa por defecto de la cuenta de débito
 DocType: BOM Item,BOM Item,Lista de materiales (LdM) del producto
@@ -1623,7 +1623,7 @@
 apps/erpnext/erpnext/accounts/doctype/journal_entry/journal_entry.py +126,Row {0}: Advance against Supplier must be debit,Fila {0}: Avance contra el Proveedor debe debitar
 DocType: Company,Default Values,Valores predeterminados
 DocType: Expense Claim,Total Amount Reimbursed,Monto total reembolsado
-apps/erpnext/erpnext/hr/doctype/vehicle/vehicle_dashboard.py +5,This is based on logs against this Vehicle. See timeline below for details,Esto se basa en los registros contra este vehículo. Ver cronología abajo para más detalles
+apps/erpnext/erpnext/hr/doctype/vehicle/vehicle_dashboard.py +5,This is based on logs against this Vehicle. See timeline below for details,Esta basado en registros contra este Vehículo. Ver el cronograma debajo para más detalles
 apps/erpnext/erpnext/schools/doctype/fees/fees.js +41,Collect,Recoger
 apps/erpnext/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py +82,Against Supplier Invoice {0} dated {1},Contra factura de proveedor {0} con fecha{1}
 DocType: Customer,Default Price List,Lista de precios por defecto
@@ -1636,7 +1636,7 @@
 apps/erpnext/erpnext/config/accounts.py +142,Update bank payment dates with journals.,Actualización de las fechas de pago del banco con los registros.
 apps/erpnext/erpnext/stock/doctype/item/item_dashboard.py +21,Pricing,la fijación de precios
 DocType: Quotation,Term Details,Detalles de términos y condiciones
-apps/erpnext/erpnext/schools/doctype/student_group/student_group.py +40,Cannot enroll more than {0} students for this student group.,No se puede inscribir más de {0} estudiantes de este grupo de estudiantes.
+apps/erpnext/erpnext/schools/doctype/student_group/student_group.py +40,Cannot enroll more than {0} students for this student group.,No se puede inscribir más de {0} estudiantes para este grupo de estudiantes.
 apps/erpnext/erpnext/accounts/doctype/asset_category/asset_category.py +15,{0} must be greater than 0,{0} debe ser mayor que 0
 DocType: Manufacturing Settings,Capacity Planning For (Days),Planificación de capacidad para (Días)
 apps/erpnext/erpnext/buying/doctype/supplier/supplier_dashboard.py +10,Procurement,Obtención
@@ -1650,7 +1650,7 @@
 DocType: Accounts Settings,Unlink Payment on Cancellation of Invoice,Desvinculación de Pago en la cancelación de la factura
 apps/erpnext/erpnext/hr/doctype/vehicle_log/vehicle_log.py +16,Current Odometer reading entered should be greater than initial Vehicle Odometer {0},Lectura actual del odómetro entrado debe ser mayor que el cuentakilómetros inicial {0}
 DocType: Shipping Rule Country,Shipping Rule Country,Regla de envio del país
-apps/erpnext/erpnext/hr/doctype/employee/employee_dashboard.py +10,Leave and Attendance,Deja y Asistencia
+apps/erpnext/erpnext/hr/doctype/employee/employee_dashboard.py +10,Leave and Attendance,Ausencia y Asistencia
 DocType: Maintenance Visit,Partially Completed,Parcialmente completado
 DocType: Leave Type,Include holidays within leaves as leaves,Incluir las vacaciones y ausencias únicamente como ausencias
 DocType: Sales Invoice,Packed Items,Productos Empacados
@@ -1662,7 +1662,7 @@
 apps/erpnext/erpnext/accounts/doctype/journal_entry/journal_entry.py +248,"Advance paid against {0} {1} cannot be greater \
 						than Grand Total {2}",El anticipo pagado para {0} {1} no puede ser mayor que el total {2}
 apps/erpnext/erpnext/maintenance/doctype/maintenance_schedule/maintenance_schedule.py +148,Please select item code,"Por favor, seleccione el código del producto"
-DocType: Student Sibling,Studying in Same Institute,Estudiar en el mismo Instituto
+DocType: Student Sibling,Studying in Same Institute,Estudian en el mismo Instituto
 DocType: Territory,Territory Manager,Gerente de Territorio
 DocType: Packed Item,To Warehouse (Optional),Para almacenes (Opcional)
 DocType: Payment Entry,Paid Amount (Company Currency),Monto pagado (Divisa por defecto)
@@ -1671,7 +1671,7 @@
 apps/erpnext/erpnext/setup/setup_wizard/industry_type.py +39,Online Auctions,Subastas en línea
 apps/erpnext/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py +98,Please specify either Quantity or Valuation Rate or both,"Por favor indique la Cantidad o el Tipo de Valoración, o ambos"
 apps/erpnext/erpnext/selling/doctype/sales_order/sales_order_dashboard.py +14,Fulfillment,Cumplimiento
-apps/erpnext/erpnext/templates/generators/item.html +67,View in Cart,Ver Carrito
+apps/erpnext/erpnext/templates/generators/item.html +67,View in Cart,Ver en Carrito
 apps/erpnext/erpnext/accounts/doctype/account/chart_of_accounts/verified/standard_chart_of_accounts.py +101,Marketing Expenses,GASTOS DE PUBLICIDAD
 ,Item Shortage Report,Reporte de productos con stock bajo
 apps/erpnext/erpnext/stock/doctype/item/item.js +256,"Weight is mentioned,\nPlease mention ""Weight UOM"" too","El peso está definido,\nPor favor indique ""UDM Peso"" también"
@@ -1715,7 +1715,7 @@
 DocType: Program Course,Required,Necesario
 DocType: Job Applicant,Applicant for a Job,Solicitante de Empleo
 DocType: Production Plan Material Request,Production Plan Material Request,Producción Solicitud Plan de materiales
-apps/erpnext/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.py +235,No Production Orders created,No existen órdenes de producción (OP)
+apps/erpnext/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.py +235,No Production Orders created,No se crearon Ordenes de Producción
 DocType: Stock Reconciliation,Reconciliation JSON,Reconciliación JSON
 apps/erpnext/erpnext/accounts/report/financial_statements.html +3,Too many columns. Export the report and print it using a spreadsheet application.,Hay demasiadas columnas. Exportar el informe e imprimirlo mediante una aplicación de hoja de cálculo.
 DocType: Purchase Invoice Item,Batch No,Lote No.
@@ -1754,7 +1754,7 @@
 DocType: Packing Slip,The net weight of this package. (calculated automatically as sum of net weight of items),El peso neto de este paquete. (calculado automáticamente por la suma del peso neto de los materiales)
 apps/erpnext/erpnext/stock/doctype/warehouse/warehouse.py +82,Please create an Account for this Warehouse and link it. This cannot be done automatically as an account with name {0} already exists,Por favor crea una cuenta para este almacén y vincularlo. Esto no se puede hacer automáticamente como una cuenta con el nombre {0} ya existe
 DocType: Sales Order,To Deliver and Bill,Para entregar y facturar
-DocType: Student Batch,Instructors,Los instructores
+DocType: Student Batch,Instructors,Instructores
 DocType: GL Entry,Credit Amount in Account Currency,Importe acreditado con la divisa
 apps/erpnext/erpnext/manufacturing/doctype/bom/bom.py +510,BOM {0} must be submitted,La lista de materiales (LdM) {0} debe ser validada
 DocType: Authorization Control,Authorization Control,Control de Autorización
@@ -1779,12 +1779,12 @@
 apps/erpnext/erpnext/stock/doctype/packing_slip/packing_slip.js +78,You have entered duplicate items. Please rectify and try again.,Ha introducido elementos duplicados . Por favor rectifique y vuelva a intentarlo .
 apps/erpnext/erpnext/setup/setup_wizard/install_fixtures.py +91,Associate,Asociado
 DocType: Asset Movement,Asset Movement,Movimiento activo
-apps/erpnext/erpnext/accounts/page/pos/pos.js +2031,New Cart,nuevo carro
+apps/erpnext/erpnext/accounts/page/pos/pos.js +2031,New Cart,Nuevo Carrito
 apps/erpnext/erpnext/selling/doctype/installation_note/installation_note.py +44,Item {0} is not a serialized Item,El producto {0} no es un producto serializado
 DocType: SMS Center,Create Receiver List,Crear lista de receptores
 DocType: Vehicle,Wheels,ruedas
 DocType: Packing Slip,To Package No.,Al paquete No.
-DocType: Production Planning Tool,Material Requests,Las solicitudes de materiales
+DocType: Production Planning Tool,Material Requests,Solicitudes de Material
 DocType: Warranty Claim,Issue Date,Fecha de emisión
 DocType: Activity Cost,Activity Cost,Costo de Actividad
 DocType: Sales Invoice Timesheet,Timesheet Detail,Detalle de parte de horas
@@ -1881,14 +1881,14 @@
 DocType: Item Attribute,Attribute Name,Nombre del Atributo
 DocType: BOM,Show In Website,Mostrar en el sitio web
 DocType: Shopping Cart Settings,Show Quantity in Website,Cantidad mostrar en la Página Web
-DocType: Employee Loan Application,Total Payable Amount,La cantidad total a pagar
+DocType: Employee Loan Application,Total Payable Amount,Monto Total a Pagar
 DocType: Task,Expected Time (in hours),Tiempo previsto (en horas)
 DocType: Item Reorder,Check in (group),El proceso de registro (grupo)
 ,Qty to Order,Cantidad a solicitar
 DocType: Period Closing Voucher,"The account head under Liability or Equity, in which Profit/Loss will be booked","El cabezal cuenta bajo pasivo o patrimonio, en el que será reservado Ganancia / Pérdida"
 apps/erpnext/erpnext/config/projects.py +25,Gantt chart of all tasks.,Diagrama Gantt de todas las tareas.
 DocType: Opportunity,Mins to First Response,Minutos hasta la primera respuesta
-DocType: Pricing Rule,Margin Type,Tipo margen
+DocType: Pricing Rule,Margin Type,Tipo de margen
 apps/erpnext/erpnext/projects/doctype/project/project_dashboard.html +15,{0} hours,{0} horas
 DocType: Course,Default Grading Scale,Escala de Calificación por defecto
 DocType: Appraisal,For Employee Name,Por nombre de empleado
@@ -1911,7 +1911,7 @@
 apps/erpnext/erpnext/selling/doctype/sales_order/sales_order.js +887,Select BOM and Qty for Production,Seleccione la lista de materiales y de Unidades de Producción
 DocType: Asset,Depreciation Schedule,Programación de la depreciación
 DocType: Bank Reconciliation Detail,Against Account,Contra la cuenta
-apps/erpnext/erpnext/hr/doctype/leave_application/leave_application.py +71,Half Day Date should be between From Date and To Date,Medio día de la fecha debe estar entre De la fecha y Hasta la fecha
+apps/erpnext/erpnext/hr/doctype/leave_application/leave_application.py +71,Half Day Date should be between From Date and To Date,Fecha de medio día debe estar entre la fecha desde y fecha hasta
 DocType: Maintenance Schedule Detail,Actual Date,Fecha Real
 DocType: Item,Has Batch No,Posee número de lote
 apps/erpnext/erpnext/public/js/utils.js +90,Annual Billing: {0},Facturación anual: {0}
@@ -1958,7 +1958,7 @@
 apps/erpnext/erpnext/setup/setup_wizard/industry_type.py +50,Sports,Deportes
 DocType: Loan Type,Loan Name,Nombre del préstamo
 apps/erpnext/erpnext/accounts/report/budget_variance_report/budget_variance_report.py +56,Total Actual,Total Actual
-DocType: Student Siblings,Student Siblings,Los hermanos de los estudiantes
+DocType: Student Siblings,Student Siblings,Hermanos del Estudiante
 apps/erpnext/erpnext/public/js/setup_wizard.js +303,Unit,Unidad(es)
 apps/erpnext/erpnext/stock/get_item_details.py +122,Please specify Company,"Por favor, especifique la compañía"
 ,Customer Acquisition and Loyalty,Compras y Lealtad de Clientes
@@ -2020,7 +2020,7 @@
 apps/erpnext/erpnext/maintenance/doctype/maintenance_schedule/maintenance_schedule.py +192,Serial No {0} is under warranty upto {1},Número de serie {0} está en garantía hasta {1}
 apps/erpnext/erpnext/config/stock.py +158,Split Delivery Note into packages.,Dividir nota de entrega entre paquetes.
 apps/erpnext/erpnext/hooks.py +87,Shipments,Envíos
-DocType: Payment Entry,Total Allocated Amount (Company Currency),Total asignado (Compañía de divisas)
+DocType: Payment Entry,Total Allocated Amount (Company Currency),Monto Total asignado (Divisa de la Compañia)
 DocType: Purchase Order Item,To be delivered to customer,Para ser entregado al cliente
 DocType: BOM,Scrap Material Cost,Costo de materiales de desecho
 apps/erpnext/erpnext/stock/doctype/serial_no/serial_no.py +223,Serial No {0} does not belong to any Warehouse,El número de serie {0} no pertenece a ningún almacén
@@ -2049,7 +2049,7 @@
 DocType: Purchase Invoice Item,Rate (Company Currency),Precio (Divisa por defecto)
 DocType: Student Guardian,Others,Otros
 DocType: Payment Entry,Unallocated Amount,Monto sin asignar
-apps/erpnext/erpnext/templates/includes/product_page.js +69,Cannot find a matching Item. Please select some other value for {0}.,Si no encuentra un artículo a juego. Por favor seleccione otro valor para {0}.
+apps/erpnext/erpnext/templates/includes/product_page.js +69,Cannot find a matching Item. Please select some other value for {0}.,No se peude encontrar un artículo que concuerde.  Por favor seleccione otro valor para {0}.
 DocType: POS Profile,Taxes and Charges,Impuestos y cargos
 DocType: Item,"A Product or a Service that is bought, sold or kept in stock.","Un producto o un servicio que se compra, se vende o se mantiene en stock."
 apps/erpnext/erpnext/hr/page/team_updates/team_updates.js +44,No more updates,No hay más actualizaciones
@@ -2073,7 +2073,7 @@
 DocType: Employee Loan,Account Info,Informacion de cuenta
 DocType: Activity Type,Default Billing Rate,Monto de facturación predeterminada
 DocType: Sales Invoice,Total Billing Amount,Importe total de facturación
-apps/erpnext/erpnext/hr/doctype/daily_work_summary_settings/daily_work_summary_settings.py +17,There must be a default incoming Email Account enabled for this to work. Please setup a default incoming Email Account (POP/IMAP) and try again.,"Tiene que haber un defecto de entrada cuenta de correo electrónico habilitado para que esto funcione. Por favor, configurar una cuenta de correo electrónico entrante por defecto (POP / IMAP) y vuelve a intentarlo."
+apps/erpnext/erpnext/hr/doctype/daily_work_summary_settings/daily_work_summary_settings.py +17,There must be a default incoming Email Account enabled for this to work. Please setup a default incoming Email Account (POP/IMAP) and try again.,Tiene que haber una cuenta de correo electrónico habilitada por defecto para que esto funcione. Por favor configure una cuenta entrante de correo electrónico por defecto (POP / IMAP) y vuelve a intentarlo.
 apps/erpnext/erpnext/accounts/report/item_wise_sales_register/item_wise_sales_register.py +59,Receivable Account,Cuenta por cobrar
 apps/erpnext/erpnext/controllers/accounts_controller.py +559,Row #{0}: Asset {1} is already {2},Fila # {0}: {1} de activos ya es {2}
 DocType: Quotation Item,Stock Balance,Balance de Inventarios.
@@ -2149,9 +2149,9 @@
 DocType: Bin,Actual Quantity,Cantidad real
 DocType: Shipping Rule,example: Next Day Shipping,ejemplo : Envío express
 apps/erpnext/erpnext/maintenance/doctype/maintenance_schedule/maintenance_schedule.py +188,Serial No {0} not found,Numero de serie {0} no encontrado
-apps/erpnext/erpnext/schools/report/student_batch_wise_attendance/student_batch_wise_attendance.py +41,Student Batch,lote estudiante
+apps/erpnext/erpnext/schools/report/student_batch_wise_attendance/student_batch_wise_attendance.py +41,Student Batch,Lote de Estudiante
 apps/erpnext/erpnext/public/js/setup_wizard.js +242,Your Customers,Sus clientes
-apps/erpnext/erpnext/utilities/activation.py +120,Make Student,hacer Estudiante
+apps/erpnext/erpnext/utilities/activation.py +120,Make Student,Crear Estudiante
 apps/erpnext/erpnext/projects/doctype/project/project.py +190,You have been invited to collaborate on the project: {0},Se le ha invitado a colaborar en el proyecto: {0}
 DocType: Leave Block List Date,Block Date,Bloquear fecha
 apps/erpnext/erpnext/templates/generators/student_admission.html +23,Apply Now,Aplica ya
@@ -2220,7 +2220,7 @@
 DocType: Stock Entry,Purchase Receipt No,Recibo de compra No.
 apps/erpnext/erpnext/accounts/doctype/account/chart_of_accounts/verified/standard_chart_of_accounts.py +30,Earnest Money,GANANCIAS PERCIBIDAS
 DocType: Process Payroll,Create Salary Slip,Crear nómina salarial
-apps/erpnext/erpnext/stock/doctype/item/item_dashboard.py +34,Traceability,trazabilidad
+apps/erpnext/erpnext/stock/doctype/item/item_dashboard.py +34,Traceability,Trazabilidad
 apps/erpnext/erpnext/accounts/doctype/account/chart_of_accounts/verified/standard_chart_of_accounts.py +135,Source of Funds (Liabilities),Origen de fondos (Pasivo)
 apps/erpnext/erpnext/stock/doctype/stock_entry/stock_entry.py +372,Quantity in row {0} ({1}) must be same as manufactured quantity {2},La cantidad en la línea {0} ({1}) debe ser la misma que la cantidad producida {2}
 DocType: Appraisal,Employee,Empleado
@@ -2270,7 +2270,7 @@
 apps/erpnext/erpnext/public/js/conf.js +28,User Forum,Foro de Usuarios
 apps/erpnext/erpnext/manufacturing/doctype/bom/bom.py +248,Raw Materials cannot be blank.,'Materias primas' no puede estar en blanco.
 apps/erpnext/erpnext/accounts/doctype/sales_invoice/sales_invoice.py +444,"Could not update stock, invoice contains drop shipping item.","No se pudo actualizar valores, factura contiene los artículos del envío de la gota."
-apps/erpnext/erpnext/accounts/doctype/journal_entry/journal_entry.js +459,Quick Journal Entry,Asiento Rápida
+apps/erpnext/erpnext/accounts/doctype/journal_entry/journal_entry.js +459,Quick Journal Entry,Asiento Contable Rápido
 apps/erpnext/erpnext/manufacturing/doctype/bom/bom.js +142,You can not change rate if BOM mentioned agianst any item,No se puede cambiar el precio si existe una Lista de materiales (LdM) en el producto
 apps/erpnext/erpnext/schools/doctype/student_batch/student_batch.py +24,Student Group exists with same name,Grupo de Estudiantes existe con el mismo nombre
 DocType: Employee,Previous Work Experience,Experiencia laboral previa
@@ -2309,7 +2309,7 @@
 apps/erpnext/erpnext/config/manufacturing.py +46,Tree of Bill of Materials,Árbol de lista de materiales
 DocType: Student,Joining Date,Dia de ingreso
 ,Employees working on a holiday,Los empleados que trabajan en un día festivo
-apps/erpnext/erpnext/hr/doctype/employee_attendance_tool/employee_attendance_tool.js +151,Mark Present,Marcos Presente
+apps/erpnext/erpnext/hr/doctype/employee_attendance_tool/employee_attendance_tool.js +151,Mark Present,Marcar Presente
 DocType: Project,% Complete Method,% Método completado
 apps/erpnext/erpnext/maintenance/doctype/maintenance_schedule/maintenance_schedule.py +201,Maintenance start date can not be before delivery date for Serial No {0},La fecha de inicio del mantenimiento no puede ser anterior de la fecha de entrega para {0}
 DocType: Production Order,Actual End Date,Fecha Real de Finalización
@@ -2320,7 +2320,7 @@
 DocType: Company,Fixed Asset Depreciation Settings,Configuración de depreciación de los inmuebles
 DocType: Item,Will also apply for variants unless overrridden,También se aplicará para las variantes menos que se sobre escriba
 DocType: Purchase Invoice,Advances,Anticipos
-DocType: Production Order,Manufacture against Material Request,Fabricación contra pedido Material
+DocType: Production Order,Manufacture against Material Request,Fabricación contra Pedido de Material
 DocType: Item Reorder,Request for,solicitud de
 apps/erpnext/erpnext/setup/doctype/authorization_rule/authorization_rule.py +32,Approving User cannot be same as user the rule is Applicable To,El usuario que aprueba no puede ser igual que el usuario para el que la regla es aplicable
 DocType: Stock Entry Detail,Basic Rate (as per Stock UOM),Precio base (según la UdM)
@@ -2337,7 +2337,7 @@
 apps/erpnext/erpnext/accounts/doctype/journal_entry/journal_entry.py +364,{0} against Purchase Order {1},{0} contra la orden de compra {1}
 DocType: SMS Settings,"Enter static url parameters here (Eg. sender=ERPNext, username=ERPNext, password=1234 etc.)","Introduzca los parámetros de URL aquí (Ej. sender = ERPNext , nombre de usuario = ERPNext , contraseña = 1234 etc )"
 DocType: Task,Actual Start Date (via Time Sheet),Fecha de inicio real (a través de hoja de horas)
-apps/erpnext/erpnext/portal/doctype/homepage/homepage.py +15,This is an example website auto-generated from ERPNext,Este es un sitio web ejemplo generado automáticamente por ERPNext
+apps/erpnext/erpnext/portal/doctype/homepage/homepage.py +15,This is an example website auto-generated from ERPNext,Este es un sitio web de ejemplo generado automáticamente por ERPNext
 apps/erpnext/erpnext/accounts/report/accounts_payable/accounts_payable.js +37,Ageing Range 1,Rango de antigüedad 1
 DocType: Purchase Taxes and Charges Template,"Standard tax template that can be applied to all Purchase Transactions. This template can contain list of tax heads and also other expense heads like ""Shipping"", ""Insurance"", ""Handling"" etc.
 
@@ -2448,17 +2448,17 @@
 apps/erpnext/erpnext/stock/doctype/landed_cost_voucher/landed_cost_voucher.py +52,Receipt document must be submitted,documento de recepción debe ser presentado
 DocType: Purchase Invoice Item,Received Qty,Cantidad recibida
 DocType: Stock Entry Detail,Serial No / Batch,No. de serie / lote
-apps/erpnext/erpnext/selling/doctype/sales_order/sales_order.py +310,Not Paid and Not Delivered,"No satisfechos, y no entregados"
+apps/erpnext/erpnext/selling/doctype/sales_order/sales_order.py +310,Not Paid and Not Delivered,No pago y no entregado
 DocType: Product Bundle,Parent Item,Producto padre / principal
 DocType: Account,Account Type,Tipo de cuenta
 DocType: Delivery Note,DN-RET-,DN-RET-
-apps/erpnext/erpnext/templates/pages/projects.html +58,No time sheets,De listas de asistencia
+apps/erpnext/erpnext/templates/pages/projects.html +58,No time sheets,No hay hojas de tiempo
 apps/erpnext/erpnext/hr/doctype/leave_allocation/leave_allocation.py +123,Leave Type {0} cannot be carry-forwarded,Deja tipo {0} no se pueden reenviar-llevar
 apps/erpnext/erpnext/maintenance/doctype/maintenance_schedule/maintenance_schedule.py +216,Maintenance Schedule is not generated for all the items. Please click on 'Generate Schedule',"El programa de mantenimiento no se genera para todos los productos. Por favor, haga clic en 'Generar programación'"
 ,To Produce,Producir
 apps/erpnext/erpnext/config/hr.py +93,Payroll,Nómina de sueldos
 apps/erpnext/erpnext/accounts/doctype/payment_entry/payment_entry.js +171,"For row {0} in {1}. To include {2} in Item rate, rows {3} must also be included","Para la línea {0} en {1}. incluir {2} en la tasa del producto, las lineas {3} también deben ser incluidas"
-apps/erpnext/erpnext/utilities/activation.py +102,Make User,hacer usuario
+apps/erpnext/erpnext/utilities/activation.py +102,Make User,Crear Usuario
 DocType: Packing Slip,Identification of the package for the delivery (for print),La identificación del paquete para la entrega (para impresión)
 DocType: Bin,Reserved Quantity,Cantidad Reservada
 DocType: Landed Cost Voucher,Purchase Receipt Items,Productos del recibo de compra
@@ -2473,10 +2473,10 @@
 DocType: BOM Item,"See ""Rate Of Materials Based On"" in Costing Section",Consulte 'tasa de materiales en base de' en la sección de costos
 DocType: Appraisal Goal,Key Responsibility Area,Área de Responsabilidad Clave
 apps/erpnext/erpnext/utilities/activation.py +128,"Student Batches help you track attendance, assessments and fees for students","Los lotes de los estudiantes ayudan a realizar un seguimiento de asistencia, evaluaciones y cuotas para los estudiantes"
-DocType: Payment Entry,Total Allocated Amount,Total asignado
+DocType: Payment Entry,Total Allocated Amount,Monto Total Asignado
 DocType: Item Reorder,Material Request Type,Tipo de requisición
 apps/erpnext/erpnext/hr/doctype/process_payroll/process_payroll.py +273,Accural Journal Entry for salaries from {0} to {1},Entrada de diario Accural para salarios de {0} a {1}
-apps/erpnext/erpnext/accounts/page/pos/pos.js +768,"LocalStorage is full, did not save","LocalStorage está llena, no salvó"
+apps/erpnext/erpnext/accounts/page/pos/pos.js +768,"LocalStorage is full, did not save","Almacenamiento Local esta lleno, no se guardó"
 apps/erpnext/erpnext/stock/doctype/stock_entry/stock_entry.py +79,Row {0}: UOM Conversion Factor is mandatory,Línea {0}: El factor de conversión de (UdM) es obligatorio
 apps/erpnext/erpnext/accounts/report/accounts_receivable/accounts_receivable.html +17,Ref,Referencia
 DocType: Budget,Cost Center,Centro de costos
@@ -2508,7 +2508,7 @@
 DocType: Supplier Quotation,SQTN-,SQTN-
 apps/erpnext/erpnext/accounts/doctype/cost_center/cost_center_tree.js +22,New Cost Center Name,Nombre del nuevo centro de costes
 DocType: Leave Control Panel,Leave Control Panel,Panel de control de ausencias
-DocType: Project,Task Completion,La terminación de la tarea
+DocType: Project,Task Completion,Completitud de Tarea
 apps/erpnext/erpnext/templates/form_grid/stock_entry_grid.html +26,Not in Stock,No disponible en stock
 DocType: Appraisal,HR User,Usuario de recursos humanos
 DocType: Purchase Invoice,Taxes and Charges Deducted,Impuestos y cargos deducidos
@@ -2534,7 +2534,7 @@
 apps/erpnext/erpnext/accounts/doctype/account/chart_of_accounts/verified/standard_chart_of_accounts.py +26,Loans and Advances (Assets),INVERSIONES Y PRESTAMOS
 apps/erpnext/erpnext/accounts/doctype/account/chart_of_accounts/verified/standard_chart_of_accounts.py +12,Debtors,DEUDORES VARIOS
 apps/erpnext/erpnext/setup/setup_wizard/install_fixtures.py +161,Large,Grande
-DocType: Homepage Featured Product,Homepage Featured Product,Página de inicio Producto destacado
+DocType: Homepage Featured Product,Homepage Featured Product,Producto destacado en página de inicio
 apps/erpnext/erpnext/setup/setup_wizard/install_fixtures.py +198,All Assessment Groups,Todos los grupos de evaluación
 apps/erpnext/erpnext/stock/doctype/warehouse/warehouse_tree.js +15,New Warehouse Name,Almacén nuevo nombre
 apps/erpnext/erpnext/accounts/report/financial_statements.py +218,Total {0} ({1}),Total {0} ({1})
@@ -2600,8 +2600,8 @@
 apps/erpnext/erpnext/accounts/doctype/payment_entry/payment_entry.py +188,{0} {1} does not associated with {2} {3},{0} {1} no asociada a {2} {3}
 apps/erpnext/erpnext/hr/doctype/attendance/attendance.py +18,Attendance for employee {0} is already marked,Asistencia para el empleado {0} ya está marcado
 DocType: Packing Slip,If more than one package of the same type (for print),Si es más de un paquete del mismo tipo (para impresión)
-,Salary Register,salario Registro
-DocType: Warehouse,Parent Warehouse,Almacén de los padres
+,Salary Register,Registro de Salario
+DocType: Warehouse,Parent Warehouse,Almacén Padre
 DocType: C-Form Invoice Detail,Net Total,Total Neto
 apps/erpnext/erpnext/config/hr.py +163,Define various loan types,Definir varios tipos de préstamos
 DocType: Bin,FCFS Rate,Cambio FCFS
@@ -2670,13 +2670,13 @@
 apps/erpnext/erpnext/stock/doctype/material_request/material_request.js +757,Warning: Material Requested Qty is less than Minimum Order Qty,Advertencia: La requisición de materiales es menor que la orden mínima establecida
 apps/erpnext/erpnext/accounts/doctype/gl_entry/gl_entry.py +212,Account {0} is frozen,La cuenta {0} está congelada
 DocType: Company,Legal Entity / Subsidiary with a separate Chart of Accounts belonging to the Organization.,Entidad Legal / Subsidiario con un Catalogo de Cuentas separado que pertenece a la Organización.
-DocType: Payment Request,Mute Email,Silenciar Email
+DocType: Payment Request,Mute Email,Email Silenciado
 apps/erpnext/erpnext/setup/setup_wizard/industry_type.py +29,"Food, Beverage & Tobacco","Alimentos, bebidas y tabaco"
 apps/erpnext/erpnext/accounts/doctype/payment_entry/payment_entry.py +623,Can only make payment against unbilled {0},Sólo se puede crear el pago contra {0} impagado
 apps/erpnext/erpnext/controllers/selling_controller.py +131,Commission rate cannot be greater than 100,El porcentaje de comisión no puede ser superior a 100
 DocType: Stock Entry,Subcontract,Sub-contrato
 apps/erpnext/erpnext/public/js/utils/party.js +161,Please enter {0} first,"Por favor, introduzca {0} primero"
-apps/erpnext/erpnext/hr/doctype/daily_work_summary/daily_work_summary.py +64,No replies from,No hay respuestas desde
+apps/erpnext/erpnext/hr/doctype/daily_work_summary/daily_work_summary.py +64,No replies from,No hay respuestas de
 DocType: Production Order Operation,Actual End Time,Hora final real
 DocType: Production Planning Tool,Download Materials Required,Descargar materiales necesarios
 DocType: Item Manufacturer,Manufacturer Part Number,Número de componente del fabricante
@@ -2704,7 +2704,7 @@
 DocType: Rename Tool,Rename Log,Cambiar el nombre de sesión
 DocType: HR Settings,Maintain Billing Hours and Working Hours Same on Timesheet,Mantener Horas y horas de trabajo de facturación igual en parte de horas
 DocType: Maintenance Visit Purpose,Against Document No,Contra el Documento No
-DocType: BOM,Scrap,Chatarra
+DocType: BOM,Scrap,Desecho
 apps/erpnext/erpnext/config/selling.py +110,Manage Sales Partners.,Administrar socios de ventas.
 DocType: Quality Inspection,Inspection Type,Tipo de inspección
 apps/erpnext/erpnext/stock/doctype/warehouse/warehouse.py +237,Warehouses with existing transaction can not be converted to group.,Complejos de transacción existentes no pueden ser convertidos en grupo.
@@ -2734,7 +2734,7 @@
 DocType: Customer Group,Only leaf nodes are allowed in transaction,Sólo las sub-cuentas son permitidas en una transacción
 DocType: Expense Claim,Expense Approver,Supervisor de gastos
 apps/erpnext/erpnext/accounts/doctype/journal_entry/journal_entry.py +124,Row {0}: Advance against Customer must be credit,Fila {0}: Avance contra el Cliente debe ser de crédito
-apps/erpnext/erpnext/accounts/doctype/account/account.js +66,Non-Group to Group,No al Grupo Grupo
+apps/erpnext/erpnext/accounts/doctype/account/account.js +66,Non-Group to Group,No-Grupo a Grupo
 DocType: Purchase Receipt Item Supplied,Purchase Receipt Item Supplied,Recibo de compra del producto suministrado
 DocType: Payment Entry,Pay,Pagar
 apps/erpnext/erpnext/projects/report/daily_timesheet_summary/daily_timesheet_summary.py +24,To Datetime,Para fecha y hora
@@ -2761,7 +2761,7 @@
 DocType: Purchase Invoice Item,Accepted Warehouse,Almacén Aceptado
 DocType: Bank Reconciliation Detail,Posting Date,Fecha de contabilización
 DocType: Item,Valuation Method,Método de valoración
-apps/erpnext/erpnext/hr/doctype/employee_attendance_tool/employee_attendance_tool.js +202,Mark Half Day,Medio Día Marcos
+apps/erpnext/erpnext/hr/doctype/employee_attendance_tool/employee_attendance_tool.js +202,Mark Half Day,Marcar Medio Día
 DocType: Sales Invoice,Sales Team,Equipo de ventas
 apps/erpnext/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py +85,Duplicate entry,Entrada duplicada
 DocType: Program Enrollment Tool,Get Students,Obtener estudiantes
@@ -2770,7 +2770,7 @@
 DocType: Sales Order,In Words will be visible once you save the Sales Order.,En palabras serán visibles una vez que guarde el pedido de ventas.
 ,Employee Birthday,Cumpleaños del empleado
 DocType: Student Batch Attendance Tool,Student Batch Attendance Tool,Herramienta de lotes de Asistencia del Estudiante
-apps/erpnext/erpnext/controllers/status_updater.py +198,Limit Crossed,límite cruzadas
+apps/erpnext/erpnext/controllers/status_updater.py +198,Limit Crossed,Límite Cruzado
 apps/erpnext/erpnext/setup/setup_wizard/industry_type.py +55,Venture Capital,Capital de riesgo
 apps/erpnext/erpnext/schools/doctype/academic_term/academic_term.py +40,An academic term with this 'Academic Year' {0} and 'Term Name' {1} already exists. Please modify these entries and try again.,"Un término académico con esto &#39;Año Académico&#39; {0} y &#39;Nombre término&#39; {1} ya existe. Por favor, modificar estas entradas y vuelva a intentarlo."
 apps/erpnext/erpnext/stock/doctype/item/item.py +466,"As there are existing transactions against item {0}, you can not change the value of {1}","Como hay transacciones existentes contra el elemento {0}, no se puede cambiar el valor de {1}"
@@ -2805,7 +2805,7 @@
 DocType: GL Entry,Voucher No,Comprobante No.
 DocType: Leave Allocation,Leave Allocation,Asignación de vacaciones
 DocType: Payment Request,Recipient Message And Payment Details,Mensaje receptor y formas de pago
-DocType: Training Event,Trainer Email,entrenador correo electrónico
+DocType: Training Event,Trainer Email,Correo electrónico del entrenador
 apps/erpnext/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.py +546,Material Requests {0} created,Requisición de materiales {0} creada
 DocType: Production Planning Tool,Include sub-contracted raw materials,Incluya materias primas subcontratados
 apps/erpnext/erpnext/config/selling.py +164,Template of terms or contract.,Configuración de las plantillas de términos y condiciones.
@@ -2854,7 +2854,7 @@
 DocType: Sales Invoice,Write Off Outstanding Amount,Balance de pagos pendientes
 DocType: Student Batch Creation Tool,Student Batch Creation Tool,Herramienta de Creación de lotes estudiante
 DocType: Stock Settings,Default Stock UOM,Unidad de Medida (UdM) predeterminada para Inventario
-DocType: Asset,Number of Depreciations Booked,Número de reserva Depreciaciones
+DocType: Asset,Number of Depreciations Booked,Cantidad de Depreciaciones Reservadas
 apps/erpnext/erpnext/hr/doctype/employee_loan/employee_loan.py +32,Against Employee Loan: {0},Préstamo contra del empleado: {0}
 DocType: Landed Cost Item,Receipt Document,la recepción de documentos
 DocType: Production Planning Tool,Create Material Requests,Crear requisición de materiales
@@ -2868,7 +2868,7 @@
 DocType: Student Guardian,Father,Padre
 apps/erpnext/erpnext/controllers/accounts_controller.py +568,'Update Stock' cannot be checked for fixed asset sale,'Actualización de Inventario' no se puede comprobar en venta de activos fijos
 DocType: Bank Reconciliation,Bank Reconciliation,Conciliación bancaria
-DocType: Attendance,On Leave,en licencia
+DocType: Attendance,On Leave,De licencia
 apps/erpnext/erpnext/templates/includes/footer/footer_extension.html +7,Get Updates,Obtener actualizaciones
 apps/erpnext/erpnext/accounts/doctype/gl_entry/gl_entry.py +97,{0} {1}: Account {2} does not belong to Company {3},{0} {1}: La cuenta {2} no pertenece a la empresa {3}
 apps/erpnext/erpnext/buying/doctype/purchase_order/purchase_order.py +132,Material Request {0} is cancelled or stopped,Requisición de materiales {0} cancelada o detenida
@@ -2972,7 +2972,7 @@
 apps/erpnext/erpnext/accounts/doctype/shipping_rule/shipping_rule.py +44,From value must be less than to value in row {0},El valor debe ser menor que el valor de la línea {0}
 apps/erpnext/erpnext/setup/setup_wizard/install_fixtures.py +144,Wire Transfer,Transferencia bancaria
 apps/erpnext/erpnext/hr/doctype/employee_attendance_tool/employee_attendance_tool.js +131,Check all,Marque todas las
-DocType: Vehicle Log,Invoice Ref,Ref factura
+DocType: Vehicle Log,Invoice Ref,Referencia de Factura
 DocType: Purchase Order,Recurring Order,Orden recurrente
 DocType: Company,Default Income Account,Cuenta de ingresos por defecto
 apps/erpnext/erpnext/selling/page/sales_analytics/sales_analytics.js +33,Customer Group / Customer,Categoría de cliente / Cliente
@@ -3016,7 +3016,7 @@
 apps/erpnext/erpnext/public/js/setup_wizard.js +230,e.g. VAT,por ejemplo IVA
 apps/erpnext/erpnext/stock/report/bom_search/bom_search.js +26,Item 4,Elemento 4
 DocType: Student Admission,Admission End Date,La entrada Fecha de finalización
-apps/erpnext/erpnext/buying/doctype/purchase_order/purchase_order_dashboard.py +21,Sub-contracting,La subcontratación
+apps/erpnext/erpnext/buying/doctype/purchase_order/purchase_order_dashboard.py +21,Sub-contracting,Subcontratación
 DocType: Journal Entry Account,Journal Entry Account,Cuenta de asiento contable
 apps/erpnext/erpnext/schools/doctype/academic_year/academic_year.js +3,Student Group,Grupo de Estudiantes
 DocType: Shopping Cart Settings,Quotation Series,Series de Presupuestos
@@ -3037,7 +3037,7 @@
 DocType: Student,Siblings,Los hermanos
 DocType: Journal Entry,Stock Entry,Entradas de inventario
 DocType: Payment Entry,Payment References,Referencias de pago
-DocType: C-Form,C-FORM-,C-FORM
+DocType: C-Form,C-FORM-,Formulario-C
 DocType: Vehicle,Insurance Details,Detalles de Seguros
 DocType: Account,Payable,Pagadero
 apps/erpnext/erpnext/hr/doctype/employee_loan/employee_loan.py +113,Please enter Repayment Periods,"Por favor, introduzca plazos de amortización"
@@ -3096,7 +3096,7 @@
 DocType: POS Profile,Update Stock,Actualizar el Inventario
 apps/erpnext/erpnext/stock/doctype/packing_slip/packing_slip.js +100,Different UOM for items will lead to incorrect (Total) Net Weight value. Make sure that Net Weight of each item is in the same UOM.,Unidad de Medida diferente para elementos dará lugar a Peso Neto (Total) incorrecto. Asegúrese de que el peso neto de cada artículo esté en la misma Unidad de Medida.
 apps/erpnext/erpnext/stock/report/item_prices/item_prices.py +39,BOM Rate,Coeficiente de la lista de materiales (LdM)
-DocType: Asset,Journal Entry for Scrap,Entrada de diario de la chatarra
+DocType: Asset,Journal Entry for Scrap,Entrada de diario para desguace
 apps/erpnext/erpnext/selling/doctype/installation_note/installation_note.py +83,Please pull items from Delivery Note,"Por favor, extraiga los productos de la nota de entrega"
 apps/erpnext/erpnext/accounts/utils.py +471,Journal Entries {0} are un-linked,Los asientos contables {0} no están enlazados
 apps/erpnext/erpnext/config/crm.py +74,"Record of all communications of type email, phone, chat, visit, etc.","Registro de todas las comunicaciones: correo electrónico, teléfono, chats, visitas, etc."
@@ -3156,13 +3156,13 @@
 apps/erpnext/erpnext/accounts/doctype/payment_entry/payment_entry.js +530,Please select Posting Date before selecting Party,"Por favor, seleccione Fecha de entrada antes de seleccionar la fiesta"
 DocType: Program Enrollment,School House,Casa de la escuela
 DocType: Serial No,Out of AMC,Fuera de CMA (Contrato de mantenimiento anual)
-apps/erpnext/erpnext/accounts/doctype/asset/asset.py +81,Number of Depreciations Booked cannot be greater than Total Number of Depreciations,Número de Depreciaciones reserva no puede ser mayor que el número total de amortizaciones
+apps/erpnext/erpnext/accounts/doctype/asset/asset.py +81,Number of Depreciations Booked cannot be greater than Total Number of Depreciations,Número de Depreciaciones Reservadas no puede ser mayor que el número total de Depreciaciones
 apps/erpnext/erpnext/maintenance/doctype/maintenance_schedule/maintenance_schedule.js +45,Make Maintenance Visit,Crear visita de mantenimiento
 apps/erpnext/erpnext/selling/doctype/customer/customer.py +177,Please contact to the user who have Sales Master Manager {0} role,"Por favor, póngase en contacto con el usuario gerente de ventas {0}"
 DocType: Company,Default Cash Account,Cuenta de efectivo por defecto
 apps/erpnext/erpnext/config/accounts.py +56,Company (not Customer or Supplier) master.,Configuración general del sistema.
-apps/erpnext/erpnext/schools/doctype/student/student_dashboard.py +6,This is based on the attendance of this Student,Esto se basa en la presencia de este Estudiante
-apps/erpnext/erpnext/stock/dashboard/item_dashboard.js +166,Add more items or open full form,Añadir más elementos o forma totalmente abierta
+apps/erpnext/erpnext/schools/doctype/student/student_dashboard.py +6,This is based on the attendance of this Student,Basado en la asistencia de este estudiante
+apps/erpnext/erpnext/stock/dashboard/item_dashboard.js +166,Add more items or open full form,Añadir más elementos o abrir formulario completo
 apps/erpnext/erpnext/selling/doctype/sales_order/sales_order.py +108,Please enter 'Expected Delivery Date',"Por favor, introduzca 'la fecha prevista de entrega'"
 apps/erpnext/erpnext/selling/doctype/sales_order/sales_order.py +197,Delivery Notes {0} must be cancelled before cancelling this Sales Order,La nota de entrega {0} debe ser cancelada antes de cancelar esta orden ventas
 apps/erpnext/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py +77,Paid amount + Write Off Amount can not be greater than Grand Total,"El total de la cantidad pagada + desajuste, no puede ser mayor que el gran total"
@@ -3247,7 +3247,7 @@
 DocType: Employee,Offer Date,Fecha de oferta
 apps/erpnext/erpnext/selling/page/sales_funnel/sales_funnel.py +33,Quotations,Presupuestos
 apps/erpnext/erpnext/accounts/page/pos/pos.js +665,You are in offline mode. You will not be able to reload until you have network.,Usted está en modo fuera de línea. Usted no será capaz de recargar hasta que tenga conexión a red.
-apps/erpnext/erpnext/schools/doctype/student_group_creation_tool/student_group_creation_tool.py +31,No Student Groups created.,No hay grupos de estudiantes crearon.
+apps/erpnext/erpnext/schools/doctype/student_group_creation_tool/student_group_creation_tool.py +31,No Student Groups created.,No se crearon grupos de estudiantes.
 DocType: Purchase Invoice Item,Serial No,Número de serie
 apps/erpnext/erpnext/hr/doctype/employee_loan/employee_loan.py +119,Monthly Repayment Amount cannot be greater than Loan Amount,Cantidad Mensual La devolución no puede ser mayor que Monto del préstamo
 apps/erpnext/erpnext/maintenance/doctype/maintenance_schedule/maintenance_schedule.py +144,Please enter Maintaince Details first,Por favor ingrese primero los detalles del mantenimiento
@@ -3266,10 +3266,10 @@
 apps/erpnext/erpnext/hooks.py +111,Request for Quotations,Solicitud de Presupuestos
 DocType: Payment Reconciliation,Maximum Invoice Amount,Importe Máximo Factura
 DocType: Item,Device Package Code,Dispositivo Código Paquete
-DocType: Student Language,Student Language,idioma del estudiante
+DocType: Student Language,Student Language,Idioma del Estudiante
 apps/erpnext/erpnext/config/selling.py +23,Customers,Clientes
 DocType: Student Sibling,Institution,Institución
-DocType: Asset,Partially Depreciated,parcialmente depreciables
+DocType: Asset,Partially Depreciated,Despreciables Parcialmente
 DocType: Issue,Opening Time,Hora de apertura
 apps/erpnext/erpnext/stock/report/itemwise_recommended_reorder_level/itemwise_recommended_reorder_level.py +92,From and To dates required,Desde y Hasta la fecha solicitada
 apps/erpnext/erpnext/setup/setup_wizard/industry_type.py +46,Securities & Commodity Exchanges,Cambios de valores y bienes
@@ -3311,7 +3311,7 @@
 apps/erpnext/erpnext/hr/doctype/process_payroll/process_payroll.py +121,Created Salary Slips,Nóminas creadas
 DocType: Item,Item Code for Suppliers,Código del producto para proveedores
 DocType: Issue,Raised By (Email),Propuesto por (Email)
-DocType: Training Event,Trainer Name,Nombre entrenador
+DocType: Training Event,Trainer Name,Nombre del entrenador
 DocType: Mode of Payment,General,General
 apps/erpnext/erpnext/public/js/setup_wizard.js +171,Attach Letterhead,Adjuntar membrete
 apps/erpnext/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js +346,Cannot deduct when category is for 'Valuation' or 'Valuation and Total',No se puede deducir cuando categoría es para ' Valoración ' o ' de Valoración y Total '
@@ -3338,7 +3338,7 @@
 					using Stock Reconciliation",El producto serializado {0} no se puede actualizar / reconciliar stock
 apps/erpnext/erpnext/stock/doctype/serial_no/serial_no.py +29,New Serial No cannot have Warehouse. Warehouse must be set by Stock Entry or Purchase Receipt,El número de serie no tiene almacén asignado. El almacén debe establecerse por entradas de inventario o recibos de compra
 DocType: Lead,Lead Type,Tipo de iniciativa
-apps/erpnext/erpnext/hr/doctype/leave_application/leave_application.py +133,You are not authorized to approve leaves on Block Dates,Usted no está autorizado para aprobar las hojas de bloquear las fechas
+apps/erpnext/erpnext/hr/doctype/leave_application/leave_application.py +133,You are not authorized to approve leaves on Block Dates,Usted no está autorizado para aprobar ausencias en fechas bloqueadas
 apps/erpnext/erpnext/stock/doctype/delivery_note/delivery_note.py +364,All these items have already been invoiced,Todos estos elementos ya fueron facturados
 apps/erpnext/erpnext/setup/doctype/authorization_control/authorization_control.py +37,Can be approved by {0},Puede ser aprobado por {0}
 DocType: Item,Default Material Request Type,El material predeterminado Tipo de solicitud
@@ -3349,13 +3349,13 @@
 DocType: Payment Entry,Received Amount,Cantidad recibida
 DocType: Production Planning Tool,"Create for full quantity, ignoring quantity already on order","Crear para la cantidad completa, haciendo caso omiso de la cantidad que ya están en orden"
 DocType: Account,Tax,Impuesto
-apps/erpnext/erpnext/schools/report/student_batch_wise_attendance/student_batch_wise_attendance.py +45,Not Marked,no Marcado
+apps/erpnext/erpnext/schools/report/student_batch_wise_attendance/student_batch_wise_attendance.py +45,Not Marked,No Marcado
 DocType: Production Planning Tool,Production Planning Tool,Planificar producción
 DocType: Quality Inspection,Report Date,Fecha del reporte
 DocType: Student,Middle Name,Segundo nombre
 DocType: C-Form,Invoices,Facturas
 DocType: Job Opening,Job Title,Título del trabajo
-apps/erpnext/erpnext/utilities/activation.py +100,Create Users,crear usuarios
+apps/erpnext/erpnext/utilities/activation.py +100,Create Users,Crear usuarios
 apps/erpnext/erpnext/public/js/setup_wizard.js +304,Gram,Gramo
 apps/erpnext/erpnext/manufacturing/doctype/production_order/production_order.py +393,Quantity to Manufacture must be greater than 0.,La cantidad a producir debe ser mayor que 0.
 apps/erpnext/erpnext/config/maintenance.py +17,Visit report for maintenance call.,Reporte de visitas para mantenimiento
@@ -3433,7 +3433,7 @@
 DocType: Naming Series,Setup Series,Configurar secuencias
 DocType: Payment Reconciliation,To Invoice Date,Para Factura Fecha
 DocType: Supplier,Contact HTML,HTML de Contacto
-,Inactive Customers,Los clientes inactivos
+,Inactive Customers,Clientes Inactivos
 DocType: Landed Cost Voucher,LCV,LCV
 DocType: Landed Cost Voucher,Purchase Receipts,Recibos de compra
 apps/erpnext/erpnext/accounts/doctype/pricing_rule/pricing_rule.js +27,How Pricing Rule is applied?,¿Cómo se aplica la regla precios?
@@ -3453,7 +3453,7 @@
 DocType: Payment Entry,Account Paid From,De cuenta de pago
 DocType: Purchase Order Item Supplied,Raw Material Item Code,Código de materia prima
 DocType: Journal Entry,Write Off Based On,Desajuste basado en
-apps/erpnext/erpnext/utilities/activation.py +66,Make Lead,hacer plomo
+apps/erpnext/erpnext/utilities/activation.py +66,Make Lead,Hacer una Iniciativa
 apps/erpnext/erpnext/accounts/doctype/account/chart_of_accounts/verified/standard_chart_of_accounts.py +110,Print and Stationery,Impresión y papelería
 DocType: Stock Settings,Show Barcode Field,Mostrar Campo de código de barras
 apps/erpnext/erpnext/buying/doctype/request_for_quotation/request_for_quotation.js +762,Send Supplier Emails,Enviar mensajes de correo electrónico del proveedor
@@ -3497,13 +3497,13 @@
 DocType: Production Order,Scrap Warehouse,Almacén de chatarra
 DocType: Program Enrollment Tool,Get Students From,Recibe estudiantes de
 DocType: Hub Settings,Seller Country,País de vendedor
-apps/erpnext/erpnext/config/learn.py +273,Publish Items on Website,Publicar artículos por página web
+apps/erpnext/erpnext/config/learn.py +273,Publish Items on Website,Publicar artículos en la página web
 apps/erpnext/erpnext/utilities/activation.py +127,Group your students in batches,Agrupar sus estudiantes en lotes
 DocType: Authorization Rule,Authorization Rule,Regla de Autorización
 DocType: Sales Invoice,Terms and Conditions Details,Detalle de términos y condiciones
 apps/erpnext/erpnext/templates/generators/item.html +85,Specifications,Especificaciones
 DocType: Sales Taxes and Charges Template,Sales Taxes and Charges Template,Plantilla de impuestos (ventas)
-apps/erpnext/erpnext/accounts/report/balance_sheet/balance_sheet.py +59,Total (Credit),Crédito total)
+apps/erpnext/erpnext/accounts/report/balance_sheet/balance_sheet.py +59,Total (Credit),Total (Crédito)
 DocType: Repayment Schedule,Payment Date,Fecha de pago
 apps/erpnext/erpnext/setup/setup_wizard/industry_type.py +10,Apparel & Accessories,Ropa y Accesorios
 apps/erpnext/erpnext/selling/report/inactive_customers/inactive_customers.py +67,Number of Order,Número de orden
@@ -3551,7 +3551,7 @@
 DocType: Program Enrollment Tool,Student Applicants,Los solicitantes de los estudiantes
 apps/erpnext/erpnext/setup/doctype/company/company.js +61,Successfully deleted all transactions related to this company!,Todas las transacciones relacionadas con esta compañía han sido eliminadas correctamente.
 apps/erpnext/erpnext/accounts/report/accounts_payable/accounts_payable.js +21,As on Date,A la fecha
-DocType: Appraisal,HR,HORA
+DocType: Appraisal,HR,HR
 DocType: Program Enrollment,Enrollment Date,Fecha de inscripción
 apps/erpnext/erpnext/setup/setup_wizard/install_fixtures.py +62,Probation,Período de prueba
 apps/erpnext/erpnext/config/hr.py +115,Salary Components,componentes de sueldos
@@ -3570,7 +3570,7 @@
 apps/erpnext/erpnext/manufacturing/doctype/bom/bom.py +235,Quantity should be greater than 0,Cantidad debe ser mayor que 0
 DocType: Journal Entry,Cash Entry,Entrada de caja
 apps/erpnext/erpnext/stock/doctype/warehouse/warehouse_tree.js +17,Child nodes can be only created under 'Group' type nodes,Los nodos hijos sólo pueden ser creados bajo los nodos de tipo &quot;grupo&quot;
-DocType: Leave Application,Half Day Date,Medio Día Fecha
+DocType: Leave Application,Half Day Date,Fecha de Medio Día
 DocType: Academic Year,Academic Year Name,Nombre Año Académico
 DocType: Sales Partner,Contact Desc,Desc. de Contacto
 apps/erpnext/erpnext/config/hr.py +65,"Type of leaves like casual, sick etc.","Tipo de vacaciones como, enfermo, casual, etc."
@@ -3578,7 +3578,7 @@
 DocType: Payment Entry,PE-,EDUCACIÓN FÍSICA-
 apps/erpnext/erpnext/hr/doctype/expense_claim/expense_claim.py +243,Please set default account in Expense Claim Type {0},"Por favor, establece de forma predeterminada en cuenta Tipo de Gastos {0}"
 DocType: Assessment Result,Student Name,Nombre del estudiante
-DocType: Brand,Item Manager,Administración de elementos
+DocType: Brand,Item Manager,Administración de artículos
 apps/erpnext/erpnext/accounts/doctype/account/chart_of_accounts/verified/standard_chart_of_accounts.py +141,Payroll Payable,nómina por pagar
 DocType: Buying Settings,Default Supplier Type,Tipos de Proveedores
 DocType: Production Order,Total Operating Cost,Costo Total de Funcionamiento
@@ -3596,7 +3596,7 @@
 DocType: Purchase Invoice,Taxes and Charges Added,Impuestos y cargos adicionales
 ,Sales Funnel,"""Embudo"" de ventas"
 apps/erpnext/erpnext/setup/doctype/company/company.py +45,Abbreviation is mandatory,La abreviatura es obligatoria
-DocType: Project,Task Progress,Grupo de Progreso
+DocType: Project,Task Progress,Progreso de Tarea
 ,Qty to Transfer,Cantidad a transferir
 apps/erpnext/erpnext/config/selling.py +13,Quotes to Leads or Customers.,Cotizaciones enviadas a los clientes u oportunidades de venta.
 DocType: Stock Settings,Role Allowed to edit frozen stock,Rol que permite editar inventario congelado
@@ -3609,10 +3609,10 @@
 DocType: Purchase Invoice Item,Price List Rate (Company Currency),Tarifa de la lista de precios (Divisa por defecto)
 DocType: Products Settings,Products Settings,productos Ajustes
 DocType: Account,Temporary,Temporal
-DocType: Program,Courses,cursos
+DocType: Program,Courses,Cursos
 DocType: Monthly Distribution Percentage,Percentage Allocation,Porcentaje de asignación
 apps/erpnext/erpnext/setup/setup_wizard/install_fixtures.py +90,Secretary,Secretaria
-DocType: Global Defaults,"If disable, 'In Words' field will not be visible in any transaction","Si desactivado, &quot;en las palabras de campo no será visible en cualquier transacción"
+DocType: Global Defaults,"If disable, 'In Words' field will not be visible in any transaction","Si se desactiva, el campo 'En Palabras' no será visible en ninguna transacción."
 DocType: Serial No,Distinct unit of an Item,Unidad distinta del producto
 DocType: Pricing Rule,Buying,Compras
 DocType: HR Settings,Employee Records to be created by,Los registros de empleados se crearán por
@@ -3724,7 +3724,7 @@
 apps/erpnext/erpnext/accounts/doctype/journal_entry/journal_entry.py +368,Note: {0},Nota: {0}
 ,Delivery Note Trends,Evolución de las notas de entrega
 apps/erpnext/erpnext/setup/doctype/email_digest/email_digest.py +113,This Week's Summary,Resumen de la semana.
-,In Stock Qty,En stock Cantidad
+,In Stock Qty,En Cantidad de Stock
 apps/erpnext/erpnext/accounts/general_ledger.py +111,Account: {0} can only be updated via Stock Transactions,Cuenta: {0} sólo puede ser actualizada mediante transacciones de inventario
 DocType: Student Group Creation Tool,Get Courses,Obtener Cursos
 DocType: GL Entry,Party,Tercero
@@ -3770,7 +3770,7 @@
 apps/erpnext/erpnext/accounts/doctype/asset/depreciation.py +106,"Asset {0} cannot be scrapped, as it is already {1}","Activos {0} no puede ser desechada, como ya lo es {1}"
 DocType: Task,Total Expense Claim (via Expense Claim),Total reembolso (Vía reembolso de gastos)
 apps/erpnext/erpnext/accounts/report/sales_register/sales_register.py +70,Customer Id,ID del cliente
-apps/erpnext/erpnext/hr/doctype/employee_attendance_tool/employee_attendance_tool.js +176,Mark Absent,Marcos Ausente
+apps/erpnext/erpnext/hr/doctype/employee_attendance_tool/employee_attendance_tool.js +176,Mark Absent,Marcar Ausente
 apps/erpnext/erpnext/manufacturing/doctype/bom/bom.py +133,Row {0}: Currency of the BOM #{1} should be equal to the selected currency {2},Fila {0}: Divisa de la lista de materiales # {1} debe ser igual a la moneda seleccionada {2}
 DocType: Journal Entry Account,Exchange Rate,Tipo de cambio
 apps/erpnext/erpnext/accounts/doctype/sales_invoice/sales_invoice.py +530,Sales Order {0} is not submitted,La órden de venta {0} no esta validada
@@ -3832,7 +3832,7 @@
 apps/erpnext/erpnext/schools/doctype/student_attendance/student_attendance.py +27,Student Batch or Course Schedule is mandatory,Lote estudiante o Horario del curso es obligatoria
 DocType: Employee,Notice (days),Aviso (días)
 DocType: Tax Rule,Sales Tax Template,Plantilla de impuesto sobre ventas
-apps/erpnext/erpnext/accounts/page/pos/pos.js +2298,Select items to save the invoice,Seleccione artículos para ahorrar la factura
+apps/erpnext/erpnext/accounts/page/pos/pos.js +2298,Select items to save the invoice,Seleccione artículos para guardar la factura
 DocType: Employee,Encashment Date,Fecha de cobro
 DocType: Training Event,Internet,Internet
 DocType: Account,Stock Adjustment,Ajuste de existencias
@@ -3872,14 +3872,14 @@
 DocType: Company,Distribution,Distribución
 apps/erpnext/erpnext/schools/doctype/fees/fees.js +27,Amount Paid,Total Pagado
 apps/erpnext/erpnext/setup/setup_wizard/install_fixtures.py +95,Project Manager,Gerente de proyectos
-,Quoted Item Comparison,Citado artículo Comparación
+,Quoted Item Comparison,Comparación de artículos de Cotización
 apps/erpnext/erpnext/setup/setup_wizard/install_fixtures.py +76,Dispatch,Despacho
 apps/erpnext/erpnext/accounts/doctype/pricing_rule/pricing_rule.py +71,Max discount allowed for item: {0} is {1}%,Descuento máximo permitido para el producto: {0} es {1}%
 apps/erpnext/erpnext/accounts/report/asset_depreciations_and_balances/asset_depreciations_and_balances.py +173,Net Asset value as on,El valor neto de activos como en
 DocType: Account,Receivable,A cobrar
 apps/erpnext/erpnext/selling/doctype/sales_order/sales_order.py +278,Row #{0}: Not allowed to change Supplier as Purchase Order already exists,Fila # {0}: No se permite cambiar de proveedores como la Orden de Compra ya existe
 DocType: Accounts Settings,Role that is allowed to submit transactions that exceed credit limits set.,Rol autorizado para validar las transacciones que excedan los límites de crédito establecidos.
-apps/erpnext/erpnext/selling/doctype/sales_order/sales_order.js +904,Select Items to Manufacture,Seleccionar artículos al Fabricación
+apps/erpnext/erpnext/selling/doctype/sales_order/sales_order.js +904,Select Items to Manufacture,Seleccionar artículos para Fabricación
 apps/erpnext/erpnext/accounts/page/pos/pos.js +909,"Master data syncing, it might take some time","Maestro sincronización de datos, que podría tomar algún tiempo"
 DocType: Item,Material Issue,Expedición de material
 DocType: Hub Settings,Seller Description,Descripción del vendedor
@@ -3910,7 +3910,7 @@
 DocType: Employee Loan,Disbursement Date,Fecha de desembolso
 DocType: Vehicle,Vehicle,Vehículo
 DocType: Purchase Invoice,In Words,En palabras
-DocType: POS Profile,Item Groups,los grupos de artículos
+DocType: POS Profile,Item Groups,Grupos de productos
 apps/erpnext/erpnext/hr/doctype/employee/employee.py +217,Today is {0}'s birthday!,Hoy el cumpleaños de {0} !
 DocType: Production Planning Tool,Material Request For Warehouse,Requisición de materiales para el almacén
 DocType: Sales Order Item,For Production,Por producción
@@ -3928,7 +3928,7 @@
 apps/erpnext/erpnext/stock/report/stock_projected_qty/stock_projected_qty.py +20,Shortage Qty,Cantidad faltante
 apps/erpnext/erpnext/stock/doctype/item/item.py +666,Item variant {0} exists with same attributes,Existe la variante de artículo {0} con mismos atributos
 DocType: Employee Loan,Repay from Salary,Pagar de su sueldo
-DocType: Leave Application,LAP/,REGAZO/
+DocType: Leave Application,LAP/,LAP/
 apps/erpnext/erpnext/accounts/doctype/payment_request/payment_request.py +334,Requesting payment against {0} {1} for amount {2},Solicitando el pago contra {0} {1} para la cantidad {2}
 DocType: Salary Slip,Salary Slip,Nómina salarial
 DocType: Lead,Lost Quotation,Presupuesto perdido
@@ -3949,7 +3949,7 @@
 DocType: Account,Account,Cuenta
 apps/erpnext/erpnext/stock/doctype/serial_no/serial_no.py +213,Serial No {0} has already been received,El número de serie {0} ya ha sido recibido
 ,Requested Items To Be Transferred,Artículos solicitados para ser transferidos
-DocType: Expense Claim,Vehicle Log,Iniciar vehículo
+DocType: Expense Claim,Vehicle Log,Bitácora del Vehiculo
 apps/erpnext/erpnext/controllers/stock_controller.py +91,"Warehouse {0} is not linked to any account, please create/link the corresponding (Asset) account for the warehouse.","Almacén {0} no está vinculada a ninguna cuenta, por favor crear / enlazar la cuenta correspondiente (Activo) para el almacén."
 DocType: Purchase Invoice,Recurring Id,ID recurrente
 DocType: Customer,Sales Team Details,Detalles del equipo de ventas.
@@ -3995,7 +3995,7 @@
 apps/erpnext/erpnext/stock/doctype/stock_entry/stock_entry.py +778,Batch {0} of Item {1} has expired.,El lote {0} del producto {1} ha expirado.
 DocType: Sales Invoice,Commission,Comisión
 apps/erpnext/erpnext/config/manufacturing.py +27,Time Sheet for manufacturing.,Hoja de tiempo para la fabricación.
-apps/erpnext/erpnext/templates/pages/cart.html +37,Subtotal,Total parcial
+apps/erpnext/erpnext/templates/pages/cart.html +37,Subtotal,Subtotal
 DocType: Salary Detail,Default Amount,Importe por defecto
 apps/erpnext/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py +93,Warehouse not found in the system,El almacén no se encuentra en el sistema
 apps/erpnext/erpnext/setup/doctype/email_digest/email_digest.py +116,This Month's Summary,Resumen de este mes
@@ -4055,7 +4055,7 @@
 apps/erpnext/erpnext/stock/doctype/item/item.py +498,Row {0}: An Reorder entry already exists for this warehouse {1},Línea {0}: Una entrada de abastecimiento ya existe para el almacén {1}
 apps/erpnext/erpnext/crm/doctype/opportunity/opportunity.py +82,"Cannot declare as lost, because Quotation has been made.","No se puede declarar como perdida, porque se ha hecho el Presupuesto"
 apps/erpnext/erpnext/hr/doctype/training_event/training_event.js +13,Training Feedback,Formación de votos
-DocType: Vehicle Log,Make Expense Claim,Hacer de Gastos
+DocType: Vehicle Log,Make Expense Claim,Crear Gasto
 apps/erpnext/erpnext/stock/doctype/stock_entry/stock_entry.py +449,Production Order {0} must be submitted,La orden de producción {0} debe ser validada
 apps/erpnext/erpnext/maintenance/doctype/maintenance_schedule/maintenance_schedule.py +150,Please select Start Date and End Date for Item {0},"Por favor, seleccione Fecha de inicio y Fecha de finalización para el elemento {0}"
 apps/erpnext/erpnext/schools/doctype/student_group_creation_tool/student_group_creation_tool.py +35,Course is mandatory in row {0},Por supuesto es obligatorio en la fila {0}
@@ -4102,7 +4102,7 @@
 apps/erpnext/erpnext/accounts/doctype/journal_entry/journal_entry.py +287,You cannot credit and debit same account at the same time,No se pueden registrar Debitos y Creditos a la misma Cuenta al mismo tiempo
 DocType: Naming Series,Help HTML,Ayuda 'HTML'
 DocType: Student Group Creation Tool,Student Group Creation Tool,Herramienta de creación de grupo de alumnos
-DocType: Item,Variant Based On,En variante basada
+DocType: Item,Variant Based On,Variante basada en
 apps/erpnext/erpnext/hr/doctype/appraisal/appraisal.py +53,Total weightage assigned should be 100%. It is {0},Peso total asignado debe ser de 100 %. Es {0}
 apps/erpnext/erpnext/public/js/setup_wizard.js +265,Your Suppliers,Sus proveedores
 apps/erpnext/erpnext/selling/doctype/quotation/quotation.py +56,Cannot set as Lost as Sales Order is made.,"No se puede definir como pérdida, cuando la orden de venta esta hecha."
@@ -4354,7 +4354,7 @@
 DocType: Purchase Invoice,Total Advance,Total anticipo
 apps/erpnext/erpnext/schools/doctype/academic_term/academic_term.py +23,The Term End Date cannot be earlier than the Term Start Date. Please correct the dates and try again.,"La fecha final de duración no puede ser anterior a la fecha de inicio Plazo. Por favor, corrija las fechas y vuelve a intentarlo."
 ,BOM Stock Report,La lista de materiales de Informe
-DocType: Stock Reconciliation Item,Quantity Difference,Cantidad Diferencia
+DocType: Stock Reconciliation Item,Quantity Difference,Diferencia de Cantidad
 apps/erpnext/erpnext/config/hr.py +311,Processing Payroll,Procesando nómina
 DocType: Opportunity Item,Basic Rate,Precio base
 DocType: GL Entry,Credit Amount,Importe acreditado
@@ -4410,7 +4410,7 @@
 DocType: Guardian,Guardian,guardián
 apps/erpnext/erpnext/hr/doctype/appraisal/appraisal.py +42,Appraisal {0} created for Employee {1} in the given date range,La evaluación {0} creado para el empleado {1} en el rango de fechas determinado
 DocType: Employee,Education,Educación
-DocType: Selling Settings,Campaign Naming By,Ordenar campañas por
+DocType: Selling Settings,Campaign Naming By,Nombrar campañas por
 DocType: Employee,Current Address Is,La dirección actual es
 apps/erpnext/erpnext/accounts/doctype/account/account_tree.js +51,"Optional. Sets company's default currency, if not specified.","Opcional. Establece moneda por defecto de la empresa, si no se especifica."
 apps/erpnext/erpnext/config/accounts.py +61,Accounting journal entries.,Asientos en el diario de contabilidad.
@@ -4449,13 +4449,13 @@
 DocType: Project,Gross Margin %,Margen bruto %
 DocType: BOM,With Operations,Con operaciones
 apps/erpnext/erpnext/accounts/party.py +250,Accounting entries have already been made in currency {0} for company {1}. Please select a receivable or payable account with currency {0}.,Ya se han registrado asientos contables en la divisa {0} para la empresa {1}. Por favor seleccione una cuenta por cobrar o por pagar con divisa {0}.
-DocType: Asset,Is Existing Asset,Es existente de activos
+DocType: Asset,Is Existing Asset,Es Activo Existente
 ,Monthly Salary Register,Registar salario mensual
 DocType: Warranty Claim,If different than customer address,Si es diferente a la dirección del cliente
 DocType: BOM Operation,BOM Operation,Operación de la lista de materiales (LdM)
 DocType: Purchase Taxes and Charges,On Previous Row Amount,Sobre la línea anterior
 DocType: Student,Home Address,Direccion de casa
-apps/erpnext/erpnext/accounts/doctype/asset/asset.js +260,Transfer Asset,Activos transferencia
+apps/erpnext/erpnext/accounts/doctype/asset/asset.js +260,Transfer Asset,Transferir Activo
 DocType: POS Profile,POS Profile,Perfil de POS
 DocType: Training Event,Event Name,Nombre del evento
 apps/erpnext/erpnext/config/schools.py +43,Admission,Admisión
@@ -4479,7 +4479,7 @@
 DocType: Program,Program Name,Nombre del programa
 DocType: Purchase Taxes and Charges,Consider Tax or Charge for,Considerar impuestos o cargos por
 apps/erpnext/erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.py +57,Actual Qty is mandatory,La cantidad real es obligatoria
-apps/erpnext/erpnext/schools/doctype/student_group_creation_tool/student_group_creation_tool.py +48,Student Groups created.,Grupos estudiantiles creados.
+apps/erpnext/erpnext/schools/doctype/student_group_creation_tool/student_group_creation_tool.py +48,Student Groups created.,Grupos de Estudiante Creado
 DocType: Employee Loan,Loan Type,Tipo de préstamo
 DocType: Scheduling Tool,Scheduling Tool,Herramienta de programación
 apps/erpnext/erpnext/setup/setup_wizard/install_fixtures.py +142,Credit Card,Tarjetas de credito
@@ -4488,7 +4488,7 @@
 DocType: Purchase Invoice,Next Date,Siguiente fecha
 DocType: Employee Education,Major/Optional Subjects,Principales / Asignaturas Optativas
 DocType: Sales Invoice Item,Drop Ship,Nave de la gota
-DocType: Training Event,Attendees,Los asistentes
+DocType: Training Event,Attendees,Asistentes
 DocType: Employee,"Here you can maintain family details like name and occupation of parent, spouse and children","Aquí usted puede ingresar los detalles de la familia como el nombre y ocupación de los padres, cónyuge e hijos"
 DocType: Academic Term,Term End Date,Plazo Fecha de finalización
 DocType: Hub Settings,Seller Name,Nombre de vendedor
@@ -4527,7 +4527,7 @@
 DocType: Serial No,Delivery Details,Detalles de la entrega
 apps/erpnext/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py +484,Cost Center is required in row {0} in Taxes table for type {1},Centro de costos requerido para la línea {0} en la tabla Impuestos para el tipo {1}
 DocType: Program,Program Code,Código de programa
-DocType: Terms and Conditions,Terms and Conditions Help,Términos y Condiciones Ayuda
+DocType: Terms and Conditions,Terms and Conditions Help,Ayuda de Términos y Condiciones
 ,Item-wise Purchase Register,Detalle de compras
 DocType: Batch,Expiry Date,Fecha de caducidad
 ,Supplier Addresses and Contacts,Libreta de direcciones de proveedores
@@ -4538,13 +4538,13 @@
 DocType: Global Defaults,Do not show any symbol like $ etc next to currencies.,No volver a mostrar cualquier símbolo como $ u otro junto a las monedas.
 apps/erpnext/erpnext/hr/doctype/leave_application/leave_application.py +459, (Half Day),(Medio día)
 DocType: Supplier,Credit Days,Días de crédito
-DocType: Student Batch Creation Tool,Make Student Batch,Hacer lotes Estudiante
+DocType: Student Batch Creation Tool,Make Student Batch,Hacer Lote de Estudiantes
 DocType: Leave Type,Is Carry Forward,Es un traslado
 apps/erpnext/erpnext/stock/doctype/material_request/material_request.js +778,Get Items from BOM,Obtener productos desde lista de materiales (LdM)
 apps/erpnext/erpnext/stock/report/itemwise_recommended_reorder_level/itemwise_recommended_reorder_level.py +41,Lead Time Days,Días de iniciativa
 apps/erpnext/erpnext/controllers/accounts_controller.py +562,Row #{0}: Posting Date must be same as purchase date {1} of asset {2},Fila # {0}: Fecha de contabilización debe ser la misma que la fecha de compra {1} de activos {2}
 apps/erpnext/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.py +129,Please enter Sales Orders in the above table,"Por favor, introduzca los pedidos de cliente en la tabla anterior"
-apps/erpnext/erpnext/hr/doctype/process_payroll/process_payroll.py +186,Not Submitted Salary Slips,No Enviado a salarios resbalones
+apps/erpnext/erpnext/hr/doctype/process_payroll/process_payroll.py +186,Not Submitted Salary Slips,No Envió Salarios
 ,Stock Summary,Resumen de la
 apps/erpnext/erpnext/config/accounts.py +236,Transfer an asset from one warehouse to another,Transferir un activo de un almacén a otro
 DocType: Vehicle,Petrol,Gasolina
diff --git a/erpnext/translations/fi.csv b/erpnext/translations/fi.csv
index 5c202a4..9df26ba 100644
--- a/erpnext/translations/fi.csv
+++ b/erpnext/translations/fi.csv
@@ -818,7 +818,7 @@
 apps/erpnext/erpnext/accounts/doctype/journal_entry/journal_entry.py +744,No Permission,Ei oikeuksia
 DocType: Company,Default Bank Account,oletus pankkitili
 apps/erpnext/erpnext/accounts/report/general_ledger/general_ledger.py +50,"To filter based on Party, select Party Type first",Valitse osapuoli tyyppi saadaksesi osapuolen mukaisen suodatuksen
-apps/erpnext/erpnext/controllers/sales_and_purchase_return.py +48,'Update Stock' can not be checked because items are not delivered via {0},"'Päivitä varastotase' ei voida käyttää tuotteille, joita ei ole toimitettu {0} kautta"
+apps/erpnext/erpnext/controllers/sales_and_purchase_return.py +48,'Update Stock' can not be checked because items are not delivered via {0},"'Päivitä varasto' ei voida käyttää tuotteille, joita ei ole toimitettu {0} kautta"
 DocType: Vehicle,Acquisition Date,Hankintapäivä
 apps/erpnext/erpnext/public/js/setup_wizard.js +303,Nos,Nos
 DocType: Item,Items with higher weightage will be shown higher,tuotteet joilla on korkeampi painoarvo nätetään ylempänä
@@ -1235,7 +1235,7 @@
 DocType: GL Entry,Against Voucher,kuitin kohdistus
 DocType: Item,Default Buying Cost Center,ostojen oletuskustannuspaikka
 apps/erpnext/erpnext/setup/page/welcome_to_erpnext/welcome_to_erpnext.html +6,"To get the best out of ERPNext, we recommend that you take some time and watch these help videos.","Saadaksesi kaiken irti ERPNextistä, Suosittelemme katsomaan nämä ohjevideot."
-apps/erpnext/erpnext/accounts/page/pos/pos.js +73, to ,että
+apps/erpnext/erpnext/accounts/page/pos/pos.js +73, to ,lle
 DocType: Item,Lead Time in days,"virtausaika, päivinä"
 apps/erpnext/erpnext/accounts/report/accounts_payable/accounts_payable.js +58,Accounts Payable Summary,maksettava tilien yhteenveto
 apps/erpnext/erpnext/hr/doctype/process_payroll/process_payroll.py +332,Payment of salary from {0} to {1},Palkanmaksu välillä {0} ja {1}
@@ -1636,7 +1636,7 @@
 DocType: Sales Invoice,Packed Items,Pakatut tuotteet
 apps/erpnext/erpnext/config/support.py +27,Warranty Claim against Serial No.,Takuuvaatimus sarjanumerolle
 DocType: BOM Replace Tool,"Replace a particular BOM in all other BOMs where it is used. It will replace the old BOM link, update cost and regenerate ""BOM Explosion Item"" table as per new BOM","korvaa BOM kaikissa muissa BOM:ssa, jossa sitä käytetään, korvaa vanhan BOM linkin, päivittää kustannukset ja muodostaa uuden ""BOM tuote räjäytyksen"" tilaston uutena BOM:na"
-apps/erpnext/erpnext/accounts/report/accounts_receivable/accounts_receivable.html +59,'Total',&#39;Kaikki yhteensä&#39;
+apps/erpnext/erpnext/accounts/report/accounts_receivable/accounts_receivable.html +59,'Total','Yhteensä'
 DocType: Shopping Cart Settings,Enable Shopping Cart,aktivoi ostoskori
 DocType: Employee,Permanent Address,Pysyvä osoite
 apps/erpnext/erpnext/accounts/doctype/journal_entry/journal_entry.py +248,"Advance paid against {0} {1} cannot be greater \
@@ -2381,7 +2381,7 @@
 DocType: Sales Order,Billing Status,Laskutus tila
 apps/erpnext/erpnext/public/js/conf.js +32,Report an Issue,Raportoi asia
 apps/erpnext/erpnext/accounts/doctype/account/chart_of_accounts/verified/standard_chart_of_accounts.py +118,Utility Expenses,Hyödykekulut
-apps/erpnext/erpnext/accounts/report/payment_period_based_on_invoice_date/payment_period_based_on_invoice_date.py +64,90-Above,90-yli
+apps/erpnext/erpnext/accounts/report/payment_period_based_on_invoice_date/payment_period_based_on_invoice_date.py +64,90-Above,90 ja yli
 apps/erpnext/erpnext/accounts/doctype/payment_entry/payment_entry.py +213,Row #{0}: Journal Entry {1} does not have account {2} or already matched against another voucher,Rivi # {0}: Päiväkirjakirjaus {1} ei ole huomioon {2} tai jo sovitettu toista voucher
 DocType: Buying Settings,Default Buying Price List,"oletus hinnasto, osto"
 DocType: Process Payroll,Salary Slip Based on Timesheet,Palkka tuntilomakkeen mukaan
@@ -2814,7 +2814,7 @@
 DocType: Asset,Double Declining Balance,Double jäännösarvopoisto
 apps/erpnext/erpnext/selling/doctype/sales_order/sales_order.py +170,Closed order cannot be cancelled. Unclose to cancel.,Suljettu järjestys ei voi peruuttaa. Unclose peruuttaa.
 DocType: Student Guardian,Father,Isä
-apps/erpnext/erpnext/controllers/accounts_controller.py +568,'Update Stock' cannot be checked for fixed asset sale,Päivitä Stock &quot;ei voida tarkistaa käyttöomaisuushankintoihin myytävänä
+apps/erpnext/erpnext/controllers/accounts_controller.py +568,'Update Stock' cannot be checked for fixed asset sale,'Päivitä varasto' ei voida valita käyttöomaisuuden myynteihin
 DocType: Bank Reconciliation,Bank Reconciliation,pankin täsmäytys
 DocType: Attendance,On Leave,lomalla
 apps/erpnext/erpnext/templates/includes/footer/footer_extension.html +7,Get Updates,hae päivitykset
@@ -3950,7 +3950,7 @@
 apps/erpnext/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py +93,Warehouse not found in the system,Varastoa ei löydy järjestelmästä
 apps/erpnext/erpnext/setup/doctype/email_digest/email_digest.py +116,This Month's Summary,Tämän kuun yhteenveto
 DocType: Quality Inspection Reading,Quality Inspection Reading,Laarutarkistuksen luku
-apps/erpnext/erpnext/stock/doctype/stock_settings/stock_settings.py +24,`Freeze Stocks Older Than` should be smaller than %d days.,Jäädytä varasto joka on vanhempi kuin % päivää
+apps/erpnext/erpnext/stock/doctype/stock_settings/stock_settings.py +24,`Freeze Stocks Older Than` should be smaller than %d days.,Kylmävarasto pitäisi olla vähemmän kuin % päivää
 DocType: Tax Rule,Purchase Tax Template,Myyntiverovelkojen malli
 ,Project wise Stock Tracking,"projekt työkalu, varastoseuranta"
 apps/erpnext/erpnext/maintenance/doctype/maintenance_schedule/maintenance_schedule.py +166,Maintenance Schedule {0} exists against {0},huoltoaikataulu {0} on olemassa kohdistettuna{0}
diff --git a/erpnext/translations/fr.csv b/erpnext/translations/fr.csv
index 96c00de..3f6779d 100644
--- a/erpnext/translations/fr.csv
+++ b/erpnext/translations/fr.csv
@@ -40,7 +40,7 @@
 DocType: Vehicle,Natural Gas,Gaz naturel
 apps/erpnext/erpnext/setup/setup_wizard/setup_wizard.py +130,Bank account cannot be named as {0},Compte Bancaire ne peut pas être nommé {0}
 DocType: Account,Heads (or groups) against which Accounting Entries are made and balances are maintained.,Titres (ou groupes) sur lequel les entrées comptables sont faites et les soldes sont maintenus.
-apps/erpnext/erpnext/accounts/doctype/gl_entry/gl_entry.py +197,Outstanding for {0} cannot be less than zero ({1}),Exceptionnelle pour {0} ne peut pas être inférieur à zéro ({1})
+apps/erpnext/erpnext/accounts/doctype/gl_entry/gl_entry.py +197,Outstanding for {0} cannot be less than zero ({1}),Solde pour {0} ne peut pas être inférieur à zéro ({1})
 DocType: Manufacturing Settings,Default 10 mins,10 minutes Par Défaut
 DocType: Leave Type,Leave Type Name,Nom du Type de Congé
 apps/erpnext/erpnext/templates/pages/projects.js +63,Show open,Afficher ouverte
@@ -69,7 +69,7 @@
 apps/erpnext/erpnext/maintenance/doctype/maintenance_schedule/maintenance_schedule.py +69,"Reference: %s, Item Code: %s and Customer: %s","Référence:% s, Code de l&#39;article:% s et le client:% s"
 DocType: Item,Country of Origin,Pays d&#39;origine
 apps/erpnext/erpnext/templates/form_grid/stock_entry_grid.html +26,In Stock,En Stock
-apps/erpnext/erpnext/setup/doctype/email_digest/templates/default.html +46,Open Issues,Questions ouvertes
+apps/erpnext/erpnext/setup/doctype/email_digest/templates/default.html +46,Open Issues,Ouvrir les Questions
 DocType: Production Plan Item,Production Plan Item,Article du plan de Fabrication
 apps/erpnext/erpnext/hr/doctype/employee/employee.py +144,User {0} is already assigned to Employee {1},Utilisateur {0} est déjà attribué à l'employé {1}
 apps/erpnext/erpnext/setup/setup_wizard/industry_type.py +31,Health Care,Soins de Santé
@@ -100,7 +100,7 @@
 apps/erpnext/erpnext/hr/doctype/salary_component/salary_component.py +21,Abbreviation cannot have more than 5 characters,L'abbréviation ne peut pas avoir plus de 5 caractères
 DocType: Payment Request,Payment Request,Requête de paiement
 DocType: Asset,Value After Depreciation,Valeur après amortissement
-DocType: Employee,O+,O +
+DocType: Employee,O+,O+
 apps/erpnext/erpnext/stock/doctype/purchase_receipt/purchase_receipt_dashboard.py +17,Related,En Relation
 apps/erpnext/erpnext/hr/doctype/attendance/attendance.py +41,Attendance date can not be less than employee's joining date,Date de présence ne peut pas être inférieure à la date se joindre à l&#39;employé
 DocType: Grading Scale,Grading Scale Name,Nom de l'Échelle de Notation
@@ -112,7 +112,7 @@
 DocType: Packed Item,Parent Detail docname,DocName Détail Parent
 apps/erpnext/erpnext/public/js/setup_wizard.js +303,Kg,Kg
 DocType: Student Log,Log,Journal
-apps/erpnext/erpnext/config/hr.py +45,Opening for a Job.,Ouverture d&#39;un emploi.
+apps/erpnext/erpnext/config/hr.py +45,Opening for a Job.,Ouverture d'un Emploi.
 DocType: Item Attribute,Increment,Incrément
 apps/erpnext/erpnext/public/js/stock_analytics.js +62,Select Warehouse...,Sélectionnez Entrepôt ...
 apps/erpnext/erpnext/setup/setup_wizard/industry_type.py +6,Advertising,Publicité
@@ -158,7 +158,7 @@
 apps/erpnext/erpnext/accounts/report/general_ledger/general_ledger.py +170,Opening,Ouverture
 apps/erpnext/erpnext/stock/doctype/stock_entry/stock_entry.py +27,From {0} to {1},Du {0} au {1}
 DocType: Item,Copy From Item Group,Copier Depuis un Groupe d'Articles
-DocType: Journal Entry,Opening Entry,Entrée ouverture
+DocType: Journal Entry,Opening Entry,Écriture d'Ouverture
 apps/erpnext/erpnext/accounts/doctype/cheque_print_template/cheque_print_template.js +25,Account Pay Only,Compte Bénéficiaire Seulement
 DocType: Employee Loan,Repay Over Number of Periods,Rembourser Over Nombre de périodes
 DocType: Stock Entry,Additional Costs,Frais Supplémentaires
@@ -244,7 +244,7 @@
 apps/erpnext/erpnext/selling/doctype/installation_note/installation_note.py +79,Installation date cannot be before delivery date for Item {0},Date d'installation ne peut pas être avant la date de livraison pour l'article {0}
 DocType: Pricing Rule,Discount on Price List Rate (%),Remise sur la Liste des Prix (%)
 DocType: Offer Letter,Select Terms and Conditions,Sélectionnez Termes et Conditions
-apps/erpnext/erpnext/stock/report/stock_balance/stock_balance.py +51,Out Value,Valeur hors
+apps/erpnext/erpnext/stock/report/stock_balance/stock_balance.py +51,Out Value,Valeur Sortante
 DocType: Production Planning Tool,Sales Orders,Commandes clients
 DocType: Purchase Taxes and Charges,Valuation,Valorisation
 ,Purchase Order Trends,Tendances Bon de commande
@@ -293,7 +293,7 @@
 apps/erpnext/erpnext/config/buying.py +13,Request for purchase.,Demande d&#39;achat.
 apps/erpnext/erpnext/projects/doctype/project/project_dashboard.py +6,This is based on the Time Sheets created against this project,Ceci est basé sur les feuilles de temps créées contre ce projet
 apps/erpnext/erpnext/hr/doctype/salary_slip/salary_slip.py +371,Net Pay cannot be less than 0,Salaire net ne peut pas être inférieur à 0
-apps/erpnext/erpnext/hr/doctype/leave_application/leave_application.py +224,Only the selected Leave Approver can submit this Leave Application,Seul l'approbateur de congé sélectionné peut soumettre cette demande de congé
+apps/erpnext/erpnext/hr/doctype/leave_application/leave_application.py +224,Only the selected Leave Approver can submit this Leave Application,Seul l'Approbateur de Congé sélectionné peut soumettre cette Demande de Congé
 apps/erpnext/erpnext/hr/doctype/employee/employee.py +116,Relieving Date must be greater than Date of Joining,La date de relève doit être postérieure à la date de l'adhésion
 apps/erpnext/erpnext/setup/setup_wizard/install_fixtures.py +190,Leaves per Year,Congés par Année
 apps/erpnext/erpnext/accounts/doctype/journal_entry/journal_entry.py +118,Row {0}: Please check 'Is Advance' against Account {1} if this is an advance entry.,Ligne {0}: S'il vous plaît vérifier 'Est Avance' sur compte {1} si c'est une entrée avance.
@@ -358,7 +358,7 @@
 apps/erpnext/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py +643,Supplier Invoice No exists in Purchase Invoice {0},No de Facture du Fournisseur existe dans Factures d'Achat {0}
 apps/erpnext/erpnext/config/selling.py +118,Manage Sales Person Tree.,Gérer l'arborescence des vendeurs
 DocType: Job Applicant,Cover Letter,Lettre de Motivation
-apps/erpnext/erpnext/accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.py +37,Outstanding Cheques and Deposits to clear,Chèques et Dépôts restant à compenser
+apps/erpnext/erpnext/accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.py +37,Outstanding Cheques and Deposits to clear,Chèques et Dépôts en suspens à compenser
 DocType: Item,Synced With Hub,Synchronisé avec Hub
 DocType: Vehicle,Fleet Manager,Gestionnaire de Flotte
 apps/erpnext/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js +505,Row #{0}: {1} can not be negative for item {2},# Ligne {0}: {1} ne peut pas être négatif pour l&#39;élément {2}
@@ -464,7 +464,7 @@
 apps/erpnext/erpnext/accounts/report/gross_profit/gross_profit.py +71,Avg. Selling Rate,Moy. Taux de vente
 DocType: Assessment Plan,Examiner Name,Nom de l'Examinateur
 apps/erpnext/erpnext/utilities/transaction_base.py +148,Quantity cannot be a fraction in row {0},La quantité ne peut pas être une fraction à la ligne {0}
-DocType: Purchase Invoice Item,Quantity and Rate,Quantité et Prix
+DocType: Purchase Invoice Item,Quantity and Rate,Quantité et Taux
 DocType: Delivery Note,% Installed,Installé%
 apps/erpnext/erpnext/public/js/setup_wizard.js +383,Classrooms/ Laboratories etc where lectures can be scheduled.,Les Salles de Classe / Laboratoires etc. où des conférences peuvent être programmées.
 apps/erpnext/erpnext/accounts/doctype/cost_center/cost_center.js +46,Please enter company name first,S'il vous plaît entrez en premier le nom de l'entreprise
@@ -479,7 +479,7 @@
 apps/erpnext/erpnext/setup/setup_wizard/install_fixtures.py +108,Non Profit,À but non lucratif
 DocType: Production Order,Not Started,Pas commencé
 DocType: Lead,Channel Partner,Partenaire de Canal
-DocType: Account,Old Parent,Parent Vieux
+DocType: Account,Old Parent,Grand Parent
 DocType: Notification Control,Customize the introductory text that goes as a part of that email. Each transaction has a separate introductory text.,Personnaliser le texte d'introduction qui fera partie de cet Email. Chaque transaction a une introduction séparée.
 apps/erpnext/erpnext/config/manufacturing.py +84,Global settings for all manufacturing processes.,Paramètres globaux pour tous les processus de fabrication.
 DocType: Accounts Settings,Accounts Frozen Upto,Comptes Gelés Jusqu'au
@@ -535,7 +535,7 @@
 DocType: Employee,Emergency Phone,Téléphone d'Urgence
 apps/erpnext/erpnext/stock/doctype/item/item_dashboard.py +29,Buy,Acheter
 ,Serial No Warranty Expiry,Expiration de Garantie du N° de Série
-DocType: Sales Invoice,Offline POS Name,Hors ligne POS Nom
+DocType: Sales Invoice,Offline POS Name,Nom du PDV Hors-ligne`
 DocType: Sales Order,To Deliver,A Livrer
 DocType: Purchase Invoice Item,Item,Article
 apps/erpnext/erpnext/accounts/page/pos/pos.js +2342,Serial no item cannot be a fraction,Un article avec un Numéro de série ne peut pas être une fraction
@@ -548,7 +548,7 @@
 apps/erpnext/erpnext/setup/doctype/company/company.py +48,Abbreviation already used for another company,Abréviation déjà utilisée pour une autre société
 DocType: Selling Settings,Default Customer Group,Groupe de Clients par Défaut
 DocType: Global Defaults,"If disable, 'Rounded Total' field will not be visible in any transaction","Si coché, le champ ""Total arrondi"" ne sera pas visible et les montants ne seront pas arrondis."
-DocType: BOM,Operating Cost,Coût d&#39;exploitation
+DocType: BOM,Operating Cost,Coût d'Exploitation
 DocType: Sales Order Item,Gross Profit,Bénéfice Brut
 apps/erpnext/erpnext/stock/doctype/item_attribute/item_attribute.py +49,Increment cannot be 0,Incrément ne peut pas être 0
 DocType: Production Planning Tool,Material Requirement,Exigence Matériel
@@ -605,7 +605,7 @@
 apps/erpnext/erpnext/config/selling.py +28,Customer database.,Base de données Clients.
 DocType: Quotation,Quotation To,Devis Pour
 DocType: Lead,Middle Income,Revenu intermédiaire
-apps/erpnext/erpnext/accounts/report/trial_balance/trial_balance.py +217,Opening (Cr),Ouverture ( Cr )
+apps/erpnext/erpnext/accounts/report/trial_balance/trial_balance.py +217,Opening (Cr),Ouverture (Cr)
 apps/erpnext/erpnext/stock/doctype/item/item.py +816,Default Unit of Measure for Item {0} cannot be changed directly because you have already made some transaction(s) with another UOM. You will need to create a new Item to use a different Default UOM.,L’Unité de Mesure par Défaut pour l’Article {0} ne peut pas être modifiée directement parce que vous avez déjà fait une (des) transaction (s) avec une autre unité de mesure. Vous devez créer un nouvel article pour utiliser une UDM par défaut différente.
 apps/erpnext/erpnext/accounts/utils.py +353,Allocated amount can not be negative,Le montant alloué ne peut être négatif
 DocType: Purchase Order Item,Billed Amt,Mnt Facturé
@@ -633,7 +633,7 @@
 DocType: Batch,Batch Description,Description du Lot
 apps/erpnext/erpnext/accounts/utils.py +720,"Payment Gateway Account not created, please create one manually.","Paiement Gateway Account ne crée pas, s&#39;il vous plaît créer un manuellement."
 DocType: Sales Invoice,Sales Taxes and Charges,Taxes et frais de vente
-DocType: Employee,Organization Profile,Profil de l'organisme
+DocType: Employee,Organization Profile,Profil de l'Organisation
 DocType: Student,Sibling Details,Détails Sibling
 DocType: Vehicle Service,Vehicle Service,Entretien des véhicules
 apps/erpnext/erpnext/config/setup.py +101,Automatically triggers the feedback request based on conditions.,Déclencher automatiquement la demande de retour d'expérience en fonction des conditions.
@@ -694,7 +694,7 @@
 DocType: Employee Loan,Total Interest Payable,Total des intérêts à payer
 DocType: Landed Cost Taxes and Charges,Landed Cost Taxes and Charges,Taxes et Frais du Coût au Débarquement
 DocType: Production Order Operation,Actual Start Time,Heure de Début Réelle
-DocType: BOM Operation,Operation Time,Temps de fonctionnement
+DocType: BOM Operation,Operation Time,Heure de l'Opération
 apps/erpnext/erpnext/manufacturing/doctype/production_order/production_order.js +134,Finish,Terminer
 apps/erpnext/erpnext/hr/doctype/salary_structure/salary_structure.js +386,Base,Base
 DocType: Timesheet,Total Billed Hours,Total des heures facturées
@@ -711,10 +711,10 @@
 apps/erpnext/erpnext/selling/doctype/quotation/quotation.py +60,Please enter item details,"Pour signaler un problème, passez à"
 DocType: Interest,Interest,Intérêt
 apps/erpnext/erpnext/selling/doctype/customer/customer_dashboard.py +10,Pre Sales,Prévente
-DocType: Purchase Receipt,Other Details,Autres détails
+DocType: Purchase Receipt,Other Details,Autres Détails
 apps/erpnext/erpnext/accounts/report/delivered_items_to_be_billed/delivered_items_to_be_billed.py +18,Suplier,suplier
 DocType: Account,Accounts,Comptes
-DocType: Vehicle,Odometer Value (Last),Valeur compteur kilométrique (dernier)
+DocType: Vehicle,Odometer Value (Last),Valeur Compteur Kilométrique (Dernier)
 apps/erpnext/erpnext/setup/setup_wizard/install_fixtures.py +71,Marketing,Marketing
 apps/erpnext/erpnext/accounts/doctype/payment_request/payment_request.py +277,Payment Entry is already created,Paiement entrée est déjà créé
 DocType: Purchase Receipt Item Supplied,Current Stock,Stock Actuel
@@ -725,15 +725,15 @@
 DocType: Hub Settings,Seller City,Ville du vendeur
 ,Absent Student Report,Rapport des Absences
 DocType: Email Digest,Next email will be sent on:,Le prochain Email sera envoyé le :
-DocType: Offer Letter Term,Offer Letter Term,Terme lettre de proposition
+DocType: Offer Letter Term,Offer Letter Term,Terme de la Lettre de Proposition
 apps/erpnext/erpnext/stock/doctype/item/item.py +631,Item has variants.,L'article a des variantes.
 apps/erpnext/erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.py +65,Item {0} not found,Article {0} introuvable
 DocType: Bin,Stock Value,Valeur du Stock
 apps/erpnext/erpnext/accounts/doctype/account/account.py +26,Company {0} does not exist,Société {0} n'existe pas
 apps/erpnext/erpnext/buying/page/purchase_analytics/purchase_analytics.js +88,Tree Type,Type d' arbre
-DocType: BOM Explosion Item,Qty Consumed Per Unit,Qté consommée par unité
+DocType: BOM Explosion Item,Qty Consumed Per Unit,Qté Consommée Par Unité
 DocType: Serial No,Warranty Expiry Date,Date d'expiration de la garantie
-DocType: Material Request Item,Quantity and Warehouse,Quantité et entrepôt
+DocType: Material Request Item,Quantity and Warehouse,Quantité et Entrepôt
 DocType: Sales Invoice,Commission Rate (%),Taux de Commission (%)
 DocType: Project,Estimated Cost,Coût Estimé
 DocType: Purchase Order,Link to material requests,Lien vers les demandes matérielles
@@ -764,7 +764,7 @@
 apps/erpnext/erpnext/accounts/doctype/journal_entry/journal_entry.py +140,You can not enter current voucher in 'Against Journal Entry' column,Vous ne pouvez pas entrer coupon courant dans «Contre Journal Entry 'colonne
 apps/erpnext/erpnext/stock/page/stock_balance/stock_balance.js +50,Reserved for manufacturing,Réservé pour la fabrication
 apps/erpnext/erpnext/setup/setup_wizard/industry_type.py +25,Energy,Énergie
-DocType: Opportunity,Opportunity From,De opportunité
+DocType: Opportunity,Opportunity From,Opportunité De
 apps/erpnext/erpnext/config/hr.py +98,Monthly salary statement.,Fiche de salaire mensuel.
 DocType: BOM,Website Specifications,Site Web Spécifications
 apps/erpnext/erpnext/hr/doctype/leave_application/leave_application.py +24,{0}: From {0} of type {1},{0}: Du {0} de type {1}
@@ -826,7 +826,7 @@
 apps/erpnext/erpnext/accounts/doctype/asset/depreciation.py +128,Asset scrapped via Journal Entry {0},Actif mis au rebut via Écriture de Journal {0}
 DocType: Employee Loan,Interest Income Account,Compte de revenu d&#39;intérêt
 apps/erpnext/erpnext/setup/setup_wizard/industry_type.py +13,Biotechnology,Biotechnologie
-apps/erpnext/erpnext/accounts/doctype/account/chart_of_accounts/verified/standard_chart_of_accounts.py +107,Office Maintenance Expenses,Entretient et dépense bureau
+apps/erpnext/erpnext/accounts/doctype/account/chart_of_accounts/verified/standard_chart_of_accounts.py +107,Office Maintenance Expenses,Dépenses d'Entretien du Bureau
 apps/erpnext/erpnext/config/learn.py +47,Setting up Email Account,Configurer un compte de messagerie
 apps/erpnext/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.js +115,Please enter Item first,S'il vous plaît entrer l'article en premier
 DocType: Account,Liability,Responsabilité
@@ -862,7 +862,7 @@
 apps/erpnext/erpnext/accounts/doctype/sales_invoice/sales_invoice.py +262,Timesheet {0} is already completed or cancelled,Timesheet {0} est déjà terminée ou annulée
 apps/erpnext/erpnext/templates/pages/projects.html +42,No tasks,Aucune tâche
 DocType: Purchase Invoice,"The day of the month on which auto invoice will be generated e.g. 05, 28 etc","Le jour du mois où la facture automatique sera généré par exemple 05, 28 etc"
-DocType: Asset,Opening Accumulated Depreciation,Ouverture Amortissement cumulé
+DocType: Asset,Opening Accumulated Depreciation,Amortissement Cumulé d'Ouverture
 apps/erpnext/erpnext/hr/doctype/appraisal/appraisal.js +49,Score must be less than or equal to 5,Score doit être inférieur ou égal à 5
 DocType: Program Enrollment Tool,Program Enrollment Tool,Outil du programme d&#39;inscription
 apps/erpnext/erpnext/config/accounts.py +294,C-Form records,Enregistrements Formulaire-C
@@ -914,20 +914,20 @@
 apps/erpnext/erpnext/stock/doctype/landed_cost_voucher/landed_cost_voucher.py +75,Total Applicable Charges in Purchase Receipt Items table must be same as Total Taxes and Charges,Total des frais applicables en Achat Table des reçus Les articles doivent être le même que Total des taxes et frais
 DocType: Sales Team,Incentives,Incitations
 DocType: SMS Log,Requested Numbers,Numéros demandés
-DocType: Production Planning Tool,Only Obtain Raw Materials,Seulement obtenir des matières premières
+DocType: Production Planning Tool,Only Obtain Raw Materials,Obtenir seulement des Matières Premières
 apps/erpnext/erpnext/config/hr.py +142,Performance appraisal.,L&#39;évaluation des performances.
 apps/erpnext/erpnext/accounts/doctype/tax_rule/tax_rule.py +95,"Enabling 'Use for Shopping Cart', as Shopping Cart is enabled and there should be at least one Tax Rule for Shopping Cart","Activation de 'Utiliser pour Panier', comme le Panier est activé et qu'il devrait y avoir au moins une Règle de Taxes pour le Panier"
 apps/erpnext/erpnext/controllers/accounts_controller.py +353,"Payment Entry {0} is linked against Order {1}, check if it should be pulled as advance in this invoice.","Paiement entrée {0} est lié contre l&#39;ordonnance {1}, vérifier si elle doit être tirée en avance dans la présente facture."
 DocType: Sales Invoice Item,Stock Details,Détails du Stock
 apps/erpnext/erpnext/projects/report/project_wise_stock_tracking/project_wise_stock_tracking.py +29,Project Value,Valeur du projet
 apps/erpnext/erpnext/config/selling.py +321,Point-of-Sale,Point-de-vente
-DocType: Vehicle Log,Odometer Reading,Relevé du compteur kilométrique
+DocType: Vehicle Log,Odometer Reading,Relevé du Compteur Kilométrique
 apps/erpnext/erpnext/accounts/doctype/account/account.py +120,"Account balance already in Credit, you are not allowed to set 'Balance Must Be' as 'Debit'","Le solde du compte est déjà Créditeur, vous n'êtes pas autorisé à mettre en 'Solde Doit Être' comme 'Débiteur'"
 DocType: Account,Balance must be,Solde doit être
 DocType: Hub Settings,Publish Pricing,Publier la Tarification
 DocType: Notification Control,Expense Claim Rejected Message,Message de Note de Frais Rejetée
 ,Available Qty,Qté Disponible
-DocType: Purchase Taxes and Charges,On Previous Row Total,Le total de la rangée précédente
+DocType: Purchase Taxes and Charges,On Previous Row Total,Le Total de la Rangée Précédente
 DocType: Purchase Invoice Item,Rejected Qty,Qté rejeté
 DocType: Salary Slip,Working Days,Jours ouvrables
 DocType: Serial No,Incoming Rate,Taux d&#39;entrée
@@ -980,7 +980,7 @@
 DocType: Mode of Payment Account,Default Bank / Cash account will be automatically updated in POS Invoice when this mode is selected.,Le compte par défaut de Banque / Caisse sera automatiquement mis à jour dans la Facture PDV lorsque ce mode est sélectionné.
 DocType: Lead,LEAD-,LEAD-
 DocType: Employee,Permanent Address Is,Adresse permanente est
-DocType: Production Order Operation,Operation completed for how many finished goods?,Opération terminée pour combien de produits finis?
+DocType: Production Order Operation,Operation completed for how many finished goods?,Opération terminée pour combien de produits finis ?
 apps/erpnext/erpnext/public/js/setup_wizard.js +167,The Brand,La Marque
 DocType: Employee,Exit Interview Details,Entretient de Départ
 DocType: Item,Is Purchase Item,Est-Item
@@ -988,7 +988,7 @@
 DocType: Stock Ledger Entry,Voucher Detail No,Détail du bon No
 apps/erpnext/erpnext/accounts/page/pos/pos.js +709,New Sales Invoice,Nouvelle Facture de Vente
 DocType: Stock Entry,Total Outgoing Value,Valeur totale sortante
-apps/erpnext/erpnext/public/js/account_tree_grid.js +225,Opening Date and Closing Date should be within same Fiscal Year,Date d'ouverture et date de clôture devraient être dans le même exercice
+apps/erpnext/erpnext/public/js/account_tree_grid.js +225,Opening Date and Closing Date should be within same Fiscal Year,Date d'Ouverture et Date de Clôture devraient être dans le même Exercice
 DocType: Lead,Request for Information,Demande de renseignements
 apps/erpnext/erpnext/accounts/page/pos/pos.js +723,Sync Offline Invoices,Synchronisation Factures hors connexion
 DocType: Payment Request,Paid,Payé
@@ -1046,7 +1046,7 @@
 apps/erpnext/erpnext/templates/pages/cart.html +5,My Cart,Mon panier
 apps/erpnext/erpnext/controllers/selling_controller.py +159,Order Type must be one of {0},Type de Commande doit être l'un des {0}
 DocType: Lead,Next Contact Date,Date du prochain contact
-apps/erpnext/erpnext/stock/report/batch_wise_balance_history/batch_wise_balance_history.py +35,Opening Qty,Quantité d'ouverture
+apps/erpnext/erpnext/stock/report/batch_wise_balance_history/batch_wise_balance_history.py +35,Opening Qty,Quantité d'Ouverture
 apps/erpnext/erpnext/accounts/doctype/sales_invoice/sales_invoice.py +424,Please enter Account for Change Amount,S&#39;il vous plaît entrez compte pour le changement Montant
 DocType: Student Batch,Student Batch Name,Student Batch Nom
 DocType: Holiday List,Holiday List Name,Nom de la Liste de Vacances
@@ -1094,7 +1094,7 @@
 apps/erpnext/erpnext/manufacturing/doctype/production_order/production_order_calendar.js +42,WIP Warehouse,WIP Entrepôt
 apps/erpnext/erpnext/maintenance/doctype/maintenance_schedule/maintenance_schedule.py +196,Serial No {0} is under maintenance contract upto {1},Budget ne peut être réglé pour les centres de coûts du Groupe
 apps/erpnext/erpnext/config/hr.py +35,Recruitment,Recrutement
-DocType: Lead,Organization Name,Nom de l'organisation
+DocType: Lead,Organization Name,Nom de l'Organisation
 DocType: Tax Rule,Shipping State,Etat de livraison
 ,Projected Quantity as Source,Quantité projetée comme Source
 apps/erpnext/erpnext/stock/doctype/landed_cost_voucher/landed_cost_voucher.py +58,Item must be added using 'Get Items from Purchase Receipts' button,L'article doit être ajouté à l'aide du bouton 'Obtenir des éléments de reçus d'achat'
@@ -1112,14 +1112,14 @@
 DocType: Packing Slip,Net Weight UOM,Unité de mesure Poids Net
 apps/erpnext/erpnext/hr/doctype/training_result/training_result.py +18,{0} Results,{0} Résultats
 DocType: Item,Default Supplier,Fournisseur par Défaut
-DocType: Manufacturing Settings,Over Production Allowance Percentage,Surproduction Allocation Pourcentage
+DocType: Manufacturing Settings,Over Production Allowance Percentage,Pourcentage d'Allocation en cas de Surproduction
 DocType: Employee Loan,Repayment Schedule,Échéancier de remboursement
 DocType: Shipping Rule Condition,Shipping Rule Condition,Condition règle de livraison
 DocType: Holiday List,Get Weekly Off Dates,Obtenir les Dates de Congés
 apps/erpnext/erpnext/hr/doctype/appraisal/appraisal.py +33,End Date can not be less than Start Date,La date de Fin ne peut pas être antérieure à la Date de Début
 DocType: Sales Person,Select company name first.,Sélectionnez en premier le nom de la société.
 apps/erpnext/erpnext/accounts/doctype/journal_entry/journal_entry.js +154,Dr,Dr
-apps/erpnext/erpnext/config/buying.py +23,Quotations received from Suppliers.,Devis reçus des fournisseurs.
+apps/erpnext/erpnext/config/buying.py +23,Quotations received from Suppliers.,Devis reçus des Fournisseurs.
 apps/erpnext/erpnext/controllers/selling_controller.py +24,To {0} | {1} {2},A {0} | {1} {2}
 apps/erpnext/erpnext/stock/report/stock_ageing/stock_ageing.py +40,Average Age,Âge Moyen
 DocType: Opportunity,Your sales person who will contact the customer in future,Votre commercial prendra contact avec le client ultérieurement
@@ -1131,7 +1131,7 @@
 apps/erpnext/erpnext/controllers/accounts_controller.py +413,Warning: System will not check overbilling since amount for Item {0} in {1} is zero,Attention : Le système ne vérifie pas la surfacturation depuis montant pour objet {0} dans {1} est nulle
 DocType: Journal Entry,Make Difference Entry,Calculer l'entrée par différence
 DocType: Upload Attendance,Attendance From Date,Présence Depuis
-DocType: Appraisal Template Goal,Key Performance Area,Domaine essentiel de performance
+DocType: Appraisal Template Goal,Key Performance Area,Domaine Essentiel de Performance
 apps/erpnext/erpnext/setup/setup_wizard/industry_type.py +54,Transportation,transport
 apps/erpnext/erpnext/controllers/item_variant.py +94,Invalid Attribute,Attribut invalide
 apps/erpnext/erpnext/accounts/doctype/payment_entry/payment_entry.py +201,{0} {1} must be submitted,{0} {1} doit être soumis
@@ -1146,7 +1146,7 @@
 DocType: Shopping Cart Shipping Rule,Shopping Cart Shipping Rule,Règles de Livraison du Panier
 apps/erpnext/erpnext/selling/doctype/sales_order/sales_order.py +224,Production Order {0} must be cancelled before cancelling this Sales Order,L'ordre de Fabrication {0} doit être cancellé avant de canceller cette Commande Client
 apps/erpnext/erpnext/public/js/controllers/transaction.js +52,Please set 'Apply Additional Discount On',S&#39;il vous plaît mettre «Appliquer réduction supplémentaire sur &#39;
-,Ordered Items To Be Billed,Articles commandés à facturer
+,Ordered Items To Be Billed,Articles Commandés À Facturer
 apps/erpnext/erpnext/stock/doctype/item_attribute/item_attribute.py +46,From Range has to be less than To Range,La Plage Initiale doit être inférieure à la Plage Finale
 DocType: Global Defaults,Global Defaults,Valeurs par Défaut Globales
 apps/erpnext/erpnext/projects/doctype/project/project.py +202,Project Collaboration Invitation,Invitation de collaboration de projet
@@ -1160,7 +1160,7 @@
 DocType: Lead,Consultant,Consultant
 DocType: Salary Slip,Earnings,Bénéfices
 apps/erpnext/erpnext/stock/doctype/stock_entry/stock_entry.py +382,Finished Item {0} must be entered for Manufacture type entry,Le Produit Fini {0} doit être saisi pour une écriture de type de Fabrication
-apps/erpnext/erpnext/config/learn.py +87,Opening Accounting Balance,Solde d&#39;ouverture de comptabilité
+apps/erpnext/erpnext/config/learn.py +87,Opening Accounting Balance,Solde d'Ouverture de Comptabilité
 DocType: Sales Invoice Advance,Sales Invoice Advance,Avance facture de vente
 apps/erpnext/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.py +548,Nothing to request,Pas de requête à demander
 apps/erpnext/erpnext/accounts/doctype/budget/budget.py +34,Another Budget record '{0}' already exists against {1} '{2}' for fiscal year {3},Un autre enregistrement de Budget '{0}' existe déjà pour {1} '{2}' pour l'exercice {3}
@@ -1240,10 +1240,10 @@
 DocType: Purchase Invoice,Is Recurring,Est récurrent
 DocType: Purchase Invoice,Supplied Items,Articles fournis
 DocType: Student,STUD.,GOUJON.
-DocType: Production Order,Qty To Manufacture,Quantité à fabriquer
+DocType: Production Order,Qty To Manufacture,Quantité À Fabriquer
 DocType: Email Digest,New Income,Nouveau revenu
 DocType: Buying Settings,Maintain same rate throughout purchase cycle,Maintenir le même taux tout au long du cycle d'achat
-DocType: Opportunity Item,Opportunity Item,Article occasion
+DocType: Opportunity Item,Opportunity Item,Article de l'Opportunité
 ,Student and Guardian Contact Details,Étudiant et Guardian Détails de contact
 apps/erpnext/erpnext/buying/doctype/request_for_quotation/request_for_quotation.py +42,Row {0}: For supplier {0} Email Address is required to send email,Row {0}: Pour le fournisseur {0} Adresse e-mail est nécessaire pour envoyer des e-mail
 apps/erpnext/erpnext/accounts/doctype/account/chart_of_accounts/verified/standard_chart_of_accounts.py +70,Temporary Opening,Ouverture temporaire
@@ -1357,7 +1357,7 @@
 DocType: Purchase Invoice,Party Account Currency,Compte Parti devise
 ,BOM Browser,Explorateur LDM
 DocType: Purchase Taxes and Charges,Add or Deduct,Ajouter ou Déduire
-apps/erpnext/erpnext/accounts/doctype/shipping_rule/shipping_rule.py +81,Overlapping conditions found between:,condition qui se coincide touvée
+apps/erpnext/erpnext/accounts/doctype/shipping_rule/shipping_rule.py +81,Overlapping conditions found between:,Conditions qui coincident touvées entre :
 apps/erpnext/erpnext/accounts/doctype/gl_entry/gl_entry.py +188,Against Journal Entry {0} is already adjusted against some other voucher,L'Écriture de Journal {0} est déjà ajustée par un autre bon
 apps/erpnext/erpnext/selling/report/inactive_customers/inactive_customers.py +68,Total Order Value,Ordre Valeur totale
 apps/erpnext/erpnext/demo/setup/setup_data.py +315,Food,Alimentation
@@ -1369,7 +1369,7 @@
 apps/erpnext/erpnext/hr/doctype/appraisal_template/appraisal_template.py +21,Sum of points for all goals should be 100. It is {0},Somme des points pour tous les objectifs devraient être 100. Il est {0}
 DocType: Project,Start and End Dates,Dates début et fin
 ,Delivered Items To Be Billed,Articles Livrés à Facturer
-apps/erpnext/erpnext/manufacturing/doctype/bom/bom_item_preview.html +16,Open BOM {0},Ouvrir BOM {0}
+apps/erpnext/erpnext/manufacturing/doctype/bom/bom_item_preview.html +16,Open BOM {0},Ouvrir LDM {0}
 apps/erpnext/erpnext/stock/doctype/serial_no/serial_no.py +60,Warehouse cannot be changed for Serial No.,Entrepôt ne peut être modifié pour le numéro de série
 DocType: Authorization Rule,Average Discount,Remise Moyenne
 DocType: Purchase Invoice Item,UOM,UOM
@@ -1382,7 +1382,7 @@
 DocType: Activity Cost,Projects,Projets
 DocType: Payment Request,Transaction Currency,Devise de la transaction
 apps/erpnext/erpnext/controllers/buying_controller.py +24,From {0} | {1} {2},Du {0} | {1} {2}
-DocType: Production Order Operation,Operation Description,Description de l&#39;opération
+DocType: Production Order Operation,Operation Description,Description de l'Opération
 DocType: Item,Will also apply to variants,Se appliquera également aux variantes
 apps/erpnext/erpnext/accounts/doctype/fiscal_year/fiscal_year.py +34,Cannot change Fiscal Year Start Date and Fiscal Year End Date once the Fiscal Year is saved.,Impossible de modifier les dates de début et de fin d'exercice une fois que l'exercice est enregistré.
 DocType: Quotation,Shopping Cart,Panier
@@ -1461,7 +1461,7 @@
 DocType: Asset Movement,Stock Manager,Responsable des Stocks
 apps/erpnext/erpnext/stock/doctype/stock_entry/stock_entry.py +135,Source warehouse is mandatory for row {0},Entrepôt Source est obligatoire à la ligne {0}
 apps/erpnext/erpnext/stock/doctype/delivery_note/delivery_note.js +814,Packing Slip,Bordereau de livraison
-apps/erpnext/erpnext/accounts/doctype/account/chart_of_accounts/verified/standard_chart_of_accounts.py +108,Office Rent,Loyer du bureau
+apps/erpnext/erpnext/accounts/doctype/account/chart_of_accounts/verified/standard_chart_of_accounts.py +108,Office Rent,Loyer du Bureau
 apps/erpnext/erpnext/config/setup.py +111,Setup SMS gateway settings,paramètres de la passerelle SMS de configuration
 apps/erpnext/erpnext/hr/doctype/upload_attendance/upload_attendance.js +60,Import Failed!,Importation a échoué!
 apps/erpnext/erpnext/public/js/templates/address_list.html +21,No address added yet.,Aucune adresse encore ajouté.
@@ -1469,7 +1469,7 @@
 apps/erpnext/erpnext/setup/setup_wizard/install_fixtures.py +87,Analyst,Analyste
 DocType: Item,Inventory,Inventaire
 DocType: Item,Sales Details,Détails ventes
-DocType: Quality Inspection,QI-,Qi-
+DocType: Quality Inspection,QI-,QI-
 DocType: Opportunity,With Items,Avec Articles
 apps/erpnext/erpnext/stock/report/batch_wise_balance_history/batch_wise_balance_history.py +36,In Qty,En Qté
 DocType: Notification Control,Expense Claim Rejected,Note de Frais Rejetée
@@ -1493,7 +1493,7 @@
 apps/erpnext/erpnext/public/js/setup_wizard.js +60,Financial Year Start Date,Date de Début de l'Exercice Financier
 DocType: POS Profile,Apply Discount,Appliquer Réduction
 DocType: Employee External Work History,Total Experience,Total Experience
-apps/erpnext/erpnext/setup/doctype/email_digest/templates/default.html +70,Open Projects,Projets Ouverts
+apps/erpnext/erpnext/setup/doctype/email_digest/templates/default.html +70,Open Projects,Ouvrir les Projets
 apps/erpnext/erpnext/stock/doctype/delivery_note/delivery_note.py +267,Packing Slip(s) cancelled,Bordereau(x) annulé
 apps/erpnext/erpnext/accounts/report/cash_flow/cash_flow.py +31,Cash Flow from Investing,Flux de Trésorerie des Investissements
 DocType: Program Course,Program Course,Cours du programme
@@ -1553,7 +1553,7 @@
 ,Lead Name,Nom du Prospect
 ,POS,Points de Ventes
 DocType: C-Form,III,III
-apps/erpnext/erpnext/config/stock.py +305,Opening Stock Balance,Ouverture Stock Solde
+apps/erpnext/erpnext/config/stock.py +305,Opening Stock Balance,Solde d'Ouverture des Stocks
 apps/erpnext/erpnext/stock/doctype/item_attribute/item_attribute.py +58,{0} must appear only once,{0} doit apparaître qu'une seule fois
 apps/erpnext/erpnext/stock/doctype/stock_entry/stock_entry.py +359,Not allowed to tranfer more {0} than {1} against Purchase Order {2},Non autorisé à tranférer plus que {0} {1} contre Purchase Order {2}
 apps/erpnext/erpnext/hr/doctype/leave_control_panel/leave_control_panel.py +59,Leaves Allocated Successfully for {0},Congés Attribués avec Succès pour {0}
@@ -1578,7 +1578,7 @@
 apps/erpnext/erpnext/accounts/doctype/payment_request/payment_request.js +20,Resend Payment Email,Renvoyer Paiement E-mail
 apps/erpnext/erpnext/templates/pages/projects.html +27,New task,Nouvelle tâche
 apps/erpnext/erpnext/utilities/activation.py +75,Make Quotation,Faire soumission
-apps/erpnext/erpnext/config/selling.py +216,Other Reports,Autres rapports
+apps/erpnext/erpnext/config/selling.py +216,Other Reports,Autres Rapports
 DocType: Dependent Task,Dependent Task,Tâche Dépendante
 apps/erpnext/erpnext/stock/doctype/item/item.py +406,Conversion factor for default Unit of Measure must be 1 in row {0},Facteur de conversion de l'Unité de Mesure par défaut doit être 1 dans la ligne {0}
 apps/erpnext/erpnext/hr/doctype/leave_application/leave_application.py +208,Leave of type {0} cannot be longer than {1},Les Congés de type {0} ne peuvent pas être plus long que {1}
@@ -1597,7 +1597,7 @@
 apps/erpnext/erpnext/manufacturing/doctype/production_order/production_order.js +246,Quantity must not be more than {0},Quantité ne doit pas être plus de {0}
 apps/erpnext/erpnext/accounts/report/balance_sheet/balance_sheet.py +107,Previous Financial Year is not closed,Précédent Année financière est pas fermé
 apps/erpnext/erpnext/accounts/report/accounts_receivable/accounts_receivable.py +44,Age (Days),Âge (Jours)
-DocType: Quotation Item,Quotation Item,Article de la soumission
+DocType: Quotation Item,Quotation Item,Article du Devis
 DocType: Account,Account Name,Nom du Compte
 apps/erpnext/erpnext/accounts/report/trial_balance/trial_balance.py +40,From Date cannot be greater than To Date,La Date Initiale ne peut pas être postérieure à la Date Finale
 apps/erpnext/erpnext/stock/doctype/serial_no/serial_no.py +194,Serial No {0} quantity {1} cannot be a fraction,N ° de série {0} quantité {1} ne peut pas être une fraction
@@ -1670,7 +1670,7 @@
 DocType: Payment Entry,Paid Amount (Company Currency),Montant payé (Devise Société)
 DocType: Purchase Invoice,Additional Discount,Remise Supplémentaire
 DocType: Selling Settings,Selling Settings,Réglages de vente
-apps/erpnext/erpnext/setup/setup_wizard/industry_type.py +39,Online Auctions,Enchères en ligne
+apps/erpnext/erpnext/setup/setup_wizard/industry_type.py +39,Online Auctions,Enchères en Ligne
 apps/erpnext/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py +98,Please specify either Quantity or Valuation Rate or both,S'il vous plaît spécifier Quantité ou l'évaluation des taux ou à la fois
 apps/erpnext/erpnext/selling/doctype/sales_order/sales_order_dashboard.py +14,Fulfillment,Accomplissement
 apps/erpnext/erpnext/templates/generators/item.html +67,View in Cart,Voir Panier
@@ -1704,14 +1704,14 @@
 DocType: Employee,AB+,AB+
 DocType: Item,"If this item has variants, then it cannot be selected in sales orders etc.","Si cet article a des variantes, alors il ne peut pas être sélectionné dans les commandes, etc."
 DocType: Lead,Next Contact By,Contact suivant par
-apps/erpnext/erpnext/manufacturing/doctype/bom/bom.py +254,Quantity required for Item {0} in row {1},Quantité requise pour l'article {0} à la ligne {1}
+apps/erpnext/erpnext/manufacturing/doctype/bom/bom.py +254,Quantity required for Item {0} in row {1},Quantité requise pour l'Article {0} à la ligne {1}
 apps/erpnext/erpnext/stock/doctype/warehouse/warehouse.py +114,Warehouse {0} can not be deleted as quantity exists for Item {1},Entrepôt {0} ne peut pas être supprimé car il existe une quantité pour l'article {1}
-DocType: Quotation,Order Type,Type d&#39;ordre
+DocType: Quotation,Order Type,Type de Commande
 DocType: Purchase Invoice,Notification Email Address,Adresse E-mail de notification
 ,Item-wise Sales Register,Registre des ventes par Article
 DocType: Asset,Gross Purchase Amount,Montant d'Achat Brut
 DocType: Asset,Depreciation Method,Méthode d'Amortissement
-apps/erpnext/erpnext/accounts/page/pos/pos.js +686,Offline,Hors ligne
+apps/erpnext/erpnext/accounts/page/pos/pos.js +686,Offline,Hors Ligne
 DocType: Purchase Taxes and Charges,Is this Tax included in Basic Rate?,Est-ce Taxes incluses dans le taux de base?
 apps/erpnext/erpnext/accounts/report/budget_variance_report/budget_variance_report.py +56,Total Target,Cible total
 DocType: Program Course,Required,Obligatoire
@@ -1730,7 +1730,7 @@
 DocType: Employee Attendance Tool,Employees HTML,Employés HTML
 apps/erpnext/erpnext/stock/doctype/item/item.py +420,Default BOM ({0}) must be active for this item or its template,LDM par défaut ({0}) doit être actif pour ce produit ou son modèle
 DocType: Employee,Leave Encashed?,Laisser Encaissé ?
-apps/erpnext/erpnext/crm/doctype/opportunity/opportunity.py +32,Opportunity From field is mandatory,Opportunité champ est obligatoire
+apps/erpnext/erpnext/crm/doctype/opportunity/opportunity.py +32,Opportunity From field is mandatory,Le champ Opportunité De est obligatoire
 DocType: Email Digest,Annual Expenses,Dépenses Annuelles
 DocType: Item,Variants,Variantes
 apps/erpnext/erpnext/selling/doctype/sales_order/sales_order.js +994,Make Purchase Order,Faire un bon de commande
@@ -1794,7 +1794,7 @@
 apps/erpnext/erpnext/setup/setup_wizard/industry_type.py +52,Telecommunications,télécommunications
 DocType: Packing Slip,Indicates that the package is a part of this delivery (Only Draft),Indique que le package est une partie de cette livraison (Seuls les projets)
 apps/erpnext/erpnext/accounts/doctype/payment_request/payment_request.js +36,Make Payment Entry,Effectuer une entrée de paiement
-apps/erpnext/erpnext/stock/doctype/packing_slip/packing_slip.py +126,Quantity for Item {0} must be less than {1},Quantité de l'article {0} doit être inférieur à {1}
+apps/erpnext/erpnext/stock/doctype/packing_slip/packing_slip.py +126,Quantity for Item {0} must be less than {1},Quantité de l'article {0} doit être inférieure à {1}
 ,Sales Invoice Trends,Tendances des Factures de Vente
 DocType: Leave Application,Apply / Approve Leaves,Appliquer / Approuver les Congés
 apps/erpnext/erpnext/accounts/print_format/payment_receipt_voucher/payment_receipt_voucher.html +23,For,Pour
@@ -1845,7 +1845,7 @@
 apps/erpnext/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.py +233,{0} created,{0} créé
 DocType: Delivery Note Item,Against Sales Order,Pour la Commande Client
 ,Serial No Status,Statut du No de série
-DocType: Payment Entry Reference,Outstanding,Exceptionnel
+DocType: Payment Entry Reference,Outstanding,Solde
 ,Daily Timesheet Summary,Récapitulatif Quotidien des Feuilles de Présence
 apps/erpnext/erpnext/maintenance/doctype/maintenance_schedule/maintenance_schedule.py +138,"Row {0}: To set {1} periodicity, difference between from and to date \
 						must be greater than or equal to {2}","Row {0}: Pour régler {1} périodicité, différence entre partir et à ce jour \
@@ -1869,7 +1869,7 @@
 ,Item-wise Purchase History,Historique des achats (par Article)
 apps/erpnext/erpnext/maintenance/doctype/maintenance_schedule/maintenance_schedule.py +231,Please click on 'Generate Schedule' to fetch Serial No added for Item {0},"S'il vous plaît cliquez sur "" Générer Calendrier ' pour récupérer le série n ° ajouté pour l'article {0}"
 DocType: Account,Frozen,Gelé
-,Open Production Orders,Commandes de Production Ouvertes
+,Open Production Orders,Ouvrir les Ordres de Fabrication
 DocType: Sales Invoice Payment,Base Amount (Company Currency),Montant de Base (Devise de la Société)
 DocType: Payment Reconciliation Payment,Reference Row,Rangée de référence
 DocType: Installation Note,Installation Time,Temps d&#39;installation
@@ -1887,7 +1887,7 @@
 DocType: Employee Loan Application,Total Payable Amount,Montant total à payer
 DocType: Task,Expected Time (in hours),Durée Prévue (en heures)
 DocType: Item Reorder,Check in (group),Enregistrement (groupe)
-,Qty to Order,Quantité à commander
+,Qty to Order,Quantité à Commander
 DocType: Period Closing Voucher,"The account head under Liability or Equity, in which Profit/Loss will be booked","Le compte tête sous la responsabilité ou l&#39;équité, dans lequel Profit / perte sera comptabilisée"
 apps/erpnext/erpnext/config/projects.py +25,Gantt chart of all tasks.,Diagramme de Gantt de toutes les tâches.
 DocType: Opportunity,Mins to First Response,Minutes avant la Première Réponse
@@ -1926,7 +1926,7 @@
 ,Maintenance Schedules,Programmes d&#39;entretien
 DocType: Task,Actual End Date (via Time Sheet),Date de Fin Réelle (via la Feuille de Temps)
 apps/erpnext/erpnext/accounts/doctype/payment_entry/payment_entry.py +346,Amount {0} {1} against {2} {3},Montant {0} {1} pour {2} {3}
-,Quotation Trends,Tendances de Soumission
+,Quotation Trends,Tendances des Devis
 apps/erpnext/erpnext/accounts/doctype/pricing_rule/pricing_rule.py +157,Item Group not mentioned in item master for item {0},Le groupe d'articles n'est pas mentionnés dans la fiche de l'article pour l'article {0}
 apps/erpnext/erpnext/accounts/doctype/sales_invoice/sales_invoice.py +330,Debit To account must be a Receivable account,Le compte de débit doit être un compte Débiteur
 DocType: Shipping Rule Condition,Shipping Amount,Montant de livraison
@@ -2011,10 +2011,10 @@
 DocType: Purchase Taxes and Charges,Deduct,Déduire
 apps/erpnext/erpnext/setup/setup_wizard/install_fixtures.py +188,Job Description,Description de l'Emploi
 DocType: Student Applicant,Applied,Appliqué
-DocType: Sales Invoice Item,Qty as per Stock UOM,Qté en stock pour Emballage
+DocType: Sales Invoice Item,Qty as per Stock UOM,Qté par UDM du Stock
 apps/erpnext/erpnext/schools/report/student_and_guardian_contact_details/student_and_guardian_contact_details.py +52,Guardian2 Name,Nom Guardian2
 apps/erpnext/erpnext/setup/doctype/naming_series/naming_series.py +130,"Special Characters except ""-"", ""#"", ""."" and ""/"" not allowed in naming series","Caractères spéciaux sauf ""-"", ""#"", ""."" et ""/"" pas autorisés à nommer série"
-DocType: Campaign,"Keep Track of Sales Campaigns. Keep track of Leads, Quotations, Sales Order etc from Campaigns to gauge Return on Investment.","Garder une trace des campagnes de vente. Gardez une trace des prospections, devis, vente etc. Pour mesurer le retour sur investissement."
+DocType: Campaign,"Keep Track of Sales Campaigns. Keep track of Leads, Quotations, Sales Order etc from Campaigns to gauge Return on Investment.","Garder une Trace des Campagnes de Vente. Garder une trace des Prospects, Devis, Commandes Client etc. depuis les Campagnes pour mesurer le Retour sur Investissement."
 DocType: Expense Claim,Approver,Approbateur
 ,SO Qty,SO Quantité
 DocType: Guardian,Work Address,Adresse de travail
@@ -2050,7 +2050,7 @@
 apps/erpnext/erpnext/accounts/report/asset_depreciations_and_balances/asset_depreciations_and_balances.py +125,Cost of New Purchase,Coût du Nouvel Achat
 apps/erpnext/erpnext/stock/doctype/delivery_note/delivery_note.py +94,Sales Order required for Item {0},Commande client requise pour l'article {0}
 DocType: Purchase Invoice Item,Rate (Company Currency),Prix (Monnaie de la société)
-DocType: Student Guardian,Others,autres
+DocType: Student Guardian,Others,Autres
 DocType: Payment Entry,Unallocated Amount,Montant Unallocated
 apps/erpnext/erpnext/templates/includes/product_page.js +69,Cannot find a matching Item. Please select some other value for {0}.,Impossible de trouver un article similaire. Veuillez sélectionner une autre valeur pour {0}.
 DocType: POS Profile,Taxes and Charges,Impôts et taxes
@@ -2063,7 +2063,7 @@
 DocType: Vehicle Service,Service Item,service de l&#39;article
 apps/erpnext/erpnext/maintenance/doctype/maintenance_schedule/maintenance_schedule.py +39,Please click on 'Generate Schedule' to get schedule,"S'il vous plaît cliquez sur "" Générer Calendrier » pour obtenir le calendrier"
 apps/erpnext/erpnext/schools/doctype/course_scheduling_tool/course_scheduling_tool.py +55,There were errors while deleting following schedules:,Il y avait des erreurs lors de la suppression des horaires suivants:
-DocType: Bin,Ordered Quantity,Quantité commandée
+DocType: Bin,Ordered Quantity,Quantité Commandée
 apps/erpnext/erpnext/public/js/setup_wizard.js +52,"e.g. ""Build tools for builders""","e.g. ""Construire des outils pour les constructeurs"""
 DocType: Grading Scale,Grading Scale Intervals,Intervalles de l'Échelle de Notation
 apps/erpnext/erpnext/accounts/doctype/gl_entry/gl_entry.py +126,{0} {1}: Accounting Entry for {2} can only be made in currency: {3},{0} {1}: L'entrée comptable pour {2} ne peut être faite en devise: {3}
@@ -2090,7 +2090,7 @@
 DocType: Production Order Operation,Pending,En attente
 DocType: Course,Course Name,Nom du Cours
 DocType: Employee Leave Approver,Users who can approve a specific employee's leave applications,Les utilisateurs qui peuvent approuver les demandes de congé d'un employé en particulier
-apps/erpnext/erpnext/accounts/doctype/account/chart_of_accounts/verified/standard_chart_of_accounts.py +50,Office Equipments,Équipement de bureau
+apps/erpnext/erpnext/accounts/doctype/account/chart_of_accounts/verified/standard_chart_of_accounts.py +50,Office Equipments,Équipements de Bureau
 DocType: Purchase Invoice Item,Qty,Qté
 DocType: Fiscal Year,Companies,Sociétés
 apps/erpnext/erpnext/setup/setup_wizard/industry_type.py +24,Electronics,Électronique
@@ -2108,7 +2108,7 @@
 apps/erpnext/erpnext/accounts/doctype/sales_invoice/sales_invoice.py +324,Debit To is required,Compte de Débit Requis
 apps/erpnext/erpnext/utilities/activation.py +110,"Timesheets help keep track of time, cost and billing for activites done by your team","Timesheets aider à suivre le temps, le coût et la facturation des activités effectuées par votre équipe"
 apps/erpnext/erpnext/stock/report/item_prices/item_prices.py +39,Purchase Price List,Liste prix d'achat
-DocType: Offer Letter Term,Offer Term,Offre à terme
+DocType: Offer Letter Term,Offer Term,Terme de la Proposition
 DocType: Quality Inspection,Quality Manager,Responsable Qualité
 DocType: Job Applicant,Job Opening,Offre d’Emploi
 DocType: Payment Reconciliation,Payment Reconciliation,Rapprochement des paiements
@@ -2116,7 +2116,7 @@
 apps/erpnext/erpnext/setup/setup_wizard/industry_type.py +51,Technology,technologie
 apps/erpnext/erpnext/public/js/utils.js +92,Total Unpaid: {0},Total non rémunéré: {0}
 DocType: BOM Website Operation,BOM Website Operation,Opération de LDM du Site Internet
-apps/erpnext/erpnext/hr/doctype/job_applicant/job_applicant.js +13,Offer Letter,lettre de proposition
+apps/erpnext/erpnext/hr/doctype/job_applicant/job_applicant.js +13,Offer Letter,Lettre de Proposition
 apps/erpnext/erpnext/config/manufacturing.py +18,Generate Material Requests (MRP) and Production Orders.,Générer des Demandes de Matériel (MRP) et des Ordres de Fabrication.
 apps/erpnext/erpnext/accounts/report/accounts_receivable/accounts_receivable.html +65,Total Invoiced Amt,Total facturé Amt
 DocType: BOM,Conversion Rate,Taux de Conversion
@@ -2225,7 +2225,7 @@
 DocType: Process Payroll,Create Salary Slip,Créer une Fiche de Paie
 apps/erpnext/erpnext/stock/doctype/item/item_dashboard.py +34,Traceability,Traçabilité
 apps/erpnext/erpnext/accounts/doctype/account/chart_of_accounts/verified/standard_chart_of_accounts.py +135,Source of Funds (Liabilities),Source des fonds ( Passif )
-apps/erpnext/erpnext/stock/doctype/stock_entry/stock_entry.py +372,Quantity in row {0} ({1}) must be same as manufactured quantity {2},Quantité alignée {0} ({1}) doit être égale a la quantité fabriquée {2}
+apps/erpnext/erpnext/stock/doctype/stock_entry/stock_entry.py +372,Quantity in row {0} ({1}) must be same as manufactured quantity {2},Quantité à la ligne {0} ({1}) doit être égale a la quantité fabriquée {2}
 DocType: Appraisal,Employee,Employé
 apps/erpnext/erpnext/schools/doctype/grading_scale/grading_scale.py +20,Please define grade for treshold 0%,S&#39;il vous plaît définir note pour 0% treshold
 apps/erpnext/erpnext/accounts/doctype/journal_entry/journal_entry.py +232,{0} {1} is fully billed,{0} {1} est entièrement facturé
@@ -2273,7 +2273,7 @@
 apps/erpnext/erpnext/public/js/conf.js +28,User Forum,Forum de l&#39;utilisateur
 apps/erpnext/erpnext/manufacturing/doctype/bom/bom.py +248,Raw Materials cannot be blank.,Matières premières ne peuvent pas être vide.
 apps/erpnext/erpnext/accounts/doctype/sales_invoice/sales_invoice.py +444,"Could not update stock, invoice contains drop shipping item.","Impossible de mettre à jour de stock, facture contient un élément en livraison directe."
-apps/erpnext/erpnext/accounts/doctype/journal_entry/journal_entry.js +459,Quick Journal Entry,Entrée rapide dans le journal
+apps/erpnext/erpnext/accounts/doctype/journal_entry/journal_entry.js +459,Quick Journal Entry,Écriture Rapide dans le Journal
 apps/erpnext/erpnext/manufacturing/doctype/bom/bom.js +142,You can not change rate if BOM mentioned agianst any item,Vous ne pouvez pas modifier le taux si BOM mentionné agianst un article
 apps/erpnext/erpnext/schools/doctype/student_batch/student_batch.py +24,Student Group exists with same name,Groupe étudiant existe avec le même nom
 DocType: Employee,Previous Work Experience,L&#39;expérience de travail antérieure
@@ -2301,7 +2301,7 @@
 apps/erpnext/erpnext/config/stock.py +189,Unit of Measure,Unité de mesure
 DocType: Fiscal Year,Year End Date,Date de Fin de l'exercice
 DocType: Task Depends On,Task Depends On,Tâches dépendent de
-DocType: Supplier Quotation,Opportunity,Occasion
+DocType: Supplier Quotation,Opportunity,Opportunité
 ,Completed Production Orders,Ordres de Fabrication Terminés
 DocType: Operation,Default Workstation,Station de Travail par Défaut
 DocType: Notification Control,Expense Claim Approved Message,Message d'une Note de Frais Approuvée
@@ -2316,7 +2316,7 @@
 DocType: Project,% Complete Method,% Méthode complète
 apps/erpnext/erpnext/maintenance/doctype/maintenance_schedule/maintenance_schedule.py +201,Maintenance start date can not be before delivery date for Serial No {0},Entretien date de début ne peut pas être avant la date de livraison pour série n ° {0}
 DocType: Production Order,Actual End Date,Date de Fin Réelle
-DocType: BOM,Operating Cost (Company Currency),Coût d&#39;exploitation (Société Monnaie)
+DocType: BOM,Operating Cost (Company Currency),Coût d'Exploitation (Devise Société)
 DocType: Purchase Invoice,PINV-,PINV-
 DocType: Authorization Rule,Applicable To (Role),Applicable À (Rôle)
 DocType: Stock Entry,Purpose,But
@@ -2418,7 +2418,7 @@
 DocType: Purchase Invoice,Is Paid,Est payé
 DocType: Salary Structure,Total Earning,Total Revenus
 DocType: Purchase Receipt,Time at which materials were received,Heure à laquelle les matériaux ont été reçus
-DocType: Stock Ledger Entry,Outgoing Rate,Taux sortant
+DocType: Stock Ledger Entry,Outgoing Rate,Taux Sortant
 apps/erpnext/erpnext/config/hr.py +224,Organization branch master.,Organisation principale des branches.
 apps/erpnext/erpnext/controllers/accounts_controller.py +286, or ,ou
 DocType: Sales Order,Billing Status,Statut de la Facturation
@@ -2438,7 +2438,7 @@
 DocType: Purchase Invoice,Total Taxes and Charges,Total Taxes et frais
 DocType: Employee,Emergency Contact,Contact en cas d'Urgence
 DocType: Bank Reconciliation Detail,Payment Entry,Paiement Entrée
-DocType: Item,Quality Parameters,Paramètres de qualité
+DocType: Item,Quality Parameters,Paramètres de Qualité
 ,sales-browser,Navigateur de ventes
 apps/erpnext/erpnext/accounts/doctype/account/account.js +56,Ledger,Grand Livre
 DocType: Target Detail,Target  Amount,Montant Ciblé
@@ -2474,7 +2474,7 @@
 apps/erpnext/erpnext/accounts/doctype/sales_invoice/sales_invoice.js +783,Delivery,Livraison
 DocType: Stock Reconciliation Item,Current Qty,Qté Actuelle
 DocType: BOM Item,"See ""Rate Of Materials Based On"" in Costing Section",Voir «Taux de matériaux à base de« coûts dans la section
-DocType: Appraisal Goal,Key Responsibility Area,Domaine à responsabilités principal
+DocType: Appraisal Goal,Key Responsibility Area,Domaine de Responsabilités Principal
 apps/erpnext/erpnext/utilities/activation.py +128,"Student Batches help you track attendance, assessments and fees for students","Batchs étudiants vous aider à suivre la fréquentation, les évaluations et les frais pour les étudiants"
 DocType: Payment Entry,Total Allocated Amount,Montant total alloué
 DocType: Item Reorder,Material Request Type,Type de demande de matériel
@@ -2560,7 +2560,7 @@
 ,S.O. No.,S.O. Non.
 apps/erpnext/erpnext/selling/doctype/quotation/quotation.py +163,Please create Customer from Lead {0},Merci de créer un Client à partir du Prospect {0}
 DocType: Price List,Applicable for Countries,Applicable pour les Pays
-apps/erpnext/erpnext/hr/doctype/leave_application/leave_application.py +52,Only Leave Applications with status 'Approved' and 'Rejected' can be submitted,Seulement demandes d&#39;autorisation avec le statut « approuvé » et « Rejeté » peut être soumis
+apps/erpnext/erpnext/hr/doctype/leave_application/leave_application.py +52,Only Leave Applications with status 'Approved' and 'Rejected' can be submitted,Seules les Demandes de Congés avec le statut 'Appouvée' ou 'Rejetée' peuvent être soumises
 apps/erpnext/erpnext/schools/doctype/student_group_creation_tool/student_group_creation_tool.py +38,Student Group Name is mandatory in row {0},Étudiant Nom de groupe est obligatoire dans la ligne {0}
 DocType: Homepage,Products to be shown on website homepage,Produits destinés à être affichés sur le site Web page d&#39;accueil
 apps/erpnext/erpnext/setup/doctype/customer_group/customer_group.js +13,This is a root customer group and cannot be edited.,Il s'agit d'un groupe de clients de la racine et ne peut être modifié .
@@ -2622,10 +2622,10 @@
 apps/erpnext/erpnext/stock/doctype/landed_cost_voucher/landed_cost_voucher.js +45,"Charges will be distributed proportionately based on item qty or amount, as per your selection","Les frais seront distribués proportionnellement à la qté ou au montant de l'article, selon votre sélection"
 DocType: Maintenance Visit,Purposes,Buts
 apps/erpnext/erpnext/controllers/sales_and_purchase_return.py +105,Atleast one item should be entered with negative quantity in return document,Au moins un article doit être saisi avec quantité négative dans le document de retour
-apps/erpnext/erpnext/manufacturing/doctype/workstation/workstation.py +71,"Operation {0} longer than any available working hours in workstation {1}, break down the operation into multiple operations","Opération {0} plus longtemps que les heures de travail disponibles dans poste de travail {1}, briser l&#39;opération en plusieurs opérations"
+apps/erpnext/erpnext/manufacturing/doctype/workstation/workstation.py +71,"Operation {0} longer than any available working hours in workstation {1}, break down the operation into multiple operations","Opération {0} plus longue que toute heure de travail disponible dans le poste {1}, séparer l'opération en plusieurs opérations"
 ,Requested,demandé
 apps/erpnext/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py +85,No Remarks,Pas de remarques
-DocType: Purchase Invoice,Overdue,En retard
+DocType: Purchase Invoice,Overdue,En Retard
 DocType: Account,Stock Received But Not Billed,Stock reçus mais non facturés
 apps/erpnext/erpnext/accounts/doctype/account/account.py +88,Root Account must be a group,Compte racine doit être un groupe
 DocType: Fees,FEE.,HONORAIRES.
@@ -2633,7 +2633,7 @@
 DocType: Item,Total Projected Qty,Nombre total prévu
 DocType: Monthly Distribution,Distribution Name,Nom de Distribution
 DocType: Course,Course Code,Code de Cours
-apps/erpnext/erpnext/controllers/stock_controller.py +320,Quality Inspection required for Item {0},Inspection de la qualité requise pour l'article {0}
+apps/erpnext/erpnext/controllers/stock_controller.py +320,Quality Inspection required for Item {0},Inspection de la Qualité requise pour l'Article {0}
 DocType: Quotation,Rate at which customer's currency is converted to company's base currency,Taux à laquelle la devise du client est converti en devise de base de la société
 DocType: Purchase Invoice Item,Net Rate (Company Currency),Taux Net (Devise Société)
 DocType: Salary Detail,Condition and Formula Help,Aide Condition et Formule
@@ -2734,7 +2734,7 @@
 DocType: Employee,You can enter any date manually,Vous pouvez entrer une date manuellement
 DocType: Asset Category Account,Depreciation Expense Account,Compte de Dotations aux Amortissement
 apps/erpnext/erpnext/setup/setup_wizard/install_fixtures.py +183,Probationary Period,Période De Probation
-DocType: Customer Group,Only leaf nodes are allowed in transaction,Seuls les noeuds feuilles sont autorisées dans une transaction
+DocType: Customer Group,Only leaf nodes are allowed in transaction,Seuls les noeuds feuilles sont autorisés dans une transaction
 DocType: Expense Claim,Expense Approver,Approbateur des Frais
 apps/erpnext/erpnext/accounts/doctype/journal_entry/journal_entry.py +124,Row {0}: Advance against Customer must be credit,Row {0}: Advance contre le Client doit être crédit
 apps/erpnext/erpnext/accounts/doctype/account/account.js +66,Non-Group to Group,Non-Groupe à groupe
@@ -2825,9 +2825,9 @@
 DocType: Asset,Expected Value After Useful Life,Valeur Attendue Après Utilisation Complète
 DocType: Item,Reorder level based on Warehouse,Niveau de réapprovisionnement basée sur Entrepôt
 DocType: Activity Cost,Billing Rate,Taux de Facturation
-,Qty to Deliver,Quantité à livrer
+,Qty to Deliver,Quantité à Livrer
 ,Stock Analytics,Analytics stock
-apps/erpnext/erpnext/manufacturing/doctype/bom/bom.py +435,Operations cannot be left blank,Les opérations peuvent ne pas être laissées vides
+apps/erpnext/erpnext/manufacturing/doctype/bom/bom.py +435,Operations cannot be left blank,Les opérations ne peuvent pas être laissées vides
 DocType: Maintenance Visit Purpose,Against Document Detail No,Pour le Détail du Document N°
 apps/erpnext/erpnext/accounts/doctype/payment_entry/payment_entry.py +79,Party Type is mandatory,Type de partie est obligatoire
 DocType: Quality Inspection,Outgoing,Sortant
@@ -2871,7 +2871,7 @@
 DocType: Student Guardian,Father,Père
 apps/erpnext/erpnext/controllers/accounts_controller.py +568,'Update Stock' cannot be checked for fixed asset sale,«Mise à jour du stock» ne peut être vérifié pour la vente d'actifs immobilisés
 DocType: Bank Reconciliation,Bank Reconciliation,Réconciliation Bancaire
-DocType: Attendance,On Leave,En congé
+DocType: Attendance,On Leave,En Congé
 apps/erpnext/erpnext/templates/includes/footer/footer_extension.html +7,Get Updates,Obtenir les Mises à jour
 apps/erpnext/erpnext/accounts/doctype/gl_entry/gl_entry.py +97,{0} {1}: Account {2} does not belong to Company {3},{0} {1}: compte {2} ne fait pas partie de la société {3}
 apps/erpnext/erpnext/buying/doctype/purchase_order/purchase_order.py +132,Material Request {0} is cancelled or stopped,Demande de Matériel {0} est annulé ou arrêté
@@ -2891,7 +2891,7 @@
 ,Stock Projected Qty,Quantité Stock projeté
 apps/erpnext/erpnext/accounts/doctype/sales_invoice/sales_invoice.py +390,Customer {0} does not belong to project {1},Le Client {0} ne fait pas parti du projet {1}
 DocType: Employee Attendance Tool,Marked Attendance HTML,Présence marquée HTML
-apps/erpnext/erpnext/utilities/activation.py +74,"Quotations are proposals, bids you have sent to your customers","Les citations sont des propositions, les offres que vous avez envoyé à vos clients"
+apps/erpnext/erpnext/utilities/activation.py +74,"Quotations are proposals, bids you have sent to your customers","Les devis sont des propositions, offres que vous avez envoyées à vos clients"
 DocType: Sales Order,Customer's Purchase Order,N° de Bon de Commande du Client
 apps/erpnext/erpnext/config/stock.py +112,Serial No and Batch,N ° de série et lot
 DocType: Warranty Claim,From Company,De la Société
@@ -2901,7 +2901,7 @@
 apps/erpnext/erpnext/stock/doctype/material_request/material_request.py +402,Productions Orders cannot be raised for:,Les Commandes de Fabrications ne peuvent pas être élevés pour:
 apps/erpnext/erpnext/public/js/setup_wizard.js +304,Minute,Minute
 DocType: Purchase Invoice,Purchase Taxes and Charges,Taxes et frais pour achats
-,Qty to Receive,Quantité à recevoir
+,Qty to Receive,Quantité à Recevoir
 DocType: Leave Block List,Leave Block List Allowed,Liste de Blocage des Congés Autorisée
 DocType: Grading Scale Interval,Grading Scale Interval,Intervalle de l'Échelle de Notation
 apps/erpnext/erpnext/hr/doctype/vehicle_log/vehicle_log.py +49,Expense Claim for Vehicle Log {0},Note de Frais pour Indémnité Kilométrique {0}
@@ -2911,7 +2911,7 @@
 apps/erpnext/erpnext/buying/page/purchase_analytics/purchase_analytics.js +128,All Supplier Types,Tous les Types de Fournisseurs
 DocType: Global Defaults,Disable In Words,"Désactiver ""En Lettres"""
 apps/erpnext/erpnext/stock/doctype/item/item.py +44,Item Code is mandatory because Item is not automatically numbered,Le code de l'article est obligatoire car l'article n'est pas numéroté automatiquement
-apps/erpnext/erpnext/selling/doctype/sales_order/sales_order.py +101,Quotation {0} not of type {1},La soumission {0} n'est pas du type {1}
+apps/erpnext/erpnext/selling/doctype/sales_order/sales_order.py +101,Quotation {0} not of type {1},Le devis {0} n'est pas du type {1}
 DocType: Maintenance Schedule Item,Maintenance Schedule Item,Article calendrier d&#39;entretien
 DocType: Sales Order,%  Delivered,Livré%
 DocType: Production Order,PRO-,PRO-
@@ -2922,7 +2922,7 @@
 DocType: Purchase Invoice,Edit Posting Date and Time,Modifier l&#39;affichage Date et heure
 apps/erpnext/erpnext/accounts/doctype/asset/depreciation.py +94,Please set Depreciation related Accounts in Asset Category {0} or Company {1},S&#39;il vous plaît mettre amortissement Comptes liés à Asset Catégorie {0} ou {1} Société
 DocType: Academic Term,Academic Year,Année Académique
-apps/erpnext/erpnext/accounts/doctype/account/chart_of_accounts/verified/standard_chart_of_accounts.py +167,Opening Balance Equity,Ouverture équité en matière d&#39;équilibre
+apps/erpnext/erpnext/accounts/doctype/account/chart_of_accounts/verified/standard_chart_of_accounts.py +167,Opening Balance Equity,Ouverture de la Balance des Capitaux Propres
 DocType: Lead,CRM,CRM
 DocType: Appraisal,Appraisal,Estimation
 apps/erpnext/erpnext/buying/doctype/request_for_quotation/request_for_quotation.py +137,Email sent to supplier {0},Email envoyé au fournisseur {0}
@@ -2995,9 +2995,9 @@
 apps/erpnext/erpnext/stock/doctype/item/item.js +39,Projected,Projeté
 apps/erpnext/erpnext/stock/doctype/serial_no/serial_no.py +218,Serial No {0} does not belong to Warehouse {1},No de série {0} ne fait pas partie de l’entrepôt {1}
 apps/erpnext/erpnext/controllers/status_updater.py +162,Note: System will not check over-delivery and over-booking for Item {0} as quantity or amount is 0,Remarque : Le système ne vérifie pas sur - livraison et la sur- réservation pour objet {0} que la quantité ou le montant est égal à 0
-DocType: Notification Control,Quotation Message,Message du devis
+DocType: Notification Control,Quotation Message,Message du Devis
 DocType: Employee Loan,Employee Loan Application,Demande de Prêt d'un Employé
-DocType: Issue,Opening Date,Date d&#39;ouverture
+DocType: Issue,Opening Date,Date d'Ouverture
 apps/erpnext/erpnext/schools/api.py +69,Attendance has been marked successfully.,La présence a été marquée avec succès.
 DocType: Journal Entry,Remark,Remarque
 DocType: Purchase Receipt Item,Rate and Amount,Taux et le montant
@@ -3022,7 +3022,7 @@
 apps/erpnext/erpnext/buying/doctype/purchase_order/purchase_order_dashboard.py +21,Sub-contracting,Sous-traitant
 DocType: Journal Entry Account,Journal Entry Account,Compte d’Écriture de Journal
 apps/erpnext/erpnext/schools/doctype/academic_year/academic_year.js +3,Student Group,Groupe étudiant
-DocType: Shopping Cart Settings,Quotation Series,Série soumission
+DocType: Shopping Cart Settings,Quotation Series,Séries de Devis
 apps/erpnext/erpnext/setup/doctype/item_group/item_group.py +58,"An item exists with same name ({0}), please change the item group name or rename the item","Un article existe avec le même nom ({0}), veuillez changer le nom du groupe d'article ou renommer l'article"
 apps/erpnext/erpnext/accounts/page/pos/pos.js +1868,Please select customer,S&#39;il vous plaît sélectionner client
 DocType: C-Form,I,I
@@ -3136,7 +3136,7 @@
 apps/erpnext/erpnext/hr/doctype/job_opening/job_opening.py +28,Current Job Openings,Offres d'Emploi Actuelles
 DocType: Company,Stock Adjustment Account,Compte d&#39;ajustement de stock
 DocType: Journal Entry,Write Off,Effacer
-DocType: Timesheet Detail,Operation ID,ID. de l'opération
+DocType: Timesheet Detail,Operation ID,ID de l'Opération
 DocType: Employee,"System User (login) ID. If set, it will become default for all HR forms.","L&#39;utilisateur du système (login) ID. S&#39;il est défini, il sera par défaut pour toutes les formes de ressources humaines."
 apps/erpnext/erpnext/support/doctype/warranty_claim/warranty_claim.py +16,{0}: From {1},{0}: De {1}
 DocType: Task,depends_on,Dépend de
@@ -3174,7 +3174,7 @@
 DocType: Training Event,Seminar,Séminaire
 DocType: Program Enrollment Fee,Program Enrollment Fee,Programme Frais d&#39;inscription
 DocType: Item,Supplier Items,Fournisseur Articles
-DocType: Opportunity,Opportunity Type,Type d&#39;opportunité
+DocType: Opportunity,Opportunity Type,Type d'Opportunité
 apps/erpnext/erpnext/accounts/doctype/cost_center/cost_center_tree.js +16,New Company,Nouvelle Société
 apps/erpnext/erpnext/setup/doctype/company/delete_company_transactions.py +17,Transactions can only be deleted by the creator of the Company,Transactions ne peuvent être supprimés que par le créateur de la Société
 apps/erpnext/erpnext/accounts/general_ledger.py +21,Incorrect number of General Ledger Entries found. You might have selected a wrong Account in the transaction.,Nombre incorrect de General Ledger Entrées trouvées. Vous avez peut-être choisi le bon compte dans la transaction.
@@ -3247,8 +3247,8 @@
 apps/erpnext/erpnext/setup/setup_wizard/industry_type.py +9,Airline,Compagnie Aérienne
 apps/erpnext/erpnext/stock/doctype/material_request/material_request.js +790,Issue Material,Problème matériel
 DocType: Material Request Item,For Warehouse,Pour l’Entrepôt
-DocType: Employee,Offer Date,Date de l'offre
-apps/erpnext/erpnext/selling/page/sales_funnel/sales_funnel.py +33,Quotations,Soumissions
+DocType: Employee,Offer Date,Date de la Proposition
+apps/erpnext/erpnext/selling/page/sales_funnel/sales_funnel.py +33,Quotations,Devis
 apps/erpnext/erpnext/accounts/page/pos/pos.js +665,You are in offline mode. You will not be able to reload until you have network.,Vous êtes en mode hors connexion. Vous ne serez pas en mesure de recharger jusqu&#39;à ce que vous avez réseau.
 apps/erpnext/erpnext/schools/doctype/student_group_creation_tool/student_group_creation_tool.py +31,No Student Groups created.,Aucun groupe d&#39;étudiants créés.
 DocType: Purchase Invoice Item,Serial No,N ° de série
@@ -3273,7 +3273,7 @@
 apps/erpnext/erpnext/config/selling.py +23,Customers,Clients
 DocType: Student Sibling,Institution,Institution
 DocType: Asset,Partially Depreciated,Partiellement dépréciées
-DocType: Issue,Opening Time,Horaire d'ouverture
+DocType: Issue,Opening Time,Horaire d'Ouverture
 apps/erpnext/erpnext/stock/report/itemwise_recommended_reorder_level/itemwise_recommended_reorder_level.py +92,From and To dates required,Les date Du et Au sont requises
 apps/erpnext/erpnext/setup/setup_wizard/industry_type.py +46,Securities & Commodity Exchanges,Valeurs mobilières et des bourses de marchandises
 apps/erpnext/erpnext/stock/doctype/item/item.py +642,Default Unit of Measure for Variant '{0}' must be same as in Template '{1}',L’Unité de mesure par défaut pour la variante '{0}' doit être la même que dans le Modèle '{1}'
@@ -3306,7 +3306,7 @@
 apps/erpnext/erpnext/setup/doctype/territory/territory.py +19,Either target qty or target amount is mandatory,Soit la qté cible soit le montant cible est obligatoire
 apps/erpnext/erpnext/stock/get_item_details.py +501,No default BOM exists for Item {0},Pas de nomenclature par défaut existe pour l'article {0}
 apps/erpnext/erpnext/accounts/doctype/journal_entry/journal_entry.js +334,Please select Posting Date first,S&#39;il vous plaît sélectionnez Date de publication abord
-apps/erpnext/erpnext/public/js/account_tree_grid.js +211,Opening Date should be before Closing Date,Date d&#39;ouverture devrait être avant la date de clôture
+apps/erpnext/erpnext/public/js/account_tree_grid.js +211,Opening Date should be before Closing Date,Date d'Ouverture devrait être antérieure à la Date de Clôture
 DocType: Leave Control Panel,Carry Forward,Reporter
 apps/erpnext/erpnext/accounts/doctype/cost_center/cost_center.py +30,Cost Center with existing transactions can not be converted to ledger,Un Centre de Coûts avec des transactions existantes ne peut pas être converti en grand livre
 DocType: Department,Days for which Holidays are blocked for this department.,Jours pour lesquels les Vacances sont bloquées pour ce département.
@@ -3361,7 +3361,7 @@
 DocType: Job Opening,Job Title,Titre de l'Emploi
 apps/erpnext/erpnext/utilities/activation.py +100,Create Users,Créer des Utilisateurs
 apps/erpnext/erpnext/public/js/setup_wizard.js +304,Gram,Gramme
-apps/erpnext/erpnext/manufacturing/doctype/production_order/production_order.py +393,Quantity to Manufacture must be greater than 0.,Quantité à fabriquer doit être supérieur à 0.
+apps/erpnext/erpnext/manufacturing/doctype/production_order/production_order.py +393,Quantity to Manufacture must be greater than 0.,Quantité à Fabriquer doit être supérieur à 0.
 apps/erpnext/erpnext/config/maintenance.py +17,Visit report for maintenance call.,Rapport de visite pour l'appel de maintenance
 DocType: Stock Entry,Update Rate and Availability,Mettre à jour prix et disponibilité
 DocType: Stock Settings,Percentage you are allowed to receive or deliver more against the quantity ordered. For example: If you have ordered 100 units. and your Allowance is 10% then you are allowed to receive 110 units.,Pourcentage que vous êtes autorisé à recevoir ou de livrer plus sur la quantité commandée. Par exemple: Si vous avez commandé 100 unités. et votre allocation est de 10% alors que vous êtes autorisé à recevoir 110 unités.
@@ -3375,7 +3375,7 @@
 apps/erpnext/erpnext/buying/doctype/purchase_order/purchase_order.js +795,Receipt,Quittance
 ,Sales Register,Registre des ventes
 DocType: Daily Work Summary Settings Company,Send Emails At,Envoyer Emails A
-DocType: Quotation,Quotation Lost Reason,Perdu la raison de la Soumission
+DocType: Quotation,Quotation Lost Reason,Raison de la Perte du Devis
 apps/erpnext/erpnext/public/js/setup_wizard.js +14,Select your Domain,Sélectionnez votre domaine
 apps/erpnext/erpnext/accounts/doctype/payment_entry/payment_entry.py +340,Transaction reference no {0} dated {1},Référence de la transaction ne {0} daté {1}
 apps/erpnext/erpnext/setup/doctype/supplier_type/supplier_type.js +5,There is nothing to edit.,Il n'y a rien à modifier.
@@ -3414,7 +3414,7 @@
 DocType: Supplier Quotation,Supplier Address,Adresse du fournisseur
 apps/erpnext/erpnext/accounts/doctype/budget/budget.py +128,{0} Budget for Account {1} against {2} {3} is {4}. It will exceed by {5},{0} Le budget du compte {1} contre {2} {3} est {4}. Il dépassera de {5}
 apps/erpnext/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py +665,Row {0}# Account must be of type 'Fixed Asset',Row {0} # Le compte doit être de type &#39;Asset fixe&#39;
-apps/erpnext/erpnext/stock/report/batch_wise_balance_history/batch_wise_balance_history.py +36,Out Qty,out Quantité
+apps/erpnext/erpnext/stock/report/batch_wise_balance_history/batch_wise_balance_history.py +36,Out Qty,Qté Sortante
 apps/erpnext/erpnext/config/accounts.py +278,Rules to calculate shipping amount for a sale,Règles de calcul du montant de l&#39;expédition pour une vente
 apps/erpnext/erpnext/selling/doctype/customer/customer.py +51,Series is mandatory,Série est obligatoire
 apps/erpnext/erpnext/setup/setup_wizard/industry_type.py +28,Financial Services,Services Financiers
@@ -3473,7 +3473,7 @@
 apps/erpnext/erpnext/controllers/item_variant.py +216,Invalid attribute {0} {1},attribut non valide {0} {1}
 apps/erpnext/erpnext/schools/doctype/assessment_plan/assessment_plan.py +13,Please select Student Group or Student Batch,S&#39;il vous plaît sélectionner Groupe étudiant ou lot étudiant
 DocType: Salary Slip,Earning & Deduction,Revenus et Déduction
-apps/erpnext/erpnext/accounts/doctype/account/account_tree.js +36,Optional. This setting will be used to filter in various transactions.,Facultatif. Ce paramètre sera utilisé pour filtrer différentes écritures.
+apps/erpnext/erpnext/accounts/doctype/account/account_tree.js +36,Optional. This setting will be used to filter in various transactions.,Facultatif. Ce paramètre sera utilisé pour filtrer différentes transactions.
 apps/erpnext/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py +108,Negative Valuation Rate is not allowed,Négatif évaluation Taux n'est pas autorisé
 DocType: Holiday List,Weekly Off,Hebdomadaire Off
 DocType: Fiscal Year,"For e.g. 2012, 2012-13","Par exemple: 2012, 2012-13"
@@ -3515,7 +3515,7 @@
 DocType: Shipping Rule,Specify conditions to calculate shipping amount,Préciser les conditions pour calculer le montant de l'expédition
 DocType: Accounts Settings,Role Allowed to Set Frozen Accounts & Edit Frozen Entries,Rôle autorisés à geler des comptes et modifier le contenu
 apps/erpnext/erpnext/accounts/doctype/cost_center/cost_center.py +28,Cannot convert Cost Center to ledger as it has child nodes,Conversion impossible du Centre de Coûts en livre car il possède des nœuds enfants
-apps/erpnext/erpnext/stock/report/stock_balance/stock_balance.py +47,Opening Value,Valeur d&#39;ouverture
+apps/erpnext/erpnext/stock/report/stock_balance/stock_balance.py +47,Opening Value,Valeur d'Ouverture
 DocType: Salary Detail,Formula,Formule
 apps/erpnext/erpnext/stock/report/stock_ledger/stock_ledger.py +37,Serial #,# Série
 apps/erpnext/erpnext/accounts/doctype/account/chart_of_accounts/verified/standard_chart_of_accounts.py +92,Commission on Sales,Commission sur les Ventes
@@ -3526,7 +3526,7 @@
 apps/erpnext/erpnext/accounts/general_ledger.py +132,Debit and Credit not equal for {0} #{1}. Difference is {2}.,Débit et Crédit non égaux pour {0} # {1}. La différence est de {2}.
 apps/erpnext/erpnext/accounts/doctype/account/chart_of_accounts/verified/standard_chart_of_accounts.py +96,Entertainment Expenses,Frais de Représentation
 apps/erpnext/erpnext/stock/doctype/stock_entry/stock_entry.js +47,Make Material Request,Effectuer une demande de matériel
-apps/erpnext/erpnext/manufacturing/doctype/bom/bom_item_preview.html +19,Open Item {0},Article ouvert {0}
+apps/erpnext/erpnext/manufacturing/doctype/bom/bom_item_preview.html +19,Open Item {0},Ouvrir l'Article {0}
 apps/erpnext/erpnext/selling/doctype/sales_order/sales_order.py +205,Sales Invoice {0} must be cancelled before cancelling this Sales Order,Facture de vente {0} doit être annulé avant l'annulation de cette commande client
 apps/erpnext/erpnext/accounts/report/payment_period_based_on_invoice_date/payment_period_based_on_invoice_date.py +60,Age,Âge
 DocType: Sales Invoice Timesheet,Billing Amount,Montant de Facturation
@@ -3541,7 +3541,7 @@
 DocType: Sales Partner,Logo,Logo
 DocType: Naming Series,Check this if you want to force the user to select a series before saving. There will be no default if you check this.,Cochez cette case si vous voulez forcer l'utilisateur à sélectionner une série avant de l'enregistrer. Il n'y aura pas de série par défaut si vous cochez cette case.
 apps/erpnext/erpnext/stock/get_item_details.py +116,No Item with Serial No {0},Aucun Item avec le Numéro de Série {0}
-DocType: Email Digest,Open Notifications,Notifications ouvertes
+DocType: Email Digest,Open Notifications,Ouvrir les Notifications
 DocType: Payment Entry,Difference Amount (Company Currency),Écart de Montant (Devise de la Société)
 apps/erpnext/erpnext/accounts/doctype/account/chart_of_accounts/verified/standard_chart_of_accounts.py +77,Direct Expenses,Dépenses Directes
 apps/erpnext/erpnext/controllers/recurring_document.py +213,"{0} is an invalid email address in 'Notification \
@@ -3602,7 +3602,7 @@
 apps/erpnext/erpnext/setup/doctype/company/company.py +45,Abbreviation is mandatory,Abréviation est obligatoire
 DocType: Project,Task Progress,progression de la tâche
 ,Qty to Transfer,Qté à Transférer
-apps/erpnext/erpnext/config/selling.py +13,Quotes to Leads or Customers.,Devis à Prospects ou Clients.
+apps/erpnext/erpnext/config/selling.py +13,Quotes to Leads or Customers.,Devis de Prospects ou Clients.
 DocType: Stock Settings,Role Allowed to edit frozen stock,Rôle autorisés à modifier stock gelé
 ,Territory Target Variance Item Group-Wise,Variance de région cible selon le groupe d'article
 apps/erpnext/erpnext/setup/setup_wizard/install_fixtures.py +105,All Customer Groups,Tous les Groupes Client
@@ -3635,7 +3635,7 @@
 apps/erpnext/erpnext/stock/doctype/item/item.py +449,Barcode {0} already used in Item {1},Le Code Barre {0} est déjà utilisé dans l'article {1}
 DocType: Lead,Add to calendar on this date,Ajouter cette date au calendrier
 apps/erpnext/erpnext/config/selling.py +86,Rules for adding shipping costs.,Règles pour l'ajout de frais de port.
-DocType: Item,Opening Stock,Stock d&#39;ouverture
+DocType: Item,Opening Stock,Stock d'Ouverture
 apps/erpnext/erpnext/support/doctype/warranty_claim/warranty_claim.py +20,Customer is required,Client est requis
 apps/erpnext/erpnext/controllers/sales_and_purchase_return.py +20,{0} is mandatory for Return,{0} est obligatoire pour le retour
 DocType: Purchase Order,To Receive,A Recevoir
@@ -3649,14 +3649,14 @@
 Updated via 'Time Log'","Mise à jour en quelques minutes 
  via 'Log Time'"
 DocType: Customer,From Lead,Du Prospect
-apps/erpnext/erpnext/config/manufacturing.py +13,Orders released for production.,Commandes validé pour la production.
+apps/erpnext/erpnext/config/manufacturing.py +13,Orders released for production.,Commandes validées pour la production.
 apps/erpnext/erpnext/public/js/account_tree_grid.js +67,Select Fiscal Year...,Sélectionnez Exercice ...
 apps/erpnext/erpnext/accounts/doctype/sales_invoice/sales_invoice.py +512,POS Profile required to make POS Entry,Profil PDV nécessaire pour faire une entrée PDV
 DocType: Program Enrollment Tool,Enroll Students,Inscrire des Étudiants
 DocType: Hub Settings,Name Token,Nom du jeton
 apps/erpnext/erpnext/patches/v4_0/create_price_list_if_missing.py +21,Standard Selling,Vente standard
 apps/erpnext/erpnext/stock/doctype/stock_entry/stock_entry.py +129,Atleast one warehouse is mandatory,Au moins un entrepôt est obligatoire
-DocType: Serial No,Out of Warranty,Hors garantie
+DocType: Serial No,Out of Warranty,Hors Garantie
 DocType: BOM Replace Tool,Replace,Remplacer
 DocType: Production Order,Unstopped,débouchées
 apps/erpnext/erpnext/accounts/doctype/journal_entry/journal_entry.py +348,{0} against Sales Invoice {1},{0} contre la facture de vente {1}
@@ -3677,9 +3677,9 @@
 apps/erpnext/erpnext/accounts/doctype/account/chart_of_accounts/verified/standard_chart_of_accounts.py +44,Electronic Equipments,Equipements Électroniques
 DocType: Account,Debit,Débit
 apps/erpnext/erpnext/hr/doctype/leave_allocation/leave_allocation.py +49,Leaves must be allocated in multiples of 0.5,"Les Congés doivent être alloués par multiples de 0,5"
-DocType: Production Order,Operation Cost,Coût de l'opération
+DocType: Production Order,Operation Cost,Coût de l'Opération
 apps/erpnext/erpnext/config/hr.py +29,Upload attendance from a .csv file,Télécharger les participations à partir d'un fichier .csv
-apps/erpnext/erpnext/selling/report/customer_credit_balance/customer_credit_balance.py +39,Outstanding Amt,Exceptionnelle Amt
+apps/erpnext/erpnext/selling/report/customer_credit_balance/customer_credit_balance.py +39,Outstanding Amt,Montant en suspens
 DocType: Sales Person,Set targets Item Group-wise for this Sales Person.,Fixer des objectifs élément de groupe-sage pour cette personne des ventes.
 DocType: Stock Settings,Freeze Stocks Older Than [Days],Geler les Articles plus Anciens que [Jours]
 apps/erpnext/erpnext/controllers/accounts_controller.py +541,Row #{0}: Asset is mandatory for fixed asset purchase/sale,Row # {0}: Asset est obligatoire pour les immobilisations achat / vente
@@ -3734,7 +3734,7 @@
 DocType: Student Group Creation Tool,Get Courses,Obtenir les Cours
 DocType: GL Entry,Party,Intervenants
 DocType: Sales Order,Delivery Date,Date de Livraison
-DocType: Opportunity,Opportunity Date,Date de possibilité
+DocType: Opportunity,Opportunity Date,Date d'Opportunité
 DocType: Purchase Receipt,Return Against Purchase Receipt,Retour contre Reçu d&#39;achat
 DocType: Request for Quotation Item,Request for Quotation Item,Article de L'Appel d'offre
 DocType: Purchase Order,To Bill,A facturer
@@ -3811,7 +3811,7 @@
 DocType: BOM Scrap Item,BOM Scrap Item,Article Mis au Rebut LDM
 apps/erpnext/erpnext/accounts/page/pos/pos.js +845,Submitted orders can not be deleted,commandes passées ne peuvent pas être supprimés
 apps/erpnext/erpnext/accounts/doctype/account/account.py +118,"Account balance already in Debit, you are not allowed to set 'Balance Must Be' as 'Credit'","Le solde du compte est déjà débiteur, vous n'êtes pas autorisé à définir 'Solde Doit Être' comme 'Créditeur'"
-apps/erpnext/erpnext/setup/setup_wizard/install_fixtures.py +80,Quality Management,Gestion de la qualité
+apps/erpnext/erpnext/setup/setup_wizard/install_fixtures.py +80,Quality Management,Gestion de la Qualité
 apps/erpnext/erpnext/accounts/doctype/asset/asset.py +40,Item {0} has been disabled,L'article {0} a été désactivé
 DocType: Employee Loan,Repay Fixed Amount per Period,Rembourser montant fixe par période
 apps/erpnext/erpnext/buying/doctype/purchase_common/purchase_common.py +47,Please enter quantity for Item {0},S'il vous plaît entrer la qté de l'article {0}
@@ -3878,7 +3878,7 @@
 DocType: Company,Distribution,Distribution
 apps/erpnext/erpnext/schools/doctype/fees/fees.js +27,Amount Paid,Montant Payé
 apps/erpnext/erpnext/setup/setup_wizard/install_fixtures.py +95,Project Manager,Chef de projet
-,Quoted Item Comparison,Comparaison d'article soumissionné
+,Quoted Item Comparison,Comparaison d'Article Soumis
 apps/erpnext/erpnext/setup/setup_wizard/install_fixtures.py +76,Dispatch,Envoi
 apps/erpnext/erpnext/accounts/doctype/pricing_rule/pricing_rule.py +71,Max discount allowed for item: {0} is {1}%,Réduction maximum autorisée pour l'article: {0} est de {1} %
 apps/erpnext/erpnext/accounts/report/asset_depreciations_and_balances/asset_depreciations_and_balances.py +173,Net Asset value as on,La valeur nette d&#39;inventaire que sur
@@ -3898,7 +3898,7 @@
 apps/erpnext/erpnext/buying/doctype/supplier_quotation/supplier_quotation_list.js +5,Ordered,Commandé
 DocType: Salary Detail,Component,Composant
 DocType: Assessment Criteria,Assessment Criteria Group,Groupe de Critère d'Évaluation
-apps/erpnext/erpnext/accounts/doctype/asset/asset.py +71,Opening Accumulated Depreciation must be less than equal to {0},Ouverture Amortissement cumulé doit être inférieur ou égal à {0}
+apps/erpnext/erpnext/accounts/doctype/asset/asset.py +71,Opening Accumulated Depreciation must be less than equal to {0},Amortissement Cumulé d'Ouverture doit être inférieur ou égal à {0}
 DocType: Warehouse,Warehouse Name,Nom de l'entrepôt
 DocType: Naming Series,Select Transaction,Sélectionner Transaction
 apps/erpnext/erpnext/setup/doctype/authorization_rule/authorization_rule.py +30,Please enter Approving Role or Approving User,S'il vous plaît entrer approuver ou approuver Rôle utilisateur
@@ -4005,7 +4005,7 @@
 DocType: Salary Detail,Default Amount,Montant par Défaut
 apps/erpnext/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py +93,Warehouse not found in the system,Entrepôt pas trouvé dans le système
 apps/erpnext/erpnext/setup/doctype/email_digest/email_digest.py +116,This Month's Summary,Résumé de ce mois-ci
-DocType: Quality Inspection Reading,Quality Inspection Reading,Libellé du contrôle de qualité
+DocType: Quality Inspection Reading,Quality Inspection Reading,Libellé du Contrôle de Qualité
 apps/erpnext/erpnext/stock/doctype/stock_settings/stock_settings.py +24,`Freeze Stocks Older Than` should be smaller than %d days.,`Figer les stocks datant de plus` doit être inférieur que %d jours.
 DocType: Tax Rule,Purchase Tax Template,Modèle de taxes pour achats
 ,Project wise Stock Tracking,Projet sage Stock Tracking
@@ -4022,11 +4022,11 @@
 apps/erpnext/erpnext/public/js/stock_analytics.js +58,Select Brand...,Sélectionnez une marque ...
 apps/erpnext/erpnext/accounts/report/asset_depreciations_and_balances/asset_depreciations_and_balances.py +149,Accumulated Depreciation as on,Amortissement Cumulé depuis
 DocType: Sales Invoice,C-Form Applicable,Formulaire-C Applicable
-apps/erpnext/erpnext/manufacturing/doctype/production_order/production_order.py +398,Operation Time must be greater than 0 for Operation {0},Temps de fonctionnement doit être supérieure à 0 pour l&#39;opération {0}
+apps/erpnext/erpnext/manufacturing/doctype/production_order/production_order.py +398,Operation Time must be greater than 0 for Operation {0},Temps de l'Opération doit être supérieur à 0 pour l'Opération {0}
 apps/erpnext/erpnext/controllers/sales_and_purchase_return.py +100,Warehouse is mandatory,Entrepôt est obligatoire
 DocType: Supplier,Address and Contacts,Adresse et Contacts
 DocType: UOM Conversion Detail,UOM Conversion Detail,Détail de conversion Unité de mesure
-apps/erpnext/erpnext/public/js/setup_wizard.js +172,Keep it web friendly 900px (w) by 100px (h),"Merci de conserver le format de l'image web convivial , ex.. 900px par 100px"
+apps/erpnext/erpnext/public/js/setup_wizard.js +172,Keep it web friendly 900px (w) by 100px (h),Garder le compatible avec le web 900px par 100px
 DocType: Program,Program Abbreviation,Abréviation du programme
 apps/erpnext/erpnext/manufacturing/doctype/production_order/production_order.py +386,Production Order cannot be raised against a Item Template,Ordre de production ne peut être soulevée contre un modèle d&#39;objet
 apps/erpnext/erpnext/stock/doctype/landed_cost_voucher/landed_cost_voucher.js +51,Charges are updated in Purchase Receipt against each item,Les frais sont mis à jour dans le Reçu d'Achat pour chaque article
@@ -4047,11 +4047,11 @@
 DocType: SMS Settings,Eg. smsgateway.com/api/send_sms.cgi,Eg. smsgateway.com / api / send_sms.cgi
 apps/erpnext/erpnext/accounts/doctype/payment_request/payment_request.py +28,Transaction currency must be same as Payment Gateway currency,Devise de la transaction doit être la même que la monnaie paiement passerelle
 DocType: Payment Entry,Receive,Recevoir
-apps/erpnext/erpnext/templates/pages/rfq.html +75,Quotations: ,Soumission:
+apps/erpnext/erpnext/templates/pages/rfq.html +75,Quotations: ,Devis :
 DocType: Maintenance Visit,Fully Completed,Entièrement Complété
 apps/erpnext/erpnext/projects/doctype/project/project_list.js +6,{0}% Complete,{0}% complète
 DocType: Employee,Educational Qualification,Qualification pour l'Éducation
-DocType: Workstation,Operating Costs,Coûts d'exploitation
+DocType: Workstation,Operating Costs,Coûts d'Exploitation
 DocType: Budget,Action if Accumulated Monthly Budget Exceeded,Action si le Budget Mensuel Cumulé est Dépassé
 DocType: Purchase Invoice,Submit on creation,Soumettre sur la création
 apps/erpnext/erpnext/accounts/doctype/payment_entry/payment_entry.py +442,Currency for {0} must be {1},Devise pour {0} doit être {1}
@@ -4076,7 +4076,7 @@
 apps/erpnext/erpnext/hr/doctype/daily_work_summary/daily_work_summary.py +31,Daily Work Summary for {0},Récapitulatif Quotidien de Travail pour {0}
 DocType: Employee Loan,Totals,Totaux
 DocType: BOM,Manufacturing,Fabrication
-,Ordered Items To Be Delivered,Articles commandés à livrer
+,Ordered Items To Be Delivered,Articles Commandés à Livrer
 DocType: Account,Income,Revenu
 DocType: Industry Type,Industry Type,Secteur d&#39;activité
 apps/erpnext/erpnext/templates/includes/cart.js +149,Something went wrong!,Quelque chose a mal tourné !
@@ -4090,7 +4090,7 @@
 DocType: Fee Structure,Student Category,étudiant Catégorie
 apps/erpnext/erpnext/schools/doctype/program_enrollment_tool/program_enrollment_tool.py +14,Mandatory feild - Get Students From,feild obligatoire - Obtenir des étudiants de
 DocType: Announcement,Student,Élève
-apps/erpnext/erpnext/config/hr.py +229,Organization unit (department) master.,Unité d'organisation (département) maître .
+apps/erpnext/erpnext/config/hr.py +229,Organization unit (department) master.,Base d'unité d'organisation (département).
 apps/erpnext/erpnext/setup/doctype/sms_settings/sms_settings.py +26,Please enter valid mobile nos,S'il vous plaît entrez No mobiles valides
 apps/erpnext/erpnext/selling/doctype/sms_center/sms_center.py +75,Please enter message before sending,S'il vous plaît entrer le message avant d'envoyer
 DocType: Email Digest,Pending Quotations,Soumissions en attente
@@ -4166,7 +4166,7 @@
 apps/erpnext/erpnext/accounts/doctype/period_closing_voucher/period_closing_voucher.py +27,Closing Account {0} must be of type Liability / Equity,Le Compte Clôturé {0} doit être de type Passif / Capitaux Propres
 apps/erpnext/erpnext/hr/doctype/salary_slip/salary_slip.py +320,Salary Slip of employee {0} already created for time sheet {1},Slip de salaire de l&#39;employé {0} déjà créé pour la feuille de temps {1}
 DocType: Vehicle Log,Odometer,Odomètre
-DocType: Sales Order Item,Ordered Qty,Quantité commandée
+DocType: Sales Order Item,Ordered Qty,Qté Commandée
 apps/erpnext/erpnext/stock/doctype/item/item.py +694,Item {0} is disabled,Article {0} est désactivé
 DocType: Stock Settings,Stock Frozen Upto,Stock gelé jusqu'au
 apps/erpnext/erpnext/stock/doctype/material_request/material_request.js +876,BOM does not contain any stock item,LDM ne contient aucun article en stock
@@ -4186,7 +4186,7 @@
 apps/erpnext/erpnext/public/js/queries.js +39,Please set {0},S'il vous plaît définir {0}
 DocType: Purchase Invoice,Repeat on Day of Month,Répétez le Jour du Mois
 DocType: Employee,Health Details,Détails de Santé
-DocType: Offer Letter,Offer Letter Terms,Offrez Conditions Lettre
+DocType: Offer Letter,Offer Letter Terms,Termes de la Lettre de Proposition
 DocType: Payment Entry,Allocate Payment Amount,Allouer le Montant du Paiement
 DocType: Employee External Work History,Salary,Salaire
 DocType: Serial No,Delivery Document Type,Type de Document de Livraison
@@ -4225,7 +4225,7 @@
 apps/erpnext/erpnext/setup/setup_wizard/install_fixtures.py +77,Customer Service,Service Client
 DocType: BOM,Thumbnail,Vignette
 DocType: Item Customer Detail,Item Customer Detail,Détail de l'article client
-apps/erpnext/erpnext/config/hr.py +50,Offer candidate a Job.,Offrir un Emploi au Candidat
+apps/erpnext/erpnext/config/hr.py +50,Offer candidate a Job.,Proposer un Emploi au candidat
 DocType: Notification Control,Prompt for Email on Submission of,Prompt for Email relative à la présentation des
 apps/erpnext/erpnext/hr/doctype/leave_allocation/leave_allocation.py +88,Total allocated leaves are more than days in the period,Nombre de feuilles alloués sont plus de jours de la période
 DocType: Pricing Rule,Percentage,Pourcentage
@@ -4297,7 +4297,7 @@
 apps/erpnext/erpnext/config/selling.py +67,Price List master.,Liste de prix principale.
 DocType: Task,Review Date,Date de révision
 DocType: Purchase Invoice,Advance Payments,Paiements Anticipés
-DocType: Purchase Taxes and Charges,On Net Total,Sur le total Net
+DocType: Purchase Taxes and Charges,On Net Total,Sur le Total Net
 apps/erpnext/erpnext/controllers/item_variant.py +92,Value for Attribute {0} must be within the range of {1} to {2} in the increments of {3} for Item {4},Valeur pour l&#39;attribut {0} doit être dans la gamme de {1} à {2} dans les incréments de {3} pour le poste {4}
 apps/erpnext/erpnext/stock/doctype/stock_entry/stock_entry.py +152,Target warehouse in row {0} must be same as Production Order,Entrepôt cible à la ligne {0} doit être le même que l'ordre de fabrication
 apps/erpnext/erpnext/controllers/recurring_document.py +217,'Notification Email Addresses' not specified for recurring %s,«notification adresse e-mail non spécifiés pour% s récurrents
@@ -4417,7 +4417,7 @@
 DocType: Employee,Education,Education
 DocType: Selling Settings,Campaign Naming By,Campagne Nommée Par
 DocType: Employee,Current Address Is,L'Adresse Actuelle est
-apps/erpnext/erpnext/accounts/doctype/account/account_tree.js +51,"Optional. Sets company's default currency, if not specified.",Optionnel. La devise par défaut de la société sera définie si le champ est laissé vide.
+apps/erpnext/erpnext/accounts/doctype/account/account_tree.js +51,"Optional. Sets company's default currency, if not specified.","Optionnel. Défini la devise par défaut de l'entreprise, si non spécifié."
 apps/erpnext/erpnext/config/accounts.py +61,Accounting journal entries.,Les écritures comptables.
 DocType: Delivery Note Item,Available Qty at From Warehouse,Qté Disponible Depuis l'Entrepôt
 apps/erpnext/erpnext/hr/doctype/leave_application/leave_application.py +295,Please select Employee Record first.,S&#39;il vous plaît sélectionnez dossier de l&#39;employé en premier.
@@ -4458,7 +4458,7 @@
 ,Monthly Salary Register,Registre mensuel des salaires
 DocType: Warranty Claim,If different than customer address,Si différente de l'adresse du client
 DocType: BOM Operation,BOM Operation,Opération LDM
-DocType: Purchase Taxes and Charges,On Previous Row Amount,Le montant rangée précédente
+DocType: Purchase Taxes and Charges,On Previous Row Amount,Le Montant de la Rangée Précédente
 DocType: Student,Home Address,Adresse du Domicile
 apps/erpnext/erpnext/accounts/doctype/asset/asset.js +260,Transfer Asset,Transfert d&#39;actifs
 DocType: POS Profile,POS Profile,Profil PDV
@@ -4557,7 +4557,7 @@
 apps/erpnext/erpnext/accounts/doctype/journal_entry/journal_entry.py +91,Row {0}: Party Type and Party is required for Receivable / Payable account {1},Row {0}: Type et le Parti est nécessaire pour recevoir / payer compte {1}
 apps/erpnext/erpnext/accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.py +94,Ref Date,Réf. date
 DocType: Employee,Reason for Leaving,Raison du départ
-DocType: BOM Operation,Operating Cost(Company Currency),Coût d&#39;exploitation (Société Monnaie)
+DocType: BOM Operation,Operating Cost(Company Currency),Coût d'Exploitation (Devise Société)
 DocType: Employee Loan Application,Rate of Interest,Taux d&#39;intérêt
 DocType: Expense Claim Detail,Sanctioned Amount,Montant approuvé
 DocType: GL Entry,Is Opening,Est l&#39;ouverture
diff --git a/erpnext/translations/hr.csv b/erpnext/translations/hr.csv
index e391c36..ba84c4e 100644
--- a/erpnext/translations/hr.csv
+++ b/erpnext/translations/hr.csv
@@ -639,7 +639,7 @@
 apps/erpnext/erpnext/config/setup.py +101,Automatically triggers the feedback request based on conditions.,Automatski aktivira se zahtjev povratne informacije na temelju uvjeta.
 DocType: Employee,Reason for Resignation,Razlog za ostavku
 apps/erpnext/erpnext/config/hr.py +147,Template for performance appraisals.,Predložak za ocjene rada .
-DocType: Sales Invoice,Credit Note Issued,Kreditne Napomena Izdano
+DocType: Sales Invoice,Credit Note Issued,Odobrenje kupcu izdano
 DocType: Project Task,Weight,Težina
 DocType: Payment Reconciliation,Invoice/Journal Entry Details,Račun / Temeljnica Detalji
 apps/erpnext/erpnext/accounts/utils.py +84,{0} '{1}' not in Fiscal Year {2},{0} '{1}' nije u fiskalnoj godini {2}
@@ -2396,7 +2396,7 @@
 DocType: Global Defaults,Hide Currency Symbol,Sakrij simbol valute
 apps/erpnext/erpnext/config/accounts.py +289,"e.g. Bank, Cash, Credit Card","npr. banka, gotovina, kreditne kartice"
 DocType: Lead Source,Source Name,source Name
-DocType: Journal Entry,Credit Note,Kreditne Napomena
+DocType: Journal Entry,Credit Note,Odobrenje kupcu
 DocType: Warranty Claim,Service Address,Usluga Adresa
 apps/erpnext/erpnext/accounts/doctype/account/chart_of_accounts/verified/standard_chart_of_accounts.py +47,Furnitures and Fixtures,Namještaja i rasvjete
 DocType: Item,Manufacture,Proizvodnja
@@ -3559,7 +3559,7 @@
 apps/erpnext/erpnext/setup/setup_wizard/install_fixtures.py +62,Probation,Probni rad
 apps/erpnext/erpnext/config/hr.py +115,Salary Components,Plaća Komponente
 DocType: Program Enrollment Tool,New Academic Year,Nova akademska godina
-apps/erpnext/erpnext/accounts/doctype/sales_invoice/sales_invoice.js +769,Return / Credit Note,Povratak / kreditne Napomena
+apps/erpnext/erpnext/accounts/doctype/sales_invoice/sales_invoice.js +769,Return / Credit Note,Povrat / odobrenje kupcu
 DocType: Stock Settings,Auto insert Price List rate if missing,"Ako ne postoji, automatski ubaciti cjenik"
 apps/erpnext/erpnext/accounts/report/accounts_receivable/accounts_receivable.html +25,Total Paid Amount,Ukupno uplaćeni iznos
 DocType: Production Order Item,Transferred Qty,prebačen Kol
diff --git a/erpnext/translations/it.csv b/erpnext/translations/it.csv
index 5b8cb2a..0406c92 100644
--- a/erpnext/translations/it.csv
+++ b/erpnext/translations/it.csv
@@ -163,7 +163,7 @@
 DocType: Employee Loan,Repay Over Number of Periods,Rimborsare corso Numero di periodi
 DocType: Stock Entry,Additional Costs,Costi aggiuntivi
 apps/erpnext/erpnext/accounts/doctype/account/account.py +142,Account with existing transaction can not be converted to group.,Account con transazioni registrate non può essere convertito a gruppo.
-DocType: Lead,Product Enquiry,Prodotto Inchiesta
+DocType: Lead,Product Enquiry,Richiesta di informazioni sui prodotti
 DocType: Academic Term,Schools,scuole
 apps/erpnext/erpnext/hr/doctype/attendance/attendance.py +35,No leave record found for employee {0} for {1},Nessun record congedo trovato per dipendente {0} per {1}
 apps/erpnext/erpnext/stock/doctype/landed_cost_voucher/landed_cost_voucher.js +23,Please enter company first,Inserisci prima azienda
@@ -242,7 +242,7 @@
 apps/erpnext/erpnext/config/selling.py +91,Rules for applying pricing and discount.,Le modalità di applicazione di prezzi e sconti .
 apps/erpnext/erpnext/stock/doctype/price_list/price_list.py +14,Price List must be applicable for Buying or Selling,Prezzo di listino deve essere applicabile per l'acquisto o la vendita di
 apps/erpnext/erpnext/selling/doctype/installation_note/installation_note.py +79,Installation date cannot be before delivery date for Item {0},Data di installazione non può essere prima della data di consegna per la voce {0}
-DocType: Pricing Rule,Discount on Price List Rate (%),Sconto Listino Tasso (%)
+DocType: Pricing Rule,Discount on Price List Rate (%),Sconto su Prezzo di Listino (%)
 DocType: Offer Letter,Select Terms and Conditions,Selezionare i Termini e Condizioni
 apps/erpnext/erpnext/stock/report/stock_balance/stock_balance.py +51,Out Value,Valore out
 DocType: Production Planning Tool,Sales Orders,Ordini di vendita
@@ -1063,7 +1063,7 @@
 DocType: Packing Slip Item,Packing Slip Item,Distinta di imballaggio articolo
 DocType: Purchase Invoice,Cash/Bank Account,Conto Cassa/Banca
 apps/erpnext/erpnext/public/js/queries.js +88,Please specify a {0},Si prega di specificare un {0}
-apps/erpnext/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py +71,Removed items with no change in quantity or value.,Elementi rimossi senza variazione di quantità o valore.
+apps/erpnext/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py +71,Removed items with no change in quantity or value.,Eliminati elementi senza variazione di quantità o valore.
 DocType: Delivery Note,Delivery To,Consegna a
 apps/erpnext/erpnext/stock/doctype/item/item.py +649,Attribute table is mandatory,Tavolo attributo è obbligatorio
 DocType: Production Planning Tool,Get Sales Orders,Ottieni Ordini di Vendita
@@ -2553,7 +2553,7 @@
 apps/erpnext/erpnext/selling/doctype/sales_order/sales_order.py +149,Quotation {0} is cancelled,Preventivo {0} è annullato
 apps/erpnext/erpnext/accounts/report/accounts_receivable/accounts_receivable.html +26,Total Outstanding Amount,Importo totale Eccezionale
 DocType: Sales Partner,Targets,Obiettivi
-DocType: Price List,Price List Master,Listino Maestro
+DocType: Price List,Price List Master,Listino Principale
 DocType: Sales Person,All Sales Transactions can be tagged against multiple **Sales Persons** so that you can set and monitor targets.,Tutte le transazioni di vendita possono essere etichettati contro più persone ** ** di vendita in modo da poter impostare e monitorare gli obiettivi.
 ,S.O. No.,S.O. No.
 apps/erpnext/erpnext/selling/doctype/quotation/quotation.py +163,Please create Customer from Lead {0},Si prega di creare il Cliente dal Lead {0}
@@ -3369,7 +3369,7 @@
 DocType: BOM,Website Description,Descrizione del sito
 apps/erpnext/erpnext/accounts/report/cash_flow/cash_flow.py +42,Net Change in Equity,Variazione netta Patrimonio
 apps/erpnext/erpnext/accounts/doctype/asset/asset.py +152,Please cancel Purchase Invoice {0} first,Si prega di annullare Acquisto Fattura {0} prima
-apps/erpnext/erpnext/hr/doctype/job_applicant/job_applicant.py +42,"Email Address must be unique, already exists for {0}","Indirizzo e-mail deve essere unico, esiste già per {0}"
+apps/erpnext/erpnext/hr/doctype/job_applicant/job_applicant.py +42,"Email Address must be unique, already exists for {0}","Indirizzo e-mail deve essere univoco, esiste già per {0}"
 DocType: Serial No,AMC Expiry Date,AMC Data Scadenza
 apps/erpnext/erpnext/buying/doctype/purchase_order/purchase_order.js +795,Receipt,Ricevuta
 ,Sales Register,Registro Vendite
@@ -4032,7 +4032,7 @@
 apps/erpnext/erpnext/config/hr.py +75,Allocate leaves for a period.,Allocare le foglie per un periodo .
 apps/erpnext/erpnext/accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.py +42,Cheques and Deposits incorrectly cleared,Assegni e depositi cancellati in modo non corretto
 apps/erpnext/erpnext/accounts/doctype/account/account.py +51,Account {0}: You can not assign itself as parent account,Account {0}: non è possibile assegnare se stesso come conto principale
-DocType: Purchase Invoice Item,Price List Rate,Prezzo di listino Vota
+DocType: Purchase Invoice Item,Price List Rate,Prezzo di Listino
 apps/erpnext/erpnext/utilities/activation.py +73,Create customer quotes,Creare le citazioni dei clienti
 DocType: Item,"Show ""In Stock"" or ""Not in Stock"" based on stock available in this warehouse.",Mostra &quot;Disponibile&quot; o &quot;Non disponibile&quot; sulla base di scorte disponibili in questo magazzino.
 apps/erpnext/erpnext/config/manufacturing.py +38,Bill of Materials (BOM),Distinte materiali (BOM)
@@ -4164,7 +4164,7 @@
 apps/erpnext/erpnext/hr/doctype/salary_slip/salary_slip.py +320,Salary Slip of employee {0} already created for time sheet {1},Salario Slip of dipendente {0} già creato per foglio di tempo {1}
 DocType: Vehicle Log,Odometer,Odometro
 DocType: Sales Order Item,Ordered Qty,Quantità ordinato
-apps/erpnext/erpnext/stock/doctype/item/item.py +694,Item {0} is disabled,Voce {0} è disattivato
+apps/erpnext/erpnext/stock/doctype/item/item.py +694,Item {0} is disabled,Articolo {0} è disattivato
 DocType: Stock Settings,Stock Frozen Upto,Giacenza Bloccate Fino
 apps/erpnext/erpnext/stock/doctype/material_request/material_request.js +876,BOM does not contain any stock item,BOM non contiene alcun elemento magazzino
 apps/erpnext/erpnext/controllers/recurring_document.py +172,Period From and Period To dates mandatory for recurring {0},Periodo Dal periodo e per date obbligatorie per ricorrenti {0}
diff --git a/erpnext/translations/kn.csv b/erpnext/translations/kn.csv
index 6fc1c3e..3b707f3 100644
--- a/erpnext/translations/kn.csv
+++ b/erpnext/translations/kn.csv
@@ -2182,7 +2182,7 @@
 DocType: Purchase Invoice,PINV-RET-,PINV-RET-
 DocType: Sales Invoice Advance,Advance Amount,ಅಡ್ವಾನ್ಸ್ ಪ್ರಮಾಣ
 DocType: Manufacturing Settings,Capacity Planning,ಸಾಮರ್ಥ್ಯವನ್ನು ಯೋಜನೆ
-apps/erpnext/erpnext/stock/report/batch_item_expiry_status/batch_item_expiry_status.py +43,'From Date' is required,' ದಿನಾಂಕದಿಂದ ' ಅಗತ್ಯವಿದೆ
+apps/erpnext/erpnext/stock/report/batch_item_expiry_status/batch_item_expiry_status.py +43,'From Date' is required,ಇಂದ ದಿನಾಂಕ ಬೇಕು
 DocType: Journal Entry,Reference Number,ಉಲ್ಲೇಖ ಸಂಖ್ಯೆ
 DocType: Employee,Employment Details,ಉದ್ಯೋಗದ ವಿವರಗಳು
 DocType: Employee,New Workplace,ಹೊಸ ಕೆಲಸದ
@@ -2885,7 +2885,7 @@
 apps/erpnext/erpnext/hr/doctype/employee_loan/employee_loan.py +107,Disbursed Amount cannot be greater than Loan Amount {0},ಪಾವತಿಸಲಾಗುತ್ತದೆ ಪ್ರಮಾಣ ಸಾಲದ ಪ್ರಮಾಣ ಹೆಚ್ಚು ಹೆಚ್ಚಿರಬಾರದು {0}
 apps/erpnext/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py +86,Purchase Order number required for Item {0},ಪರ್ಚೇಸ್ ಆರ್ಡರ್ ಸಂಖ್ಯೆ ಐಟಂ ಅಗತ್ಯವಿದೆ {0}
 apps/erpnext/erpnext/selling/doctype/sales_order/sales_order.js +871,Production Order not created,ಪ್ರೊಡಕ್ಷನ್ ಆರ್ಡರ್ ರಚಿಸಿಲ್ಲ
-apps/erpnext/erpnext/stock/report/itemwise_recommended_reorder_level/itemwise_recommended_reorder_level.py +18,'From Date' must be after 'To Date',' ದಿನಾಂಕದಿಂದ ' ' ದಿನಾಂಕ ' ನಂತರ ಇರಬೇಕು
+apps/erpnext/erpnext/stock/report/itemwise_recommended_reorder_level/itemwise_recommended_reorder_level.py +18,'From Date' must be after 'To Date',"ಇಂದ ದಿನಾಂಕ, ಗೆ ದಿನಾಂಕದ ಆಮೇಲೆ ಬರಬೇಕು"
 apps/erpnext/erpnext/schools/doctype/student_applicant/student_applicant.py +29,Cannot change status as student {0} is linked with student application {1},ಅಲ್ಲ ವಿದ್ಯಾರ್ಥಿಯಾಗಿ ಸ್ಥಿತಿಯನ್ನು ಬದಲಾಯಿಸಬಹುದು {0} ವಿದ್ಯಾರ್ಥಿ ಅಪ್ಲಿಕೇಶನ್ ಸಂಬಂಧ ಇದೆ {1}
 DocType: Asset,Fully Depreciated,ಸಂಪೂರ್ಣವಾಗಿ Depreciated
 ,Stock Projected Qty,ಸ್ಟಾಕ್ ಪ್ರಮಾಣ ಯೋಜಿತ
diff --git a/erpnext/translations/pt-BR.csv b/erpnext/translations/pt-BR.csv
index 063c2ff..4173c3e 100644
--- a/erpnext/translations/pt-BR.csv
+++ b/erpnext/translations/pt-BR.csv
@@ -337,7 +337,7 @@
 DocType: Employee,Health Concerns,Preocupações com a Saúde
 DocType: Process Payroll,Select Payroll Period,Selecione Período de Pagamento
 DocType: Process Payroll,Select Payroll Period,Selecione Período de Pagamento
-DocType: Packing Slip,From Package No.,De No. Package
+DocType: Packing Slip,From Package No.,Do nº do pacote
 DocType: Item Attribute,To Range,Para a Faixa
 apps/erpnext/erpnext/hr/doctype/leave_allocation/leave_allocation.py +82,Total leaves allocated is mandatory,Total de folhas alocados é obrigatória
 DocType: Job Opening,Description of a Job Opening,Descrição de uma vaga de emprego
@@ -833,6 +833,7 @@
 DocType: Leave Control Panel,Leave blank if considered for all branches,Deixe em branco se considerado para todos os ramos
 apps/erpnext/erpnext/accounts/doctype/c_form/c_form.py +21,C-form is not applicable for Invoice: {0},C-forma não é aplicável para a fatura: {0}
 DocType: Payment Reconciliation,Unreconciled Payment Details,Detalhes do Pagamento não Conciliado
+DocType: Global Defaults,Disable Rounded Total,Desativar total arredondado
 apps/erpnext/erpnext/accounts/doctype/journal_entry/journal_entry.py +436,'Entries' cannot be empty,'Entradas' não pode estar vazio
 apps/erpnext/erpnext/config/hr.py +296,Setting up Employees,Configurando Colaboradores
 DocType: Sales Order,SO-,OV-
@@ -885,7 +886,7 @@
 DocType: Email Digest,Add Quote,Adicionar Citar
 apps/erpnext/erpnext/stock/doctype/stock_entry/stock_entry.py +843,UOM coversion factor required for UOM: {0} in Item: {1},Fator de Conversão de Unidade de Medida é necessário para Unidade de Medida: {0} no Item: {1}
 apps/erpnext/erpnext/stock/doctype/stock_entry/stock_entry.py +77,Row {0}: Qty is mandatory,Linha {0}: Qtde é obrigatória
-apps/erpnext/erpnext/accounts/page/pos/pos.js +714,Sync Master Data,Sincronizar com o servidor
+apps/erpnext/erpnext/accounts/page/pos/pos.js +714,Sync Master Data,Sincronizar com o Servidor
 apps/erpnext/erpnext/public/js/setup_wizard.js +288,Your Products or Services,Seus Produtos ou Serviços
 DocType: Mode of Payment,Mode of Payment,Forma de Pagamento
 apps/erpnext/erpnext/stock/doctype/item/item.py +179,Website Image should be a public file or website URL,Site de imagem deve ser um arquivo público ou URL do site
@@ -988,6 +989,7 @@
 DocType: GL Entry,GL Entry,Lançamento GL
 DocType: HR Settings,Employee Settings,Configurações de Colaboradores
 ,Batch-Wise Balance History,Balanço por Histórico de Lotes
+DocType: Package Code,Package Code,Código do pacote
 apps/erpnext/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py +103,Negative Quantity is not allowed,Negativo Quantidade não é permitido
 DocType: Purchase Invoice Item,"Tax detail table fetched from item master as a string and stored in this field.
 Used for Taxes and Charges",Detalhe da tabela de imposto obtido a partir do cadastro do item como texto e armazenado neste campo. Usado para Tributos e Encargos
@@ -1225,7 +1227,7 @@
 DocType: Asset Movement,Asset Movement,Movimentação de Ativos
 apps/erpnext/erpnext/selling/doctype/installation_note/installation_note.py +44,Item {0} is not a serialized Item,Item {0} não é um item serializado
 DocType: SMS Center,Create Receiver List,Criar Lista de Receptor
-DocType: Packing Slip,To Package No.,Para Pacote Nº.
+DocType: Packing Slip,To Package No.,Até nº do pacote
 DocType: Production Planning Tool,Material Requests,Requisições de Material
 DocType: Warranty Claim,Issue Date,Data do Incidente
 DocType: Sales Invoice Timesheet,Timesheet Detail,Detalhes do Registro de Tempo
@@ -1746,6 +1748,7 @@
 apps/erpnext/erpnext/accounts/report/accounts_receivable/accounts_receivable.html +17,Ref,Referência
 apps/erpnext/erpnext/stock/report/stock_ledger/stock_ledger.py +36,Voucher #,Comprovante #
 DocType: Notification Control,Purchase Order Message,Mensagem do Pedido de Compra
+DocType: Selling Settings,Hide Customer's Tax Id from Sales Transactions,Esconder CPF/CNPJ em transações de vendas
 DocType: Upload Attendance,Upload HTML,Upload HTML
 DocType: Employee,Relieving Date,Data da Liberação
 apps/erpnext/erpnext/accounts/doctype/pricing_rule/pricing_rule.js +12,"Pricing Rule is made to overwrite Price List / define discount percentage, based on some criteria.","Regra de preços é feita para substituir Lista de Preços / define percentual de desconto, com base em alguns critérios."
@@ -2049,6 +2052,7 @@
 apps/erpnext/erpnext/hr/doctype/vehicle_log/vehicle_log.py +49,Expense Claim for Vehicle Log {0},Reembolso de Despesa para o Log do Veículo {0}
 DocType: Sales Partner,Retailer,Varejista
 apps/erpnext/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py +107,Credit To account must be a Balance Sheet account,Para crédito de conta deve ser uma conta de Balanço
+DocType: Global Defaults,Disable In Words,Desativar por extenso
 apps/erpnext/erpnext/stock/doctype/item/item.py +44,Item Code is mandatory because Item is not automatically numbered,Código do item é obrigatório porque Item não é numerada automaticamente
 apps/erpnext/erpnext/selling/doctype/sales_order/sales_order.py +101,Quotation {0} not of type {1},O Orçamento {0} não é do tipo {1}
 DocType: Maintenance Schedule Item,Maintenance Schedule Item,Ítem da Programação da Manutenção
diff --git a/erpnext/translations/pt.csv b/erpnext/translations/pt.csv
index c103a66..de1bccf 100644
--- a/erpnext/translations/pt.csv
+++ b/erpnext/translations/pt.csv
@@ -1035,7 +1035,7 @@
 DocType: Timesheet Detail,Bill,Fatura
 apps/erpnext/erpnext/accounts/doctype/asset/asset.py +84,Next Depreciation Date is entered as past date,A Próxima Data de Depreciação é inserida como data passada
 apps/erpnext/erpnext/setup/setup_wizard/install_fixtures.py +170,White,Branco
-DocType: SMS Center,All Lead (Open),Todos Pot. Clientes (Abertos)
+DocType: SMS Center,All Lead (Open),Todos Potenciais Clientes (Abertos)
 apps/erpnext/erpnext/stock/doctype/stock_entry/stock_entry.py +222,Row {0}: Qty not available for {4} in warehouse {1} at posting time of the entry ({2} {3}),Linha {0}: A qtd não está disponível para {4} no armazém {1} no momento da postagem do registo ({2} {3})
 DocType: Purchase Invoice,Get Advances Paid,Obter Adiantamentos Pagos
 apps/erpnext/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js +763,Make ,Efetuar
@@ -1187,7 +1187,7 @@
 DocType: Opportunity,Your sales person will get a reminder on this date to contact the customer,O seu vendedor receberá um lembrete nesta data para contatar o cliente
 apps/erpnext/erpnext/buying/doctype/purchase_common/purchase_common.py +75,Same item cannot be entered multiple times.,Mesmo item não pode ser inserido várias vezes.
 apps/erpnext/erpnext/accounts/doctype/account/account_tree.js +28,"Further accounts can be made under Groups, but entries can be made against non-Groups","Podem ser realizadas outras contas nos Grupos, e os registos podem ser efetuados em Fora do Grupo"
-DocType: Lead,Lead,Pot Clie
+DocType: Lead,Lead,Potenciais Clientes
 DocType: Email Digest,Payables,A Pagar
 DocType: Course,Course Intro,Introdução do Curso
 apps/erpnext/erpnext/stock/dashboard/item_dashboard.js +157,Stock Entry {0} created,Registo de Stock {0} criado
@@ -1549,7 +1549,7 @@
 DocType: Purchase Receipt,PREC-,RECC-
 apps/erpnext/erpnext/accounts/doctype/account/chart_of_accounts/verified/standard_chart_of_accounts.py +16,Bank Accounts,Contas Bancárias
 ,Bank Reconciliation Statement,Declaração de Conciliação Bancária
-,Lead Name,Nome de Pot Client
+,Lead Name,Nome de Potencial Cliente
 ,POS,POS
 DocType: C-Form,III,III
 apps/erpnext/erpnext/config/stock.py +305,Opening Stock Balance,Saldo de Stock Inicial
@@ -2433,7 +2433,7 @@
 apps/erpnext/erpnext/config/setup.py +15,"Set Default Values like Company, Currency, Current Fiscal Year, etc.","Definir Valores Padrão, como a Empresa, Moeda, Ano Fiscal Atual, etc."
 DocType: Payment Entry,Payment Type,Tipo de Pagamento
 DocType: Process Payroll,Select Employees,Selecionar Funcionários
-DocType: Opportunity,Potential Sales Deal,Negócio de Vendas Potencial
+DocType: Opportunity,Potential Sales Deal,Potenciais Negócios de Vendas
 DocType: Payment Entry,Cheque/Reference Date,Data do Cheque/Referência
 DocType: Purchase Invoice,Total Taxes and Charges,Impostos e Encargos Totais
 DocType: Employee,Emergency Contact,Contacto de Emergência
@@ -3341,7 +3341,7 @@
 					using Stock Reconciliation","O Item em Série {0} não pode ser atualizado utilizando \
 a Reconciliação de Stock"
 apps/erpnext/erpnext/stock/doctype/serial_no/serial_no.py +29,New Serial No cannot have Warehouse. Warehouse must be set by Stock Entry or Purchase Receipt,O Novo Nr. de Série não pode ter um Armazém. O Armazém deve ser definido no Registo de Compra ou no Recibo de Compra
-DocType: Lead,Lead Type,Tipo Pot. Cliente
+DocType: Lead,Lead Type,Tipo Potencial Cliente
 apps/erpnext/erpnext/hr/doctype/leave_application/leave_application.py +133,You are not authorized to approve leaves on Block Dates,Não está autorizado a aprovar licenças em Datas Bloqueadas
 apps/erpnext/erpnext/stock/doctype/delivery_note/delivery_note.py +364,All these items have already been invoiced,Todos estes itens já foram faturados
 apps/erpnext/erpnext/setup/doctype/authorization_control/authorization_control.py +37,Can be approved by {0},Pode ser aprovado por {0}
@@ -3457,7 +3457,7 @@
 DocType: Payment Entry,Account Paid From,Conta Paga De
 DocType: Purchase Order Item Supplied,Raw Material Item Code,Código de Item de Matéria-prima
 DocType: Journal Entry,Write Off Based On,Liquidação Baseada Em
-apps/erpnext/erpnext/utilities/activation.py +66,Make Lead,Faça chumbo
+apps/erpnext/erpnext/utilities/activation.py +66,Make Lead,Crie um Potencial Cliente
 apps/erpnext/erpnext/accounts/doctype/account/chart_of_accounts/verified/standard_chart_of_accounts.py +110,Print and Stationery,Impressão e artigos de papelaria
 DocType: Stock Settings,Show Barcode Field,Mostrar Campo do Código de Barras
 apps/erpnext/erpnext/buying/doctype/request_for_quotation/request_for_quotation.js +762,Send Supplier Emails,Enviar Emails de Fornecedores
@@ -3648,7 +3648,7 @@
 DocType: Production Order Operation,"in Minutes
 Updated via 'Time Log'","em Minutos
 Atualizado através do ""Registo de Tempo"""
-DocType: Customer,From Lead,Do Pot. Cliente
+DocType: Customer,From Lead,Do Potencial Cliente
 apps/erpnext/erpnext/config/manufacturing.py +13,Orders released for production.,Pedidos lançados para a produção.
 apps/erpnext/erpnext/public/js/account_tree_grid.js +67,Select Fiscal Year...,Selecione o Ano Fiscal...
 apps/erpnext/erpnext/accounts/doctype/sales_invoice/sales_invoice.py +512,POS Profile required to make POS Entry,É necessário colocar o Perfil POS para efetuar um Registo POS
@@ -3966,7 +3966,7 @@
 DocType: Customer,Sales Team Details,Dados de Equipa de Vendas
 apps/erpnext/erpnext/accounts/page/pos/pos.js +1252,Delete permanently?,Eliminar permanentemente?
 DocType: Expense Claim,Total Claimed Amount,Montante Reclamado Total
-apps/erpnext/erpnext/config/crm.py +17,Potential opportunities for selling.,Oportunidades potenciais de venda.
+apps/erpnext/erpnext/config/crm.py +17,Potential opportunities for selling.,Potenciais oportunidades de venda.
 apps/erpnext/erpnext/accounts/doctype/pricing_rule/pricing_rule.py +211,Invalid {0},Inválido {0}
 apps/erpnext/erpnext/setup/setup_wizard/install_fixtures.py +52,Sick Leave,Licença de Doença
 DocType: Email Digest,Email Digest,Email de Resumo
@@ -3997,7 +3997,7 @@
 apps/erpnext/erpnext/accounts/report/budget_variance_report/budget_variance_report.js +16,Period,Período
 apps/erpnext/erpnext/stock/doctype/warehouse/warehouse.js +18,General Ledger,Razão Geral
 apps/erpnext/erpnext/hr/doctype/attendance/attendance.py +33,Employee {0} on Leave on {1},Employee {0} em licença {1}
-apps/erpnext/erpnext/selling/doctype/campaign/campaign.js +10,View Leads,Ver Pot. Clientes
+apps/erpnext/erpnext/selling/doctype/campaign/campaign.js +10,View Leads,Ver Potenciais Clientes
 DocType: Program Enrollment Tool,New Program,Novo Programa
 DocType: Item Attribute Value,Attribute Value,Valor do Atributo
 ,Itemwise Recommended Reorder Level,Nível de Reposição Recomendada por Item
@@ -4199,7 +4199,7 @@
 apps/erpnext/erpnext/hub_node/doctype/hub_settings/hub_settings.py +93,{0} Items synced,{0} Itens sincronizados
 DocType: Sales Order,Partly Delivered,Parcialmente Entregue
 DocType: Email Digest,Receivables,A Receber
-DocType: Lead Source,Lead Source,Fonte de Pot. Cliente
+DocType: Lead Source,Lead Source,Fonte de Potencial Cliente
 DocType: Customer,Additional information regarding the customer.,Informações adicionais acerca do cliente.
 DocType: Quality Inspection Reading,Reading 5,Leitura 5
 DocType: Maintenance Visit,Maintenance Date,Data de Manutenção
diff --git a/erpnext/translations/ro.csv b/erpnext/translations/ro.csv
index cf444a3..3f8797b 100644
--- a/erpnext/translations/ro.csv
+++ b/erpnext/translations/ro.csv
@@ -36,7 +36,7 @@
 DocType: Delivery Note,Return Against Delivery Note,Reveni Împotriva livrare Nota
 DocType: Purchase Order,% Billed,% Facurat
 apps/erpnext/erpnext/controllers/sales_and_purchase_return.py +43,Exchange Rate must be same as {0} {1} ({2}),Rata de schimb trebuie să fie aceeași ca și {0} {1} ({2})
-DocType: Sales Invoice,Customer Name,Nume client
+DocType: Sales Invoice,Customer Name,Cumpărător
 DocType: Vehicle,Natural Gas,Gaz natural
 apps/erpnext/erpnext/setup/setup_wizard/setup_wizard.py +130,Bank account cannot be named as {0},Contul bancar nu poate fi numit ca {0}
 DocType: Account,Heads (or groups) against which Accounting Entries are made and balances are maintained.,Heads (sau grupuri) față de care înregistrările contabile sunt făcute și soldurile sunt menținute.
@@ -785,7 +785,7 @@
 
 #### Description of Columns
 
-1. Calculation Type: 
+1. Calculation Type:
     - This can be on **Net Total** (that is the sum of basic amount).
     - **On Previous Row Total / Amount** (for cumulative taxes or charges). If you select this option, the tax will be applied as a percentage of the previous row (in the tax table) amount or total.
     - **Actual** (as mentioned).
@@ -796,19 +796,19 @@
 6. Amount: Tax amount.
 7. Total: Cumulative total to this point.
 8. Enter Row: If based on ""Previous Row Total"" you can select the row number which will be taken as a base for this calculation (default is the previous row).
-9. Is this Tax included in Basic Rate?: If you check this, it means that this tax will not be shown below the item table, but will be included in the Basic Rate in your main item table. This is useful where you want give a flat price (inclusive of all taxes) price to customers.","Șablon de impozitare standard, care pot fi aplicate la toate tranzacțiile de vânzare. Acest model poate conține lista de capete fiscale și, de asemenea, mai multe capete de cheltuieli / venituri, cum ar fi ""de transport"", ""asigurare"", ""manipulare"" etc. 
+9. Is this Tax included in Basic Rate?: If you check this, it means that this tax will not be shown below the item table, but will be included in the Basic Rate in your main item table. This is useful where you want give a flat price (inclusive of all taxes) price to customers.","Șablon de impozitare standard, care pot fi aplicate la toate tranzacțiile de vânzare. Acest model poate conține lista de capete fiscale și, de asemenea, mai multe capete de cheltuieli / venituri, cum ar fi ""de transport"", ""asigurare"", ""manipulare"" etc.
 
- #### Notă 
+ #### Notă
 
  vă Rata de impozitare defini aici va fi cota de impozitare standard pentru toate Articole ** **. Dacă există articole ** **, care au preturi diferite, acestea trebuie să fie adăugate în ** Impozitul Postul ** masă în ** ** postul comandantului.
 
- #### Descrierea de coloane 
+ #### Descrierea de coloane
 
- 1. Calcul Tip: 
+ 1. Calcul Tip:
  - Acest lucru poate fi pe ** net total ** (care este suma cuantum de bază).
  - ** La rândul precedent Raport / Suma ** (pentru impozite sau taxe cumulative). Dacă selectați această opțiune, impozitul va fi aplicat ca procent din rândul anterior (în tabelul de impozitare) suma totală sau.
  - ** ** Real (după cum sa menționat).
- 2. Șeful cont: Registrul cont în care acest impozit va fi rezervat 
+ 2. Șeful cont: Registrul cont în care acest impozit va fi rezervat
  3. Cost Center: În cazul în care taxa / taxa este un venit (cum ar fi de transport maritim) sau cheltuieli trebuie să se rezervat împotriva unui centru de cost.
  4. Descriere: Descriere a taxei (care vor fi tipărite în facturi / citate).
  5. Notă: Rata de Profit Brut.
@@ -893,7 +893,7 @@
 DocType: Shopping Cart Settings,Enable Checkout,activaţi Checkout
 apps/erpnext/erpnext/config/learn.py +202,Purchase Order to Payment,Comandă de aprovizionare de plata
 apps/erpnext/erpnext/stock/page/stock_balance/stock_balance.js +48,Projected Qty,Proiectat Cantitate
-DocType: Sales Invoice,Payment Due Date,Data scadentă de plată
+DocType: Sales Invoice,Payment Due Date,Scadentă
 apps/erpnext/erpnext/stock/doctype/item/item.js +340,Item Variant {0} already exists with same attributes,Postul Varianta {0} există deja cu aceleași atribute
 apps/erpnext/erpnext/stock/report/stock_ledger/stock_ledger.py +95,'Opening',&quot;Deschiderea&quot;
 apps/erpnext/erpnext/setup/doctype/email_digest/templates/default.html +130,Open To Do,Deschideți To Do
@@ -1021,7 +1021,7 @@
 apps/erpnext/erpnext/accounts/doctype/journal_entry/journal_entry.py +120,Row {0}: Payment against Sales/Purchase Order should always be marked as advance,Rând {0}: Plata împotriva Vânzări / Ordinului de Procurare ar trebui să fie întotdeauna marcate ca avans
 apps/erpnext/erpnext/setup/setup_wizard/industry_type.py +16,Chemical,Chimic
 DocType: Salary Component Account,Default Bank / Cash account will be automatically updated in Salary Journal Entry when this mode is selected.,Default cont bancar / numerar vor fi actualizate automat în Jurnalul de intrare a salariului când este selectat acest mod.
-apps/erpnext/erpnext/schools/doctype/grading_structure/grading_structure.py +24,"The intervals for Grade Code {0} overlaps with the grade intervals for other grades. 
+apps/erpnext/erpnext/schools/doctype/grading_structure/grading_structure.py +24,"The intervals for Grade Code {0} overlaps with the grade intervals for other grades.
                     Please check intervals {0} and {1} and try again",Intervalele de cod Grad {0} se suprapune cu intervalele de grad pentru alte clase. Vă rugăm să verificați intervalele de {0} și {1} și încercați din nou
 DocType: BOM,Raw Material Cost(Company Currency),Brut Costul materialelor (companie Moneda)
 apps/erpnext/erpnext/stock/doctype/stock_entry/stock_entry.py +715,All items have already been transferred for this Production Order.,Toate articolele acestei comenzi de producție au fost deja transferate.
@@ -2345,7 +2345,7 @@
 
 #### Description of Columns
 
-1. Calculation Type: 
+1. Calculation Type:
     - This can be on **Net Total** (that is the sum of basic amount).
     - **On Previous Row Total / Amount** (for cumulative taxes or charges). If you select this option, the tax will be applied as a percentage of the previous row (in the tax table) amount or total.
     - **Actual** (as mentioned).
@@ -2357,19 +2357,19 @@
 7. Total: Cumulative total to this point.
 8. Enter Row: If based on ""Previous Row Total"" you can select the row number which will be taken as a base for this calculation (default is the previous row).
 9. Consider Tax or Charge for: In this section you can specify if the tax / charge is only for valuation (not a part of total) or only for total (does not add value to the item) or for both.
-10. Add or Deduct: Whether you want to add or deduct the tax.","Șablon de impozitare standard care pot fi aplicate la toate tranzacțiile de cumpărare. Acest model poate conține lista de capete fiscale și, de asemenea, mai multe capete de cheltuieli, cum ar fi ""de transport"", ""asigurare"", ""manipulare"" etc. 
+10. Add or Deduct: Whether you want to add or deduct the tax.","Șablon de impozitare standard care pot fi aplicate la toate tranzacțiile de cumpărare. Acest model poate conține lista de capete fiscale și, de asemenea, mai multe capete de cheltuieli, cum ar fi ""de transport"", ""asigurare"", ""manipulare"" etc.
 
- #### Notă 
+ #### Notă
 
  Rata de impozitare pe care o definiți aici va fi rata de impozitare standard pentru toate Articole ** **. Dacă există articole ** **, care au preturi diferite, acestea trebuie să fie adăugate în ** Impozitul Postul ** masă în ** ** postul comandantului.
 
- #### Descrierea de coloane 
+ #### Descrierea de coloane
 
- 1. Calcul Tip: 
+ 1. Calcul Tip:
  - Acest lucru poate fi pe ** net total ** (care este suma cuantum de bază).
  - ** La rândul precedent Raport / Suma ** (pentru impozite sau taxe cumulative). Dacă selectați această opțiune, impozitul va fi aplicat ca procent din rândul anterior (în tabelul de impozitare) suma totală sau.
  - ** ** Real (după cum sa menționat).
- 2. Șeful cont: Registrul cont în care acest impozit va fi rezervat 
+ 2. Șeful cont: Registrul cont în care acest impozit va fi rezervat
  3. Cost Center: În cazul în care taxa / taxa este un venit (cum ar fi de transport maritim) sau cheltuieli trebuie să se rezervat împotriva unui centru de cost.
  4. Descriere: Descriere a taxei (care vor fi tipărite în facturi / citate).
  5. Notă: Rata de Profit Brut.
@@ -2579,7 +2579,7 @@
 1. Ways of addressing disputes, indemnity, liability, etc.
 1. Address and Contact of your Company.","Termeni și Condiții care pot fi adăugate la vânzările și achizițiile standard.
 
- Exemple: 
+ Exemple:
 
  1. Perioada de valabilitate a ofertei.
  1. Conditii de plata (in avans, pe credit, parte în avans etc.).
@@ -2588,7 +2588,7 @@
  1. Garantie dacă este cazul.
  1. Politica de Returnare.
  1. Condiții de transport maritim, dacă este cazul.
- 1. Modalitati de litigii de adresare, indemnizație, răspunderea, etc. 
+ 1. Modalitati de litigii de adresare, indemnizație, răspunderea, etc.
  1. Adresa și de contact ale companiei."
 DocType: Attendance,Leave Type,Tip Concediu
 DocType: Purchase Invoice,Supplier Invoice Details,Furnizor Detalii factură
@@ -3641,7 +3641,7 @@
 apps/erpnext/erpnext/setup/setup_wizard/industry_type.py +15,Brokerage,Brokeraj
 apps/erpnext/erpnext/hr/doctype/leave_application/leave_application.py +232,Attendance for employee {0} is already marked for this day,Prezență pentru angajat {0} este deja marcat pentru această zi
 DocType: Production Order Operation,"in Minutes
-Updated via 'Time Log'","în procesul-verbal 
+Updated via 'Time Log'","în procesul-verbal
  Actualizat prin ""Ora Log"""
 DocType: Customer,From Lead,Din Conducere
 apps/erpnext/erpnext/config/manufacturing.py +13,Orders released for production.,Comenzi lansat pentru producție.
@@ -3743,7 +3743,7 @@
 DocType: Stock Ledger Entry,Stock Ledger Entry,Stoc Ledger intrare
 apps/erpnext/erpnext/selling/doctype/sales_order/sales_order.py +87,Same item has been entered multiple times,Același articol a fost introdus de mai multe ori
 DocType: Department,Leave Block List,Lista Concedii Blocate
-DocType: Sales Invoice,Tax ID,ID impozit
+DocType: Sales Invoice,Tax ID,Cod inregistrare fiscala
 apps/erpnext/erpnext/stock/doctype/serial_no/serial_no.py +188,Item {0} is not setup for Serial Nos. Column must be blank,Articolul {0} nu este configurat pentru Numerotare Seriala. Coloana trebuie să fie vida
 DocType: Accounts Settings,Accounts Settings,Setări Conturi
 apps/erpnext/erpnext/schools/doctype/student_applicant/student_applicant.js +7,Approve,Aproba
@@ -3843,7 +3843,7 @@
 apps/erpnext/erpnext/accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.py +34,Bank Statement balance as per General Ledger,Banca echilibru Declarație pe General Ledger
 DocType: Job Applicant,Applicant Name,Nume solicitant
 DocType: Authorization Rule,Customer / Item Name,Client / Denumire articol
-DocType: Product Bundle,"Aggregate group of **Items** into another **Item**. This is useful if you are bundling a certain **Items** into a package and you maintain stock of the packed **Items** and not the aggregate **Item**. 
+DocType: Product Bundle,"Aggregate group of **Items** into another **Item**. This is useful if you are bundling a certain **Items** into a package and you maintain stock of the packed **Items** and not the aggregate **Item**.
 
 The package **Item** will have ""Is Stock Item"" as ""No"" and ""Is Sales Item"" as ""Yes"".
 
@@ -4195,7 +4195,7 @@
 apps/erpnext/erpnext/accounts/doctype/fiscal_year/fiscal_year.py +82,Year start date or end date is overlapping with {0}. To avoid please set company,Anul Data de începere sau de încheiere este suprapunerea cu {0}. Pentru a evita vă rugăm să setați companie
 apps/erpnext/erpnext/maintenance/doctype/maintenance_schedule/maintenance_schedule.py +157,Start date should be less than end date for Item {0},Data de începere trebuie să fie mai mică decât data de sfârșit pentru postul {0}
 DocType: Item,"Example: ABCD.#####
-If series is set and Serial No is not mentioned in transactions, then automatic serial number will be created based on this series. If you always want to explicitly mention Serial Nos for this item. leave this blank.","Exemplu:. ABCD ##### 
+If series is set and Serial No is not mentioned in transactions, then automatic serial number will be created based on this series. If you always want to explicitly mention Serial Nos for this item. leave this blank.","Exemplu:. ABCD #####
  Dacă seria este setat și nu de serie nu este menționat în tranzacții, numărul de atunci automat de serie va fi creat pe baza acestei serii. Dacă întotdeauna doriți să se menționeze explicit Serial nr de acest articol. părăsi acest gol."
 DocType: Upload Attendance,Upload Attendance,Încărcați Spectatori
 apps/erpnext/erpnext/stock/doctype/stock_entry/stock_entry.js +302,BOM and Manufacturing Quantity are required,BOM și cantitatea de producție sunt necesare
diff --git a/erpnext/utilities/__init__.py b/erpnext/utilities/__init__.py
index b94061c..944f978 100644
--- a/erpnext/utilities/__init__.py
+++ b/erpnext/utilities/__init__.py
@@ -2,6 +2,7 @@
 
 import frappe
 from erpnext.utilities.activation import get_level
+from frappe.utils import cstr
 
 def update_doctypes():
 	for d in frappe.db.sql("""select df.parent, df.fieldname
@@ -26,7 +27,7 @@
 		company = company[0][0] if company else None
 
 	if company:
-		domain = frappe.db.get_value('Company', company, 'domain')
+		domain = frappe.db.get_value('Company', cstr(company), 'domain')
 
 	return {
 		'company': company,
diff --git a/erpnext/utilities/activation.py b/erpnext/utilities/activation.py
index c4841bb..0b73d3e 100644
--- a/erpnext/utilities/activation.py
+++ b/erpnext/utilities/activation.py
@@ -37,7 +37,7 @@
 	if frappe.db.count('Student') > 5:
 		activation_level += 1
 
-	if frappe.db.count('Student Batch') > 5:
+	if frappe.db.count('Student Batch Name') > 5:
 		activation_level += 1
 
 	if frappe.db.count('Instructor') > 5:
diff --git a/erpnext/utilities/transaction_base.py b/erpnext/utilities/transaction_base.py
index 688d6c4..7657188 100644
--- a/erpnext/utilities/transaction_base.py
+++ b/erpnext/utilities/transaction_base.py
@@ -18,6 +18,10 @@
 				frappe.db.get_value("Notification Control", None, dt + "_message"))
 
 	def validate_posting_time(self):
+		# set Edit Posting Date and Time to 1 while data import
+		if frappe.flags.in_import:
+			self.set_posting_time = 1
+
 		if not getattr(self, 'set_posting_time', None):
 			now = now_datetime()
 			self.posting_date = now.strftime('%Y-%m-%d')
@@ -143,6 +147,7 @@
 	for d in doc.get_all_children(parenttype=child_dt):
 		if d.get(uom_field) in integer_uoms:
 			for f in qty_fields:
-				if d.get(f):
-					if cint(d.get(f))!=d.get(f):
-						frappe.throw(_("Quantity cannot be a fraction in row {0}").format(d.idx), UOMMustBeIntegerError)
+				qty = d.get(f)
+				if qty:
+					if abs(int(qty) - float(qty)) > 0.0000001:
+						frappe.throw(_("Quantity ({0}) cannot be a fraction in row {1}").format(qty, d.idx), UOMMustBeIntegerError)