Workflow

How to Edit a Saved Sales Invoice Draft

Verified end to end. Demo run edit-sales-invoice-draft-20260519T180638Z opened FT draft 467, changed its reference, clicked Save Draft, and verified the edited draft reopened as active draft 468.

Evidence Summary

Original draft
467 / /vendas/ft/rasc/NDY3
Active edited draft
468 / /vendas/ft/rasc/NDY4
Edited reference
AI-FT-DRAFT-20260519T180605Z-EDIT
Workflow run
edit-sales-invoice-draft-20260519T180638Z
Evidence file
raw/playwright/workflows/latest-edit-sales-invoice-draft.json

Verified saved invoice draft edit workflow

When to Use This

Use this when an invoice was saved as an FT draft and the user needs to correct header information before issuing it. The verified run changed the draft reference only; line editing should be verified separately before documenting it as covered.

In the verified run, re-saving the edited draft returned a new draft number. OfficeGest moved from draft 467 to draft 468, so users should keep working from the new draft URL after saving edits.

Step-by-Step

  1. Open the saved FT draft. The verified source was /vendas/ft/rasc/NDY3.
  2. Confirm the page title is OG - Invoice [FT] and the document is still a draft route, not a final /view/ route.
  3. Review the existing customer and lines. The verified draft had customer 910 and one article line for AI-DEMO-20260519-021105.
  4. Edit the header field that needs correction. The verified run changed the reference from AI-FT-DRAFT-20260519T180605Z to AI-FT-DRAFT-20260519T180605Z-EDIT.
  5. Click Save Draft.
  6. OfficeGest saves through saveRascunho. The verified response was "OK:468:&=&AI-DEMO-20260519-021105:1#".
  7. Use the new draft route shown after save. The verified edited draft reopened at /vendas/ft/rasc/NDY4.
  8. Reopen or refresh the active draft and confirm the edited value persisted.
  9. Do not treat the draft as issued. The verified final FT list search for the edited reference returned no final invoice rows.

Verified Values

FieldValue
Original draft467, route /vendas/ft/rasc/NDY3.
Active edited draft468, route /vendas/ft/rasc/NDY4.
Customer[910] 100 Ouvidos Lda, VAT 509031862.
Edited fieldReference changed to AI-FT-DRAFT-20260519T180605Z-EDIT.
Line preservedArticle AI-DEMO-20260519-021105, quantity 1, warehouse 1, VAT 23%.
Final document listNo final FT rows were returned for the edited reference.
Stock effectWarehouse 1 stock stayed at -3 before and after the draft edit.

Backend Calls Observed

Action or endpointPurpose
listaTabDocumentoLoads the saved FT draft line after opening the draft route.
create_document&option=calcular_totaisRecalculates totals after the draft is loaded.
saveRascunhoRe-saves the edited draft. The verified response returned draft 468.
NameEntidades&tabla=ClienteReloads customer context after the edited draft route opens.
DT_List_DocumentosConfirms the edited draft reference is not present as a finalized FT invoice.
dt_list_recalc_stock_articles_lojasConfirms no stock movement happened during draft edit and re-save.

Raw evidence: raw/playwright/workflows/edit-sales-invoice-draft-20260519T180638Z.json. Screenshots: assets/screenshots/edit-sales-invoice-draft-20260519T180638Z-01-open-draft-before-edit.png through assets/screenshots/edit-sales-invoice-draft-20260519T180638Z-04-reopened-edited-draft.png.