feat(invoice-numbering): add new per_organisation numbering logic #1774
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context
Due to the accounting regulations, we should not reset our
per_organisation
numbering sequence each month.Current logic for November 2023:
COM-202311-001
COM-202311-002
Current logic for December 2023:
COM-202312-001
COM-202312-002
Expected Behaviour:
Feb
PRO-377A-202402-001
PRO-377A-202402-002
PRO-377A-202402-003
PRO-377A-202402-004
March
PRO-377A-202403-001
PRO-377A-202403-002
//RELEASE FEATURE
PRO-377A-202403-003
PRO-377A-202403-004
April
PRO-377A-202404-005
PRO-377A-202404-006
PRO-377A-202404-007
Description
This PR covers described
per_organisation
logic change.There are two main constraints that we had to satisfy and which affected the logic:
organisation_sequence_id
and continue from there (accounting regulations since there should be no gap in a period)per_customer
toper_organisation
, we should simply count all organisation invoices and increment by 1As addition, from now on, default numbering system is
per_organization