Repository navigation
Conversation
{SEQ} and {CSEQ} were always padded to 3 digits, so formats that
require a fixed number of digits (e.g. Bulgaria: exactly 10 digits,
0000000001) could not be produced. {SEQ:N} and {CSEQ:N} now pad the
counter to N digits; plain {SEQ}/{CSEQ} keep 3 digits.
Patterns with a width also allocate the real number when the invoice
is created, like plain {SEQ}.
Refs kittendevv#152
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 20, 2026
Merged
Contributor
Author
|
@kittendevv Any opinion on this and the other 3 PRs? Let me know if I need to change something or if you're not happy with one or more PR |
Owner
|
I was still working through em, everything seems great so far. Thanks for you continued contribution to Invio. It is however taking a little longer for me due to school stuff etc. |
Contributor
Author
|
I don't want to stress you, it was just out of curiosity if you feel things going into the right direction or not! Take your time |
Owner
|
Btw about this pr im so sorry but I was also working on this for a little while now. I also made an implementation for this and I am so full of myself I am gonna merge my implementation I made myself. I hope you dont mind Ive had a branch for it |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Closes #152
The reported bug
In #152 a custom pattern (
Фактура-{SEQ}) was saved and "Enable Automatic Invoice Numbering" looked checked, but new invoices still gotINV-2026-001. That is the legacy format, used wheneverinvoiceNumberingEnabledis stored as"false". Older versions showed that stored"false"as a checked box, so numbering looked enabled while the pattern was ignored. This was fixed by #188 and is released in 2.5.0. On a fresh 2.5.0 instance:INV-2026-001, checkbox correctly uncheckedФактура-001What this PR adds
The follow-up comment in #152 lists the Bulgarian requirements: invoice numbers must be exactly 10 digits (
0000000001).{SEQ}was always padded to 3 digits, so that was not possible.{SEQ:N}and{CSEQ:N}pad the counter to N digits (1–20), so{SEQ:10}gives0000000001. Plain{SEQ}/{CSEQ}keep 3 digits, so existing patterns are unchanged (backend/src/database/init.ts).{SEQ}(backend/src/controllers/invoices.ts).Not included
Two other points from that comment need separate PRs and have their own issues:
Verification
On a fresh instance built from this branch, each pattern shows the preview and then two invoices created via the API:
{SEQ:10}00000000010000000001,0000000002Фактура-{SEQ}Фактура-001Фактура-001,Фактура-002INV-{YYYY}-{SEQ}INV-2026-001INV-2026-001,INV-2026-002C{CNUM}-{CSEQ:5}C-00001(no customer selected)C001-00001,C001-00002The new-invoice form shows
0000000003for{SEQ:10}.deno check src/app.tspasses.🤖 Generated with Claude Code