<?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="Credito" language="groovy" pageWidth="792" pageHeight="612" orientation="Landscape" columnWidth="752" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20">
	<property name="ireport.zoom" value="2.143588810000003"/>
	<property name="ireport.x" value="677"/>
	<property name="ireport.y" value="0"/>
	<parameter name="whereSecCredito" class="java.lang.String">
		<defaultValueExpression><![CDATA[" "]]></defaultValueExpression>
	</parameter>
	<parameter name="whereExacto" class="java.lang.String">
		<defaultValueExpression><![CDATA[" "]]></defaultValueExpression>
	</parameter>
	<parameter name="whereValorTotal" class="java.lang.String">
		<defaultValueExpression><![CDATA[" "]]></defaultValueExpression>
	</parameter>
	<parameter name="fecha_fin" class="java.lang.String">
		<defaultValueExpression><![CDATA[]]></defaultValueExpression>
	</parameter>
	<parameter name="fecha_ini" class="java.lang.String">
		<defaultValueExpression><![CDATA[]]></defaultValueExpression>
	</parameter>
	<parameter name="wherePuntoVenta" class="java.lang.String">
		<defaultValueExpression><![CDATA[" "]]></defaultValueExpression>
	</parameter>
	<parameter name="whereTipoCredito" class="java.lang.String">
		<defaultValueExpression><![CDATA[" "]]></defaultValueExpression>
	</parameter>
	<parameter name="whereTipoDocumento" class="java.lang.String">
		<defaultValueExpression><![CDATA[" "]]></defaultValueExpression>
	</parameter>
	<parameter name="whereConceptoCredito" class="java.lang.String">
		<defaultValueExpression><![CDATA[" "]]></defaultValueExpression>
	</parameter>
	<parameter name="whereBanco" class="java.lang.String">
		<defaultValueExpression><![CDATA[" "]]></defaultValueExpression>
	</parameter>
	<parameter name="whereCuenta" class="java.lang.String">
		<defaultValueExpression><![CDATA[" "]]></defaultValueExpression>
	</parameter>
	<parameter name="NomPuntoVenta" class="java.lang.String"/>
	<queryString>
		<![CDATA[SELECT    tab0.id_credito as id_credito,
tab0.id_anhos as id_anhos,
tab0.id_punto_venta as id_punto_venta,
tab0.id_tipo_credito as id_tipo_credito,
tab0.sec_credito as sec_credito,
tab0.id_con_credito as id_con_credito,
to_char(tab0.fecha_proceso, 'YYYY-MM-DD') as fecha_proceso,
tab0.id_bn as id_bn,
tab0.id_cb as id_cb,
tab0.num_doc as num_doc,
tab0.oficina as oficina,
tab0.valor as valor,
tab0.observaciones as observaciones,
tab0.estado as estado,
to_char(tab0.fecha_anu, 'YYYY-MM-DD') as fecha_anu,
tab0.motivo_anu as motivo_anu,
to_char(tab0.fecha, 'YYYY-MM-DD') as fecha,
tab0.id_ts_td as id_ts_td,
tab1.nombre as nombre_pv,
tab1.descripcion as descripcion_pv,
tab2.descripcion as descripcion_tc,
tab2.desc_corta as desc_corta_tc,
tab3.descripcion as descripcion_cc,
tab3.desc_corta as desc_corta_cc,
tab4.codigo as codigo_bn,
tab4.descripcion as descripcion_bn,
tab5.numero_cuenta as numero_cuenta,
tab6.documento as documento,
tab6.descripcion as descripcion_td

FROM CA_CREDITO tab0

JOIN CA_PUNTO_VENTA tab1
ON tab0.id_punto_venta = tab1.id_punto_venta

JOIN CA_TIPO_CREDITO tab2
ON tab0.id_tipo_credito = tab2.id_tipo_credito

JOIN CA_CON_CREDITO tab3
ON tab0.id_con_credito = tab3.id_con_credito

LEFT JOIN TS_BN tab4
ON tab0.id_bn = tab4.id_bn

LEFT JOIN TS_CB tab5
ON tab0.id_cb = tab5.id_cb

LEFT JOIN TS_TD tab6
ON tab0.id_ts_td = tab6.id


WHERE
tab0.Fecha_Proceso BETWEEN to_date($P{fecha_ini}, 'dd/mm/yyyy') AND to_date($P{fecha_fin}, 'dd/mm/yyyy')

$P!{whereTipoCredito}
$P!{wherePuntoVenta}
$P!{whereSecCredito}
$P!{whereExacto}
$P!{whereConceptoCredito}
$P!{whereBanco}
$P!{whereCuenta}
$P!{whereTipoDocumento}

ORDER BY id_credito]]>
	</queryString>
	<field name="ID_CREDITO" class="java.math.BigDecimal"/>
	<field name="ID_ANHOS" class="java.math.BigDecimal"/>
	<field name="ID_PUNTO_VENTA" class="java.math.BigDecimal"/>
	<field name="ID_TIPO_CREDITO" class="java.math.BigDecimal"/>
	<field name="SEC_CREDITO" class="java.math.BigDecimal"/>
	<field name="ID_CON_CREDITO" class="java.math.BigDecimal"/>
	<field name="FECHA_PROCESO" class="java.lang.String"/>
	<field name="ID_BN" class="java.math.BigDecimal"/>
	<field name="ID_CB" class="java.math.BigDecimal"/>
	<field name="NUM_DOC" class="java.math.BigDecimal"/>
	<field name="OFICINA" class="java.lang.String"/>
	<field name="VALOR" class="java.math.BigDecimal"/>
	<field name="OBSERVACIONES" class="java.lang.String"/>
	<field name="ESTADO" class="java.math.BigDecimal"/>
	<field name="FECHA_ANU" class="java.lang.String"/>
	<field name="MOTIVO_ANU" class="java.lang.String"/>
	<field name="FECHA" class="java.lang.String"/>
	<field name="ID_TS_TD" class="java.math.BigDecimal"/>
	<field name="NOMBRE_PV" class="java.lang.String"/>
	<field name="DESCRIPCION_PV" class="java.lang.String"/>
	<field name="DESCRIPCION_TC" class="java.lang.String"/>
	<field name="DESC_CORTA_TC" class="java.lang.String"/>
	<field name="DESCRIPCION_CC" class="java.lang.String"/>
	<field name="DESC_CORTA_CC" class="java.lang.String"/>
	<field name="CODIGO_BN" class="java.lang.String"/>
	<field name="DESCRIPCION_BN" class="java.lang.String"/>
	<field name="NUMERO_CUENTA" class="java.lang.String"/>
	<field name="DOCUMENTO" class="java.lang.String"/>
	<field name="DESCRIPCION_TD" class="java.lang.String"/>
	<background>
		<band splitType="Stretch"/>
	</background>
	<title>
		<band height="60" splitType="Stretch">
			<staticText>
				<reportElement x="176" y="0" width="428" height="40"/>
				<textElement textAlignment="Center" verticalAlignment="Bottom" markup="none">
					<font fontName="SansSerif" size="12" isBold="true"/>
				</textElement>
				<text><![CDATA[Sistema de Cartera y Facturación
Créditos]]></text>
			</staticText>
			<image>
				<reportElement x="0" y="10" width="140" height="40"/>
				<imageExpression class="java.lang.String"><![CDATA["repo:LogoEmpresa003.jpg"]]></imageExpression>
			</image>
			<textField>
				<reportElement x="176" y="40" width="428" height="20"/>
				<textElement textAlignment="Center" verticalAlignment="Middle" markup="none">
					<font fontName="SansSerif" size="12" isBold="true"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA["Periodo: "+$P{fecha_ini}+ " a "+$P{fecha_fin}]]></textFieldExpression>
			</textField>
			<staticText>
				<reportElement mode="Opaque" x="604" y="4" width="148" 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 mode="Opaque" x="604" y="28" width="148" 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[Punto de venta:]]></text>
			</staticText>
			<textField pattern="###0.00">
				<reportElement mode="Opaque" x="604" y="40" width="148" height="12" forecolor="#000000" backcolor="#FFFFFF"/>
				<box rightPadding="2"/>
				<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.lang.String"><![CDATA[$P{NomPuntoVenta}]]></textFieldExpression>
			</textField>
			<textField pattern="dd/MM/yyyy  hh:mm aaa">
				<reportElement x="604" y="16" width="148" height="12"/>
				<box rightPadding="3"/>
				<textElement textAlignment="Right" verticalAlignment="Middle">
					<font size="8"/>
				</textElement>
				<textFieldExpression class="java.util.Date"><![CDATA[new java.util.Date()]]></textFieldExpression>
			</textField>
		</band>
	</title>
	<pageHeader>
		<band height="20" splitType="Stretch"/>
	</pageHeader>
	<columnHeader>
		<band height="12" splitType="Stretch">
			<staticText>
				<reportElement mode="Opaque" x="0" y="0" width="48" height="12" backcolor="#88C2F9"/>
				<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">
					<font size="8" isBold="true"/>
				</textElement>
				<text><![CDATA[VIGENCIA]]></text>
			</staticText>
			<staticText>
				<reportElement mode="Opaque" x="48" y="0" width="60" height="12" backcolor="#88C2F9"/>
				<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">
					<font size="8" isBold="true"/>
				</textElement>
				<text><![CDATA[NÚM. SEC.]]></text>
			</staticText>
			<staticText>
				<reportElement mode="Opaque" x="108" y="0" width="68" height="12" backcolor="#88C2F9"/>
				<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">
					<font size="8" isBold="true"/>
				</textElement>
				<text><![CDATA[NÚMERO DOC.]]></text>
			</staticText>
			<staticText>
				<reportElement mode="Opaque" x="176" y="0" width="64" height="12" backcolor="#88C2F9"/>
				<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">
					<font size="8" isBold="true"/>
				</textElement>
				<text><![CDATA[FECHA PROC.]]></text>
			</staticText>
			<staticText>
				<reportElement mode="Opaque" x="240" y="0" width="73" height="12" backcolor="#88C2F9"/>
				<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">
					<font size="8" isBold="true"/>
				</textElement>
				<text><![CDATA[VALOR TOTAL]]></text>
			</staticText>
			<staticText>
				<reportElement mode="Opaque" x="313" y="0" width="119" height="12" backcolor="#88C2F9"/>
				<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">
					<font size="8" isBold="true"/>
				</textElement>
				<text><![CDATA[DESC. TIPO CRÉDITO]]></text>
			</staticText>
			<staticText>
				<reportElement mode="Opaque" x="432" y="0" width="272" height="12" backcolor="#88C2F9"/>
				<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">
					<font size="8" isBold="true"/>
				</textElement>
				<text><![CDATA[CONCEPTO CREDITO]]></text>
			</staticText>
			<staticText>
				<reportElement mode="Opaque" x="704" y="0" width="48" height="12" backcolor="#88C2F9"/>
				<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">
					<font size="8" isBold="true"/>
				</textElement>
				<text><![CDATA[ESTADO]]></text>
			</staticText>
		</band>
	</columnHeader>
	<detail>
		<band height="10" splitType="Stretch">
			<textField>
				<reportElement stretchType="RelativeToTallestObject" x="0" y="0" width="48" height="10"/>
				<box leftPadding="0" 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="Right" verticalAlignment="Middle">
					<font size="6"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{ID_ANHOS}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement stretchType="RelativeToTallestObject" x="48" y="0" width="60" height="10"/>
				<box leftPadding="0" rightPadding="3">
					<pen lineWidth="0.75"/>
					<topPen lineWidth="0.75"/>
					<leftPen lineWidth="0.75"/>
					<bottomPen lineWidth="0.75"/>
					<rightPen lineWidth="0.75"/>
				</box>
				<textElement textAlignment="Right" verticalAlignment="Middle">
					<font size="6"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{SEC_CREDITO}]]></textFieldExpression>
			</textField>
			<textField isBlankWhenNull="true">
				<reportElement stretchType="RelativeToTallestObject" x="108" y="0" width="68" height="10"/>
				<box leftPadding="0" rightPadding="3">
					<pen lineWidth="0.75"/>
					<topPen lineWidth="0.75"/>
					<leftPen lineWidth="0.75"/>
					<bottomPen lineWidth="0.75"/>
					<rightPen lineWidth="0.75"/>
				</box>
				<textElement textAlignment="Right" verticalAlignment="Middle">
					<font size="6"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{DOCUMENTO}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement stretchType="RelativeToTallestObject" x="176" y="0" width="64" height="10"/>
				<box leftPadding="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">
					<font size="6"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{FECHA_PROCESO}]]></textFieldExpression>
			</textField>
			<textField pattern="#,##0.00">
				<reportElement stretchType="RelativeToTallestObject" x="240" y="0" width="73" height="10"/>
				<box leftPadding="0" rightPadding="3">
					<pen lineWidth="0.75"/>
					<topPen lineWidth="0.75"/>
					<leftPen lineWidth="0.75"/>
					<bottomPen lineWidth="0.75"/>
					<rightPen lineWidth="0.75"/>
				</box>
				<textElement textAlignment="Right" verticalAlignment="Middle">
					<font size="6"/>
				</textElement>
				<textFieldExpression class="java.math.BigDecimal"><![CDATA[$F{VALOR}]]></textFieldExpression>
			</textField>
			<textField isStretchWithOverflow="true">
				<reportElement stretchType="RelativeToTallestObject" x="313" y="0" width="119" height="10"/>
				<box leftPadding="2">
					<pen lineWidth="0.75"/>
					<topPen lineWidth="0.75"/>
					<leftPen lineWidth="0.75"/>
					<bottomPen lineWidth="0.75"/>
					<rightPen lineWidth="0.75"/>
				</box>
				<textElement verticalAlignment="Middle">
					<font size="6"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{DESCRIPCION_TC}]]></textFieldExpression>
			</textField>
			<textField isStretchWithOverflow="true">
				<reportElement stretchType="RelativeToTallestObject" x="432" y="0" width="272" height="10"/>
				<box leftPadding="2">
					<pen lineWidth="0.75"/>
					<topPen lineWidth="0.75"/>
					<leftPen lineWidth="0.75"/>
					<bottomPen lineWidth="0.75"/>
					<rightPen lineWidth="0.75"/>
				</box>
				<textElement verticalAlignment="Middle">
					<font size="6"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{DESCRIPCION_CC}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement stretchType="RelativeToTallestObject" x="704" y="0" width="48" height="10"/>
				<box leftPadding="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">
					<font size="6"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[($F{ESTADO}==0 ? "Reversado" : "Activo" )]]></textFieldExpression>
			</textField>
		</band>
	</detail>
	<columnFooter>
		<band height="23" splitType="Stretch"/>
	</columnFooter>
	<pageFooter>
		<band height="24" splitType="Stretch">
			<textField>
				<reportElement mode="Opaque" x="299" y="12" width="89" height="12" forecolor="#575757" backcolor="#FFFFFF"/>
				<textElement textAlignment="Right" 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.lang.String"><![CDATA["Página "+$V{PAGE_NUMBER}+" de "]]></textFieldExpression>
			</textField>
			<textField evaluationTime="Report" pattern="" isBlankWhenNull="false">
				<reportElement mode="Opaque" x="389" y="12" width="60" height="12" forecolor="#575757" backcolor="#FFFFFF"/>
				<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.lang.String"><![CDATA[$V{PAGE_NUMBER}]]></textFieldExpression>
			</textField>
			<staticText>
				<reportElement mode="Opaque" x="299" y="0" width="150" height="12" forecolor="#575757"/>
				<textElement textAlignment="Center" verticalAlignment="Middle">
					<font size="6"/>
				</textElement>
				<text><![CDATA[Websafi - Cartera y Facturación]]></text>
			</staticText>
		</band>
	</pageFooter>
	<summary>
		<band height="25" splitType="Stretch"/>
	</summary>
	<noData>
		<band height="20">
			<staticText>
				<reportElement x="0" y="0" width="752" height="20"/>
				<textElement textAlignment="Center" verticalAlignment="Middle">
					<font isBold="true"/>
				</textElement>
				<text><![CDATA[No hay objetos a mostrar.]]></text>
			</staticText>
		</band>
	</noData>
</jasperReport>
