Step-by-Step
- Open
/vendas/ft/createand select an active billing customer. - Add at least one invoice line. OfficeGest returns Não há linhas if the voucher is applied before document lines exist.
- In Linhas Doc., click Vale oferta /
#btnValeDesconto. - Select an active gift certificate in Número /
#numero_valeoferta. The selector filtersestado=ACT. - Click Guardar /
#save_valeoferta. - Review the returned discount value and totals before finalizing the invoice.
Verified Behavior
| Check | Observed result |
|---|---|
| Route | /vendas/ft/create |
| Temporary voucher | IG024756000001, value 1.00, status ACT. |
| Apply request | action=retalho, option=save_valeoferta, selected voucher id 127, and document table id from the FT form. |
| Response | {"success":true,"add_desconto":false,"valor_desconto":1,"percentagem":0}. |
| Voucher state before cleanup | The voucher still listed as ACT because the FT was not finalized in this boundary run. |
| Safety boundary | No saveDocument, saveRascunho, print, payment, or delete-document request was submitted. |
This run verifies applying the voucher to the temporary invoice form. It intentionally does not prove final voucher consumption on an issued invoice because the test stopped before fiscal save.
Backend Calls Observed
| Action or endpoint | Purpose |
|---|---|
Sel2_Select_CRM_vales_oferta | Loads active gift certificates for the modal selector. |
retalho&option=save_valeoferta | Applies the selected voucher against the temporary document table and returns the discount value. |
DT_Select with table=vales_oferta | Verifies voucher state before and after the temporary apply boundary. |
Raw evidence: raw/playwright/workflows/sales-invoice-gift-card-20260520T024756Z.json. Screenshots: assets/screenshots/sales-invoice-gift-card-20260520T024756Z-01-create-page.png through assets/screenshots/sales-invoice-gift-card-20260520T024756Z-03-gift-card-applied.png.