Merge pull request #6455 from rohitwaghchaure/retun_field_duplicate_issue

[Fix] Allow renaming for UOM, When Duplicate Is Return field should not be copied #5510 #6288
diff --git a/erpnext/accounts/report/accounts_receivable/accounts_receivable.py b/erpnext/accounts/report/accounts_receivable/accounts_receivable.py
index ed429d6..685b8a7 100644
--- a/erpnext/accounts/report/accounts_receivable/accounts_receivable.py
+++ b/erpnext/accounts/report/accounts_receivable/accounts_receivable.py
@@ -124,6 +124,10 @@
 					row += get_ageing_data(cint(self.filters.range1), cint(self.filters.range2),
 						cint(self.filters.range3), self.age_as_on, entry_date, outstanding_amount)
 
+					# issue 6371-Ageing buckets should not have amounts if due date is not reached
+					if self.filters.ageing_based_on == "Due Date" and getdate(due_date) > getdate(self.filters.report_date):
+						row[-1]=row[-2]=row[-3]=row[-4]=0
+
 					if self.filters.get(scrub(args.get("party_type"))):
 						row.append(gle.account_currency)
 					else:
diff --git a/erpnext/setup/doctype/naming_series/naming_series.py b/erpnext/setup/doctype/naming_series/naming_series.py
index 33deea4..d382d24 100644
--- a/erpnext/setup/doctype/naming_series/naming_series.py
+++ b/erpnext/setup/doctype/naming_series/naming_series.py
@@ -24,7 +24,7 @@
 			try:
 				options = self.get_options(d)
 			except frappe.DoesNotExistError:
-				frappe.pass_does_not_exist_error()
+				frappe.msgprint('Unable to find DocType {0}'.format(d))
 				continue
 
 			if options: