Invoice number
FreeLogic@rabbinatix/invoice-number by Rabbinatixupdated Oct 4, 2026
Formats a year and a sequence as `INV-2026-00042`.
The sequence is padded with zeros to 5 digits. Longer sequences are kept whole.
Shows: To String, Pad Start, Format with {name} placeholders.
How to use it
Add it to your logic, then add a Call Function step in any logic and pick Invoice number. It belongs to no system, so every system can use it. Or download the TypeScript and call it from your own code.
Inputs
year: Whole number
sequence: Whole number
Outputs
invoiceNumber: Text
Previewdrag the steps around; scroll to zoom
Function Entry, Input / output. 0 inputs, 3 outputs. step 1 of 5
Invoice number
year
sequence
To String, Data. 1 input, 1 output. step 2 of 5
To String
value
result
Pad Start, String. 3 inputs, 1 output. step 3 of 5
Pad Start
text
length
fill
result
Format, String. 2 inputs, 1 output. step 4 of 5
Format "INV-{year}-{seq}"
year
seq
result
Return, Input / output. 2 inputs, 0 outputs. step 5 of 5
Return
invoiceNumber
Arrow keys: next or previous step in flow order. Alt with arrows: nearest step in that direction. Enter: open. Shift F10: more actions.
Examplesrun live against the logic · 2/2 pass
| Passed | Example | Input | Output |
|---|---|---|---|
| Padded | {"year":2026,"sequence":42} | {"invoiceNumber":"INV-2026-00042"} | |
| Longer than 5 digits | {"year":2026,"sequence":123456} | {"invoiceNumber":"INV-2026-123456"} |
Try it
Versions
In this package
Invoice number (entry)
