Evidence Summary
- Draft source
/compras/cd/rasc/NDU2- Final view
/compras/cd/view/OTk5OTAwMDUz- Created document
999900053 / CD 9999/53- Status
LIQ/ Finished- Supplier
[100] AI Demo Supplier 20260519T030323Z- Evidence files
raw/playwright/workflows/latest-purchase-expense-finalize.jsonandraw/playwright/workflows/latest-purchase-expense-finalize-recovery.json
When to Use This
Use this workflow when a Purchases / Expenses CD draft is ready to become a finished supplier purchase/expense document. The verified path starts from an existing draft, clicks End, adds payment, confirms the save, and verifies the finished view, payment panel, document list, and stock movement.
Step-by-Step
- Open Purchases / Purchases / Expenses [CD].
- In the Drafts table, open the draft with Edit. The verified draft was
456. - Review supplier, supplier VAT, supplier document number, dates, series, employee, and line totals.
- Confirm the document has at least one line. The verified line used article
AI-DEMO-20260519-021105, quantity1, unit cost1.23, VAT23%, and total1.51. - Click End. OfficeGest calls
payment&option=validate; before payment it reports that payment must equal or exceed the document total. - In the Payment modal, choose a payment method. The verified run selected [NUM] Numerario.
- Confirm the payment line amount equals the document total. The verified payment line was
1.51. - Click Save in the Payment modal.
- Confirm the Are you sure? dialog with OK.
- OfficeGest posts
saveDocument, redirects to the finished CD view, and shows the payment panel. The verified response was999900053%&=&OKDOC&=&. - Check the CD list if needed. Searching for
999900053returnedCD 9999/53, statusLIQ, total1.51, and supplier referenceAI-CD-DRAFT-20260519T034251Z.
Verified Final Document
| Field | Value |
|---|---|
| Internal number | 999900053 |
| Visible document number | CD 9999/53 |
| Draft converted | 456 |
| Supplier document number | AI-CD-DRAFT-20260519T034251Z |
| Supplier | [100] AI Demo Supplier 20260519T030323Z, VAT 590303236 |
| Payment | [NUM] Numerario, bank/cash account [CXC] Caixa Defeito - Caixa Colaborador Demo, value 1.51 |
| Status | LIQ, visible as Finished |
| Stock result | Article AI-DEMO-20260519-021105, warehouse 1, stock increased from 1 to 2. |
Backend Calls Observed
| Action or endpoint | Purpose |
|---|---|
payment&option=validate | Checks whether payment covers the CD total. Before selecting a method it returned valid: NONE; after adding payment it returned valid: true. |
payment&option=add | Adds the selected payment line. The verified payload used modopagamento=NUM, entidade=100, compras=T, tipoop=CD, and total 1.51. |
saveDocument | Finalizes the draft into a CD document. The verified payload included num=456, id=45392, estado=ABR, isedit=T, and israsc=1. |
payment&option=get_payment | Reloads payment details on the finished document view. |
listaTabDocumento | Loads finished document lines in view mode. The finished line table used mode=view, document table 45477, and encoded document number OTk5OTAwMDUz. |
DT_List_DocumentosF | Verifies the finalized supplier document in the CD list. Search for 999900053 returned one row. |
dt_list_drafts | Verifies that the converted draft is no longer in the draft list. |
dt_list_recalc_stock_articles_lojas | Verifies article stock by warehouse. Warehouse 1 returned QtdStock: 2 after finalization. |
Raw evidence: raw/playwright/workflows/purchase-expense-finalize-20260519T035328Z.json plus recovery verification raw/playwright/workflows/purchase-expense-finalize-20260519T035328Z-recovery.json. Screenshots: assets/screenshots/purchase-expense-finalize-20260519T035328Z-01-open-draft.png and assets/screenshots/purchase-expense-finalize-20260519T035328Z-02-final-view-recovered.png.
Validation Notes
- Payment is required: the first validation returned
valid: NONEuntil a payment method was added. - Draft conversion: the final save uses the draft number as
num=456andisrasc=1. After finalization, draft456no longer appeared in the CD draft list. - Finished status: the saved document row showed
CodEstado=LIQ,ValorPago=1.51, and visible state Finished. - Automation note: the original finalization run exited after the application had already saved because the parser expected a different success token. The parser has been corrected, and the recovery evidence verifies the final document state.