<?xml version="1.0" encoding="UTF-8"?>
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="extracto_consol_anual" language="groovy" pageWidth="612" pageHeight="792" columnWidth="572" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20">
	<property name="ireport.zoom" value="1.464100000000004"/>
	<property name="ireport.x" value="0"/>
	<property name="ireport.y" value="0"/>
	<parameter name="num_doc" class="java.lang.String">
		<defaultValueExpression><![CDATA[]]></defaultValueExpression>
	</parameter>
	<parameter name="nombre_periodo" class="java.lang.String">
		<defaultValueExpression><![CDATA[]]></defaultValueExpression>
	</parameter>
	<parameter name="id_agrup_concepto" class="java.math.BigDecimal">
		<defaultValueExpression><![CDATA[]]></defaultValueExpression>
	</parameter>
	<parameter name="id_tipo_doc" class="java.lang.String">
		<defaultValueExpression><![CDATA[]]></defaultValueExpression>
	</parameter>
	<parameter name="periodo" class="java.math.BigDecimal">
		<defaultValueExpression><![CDATA[]]></defaultValueExpression>
	</parameter>
	<parameter name="tag_firma" class="java.math.BigDecimal">
		<defaultValueExpression><![CDATA[1]]></defaultValueExpression>
	</parameter>
	<parameter name="entidad_cliente" class="java.math.BigDecimal">
		<defaultValueExpression><![CDATA[0]]></defaultValueExpression>
	</parameter>
	<queryString>
		<![CDATA[select

nvl((select
prom.valor_promedio as valor_promedio
from no_liquida_promedio prom
where prom.id_anhos = TAB3.ID_ANHOS
and prom.id_tipo_doc = TAB0.ID_TIPO_DOC
and prom.num_doc = TAB0.NUM_DOC
and prom.caracter in ( case when agrup.tipo_valor = 'R' then 'P' else agrup.tipo_valor end , case when agrup.tipo_valor != 'R' then '' else agrup.tipo_valor end )
and prom.id_concep_nomina = agrup.id_concep_nomina),0) as valor_promedio,

to_char (sysdate, 'fmday dd "de "fmmonth" de "yyyy') as mensaje_fecha,
(select descripcion from no_inf_firma where comando = 'no_extracto_consol_anual' and rownum = 1 ) as mensaje,
case when to_date( agrup.vig_ini  || '01-01','yyyy-mm-dd') > tab10.fecha_ingreso then to_date( agrup.vig_ini  || '01-01','yyyy-mm-dd') else tab10.fecha_ingreso end as fecha_desde,
to_date( agrup.vig_fin  || '12-31','yyyy-mm-dd') as fecha_hasta,
TAB0.ID_CESANTIA as ID_CESANTIA, TAB0.ID_PERIODO as ID_PERIODO, TAB0.ID_TIPO_DOC as ID_TIPO_DOC,
TAB0.NUM_DOC as NUM_DOC, TAB0.ID_CONCEP_NOMINA as ID_CONCEP_NOMINA, TAB0.VALOR_LIQUIDADO as VALOR_LIQUIDADO,
TAB0.NUM_DIAS as NUM_DIAS,
TAB0.VALOR_BASE as VALOR_BASE,
TAB0.VALOR_CONSOLIDADO as VALOR_CONSOLIDADO, TAB0.VALOR_APLICADO as VALOR_APLICADO,
TAB0.VALOR_AJUSTE as VALOR_AJUSTE, TAB1.DESCRIPCION as DESCRIPCION, TAB1.ABREVIACION as ABREVIACION,
TAB2.PRIMER_NOMBRE as PRIMER_NOMBRE, TAB2.SEGUNDO_NOMBRE as SEGUNDO_NOMBRE,
TAB2.PRIMER_APELLIDO as PRIMER_APELLIDO, TAB2.SEGUNDO_APELLIDO as SEGUNDO_APELLIDO,
TAB2.PRIMER_NOMBRE||' '||TAB2.SEGUNDO_NOMBRE as NOMBRE,
tab2.nombre_apellido,
tab2.email,
tab3.periodo,
TAB3.ID_ANHOS as ID_ANHOS,
TAB3.ID_MESES as ID_MESES, TAB3.ID_ANHOS||' '||TAB3.ID_MESES as PERIODO_MES,
tab4.asignacion_basica as asignacion_basica, tab8.coddepto as coddepto, tab9.codmun_text as codmun_text,
tab10.fecha_ingreso, tab10.fecha_termina, tab10.fecha_retiro,
agrup.id_concep_nomina as id_concep_nomina_agrup, agrup.codigo,
agrup.descripcion as descripcion_agrup, agrup.valor, agrup.tipo_valor,
case when agrup.tipo_valor = 'V' then '1/12' else '' end as parte,
case when agrup.tipo_valor = 'V' then round(agrup.valor /12 , 2) else agrup.valor end as valor_base_agrup,
TAB6.DENOMINACION_COMP

from NO_CESANTIA tab0

join TIPO_DOCUMENTO TAB1 on TAB0.ID_TIPO_DOC = TAB1.ID_TIPO_DOC
join no_datos_funcionario_v tab2 on tab0.id_tipo_doc = tab2.id_tipo_doc and tab0.num_doc = tab2.num_doc
join NO_PERIODO_V TAB3 on TAB0.ID_PERIODO = TAB3.ID_PERIODO
LEFT JOIN NO_LIQUIDA_V tab4 ON tab0.id_tipo_doc = tab4.id_tipo_dOC and TAB0.NUM_DOC = TAB4.NUM_DOC and TAB0.ID_PERIODO = TAB4.ID_PERIODO
left join NO_ESTADO_FUNC_V TAB5 on TAB0.ID_TIPO_DOC = TAB5.ID_TIPO_DOC and TAB0.NUM_DOC = TAB5.NUM_DOC and TAB0.ID_PERIODO = TAB5.PERIODO
left join no_nombramiento_v tab10 ON tab10.id_tipo_doc = tab0.id_tipo_doc and tab10.num_doc = tab0.num_doc
--and tab10.id_dp = tab5.id_dp
left join NO_DP_V TAB6 on TAB5.ID_DP = TAB6.ID_DP
left join CENTRO_OPERACION TAB7 on TAB5.ID_CEN_OP = TAB7.ID_CEN_OP  left join DEPARTAMENTO TAB8 on TAB7.ID_DEPTO = TAB8.ID_DEPTO
left join MUNICIPIOS TAB9 on TAB7.CODMUN = TAB9.CODMUN


left join(
select
$P{id_tipo_doc} as id_tipo_doc,
$P{num_doc} as num_doc,
/*
Valida si es por promedio o el ultimo salario pagado - 20140128
*/
case
 when (tab.tipo_valor = 'R') and ((select tab1.ult_valor - round(tab1.valor/cant) as promedio from(

    select

    SUM( case when LIQNOM.PERIODO  = $P{periodo} then round(LIQNOM.valor) else 0 end )/
    (case when sum( case when LIQNOM.PERIODO  = $P{periodo} then 1 else 0 end ) > 0 then sum( case when LIQNOM.PERIODO  = $P{periodo} then 1 else 0 end ) else 1 end) as ult_valor,
    round( ( NVL(SUM(LIQNOM.valor),0)  ) )  as VALOR,
    count(LIQNOM.valor) as cant

    from no_concepto_periodo LIQNOM
    join NO_PERIODO PER on PER.ID_PERIODO = LIQNOM.PERIODO
    where 1 = 1 and PER.ID_ANHOS || LPAD(PER.ID_MESES, 2, '0')
    between  extract(YEAR FROM (select fecha_ini from no_periodo where id_periodo = $P{periodo}))|| LPAD( extract(MONTH FROM (select fecha_fin from no_periodo where id_periodo = $P{periodo}))-2, 2, '0')
    and extract(YEAR FROM (select fecha_ini from no_periodo where id_periodo = $P{periodo})) || LPAD( extract(MONTH FROM (select fecha_fin from no_periodo where id_periodo = $P{periodo})), 2, '0')

    and liqnom.id_periodo_ajuste is null
    and liqnom.num_doc = $P{num_doc}  and liqnom.id_tipo_doc = $P{id_tipo_doc}
        and liqnom.id_concep_nomina = (select NO_PARAM_CONCEP.ID_CONCEP_BASICA from NO_PARAM_CONCEP)
    and (
        case
        when LIQNOM.num_dias > 0  then 1
        when LIQNOM.num_dias = 0  and  liqnom.fecha_desde <= liqnom.fecha_hasta then 1
        else 0 end
    ) = 1

)tab1) != 0)
then nvl(no_consulta_sql_f(tab.vig_ini, tab.per_ini, tab.vig_fin, tab.per_fin, $P{id_tipo_doc}, $P{num_doc}, tab.id_concep_nomina, 'P', $P{periodo}) ,0)
/* Para MIN se toma tambien para concepto id-55 - 20210127*/
 when (tab.tipo_valor = 'R') and ((select tab1.ult_valor - round(tab1.valor/cant) as promedio from(

    select

    SUM( case when LIQNOM.PERIODO  = $P{periodo} then round(LIQNOM.valor) else 0 end )/
    (case when sum( case when LIQNOM.PERIODO  = $P{periodo} then 1 else 0 end ) > 0 then sum( case when LIQNOM.PERIODO  = $P{periodo} then 1 else 0 end ) else 1 end) as ult_valor,
    round( ( NVL(SUM(LIQNOM.valor),0)  ) )  as VALOR,
    count(LIQNOM.valor) as cant

    from no_concepto_periodo LIQNOM
    join NO_PERIODO PER on PER.ID_PERIODO = LIQNOM.PERIODO
    where 1 = 1 and PER.ID_ANHOS || LPAD(PER.ID_MESES, 2, '0')
    between  extract(YEAR FROM (select fecha_ini from no_periodo where id_periodo = $P{periodo}))|| LPAD( extract(MONTH FROM (select fecha_fin from no_periodo where id_periodo = $P{periodo}))-2, 2, '0')
    and extract(YEAR FROM (select fecha_ini from no_periodo where id_periodo = $P{periodo})) || LPAD( extract(MONTH FROM (select fecha_fin from no_periodo where id_periodo = $P{periodo})), 2, '0')

    and liqnom.id_periodo_ajuste is null
    and liqnom.num_doc = $P{num_doc}  and liqnom.id_tipo_doc = $P{id_tipo_doc}
        and (
            ( liqnom.id_concep_nomina in ( 55 ) and ( $P{entidad_cliente} = 5) )
        )
    and (
        case
        when LIQNOM.num_dias > 0  then 1
        when LIQNOM.num_dias = 0  and  liqnom.fecha_desde <= liqnom.fecha_hasta then 1
        else 0 end
    ) = 1

)tab1) != 0)
then nvl(no_consulta_sql_f(tab.vig_ini, tab.per_ini, tab.vig_fin, tab.per_fin, $P{id_tipo_doc}, $P{num_doc}, tab.id_concep_nomina, 'P', $P{periodo}) ,0)
 when (tab.tipo_valor = 'R')
then nvl(no_consulta_sql_f(tab.vig_ini, tab.per_ini, tab.vig_fin, tab.per_fin, $P{id_tipo_doc}, $P{num_doc}, tab.id_concep_nomina, 'R', $P{periodo}) ,0)
else nvl(no_consulta_sql_f(tab.vig_ini, tab.per_ini, tab.vig_fin, tab.per_fin, $P{id_tipo_doc}, $P{num_doc}, tab.id_concep_nomina, tab.tipo_valor, $P{periodo}) ,0)
end as valor,

tab.*
from(

select
extract(YEAR FROM (select fecha_ini from no_periodo where id_periodo = $P{periodo})) as vig_ini,
1 as per_ini,
extract(YEAR FROM (select fecha_fin from no_periodo where id_periodo = $P{periodo})) as vig_fin,
extract(MONTH FROM (select fecha_fin from no_periodo where id_periodo = $P{periodo})) as per_fin,
TAB0.ID_AGRUP_CONCEPTO,
TAB0.ORDEN,
TAB0.TIPO_VALOR,
tab1.*
from no_agrup_deta tab0
left join no_concep_nomina tab1 on tab1.id_concep_nomina = tab0.id_concep_nomina
where tab0.id_agrup_concepto =  $P{id_agrup_concepto}

)tab


)agrup
on agrup.ID_TIPO_DOC = tab0.ID_TIPO_DOC and agrup.NUM_DOC = tab0.NUM_DOC

where
tab0.id_periodo = $P{periodo} and tab0.consolidado = 1
and tab0.num_doc = $P{num_doc} and tab0.id_tipo_doc = $P{id_tipo_doc}

order by
agrup.codigo]]>
	</queryString>
	<field name="VALOR_PROMEDIO" class="java.math.BigDecimal"/>
	<field name="MENSAJE_FECHA" class="java.lang.String"/>
	<field name="MENSAJE" class="java.lang.String"/>
	<field name="FECHA_DESDE" class="java.sql.Timestamp"/>
	<field name="FECHA_HASTA" class="java.sql.Timestamp"/>
	<field name="ID_CESANTIA" class="java.math.BigDecimal"/>
	<field name="ID_PERIODO" class="java.math.BigDecimal"/>
	<field name="ID_TIPO_DOC" class="java.math.BigDecimal"/>
	<field name="NUM_DOC" class="java.lang.String"/>
	<field name="ID_CONCEP_NOMINA" class="java.math.BigDecimal"/>
	<field name="VALOR_LIQUIDADO" class="java.math.BigDecimal"/>
	<field name="NUM_DIAS" class="java.math.BigDecimal"/>
	<field name="VALOR_BASE" class="java.math.BigDecimal"/>
	<field name="VALOR_CONSOLIDADO" class="java.math.BigDecimal"/>
	<field name="VALOR_APLICADO" class="java.math.BigDecimal"/>
	<field name="VALOR_AJUSTE" class="java.math.BigDecimal"/>
	<field name="DESCRIPCION" class="java.lang.String"/>
	<field name="ABREVIACION" class="java.lang.String"/>
	<field name="PRIMER_NOMBRE" class="java.lang.String"/>
	<field name="SEGUNDO_NOMBRE" class="java.lang.String"/>
	<field name="PRIMER_APELLIDO" class="java.lang.String"/>
	<field name="SEGUNDO_APELLIDO" class="java.lang.String"/>
	<field name="NOMBRE" class="java.lang.String"/>
	<field name="NOMBRE_APELLIDO" class="java.lang.String"/>
	<field name="EMAIL" class="java.lang.String"/>
	<field name="PERIODO" class="java.lang.String"/>
	<field name="ID_ANHOS" class="java.math.BigDecimal"/>
	<field name="ID_MESES" class="java.math.BigDecimal"/>
	<field name="PERIODO_MES" class="java.lang.String"/>
	<field name="ASIGNACION_BASICA" class="java.math.BigDecimal"/>
	<field name="CODDEPTO" class="java.lang.String"/>
	<field name="CODMUN_TEXT" class="java.lang.String"/>
	<field name="FECHA_INGRESO" class="java.sql.Timestamp"/>
	<field name="FECHA_TERMINA" class="java.sql.Timestamp"/>
	<field name="FECHA_RETIRO" class="java.sql.Timestamp"/>
	<field name="ID_CONCEP_NOMINA_AGRUP" class="java.math.BigDecimal"/>
	<field name="CODIGO" class="java.lang.String"/>
	<field name="DESCRIPCION_AGRUP" class="java.lang.String"/>
	<field name="VALOR" class="java.math.BigDecimal"/>
	<field name="TIPO_VALOR" class="java.lang.String"/>
	<field name="PARTE" class="java.lang.String"/>
	<field name="VALOR_BASE_AGRUP" class="java.math.BigDecimal"/>
	<field name="DENOMINACION_COMP" class="java.lang.String"/>
	<variable name="total_valor_base" class="java.math.BigDecimal" calculation="Sum">
		<variableExpression><![CDATA[($F{VALOR_PROMEDIO} == -1
    ? 0
    : ($F{VALOR_PROMEDIO} > 0
            ? $F{VALOR_PROMEDIO}
            : $F{VALOR_BASE_AGRUP}
        )
)]]></variableExpression>
	</variable>
	<group name="num_doc">
		<groupExpression><![CDATA[$F{NUM_DOC}]]></groupExpression>
		<groupHeader>
			<band height="10">
				<staticText>
					<reportElement mode="Opaque" x="292" y="0" width="100" height="10" forecolor="#000000" backcolor="#AED6FB"/>
					<box rightPadding="0">
						<pen lineWidth="0.75"/>
						<topPen lineWidth="0.75"/>
						<leftPen lineWidth="0.75"/>
						<bottomPen lineWidth="0.75"/>
						<rightPen lineWidth="0.75"/>
					</box>
					<textElement textAlignment="Center" verticalAlignment="Middle" rotation="None" markup="none">
						<font fontName="SansSerif" size="8" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
					</textElement>
					<text><![CDATA[Total Anual]]></text>
				</staticText>
				<staticText>
					<reportElement mode="Opaque" x="90" y="0" width="202" height="10" forecolor="#000000" backcolor="#AED6FB"/>
					<box>
						<pen lineWidth="0.75"/>
						<topPen lineWidth="0.75"/>
						<leftPen lineWidth="0.75"/>
						<bottomPen lineWidth="0.75"/>
						<rightPen lineWidth="0.75"/>
					</box>
					<textElement textAlignment="Center" verticalAlignment="Middle" rotation="None" markup="none">
						<font fontName="SansSerif" size="8" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
					</textElement>
					<text><![CDATA[Concepto]]></text>
				</staticText>
				<staticText>
					<reportElement mode="Opaque" x="0" y="0" width="90" height="10" forecolor="#000000" backcolor="#AED6FB"/>
					<box>
						<pen lineWidth="0.75"/>
						<topPen lineWidth="0.75"/>
						<leftPen lineWidth="0.75"/>
						<bottomPen lineWidth="0.75"/>
						<rightPen lineWidth="0.75"/>
					</box>
					<textElement textAlignment="Center" verticalAlignment="Middle" rotation="None" markup="none">
						<font fontName="SansSerif" size="8" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
					</textElement>
					<text><![CDATA[Código]]></text>
				</staticText>
				<staticText>
					<reportElement mode="Opaque" x="472" y="0" width="100" height="10" forecolor="#000000" backcolor="#AED6FB"/>
					<box>
						<pen lineWidth="0.75"/>
						<topPen lineWidth="0.75"/>
						<leftPen lineWidth="0.75"/>
						<bottomPen lineWidth="0.75"/>
						<rightPen lineWidth="0.75"/>
					</box>
					<textElement textAlignment="Center" verticalAlignment="Middle" rotation="None" markup="none">
						<font fontName="SansSerif" size="8" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
					</textElement>
					<text><![CDATA[Valor Base]]></text>
				</staticText>
				<staticText>
					<reportElement mode="Opaque" x="392" y="0" width="80" height="10" forecolor="#000000" backcolor="#AED6FB"/>
					<box>
						<pen lineWidth="0.75"/>
						<topPen lineWidth="0.75"/>
						<leftPen lineWidth="0.75"/>
						<bottomPen lineWidth="0.75"/>
						<rightPen lineWidth="0.75"/>
					</box>
					<textElement textAlignment="Center" verticalAlignment="Middle" rotation="None" markup="none">
						<font fontName="SansSerif" size="8" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
					</textElement>
					<text><![CDATA[]]></text>
				</staticText>
			</band>
		</groupHeader>
		<groupFooter>
			<band height="186">
				<textField pattern="#,##0.00;(#,##0.00)" isBlankWhenNull="true">
					<reportElement mode="Opaque" x="472" y="0" width="100" height="12" forecolor="#000000" backcolor="#D2D8E0"/>
					<box rightPadding="2">
						<pen lineWidth="0.75"/>
						<topPen lineWidth="0.75"/>
						<leftPen lineWidth="0.75"/>
						<bottomPen lineWidth="0.75"/>
						<rightPen lineWidth="0.75"/>
					</box>
					<textElement textAlignment="Right" verticalAlignment="Middle" rotation="None" markup="none">
						<font fontName="SansSerif" size="7" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
					</textElement>
					<textFieldExpression class="java.math.BigDecimal"><![CDATA[$V{total_valor_base}]]></textFieldExpression>
				</textField>
				<staticText>
					<reportElement mode="Opaque" x="0" y="0" width="472" height="12" forecolor="#000000" backcolor="#D2D8E0"/>
					<box leftPadding="2" rightPadding="7">
						<pen lineWidth="0.75"/>
						<topPen lineWidth="0.75"/>
						<leftPen lineWidth="0.75"/>
						<bottomPen lineWidth="0.75"/>
						<rightPen lineWidth="0.75"/>
					</box>
					<textElement textAlignment="Right" verticalAlignment="Middle" rotation="None" markup="none">
						<font fontName="SansSerif" size="7" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
					</textElement>
					<text><![CDATA[Total Base]]></text>
				</staticText>
				<staticText>
					<reportElement mode="Transparent" x="90" y="22" width="302" height="12" forecolor="#000000" backcolor="#A4CFF6"/>
					<box>
						<pen lineWidth="0.75"/>
						<topPen lineWidth="0.75"/>
						<leftPen lineWidth="0.75"/>
						<bottomPen lineWidth="0.75"/>
						<rightPen lineWidth="0.75"/>
					</box>
					<textElement verticalAlignment="Middle" rotation="None" markup="none">
						<font fontName="SansSerif" size="7" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
					</textElement>
					<text><![CDATA[Total Cesantias Consolidado]]></text>
				</staticText>
				<textField pattern="#,##0.00;(#,##0.00)">
					<reportElement x="392" y="22" width="80" height="12"/>
					<box rightPadding="2">
						<pen lineWidth="0.75"/>
						<topPen lineWidth="0.75"/>
						<leftPen lineWidth="0.75"/>
						<bottomPen lineWidth="0.75"/>
						<rightPen lineWidth="0.75"/>
					</box>
					<textElement textAlignment="Right" verticalAlignment="Middle">
						<font size="7" isBold="true"/>
					</textElement>
					<textFieldExpression class="java.math.BigDecimal"><![CDATA[$F{VALOR_CONSOLIDADO}]]></textFieldExpression>
				</textField>
				<textField isStretchWithOverflow="true">
					<reportElement x="1" y="43" width="571" height="70"/>
					<box topPadding="2" leftPadding="2"/>
					<textElement textAlignment="Justified">
						<font size="8"/>
					</textElement>
					<textFieldExpression class="java.lang.String"><![CDATA[$F{MENSAJE}]]></textFieldExpression>
				</textField>
				<textField isStretchWithOverflow="true">
					<reportElement x="1" y="113" width="90" height="14"/>
					<box topPadding="2" leftPadding="2"/>
					<textElement textAlignment="Justified">
						<font size="8"/>
					</textElement>
					<textFieldExpression class="java.lang.String"><![CDATA["Dado en Bogotá D.C., "]]></textFieldExpression>
				</textField>
				<textField isStretchWithOverflow="true" isBlankWhenNull="true">
					<reportElement x="1" y="127" width="291" height="45">
						<printWhenExpression><![CDATA[1 == $P{tag_firma}]]></printWhenExpression>
					</reportElement>
					<box topPadding="2" leftPadding="2">
						<bottomPen lineWidth="0.75"/>
					</box>
					<textElement textAlignment="Justified">
						<font size="8"/>
					</textElement>
				</textField>
				<textField pattern="dd &apos;de&apos; MMMMM &apos;de&apos; yyyy">
					<reportElement mode="Opaque" x="91" y="114" width="200" height="12" forecolor="#000000" backcolor="#FFFFFF"/>
					<box leftPadding="2"/>
					<textElement verticalAlignment="Middle" rotation="None" markup="none">
						<font fontName="SansSerif" size="8" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
					</textElement>
					<textFieldExpression class="java.util.Date"><![CDATA[new java.util.Date()]]></textFieldExpression>
				</textField>
				<textField isStretchWithOverflow="true">
					<reportElement x="1" y="172" width="292" height="14" isRemoveLineWhenBlank="true">
						<printWhenExpression><![CDATA[1 == $P{tag_firma}]]></printWhenExpression>
					</reportElement>
					<box topPadding="2" leftPadding="2"/>
					<textElement textAlignment="Justified">
						<font size="8"/>
					</textElement>
					<textFieldExpression class="java.lang.String"><![CDATA["FIRMA DEL SERVIDOR"]]></textFieldExpression>
				</textField>
			</band>
		</groupFooter>
	</group>
	<background>
		<band splitType="Stretch"/>
	</background>
	<title>
		<band height="60" splitType="Stretch">
			<textField pattern="dd-MMM-yyyy   hh:mm aaa">
				<reportElement mode="Opaque" x="421" y="40" width="151" height="12" forecolor="#000000" backcolor="#FFFFFF"/>
				<textElement textAlignment="Right" verticalAlignment="Middle" rotation="None" markup="none">
					<font fontName="SansSerif" size="8" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
				</textElement>
				<textFieldExpression class="java.util.Date"><![CDATA[new java.util.Date()]]></textFieldExpression>
			</textField>
			<staticText>
				<reportElement x="141" y="0" width="280" height="40"/>
				<textElement textAlignment="Center" verticalAlignment="Bottom" markup="none">
					<font fontName="SansSerif" size="12" isBold="true"/>
				</textElement>
				<text><![CDATA[Sistema General de Nómina
Extracto Consolidado Anual de Cesantias]]></text>
			</staticText>
			<staticText>
				<reportElement mode="Opaque" x="421" y="28" width="151" height="12" forecolor="#000000" backcolor="#FFFFFF"/>
				<textElement textAlignment="Right" verticalAlignment="Middle" rotation="None" markup="none">
					<font fontName="SansSerif" size="8" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
				</textElement>
				<text><![CDATA[Fecha de Impresión:]]></text>
			</staticText>
			<textField>
				<reportElement x="141" y="40" width="280" height="20"/>
				<textElement textAlignment="Center" verticalAlignment="Middle" markup="none">
					<font fontName="SansSerif" size="12" isBold="true"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA["Vigencia - " + $F{ID_ANHOS}]]></textFieldExpression>
			</textField>
			<image>
				<reportElement x="1" y="12" width="140" height="40"/>
				<imageExpression class="java.lang.String"><![CDATA["repo:LogoEmpresa003.jpg"]]></imageExpression>
			</image>
		</band>
	</title>
	<pageHeader>
		<band height="20" splitType="Stretch"/>
	</pageHeader>
	<columnHeader>
		<band height="101" splitType="Stretch">
			<textField>
				<reportElement x="90" y="0" width="482" height="12"/>
				<box leftPadding="2"/>
				<textElement verticalAlignment="Middle">
					<font size="8"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{NOMBRE_APELLIDO}]]></textFieldExpression>
			</textField>
			<staticText>
				<reportElement mode="Transparent" x="0" y="60" width="90" height="12" forecolor="#000000" backcolor="#A4CFF6"/>
				<box>
					<pen lineWidth="0.0"/>
					<topPen lineWidth="0.0"/>
					<leftPen lineWidth="0.0"/>
					<bottomPen lineWidth="0.0"/>
					<rightPen lineWidth="0.0"/>
				</box>
				<textElement verticalAlignment="Middle" rotation="None" markup="none">
					<font fontName="SansSerif" size="7" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
				</textElement>
				<text><![CDATA[Periodo Hasta]]></text>
			</staticText>
			<staticText>
				<reportElement mode="Transparent" x="0" y="0" width="90" height="12" forecolor="#000000" backcolor="#A4CFF6"/>
				<box>
					<pen lineWidth="0.0"/>
					<topPen lineWidth="0.0"/>
					<leftPen lineWidth="0.0"/>
					<bottomPen lineWidth="0.0"/>
					<rightPen lineWidth="0.0"/>
				</box>
				<textElement verticalAlignment="Middle" rotation="None" markup="none">
					<font fontName="SansSerif" size="7" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
				</textElement>
				<text><![CDATA[Funcionario]]></text>
			</staticText>
			<staticText>
				<reportElement mode="Transparent" x="0" y="12" width="90" height="12" forecolor="#000000" backcolor="#A4CFF6"/>
				<box>
					<pen lineWidth="0.0"/>
					<topPen lineWidth="0.0"/>
					<leftPen lineWidth="0.0"/>
					<bottomPen lineWidth="0.0"/>
					<rightPen lineWidth="0.0"/>
				</box>
				<textElement verticalAlignment="Middle" rotation="None" markup="none">
					<font fontName="SansSerif" size="7" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
				</textElement>
				<text><![CDATA[Identificación]]></text>
			</staticText>
			<staticText>
				<reportElement mode="Transparent" x="0" y="36" width="90" height="12" forecolor="#000000" backcolor="#A4CFF6"/>
				<box>
					<pen lineWidth="0.0"/>
					<topPen lineWidth="0.0"/>
					<leftPen lineWidth="0.0"/>
					<bottomPen lineWidth="0.0"/>
					<rightPen lineWidth="0.0"/>
				</box>
				<textElement verticalAlignment="Middle" rotation="None" markup="none">
					<font fontName="SansSerif" size="7" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
				</textElement>
				<text><![CDATA[Fecha Ingreso]]></text>
			</staticText>
			<staticText>
				<reportElement mode="Transparent" x="0" y="72" width="90" height="12" forecolor="#000000" backcolor="#A4CFF6"/>
				<box>
					<pen lineWidth="0.0"/>
					<topPen lineWidth="0.0"/>
					<leftPen lineWidth="0.0"/>
					<bottomPen lineWidth="0.0"/>
					<rightPen lineWidth="0.0"/>
				</box>
				<textElement verticalAlignment="Middle" rotation="None" markup="none">
					<font fontName="SansSerif" size="7" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
				</textElement>
				<text><![CDATA[Días Netos Vigencia]]></text>
			</staticText>
			<staticText>
				<reportElement mode="Transparent" x="0" y="48" width="90" height="12" forecolor="#000000" backcolor="#A4CFF6"/>
				<box>
					<pen lineWidth="0.0"/>
					<topPen lineWidth="0.0"/>
					<leftPen lineWidth="0.0"/>
					<bottomPen lineWidth="0.0"/>
					<rightPen lineWidth="0.0"/>
				</box>
				<textElement verticalAlignment="Middle" rotation="None" markup="none">
					<font fontName="SansSerif" size="7" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
				</textElement>
				<text><![CDATA[Periodo Desde]]></text>
			</staticText>
			<textField>
				<reportElement x="90" y="12" width="202" height="12"/>
				<box leftPadding="2" rightPadding="0"/>
				<textElement verticalAlignment="Middle">
					<font size="8"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{NUM_DOC}]]></textFieldExpression>
			</textField>
			<textField pattern="dd &apos;de&apos; MMMMM &apos;de&apos; yyyy">
				<reportElement x="90" y="36" width="202" height="12"/>
				<box leftPadding="2"/>
				<textElement verticalAlignment="Middle">
					<font size="8"/>
				</textElement>
				<textFieldExpression class="java.sql.Timestamp"><![CDATA[$F{FECHA_INGRESO}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="90" y="72" width="202" height="12"/>
				<box leftPadding="2"/>
				<textElement verticalAlignment="Middle">
					<font size="8"/>
				</textElement>
				<textFieldExpression class="java.math.BigDecimal"><![CDATA[$F{NUM_DIAS}]]></textFieldExpression>
			</textField>
			<textField pattern="dd &apos;de&apos; MMMMM &apos;de&apos; yyyy">
				<reportElement x="90" y="48" width="202" height="12"/>
				<box leftPadding="2"/>
				<textElement verticalAlignment="Middle">
					<font size="8"/>
				</textElement>
				<textFieldExpression class="java.sql.Timestamp"><![CDATA[$F{FECHA_DESDE}]]></textFieldExpression>
			</textField>
			<textField pattern="dd &apos;de&apos; MMMMM &apos;de&apos; yyyy">
				<reportElement x="90" y="60" width="202" height="12"/>
				<box leftPadding="2"/>
				<textElement verticalAlignment="Middle">
					<font size="8"/>
				</textElement>
				<textFieldExpression class="java.sql.Timestamp"><![CDATA[$F{FECHA_HASTA}]]></textFieldExpression>
			</textField>
			<staticText>
				<reportElement mode="Transparent" x="0" y="24" width="90" height="12" forecolor="#000000" backcolor="#A4CFF6"/>
				<box>
					<pen lineWidth="0.0"/>
					<topPen lineWidth="0.0"/>
					<leftPen lineWidth="0.0"/>
					<bottomPen lineWidth="0.0"/>
					<rightPen lineWidth="0.0"/>
				</box>
				<textElement verticalAlignment="Middle" rotation="None" markup="none">
					<font fontName="SansSerif" size="7" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
				</textElement>
				<text><![CDATA[Cargo]]></text>
			</staticText>
			<textField isBlankWhenNull="true">
				<reportElement x="90" y="24" width="482" height="12"/>
				<box leftPadding="2" rightPadding="0"/>
				<textElement verticalAlignment="Middle">
					<font size="8"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{DENOMINACION_COMP}]]></textFieldExpression>
			</textField>
		</band>
	</columnHeader>
	<detail>
		<band height="10" splitType="Stretch">
			<textField pattern="#,##0.00;(#,##0.00)">
				<reportElement x="292" y="0" width="100" height="10"/>
				<box rightPadding="2">
					<pen lineWidth="0.75"/>
					<topPen lineWidth="0.75"/>
					<leftPen lineWidth="0.75"/>
					<bottomPen lineWidth="0.75"/>
					<rightPen lineWidth="0.75"/>
				</box>
				<textElement textAlignment="Right" verticalAlignment="Middle">
					<font size="7"/>
				</textElement>
				<textFieldExpression class="java.math.BigDecimal"><![CDATA[($F{VALOR_PROMEDIO} == -1
    ? 0
    : ($F{VALOR_PROMEDIO} > 0
            ? $F{VALOR_PROMEDIO}
            : $F{VALOR}
        )
)]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="0" y="0" width="90" height="10"/>
				<box>
					<pen lineWidth="0.75"/>
					<topPen lineWidth="0.75"/>
					<leftPen lineWidth="0.75"/>
					<bottomPen lineWidth="0.75"/>
					<rightPen lineWidth="0.75"/>
				</box>
				<textElement textAlignment="Center" verticalAlignment="Middle">
					<font size="7"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{CODIGO}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="90" y="0" width="202" height="10"/>
				<box leftPadding="2">
					<pen lineWidth="0.75"/>
					<topPen lineWidth="0.75"/>
					<leftPen lineWidth="0.75"/>
					<bottomPen lineWidth="0.75"/>
					<rightPen lineWidth="0.75"/>
				</box>
				<textElement verticalAlignment="Middle">
					<font size="7"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{DESCRIPCION_AGRUP}]]></textFieldExpression>
			</textField>
			<textField isBlankWhenNull="true">
				<reportElement x="392" y="0" width="80" height="10"/>
				<box>
					<pen lineWidth="0.75"/>
					<topPen lineWidth="0.75"/>
					<leftPen lineWidth="0.75"/>
					<bottomPen lineWidth="0.75"/>
					<rightPen lineWidth="0.75"/>
				</box>
				<textElement textAlignment="Center" verticalAlignment="Middle">
					<font size="7"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{PARTE}]]></textFieldExpression>
			</textField>
			<textField pattern="#,##0.00;(#,##0.00)">
				<reportElement x="472" y="0" width="100" height="10"/>
				<box rightPadding="2">
					<pen lineWidth="0.75"/>
					<topPen lineWidth="0.75"/>
					<leftPen lineWidth="0.75"/>
					<bottomPen lineWidth="0.75"/>
					<rightPen lineWidth="0.75"/>
				</box>
				<textElement textAlignment="Right" verticalAlignment="Middle">
					<font size="7"/>
				</textElement>
				<textFieldExpression class="java.math.BigDecimal"><![CDATA[($F{VALOR_PROMEDIO} == -1
    ? 0
    : ($F{VALOR_PROMEDIO} > 0
            ? $F{VALOR_PROMEDIO}
            : $F{VALOR_BASE_AGRUP}
        )
)]]></textFieldExpression>
			</textField>
		</band>
	</detail>
	<pageFooter>
		<band height="24" splitType="Stretch">
			<textField>
				<reportElement mode="Opaque" x="211" y="12" width="89" height="12" forecolor="#575757" backcolor="#FFFFFF"/>
				<textElement textAlignment="Right" verticalAlignment="Middle" rotation="None" markup="none">
					<font fontName="SansSerif" size="6" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA["Página "+$V{PAGE_NUMBER}+" de "]]></textFieldExpression>
			</textField>
			<textField evaluationTime="Report" pattern="" isBlankWhenNull="false">
				<reportElement mode="Opaque" x="301" y="12" width="60" height="12" forecolor="#575757" backcolor="#FFFFFF"/>
				<textElement verticalAlignment="Middle" rotation="None" markup="none">
					<font fontName="SansSerif" size="6" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$V{PAGE_NUMBER}]]></textFieldExpression>
			</textField>
			<staticText>
				<reportElement mode="Opaque" x="211" y="0" width="150" height="12" forecolor="#575757"/>
				<textElement textAlignment="Center" verticalAlignment="Middle">
					<font size="6"/>
				</textElement>
				<text><![CDATA[Websafi - Nómina]]></text>
			</staticText>
		</band>
	</pageFooter>
	<summary>
		<band height="25" splitType="Stretch"/>
	</summary>
	<noData>
		<band height="20">
			<staticText>
				<reportElement x="0" y="0" width="572" height="20"/>
				<textElement textAlignment="Center" verticalAlignment="Middle">
					<font isBold="true"/>
				</textElement>
				<text><![CDATA[No hay objetos a mostrar.]]></text>
			</staticText>
		</band>
	</noData>
</jasperReport>
