Evidence Summary
- Invoice route
/vendas/ft/view/OTk5OTAxNjcy- List route
/vendas/ft- Workflow run
cancel-sales-invoice-ft-20260519T172726Z- Cancelled invoice
999901672 / FT 9999/1672- Evidence file
raw/playwright/workflows/latest-cancel-sales-invoice-ft.json
When to Use This
Use Cancel on an FT invoice when the issued invoice must be annulled instead of corrected with a credit note. In the verified run, the action was irreversible, required a cancellation reason, changed the FT state to ANU, and reversed the stock effect from the invoice line.
Only cancel when the business and fiscal rules allow cancellation. If the invoice should remain issued but be financially corrected, use the credit note workflow instead.
Step-by-Step
- Open Sales / Invoice [FT] and open the invoice view. The verified run used
FT 9999/1672. - Confirm the invoice is the correct document and still shows Open. The verified FT row had total
1.97, paid value0.00, and pending value1.97. - Click the red Cancel action in the invoice action bar.
- OfficeGest checks whether the document can be cancelled through
podeAnularDoc. In the verified run, the response was{"succeeded":true,"message":null,"params":null}. - In Reason for Cancellation, choose a cancellation reason. The verified run used reason id
1, visible as Erro de faturacao. - Click the red Cancel button inside the reason modal.
- Confirm the warning dialog: Are you sure you want to cancel? This irreversible operation.
- Search the FT list for the invoice number. The verified row returned
estado=ANU, visible state Canceled, total1.97, paid value0.00, and pending value1.97.
Verified Cancellation Values
| Field | Value |
|---|---|
| Internal number | 999901672 |
| Visible document number | FT 9999/1672 |
| Reference | AI-FT-CANCEL-20260519T172726Z |
| Customer | [910] 100 Ouvidos Lda, VAT 509031862 |
| Cancellation reason | id_motivo_anulacao=1, Erro de faturacao |
| Final state | ANU, visible as Canceled |
| Total | 1.97 |
| Paid / pending | ValorPago=0; pending value remained 1.97 in the FT list row. |
| Stock effect | Warehouse 1 stock for article AI-DEMO-20260519-021105 moved from -2 before cancellation to -1 after cancellation. |
Backend Calls Observed
| Action or endpoint | Purpose |
|---|---|
podeAnularDoc&num=999901672&tipoop=FT | Checks whether the FT can be cancelled before showing or submitting the cancellation flow. |
Sel2_Select_v2 with table=motivos_docs | Loads active cancellation reasons where is_anulacao=1. |
deleteDocument | Submits the actual FT cancellation with num=999901672, tipoop=FT, and the serialized document form including cancellation reason. |
DT_List_Documentos | Verifies the invoice row in the FT list after cancellation. The returned row had estado=ANU and desig_estado=Canceled. |
dt_list_recalc_stock_articles_lojas | Verifies warehouse stock before and after cancellation. |
Raw evidence: raw/playwright/workflows/cancel-sales-invoice-ft-20260519T172726Z.json. Screenshots: assets/screenshots/cancel-sales-invoice-ft-20260519T172726Z-01-filled-invoice.png through assets/screenshots/cancel-sales-invoice-ft-20260519T172726Z-05-ft-list.png.
Validation Notes
- Irreversible confirmation: OfficeGest displayed a confirmation warning before submitting the cancellation.
- Reason required: the cancellation modal contains
id_motivo_anulacao; the verified flow selected a reason before submitting. - State is not deletion: the invoice remained searchable in the FT list, but its state changed from
ABR/ Open toANU/ Canceled. - Stock was reversed: the original FT lowered stock by one unit; cancelling it restored one unit in warehouse
1.