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
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
- Open the source invoice. The verified source was
FT 9999/1674. - Click To convert, then choose Credit note.
- OfficeGest opens
/vendas/nc/createwith customer910already filled and the Associate documents: Invoice modal open. - Confirm the source invoice is selected. The verified modal selected
FT 9999/1674and loaded line1for articleAI-DEMO-20260519-021105. - Select the credit-note reason. The verified run used reason id
1, Erro de faturacao. - Click the association modal Save. OfficeGest copies the FT line into the NC draft and keeps source metadata:
ndocori=999901674,tipodocori=FT, andlinhandocori=1. - Review the NC totals. The verified draft had net
1.60, VAT0.37, and total1.97. - Click Save and Finish, then confirm Are you sure?.
- Verify the NC list. The verified row returned
NC 9999/61,ABR/ Open, total1.97, paid value0.00, and pending value1.97. - Verify the source FT if needed. The source
FT 9999/1674remainedABR/ Open in the FT list.
Verified Values
| Field | Value |
|---|---|
| Source invoice | 999901674 / FT 9999/1674 |
| Credit note | 999900061 / NC 9999/61 |
| Customer | [910] 100 Ouvidos Lda, VAT 509031862 |
| Reason | id_motivo=1, Erro de faturacao |
| Copied line | Article AI-DEMO-20260519-021105, quantity 1, warehouse 1, VAT 23%. |
| Source metadata | ndocori=999901674, tipodocori=FT, linhandocori=1. |
| NC state | ABR / Open, total 1.97, paid 0.00, pending 1.97. |
| Source FT state | ABR / Open after the credit note was saved. |
| Stock effect | Source FT moved warehouse 1 stock from 0 to -1; the NC restored it to 0. |
Backend Calls Observed
| Action or endpoint | Purpose |
|---|---|
POST /vendas/nc/create | Opens NC create from the FT view with copy=1, num_copy=999901674, and tipoop_copy=FT. |
associar_documento&option=load_modal | Loads the source invoice association modal for target NC. |
associar_documento&option=listar_documentos | Preselects the source FT document. |
associar_documento&option=listar_tabela | Loads the source FT lines that can be credited. |
associar_documento&option=save_linhas | Copies the selected FT line into the NC draft. |
Sel2_Select_v2&table=motivos_docs | Loads NC reasons with where[is_nc]=1. |
saveDocument | Saves the finished NC. The verified final view was NC 9999/61. |
DT_List_Documentos | Verifies both the NC list and the source FT list after save. |
dt_list_recalc_stock_articles_lojas | Verifies 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.