Workflow

How to Cancel a Debit Note

Verified end to end. Demo run cancel-debit-note-nd-20260520T001612Z cancelled debit note ND 9999/5, verified it in the ND list as canceled, confirmed source invoice FT 9999/1707 stayed open and unpaid, and checked that stock stayed unchanged.

Evidence Summary

Debit note route
/vendas/nd/view/OTk5OTAwMDA1
List route
/vendas/nd
Workflow run
cancel-debit-note-nd-20260520T001612Z
Cancelled debit note
999900005 / ND 9999/5
Source invoice
999901707 / FT 9999/1707
Evidence file
raw/playwright/workflows/latest-cancel-debit-note-nd.json

Verified debit note cancellation workflow

When to Use This

Use Cancel on a debit note when the ND adjustment itself was issued incorrectly and should be annulled. In the verified run, OfficeGest kept the ND searchable, changed it from ABR / Open to ANU / Canceled, left the source invoice unchanged, and did not move stock.

Cancellation is irreversible in the OfficeGest confirmation dialog. The verified cancellation did not change the source invoice settlement state; FT 9999/1707 stayed ABR / Open with paid value 0.00.

Step-by-Step

  1. Open Sales / Debit Note [ND] and open the debit note view. The verified run used ND 9999/5.
  2. Confirm the source and values before cancellation. Before cancellation, ND 9999/5 was ABR / Open, total 1.97, ValorPago=0, pending value 1.97, and source FT 9999/1707.
  3. Click the red Cancel action in the debit note action bar.
  4. In Reason for Cancellation, select a cancellation reason. The verified run used reason id 1, visible as Erro de faturacao.
  5. Click the red Cancel button inside the reason modal.
  6. Confirm the warning dialog: Are you sure you want to cancel? This irreversible operation.
  7. Search the ND list for the debit note number. The verified row returned estado=ANU, visible state Canceled, total 1.97, ValorPago=0, and pending value 1.97.
  8. Search the source FT list for FT 9999/1707. The verified row stayed ABR / Open, ValorPago=0, and pending value 1.97.
  9. Check stock when the adjustment includes article lines. Warehouse 1 stayed at -41, matching the verified ND behavior that did not move physical stock.

Verified Cancellation Values

FieldValue
Debit note internal number999900005
Visible debit note numberND 9999/5
Customer[910] 100 Ouvidos Lda, VAT 509031862
Source document999901707 / FT 9999/1707
Cancellation reasonid_motivo_anulacao=1, Erro de faturacao
ND before cancellationABR / Open, total 1.97, ValorPago=0, pending value 1.97.
ND after cancellationANU / Canceled, total 1.97, ValorPago=0, pending value 1.97.
Source FT after cancellationABR / Open, ValorPago=0, pending value 1.97.
Stock effectWarehouse 1 stock for AI-DEMO-20260519-021105 stayed -41.

Backend Calls Observed

Action or endpointPurpose
podeAnularDocChecks whether the ND can be cancelled. The verified call used num=999900005, tipoop=ND, and returned succeeded:true.
Sel2_Select_v2&table=motivos_docsLoads active cancellation reasons with where[is_anulacao]=1 and where[activo]=1.
deleteDocumentSubmits the ND cancellation with tipoop=ND, id_motivo_anulacao=1, and tot_fin=1.97.
DT_List_Documentos&table=NDebVerifies the ND list before and after cancellation.
DT_List_Documentos&table=FactVerifies the source invoice after cancellation.
dt_list_recalc_stock_articles_lojasVerifies that article stock stayed unchanged after the cancellation.

Raw evidence: raw/playwright/workflows/cancel-debit-note-nd-20260520T001612Z.json. Screenshots: assets/screenshots/cancel-debit-note-nd-20260520T001612Z-01-nd-view-before-cancel.png through assets/screenshots/cancel-debit-note-nd-20260520T001612Z-04-nd-list.png.