Merge pull request #6012 from bohlian/develop

[Enhancement + Fix] Disable buttons when Production Order is Stopped, Fixed Stopping and Re-Opening of Production Order
diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry.py b/erpnext/accounts/doctype/journal_entry/journal_entry.py
index 94709a7..4e00c32 100644
--- a/erpnext/accounts/doctype/journal_entry/journal_entry.py
+++ b/erpnext/accounts/doctype/journal_entry/journal_entry.py
@@ -772,6 +772,9 @@
 	company_currency = get_company_currency(company)
 	account_details = frappe.db.get_value("Account", account, ["account_type", "account_currency"], as_dict=1)
 
+	if not account_details:
+		return
+
 	if account_details.account_type == "Receivable":
 		party_type = "Customer"
 	elif account_details.account_type == "Payable":
diff --git a/erpnext/accounts/report/accounts_receivable/accounts_receivable.py b/erpnext/accounts/report/accounts_receivable/accounts_receivable.py
index 3a594c8..843937f 100644
--- a/erpnext/accounts/report/accounts_receivable/accounts_receivable.py
+++ b/erpnext/accounts/report/accounts_receivable/accounts_receivable.py
@@ -52,10 +52,10 @@
 		if not "range3" in self.filters:
 			self.filters["range3"] = "90"
 			
-		for label in ("0-{range1}".format(**self.filters),
-			"{range1}-{range2}".format(**self.filters),
-			"{range2}-{range3}".format(**self.filters),
-			"{range3}-{above}".format(range3=self.filters.range3, above=_("Above"))):
+		for label in ("0-{range1}".format(range1=self.filters["range1"]),
+			"{range1}-{range2}".format(range1=self.filters["range1"]+1, range2=self.filters["range2"]),
+			"{range2}-{range3}".format(range2=self.filters["range2"]+1, range3=self.filters["range3"]),
+			"{range3}-{above}".format(range3=self.filters["range3"] + 1, above=_("Above"))):
 				columns.append({
 					"label": label,
 					"fieldtype": "Currency",