Workflow

How to Convert a Sales Invoice to a Credit Note

Verified end to end. Demo run sales-invoice-to-credit-note-20260519T173701Z created source invoice FT 9999/1674, used To convert / Credit note, and saved credit note NC 9999/61 / 999900061.

Evidence Summary

Source FT
999901674 / FT 9999/1674
Target NC
999900061 / NC 9999/61
Target view
/vendas/nc/view/OTk5OTAwMDYx
Workflow run
sales-invoice-to-credit-note-20260519T173701Z
Evidence file
raw/playwright/workflows/latest-sales-invoice-to-credit-note.json

Verified invoice to credit note workflow

When to Use This

Use this path when the user is already viewing an issued Invoice [FT] and needs to create a linked Credit Note [NC]. This differs from cancelling the invoice: the source FT remains open and searchable, while OfficeGest creates a separate NC document that references the FT line.

Step-by-Step

  1. Open the source invoice. The verified source was FT 9999/1674.
  2. Click To convert, then choose Credit note.
  3. OfficeGest opens /vendas/nc/create with customer 910 already filled and the Associate documents: Invoice modal open.
  4. Confirm the source invoice is selected. The verified modal selected FT 9999/1674 and loaded line 1 for article AI-DEMO-20260519-021105.
  5. Select the credit-note reason. The verified run used reason id 1, Erro de faturacao.
  6. Click the association modal Save. OfficeGest copies the FT line into the NC draft and keeps source metadata: ndocori=999901674, tipodocori=FT, and linhandocori=1.
  7. Review the NC totals. The verified draft had net 1.60, VAT 0.37, and total 1.97.
  8. Click Save and Finish, then confirm Are you sure?.
  9. Verify the NC list. The verified row returned NC 9999/61, ABR / Open, total 1.97, paid value 0.00, and pending value 1.97.
  10. Verify the source FT if needed. The source FT 9999/1674 remained ABR / Open in the FT list.

Verified Values

FieldValue
Source invoice999901674 / FT 9999/1674
Credit note999900061 / NC 9999/61
Customer[910] 100 Ouvidos Lda, VAT 509031862
Reasonid_motivo=1, Erro de faturacao
Copied lineArticle AI-DEMO-20260519-021105, quantity 1, warehouse 1, VAT 23%.
Source metadatandocori=999901674, tipodocori=FT, linhandocori=1.
NC stateABR / Open, total 1.97, paid 0.00, pending 1.97.
Source FT stateABR / Open after the credit note was saved.
Stock effectSource FT moved warehouse 1 stock from 0 to -1; the NC restored it to 0.

Backend Calls Observed

Action or endpointPurpose
POST /vendas/nc/createOpens NC create from the FT view with copy=1, num_copy=999901674, and tipoop_copy=FT.
associar_documento&option=load_modalLoads the source invoice association modal for target NC.
associar_documento&option=listar_documentosPreselects the source FT document.
associar_documento&option=listar_tabelaLoads the source FT lines that can be credited.
associar_documento&option=save_linhasCopies the selected FT line into the NC draft.
Sel2_Select_v2&table=motivos_docsLoads NC reasons with where[is_nc]=1.
saveDocumentSaves the finished NC. The verified final view was NC 9999/61.
DT_List_DocumentosVerifies both the NC list and the source FT list after save.
dt_list_recalc_stock_articles_lojasVerifies stock moved back to the pre-invoice quantity after the NC.

Raw evidence: raw/playwright/workflows/sales-invoice-to-credit-note-20260519T173701Z.json. Screenshots: assets/screenshots/sales-invoice-to-credit-note-20260519T173701Z-01-source-ft-filled.png through assets/screenshots/sales-invoice-to-credit-note-20260519T173701Z-06-nc-list.png.