Especialistas em TOTVS Protheus, BI e Automação de Processos
Dicionário Protheus · SX2

Tabela C5Z no Protheus

Contr.Val.Ret.Pis/Pasep/Cofins

A tabela C5Z do Protheus está descrita no dicionário (SX2) como “Contr.Val.Ret.Pis/Pasep/Cofins”. Possui 12 campos e 3 índices e chave única C5Z_FILIAL+C5Z_ID. Abaixo estão tipo, tamanho e descrição de cada campo, os índices e um exemplo de consulta SQL.

Propriedades da tabela

Código
C5Z
Nome
Contr.Val.Ret.Pis/Pasep/Cofins
Nome (inglês)
Pis/Pasep/Cofins With.Val.Cont
Compartilhamento por filial
Exclusivo
Compartilhamento por unidade
Exclusivo
Compartilhamento por empresa
Exclusivo
Chave única
C5Z_FILIAL+C5Z_ID
Campos / índices
12 / 3

Campos da tabela C5Z (12)

OrdemCampoTipoTam.Dec.TítuloDescriçãoContexto
01 C5Z_FILIAL C 2 0 Filial Filial Real
02 C5Z_ID C 6 0 ID Identificador Registro Real
03 C5Z_TPTRIB C 1 0 Tipo Tributo Tipo do Tributo Real
04 C5Z_PERIOD D 8 0 Data Movto Data do Movimento Decl. Real
05 C5Z_INDNAT C 6 0 Ind.Nat.Ret Ind.Nat.Retenção Real
06 C5Z_DINDNA C 220 0 Des.Nat.Ret Des.Nat.Retenção Virtual
07 C5Z_PERRET C 6 0 Per.Rec.Ret Per.Receb e Retenção Real
08 C5Z_VLRRET N 16 2 Vlr.Tot.Ret Valor Total Retenção Real
09 C5Z_VLRRTD N 16 2 Vlr.Ret.Ded Valor Ret. Deduzida Real
10 C5Z_VLRRES N 16 2 Vl.Ret.PRest Valor Ret. Ped. Rest. Real
11 C5Z_VLRRDC N 16 2 Vl.Ret.DComp Valor Ret. Dec.Comp. Real
12 C5Z_STATUS C 1 0 Status Reg. Status do registro Real

Tipo: C = caractere, N = numérico, D = data, L = lógico, M = memo.

Índices da tabela C5Z (3)

OrdemChaveDescriçãoApelido
1C5Z_FILIAL+C5Z_TPTRIB+DTOS(C5Z_PERIOD)+C5Z_INDNAT+C5Z_PERRETTipo Tributo + Data Movto + Ind.Nat.Ret + Per.Rec.Ret
2C5Z_FILIAL+C5Z_INDNAT+C5Z_PERRETInd.Nat.Ret + Per.Rec.Ret
3C5Z_FILIAL+C5Z_IDID

Perguntas frequentes sobre a tabela C5Z

O que é a tabela C5Z?

É a tabela “Contr.Val.Ret.Pis/Pasep/Cofins” do ERP TOTVS Protheus, com 12 campos definidos no dicionário SX3.

Qual é a chave única da tabela C5Z?

A chave única é C5Z_FILIAL+C5Z_ID.

Quais são os índices da tabela C5Z?

A tabela tem 3 índices. O principal (ordem 1) usa a chave C5Z_FILIAL+C5Z_TPTRIB+DTOS(C5Z_PERIOD)+C5Z_INDNAT+C5Z_PERRET.

Qual é o nome físico da tabela C5Z no banco de dados?

No banco, o nome é o código da tabela seguido do código da empresa (no dicionário de referência desta consulta: C5Z990). Em ADVPL, use RetSqlName("C5Z") para obter o nome correto do ambiente.

Exemplo de consulta SQL da tabela C5Z

Modelo gerado a partir da estrutura da tabela. Ajuste os filtros ao seu cenário.

SELECT
    C5Z_FILIAL,
    C5Z_ID,
    C5Z_TPTRIB,
    C5Z_PERIOD,
    C5Z_INDNAT,
    C5Z_DINDNA,
    C5Z_PERRET,
    C5Z_VLRRET,
    C5Z_VLRRTD,
    C5Z_VLRRES,
    C5Z_VLRRDC,
    C5Z_STATUS
FROM C5Z
WHERE
    D_E_L_E_T_ = ' '
    AND C5Z_FILIAL = 'VALOR'
    AND C5Z_ID = 'VALOR'
    AND C5Z_TPTRIB = 'VALOR'
    AND C5Z_PERIOD BETWEEN '20261001' AND '20261031'
    AND C5Z_INDNAT = 'VALOR'
    AND C5Z_DINDNA = 'VALOR'
    AND C5Z_PERRET = 'VALOR'
    AND C5Z_VLRRET = 0
    AND C5Z_VLRRTD = 0
    AND C5Z_VLRRES = 0
    AND C5Z_VLRRDC = 0
    AND C5Z_STATUS = 'VALOR'

Outras tabelas relacionadas

Dicionário Protheus · atualizado em 13/10/2026. Voltar ao índice do dicionário.