checkSequentialNumberGaps
The checkSequentialNumberGaps
method verifies whether the next sequential e-document number is already in use, queued, or missing. It helps ensure continuous numbering for tax authorities that require sequential numbers.
Input Parameters
Use the following parameter to indicate which subsidiary and category should be checked for sequential number gaps.
Parameter |
Type |
Description |
---|---|---|
subsidiaryId |
String, Number |
Subsidiary internal ID. |
Return Value
The method returns the e-document series and indicators of whether gaps exist in the sequence.
Property |
Type |
Description |
---|---|---|
success |
Boolean |
Indicates whether the check was successful. |
message |
String |
Success or error message. |
details |
Array |
List of objects with information about gaps in the sequence. |
Each object in details
contains:
Field |
Type |
Description |
---|---|---|
taxAuthority |
String, Number |
ID of the Tax Authority Certification Service record. |
environment |
String, Number |
Identifies the certification environment used to send the e-document:
|
documents |
Array |
List of documents for each series. |
Each object in documents
contains:
Field |
Type |
Description |
---|---|---|
documentSeries |
String |
E-document series number. |
gapExists |
Boolean |
Indicates if a gap exists in the document number sequence. |
message |
String |
Indicates whether the next expected document number is already in the processing queue. |
Example
/**
* This is the exposed API method for checking the next sequential number inside the message queue.
*
* @param {Object} context
* @returns {Object} result
*/
var checkSequentialNumberGaps = function (context) {
var ecsApi = loadEcsApi();
return ecsApi.checkSequentialNumberGaps(context, "");
};