Workflow

How to Add a Line to a Sales Invoice Draft

Verified end to end. Demo run add-line-sales-invoice-draft-20260519T181220Z opened FT draft 469, added another article line, clicked Save Draft, and verified the active edited draft 470 contained two lines.

Evidence Summary

Original draft
469 / /vendas/ft/rasc/NDY5
Active edited draft
470 / /vendas/ft/rasc/NDcw
Line count
1 line before, 2 lines after
Reference
AI-FT-DRAFT-20260519T181144Z-ADDLINE
Evidence file
raw/playwright/workflows/latest-add-line-sales-invoice-draft.json

Verified saved invoice draft line add workflow

When to Use This

Use this when an FT draft is still editable and the user needs to add another article before issuing the invoice. The verified run added a second line for the same article, saved the document as a draft again, and confirmed no final invoice or stock movement was created by the draft edit.

Like the header-edit workflow, re-saving after a line edit returned a new active draft number. The verified run moved from draft 469 to draft 470.

Step-by-Step

  1. Open the saved FT draft. The verified source was /vendas/ft/rasc/NDY5.
  2. Confirm the page is still OG - Invoice [FT] on a draft route, not a final invoice view.
  3. Review the current lines. The verified draft started with one line for article AI-DEMO-20260519-021105, quantity 1, total with VAT 1.96677.
  4. Add the extra article line from the document line area. The verified run added the same article again with quantity 1.
  5. Confirm the line grid now shows the extra line or increased line total. The verified draft had two matching rows and total quantity 2.
  6. Click Save Draft.
  7. Use the new draft route returned by OfficeGest. The verified re-save returned OK:470 and opened active draft /vendas/ft/rasc/NDcw.
  8. Reopen or refresh the active draft and confirm both lines are still present.
  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 draft469, route /vendas/ft/rasc/NDY5.
Active edited draft470, route /vendas/ft/rasc/NDcw.
Customer[910] 100 Ouvidos Lda, VAT 509031862.
Line resultRow count changed from 1 to 2; total quantity changed from 1 to 2.
Total with VATLine total with VAT changed from 1.96677 to 3.93354.
Final document listNo final FT rows were returned for reference AI-FT-DRAFT-20260519T181144Z-ADDLINE.
Stock effectWarehouse 1 stock stayed at -3 before and after the draft line add.

Backend Calls Observed

Action or endpointPurpose
listaTabDocumentoLoads the saved draft line grid.
loadArtigoReducidoLoads the added article for the new draft line.
insertLinhaTabDocAdds the second article line into the draft line table.
create_document&option=calcular_totaisRecalculates totals after the added line.
saveRascunhoRe-saves the draft. The verified response returned draft 470.
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/add-line-sales-invoice-draft-20260519T181220Z.json. Screenshots: assets/screenshots/add-line-sales-invoice-draft-20260519T181220Z-01-open-draft-before-line-add.png through assets/screenshots/add-line-sales-invoice-draft-20260519T181220Z-04-reopened-edited-draft.png.