<?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="legalizacion_comision_f009" language="groovy" pageWidth="660" pageHeight="792" whenNoDataType="NoDataSection" columnWidth="572" leftMargin="68" rightMargin="20" topMargin="20" bottomMargin="20">
	<property name="ireport.zoom" value="2.143588810000008"/>
	<property name="ireport.x" value="163"/>
	<property name="ireport.y" value="66"/>
	<property name="ireport.jasperserver.reportUnit" value="/reports/presupuesto/legalizacion_comision_f009"/>
	<property name="ireport.jasperserver.url" value="http://localhost:18080/jasperserver/services/repository"/>
	<parameter name="vigencia" class="java.math.BigDecimal">
		<defaultValueExpression><![CDATA[]]></defaultValueExpression>
	</parameter>
	<parameter name="id_rp" class="java.math.BigDecimal">
		<defaultValueExpression><![CDATA[]]></defaultValueExpression>
	</parameter>
	<queryString>
		<![CDATA[select /*DISTINCT daña la imagen*/

'$' as pesos,

substr( tab0.id , 4 ) as no_egreso,
com.codare,
area.descripcion as dependencia,
leg.fecha_proceso as fecha_leg,
lpad(to_char(leg.fecha_proceso,'dd'),2,'0') as dia_leg,
trim(initcap(to_char(leg.fecha_proceso,'MONTH','nls_date_language=spanish'))) as mes_leg,
to_char(leg.fecha_proceso,'yyyy') as anho_leg,
res.resolucion,
avan.fecha_ini_comi as fecha_comis,
lpad(to_char(avan.fecha_ini_comi,'dd'),2,'0') as dia_comis,
trim(initcap(to_char(avan.fecha_ini_comi,'MONTH','nls_date_language=spanish'))) as mes_comis,
to_char(avan.fecha_ini_comi,'yyyy') as anho_comis,
avan.fecha_fin_comi as fecha_fin_comis,
lpad(to_char(avan.fecha_fin_comi,'dd'),2,'0') as dia_fin_comis,
trim(initcap(to_char(avan.fecha_fin_comi,'MONTH','nls_date_language=spanish'))) as mes_fin_comis,
to_char(avan.fecha_fin_comi,'yyyy') as anho_fin_comis,
case when comis.tip = 1 then 'Nombre del funcionario' else 'Nombre del contratista' end as tip,
case when comis.tip = 1 then 'Firma Funcionario' else 'Firma Contratista' end as tip_firma,
ter.nitocc,
ter.razsoc,
nvl(resobj.dias,comis.dias) as dias,
comis.tip as  tipo,
avan.firmado,
avan.aprobado,

(select
listagg(mun.municipio || ', ' ||  dep.descripcion, ' - ') within group (order by des.nitocc) as destino
from destinos_comisionados des
join municipios mun
on mun.codmun = des.codmun
left join departamento dep
on dep.id_depto = mun.depto
where des.id_comision = tab0.id_comision and des.vigencia = tab0.vigencia and des.nitocc = tab0.id_tercero and des.estado = 1) as destino,

avan.observaciones as observaciones_avan,
to_number(avan.dias_comi) as dias_comi,

(
select
/*
rpcom.*,
nvl(nov.cant,0) as cant,
nvl(nov7.cant7,0) as cant7,
nvl(hist.valor_hist,0) as valor_hist,
nvl(nov7.debito,0) as debito,
nvl(nov7.credito,0) as credito,*/
nvl(sum(case when nvl(nov.cant,0) = 0 then rpcom.valor
     when nvl(nov.cant,0) = 1 and nvl(nov7.cant7,0) = 1 then rpcom.valor
     when nvl(nov.cant,0) = 1 and nvl(nov7.cant7,0) != 1 then nvl(hist.valor_hist,0)
     when nvl(nov.cant,0) != 1 then nvl(hist.valor_hist,0) - nvl(nov7.credito,0)
     else 0 end),0) as v_reintegro_comp


from (
        SELECT
        aut.*,
        ROW_NUMBER() OVER (
            partition by aut.id_rp, aut.vigencia, aut.id_obj_gasto
            ORDER BY aut.id_rp, aut.vigencia, aut.id_obj_gasto, aut.id
        ) AS rn
        from pr_rp_compromiso aut
    )rpcom

left join(
  select
  nov.id_rp,
  nov.id_vigencia,
  nov.vigencia,
  novval.id_obj_gasto,
  count(nov.id_novedad_rp) as cant
  /*
  nov.*,
  novval.debito,
  novval.credito*/
  from pr_novedad_rp nov
  join pr_novedad_rp_val novval
  on novval.id_novedad_rp = nov.id_novedad_rp
  group by
  nov.id_rp,
  nov.id_vigencia,
  nov.vigencia,
  novval.id_obj_gasto
)nov
on nov.id_rp = rpcom.id_rp
and nov.id_vigencia = rpcom.id_vigencia
and nov.vigencia = rpcom.vigencia
and nov.id_obj_gasto = rpcom.id_obj_gasto

left join(
  select
  nov.id_rp,
  nov.id_vigencia,
  nov.vigencia,
  novval.id_obj_gasto,
  count(nov.id_novedad_rp) as cant7,
  sum(novval.debito) as debito,
  sum(novval.credito) as credito
  /*
  nov.*,
  novval.debito,
  novval.credito*/
  from pr_novedad_rp nov
  join pr_novedad_rp_val novval
  on novval.id_novedad_rp = nov.id_novedad_rp
  where
  nov.id_tipo_novedad = 7
  group by
  nov.id_rp,
  nov.id_vigencia,
  nov.vigencia,
  novval.id_obj_gasto
)nov7
on nov7.id_rp = rpcom.id_rp
and nov7.id_vigencia = rpcom.id_vigencia
and nov7.vigencia = rpcom.vigencia
and nov7.id_obj_gasto = rpcom.id_obj_gasto

left join(
  select
  hist.id_rp,
  hist.id_vigencia,
  hist.vigencia,
  hist.id_obj_gasto,
  sum(nvl(hist.valor,0)) as valor_hist
  from pr_historial_rp hist
  group by
  hist.id_rp,
  hist.id_vigencia,
  hist.vigencia,
  hist.id_obj_gasto
)hist
on hist.id_rp = rpcom.id_rp
and hist.id_vigencia = rpcom.id_vigencia
and hist.vigencia = rpcom.vigencia
and hist.id_obj_gasto = rpcom.id_obj_gasto

where
rpcom.id_rp = tab0.id
and rpcom.id_vigencia = tab0.id_vigencia
and rpcom.vigencia = tab0.vigencia) as v_reintegro_comp,

(select
--rpcom.*
sum(nvl(leg.v_bruto,0)) + sum(nvl(leg.v_iva,0)) as v_retencion
from (
        SELECT
        aut.*,
        ROW_NUMBER() OVER (
            partition by aut.id_rp, aut.vigencia, aut.id_obj_gasto
            ORDER BY aut.id_rp, aut.vigencia, aut.id_obj_gasto, aut.id
        ) AS rn
        from pr_rp_compromiso aut
    )rpcom

join objetos_gasto obj
on obj.id = rpcom.id_obj_gasto

join pr_elementos_gasto ele
on ele.id_objeto_gasto = obj.id

join pr_legalizacion_comis leg
on leg.id_rp_comis = rpcom.id_rp
and leg.id_vigencia = rpcom.id_vigencia
and leg.vigencia = rpcom.vigencia
and case when leg.id_elementos_gasto = 82 then 32 else leg.id_elementos_gasto end = ele.id_elementos_gasto

where
rpcom.id_rp = tab0.id
and rpcom.id_vigencia = tab0.id_vigencia
and rpcom.vigencia = tab0.vigencia
    and rpcom.rn = 1) as v_reintegro_leg,


(select
--rpcom.*
sum(nvl(leg.v_retencion,0)) as v_retencion
from pr_rp_compromiso rpcom

join objetos_gasto obj
on obj.id = rpcom.id_obj_gasto

join pr_elementos_gasto ele
on ele.id_objeto_gasto = obj.id

join pr_legalizacion_comis leg
on leg.id_rp_comis = rpcom.id_rp
and leg.id_vigencia = rpcom.id_vigencia
and leg.vigencia = rpcom.vigencia
and leg.id_elementos_gasto = ele.id_elementos_gasto

where
rpcom.id_rp = tab0.id
and rpcom.id_vigencia = tab0.id_vigencia
and rpcom.vigencia = tab0.vigencia) as v_retencion,


inter.razon_soc as jefe,
avan.firmado,
(avan.img_firma) as img_firma,

tab0.id,
tab0.id_tercero,
tab0.id_clase_admin,
tab0.no_acto_admin,
tab0.id_pago,
tab0.objeto,
tab0.observaciones,
tab0.destinos,
tab0.actividades,
tab0.id_cdp,
tab0.id_comision,
tab0.fecha,
tab0.fecha_proceso,
tab0.id_vigencia,
tab0.vigencia,
tab0.estado,
tab0.id_mae_ter,
tab0.destinos_add,
tab0.usuariolog,

nvl(resobj.resolucion,' ') as resolucion_mof

from pr_rp_comis tab0

left join comisiones com
on tab0.id_comision = com.id
and tab0.vigencia = com.vigencia

left join areas area
on area.codigo = com.codare

left join pr_legalizacion_comis leg
on leg.id_rp_comis = tab0.id
and leg.id_vigencia = tab0.id_vigencia
and leg.vigencia = tab0.vigencia
and leg.secuencia = 1

left join pr_resol_comis res
on res.id = tab0.no_acto_admin
and res.id_vigencia = tab0.id_vigencia
and res.vigencia = tab0.vigencia

/*Se modifica que puede tener mas de una resol modif - 20231003::LAVILA*/
left join(

    SELECT
    rescom.nitocc,
    tab0.id_resol_orig,
    min(rescom.dias) as dias,
    wm_concat(distinct ' Modif. ' || tab0.resolucion) as resolucion
    FROM com_resol_comisionados rescom
    left join PR_RESOLUCIONES tab0
    on rescom.id_resoluciones = tab0.id_resoluciones
    where
    tab0.id_tipo_resol = 1 and tab0.firmado_digital = 1 and tab0.estado = 1
    group by
    rescom.nitocc,
    tab0.id_resol_orig/*,
    tab0.resolucion*/

)resobj
on resobj.id_resol_orig = res.id
and resobj.nitocc = tab0.id_tercero

left join(
    select
    1 as tip,
    comisionados_planta.*
    from comisionados_planta
    union
    select
    0 as tip,
    comisionados_contrato.*
    from comisionados_contrato
)comis
on comis.nitocc = tab0.id_tercero
and comis.id_comision = tab0.id_comision
and comis.vigencia = tab0.vigencia

left join terceros ter
on ter.nitocc = tab0.id_tercero

left join pr_avances_comisiones avan
on avan.id_rp_comis = tab0.id
and avan.id_vigencia = tab0.id_vigencia
and avan.vigencia = tab0.vigencia

left join interceros_v inter
on inter.id_mae_ter = avan.id_mae_ter

where
tab0.id_vigencia = 1
and tab0.vigencia = $P{vigencia}
and tab0.id = $P{id_rp}

order by
tab0.id]]>
	</queryString>
	<field name="PESOS" class="java.lang.String"/>
	<field name="NO_EGRESO" class="java.lang.String"/>
	<field name="CODARE" class="java.lang.String"/>
	<field name="DEPENDENCIA" class="java.lang.String"/>
	<field name="FECHA_LEG" class="java.sql.Timestamp"/>
	<field name="DIA_LEG" class="java.lang.String"/>
	<field name="MES_LEG" class="java.lang.String"/>
	<field name="ANHO_LEG" class="java.lang.String"/>
	<field name="RESOLUCION" class="java.lang.String"/>
	<field name="FECHA_COMIS" class="java.sql.Timestamp"/>
	<field name="DIA_COMIS" class="java.lang.String"/>
	<field name="MES_COMIS" class="java.lang.String"/>
	<field name="ANHO_COMIS" class="java.lang.String"/>
	<field name="FECHA_FIN_COMIS" class="java.sql.Timestamp"/>
	<field name="DIA_FIN_COMIS" class="java.lang.String"/>
	<field name="MES_FIN_COMIS" class="java.lang.String"/>
	<field name="ANHO_FIN_COMIS" class="java.lang.String"/>
	<field name="TIP" class="java.lang.String"/>
	<field name="TIP_FIRMA" class="java.lang.String"/>
	<field name="NITOCC" class="java.math.BigDecimal"/>
	<field name="RAZSOC" class="java.lang.String"/>
	<field name="DIAS" class="java.math.BigDecimal"/>
	<field name="TIPO" class="java.math.BigDecimal"/>
	<field name="FIRMADO" class="java.math.BigDecimal"/>
	<field name="APROBADO" class="java.math.BigDecimal"/>
	<field name="DESTINO" class="java.lang.String"/>
	<field name="OBSERVACIONES_AVAN" class="java.lang.String"/>
	<field name="DIAS_COMI" class="java.math.BigDecimal"/>
	<field name="V_REINTEGRO_COMP" class="java.math.BigDecimal"/>
	<field name="V_REINTEGRO_LEG" class="java.math.BigDecimal"/>
	<field name="V_RETENCION" class="java.math.BigDecimal"/>
	<field name="JEFE" class="java.lang.String"/>
	<field name="IMG_FIRMA" class="oracle.sql.BLOB"/>
	<field name="ID" class="java.math.BigDecimal"/>
	<field name="ID_TERCERO" class="java.math.BigDecimal"/>
	<field name="ID_CLASE_ADMIN" class="java.math.BigDecimal"/>
	<field name="NO_ACTO_ADMIN" class="java.math.BigDecimal"/>
	<field name="ID_PAGO" class="java.math.BigDecimal"/>
	<field name="OBJETO" class="java.lang.String"/>
	<field name="OBSERVACIONES" class="java.lang.String"/>
	<field name="DESTINOS" class="java.lang.String"/>
	<field name="ACTIVIDADES" class="java.lang.String"/>
	<field name="ID_CDP" class="java.math.BigDecimal"/>
	<field name="ID_COMISION" class="java.math.BigDecimal"/>
	<field name="FECHA" class="java.sql.Timestamp"/>
	<field name="FECHA_PROCESO" class="java.sql.Timestamp"/>
	<field name="ID_VIGENCIA" class="java.math.BigDecimal"/>
	<field name="VIGENCIA" class="java.lang.String"/>
	<field name="ESTADO" class="java.math.BigDecimal"/>
	<field name="ID_MAE_TER" class="java.math.BigDecimal"/>
	<field name="DESTINOS_ADD" class="java.lang.String"/>
	<field name="USUARIOLOG" class="java.lang.String"/>
	<field name="RESOLUCION_MOF" class="java.lang.String"/>
	<background>
		<band height="752" splitType="Stretch">
			<image>
				<reportElement x="112" y="97" width="370" height="469">
					<printWhenExpression><![CDATA[$F{FIRMADO}.toString()=="1" && $F{APROBADO}.toString()=="0" ?Boolean.TRUE:Boolean.FALSE]]></printWhenExpression>
				</reportElement>
				<imageExpression class="java.lang.String"><![CDATA["repo:wmfirmado"]]></imageExpression>
			</image>
			<image>
				<reportElement x="112" y="97" width="370" height="469">
					<printWhenExpression><![CDATA[$F{APROBADO}.toString()=="1" ?Boolean.TRUE:Boolean.FALSE]]></printWhenExpression>
				</reportElement>
				<imageExpression class="java.lang.String"><![CDATA["repo:wmaprobado"]]></imageExpression>
			</image>
		</band>
	</background>
	<title>
		<band height="50" splitType="Stretch">
			<staticText>
				<reportElement x="160" y="0" width="412" height="50"/>
				<textElement textAlignment="Center" verticalAlignment="Middle" markup="none">
					<font fontName="SansSerif" size="10" isBold="true"/>
				</textElement>
				<text><![CDATA[FORMATO 3: LEGALIZACIÓN DE COMISIONES O GASTOS DE DESPLAZAMIENTO-ANM]]></text>
			</staticText>
			<image>
				<reportElement x="0" y="10" width="140" height="40"/>
				<imageExpression class="java.lang.String"><![CDATA["repo:LogoEmpresa003.jpg"]]></imageExpression>
			</image>
		</band>
	</title>
	<pageHeader>
		<band height="8" splitType="Stretch"/>
	</pageHeader>
	<columnHeader>
		<band height="163" splitType="Stretch">
			<textField>
				<reportElement mode="Opaque" x="0" y="0" width="90" height="15" forecolor="#000000"/>
				<box>
					<pen lineWidth="0.75" lineStyle="Dotted"/>
					<topPen lineWidth="0.0" lineStyle="Dotted"/>
					<leftPen lineWidth="0.0" lineStyle="Dotted"/>
					<bottomPen lineWidth="0.0" lineStyle="Dotted"/>
					<rightPen lineWidth="0.0" lineStyle="Dotted"/>
				</box>
				<textElement verticalAlignment="Middle" markup="none">
					<font fontName="SansSerif" size="8"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA["Dependencia:"]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement mode="Opaque" x="90" y="0" width="262" height="15" forecolor="#000000"/>
				<box>
					<bottomPen lineWidth="0.75"/>
				</box>
				<textElement verticalAlignment="Middle" markup="none">
					<font fontName="SansSerif" size="8"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{DEPENDENCIA}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement mode="Opaque" x="462" y="0" width="110" height="15" forecolor="#000000"/>
				<box>
					<bottomPen lineWidth="0.75"/>
				</box>
				<textElement verticalAlignment="Middle" markup="none">
					<font fontName="SansSerif" size="8"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{DIA_LEG} + " " + $F{MES_LEG} + " " + $F{ANHO_LEG}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement mode="Opaque" x="352" y="0" width="110" height="15" forecolor="#000000"/>
				<box>
					<pen lineWidth="0.75" lineStyle="Dotted"/>
					<topPen lineWidth="0.0" lineStyle="Dotted"/>
					<leftPen lineWidth="0.0" lineStyle="Dotted"/>
					<bottomPen lineWidth="0.0" lineStyle="Dotted"/>
					<rightPen lineWidth="0.0" lineStyle="Dotted"/>
				</box>
				<textElement verticalAlignment="Middle" markup="none">
					<font fontName="SansSerif" size="8"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA["Fecha de legalización:"]]></textFieldExpression>
			</textField>
			<textField isBlankWhenNull="true">
				<reportElement mode="Opaque" x="462" y="16" width="110" height="20" forecolor="#000000"/>
				<box>
					<bottomPen lineWidth="0.75"/>
				</box>
				<textElement verticalAlignment="Middle" markup="none">
					<font fontName="SansSerif" size="8"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[( $F{DIAS_COMI}.doubleValue() == 0
    ? ""
    : $F{DIA_COMIS} + " " + $F{MES_COMIS} + " " + $F{ANHO_COMIS}
)]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement mode="Opaque" x="352" y="16" width="110" height="20" forecolor="#000000"/>
				<box>
					<pen lineWidth="0.75" lineStyle="Dotted"/>
					<topPen lineWidth="0.0" lineStyle="Dotted"/>
					<leftPen lineWidth="0.0" lineStyle="Dotted"/>
					<bottomPen lineWidth="0.0" lineStyle="Dotted"/>
					<rightPen lineWidth="0.0" lineStyle="Dotted"/>
				</box>
				<textElement verticalAlignment="Middle" markup="none">
					<font fontName="SansSerif" size="8"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA["Fecha de salida comisión:"]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement mode="Opaque" x="111" y="37" width="129" height="15" forecolor="#000000"/>
				<box>
					<bottomPen lineWidth="0.75"/>
				</box>
				<textElement verticalAlignment="Middle" markup="none">
					<font fontName="SansSerif" size="8"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{NITOCC}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement mode="Opaque" x="0" y="37" width="111" height="15" forecolor="#000000"/>
				<box>
					<pen lineWidth="0.75" lineStyle="Dotted"/>
					<topPen lineWidth="0.0" lineStyle="Dotted"/>
					<leftPen lineWidth="0.0" lineStyle="Dotted"/>
					<bottomPen lineWidth="0.0" lineStyle="Dotted"/>
					<rightPen lineWidth="0.0" lineStyle="Dotted"/>
				</box>
				<textElement verticalAlignment="Middle" markup="none">
					<font fontName="SansSerif" size="8"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA["Documento de identidad:"]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement mode="Opaque" x="251" y="68" width="100" height="15" forecolor="#000000"/>
				<box>
					<pen lineWidth="0.75" lineStyle="Dotted"/>
					<topPen lineWidth="0.0" lineStyle="Dotted"/>
					<leftPen lineWidth="0.0" lineStyle="Dotted"/>
					<bottomPen lineWidth="0.0" lineStyle="Dotted"/>
					<rightPen lineWidth="0.0" lineStyle="Dotted"/>
				</box>
				<textElement verticalAlignment="Middle" markup="none">
					<font fontName="SansSerif" size="8"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA["Días legalizados: "]]></textFieldExpression>
			</textField>
			<textField isStretchWithOverflow="true" isBlankWhenNull="true">
				<reportElement stretchType="RelativeToBandHeight" mode="Opaque" x="89" y="84" width="482" height="30" forecolor="#000000"/>
				<box>
					<bottomPen lineWidth="0.75"/>
				</box>
				<textElement verticalAlignment="Middle" markup="none">
					<font fontName="SansSerif" size="8"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{DESTINO}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement stretchType="RelativeToBandHeight" mode="Opaque" x="0" y="84" width="89" height="15" forecolor="#000000"/>
				<box>
					<pen lineWidth="0.75" lineStyle="Dotted"/>
					<topPen lineWidth="0.0" lineStyle="Dotted"/>
					<leftPen lineWidth="0.0" lineStyle="Dotted"/>
					<bottomPen lineWidth="0.0" lineStyle="Dotted"/>
					<rightPen lineWidth="0.0" lineStyle="Dotted"/>
				</box>
				<textElement verticalAlignment="Middle" markup="none">
					<font fontName="SansSerif" size="8"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA["Destinos:"]]></textFieldExpression>
			</textField>
			<textField isStretchWithOverflow="true" isBlankWhenNull="true">
				<reportElement stretchType="RelativeToBandHeight" mode="Opaque" x="89" y="115" width="482" height="45" forecolor="#000000"/>
				<box>
					<bottomPen lineWidth="0.75"/>
				</box>
				<textElement verticalAlignment="Middle" markup="none">
					<font fontName="SansSerif" size="8"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{OBSERVACIONES_AVAN}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement stretchType="RelativeToBandHeight" mode="Opaque" x="0" y="115" width="89" height="15" forecolor="#000000"/>
				<box>
					<pen lineWidth="0.75" lineStyle="Dotted"/>
					<topPen lineWidth="0.0" lineStyle="Dotted"/>
					<leftPen lineWidth="0.0" lineStyle="Dotted"/>
					<bottomPen lineWidth="0.0" lineStyle="Dotted"/>
					<rightPen lineWidth="0.0" lineStyle="Dotted"/>
				</box>
				<textElement verticalAlignment="Middle" markup="none">
					<font fontName="SansSerif" size="8"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA["Observaciones:"]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement mode="Opaque" x="0" y="68" width="111" height="15" forecolor="#000000"/>
				<box>
					<pen lineWidth="0.75" lineStyle="Dotted"/>
					<topPen lineWidth="0.0" lineStyle="Dotted"/>
					<leftPen lineWidth="0.0" lineStyle="Dotted"/>
					<bottomPen lineWidth="0.0" lineStyle="Dotted"/>
					<rightPen lineWidth="0.0" lineStyle="Dotted"/>
				</box>
				<textElement verticalAlignment="Middle" markup="none">
					<font fontName="SansSerif" size="8"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA["Total días aprobados: "]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement mode="Opaque" x="90" y="16" width="80" height="20" forecolor="#000000"/>
				<box>
					<bottomPen lineWidth="0.75"/>
				</box>
				<textElement verticalAlignment="Middle" markup="none">
					<font fontName="SansSerif" size="8"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{ID}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement mode="Opaque" x="0" y="16" width="90" height="20" forecolor="#000000"/>
				<box>
					<pen lineWidth="0.75" lineStyle="Dotted"/>
					<topPen lineWidth="0.0" lineStyle="Dotted"/>
					<leftPen lineWidth="0.0" lineStyle="Dotted"/>
					<bottomPen lineWidth="0.0" lineStyle="Dotted"/>
					<rightPen lineWidth="0.0" lineStyle="Dotted"/>
				</box>
				<textElement verticalAlignment="Middle" markup="none">
					<font fontName="SansSerif" size="8"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA["Registro presupuestal:"]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement mode="Opaque" x="111" y="52" width="240" height="15" forecolor="#000000"/>
				<box>
					<bottomPen lineWidth="0.75"/>
				</box>
				<textElement verticalAlignment="Middle" markup="none">
					<font fontName="SansSerif" size="8"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{RAZSOC}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement mode="Opaque" x="0" y="52" width="111" height="15" forecolor="#000000"/>
				<box>
					<pen lineWidth="0.75" lineStyle="Dotted"/>
					<topPen lineWidth="0.0" lineStyle="Dotted"/>
					<leftPen lineWidth="0.0" lineStyle="Dotted"/>
					<bottomPen lineWidth="0.0" lineStyle="Dotted"/>
					<rightPen lineWidth="0.0" lineStyle="Dotted"/>
				</box>
				<textElement verticalAlignment="Middle" markup="none">
					<font fontName="SansSerif" size="8"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{TIP}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement mode="Opaque" x="111" y="68" width="140" height="15" forecolor="#000000"/>
				<box>
					<bottomPen lineWidth="0.75"/>
				</box>
				<textElement verticalAlignment="Middle" markup="none">
					<font fontName="SansSerif" size="8"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{DIAS}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement mode="Opaque" x="240" y="17" width="112" height="20" forecolor="#000000"/>
				<box>
					<bottomPen lineWidth="0.75"/>
				</box>
				<textElement verticalAlignment="Middle" markup="none">
					<font fontName="SansSerif" size="8"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{RESOLUCION} + $F{RESOLUCION_MOF}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement mode="Opaque" x="170" y="16" width="70" height="20" forecolor="#000000"/>
				<box>
					<pen lineWidth="0.75" lineStyle="Dotted"/>
					<topPen lineWidth="0.0" lineStyle="Dotted"/>
					<leftPen lineWidth="0.0" lineStyle="Dotted"/>
					<bottomPen lineWidth="0.0" lineStyle="Dotted"/>
					<rightPen lineWidth="0.0" lineStyle="Dotted"/>
				</box>
				<textElement verticalAlignment="Middle" markup="none">
					<font fontName="SansSerif" size="8"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA["No. Resolución:"]]></textFieldExpression>
			</textField>
			<textField pattern="">
				<reportElement mode="Opaque" x="351" y="68" width="220" height="15" forecolor="#000000"/>
				<box>
					<bottomPen lineWidth="0.75"/>
				</box>
				<textElement verticalAlignment="Middle" markup="none">
					<font fontName="SansSerif" size="8"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{DIAS_COMI}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement mode="Opaque" x="351" y="37" width="110" height="15" forecolor="#000000"/>
				<box>
					<pen lineWidth="0.75" lineStyle="Dotted"/>
					<topPen lineWidth="0.0" lineStyle="Dotted"/>
					<leftPen lineWidth="0.0" lineStyle="Dotted"/>
					<bottomPen lineWidth="0.0" lineStyle="Dotted"/>
					<rightPen lineWidth="0.0" lineStyle="Dotted"/>
				</box>
				<textElement verticalAlignment="Middle" markup="none">
					<font fontName="SansSerif" size="8"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA["Fecha fin comisión:"]]></textFieldExpression>
			</textField>
			<textField isBlankWhenNull="true">
				<reportElement mode="Opaque" x="461" y="37" width="110" height="15" forecolor="#000000"/>
				<box>
					<bottomPen lineWidth="0.75"/>
				</box>
				<textElement verticalAlignment="Middle" markup="none">
					<font fontName="SansSerif" size="8"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[( $F{DIAS_COMI}.doubleValue() == 0
    ? ""
    : $F{DIA_FIN_COMIS} + " " + $F{MES_FIN_COMIS} + " " + $F{ANHO_FIN_COMIS}
)]]></textFieldExpression>
			</textField>
		</band>
	</columnHeader>
	<detail>
		<band height="56" splitType="Stretch">
			<subreport>
				<reportElement x="0" y="0" width="572" height="50"/>
				<subreportParameter name="id_rp">
					<subreportParameterExpression><![CDATA[$P{id_rp}]]></subreportParameterExpression>
				</subreportParameter>
				<subreportParameter name="id_vigencia">
					<subreportParameterExpression><![CDATA[$F{ID_VIGENCIA}]]></subreportParameterExpression>
				</subreportParameter>
				<subreportParameter name="tipo">
					<subreportParameterExpression><![CDATA[$F{TIPO}]]></subreportParameterExpression>
				</subreportParameter>
				<subreportParameter name="vigencia">
					<subreportParameterExpression><![CDATA[$P{vigencia}]]></subreportParameterExpression>
				</subreportParameter>
				<connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
				<subreportExpression class="java.lang.String"><![CDATA["repo:presup_asig"]]></subreportExpression>
			</subreport>
		</band>
		<band height="58">
			<subreport>
				<reportElement x="0" y="0" width="572" height="50"/>
				<subreportParameter name="id_rp">
					<subreportParameterExpression><![CDATA[$P{id_rp}]]></subreportParameterExpression>
				</subreportParameter>
				<subreportParameter name="id_vigencia">
					<subreportParameterExpression><![CDATA[$F{ID_VIGENCIA}]]></subreportParameterExpression>
				</subreportParameter>
				<subreportParameter name="vigencia">
					<subreportParameterExpression><![CDATA[$P{vigencia}]]></subreportParameterExpression>
				</subreportParameter>
				<connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
				<subreportExpression class="java.lang.String"><![CDATA["repo:regis_deta"]]></subreportExpression>
			</subreport>
		</band>
	</detail>
	<columnFooter>
		<band height="3" splitType="Stretch"/>
	</columnFooter>
	<pageFooter>
		<band height="24" splitType="Stretch">
			<staticText>
				<reportElement mode="Opaque" x="0" y="12" width="70" height="12" forecolor="#575757"/>
				<textElement verticalAlignment="Middle">
					<font fontName="SansSerif" size="6"/>
				</textElement>
				<text><![CDATA[Fecha de Impresion:]]></text>
			</staticText>
			<textField pattern="dd-MMM-yyyy   hh:mm aaa">
				<reportElement mode="Opaque" x="70" y="12" width="150" height="12" forecolor="#575757" backcolor="#FFFFFF"/>
				<box leftPadding="2"/>
				<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.util.Date"><![CDATA[new java.util.Date()]]></textFieldExpression>
			</textField>
			<staticText>
				<reportElement mode="Opaque" x="421" y="0" 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>
				<text><![CDATA[AP03-P-008-F-009 / V1]]></text>
			</staticText>
		</band>
	</pageFooter>
	<summary>
		<band height="242" splitType="Stretch">
			<textField>
				<reportElement mode="Opaque" x="0" y="230" width="572" height="12" forecolor="#000000"/>
				<textElement verticalAlignment="Middle" markup="styled">
					<font fontName="SansSerif" size="8"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA["<style isBold=\"true\">Nota:</style> En caso de requerir registrar gastos adicionales imprima éste formato a doble cara, por un mejor medio ambiente."]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement mode="Opaque" x="0" y="180" width="572" height="12" forecolor="#000000"/>
				<box>
					<pen lineWidth="0.75" lineStyle="Dotted"/>
					<topPen lineWidth="0.75" lineStyle="Dotted"/>
					<leftPen lineWidth="0.75" lineStyle="Dotted"/>
					<bottomPen lineWidth="0.0" lineStyle="Dotted"/>
					<rightPen lineWidth="0.75" lineStyle="Dotted"/>
				</box>
				<textElement textAlignment="Center" verticalAlignment="Middle" markup="styled">
					<font fontName="SansSerif" size="7"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA["Reintegro recursos <style isBold=\"true\">PROPIOS</style> Funcionamiento o Inversión por favor consignar en la cuenta Corriente del Banco de Bogotá No. 000051011 a nombre de la "]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement mode="Opaque" x="0" y="192" width="572" height="12" forecolor="#000000"/>
				<box>
					<pen lineWidth="0.75" lineStyle="Dotted"/>
					<topPen lineWidth="0.0" lineStyle="Dotted"/>
					<leftPen lineWidth="0.75" lineStyle="Dotted"/>
					<bottomPen lineWidth="0.0" lineStyle="Dotted"/>
					<rightPen lineWidth="0.75" lineStyle="Dotted"/>
				</box>
				<textElement textAlignment="Center" verticalAlignment="Middle" markup="styled">
					<font fontName="SansSerif" size="7"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA["<style isBold=\"true\">AGENCIA NACIONAL DE MINERIA</style>, en Formato Sistema Nacional de Recaudo Comprobante Universal Individual."]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement mode="Opaque" x="0" y="204" width="572" height="12" forecolor="#000000"/>
				<box>
					<pen lineWidth="0.75" lineStyle="Dotted"/>
					<topPen lineWidth="0.0" lineStyle="Dotted"/>
					<leftPen lineWidth="0.75" lineStyle="Dotted"/>
					<bottomPen lineWidth="0.75" lineStyle="Dotted"/>
					<rightPen lineWidth="0.75" lineStyle="Dotted"/>
				</box>
				<textElement textAlignment="Center" verticalAlignment="Middle" markup="styled">
					<font fontName="SansSerif" size="7"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA["Ref 1. Número de cédula del comisionado  Ref 2: El número del teléfono"]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement mode="Opaque" x="0" y="86" width="200" height="12" forecolor="#000000"/>
				<box>
					<pen lineWidth="0.75" lineStyle="Dotted"/>
					<topPen lineWidth="0.75" lineStyle="Solid"/>
					<leftPen lineWidth="0.0" lineStyle="Dotted"/>
					<bottomPen lineWidth="0.0" lineStyle="Dotted"/>
					<rightPen lineWidth="0.0" lineStyle="Dotted"/>
				</box>
				<textElement textAlignment="Center" verticalAlignment="Middle" markup="none">
					<font fontName="SansSerif" size="8"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{TIP_FIRMA}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement mode="Opaque" x="372" y="86" width="200" height="12" forecolor="#000000"/>
				<box>
					<pen lineWidth="0.75" lineStyle="Dotted"/>
					<topPen lineWidth="0.75" lineStyle="Solid"/>
					<leftPen lineWidth="0.0" lineStyle="Dotted"/>
					<bottomPen lineWidth="0.0" lineStyle="Dotted"/>
					<rightPen lineWidth="0.0" lineStyle="Dotted"/>
				</box>
				<textElement textAlignment="Center" verticalAlignment="Middle" markup="none">
					<font fontName="SansSerif" size="8"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA["Firma"]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement mode="Opaque" x="372" y="113" width="200" height="12" forecolor="#000000"/>
				<box>
					<pen lineWidth="0.75" lineStyle="Dotted"/>
					<topPen lineWidth="0.75" lineStyle="Solid"/>
					<leftPen lineWidth="0.0" lineStyle="Dotted"/>
					<bottomPen lineWidth="0.0" lineStyle="Dotted"/>
					<rightPen lineWidth="0.0" lineStyle="Dotted"/>
				</box>
				<textElement textAlignment="Center" verticalAlignment="Middle" markup="none">
					<font fontName="SansSerif" size="8"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[" Nombre del Jefe inmediato y/o Supervisor"]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement mode="Opaque" x="0" y="10" width="150" height="12" forecolor="#000000"/>
				<box>
					<pen lineWidth="0.75" lineStyle="Dotted"/>
					<topPen lineWidth="0.0" lineStyle="Dotted"/>
					<leftPen lineWidth="0.0" lineStyle="Dotted"/>
					<bottomPen lineWidth="0.0" lineStyle="Dotted"/>
					<rightPen lineWidth="0.0" lineStyle="Dotted"/>
				</box>
				<textElement textAlignment="Right" verticalAlignment="Middle" markup="none">
					<font fontName="SansSerif" size="8"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA["Valor a reintegrar:"]]></textFieldExpression>
			</textField>
			<textField pattern="#,##0.00" isBlankWhenNull="true">
				<reportElement mode="Opaque" x="160" y="10" width="120" height="12" forecolor="#000000"/>
				<box>
					<pen lineWidth="0.75" lineStyle="Dotted"/>
					<topPen lineWidth="0.0" lineStyle="Dotted"/>
					<leftPen lineWidth="0.0" lineStyle="Dotted"/>
					<bottomPen lineWidth="0.75" lineStyle="Solid"/>
					<rightPen lineWidth="0.0" lineStyle="Dotted"/>
				</box>
				<textElement textAlignment="Right" verticalAlignment="Middle" markup="none">
					<font fontName="SansSerif" size="8"/>
				</textElement>
				<textFieldExpression class="java.math.BigDecimal"><![CDATA[$F{V_REINTEGRO_COMP} - $F{V_REINTEGRO_LEG}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement mode="Opaque" x="150" y="10" width="10" height="12" forecolor="#000000"/>
				<box>
					<pen lineWidth="0.75" lineStyle="Dotted"/>
					<topPen lineWidth="0.0" lineStyle="Dotted"/>
					<leftPen lineWidth="0.0" lineStyle="Dotted"/>
					<bottomPen lineWidth="0.75" lineStyle="Solid"/>
					<rightPen lineWidth="0.0" lineStyle="Dotted"/>
				</box>
				<textElement textAlignment="Center" verticalAlignment="Middle" markup="none">
					<font fontName="SansSerif" size="8"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{PESOS}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement mode="Opaque" x="372" y="101" width="200" height="12" forecolor="#000000"/>
				<box>
					<pen lineWidth="0.75" lineStyle="Dotted"/>
					<topPen lineWidth="0.0" lineStyle="Dotted"/>
					<leftPen lineWidth="0.0" lineStyle="Dotted"/>
					<bottomPen lineWidth="0.0" lineStyle="Dotted"/>
					<rightPen lineWidth="0.0" lineStyle="Dotted"/>
				</box>
				<textElement textAlignment="Center" verticalAlignment="Middle" markup="none">
					<font fontName="SansSerif" size="8"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{JEFE}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement mode="Opaque" x="0" y="145" width="572" height="12" forecolor="#000000"/>
				<box>
					<pen lineWidth="0.75" lineStyle="Dotted"/>
					<topPen lineWidth="0.0" lineStyle="Dotted"/>
					<leftPen lineWidth="0.75" lineStyle="Dotted"/>
					<bottomPen lineWidth="0.0" lineStyle="Dotted"/>
					<rightPen lineWidth="0.75" lineStyle="Dotted"/>
				</box>
				<textElement textAlignment="Center" verticalAlignment="Middle" markup="styled">
					<font fontName="SansSerif" size="7"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA["Identificar la fuente de los recursos del rubro presupuestal por el cual se otorgó la comisión y seguir el instructivo para transferencia <style isBold=\"true\">PSE</style> Punto virtual Banco Agrario."]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement mode="Opaque" x="0" y="133" width="572" height="12" forecolor="#000000"/>
				<box>
					<pen lineWidth="0.75" lineStyle="Dotted"/>
					<topPen lineWidth="0.75" lineStyle="Dotted"/>
					<leftPen lineWidth="0.75" lineStyle="Dotted"/>
					<bottomPen lineWidth="0.0" lineStyle="Dotted"/>
					<rightPen lineWidth="0.75" lineStyle="Dotted"/>
				</box>
				<textElement textAlignment="Center" verticalAlignment="Middle" markup="styled">
					<font fontName="SansSerif" size="7"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA["Reintegro recursos <style isBold=\"true\">NACION</style> Funcionamiento o Inversión por <style isBold=\"true\">PSE</style> en el portal del <style isBold=\"true\">BANCO AGRARIO.</style>"]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement mode="Opaque" x="0" y="157" width="572" height="12" forecolor="#000000"/>
				<box>
					<pen lineWidth="0.75" lineStyle="Dotted"/>
					<topPen lineWidth="0.0" lineStyle="Dotted"/>
					<leftPen lineWidth="0.75" lineStyle="Dotted"/>
					<bottomPen lineWidth="0.75" lineStyle="Dotted"/>
					<rightPen lineWidth="0.75" lineStyle="Dotted"/>
				</box>
				<textElement textAlignment="Center" verticalAlignment="Middle" markup="styled">
					<font fontName="SansSerif" size="7"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA["Concepto: Código portafolio 398 - Agencia Nacional de Minería. Unidad Ejecutora 21-12-00."]]></textFieldExpression>
			</textField>
			<image>
				<reportElement x="67" y="32" width="68" height="49">
					<printWhenExpression><![CDATA[$F{FIRMADO}.toString()=="1"?Boolean.TRUE:Boolean.FALSE]]></printWhenExpression>
				</reportElement>
				<imageExpression class="java.lang.String"><![CDATA["repo:firmado"]]></imageExpression>
			</image>
			<image>
				<reportElement x="435" y="32" width="72" height="49">
					<printWhenExpression><![CDATA[$F{APROBADO}.toString()=="1"?Boolean.TRUE:Boolean.FALSE]]></printWhenExpression>
				</reportElement>
				<imageExpression class="java.lang.String"><![CDATA["repo:autorizado"]]></imageExpression>
			</image>
		</band>
	</summary>
	<noData>
		<band height="20">
			<staticText>
				<reportElement x="0" y="0" width="572" height="20"/>
				<textElement textAlignment="Center" verticalAlignment="Middle">
					<font fontName="SansSerif" isBold="true"/>
				</textElement>
				<text><![CDATA[No hay objetos a mostrar.]]></text>
			</staticText>
		</band>
	</noData>
</jasperReport>
