Counters and Number Ranges
Invoices, credits, cancellations and dunning reminders must have unique numbers to comply with legal regulations. In
Draft status, these numbers are temporary and of no legal relevance. When finalizing invoices or dunning reminders, however, JustOn creates the unique and unalterable numbers based on defined counters.
Invoice numbers must be unique and unalterable in order to clearly and unambiguously identify an invoice once it is finalized, that is, effective in legal and bookkeeping terms. Applying JustOn's counter and number range functionality, you make sure that these requirements are met.
The fact that some jurisdictions demand sequential invoice numbers, however, does not imply that your invoice numbers must necessarily be consecutive and without gaps in numbering – solely the uniqueness is required. As long as you can provide an explanation for non-consecutive numbers (like a specifically configured counter or just a canceled invoice), breaks in sequence are acceptable. For Germany, for example, the Sales Tax Application Decree states that a gapless sequence of issued invoice numbers is not mandatory ("Umsatzsteuer-Anwendungserlass", section 14.5).
Counter and Number Range Implementation
JustOn implements counters using the custom setting Counters. The following fields are available:
|Name||Specifies the name of the counter, is to be referred to by the template.|
||Defines the interval after which the counter is reset. If empty, the counter is not reset.|
||Specifies the pattern of the produced number. It may contain custom placeholders (defined for fields on the invoice, account, subscription, business entity, related invoice and email contact), and must define the minimum number of digits like
|Use Account Counters (checkbox)||
||If checked, creates a new number range for each account that uses this counter.|
|Start Count||Optionally, specifies a start count. If set, the associated number range will start with the next number (
JustOn evaluates the start count on number range creation and after reset.
If empty, defaults to
The default counter as shipped with JustOn, for example, uses the following pattern template:
This produces invoice numbers of the following pattern:
201700001, 201700002, 201700003
The count increases each time an invoice is set
Open and a new invoice ID is created.
The following table lists some examples.
Each counter is associated to one or more number ranges. Number ranges are implemented as a custom object. They represent the groups of numbers to which the unique numbers created for an invoice, dunning reminder etc. belong. If a number range as required by the counter does not exist, JustOn creates one automatically with the count set
With the counter field
Reset set to
YEARLY, JustOn creates a new number range for each year. Likewise it creates a new number range for each month if
Reset is set
MONTHLY, and every day if
Reset is set
DAILY. The reset feature can be combined with the setting
Use Account Counters.
JustOn selects number ranges based on the counter defined for the invoice, the account of the invoice and the invoice date for day/month/year.
Number ranges include the following fields:
|Counter Name||Specifies the name of the associated counter.|
|Counter||Shows the current count for this number range. Equals the number of the last invoice.|
|Year||Shows the year for this number range. Is empty if the counter is set to not reset.|
|Month||Shows the month for this number range. Is empty if the counter is set to not reset or set to reset
|Day||Shows the day for this number range. Is empty if the counter is set to not reset or set to reset
|Account||Shows the account for this number range. Is empty if the checkbox
By default, JustOn provides the following counters:
Default: A single counter used by default for generating all invoice, credit, cancellation or dunning IDs. This counter is assigned to the default invoice template.
If you have more than one template or template details to cover specific needs, you can use an individual counter with each template or template detail. To this end, configure additional counters. If you use the dunning functionality, for example, configure a dunning counter first and assign it to the corresponding template detail.
If the template or template detail does not define a counter, JustOn falls back to the counter set on the business entity. If the system cannot find a valid counter, it shows an exception.
Dunning Run: Used to count the individual dunning runs. The dunning run counter does not offer the reset feature and does not work with placeholders.
- Subscription: Used to count the subscriptions. The subscription counter does not offer the reset feature and supports only a limited set of placeholders (account-related and built-in).
Number Range History
In case of issues or disputes with respect to the sequence of JustOn's numbering, you may may need some detailed tracking or debugging information about the number range usage. To this end, JustOn introduces dedicated history fields and history tracking for number ranges.
The number range history is available as of JustOn 2.64.
For each generated number, the following information is recorded:
|Counter||The current count for this number range.|
|Timestamp||The date and time of the latest count increase.|
|Target ID||The Salesforce ID of the record on which the counter has been used the last time.|
|Last Generated Name||The last produced counter (invoice number, etc.)|
In addition, each history record includes
- The name of the user who triggered the counter generation
- The last value and the current value for
Last Generated Name.