wilian 2016-04-20 18:12:03 +00:00
parent 4bc642877e
commit cbda3639d9
8 changed files with 280 additions and 268 deletions

View File

@ -1,13 +1,10 @@
package com.rjconsultores.ventaboletos.relatorios.impl; package com.rjconsultores.ventaboletos.relatorios.impl;
import java.math.BigDecimal;
import java.sql.Connection; import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet; import java.sql.ResultSet;
import java.sql.SQLException; import java.sql.SQLException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -18,7 +15,7 @@ import com.rjconsultores.ventaboletos.relatorios.utilitarios.DataSource;
import com.rjconsultores.ventaboletos.relatorios.utilitarios.Relatorio; import com.rjconsultores.ventaboletos.relatorios.utilitarios.Relatorio;
import com.rjconsultores.ventaboletos.utilerias.DateUtil; import com.rjconsultores.ventaboletos.utilerias.DateUtil;
import com.rjconsultores.ventaboletos.vo.impressaofiscal.ItemRelatorioVoucher; import com.rjconsultores.ventaboletos.vo.impressaofiscal.ItemRelatorioVoucher;
import com.rjconsultores.ventaboletos.vo.impressaofiscal.TotalRelatorioVoucher; import com.rjconsultores.ventaboletos.web.utilerias.NamedParameterStatement;
import net.sf.jasperreports.engine.data.JRBeanCollectionDataSource; import net.sf.jasperreports.engine.data.JRBeanCollectionDataSource;
@ -57,82 +54,120 @@ public class RelatorioAnaliticoVoucher extends Relatorio {
inicio = DateUtil.inicioFecha(inicio); inicio = DateUtil.inicioFecha(inicio);
fim = DateUtil.fimFecha(fim); fim = DateUtil.fimFecha(fim);
StringBuilder sql = new StringBuilder(); NamedParameterStatement stmt = new NamedParameterStatement(getConexao(), getSql());
sql.append("select ");
sql.append(" TO_CHAR(b.fechorventa, 'dd-MM-yyyy') as dataVendaVoucher, ");
sql.append(" TO_CHAR(impres.fechorventa, 'dd-MM-yyyy') as dataEmissao, ");
sql.append(" e.nombempresa as empresa, ");
sql.append(" fr4.coo as numDocFiscal, ");
sql.append(" coalesce(b.numfoliosistema, impres.numfoliosistema) as bilhete, ");
sql.append(" b.boleto_id as boletoVoucher, ");
sql.append(" impres.boleto_id as boletoImpresso, ");
sql.append(" tv.desctipoventa as tipoVenda, ");
sql.append(" case when b.motivocancelacion_id in (31, 32) then b.preciopagado * -1 else b.preciopagado end as tarifa, ");
sql.append(" case when b.motivocancelacion_id in (31, 32) then b.importepedagio * -1 else b.importepedagio end as pedagio, ");
sql.append(" case when b.motivocancelacion_id in (31, 32) then b.importetaxaembarque * -1 else b.importetaxaembarque end as embarque, ");
sql.append(" case when b.motivocancelacion_id in (31, 32) then b.importeseguro * -1 else b.importeseguro end as seguro, ");
sql.append(" case when mc.descmotivo is null then 'VOUCHER' else mc.descmotivo end as status ");
sql.append(" from boleto b ");
sql.append(" join empresa e on b.marca_id = e.empresa_id ");
sql.append(" left join boleto impres on b.boleto_id = impres.boletooriginal_id ");
sql.append(" left join fiscal_r4 fr4 on impres.boleto_id = fr4.boleto_id ");
sql.append(" left join tipo_venta tv on tv.tipoventa_id = coalesce(b.tipoventa_id, impres.tipoventa_id) ");
sql.append(" left join motivo_cancelacion mc on mc.motivocancelacion_id = coalesce(b.motivocancelacion_id, impres.motivocancelacion_id) ");
sql.append(" where b.tipoventa_id in (5,12,18) ");
sql.append(" and b.fechorventa between ? and ? ");
sql.append(" and b.marca_id = ? ");
sql.append(" order by dataVendaVoucher, dataEmissao desc ");
PreparedStatement stmt = getConexao().prepareStatement(sql.toString()); stmt.setTimestamp("dataInicial", new java.sql.Timestamp(inicio.getTime()));
stmt.setTimestamp(1, new java.sql.Timestamp(inicio.getTime())); stmt.setTimestamp("dataFinal", new java.sql.Timestamp(fim.getTime()));
stmt.setTimestamp(2, new java.sql.Timestamp(fim.getTime())); stmt.setInt("empresaId", empresaId);
stmt.setInt(3, empresaId);
ResultSet rset = stmt.executeQuery(); ResultSet rset = stmt.executeQuery();
List<ItemRelatorioVoucher> list = new ArrayList<ItemRelatorioVoucher>(); List<ItemRelatorioVoucher> list = new ArrayList<ItemRelatorioVoucher>();
Map<String, TotalRelatorioVoucher> totais = new HashMap<String, TotalRelatorioVoucher>();
while (rset.next()) { while (rset.next()) {
ItemRelatorioVoucher item = new ItemRelatorioVoucher(); ItemRelatorioVoucher item = new ItemRelatorioVoucher();
item.setDataVendaVoucher(rset.getString("dataVendaVoucher")); item.setSituacao(rset.getString("SITUACAO"));
item.setDataEmissao(rset.getString("dataEmissao")); item.setCompetenciaEntrega(rset.getString("COMPETENCIA_ENTREGA"));
item.setEmpresa(rset.getString("empresa")); item.setCompetenciaVenda(rset.getString("COMPETENCIA_VENDA"));
item.setNumDocFiscal(rset.getString("numDocFiscal")); item.setTarifa(rset.getBigDecimal("TARIFA"));
item.setBilhete(rset.getString("bilhete")); item.setPedagio(rset.getBigDecimal("PEDAGIO"));
item.setBoletoVoucher(rset.getLong("boletoVoucher")); item.setEmbarque(rset.getBigDecimal("TAXA_EMBARQUE"));
item.setBoletoImpresso(rset.getLong("boletoImpresso")); item.setSeguro(rset.getBigDecimal("SEGURO"));
item.setTipoVenda(rset.getString("tipoVenda")); item.setQtde(rset.getInt("QTDE"));
item.setTarifa(rset.getBigDecimal("tarifa"));
item.setPedagio(rset.getBigDecimal("pedagio"));
item.setEmbarque(rset.getBigDecimal("embarque"));
item.setSeguro(rset.getBigDecimal("seguro"));
item.setStatus(rset.getString("status"));
TotalRelatorioVoucher total = null;
if(totais.containsKey(item.getStatus())) {
total = totais.get(item.getStatus());
} else {
total = new TotalRelatorioVoucher();
}
total.setStatus(item.getStatus());
total.setTarifa(total.getTarifa().add(item.getTarifa().intValue() < 0 ? item.getTarifa().multiply(new BigDecimal(-1)) : item.getTarifa()));
total.setPedagio(total.getPedagio().add(item.getPedagio().intValue() < 0 ? item.getPedagio().multiply(new BigDecimal(-1)) : item.getPedagio()));
total.setEmbarque(total.getEmbarque().add(item.getEmbarque().intValue() < 0 ? item.getEmbarque().multiply(new BigDecimal(-1)) : item.getEmbarque()));
total.setSeguro(total.getSeguro().add(item.getSeguro().intValue() < 0 ? item.getSeguro().multiply(new BigDecimal(-1)) : item.getSeguro()));
totais.put(item.getStatus(), total);
list.add(item); list.add(item);
} }
parametros.put("totais", totais.values());
if (!getConexao().isClosed()) if (!getConexao().isClosed())
getConexao().close(); getConexao().close();
return list; return list;
} }
private String getSql() {
StringBuilder sQuery = new StringBuilder();
/* VENDIDO E IMPRESSO NA MESMA COMPETENCIA */
sQuery.append("SELECT 'VENDIDO E ENTREGUE MESMA COMPETÊNCIA' AS SITUACAO, ")
.append("TO_CHAR(BE.FECHORVENTA,'MM/YYYY') AS COMPETENCIA_ENTREGA, ")
.append("TO_CHAR(B.FECHORVENTA,'MM/YYYY') AS COMPETENCIA_VENDA, ")
.append("SUM(B.PRECIOPAGADO) AS TARIFA, ")
.append("SUM(B.IMPORTEPEDAGIO) AS PEDAGIO, ")
.append("SUM(B.IMPORTESEGURO) AS SEGURO, ")
.append("SUM(B.IMPORTETAXAEMBARQUE) AS TAXA_EMBARQUE, ")
.append("COUNT(B.BOLETO_ID) AS QTDE ")
.append("FROM BOLETO B ")
.append("JOIN BOLETO BE ON B.BOLETO_ID = BE.BOLETOORIGINAL_ID ")
.append(" AND BE.FECHORVENTA BETWEEN :dataInicial AND :dataFinal ")
.append("JOIN FISCAL_R4 R4 ON BE.BOLETO_ID = R4.BOLETO_ID ")
.append("WHERE B.TIPOVENTA_ID IN (5,12,18) ")
.append("AND B.FECHORVENTA BETWEEN :dataInicial AND :dataFinal ")
.append("AND B.EMPRESACORRIDA_ID = :empresaId ")
.append("AND B.INDSTATUSBOLETO = 'V' ")
.append("AND B.MOTIVOCANCELACION_ID = 16 ")
.append("AND BE.INDSTATUSBOLETO = 'E' ")
.append("AND TO_CHAR(B.FECHORVENTA,'MM/YYYY') = TO_CHAR(BE.FECHORVENTA,'MM/YYYY') ")
.append("GROUP BY 'VENDIDO E ENTREGUE MESMA COMPETÊNCIA', ")
.append(" TO_CHAR(B.FECHORVENTA,'MM/YYYY'), ")
.append(" TO_CHAR(BE.FECHORVENTA,'MM/YYYY') ");
sQuery.append("UNION ");
/*VENDIDO EM COMPETÊNCIA ANTERIOR*/
sQuery.append("SELECT 'VENDIDO EM COMPETÊNCIA ANTERIOR' AS SITUACAO, ")
.append("TO_CHAR(BE.FECHORVENTA,'MM/YYYY') AS COMPETENCIA_ENTREGA, ")
.append("TO_CHAR(B.FECHORVENTA,'MM/YYYY') AS COMPETENCIA_VENDA, ")
.append("SUM(B.PRECIOPAGADO) AS TARIFA, ")
.append("SUM(B.IMPORTEPEDAGIO) AS PEDAGIO, ")
.append("SUM(B.IMPORTESEGURO) AS SEGURO, ")
.append("SUM(B.IMPORTETAXAEMBARQUE) AS TAXA_EMBARQUE, ")
.append("COUNT(B.BOLETO_ID) AS QTDE ")
.append("FROM BOLETO B ")
.append("JOIN BOLETO BE ON B.BOLETO_ID = BE.BOLETOORIGINAL_ID ")
.append("JOIN FISCAL_R4 R4 ON BE.BOLETO_ID = R4.BOLETO_ID ")
.append("WHERE B.TIPOVENTA_ID IN (5,12,18) ")
.append("AND BE.FECHORVENTA BETWEEN :dataInicial AND :dataFinal ")
.append("AND BE.EMPRESACORRIDA_ID = :empresaId ")
.append("AND B.INDSTATUSBOLETO = 'V' ")
.append("AND B.MOTIVOCANCELACION_ID = 16 ")
.append("AND BE.INDSTATUSBOLETO = 'E' ")
.append("AND TO_CHAR(B.FECHORVENTA,'MM/YYYY') < TO_CHAR(BE.FECHORVENTA,'MM/YYYY') ")
.append("GROUP BY 'VENDIDO EM COMPETÊNCIA ANTERIOR', ")
.append(" TO_CHAR(B.FECHORVENTA,'MM/YYYY'), ")
.append(" TO_CHAR(BE.FECHORVENTA,'MM/YYYY') ");
sQuery.append("UNION ");
/*VENDIDO E NÃO ENTREGUE NA COMPETÊNCIA*/
sQuery.append("SELECT 'VENDIDO E NÃO ENTREGUE NA COMPETÊNCIA' AS SITUACAO, ")
.append("'' AS COMPETENCIA_ENTREGA, ")
.append("TO_CHAR(B.FECHORVENTA,'MM/YYYY') AS COMPETENCIA_VENDA, ")
.append("SUM(B.PRECIOPAGADO) AS TARIFA, ")
.append("SUM(B.IMPORTEPEDAGIO) AS PEDAGIO, ")
.append("SUM(B.IMPORTESEGURO) AS SEGURO, ")
.append("SUM(B.IMPORTETAXAEMBARQUE) AS TAXA_EMBARQUE, ")
.append("COUNT(B.BOLETO_ID) AS QTDE ")
.append("FROM BOLETO B ")
.append("LEFT JOIN BOLETO BE ON B.BOLETO_ID = BE.BOLETOORIGINAL_ID ")
.append("WHERE B.TIPOVENTA_ID IN (5,12,18) ")
.append("AND B.FECHORVENTA BETWEEN :dataInicial AND :dataFinal ")
.append("AND B.EMPRESACORRIDA_ID = :empresaId ")
.append("AND B.INDSTATUSBOLETO = 'V' ")
.append("AND (B.MOTIVOCANCELACION_ID IS NULL OR ")
.append(" ( ")
.append(" B.MOTIVOCANCELACION_ID = 16 ")
.append(" AND BE.INDSTATUSBOLETO = 'E' ")
.append(" AND TO_CHAR(BE.FECHORVENTA,'MM/YYYY') > TO_CHAR(B.FECHORVENTA,'MM/YYYY') ")
.append(" ) ")
.append(" ) ")
.append("GROUP BY 'VENDIDO E NÃO ENTREGUE NA COMPETÊNCIA', ")
.append(" TO_CHAR(B.FECHORVENTA,'MM/YYYY') ");
sQuery.append("ORDER BY SITUACAO, COMPETENCIA_ENTREGA, COMPETENCIA_VENDA");
return sQuery.toString();
}
@Override @Override
protected void processaParametros() throws Exception { protected void processaParametros() throws Exception {
} }

View File

@ -3,28 +3,35 @@
<property name="ireport.zoom" value="1.0"/> <property name="ireport.zoom" value="1.0"/>
<property name="ireport.x" value="14"/> <property name="ireport.x" value="14"/>
<property name="ireport.y" value="0"/> <property name="ireport.y" value="0"/>
<subDataset name="dataset1" uuid="74edbc6d-4647-4e5a-ab51-73e65607c36e"> <parameter name="nombempresa" class="java.lang.String"/>
<field name="status" class="java.lang.String"/> <parameter name="competencia" class="java.lang.String"/>
<field name="tarifa" class="java.math.BigDecimal"/> <field name="tarifa" class="java.math.BigDecimal"/>
<field name="embarque" class="java.math.BigDecimal"/>
<field name="pedagio" class="java.math.BigDecimal"/> <field name="pedagio" class="java.math.BigDecimal"/>
<field name="embarque" class="java.math.BigDecimal"/>
<field name="seguro" class="java.math.BigDecimal"/>
<field name="situacao" class="java.lang.String"/>
<field name="competenciaEntrega" class="java.lang.String"/>
<field name="competenciaVenda" class="java.lang.String"/>
<field name="qtde" class="java.lang.Integer"/>
<field name="total" class="java.math.BigDecimal"/> <field name="total" class="java.math.BigDecimal"/>
<field name="seguro" class="java.math.BigDecimal"/> <variable name="vTotalQtde" class="java.lang.Integer" calculation="Sum">
</subDataset> <variableExpression><![CDATA[$F{qtde}]]></variableExpression>
<parameter name="inicio" class="java.util.Date"/> </variable>
<parameter name="fim" class="java.util.Date"/> <variable name="vTotalTarifa" class="java.math.BigDecimal" calculation="Sum">
<parameter name="totais" class="java.util.Collection"/> <variableExpression><![CDATA[$F{tarifa}]]></variableExpression>
<field name="dataVendaVoucher" class="java.lang.String"/> </variable>
<field name="dataEmissao" class="java.lang.String"/> <variable name="vTotalPedagio" class="java.math.BigDecimal" calculation="Sum">
<field name="empresa" class="java.lang.String"/> <variableExpression><![CDATA[$F{pedagio}]]></variableExpression>
<field name="numDocFiscal" class="java.lang.String"/> </variable>
<field name="bilhete" class="java.lang.String"/> <variable name="vTotalEmbarque" class="java.math.BigDecimal" calculation="Sum">
<field name="tipoVenda" class="java.lang.String"/> <variableExpression><![CDATA[$F{embarque}]]></variableExpression>
<field name="status" class="java.lang.String"/> </variable>
<field name="tarifa" class="java.math.BigDecimal"/> <variable name="vTotalSeguro" class="java.math.BigDecimal" calculation="Sum">
<field name="pedagio" class="java.math.BigDecimal"/> <variableExpression><![CDATA[$F{seguro}]]></variableExpression>
<field name="embarque" class="java.math.BigDecimal"/> </variable>
<field name="seguro" class="java.math.BigDecimal"/> <variable name="vTotal" class="java.math.BigDecimal" calculation="Sum">
<variableExpression><![CDATA[$F{total}]]></variableExpression>
</variable>
<background> <background>
<band splitType="Stretch"/> <band splitType="Stretch"/>
</background> </background>
@ -33,10 +40,10 @@
<textField> <textField>
<reportElement x="84" y="40" width="471" height="23" uuid="63ce47a3-7e94-42a2-8325-eceef777fbe2"/> <reportElement x="84" y="40" width="471" height="23" uuid="63ce47a3-7e94-42a2-8325-eceef777fbe2"/>
<textElement verticalAlignment="Middle"/> <textElement verticalAlignment="Middle"/>
<textFieldExpression><![CDATA[$F{empresa}]]></textFieldExpression> <textFieldExpression><![CDATA[$P{nombempresa}]]></textFieldExpression>
</textField> </textField>
<staticText> <staticText>
<reportElement x="0" y="0" width="276" height="20" uuid="2e2e9caa-4076-4209-bdaf-0017ddf83a56"/> <reportElement x="0" y="0" width="522" height="20" uuid="2e2e9caa-4076-4209-bdaf-0017ddf83a56"/>
<textElement verticalAlignment="Middle"> <textElement verticalAlignment="Middle">
<font size="14" isBold="true"/> <font size="14" isBold="true"/>
</textElement> </textElement>
@ -54,7 +61,7 @@
<textElement verticalAlignment="Middle"> <textElement verticalAlignment="Middle">
<font isBold="true"/> <font isBold="true"/>
</textElement> </textElement>
<textFieldExpression><![CDATA["Período: "]]></textFieldExpression> <textFieldExpression><![CDATA["Competência: "]]></textFieldExpression>
</textField> </textField>
<staticText> <staticText>
<reportElement x="0" y="40" width="84" height="23" uuid="cf05ce5a-615b-41ac-b24d-2c45ca1bc60e"/> <reportElement x="0" y="40" width="84" height="23" uuid="cf05ce5a-615b-41ac-b24d-2c45ca1bc60e"/>
@ -64,21 +71,9 @@
<text><![CDATA[Empresa:]]></text> <text><![CDATA[Empresa:]]></text>
</staticText> </staticText>
<textField pattern="dd/MM/yyyy"> <textField pattern="dd/MM/yyyy">
<reportElement x="80" y="20" width="78" height="20" uuid="7f5ee01d-f86d-49a4-a2a1-f1c671621ef0"/> <reportElement x="80" y="20" width="205" height="20" uuid="7f5ee01d-f86d-49a4-a2a1-f1c671621ef0"/>
<textElement textAlignment="Left" verticalAlignment="Middle"/>
<textFieldExpression><![CDATA[$P{inicio}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="158" y="20" width="28" height="20" uuid="c1dec10a-743d-4569-916d-f1b65d4475b7"/>
<textElement verticalAlignment="Middle">
<font isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[" a "]]></textFieldExpression>
</textField>
<textField pattern="dd/MM/yyyy">
<reportElement x="186" y="20" width="369" height="20" uuid="0b39fe78-5378-404c-b364-8be6ca288e25"/>
<textElement verticalAlignment="Middle"/> <textElement verticalAlignment="Middle"/>
<textFieldExpression><![CDATA[$P{fim}]]></textFieldExpression> <textFieldExpression><![CDATA[$P{competencia}]]></textFieldExpression>
</textField> </textField>
</band> </band>
</title> </title>
@ -88,60 +83,53 @@
<columnHeader> <columnHeader>
<band height="24" splitType="Stretch"> <band height="24" splitType="Stretch">
<textField isStretchWithOverflow="true" isBlankWhenNull="true"> <textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement stretchType="RelativeToTallestObject" x="0" y="2" width="65" height="20" uuid="e6dbc037-913e-4ccc-8c62-2b030b909d33"/> <reportElement stretchType="RelativeToTallestObject" x="0" y="2" width="147" height="20" uuid="e6dbc037-913e-4ccc-8c62-2b030b909d33"/>
<textElement markup="none"> <textElement verticalAlignment="Middle" markup="none">
<font fontName="SansSerif" size="6" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false"/> <font fontName="SansSerif" size="6" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false"/>
</textElement> </textElement>
<textFieldExpression><![CDATA["Data Venda"]]></textFieldExpression> <textFieldExpression><![CDATA["Situação"]]></textFieldExpression>
</textField> </textField>
<line> <line>
<reportElement x="0" y="1" width="802" height="1" uuid="481b2107-ee62-4815-8a89-8435d34384c8"/> <reportElement x="0" y="1" width="802" height="1" uuid="481b2107-ee62-4815-8a89-8435d34384c8"/>
</line> </line>
<textField isStretchWithOverflow="true" isBlankWhenNull="true"> <textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement stretchType="RelativeToTallestObject" x="134" y="2" width="70" height="20" uuid="8e32858b-3bbe-453f-bc9c-e47cd03cbb72"/> <reportElement stretchType="RelativeToTallestObject" x="241" y="2" width="89" height="20" uuid="8e32858b-3bbe-453f-bc9c-e47cd03cbb72"/>
<textElement markup="none"> <textElement textAlignment="Center" verticalAlignment="Middle" markup="none">
<font fontName="SansSerif" size="6" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false"/> <font fontName="SansSerif" size="6" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false"/>
</textElement> </textElement>
<textFieldExpression><![CDATA["COO (Nº FISCAL)"]]></textFieldExpression> <textFieldExpression><![CDATA["Competência Venda"]]></textFieldExpression>
</textField> </textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true"> <textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement stretchType="RelativeToTallestObject" x="204" y="2" width="58" height="20" uuid="25ca2035-0d91-479e-acb6-d542514d7d5b"/> <reportElement stretchType="RelativeToTallestObject" x="330" y="2" width="46" height="20" uuid="25ca2035-0d91-479e-acb6-d542514d7d5b"/>
<textElement markup="none"> <textElement textAlignment="Center" verticalAlignment="Middle" markup="none">
<font fontName="SansSerif" size="6" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false"/> <font fontName="SansSerif" size="6" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false"/>
</textElement> </textElement>
<textFieldExpression><![CDATA["Bilhete"]]></textFieldExpression> <textFieldExpression><![CDATA["Qtde"]]></textFieldExpression>
</textField> </textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true"> <textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement stretchType="RelativeToTallestObject" x="262" y="2" width="113" height="20" uuid="2e674c44-07ff-4d6f-9643-2ba3bbbce4b9"/> <reportElement stretchType="RelativeToTallestObject" x="716" y="2" width="85" height="20" uuid="2e674c44-07ff-4d6f-9643-2ba3bbbce4b9"/>
<textElement markup="none"> <textElement textAlignment="Right" verticalAlignment="Middle" markup="none">
<font fontName="SansSerif" size="6" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false"/> <font fontName="SansSerif" size="6" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false"/>
</textElement> </textElement>
<textFieldExpression><![CDATA["Tipo Venda"]]></textFieldExpression> <textFieldExpression><![CDATA["Total"]]></textFieldExpression>
</textField> </textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true"> <textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement stretchType="RelativeToTallestObject" x="375" y="2" width="125" height="20" uuid="f74f8fc8-d3dd-4459-9f4f-426b5a3d1949"/> <reportElement stretchType="RelativeToTallestObject" x="376" y="2" width="85" height="20" uuid="3e9b6264-c5df-4ecd-b739-9030e097fc99"/>
<textElement markup="none"> <textElement textAlignment="Right" verticalAlignment="Middle" markup="none">
<font fontName="SansSerif" size="6" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false"/>
</textElement>
<textFieldExpression><![CDATA["Status"]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement stretchType="RelativeToTallestObject" x="500" y="2" width="84" height="20" uuid="3e9b6264-c5df-4ecd-b739-9030e097fc99"/>
<textElement textAlignment="Right" markup="none">
<font fontName="SansSerif" size="6" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false"/> <font fontName="SansSerif" size="6" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false"/>
</textElement> </textElement>
<textFieldExpression><![CDATA["Tarifa"]]></textFieldExpression> <textFieldExpression><![CDATA["Tarifa"]]></textFieldExpression>
</textField> </textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true"> <textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement stretchType="RelativeToTallestObject" x="584" y="2" width="71" height="20" uuid="d0e7d648-5347-4345-a95b-13a6895e77ed"/> <reportElement stretchType="RelativeToTallestObject" x="461" y="2" width="85" height="20" uuid="d0e7d648-5347-4345-a95b-13a6895e77ed"/>
<textElement textAlignment="Right" markup="none"> <textElement textAlignment="Right" verticalAlignment="Middle" markup="none">
<font fontName="SansSerif" size="6" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false"/> <font fontName="SansSerif" size="6" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false"/>
</textElement> </textElement>
<textFieldExpression><![CDATA["Pedagio"]]></textFieldExpression> <textFieldExpression><![CDATA["Pedagio"]]></textFieldExpression>
</textField> </textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true"> <textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement stretchType="RelativeToTallestObject" x="655" y="2" width="73" height="20" uuid="5f93a22b-64e8-4393-9d9c-fabb30e54b61"/> <reportElement stretchType="RelativeToTallestObject" x="546" y="2" width="85" height="20" uuid="5f93a22b-64e8-4393-9d9c-fabb30e54b61"/>
<textElement textAlignment="Right" markup="none"> <textElement textAlignment="Right" verticalAlignment="Middle" markup="none">
<font fontName="SansSerif" size="6" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false"/> <font fontName="SansSerif" size="6" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false"/>
</textElement> </textElement>
<textFieldExpression><![CDATA["Embarque"]]></textFieldExpression> <textFieldExpression><![CDATA["Embarque"]]></textFieldExpression>
@ -150,15 +138,15 @@
<reportElement positionType="Float" x="0" y="22" width="802" height="1" uuid="a33f21d9-c821-4fa9-8dd8-1768914351f2"/> <reportElement positionType="Float" x="0" y="22" width="802" height="1" uuid="a33f21d9-c821-4fa9-8dd8-1768914351f2"/>
</line> </line>
<textField isStretchWithOverflow="true" isBlankWhenNull="true"> <textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement stretchType="RelativeToTallestObject" x="65" y="2" width="69" height="20" uuid="86784842-c177-49aa-82ed-9b06e59d4aa4"/> <reportElement stretchType="RelativeToTallestObject" x="147" y="2" width="94" height="20" uuid="86784842-c177-49aa-82ed-9b06e59d4aa4"/>
<textElement markup="none"> <textElement textAlignment="Center" verticalAlignment="Middle" markup="none">
<font fontName="SansSerif" size="6" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false"/> <font fontName="SansSerif" size="6" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false"/>
</textElement> </textElement>
<textFieldExpression><![CDATA["Data Emissão"]]></textFieldExpression> <textFieldExpression><![CDATA["Competência Entrega"]]></textFieldExpression>
</textField> </textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true"> <textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement stretchType="RelativeToTallestObject" x="729" y="2" width="73" height="20" uuid="8ba8c64a-e023-433b-9e42-2a96011c029e"/> <reportElement stretchType="RelativeToTallestObject" x="631" y="2" width="85" height="20" uuid="8ba8c64a-e023-433b-9e42-2a96011c029e"/>
<textElement textAlignment="Right" markup="none"> <textElement textAlignment="Right" verticalAlignment="Middle" markup="none">
<font fontName="SansSerif" size="6" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false"/> <font fontName="SansSerif" size="6" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false"/>
</textElement> </textElement>
<textFieldExpression><![CDATA["Seguro"]]></textFieldExpression> <textFieldExpression><![CDATA["Seguro"]]></textFieldExpression>
@ -168,71 +156,64 @@
<detail> <detail>
<band height="21" splitType="Stretch"> <band height="21" splitType="Stretch">
<textField isStretchWithOverflow="true" isBlankWhenNull="true"> <textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement stretchType="RelativeToTallestObject" x="0" y="0" width="65" height="20" uuid="880453bc-b85e-49c3-996a-6441cf25df5f"/> <reportElement stretchType="RelativeToTallestObject" x="0" y="0" width="147" height="20" uuid="880453bc-b85e-49c3-996a-6441cf25df5f"/>
<textElement> <textElement verticalAlignment="Middle">
<font size="6"/> <font size="6"/>
</textElement> </textElement>
<textFieldExpression><![CDATA[$F{dataVendaVoucher}]]></textFieldExpression> <textFieldExpression><![CDATA[$F{situacao}]]></textFieldExpression>
</textField> </textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true"> <textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement stretchType="RelativeToTallestObject" x="65" y="0" width="69" height="20" uuid="04367436-a76e-4e64-a157-4325ce7d98a5"/> <reportElement stretchType="RelativeToTallestObject" x="147" y="0" width="94" height="20" uuid="04367436-a76e-4e64-a157-4325ce7d98a5"/>
<textElement> <textElement textAlignment="Center" verticalAlignment="Middle">
<font size="6"/> <font size="6"/>
</textElement> </textElement>
<textFieldExpression><![CDATA[$F{dataEmissao}]]></textFieldExpression> <textFieldExpression><![CDATA[$F{competenciaEntrega}]]></textFieldExpression>
</textField> </textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true"> <textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement stretchType="RelativeToTallestObject" x="134" y="0" width="70" height="20" uuid="1e0ca195-eef6-46b7-ba9f-66af0ef33209"/> <reportElement stretchType="RelativeToTallestObject" x="241" y="0" width="89" height="20" uuid="1e0ca195-eef6-46b7-ba9f-66af0ef33209"/>
<textElement> <textElement textAlignment="Center" verticalAlignment="Middle">
<font size="6"/> <font size="6"/>
</textElement> </textElement>
<textFieldExpression><![CDATA[$F{numDocFiscal}]]></textFieldExpression> <textFieldExpression><![CDATA[$F{competenciaVenda}]]></textFieldExpression>
</textField> </textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true"> <textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement stretchType="RelativeToTallestObject" x="204" y="0" width="58" height="20" uuid="2564f9af-3487-4dda-bfaa-4467ea076db0"/> <reportElement stretchType="RelativeToTallestObject" x="330" y="0" width="46" height="20" uuid="2564f9af-3487-4dda-bfaa-4467ea076db0"/>
<textElement> <textElement textAlignment="Center" verticalAlignment="Middle">
<font size="6"/> <font size="6"/>
</textElement> </textElement>
<textFieldExpression><![CDATA[$F{bilhete}]]></textFieldExpression> <textFieldExpression><![CDATA[$F{qtde}]]></textFieldExpression>
</textField> </textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true"> <textField isStretchWithOverflow="true" pattern="#,##0.00" isBlankWhenNull="true">
<reportElement stretchType="RelativeToTallestObject" x="262" y="0" width="113" height="20" uuid="5a614727-0d7b-41da-a7b7-293558bf2bdc"/> <reportElement stretchType="RelativeToTallestObject" x="716" y="0" width="85" height="20" uuid="5a614727-0d7b-41da-a7b7-293558bf2bdc"/>
<textElement> <textElement textAlignment="Right" verticalAlignment="Middle">
<font size="6"/> <font size="6"/>
</textElement> </textElement>
<textFieldExpression><![CDATA[$F{tipoVenda}]]></textFieldExpression> <textFieldExpression><![CDATA[$F{total}]]></textFieldExpression>
</textField> </textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true"> <textField isStretchWithOverflow="true" pattern="#,##0.00" isBlankWhenNull="true">
<reportElement stretchType="RelativeToTallestObject" x="375" y="0" width="125" height="20" uuid="45664dba-aceb-4198-bcc7-5e6567daf0a5"/> <reportElement stretchType="RelativeToTallestObject" x="376" y="0" width="85" height="20" uuid="c3aa8f19-46d6-4c0b-9703-e74adaa2b5d7"/>
<textElement> <textElement textAlignment="Right" verticalAlignment="Middle">
<font size="6"/>
</textElement>
<textFieldExpression><![CDATA[$F{status}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="¤ #,##0.00" isBlankWhenNull="true">
<reportElement stretchType="RelativeToTallestObject" x="500" y="0" width="84" height="20" uuid="c3aa8f19-46d6-4c0b-9703-e74adaa2b5d7"/>
<textElement textAlignment="Right">
<font size="6"/> <font size="6"/>
</textElement> </textElement>
<textFieldExpression><![CDATA[$F{tarifa}]]></textFieldExpression> <textFieldExpression><![CDATA[$F{tarifa}]]></textFieldExpression>
</textField> </textField>
<textField isStretchWithOverflow="true" pattern="¤ #,##0.00" isBlankWhenNull="true"> <textField isStretchWithOverflow="true" pattern="#,##0.00" isBlankWhenNull="true">
<reportElement stretchType="RelativeToTallestObject" x="584" y="0" width="71" height="20" uuid="655984a8-3e4a-4ac7-8816-317469c6a3ee"/> <reportElement stretchType="RelativeToTallestObject" x="461" y="0" width="85" height="20" uuid="655984a8-3e4a-4ac7-8816-317469c6a3ee"/>
<textElement textAlignment="Right"> <textElement textAlignment="Right" verticalAlignment="Middle">
<font size="6"/> <font size="6"/>
</textElement> </textElement>
<textFieldExpression><![CDATA[$F{pedagio}]]></textFieldExpression> <textFieldExpression><![CDATA[$F{pedagio}]]></textFieldExpression>
</textField> </textField>
<textField isStretchWithOverflow="true" pattern="¤ #,##0.00" isBlankWhenNull="true"> <textField isStretchWithOverflow="true" pattern="#,##0.00" isBlankWhenNull="true">
<reportElement stretchType="RelativeToTallestObject" x="655" y="0" width="73" height="20" uuid="fced1969-520a-4be8-b126-45c7dc8fae72"/> <reportElement stretchType="RelativeToTallestObject" x="546" y="0" width="85" height="20" uuid="fced1969-520a-4be8-b126-45c7dc8fae72"/>
<textElement textAlignment="Right"> <textElement textAlignment="Right" verticalAlignment="Middle">
<font size="6"/> <font size="6"/>
</textElement> </textElement>
<textFieldExpression><![CDATA[$F{embarque}]]></textFieldExpression> <textFieldExpression><![CDATA[$F{embarque}]]></textFieldExpression>
</textField> </textField>
<textField isStretchWithOverflow="true" pattern="¤ #,##0.00" isBlankWhenNull="true"> <textField isStretchWithOverflow="true" pattern="#,##0.00" isBlankWhenNull="true">
<reportElement stretchType="RelativeToTallestObject" x="728" y="0" width="73" height="20" uuid="f13ecbfe-3b3f-48ad-8c7c-e93b8bfe3445"/> <reportElement stretchType="RelativeToTallestObject" x="631" y="0" width="85" height="20" uuid="f13ecbfe-3b3f-48ad-8c7c-e93b8bfe3445"/>
<textElement textAlignment="Right"> <textElement textAlignment="Right" verticalAlignment="Middle">
<font size="6"/> <font size="6"/>
</textElement> </textElement>
<textFieldExpression><![CDATA[$F{seguro}]]></textFieldExpression> <textFieldExpression><![CDATA[$F{seguro}]]></textFieldExpression>
@ -246,111 +227,59 @@
<band splitType="Stretch"/> <band splitType="Stretch"/>
</pageFooter> </pageFooter>
<summary> <summary>
<band height="69"> <band height="24">
<componentElement> <textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement x="0" y="47" width="711" height="20" uuid="1d137acc-1a93-441e-80c7-f7fc3096be62"/> <reportElement stretchType="RelativeToTallestObject" x="330" y="3" width="46" height="20" uuid="6730eb69-2702-48c8-945b-e47c19c1fa1b"/>
<jr:list xmlns:jr="http://jasperreports.sourceforge.net/jasperreports/components" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/components http://jasperreports.sourceforge.net/xsd/components.xsd" printOrder="Vertical"> <textElement textAlignment="Center" verticalAlignment="Middle">
<datasetRun subDataset="dataset1" uuid="c0ca26e9-9598-4df2-bdac-196cc2c8130d"> <font size="6" isBold="true"/>
<dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($P{totais})]]></dataSourceExpression>
</datasetRun>
<jr:listContents height="20" width="711">
<textField isStretchWithOverflow="true" pattern="#,##0.00" isBlankWhenNull="true">
<reportElement x="209" y="0" width="100" height="20" uuid="08b44c7e-53eb-4a90-a24a-aad5a023ebc9"/>
<textElement textAlignment="Right">
<font size="6"/>
</textElement> </textElement>
<textFieldExpression><![CDATA[$F{tarifa}]]></textFieldExpression> <textFieldExpression><![CDATA[$V{vTotalQtde}]]></textFieldExpression>
</textField> </textField>
<textField isStretchWithOverflow="true" pattern="#,##0.00" isBlankWhenNull="true"> <textField isStretchWithOverflow="true" pattern="#,##0.00" isBlankWhenNull="true">
<reportElement x="309" y="0" width="100" height="20" uuid="7a644a7e-fa80-4d39-976b-ef2da3491d5e"/> <reportElement stretchType="RelativeToTallestObject" x="546" y="3" width="85" height="20" uuid="8705cf87-3709-41f9-9939-ebd197090831"/>
<textElement textAlignment="Right"> <textElement textAlignment="Right" verticalAlignment="Middle">
<font size="6"/> <font size="6" isBold="true"/>
</textElement> </textElement>
<textFieldExpression><![CDATA[$F{embarque}]]></textFieldExpression> <textFieldExpression><![CDATA[$V{vTotalEmbarque}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="0" y="0" width="210" height="20" uuid="075957e8-8e9b-46c8-829b-0f50aaeffa5e"/>
<textElement>
<font size="6"/>
</textElement>
<textFieldExpression><![CDATA[$F{status}]]></textFieldExpression>
</textField> </textField>
<textField isStretchWithOverflow="true" pattern="#,##0.00" isBlankWhenNull="true"> <textField isStretchWithOverflow="true" pattern="#,##0.00" isBlankWhenNull="true">
<reportElement x="409" y="0" width="101" height="20" uuid="341d8526-54c6-4fcf-b806-4cef7314f66a"/> <reportElement stretchType="RelativeToTallestObject" x="461" y="3" width="85" height="20" uuid="9c25317a-a5b0-41e9-95d7-70c4b7ab124b"/>
<textElement textAlignment="Right"> <textElement textAlignment="Right" verticalAlignment="Middle">
<font size="6"/> <font size="6" isBold="true"/>
</textElement> </textElement>
<textFieldExpression><![CDATA[$F{pedagio}]]></textFieldExpression> <textFieldExpression><![CDATA[$V{vTotalPedagio}]]></textFieldExpression>
</textField> </textField>
<textField isStretchWithOverflow="true" pattern="#,##0.00" isBlankWhenNull="true"> <textField isStretchWithOverflow="true" pattern="#,##0.00" isBlankWhenNull="true">
<reportElement x="610" y="0" width="100" height="20" uuid="86f554f9-e1e2-4142-89c1-9fbf9b1b397d"/> <reportElement stretchType="RelativeToTallestObject" x="376" y="3" width="85" height="20" uuid="27d46076-e886-4dc9-b324-d579c67ba8df"/>
<textElement textAlignment="Right"> <textElement textAlignment="Right" verticalAlignment="Middle">
<font size="6"/> <font size="6" isBold="true"/>
</textElement> </textElement>
<textFieldExpression><![CDATA[$F{total}]]></textFieldExpression> <textFieldExpression><![CDATA[$V{vTotalTarifa}]]></textFieldExpression>
</textField> </textField>
<textField isStretchWithOverflow="true" pattern="#,##0.00" isBlankWhenNull="true"> <textField isStretchWithOverflow="true" pattern="#,##0.00" isBlankWhenNull="true">
<reportElement x="510" y="0" width="100" height="20" uuid="d3c3c2af-12dd-425c-906c-be13fe65eb91"/> <reportElement stretchType="RelativeToTallestObject" x="631" y="3" width="85" height="20" uuid="1b28acca-3838-4ca7-a11f-73b42793a888"/>
<textElement textAlignment="Right"> <textElement textAlignment="Right" verticalAlignment="Middle">
<font size="6"/> <font size="6" isBold="true"/>
</textElement> </textElement>
<textFieldExpression><![CDATA[$F{seguro}]]></textFieldExpression> <textFieldExpression><![CDATA[$V{vTotalSeguro}]]></textFieldExpression>
</textField> </textField>
</jr:listContents> <textField isStretchWithOverflow="true" pattern="#,##0.00" isBlankWhenNull="true">
</jr:list> <reportElement stretchType="RelativeToTallestObject" x="716" y="3" width="85" height="20" uuid="a4e22ca1-4e61-49f8-8a28-4ece1cb9f127"/>
</componentElement> <textElement textAlignment="Right" verticalAlignment="Middle">
<staticText> <font size="6" isBold="true"/>
<reportElement x="-1" y="5" width="154" height="20" uuid="462f1a0b-7ff6-4c3e-bc52-e4a08e8ad8a4"/> </textElement>
<textElement> <textFieldExpression><![CDATA[$V{vTotal}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement stretchType="RelativeToTallestObject" x="241" y="3" width="89" height="20" uuid="8e5281f5-8b41-407a-9cdf-5e79776bf269"/>
<textElement textAlignment="Right" verticalAlignment="Middle" markup="none">
<font fontName="SansSerif" size="6" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false"/> <font fontName="SansSerif" size="6" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false"/>
</textElement> </textElement>
<text><![CDATA[TOTAIS]]></text> <textFieldExpression><![CDATA["Total"]]></textFieldExpression>
</staticText> </textField>
<staticText>
<reportElement x="210" y="25" width="100" height="20" uuid="59bc7dec-6f8a-4c34-a6f3-5da1360a07ce"/>
<textElement textAlignment="Right">
<font fontName="SansSerif" size="6" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false"/>
</textElement>
<text><![CDATA[Tarifa]]></text>
</staticText>
<staticText>
<reportElement x="611" y="25" width="100" height="20" uuid="3d1b6b71-cfec-46f5-a933-dfffe71e9035"/>
<textElement textAlignment="Right">
<font fontName="SansSerif" size="6" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false"/>
</textElement>
<text><![CDATA[Total]]></text>
</staticText>
<staticText>
<reportElement x="0" y="25" width="210" height="20" uuid="9d26c5b3-2805-4160-884a-ce16694f67fd"/>
<textElement>
<font fontName="SansSerif" size="6" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false"/>
</textElement>
<text><![CDATA[Status]]></text>
</staticText>
<staticText>
<reportElement x="310" y="25" width="100" height="20" uuid="c332f8d7-dab9-431f-b52e-f6dc130e2205"/>
<textElement textAlignment="Right">
<font fontName="SansSerif" size="6" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false"/>
</textElement>
<text><![CDATA[Embarque]]></text>
</staticText>
<staticText>
<reportElement x="410" y="25" width="100" height="20" uuid="54b96793-cbbc-45a9-bf53-2eff6141c22e"/>
<textElement textAlignment="Right">
<font fontName="SansSerif" size="6" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false"/>
</textElement>
<text><![CDATA[Pedágio]]></text>
</staticText>
<line> <line>
<reportElement x="0" y="3" width="802" height="1" uuid="4142d01b-d6e1-486d-9659-df1e445b9d91"/> <reportElement x="0" y="1" width="802" height="1" uuid="fb654034-ffac-46bd-85b3-13eb144ff5e2"/>
</line> </line>
<staticText>
<reportElement x="510" y="25" width="100" height="20" uuid="26c51b2e-1d63-4910-a1d7-96bef42fccbe"/>
<textElement textAlignment="Right">
<font fontName="SansSerif" size="6" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false"/>
</textElement>
<text><![CDATA[Seguro]]></text>
</staticText>
</band> </band>
</summary> </summary>
</jasperReport> </jasperReport>

View File

@ -6,6 +6,7 @@ import java.io.FileNotFoundException;
import java.io.InputStream; import java.io.InputStream;
import java.sql.SQLException; import java.sql.SQLException;
import java.util.Calendar; import java.util.Calendar;
import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -25,6 +26,8 @@ import org.zkoss.zul.Checkbox;
import org.zkoss.zul.Comboitem; import org.zkoss.zul.Comboitem;
import org.zkoss.zul.Datebox; import org.zkoss.zul.Datebox;
import org.zkoss.zul.Filedownload; import org.zkoss.zul.Filedownload;
import org.zkoss.zul.Messagebox;
import org.zkoss.zul.Textbox;
import com.rjconsultores.ventaboletos.entidad.Empresa; import com.rjconsultores.ventaboletos.entidad.Empresa;
import com.rjconsultores.ventaboletos.relatorios.impl.RelatorioAnaliticoFinanceiro; import com.rjconsultores.ventaboletos.relatorios.impl.RelatorioAnaliticoFinanceiro;
@ -33,6 +36,7 @@ import com.rjconsultores.ventaboletos.service.EmpresaService;
import com.rjconsultores.ventaboletos.service.FiscalService; import com.rjconsultores.ventaboletos.service.FiscalService;
import com.rjconsultores.ventaboletos.utilerias.DateUtil; import com.rjconsultores.ventaboletos.utilerias.DateUtil;
import com.rjconsultores.ventaboletos.utilerias.ZipUtil; import com.rjconsultores.ventaboletos.utilerias.ZipUtil;
import com.rjconsultores.ventaboletos.web.utilerias.MaskUtil;
import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar; import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar;
import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer;
@ -65,6 +69,9 @@ public class BusquedaImportacionFiscalController extends MyGenericForwardCompose
private Button btnExeRelatorioVoucher; private Button btnExeRelatorioVoucher;
private Boolean isExibirTipoGeracaoArquivo; private Boolean isExibirTipoGeracaoArquivo;
private Boolean isExibirCompetencia;
private boolean isExibirDatas;
private Textbox txtCompetencia;
@Override @Override
public void doAfterCompose(Component comp) throws Exception { public void doAfterCompose(Component comp) throws Exception {
@ -72,6 +79,7 @@ public class BusquedaImportacionFiscalController extends MyGenericForwardCompose
super.doAfterCompose(comp); super.doAfterCompose(comp);
defineImportacao(); defineImportacao();
aplicarMascara();
} }
private void defineImportacao() { private void defineImportacao() {
@ -126,6 +134,8 @@ public class BusquedaImportacionFiscalController extends MyGenericForwardCompose
} }
isExibirTipoGeracaoArquivo = (Boolean) Executions.getCurrent().getArg().get("ExibirTipoGeracaoArquivo"); isExibirTipoGeracaoArquivo = (Boolean) Executions.getCurrent().getArg().get("ExibirTipoGeracaoArquivo");
isExibirCompetencia = (Boolean) Executions.getCurrent().getArg().get("ExibirCompetencia");
isExibirDatas = isExibirCompetencia != null ? !isExibirCompetencia : true;
} }
@ -308,10 +318,24 @@ public class BusquedaImportacionFiscalController extends MyGenericForwardCompose
empresa = (Empresa) itemEmpresa.getValue(); empresa = (Empresa) itemEmpresa.getValue();
} }
txtCompetencia.getValue();
if(!DateUtil.isCompetenciaValida(txtCompetencia.getValue())) {
Messagebox.show(Labels.getLabel("MSG.Error.invalida.competencia"),
Labels.getLabel("busquedaImportacionFiscalRelatorioVoucherController.window.title"),
Messagebox.OK, Messagebox.ERROR);
return;
}
Date dataInicial = DateUtil.getDataInicialCompetencia(txtCompetencia.getValue());
Date dataFinal = DateUtil.getDataFinalCompetencia(txtCompetencia.getValue());
Map<String, Object> parametros = new HashMap<String, Object>(); Map<String, Object> parametros = new HashMap<String, Object>();
parametros.put("inicio", datInicial.getValue()); parametros.put("competencia", txtCompetencia.getValue());
parametros.put("fim", datFinal.getValue()); parametros.put("inicio", dataInicial);
parametros.put("fim", dataFinal);
parametros.put("empresa", empresa); parametros.put("empresa", empresa);
parametros.put("nombempresa", empresa.getNombempresa());
RelatorioAnaliticoVoucher relatorio = new RelatorioAnaliticoVoucher(parametros, dataSourceRead.getConnection()); RelatorioAnaliticoVoucher relatorio = new RelatorioAnaliticoVoucher(parametros, dataSourceRead.getConnection());
@ -352,4 +376,16 @@ public class BusquedaImportacionFiscalController extends MyGenericForwardCompose
return isExibirTipoGeracaoArquivo; return isExibirTipoGeracaoArquivo;
} }
public Boolean isExibirCompetencia() {
return isExibirCompetencia;
}
public Boolean isExibirDatas() {
return isExibirDatas;
}
public void aplicarMascara() {
MaskUtil.aplicarMascara(txtCompetencia.getUuid(), "99/9999");
}
} }

View File

@ -25,6 +25,7 @@ public class ItemMenuFiscalRelatorioVoucher extends DefaultItemMenuSistema {
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
HashMap<String, Boolean> map = TipoImportacaoFiscal.selecionaTipoImportacao(TipoImportacao.RELATORIO_VOUCHER, (HashMap<String, Boolean>) getArgs()); HashMap<String, Boolean> map = TipoImportacaoFiscal.selecionaTipoImportacao(TipoImportacao.RELATORIO_VOUCHER, (HashMap<String, Boolean>) getArgs());
map.put("ExibirCompetencia", true);
PantallaUtileria.openWindow("/gui/impressaofiscal/busquedaImportacionFiscal.zul", PantallaUtileria.openWindow("/gui/impressaofiscal/busquedaImportacionFiscal.zul",
Labels.getLabel("busquedaImportacionFiscalRelatorioVoucherController.window.title"), map, desktop); Labels.getLabel("busquedaImportacionFiscalRelatorioVoucherController.window.title"), map, desktop);

View File

@ -6018,6 +6018,7 @@ busquedaImportacionFiscalController.lbDataFin.value = Data Final
busquedaImportacionFiscalController.lbGerarArquivo.value = Gerar Arquivo busquedaImportacionFiscalController.lbGerarArquivo.value = Gerar Arquivo
busquedaImportacionFiscalController.lbArquivoTxt.value = Importação Texto busquedaImportacionFiscalController.lbArquivoTxt.value = Importação Texto
busquedaImportacionFiscalController.lbArquivoXls.value = Consolidado Excel busquedaImportacionFiscalController.lbArquivoXls.value = Consolidado Excel
busquedaImportacionFiscalController.lbCompetencia.label = Competência
busquedaImportacionFiscalController.btnExe.label = Executar Importação busquedaImportacionFiscalController.btnExe.label = Executar Importação
#busquedaImportacionFiscalController.btnExe.label = Importação Fiscal ECF #busquedaImportacionFiscalController.btnExe.label = Importação Fiscal ECF
#busquedaImportacionFiscalController.btnExeManual.label = Importação Fiscal Manual #busquedaImportacionFiscalController.btnExeManual.label = Importação Fiscal Manual

View File

@ -6024,6 +6024,7 @@ busquedaImportacionFiscalController.lbDataFin.value = Data Final
busquedaImportacionFiscalController.lbGerarArquivo.value = Gerar Arquivo busquedaImportacionFiscalController.lbGerarArquivo.value = Gerar Arquivo
busquedaImportacionFiscalController.lbArquivoTxt.value = Importação Texto busquedaImportacionFiscalController.lbArquivoTxt.value = Importação Texto
busquedaImportacionFiscalController.lbArquivoXls.value = Consolidado Excel busquedaImportacionFiscalController.lbArquivoXls.value = Consolidado Excel
busquedaImportacionFiscalController.lbCompetencia.label = Competência
busquedaImportacionFiscalController.btnExe.label = Executar Importação busquedaImportacionFiscalController.btnExe.label = Executar Importação
#busquedaImportacionFiscalController.btnExe.label = Importação Fiscal ECF #busquedaImportacionFiscalController.btnExe.label = Importação Fiscal ECF
#busquedaImportacionFiscalController.btnExeManual.label = Importação Fiscal Manual #busquedaImportacionFiscalController.btnExeManual.label = Importação Fiscal Manual

View File

@ -18,7 +18,7 @@
</columns> </columns>
<rows> <rows>
<row> <row visible="@{winBusquedaImportacionFiscal$composer.exibirDatas}">
<label <label
value="${c:l('busquedaImportacionFiscalController.lbDataIni.value')}" /> value="${c:l('busquedaImportacionFiscalController.lbDataIni.value')}" />
<datebox id="datInicial" width="90%" <datebox id="datInicial" width="90%"
@ -31,6 +31,15 @@
maxlength="10" /> maxlength="10" />
</row> </row>
<row spans="1,3" visible="@{winBusquedaImportacionFiscal$composer.exibirCompetencia}">
<label value="${c:l('busquedaImportacionFiscalController.lbCompetencia.label')}" />
<hbox>
<textbox id="txtCompetencia"
width="100px"
use="com.rjconsultores.ventaboletos.web.utilerias.MyTextbox" />
<label value="${c:l('busquedaConferenciaComissaoController.lbCompetenciaLayout.label')}" />
</hbox>
</row>
<row spans="1, 3"> <row spans="1, 3">
<label <label
value="${c:l('relatorioReceitaDiariaAgenciaController.lbEmpresa.value')}" /> value="${c:l('relatorioReceitaDiariaAgenciaController.lbEmpresa.value')}" />