Evidence Summary
- Create route
/vendas/ft/create- Final view
/vendas/ft/view/OTk5OTAxNjg1- Created invoice
999901685 / FT 9999/1685- Customer
[910] 100 Ouvidos Lda- Discount
Desconto1=10, line discount value0.1599- Evidence file
raw/playwright/workflows/latest-sales-invoice-line-discount.json
When to Use This
Use a line discount when only a specific article line should receive a discount. This differs from the document-level discount fields, which affect the invoice totals more broadly.
Step-by-Step
- Open Sales / Invoice [FT], then click New document, or navigate directly to
/vendas/ft/create. - Select the customer and confirm the mandatory header fields. The verified run used customer
910, VAT509031862, seller1, and employee1. - Add the article line. The verified run inserted article
AI-DEMO-20260519-021105, quantity1, warehouse1, unit price1.599, VAT23%. - In the document lines table, edit the first discount column for the line. The field stored by OfficeGest is
Desconto1. - Enter the discount percentage. The verified run used
10. - Wait for the line grid to reload and confirm the line now has
Desconto1=10. - Click Save and Finish, then confirm the Are you sure? dialog.
- Verify the saved invoice view and list. The verified FT list row showed total
1.77, paid0.00, and pending1.77.
Verified Behavior
| Check | Observed result |
|---|---|
| Before discount | The inserted line had Desconto1=0, DescontoLinha=0, unit price 1.599, and VAT 23%. |
| Discount edit | updateEditableTabDoc returned {"success":true,"msg":""} for campo=Desconto1 and value=10. |
| After grid reload | The line held Desconto1=10 and DescontoLinha=0.1599. |
| Final view | The saved FT line retained Desconto1=10, DescontoLinha=0.1599, and VAT value 0.330993. |
| List state | The FT list returned FT 9999/1685 as ABR / Open with total 1.77 and pending value 1.77. |
Backend Calls Observed
| Action or endpoint | Purpose |
|---|---|
NameEntidades | Loads customer billing data after customer selection. |
loadArtigoReducido / insertLinhaTabDoc | Loads and inserts the invoice article line. |
updateEditableTabDoc | Updates the line field Desconto1. OfficeGest validates discounts between 0 and 100. |
DT_TabDocumento | Reloads the document-line grid after the discount edit. |
saveDocument | Saves the final FT invoice with the discounted server-side line. |
DT_List_Documentos | Verifies the invoice list row after save. |
Raw evidence: raw/playwright/workflows/sales-invoice-line-discount-20260519T195856Z.json. Screenshots: assets/screenshots/sales-invoice-line-discount-20260519T195856Z-01-create-page.png through assets/screenshots/sales-invoice-line-discount-20260519T195856Z-04-final-view.png.