-
Notifications
You must be signed in to change notification settings - Fork 7.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: validate due date code and message according to doctype #45126
Conversation
validate_due_date( | ||
posting_date, | ||
self.due_date, | ||
self.payment_terms_template, | ||
posting_date=posting_date, | ||
due_date=self.due_date, | ||
template_name=self.payment_terms_template, | ||
doctype=self.doctype, | ||
) | ||
elif self.doctype == "Purchase Invoice": | ||
validate_due_date( | ||
posting_date, | ||
self.due_date, | ||
self.bill_date, | ||
self.payment_terms_template, | ||
posting_date=posting_date, | ||
due_date=self.due_date, | ||
bill_date=self.bill_date, | ||
template_name=self.payment_terms_template, | ||
doctype=self.doctype, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no need to call the function separately for sales and Purchase Invoices. Commonify them; only due_date is different in both cases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @nabinhait ,
I have removed the redundant mandatory error validation. Could you please check again now?
Closes #44998
Sales Invoice
Purchase Invoice