erpnext
erpnext copied to clipboard
fix: logic: 'following calendar months' now allows yearly billing cycles
For my association I wanted to be able to create yearly memberships tied to open-ended subscriptions that follow the calendar year. This was impossible because of validation errors and missing logic.
In the current codebase, there is a check for the existence of a subscription end date when "follow calendar months" is enabled. It complains about the absence of a subscription end date when you create a subscription on a yearly billing cycle. This exception seems unintentional and I cannot think of a valid use case where you'd want to require a predefined subscription end date with yearly subscriptions but not monthly/quarterly. As such, I am submitting this fix (which otherwise leaves the validation check in place).
The second and third commit expand the get_current_invoice_end method invoicing logic to work with yearly subscriptions as well as amending the option description in the json file.
bump
This pull request has been automatically marked as inactive because it has not had recent activity. It will be closed within 3 days if no further activity occurs, but it only takes a comment to keep a contribution alive :) Also, even if it is closed, you can always reopen the PR when you're ready. Thank you for contributing.
whoops, premature push, sorry.
oh, this isn't better. sorry number 2
PR hopefully superseded by https://github.com/frappe/erpnext/pull/48770
⚠️ The sha of the head commit of this PR conflicts with #48770. Mergify cannot evaluate rules on this PR. ⚠️