Evidence Summary
- Source view
/vendas/orc/view/OTk5OTAwMDkx- Target draft
/vendas/enc/rasc/NDYy- Workflow run
quotation-to-sales-order-draft-20260519T163135Z- Source quotation
999900091 / ORC 9999/91- Created draft
462, order typeENC- Evidence file
raw/playwright/workflows/latest-quotation-to-sales-order-draft.json
When to Use This
Use this workflow after a customer accepts a quotation but the next operational step is an order, not an invoice. The conversion creates an Internal Doc [ENC] sales order draft from the quotation lines. It does not finalize the order or invoice the customer.
In the verified run, the source quotation remained ABR / Open after draft creation. Treat the generated ENC as a draft that still needs review and final save.
Step-by-Step
- Open the quotation that should become a sales order. The verified source was
ORC 9999/91. - Confirm the quotation is the correct customer and line set. The verified quotation was for customer
910, 100 Ouvidos Lda, with articleAI-DEMO-20260519-021105, quantity1, and total1.97. - In the bottom action bar, open To convert.
- Choose Internal Doc. This maps to
facturar('enc'). - Confirm the Are you sure? dialog.
- OfficeGest calls
facturardocwith sourcetipoop=ORC, source number999900091, and targettipoopdest=enc. - OfficeGest returns the draft identifier. The verified response was
"OK:462:vendas". - OfficeGest opens the ENC draft route
/vendas/enc/rasc/NDYy. - Review the copied sales order draft before saving. The verified draft kept reference
AI-ORC-ENC-20260519T163135Z, typeENC, and copied the source line fromORC 9999/91. - When the order is ready, continue with the normal Create a Sales Order save/finalization checks.
Conversion Options Observed
| Menu item | Observed handler | Meaning |
|---|---|---|
| Invoice | facturar('ft') | Creates an FT draft from the quotation. |
| Invoice / Receipt | facturar('fr') | Creates an FR draft from the quotation. |
| Internal Doc | facturar('enc') | Creates an ENC draft from the quotation. This is the verified path in this guide. |
| Order of Service | criarOS() | Posts the quotation context to the workshops order-of-service route; not verified here. |
Verified Values
| Field | Value |
|---|---|
| Source quotation | 999900091 / ORC 9999/91 |
| Source state after conversion | ABR / Open, total 1.97, paid 0. |
| Created ENC draft | 462, opened at /vendas/enc/rasc/NDYy. |
| Draft reference | AI-ORC-ENC-20260519T163135Z |
| Draft line source | ndocori=999900091, tipodocori=ORC, 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 ORC quotation. The verified source save returned 999900091%OK&=&OKDOC&=&. |
facturardoc | Converted the source ORC into an ENC draft. Payload included tipoopdest=enc, tipoop=ORC, and num=999900091. Response: "OK:462:vendas". |
listaTabDocumento | Loaded the generated ENC draft lines after opening /vendas/enc/rasc/NDYy. |
dt_list_drafts | Queried sales drafts for TipoOp=ENC after conversion. |
DT_List_Documentos | Checked the source ORC list after conversion and confirmed the quotation row still appeared as open. |
Raw evidence: raw/playwright/workflows/quotation-to-sales-order-draft-20260519T163135Z.json. Screenshots: assets/screenshots/quotation-to-sales-order-draft-20260519T163135Z-01-orc-filled.png through assets/screenshots/quotation-to-sales-order-draft-20260519T163135Z-04-enc-list.png.
Validation Notes
- This workflow stops at draft: no final ENC was saved in the verified run.
- The copied line keeps source metadata: the ENC draft line records the original ORC number and line.
- It is not an invoice: use this path when the customer accepted the quote but the business still needs an order step before invoicing.
- Source state: the ORC row was still open immediately after draft creation; do not treat it as closed or invoiced until the target order and later invoice are finalized as needed.