Merge pull request #33197 from frappe/mergify/bp/version-14-hotfix/pr-33183

fix: Due date for month end payment term (backport #33183)
This commit is contained in:
Deepesh Garg
2022-12-02 10:09:55 +05:30
committed by GitHub

View File

@@ -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