Saldos Cl Valor x Item
A tabela CTX faz parte do sistema ERP Protheus da TOTVS e é utilizada para saldos cl valor x item.
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 CTX 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 CTX, incluindo todos os campos e índices relacionados.
| Propriedade | Valor |
|---|---|
| X2_CHAVE | CTX |
| X2_PATH | \DATA\ |
| X2_ARQUIVO | CTX990 |
| X2_NOME | Saldos Cl Valor x Item |
| X2_NOMESPA | Saldos Cl Valor vs. Ítem |
| X2_NOMEENG | Value Class vs. Item Balances |
| X2_ROTINA | - |
| X2_MODO | E |
| X2_MODOUN | E |
| X2_MODOEMP | E |
| X2_DELET | 0 |
| X2_TTS | - |
| X2_UNICO | CTX_FILIAL+DTOS(CTX_DATA)+CTX_ITEM+CTX_CLVL+CTX_MOEDA+CTX_TPSALD+CTX_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_ | 2736 |
| 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_ |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| CTX | 01 | CTX_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 | - | - | - | 42803 | 0 |
| CTX | 02 | CTX_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 | - | - | - | 42804 | 0 |
| CTX | 03 | CTX_CLVL | C | 9 | 0 | Cod Cl Valor | Cod Cl Valor | Vl.Cat.Code | Codigo Classe de Valor | Codigo Clase de Valor | Value Cat. Code | @! | - | x x x x x x x x x x x x x x x x | - | - | 1 | x | - | - | - | S | - | - | - | - | - | - | - | - | - | - | 006 | - | S | - | - | N | N | N | - | - | - | 1 | 2 | - | - | - | 42805 | 0 |
| CTX | 04 | CTX_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 | - | - | - | 42806 | 0 |
| CTX | 05 | CTX_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 | - | - | - | 42807 | 0 |
| CTX | 06 | CTX_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 | - | - | - | 42808 | 0 |
| CTX | 07 | CTX_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 | - | - | - | 42809 | 0 |
| CTX | 08 | CTX_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 | - | - | - | 42810 | 0 |
| CTX | 09 | CTX_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 | - | - | - | 42811 | 0 |
| CTX | 10 | CTX_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 | - | - | - | 42812 | 0 |
| CTX | 11 | CTX_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 | - | - | - | 42813 | 0 |
| CTX | 12 | CTX_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 | - | - | - | 42814 | 0 |
| CTX | 13 | CTX_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 | - | - | - | 42815 | 0 |
| CTX | 14 | CTX_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 | - | - | - | 42816 | 0 |
| CTX | 15 | CTX_LPCRD | N | 16 | 2 | LP Credito | GP Credito | Credit GL | Lucro / Perda Credito | Ganancia/Perdida Credito | Credit Gain / 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 | - | - | - | 42817 | 0 |
| CTX | 16 | CTX_SLCOMP | C | 1 | 0 | Flag Sl Comp | Flag Sl Comp | Com.Bal.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 | - | - | - | 42818 | 0 |
| CTX | 17 | CTX_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 | - | - | - | 42819 | 0 |
| CTX | 18 | CTX_LP | C | 1 | 0 | Sld L.Perdas | Sld G.Perdid | P/L Balance | 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 | - | - | - | 42820 | 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_ |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| CTX | 1 | CTX_FILIAL+CTX_MOEDA+CTX_TPSALD+CTX_ITEM+CTX_CLVL+DTOS(CTX_DATA)+CTX_LP | Moeda + Tipo do Sld + Cod Item + Cod Cl Valor + Data Saldo + Sld L.Per | Moneda + Tipo de Sld + Cod. Item + Cod Cl Valor + Fecha Saldo + Sld G. | Currency + Balance Type + Item Code + Vl.Cat.Code + Balance Date + P/L | S | - | - | S | 2 | 3 | - | 6585 | 0 |
| CTX | 2 | CTX_FILIAL+CTX_MOEDA+CTX_TPSALD+CTX_CLVL+CTX_ITEM+DTOS(CTX_DATA) | Moeda + Tipo do Sld + Cod Cl Valor + Cod Item + Data Saldo | Moneda + Tipo de Sld + Cod Cl Valor + Cod. Item + Fecha Saldo | Currency + Balance Type + Vl.Cat.Code + Item Code + Balance Date | S | - | - | S | 2 | 3 | - | 6586 | 0 |
| CTX | 3 | CTX_FILIAL+CTX_SLCOMP+CTX_TPSALD+CTX_MOEDA+DTOS(CTX_DATA)+CTX_ITEM+CTX_CLVL | Flag Sl Comp + Tipo do Sld + Moeda + Data Saldo + Cod Item + Cod Cl Va | Flag Sl Comp + Tipo de Sld + Moneda + Fecha Saldo + Cod. Item + Cod Cl | Com.Bal.Flag + Balance Type + Currency + Balance Date + Item Code + Vl | S | - | - | S | 2 | 3 | - | 6587 | 0 |
| CTX | 4 | CTX_FILIAL+CTX_SLCOMP+CTX_TPSALD+CTX_MOEDA+DTOS(CTX_DATA)+CTX_CLVL+CTX_ITEM | Flag Sl Comp + Tipo do Sld + Moeda + Data Saldo + Cod Cl Valor + Cod I | Flag Sl Comp + Tipo de Sld + Moneda + Fecha Saldo + Cod Cl Valor + Cod | Com.Bal.Flag + Balance Type + Currency + Balance Date + Vl.Cat.Code + | S | - | - | S | 2 | 3 | - | 6588 | 0 |
| CTX | 5 | CTX_FILIAL+CTX_TPSALD+CTX_MOEDA+DTOS(CTX_DATA)+CTX_ITEM+CTX_CLVL | Tipo do Sld + Moeda + Data Saldo + Cod Item + Cod Cl Valor | Tipo de Sld + Moneda + Fecha Saldo + Cod. Item + Cod Cl Valor | Balance Type + Currency + Balance Date + Item Code + Vl.Cat.Code | S | - | - | S | 2 | 3 | - | 6589 | 0 |
| CTX | 6 | CTX_FILIAL+CTX_LP+CTX_MOEDA+CTX_TPSALD+CTX_ITEM+CTX_CLVL+DTOS(CTX_DATA) | Sld L.Perdas + Moeda + Tipo do Sld + Cod Item + Cod Cl Valor + Data Sa | Sld G.Perdid + Moneda + Tipo de Sld + Cod. Item + Cod Cl Valor + Fecha | P/L Balance + Currency + Balance Type + Item Code + Vl.Cat.Code + Bala | S | - | - | S | 2 | 3 | - | 6590 | 0 |
| CTX | 7 | CTX_FILIAL+CTX_LP+CTX_MOEDA+CTX_TPSALD+CTX_CLVL+CTX_ITEM+DTOS(CTX_DATA) | Sld L.Perdas + Moeda + Tipo do Sld + Cod Cl Valor + Cod Item + Data Sa | Sld G.Perdid + Moneda + Tipo de Sld + Cod Cl Valor + Cod. Item + Fecha | P/L Balance + Currency + Balance Type + Vl.Cat.Code + Item Code + Bala | S | - | - | S | 2 | 3 | - | 6591 | 0 |
Ela é utilizada para saldos cl valor x item 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
CTX_FILIAL,
CTX_ITEM,
CTX_CLVL,
CTX_MOEDA,
CTX_DATA,
CTX_DEBITO,
CTX_CREDIT,
CTX_TPSALD,
CTX_STATUS,
CTX_ATUDEB,
CTX_ATUCRD,
CTX_ANTDEB,
CTX_ANTCRD,
CTX_LPDEB,
CTX_LPCRD,
CTX_SLCOMP,
CTX_DTLP,
CTX_LP
FROM CTX
WHERE
D_E_L_E_T_ = ' '
AND CTX_FILIAL = 'VALOR'
AND CTX_ITEM = 'VALOR'
AND CTX_CLVL = 'VALOR'
AND CTX_MOEDA = 'VALOR'
AND CTX_DATA BETWEEN '20261001' AND '20261031'
AND CTX_DEBITO = 0
AND CTX_CREDIT = 0
AND CTX_TPSALD = 'VALOR'
AND CTX_STATUS = 'VALOR'
AND CTX_ATUDEB = 0
AND CTX_ATUCRD = 0
AND CTX_ANTDEB = 0
AND CTX_ANTCRD = 0
AND CTX_LPDEB = 0
AND CTX_LPCRD = 0
AND CTX_SLCOMP = 'VALOR'
AND CTX_DTLP BETWEEN '20261001' AND '20261031'
AND CTX_LP = 'VALOR'