Evidence Summary
- Create route
/vendas/ft/create- Final view
/vendas/ft/view/OTk5OTAxNjg2- Created invoice
999901686 / FT 9999/1686- Customer
[910] 100 Ouvidos Lda- Discount
PerDesc=5, discount value0.08 EUR- Evidence file
raw/playwright/workflows/latest-sales-invoice-global-discount.json
When to Use This
Use a global discount when the whole invoice should receive a percentage discount after line totals are calculated. Use the line-discount workflow instead when only one article line should be discounted.
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%. - Go to the totals/discount area below the document lines.
- Set the first document discount field to the desired percentage. The verified field is
#doc_PerDesc, submitted asPerDesc. - Confirm the totals recalculate. In the verified run, Discount became
0.08 EUR, Net Total became1.52 EUR, VAT became0.35 EUR, and Total became1.87 EUR. - Click Save and Finish, then confirm the Are you sure? dialog.
- Verify the saved invoice view and FT list. The verified FT list row showed total
1.87, paid0.00, and pending1.87.
Verified Behavior
| Check | Observed result |
|---|---|
| Before discount | Total discount 0.00 EUR, net total 1.60 EUR, VAT 0.37 EUR, final total 1.97 EUR. |
| After discount | #doc_PerDesc=5, total discount 0.08 EUR, net total 1.52 EUR, VAT 0.35 EUR, final total 1.87 EUR. |
| Final save payload | The nested saveDocument form payload submitted PerDesc=5. |
| Final view | The saved FT view retained #doc_PerDesc=5 and displayed the discounted totals. |
| List state | The FT list returned FT 9999/1686 as ABR / Open with total and pending value 1.87. |
Backend Calls Observed
| Action or endpoint | Purpose |
|---|---|
NameEntidades | Loads customer billing data after customer selection. |
loadArtigoReducido / insertLinhaTabDoc | Loads and inserts the invoice article line. |
create_document&option=calcular_totais | Recalculates totals using desconto1=5. |
saveDocument | Saves the final FT invoice with PerDesc=5. |
DT_List_Documentos | Verifies the invoice list row after save. |
Raw evidence: raw/playwright/workflows/sales-invoice-global-discount-20260519T200434Z.json. Screenshots: assets/screenshots/sales-invoice-global-discount-20260519T200434Z-01-create-page.png through assets/screenshots/sales-invoice-global-discount-20260519T200434Z-04-final-view.png.