Evidence Summary
- Simplified invoice route
/vendas/fs/view/OTk5OTAwMDEy- List route
/vendas/fs- Workflow run
cancel-simplified-invoice-fs-20260519T234643Z- Cancelled document
999900012 / FS 9999/12- Evidence file
raw/playwright/workflows/latest-cancel-simplified-invoice-fs.json
When to Use This
Use Cancel on an FS when the issued simplified invoice must be annulled. In the verified run, the FS was already paid during creation, OfficeGest required a cancellation reason, changed the state to ANU, kept the paid value visible in the list, and reversed the stock movement from the sold line.
Cancellation is irreversible in the OfficeGest confirmation dialog. Use it only when the business and fiscal rules allow annulling the issued simplified invoice.
Step-by-Step
- Open Sales / Simplified Invoice [FS] and open the FS view. The verified run used
FS 9999/12. - Confirm it is the correct paid document. The verified FS row had total
1.97, paid value1.97, and pending value0.00. - Click the red Cancel action in the FS action bar.
- In Reason for Cancellation, select 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 FS list for the document number. The verified row returned
estado=ANU, visible state Canceled, total1.97, paid value1.97, and pending value0.00.
Verified Cancellation Values
| Field | Value |
|---|---|
| Internal number | 999900012 |
| Visible document number | FS 9999/12 |
| Customer | [910] 100 Ouvidos Lda, VAT 509031862 |
| Payment before cancellation | [NUM] Numerario amount 1.97; validation returned valid:true and troco:0. |
| Cancellation reason | id_motivo_anulacao=1, Erro de faturacao |
| Final state | ANU, visible as Canceled |
| Total | 1.97 |
| Paid / pending | ValorPago=1.97; pending value remained 0.00 in the FS list row. |
| Stock effect | Warehouse 1 stock for article AI-DEMO-20260519-021105 moved from -37 before FS creation to -38 after save, then returned to -37 after cancellation. |
Backend Calls Observed
| Action or endpoint | Purpose |
|---|---|
payment&option=add | Adds the immediate FS cash payment row before the document is saved. |
payment&option=validate | Validates that the payment equals the FS total before final save. |
saveDocument | Finishes the paid FS and opens the final FS view. |
Sel2_Select_v2 with table=motivos_docs | Loads active cancellation reasons where is_anulacao=1. |
deleteDocument | Submits the actual FS cancellation with num=999900012, tipoop=FS, and the selected cancellation reason. |
DT_List_Documentos&table=FactSim | Verifies the FS row in the list after cancellation. The returned row had estado=ANU and desig_estado=Canceled. |
dt_list_recalc_stock_articles_lojas | Verifies warehouse stock before creation, after save, and after cancellation. |
Raw evidence: raw/playwright/workflows/cancel-simplified-invoice-fs-20260519T234643Z.json. Screenshots: assets/screenshots/cancel-simplified-invoice-fs-20260519T234643Z-01-fs-line-before-payment.png through assets/screenshots/cancel-simplified-invoice-fs-20260519T234643Z-05-fs-list.png.