From 2bcd98f35cab272bd4d68151368b9170d5251693 Mon Sep 17 00:00:00 2001 From: barredterra <14891507+barredterra@users.noreply.github.com> Date: Tue, 10 Dec 2024 17:23:00 +0100 Subject: [PATCH] feat: validate discount date in payment schedule (cherry picked from commit 11644241faae5007c16748bd84b0ca02dc3a54df) --- erpnext/controllers/accounts_controller.py | 1 + 1 file changed, 1 insertion(+) diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py index 6a5914ddbe06..c496782650ae 100644 --- a/erpnext/controllers/accounts_controller.py +++ b/erpnext/controllers/accounts_controller.py @@ -2181,6 +2181,7 @@ def validate_payment_schedule_dates(self): 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(