Skip to content
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

feat(invoice-numbering): add new per_organisation numbering logic #1774

Merged
merged 2 commits into from
Mar 13, 2024

Conversation

lovrocolic
Copy link
Collaborator

@lovrocolic lovrocolic commented Mar 12, 2024

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:

  1. After releasing the feature we should take the last organisation_sequence_id and continue from there (accounting regulations since there should be no gap in a period)
  2. If invoice numbering switched from per_customer to per_organisation, we should simply count all organisation invoices and increment by 1

As addition, from now on, default numbering system is per_organization

@lovrocolic lovrocolic merged commit 97cdf0d into main Mar 13, 2024
7 checks passed
@lovrocolic lovrocolic deleted the ftr-new-org-numbering-logic branch March 13, 2024 12:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants