Evidence Summary
- Source view
/vendas/enc/view/OTk5OTAwMTA0- Target draft
/vendas/ft/rasc/NDU5- Workflow run
sales-order-to-invoice-draft-20260519T161456Z- Source order
999900104 / ENC 9999/104- Created draft
459, invoice typeFT- Evidence file
raw/playwright/workflows/latest-sales-order-to-invoice-draft.json
When to Use This
Use this workflow when a customer order has been accepted and the next step is to prepare a normal customer invoice. The conversion creates an Invoice [FT] draft from the sales order lines. It does not finalize the invoice, post the final invoice state, or collect payment.
In the verified run, the source sales order remained ABR / Open after draft creation. Treat the generated FT as a draft that still needs review and final save.
Step-by-Step
- Open the sales order that should be invoiced. The verified source was
ENC 9999/104. - Confirm the order is the correct customer and backlog line. The verified order was for customer
910, 100 Ouvidos Lda, with articleAI-DEMO-20260519-021105, quantity1, and total1.97. - In the bottom action bar, open Invoice.
- Choose Invoice. This maps to
facturar('ft'). - Confirm the Are you sure? dialog.
- OfficeGest calls
facturardocwith sourcetipoop=ENC, source number999900104, and targettipoopdest=ft. - OfficeGest returns the draft identifier. The verified response was
"OK:459:vendas". - OfficeGest opens the FT draft route
/vendas/ft/rasc/NDU5. - Review the copied invoice draft before saving. The verified draft kept reference
AI-ENC-FT-20260519T161456Z, typeFT, and copied the source line fromENC 9999/104. - When the invoice is ready, continue with the normal Create a Sales Invoice save/finalization checks.
Conversion Options Observed
| Menu item | Observed handler | Meaning |
|---|---|---|
| Invoice | facturar('ft') | Creates an FT draft from the order. This is the verified path. |
| Invoice / Receipt | facturar('fr') | Creates an FR draft path from the order. The final payment step was not run in this workflow. |
| Internal Doc | facturar('enc') | Creates an ENC/internal document path from the order. |
Verified Values
| Field | Value |
|---|---|
| Source sales order | 999900104 / ENC 9999/104 |
| Source state after conversion | ABR / Open, total 1.97, paid 0. |
| Created FT draft | 459, opened at /vendas/ft/rasc/NDU5. |
| Draft reference | AI-ENC-FT-20260519T161456Z |
| Draft line source | ndocori=999900104, tipodocori=ENC, linhandocori=1. |
| Draft line | Article AI-DEMO-20260519-021105, quantity 1, unit price about 1.599, VAT 23%. |
Backend Calls Observed
| Action or endpoint | Purpose |
|---|---|
saveDocument | Created the source ENC sales order. The verified source save returned 999900104%&=&OKDOC&=&. |
facturardoc | Converted the source ENC into an FT draft. Payload included tipoopdest=ft, tipoop=ENC, and num=999900104. Response: "OK:459:vendas". |
listaTabDocumento | Loaded the generated FT draft lines after opening /vendas/ft/rasc/NDU5. |
dt_list_drafts | Queried sales drafts for TipoOp=FT after conversion. |
DT_List_Documentos | Checked the source ENC list after conversion and confirmed the order row still appeared as open. |
Raw evidence: raw/playwright/workflows/sales-order-to-invoice-draft-20260519T161456Z.json. Screenshots: assets/screenshots/sales-order-to-invoice-draft-20260519T161456Z-01-enc-filled.png through assets/screenshots/sales-order-to-invoice-draft-20260519T161456Z-04-ft-list.png.
Validation Notes
- This workflow stops at draft: no final FT was saved in the verified run.
- The copied line keeps source metadata: the FT draft line records the original ENC number and line, which is useful for audit and support.
- Review before final save: confirm customer, dates, tax zone, stock warning, backlog impact, and totals before using Save and Finish on the FT draft.
- Source state: the ENC row was still open immediately after draft creation; do not assume an order is invoiced until the target document is finalized and list state is verified.