Merge pull request #6178 from nabinhait/status_updater_fix

Ignore validating billed amount against order if order item amount is zero
diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json
index 930f25f..836a2e0 100755
--- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json
+++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json
@@ -252,17 +252,17 @@
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
-   "fieldname": "bill_date", 
+   "fieldname": "due_date", 
    "fieldtype": "Date", 
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
    "in_filter": 1, 
    "in_list_view": 0, 
-   "label": "Supplier Invoice Date", 
+   "label": "Due Date", 
    "length": 0, 
    "no_copy": 0, 
-   "oldfieldname": "bill_date", 
+   "oldfieldname": "due_date", 
    "oldfieldtype": "Date", 
    "permlevel": 0, 
    "print_hide": 1, 
@@ -278,17 +278,17 @@
    "allow_on_submit": 0, 
    "bold": 0, 
    "collapsible": 0, 
-   "fieldname": "due_date", 
+   "fieldname": "bill_date", 
    "fieldtype": "Date", 
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
    "in_filter": 1, 
    "in_list_view": 0, 
-   "label": "Due Date", 
+   "label": "Supplier Invoice Date", 
    "length": 0, 
    "no_copy": 0, 
-   "oldfieldname": "due_date", 
+   "oldfieldname": "bill_date", 
    "oldfieldtype": "Date", 
    "permlevel": 0, 
    "print_hide": 1, 
@@ -3032,7 +3032,7 @@
  "istable": 0, 
  "max_attachments": 0, 
  "menu_index": 0, 
- "modified": "2016-08-10 02:45:28.746569", 
+ "modified": "2016-08-24 12:50:15.777689", 
  "modified_by": "Administrator", 
  "module": "Accounts", 
  "name": "Purchase Invoice", 
diff --git a/erpnext/controllers/status_updater.py b/erpnext/controllers/status_updater.py
index 2c25f5c..ccbf377 100644
--- a/erpnext/controllers/status_updater.py
+++ b/erpnext/controllers/status_updater.py
@@ -142,7 +142,7 @@
 							if item['reduce_by'] > .01:
 								self.limits_crossed_error(args, item)
 
-						else:
+						elif item[args['target_ref_field']]:
 							self.check_overflow_with_tolerance(item, args)
 
 	def check_overflow_with_tolerance(self, item, args):