Merge pull request #33183 from deepeshgarg007/month_end_due_date

fix: Due date for month end payment term
This commit is contained in:
Deepesh Garg 2022-12-01 18:16:13 +05:30 committed by GitHub
commit 9ddd838f2d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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