Merge pull request #44646 from barredterra/validate-discount-date

feat: validate discount date in payment schedule
This commit is contained in:
ruthra kumar
2024-12-17 10:58:15 +05:30
committed by GitHub

View File

@@ -2361,6 +2361,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(