-
Notifications
You must be signed in to change notification settings - Fork 48
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
Improvements for the due date feature #641
Conversation
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.
Just one remark. You have placed the method get_due_date()
in the Invoice document class, but the display_due_date()
on the main class. Since this is restricted to the Invoice, don't you think they should both be in the Invoice class?
It seems that the |
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.
In that case I think we should make the function display_due_date
a bit more flexible:
- adding a filter in the document type check
- using
wcpdf_get_document
instead ofwcpdf_get_invoice
- add a callable check under
get_due_date
, just in case - Renaming this hook:
wpo_wcpdf_{document_slug}_due_date_display
To make it more general purpose instead of just working for the |
@alexmigf In the latest commit, I also updated the hook name for filters. Instead of adding the document slug in the hook name, I send the document type as an argument to make them uniform. It seemed there was no need to have different hook names for them. |
@alexmigf Ready to review. |
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.
Perfect!
close #640