Workflow

How to Apply a Line Discount on a Sales Invoice

Verified end to end. Demo run sales-invoice-line-discount-20260519T195856Z applied a 10% first discount to an FT article line, saved FT 9999/1685, and verified the final invoice line and FT list kept the discounted value.

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 value 0.1599
Evidence file
raw/playwright/workflows/latest-sales-invoice-line-discount.json

Verified sales invoice line discount workflow

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

  1. Open Sales / Invoice [FT], then click New document, or navigate directly to /vendas/ft/create.
  2. Select the customer and confirm the mandatory header fields. The verified run used customer 910, VAT 509031862, seller 1, and employee 1.
  3. Add the article line. The verified run inserted article AI-DEMO-20260519-021105, quantity 1, warehouse 1, unit price 1.599, VAT 23%.
  4. In the document lines table, edit the first discount column for the line. The field stored by OfficeGest is Desconto1.
  5. Enter the discount percentage. The verified run used 10.
  6. Wait for the line grid to reload and confirm the line now has Desconto1=10.
  7. Click Save and Finish, then confirm the Are you sure? dialog.
  8. Verify the saved invoice view and list. The verified FT list row showed total 1.77, paid 0.00, and pending 1.77.

Verified Behavior

CheckObserved result
Before discountThe inserted line had Desconto1=0, DescontoLinha=0, unit price 1.599, and VAT 23%.
Discount editupdateEditableTabDoc returned {"success":true,"msg":""} for campo=Desconto1 and value=10.
After grid reloadThe line held Desconto1=10 and DescontoLinha=0.1599.
Final viewThe saved FT line retained Desconto1=10, DescontoLinha=0.1599, and VAT value 0.330993.
List stateThe FT list returned FT 9999/1685 as ABR / Open with total 1.77 and pending value 1.77.

Backend Calls Observed

Action or endpointPurpose
NameEntidadesLoads customer billing data after customer selection.
loadArtigoReducido / insertLinhaTabDocLoads and inserts the invoice article line.
updateEditableTabDocUpdates the line field Desconto1. OfficeGest validates discounts between 0 and 100.
DT_TabDocumentoReloads the document-line grid after the discount edit.
saveDocumentSaves the final FT invoice with the discounted server-side line.
DT_List_DocumentosVerifies 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.