<?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="comprobante_movimiento_bancario" language="groovy" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20">
	<property name="ireport.zoom" value="2.0"/>
	<property name="ireport.x" value="0"/>
	<property name="ireport.y" value="88"/>
	<parameter name="id_movimiento" class="java.math.BigDecimal">
		<defaultValueExpression><![CDATA[0]]></defaultValueExpression>
	</parameter>
	<queryString>
		<![CDATA[SELECT
  NUMERO_A_TEXTO(mv.VALOR,2) as VALOR_text,
  mv.ID as no_movimiento,
  mv.OBSERVACIONES,
  mv.USUARIOLOG,
  mv.VALOR,
  mv.FECHA,
  mv.FECHA_PROC,
  mv.OFICINA,
  bn.DESCRIPCION as banco,
  cb.NUMERO_CUENTA as cuenta,
  mb.DESCRIPCION as descripcion_mb,
  td.DESCRIPCION as descripcion_td,
  ter.RAZON_SOC as razon_social,
  ter.NUM_DOC as no_documento,
  ti.ABREVIATURA as tipo_doc,
  rm.DESCRIPCION as mineral
FROM ts_mov_banc mv
JOIN TS_BN bn ON bn.ID_BN = mv.ID_TS_BN
JOIN TS_CB cb ON cb.ID_CB = mv.ID_TS_CB
JOIN TS_MB mb ON mb.ID = mv.ID_TS_MB
JOIN TS_TD td ON td.ID = mv.ID_TS_TD
JOIN INTERCEROS_V ter ON ter.ID_MAE_TER = mv.ID_MAE_TER
JOIN TIPO_IDENTIFICACION ti ON ti.ID_TIPO_IDENTIFICACION = ter.ID_TIPO_DOC
JOIN RE_MINERAL rm on rm.ID_MINERAL = mv.ID_MINERAL_CB
where mv.id = $P{id_movimiento}]]>
	</queryString>
	<field name="VALOR_TEXT" class="java.lang.String"/>
	<field name="NO_MOVIMIENTO" class="java.math.BigDecimal"/>
	<field name="OBSERVACIONES" class="java.lang.String"/>
	<field name="USUARIOLOG" class="java.lang.String"/>
	<field name="VALOR" class="java.math.BigDecimal"/>
	<field name="FECHA" class="java.util.Date"/>
	<field name="FECHA_PROC" class="java.sql.Timestamp"/>
	<field name="OFICINA" class="java.lang.String"/>
	<field name="BANCO" class="java.lang.String"/>
	<field name="CUENTA" class="java.lang.String"/>
	<field name="DESCRIPCION_MB" class="java.lang.String"/>
	<field name="DESCRIPCION_TD" class="java.lang.String"/>
	<field name="RAZON_SOCIAL" class="java.lang.String"/>
	<field name="NO_DOCUMENTO" class="java.lang.String"/>
	<field name="TIPO_DOC" class="java.lang.String"/>
	<field name="MINERAL" class="java.lang.String"/>
	<variable name="TOTAL_VALOR" class="java.math.BigDecimal" calculation="Sum">
		<variableExpression><![CDATA[$F{VALOR}]]></variableExpression>
		<initialValueExpression><![CDATA[]]></initialValueExpression>
	</variable>
	<background>
		<band splitType="Stretch"/>
	</background>
	<title>
		<band height="91" splitType="Stretch">
			<staticText>
				<reportElement x="193" y="36" width="171" height="37"/>
				<textElement textAlignment="Center">
					<font size="12" isBold="true"/>
				</textElement>
				<text><![CDATA[COMPROBANTE MOVIMIENTO BANCARIO]]></text>
			</staticText>
			<staticText>
				<reportElement x="442" y="10" width="113" height="14"/>
				<textElement>
					<font size="8" isBold="true"/>
				</textElement>
				<text><![CDATA[Fecha Impresión:]]></text>
			</staticText>
			<textField>
				<reportElement x="442" y="51" width="113" height="15"/>
				<textElement>
					<font size="8"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{USUARIOLOG}]]></textFieldExpression>
			</textField>
			<staticText>
				<reportElement x="442" y="36" width="113" height="15"/>
				<textElement>
					<font isBold="true"/>
				</textElement>
				<text><![CDATA[Usuario: ]]></text>
			</staticText>
			<textField>
				<reportElement x="442" y="24" width="113" height="12"/>
				<textElement>
					<font size="8"/>
				</textElement>
				<textFieldExpression class="java.util.Date"><![CDATA[new java.util.Date()]]></textFieldExpression>
			</textField>
			<image>
				<reportElement x="13" y="10" width="95" height="26"/>
				<imageExpression class="java.lang.String"><![CDATA["repo:LogoEmpresa003.jpg"]]></imageExpression>
			</image>
		</band>
	</title>
	<pageHeader>
		<band height="97" splitType="Stretch">
			<staticText>
				<reportElement mode="Opaque" x="13" y="22" width="59" height="12" backcolor="#C0C0C0"/>
				<textElement textAlignment="Left">
					<font size="9" isBold="true"/>
				</textElement>
				<text><![CDATA[EMISOR: ]]></text>
			</staticText>
			<staticText>
				<reportElement mode="Opaque" x="303" y="22" width="102" height="12" backcolor="#C0C0C0"/>
				<textElement textAlignment="Left">
					<font size="9" isBold="true"/>
				</textElement>
				<text><![CDATA[BANCO: ]]></text>
			</staticText>
			<staticText>
				<reportElement mode="Opaque" x="13" y="58" width="59" height="12" backcolor="#E8E8E8"/>
				<textElement textAlignment="Left">
					<font size="9" isBold="true"/>
				</textElement>
				<text><![CDATA[FECHA: ]]></text>
			</staticText>
			<staticText>
				<reportElement mode="Opaque" x="303" y="46" width="102" height="12" backcolor="#C0C0C0"/>
				<textElement textAlignment="Left">
					<font size="9" isBold="true"/>
				</textElement>
				<text><![CDATA[MOVIMIENTO N°: ]]></text>
			</staticText>
			<textField>
				<reportElement mode="Opaque" x="405" y="22" width="138" height="12" backcolor="#C0C0C0"/>
				<textElement/>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{BANCO}]]></textFieldExpression>
			</textField>
			<staticText>
				<reportElement mode="Opaque" x="303" y="34" width="102" height="12" backcolor="#E8E8E8"/>
				<textElement textAlignment="Left">
					<font size="9" isBold="true"/>
				</textElement>
				<text><![CDATA[CUENTA: ]]></text>
			</staticText>
			<textField>
				<reportElement mode="Opaque" x="72" y="22" width="216" height="12" backcolor="#C0C0C0"/>
				<textElement/>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{RAZON_SOCIAL}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement mode="Opaque" x="13" y="34" width="59" height="12" backcolor="#E8E8E8"/>
				<textElement textAlignment="Left">
					<font isBold="true"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{TIPO_DOC} + ": "]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement mode="Opaque" x="72" y="34" width="216" height="12" backcolor="#E8E8E8"/>
				<textElement/>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{NO_DOCUMENTO}]]></textFieldExpression>
			</textField>
			<textField pattern="dd-MMM-yy">
				<reportElement mode="Opaque" x="72" y="58" width="216" height="12" backcolor="#E8E8E8"/>
				<textElement>
					<font isBold="false"/>
				</textElement>
				<textFieldExpression class="java.util.Date"><![CDATA[$F{FECHA_PROC}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement mode="Opaque" x="405" y="34" width="138" height="12" backcolor="#E8E8E8"/>
				<textElement/>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{CUENTA}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement mode="Opaque" x="405" y="46" width="138" height="12" backcolor="#C0C0C0"/>
				<textElement/>
				<textFieldExpression class="java.math.BigDecimal"><![CDATA[$F{NO_MOVIMIENTO}]]></textFieldExpression>
			</textField>
			<staticText>
				<reportElement mode="Opaque" x="13" y="46" width="59" height="12" backcolor="#C0C0C0"/>
				<textElement textAlignment="Left">
					<font size="9" isBold="true"/>
				</textElement>
				<text><![CDATA[MINERAL: ]]></text>
			</staticText>
			<textField>
				<reportElement mode="Opaque" x="72" y="46" width="216" height="12" backcolor="#C0C0C0"/>
				<textElement/>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{MINERAL}]]></textFieldExpression>
			</textField>
		</band>
	</pageHeader>
	<columnHeader>
		<band height="26" splitType="Stretch">
			<staticText>
				<reportElement mode="Opaque" x="164" y="14" width="298" height="12" backcolor="#C0C0C0"/>
				<box>
					<pen lineWidth="0.5"/>
					<topPen lineWidth="0.5"/>
					<leftPen lineWidth="0.5"/>
					<bottomPen lineWidth="0.5"/>
					<rightPen lineWidth="0.5"/>
				</box>
				<textElement textAlignment="Center" verticalAlignment="Middle">
					<font isBold="true"/>
				</textElement>
				<text><![CDATA[DESCRIPCIÓN]]></text>
			</staticText>
			<staticText>
				<reportElement mode="Opaque" x="462" y="14" width="93" height="12" backcolor="#C0C0C0"/>
				<box>
					<pen lineWidth="0.5"/>
					<topPen lineWidth="0.5"/>
					<leftPen lineWidth="0.5"/>
					<bottomPen lineWidth="0.5"/>
					<rightPen lineWidth="0.5"/>
				</box>
				<textElement textAlignment="Center" verticalAlignment="Middle">
					<font isBold="true"/>
				</textElement>
				<text><![CDATA[VALOR]]></text>
			</staticText>
			<staticText>
				<reportElement mode="Opaque" x="0" y="14" width="164" height="12" backcolor="#C0C0C0"/>
				<box>
					<pen lineWidth="0.5"/>
					<topPen lineWidth="0.5"/>
					<leftPen lineWidth="0.5"/>
					<bottomPen lineWidth="0.5"/>
					<rightPen lineWidth="0.5"/>
				</box>
				<textElement textAlignment="Center" verticalAlignment="Middle">
					<font isBold="true" isUnderline="false"/>
				</textElement>
				<text><![CDATA[CONCEPTO]]></text>
			</staticText>
		</band>
	</columnHeader>
	<detail>
		<band height="50">
			<textField>
				<reportElement x="164" y="0" width="298" height="50"/>
				<box leftPadding="2">
					<pen lineWidth="0.5"/>
					<topPen lineWidth="0.5"/>
					<leftPen lineWidth="0.5"/>
					<bottomPen lineWidth="0.5"/>
					<rightPen lineWidth="0.5"/>
				</box>
				<textElement verticalAlignment="Middle"/>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{DESCRIPCION_MB} + "(+) " + $F{OBSERVACIONES}]]></textFieldExpression>
			</textField>
			<textField pattern="#,##0.00">
				<reportElement x="462" y="0" width="93" height="50"/>
				<box>
					<pen lineWidth="0.5"/>
					<topPen lineWidth="0.5"/>
					<leftPen lineWidth="0.5"/>
					<bottomPen lineWidth="0.5"/>
					<rightPen lineWidth="0.5"/>
				</box>
				<textElement textAlignment="Right" verticalAlignment="Middle"/>
				<textFieldExpression class="java.math.BigDecimal"><![CDATA[$F{VALOR}]]></textFieldExpression>
			</textField>
			<textField pattern="">
				<reportElement x="0" y="0" width="164" height="50"/>
				<box leftPadding="2">
					<pen lineWidth="0.5"/>
					<topPen lineWidth="0.5"/>
					<leftPen lineWidth="0.5"/>
					<bottomPen lineWidth="0.5"/>
					<rightPen lineWidth="0.5"/>
				</box>
				<textElement verticalAlignment="Middle"/>
				<textFieldExpression class="java.lang.String"><![CDATA["DOCUMENTO:" + $F{DESCRIPCION_TD} + " FECHA:" + $F{FECHA}]]></textFieldExpression>
			</textField>
		</band>
	</detail>
	<pageFooter>
		<band height="50">
			<staticText>
				<reportElement mode="Opaque" x="217" y="15" width="126" height="12" forecolor="#575757"/>
				<textElement textAlignment="Center" verticalAlignment="Middle">
					<font size="6"/>
				</textElement>
				<text><![CDATA[Websafi - Tesoreria]]></text>
			</staticText>
			<textField evaluationTime="Report" pattern="" isBlankWhenNull="false">
				<reportElement mode="Opaque" x="295" y="27" width="36" 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>
			<textField>
				<reportElement mode="Opaque" x="227" y="27" width="68" 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>
		</band>
	</pageFooter>
	<summary>
		<band height="50">
			<textField pattern="#,##0.00" isBlankWhenNull="true">
				<reportElement mode="Opaque" x="462" y="0" width="93" height="34" backcolor="#E8E8E8"/>
				<box>
					<pen lineWidth="0.5"/>
					<topPen lineWidth="0.5"/>
					<leftPen lineWidth="0.5"/>
					<bottomPen lineWidth="0.5"/>
					<rightPen lineWidth="0.5"/>
				</box>
				<textElement textAlignment="Right" verticalAlignment="Middle"/>
				<textFieldExpression class="java.math.BigDecimal"><![CDATA[$V{TOTAL_VALOR}]]></textFieldExpression>
			</textField>
			<staticText>
				<reportElement mode="Opaque" x="0" y="0" width="164" height="34" backcolor="#E8E8E8"/>
				<box>
					<pen lineWidth="0.5"/>
					<topPen lineWidth="0.5"/>
					<leftPen lineWidth="0.5"/>
					<bottomPen lineWidth="0.5"/>
					<rightPen lineWidth="0.5"/>
				</box>
				<textElement textAlignment="Center" verticalAlignment="Middle">
					<font isBold="true"/>
				</textElement>
				<text><![CDATA[TOTAL]]></text>
			</staticText>
			<textField>
				<reportElement mode="Opaque" x="164" y="0" width="298" height="34" backcolor="#E8E8E8"/>
				<box leftPadding="2">
					<pen lineWidth="0.5"/>
					<topPen lineWidth="0.5"/>
					<leftPen lineWidth="0.5"/>
					<bottomPen lineWidth="0.5"/>
					<rightPen lineWidth="0.5"/>
				</box>
				<textElement verticalAlignment="Middle"/>
				<textFieldExpression class="java.lang.String"><![CDATA["La suma de " + $F{VALOR_TEXT} + "pesos."]]></textFieldExpression>
			</textField>
		</band>
	</summary>
</jasperReport>
