Merge pull request #6678 from KanchanChauhan/total-leave-days-updated

Total leave days gets updated on date change
diff --git a/erpnext/hr/doctype/process_payroll/process_payroll.json b/erpnext/hr/doctype/process_payroll/process_payroll.json
index 13d3191..546da97 100644
--- a/erpnext/hr/doctype/process_payroll/process_payroll.json
+++ b/erpnext/hr/doctype/process_payroll/process_payroll.json
@@ -609,7 +609,7 @@
    "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
-   "depends_on": "payment_account", 
+   "depends_on": "eval:doc.payment_account", 
    "description": "Create Bank Entry for the total salary paid for the above selected criteria", 
    "fieldname": "make_bank_entry", 
    "fieldtype": "Button", 
@@ -692,7 +692,7 @@
  "issingle": 1, 
  "istable": 0, 
  "max_attachments": 0, 
- "modified": "2016-09-28 05:43:26.472928", 
+ "modified": "2016-10-22 08:10:44.293748", 
  "modified_by": "Administrator", 
  "module": "HR", 
  "name": "Process Payroll", 
@@ -708,6 +708,7 @@
    "export": 0, 
    "if_owner": 0, 
    "import": 0, 
+   "is_custom": 0, 
    "permlevel": 0, 
    "print": 0, 
    "read": 1, 
diff --git a/erpnext/stock/doctype/material_request/material_request.js b/erpnext/stock/doctype/material_request/material_request.js
index 78f17d3..44b7dea 100644
--- a/erpnext/stock/doctype/material_request/material_request.js
+++ b/erpnext/stock/doctype/material_request/material_request.js
@@ -7,7 +7,13 @@
 	onload: function(frm) {
 		// formatter for material request item
 		frm.set_indicator_formatter('item_code',
-			function(doc) { return (doc.qty<=doc.ordered_qty) ? "green" : "orange" })
+			function(doc) { return (doc.qty<=doc.ordered_qty) ? "green" : "orange" }),
+
+		frm.fields_dict["items"].grid.get_field("warehouse").get_query = function(doc, cdt, cdn){
+			return{
+				filters: {'company': doc.company}
+			}
+		}
 	}
 });