fixes bug#11035
dev:julio qua:julio git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@82304 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
a9272d85db
commit
c78c521731
|
@ -40,6 +40,7 @@ public class RelatorioFinanceiroAnalitico extends Relatorio {
|
||||||
Date fim = (Date) parametros.get("fim");
|
Date fim = (Date) parametros.get("fim");
|
||||||
Empresa empresa = (Empresa) parametros.get("empresa");
|
Empresa empresa = (Empresa) parametros.get("empresa");
|
||||||
TipoPuntoVenta tipoPuntoVenta = (TipoPuntoVenta) parametros.get("tipoPuntoVenta");
|
TipoPuntoVenta tipoPuntoVenta = (TipoPuntoVenta) parametros.get("tipoPuntoVenta");
|
||||||
|
boolean isBpe = (Boolean) parametros.get("isBpe");
|
||||||
|
|
||||||
List<Estado> estados = (List<Estado>) parametros.get("estados");
|
List<Estado> estados = (List<Estado>) parametros.get("estados");
|
||||||
String ufs = null;
|
String ufs = null;
|
||||||
|
@ -50,9 +51,9 @@ public class RelatorioFinanceiroAnalitico extends Relatorio {
|
||||||
ufs = ufs + "," + estado.getEstadoId().toString();
|
ufs = ufs + "," + estado.getEstadoId().toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
String pdvs = (String)parametros.get("agencias");
|
String pdvs = (String) parametros.get("agencias");
|
||||||
|
|
||||||
NamedParameterStatement stmt = new NamedParameterStatement(getConexao(), getSql(ufs, pdvs, tipoPuntoVenta == null ? -1 : tipoPuntoVenta.getTipoptovtaId().intValue()));
|
NamedParameterStatement stmt = new NamedParameterStatement(getConexao(), getSql(ufs, pdvs, tipoPuntoVenta == null ? -1 : tipoPuntoVenta.getTipoptovtaId().intValue(), isBpe));
|
||||||
stmt.setInt("EMPRESA_ID", empresa.getEmpresaId());
|
stmt.setInt("EMPRESA_ID", empresa.getEmpresaId());
|
||||||
stmt.setTimestamp("DATE_INICIO", new java.sql.Timestamp(DateUtil.inicioFecha(inicio).getTime()));
|
stmt.setTimestamp("DATE_INICIO", new java.sql.Timestamp(DateUtil.inicioFecha(inicio).getTime()));
|
||||||
stmt.setTimestamp("DATE_FIM", new java.sql.Timestamp(DateUtil.fimFecha(fim).getTime()));
|
stmt.setTimestamp("DATE_FIM", new java.sql.Timestamp(DateUtil.fimFecha(fim).getTime()));
|
||||||
|
@ -65,7 +66,7 @@ public class RelatorioFinanceiroAnalitico extends Relatorio {
|
||||||
|
|
||||||
fs.setGapVenda(getBigDecimal(rset, "receita_gap"));
|
fs.setGapVenda(getBigDecimal(rset, "receita_gap"));
|
||||||
fs.setGapImpressa(getBigDecimal(rset, "entrega_gap"));
|
fs.setGapImpressa(getBigDecimal(rset, "entrega_gap"));
|
||||||
|
|
||||||
fs.setReceitaBPR(getBigDecimal(rset, "receita_rdi_bpr"));
|
fs.setReceitaBPR(getBigDecimal(rset, "receita_rdi_bpr"));
|
||||||
|
|
||||||
BigDecimal totalVendaPassagens = fs.getReceitaBPR().add(fs.getGapVenda());
|
BigDecimal totalVendaPassagens = fs.getReceitaBPR().add(fs.getGapVenda());
|
||||||
|
@ -83,7 +84,7 @@ public class RelatorioFinanceiroAnalitico extends Relatorio {
|
||||||
BigDecimal taxaEmbarque = getBigDecimal(rset, "taxaEmbarque");
|
BigDecimal taxaEmbarque = getBigDecimal(rset, "taxaEmbarque");
|
||||||
taxaEmbarque = taxaEmbarque.add(getBigDecimal(rset, "taxaEmbarque_ee"));
|
taxaEmbarque = taxaEmbarque.add(getBigDecimal(rset, "taxaEmbarque_ee"));
|
||||||
fs.setTxEmb(taxaEmbarque);
|
fs.setTxEmb(taxaEmbarque);
|
||||||
|
|
||||||
fs.setPedagio(getBigDecimal(rset, "pedagio"));
|
fs.setPedagio(getBigDecimal(rset, "pedagio"));
|
||||||
fs.setSegFacult(getBigDecimal(rset, "segurofac"));
|
fs.setSegFacult(getBigDecimal(rset, "segurofac"));
|
||||||
|
|
||||||
|
@ -103,15 +104,15 @@ public class RelatorioFinanceiroAnalitico extends Relatorio {
|
||||||
fs.setDespesas(getBigDecimal(rset, "despesas"));
|
fs.setDespesas(getBigDecimal(rset, "despesas"));
|
||||||
fs.setPgOCD(getBigDecimal(rset, "receita_ocd_deb"));
|
fs.setPgOCD(getBigDecimal(rset, "receita_ocd_deb"));
|
||||||
fs.setDifTarifaMenor(getBigDecimal(rset, "receita_dif_dif_tarifa_menor"));
|
fs.setDifTarifaMenor(getBigDecimal(rset, "receita_dif_dif_tarifa_menor"));
|
||||||
|
|
||||||
BigDecimal cartaoCredito = getBigDecimal(rset, "cartao_credito");
|
BigDecimal cartaoCredito = getBigDecimal(rset, "cartao_credito");
|
||||||
cartaoCredito = cartaoCredito.add(getBigDecimal(rset, "cartao_credito_ee"));
|
cartaoCredito = cartaoCredito.add(getBigDecimal(rset, "cartao_credito_ee"));
|
||||||
fs.setCartaoCredito(cartaoCredito);
|
fs.setCartaoCredito(cartaoCredito);
|
||||||
|
|
||||||
BigDecimal cartaoDebito = getBigDecimal(rset, "cartao_debito");
|
BigDecimal cartaoDebito = getBigDecimal(rset, "cartao_debito");
|
||||||
cartaoDebito = cartaoDebito.add(getBigDecimal(rset, "cartao_debito_ee"));
|
cartaoDebito = cartaoDebito.add(getBigDecimal(rset, "cartao_debito_ee"));
|
||||||
fs.setCartaoDebito(cartaoDebito);
|
fs.setCartaoDebito(cartaoDebito);
|
||||||
|
|
||||||
BigDecimal boleto = getBigDecimal(rset, "boleto_bnc");
|
BigDecimal boleto = getBigDecimal(rset, "boleto_bnc");
|
||||||
boleto = boleto.add(getBigDecimal(rset, "boleto_bnc_ee"));
|
boleto = boleto.add(getBigDecimal(rset, "boleto_bnc_ee"));
|
||||||
fs.setBoletoBancario(boleto);
|
fs.setBoletoBancario(boleto);
|
||||||
|
@ -150,7 +151,7 @@ public class RelatorioFinanceiroAnalitico extends Relatorio {
|
||||||
protected void processaParametros() throws Exception {
|
protected void processaParametros() throws Exception {
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getSql(String ufs, String pdvs, Integer tipoptovtaId) {
|
private String getSql(String ufs, String pdvs, Integer tipoptovtaId, boolean isBpe) {
|
||||||
|
|
||||||
StringBuilder sql = new StringBuilder(18000);
|
StringBuilder sql = new StringBuilder(18000);
|
||||||
sql.append(" SELECT * ");
|
sql.append(" SELECT * ");
|
||||||
|
@ -211,11 +212,11 @@ public class RelatorioFinanceiroAnalitico extends Relatorio {
|
||||||
sql.append(" AND ccp.feccorte >= :DATE_INICIO ");
|
sql.append(" AND ccp.feccorte >= :DATE_INICIO ");
|
||||||
sql.append(" AND ccp.feccorte <= :DATE_FIM ");
|
sql.append(" AND ccp.feccorte <= :DATE_FIM ");
|
||||||
sql.append(" AND ccp.empresa_id = :EMPRESA_ID ");
|
sql.append(" AND ccp.empresa_id = :EMPRESA_ID ");
|
||||||
|
|
||||||
sql.append(ufs == null ? "" : " and eo.estado_id in ( " + ufs + " ) ");
|
sql.append(ufs == null ? "" : " and eo.estado_id in ( " + ufs + " ) ");
|
||||||
sql.append(pdvs == null ? "" : "and ccp.puntoventa_id in ( " + pdvs + " ) ");
|
sql.append(pdvs == null ? "" : "and ccp.puntoventa_id in ( " + pdvs + " ) ");
|
||||||
sql.append(tipoptovtaId == -1 ? "" : "and pv.tipoptovta_id = " + tipoptovtaId);
|
sql.append(tipoptovtaId == -1 ? "" : "and pv.tipoptovta_id = " + tipoptovtaId);
|
||||||
|
|
||||||
sql.append(" ) cdv ");
|
sql.append(" ) cdv ");
|
||||||
sql.append(" GROUP BY cdv.empresaId, ");
|
sql.append(" GROUP BY cdv.empresaId, ");
|
||||||
sql.append(" cdv.fechorVenta ");
|
sql.append(" cdv.fechorVenta ");
|
||||||
|
@ -325,8 +326,8 @@ public class RelatorioFinanceiroAnalitico extends Relatorio {
|
||||||
sql.append(" AND ee.empresa_id = :EMPRESA_ID ");
|
sql.append(" AND ee.empresa_id = :EMPRESA_ID ");
|
||||||
sql.append(" AND ccp.FECCORTE BETWEEN :DATE_INICIO AND :DATE_FIM ");
|
sql.append(" AND ccp.FECCORTE BETWEEN :DATE_INICIO AND :DATE_FIM ");
|
||||||
|
|
||||||
sql.append(ufs == null ? "" : " and eo.estado_id in ( " + ufs + " ) ");
|
sql.append(ufs == null ? "" : " and eo.estado_id in ( " + ufs + " ) ");
|
||||||
sql.append(pdvs == null ? "" : "and ccp.puntoventa_id in ( " + pdvs + " ) ");
|
sql.append(pdvs == null ? "" : "and ccp.puntoventa_id in ( " + pdvs + " ) ");
|
||||||
sql.append(tipoptovtaId == -1 ? "" : "and pv.tipoptovta_id = " + tipoptovtaId);
|
sql.append(tipoptovtaId == -1 ? "" : "and pv.tipoptovta_id = " + tipoptovtaId);
|
||||||
|
|
||||||
sql.append(" GROUP BY ee.empresa_id, ");
|
sql.append(" GROUP BY ee.empresa_id, ");
|
||||||
|
@ -335,7 +336,8 @@ public class RelatorioFinanceiroAnalitico extends Relatorio {
|
||||||
sql.append(" AND agrc.fechorVenta = eed.fechorVenta ");
|
sql.append(" AND agrc.fechorVenta = eed.fechorVenta ");
|
||||||
sql.append(" LEFT JOIN ");
|
sql.append(" LEFT JOIN ");
|
||||||
sql.append(" (select empresaId, fechorVenta, sum(tarifa) receita_rdi_bpr from ( ");
|
sql.append(" (select empresaId, fechorVenta, sum(tarifa) receita_rdi_bpr from ( ");
|
||||||
sql.append(" SELECT DISTINCT c.caja_id AS cajaId, ");
|
sql.append(" SELECT DISTINCT ");
|
||||||
|
sql.append(isBpe ? " c.boleto_id as cajaId, " : " c.caja_id as cajaId, ");
|
||||||
sql.append(" e.empresa_id AS empresaId, ");
|
sql.append(" e.empresa_id AS empresaId, ");
|
||||||
sql.append(" TRUNC(c.feccreacion) AS fechorVenta, ");
|
sql.append(" TRUNC(c.feccreacion) AS fechorVenta, ");
|
||||||
sql.append(" COALESCE(c.preciopagado, 0)AS tarifa, ");
|
sql.append(" COALESCE(c.preciopagado, 0)AS tarifa, ");
|
||||||
|
@ -343,39 +345,26 @@ public class RelatorioFinanceiroAnalitico extends Relatorio {
|
||||||
sql.append(" COALESCE(c.importepedagio, 0) AS pedagio, ");
|
sql.append(" COALESCE(c.importepedagio, 0) AS pedagio, ");
|
||||||
sql.append(" COALESCE(c.importeseguro, 0) AS seguro, ");
|
sql.append(" COALESCE(c.importeseguro, 0) AS seguro, ");
|
||||||
sql.append(" COALESCE(c.importeoutros, 0) AS outros ");
|
sql.append(" COALESCE(c.importeoutros, 0) AS outros ");
|
||||||
sql.append(" FROM caja c ");
|
sql.append(isBpe ? " from boleto c " : " FROM caja c ");
|
||||||
sql.append(" INNER JOIN marca m ");
|
sql.append(isBpe ? " inner join bpe bpe on bpe.boleto_id = c.boleto_id " : "");
|
||||||
sql.append(" ON m.marca_id = c.marca_id ");
|
sql.append(" INNER JOIN marca m ON m.marca_id = c.marca_id AND m.activo = 1 ");
|
||||||
sql.append(" AND m.activo = 1 ");
|
sql.append(" INNER JOIN empresa e ON e.empresa_id = m.empresa_id ");
|
||||||
sql.append(" INNER JOIN empresa e ");
|
sql.append(" INNER JOIN punto_venta pv ON pv.puntoventa_id = c.puntoventa_id ");
|
||||||
sql.append(" ON e.empresa_id = m.empresa_id ");
|
sql.append(" INNER JOIN parada p ON pv.parada_id = p.parada_id ");
|
||||||
sql.append(" INNER JOIN punto_venta pv ");
|
sql.append(" INNER JOIN ciudad co ON co.ciudad_id = p.ciudad_id ");
|
||||||
sql.append(" ON pv.puntoventa_id = c.puntoventa_id ");
|
sql.append(" INNER JOIN estado eo ON eo.estado_id = co.estado_id ");
|
||||||
sql.append(" INNER JOIN parada p ");
|
sql.append(" WHERE c.activo = 1 AND p.activo = 1 AND co.activo = 1 AND eo.activo = 1 ");
|
||||||
sql.append(" ON pv.parada_id = p.parada_id ");
|
sql.append(isBpe ? " and bpe.bpe_id is not null " : " AND c.serieimpfiscal IS NOT NULL ");
|
||||||
sql.append(" INNER JOIN ciudad co ");
|
sql.append(" AND ((c.indreimpresion = 0 AND c.motivocancelacion_id IS NULL ");
|
||||||
sql.append(" ON co.ciudad_id = p.ciudad_id ");
|
sql.append(" AND c.numfoliosistema IS NOT NULL) OR (c.indstatusboleto = 'E' AND c.indreimpresion = 1)) ");
|
||||||
sql.append(" INNER JOIN estado eo ");
|
|
||||||
sql.append(" ON eo.estado_id = co.estado_id ");
|
|
||||||
sql.append(" WHERE c.activo = 1 ");
|
|
||||||
sql.append(" AND p.activo = 1 ");
|
|
||||||
sql.append(" AND co.activo = 1 ");
|
|
||||||
sql.append(" AND eo.activo = 1 ");
|
|
||||||
sql.append(" AND c.serieimpfiscal IS NOT NULL ");
|
|
||||||
sql.append(" AND ((c.indreimpresion = 0 ");
|
|
||||||
sql.append(" AND c.motivocancelacion_id IS NULL ");
|
|
||||||
sql.append(" AND c.numfoliosistema IS NOT NULL) ");
|
|
||||||
sql.append(" OR (c.indstatusboleto = 'E' ");
|
|
||||||
sql.append(" AND c.indreimpresion = 1)) ");
|
|
||||||
sql.append(" AND (COALESCE(c.preciopagado,0) + COALESCE(c.importetaxaembarque,0) + COALESCE(c.importeseguro,0) + COALESCE(c.importepedagio,0) + COALESCE(c.importeoutros,0)) > 0 ");
|
sql.append(" AND (COALESCE(c.preciopagado,0) + COALESCE(c.importetaxaembarque,0) + COALESCE(c.importeseguro,0) + COALESCE(c.importepedagio,0) + COALESCE(c.importeoutros,0)) > 0 ");
|
||||||
sql.append(" AND c.feccreacion >= :DATE_INICIO ");
|
sql.append(" AND c.feccreacion >= :DATE_INICIO AND c.feccreacion <= :DATE_FIM ");
|
||||||
sql.append(" AND c.feccreacion <= :DATE_FIM ");
|
|
||||||
sql.append(" AND c.empresacorrida_id = 10 ");
|
sql.append(" AND c.empresacorrida_id = 10 ");
|
||||||
|
|
||||||
sql.append(ufs == null ? "" : " and eo.estado_id in ( " + ufs + " ) ");
|
sql.append(ufs == null ? "" : " and eo.estado_id in ( " + ufs + " ) ");
|
||||||
sql.append(pdvs == null ? "" : "and pv.puntoventa_id in ( " + pdvs + " ) ");
|
sql.append(pdvs == null ? "" : "and pv.puntoventa_id in ( " + pdvs + " ) ");
|
||||||
sql.append(tipoptovtaId == -1 ? "" : "and pv.tipoptovta_id = " + tipoptovtaId);
|
sql.append(tipoptovtaId == -1 ? "" : "and pv.tipoptovta_id = " + tipoptovtaId);
|
||||||
|
|
||||||
sql.append(" UNION ALL ");
|
sql.append(" UNION ALL ");
|
||||||
sql.append(" SELECT DISTINCT c.caja_id AS cajaId, ");
|
sql.append(" SELECT DISTINCT c.caja_id AS cajaId, ");
|
||||||
sql.append(" e.empresa_id AS empresaId, ");
|
sql.append(" e.empresa_id AS empresaId, ");
|
||||||
|
@ -414,8 +403,8 @@ public class RelatorioFinanceiroAnalitico extends Relatorio {
|
||||||
|
|
||||||
sql.append(ufs == null ? "" : " and eo.estado_id in ( " + ufs + " ) ");
|
sql.append(ufs == null ? "" : " and eo.estado_id in ( " + ufs + " ) ");
|
||||||
sql.append(pdvs == null ? "" : "and pv.puntoventa_id in ( " + pdvs + " ) ");
|
sql.append(pdvs == null ? "" : "and pv.puntoventa_id in ( " + pdvs + " ) ");
|
||||||
sql.append(tipoptovtaId == -1 ? "" : "and pv.tipoptovta_id = " + tipoptovtaId);
|
sql.append(tipoptovtaId == -1 ? "" : "and pv.tipoptovta_id = " + tipoptovtaId);
|
||||||
|
|
||||||
sql.append(" ) rbl ");
|
sql.append(" ) rbl ");
|
||||||
sql.append(" GROUP BY rbl.fechorVenta, ");
|
sql.append(" GROUP BY rbl.fechorVenta, ");
|
||||||
sql.append(" rbl.empresaId ");
|
sql.append(" rbl.empresaId ");
|
||||||
|
@ -452,11 +441,11 @@ public class RelatorioFinanceiroAnalitico extends Relatorio {
|
||||||
sql.append(" AND e.empresa_id = :EMPRESA_ID ");
|
sql.append(" AND e.empresa_id = :EMPRESA_ID ");
|
||||||
sql.append(" AND b.fechorventa >= :DATE_INICIO ");
|
sql.append(" AND b.fechorventa >= :DATE_INICIO ");
|
||||||
sql.append(" AND b.fechorventa <= :DATE_FIM ");
|
sql.append(" AND b.fechorventa <= :DATE_FIM ");
|
||||||
|
|
||||||
sql.append(ufs == null ? "" : " and eo.estado_id in ( " + ufs + " ) ");
|
sql.append(ufs == null ? "" : " and eo.estado_id in ( " + ufs + " ) ");
|
||||||
sql.append(pdvs == null ? "" : "and pv.puntoventa_id in ( " + pdvs + " ) ");
|
sql.append(pdvs == null ? "" : "and pv.puntoventa_id in ( " + pdvs + " ) ");
|
||||||
sql.append(tipoptovtaId == -1 ? "" : "and pv.tipoptovta_id = " + tipoptovtaId);
|
sql.append(tipoptovtaId == -1 ? "" : "and pv.tipoptovta_id = " + tipoptovtaId);
|
||||||
|
|
||||||
sql.append(" AND b.categoria_id NOT IN ");
|
sql.append(" AND b.categoria_id NOT IN ");
|
||||||
sql.append(" (SELECT valorconstante ");
|
sql.append(" (SELECT valorconstante ");
|
||||||
sql.append(" FROM constante ");
|
sql.append(" FROM constante ");
|
||||||
|
@ -469,7 +458,7 @@ public class RelatorioFinanceiroAnalitico extends Relatorio {
|
||||||
sql.append(" ON agrc.empresaId = cbpr.empresaId ");
|
sql.append(" ON agrc.empresaId = cbpr.empresaId ");
|
||||||
sql.append(" AND agrc.fechorVenta = cbpr.fechorVenta ");
|
sql.append(" AND agrc.fechorVenta = cbpr.fechorVenta ");
|
||||||
sql.append(" order by agrc.fechorVenta ");
|
sql.append(" order by agrc.fechorVenta ");
|
||||||
|
|
||||||
return sql.toString();
|
return sql.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -40,6 +40,7 @@ public class RelatorioFinanceiroSintetico extends Relatorio {
|
||||||
Date fim = (Date) parametros.get("fim");
|
Date fim = (Date) parametros.get("fim");
|
||||||
Empresa empresa = (Empresa) parametros.get("empresa");
|
Empresa empresa = (Empresa) parametros.get("empresa");
|
||||||
TipoPuntoVenta tipoPuntoVenta = (TipoPuntoVenta) parametros.get("tipoPuntoVenta");
|
TipoPuntoVenta tipoPuntoVenta = (TipoPuntoVenta) parametros.get("tipoPuntoVenta");
|
||||||
|
boolean isBpe = (Boolean) parametros.get("isBpe");
|
||||||
|
|
||||||
List<Estado> estados = (List<Estado>) parametros.get("estados");
|
List<Estado> estados = (List<Estado>) parametros.get("estados");
|
||||||
String ufs = null;
|
String ufs = null;
|
||||||
|
@ -52,7 +53,7 @@ public class RelatorioFinanceiroSintetico extends Relatorio {
|
||||||
|
|
||||||
String pdvs = (String)parametros.get("agencias");
|
String pdvs = (String)parametros.get("agencias");
|
||||||
|
|
||||||
NamedParameterStatement stmt = new NamedParameterStatement(getConexao(), getSql(ufs, pdvs, tipoPuntoVenta == null ? -1 : tipoPuntoVenta.getTipoptovtaId().intValue()));
|
NamedParameterStatement stmt = new NamedParameterStatement(getConexao(), getSql(ufs, pdvs, tipoPuntoVenta == null ? -1 : tipoPuntoVenta.getTipoptovtaId().intValue(), isBpe));
|
||||||
stmt.setInt("EMPRESA_ID", empresa.getEmpresaId());
|
stmt.setInt("EMPRESA_ID", empresa.getEmpresaId());
|
||||||
stmt.setTimestamp("DATE_INICIO", new java.sql.Timestamp(DateUtil.inicioFecha(inicio).getTime()));
|
stmt.setTimestamp("DATE_INICIO", new java.sql.Timestamp(DateUtil.inicioFecha(inicio).getTime()));
|
||||||
stmt.setTimestamp("DATE_FIM", new java.sql.Timestamp(DateUtil.fimFecha(fim).getTime()));
|
stmt.setTimestamp("DATE_FIM", new java.sql.Timestamp(DateUtil.fimFecha(fim).getTime()));
|
||||||
|
@ -151,7 +152,7 @@ public class RelatorioFinanceiroSintetico extends Relatorio {
|
||||||
protected void processaParametros() throws Exception {
|
protected void processaParametros() throws Exception {
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getSql(String ufs, String pdvs, Integer tipoptovtaId) {
|
private String getSql(String ufs, String pdvs, Integer tipoptovtaId, boolean isBpe) {
|
||||||
|
|
||||||
StringBuilder sql = new StringBuilder(20000);
|
StringBuilder sql = new StringBuilder(20000);
|
||||||
sql.append(" SELECT * ");
|
sql.append(" SELECT * ");
|
||||||
|
@ -358,7 +359,8 @@ public class RelatorioFinanceiroSintetico extends Relatorio {
|
||||||
sql.append(" AND agrc.estadoId = eed.estadoId ");
|
sql.append(" AND agrc.estadoId = eed.estadoId ");
|
||||||
sql.append(" LEFT JOIN ");
|
sql.append(" LEFT JOIN ");
|
||||||
sql.append(" (select empresaId, puntoventaId, estadoId, sum(tarifa) receita_rdi_bpr from ( ");
|
sql.append(" (select empresaId, puntoventaId, estadoId, sum(tarifa) receita_rdi_bpr from ( ");
|
||||||
sql.append(" SELECT DISTINCT c.caja_id AS cajaId, ");
|
sql.append(" SELECT DISTINCT ");
|
||||||
|
sql.append(isBpe ? " c.boleto_id as cajaId, " : " c.caja_id as cajaId, ");
|
||||||
sql.append(" e.empresa_id AS empresaId, ");
|
sql.append(" e.empresa_id AS empresaId, ");
|
||||||
sql.append(" pv.puntoventa_id AS puntoventaId, ");
|
sql.append(" pv.puntoventa_id AS puntoventaId, ");
|
||||||
sql.append(" eo.estado_id AS estadoId, ");
|
sql.append(" eo.estado_id AS estadoId, ");
|
||||||
|
@ -366,34 +368,24 @@ public class RelatorioFinanceiroSintetico extends Relatorio {
|
||||||
sql.append(" COALESCE(c.importetaxaembarque, 0) AS taxaEmbarque, ");
|
sql.append(" COALESCE(c.importetaxaembarque, 0) AS taxaEmbarque, ");
|
||||||
sql.append(" COALESCE(c.importepedagio, 0) AS pedagio, ");
|
sql.append(" COALESCE(c.importepedagio, 0) AS pedagio, ");
|
||||||
sql.append(" COALESCE(c.importeseguro, 0) AS seguro, ");
|
sql.append(" COALESCE(c.importeseguro, 0) AS seguro, ");
|
||||||
sql.append(" COALESCE(c.importeoutros, 0) AS outros ");
|
sql.append(" COALESCE(c.importeoutros, 0) AS outros ");
|
||||||
sql.append(" FROM caja c ");
|
sql.append(isBpe ? " from boleto c " : " FROM caja c ");
|
||||||
sql.append(" INNER JOIN marca m ");
|
sql.append(isBpe ? " inner join bpe bpe on bpe.boleto_id = c.boleto_id " : "");
|
||||||
sql.append(" ON m.marca_id = c.marca_id ");
|
sql.append(" INNER JOIN marca m ON m.marca_id = c.marca_id AND m.activo = 1 ");
|
||||||
sql.append(" AND m.activo = 1 ");
|
sql.append(" INNER JOIN empresa e ON e.empresa_id = m.empresa_id ");
|
||||||
sql.append(" INNER JOIN empresa e ");
|
sql.append(" INNER JOIN punto_venta pv ON pv.puntoventa_id = c.puntoventa_id ");
|
||||||
sql.append(" ON e.empresa_id = m.empresa_id ");
|
sql.append(" INNER JOIN parada p ON pv.parada_id = p.parada_id ");
|
||||||
sql.append(" INNER JOIN punto_venta pv ");
|
sql.append(" INNER JOIN ciudad co ON co.ciudad_id = p.ciudad_id ");
|
||||||
sql.append(" ON pv.puntoventa_id = c.puntoventa_id ");
|
sql.append(" INNER JOIN estado eo ON eo.estado_id = co.estado_id ");
|
||||||
sql.append(" INNER JOIN parada p ");
|
|
||||||
sql.append(" ON pv.parada_id = p.parada_id ");
|
|
||||||
sql.append(" INNER JOIN ciudad co ");
|
|
||||||
sql.append(" ON co.ciudad_id = p.ciudad_id ");
|
|
||||||
sql.append(" INNER JOIN estado eo ");
|
|
||||||
sql.append(" ON eo.estado_id = co.estado_id ");
|
|
||||||
sql.append(" WHERE c.activo = 1 ");
|
sql.append(" WHERE c.activo = 1 ");
|
||||||
sql.append(" AND p.activo = 1 ");
|
sql.append(" AND p.activo = 1 ");
|
||||||
sql.append(" AND co.activo = 1 ");
|
sql.append(" AND co.activo = 1 ");
|
||||||
sql.append(" AND eo.activo = 1 ");
|
sql.append(" AND eo.activo = 1 ");
|
||||||
sql.append(" AND c.serieimpfiscal IS NOT NULL ");
|
sql.append(isBpe ? " and bpe.bpe_id is not null " : " AND c.serieimpfiscal IS NOT NULL ");
|
||||||
sql.append(" AND ((c.indreimpresion = 0 ");
|
sql.append(" AND ((c.indreimpresion = 0 AND c.motivocancelacion_id IS NULL ");
|
||||||
sql.append(" AND c.motivocancelacion_id IS NULL ");
|
sql.append(" AND c.numfoliosistema IS NOT NULL) OR (c.indstatusboleto = 'E' AND c.indreimpresion = 1)) ");
|
||||||
sql.append(" AND c.numfoliosistema IS NOT NULL) ");
|
|
||||||
sql.append(" OR (c.indstatusboleto = 'E' ");
|
|
||||||
sql.append(" AND c.indreimpresion = 1)) ");
|
|
||||||
sql.append(" AND (COALESCE(c.preciopagado,0) + COALESCE(c.importetaxaembarque,0) + COALESCE(c.importeseguro,0) + COALESCE(c.importepedagio,0) + COALESCE(c.importeoutros,0)) > 0 ");
|
sql.append(" AND (COALESCE(c.preciopagado,0) + COALESCE(c.importetaxaembarque,0) + COALESCE(c.importeseguro,0) + COALESCE(c.importepedagio,0) + COALESCE(c.importeoutros,0)) > 0 ");
|
||||||
sql.append(" AND c.feccreacion >= :DATE_INICIO ");
|
sql.append(" AND c.feccreacion >= :DATE_INICIO AND c.feccreacion <= :DATE_FIM ");
|
||||||
sql.append(" AND c.feccreacion <= :DATE_FIM ");
|
|
||||||
sql.append(" AND c.empresacorrida_id = 10 ");
|
sql.append(" AND c.empresacorrida_id = 10 ");
|
||||||
|
|
||||||
sql.append(ufs == null ? "" : " and eo.estado_id in ( " + ufs + " ) ");
|
sql.append(ufs == null ? "" : " and eo.estado_id in ( " + ufs + " ) ");
|
||||||
|
|
|
@ -0,0 +1,145 @@
|
||||||
|
package com.rjconsultores.ventaboletos.web.gui.controladores.bpe;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.FileInputStream;
|
||||||
|
import java.io.InputStream;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.apache.log4j.Logger;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.context.annotation.Scope;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.zkoss.zk.ui.Component;
|
||||||
|
import org.zkoss.zk.ui.event.Event;
|
||||||
|
import org.zkoss.zul.Comboitem;
|
||||||
|
import org.zkoss.zul.Datebox;
|
||||||
|
import org.zkoss.zul.Filedownload;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.Estado;
|
||||||
|
import com.rjconsultores.ventaboletos.service.BpeService;
|
||||||
|
import com.rjconsultores.ventaboletos.service.EmpresaService;
|
||||||
|
import com.rjconsultores.ventaboletos.service.EstadoService;
|
||||||
|
import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar;
|
||||||
|
import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer;
|
||||||
|
|
||||||
|
@Controller("busquedaBpeExportacaoController")
|
||||||
|
@Scope("prototype")
|
||||||
|
public class BusquedaBpeExportacaoController extends MyGenericForwardComposer {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
private static Logger log = Logger.getLogger(BusquedaBpeExportacaoController.class);
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private BpeService bpeService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private EmpresaService empresaService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private EstadoService estadoService;
|
||||||
|
|
||||||
|
private List<Empresa> lsEmpresa;
|
||||||
|
private List<Estado> lsEstado;
|
||||||
|
|
||||||
|
private Datebox datInicial;
|
||||||
|
private Datebox datFinal;
|
||||||
|
|
||||||
|
private MyComboboxEstandar cmbEmpresa;
|
||||||
|
private MyComboboxEstandar cmbEstado;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void doAfterCompose(Component comp) throws Exception {
|
||||||
|
lsEmpresa = empresaService.obtenerTodos();
|
||||||
|
lsEstado = estadoService.obtenerTodos();
|
||||||
|
|
||||||
|
super.doAfterCompose(comp);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onClick$btnExeExportacao(Event ev) throws InterruptedException {
|
||||||
|
Empresa empresa = null;
|
||||||
|
Estado estado = null;
|
||||||
|
|
||||||
|
Comboitem itemEmpresa = cmbEmpresa.getSelectedItem();
|
||||||
|
Comboitem itemEstado = cmbEstado.getSelectedItem();
|
||||||
|
|
||||||
|
if (itemEmpresa != null) {
|
||||||
|
empresa = (Empresa) itemEmpresa.getValue();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (itemEstado != null) {
|
||||||
|
estado = (Estado) itemEstado.getValue();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (empresa != null && estado != null) {
|
||||||
|
String nomeArquivo = getNomeArquivoExportacaoECF(datInicial.getValue(), estado, "BPE");
|
||||||
|
File arquivo = bpeService.buscarArquivoExportacaoBPE(datInicial.getValue(), datFinal.getValue(), empresa, estado, nomeArquivo);
|
||||||
|
|
||||||
|
try {
|
||||||
|
downloadArquivo(arquivo, nomeArquivo);
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error(e.getMessage(), e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private String getNomeArquivoExportacaoECF(Date dataInicial, Estado estado, String tipo) {
|
||||||
|
String[] mesano = new SimpleDateFormat("MM/yyyy").format(dataInicial).split("/");
|
||||||
|
|
||||||
|
String mes = mesano[0].toString();
|
||||||
|
String ano = mesano[1].toString();
|
||||||
|
|
||||||
|
String nome = "";
|
||||||
|
|
||||||
|
switch (Integer.valueOf(mes)) {
|
||||||
|
case 1: nome = "Jan"; break;
|
||||||
|
case 2: nome = "Fev"; break;
|
||||||
|
case 3: nome = "Mar"; break;
|
||||||
|
case 4: nome = "Abr"; break;
|
||||||
|
case 5: nome = "Mai"; break;
|
||||||
|
case 6: nome = "Jun"; break;
|
||||||
|
case 7: nome = "Jul"; break;
|
||||||
|
case 8: nome = "Ago"; break;
|
||||||
|
case 9: nome = "Set"; break;
|
||||||
|
case 10: nome = "Out"; break;
|
||||||
|
case 11: nome = "Nov"; break;
|
||||||
|
case 12: nome = "Dez"; break;
|
||||||
|
default: break;
|
||||||
|
}
|
||||||
|
|
||||||
|
String nomeArquivo = "TotalBus " + estado.getCveestado() + " " + tipo + " " + nome + ano;
|
||||||
|
|
||||||
|
return nomeArquivo;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void downloadArquivo(File arquivoTxt, String nome) throws Exception {
|
||||||
|
String contentType = "application/notepad";
|
||||||
|
InputStream isFile = new FileInputStream(arquivoTxt);
|
||||||
|
String nomeArquivo = arquivoTxt.getName();
|
||||||
|
|
||||||
|
if (nome != null && !nome.isEmpty()) {
|
||||||
|
nomeArquivo = nome + ".fs";
|
||||||
|
}
|
||||||
|
|
||||||
|
Filedownload.save(isFile, contentType, nomeArquivo);
|
||||||
|
|
||||||
|
if (arquivoTxt != null) {
|
||||||
|
arquivoTxt.delete();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Empresa> getLsEmpresa() {
|
||||||
|
return lsEmpresa;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Estado> getLsEstado() {
|
||||||
|
return lsEstado;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLsEstado(List<Estado> lsEstado) {
|
||||||
|
this.lsEstado = lsEstado;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,131 @@
|
||||||
|
package com.rjconsultores.ventaboletos.web.gui.controladores.bpe;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import javax.sql.DataSource;
|
||||||
|
|
||||||
|
import org.apache.log4j.Logger;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.context.annotation.Scope;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.zkoss.util.resource.Labels;
|
||||||
|
import org.zkoss.zhtml.Messagebox;
|
||||||
|
import org.zkoss.zk.ui.Component;
|
||||||
|
import org.zkoss.zk.ui.event.Event;
|
||||||
|
import org.zkoss.zul.Datebox;
|
||||||
|
import org.zkoss.zul.Radio;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.Estado;
|
||||||
|
import com.rjconsultores.ventaboletos.relatorios.impl.RelatorioRDI;
|
||||||
|
import com.rjconsultores.ventaboletos.relatorios.utilitarios.Relatorio;
|
||||||
|
import com.rjconsultores.ventaboletos.service.BpeService;
|
||||||
|
import com.rjconsultores.ventaboletos.service.EmpresaService;
|
||||||
|
import com.rjconsultores.ventaboletos.service.EstadoService;
|
||||||
|
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||||
|
import com.rjconsultores.ventaboletos.utilerias.fiscal.vo.FiscalRdi;
|
||||||
|
import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar;
|
||||||
|
import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer;
|
||||||
|
import com.rjconsultores.ventaboletos.web.utilerias.MyListbox;
|
||||||
|
import com.rjconsultores.ventaboletos.web.utilerias.render.RenderEstadoUf;
|
||||||
|
|
||||||
|
@Controller("busquedaBpeRdiController")
|
||||||
|
@Scope("prototype")
|
||||||
|
public class BusquedaBpeRdiController extends MyGenericForwardComposer {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
private static Logger log = Logger.getLogger(BusquedaBpeRdiController.class);
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private DataSource dataSourceRead;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private BpeService bpeService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private EmpresaService empresaService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private EstadoService estadoService;
|
||||||
|
|
||||||
|
private List<Empresa> lsEmpresa;
|
||||||
|
private List<Estado> lsEstado;
|
||||||
|
|
||||||
|
private Datebox datInicial;
|
||||||
|
private Datebox datFinal;
|
||||||
|
|
||||||
|
private MyComboboxEstandar cmbEmpresa;
|
||||||
|
private MyListbox estadoList;
|
||||||
|
|
||||||
|
private Radio radSim;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void doAfterCompose(Component comp) throws Exception {
|
||||||
|
lsEmpresa = empresaService.obtenerTodos();
|
||||||
|
lsEstado = estadoService.obtenerTodos();
|
||||||
|
|
||||||
|
super.doAfterCompose(comp);
|
||||||
|
|
||||||
|
estadoList.setItemRenderer(new RenderEstadoUf());
|
||||||
|
estadoList.setData(lsEstado);
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||||
|
private void executar() throws InterruptedException {
|
||||||
|
|
||||||
|
try {
|
||||||
|
Empresa empresa = cmbEmpresa.getSelectedItem() == null ? null : (Empresa) cmbEmpresa.getSelectedItem().getValue();
|
||||||
|
List<Estado> estados = new ArrayList<Estado>();
|
||||||
|
for (Object ob : estadoList.getSelectedItemsByIndex()) {
|
||||||
|
estados.add((Estado) ob);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (estados.isEmpty()) {
|
||||||
|
Messagebox.show(Labels.getLabel("busquedaRelatorioRDIController.seleciona.estado"),
|
||||||
|
Labels.getLabel("indexController.mnImpressaoRMD.label"),
|
||||||
|
Messagebox.OK, Messagebox.ERROR);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
List<FiscalRdi> list = bpeService.buscarBpeRDI(datInicial.getValue(), datFinal.getValue(), empresa, estados, radSim.isChecked());
|
||||||
|
|
||||||
|
Map<String, Object> parametros = new HashMap<String, Object>();
|
||||||
|
parametros.put("list", list);
|
||||||
|
parametros.put("empresa", empresa.getNombempresa());
|
||||||
|
parametros.put("inicio", datInicial.getValue());
|
||||||
|
parametros.put("fim", datFinal.getValue());
|
||||||
|
parametros.put("estados", estados);
|
||||||
|
parametros.put("receitaTerceiros", radSim.isChecked());
|
||||||
|
parametros.put("usuario", UsuarioLogado.getUsuarioLogado().getClaveUsuario());
|
||||||
|
|
||||||
|
Relatorio relatorio = new RelatorioRDI(parametros, dataSourceRead.getConnection());
|
||||||
|
|
||||||
|
Map args = new HashMap();
|
||||||
|
args.put("relatorio", relatorio);
|
||||||
|
|
||||||
|
openWindow("/component/reportView.zul",
|
||||||
|
Labels.getLabel("indexController.mnRelatorioRDI.label"), args, MODAL);
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("", e);
|
||||||
|
Messagebox.show(e.getMessage(),
|
||||||
|
Labels.getLabel("indexController.mnImpressaoRMD.label"),
|
||||||
|
Messagebox.OK, Messagebox.INFORMATION);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onClick$btnExecutar(Event ev) throws InterruptedException {
|
||||||
|
executar();
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Empresa> getLsEmpresa() {
|
||||||
|
return lsEmpresa;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Estado> getLsEstado() {
|
||||||
|
return lsEstado;
|
||||||
|
}
|
||||||
|
}
|
|
@ -36,9 +36,6 @@ public class BusquedaExportacaoFiscalController extends MyGenericForwardComposer
|
||||||
|
|
||||||
private static Logger log = Logger.getLogger(BusquedaExportacaoFiscalController.class);
|
private static Logger log = Logger.getLogger(BusquedaExportacaoFiscalController.class);
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private DataSource dataSourceRead;
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private FiscalService fiscalService;
|
private FiscalService fiscalService;
|
||||||
|
|
||||||
|
|
|
@ -15,6 +15,7 @@ import org.springframework.stereotype.Controller;
|
||||||
import org.zkoss.util.resource.Labels;
|
import org.zkoss.util.resource.Labels;
|
||||||
import org.zkoss.zhtml.Messagebox;
|
import org.zkoss.zhtml.Messagebox;
|
||||||
import org.zkoss.zk.ui.Component;
|
import org.zkoss.zk.ui.Component;
|
||||||
|
import org.zkoss.zk.ui.Executions;
|
||||||
import org.zkoss.zk.ui.event.Event;
|
import org.zkoss.zk.ui.event.Event;
|
||||||
import org.zkoss.zul.Combobox;
|
import org.zkoss.zul.Combobox;
|
||||||
import org.zkoss.zul.Datebox;
|
import org.zkoss.zul.Datebox;
|
||||||
|
@ -80,6 +81,8 @@ public class BusquedaRelatorioFinanceiroController extends MyGenericForwardCompo
|
||||||
private Textbox txtPalavraPesquisa;
|
private Textbox txtPalavraPesquisa;
|
||||||
private MyListbox puntoVentaSelList;
|
private MyListbox puntoVentaSelList;
|
||||||
private Paging pagingPuntoVenta;
|
private Paging pagingPuntoVenta;
|
||||||
|
|
||||||
|
private boolean isBpe;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void doAfterCompose(Component comp) throws Exception {
|
public void doAfterCompose(Component comp) throws Exception {
|
||||||
|
@ -93,6 +96,9 @@ public class BusquedaRelatorioFinanceiroController extends MyGenericForwardCompo
|
||||||
estadoList.setData(lsEstado);
|
estadoList.setData(lsEstado);
|
||||||
puntoVentaList.setItemRenderer(new RenderPuntoVentaSimple());
|
puntoVentaList.setItemRenderer(new RenderPuntoVentaSimple());
|
||||||
puntoVentaSelList.setItemRenderer(new RenderPuntoVentaSimple());
|
puntoVentaSelList.setItemRenderer(new RenderPuntoVentaSimple());
|
||||||
|
|
||||||
|
isBpe = Executions.getCurrent().getArg().get("isRelatorioFinanceiroBpe") == null ? Boolean.FALSE : (Boolean) Executions.getCurrent().getArg().get("isRelatorioFinanceiroBpe");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||||
|
@ -130,7 +136,9 @@ public class BusquedaRelatorioFinanceiroController extends MyGenericForwardCompo
|
||||||
parametros.put("agencias", puntoVentaIds);
|
parametros.put("agencias", puntoVentaIds);
|
||||||
}
|
}
|
||||||
filtro.append(puntoVentas).append(";");
|
filtro.append(puntoVentas).append(";");
|
||||||
|
|
||||||
|
|
||||||
|
parametros.put("isBpe", isBpe);
|
||||||
parametros.put("empresa", empresa);
|
parametros.put("empresa", empresa);
|
||||||
parametros.put("nombempresa", empresa.getNombempresa());
|
parametros.put("nombempresa", empresa.getNombempresa());
|
||||||
parametros.put("tipoPuntoVenta", tipoPuntoVenta);
|
parametros.put("tipoPuntoVenta", tipoPuntoVenta);
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
package com.rjconsultores.ventaboletos.web.gui.controladores.impressaofiscal;
|
package com.rjconsultores.ventaboletos.web.gui.controladores.impressaofiscal;
|
||||||
|
|
||||||
import java.sql.SQLException;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -15,7 +14,6 @@ import org.springframework.stereotype.Controller;
|
||||||
import org.zkoss.util.resource.Labels;
|
import org.zkoss.util.resource.Labels;
|
||||||
import org.zkoss.zhtml.Messagebox;
|
import org.zkoss.zhtml.Messagebox;
|
||||||
import org.zkoss.zk.ui.Component;
|
import org.zkoss.zk.ui.Component;
|
||||||
import org.zkoss.zk.ui.WrongValueException;
|
|
||||||
import org.zkoss.zk.ui.event.Event;
|
import org.zkoss.zk.ui.event.Event;
|
||||||
import org.zkoss.zul.Datebox;
|
import org.zkoss.zul.Datebox;
|
||||||
import org.zkoss.zul.Radio;
|
import org.zkoss.zul.Radio;
|
||||||
|
|
|
@ -0,0 +1,25 @@
|
||||||
|
package com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorio.bpe;
|
||||||
|
|
||||||
|
import org.zkoss.util.resource.Labels;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria;
|
||||||
|
import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema;
|
||||||
|
|
||||||
|
public class ItemMenuBpeDevolucao extends DefaultItemMenuSistema {
|
||||||
|
|
||||||
|
public ItemMenuBpeDevolucao() {
|
||||||
|
super("indexController.mnSubMenuBpeFiscal.devolucion.label");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getClaveMenu() {
|
||||||
|
return "COM.RJCONSULTORES.ADMINISTRACION.GUI.RELATORIOS.BPE.DEVOLUCION";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void ejecutar() {
|
||||||
|
PantallaUtileria.openWindow("/gui/relatorios/filtroRelatorioDevolucaoBilhetes.zul",
|
||||||
|
Labels.getLabel("indexController.mnSubMenuBpeFiscal.devolucion.label"), getArgs(), desktop);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,24 @@
|
||||||
|
package com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorio.bpe;
|
||||||
|
|
||||||
|
import org.zkoss.util.resource.Labels;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria;
|
||||||
|
import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema;
|
||||||
|
|
||||||
|
public class ItemMenuBpeExportacao extends DefaultItemMenuSistema {
|
||||||
|
|
||||||
|
public ItemMenuBpeExportacao() {
|
||||||
|
super("indexController.mnSubMenuBpeFiscal.exportacao.label");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getClaveMenu() {
|
||||||
|
return "COM.RJCONSULTORES.ADMINISTRACION.GUI.RELATORIOS.BPE.EXPORTACAO";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void ejecutar() {
|
||||||
|
PantallaUtileria.openWindow("/gui/bpe/busquedaBpeExportacao.zul",
|
||||||
|
Labels.getLabel("indexController.mnSubMenuBpeFiscal.exportacao.label"), getArgs(), desktop);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,31 @@
|
||||||
|
package com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorio.bpe;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.zkoss.util.resource.Labels;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria;
|
||||||
|
import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema;
|
||||||
|
|
||||||
|
public class ItemMenuBpeFinanceiro extends DefaultItemMenuSistema {
|
||||||
|
|
||||||
|
public ItemMenuBpeFinanceiro() {
|
||||||
|
super("indexController.mnSubMenuBpeFiscal.financeiro.label");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getClaveMenu() {
|
||||||
|
return "COM.RJCONSULTORES.ADMINISTRACION.GUI.RELATORIOS.BPE.FINANCIERO";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void ejecutar() {
|
||||||
|
|
||||||
|
Map map = getArgs();
|
||||||
|
map.put("isRelatorioFinanceiroBpe", Boolean.TRUE);
|
||||||
|
|
||||||
|
PantallaUtileria.openWindow("/gui/impressaofiscal/busquedaRelatorioFinanceiro.zul",
|
||||||
|
Labels.getLabel("indexController.mnSubMenuBpeFiscal.financeiro.label"), map, desktop);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,24 @@
|
||||||
|
package com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorio.bpe;
|
||||||
|
|
||||||
|
import org.zkoss.util.resource.Labels;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria;
|
||||||
|
import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema;
|
||||||
|
|
||||||
|
public class ItemMenuBpeRdi extends DefaultItemMenuSistema {
|
||||||
|
|
||||||
|
public ItemMenuBpeRdi() {
|
||||||
|
super("indexController.mnSubMenuBpeFiscal.rdi.label");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getClaveMenu() {
|
||||||
|
return "COM.RJCONSULTORES.ADMINISTRACION.GUI.RELATORIOS.BPE.RDI";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void ejecutar() {
|
||||||
|
PantallaUtileria.openWindow("/gui/bpe/busquedaBpeRdi.zul",
|
||||||
|
Labels.getLabel("indexController.mnSubMenuBpeFiscal.rdi.label"), getArgs(), desktop);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,16 @@
|
||||||
|
package com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorio.bpe;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema;
|
||||||
|
|
||||||
|
public class SubMenuBpe extends DefaultItemMenuSistema {
|
||||||
|
|
||||||
|
public SubMenuBpe() {
|
||||||
|
super("indexController.mnSubMenuBpeFiscal.label");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getClaveMenu() {
|
||||||
|
return "COM.RJCONSULTORES.ADMINISTRACION.GUI.RELATORIOS.BPE";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -219,6 +219,11 @@ analitico.integracion.exportacaoFiscal.rmd=com.rjconsultores.ventaboletos.web.ut
|
||||||
analitico.integracion.exportacaoFiscal.impressaoRMD=com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorios.impressaofiscal.ItemMenuImpressaoRMD
|
analitico.integracion.exportacaoFiscal.impressaoRMD=com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorios.impressaofiscal.ItemMenuImpressaoRMD
|
||||||
analitico.integracion.exportacaoFiscal.relatorioFinanceiro=com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorios.impressaofiscal.ItemMenuRelatorioFinanceiro
|
analitico.integracion.exportacaoFiscal.relatorioFinanceiro=com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorios.impressaofiscal.ItemMenuRelatorioFinanceiro
|
||||||
analitico.integracion.exportacaoFiscal.relatorioRDI=com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorios.impressaofiscal.ItemMenuRelatorioRDI
|
analitico.integracion.exportacaoFiscal.relatorioRDI=com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorios.impressaofiscal.ItemMenuRelatorioRDI
|
||||||
|
analitico.integracion.bpe=com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorio.bpe.SubMenuBpe
|
||||||
|
analitico.integracion.bpe.exportacao=com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorio.bpe.ItemMenuBpeExportacao
|
||||||
|
analitico.integracion.bpe.rdi=com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorio.bpe.ItemMenuBpeRdi
|
||||||
|
analitico.integracion.bpe.financeiro=com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorio.bpe.ItemMenuBpeFinanceiro
|
||||||
|
analitico.integracion.bpe.devolucion=com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorio.bpe.ItemMenuBpeDevolucao
|
||||||
seguridad=com.rjconsultores.ventaboletos.web.utilerias.menu.item.seguridad.MenuSeguridad
|
seguridad=com.rjconsultores.ventaboletos.web.utilerias.menu.item.seguridad.MenuSeguridad
|
||||||
seguridad.estacion=com.rjconsultores.ventaboletos.web.utilerias.menu.item.seguridad.ItemMenuEstacion
|
seguridad.estacion=com.rjconsultores.ventaboletos.web.utilerias.menu.item.seguridad.ItemMenuEstacion
|
||||||
seguridad.autorizacion=com.rjconsultores.ventaboletos.web.utilerias.menu.item.seguridad.ItemMenuAutorizacion
|
seguridad.autorizacion=com.rjconsultores.ventaboletos.web.utilerias.menu.item.seguridad.ItemMenuAutorizacion
|
||||||
|
|
|
@ -331,6 +331,12 @@ indexController.mniExportacaoFiscalRMD.label=RMD
|
||||||
indexController.mnImpressaoRMD.label=Impressão RMD
|
indexController.mnImpressaoRMD.label=Impressão RMD
|
||||||
indexController.mnRelatorioRDI.label=Relatório RDI
|
indexController.mnRelatorioRDI.label=Relatório RDI
|
||||||
|
|
||||||
|
indexController.mnSubMenuBpeFiscal.label=BPE
|
||||||
|
indexController.mnSubMenuBpeFiscal.exportacao.label=Exportación BPE
|
||||||
|
indexController.mnSubMenuBpeFiscal.rdi.label=Reporte RDI BPE
|
||||||
|
indexController.mnSubMenuBpeFiscal.financeiro.label=Reporte Financiero BPE
|
||||||
|
indexController.mnSubMenuBpeFiscal.devolucion.label=Reporte Devolución BPE
|
||||||
|
|
||||||
indexController.mnRelatoriosFinanceiros.label=Reportes financeiros
|
indexController.mnRelatoriosFinanceiros.label=Reportes financeiros
|
||||||
|
|
||||||
indexController.mniSubMenuClientePacote.label=Paquete
|
indexController.mniSubMenuClientePacote.label=Paquete
|
||||||
|
|
|
@ -348,6 +348,12 @@ indexController.mniExportacaoFiscalRMD.label=RMD
|
||||||
indexController.mnImpressaoRMD.label=Impressão RMD
|
indexController.mnImpressaoRMD.label=Impressão RMD
|
||||||
indexController.mnRelatorioRDI.label=Relatório RDI
|
indexController.mnRelatorioRDI.label=Relatório RDI
|
||||||
|
|
||||||
|
indexController.mnSubMenuBpeFiscal.label=BPE
|
||||||
|
indexController.mnSubMenuBpeFiscal.exportacao.label=Exportação BPE
|
||||||
|
indexController.mnSubMenuBpeFiscal.rdi.label=Relatório RDI BPE
|
||||||
|
indexController.mnSubMenuBpeFiscal.financeiro.label=Relatório Financiero BPE
|
||||||
|
indexController.mnSubMenuBpeFiscal.devolucion.label=Relatório Devolução BPE
|
||||||
|
|
||||||
indexController.mnRelatoriosFinanceiros.label=Relatórios Financeiros
|
indexController.mnRelatoriosFinanceiros.label=Relatórios Financeiros
|
||||||
|
|
||||||
indexController.mniSubMenuClientePacote.label=Pacote
|
indexController.mniSubMenuClientePacote.label=Pacote
|
||||||
|
|
|
@ -0,0 +1,62 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<?page title="RelgerencialEmpresa" contentType="text/html;charset=UTF-8"?>
|
||||||
|
<?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?>
|
||||||
|
<?init class="org.zkoss.zkplus.databind.AnnotateDataBinderInit" arg0="winBusquedaBpeExportacao"?>
|
||||||
|
<?taglib uri="http://www.zkoss.org/dsp/web/core" prefix="c"?>
|
||||||
|
|
||||||
|
<zk>
|
||||||
|
<window id="winBusquedaBpeExportacao" apply="${busquedaBpeExportacaoController}"
|
||||||
|
title="${c:l('indexController.mnSubMenuBpeFiscal.exportacao.label')}"
|
||||||
|
contentStyle="overflow:auto" width="660px" border="normal">
|
||||||
|
|
||||||
|
<grid fixedLayout="true">
|
||||||
|
<columns>
|
||||||
|
<column width="20%" />
|
||||||
|
<column width="30%" />
|
||||||
|
<column width="20%" />
|
||||||
|
<column width="30%" />
|
||||||
|
</columns>
|
||||||
|
|
||||||
|
<rows>
|
||||||
|
<row>
|
||||||
|
<label
|
||||||
|
value="${c:l('busquedaImportacionFiscalController.lbDataIni.value')}" />
|
||||||
|
<datebox id="datInicial" width="90%"
|
||||||
|
format="dd/MM/yyyy" constraint="no empty"
|
||||||
|
maxlength="10" />
|
||||||
|
<label
|
||||||
|
value="${c:l('busquedaImportacionFiscalController.lbDataFin.value')}" />
|
||||||
|
<datebox id="datFinal" width="90%"
|
||||||
|
format="dd/MM/yyyy" constraint="no empty"
|
||||||
|
maxlength="10" />
|
||||||
|
</row>
|
||||||
|
|
||||||
|
<row spans="1, 3">
|
||||||
|
<label
|
||||||
|
value="${c:l('busquedaCiudadController.estado.label')}" />
|
||||||
|
<combobox id="cmbEstado"
|
||||||
|
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar"
|
||||||
|
constraint="no empty" mold="rounded" buttonVisible="true"
|
||||||
|
style="width: 483px;" model="@{winBusquedaBpeExportacao$composer.lsEstado}"/>
|
||||||
|
</row>
|
||||||
|
|
||||||
|
<row spans="1, 3">
|
||||||
|
<label
|
||||||
|
value="${c:l('relatorioReceitaDiariaAgenciaController.lbEmpresa.value')}" />
|
||||||
|
<combobox id="cmbEmpresa" style="width: 483px;" mold="rounded"
|
||||||
|
buttonVisible="true"
|
||||||
|
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar"
|
||||||
|
model="@{winBusquedaBpeExportacao$composer.lsEmpresa}"
|
||||||
|
constraint="no empty" />
|
||||||
|
</row>
|
||||||
|
</rows>
|
||||||
|
</grid>
|
||||||
|
|
||||||
|
<toolbar>
|
||||||
|
<button id="btnExeExportacao" image="/gui/img/enginer.png"
|
||||||
|
label="${c:l('busquedaExportacaoFiscalController.btnExe.label')}" />
|
||||||
|
|
||||||
|
</toolbar>
|
||||||
|
|
||||||
|
</window>
|
||||||
|
</zk>
|
|
@ -0,0 +1,73 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<?page title="RelgerencialEmpresa" contentType="text/html;charset=UTF-8"?>
|
||||||
|
<?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?>
|
||||||
|
<?init class="org.zkoss.zkplus.databind.AnnotateDataBinderInit" arg0="winBusquedaBpeRdi"?>
|
||||||
|
<?taglib uri="http://www.zkoss.org/dsp/web/core" prefix="c"?>
|
||||||
|
|
||||||
|
<zk>
|
||||||
|
<window id="winBusquedaBpeRdi"
|
||||||
|
title="${c:l('indexController.mnSubMenuBpeFiscal.rdi.label')}"
|
||||||
|
apply="${busquedaBpeRdiController}" contentStyle="overflow:auto"
|
||||||
|
width="660px" border="normal">
|
||||||
|
|
||||||
|
<grid fixedLayout="true">
|
||||||
|
<columns>
|
||||||
|
<column width="20%" />
|
||||||
|
<column width="30%" />
|
||||||
|
<column width="20%" />
|
||||||
|
<column width="30%" />
|
||||||
|
</columns>
|
||||||
|
|
||||||
|
<rows>
|
||||||
|
<row>
|
||||||
|
<label
|
||||||
|
value="${c:l('busquedaImportacionFiscalController.lbDataIni.value')}" />
|
||||||
|
<datebox id="datInicial" width="90%"
|
||||||
|
format="dd/MM/yyyy" constraint="no empty" maxlength="10" />
|
||||||
|
<label
|
||||||
|
value="${c:l('busquedaImportacionFiscalController.lbDataFin.value')}" />
|
||||||
|
<datebox id="datFinal" width="90%"
|
||||||
|
format="dd/MM/yyyy" constraint="no empty" maxlength="10" />
|
||||||
|
</row>
|
||||||
|
|
||||||
|
<row spans="1, 3">
|
||||||
|
<label
|
||||||
|
value="${c:l('busquedaRelatorioRDIController.lbEmpresa.value')}" />
|
||||||
|
<combobox id="cmbEmpresa" style="width: 483px;"
|
||||||
|
mold="rounded" buttonVisible="true"
|
||||||
|
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar"
|
||||||
|
model="@{winBusquedaBpeRdi$composer.lsEmpresa}"
|
||||||
|
constraint="no empty" />
|
||||||
|
</row>
|
||||||
|
|
||||||
|
<row spans="1, 3">
|
||||||
|
<label
|
||||||
|
value="${c:l('busquedaRelatorioRDIController.estado.label')}" />
|
||||||
|
<listbox id="estadoList" rows="10" vflex="false"
|
||||||
|
width="90%" multiple="true" checkmark="true"
|
||||||
|
use="com.rjconsultores.ventaboletos.web.utilerias.MyListbox">
|
||||||
|
</listbox>
|
||||||
|
</row>
|
||||||
|
|
||||||
|
<row spans="1, 3">
|
||||||
|
<label
|
||||||
|
value="${c:l('busquedaRelatorioRDIController.receitaTerceiros.label')}" />
|
||||||
|
<radiogroup id="receitaTerceiros">
|
||||||
|
<radio id="radSim"
|
||||||
|
label="${c:l('busquedaRelatorioRDIController.labelRadio.radSim')}"
|
||||||
|
checked="true" />
|
||||||
|
<radio id="radNao"
|
||||||
|
label="${c:l('busquedaRelatorioRDIController.labelRadio.radNao')}" />
|
||||||
|
</radiogroup>
|
||||||
|
</row>
|
||||||
|
|
||||||
|
</rows>
|
||||||
|
</grid>
|
||||||
|
|
||||||
|
<toolbar>
|
||||||
|
<button id="btnExecutar" image="/gui/img/enginer.png"
|
||||||
|
label="${c:l('busquedaRelatorioRDIController.btnExe.label')}" />
|
||||||
|
</toolbar>
|
||||||
|
|
||||||
|
</window>
|
||||||
|
</zk>
|
Loading…
Reference in New Issue