<?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="Cierre de Remesa" pageWidth="612" pageHeight="792" whenNoDataType="AllSectionsNoDetail" columnWidth="572" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" whenResourceMissingType="Empty">
<property name="ireport.zoom" value="1.098075000000002"/>
<property name="ireport.x" value="212"/>
<property name="ireport.y" value="0"/>
<parameter name="rutalogo" class="java.lang.String"/>
<parameter name="clavePersona" class="java.lang.String"/>
<parameter name="folioCuenta" class="java.lang.String">
<defaultValueExpression><![CDATA[]]></defaultValueExpression>
</parameter>
<parameter name="claveCuenta" class="java.lang.String">
<defaultValueExpression><![CDATA[]]></defaultValueExpression>
</parameter>
<parameter name="claveBodega" class="java.lang.String">
<defaultValueExpression><![CDATA[]]></defaultValueExpression>
</parameter>
<queryString>
<![CDATA[SELECT
adm_bodega.descripcion AS [bodega]
,CONVERT(VARCHAR(10), adm_movimientos_cuentas.fecha, 103) AS [fecha]
,CONVERT(VARCHAR(10), adm_movimientos_cuentas.vence_documento, 103) AS [fechaExp]
,adm_movimientos_cuentas.folio_documento AS [foliodocumento]
,ISNULL(adm_movimientos_cuentas.serie_documento,'') AS [seriedocumento]
,CASE adm_movimientos_cuentas.tipo_documento WHEN 9 THEN 'Comprobante Digital' ELSE 'Factura' END AS [tipodocumento]
,RTRIM(ISNULL(adm_movimientos_cuentas.nota,'')) AS [nota]
,RTRIM( ISNULL(CAST(adm_movimientos_cuentas_detalle.clave_articulo AS varchar), ISNULL(adm_movimientos_cuentas_detalle.descripcion,'') ) ) AS [articulo]
,adm_movimientos_cuentas_detalle.cantidad AS [cantidad]
,adm_movimientos_cuentas_detalle.contrato AS [contrato]
,ROUND(adm_movimientos_cuentas_detalle.importe-adm_movimientos_cuentas_detalle.iva,2) AS [unitario]
,ROUND(adm_movimientos_cuentas.iva,2) AS [iva]
FROM
adm_movimientos_cuentas
INNER JOIN adm_movimientos_cuentas_detalle
ON adm_movimientos_cuentas.folio_cuenta = adm_movimientos_cuentas_detalle.folio_cuenta
AND adm_movimientos_cuentas.clave_cuenta = adm_movimientos_cuentas_detalle.clave_cuenta
AND adm_movimientos_cuentas.bodega_registro = adm_movimientos_cuentas_detalle.clave_bodega
INNER JOIN adm_bodega ON adm_movimientos_cuentas.bodega_registro = adm_bodega.clave_bodega
WHERE
adm_movimientos_cuentas.clave_asignado_a = $P{clavePersona}
AND adm_movimientos_cuentas.folio_cuenta = $P{folioCuenta}
AND adm_movimientos_cuentas.clave_cuenta = $P{claveCuenta}
AND adm_movimientos_cuentas.bodega_registro = $P{claveBodega}]]>
</queryString>
<field name="bodega" class="java.lang.String"/>
<field name="fecha" class="java.lang.String"/>
<field name="fechaExp" class="java.lang.String"/>
<field name="foliodocumento" class="java.lang.Long"/>
<field name="seriedocumento" class="java.lang.String"/>
<field name="tipodocumento" class="java.lang.String"/>
<field name="nota" class="java.lang.String"/>
<field name="articulo" class="java.lang.String"/>
<field name="cantidad" class="java.lang.Integer"/>
<field name="contrato" class="java.lang.String"/>
<field name="unitario" class="java.math.BigDecimal"/>
<field name="iva" class="java.math.BigDecimal"/>
<variable name="totalContratos" class="java.lang.Integer" resetType="Page" calculation="Count">
<variableExpression><![CDATA[]]></variableExpression>
</variable>
<variable name="subtotal_1" class="java.lang.Double" calculation="Sum">
<variableExpression><![CDATA[$F{unitario}.doubleValue()]]></variableExpression>
</variable>
<variable name="iva_1" class="java.lang.Double">
<variableExpression><![CDATA[$F{iva}.doubleValue()]]></variableExpression>
</variable>
<background>
<band splitType="Stretch"/>
</background>
<title>
<band height="55" splitType="Stretch">
<textField>
<reportElement mode="Opaque" x="105" y="0" width="467" height="55" forecolor="#FFFF00" backcolor="#1818B4"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font fontName="Arial" size="20" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA["Factura"]]></textFieldExpression>
</textField>
<image scaleImage="FillFrame" hAlign="Center" vAlign="Middle">
<reportElement x="0" y="0" width="105" height="55"/>
<imageExpression><![CDATA[$P{rutalogo}]]></imageExpression>
</image>
</band>
</title>
<pageHeader>
<band height="135" splitType="Stretch">
<staticText>
<reportElement x="19" y="15" width="536" height="18"/>
<textElement verticalAlignment="Middle">
<font fontName="Arial" isBold="true" pdfFontName="" isPdfEmbedded="true"/>
</textElement>
<text><![CDATA[Datos De Factura]]></text>
</staticText>
<staticText>
<reportElement x="19" y="35" width="54" height="18"/>
<textElement verticalAlignment="Middle">
<font fontName="Arial" isBold="true"/>
</textElement>
<text><![CDATA[Folio:]]></text>
</staticText>
<staticText>
<reportElement x="331" y="35" width="54" height="18"/>
<textElement verticalAlignment="Middle">
<font fontName="Arial" isBold="true"/>
</textElement>
<text><![CDATA[Serie:]]></text>
</staticText>
<textField>
<reportElement x="385" y="35" width="170" height="18"/>
<box leftPadding="5">
<bottomPen lineWidth="1.0"/>
</box>
<textElement verticalAlignment="Middle">
<font fontName="Arial"/>
</textElement>
<textFieldExpression><![CDATA[$F{seriedocumento}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="73" y="35" width="136" height="18"/>
<box leftPadding="5">
<bottomPen lineWidth="1.0"/>
</box>
<textElement verticalAlignment="Middle">
<font fontName="Arial"/>
</textElement>
<textFieldExpression><![CDATA[$F{foliodocumento}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="19" y="55" width="54" height="18"/>
<textElement verticalAlignment="Middle">
<font fontName="Arial" isBold="true"/>
</textElement>
<text><![CDATA[Fecha:]]></text>
</staticText>
<textField>
<reportElement x="73" y="53" width="136" height="18"/>
<box leftPadding="5">
<bottomPen lineWidth="1.0"/>
</box>
<textElement verticalAlignment="Middle">
<font fontName="Arial"/>
</textElement>
<textFieldExpression><![CDATA[$F{fecha}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="331" y="55" width="54" height="18"/>
<textElement verticalAlignment="Middle">
<font fontName="Arial" isBold="true"/>
</textElement>
<text><![CDATA[Tipo:]]></text>
</staticText>
<textField>
<reportElement x="385" y="55" width="170" height="18"/>
<box leftPadding="5">
<bottomPen lineWidth="1.0"/>
</box>
<textElement verticalAlignment="Middle">
<font fontName="Arial"/>
</textElement>
<textFieldExpression><![CDATA[$F{tipodocumento}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="19" y="96" width="54" height="18"/>
<textElement verticalAlignment="Middle">
<font fontName="Arial" isBold="true"/>
</textElement>
<text><![CDATA[Bodega:]]></text>
</staticText>
<textField>
<reportElement x="73" y="96" width="482" height="18"/>
<box leftPadding="5">
<bottomPen lineWidth="1.0"/>
</box>
<textElement verticalAlignment="Middle">
<font fontName="Arial"/>
</textElement>
<textFieldExpression><![CDATA[$F{bodega}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="73" y="117" width="482" height="18"/>
<box leftPadding="5">
<bottomPen lineWidth="1.0"/>
</box>
<textElement verticalAlignment="Middle">
<font fontName="Arial"/>
</textElement>
<textFieldExpression><![CDATA[$F{nota}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="19" y="117" width="54" height="18"/>
<textElement verticalAlignment="Middle">
<font fontName="Arial" isBold="true"/>
</textElement>
<text><![CDATA[Nota:]]></text>
</staticText>
<textField pattern="" isBlankWhenNull="true">
<reportElement mode="Transparent" x="127" y="73" width="100" height="19" forecolor="#000000" backcolor="#FFFFFF"/>
<box leftPadding="5">
<bottomPen lineWidth="1.0"/>
</box>
<textElement textAlignment="Left" verticalAlignment="Middle" rotation="None" markup="none">
<font fontName="Arial" size="10" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/>
</textElement>
<textFieldExpression><![CDATA[$F{fechaExp}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="19" y="75" width="109" height="18"/>
<textElement verticalAlignment="Middle">
<font fontName="Arial" isBold="true"/>
</textElement>
<text><![CDATA[Fecha de expiración:]]></text>
</staticText>
</band>
</pageHeader>
<columnHeader>
<band height="20" splitType="Stretch">
<staticText>
<reportElement mode="Opaque" x="28" y="0" width="206" height="20" forecolor="#FFFFFF" backcolor="#1818B4"/>
<box>
<pen lineWidth="1.0" lineColor="#000000"/>
<topPen lineWidth="1.0" lineColor="#000000"/>
<leftPen lineWidth="1.0" lineColor="#000000"/>
<bottomPen lineWidth="1.0" lineColor="#000000"/>
<rightPen lineWidth="1.0" lineColor="#000000"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font fontName="Arial" isBold="true"/>
</textElement>
<text><![CDATA[Descripción:]]></text>
</staticText>
<staticText>
<reportElement mode="Opaque" x="234" y="0" width="60" height="20" forecolor="#FFFFFF" backcolor="#1818B4"/>
<box>
<pen lineWidth="1.0" lineColor="#000000"/>
<topPen lineWidth="1.0" lineColor="#000000"/>
<leftPen lineWidth="1.0" lineColor="#000000"/>
<bottomPen lineWidth="1.0" lineColor="#000000"/>
<rightPen lineWidth="1.0" lineColor="#000000"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font fontName="Arial" isBold="true"/>
</textElement>
<text><![CDATA[Cantidad]]></text>
</staticText>
<staticText>
<reportElement mode="Opaque" x="294" y="0" width="80" height="20" forecolor="#FFFFFF" backcolor="#1818B4"/>
<box>
<pen lineWidth="1.0" lineColor="#000000"/>
<topPen lineWidth="1.0" lineColor="#000000"/>
<leftPen lineWidth="1.0" lineColor="#000000"/>
<bottomPen lineWidth="1.0" lineColor="#000000"/>
<rightPen lineWidth="1.0" lineColor="#000000"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font fontName="Arial" isBold="true"/>
</textElement>
<text><![CDATA[Contrato]]></text>
</staticText>
<staticText>
<reportElement mode="Opaque" x="374" y="0" width="100" height="20" forecolor="#FFFFFF" backcolor="#1818B4"/>
<box>
<pen lineWidth="1.0" lineColor="#000000"/>
<topPen lineWidth="1.0" lineColor="#000000"/>
<leftPen lineWidth="1.0" lineColor="#000000"/>
<bottomPen lineWidth="1.0" lineColor="#000000"/>
<rightPen lineWidth="1.0" lineColor="#000000"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font fontName="Arial" isBold="true"/>
</textElement>
<text><![CDATA[Unitario]]></text>
</staticText>
<staticText>
<reportElement mode="Opaque" x="474" y="0" width="100" height="20" forecolor="#FFFFFF" backcolor="#1818B4"/>
<box>
<pen lineWidth="1.0" lineColor="#000000"/>
<topPen lineWidth="1.0" lineColor="#000000"/>
<leftPen lineWidth="1.0" lineColor="#000000"/>
<bottomPen lineWidth="1.0" lineColor="#000000"/>
<rightPen lineWidth="1.0" lineColor="#000000"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font fontName="Arial" isBold="true"/>
</textElement>
<text><![CDATA[Importe]]></text>
</staticText>
</band>
</columnHeader>
<detail>
<band height="18" splitType="Stretch">
<textField>
<reportElement x="28" y="0" width="206" height="18"/>
<box leftPadding="5" rightPadding="0">
<topPen lineWidth="1.0"/>
<leftPen lineWidth="1.0"/>
<bottomPen lineWidth="1.0"/>
<rightPen lineWidth="1.0"/>
</box>
<textElement textAlignment="Left" verticalAlignment="Middle">
<font fontName="Arial"/>
</textElement>
<textFieldExpression><![CDATA[$F{articulo}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="234" y="0" width="60" height="18"/>
<box rightPadding="0">
<topPen lineWidth="1.0"/>
<leftPen lineWidth="1.0"/>
<bottomPen lineWidth="1.0"/>
<rightPen lineWidth="1.0"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font fontName="Arial"/>
</textElement>
<textFieldExpression><![CDATA[$F{cantidad}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="294" y="0" width="80" height="18"/>
<box rightPadding="0">
<topPen lineWidth="1.0"/>
<leftPen lineWidth="1.0"/>
<bottomPen lineWidth="1.0"/>
<rightPen lineWidth="1.0"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font fontName="Arial"/>
</textElement>
<textFieldExpression><![CDATA[$F{contrato}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="374" y="0" width="100" height="18"/>
<box rightPadding="5">
<topPen lineWidth="1.0"/>
<leftPen lineWidth="1.0"/>
<bottomPen lineWidth="1.0"/>
<rightPen lineWidth="1.0"/>
</box>
<textElement textAlignment="Right" verticalAlignment="Middle">
<font fontName="Arial"/>
</textElement>
<textFieldExpression><![CDATA[new DecimalFormat("###,##0.00",
new DecimalFormatSymbols(
new Locale("es","MX")
)
).format( $F{unitario}.doubleValue() /$F{cantidad}.doubleValue())]]></textFieldExpression>
</textField>
<textField>
<reportElement x="474" y="0" width="100" height="18"/>
<box rightPadding="5">
<topPen lineWidth="1.0"/>
<leftPen lineWidth="1.0"/>
<bottomPen lineWidth="1.0"/>
<rightPen lineWidth="1.0"/>
</box>
<textElement textAlignment="Right" verticalAlignment="Middle">
<font fontName="Arial"/>
</textElement>
<textFieldExpression><![CDATA[new DecimalFormat("###,##0.00",
new DecimalFormatSymbols(
new Locale("es","MX")
)
).format( $F{unitario}.doubleValue())]]></textFieldExpression>
</textField>
<textField>
<reportElement x="0" y="0" width="28" height="18"/>
<box rightPadding="0">
<topPen lineWidth="1.0"/>
<leftPen lineWidth="1.0"/>
<bottomPen lineWidth="1.0"/>
<rightPen lineWidth="1.0"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font fontName="Arial"/>
</textElement>
<textFieldExpression><![CDATA[$V{REPORT_COUNT}]]></textFieldExpression>
</textField>
</band>
</detail>
<columnFooter>
<band height="16" splitType="Stretch"/>
</columnFooter>
<pageFooter>
<band height="49" splitType="Stretch">
<line>
<reportElement x="0" y="20" width="572" height="1"/>
</line>
<textField>
<reportElement x="7" y="1" width="387" height="20"/>
<textElement/>
<textFieldExpression><![CDATA["Documento generado el "
+new SimpleDateFormat("EEEEEEEEE, dd/MM/yyyy", new Locale("es","MX") ).format(new Date())]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="5" y="21" width="567" height="20"/>
<textElement/>
<text><![CDATA[Códice. Av. Ventura Puente 846 Col. Ventura Puente Morelia C.P. 58020 Michoacán, México]]></text>
</staticText>
<textField>
<reportElement x="399" y="0" width="126" height="20"/>
<textElement textAlignment="Right"/>
<textFieldExpression><![CDATA["Página "+$V{PAGE_NUMBER}+" de"]]></textFieldExpression>
</textField>
<textField evaluationTime="Report">
<reportElement x="525" y="0" width="40" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[" " + $V{PAGE_NUMBER}]]></textFieldExpression>
</textField>
</band>
</pageFooter>
<summary>
<band height="60" splitType="Stretch">
<textField>
<reportElement x="399" y="0" width="75" height="20"/>
<textElement textAlignment="Right" verticalAlignment="Middle"/>
<textFieldExpression><![CDATA["Subtotal: "]]></textFieldExpression>
</textField>
<textField>
<reportElement x="399" y="20" width="75" height="20"/>
<textElement textAlignment="Right" verticalAlignment="Middle"/>
<textFieldExpression><![CDATA["I.V.A.: "]]></textFieldExpression>
</textField>
<textField>
<reportElement x="474" y="1" width="98" height="19"/>
<box rightPadding="5"/>
<textElement textAlignment="Right" verticalAlignment="Middle">
<font fontName="Arial"/>
</textElement>
<textFieldExpression><![CDATA[new DecimalFormat("###,##0.00",
new DecimalFormatSymbols(
new Locale("es","MX")
)
).format( $V{subtotal_1}.doubleValue() )]]></textFieldExpression>
</textField>
<textField>
<reportElement x="399" y="40" width="75" height="20"/>
<textElement textAlignment="Right" verticalAlignment="Middle"/>
<textFieldExpression><![CDATA["Total: "]]></textFieldExpression>
</textField>
<textField>
<reportElement x="474" y="20" width="98" height="20"/>
<box rightPadding="5"/>
<textElement textAlignment="Right" verticalAlignment="Middle">
<font fontName="Arial"/>
</textElement>
<textFieldExpression><![CDATA[new DecimalFormat("###,##0.00",
new DecimalFormatSymbols(
new Locale("es","MX")
)
).format( $V{iva_1}.doubleValue() )]]></textFieldExpression>
</textField>
<textField>
<reportElement x="474" y="40" width="98" height="20"/>
<box rightPadding="5"/>
<textElement textAlignment="Right" verticalAlignment="Middle">
<font fontName="Arial"/>
</textElement>
<textFieldExpression><![CDATA[new DecimalFormat("###,##0.00",
new DecimalFormatSymbols(
new Locale("es","MX")
)
).format( $V{iva_1}.doubleValue() + $V{subtotal_1}.doubleValue() )]]></textFieldExpression>
</textField>
</band>
</summary>
</jasperReport>