<?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="declara_otra_entid" language="groovy" pageWidth="660" pageHeight="980" whenNoDataType="NoDataSection" columnWidth="525" leftMargin="68" rightMargin="67" topMargin="70" bottomMargin="20">
	<property name="ireport.zoom" value="1.5"/>
	<property name="ireport.x" value="0"/>
	<property name="ireport.y" value="106"/>
	<property name="ireport.jasperserver.reportUnit" value="/reports/radicacionvirtualcuentas/declara_otra_entid"/>
	<property name="ireport.jasperserver.url" value="http://localhost:8090/jasperserver/services/repository"/>
	<parameter name="id_declara_otra_entid" class="java.lang.String">
		<defaultValueExpression><![CDATA['0']]></defaultValueExpression>
	</parameter>
	<queryString>
		<![CDATA[SELECT * FROM (

SELECT    tab0.ID_DECLARA_OTRA_ENTID,
          tab0.ID_CONTRATISTA,
          to_char(tab0.FECHA,'yyyy-mm-dd') as fecha_text,
          tab0.OTRA_ENTIDAD,
          tab0.NUMERO_DOC,
          to_char(tab0.FECHA_DOC,'yyyy-mm-dd') as fecha_doc_text,
          tab0.OBSERVACIONES,
          tab0.USUARIO_LOG,
          to_char(tab0.FECHA_LOG,'yyyy-mm-dd') as fecha_log_text,
          tab0.FIRMADO,
          to_char(tab0.FECHA_FIRMADO,'yyyy-mm-dd') as fecha_firmado_text,
          tab0.ADJUNTO_FIRMADO,
	to_char(nvl(tab1.entidad_publica,'')) as entidad_publica,
	to_char(nvl(tab1.no_contrato,'')) as no_contrato,

	tab1.valor_mensualizado,
	to_char(nvl(tab1.nombre_supervisor,'')) as nombre_supervisor,
	to_char(nvl(tab1.telefono_supervisor,'')) as telefono_supervisor,
         to_char( tab2.NUM_DOC) as num_doc,
          to_char(tab2.RAZON_SOCIAL) as razon_social,
	to_char(tab2.razon_social )as nombre_firma,
	to_char(tab3.municipio) as municipio,
	to_char(sysdate, 'dd')  as dia_firma,
	to_char(sysdate,'mm') as mes_texto_firma,
	to_char(sysdate,'yyyy') as ano_firma,
	'VICEPRESIDENCIA ADMINISTRATIVA Y FINANCIERA
GRUPO DE RECUROS FINANCIEROS' as s,
tab4.abreviacion,
tab5.num_contrato


FROM RVC_DECLARA_OTRA_ENTID tab0
LEFT JOIN RVC_DECLARA_OTRA_ENTIDET tab1 ON tab1.id_declara_otra_entid=tab0.id_declara_otra_entid
LEFT JOIN RVC_CONTRATISTA tab2 ON tab0.id_contratista=tab2.id_contratista
LEFT JOIN MUNICIPIOS tab3 ON tab2.codmun=tab3.codmun
LEFT JOIN TIPO_DOCUMENTO tab4 ON tab2.id_tipo_doc=tab4.id_tipo_doc
LEFT JOIN RVC_CONTRATO tab5 ON tab5.id_contratista=tab2.id_contratista and tab5.estado = 1

)tab0

WHERE 1=1
and tab0.id_declara_otra_entid = $P!{id_declara_otra_entid}]]>
	</queryString>
	<field name="ID_DECLARA_OTRA_ENTID" class="java.math.BigDecimal"/>
	<field name="ID_CONTRATISTA" class="java.math.BigDecimal"/>
	<field name="FECHA_TEXT" class="java.lang.String"/>
	<field name="OTRA_ENTIDAD" class="java.math.BigDecimal"/>
	<field name="NUMERO_DOC" class="java.lang.String"/>
	<field name="FECHA_DOC_TEXT" class="java.lang.String"/>
	<field name="OBSERVACIONES" class="java.lang.String"/>
	<field name="USUARIO_LOG" class="java.lang.String"/>
	<field name="FECHA_LOG_TEXT" class="java.lang.String"/>
	<field name="FIRMADO" class="java.math.BigDecimal"/>
	<field name="FECHA_FIRMADO_TEXT" class="java.lang.String"/>
	<field name="ADJUNTO_FIRMADO" class="java.lang.String"/>
	<field name="ENTIDAD_PUBLICA" class="java.lang.String"/>
	<field name="NO_CONTRATO" class="java.lang.String"/>
	<field name="VALOR_MENSUALIZADO" class="java.math.BigDecimal"/>
	<field name="NOMBRE_SUPERVISOR" class="java.lang.String"/>
	<field name="TELEFONO_SUPERVISOR" class="java.lang.String"/>
	<field name="NUM_DOC" class="java.lang.String"/>
	<field name="RAZON_SOCIAL" class="java.lang.String"/>
	<field name="NOMBRE_FIRMA" class="java.lang.String"/>
	<field name="MUNICIPIO" class="java.lang.String"/>
	<field name="DIA_FIRMA" class="java.lang.String"/>
	<field name="MES_TEXTO_FIRMA" class="java.lang.String"/>
	<field name="ANO_FIRMA" class="java.lang.String"/>
	<field name="S" class="java.lang.String"/>
	<field name="ABREVIACION" class="java.lang.String"/>
	<field name="NUM_CONTRATO" class="java.lang.String"/>
	<title>
		<band height="60" splitType="Stretch">
			<image>
				<reportElement x="0" y="0" width="140" height="60"/>
				<box topPadding="10" leftPadding="10" bottomPadding="10" rightPadding="10">
					<topPen lineWidth="1.0"/>
					<leftPen lineWidth="1.0"/>
					<bottomPen lineWidth="1.0"/>
					<rightPen lineWidth="1.0"/>
				</box>
				<imageExpression class="java.lang.String"><![CDATA["repo:LogoEmpresa003.jpg"]]></imageExpression>
			</image>
			<textField>
				<reportElement x="140" y="0" width="383" height="60"/>
				<box>
					<pen lineWidth="1.0"/>
					<topPen lineWidth="1.0"/>
					<leftPen lineWidth="1.0"/>
					<bottomPen lineWidth="1.0"/>
					<rightPen lineWidth="1.0"/>
				</box>
				<textElement textAlignment="Center">
					<font size="12"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA["\n"+$F{S}]]></textFieldExpression>
			</textField>
		</band>
	</title>
	<pageHeader>
		<band height="52" splitType="Stretch">
			<textField isStretchWithOverflow="true">
				<reportElement mode="Transparent" x="2" y="15" width="525" height="15" forecolor="#000000"/>
				<box>
					<bottomPen lineWidth="0.0"/>
				</box>
				<textElement textAlignment="Center" verticalAlignment="Middle" markup="none">
					<font fontName="SansSerif" size="12" isBold="true"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[" CERTIFICACION DE CONTRATOS CON OTRAS ENTIDADES PÚBLICAS "]]></textFieldExpression>
			</textField>
		</band>
	</pageHeader>
	<columnHeader>
		<band height="211" splitType="Stretch">
			<staticText>
				<reportElement mode="Transparent" x="0" y="181" width="110" height="30"/>
				<box>
					<topPen lineWidth="0.75"/>
					<leftPen lineWidth="0.75"/>
					<bottomPen lineWidth="0.75"/>
					<rightPen lineWidth="0.75"/>
				</box>
				<textElement textAlignment="Center" verticalAlignment="Middle">
					<font size="12" isBold="true"/>
				</textElement>
				<text><![CDATA[Entidad Pública]]></text>
			</staticText>
			<staticText>
				<reportElement mode="Transparent" x="110" y="181" width="90" height="30"/>
				<box>
					<topPen lineWidth="0.75"/>
					<leftPen lineWidth="0.75"/>
					<bottomPen lineWidth="0.75"/>
					<rightPen lineWidth="0.75"/>
				</box>
				<textElement textAlignment="Center" verticalAlignment="Middle">
					<font size="12" isBold="true"/>
				</textElement>
				<text><![CDATA[No. Contrato]]></text>
			</staticText>
			<textField isStretchWithOverflow="true" isBlankWhenNull="true">
				<reportElement stretchType="RelativeToBandHeight" mode="Transparent" x="0" y="0" width="526" height="54" forecolor="#000000"/>
				<box>
					<bottomPen lineWidth="0.0"/>
				</box>
				<textElement textAlignment="Justified" verticalAlignment="Middle" markup="none">
					<font fontName="SansSerif" size="12"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA["Yo, "+ $F{RAZON_SOCIAL} + " , identificada (o) con cedula de ciudadania número "+ $F{NUM_DOC} + " y vinculada (o) a la Agencia Nacional de Mineria mediante contrato de prestación de servicios número " +
( $F{NUM_CONTRATO}!=null
? $F{NUM_CONTRATO}+"."
: ""
)]]></textFieldExpression>
			</textField>
			<staticText>
				<reportElement mode="Opaque" x="200" y="181" width="135" height="30" forecolor="#000000" backcolor="#FFFFFF"/>
				<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="12" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
				</textElement>
				<text><![CDATA[Valor Mensualizado sin IVA]]></text>
			</staticText>
			<staticText>
				<reportElement mode="Opaque" x="335" y="181" width="100" height="30" forecolor="#000000" backcolor="#FFFFFF"/>
				<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="12" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
				</textElement>
				<text><![CDATA[Nombre Supervisor]]></text>
			</staticText>
			<staticText>
				<reportElement mode="Opaque" x="435" y="181" width="90" height="30" forecolor="#000000" backcolor="#FFFFFF"/>
				<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="12" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
				</textElement>
				<text><![CDATA[Teléfono Supervisor]]></text>
			</staticText>
			<textField isStretchWithOverflow="true" isBlankWhenNull="true">
				<reportElement stretchType="RelativeToBandHeight" mode="Transparent" x="0" y="55" width="526" height="29" forecolor="#000000"/>
				<box>
					<bottomPen lineWidth="0.0"/>
				</box>
				<textElement textAlignment="Justified" verticalAlignment="Middle" markup="none">
					<font fontName="SansSerif" size="12"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[" Me permito informar bajo la gravedad de Juramento lo siguiente: "]]></textFieldExpression>
			</textField>
			<textField isStretchWithOverflow="true" isBlankWhenNull="true">
				<reportElement stretchType="RelativeToBandHeight" mode="Transparent" x="0" y="84" width="526" height="46" forecolor="#000000"/>
				<box>
					<bottomPen lineWidth="0.0"/>
				</box>
				<textElement textAlignment="Justified" verticalAlignment="Middle" markup="none">
					<font fontName="SansSerif" size="12"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[( $F{OTRA_ENTIDAD}.toString().equals('1')
    ? "Si tengo contratos de prestación de servicios con otras entidades del Estado. "
    : "No tengo contratos de prestación de servicios con otras entidades del Estado. "
)]]></textFieldExpression>
			</textField>
			<textField isStretchWithOverflow="true" isBlankWhenNull="true">
				<reportElement stretchType="RelativeToBandHeight" mode="Transparent" x="1" y="130" width="526" height="19" forecolor="#000000"/>
				<box>
					<bottomPen lineWidth="0.0"/>
				</box>
				<textElement textAlignment="Justified" verticalAlignment="Middle" markup="none">
					<font fontName="SansSerif" size="12"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA["Información de Contratos Vigentes con otras entidades: "]]></textFieldExpression>
			</textField>
		</band>
	</columnHeader>
	<detail>
		<band height="18" splitType="Stretch">
			<textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true">
				<reportElement stretchType="RelativeToTallestObject" mode="Transparent" x="0" y="0" width="110" height="18"/>
				<box>
					<topPen lineWidth="0.75"/>
					<leftPen lineWidth="0.75"/>
					<bottomPen lineWidth="0.75"/>
					<rightPen lineWidth="0.75"/>
				</box>
				<textElement textAlignment="Center" verticalAlignment="Middle">
					<font size="12"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{ENTIDAD_PUBLICA}]]></textFieldExpression>
			</textField>
			<textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true">
				<reportElement stretchType="RelativeToTallestObject" mode="Transparent" x="110" y="0" width="90" height="18"/>
				<box>
					<topPen lineWidth="0.75"/>
					<leftPen lineWidth="0.75"/>
					<bottomPen lineWidth="0.75"/>
					<rightPen lineWidth="0.75"/>
				</box>
				<textElement textAlignment="Center" verticalAlignment="Middle">
					<font size="12"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{NO_CONTRATO}]]></textFieldExpression>
			</textField>
			<textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true">
				<reportElement stretchType="RelativeToTallestObject" mode="Transparent" x="335" y="0" width="100" height="18" forecolor="#000000" backcolor="#FFFFFF"/>
				<box leftPadding="2" 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="Center" verticalAlignment="Middle" rotation="None" markup="none">
					<font fontName="SansSerif" size="12" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{NOMBRE_SUPERVISOR}]]></textFieldExpression>
			</textField>
			<textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true">
				<reportElement stretchType="RelativeToTallestObject" mode="Transparent" x="435" y="0" width="90" height="18" forecolor="#000000" backcolor="#FFFFFF"/>
				<box leftPadding="2" 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="Center" verticalAlignment="Middle" rotation="None" markup="none">
					<font fontName="SansSerif" size="12" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{TELEFONO_SUPERVISOR}]]></textFieldExpression>
			</textField>
			<textField isStretchWithOverflow="true" pattern="#,##0.00" isBlankWhenNull="true">
				<reportElement stretchType="RelativeToTallestObject" mode="Transparent" x="200" y="0" width="135" height="18" forecolor="#000000" backcolor="#FFFFFF"/>
				<box leftPadding="2" 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="Center" verticalAlignment="Middle" rotation="None" markup="none">
					<font fontName="SansSerif" size="12" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
				</textElement>
				<textFieldExpression class="java.math.BigDecimal"><![CDATA[$F{VALOR_MENSUALIZADO}]]></textFieldExpression>
			</textField>
		</band>
	</detail>
	<columnFooter>
		<band splitType="Stretch"/>
	</columnFooter>
	<summary>
		<band height="320" splitType="Stretch">
			<textField isStretchWithOverflow="true" isBlankWhenNull="true">
				<reportElement positionType="FixRelativeToBottom" stretchType="RelativeToBandHeight" mode="Transparent" x="0" y="115" width="525" height="29" forecolor="#000000"/>
				<box>
					<bottomPen lineWidth="0.0"/>
				</box>
				<textElement textAlignment="Justified" verticalAlignment="Middle" markup="none">
					<font fontName="SansSerif" size="12"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA["En constancia de lo anterior, firmo en  "+$F{MUNICIPIO}+", a los  "+$F{DIA_FIRMA}+"  dias del mes de  "+$F{MES_TEXTO_FIRMA}+"  de  "+$F{ANO_FIRMA}+"."]]></textFieldExpression>
			</textField>
			<textField isStretchWithOverflow="true" isBlankWhenNull="true">
				<reportElement positionType="FixRelativeToBottom" stretchType="RelativeToBandHeight" mode="Transparent" x="-2" y="19" width="525" height="82" forecolor="#000000"/>
				<box>
					<bottomPen lineWidth="0.0"/>
				</box>
				<textElement textAlignment="Justified" verticalAlignment="Middle" markup="none">
					<font fontName="SansSerif" size="12"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA["Lo anterior con el fin de cumplir con lo establecido en el concepto 100208221- 469 expedido por la Subdirección de Gestión Normativa y Doctrina de la Direccion de Impuestos y Aduanas Nacionales en su numeral III, párrafo final:  “Cuando un persona natural esté vinculada mediante 2 o más contratos de prestación de servicios profesionales y de apoyo a la gestión pública, se deberán tener en cuenta la totalidad de los pagos o abonos en cuenta para efectos de determinar la sujeción pasiva, el hecho generador, la base gravable y la tarifa. “ "]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement stretchType="RelativeToBandHeight" mode="Opaque" x="76" y="253" width="250" height="15" forecolor="#000000"/>
				<box>
					<pen lineWidth="0.75" lineStyle="Dotted"/>
					<topPen lineWidth="0.0" lineStyle="Solid"/>
					<leftPen lineWidth="0.0" lineStyle="Dotted"/>
					<bottomPen lineWidth="0.0" lineStyle="Dotted"/>
					<rightPen lineWidth="0.0" lineStyle="Dotted"/>
				</box>
				<textElement textAlignment="Left" verticalAlignment="Middle" markup="none">
					<font fontName="SansSerif" size="10" isBold="false"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[($F{FIRMADO}.toString()=="1"
    ?"Firmado por: "
    :""
)
+$F{RAZON_SOCIAL}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement stretchType="RelativeToBandHeight" x="76" y="268" width="250" height="15"/>
				<textElement textAlignment="Left" verticalAlignment="Middle" markup="none">
					<font fontName="SansSerif" size="10" isBold="false"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{ABREVIACION} + " No. " + $F{NUM_DOC}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement stretchType="RelativeToBandHeight" x="76" y="283" width="250" height="15"/>
				<textElement textAlignment="Left" verticalAlignment="Middle" markup="none">
					<font fontName="SansSerif" size="10" isBold="false"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA["Contratista"]]></textFieldExpression>
			</textField>
			<image>
				<reportElement x="2" y="244" width="74" height="76">
					<printWhenExpression><![CDATA[$F{FIRMADO}.toString()=="1"?Boolean.TRUE:Boolean.FALSE]]></printWhenExpression>
				</reportElement>
				<imageExpression class="java.lang.String"><![CDATA["repo:logo_firmaa"]]></imageExpression>
			</image>
			<textField>
				<reportElement positionType="FixRelativeToBottom" stretchType="RelativeToBandHeight" mode="Transparent" x="2" y="205" width="324" height="12" forecolor="#000000"/>
				<box>
					<pen lineWidth="0.75" lineStyle="Dotted"/>
					<topPen lineWidth="0.0" lineStyle="Solid"/>
					<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="10" isBold="false"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA["Atentamente, "]]></textFieldExpression>
			</textField>
		</band>
	</summary>
	<noData>
		<band height="20">
			<staticText>
				<reportElement x="0" y="0" width="525" 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>
