Workflow

How to Convert a Quotation to a Sales Order Draft

Verified to draft. Demo run quotation-to-sales-order-draft-20260519T163135Z created quotation ORC 9999/91 / 999900091, used To convert / Internal Doc, and opened sales order draft 462 at /vendas/enc/rasc/NDYy. The ENC draft was not finalized.

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 type ENC
Evidence file
raw/playwright/workflows/latest-quotation-to-sales-order-draft.json

Verified quotation to sales order draft conversion workflow

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

  1. Open the quotation that should become a sales order. The verified source was ORC 9999/91.
  2. Confirm the quotation is the correct customer and line set. The verified quotation was for customer 910, 100 Ouvidos Lda, with article AI-DEMO-20260519-021105, quantity 1, and total 1.97.
  3. In the bottom action bar, open To convert.
  4. Choose Internal Doc. This maps to facturar('enc').
  5. Confirm the Are you sure? dialog.
  6. OfficeGest calls facturardoc with source tipoop=ORC, source number 999900091, and target tipoopdest=enc.
  7. OfficeGest returns the draft identifier. The verified response was "OK:462:vendas".
  8. OfficeGest opens the ENC draft route /vendas/enc/rasc/NDYy.
  9. Review the copied sales order draft before saving. The verified draft kept reference AI-ORC-ENC-20260519T163135Z, type ENC, and copied the source line from ORC 9999/91.
  10. When the order is ready, continue with the normal Create a Sales Order save/finalization checks.

Conversion Options Observed

Menu itemObserved handlerMeaning
Invoicefacturar('ft')Creates an FT draft from the quotation.
Invoice / Receiptfacturar('fr')Creates an FR draft from the quotation.
Internal Docfacturar('enc')Creates an ENC draft from the quotation. This is the verified path in this guide.
Order of ServicecriarOS()Posts the quotation context to the workshops order-of-service route; not verified here.

Verified Values

FieldValue
Source quotation999900091 / ORC 9999/91
Source state after conversionABR / Open, total 1.97, paid 0.
Created ENC draft462, opened at /vendas/enc/rasc/NDYy.
Draft referenceAI-ORC-ENC-20260519T163135Z
Draft line sourcendocori=999900091, tipodocori=ORC, linhandocori=1.
Draft lineArticle AI-DEMO-20260519-021105, quantity 1, unit price about 1.599, VAT 23%.

Backend Calls Observed

Action or endpointPurpose
saveDocumentCreated the source ORC quotation. The verified source save returned 999900091%OK&=&OKDOC&=&.
facturardocConverted the source ORC into an ENC draft. Payload included tipoopdest=enc, tipoop=ORC, and num=999900091. Response: "OK:462:vendas".
listaTabDocumentoLoaded the generated ENC draft lines after opening /vendas/enc/rasc/NDYy.
dt_list_draftsQueried sales drafts for TipoOp=ENC after conversion.
DT_List_DocumentosChecked 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