fix: default due_date was wrong calculated on template "_Test Payment Term Template 1" (last day of next month)
diff --git a/erpnext/accounts/party.py b/erpnext/accounts/party.py
index b6eb3ed..01cfb58 100644
--- a/erpnext/accounts/party.py
+++ b/erpnext/accounts/party.py
@@ -550,7 +550,7 @@
 		elif term.due_date_based_on == "Day(s) after the end of the invoice month":
 			due_date = max(due_date, add_days(get_last_day(due_date), term.credit_days))
 		else:
-			due_date = max(due_date, add_months(get_last_day(due_date), term.credit_months))
+			due_date = max(due_date, get_last_day(add_months(due_date, term.credit_months)))
 	return due_date