From bfb81ef56f6af482b31d9331bfd13d800dfccb01 Mon Sep 17 00:00:00 2001 From: Deepesh Garg Date: Wed, 30 Nov 2022 20:53:41 +0530 Subject: [PATCH] fix: Due date for month end payment term --- erpnext/controllers/accounts_controller.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py index b7a80c1019..5a051e3baf 100644 --- a/erpnext/controllers/accounts_controller.py +++ b/erpnext/controllers/accounts_controller.py @@ -2311,7 +2311,7 @@ def get_due_date(term, posting_date=None, bill_date=None): elif term.due_date_based_on == "Day(s) after the end of the invoice month": due_date = add_days(get_last_day(date), term.credit_days) elif term.due_date_based_on == "Month(s) after the end of the invoice month": - due_date = add_months(get_last_day(date), term.credit_months) + due_date = get_last_day(add_months(date, term.credit_months)) return due_date @@ -2323,7 +2323,7 @@ def get_discount_date(term, posting_date=None, bill_date=None): elif term.discount_validity_based_on == "Day(s) after the end of the invoice month": discount_validity = add_days(get_last_day(date), term.discount_validity) elif term.discount_validity_based_on == "Month(s) after the end of the invoice month": - discount_validity = add_months(get_last_day(date), term.discount_validity) + discount_validity = get_last_day(add_months(date, term.discount_validity)) return discount_validity