feat: validate discount date in payment schedule (backport #44646) (#44726)

Co-authored-by: barredterra <14891507+barredterra@users.noreply.github.com>
This commit is contained in:
mergify[bot]
2025-01-09 18:51:27 +01:00
committed by GitHub
parent c331a4fa84
commit f4b7fa8980

View File

@@ -2188,6 +2188,9 @@ class AccountsController(TransactionBase):
return
for d in self.get("payment_schedule"):
if d.due_date and d.discount_date:
d.validate_from_to_dates("discount_date", "due_date")
if self.doctype == "Sales Order" and getdate(d.due_date) < getdate(self.transaction_date):
frappe.throw(
_("Row {0}: Due Date in the Payment Terms table cannot be before Posting Date").format(