Saneamiento de la base de proveedores —Personalizado (Aprobación)
Observación
Use los comandos enumerados en esta página solo si el sistema que está integrando aún no ha completado la aprobación con Senior. Estos comandos se pueden utilizar provisionalmente hasta que se habilite la integración.
Si su sistema ya aparece en la lista disponible endocumentación de saneamiento, utilice los comandos que le son específicos.
Estos son los comandos paraSELECT
eso puede serejecutar en el sistema de Senior, para facilitar la extracción de datos. Os comandos estão divididos por tipo de informação (colaboradores, cargos, setores, filiais e centros de custos).
Se for necessário extrair informações diferentes dos exemplos, você pode adaptar os comandos para buscar as informações que não constam nos exemplos.
Saneamento de dados:
Colaboradores
Ligação dos registros
La vinculación de los registros la realiza elregistro de empleados:
Registro en el sistema de Senior | Registro con el proveedor de SST | Ejemplo | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
R034FUN.TipCol
R034FUN.NumCad
|
Campo: MATRÍCULA do colaborador Formato:
|
|
Comandos do banco de dados para saneamento da base
SELECT R034FUN.CodFil 'Cod.Unid', R030FIL.NomFil 'Nome Unidade', CAST(R030ORG.TabOrg AS VARCHAR(200)) + '/' + CAST(R016HIE.CodLoc AS VARCHAR(200)) 'Cod.Setor', R016ORN.NomLoc 'Nome Setor', CAST(R030CAR.EstCar AS VARCHAR(200)) + '/' + CAST(R034FUN.CodCar AS VARCHAR(200)) 'Cod.Cargo', R024CAR.TitRed 'Nome Cargo', CAST(R034FUN.TIPCOL AS VARCHAR(200))+ '/'+ CAST(R034FUN.NUMCAD AS VARCHAR(200)) 'Matrícula', '' 'Cod Funcionário', R034FUN.NomFun 'Nome Funcionário', CASE WHEN (convert(varchar, R034FUN.DatNas, 103) = '31/12/1900') THEN null ELSE (convert(varchar, R034FUN.DatNas, 103)) END 'Dt.Nascimento', R034FUN.TipSex 'Sexo', R010SIT.DesSit 'Situação', CASE WHEN (convert(varchar, R034FUN.DatAdm, 103) = '31/12/1900') THEN null ELSE (convert(varchar, R034FUN.DatAdm, 103)) END 'Dt.Admissão', CASE WHEN (convert(varchar, R038AFA.DatAfa, 103) = '31/12/1900') THEN null ELSE (convert(varchar, R038AFA.DatAfa, 103)) END 'Dt.Demissão', CASE R034FUN.EstCiv WHEN 1 THEN 'Solteiro' WHEN 2 THEN 'Casado' WHEN 3 THEN 'Divorciado' WHEN 4 THEN 'Viúvo' WHEN 5 THEN 'Concubinato' WHEN 6 THEN 'Separado' WHEN 7 THEN 'União Estável' WHEN 9 THEN 'Outros' ELSE 'Solteiro' END 'Estado Civil', R034FUN.NumPis 'Pis/Pasep', CASE R034FUN.tipcon WHEN 1 THEN 'Empregado' WHEN 2 THEN 'Diretor' WHEN 3 THEN 'Trabalhador Rural' WHEN 4 THEN 'Aposentado' WHEN 5 THEN 'Estágiario' WHEN 6 THEN 'Aprendiz' WHEN 7 THEN 'Prazo Determinado - Lei 9.601/98' WHEN 8 THEN 'Diretor Aposentado' WHEN 9 THEN 'Agente Público' WHEN 10 THEN 'Professor' WHEN 11 THEN 'Cooperador' WHEN 12 THEN 'Trabalhador Doméstico' WHEN 13 THEN 'Professor Prazo Determinado' ELSE 'Empregado' END 'Contratação', R033PES.NumCid 'Rg', R033PES.EstCid 'UF-RG', CASE WHEN R034FUN.NumCPF = 0 THEN ' ' WHEN R034FUN.NumCPF IS NULL THEN ' ' WHEN ((R034FUN.NumCPF <> 0) AND (LEN(R034FUN.NumCPF)= 1)) THEN (SUBSTRING('0000000000' + CONVERT(CHAR, R034FUN.NumCPF),1,3) + '.' + SUBSTRING('0000000000' + CONVERT(CHAR, R034FUN.NumCPF),4,3) + '.' + SUBSTRING('0000000000' + CONVERT(CHAR, R034FUN.NumCPF),7,3) + '-' + SUBSTRING('0000000000' + CONVERT(CHAR, R034FUN.NumCPF),10,2)) WHEN ((R034FUN.NumCPF <> 0) AND (LEN(R034FUN.NumCPF)= 2)) THEN (SUBSTRING('000000000' + CONVERT(CHAR, R034FUN.NumCPF),1,3) + '.' + SUBSTRING('000000000' + CONVERT(CHAR, R034FUN.NumCPF),4,3) + '.' + SUBSTRING('000000000' + CONVERT(CHAR, R034FUN.NumCPF),7,3) + '-' + SUBSTRING('000000000' + CONVERT(CHAR, R034FUN.NumCPF),10,2)) WHEN ((R034FUN.NumCPF <> 0) AND (LEN(R034FUN.NumCPF)= 3)) THEN (SUBSTRING('00000000' + CONVERT(CHAR, R034FUN.NumCPF),1,3) + '.' + SUBSTRING('00000000' + CONVERT(CHAR, R034FUN.NumCPF),4,3) + '.' + SUBSTRING('00000000' + CONVERT(CHAR, R034FUN.NumCPF),7,3) + '-' + SUBSTRING('00000000' + CONVERT(CHAR, R034FUN.NumCPF),10,2)) WHEN ((R034FUN.NumCPF <> 0) AND (LEN(R034FUN.NumCPF)= 4)) THEN (SUBSTRING('0000000' + CONVERT(CHAR, R034FUN.NumCPF),1,3) + '.' + SUBSTRING('0000000' + CONVERT(CHAR, R034FUN.NumCPF),4,3) + '.' + SUBSTRING('0000000' + CONVERT(CHAR, R034FUN.NumCPF),7,3) + '-' + SUBSTRING('0000000' + CONVERT(CHAR, R034FUN.NumCPF),10,2)) WHEN ((R034FUN.NumCPF <> 0) AND (LEN(R034FUN.NumCPF)= 5)) THEN (SUBSTRING('000000' + CONVERT(CHAR, R034FUN.NumCPF),1,3) + '.' + SUBSTRING('000000' + CONVERT(CHAR, R034FUN.NumCPF),4,3) + '.' + SUBSTRING('000000' + CONVERT(CHAR, R034FUN.NumCPF),7,3) + '-' + SUBSTRING('000000' + CONVERT(CHAR, R034FUN.NumCPF),10,2)) WHEN ((R034FUN.NumCPF <> 0) AND (LEN(R034FUN.NumCPF)= 6)) THEN (SUBSTRING('00000' + CONVERT(CHAR, R034FUN.NumCPF),1,3) + '.' + SUBSTRING('00000' + CONVERT(CHAR, R034FUN.NumCPF),4,3) + '.' + SUBSTRING('00000' + CONVERT(CHAR, R034FUN.NumCPF),7,3) + '-' + SUBSTRING('00000' + CONVERT(CHAR, R034FUN.NumCPF),10,2)) WHEN ((R034FUN.NumCPF <> 0) AND (LEN(R034FUN.NumCPF)= 7)) THEN (SUBSTRING('0000' + CONVERT(CHAR, R034FUN.NumCPF),1,3) + '.' + SUBSTRING('0000' + CONVERT(CHAR, R034FUN.NumCPF),4,3) + '.' + SUBSTRING('0000' + CONVERT(CHAR, R034FUN.NumCPF),7,3) + '-' + SUBSTRING('0000' + CONVERT(CHAR, R034FUN.NumCPF),10,2)) WHEN ((R034FUN.NumCPF <> 0) AND (LEN(R034FUN.NumCPF)= 8)) THEN (SUBSTRING('000' + CONVERT(CHAR, R034FUN.NumCPF),1,3) + '.' + SUBSTRING('000' + CONVERT(CHAR, R034FUN.NumCPF),4,3) + '.' + SUBSTRING('000' + CONVERT(CHAR, R034FUN.NumCPF),7,3) + '-' + SUBSTRING('000' + CONVERT(CHAR, R034FUN.NumCPF),10,2)) WHEN ((R034FUN.NumCPF <> 0) AND (LEN(R034FUN.NumCPF)= 9)) THEN (SUBSTRING('00' + CONVERT(CHAR, R034FUN.NumCPF),1,3) + '.' + SUBSTRING('00' + CONVERT(CHAR, R034FUN.NumCPF),4,3) + '.' + SUBSTRING('00' + CONVERT(CHAR, R034FUN.NumCPF),7,3) + '-' + SUBSTRING('00' + CONVERT(CHAR, R034FUN.NumCPF),10,2)) WHEN ((R034FUN.NumCPF <> 0) AND (LEN(R034FUN.NumCPF)= 10)) THEN (SUBSTRING('0' + CONVERT(CHAR, R034FUN.NumCPF),1,3) + '.' + SUBSTRING('0' + CONVERT(CHAR, R034FUN.NumCPF),4,3) + '.' + SUBSTRING('0' + CONVERT(CHAR, R034FUN.NumCPF),7,3) + '-' + SUBSTRING('0' + CONVERT(CHAR, R034FUN.NumCPF),10,2)) WHEN ((R034FUN.NumCPF <> 0) AND (LEN(R034FUN.NumCPF)= 11)) THEN (SUBSTRING(CONVERT(CHAR, R034FUN.NumCPF),1,3) + '.' + SUBSTRING(CONVERT(CHAR, R034FUN.NumCPF),4,3) + '.' + SUBSTRING(CONVERT(CHAR, R034FUN.NumCPF),7,3) + '-' + SUBSTRING(CONVERT(CHAR, R034FUN.NumCPF),10,2)) ELSE '' END 'CPF' FROM R034FUN inner join R030EMP on (R030EMP.NumEmp = R034FUN.NumEmp) inner join R030CAR on (R030CAR.NumEmp = R034FUN.NumEmp AND R030CAR.EstCar = R034FUN.EstCar AND R030CAR.DatAlt = (SELECT MAX(C.DATALT) FROM R030CAR C WHERE R030EMP.NumEmp = C.NumEmp AND C.DatAlt <= GETDATE())) inner join R024CAR on (R024CAR.EstCar = R034FUN.EstCar AND R024CAR.CodCar = R034FUN.CodCar) inner join R030ORG on (R030ORG.NumEmp = R034FUN.NumEmp AND R030ORG.TabOrg = R034FUN.TabOrg AND R030ORG.DatAlt = (SELECT MAX(O.DATALT) FROM R030ORG O WHERE R030EMP.NumEmp = O.NumEmp AND O.DatAlt <= GETDATE())) inner join R016ORN on (R016ORN.TabOrg = R034FUN.TabOrg AND R016ORN.NumLoc = R034FUN.NumLoc) inner join R016HIE on (R016HIE.TabOrg = R034FUN.TabOrg AND R016HIE.NumLoc = R034FUN.NumLoc AND R016HIE.DatIni = (SELECT MAX(H.DATINI) FROM R016HIE H WHERE R034FUN.TabOrg = H.TabOrg AND R034FUN.NumLoc = H.NumLoc AND H.DatIni <= GETDATE())) inner join R030FIL on (R030FIL.NumEmp = R034FUN.NumEmp AND R030FIL.CodFil = R034FUN.CodFil) inner join R010SIT on (R010SIT.CodSit = R034FUN.SitAfa) left join R033PES on (R033PES.CodPES = R034FUN.CodPes) left join R038AFA on (R038AFA.numemp = R034FUN.NumEmp AND R038AFA.TipCol = R034FUN.tipcol AND R038AFA.NumCad = R034FUN.numcad AND r038afa.sitafa in (SELECT S.codsit FROM r010sit S WHERE S.tipsit = 7)) WHERE R034FUn.tipcol IN (1,2) ORDER BY 1,3,4 |
Observación
El comando anteriorconsidera también los empleados que sondespedido.
SELECT R034FUN.CodFil "Cod.Unid", R030FIL.NomFil "Nome Unidade", R030ORG.TabOrg || '/' || R016HIE.CodLoc "Cod.Setor", R016ORN.NomLoc "Nome Setor", R030CAR.EstCar || '/' || R034FUN.CodCar "Cod.Cargo", R024CAR.TitRed "Nome Cargo", R034FUN.TipCol || '/' || R034FUN.NumCad "Matrícula", '' "Cod Funcionário", R034FUN.NomFun "Nome Funcionário", DECODE(TO_CHAR(R034FUN.DatNas, 'DD/MM/YYYY'), '31/12/1900', null, TO_CHAR(R034FUN.DatNas, 'DD/MM/YYYY')) "Dt.Nascimento", R034FUN.TipSex "Sexo", R010SIT.DesSit "Situação", DECODE(TO_CHAR(R034FUN.DatAdm, 'DD/MM/YYYY'), '31/12/1900', null, TO_CHAR(R034FUN.DatAdm, 'DD/MM/YYYY')) "Dt.Admissão", DECODE(TO_CHAR(R038AFA.DATAFA, 'DD/MM/YYYY'), '31/12/1900', null, TO_CHAR(R038AFA.DATAFA, 'DD/MM/YYYY')) "Dt.Demissão", CASE R034FUN.EstCiv WHEN 1 THEN 'Solteiro' WHEN 2 THEN 'Casado' WHEN 3 THEN 'Divorciado' WHEN 4 THEN 'Viúvo' WHEN 5 THEN 'Concubinato' WHEN 6 THEN 'Separado' WHEN 7 THEN 'União Estável' WHEN 9 THEN 'Outros' ELSE 'Solteiro' END "Estado Civil", R034FUN.NumPis "Pis/Pasep", CASE R034FUN.tipcon WHEN 1 THEN 'Empregado' WHEN 2 THEN 'Diretor' WHEN 3 THEN 'Trabalhador Rural' WHEN 4 THEN 'Aposentado' WHEN 5 THEN 'Estágiario' WHEN 6 THEN 'Aprendiz' WHEN 7 THEN 'Prazo Determinado - Lei 9.601/98' WHEN 8 THEN 'Diretor Aposentado' WHEN 9 THEN 'Agente Público' WHEN 10 THEN 'Professor' WHEN 11 THEN 'Cooperador' WHEN 12 THEN 'Trabalhador Doméstico' WHEN 13 THEN 'Professor Prazo Determinado' ELSE 'Empregado' END "Contratação", R033PES.NumCid "Rg", R033PES.EstCid "UF-RG", DECODE(R034FUN.NumCPF, 0, ' ', SUBSTR(TO_CHAR(R034FUN.NumCPF),1,3) ||'.'|| SUBSTR(TO_CHAR(R034FUN.NumCPF),4,3) ||'.'|| SUBSTR(TO_CHAR(R034FUN.NumCPF),7,3) ||'-'|| SUBSTR(TO_CHAR(R034FUN.NumCPF),10,2)) "CPF" FROM R034FUN inner join R030EMP on (R030EMP.NumEmp = R034FUN.NumEmp) inner join R030CAR on (R030CAR.NumEmp = R030EMP.NumEmp AND R030CAR.EstCar = R034FUN.EstCar AND R030CAR.DatAlt = (SELECT MAX(DATALT) FROM R030CAR C WHERE R030EMP.NumEmp = C.NumEmp AND C.DatAlt <= SYSDATE)) inner join R024CAR on (R024CAR.EstCar = R034FUN.EstCar AND R024CAR.CodCar = R034FUN.CodCar) inner join R030ORG on (R030ORG.NumEmp = R034FUN.NumEmp AND R030ORG.TabOrg = R034FUN.TabOrg AND R030ORG.DatAlt = (SELECT MAX(O.DATALT) FROM R030ORG O WHERE R030EMP.NumEmp = O.NumEmp AND O.DatAlt <= SYSDATE)) inner join R016ORN on (R016ORN.TabOrg = R034FUN.TabOrg AND R016ORN.NumLoc = R034FUN.NumLoc) inner join R016HIE on (R016HIE.TabOrg = R034FUN.TabOrg AND R016HIE.NumLoc = R034FUN.NumLoc AND R016HIE.DatIni = (SELECT MAX(DATINI) FROM R016HIE H WHERE R034FUN.TabOrg = H.TabOrg AND R034FUN.NumLoc = H.NumLoc AND H.DatIni <= SYSDATE)) inner join R030FIL on (R030FIL.NumEmp = R034FUN.NumEmp AND R030FIL.CodFil = R034FUN.CodFil) inner join R010SIT on (R010SIT.CodSit = R034FUN.SitAfa) left join R033PES on (R033PES.CodPES = R034FUN.CodPes) left join R038AFA on (R038AFA.numemp = R034FUN.NumEmp AND R034FUN.TipCol = R038AFA.tipcol AND R034FUN.NumCad = R038AFA.numcad AND r038afa.sitafa IN (SELECT codsit FROM r010sit WHERE r010sit.tipsit = 7)) WHERE R034FUN.TipCol IN (1,2) ORDER BY 1,3,4 |
Observación
El comando anteriorconsidera también los empleados que sondespedido.
Posiciones
Ligação dos registros
La vinculación de los registros la realiza elcódigo de recursos humanos del trabajo:
Registro en el sistema de Senior | Registro con el proveedor de SST | Ejemplo | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
R024CAR.EstCar
R024CAR.CodCar
|
Campo: Código RH do CARGO Formato:
|
|
Comandos do banco de dados para saneamento da base
SELECT DISTINCT R024CAR.EstCar 'Estrutura cargo', R024CAR.CodCar 'Código cargo', R024CAR.TitRed 'Título cargo', CAST(R024CAR.ESTCAR AS VARCHAR(10))+'/'+ CAST(R024CAR.CODCAR AS VARCHAR(100)) 'CÓDIGO RH DO CARGO' FROM R024CAR, R034FUN, R010SIT WHERE (R024CAR.DatExt >= getdate() OR CAST(R024CAR.DatExt AS DATE) = '1900-12-31') AND R024CAR.ESTCAR = R034FUN.ESTCAR AND R024CAR.CODCAR = R034FUN.CODCAR AND R034FUN.SITAFA = R010SIT.CODSIT AND R010SIT.TIPSIT <> 7 ORDER BY 1,3 |
SELECT DISTINCT R024CAR.EstCar "Estrutura cargo", R024CAR.CodCar "Código cargo", R024CAR.TitRed "Título cargo", R024CAR.EstCar || '/' || R024CAR.CodCar "Código RH do CARGO" FROM R024CAR, R034FUN, R010SIT WHERE (R024CAR.DatExt >= sysdate OR R024CAR.DatExt = TO_DATE('1900-12-31', 'YYYY-MM-DD')) AND R024CAR.ESTCAR = R034FUN.ESTCAR AND R024CAR.CODCAR = R034FUN.CODCAR AND R034FUN.SITAFA = R010SIT.CODSIT AND R010SIT.TIPSIT <> 7 ORDER BY 1,3 |
Setores (Locais)
Ligação dos registros
La vinculación de los registros la realiza elcódigo de recursos humanos de la industria:
Registro en el sistema de Senior | Registro con el proveedor de SST | Ejemplo | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
R016HIE.TabOrg
R016HIE.CodLoc
|
Campo: Código RH do SETOR Formato:
|
|
Comandos do banco de dados para saneamento da base
SELECT DISTINCT R016HIE.TabOrg 'Tabela organograma', R016HIE.CodLoc 'Código setor', R016ORN.NomLoc 'Nome setor', CAST(R016HIE.TABORG AS VARCHAR(200)) +'/'+ R016HIE.CODLOC 'CÓDIGO RH DO SETOR' FROM R016ORN, R016HIE, R034FUN, R010SIT WHERE R016ORN.TabOrg = R016HIE.TabOrg AND R016ORN.NumLoc = R016HIE.NumLoc AND R016HIE.DatIni = (SELECT MAX(DATINI) FROM R016HIE H WHERE R016ORN.TabOrg = H.TabOrg AND R016ORN.NumLoc = H.NumLoc AND H.DatIni <= GETDATE()) AND (R016ORN.DatExt >= getdate() OR CAST(R016ORN.DatExt AS DATE) = '1900-12-31') AND R016ORN.taborg = R034FUN.taborg AND R016HIE.numloc = R034FUN.numloc AND R034FUN.SITAFA = R010SIT.CODSIT AND R010SIT.TIPSIT <> 7 ORDER BY 1,2,3 |
SELECT DISTINCT R016HIE.TabOrg "Tabela organograma", R016HIE.CodLoc "Código setor", R016ORN.NomLoc "Nome setor", R016HIE.TabOrg || '/' || R016HIE.CodLoc "Código RH do SETOR" FROM R016ORN, R016HIE, R034FUN, R010SIT WHERE R016ORN.TabOrg = R016HIE.TabOrg AND R016ORN.NumLoc = R016HIE.NumLoc AND R016HIE.DatIni = (SELECT MAX(DATINI) FROM R016HIE H WHERE R016ORN.TabOrg = H.TabOrg AND R016ORN.NumLoc = H.NumLoc AND H.DatIni <= SYSDATE) AND (R016ORN.DatExt >= sysdate OR R016ORN.DatExt = TO_DATE('1900-12-31', 'YYYY-MM-DD')) AND R016ORN.taborg = R034FUN.taborg AND R016HIE.numloc = R034FUN.numloc AND R034FUN.SITAFA = R010SIT.CODSIT AND R010SIT.TIPSIT <> 7 ORDER BY 1,2,3 |
Filiais
Ligação dos registros
La vinculación de los registros la realiza elcódigo HR sucursal:
Registro en el sistema de Senior | Registro con el proveedor de SST | Ejemplo | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
R030FIL.CodFil
|
Campo: Código RH da FILIAL Formato:
|
|
Comandos do banco de dados para saneamento da base
SELECT R030FIL.NumEmp 'Empresa', R030EMP.NomEmp 'Nome empresa', R030FIL.CodFil 'Código filial', R030FIL.NomFil 'Nome da Filial', R030FIL.RazSoc 'Razão social da filial', R030FIL.CodFil 'Código RH da Filial', CASE R030FIL.TipIns WHEN 1 THEN 'CNPJ' WHEN 2 THEN 'CEI' WHEN 3 THEN 'CPF' ELSE null END 'Tipo de inscrição', CASE R030FIL.TipIns WHEN 1 THEN CASE WHEN (REPLACE(R030FIL.NumCGC, '.', '') = null) THEN null ELSE (SUBSTRING(CONVERT(CHAR, REPLACE(R030FIL.NumCGC, '.', '')),1,2) + '.' + SUBSTRING(CONVERT(CHAR, REPLACE(R030FIL.NumCGC, '.', '')),3,3) + '.' + SUBSTRING(CONVERT(CHAR, REPLACE(R030FIL.NumCGC, '.', '')),6,3) + '/' + SUBSTRING(CONVERT(CHAR, REPLACE(R030FIL.NumCGC, '.', '')),9,4) + '-' + SUBSTRING(CONVERT(CHAR, REPLACE(R030FIL.NumCGC, '.', '')),13,2)) END WHEN 2 THEN CASE WHEN (REPLACE(R030FIL.NumCGC, '.', '') = null) THEN null ELSE (SUBSTRING(CONVERT(CHAR, REPLACE(R030FIL.NumCGC, '.', '')),1,2) + '.' + SUBSTRING(CONVERT(CHAR, REPLACE(R030FIL.NumCGC, '.', '')),3,3) + '.' + SUBSTRING(CONVERT(CHAR, REPLACE(R030FIL.NumCGC, '.', '')),6,5) + '/' + SUBSTRING(CONVERT(CHAR, REPLACE(R030FIL.NumCGC, '.', '')),11,2)) END WHEN 3 THEN CASE WHEN (REPLACE(R030FIL.NumCGC, '.', '') = null) THEN null ELSE (SUBSTRING(CONVERT(CHAR, REPLACE(R030FIL.NumCGC, '.', '')),1,3) + '.' + SUBSTRING(CONVERT(CHAR, REPLACE(R030FIL.NumCGC, '.', '')),4,3) + '.' + SUBSTRING(CONVERT(CHAR, REPLACE(R030FIL.NumCGC, '.', '')),7,3) + '-' + SUBSTRING(CONVERT(CHAR, REPLACE(R030FIL.NumCGC, '.', '')),10,2)) END ELSE null END 'Número de inscrição', CASE WHEN (R030FIL.InsCei = 0) THEN null ELSE R030FIL.InsCei END 'Número de inscrição CEI', CASE WHEN (R030FIL.NumCno = 0) THEN null ELSE R030FIL.NumCno END 'Número de inscrição no CNO', CASE WHEN (R030FIL.NCaepf = 0) THEN null ELSE R030FIL.NCaepf END 'Número de inscrição no CAEPF' FROM R030FIL, R030EMP WHERE R030Emp.NumEmp = R030FIL.NumEmp ORDER BY 1,3,4 |
SELECT R030FIL.NumEmp "Empresa", R030EMP.NomEmp "Nome empresa", R030FIL.CodFil "Código filial", R030FIL.NomFil "Nome da Filial", R030FIL.RazSoc "Razão social da filial", R030FIL.CodFil "Código RH da FILIAL", CASE R030FIL.TipIns WHEN 1 THEN 'CNPJ' WHEN 2 THEN 'CEI' WHEN 3 THEN 'CPF' ELSE NULL END "Tipo de inscrição", CASE R030FIL.TipIns WHEN 1 THEN DECODE(REPLACE(R030FIL.NumCGC, '.', ''), null, null, SUBSTR(REPLACE(R030FIL.NumCGC, '.', ''),1,2) || '.' || SUBSTR(REPLACE(R030FIL.NumCGC, '.', ''),3,3) || '.' || SUBSTR(REPLACE(R030FIL.NumCGC, '.', ''),6,3) || '/' || SUBSTR(REPLACE(R030FIL.NumCGC, '.', ''),9,4) || '-' || SUBSTR(REPLACE(R030FIL.NumCGC, '.', ''),13,2)) WHEN 2 THEN DECODE(REPLACE(R030FIL.NumCGC, '.', ''),null, null, SUBSTR(REPLACE(R030FIL.NumCGC, '.', ''),1,2) || '.' || SUBSTR(REPLACE(R030FIL.NumCGC, '.', ''),3,3) || '.' || SUBSTR(REPLACE(R030FIL.NumCGC, '.', ''),6,5) || '/' || SUBSTR(REPLACE(R030FIL.NumCGC, '.', ''),11,2)) WHEN 3 THEN DECODE(REPLACE(R030FIL.NumCGC, '.', ''), 0, ' ', SUBSTR(REPLACE(R030FIL.NumCGC, '.', ''),1,3) ||'.'|| SUBSTR(REPLACE(R030FIL.NumCGC, '.', ''),4,3) ||'.'|| SUBSTR(REPLACE(R030FIL.NumCGC, '.', ''),7,3) ||'-'|| SUBSTR(REPLACE(R030FIL.NumCGC, '.', ''),10,2)) ELSE null END "Número de inscrição", DECODE(R030FIL.InsCei, 0, null, R030FIL.InsCei) "Número de inscrição CEI", DECODE(R030FIL.NumCno, 0, null, R030FIL.NumCno) "Número de inscrição CEI", DECODE(R030FIL.NCaepf, 0, null, R030FIL.NCaepf) "Número de inscrição CEI" FROM R030FIL, R030EMP WHERE R030Emp.NumEmp = R030FIL.NumEmp ORDER BY 1,3,4 |
Centros de custos
Ligação dos registros
La vinculación de los registros la realiza elcódigo HR del centro de coste:
Registro en el sistema de Senior | Registro con el proveedor de SST | Ejemplo | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
R018CCU.CodCcu
|
Campo: Código RH do CENTRO DE CUSTO Formato:
|
|
Comandos do banco de dados para saneamento da base
SELECT DISTINCT R018CCU.NumEmp 'Empresa', R030EMP.NomEmp 'Nome empresa', R018CCU.CodCcu 'Código centro de custo', R018CCU.NomCcu 'Descrição centro de custo', R018CCU.CodCcu 'CÓDIGO RH DO CENTRO DE CUSTO' FROM R030EMP, R018CCU, R034FUN, R010SIT WHERE R018CCU.NUMEMP = R030EMP.NUMEMP AND R018CCU.NUMEMP = R034FUN.NUMEMP AND R018CCU.CODCCU = R034FUN.CODCCU AND (R018CCU.DatExt >= getdate() OR CAST(R018CCU.DatExt AS DATE) = '1900-12-31') AND R034FUN.SITAFA = R010SIT.CODSIT AND R010SIT.TIPSIT <> 7 ORDER BY 1,3 |
SELECT DISTINCT R018CCU.NumEmp "Empresa", R030EMP.NomEmp "Nome empresa", R018CCU.CodCcu "Código centro de custo", R018CCU.NomCcu "Descrição centro de custo", R018CCU.CodCcu "CÓDIGO RH DO CENTRO DE CUSTO" FROM R030EMP, R018CCU, R034FUN, R010SIT WHERE R018CCU.NUMEMP = R030EMP.NUMEMP AND R018CCU.NUMEMP = R034FUN.NUMEMP AND R018CCU.CODCCU = R034FUN.CODCCU AND (R018CCU.DatExt >= sysdate OR R018CCU.DatExt = TO_DATE('1900-12-31', 'YYYY-MM-DD')) AND R034FUN.SITAFA = R010SIT.CODSIT AND R010SIT.TIPSIT <> 7 ORDER BY 1,3 |