Workflow

How to Delete a Line from a Sales Invoice Draft

Verified end to end. Demo run delete-line-sales-invoice-draft-20260519T182132Z opened FT draft 472, removed one of two article lines, clicked Save Draft, and verified the active edited draft 473 contained one line.

Evidence Summary

Original draft
472 / /vendas/ft/rasc/NDcy
Active edited draft
473 / /vendas/ft/rasc/NDcz
Line count
2 lines before, 1 line after
Reference
AI-FT-DRAFT-20260519T182039Z-ADDLINE-DELLINE
Evidence file
raw/playwright/workflows/latest-delete-line-sales-invoice-draft.json

Verified saved invoice draft line deletion workflow

When to Use This

Use this when an FT draft is still editable and the user needs to remove an article line before issuing the invoice. The verified run started from a two-line draft, deleted the second line, saved the document as a draft again, and confirmed no final invoice or stock movement was created by the draft edit.

Like other draft edit workflows, re-saving after a line deletion returned a new active draft number. The verified run moved from draft 472 to draft 473.

Step-by-Step

  1. Open the saved FT draft. The verified source was /vendas/ft/rasc/NDcy.
  2. Confirm the page is still OG - Invoice [FT] on a draft route, not a final invoice view.
  3. Review the line grid and identify the line to remove. The verified draft had two lines for article AI-DEMO-20260519-021105.
  4. Use the line's delete action and confirm deletion when OfficeGest asks.
  5. Confirm the line grid now shows the reduced line count or quantity. The verified draft changed from two matching rows to one matching row.
  6. Click Save Draft.
  7. Use the new draft route returned by OfficeGest. The verified re-save returned OK:473 and opened active draft /vendas/ft/rasc/NDcz.
  8. Reopen or refresh the active draft and confirm the removed line is still absent.
  9. Do not treat the document as issued until you use Save and Finish. The verified final FT list search returned no final invoice rows.

Verified Values

FieldValue
Original draft472, route /vendas/ft/rasc/NDcy.
Active edited draft473, route /vendas/ft/rasc/NDcz.
Customer[910] 100 Ouvidos Lda, VAT 509031862.
Line resultRow count changed from 2 to 1; total quantity changed from 2 to 1.
Total with VATLine total with VAT changed from 3.93354 to 1.96677.
Final document listNo final FT rows were returned for reference AI-FT-DRAFT-20260519T182039Z-ADDLINE-DELLINE.
Stock effectWarehouse 1 stock stayed at -3 before and after the draft line deletion.

Backend Calls Observed

Action or endpointPurpose
listaTabDocumentoLoads and reloads the saved draft line grid.
deleteLinhaDocDeletes the selected draft line. The verified run removed line sequence 2.
create_document&option=calcular_totaisRecalculates totals after the deleted line.
saveRascunhoRe-saves the draft. The verified response returned draft 473.
DT_List_DocumentosConfirms the edited draft reference is not a finalized FT invoice.
dt_list_recalc_stock_articles_lojasConfirms no stock movement happened while the document remained a draft.

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