Workflow

How to Set a Line VAT Reason on a Sales Invoice

Verified end to end. Demo run sales-invoice-line-vat-reason-20260519T205716Z set an FT line VAT reason to 7 / M07, saved FT 9999/1696, and verified the final FT line retained RI=7.

Evidence Summary

Create route
/vendas/ft/create
Final view
/vendas/ft/view/OTk5OTAxNjk2
Created invoice
999901696 / FT 9999/1696
Customer
[910] 100 Ouvidos Lda
VAT reason
7 / [M07] Isento Artigo 9.º do CIVA
Evidence file
raw/playwright/workflows/latest-sales-invoice-line-vat-reason.json

Verified sales invoice line VAT reason workflow

When to Use This

Use the line VAT reason when a fiscal reason must be associated with a specific invoice line. This is stored in the line field RI. In the verified run, setting the reason did not change the VAT rate or totals by itself.

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 invoice fields. The verified run used customer 910, seller 1, and employee 1.
  3. Add the article line. The verified run inserted article AI-DEMO-20260519-021105, quantity 1, warehouse 1.
  4. In the document lines table, edit the RI / VAT reason column for the line.
  5. Select the required VAT reason. The verified run selected 7, displayed by the selector as [M07] Isento Artigo 9.º do CIVA.
  6. Wait for the document-line grid to reload and confirm the line now holds RI=7.
  7. Review VAT and totals. In the verified run the line stayed at IVA=23, ValorIVA=0.36777, and TotalCIVA=1.96677.
  8. Click Save and Finish, then confirm Are you sure?.
  9. Verify the saved invoice view still shows RI=7 on the document line.

Verified Behavior

CheckObserved result
Before editThe inserted line had empty RI, IVA=23, and TotalCIVA=1.96677.
Reason editupdateEditableTabDoc returned {"success":{"success":true,"m13":false},"msg":""} for campo=RI and value=7.
After grid reloadThe line returned RI=7, while IVA and totals stayed unchanged.
Final viewThe saved FT line retained RI=7, IVA=23, ValorIVA=0.36777, and TotalCIVA=1.96677.
List stateThe FT list returned FT 9999/1696 as ABR / Open with total and pending value 1.97.

Treat this field as a fiscal classification for the line. If the invoice requires a reduced or exempt VAT rate, verify and set the VAT rate separately with the line VAT workflow.

Observed Reason Choices

The editor exposes a static selector containing Portuguese VAT reason entries. Observed examples include M01, M04, M07, M08, M10, M13, M19, M40, M44, M45, and M46.

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 RI.
DT_TabDocumentoReloads the document-line grid after the VAT-reason edit.
saveDocumentSaves the final FT invoice after confirmation.
DT_List_DocumentosVerifies the invoice list row after save.

Raw evidence: raw/playwright/workflows/sales-invoice-line-vat-reason-20260519T205716Z.json. Screenshots: assets/screenshots/sales-invoice-line-vat-reason-20260519T205716Z-01-create-page.png through assets/screenshots/sales-invoice-line-vat-reason-20260519T205716Z-04-final-view.png.