Workflow

How to Cancel a Sales Order

Verified end to end. Demo run cancel-sales-order-enc-20260520T003150Z cancelled sales order ENC 9999/110, verified it in the ENC list as canceled, and checked that physical stock stayed unchanged while customer-order quantity decreased.

Evidence Summary

Sales order route
/vendas/enc/view/OTk5OTAwMTEw
List route
/vendas/enc
Workflow run
cancel-sales-order-enc-20260520T003150Z
Cancelled order
999900110 / ENC 9999/110
Evidence file
raw/playwright/workflows/latest-cancel-sales-order-enc.json

Verified sales order cancellation workflow

When to Use This

Use Cancel on an Internal Doc [ENC] when an open sales order should no longer reserve customer demand before invoicing or fulfillment. In the verified run, OfficeGest kept the order searchable, changed it from ABR / Open to ANU / Canceled, and reduced the article's customer-order quantity.

Cancellation is irreversible in the OfficeGest confirmation dialog. Unlike the verified FT, FP, NC, and ND cancellation flows, the ENC run did not show a cancellation-reason selector; the view script called btnDelete('Anular') and opened the irreversible confirmation directly.

Step-by-Step

  1. Open Sales / Internal Doc [ENC] and open the sales order view. The verified run used ENC 9999/110.
  2. Confirm the values before cancellation. Before cancellation, ENC 9999/110 was ABR / Open, total 1.97, ValorPago=0, pending value 1.97, and reference AI-ENC-20260520T002909Z.
  3. Click the Cancel action in the sales order action area.
  4. Confirm the warning dialog: Are you sure you want to cancel? This irreversible operation.
  5. Search the ENC list for the order number. The verified row returned estado=ANU, visible state Canceled, total 1.97, ValorPago=0, and pending value 1.97.
  6. Check stock/order quantities when the ENC includes article lines. Warehouse 1 stock stayed at -41, while qtd_enc_cliente changed from 6 to 5.

Verified Cancellation Values

FieldValue
Sales order internal number999900110
Visible sales order numberENC 9999/110
Customer[910] 100 Ouvidos Lda, VAT 509031862
Cancellation reasonNo reason selector was used in the verified run; the serialized form posted anulacao= empty.
ENC before cancellationABR / Open, total 1.97, ValorPago=0, pending value 1.97.
ENC after cancellationANU / Canceled, total 1.97, ValorPago=0, pending value 1.97.
Stock/order effectWarehouse 1 physical stock stayed -41; qtd_enc_cliente changed from 6 to 5; qtd_enc_forn stayed 2.

Backend Calls Observed

Action or endpointPurpose
deleteDocumentSubmits the ENC cancellation with num=999900110, tipoop=ENC, serialized form data including empty anulacao=, and tot_fin=1.97.
DT_List_Documentos&table=EncVerifies the ENC list before and after cancellation.
dt_list_recalc_stock_articles_lojasVerifies that physical stock stayed unchanged and customer-order quantity decreased after cancellation.

No podeAnularDoc permission check or Sel2_Select_v2&table=motivos_docs reason lookup was captured for the verified ENC cancellation.

Raw evidence: raw/playwright/workflows/cancel-sales-order-enc-20260520T003150Z.json. Screenshots: assets/screenshots/cancel-sales-order-enc-20260520T003150Z-01-enc-view-before-cancel.png through assets/screenshots/cancel-sales-order-enc-20260520T003150Z-04-enc-list.png.