<?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="pdf_factura_pago" language="groovy" pageWidth="502" pageHeight="600" orientation="Landscape" columnWidth="502" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0">
	<property name="ireport.zoom" value="2.0"/>
	<property name="ireport.x" value="0"/>
	<property name="ireport.y" value="0"/>
	<property name="ireport.jasperserver.reportUnit" value="/reports/cartera/pdf_factura"/>
	<property name="ireport.jasperserver.url" value="http://192.168.2.43:8090/jasperserver/services/repository"/>
	<parameter name="id_factura" class="java.math.BigDecimal">
		<defaultValueExpression><![CDATA[]]></defaultValueExpression>
	</parameter>
	<parameter name="cambio" class="java.math.BigDecimal"/>
	<queryString>
		<![CDATA[select tab0.valor, tab1.descripcion AS TIPO,
tab2.numero_cuenta, tab3.descripcion,
to_char(tab0.fecha_doc,'dd-mm-yyyy') AS FECHA, tab0.oficina,
tab0.num_doc

from ca_factura_pago tab0
left join ts_pc_fp tab1 ON tab1.id = tab0.id_ts_pc_fp
left join ts_cb tab2 ON tab2.id_cb = tab0.id_cb
left join ts_bn tab3 ON tab3.id_bn = tab0.id_bn

where tab0.id_factura = $P{id_factura}]]>
	</queryString>
	<field name="VALOR" class="java.math.BigDecimal"/>
	<field name="TIPO" class="java.lang.String"/>
	<field name="NUMERO_CUENTA" class="java.lang.String"/>
	<field name="DESCRIPCION" class="java.lang.String"/>
	<field name="FECHA" class="java.lang.String"/>
	<field name="OFICINA" class="java.lang.String"/>
	<field name="NUM_DOC" class="java.lang.String"/>
	<background>
		<band splitType="Stretch"/>
	</background>
	<detail>
		<band height="23" splitType="Stretch">
			<textField pattern="" isBlankWhenNull="false">
				<reportElement mode="Transparent" x="0" y="0" width="141" height="10" forecolor="#000000" backcolor="#FFFFFF"/>
				<box leftPadding="2"/>
				<textElement textAlignment="Left" 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[$F{TIPO}]]></textFieldExpression>
			</textField>
			<textField pattern="#,##0.00" isBlankWhenNull="false">
				<reportElement mode="Transparent" x="390" y="0" width="112" height="10" 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.math.BigDecimal"><![CDATA[$F{VALOR}]]></textFieldExpression>
			</textField>
			<textField pattern="" isBlankWhenNull="true">
				<reportElement mode="Transparent" x="141" y="0" width="119" height="10" isRemoveLineWhenBlank="true" forecolor="#000000" backcolor="#FFFFFF">
					<printWhenExpression><![CDATA[$F{NUM_DOC}!=null]]></printWhenExpression>
				</reportElement>
				<box leftPadding="2"/>
				<textElement 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["Num: "+ $F{NUM_DOC}]]></textFieldExpression>
			</textField>
			<textField isBlankWhenNull="true">
				<reportElement x="260" y="0" width="130" height="10" isRemoveLineWhenBlank="true">
					<printWhenExpression><![CDATA[$F{NUM_DOC}!=null]]></printWhenExpression>
				</reportElement>
				<box leftPadding="2" rightPadding="0"/>
				<textElement verticalAlignment="Middle">
					<font size="8"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA["Fecha: "+$F{FECHA}]]></textFieldExpression>
			</textField>
			<textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true">
				<reportElement mode="Transparent" x="0" y="10" width="141" height="10" isRemoveLineWhenBlank="true" forecolor="#000000" backcolor="#FFFFFF">
					<printWhenExpression><![CDATA[$F{NUM_DOC}!=null]]></printWhenExpression>
				</reportElement>
				<box leftPadding="2"/>
				<textElement 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["Oficina: " + $F{OFICINA}]]></textFieldExpression>
			</textField>
			<textField pattern="" isBlankWhenNull="true">
				<reportElement mode="Transparent" x="141" y="10" width="119" height="10" isRemoveLineWhenBlank="true" forecolor="#000000" backcolor="#FFFFFF">
					<printWhenExpression><![CDATA[$F{NUM_DOC}!=null]]></printWhenExpression>
				</reportElement>
				<box leftPadding="2" rightPadding="0"/>
				<textElement 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["Cuenta: "+$F{NUMERO_CUENTA}]]></textFieldExpression>
			</textField>
			<textField pattern="" isBlankWhenNull="true">
				<reportElement mode="Transparent" x="260" y="10" width="242" height="10" isRemoveLineWhenBlank="true" forecolor="#000000" backcolor="#FFFFFF">
					<printWhenExpression><![CDATA[$F{NUM_DOC}!=null]]></printWhenExpression>
				</reportElement>
				<box leftPadding="2"/>
				<textElement textAlignment="Left" 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["Banco : "+$F{DESCRIPCION}]]></textFieldExpression>
			</textField>
		</band>
	</detail>
	<columnFooter>
		<band splitType="Stretch"/>
	</columnFooter>
	<pageFooter>
		<band splitType="Stretch"/>
	</pageFooter>
	<summary>
		<band height="28" splitType="Stretch">
			<staticText>
				<reportElement x="0" y="13" width="390" height="13"/>
				<box leftPadding="2"/>
				<textElement>
					<font size="8" isBold="true"/>
				</textElement>
				<text><![CDATA[Cambio : ]]></text>
			</staticText>
			<textField pattern="#,##0.00" isBlankWhenNull="false">
				<reportElement mode="Transparent" x="390" y="13" width="112" height="13" forecolor="#000000" backcolor="#FFFFFF"/>
				<box rightPadding="2"/>
				<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>
				<textFieldExpression class="java.math.BigDecimal"><![CDATA[$P{cambio}]]></textFieldExpression>
			</textField>
		</band>
	</summary>
</jasperReport>
