Serial number - ShenTengTu/node-tw-e-invoice GitHub Wiki

Serial number

序列號標識每次傳輸的信息。根據API規範,第一次傳輸時應該是0000000001,並且每次發送信息時都應該加上1。您可以使用APIUti.Serial生成序列號。

The serial number identifies the information for each transfer.

According to the API spec, it should be 0000000001 for the first transmission,and the value plus 1 each time the information is sent.

You can use APIUti.Serial to generate serial number:

const {Serial}= require('node-tw-e-invoice').APIUtil;
let a = new Serial();
console.log(a.next());//0000000001
console.log(a.next());//0000000002
console.log(a.next());//0000000003
console.log(a.anew().next());//0000000001