<?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="no_factores_col" language="groovy" pageWidth="450" pageHeight="59" orientation="Landscape" columnWidth="450" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0">
	<property name="ireport.zoom" value="1.6105100000000008"/>
	<property name="ireport.x" value="0"/>
	<property name="ireport.y" value="0"/>
	<parameter name="id_periodo_filtro" class="java.lang.String">
		<defaultValueExpression><![CDATA[]]></defaultValueExpression>
	</parameter>
	<parameter name="num_doc" class="java.lang.String">
		<defaultValueExpression><![CDATA[]]></defaultValueExpression>
	</parameter>
	<parameter name="id_novedad_vac" class="java.math.BigDecimal">
		<defaultValueExpression><![CDATA[]]></defaultValueExpression>
	</parameter>
	<queryString>
		<![CDATA[select

'$' as signo,
rownum,
tab.* ,
   ROW_NUMBER() OVER (
    --partition by tab.num_doc
    ORDER BY tab.codigo asc
   ) AS rn
from
(

        select
        concep.orden,
        conom.*,
        case when conom.id_concep_nomina not in (11,16) then ' ' else ' 1/12 ' end as tag_descrip,
        case when conom.id_concep_nomina not in (11,16) then  nvl( NO_CONSULTA_SQL_F(ID_ANHOS, ID_MESES, ID_ANHOS, ID_MESES, 1, $P{num_doc}, conom.id_concep_nomina, concep.tipo_valor, per.id_periodo) ,0)
        else nvl( NO_CONSULTA_SQL_F(ID_ANHOS, ID_MESES, ID_ANHOS, ID_MESES, 1, $P{num_doc}, conom.id_concep_nomina, concep.tipo_valor, per.id_periodo) ,0) / 12 end as valor_liquidado

        from no_concep_nomina conom

        left join no_periodo per
        on per.id_periodo = $P{id_periodo_filtro}

        join no_agrup_deta concep
        on concep.id_agrup_concepto = 123
        and concep.id_concep_nomina = conom.id_concep_nomina

        /*where
        conom.id_concep_nomina in (
            (SELECT ID_CONCEP_BASICA FROM no_param_concep where id_param_concep = 1),
            (SELECT ID_CONCEP_BONIF FROM no_param_concep where id_param_concep = 1),
            (SELECT ID_CONCEP_PRIMSERV FROM no_param_concep where id_param_concep = 1)
        )*/

)tab

where
tab.valor_liquidado != 0

order by
tab.orden,
tab.codigo]]>
	</queryString>
	<field name="SIGNO" class="java.lang.String"/>
	<field name="ROWNUM" class="java.math.BigDecimal"/>
	<field name="ORDEN" class="java.math.BigDecimal"/>
	<field name="ID_CONCEP_NOMINA" class="java.math.BigDecimal"/>
	<field name="ID_TIPO_CONCEPTO" class="java.math.BigDecimal"/>
	<field name="CODIGO" class="java.lang.String"/>
	<field name="DESCRIPCION" class="java.lang.String"/>
	<field name="ABREVIATURA" class="java.lang.String"/>
	<field name="OPERADOR" class="java.math.BigDecimal"/>
	<field name="ID_CONCEP_AJUSTE" class="java.math.BigDecimal"/>
	<field name="ID_CONCEP_REIN" class="java.math.BigDecimal"/>
	<field name="ID_ACREEDOR" class="java.math.BigDecimal"/>
	<field name="ID_RUBRO" class="java.math.BigDecimal"/>
	<field name="ID_CPO" class="java.math.BigDecimal"/>
	<field name="ESTADO" class="java.math.BigDecimal"/>
	<field name="APLICA_DESCUENTO" class="java.math.BigDecimal"/>
	<field name="ID_CLASE_FONDO" class="java.math.BigDecimal"/>
	<field name="USA_DIAS_CALEN" class="java.math.BigDecimal"/>
	<field name="APLICA_CERTIF" class="java.math.BigDecimal"/>
	<field name="CANT_UVT" class="java.math.BigDecimal"/>
	<field name="APLICA_VACAC" class="java.math.BigDecimal"/>
	<field name="PAGO_FUNC" class="java.math.BigDecimal"/>
	<field name="ID_TIPO_CONCEPTO_ORG" class="java.math.BigDecimal"/>
	<field name="ID_LISTA_CONCEPTOS_SIIF" class="java.math.BigDecimal"/>
	<field name="APLICA_NOVKA" class="java.math.BigDecimal"/>
	<field name="APLICA_ASIG_BASICA" class="java.math.BigDecimal"/>
	<field name="APLICA_DESC_ADIC_VAC" class="java.math.BigDecimal"/>
	<field name="FACTOR_SALARIAL" class="java.math.BigDecimal"/>
	<field name="TAG_DESCRIP" class="java.lang.String"/>
	<field name="VALOR_LIQUIDADO" class="java.math.BigDecimal"/>
	<field name="RN" class="java.math.BigDecimal"/>
	<variable name="total" class="java.math.BigDecimal" calculation="Sum">
		<variableExpression><![CDATA[$F{VALOR_LIQUIDADO}]]></variableExpression>
	</variable>
	<background>
		<band splitType="Stretch"/>
	</background>
	<detail>
		<band height="15" splitType="Stretch">
			<textField>
				<reportElement x="0" y="0" width="300" height="15"/>
				<textElement verticalAlignment="Middle">
					<font fontName="SansSerif" size="10"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{TAG_DESCRIP} + $F{DESCRIPCION}]]></textFieldExpression>
			</textField>
			<textField pattern=" #,##0">
				<reportElement x="330" y="0" width="120" height="15"/>
				<textElement textAlignment="Right" verticalAlignment="Middle">
					<font fontName="SansSerif" size="10"/>
				</textElement>
				<textFieldExpression class="java.math.BigDecimal"><![CDATA[$F{VALOR_LIQUIDADO}]]></textFieldExpression>
			</textField>
			<textField pattern="">
				<reportElement x="300" y="0" width="30" height="15"/>
				<textElement textAlignment="Center" verticalAlignment="Middle">
					<font fontName="SansSerif" size="10"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{SIGNO}]]></textFieldExpression>
			</textField>
		</band>
	</detail>
	<summary>
		<band height="25">
			<textField pattern=" #,##0">
				<reportElement x="330" y="10" width="120" height="15"/>
				<textElement textAlignment="Right" verticalAlignment="Middle">
					<font fontName="SansSerif" size="10" isBold="true"/>
				</textElement>
				<textFieldExpression class="java.math.BigDecimal"><![CDATA[$V{total}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="0" y="10" width="300" height="15"/>
				<textElement verticalAlignment="Middle">
					<font fontName="SansSerif" size="10" isBold="true"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA["TOTAL:"]]></textFieldExpression>
			</textField>
			<textField pattern="">
				<reportElement x="300" y="10" width="30" height="15"/>
				<textElement textAlignment="Center" verticalAlignment="Middle">
					<font fontName="SansSerif" size="10" isBold="true"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{SIGNO}]]></textFieldExpression>
			</textField>
		</band>
	</summary>
</jasperReport>
