Issuing one invoice
One client, one service, one amount. What happens between the click and the authorization.
- 1 In Invoices → New, pick the client and the service and type the amount. Competence (it cannot be in the future), ISS rate, ISS withheld, description, deductions, discounts and federal withholdings are optional; the service fills the defaults.
- 2 The preview shows ISS base, ISS, federal withholdings and net amount before anything is sent, with the problems it found.
- 3 Choose Issue and transmit, or Save draft. A draft does not take a number; you can edit or delete it.
- 4 On transmit, the invoice takes the next DPS number, is queued, signed with your certificate and sent. It ends authorized, rejected (the government refused it, with the code and message) or failed (the network or the government did not answer; it is retried on its own).
| Status | Meaning |
|---|---|
| draft | Saved, not sent, no number. Editable. |
| queued | Number reserved, waiting for the worker. |
| processing | Signed and on its way to the government. |
| authorized | The government authorized it. Immutable from now on. |
| rejected | Refused by the government. Fix and transmit again; it was never issued. |
| failed | No answer. Retried after 1, 2, 4… minutes, up to 6 attempts, always asking first whether it already exists. |
| canceling | Cancellation event on its way. |
| canceled | Cancelled by the government. Stays in the record. |
Why an invoice is never issued twice
- The number is reserved under a row lock when the invoice is queued, and committed before the worker sees it.
- Creating an invoice accepts an Idempotency-Key: the same key returns the same invoice. The panel sends one with every form.
- Before any retry the worker asks the government whether a document with that number already exists. When the answer is unknown, the invoice stays where it is and nothing is resent.
- The client and the service are copied into the invoice when it is created. Editing the client later does not rewrite a fiscal document.