Evidence Summary
- Invoice / receipt route
/vendas/fr/view/OTk5OTAwODQ5- List route
/vendas/fr- Workflow run
cancel-invoice-receipt-fr-20260519T234010Z- Cancelled document
999900849 / FR 9999/849- Evidence file
raw/playwright/workflows/latest-cancel-invoice-receipt-fr.json
When to Use This
Use Cancel on an FR when the issued invoice / receipt must be annulled. In the verified run, the FR was already paid during creation, OfficeGest still required a cancellation reason, changed the document state to ANU, kept the paid value visible in the list, and reversed the stock movement from the sold line.
Cancellation is an irreversible operation in the OfficeGest confirmation dialog. Use it only when the business and fiscal rules allow annulling the issued FR.
Step-by-Step
- Open Sales / Invoice / Receipt [FR] and open the FR view. The verified run used
FR 9999/849. - Confirm it is the correct paid document. The verified FR row had total
1.97, paid value1.97, and pending value0.00. - Click the red Cancel action in the FR 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 FR 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 | 999900849 |
| Visible document number | FR 9999/849 |
| 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 FR list row. |
| Stock effect | Warehouse 1 stock for article AI-DEMO-20260519-021105 moved from -37 before FR creation to -38 after save, then returned to -37 after cancellation. |
Backend Calls Observed
| Action or endpoint | Purpose |
|---|---|
payment&option=add | Adds the immediate FR cash payment row before the document is saved. |
payment&option=validate | Validates that the payment equals the FR total before final save. |
saveDocument | Finishes the paid FR and opens the final FR view. |
Sel2_Select_v2 with table=motivos_docs | Loads active cancellation reasons where is_anulacao=1. |
deleteDocument | Submits the actual FR cancellation with num=999900849, tipoop=FR, and the selected cancellation reason. |
DT_List_Documentos | Verifies the FR 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-invoice-receipt-fr-20260519T234010Z.json. Screenshots: assets/screenshots/cancel-invoice-receipt-fr-20260519T234010Z-01-fr-line-before-payment.png through assets/screenshots/cancel-invoice-receipt-fr-20260519T234010Z-05-fr-list.png.
Validation Notes
- Paid FR can be cancelled: the verified document was paid before cancellation and still became
ANU/ Canceled. - State is not deletion: the FR remained searchable in the FR list after cancellation.
- Paid value remains visible: the cancelled FR list row still showed
ValorPago=1.97and pending value0.00. - Stock was reversed: the original FR lowered stock by one unit; cancelling it restored that unit in warehouse
1.