<?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="caco_inf_interes_banc_mes" language="groovy" pageWidth="556" pageHeight="752" whenNoDataType="NoDataSection" columnWidth="556" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0">
	<property name="ireport.zoom" value="1.6105100000000012"/>
	<property name="ireport.x" value="0"/>
	<property name="ireport.y" value="0"/>
	<parameter name="id_contrato" class="java.math.BigDecimal">
		<defaultValueExpression><![CDATA[]]></defaultValueExpression>
	</parameter>
	<parameter name="id_novedad_contrato" class="java.math.BigDecimal">
		<defaultValueExpression><![CDATA[]]></defaultValueExpression>
	</parameter>
	<parameter name="valor_cero" class="java.math.BigDecimal">
		<defaultValueExpression><![CDATA[0]]></defaultValueExpression>
	</parameter>
	<queryString>
		<![CDATA[SELECT
tab0.*,
TO_CHAR(tab0.TASA_ANU, 'FM9,999,999,999.99') || ' %' as TASA_anu_text,
TO_CHAR(tab0.TASA_MEN, 'FM9,999,999,999.99') || ' %' as TASA_men_text,
upper(mes.descripcion) as mes,
ROW_NUMBER() OVER (
    partition by tab0.id_novedad_contrato
    ORDER BY tab0.vigencia_mes asc
) AS rn

FROM caco_calculo_interes_banco tab0

left join meses mes
on tab0.id_meses = mes.id_meses

where
tab0.id_novedad_contrato = $P{id_novedad_contrato}

order by
tab0.vigencia_mes,
tab0.fecha_ini]]>
	</queryString>
	<field name="ID_NOVEDAD_CONTRATO" class="java.math.BigDecimal"/>
	<field name="ID_CONTRATO" class="java.math.BigDecimal"/>
	<field name="VIGENCIA_MES" class="java.math.BigDecimal"/>
	<field name="FECHA_INI" class="java.sql.Timestamp"/>
	<field name="FECHA_FIN" class="java.sql.Timestamp"/>
	<field name="ID_ANHOS" class="java.math.BigDecimal"/>
	<field name="ID_MESES" class="java.math.BigDecimal"/>
	<field name="DIAS" class="java.math.BigDecimal"/>
	<field name="TASA_ANU" class="java.math.BigDecimal"/>
	<field name="TASA_MEN" class="java.math.BigDecimal"/>
	<field name="VALOR_CAPITAL" class="java.math.BigDecimal"/>
	<field name="VALOR_INTERES" class="java.math.BigDecimal"/>
	<field name="TASA_ANU_TEXT" class="java.lang.String"/>
	<field name="TASA_MEN_TEXT" class="java.lang.String"/>
	<field name="MES" class="java.lang.String"/>
	<field name="RN" class="java.math.BigDecimal"/>
	<variable name="total" class="java.math.BigDecimal" resetType="Group" resetGroup="id_anhos" calculation="Sum">
		<variableExpression><![CDATA[( $F{RN} != 1
    ? $F{VALOR_INTERES}
    : 0
)]]></variableExpression>
	</variable>
	<group name="id_anhos">
		<groupExpression><![CDATA[$F{ID_ANHOS}]]></groupExpression>
		<groupHeader>
			<band height="25" splitType="Prevent">
				<staticText>
					<reportElement x="160" y="0" width="40" height="25"/>
					<box>
						<pen lineWidth="0.75" lineStyle="Double"/>
						<topPen lineWidth="0.75" lineStyle="Double"/>
						<leftPen lineWidth="0.75" lineStyle="Double"/>
						<bottomPen lineWidth="0.75" lineStyle="Double"/>
						<rightPen lineWidth="0.75" lineStyle="Double"/>
					</box>
					<textElement textAlignment="Center" verticalAlignment="Middle"/>
					<text><![CDATA[DIAS]]></text>
				</staticText>
				<staticText>
					<reportElement x="450" y="0" width="106" height="25"/>
					<box>
						<pen lineWidth="0.75" lineStyle="Double"/>
						<topPen lineWidth="0.75" lineStyle="Double"/>
						<leftPen lineWidth="0.75" lineStyle="Double"/>
						<bottomPen lineWidth="0.75" lineStyle="Double"/>
						<rightPen lineWidth="0.75" lineStyle="Double"/>
					</box>
					<textElement textAlignment="Center" verticalAlignment="Middle"/>
					<text><![CDATA[VALOR INTERES CORRIENTE MENSUAL]]></text>
				</staticText>
				<staticText>
					<reportElement x="80" y="0" width="80" height="25"/>
					<box>
						<pen lineWidth="0.75" lineStyle="Double"/>
						<topPen lineWidth="0.75" lineStyle="Double"/>
						<leftPen lineWidth="0.75" lineStyle="Double"/>
						<bottomPen lineWidth="0.75" lineStyle="Double"/>
						<rightPen lineWidth="0.75" lineStyle="Double"/>
					</box>
					<textElement textAlignment="Center" verticalAlignment="Middle"/>
					<text><![CDATA[MES]]></text>
				</staticText>
				<staticText>
					<reportElement x="275" y="0" width="75" height="25"/>
					<box>
						<pen lineWidth="0.75" lineStyle="Double"/>
						<topPen lineWidth="0.75" lineStyle="Double"/>
						<leftPen lineWidth="0.75" lineStyle="Double"/>
						<bottomPen lineWidth="0.75" lineStyle="Double"/>
						<rightPen lineWidth="0.75" lineStyle="Double"/>
					</box>
					<textElement textAlignment="Center" verticalAlignment="Middle"/>
					<text><![CDATA[TASA MENSUAL (Int.Ban.Corr)]]></text>
				</staticText>
				<staticText>
					<reportElement x="350" y="0" width="100" height="25"/>
					<box>
						<pen lineWidth="0.75" lineStyle="Double"/>
						<topPen lineWidth="0.75" lineStyle="Double"/>
						<leftPen lineWidth="0.75" lineStyle="Double"/>
						<bottomPen lineWidth="0.75" lineStyle="Double"/>
						<rightPen lineWidth="0.75" lineStyle="Double"/>
					</box>
					<textElement textAlignment="Center" verticalAlignment="Middle"/>
					<text><![CDATA[CAPITAL]]></text>
				</staticText>
				<staticText>
					<reportElement x="0" y="0" width="80" height="25"/>
					<box>
						<pen lineWidth="0.75" lineStyle="Double"/>
						<topPen lineWidth="0.75" lineStyle="Double"/>
						<leftPen lineWidth="0.75" lineStyle="Double"/>
						<bottomPen lineWidth="0.75" lineStyle="Double"/>
						<rightPen lineWidth="0.75" lineStyle="Double"/>
					</box>
					<textElement textAlignment="Center" verticalAlignment="Middle"/>
					<text><![CDATA[AÑO]]></text>
				</staticText>
				<staticText>
					<reportElement x="200" y="0" width="75" height="25"/>
					<box>
						<pen lineWidth="0.75" lineStyle="Double"/>
						<topPen lineWidth="0.75" lineStyle="Double"/>
						<leftPen lineWidth="0.75" lineStyle="Double"/>
						<bottomPen lineWidth="0.75" lineStyle="Double"/>
						<rightPen lineWidth="0.75" lineStyle="Double"/>
					</box>
					<textElement textAlignment="Center" verticalAlignment="Middle"/>
					<text><![CDATA[TASA ANUAL (Int.Ban.Corr)]]></text>
				</staticText>
			</band>
		</groupHeader>
		<groupFooter>
			<band height="23">
				<textField pattern="$ #,##0" isBlankWhenNull="true">
					<reportElement x="450" y="0" width="106" height="12"/>
					<box rightPadding="2">
						<pen lineWidth="0.75" lineStyle="Double"/>
						<topPen lineWidth="0.75" lineStyle="Double"/>
						<leftPen lineWidth="0.75" lineStyle="Double"/>
						<bottomPen lineWidth="0.75" lineStyle="Double"/>
						<rightPen lineWidth="0.75" lineStyle="Double"/>
					</box>
					<textElement textAlignment="Right"/>
					<textFieldExpression class="java.math.BigDecimal"><![CDATA[$V{total}]]></textFieldExpression>
				</textField>
			</band>
		</groupFooter>
	</group>
	<detail>
		<band height="12" splitType="Stretch">
			<textField isBlankWhenNull="true">
				<reportElement x="80" y="0" width="80" height="12"/>
				<box>
					<pen lineWidth="0.75" lineStyle="Double"/>
					<topPen lineWidth="0.75" lineStyle="Double"/>
					<leftPen lineWidth="0.75" lineStyle="Double"/>
					<bottomPen lineWidth="0.75" lineStyle="Double"/>
					<rightPen lineWidth="0.75" lineStyle="Double"/>
				</box>
				<textElement textAlignment="Center"/>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{MES}]]></textFieldExpression>
			</textField>
			<textField isStretchWithOverflow="true" isBlankWhenNull="true">
				<reportElement stretchType="RelativeToBandHeight" x="0" y="0" width="80" height="12"/>
				<box>
					<pen lineWidth="0.75" lineStyle="Double"/>
					<topPen lineWidth="0.75" lineStyle="Double"/>
					<leftPen lineWidth="0.75" lineStyle="Double"/>
					<bottomPen lineWidth="0.75" lineStyle="Double"/>
					<rightPen lineWidth="0.75" lineStyle="Double"/>
				</box>
				<textElement textAlignment="Center"/>
				<textFieldExpression class="java.math.BigDecimal"><![CDATA[$F{ID_ANHOS}]]></textFieldExpression>
			</textField>
			<textField isBlankWhenNull="true">
				<reportElement x="160" y="0" width="40" height="12"/>
				<box>
					<pen lineWidth="0.75" lineStyle="Double"/>
					<topPen lineWidth="0.75" lineStyle="Double"/>
					<leftPen lineWidth="0.75" lineStyle="Double"/>
					<bottomPen lineWidth="0.75" lineStyle="Double"/>
					<rightPen lineWidth="0.75" lineStyle="Double"/>
				</box>
				<textElement textAlignment="Center"/>
				<textFieldExpression class="java.math.BigDecimal"><![CDATA[( $F{RN} != 1
    ? $F{DIAS}
    : null
)]]></textFieldExpression>
			</textField>
			<textField pattern="$ #,##0" isBlankWhenNull="true">
				<reportElement x="450" y="0" width="106" height="12"/>
				<box rightPadding="2">
					<pen lineWidth="0.75" lineStyle="Double"/>
					<topPen lineWidth="0.75" lineStyle="Double"/>
					<leftPen lineWidth="0.75" lineStyle="Double"/>
					<bottomPen lineWidth="0.75" lineStyle="Double"/>
					<rightPen lineWidth="0.75" lineStyle="Double"/>
				</box>
				<textElement textAlignment="Right"/>
				<textFieldExpression class="java.math.BigDecimal"><![CDATA[( $F{RN} != 1
    ? $F{VALOR_INTERES}
    : null
)]]></textFieldExpression>
			</textField>
			<textField pattern="$ #,##0.00" isBlankWhenNull="true">
				<reportElement x="350" y="0" width="100" height="12"/>
				<box rightPadding="2">
					<pen lineWidth="0.75" lineStyle="Double"/>
					<topPen lineWidth="0.75" lineStyle="Double"/>
					<leftPen lineWidth="0.75" lineStyle="Double"/>
					<bottomPen lineWidth="0.75" lineStyle="Double"/>
					<rightPen lineWidth="0.75" lineStyle="Double"/>
				</box>
				<textElement textAlignment="Right"/>
				<textFieldExpression class="java.math.BigDecimal"><![CDATA[$F{VALOR_CAPITAL}]]></textFieldExpression>
			</textField>
			<textField pattern="" isBlankWhenNull="true">
				<reportElement x="200" y="0" width="75" height="12"/>
				<box rightPadding="0">
					<pen lineWidth="0.75"/>
					<topPen lineWidth="0.75"/>
					<leftPen lineWidth="0.75"/>
					<bottomPen lineWidth="0.75"/>
					<rightPen lineWidth="0.75"/>
				</box>
				<textElement textAlignment="Center"/>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{TASA_ANU_TEXT}]]></textFieldExpression>
			</textField>
			<textField pattern="" isBlankWhenNull="true">
				<reportElement x="275" y="0" width="75" height="12"/>
				<box rightPadding="0">
					<pen lineWidth="0.75"/>
					<topPen lineWidth="0.75"/>
					<leftPen lineWidth="0.75"/>
					<bottomPen lineWidth="0.75"/>
					<rightPen lineWidth="0.75"/>
				</box>
				<textElement textAlignment="Center"/>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{TASA_MEN_TEXT}]]></textFieldExpression>
			</textField>
		</band>
	</detail>
</jasperReport>
