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

Co-authored-by: barredterra <14891507+barredterra@users.noreply.github.com>
This commit is contained in:
mergify[bot]
2025-01-03 13:19:34 +01:00
committed by GitHub
parent 2c487af2df
commit 500deff3e9

View File

@@ -2353,6 +2353,7 @@ class AccountsController(TransactionBase):
return
for d in self.get("payment_schedule"):
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(