show all duplicate rows after checking for duplicate due date
This commit is contained in:
@@ -650,6 +650,7 @@ class AccountsController(TransactionBase):
|
|||||||
|
|
||||||
def validate_payment_schedule_dates(self):
|
def validate_payment_schedule_dates(self):
|
||||||
dates = []
|
dates = []
|
||||||
|
li = []
|
||||||
if self.due_date and getdate(self.due_date) < getdate(self.posting_date):
|
if self.due_date and getdate(self.due_date) < getdate(self.posting_date):
|
||||||
frappe.throw(_("Due Date cannot be before posting date"))
|
frappe.throw(_("Due Date cannot be before posting date"))
|
||||||
|
|
||||||
@@ -657,7 +658,14 @@ class AccountsController(TransactionBase):
|
|||||||
if getdate(d.due_date) < getdate(self.posting_date):
|
if getdate(d.due_date) < getdate(self.posting_date):
|
||||||
frappe.throw(_("Row {0}: Due Date cannot be before posting date").format(d.idx))
|
frappe.throw(_("Row {0}: Due Date cannot be before posting date").format(d.idx))
|
||||||
elif d.due_date in dates:
|
elif d.due_date in dates:
|
||||||
frappe.throw(_("Row {0}: Duplicate due date found").format(d.idx))
|
li.append('{0} in row {1}'.format(d.due_date, d.idx))
|
||||||
|
# frappe.throw(_("Row {0}: Duplicate due date found").format(d.idx))
|
||||||
|
dates.append(d.due_date)
|
||||||
|
|
||||||
|
if li:
|
||||||
|
duplicates = '<br>' + '<br>'.join(li)
|
||||||
|
frappe.throw(_("Rows with duplicate due dates in other rows were found: {list}").format(list=duplicates))
|
||||||
|
|
||||||
|
|
||||||
def validate_payment_schedule_amount(self):
|
def validate_payment_schedule_amount(self):
|
||||||
total = 0
|
total = 0
|
||||||
|
|||||||
Reference in New Issue
Block a user