Commit 1e83e095 authored by Ramon Quintana's avatar Ramon Quintana

actualizacion de la vista vista_salario

parent d928c849
DROP VIEW crm.vista_salario;
CREATE VIEW
crm.vista_salario
(
id_categcontr,
nro_legajo,
id_contrato,
id_objgasto,
id_concepto,
id_categ,
categ,
importe_salario,
desde,
hasta,
id_tipocontrato,
estado_reg
) AS
SELECT
c.id_categcontr,
c.nro_legajo,
c.id_contrato,
c.id_objgasto,
c.id_concepto,
c.id_categ,
vc.categ,
c.importe AS importe_salario,
c.desde,
c.hasta,
con.id_tipocontrato,
c.estado_reg
FROM
((crm.rrhh_categcontr c
LEFT JOIN
crm.vista_categoria vc
ON
(((
c.id_categ)::text = vc.id)))
JOIN
crm.rrhh_contrato con
ON
((
c.id_contrato = con.id_contrato)))
WHERE
((
c.tipo = 'S'::bpchar)
AND (
c.id_categ IS NOT NULL))
UNION
SELECT
cc.id AS id_categcontr,
cc.nro_legajo,
c.id_contrato,
NULL::INTEGER AS id_objgasto,
NULL::INTEGER AS id_concepto,
NULL::CHARACTER VARYING AS id_categ,
cc.categoria AS categ,
cc.asignacion AS importe_salario,
c.fecha_desde AS desde,
c.fecha_hasta AS hasta,
c.id_tipocontrato,
c.estado_reg
FROM
(crm.rrhh_comisionado_categ cc
JOIN
crm.rrhh_contrato c
ON
((
c.nro_legajo = cc.nro_legajo)));
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment