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
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
- Open Sales / Invoice [FT], then click New document, or navigate directly to
/vendas/ft/create. - Select the customer and confirm the mandatory invoice fields. The verified run used customer
910, seller1, and employee1. - Add the article line. The verified run inserted article
AI-DEMO-20260519-021105, quantity1, warehouse1. - In the document lines table, edit the Cost Center column for the line. The stored line field is
cod_centrocusto. - Select the cost center. The verified run selected
0002/ Dep.Comercial. - Wait for the document-line grid to reload and confirm the line now holds
cod_centrocusto=0002. - Click Save and Finish, then confirm the Are you sure? dialog.
- Verify the saved invoice view still shows the cost center on the document line.
Observed Cost Centers
| Code | Label |
|---|---|
0001 | Geral |
0002 | Dep.Comercial |
0003 | Dep RH |
0004 | Dep.Marketing |
0005 | Dep. Produção |
123 | Evento X |
OB 2021/3 | Obra na Arrábida |
Obra 2025/0001 | Moradia Unifamiliar 2 Pisos |
Verified Behavior
| Check | Observed result |
|---|---|
| Before edit | The inserted line had cod_centrocusto=null. |
| Cost-center edit | updateEditableTabDoc returned {"success":true,"msg":""} for campo=cod_centrocusto and value=0002. |
| After grid reload | The line returned cod_centrocusto=0002. |
| Final view | The saved FT line retained cod_centrocusto=0002. |
| List state | The FT list returned FT 9999/1690 as ABR / Open with total and pending value 1.97. |
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 cod_centrocusto. |
DT_TabDocumento | Reloads the document-line grid after the cost-center edit. |
saveDocument | Saves the final FT invoice with the updated server-side line. |
DT_List_Documentos | Verifies 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.