<?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="nov_ret" language="groovy" pageWidth="612" pageHeight="792" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20">
	<property name="ireport.zoom" value="1.2100000000000006"/>
	<property name="ireport.x" value="0"/>
	<property name="ireport.y" value="0"/>
	<property name="ireport.jasperserver.reportUnit" value="/reports/nomina/ci_nov_ret"/>
	<property name="ireport.jasperserver.url" value="http://release.sofhouse.net:8080/jasperserver/services/repository"/>
	<parameter name="wherenovedadretiro" class="java.lang.String">
		<defaultValueExpression><![CDATA[" "]]></defaultValueExpression>
	</parameter>
	<queryString>
		<![CDATA[SELECT tab0.* FROM (
SELECT tab0.id as id_nov_ausen,
tab0.id_tipo_doc as id_tipo_doc,
tab0.num_doc as num_doc,
tab.nombre_apellido as nombre_apellido_func,
tab.tipo_documento as tipo_documento,
tab0.id_tipo_retiro as id_tipo_retiro,
tab0.id_dp as id_dp,
to_char(tab0.fecha_retiro,'yyyy-mm-dd') as fecha_retiro,
nvl(tab0.motivo_retiro,' ') as motivo_retiro,
tab1.nombre as tipo_retiro,
tab4.codigo as codigo,
tab4.grado as grado,
tab4.denominacion as denominacion,
tab5.descripcion as area,
nvl(tab6.descripcion,'Bogota') as centro_operacion,
to_char(sysdate, 'Month','nls_date_language=spanish') as mes,
to_char(sysdate, 'dd') as dia,
to_char(sysdate, 'yyyy') as ano,
 t.nombre_apellido as nombre_apellido_presi
 FROM CI_NOVEDAD_RETIRO tab0
 LEFT JOIN TIPO_RETIRO tab1 ON tab0.id_tipo_retiro = tab1.id
 LEFT JOIN NO_DATOS_FUNCIONARIO_V tab ON tab0.num_doc=tab.num_doc AND tab0.id_tipo_doc=tab.id_tipo_doc
 LEFT JOIN RH_DP       tab2 ON tab0.id_dp =  tab2.id_dp
 LEFT JOIN RH_AP_DEN_EMP tab3 ON tab2.id_den_emp = tab3.id_den_emp
 LEFT JOIN RH_PN_COMPONENTE_ESCALA tab4 ON tab4.id_com_esc = tab3.id_comp_es
 LEFT JOIN AREA  tab5 ON tab5.id_area=tab2.id_ea
 LEFT JOIN CENTRO_OPERACION_V tab6 ON tab6.id_cen_op = tab2.id_cen_op
 LEFT JOIN (
	SELECT tab0.denominacion,tab3.nombre_apellido FROM RH_PN_COMPONENTE_ESCALA tab0
	LEFT JOIN RH_AP_DEN_EMP tab1 ON tab1.id_comp_es=tab0.id_com_esc
	LEFT JOIN RH_DP         tab2 ON tab2.id_den_emp = tab1.id_den_emp
	LEFT JOIN NO_DATOS_FUNCIONARIO_V tab3 ON tab3.num_doc = tab2.titular
	WHERE 1=1 AND tab0.denominacion='PRESIDENTE DE AGENCIA'
)t ON t.denominacion='PRESIDENTE DE AGENCIA'
WHERE 1=1
)tab0
WHERE 1=1
$P!{wherenovedadretiro}]]>
	</queryString>
	<field name="ID_NOV_AUSEN" class="java.math.BigDecimal"/>
	<field name="ID_TIPO_DOC" class="java.math.BigDecimal"/>
	<field name="NUM_DOC" class="java.lang.String"/>
	<field name="NOMBRE_APELLIDO_FUNC" class="java.lang.String"/>
	<field name="TIPO_DOCUMENTO" class="java.lang.String"/>
	<field name="ID_TIPO_RETIRO" class="java.math.BigDecimal"/>
	<field name="ID_DP" class="java.math.BigDecimal"/>
	<field name="FECHA_RETIRO" class="java.lang.String"/>
	<field name="MOTIVO_RETIRO" class="java.lang.String"/>
	<field name="TIPO_RETIRO" class="java.lang.String"/>
	<field name="CODIGO" class="java.lang.String"/>
	<field name="GRADO" class="java.lang.String"/>
	<field name="DENOMINACION" class="java.lang.String"/>
	<field name="AREA" class="java.lang.String"/>
	<field name="CENTRO_OPERACION" class="java.lang.String"/>
	<field name="MES" class="java.lang.String"/>
	<field name="DIA" class="java.lang.String"/>
	<field name="ANO" class="java.lang.String"/>
	<field name="NOMBRE_APELLIDO_PRESI" class="java.lang.String"/>
	<background>
		<band splitType="Stretch"/>
	</background>
	<title>
		<band height="79" splitType="Stretch">
			<image>
				<reportElement x="0" y="0" width="164" height="79"/>
				<imageExpression class="java.lang.String"><![CDATA["repo:LogoEmpresa003.jpg"]]></imageExpression>
			</image>
			<staticText>
				<reportElement x="164" y="0" width="270" height="27"/>
				<textElement textAlignment="Center" verticalAlignment="Bottom" markup="none">
					<font fontName="SansSerif" size="12" isBold="true"/>
				</textElement>
				<text><![CDATA[Sistema de Cliente Interno]]></text>
			</staticText>
			<textField pattern="MMMMM dd, yyyy">
				<reportElement mode="Opaque" x="434" y="27" width="138" 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 mode="Opaque" x="434" y="15" width="138" 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>
			<staticText>
				<reportElement x="164" y="27" width="270" height="25"/>
				<textElement textAlignment="Center" verticalAlignment="Bottom" markup="none">
					<font fontName="SansSerif" size="12" isBold="true"/>
				</textElement>
				<text><![CDATA[Novedad de Retiro]]></text>
			</staticText>
		</band>
	</title>
	<pageHeader>
		<band height="20" splitType="Stretch">
			<textField>
				<reportElement x="0" y="0" width="434" height="20"/>
				<textElement/>
				<textFieldExpression class="java.lang.String"><![CDATA[""+$F{CENTRO_OPERACION}+", "+$F{DIA}+" de "+$F{MES}+" del "+$F{ANO}+"."]]></textFieldExpression>
			</textField>
		</band>
	</pageHeader>
	<columnHeader>
		<band height="82" splitType="Stretch">
			<textField>
				<reportElement x="0" y="0" width="164" height="20"/>
				<textElement/>
				<textFieldExpression class="java.lang.String"><![CDATA["Doctor (a)."]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="0" y="20" width="164" height="20"/>
				<textElement/>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{NOMBRE_APELLIDO_PRESI}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="0" y="40" width="208" height="20"/>
				<textElement/>
				<textFieldExpression class="java.lang.String"><![CDATA["Presidente Agencia Nacional de Mineria"]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="0" y="60" width="164" height="20"/>
				<textElement/>
				<textFieldExpression class="java.lang.String"><![CDATA[""+$F{CENTRO_OPERACION}]]></textFieldExpression>
			</textField>
		</band>
	</columnHeader>
	<detail>
		<band height="192" splitType="Stretch">
			<textField>
				<reportElement x="0" y="0" width="572" height="40"/>
				<textElement/>
				<textFieldExpression class="java.lang.String"><![CDATA["Asunto: "+$F{TIPO_RETIRO}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="0" y="40" width="572" height="50"/>
				<textElement textAlignment="Justified"/>
				<textFieldExpression class="java.lang.String"><![CDATA["Motivo de Retiro: "+$F{MOTIVO_RETIRO}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="0" y="90" width="100" height="20"/>
				<textElement/>
				<textFieldExpression class="java.lang.String"><![CDATA["Cordialmente,"]]></textFieldExpression>
			</textField>
			<line>
				<reportElement x="149" y="142" width="229" height="1"/>
			</line>
			<textField>
				<reportElement x="149" y="143" width="229" height="20"/>
				<textElement textAlignment="Center"/>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{NOMBRE_APELLIDO_FUNC}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="149" y="163" width="229" height="20"/>
				<textElement textAlignment="Center"/>
				<textFieldExpression class="java.lang.String"><![CDATA[""+$F{TIPO_DOCUMENTO}+"-"+$F{NUM_DOC}]]></textFieldExpression>
			</textField>
		</band>
	</detail>
</jasperReport>
