<?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="inf_concep_liqui" language="groovy" pageWidth="612" pageHeight="792" whenNoDataType="NoDataSection" columnWidth="572" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20">
	<property name="ireport.zoom" value="1.6105100000000032"/>
	<property name="ireport.x" value="0"/>
	<property name="ireport.y" value="0"/>
	<parameter name="whereTipoConcepto" class="java.lang.String">
		<defaultValueExpression><![CDATA[""]]></defaultValueExpression>
	</parameter>
	<parameter name="id_periodo_filtro" class="java.lang.String">
		<defaultValueExpression><![CDATA[]]></defaultValueExpression>
	</parameter>
	<parameter name="whereConcepto" class="java.lang.String">
		<defaultValueExpression><![CDATA[""]]></defaultValueExpression>
	</parameter>
	<parameter name="comando" class="java.lang.String">
		<defaultValueExpression><![CDATA[]]></defaultValueExpression>
	</parameter>
	<parameter name="whereFuncionarioNumDoc" class="java.lang.String">
		<defaultValueExpression><![CDATA[" "]]></defaultValueExpression>
	</parameter>
	<parameter name="whereFuncionarioTipoDoc" class="java.lang.String">
		<defaultValueExpression><![CDATA[" "]]></defaultValueExpression>
	</parameter>
	<parameter name="whereClasePlanta" class="java.lang.String">
		<defaultValueExpression><![CDATA[" "]]></defaultValueExpression>
	</parameter>
	<queryString>
		<![CDATA[select
tab0.*,
(select distinct periodo.periodo from no_periodo_v periodo where periodo.id_periodo = $P{id_periodo_filtro}) AS PERIODO

from(

select
tab.codigo as codigo_clapla,
tab.descripcion as descripcion_clapla,
tab.id_clase_planta,
tab1.id_periodo,
tab4.id_tipo_concepto as id_tipo_concepto,
tab4.descripcion as tipo_concepto,
tab3.id_concep_nomina,
tab3.id_acreedor,
tab3.codigo||' - '||tab3.descripcion AS CONCEPTO,
tab5.razon_soc as beneficiario,
tab2.id_tipo_doc,
tab2.num_doc as num_doc,
tab2.nombre_apellido as nombre,
tab1.valor_liquidado AS VALOR

from no_liquida_nomina tab1

left join no_datos_funcionario_v tab2 ON tab2.id_tipo_doc = tab1.id_tipo_doc and tab2.num_doc = tab1.num_doc
left join no_concep_nomina tab3 ON tab3.id_concep_nomina = tab1.id_concep_nomina
left join no_tipo_concepto tab4 ON tab4.id_tipo_concepto = tab3.id_tipo_concepto
left join interceros_v tab5 ON tab5.id_mae_ter = tab3.id_acreedor

left join (
         select
         clapla.codigo,
         clapla.descripcion,
         nom.*,
          case when tab.num_doc is not null then 1 else 0 end as pago
          from no_nombramiento_v nom

          join no_clase_planta clapla
          on clapla.id_clase_planta = nom.id_clase_planta

          left join (select distinct
          pago.id_tipo_doc,
          pago.num_doc
          from no_pago_func pago
          where
          (select fecha_fin from no_periodo where id_periodo = $P{id_periodo_filtro}) between pago.fecha_activacion and nvl(pago.fecha_terminacion, (select fecha_fin from no_periodo where id_periodo = $P{id_periodo_filtro}))
          )tab
          on tab.id_tipo_doc = nom.id_tipo_doc and tab.num_doc = nom.num_doc
)tab
on tab.id_tipo_doc = tab1.id_tipo_doc and tab.num_doc = tab1.num_doc

order by tab3.codigo

)tab0

where tab0.id_periodo = $P{id_periodo_filtro}
$P!{whereConcepto} $P!{whereTipoConcepto}
$P!{whereFuncionarioTipoDoc} $P!{whereFuncionarioNumDoc}
$P!{whereClasePlanta}

order by
tab0.concepto,
tab0.id_tipo_doc,
tab0.num_doc]]>
	</queryString>
	<field name="CODIGO_CLAPLA" class="java.lang.String"/>
	<field name="DESCRIPCION_CLAPLA" class="java.lang.String"/>
	<field name="ID_CLASE_PLANTA" class="java.math.BigDecimal"/>
	<field name="ID_PERIODO" class="java.math.BigDecimal"/>
	<field name="ID_TIPO_CONCEPTO" class="java.math.BigDecimal"/>
	<field name="TIPO_CONCEPTO" class="java.lang.String"/>
	<field name="ID_CONCEP_NOMINA" class="java.math.BigDecimal"/>
	<field name="ID_ACREEDOR" class="java.math.BigDecimal"/>
	<field name="CONCEPTO" class="java.lang.String"/>
	<field name="BENEFICIARIO" class="java.lang.String"/>
	<field name="ID_TIPO_DOC" class="java.math.BigDecimal"/>
	<field name="NUM_DOC" class="java.lang.String"/>
	<field name="NOMBRE" class="java.lang.String"/>
	<field name="VALOR" class="java.math.BigDecimal"/>
	<field name="PERIODO" class="java.lang.String"/>
	<variable name="total_concepto" class="java.math.BigDecimal" resetType="Group" resetGroup="Concepto" calculation="Sum">
		<variableExpression><![CDATA[$F{VALOR}]]></variableExpression>
	</variable>
	<variable name="cantidad" class="java.math.BigDecimal" resetType="Group" resetGroup="Concepto" calculation="Count">
		<variableExpression><![CDATA[$F{NUM_DOC}]]></variableExpression>
	</variable>
	<group name="Concepto">
		<groupExpression><![CDATA[$F{CONCEPTO}]]></groupExpression>
		<groupHeader>
			<band height="56">
				<textField>
					<reportElement x="100" y="16" width="472" 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>
						<font size="8"/>
					</textElement>
					<textFieldExpression class="java.lang.String"><![CDATA[$F{CONCEPTO}]]></textFieldExpression>
				</textField>
				<textField>
					<reportElement x="100" y="36" width="472" 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>
						<font size="8"/>
					</textElement>
					<textFieldExpression class="java.lang.String"><![CDATA[$F{BENEFICIARIO}]]></textFieldExpression>
				</textField>
				<staticText>
					<reportElement mode="Opaque" x="100" y="46" width="100" height="10" forecolor="#000000" backcolor="#88C2F9"/>
					<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ÉDULA]]></text>
				</staticText>
				<staticText>
					<reportElement mode="Opaque" x="200" y="46" width="252" height="10" forecolor="#000000" backcolor="#88C2F9"/>
					<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[NOMBRE]]></text>
				</staticText>
				<staticText>
					<reportElement mode="Opaque" x="452" y="46" width="120" height="10" forecolor="#000000" backcolor="#88C2F9"/>
					<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]]></text>
				</staticText>
				<staticText>
					<reportElement mode="Opaque" x="0" y="16" width="100" height="10" forecolor="#000000" backcolor="#88C2F9"/>
					<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" 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="36" width="100" height="10" forecolor="#000000" backcolor="#88C2F9"/>
					<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" rotation="None" markup="none">
						<font fontName="SansSerif" size="8" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
					</textElement>
					<text><![CDATA[BENEFICIARIO:]]></text>
				</staticText>
				<staticText>
					<reportElement mode="Opaque" x="0" y="26" width="100" height="10" forecolor="#000000" backcolor="#88C2F9"/>
					<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" rotation="None" markup="none">
						<font fontName="SansSerif" size="8" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
					</textElement>
					<text><![CDATA[TIPO CONCEPTO:]]></text>
				</staticText>
				<textField>
					<reportElement x="100" y="26" width="472" 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>
						<font size="8"/>
					</textElement>
					<textFieldExpression class="java.lang.String"><![CDATA[$F{TIPO_CONCEPTO}]]></textFieldExpression>
				</textField>
				<staticText>
					<reportElement mode="Opaque" x="0" y="46" width="100" height="10" forecolor="#000000" backcolor="#88C2F9"/>
					<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[CLASE PLANTA]]></text>
				</staticText>
			</band>
		</groupHeader>
		<groupFooter>
			<band height="10">
				<textField pattern="#,##0.00;(#,##0.00)" isBlankWhenNull="true">
					<reportElement mode="Opaque" x="452" y="0" width="120" height="10" forecolor="#000000" backcolor="#D2D8E0"/>
					<box>
						<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="6" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
					</textElement>
					<textFieldExpression class="java.math.BigDecimal"><![CDATA[$V{total_concepto}]]></textFieldExpression>
				</textField>
				<textField pattern="" isBlankWhenNull="true">
					<reportElement mode="Opaque" x="0" y="0" width="452" height="10" forecolor="#000000" backcolor="#D2D8E0"/>
					<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" rotation="None" markup="none">
						<font fontName="SansSerif" size="6" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
					</textElement>
					<textFieldExpression class="java.lang.String"><![CDATA["Total Concepto: "+$V{cantidad}+" Funcionarios"]]></textFieldExpression>
				</textField>
			</band>
		</groupFooter>
	</group>
	<background>
		<band splitType="Stretch"/>
	</background>
	<title>
		<band height="60" splitType="Stretch">
			<staticText>
				<reportElement x="124" y="0" width="328" height="40"/>
				<textElement textAlignment="Center" verticalAlignment="Bottom" markup="none">
					<font fontName="SansSerif" size="12" isBold="true"/>
				</textElement>
				<text><![CDATA[Sistema General de Nómina
Nómina por Concepto Liquidado]]></text>
			</staticText>
			<image>
				<reportElement x="0" y="10" width="124" height="30"/>
				<imageExpression class="java.lang.String"><![CDATA["repo:LogoEmpresa003.jpg"]]></imageExpression>
			</image>
			<staticText>
				<reportElement mode="Opaque" x="452" y="28" width="120" 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 pattern="dd-MMM-yyyy   hh:mm aaa">
				<reportElement x="452" y="40" width="120" height="12"/>
				<box rightPadding="3"/>
				<textElement textAlignment="Right" verticalAlignment="Middle">
					<font size="8"/>
				</textElement>
				<textFieldExpression class="java.util.Date"><![CDATA[new java.util.Date()]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="124" y="40" width="328" height="20"/>
				<textElement textAlignment="Center" verticalAlignment="Middle">
					<font size="12" isBold="true"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{PERIODO}]]></textFieldExpression>
			</textField>
		</band>
	</title>
	<pageHeader>
		<band height="6" splitType="Stretch"/>
	</pageHeader>
	<columnHeader>
		<band height="8" splitType="Stretch"/>
	</columnHeader>
	<detail>
		<band height="10" splitType="Stretch">
			<textField>
				<reportElement x="100" y="0" width="100" 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="6"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{NUM_DOC}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="200" y="0" width="252" 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="6"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{NOMBRE}]]></textFieldExpression>
			</textField>
			<textField pattern="#,##0.00;(#,##0.00)">
				<reportElement x="452" y="0" width="120" 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="6"/>
				</textElement>
				<textFieldExpression class="java.math.BigDecimal"><![CDATA[$F{VALOR}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="0" y="0" width="100" 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="6"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{CODIGO_CLAPLA} + " - " + $F{DESCRIPCION_CLAPLA}]]></textFieldExpression>
			</textField>
		</band>
	</detail>
	<columnFooter>
		<band height="24" splitType="Stretch"/>
	</columnFooter>
	<pageFooter>
		<band height="24" splitType="Stretch">
			<textField>
				<reportElement mode="Opaque" x="200" 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="290" 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="200" 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="58" splitType="Stretch">
			<subreport>
				<reportElement stretchType="RelativeToBandHeight" x="75" y="0" width="200" height="58"/>
				<subreportParameter name="comando">
					<subreportParameterExpression><![CDATA[$P{comando}]]></subreportParameterExpression>
				</subreportParameter>
				<connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
				<subreportExpression class="java.lang.String"><![CDATA["repo:firmas1.jrxml"]]></subreportExpression>
			</subreport>
			<subreport>
				<reportElement x="276" y="0" width="200" height="58"/>
				<subreportParameter name="comando">
					<subreportParameterExpression><![CDATA[$P{comando}]]></subreportParameterExpression>
				</subreportParameter>
				<connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
				<subreportExpression class="java.lang.String"><![CDATA["repo:firma2.jrxml"]]></subreportExpression>
			</subreport>
		</band>
	</summary>
	<noData>
		<band height="20">
			<staticText>
				<reportElement x="-41" y="0" width="613" height="20"/>
				<textElement textAlignment="Center" verticalAlignment="Middle">
					<font isBold="true"/>
				</textElement>
				<text><![CDATA[No hay objetos a mostrar.]]></text>
			</staticText>
		</band>
	</noData>
</jasperReport>
