<?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="resuluciones_vobo" language="groovy" pageWidth="200" pageHeight="555" orientation="Landscape" columnWidth="200" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0">
	<property name="ireport.zoom" value="1.771561000000001"/>
	<property name="ireport.x" value="0"/>
	<property name="ireport.y" value="0"/>
	<property name="ireport.jasperserver.reportUnit" value="/reports/control_comisiones/resolucion_comis_id"/>
	<property name="ireport.jasperserver.url" value="http://192.168.2.43:8090/jasperserver/services/repository"/>
	<parameter name="id_resoluciones" class="java.math.BigDecimal">
		<defaultValueExpression><![CDATA[]]></defaultValueExpression>
	</parameter>
	<queryString>
		<![CDATA[select
        res.id_resol_vobo,
        res.id_resoluciones,
        res.id_resol_comis,
        case when res.id_resol_comis is not null
        then (select max(pr_resol_comis.resolucion) from pr_resol_comis where pr_resol_comis.id = res.id_resol_comis)
        else (select max(pr_resoluciones.resolucion) from pr_resoluciones where pr_resoluciones.id_resoluciones = res.id_resoluciones) end as numero_resol,
        res.id_mae_ter,
        ter.num_doc as num_doc,
        initcap_sofhouse( initcap(ter.razon_soc) ) as razon_soc

        from pr_resol_vobo res

        join interceros_v ter
        on ter.id_mae_ter = res.id_mae_ter

        where
        case when res.id_resol_comis is not null
        then res.id_resol_comis
        else res.id_resoluciones end = $P{id_resoluciones}

        order by
        res.id_resol_vobo,
        ter.num_doc]]>
	</queryString>
	<field name="ID_RESOL_VOBO" class="java.math.BigDecimal"/>
	<field name="ID_RESOLUCIONES" class="java.math.BigDecimal"/>
	<field name="ID_RESOL_COMIS" class="java.math.BigDecimal"/>
	<field name="NUMERO_RESOL" class="java.lang.String"/>
	<field name="ID_MAE_TER" class="java.math.BigDecimal"/>
	<field name="NUM_DOC" class="java.lang.String"/>
	<field name="RAZON_SOC" class="java.lang.String"/>
	<detail>
		<band height="12" splitType="Stretch">
			<textField>
				<reportElement mode="Opaque" x="0" y="0" width="200" height="12" forecolor="#000000"/>
				<box leftPadding="2">
					<pen lineWidth="0.75" lineStyle="Solid"/>
					<topPen lineWidth="0.0" lineStyle="Solid"/>
					<leftPen lineWidth="0.0" lineStyle="Solid"/>
					<bottomPen lineWidth="0.0" lineStyle="Solid"/>
					<rightPen lineWidth="0.0" lineStyle="Solid"/>
				</box>
				<textElement verticalAlignment="Middle" markup="none">
					<font fontName="SansSerif" size="8"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA["Vo. Bo.  "+$F{RAZON_SOC}]]></textFieldExpression>
			</textField>
		</band>
	</detail>
</jasperReport>
