Workflow

How to Set a Line Cost Center on a Sales Invoice

Verified end to end. Demo run sales-invoice-line-cost-center-20260519T202424Z set the invoice line cost center to [0002] Dep.Comercial, saved FT 9999/1690, and verified the final FT line retained cod_centrocusto=0002.

Evidence Summary

Create route
/vendas/ft/create
Final view
/vendas/ft/view/OTk5OTAxNjkw
Created invoice
999901690 / FT 9999/1690
Customer
[910] 100 Ouvidos Lda
Line cost center
0002 / [0002] Dep.Comercial
Evidence file
raw/playwright/workflows/latest-sales-invoice-line-cost-center.json

Verified sales invoice line cost center workflow

When to Use This

Use a line cost center when only a specific invoice line should be allocated to a department, project, work, or other cost-center bucket. This is different from the invoice header classification, which classifies the whole document.

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 Cost Center column for the line. The stored line field is cod_centrocusto.
  5. Select the cost center. The verified run selected 0002 / Dep.Comercial.
  6. Wait for the document-line grid to reload and confirm the line now holds cod_centrocusto=0002.
  7. Click Save and Finish, then confirm the Are you sure? dialog.
  8. Verify the saved invoice view still shows the cost center on the document line.

Observed Cost Centers

CodeLabel
0001Geral
0002Dep.Comercial
0003Dep RH
0004Dep.Marketing
0005Dep. Produção
123Evento X
OB 2021/3Obra na Arrábida
Obra 2025/0001Moradia Unifamiliar 2 Pisos

Verified Behavior

CheckObserved result
Before editThe inserted line had cod_centrocusto=null.
Cost-center editupdateEditableTabDoc returned {"success":true,"msg":""} for campo=cod_centrocusto and value=0002.
After grid reloadThe line returned cod_centrocusto=0002.
Final viewThe saved FT line retained cod_centrocusto=0002.
List stateThe FT list returned FT 9999/1690 as ABR / Open with total and pending value 1.97.

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 cod_centrocusto.
DT_TabDocumentoReloads the document-line grid after the cost-center edit.
saveDocumentSaves the final FT invoice with the updated server-side line.
DT_List_DocumentosVerifies the invoice list row after save.

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