Saldos Item x Centro de Custo
A tabela CTV faz parte do sistema ERP Protheus da TOTVS e é utilizada para saldos item x centro de custo.
Ela pertence ao dicionário de dados do Protheus (SX2) e armazena informações essenciais utilizadas em processos como cadastros, movimentações e integrações do sistema.
A tabela CTV possui diversos campos (SX3), cada um com regras específicas como tipo, tamanho e validações, além de índices (SIX) que otimizam a performance das consultas.
Nesta página você pode consultar a estrutura completa da tabela CTV, incluindo todos os campos e índices relacionados.
| Propriedade | Valor |
|---|---|
| X2_CHAVE | CTV |
| X2_PATH | \DATA\ |
| X2_ARQUIVO | CTV990 |
| X2_NOME | Saldos Item x Centro de Custo |
| X2_NOMESPA | Saldos ítem vs. Centro de Cost |
| X2_NOMEENG | Item vs. Cost Center Balances |
| X2_ROTINA | - |
| X2_MODO | E |
| X2_MODOUN | E |
| X2_MODOEMP | E |
| X2_DELET | 0 |
| X2_TTS | - |
| X2_UNICO | CTV_FILIAL+DTOS(CTV_DATA)+CTV_CUSTO+CTV_ITEM+CTV_MOEDA+CTV_TPSALD+CTV_LP |
| X2_PYME | S |
| X2_MODULO | 34 |
| X2_DISPLAY | - |
| X2_SYSOBJ | - |
| X2_USROBJ | - |
| X2_POSLGT | 1 |
| X2_CLOB | 2 |
| X2_AUTREC | 2 |
| X2_TAMFIL | 2 |
| X2_TAMUN | 0 |
| X2_TAMEMP | 0 |
| X2_STAMP | 2 |
| X2_INSDT | 2 |
| D_E_L_E_T_ | - |
| R_E_C_N_O_ | 2734 |
| R_E_C_D_E_L_ | 0 |
| X3_ARQUIVO | X3_ORDEM | X3_CAMPO | X3_TIPO | X3_TAMANHO | X3_DECIMAL | X3_TITULO | X3_TITSPA | X3_TITENG | X3_DESCRIC | X3_DESCSPA | X3_DESCENG | X3_PICTURE | X3_VALID | X3_USADO | X3_RELACAO | X3_F3 | X3_NIVEL | X3_RESERV | X3_CHECK | X3_TRIGGER | X3_PROPRI | X3_BROWSE | X3_VISUAL | X3_CONTEXT | X3_OBRIGAT | X3_VLDUSER | X3_CBOX | X3_CBOXSPA | X3_CBOXENG | X3_PICTVAR | X3_WHEN | X3_INIBRW | X3_GRPSXG | X3_FOLDER | X3_PYME | X3_CONDSQL | X3_CHKSQL | X3_IDXSRV | X3_ORTOGRA | X3_IDXFLD | X3_TELA | X3_PICBRV | X3_AGRUP | X3_POSLGT | X3_MODAL | X3_CHKSUM | X3_ADDSUM | D_E_L_E_T_ | R_E_C_N_O_ | R_E_C_D_E_L_ |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| CTV | 01 | CTV_FILIAL | C | 2 | 0 | Filial | Sucursal | Branch | Filial do Sistema | Sucursal del Sistema | System Branch | - | - | x x x x x x x x x x x x x x x | - | - | 1 | - | - | - | - | N | - | - | - | - | - | - | - | - | - | - | 033 | - | S | - | - | N | N | N | - | - | - | 1 | 2 | - | - | - | 42767 | 0 |
| CTV | 02 | CTV_CUSTO | C | 9 | 0 | Cod C Custo | Cod C Costo | C.Cent.Code | Codigo Centro Custo | Codigo Centro Costo | Cost Center Code | @! | - | x x x x x x x x x x x x x x x x | - | - | 1 | x | - | - | - | S | - | - | - | - | - | - | - | - | - | - | 004 | - | S | - | - | N | N | N | - | - | - | 1 | 2 | - | - | - | 42768 | 0 |
| CTV | 03 | CTV_ITEM | C | 9 | 0 | Cod Item | Cod. Item | Item Code | Codigo Item | Codigo Item | Item Code | @! | - | x x x x x x x x x x x x x x x x | - | - | 1 | x | - | - | - | S | - | - | - | - | - | - | - | - | - | - | 005 | - | S | - | - | N | N | N | - | - | - | 1 | 2 | - | - | - | 42769 | 0 |
| CTV | 04 | CTV_MOEDA | C | 2 | 0 | Moeda | Moneda | Currency | Moeda | Moneda | Currency | ! | - | x x x x x x x x x x x x x x x x | - | - | 1 | xx | - | - | - | S | - | - | - | - | - | - | - | - | - | - | - | - | S | - | - | N | N | N | - | - | - | 1 | 1 | - | - | - | 42770 | 0 |
| CTV | 05 | CTV_DATA | D | 8 | 0 | Data Saldo | Fecha Saldo | Balance Date | Data do Saldo | Fecha de Saldo | Balance Date | 99/99/9999 | - | x x x x x x x x x x x x x x x x | - | - | 1 | xx | - | - | - | N | - | - | - | - | - | - | - | - | - | - | - | - | S | - | - | N | N | N | - | - | - | 1 | 1 | - | - | - | 42771 | 0 |
| CTV | 06 | CTV_DEBITO | N | 16 | 2 | Sld Debito | Sld Debito | Debit Bal | Debito na Data | Debito en la Fecha | Debit on date | @E 9,999,999,999,999.99 | - | x x x x x x x x x x x x x x x x | - | - | 1 | xxxx | - | - | - | N | - | - | - | - | - | - | - | - | - | - | - | - | S | - | - | N | N | N | - | - | - | 1 | 2 | - | - | - | 42772 | 0 |
| CTV | 07 | CTV_CREDIT | N | 16 | 2 | Sld Credito | Sld Credito | Credit Bal | Credito na Data | Credito en la Fecha | Credit on date | @E 9,999,999,999,999.99 | - | x x x x x x x x x x x x x x x x | - | - | 1 | xxxx | - | - | - | N | - | - | - | - | - | - | - | - | - | - | - | - | S | - | - | N | N | N | - | - | - | 1 | 2 | - | - | - | 42773 | 0 |
| CTV | 08 | CTV_TPSALD | C | 1 | 0 | Tipo do Sld | Tipo de Sld | Balance Type | Tipo do Saldo | Tipo de Saldo | Balance Type | ! | - | x x x x x x x x x x x x x x x x | - | - | 1 | xx | - | - | - | N | - | - | - | - | 1=Real;2=Orcado;3=Gerencial | 1=Real;2=Presupuestado;3=Gestion | 1=Real;2=Budgeted;3=Managerial | - | - | - | - | - | S | - | - | N | N | N | - | - | - | 1 | 1 | - | - | - | 42774 | 0 |
| CTV | 09 | CTV_STATUS | C | 1 | 0 | Status | Estatus | Status | Status do Saldo (Ab/Enc) | Estatus de Saldo (Ab/Cer) | Balance Status (Pd/Cld) | ! | - | x x x x x x x x x x x x x x x x | - | - | 1 | xx | - | - | - | N | - | - | - | - | - | - | - | - | - | - | - | - | S | - | - | N | N | N | - | - | - | 1 | 1 | - | - | - | 42775 | 0 |
| CTV | 10 | CTV_ATUDEB | N | 16 | 2 | Sld Atu Deb | Sld.Act.Adeu | Deb Crt Bal | Saldo Atual Devedor | Saldo Actual Adeudado | Debtor Current Balance | @E 9,999,999,999,999.99 | - | x x x x x x x x x x x x x x x x | - | - | 1 | xxxxx | - | - | - | N | - | - | - | - | - | - | - | - | - | - | - | - | S | - | - | N | N | N | - | - | - | 1 | 1 | - | - | - | 42776 | 0 |
| CTV | 11 | CTV_ATUCRD | N | 16 | 2 | Sld Atu Crd | Sld Act Acre | Crd Crt Bal | Saldo Atual Credor | Saldo Actual Acreditado | Creditor Current Balance | @E 9,999,999,999,999.99 | - | x x x x x x x x x x x x x x x x | - | - | 1 | xxxxx | - | - | - | N | - | - | - | - | - | - | - | - | - | - | - | - | S | - | - | N | N | N | - | - | - | 1 | 1 | - | - | - | 42777 | 0 |
| CTV | 12 | CTV_ANTDEB | N | 16 | 2 | Sld Ant Deb | Sld Ant Adeu | Deb Prev Bal | Saldo Anterior Devedor | Saldo Anter. Adeudado | Debtor Previous Balance | @E 9,999,999,999,999.99 | - | x x x x x x x x x x x x x x x x | - | - | 1 | xxxxx | - | - | - | N | - | - | - | - | - | - | - | - | - | - | - | - | S | - | - | N | N | N | - | - | - | 1 | 1 | - | - | - | 42778 | 0 |
| CTV | 13 | CTV_ANTCRD | N | 16 | 2 | Sld Ant Crd | Sld Ant Acre | Crd Prev Bal | Saldo Anterior Credor | Saldo Anterior Acred. | Creditor Previous Balance | @E 9,999,999,999,999.99 | - | x x x x x x x x x x x x x x x x | - | - | 1 | xxxxx | - | - | - | N | - | - | - | - | - | - | - | - | - | - | - | - | S | - | - | N | N | N | - | - | - | 1 | 1 | - | - | - | 42779 | 0 |
| CTV | 14 | CTV_LPDEB | N | 16 | 2 | LP Debito | GP Debito | Debit P/L | Lucro / Perda Debito | Ganancia/Perdida Debito | Debit Profit / Loss | @E 9,999,999,999,999.99 | - | x x x x x x x x x x x x x x x x | - | - | 1 | xxxx | - | - | - | N | - | - | - | - | - | - | - | - | - | - | - | - | S | - | - | N | N | N | - | - | - | 1 | 2 | - | - | - | 42780 | 0 |
| CTV | 15 | CTV_LPCRD | N | 16 | 2 | LP Credito | GP Credito | Credit PL | Lucro / Perda Credito | Ganancia/Perdida Credito | Credit Profit / Loss | @E 9,999,999,999,999.99 | - | x x x x x x x x x x x x x x x x | - | - | 1 | xxxx | - | - | - | N | - | - | - | - | - | - | - | - | - | - | - | - | S | - | - | N | N | N | - | - | - | 1 | 2 | - | - | - | 42781 | 0 |
| CTV | 16 | CTV_SLCOMP | C | 1 | 0 | Flag Sl Comp | Flag Sl Comp | Com.Blc.Flag | Flag Saldo Composto | Flag Saldo Compuesto | Comp.Balance Flag | - | - | x x x x x x x x x x x x x x x | - | - | 1 | x | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | S | - | - | N | N | N | - | - | - | 1 | 2 | - | - | - | 42782 | 0 |
| CTV | 17 | CTV_DTLP | D | 8 | 0 | Dt Apuracao | Fch. Calculo | Calc.Date | Data da apuracao | Fecha del Calculo | Calculation Date | 99/99/9999 | - | x x x x x x x x x x x x x x x | - | - | 1 | xx | - | - | - | N | - | - | - | - | - | - | - | - | - | - | - | - | S | - | - | N | N | N | - | - | - | 1 | 1 | - | - | - | 42783 | 0 |
| CTV | 18 | CTV_LP | C | 1 | 0 | Sld L.Perdas | Sld G.Perdid | P/L Balc. | Flag Saldo Lucros Perdas | Flag Saldo Gananc.Perdida | Profit/Loss Balance Flag | - | - | x x x x x x x x x x x x x x x | - | - | 1 | x | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | S | - | - | N | N | N | - | - | - | 1 | 2 | - | - | - | 42784 | 0 |
| INDICE | ORDEM | CHAVE | DESCRICAO | DESCSPA | DESCENG | PROPRI | F3 | NICKNAME | SHOWPESQ | IX_VIRTUAL | IX_VIRCUST | D_E_L_E_T_ | R_E_C_N_O_ | R_E_C_D_E_L_ |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| CTV | 1 | CTV_FILIAL+CTV_MOEDA+CTV_TPSALD+CTV_ITEM+CTV_CUSTO+DTOS(CTV_DATA)+CTV_LP | Moeda + Tipo do Sld + Cod Item + Cod C Custo + Data Saldo + Sld L.Perd | Moneda + Tipo de Sld + Cod. Item + Cod C Costo + Fecha Saldo + Sld G.P | Currency + Balance Type + Item Code + C.Cent.Code + Balance Date + P/L | S | - | - | S | 2 | 3 | - | 6571 | 0 |
| CTV | 2 | CTV_FILIAL+CTV_MOEDA+CTV_TPSALD+CTV_CUSTO+CTV_ITEM+DTOS(CTV_DATA) | Moeda + Tipo do Sld + Cod C Custo + Cod Item + Data Saldo | Moneda + Tipo de Sld + Cod C Costo + Cod. Item + Fecha Saldo | Currency + Balance Type + C.Cent.Code + Item Code + Balance Date | S | - | - | S | 2 | 3 | - | 6572 | 0 |
| CTV | 3 | CTV_FILIAL+CTV_SLCOMP+CTV_TPSALD+CTV_MOEDA+DTOS(CTV_DATA)+CTV_ITEM+CTV_CUSTO | Flag Sl Comp + Tipo do Sld + Moeda + Data Saldo + Cod Item + Cod C Cus | Flag Sl Comp + Tipo de Sld + Moneda + Fecha Saldo + Cod. Item + Cod C | Com.Blc.Flag + Balance Type + Currency + Balance Date + Item Code + C. | S | - | - | S | 2 | 3 | - | 6573 | 0 |
| CTV | 4 | CTV_FILIAL+CTV_SLCOMP+CTV_TPSALD+CTV_MOEDA+DTOS(CTV_DATA)+CTV_CUSTO+CTV_ITEM | Flag Sl Comp + Tipo do Sld + Moeda + Data Saldo + Cod C Custo + Cod It | Flag Sl Comp + Tipo de Sld + Moneda + Fecha Saldo + Cod C Costo + Cod. | Com.Blc.Flag + Balance Type + Currency + Balance Date + C.Cent.Code + | S | - | - | S | 2 | 3 | - | 6574 | 0 |
| CTV | 5 | CTV_FILIAL+CTV_TPSALD+CTV_MOEDA+DTOS(CTV_DATA)+CTV_CUSTO+CTV_ITEM | Tipo do Sld + Moeda + Data Saldo + Cod C Custo + Cod Item | Tipo de Sld + Moneda + Fecha Saldo + Cod C Costo + Cod. Item | Balance Type + Currency + Balance Date + C.Cent.Code + Item Code | S | - | - | S | 2 | 3 | - | 6575 | 0 |
| CTV | 6 | CTV_FILIAL+CTV_LP+CTV_MOEDA+CTV_TPSALD+CTV_ITEM+CTV_CUSTO+DTOS(CTV_DATA) | Sld L.Perdas + Moeda + Tipo do Sld + Cod Item + Cod C Custo + Data Sal | Sld G.Perdid + Moneda + Tipo de Sld + Cod. Item + Cod C Costo + Fecha | P/L Balc. + Currency + Balance Type + Item Code + C.Cent.Code + Balanc | S | - | - | S | 2 | 3 | - | 6576 | 0 |
| CTV | 7 | CTV_FILIAL+CTV_LP+CTV_MOEDA+CTV_TPSALD+CTV_CUSTO+CTV_ITEM+DTOS(CTV_DATA) | Sld L.Perdas + Moeda + Tipo do Sld + Cod C Custo + Cod Item + Data Sal | Sld G.Perdid + Moneda + Tipo de Sld + Cod C Costo + Cod. Item + Fecha | P/L Balc. + Currency + Balance Type + C.Cent.Code + Item Code + Balanc | S | - | - | S | 2 | 3 | - | 6577 | 0 |
Ela é utilizada para saldos item x centro de custo dentro do sistema ERP Protheus.
Nesta página você pode visualizar todos os campos, incluindo tipo, tamanho e validações.
Os índices são estruturas que melhoram a performance de busca e acesso aos dados dentro do Protheus.
Modelo de query gerado automaticamente com base na estrutura da tabela.
SELECT
CTV_FILIAL,
CTV_CUSTO,
CTV_ITEM,
CTV_MOEDA,
CTV_DATA,
CTV_DEBITO,
CTV_CREDIT,
CTV_TPSALD,
CTV_STATUS,
CTV_ATUDEB,
CTV_ATUCRD,
CTV_ANTDEB,
CTV_ANTCRD,
CTV_LPDEB,
CTV_LPCRD,
CTV_SLCOMP,
CTV_DTLP,
CTV_LP
FROM CTV
WHERE
D_E_L_E_T_ = ' '
AND CTV_FILIAL = 'VALOR'
AND CTV_CUSTO = 'VALOR'
AND CTV_ITEM = 'VALOR'
AND CTV_MOEDA = 'VALOR'
AND CTV_DATA BETWEEN '20261001' AND '20261031'
AND CTV_DEBITO = 0
AND CTV_CREDIT = 0
AND CTV_TPSALD = 'VALOR'
AND CTV_STATUS = 'VALOR'
AND CTV_ATUDEB = 0
AND CTV_ATUCRD = 0
AND CTV_ANTDEB = 0
AND CTV_ANTCRD = 0
AND CTV_LPDEB = 0
AND CTV_LPCRD = 0
AND CTV_SLCOMP = 'VALOR'
AND CTV_DTLP BETWEEN '20261001' AND '20261031'
AND CTV_LP = 'VALOR'