diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioReceitaDiariaAgencia.java b/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioReceitaDiariaAgencia.java index b82686402..5b09b01e7 100644 --- a/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioReceitaDiariaAgencia.java +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioReceitaDiariaAgencia.java @@ -5,13 +5,16 @@ package com.rjconsultores.ventaboletos.relatorios.impl; import java.math.BigDecimal; import java.sql.Connection; +import java.sql.Date; +import java.sql.ResultSet; import java.sql.SQLException; +import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.HashMap; import java.util.Map; import com.rjconsultores.ventaboletos.entidad.PuntoVenta; -import com.rjconsultores.ventaboletos.relatorios.utilitarios.DataSource; +import com.rjconsultores.ventaboletos.relatorios.utilitarios.ArrayDataSource; import com.rjconsultores.ventaboletos.relatorios.utilitarios.Relatorio; import com.rjconsultores.ventaboletos.web.utilerias.NamedParameterStatement; @@ -21,31 +24,43 @@ import com.rjconsultores.ventaboletos.web.utilerias.NamedParameterStatement; */ public class RelatorioReceitaDiariaAgencia extends Relatorio { - private HashMap cacheImposto; + private Map> mapCacheConfigImposto; + private Map> mapCacheConfigComissao; public RelatorioReceitaDiariaAgencia(Map parametros, Connection conexao) throws Exception { super(parametros, conexao); - this.cacheImposto = new HashMap(); + this.mapCacheConfigImposto = new HashMap>(); + this.mapCacheConfigComissao = new HashMap>(); - this.setCustomDataSource(new DataSource(this) { + this.setCustomDataSource(new ArrayDataSource(this) { + + protected HashMap> mapDados; @Override public Object valueCustomFields(String fieldName) throws Exception { - if (fieldName.equals("IMPOSTOS")) { - return getValorImposto(this.rowNum, this.resultSet.getInt("puntoventa_id"), this.resultSet.getBigDecimal("receita_tarifa"), this.resultSet.getBigDecimal("receita_seguro"), BigDecimal.ZERO, BigDecimal.ZERO); + if (fieldName.equals("RECEITA_BAGAGEM")) { + if (!(Boolean) this.relatorio.getParametros().get("B_EXCLUI_BAGAGEM")) + return getValorReceitaBagagem((Integer) this.getByName("PUNTOVENTA_ID")); + else + return BigDecimal.ZERO; + } + else if (fieldName.equals("RECEITA_TOTAL")) { + return ((BigDecimal) this.getByName("RECEITA_TARIFA")).add((BigDecimal) this.getByName("RECEITA_SEGURO")).add((BigDecimal) this.getByName("RECEITA_BAGAGEM")).subtract((BigDecimal) this.getByName("TOTAL_DEVOL")); } else if (fieldName.equals("RECEITA_LIQUIDA")) { - return this.resultSet.getBigDecimal("receita_tarifa").subtract(getValorImposto(this.rowNum, this.resultSet.getInt("puntoventa_id"), this.resultSet.getBigDecimal("receita_tarifa"), this.resultSet.getBigDecimal("receita_seguro"), BigDecimal.ZERO, BigDecimal.ZERO)); + return ((BigDecimal) this.getByName("RECEITA_TARIFA")).add((BigDecimal) this.getByName("RECEITA_SEGURO")).add((BigDecimal) this.getByName("RECEITA_BAGAGEM")).subtract((BigDecimal) this.getByName("TOTAL_DEVOL")).subtract((BigDecimal) this.getByName("IMPOSTOS")); + } + else if (fieldName.equals("DIFERENCA_COMISSAO")) { + return ((BigDecimal) this.getByName("VALOR_COMISSAO")).subtract((BigDecimal) this.getByName("ANTECIPACAO")); } return null; } - @Override - public void initDados() throws SQLException { + protected void prepareQuery() throws SQLException { Connection conexao = this.relatorio.getConexao(); Map parametros = this.relatorio.getParametros(); @@ -53,26 +68,227 @@ public class RelatorioReceitaDiariaAgencia extends Relatorio { NamedParameterStatement stmt = new NamedParameterStatement(conexao, sql); if (parametros.get("NUMPUNTOVENTA") != null) { - StringBuilder strNumPuntoVenta = new StringBuilder(); - for (PuntoVenta s : ((ArrayList) parametros.get("NUMPUNTOVENTA"))) { + for (PuntoVenta s : (ArrayList) parametros.get("NUMPUNTOVENTA")) { strNumPuntoVenta.append("," + s.getNumPuntoVenta() + ","); } - stmt.setString("NUMPUNTOVENTA", strNumPuntoVenta.toString()); } else stmt.setString("NUMPUNTOVENTA", null); - stmt.setBoolean("B_EXCLUI_BAGAGEM", (Boolean) parametros.get("B_EXCLUI_BAGAGEM")); - stmt.setNull("ESTADO_ID", java.sql.Types.INTEGER); + if (parametros.get("ESTADO_ID") != null) + stmt.setInt("ESTADO_ID", (Integer) parametros.get("ESTADO_ID")); + else + stmt.setNull("ESTADO_ID", java.sql.Types.INTEGER); + if (parametros.get("EMPRESA_ID") != null) + stmt.setInt("EMPRESA_ID", (Integer) parametros.get("EMPRESA_ID")); + else + stmt.setNull("EMPRESA_ID", java.sql.Types.INTEGER); + if (parametros.get("TIPOPTOVTA_ID") != null) + stmt.setInt("TIPOPTOVTA_ID", (Integer) parametros.get("TIPOPTOVTA_ID")); + else + stmt.setNull("TIPOPTOVTA_ID", java.sql.Types.INTEGER); + stmt.setDate("DATA_INICIO", (java.sql.Date) parametros.get("DATA_INICIO")); stmt.setDate("DATA_FINAL", (java.sql.Date) parametros.get("DATA_FINAL")); stmt.setString("ISNUMPUNTOVENTATODOS", (String) parametros.get("ISNUMPUNTOVENTATODOS")); this.resultSet = stmt.executeQuery(); + } + public void setRowComissao(Map rowOrigem) throws Exception { + Map rowDestino = rowOrigem; + + // Busca as configurações de comissão + HashMap configComissao = getConfigComissao((Integer) rowOrigem.get("PUNTOVENTA_ID"), (Integer) rowOrigem.get("EMPRESAPUNTOVENTA_ID")); + if (configComissao == null) { + return; + } + + // Verifica se existe agência de destino da comissão e atualiza a row se necessario + if ((Integer) configComissao.get("PUNTOVENTA_ID") != 0 && !((Integer) configComissao.get("PUNTOVENTA_ID")).equals(this.resultSet.getInt("PUNTOVENTA_ID"))) + rowDestino = this.getRow((Integer) configComissao.get("PUNTOVENTA_ID"), null); + + Integer puntoVentaId = (Integer) rowDestino.get("PUNTOVENTA_ID"); + BigDecimal motivoCancelacionId = this.resultSet.getBigDecimal("MOTIVOCANCELACION_ID"); + Integer tipoVentaId = this.resultSet.getInt("TIPOVENTA_ID"); + + HashMap configImposto = getConfigImposto(puntoVentaId); + if (configImposto == null) { + return; + } + + BigDecimal baseCalculo = BigDecimal.ZERO; + BigDecimal valorComissao, percComissao; + BigDecimal issComissao = (BigDecimal) configComissao.get("ISSRETIDO"); + BigDecimal royatilesComissao = (BigDecimal) configComissao.get("ROYALTIES"); + + // Defini a base de calculo da comissão + if (motivoCancelacionId == null) { + if ((Boolean) configComissao.get("TARIFARECEITA")) + baseCalculo = baseCalculo.add(this.resultSet.getBigDecimal("PRECIOPAGADO")); + if ((Boolean) configComissao.get("SEGURORECEITA")) + baseCalculo = baseCalculo.add(this.resultSet.getBigDecimal("IMPORTESEGURO")); + if ((Boolean) configComissao.get("TAXARECEITA")) + baseCalculo = baseCalculo.add(this.resultSet.getBigDecimal("IMPORTETAXAEMBARQUE")); + if ((Boolean) configComissao.get("PEDAGIORECEITA")) + baseCalculo = baseCalculo.add(this.resultSet.getBigDecimal("IMPORTEPEDAGIO")); + + // Caso esteje setado na configuração de comissão que o calculo deve ser sobre o liquido, deduz o imposto. + if (((String) configComissao.get("RECEITA")).equals("RL") && + (!tipoVentaId.equals(18) || (tipoVentaId.equals(18) && (Boolean) this.relatorio.getParametros().get("B_CONTEMPLAR_GAP")))) + baseCalculo = baseCalculo.subtract((BigDecimal) rowOrigem.get("IMPOSTO")); + + } + else { + if ((Boolean) configComissao.get("TARIFADEV")) + baseCalculo = baseCalculo.add(this.resultSet.getBigDecimal("PRECIOPAGADO")); + if ((Boolean) configComissao.get("SEGURO_DEV")) + baseCalculo = baseCalculo.add(this.resultSet.getBigDecimal("IMPORTESEGURO")); + if ((Boolean) configComissao.get("TAXADEV")) + baseCalculo = baseCalculo.add(this.resultSet.getBigDecimal("IMPORTETAXAEMBARQUE")); + if ((Boolean) configComissao.get("PEDAGIODEV")) + baseCalculo = baseCalculo.add(this.resultSet.getBigDecimal("IMPORTEPEDAGIO")); + } + + // Verifica se na tabela de impostos por empresa, o mes da corrida esta marcado como alta ou baixa temporada + + Date fecCorrida = this.resultSet.getDate("FECCORRIDA"); + String mes = new SimpleDateFormat("M").format(fecCorrida); + Boolean isAltaTemporada = ((mes.equals("1") && (Boolean) configImposto.get("INDJANEIRO")) || (mes.equals("2") && (Boolean) configImposto.get("INDFEVEREIRO")) + || (mes.equals("3") && (Boolean) configImposto.get("INDMARCO")) || (mes.equals("4") && (Boolean) configImposto.get("INDJABRIL")) + || (mes.equals("5") && (Boolean) configImposto.get("INDMAIO")) || (mes.equals("6") && (Boolean) configImposto.get("INDJUNHO")) + || (mes.equals("7") && (Boolean) configImposto.get("INDJULHO")) || (mes.equals("8") && (Boolean) configImposto.get("INDAGOSTO")) + || (mes.equals("9") && (Boolean) configImposto.get("INDSETEMBRO")) || (mes.equals("10") && (Boolean) configImposto.get("INDOUTUBRO")) + || (mes.equals("11") && (Boolean) configImposto.get("INDNOVEMBRO")) || (mes.equals("12") && (Boolean) configImposto.get("INDDEZEMBRO"))) ? true : false; + + percComissao = isAltaTemporada ? (BigDecimal) configComissao.get("PASSAGEMALTA") : (BigDecimal) configComissao.get("PASSAGEMBAIXA"); + + // VALOR COMISSAO = BASE DE CALCULO * (PERCENTUAL COMISSAO / 100) + valorComissao = baseCalculo.multiply(percComissao.divide(BigDecimal.valueOf(100))); + + // Deduz o ISS: VALOR COMISSAO = VALOR COMISSAO * (PERCENTUAL ISS / 100) - 1 + if (issComissao != null && !issComissao.equals(BigDecimal.ZERO)) { + BigDecimal fator = BigDecimal.ONE.subtract(issComissao.divide(BigDecimal.valueOf(100))); + valorComissao = valorComissao.multiply(fator); + } + + // Deduz os royatiles + if (royatilesComissao != null && !royatilesComissao.equals(BigDecimal.ZERO)) { + BigDecimal fator = BigDecimal.ONE.subtract(royatilesComissao.divide(BigDecimal.valueOf(100))); + valorComissao = valorComissao.multiply(fator); + } + + rowDestino.put("VALOR_COMISSAO", ((BigDecimal) rowDestino.get("VALOR_COMISSAO")).add(!tipoVentaId.equals(18) ? valorComissao : BigDecimal.ZERO)); + + // Se a agencia de destino não estiver na listagem, finaliza o preenchimento do map e adiciona na listagem + if (!mapDados.containsKey(puntoVentaId)) { + + rowDestino.put("PUNTOVENTA_ID", configComissao.get("PUNTOVENTA_ID")); + rowDestino.put("CVEESTADO", configComissao.get("CVEESTADO")); + rowDestino.put("NUMPUNTOVENTA", configComissao.get("NUMPUNTOVENTA")); + rowDestino.put("NOMBPUNTOVENTA", configComissao.get("NOMBPUNTOVENTA")); + rowDestino.put("EMPRESAPUNTOVENTA_ID", rowOrigem.get("EMPRESAPUNTOVENTA_ID")); + rowDestino.put("ESTADO_ID", configComissao.get("ESTADO_ID")); + rowDestino.put("TIPO_AGENCIA", configComissao.get("TIPO_AGENCIA")); + + mapDados.put(puntoVentaId, (HashMap) rowDestino); + } + } + + protected Map getRow(Integer puntoVentaId, ResultSet rs) throws SQLException { + + Map row; + if (mapDados.containsKey(puntoVentaId)) { + row = mapDados.get(puntoVentaId); + } + else + { + row = new HashMap(); + row.put("TOTAL_BILHETES", BigDecimal.ZERO); + row.put("TOTAL_BILHETES_CANC", BigDecimal.ZERO); + row.put("TOTAL_BILHETES_GAP", BigDecimal.ZERO); + row.put("RECEITA_TARIFA", BigDecimal.ZERO); + row.put("RECEITA_TARIFA_GAP", BigDecimal.ZERO); + row.put("RECEITA_SEGURO", BigDecimal.ZERO); + row.put("RECEITA_SEGURO_GAP", BigDecimal.ZERO); + row.put("RECEITA_EMBARQUE", BigDecimal.ZERO); + row.put("RECEITA_EMBARQUE_GAP", BigDecimal.ZERO); + row.put("RECEITA_OUTROS", BigDecimal.ZERO); + row.put("RECEITA_OUTROS_GAP", BigDecimal.ZERO); + row.put("RECEITA_PEDAGIO", BigDecimal.ZERO); + row.put("RECEITA_PEDAGIO_GAP", BigDecimal.ZERO); + row.put("RECEITA_BAGAGEM", BigDecimal.ZERO); + row.put("TOTAL_DEVOL", BigDecimal.ZERO); + row.put("TOTAL_DEVOL_GAP", BigDecimal.ZERO); + row.put("IMPOSTOS", BigDecimal.ZERO); + row.put("VALOR_COMISSAO", BigDecimal.ZERO); + + row.put("ANTECIPACAO", getValorAntecipacaoComissao(puntoVentaId)); + + if (rs != null) { + row.put("PUNTOVENTA_ID", rs.getInt("PUNTOVENTA_ID")); + row.put("CVEESTADO", rs.getString("CVEESTADO")); + row.put("NUMPUNTOVENTA", rs.getString("NUMPUNTOVENTA")); + row.put("NOMBPUNTOVENTA", rs.getString("NOMBPUNTOVENTA")); + row.put("EMPRESAPUNTOVENTA_ID", rs.getInt("EMPRESAPUNTOVENTA_ID")); + row.put("ESTADO_ID", rs.getBigDecimal("ESTADO_ID")); + row.put("TIPO_AGENCIA", rs.getString("TIPO_AGENCIA")); + } + + } + return row; + } + + @Override + public void initDados() throws Exception { + + this.prepareQuery(); + this.mapDados = new HashMap>(); + + while (this.resultSet.next()) { + + Integer puntoVentaId = this.resultSet.getInt("PUNTOVENTA_ID"); + BigDecimal motivoCancelacionId = this.resultSet.getBigDecimal("MOTIVOCANCELACION_ID"); + Integer tipoVentaId = this.resultSet.getInt("TIPOVENTA_ID"); + + // Inicializa a row atual + Map row = this.getRow(puntoVentaId, this.resultSet); + this.mapDados.put((Integer) row.get("PUNTOVENTA_ID"), (HashMap) row); + + row.put("TOTAL_BILHETES", ((BigDecimal) row.get("TOTAL_BILHETES")).add(motivoCancelacionId == null && !tipoVentaId.equals(18) ? BigDecimal.ONE : BigDecimal.ZERO)); + row.put("TOTAL_BILHETES_GAP", ((BigDecimal) row.get("TOTAL_BILHETES_GAP")).add(motivoCancelacionId == null && tipoVentaId.equals(18) ? BigDecimal.ONE : BigDecimal.ZERO)); + row.put("TOTAL_BILHETES_CANC", ((BigDecimal) row.get("TOTAL_BILHETES_CANC")).add(motivoCancelacionId != null ? BigDecimal.ONE : BigDecimal.ZERO)); + + if (motivoCancelacionId == null) { + + row.put("RECEITA_TARIFA", ((BigDecimal) row.get("RECEITA_TARIFA")).add(!tipoVentaId.equals(18) ? this.resultSet.getBigDecimal("PRECIOPAGADO") : BigDecimal.ZERO)); + row.put("RECEITA_TARIFA_GAP", ((BigDecimal) row.get("RECEITA_TARIFA_GAP")).add(tipoVentaId.equals(18) ? this.resultSet.getBigDecimal("PRECIOPAGADO") : BigDecimal.ZERO)); + row.put("RECEITA_SEGURO", ((BigDecimal) row.get("RECEITA_SEGURO")).add(!tipoVentaId.equals(18) && this.resultSet.getBigDecimal("IMPORTESEGURO") != null ? this.resultSet.getBigDecimal("IMPORTESEGURO") : BigDecimal.ZERO)); + row.put("RECEITA_SEGURO_GAP", ((BigDecimal) row.get("RECEITA_SEGURO_GAP")).add(tipoVentaId.equals(18) ? this.resultSet.getBigDecimal("IMPORTESEGURO") : BigDecimal.ZERO)); + row.put("RECEITA_EMBARQUE", ((BigDecimal) row.get("RECEITA_EMBARQUE")).add(!tipoVentaId.equals(18) && this.resultSet.getBigDecimal("IMPORTETAXAEMBARQUE") != null ? this.resultSet.getBigDecimal("IMPORTETAXAEMBARQUE") : BigDecimal.ZERO)); + row.put("RECEITA_EMBARQUE_GAP", ((BigDecimal) row.get("RECEITA_EMBARQUE_GAP")).add(tipoVentaId.equals(18) && this.resultSet.getBigDecimal("IMPORTETAXAEMBARQUE") != null ? this.resultSet.getBigDecimal("IMPORTETAXAEMBARQUE") : BigDecimal.ZERO)); + row.put("RECEITA_OUTROS", ((BigDecimal) row.get("RECEITA_OUTROS")).add(!tipoVentaId.equals(18) && this.resultSet.getBigDecimal("IMPORTEOUTROS") != null ? this.resultSet.getBigDecimal("IMPORTEOUTROS") : BigDecimal.ZERO)); + row.put("RECEITA_OUTROS_GAP", ((BigDecimal) row.get("RECEITA_OUTROS_GAP")).add(tipoVentaId.equals(18) && this.resultSet.getBigDecimal("IMPORTEOUTROS") != null ? this.resultSet.getBigDecimal("IMPORTEOUTROS") : BigDecimal.ZERO)); + row.put("RECEITA_PEDAGIO", ((BigDecimal) row.get("RECEITA_PEDAGIO")).add(!tipoVentaId.equals(18) && this.resultSet.getBigDecimal("IMPORTEPEDAGIO") != null ? this.resultSet.getBigDecimal("IMPORTEPEDAGIO") : BigDecimal.ZERO)); + row.put("RECEITA_PEDAGIO_GAP", ((BigDecimal) row.get("RECEITA_PEDAGIO_GAP")).add(tipoVentaId.equals(18) && this.resultSet.getBigDecimal("IMPORTEPEDAGIO") != null ? this.resultSet.getBigDecimal("IMPORTEPEDAGIO") : BigDecimal.ZERO)); + row.put("IMPOSTOS", ((BigDecimal) row.get("IMPOSTOS")).add(!tipoVentaId.equals(18) || (tipoVentaId.equals(18) && (Boolean) this.relatorio.getParametros().get("B_CONTEMPLAR_GAP")) ? getValorImposto(puntoVentaId, this.resultSet.getString("INTERESTADUAL"), this.resultSet.getBigDecimal("PRECIOPAGADO"), this.resultSet.getBigDecimal("IMPORTESEGURO"), this.resultSet.getBigDecimal("IMPORTETAXAEMBARQUE"), this.resultSet.getBigDecimal("IMPORTEPEDAGIO")) : BigDecimal.ZERO)); + // Realiza os calculos de comissão se o tipo de venda não for "EM ABERTO" e se for venda normal, ou se for GAP e o check estiver marcado + if (!tipoVentaId.equals(9) && (!tipoVentaId.equals(18) || (tipoVentaId.equals(18) && (Boolean) this.relatorio.getParametros().get("B_CONTEMPLAR_GAP")))) + this.setRowComissao(row); + } + else { + // Verificia se a devolução é pra ser contabilizada na agência de destino ou de origem da venda + if (((Integer) this.relatorio.getParametros().get("ISDEVOLUCAODESTINO")).equals(1) || (((Integer) this.relatorio.getParametros().get("ISDEVOLUCAODESTINO")).equals(0) && this.resultSet.getInt("POSSUI_CANC") == 1)) { + row.put("TOTAL_DEVOL", ((BigDecimal) row.get("TOTAL_DEVOL")).add((motivoCancelacionId.equals(31) || motivoCancelacionId.equals(32)) && !tipoVentaId.equals(18) ? this.resultSet.getBigDecimal("PRECIOPAGADO") : BigDecimal.ZERO)); + row.put("TOTAL_DEVOL_GAP", ((BigDecimal) row.get("TOTAL_DEVOL_GAP")).add((motivoCancelacionId.equals(31) || motivoCancelacionId.equals(32)) && tipoVentaId.equals(18) ? this.resultSet.getBigDecimal("PRECIOPAGADO") : BigDecimal.ZERO)); + } + } + + } + this.dados = new ArrayList>(this.mapDados.values()); } }); @@ -87,19 +303,336 @@ public class RelatorioReceitaDiariaAgencia extends Relatorio { public void processaParametros() throws Exception { } - public BigDecimal getValorImposto(Integer puntoVentaId, BigDecimal tarifa, BigDecimal seguro, BigDecimal embarque, BigDecimal pedagio) { + public HashMap getConfigComissao(Integer puntoVentaId, Integer empresaId) throws Exception { - return tarifa.add(seguro).multiply(BigDecimal.valueOf(0.10)); + HashMap cacheConfig = null; + + // Verifica se já existe configuração na memoria, caso não exista, realiza busca no banco + if (!mapCacheConfigComissao.containsKey(puntoVentaId.toString() + "_" + empresaId.toString())) { + StringBuilder sql = new StringBuilder(); + + sql.append(" SELECT PC.ISSRETIDO, PC.ROYALTIES, PC.ENVIARRECIBO, PC.RECEITA, PC.CODAG, PC.PASSAGEMALTA, PC.PASSAGEMBAIXA, "); + sql.append(" PC.SEGUROALTA, PC.SEGUROBAIXA, PC.OUTROSBAIXA, PC.OUTROSALTA, PC.EXCESSOALTA, PC.EXCESSOBAIXA, "); + sql.append(" PC.TARIFARECEITA, PC.SEGURORECEITA, PC.TAXARECEITA, PC.PEDAGIORECEITA, TP.CVEPTOVTA TIPO_AGENCIA, "); + sql.append(" PC.TARIFADEV, PC.SEGURO_DEV, PC.TAXADEV, PC.PEDAGIODEV, PV.PUNTOVENTA_ID, PV.NUMPUNTOVENTA, PV.NOMBPUNTOVENTA, "); + sql.append(" ES.CVEESTADO, ES.ESTADO_ID "); + sql.append(" FROM PTOVTA_COMISSAO PC, "); + sql.append(" PUNTO_VENTA PV, "); + sql.append(" PARADA PR, "); + sql.append(" CIUDAD CD, "); + sql.append(" ESTADO ES, "); + sql.append(" TIPO_PTOVTA TP "); + sql.append(" WHERE PC.EMPRESA_ID = :EMPRESA_ID "); + sql.append(" AND PC.PUNTOVENTA_ID = :PUNTOVENTA_ID "); + sql.append(" AND PC.PTOVTADESCOMISSAO_ID = PV.PUNTOVENTA_ID(+) "); + sql.append(" AND PV.PARADA_ID = PR.PARADA_ID(+) "); + sql.append(" AND PR.CIUDAD_ID = CD.CIUDAD_ID(+) "); + sql.append(" AND CD.ESTADO_ID = ES.ESTADO_ID(+) "); + sql.append(" AND PV.TIPOPTOVTA_ID = TP.TIPOPTOVTA_ID(+) "); + + NamedParameterStatement stmt = new NamedParameterStatement(this.getConexao(), sql.toString()); + stmt.setInt("PUNTOVENTA_ID", puntoVentaId); + stmt.setInt("EMPRESA_ID", empresaId); + + ResultSet rs = stmt.executeQuery(); + + if (rs.next()) { + cacheConfig = new HashMap(); + + cacheConfig.put("ISSRETIDO", rs.getBigDecimal("ISSRETIDO")); + cacheConfig.put("ROYALTIES", rs.getBigDecimal("ROYALTIES")); + cacheConfig.put("PASSAGEMALTA", rs.getBigDecimal("PASSAGEMALTA")); + cacheConfig.put("PASSAGEMBAIXA", rs.getBigDecimal("PASSAGEMBAIXA")); + cacheConfig.put("SEGUROALTA", rs.getBigDecimal("SEGUROALTA")); + cacheConfig.put("SEGUROBAIXA", rs.getBigDecimal("SEGUROBAIXA")); + cacheConfig.put("OUTROSALTA", rs.getBigDecimal("OUTROSALTA")); + cacheConfig.put("OUTROSBAIXA", rs.getBigDecimal("OUTROSBAIXA")); + cacheConfig.put("EXCESSOALTA", rs.getBigDecimal("EXCESSOALTA")); + cacheConfig.put("EXCESSOBAIXA", rs.getBigDecimal("EXCESSOBAIXA")); + + cacheConfig.put("TARIFARECEITA", rs.getBoolean("TARIFARECEITA")); + cacheConfig.put("SEGURORECEITA", rs.getBoolean("SEGURORECEITA")); + cacheConfig.put("TAXARECEITA", rs.getBoolean("TAXARECEITA")); + cacheConfig.put("PEDAGIORECEITA", rs.getBoolean("PEDAGIORECEITA")); + cacheConfig.put("TARIFADEV", rs.getBoolean("TARIFADEV")); + cacheConfig.put("SEGURO_DEV", rs.getBoolean("SEGURO_DEV")); + cacheConfig.put("TAXADEV", rs.getBoolean("TAXADEV")); + cacheConfig.put("PEDAGIODEV", rs.getBoolean("PEDAGIODEV")); + + cacheConfig.put("RECEITA", rs.getString("RECEITA")); + cacheConfig.put("TIPO_AGENCIA", rs.getString("TIPO_AGENCIA")); + cacheConfig.put("NUMPUNTOVENTA", rs.getString("NUMPUNTOVENTA")); + cacheConfig.put("NOMBPUNTOVENTA", rs.getString("NOMBPUNTOVENTA")); + cacheConfig.put("CVEESTADO", rs.getString("CVEESTADO")); + + cacheConfig.put("ESTADO_ID", rs.getInt("ESTADO_ID")); + cacheConfig.put("PUNTOVENTA_ID", rs.getInt("PUNTOVENTA_ID")); + + mapCacheConfigComissao.put(puntoVentaId.toString() + "_" + empresaId.toString(), cacheConfig); + + rs.close(); + stmt.close(); + + } + else { + StringBuilder sqlParam = new StringBuilder(); + + sqlParam.append(" SELECT EM.NOMBEMPRESA, PV.NOMBPUNTOVENTA "); + sqlParam.append(" FROM EMPRESA EM, "); + sqlParam.append(" PUNTO_VENTA PV "); + sqlParam.append(" WHERE EM.EMPRESA_ID = :EMPRESA_ID "); + sqlParam.append(" AND PV.PUNTOVENTA_ID = :PUNTOVENTA_ID "); + + NamedParameterStatement stmtParam = new NamedParameterStatement(this.getConexao(), sqlParam.toString()); + stmtParam.setInt("PUNTOVENTA_ID", puntoVentaId); + stmtParam.setInt("EMPRESA_ID", empresaId); + + ResultSet rsParam = stmtParam.executeQuery(); + + if (rsParam.next()) + this.addInfoMsg("Não foi possivel obter a configuração de comissão do ponto de venda: " + rsParam.getString("NOMBPUNTOVENTA") + " empresa: " + rsParam.getString("NOMBEMPRESA") + " ."); + + rsParam.close(); + stmtParam.close(); + } + + } + else + cacheConfig = mapCacheConfigComissao.get(puntoVentaId.toString() + "_" + empresaId.toString()); + + return cacheConfig; } - public BigDecimal getValorImposto(Integer rowResultSet, Integer puntoVentaId, BigDecimal tarifa, BigDecimal seguro, BigDecimal embarque, BigDecimal pedagio) { + public HashMap getConfigImposto(Integer puntoVentaId) throws Exception { + HashMap cacheConfig = null; - if (this.cacheImposto.containsKey(rowResultSet)) - return (BigDecimal) this.cacheImposto.get(rowResultSet); + // Verifica se já existe configuração na memoria, caso não exista, realiza busca no banco + if (!mapCacheConfigImposto.containsKey(puntoVentaId.toString())) { + + StringBuilder sql = new StringBuilder(); + + sql.append("SELECT EI.*, ES.NOMBESTADO, EM.NOMBEMPRESA "); + sql.append(" FROM PUNTO_VENTA PV, PARADA PR, CIUDAD CD, EMPRESA_IMPOSTO EI, ESTADO ES, EMPRESA EM "); + sql.append("WHERE PV.PUNTOVENTA_ID = :PUNTOVENTA_ID "); + sql.append(" AND PV.PARADA_ID = PR.PARADA_ID "); + sql.append(" AND PR.CIUDAD_ID = CD.CIUDAD_ID "); + sql.append(" AND CD.ESTADO_ID = EI.ESTADO_ID (+) "); + sql.append(" AND PV.EMPRESA_ID = NVL(EI.EMPRESA_ID, PV.EMPRESA_ID) "); + sql.append(" AND CD.ESTADO_ID = ES.ESTADO_ID "); + sql.append(" AND PV.EMPRESA_ID = EM.EMPRESA_ID "); + sql.append(" AND NVL(EI.ACTIVO, 1) = 1 "); + + + NamedParameterStatement stmt = new NamedParameterStatement(this.getConexao(), sql.toString()); + stmt.setInt("PUNTOVENTA_ID", puntoVentaId); + + ResultSet rs = stmt.executeQuery(); + + if (rs.next()) { + + if (rs.getBigDecimal("ICMS") != null) { + cacheConfig = new HashMap(); + + cacheConfig.put("PORCREDBASEICMS", rs.getBigDecimal("PORCREDBASEICMS")); + cacheConfig.put("PORCREDESTADUAL", rs.getBigDecimal("PORCREDESTADUAL")); + cacheConfig.put("INDTARIFAESTADUAL", rs.getBoolean("INDTARIFAESTADUAL")); + cacheConfig.put("INDSEGUROESTADUAL", rs.getBoolean("INDSEGUROESTADUAL")); + cacheConfig.put("INDTXEMBARQUEESTADUAL", rs.getBoolean("INDTXEMBARQUEESTADUAL")); + cacheConfig.put("INDPEDAGIOESTDUAL", rs.getBoolean("INDPEDAGIOESTDUAL")); + cacheConfig.put("PORCREDMUNICIPAL", rs.getBigDecimal("PORCREDMUNICIPAL")); + cacheConfig.put("INDTARIFAMUNICIPAL", rs.getBoolean("INDTARIFAMUNICIPAL")); + cacheConfig.put("INDSEGUROMUNICIPAL", rs.getBoolean("INDSEGUROMUNICIPAL")); + cacheConfig.put("INDTXEMBARQUEMUNICIPAL", rs.getBoolean("INDTXEMBARQUEMUNICIPAL")); + cacheConfig.put("INDPEDAGIOMUNICIPAL", rs.getBoolean("INDPEDAGIOMUNICIPAL")); + + cacheConfig.put("INDJANEIRO", rs.getBoolean("INDJANEIRO")); + cacheConfig.put("INDFEVEREIRO", rs.getBoolean("INDFEVEREIRO")); + cacheConfig.put("INDMARCO", rs.getBoolean("INDMARCO")); + cacheConfig.put("INDABRIL", rs.getBoolean("INDABRIL")); + cacheConfig.put("INDMAIO", rs.getBoolean("INDMAIO")); + cacheConfig.put("INDJUNHO", rs.getBoolean("INDJUNHO")); + cacheConfig.put("INDJULHO", rs.getBoolean("INDJULHO")); + cacheConfig.put("INDAGOSTO", rs.getBoolean("INDAGOSTO")); + cacheConfig.put("INDSETEMBRO", rs.getBoolean("INDSETEMBRO")); + cacheConfig.put("INDOUTUBRO", rs.getBoolean("INDOUTUBRO")); + cacheConfig.put("INDNOVEMBRO", rs.getBoolean("INDNOVEMBRO")); + cacheConfig.put("INDDEZEMBRO", rs.getBoolean("INDDEZEMBRO")); + + cacheConfig.put("ICMS", rs.getBigDecimal("ICMS")); + cacheConfig.put("PORCREDBASEICMS", rs.getBigDecimal("PORCREDBASEICMS")); + + this.mapCacheConfigImposto.put(puntoVentaId.toString(), cacheConfig); + } + else + { + this.addInfoMsg("Não foi possivel obter a configuração de imposto para o estado: " + rs.getString("NOMBESTADO") + " empresa: " + rs.getString("NOMBEMPRESA")); + + } + + rs.close(); + stmt.close(); + + } + else { + } + } + else + cacheConfig = mapCacheConfigImposto.get(puntoVentaId.toString()); + + return cacheConfig; + } + + public BigDecimal getValorImposto(Integer puntoVentaId, String indInterestadual, BigDecimal tarifa, BigDecimal seguro, BigDecimal embarque, BigDecimal pedagio) throws Exception { + + HashMap configImposto = new HashMap(); + + BigDecimal baseCalculo = BigDecimal.ZERO; + BigDecimal icms; + BigDecimal porcRedEstadual; + BigDecimal porcRedMunicipal; + BigDecimal porcRedBaseIcms; + + BigDecimal valorIcms = BigDecimal.ZERO; + + Boolean indTarifaMunicipal; + Boolean indSeguroMunicipal; + Boolean indTxEmbarqueMunicipal; + Boolean indPedagioMunicipal; + Boolean indTarifaEstadual; + Boolean indSeguroEstadual; + Boolean indTxEmbarqueEstadual; + Boolean indPedagioEstadual; + + configImposto = this.getConfigImposto(puntoVentaId); + + if (configImposto == null) + return BigDecimal.ZERO; + + icms = (BigDecimal) configImposto.get("ICMS"); + porcRedBaseIcms = (BigDecimal) configImposto.get("PORCREDBASEICMS"); + + if (indInterestadual.equals("S")) { + porcRedEstadual = (BigDecimal) configImposto.get("PORCREDESTADUAL"); + + indTarifaEstadual = (Boolean) configImposto.get("INDTARIFAESTADUAL"); + indSeguroEstadual = (Boolean) configImposto.get("INDSEGUROESTADUAL"); + indTxEmbarqueEstadual = (Boolean) configImposto.get("INDTXEMBARQUEESTADUAL"); + indPedagioEstadual = (Boolean) configImposto.get("INDPEDAGIOESTDUAL"); + + // System.out.println(" Tarifa: "+ tarifa +" seguro: "+ seguro +" embarque: "+ embarque +" pedagio: "+ pedagio); + + // Criação da base de calculo + baseCalculo = indTarifaEstadual && tarifa != null ? baseCalculo.add(tarifa) : BigDecimal.ZERO; + baseCalculo = indSeguroEstadual && seguro != null ? baseCalculo.add(seguro) : BigDecimal.ZERO; + baseCalculo = indTxEmbarqueEstadual && embarque != null ? baseCalculo.add(embarque) : BigDecimal.ZERO; + baseCalculo = indPedagioEstadual && pedagio != null ? baseCalculo.add(pedagio) : BigDecimal.ZERO; + + // Redução da base de calculo + if (porcRedBaseIcms != null && porcRedBaseIcms.equals(BigDecimal.ZERO)) + // BASE DE CALCULO = BASE DE CALCULO - ((PERCENTUAL DE REDUÇÃO / 100) * BASE DE CALCULO )) + baseCalculo = baseCalculo.subtract(porcRedBaseIcms.divide(BigDecimal.valueOf(100)).multiply(baseCalculo)); + + // Calcula o valor do ICMS + valorIcms = baseCalculo.multiply(icms.divide(BigDecimal.valueOf(100))); + + // Redução estadual + if (porcRedEstadual != null && porcRedEstadual.equals(BigDecimal.ZERO)) + valorIcms = valorIcms.subtract(porcRedEstadual.divide(BigDecimal.valueOf(100)).multiply(valorIcms)); + + // System.out.println("INTER BASE DE CALCULO: "+baseCalculo+" VALOR ICMS: "+ valorIcms); + + } else { - this.cacheImposto.put(rowResultSet, this.getValorImposto(puntoVentaId, tarifa, seguro, embarque, pedagio)); - return this.cacheImposto.get(rowResultSet); + porcRedMunicipal = (BigDecimal) configImposto.get("PORCREDMUNICIPAL"); + + indTarifaMunicipal = (Boolean) configImposto.get("INDTARIFAMUNICIPAL"); + indSeguroMunicipal = (Boolean) configImposto.get("INDSEGUROMUNICIPAL"); + indTxEmbarqueMunicipal = (Boolean) configImposto.get("INDTXEMBARQUEMUNICIPAL"); + indPedagioMunicipal = (Boolean) configImposto.get("INDPEDAGIOMUNICIPAL"); + + baseCalculo = indTarifaMunicipal && tarifa != null ? baseCalculo.add(tarifa) : BigDecimal.ZERO; + baseCalculo = indSeguroMunicipal && seguro != null ? baseCalculo.add(seguro) : BigDecimal.ZERO; + baseCalculo = indTxEmbarqueMunicipal && embarque != null ? baseCalculo.add(embarque) : BigDecimal.ZERO; + baseCalculo = indPedagioMunicipal && pedagio != null ? baseCalculo.add(pedagio) : BigDecimal.ZERO; + + // Redução da base de calculo + if (porcRedBaseIcms != null && porcRedBaseIcms.equals(BigDecimal.ZERO)) + // BASE DE CALCULO = BASE DE CALCULO - ((PERCENTUAL DE REDUÇÃO / 100) * BASE DE CALCULO )) + baseCalculo = baseCalculo.subtract(porcRedBaseIcms.divide(BigDecimal.valueOf(100)).multiply(baseCalculo)); + + // Calcula o valor do ICMS + valorIcms = baseCalculo.multiply(icms.divide(BigDecimal.valueOf(100))); + + // Redução estadual + if (porcRedMunicipal != null && porcRedMunicipal.equals(BigDecimal.ZERO)) + valorIcms = valorIcms.subtract(porcRedMunicipal.divide(BigDecimal.valueOf(100)).multiply(valorIcms)); + + // System.out.println("MUN BASE DE CALCULO: "+baseCalculo+" VALOR ICMS: "+ valorIcms); + + } + + return valorIcms; + + } + + public BigDecimal getValorReceitaBagagem(Integer puntoVentaId) throws SQLException { + StringBuilder sql = new StringBuilder(); + sql.append(" SELECT SUM(CASE "); + sql.append(" WHEN EE.TIPOEVENTOEXTRA_ID = 1 AND EE.ACTIVO = 1 THEN "); + sql.append(" EE.IMPINGRESO "); + sql.append(" END) RECEITA_BAGAGEM "); + sql.append(" FROM EVENTO_EXTRA EE "); + sql.append(" WHERE TRUNC(EE.FECHORINGRESO) BETWEEN :DATA_INICIO AND "); + sql.append(" :DATA_FINAL "); + sql.append(" AND EE.PUNTOVENTA_ID = :PUNTOVENTA_ID "); + + NamedParameterStatement stmt = new NamedParameterStatement(this.getConexao(), sql.toString()); + stmt.setInt("PUNTOVENTA_ID", puntoVentaId); + stmt.setDate("DATA_INICIO", (java.sql.Date) this.getParametros().get("DATA_INICIO")); + stmt.setDate("DATA_FINAL", (java.sql.Date) this.getParametros().get("DATA_FINAL")); + + ResultSet rs = stmt.executeQuery(); + if (rs.next()) { + BigDecimal receitaBagagem = rs.getBigDecimal("RECEITA_BAGAGEM"); + rs.close(); + stmt.close(); + return receitaBagagem; + } + else { + rs.close(); + stmt.close(); + return BigDecimal.ZERO; + } + + } + + public BigDecimal getValorAntecipacaoComissao(Integer puntoVentaId) throws SQLException { + StringBuilder sql = new StringBuilder(); + + sql.append(" SELECT SUM(PA.RETEM) TOTAL_ANTECIPACAO "); + sql.append(" FROM PTOVTA_ANTECIPACOMISSAO PA "); + sql.append(" WHERE PA.ACTIVO = 1 "); + sql.append(" AND PA.DATA BETWEEN :DATA_INICIO AND "); + sql.append(" :DATA_FINAL "); + sql.append(" AND PA.PUNTOVENTA_ID = :PUNTOVENTA_ID "); + + NamedParameterStatement stmt = new NamedParameterStatement(this.getConexao(), sql.toString()); + stmt.setInt("PUNTOVENTA_ID", puntoVentaId); + stmt.setDate("DATA_INICIO", (java.sql.Date) this.getParametros().get("DATA_INICIO")); + stmt.setDate("DATA_FINAL", (java.sql.Date) this.getParametros().get("DATA_FINAL")); + + ResultSet rs = stmt.executeQuery(); + if (rs.next()) { + BigDecimal antecipacaoComissao = rs.getBigDecimal("TOTAL_ANTECIPACAO"); + rs.close(); + stmt.close(); + return (antecipacaoComissao == null) ? BigDecimal.ZERO : antecipacaoComissao; + } + else { + rs.close(); + stmt.close(); + return BigDecimal.ZERO; } } @@ -108,200 +641,70 @@ public class RelatorioReceitaDiariaAgencia extends Relatorio { StringBuilder sql = new StringBuilder(); - sql.append(" select tab1.*, "); - sql.append(" (tab1.receita_tarifa + tab1.receita_bagagem + tab1.receita_seguro + "); - sql.append(" tab1.receita_tarifa_gap + tab1.receita_seguro_gap - "); - sql.append(" tab1.total_devol - tab1.total_devol_gap) receita_total, "); - sql.append(" 0 impostos, "); - sql.append(" ((tab1.receita_tarifa + tab1.receita_bagagem + tab1.receita_seguro + "); - sql.append(" tab1.receita_tarifa_gap + tab1.receita_seguro_gap - "); - sql.append(" tab1.total_devol - tab1.total_devol_gap) - 0) receita_liquida, "); - sql.append(" 0 percentual_comissao, "); - sql.append(" 0 valor_comissao, "); - sql.append(" 0 diferenca_comissao, "); - sql.append(" '' tipo_agencia "); - sql.append(" from (select tab.cveestado, "); - sql.append(" tab.puntoventa_id, "); - sql.append(" tab.empresapuntoventa_id, "); - sql.append(" tab.estado_id, "); - sql.append(" tab.numpuntoventa, "); - sql.append(" tab.nombpuntoventa, "); - sql.append(" tab.total_bilhetes, "); - sql.append(" tab.total_bilhetes_gap, "); - sql.append(" tab.receita_tarifa receita_tarifa, "); - sql.append(" tab.receita_seguro receita_seguro, "); - sql.append(" decode( :B_EXCLUI_BAGAGEM , "); - sql.append(" 0, "); - sql.append(" nvl(sum(case "); - sql.append(" when ee.tipoeventoextra_id = 1 and ee.activo = 1 then "); - sql.append(" ee.impingreso "); - sql.append(" end), "); - sql.append(" 0), "); - sql.append(" 0) receita_bagagem, "); - sql.append(" tab.total_devol total_devol, "); - sql.append(" tab.receita_tarifa_gap receita_tarifa_gap, "); - sql.append(" tab.receita_seguro_gap receita_seguro_gap, "); - sql.append(" tab.total_devol_gap total_devol_gap, "); - sql.append(" tab.total_bilhetes_canc total_bilhetes_canc "); - sql.append(" "); - sql.append(" from (select es.cveestado, "); - sql.append(" pv.puntoventa_id, "); - sql.append(" pv.numpuntoventa, "); - sql.append(" pv.nombpuntoventa, "); - sql.append(" cj.empresapuntoventa_id, "); - sql.append(" ce.estado_id, "); - sql.append(" sum(CASE "); - sql.append(" WHEN cj.motivocancelacion_id is null and "); - sql.append(" cj.tipoventa_id <> 18 THEN "); - sql.append(" 1 "); - sql.append(" ELSE "); - sql.append(" 0 "); - sql.append(" END) total_bilhetes, "); - sql.append(" "); - sql.append(" sum(CASE "); - sql.append(" WHEN cj.motivocancelacion_id is not null THEN "); - sql.append(" 1 "); - sql.append(" ELSE "); - sql.append(" 0 "); - sql.append(" END) total_bilhetes_canc, "); - sql.append(" sum(CASE "); - sql.append(" WHEN cj.motivocancelacion_id is null and "); - sql.append(" cj.tipoventa_id = 18 THEN "); - sql.append(" 1 "); - sql.append(" ELSE "); - sql.append(" 0 "); - sql.append(" END) total_bilhetes_gap, "); - sql.append(" sum(CASE "); - sql.append(" WHEN cj.motivocancelacion_id is null and "); - sql.append(" cj.tipoventa_id <> 18 THEN "); - sql.append(" cj.preciopagado "); - sql.append(" ELSE "); - sql.append(" 0 "); - sql.append(" END) receita_tarifa, "); - sql.append(" sum(CASE "); - sql.append(" WHEN cj.motivocancelacion_id is null and "); - sql.append(" cj.tipoventa_id = 18 THEN "); - sql.append(" cj.preciopagado "); - sql.append(" ELSE "); - sql.append(" 0 "); - sql.append(" END) receita_tarifa_gap, "); - sql.append(" sum(CASE "); - sql.append(" WHEN cj.motivocancelacion_id is null and "); - sql.append(" cj.tipoventa_id <> 18 THEN "); - sql.append(" cj.importeseguro "); - sql.append(" ELSE "); - sql.append(" 0 "); - sql.append(" END) receita_seguro, "); - sql.append(" sum(CASE "); - sql.append(" WHEN cj.motivocancelacion_id is null and "); - sql.append(" cj.tipoventa_id = 18 THEN "); - sql.append(" cj.importeseguro "); - sql.append(" ELSE "); - sql.append(" 0 "); - sql.append(" END) receita_seguro_gap, "); - sql.append(" sum(CASE "); - sql.append(" WHEN cj.motivocancelacion_id is null and "); - sql.append(" cj.tipoventa_id <> 18 THEN "); - sql.append(" cj.importetaxaembarque "); - sql.append(" ELSE "); - sql.append(" 0 "); - sql.append(" END) receita_embarque, "); - sql.append(" sum(CASE "); - sql.append(" WHEN cj.motivocancelacion_id is null and "); - sql.append(" cj.tipoventa_id = 18 THEN "); - sql.append(" cj.importetaxaembarque "); - sql.append(" ELSE "); - sql.append(" 0 "); - sql.append(" END) receita_embarque_gap, "); - sql.append(" sum(CASE "); - sql.append(" WHEN cj.motivocancelacion_id is null and "); - sql.append(" cj.tipoventa_id <> 18 THEN "); - sql.append(" cj.importeoutros "); - sql.append(" ELSE "); - sql.append(" 0 "); - sql.append(" END) receita_outros, "); - sql.append(" sum(CASE "); - sql.append(" WHEN cj.motivocancelacion_id is null and "); - sql.append(" cj.tipoventa_id = 18 THEN "); - sql.append(" cj.importeoutros "); - sql.append(" ELSE "); - sql.append(" 0 "); - sql.append(" END) receita_outros_gap, "); - sql.append(" sum(CASE "); - sql.append(" WHEN cj.motivocancelacion_id is null and "); - sql.append(" cj.tipoventa_id <> 18 THEN "); - sql.append(" cj.importepedagio "); - sql.append(" ELSE "); - sql.append(" 0 "); - sql.append(" END) receita_pedagio, "); - sql.append(" sum(CASE "); - sql.append(" WHEN cj.motivocancelacion_id is null and "); - sql.append(" cj.tipoventa_id = 18 THEN "); - sql.append(" cj.importepedagio "); - sql.append(" ELSE "); - sql.append(" 0 "); - sql.append(" END) receita_pedagio_gap, "); - sql.append(" "); - sql.append(" sum(CASE "); - sql.append(" WHEN cj.motivocancelacion_id in (31, 32) and "); - sql.append(" cj.tipoventa_id <> 18 THEN "); - sql.append(" cj.preciopagado "); - sql.append(" ELSE "); - sql.append(" 0 "); - sql.append(" END) total_devol, "); - sql.append(" sum(CASE "); - sql.append(" WHEN cj.motivocancelacion_id in (31, 32) and "); - sql.append(" cj.tipoventa_id = 18 THEN "); - sql.append(" cj.preciopagado "); - sql.append(" ELSE "); - sql.append(" 0 "); - sql.append(" END) total_devol_gap "); - sql.append(" from caja cj, "); - sql.append(" punto_venta pv, "); - sql.append(" empresa em, "); - sql.append(" parada pr, "); - sql.append(" ciudad cd, "); - sql.append(" ciudad ce, "); - sql.append(" estado es "); - sql.append(" where cj.puntoventa_id = pv.puntoventa_id "); - sql.append(" and trunc(cj.fechorventa) between :DATA_INICIO and "); - sql.append(" :DATA_FINAL "); - sql.append(" and pr.parada_id = pv.parada_id "); - sql.append(" and cj.empresapuntoventa_id = em.empresa_id "); - sql.append(" and em.ciudad_id = ce.ciudad_id "); - sql.append(" and cd.ciudad_id = pr.ciudad_id "); - sql.append(" and cd.estado_id = es.estado_id "); - sql.append(" and es.estado_id = nvl( :ESTADO_ID , es.estado_id) "); - sql.append(" and (( instr( :NUMPUNTOVENTA , ','||trim(numpuntoventa)||',') > 0 "); - sql.append(" and :ISNUMPUNTOVENTATODOS = 'N') or "); - sql.append(" ( :ISNUMPUNTOVENTATODOS = 'S')) "); - sql.append(" group by es.cveestado, "); - sql.append(" pv.puntoventa_id, "); - sql.append(" pv.numpuntoventa, "); - sql.append(" cj.empresapuntoventa_id, "); - sql.append(" ce.estado_id, "); - sql.append(" pv.nombpuntoventa) tab, "); - sql.append(" vtabol.evento_extra ee "); - sql.append(" where trunc(ee.fechoringreso(+)) between :DATA_INICIO and "); - sql.append(" :DATA_FINAL "); - sql.append(" and ee.puntoventa_id(+) = tab.puntoventa_id "); - sql.append(" "); - sql.append(" group by tab.cveestado, "); - sql.append(" tab.puntoventa_id, "); - - sql.append(" tab.numpuntoventa, "); - sql.append(" tab.nombpuntoventa, "); - sql.append(" tab.total_bilhetes, "); - sql.append(" tab.total_bilhetes_gap, "); - sql.append(" tab.receita_tarifa, "); - sql.append(" tab.receita_seguro, "); - sql.append(" tab.total_devol, "); - sql.append(" tab.receita_tarifa_gap, "); - sql.append(" tab.receita_seguro_gap, "); - sql.append(" tab.total_devol_gap, "); - sql.append(" tab.empresapuntoventa_id, "); - sql.append(" tab.estado_id, "); - sql.append(" tab.total_bilhetes_canc) tab1 "); + sql.append(" SELECT ES.CVEESTADO, "); + sql.append(" PV.PUNTOVENTA_ID, "); + sql.append(" PV.NUMPUNTOVENTA, "); + sql.append(" PV.NOMBPUNTOVENTA, "); + sql.append(" CJ.EMPRESAPUNTOVENTA_ID, "); + sql.append(" CE.ESTADO_ID, "); + sql.append(" CASE "); + sql.append(" WHEN CO.ESTADO_ID <> CD.ESTADO_ID THEN "); + sql.append(" 'S' "); + sql.append(" ELSE "); + sql.append(" 'N' "); + sql.append(" END INTERESTADUAL, "); + sql.append(" CJ.PRECIOPAGADO, "); + sql.append(" CJ.MOTIVOCANCELACION_ID, "); + sql.append(" CJ.TIPOVENTA_ID, "); + sql.append(" CJ.IMPORTESEGURO, "); + sql.append(" CJ.IMPORTETAXAEMBARQUE, "); + sql.append(" CJ.IMPORTEOUTROS, "); + sql.append(" CJ.IMPORTEPEDAGIO, "); + sql.append(" CJ.FECCORRIDA, "); + sql.append(" (SELECT 1 "); + sql.append(" FROM CAJA CJD "); + sql.append(" WHERE CJD.MOTIVOCANCELACION_ID IN (31, 32) "); + sql.append(" AND CJD.FECCORRIDA = CJ.FECCORRIDA "); + sql.append(" AND CJD.CORRIDA_ID = CJ.CORRIDA_ID "); + sql.append(" AND CJD.NUMFOLIOSISTEMA = CJ.NUMFOLIOSISTEMA "); + sql.append(" AND CJD.NUMASIENTO = CJ.NUMASIENTO "); + sql.append(" AND CJD.CAJA_ID <> CJ.CAJA_ID "); + sql.append(" AND CJD.INDSTATUSOPERACION = 'F' "); + sql.append(" AND CJD.INDREIMPRESION = 0 "); + sql.append(" AND ROWNUM = 1) POSSUI_CANC, "); + sql.append(" TP.CVEPTOVTA TIPO_AGENCIA "); + sql.append(" FROM CAJA CJ, "); + sql.append(" PUNTO_VENTA PV, "); + sql.append(" EMPRESA EM, "); + sql.append(" PARADA PR, "); + sql.append(" CIUDAD CX, "); + sql.append(" CIUDAD CE, "); + sql.append(" ESTADO ES, "); + sql.append(" PARADA PO, "); + sql.append(" PARADA PD, "); + sql.append(" CIUDAD CO, "); + sql.append(" CIUDAD CD, "); + sql.append(" TIPO_PTOVTA TP "); + sql.append(" WHERE CJ.PUNTOVENTA_ID = PV.PUNTOVENTA_ID "); + sql.append(" AND TRUNC(CJ.FECHORVENTA) BETWEEN :DATA_INICIO AND "); + sql.append(" :DATA_FINAL "); + sql.append(" AND PR.PARADA_ID = PV.PARADA_ID "); + sql.append(" AND CJ.EMPRESAPUNTOVENTA_ID = EM.EMPRESA_ID "); + sql.append(" AND EM.CIUDAD_ID = CE.CIUDAD_ID "); + sql.append(" AND CX.CIUDAD_ID = PR.CIUDAD_ID "); + sql.append(" AND CX.ESTADO_ID = ES.ESTADO_ID "); + sql.append(" AND CJ.ORIGEN_ID = PO.PARADA_ID "); + sql.append(" AND CJ.DESTINO_ID = PD.PARADA_ID "); + sql.append(" AND PO.CIUDAD_ID = CO.CIUDAD_ID "); + sql.append(" AND PD.CIUDAD_ID = CD.CIUDAD_ID "); + sql.append(" AND CJ.INDSTATUSOPERACION = 'F' "); + sql.append(" AND CJ.INDREIMPRESION = 0 "); + sql.append(" AND PV.TIPOPTOVTA_ID = NVL(:TIPOPTOVTA_ID, PV.TIPOPTOVTA_ID) "); + sql.append(" AND TP.TIPOPTOVTA_ID = PV.TIPOPTOVTA_ID "); + sql.append(" AND CJ.EMPRESAPUNTOVENTA_ID = NVL(:EMPRESA_ID, CJ.EMPRESAPUNTOVENTA_ID) "); + sql.append(" AND ES.ESTADO_ID = NVL(:ESTADO_ID, ES.ESTADO_ID) "); + sql.append(" AND ((INSTR(:NUMPUNTOVENTA, ',' || TRIM(PV.NUMPUNTOVENTA) || ',') > 0 AND "); + sql.append(" :ISNUMPUNTOVENTATODOS = 'N') OR (:ISNUMPUNTOVENTATODOS = 'S')) "); return sql.toString(); } diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioResumoLinhas.java b/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioResumoLinhas.java new file mode 100644 index 000000000..318501c2f --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioResumoLinhas.java @@ -0,0 +1,35 @@ +/** + * + */ +package com.rjconsultores.ventaboletos.relatorios.impl; + +import java.sql.Connection; +import java.util.Map; + +import com.rjconsultores.ventaboletos.relatorios.utilitarios.Relatorio; + +/** + * @author Bruno H. G. Gouvêa + * + */ +public class RelatorioResumoLinhas extends Relatorio { + + /** + * @param parametros + * @param conexao + */ + public RelatorioResumoLinhas(Map parametros, Connection conexao) { + super(parametros, conexao); + // TODO Auto-generated constructor stub + } + + /* + * (non-Javadoc) + * + * @see com.rjconsultores.ventaboletos.relatorios.utilitarios.Relatorio#processaParametros() + */ + @Override + public void processaParametros() throws Exception { + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioResumoLinhasAnalitico.java b/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioResumoLinhasAnalitico.java new file mode 100644 index 000000000..a0cd08365 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioResumoLinhasAnalitico.java @@ -0,0 +1,35 @@ +/** + * + */ +package com.rjconsultores.ventaboletos.relatorios.impl; + +import java.sql.Connection; +import java.util.Map; + +import com.rjconsultores.ventaboletos.relatorios.utilitarios.Relatorio; + +/** + * @author Bruno H. G. Gouvêa + * + */ +public class RelatorioResumoLinhasAnalitico extends Relatorio { + + /** + * @param parametros + * @param conexao + */ + public RelatorioResumoLinhasAnalitico(Map parametros, Connection conexao) { + super(parametros, conexao); + // TODO Auto-generated constructor stub + } + + /* + * (non-Javadoc) + * + * @see com.rjconsultores.ventaboletos.relatorios.utilitarios.Relatorio#processaParametros() + */ + @Override + public void processaParametros() throws Exception { + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioResumoLinhasAnalitico_pt_BR.properties b/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioResumoLinhasAnalitico_pt_BR.properties new file mode 100644 index 000000000..45f4f75b6 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioResumoLinhasAnalitico_pt_BR.properties @@ -0,0 +1,10 @@ +#geral +msg.noData=Não foi possivel obter dados com os parâmetros informados. + + +#Labels cabeçalho +cabecalho.periodo=Período: +cabecalho.periodoA=à + +rodape.pagina=Página +rodape.de=de \ No newline at end of file diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioResumoLinhas_pt_BR.properties b/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioResumoLinhas_pt_BR.properties new file mode 100644 index 000000000..45f4f75b6 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioResumoLinhas_pt_BR.properties @@ -0,0 +1,10 @@ +#geral +msg.noData=Não foi possivel obter dados com os parâmetros informados. + + +#Labels cabeçalho +cabecalho.periodo=Período: +cabecalho.periodoA=à + +rodape.pagina=Página +rodape.de=de \ No newline at end of file diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioReceitaDiariaAgencia.jasper b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioReceitaDiariaAgencia.jasper index bb182020f..9f196f34f 100644 Binary files a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioReceitaDiariaAgencia.jasper and b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioReceitaDiariaAgencia.jasper differ diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioReceitaDiariaAgencia.jrxml b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioReceitaDiariaAgencia.jrxml index 97407aa62..068405b07 100644 --- a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioReceitaDiariaAgencia.jrxml +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioReceitaDiariaAgencia.jrxml @@ -1,8 +1,8 @@ - - + + + + + + + + + + + + + + + CD.ESTADO_ID THEN + 'S' + ELSE + 'N' + END INTERESTADUAL, + NVL(GR.DESCGRUPO, 'Não Definido') GRUPO_LINHA, + (SELECT SUM(TR.CANTKMREAL) + FROM RUTA_SECUENCIA RS, TRAMO TR + WHERE RS.RUTA_ID = RT.RUTA_ID + AND RS.TRAMO_ID = TR.TRAMO_ID) EXTENSAO_KM, + NVL(SUM(BL.IMPORTESEGURO),0) RECEITA_SEGURO, + 0 RECEITA_BAGAGEM, + 0 RECEITA_SEGURO_OUTROS, + SUM(BL.PRECIOPAGADO) RECEITA_TARIFA, + COUNT(1) PASSAGEIROS, + COUNT(DISTINCT CASE + WHEN CR.TIPOSERVICIO_ID = 2 THEN + CR.FECCORRIDA || CR.CORRIDA_ID + ELSE + NULL + END) VIAGENS_EXTRA, + COUNT(DISTINCT CASE + WHEN CR.TIPOSERVICIO_ID <> 2 THEN + CR.FECCORRIDA || CR.CORRIDA_ID + ELSE + NULL + END) VIAGENS + FROM RUTA RT, + BOLETO BL, + CORRIDA CR, + TRAMO TR, + ROL_OPERATIVO RO, + DIAGRAMA_AUTOBUS DA, + TARIFA TF, + VIGENCIA_TARIFA VT, + GRUPO_RUTA GR, + PARADA PO, + PARADA PD, + CIUDAD CO, + CIUDAD CD + WHERE RT.RUTA_ID = CR.RUTA_ID + AND CR.FECCORRIDA = BL.FECCORRIDA + AND CR.RUTA_ID = NVL( $P{RUTA_ID} , CR.RUTA_ID) + AND CR.CORRIDA_ID = BL.CORRIDA_ID + AND CR.EMPRESACORRIDA_ID = $P{EMPRESA_ID} + AND CR.ORIGEN_ID = PO.PARADA_ID + AND CR.DESTINO_ID = PD.PARADA_ID + AND PO.CIUDAD_ID = CO.CIUDAD_ID + AND PD.CIUDAD_ID = CD.CIUDAD_ID + AND RT.GRUPORUTA_ID = GR.GRUPORUTA_ID(+) + AND RO.ROLOPERATIVO_ID = CR.ROLOPERATIVO_ID + AND RO.DIAGRAMAAUTOBUS_ID = DA.DIAGRAMAAUTOBUS_ID + AND TF.CLASESERVICIO_ID = CR.CLASESERVICIO_ID + AND TR.ORIGEN_ID = CR.ORIGEN_ID + AND TR.DESTINO_ID = CR.DESTINO_ID + AND TF.MARCA_ID = CR.MARCA_ID + AND TF.RUTA_ID = CR.RUTA_ID + AND TF.TRAMO_ID = TR.TRAMO_ID + AND TF.STATUSTARIFA = 'A' + AND TF.ACTIVO = 1 + AND BL.MOTIVOCANCELACION_ID IS NULL + AND BL.INDREIMPRESION = 0 + AND BL.INDSTATUSOPERACION = 'F' + AND TF.VIGENCIATARIFA_ID = VT.VIGENCIATARIFA_ID + AND VT.ACTIVO = 1 + AND CR.FECCORRIDA BETWEEN VT.FECINICIOVIGENCIA AND + VT.FECFINVIGENCIA + AND CR.FECCORRIDA BETWEEN + $P{DATA_INICIAL} AND + $P{DATA_FINAL} + GROUP BY RT.RUTA_ID, + RT.NUMRUTA, + RT.DESCRUTA, + TF.PRECIO, + DA.CANTASIENTOS, + RO.ROLOPERATIVO_ID, + GR.DESCGRUPO, + CO.ESTADO_ID, + CD.ESTADO_ID) TAB1) TAB]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <band height="79" splitType="Stretch"> + <textField> + <reportElement uuid="9e87eb2d-1887-4b55-8185-532290be371a" x="0" y="24" width="114" height="15"/> + <textElement> + <font size="10"/> + </textElement> + <textFieldExpression><![CDATA[$P{EMPRESA}]]></textFieldExpression> + </textField> + <textField> + <reportElement uuid="13cd1307-cc98-498c-8bac-618957350b22" x="0" y="40" width="114" height="20"/> + <textElement> + <font size="10"/> + </textElement> + <textFieldExpression><![CDATA[$P{NOME_RELATORIO}]]></textFieldExpression> + </textField> + <textField pattern="" isBlankWhenNull="false"> + <reportElement uuid="e9d8adae-c169-4fc4-9a35-fd1461933161" mode="Transparent" x="119" y="60" width="13" height="15" forecolor="#000000" backcolor="#FFFFFF"/> + <textElement textAlignment="Left" verticalAlignment="Top" rotation="None" markup="none"> + <font fontName="SansSerif" size="9" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/> + <paragraph lineSpacing="Single"/> + </textElement> + <textFieldExpression><![CDATA[$R{cabecalho.periodoA}]]></textFieldExpression> + </textField> + <textField pattern="dd/MM/yyyy" isBlankWhenNull="false"> + <reportElement uuid="4408d1db-05db-4538-944d-5561074f2706" mode="Transparent" x="66" y="60" width="53" height="15" forecolor="#000000" backcolor="#FFFFFF"/> + <textElement textAlignment="Left" verticalAlignment="Top" rotation="None" markup="none"> + <font fontName="SansSerif" size="9" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/> + <paragraph lineSpacing="Single"/> + </textElement> + <textFieldExpression><![CDATA[$P{DATA_INICIAL}]]></textFieldExpression> + </textField> + <textField pattern="dd/MM/yyyy" isBlankWhenNull="false"> + <reportElement uuid="06b0102b-f339-4eed-aad7-f6b84267c237" mode="Transparent" x="132" y="60" width="59" height="15" forecolor="#000000" backcolor="#FFFFFF"/> + <textElement textAlignment="Left" verticalAlignment="Top" rotation="None" markup="none"> + <font fontName="SansSerif" size="9" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/> + <paragraph lineSpacing="Single"/> + </textElement> + <textFieldExpression><![CDATA[$P{DATA_FINAL}]]></textFieldExpression> + </textField> + <textField pattern="" isBlankWhenNull="false"> + <reportElement uuid="c714d8a2-a41a-4fc8-848c-9cb455c3a0c7" mode="Transparent" x="1" y="60" width="65" height="15" forecolor="#000000" backcolor="#FFFFFF"/> + <textElement textAlignment="Left" verticalAlignment="Top" rotation="None" markup="none"> + <font fontName="SansSerif" size="9" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/> + <paragraph lineSpacing="Single"/> + </textElement> + <textFieldExpression><![CDATA[$R{cabecalho.periodo}]]></textFieldExpression> + </textField> + <textField> + <reportElement uuid="e5254cd0-647f-4b22-be4c-cce9afc5a10f" x="669" y="40" width="100" height="20"/> + <textElement textAlignment="Right"> + <font size="10"/> + </textElement> + <textFieldExpression><![CDATA["Página: "+$V{PAGE_NUMBER}]]></textFieldExpression> + </textField> + <textField pattern="dd/MM/yyyy"> + <reportElement uuid="55b08ff2-e470-4b59-8c56-58e6fa05ccd5" x="669" y="25" width="100" height="15"/> + <textElement textAlignment="Right"> + <font size="10"/> + </textElement> + <textFieldExpression><![CDATA[new java.util.Date()]]></textFieldExpression> + </textField> + <line> + <reportElement uuid="afaaa1cf-1a3e-4a42-9fa3-e634a66fc3d3" x="1" y="76" width="797" height="1"/> + </line> + </band> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioResumoLinhasAnalitico.jrxml b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioResumoLinhasAnalitico.jrxml new file mode 100644 index 000000000..657d131e8 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioResumoLinhasAnalitico.jrxml @@ -0,0 +1,319 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <band height="79" splitType="Stretch"> + <textField> + <reportElement uuid="9e87eb2d-1887-4b55-8185-532290be371a" x="0" y="24" width="114" height="15"/> + <textElement> + <font size="10"/> + </textElement> + <textFieldExpression><![CDATA[$P{EMPRESA}]]></textFieldExpression> + </textField> + <textField> + <reportElement uuid="13cd1307-cc98-498c-8bac-618957350b22" x="0" y="40" width="114" height="20"/> + <textElement> + <font size="10"/> + </textElement> + <textFieldExpression><![CDATA[$P{NOME_RELATORIO}]]></textFieldExpression> + </textField> + <textField pattern="" isBlankWhenNull="false"> + <reportElement uuid="e9d8adae-c169-4fc4-9a35-fd1461933161" mode="Transparent" x="119" y="60" width="13" height="15" forecolor="#000000" backcolor="#FFFFFF"/> + <textElement textAlignment="Left" verticalAlignment="Top" rotation="None" markup="none"> + <font fontName="SansSerif" size="9" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/> + <paragraph lineSpacing="Single"/> + </textElement> + <textFieldExpression><![CDATA[$R{cabecalho.periodoA}]]></textFieldExpression> + </textField> + <textField pattern="dd/MM/yyyy" isBlankWhenNull="false"> + <reportElement uuid="4408d1db-05db-4538-944d-5561074f2706" mode="Transparent" x="66" y="60" width="53" height="15" forecolor="#000000" backcolor="#FFFFFF"/> + <textElement textAlignment="Left" verticalAlignment="Top" rotation="None" markup="none"> + <font fontName="SansSerif" size="9" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/> + <paragraph lineSpacing="Single"/> + </textElement> + <textFieldExpression><![CDATA[$P{DATA_INICIAL}]]></textFieldExpression> + </textField> + <textField pattern="dd/MM/yyyy" isBlankWhenNull="false"> + <reportElement uuid="06b0102b-f339-4eed-aad7-f6b84267c237" mode="Transparent" x="132" y="60" width="59" height="15" forecolor="#000000" backcolor="#FFFFFF"/> + <textElement textAlignment="Left" verticalAlignment="Top" rotation="None" markup="none"> + <font fontName="SansSerif" size="9" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/> + <paragraph lineSpacing="Single"/> + </textElement> + <textFieldExpression><![CDATA[$P{DATA_FINAL}]]></textFieldExpression> + </textField> + <textField pattern="" isBlankWhenNull="false"> + <reportElement uuid="c714d8a2-a41a-4fc8-848c-9cb455c3a0c7" mode="Transparent" x="1" y="60" width="65" height="15" forecolor="#000000" backcolor="#FFFFFF"/> + <textElement textAlignment="Left" verticalAlignment="Top" rotation="None" markup="none"> + <font fontName="SansSerif" size="9" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/> + <paragraph lineSpacing="Single"/> + </textElement> + <textFieldExpression><![CDATA[$R{cabecalho.periodo}]]></textFieldExpression> + </textField> + <textField> + <reportElement uuid="e5254cd0-647f-4b22-be4c-cce9afc5a10f" x="455" y="39" width="100" height="20"/> + <textElement textAlignment="Right"> + <font size="10"/> + </textElement> + <textFieldExpression><![CDATA["Página: "+$V{PAGE_NUMBER}]]></textFieldExpression> + </textField> + <textField pattern="dd/MM/yyyy"> + <reportElement uuid="55b08ff2-e470-4b59-8c56-58e6fa05ccd5" x="455" y="24" width="100" height="15"/> + <textElement textAlignment="Right"> + <font size="10"/> + </textElement> + <textFieldExpression><![CDATA[new java.util.Date()]]></textFieldExpression> + </textField> + </band> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/utilitarios/ArrayDataSource.java b/src/java/com/rjconsultores/ventaboletos/relatorios/utilitarios/ArrayDataSource.java new file mode 100644 index 000000000..30b478e48 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/utilitarios/ArrayDataSource.java @@ -0,0 +1,88 @@ +/** + * + */ +package com.rjconsultores.ventaboletos.relatorios.utilitarios; + +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + + +import net.sf.jasperreports.engine.JRException; +import net.sf.jasperreports.engine.JRField; + +/** + * @author Bruno H. G. Gouvêa + * + */ +public class ArrayDataSource implements IDataSource { + + protected Relatorio relatorio; + protected ResultSet resultSet; + private Integer rowNum; + + protected List> dados; + + public ArrayDataSource(Relatorio relatorio) throws Exception { + this.relatorio = relatorio; + + this.initDados(); + this.rowNum = -1; + } + + @Override + public Object getFieldValue(JRField field) throws JRException { + try { + + Object valueCustomField = this.valueCustomFields(field.getName()); + + return (valueCustomField != null) ? valueCustomField : getByName(field.getName()); + + } catch (Exception e) { + e.printStackTrace(); + throw new JRException(e); + + } + } + + protected Object getByName(String name){ + return this.dados.get(this.rowNum).get(name); + } + + /* + * (non-Javadoc) + * + * @see net.sf.jasperreports.engine.JRDataSource#next() + */ + @Override + public boolean next() { + + this.rowNum++; + if ( this.dados != null && this.rowNum < this.dados.size()) { + return true; + } + + return false; + + } + + @Override + public void initDados() throws Exception { + + } + + /* + * (non-Javadoc) + * + * @see com.rjconsultores.ventaboletos.relatorios.utilitarios.IDataSource#valueCustomFields(java.lang.String) + */ + @Override + public Object valueCustomFields(String fieldName) throws Exception { + // TODO Auto-generated method stub + return null; + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/utilitarios/ProcessadorParametros.java b/src/java/com/rjconsultores/ventaboletos/relatorios/utilitarios/ProcessadorParametros.java index e3f47fdf8..3ff8099aa 100644 --- a/src/java/com/rjconsultores/ventaboletos/relatorios/utilitarios/ProcessadorParametros.java +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/utilitarios/ProcessadorParametros.java @@ -3,8 +3,6 @@ */ package com.rjconsultores.ventaboletos.relatorios.utilitarios; -import java.sql.Connection; -import java.util.Map; /** * @author Bruno H. G. Gouvêa diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/utilitarios/Relatorio.java b/src/java/com/rjconsultores/ventaboletos/relatorios/utilitarios/Relatorio.java index 9a5d71c86..7fd5c685e 100644 --- a/src/java/com/rjconsultores/ventaboletos/relatorios/utilitarios/Relatorio.java +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/utilitarios/Relatorio.java @@ -1,7 +1,11 @@ package com.rjconsultores.ventaboletos.relatorios.utilitarios; import java.sql.Connection; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; import java.util.Map; +import java.util.Set; import com.rjconsultores.ventaboletos.relatorios.render.RenderRelatorioJasper; @@ -27,11 +31,13 @@ public abstract class Relatorio { protected RenderRelatorioJasper render; private IDataSource customDataSource; private IParametros processadorParametros; + private Set infoMsg; protected Relatorio(Map parametros, Connection conexao) { this.parametros = parametros; this.conexao = conexao; + this.infoMsg = new HashSet(); } public Connection getConexao() { @@ -80,8 +86,6 @@ public abstract class Relatorio { protected abstract void processaParametros() throws Exception; - - /* * (non-Javadoc) * @@ -89,13 +93,20 @@ public abstract class Relatorio { */ public byte[] getConteudo(SaidaRelatorio saida) throws Exception { this.processaParametros(); - - if(this.render == null) + + if (this.render == null) this.render = new RenderRelatorioJasper(this); - return this.render.render(saida); - + return this.render.render(saida); } + public Set getInfoMsg() { + return infoMsg; + } + + public void addInfoMsg(String msg) { + this.infoMsg.add(msg); + } + } \ No newline at end of file diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/BusquedaGrupoRutaController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/BusquedaGrupoRutaController.java new file mode 100644 index 000000000..f38cd471d --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/BusquedaGrupoRutaController.java @@ -0,0 +1,131 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.catalogos; + +import com.rjconsultores.ventaboletos.entidad.GrupoRuta; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderGrupoRuta; +import java.util.HashMap; +import java.util.Map; +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.zk.ui.event.EventListener; +import org.zkoss.zul.Paging; +import org.zkoss.zul.Textbox; + +/** + * + * @author Administrador + */ +@Controller("busquedaGrupoRutaController") +@Scope("prototype") +public class BusquedaGrupoRutaController extends MyGenericForwardComposer { + + @Autowired + private transient PagedListWrapper plwGrupoRuta; + private MyListbox grupoRutaList; + private Paging pagingGrupoRuta; + private Textbox txtNome; + + public MyListbox getGrupoRutaList() { + return grupoRutaList; + } + + public void setGrupoRutaList(MyListbox grupoRutaList) { + this.grupoRutaList = grupoRutaList; + } + + public Paging getPagingGrupoRuta() { + return pagingGrupoRuta; + } + + public void setPagingGrupoRuta(Paging pagingGrupoRuta) { + this.pagingGrupoRuta = pagingGrupoRuta; + } + + public Textbox getTxtNome() { + return txtNome; + } + + public void setTxtNome(Textbox txtNome) { + this.txtNome = txtNome; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + + grupoRutaList.setItemRenderer(new RenderGrupoRuta()); + grupoRutaList.addEventListener("onDoubleClick", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + GrupoRuta c = (GrupoRuta) grupoRutaList.getSelected(); + verGrupoRuta(c); + } + }); + + refreshLista(); + + txtNome.focus(); + } + + private void verGrupoRuta(GrupoRuta c) { + if (c == null) { + return; + } + + Map args = new HashMap(); + args.put("grupoRuta", c); + args.put("grupoRutaList", grupoRutaList); + + openWindow("/gui/catalogos/editarGrupoRuta.zul", + Labels.getLabel("editarGrupoRutaController.window.title"), args, MODAL); + } + + private void refreshLista() { + HibernateSearchObject grupoRutaBusqueda = + new HibernateSearchObject(GrupoRuta.class, + pagingGrupoRuta.getPageSize()); + + grupoRutaBusqueda.addFilterLike("descgrupo", + "%" + txtNome.getText().trim().concat("%")); + grupoRutaBusqueda.addFilterNotEqual("grupoRutaId", -1); + + grupoRutaBusqueda.addSortAsc("descgrupo"); + grupoRutaBusqueda.addFilterEqual("activo", Boolean.TRUE); + + plwGrupoRuta.init(grupoRutaBusqueda, grupoRutaList, pagingGrupoRuta); + + if (grupoRutaList.getData().length == 0) { + try { + Messagebox.show(Labels.getLabel("MSG.ningunRegistro"), + Labels.getLabel("busquedaGrupoRutaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } catch (InterruptedException ex) { + } + } + } + + public void onClick$btnPesquisa(Event ev) { + refreshLista(); + } + + public void onClick$btnRefresh(Event ev) { + refreshLista(); + } + + public void onClick$btnNovo(Event ev) { + verGrupoRuta(new GrupoRuta()); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/EditarGrupoRutaController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/EditarGrupoRutaController.java new file mode 100644 index 000000000..dc13772ac --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/EditarGrupoRutaController.java @@ -0,0 +1,143 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.catalogos; + +import com.rjconsultores.ventaboletos.entidad.GrupoRuta; +import com.rjconsultores.ventaboletos.service.GrupoRutaService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.MyTextbox; +import java.util.Calendar; +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.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.util.resource.Labels; +import org.zkoss.zul.Button; +/** + * + * @author Administrador + */ +@Controller("editarGrupoRutaController") +@Scope("prototype") +public class EditarGrupoRutaController extends MyGenericForwardComposer { + + @Autowired + private GrupoRutaService grupoRutaService; + private GrupoRuta grupoRuta; + private MyListbox grupoRutaList; + private MyTextbox txtNome; + private Button btnApagar; + private static Logger log = Logger.getLogger(EditarGrupoRutaController.class); + + public GrupoRuta getGrupoRuta() { + return grupoRuta; + } + + public void setGrupoRuta(GrupoRuta grupoRuta) { + this.grupoRuta = grupoRuta; + } + + public MyTextbox getTxtNome() { + return txtNome; + } + + public void setTxtNome(MyTextbox txtNome) { + this.txtNome = txtNome; + } + + public Button getBtnApagar() { + return btnApagar; + } + + public void setBtnApagar(Button btnApagar) { + this.btnApagar = btnApagar; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + + grupoRuta = (GrupoRuta) Executions.getCurrent().getArg().get("grupoRuta"); + grupoRutaList = (MyListbox) Executions.getCurrent().getArg().get("grupoRutaList"); + + if (grupoRuta.getGrupoRutaId() == null) { + btnApagar.setVisible(Boolean.FALSE); + } + + txtNome.focus(); + } + + public void onClick$btnSalvar(Event ev) throws InterruptedException { + txtNome.getText(); + + try { + String nomeGrupoRuta = grupoRuta.getDescGrupo(); + List lsGrupoRuta = grupoRutaService.buscarPorNome(nomeGrupoRuta); + + if (lsGrupoRuta.isEmpty()) { + grupoRuta.setActivo(Boolean.TRUE); + grupoRuta.setFecmodif(Calendar.getInstance().getTime()); + grupoRuta.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + + if (grupoRuta.getGrupoRutaId() == null) { + grupoRutaService.suscribir(grupoRuta); + grupoRutaList.addItem(grupoRuta); + } else { + grupoRutaService.actualizacion(grupoRuta); + grupoRutaList.updateItem(grupoRuta); + } + + Messagebox.show( + Labels.getLabel("editarGrupoRutaController.MSG.suscribirOK"), + Labels.getLabel("editarGrupoRutaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + closeWindow(); + } else { + Messagebox.show( + Labels.getLabel("MSG.Registro.Existe"), + Labels.getLabel("editarGrupoRutaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + } catch (Exception ex) { + log.error("editarGrupoRutaController: " + ex); + Messagebox.show( + Labels.getLabel("MSG.Error"), + Labels.getLabel("editarGrupoRutaController.window.title"), + Messagebox.OK, Messagebox.ERROR); + } + } + + public void onClick$btnApagar(Event ev) { + try { + int resp = Messagebox.show( + Labels.getLabel("editarGrupoRutaController.MSG.borrarPergunta"), + Labels.getLabel("editarGrupoRutaController.window.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (resp == Messagebox.YES) { + grupoRutaService.borrar(grupoRuta); + + Messagebox.show( + Labels.getLabel("editarGrupoRutaController.MSG.borrarOK"), + Labels.getLabel("editarGrupoRutaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + grupoRutaList.removeItem(grupoRuta); + + closeWindow(); + } + } catch (Exception ex) { + log.error(ex); + } + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/EditarPuntoVentaComissaoController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/EditarPuntoVentaComissaoController.java new file mode 100644 index 000000000..f7c6c19d0 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/EditarPuntoVentaComissaoController.java @@ -0,0 +1,164 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.catalogos; + +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.util.resource.Labels; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zul.Comboitem; +import org.zkoss.zul.Messagebox; + +import com.rjconsultores.ventaboletos.entidad.PtovtaComissao; +import com.rjconsultores.ventaboletos.entidad.PuntoVenta; +import com.rjconsultores.ventaboletos.service.PtovtaComissaoService; +import com.rjconsultores.ventaboletos.service.PuntoVentaService; +import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; + +/** + * + * @author Bruno H. G. Gouvêa + * + */ +@Controller("editarPuntoVentaComissaoController") +@Scope("prototype") +public class EditarPuntoVentaComissaoController extends MyGenericForwardComposer { + + private static final long serialVersionUID = 1L; + + @Autowired + private PtovtaComissaoService ptovtaComissaoService; + + @Autowired + private PuntoVentaService puntoVentaService; + + private MyListbox ptovtaComissaoList; + private static Logger log = Logger.getLogger(EditarPuntoVentaComissaoController.class); + + private List lsDestino; + private MyComboboxEstandar cmbReceita; + private MyComboboxEstandar cmbDestino; + + private PtovtaComissao ptovtaComissao; + + @Override + public void doAfterCompose(Component comp) throws Exception { + PtovtaComissao ptovtaComissao = (PtovtaComissao) Executions.getCurrent().getArg().get("ptovtaComissao"); + this.ptovtaComissaoList = (MyListbox) Executions.getCurrent().getArg().get("ptovtaComissaoList"); + this.ptovtaComissao = ptovtaComissaoService.obtenerID(ptovtaComissao.getPtovtaComissaoId()); + this.lsDestino = puntoVentaService.obtenerTodos(); + + + super.doAfterCompose(comp); + + for (PtovtaComissao.enumReceita p : PtovtaComissao.enumReceita.values()) { + Comboitem comboItem = new Comboitem(p.descricao()); + comboItem.setValue(p.valor()); + comboItem.setParent(cmbReceita); + + } + + if (this.ptovtaComissao.getReceita() != null) + if (this.ptovtaComissao.getReceita().equals("RB")) { + cmbReceita.setSelectedIndex(0); + } else if (this.ptovtaComissao.getReceita().equals("RL")) { + cmbReceita.setSelectedIndex(1); + } + + } + + public void onClick$btnSalvarPtovtaComissao(Event ev) throws InterruptedException { + + if (cmbReceita.getSelectedItem() != null) { + this.ptovtaComissao.setReceita((String) cmbReceita.getSelectedItem().getValue()); + } + /*if (cmbDestino.getSelectedItem() != null) { + this.ptovtaComissao.setReceita((String) cmbReceita.getSelectedItem().getValue()); + }*/ + ptovtaComissaoService.actualizacion(this.ptovtaComissao); + + Messagebox.show( + Labels.getLabel("editarPuntoVentaComissaoController.MSG.suscribirOK"), + Labels.getLabel("editarPuntoVentaComissaoController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + closeWindow(); + + } + + public void onClick$btnApagarPtovtaComissao(Event ev) { + try { + int resp = Messagebox.show( + Labels.getLabel("editarPuntoVentaComissaoController.MSG.borrarPergunta"), + Labels.getLabel("editarPuntoVentaComissaoController.window.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (resp == Messagebox.YES) { + + ptovtaComissaoService.borrar(this.ptovtaComissao); + + Messagebox.show( + Labels.getLabel("editarPuntoVentaComissaoController.MSG.borrarOK"), + Labels.getLabel("editarPuntoVentaComissaoController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + ptovtaComissaoList.removeItem(this.ptovtaComissao); + + closeWindow(); + } + } catch (Exception ex) { + log.error(ex); + } + } + + public PuntoVentaService getPuntoVentaService() { + return puntoVentaService; + } + + public void setPuntoVentaService(PuntoVentaService puntoVentaService) { + this.puntoVentaService = puntoVentaService; + } + + public List getLsDestino() { + return lsDestino; + } + + public void setLsDestino(List lsDestino) { + this.lsDestino = lsDestino; + } + + public PtovtaComissao getPtovtaComissao() { + return ptovtaComissao; + } + + public void setPtovtaComissao(PtovtaComissao ptovtaComissao) { + this.ptovtaComissao = ptovtaComissao; + } + + /** + * @return the cmbReceita + */ + public MyComboboxEstandar getCmbReceita() { + return cmbReceita; + } + + /** + * @param cmbReceita + * the cmbReceita to set + */ + public void setCmbReceita(MyComboboxEstandar cmbReceita) { + this.cmbReceita = cmbReceita; + } + + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/EditarPuntoVentaController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/EditarPuntoVentaController.java index 362ebc9e3..c40ca8548 100644 --- a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/EditarPuntoVentaController.java +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/EditarPuntoVentaController.java @@ -8,7 +8,9 @@ import java.io.IOException; import java.math.BigDecimal; import java.util.ArrayList; import java.util.Calendar; +import java.util.HashMap; import java.util.List; +import java.util.Map; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.Predicate; @@ -21,6 +23,7 @@ import org.zkoss.zk.ui.Component; import org.zkoss.zk.ui.Executions; import org.zkoss.zk.ui.UiException; import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; import org.zkoss.zk.ui.event.UploadEvent; import org.zkoss.zk.ui.util.Clients; import org.zkoss.zkplus.databind.BindingListModel; @@ -66,6 +69,7 @@ import com.rjconsultores.ventaboletos.service.InstiFinanceiraService; import com.rjconsultores.ventaboletos.service.MonedaService; import com.rjconsultores.ventaboletos.service.NodoService; import com.rjconsultores.ventaboletos.service.PtoVtaUsuarioBancarioService; +import com.rjconsultores.ventaboletos.service.PtovtaComissaoService; import com.rjconsultores.ventaboletos.service.PtovtaEmpresaService; import com.rjconsultores.ventaboletos.service.PuntoVentaService; import com.rjconsultores.ventaboletos.service.TipoPuntoVentaService; @@ -82,6 +86,7 @@ import com.rjconsultores.ventaboletos.web.utilerias.render.PtovtaEmpresaRender; import com.rjconsultores.ventaboletos.web.utilerias.render.PtovtaEstoqueRender; import com.rjconsultores.ventaboletos.web.utilerias.render.PtovtaHorarioRender; import com.rjconsultores.ventaboletos.web.utilerias.render.PtovtaUsuarioBancarioRender; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderPtovtaComissao; /** * @@ -114,6 +119,9 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer { private PtoVtaUsuarioBancarioService ptoVtaUsuarioBancarioService; @Autowired private UsuarioBancarioService usuarioBancarioService; + @Autowired + private PtovtaComissaoService ptovtaComissaoService; + private PuntoVenta puntoVenta; private Textbox txtCP; private MyListbox puntoVentaList; @@ -124,7 +132,9 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer { private MyListbox ptovtaAntecipaList; private MyListbox ptovtaHorarioList; private MyListbox ptovtaEstoqueList; + private MyListbox ptovtaComissaoList; private static Logger log = Logger.getLogger(EditarPuntoVentaController.class); + private List lsEmpresas; private List lsBanco; private List lsTipoPuntoVenta; @@ -139,12 +149,15 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer { private List lsPtovtaUsuarioBancario; private List lsAntecipacomissao; private List lsHorario; + private List lsEmpresaComissao; private List lsEstoque; private List lsDestino; + private List lsPtovtaComissao; private Radio radDatosTarjetaSi; private Radio radDatosTarjetaNo; private Radio radAprobacionAutorizado; private Radio radAprobacionLatente; + private Button btnAdicionarEmpresaComissao; private Combobox cmbPuntoVentaPadre; private Combobox cmbFormaPago; private Combobox cmbEmpresa; @@ -166,6 +179,7 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer { private Combobox cmbUsuarioBancarioPtoVtaUsuarioBancario; private Combobox cmbPosicao; private Combobox cmbReceita; + private Combobox cmbEmpresaComissao; private Button btnSalvarFormaPago; private Button btnApagar; private Doublebox txtCargosExtras; @@ -190,16 +204,7 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer { private Datebox dateAntecipData; private MyTextboxDecimal txtAntecipRetem; private MyTextboxDecimal txtAntecipPercentual; - private MyTextboxDecimal txtPassagemBaixa; - private MyTextboxDecimal txtPassagemAlta; - private MyTextboxDecimal txtExcessoBaixa; - private MyTextboxDecimal txtExcessoAlta; - private MyTextboxDecimal txtSeguroBaixa; - private MyTextboxDecimal txtSeguroAlta; - private MyTextboxDecimal txtOutrosBaixa; - private MyTextboxDecimal txtOutrosAlta; - private MyTextboxDecimal txtIss; - private MyTextboxDecimal txtRoyaties; + private Image img; private Timebox timeboxInicio; private Timebox timeboxFim; @@ -210,15 +215,6 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer { private Textbox txtNomeBanco; private Textbox numtelefonodos; private Textbox numtelefonouno; - private Checkbox checkRecibo; - private Checkbox checkTarifaReceita; - private Checkbox checkTaxaReceita; - private Checkbox checkSeguroReceita; - private Checkbox checkPedagioReceita; - private Checkbox checkTarifaDev; - private Checkbox checkTaxaDev; - private Checkbox checkSeguroDev; - private Checkbox checkPedagioDev; private Checkbox checkInformatizada; private Checkbox checkBilheteInfo; private Checkbox checkVendaInternet; @@ -261,12 +257,30 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer { lsTipoPuntoVenta = tipoPuntoVentaService.obtenerTodos(); lsUsuarioBancario = usuarioBancarioService.obtenerTodos(); + ptovtaComissaoList.setItemRenderer(new RenderPtovtaComissao()); + ptovtaComissaoList.addEventListener("onDoubleClick", new EventListener() { + @Override + public void onEvent(Event event) throws Exception { + PtovtaComissao ptovtaComissao = (PtovtaComissao) ptovtaComissaoList.getSelected(); + abrirPtovtaComissao(ptovtaComissao); + } + }); + try { txtCP.setDisabled(true); puntoVenta = (PuntoVenta) Executions.getCurrent().getArg().get("puntoVenta"); if (puntoVenta.getPuntoventaId() != null) { + puntoVenta = puntoVentaService.obtenerID(puntoVenta.getPuntoventaId()); + lsEmpresaComissao = empresaService.buscarNotInPuntoVtaComissao(puntoVenta); + + lsPtovtaComissao = ptovtaComissaoService.buscarByPuntaVenta(puntoVenta); + + + btnAdicionarEmpresaComissao.setDisabled(false); + ptovtaComissaoList.setData(lsPtovtaComissao); + if (puntoVenta.getColonia() != null) { cmbCiudad.setText(puntoVenta.getColonia().getCiudad().getNombciudad()); cmbColonia.setText(puntoVenta.getColonia().getDesccolonia()); @@ -301,125 +315,6 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer { } } - if (puntoVenta.getPuntoventaId() != null) { - if (puntoVenta.getComissaoId() != null) { - - if (puntoVenta.getComissaoId().getExcessoAlta() != null) { - txtExcessoAlta.setText(puntoVenta.getComissaoId().getExcessoAlta().toString()); - - } - if (puntoVenta.getComissaoId().getExcessoBaixa() != null) { - txtExcessoBaixa.setText(puntoVenta.getComissaoId().getExcessoBaixa().toString()); - } - - if (puntoVenta.getComissaoId().getPassagemBaixa() != null) { - txtPassagemBaixa.setText(puntoVenta.getComissaoId().getPassagemBaixa().toString()); - } - - if (puntoVenta.getComissaoId().getPassagemAlta() != null) { - txtPassagemAlta.setText(puntoVenta.getComissaoId().getPassagemAlta().toString()); - } - - if (puntoVenta.getComissaoId().getSeguroBaixa() != null) { - txtSeguroBaixa.setText(puntoVenta.getComissaoId().getSeguroBaixa().toString()); - } - - if (puntoVenta.getComissaoId().getSeguroAlta() != null) { - txtSeguroAlta.setText(puntoVenta.getComissaoId().getSeguroAlta().toString()); - } - - if (puntoVenta.getComissaoId().getOutrosBaixa() != null) { - txtOutrosBaixa.setText(puntoVenta.getComissaoId().getOutrosBaixa().toString()); - } - - if (puntoVenta.getComissaoId().getOutrosAlta() != null) { - txtOutrosAlta.setText(puntoVenta.getComissaoId().getOutrosAlta().toString()); - } - - if (puntoVenta.getComissaoId().getIssretido() != null) { - txtIss.setText(puntoVenta.getComissaoId().getIssretido().toString()); - } - - if (puntoVenta.getComissaoId().getRoyalties() != null) { - txtRoyaties.setText(puntoVenta.getComissaoId().getRoyalties().toString()); - } - - if (puntoVenta.getComissaoId().getTarifaDev() != null) { - if (puntoVenta.getComissaoId().getTarifaDev()) { - checkTarifaDev.setChecked(true); - } else { - checkTarifaDev.setChecked(false); - } - } - - if (puntoVenta.getComissaoId().getTaxaDev() != null) { - if (puntoVenta.getComissaoId().getTaxaDev()) { - checkTaxaDev.setChecked(true); - } else { - checkTaxaDev.setChecked(false); - } - } - - if (puntoVenta.getComissaoId().getPegagioDev() != null) { - if (puntoVenta.getComissaoId().getPegagioDev()) { - checkPedagioDev.setChecked(true); - } else { - checkPedagioDev.setChecked(false); - } - - } - - if (puntoVenta.getComissaoId().getSeguroDev() != null) { - if (puntoVenta.getComissaoId().getSeguroDev()) { - checkSeguroDev.setChecked(true); - } else { - checkSeguroDev.setChecked(false); - } - } - - if (puntoVenta.getComissaoId().getTarifaReceita() != null) { - if (puntoVenta.getComissaoId().getTarifaReceita()) { - checkTarifaReceita.setChecked(true); - } else { - checkTarifaReceita.setChecked(false); - } - } - - if (puntoVenta.getComissaoId().getTaxaReceita() != null) { - if (puntoVenta.getComissaoId().getTaxaReceita()) { - checkTaxaReceita.setChecked(true); - } else { - checkTaxaReceita.setChecked(false); - } - } - if (puntoVenta.getComissaoId().getReceita() != null) { - if (puntoVenta.getComissaoId().getReceita().equals("RB")) { - cmbReceita.setSelectedIndex(0); - } else if (puntoVenta.getComissaoId().getReceita().equals("RL")) { - cmbReceita.setSelectedIndex(1); - } - } - - if (puntoVenta.getComissaoId().getPedagioReceita() != null) { - if (puntoVenta.getComissaoId().getPedagioReceita()) { - checkPedagioReceita.setChecked(true); - } else { - checkPedagioReceita.setChecked(false); - } - } - - if (puntoVenta.getComissaoId().getSeguroReceita() != null) { - if (puntoVenta.getComissaoId().getSeguroReceita()) { - checkSeguroReceita.setChecked(true); - } else { - checkSeguroReceita.setChecked(false); - } - } - } else { - puntoVenta.setComissaoId(new PtovtaComissao()); - } - } - if (puntoVenta.getPuntoventaId() != null) { if (puntoVenta.getAgenciaId() != null) { @@ -722,17 +617,7 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer { txtTitularEmissor.getValue(); txtAntecipRetem.getValue(); txtAntecipPercentual.getValue(); - txtPassagemBaixa.getValue(); - txtPassagemAlta.getValue(); - txtExcessoBaixa.getValue(); - txtExcessoAlta.getValue(); - txtSeguroBaixa.getValue(); - txtSeguroAlta.getValue(); - txtOutrosBaixa.getValue(); - txtOutrosAlta.getValue(); - txtIss.getValue(); - txtRoyaties.getValue(); - txtcodAg.getValue(); + txtResponAluguel.getValue(); txtResponTel.getValue(); txtResponEnergia.getValue(); @@ -750,8 +635,8 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer { cmbTipoConta.getValue(); cmbPosicao.getValue(); - //checar uma forma onde o proprio componente coloque como null o atributo - if (cmbPuntoVentaPadre.getSelectedItem() == null){ + // checar uma forma onde o proprio componente coloque como null o atributo + if (cmbPuntoVentaPadre.getSelectedItem() == null) { puntoVenta.setPuntoVentaPadre(null); } List lsPuntoVenta = puntoVentaService.buscaPuntoVenta(txtNumPtoVta.getValue()); @@ -871,37 +756,6 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer { puntoVenta.getTitularId().setFecmodif(Calendar.getInstance().getTime()); } - if ((txtIss.getValue().equals("")) && (txtRoyaties.getValue().equals("")) && (txtExcessoAlta.getValue().equals("")) - && (txtExcessoBaixa.getValue().equals("")) && (txtPassagemBaixa.getValue().equals("")) - && (txtPassagemAlta.getValue().equals("")) && (txtSeguroBaixa.getValue().equals(""))) { - puntoVenta.setComissaoId(null); - } else { - if (cmbReceita.getSelectedItem() != null) { - puntoVenta.getComissaoId().setReceita((String) cmbReceita.getSelectedItem().getValue()); - } - puntoVenta.getComissaoId().setEnviarrecibo(checkRecibo.isChecked()); - puntoVenta.getComissaoId().setTarifaReceita(checkTarifaReceita.isChecked()); - puntoVenta.getComissaoId().setTaxaReceita(checkTaxaReceita.isChecked()); - puntoVenta.getComissaoId().setSeguroReceita(checkSeguroReceita.isChecked()); - puntoVenta.getComissaoId().setPedagioReceita(checkPedagioReceita.isChecked()); - puntoVenta.getComissaoId().setTarifaDev(checkTarifaDev.isChecked()); - puntoVenta.getComissaoId().setTaxaDev(checkTaxaDev.isChecked()); - puntoVenta.getComissaoId().setSeguroDev(checkSeguroDev.isChecked()); - puntoVenta.getComissaoId().setPegagioDev(checkPedagioDev.isChecked()); - puntoVenta.getComissaoId().setExcessoAlta(txtExcessoAlta.getValueDecimal()); - puntoVenta.getComissaoId().setExcessoBaixa(txtExcessoBaixa.getValueDecimal()); - puntoVenta.getComissaoId().setPassagemBaixa(txtPassagemBaixa.getValueDecimal()); - puntoVenta.getComissaoId().setPassagemAlta(txtPassagemAlta.getValueDecimal()); - puntoVenta.getComissaoId().setSeguroBaixa(txtSeguroBaixa.getValueDecimal()); - puntoVenta.getComissaoId().setSeguroAlta(txtSeguroAlta.getValueDecimal()); - puntoVenta.getComissaoId().setOutrosBaixa(txtOutrosBaixa.getValueDecimal()); - puntoVenta.getComissaoId().setOutrosAlta(txtOutrosAlta.getValueDecimal()); - puntoVenta.getComissaoId().setIssretido(txtIss.getValueDecimal()); - puntoVenta.getComissaoId().setRoyalties(txtRoyaties.getValueDecimal()); - puntoVenta.getComissaoId().setActivo(Boolean.TRUE); - puntoVenta.getComissaoId().setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); - puntoVenta.getComissaoId().setFecmodif(Calendar.getInstance().getTime()); - } if ((txtResponAluguel.getValue().equals("") && (txtResponTel.getValue().equals("")))) { puntoVenta.setDiversosId(null); @@ -1431,6 +1285,39 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer { } } + public void onClick$btnAdicionarEmpresaComissao(Event ev) throws InterruptedException { + if (cmbEmpresaComissao.getSelectedItem() == null) { + Messagebox.show( + Labels.getLabel("MSG.Error.combobox"), + Labels.getLabel("editarPricingController.windowMarca.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + return; + } + Empresa empresa = (Empresa) cmbEmpresaComissao.getSelectedItem().getValue(); + + PtovtaComissao ptovtaComissao = new PtovtaComissao(); + + ptovtaComissao.setEmpresaId(empresa); + ptovtaComissao.setPuntoventaId(this.puntoVenta); + + ptovtaComissaoService.suscribir(ptovtaComissao); + + lsPtovtaComissao.add(ptovtaComissao); + + List lsPtovtaComissaoAtivo = new ArrayList(); + for (PtovtaComissao rc : lsPtovtaComissao) { + if (rc.getActivo()) { + lsPtovtaComissaoAtivo.add(rc); + } + } + ptovtaComissaoList.setData(lsPtovtaComissaoAtivo); + + cmbEmpresaComissao.getSelectedItem().setVisible(false); + + abrirPtovtaComissao(ptovtaComissao); + + } + public PuntoVenta getPuntoVenta() { return puntoVenta; } @@ -1828,85 +1715,6 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer { this.lsParamRecoleccion = lsParamRecoleccion; } - public MyTextboxDecimal getTxtPassagemBaixa() { - return txtPassagemBaixa; - } - - public void setTxtPassagemBaixa(MyTextboxDecimal txtPassagemBaixa) { - this.txtPassagemBaixa = txtPassagemBaixa; - } - - public MyTextboxDecimal getTxtPassagemAlta() { - return txtPassagemAlta; - } - - public void setTxtPassagemAlta(MyTextboxDecimal txtPassagemAlta) { - this.txtPassagemAlta = txtPassagemAlta; - } - - public MyTextboxDecimal getTxtExcessoBaixa() { - return txtExcessoBaixa; - } - - public void setTxtExcessoBaixa(MyTextboxDecimal txtExcessoBaixa) { - this.txtExcessoBaixa = txtExcessoBaixa; - } - - public MyTextboxDecimal getTxtExcessoAlta() { - return txtExcessoAlta; - } - - public void setTxtExcessoAlta(MyTextboxDecimal txtExcessoAlta) { - this.txtExcessoAlta = txtExcessoAlta; - } - - public MyTextboxDecimal getTxtSeguroBaixa() { - return txtSeguroBaixa; - } - - public void setTxtSeguroBaixa(MyTextboxDecimal txtSeguroBaixa) { - this.txtSeguroBaixa = txtSeguroBaixa; - } - - public MyTextboxDecimal getTxtSeguroAlta() { - return txtSeguroAlta; - } - - public void setTxtSeguroAlta(MyTextboxDecimal txtSeguroAlta) { - this.txtSeguroAlta = txtSeguroAlta; - } - - public MyTextboxDecimal getTxtOutrosBaixa() { - return txtOutrosBaixa; - } - - public void setTxtOutrosBaixa(MyTextboxDecimal txtOutrosBaixa) { - this.txtOutrosBaixa = txtOutrosBaixa; - } - - public MyTextboxDecimal getTxtOutrosAlta() { - return txtOutrosAlta; - } - - public void setTxtOutrosAlta(MyTextboxDecimal txtOutrosAlta) { - this.txtOutrosAlta = txtOutrosAlta; - } - - public MyTextboxDecimal getTxtIss() { - return txtIss; - } - - public void setTxtIss(MyTextboxDecimal txtIss) { - this.txtIss = txtIss; - } - - public MyTextboxDecimal getTxtRoyaties() { - return txtRoyaties; - } - - public void setTxtRoyaties(MyTextboxDecimal txtRoyaties) { - this.txtRoyaties = txtRoyaties; - } public Intbox getTxtQuant() { return txtQuant; @@ -2068,6 +1876,30 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer { this.ptovtaUsuarioBancarioList = ptovtaUsuarioBancarioList; } + public List getLsEmpresaComissao() { + return lsEmpresaComissao; + } + + public void setLsEmpresaComissao(List lsEmpresaComissao) { + this.lsEmpresaComissao = lsEmpresaComissao; + } + + public Combobox getCmbEmpresaComissao() { + return cmbEmpresaComissao; + } + + public void setCmbEmpresaComissao(Combobox cmbEmpresaComissao) { + this.cmbEmpresaComissao = cmbEmpresaComissao; + } + + public Button getBtnAdicionarEmpresaComissao() { + return btnAdicionarEmpresaComissao; + } + + public void setBtnAdicionarEmpresaComissao(Button btnAdicionarEmpresaComissao) { + this.btnAdicionarEmpresaComissao = btnAdicionarEmpresaComissao; + } + public void onChange$cmbPuntoVentaPadre(Event ev) throws InterruptedException { if (puntoVenta.getPuntoventaId() != null) { List lsPuntosSubordinados = puntoVentaService.buscarPuntoVentaSubordinados(puntoVenta); @@ -2088,4 +1920,14 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer { } } } + + public void abrirPtovtaComissao(PtovtaComissao ptovtaComissao) { + Map args = new HashMap(); + args.put("ptovtaComissao", ptovtaComissao); + args.put("ptovtaComissaoList", ptovtaComissaoList); + + openWindow("/gui/catalogos/editarPuntoVentaComissao.zul", + Labels.getLabel("ededitarPuntoVentaComissaoController.window.title"), args, MODAL); + + } } diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/relatorios/RelatorioController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/relatorios/RelatorioController.java index a6f33e897..bd05f1c74 100644 --- a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/relatorios/RelatorioController.java +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/relatorios/RelatorioController.java @@ -4,7 +4,6 @@ */ package com.rjconsultores.ventaboletos.web.gui.controladores.relatorios; - import java.io.ByteArrayInputStream; import java.io.InputStream; @@ -17,6 +16,7 @@ import org.zkoss.zk.ui.event.Event; import org.zkoss.zul.Div; import org.zkoss.zul.Filedownload; import org.zkoss.zul.Iframe; +import org.zkoss.zul.Messagebox; import org.zkoss.zul.Toolbarbutton; import com.rjconsultores.ventaboletos.relatorios.utilitarios.Relatorio; import com.rjconsultores.ventaboletos.relatorios.utilitarios.SaidaRelatorio; @@ -30,32 +30,29 @@ import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; @Scope("prototype") public class RelatorioController extends MyGenericForwardComposer { - private Div divResultadoRelatorio; - private Iframe iframeRelatorio; - private Toolbarbutton btnSalvarPDF; - private Toolbarbutton btnSalvarXLS; - private AMedia conteudoRelatorioPDF; - private AMedia conteudoRelatorioXLS; - private Relatorio relatorio; - - - /** + private Iframe iframeRelatorio; + private Toolbarbutton btnSalvarPDF; + private Toolbarbutton btnSalvarXLS; + private AMedia conteudoRelatorioPDF; + private AMedia conteudoRelatorioXLS; + private Relatorio relatorio; + + /** * @return the btnSalvarPDF */ public Toolbarbutton getBtnSalvarPDF() { return btnSalvarPDF; } - /** - * @param btnSalvarPDF the btnSalvarPDF to set + * @param btnSalvarPDF + * the btnSalvarPDF to set */ public void setBtnSalvarPDF(Toolbarbutton btnSalvarPDF) { this.btnSalvarPDF = btnSalvarPDF; } - /** * @return the btnSalvarXLS */ @@ -63,70 +60,58 @@ public class RelatorioController extends MyGenericForwardComposer { return btnSalvarXLS; } - /** - * @param btnSalvarXLS the btnSalvarXLS to set + * @param btnSalvarXLS + * the btnSalvarXLS to set */ public void setBtnSalvarXLS(Toolbarbutton btnSalvarXLS) { this.btnSalvarXLS = btnSalvarXLS; } - - public Iframe getIframeRelatorio() { return iframeRelatorio; } - public void setIframeRelatorio(Iframe iframeRelatorio) { this.iframeRelatorio = iframeRelatorio; } - public Div getDivResultadoRelatorio() { return divResultadoRelatorio; } - public void setDivResultadoRelatorio(Div divResultadoRelatorio) { this.divResultadoRelatorio = divResultadoRelatorio; } - - @Override public void doAfterCompose(Component comp) throws Exception { - super.doAfterCompose(comp); - this.relatorio = (Relatorio) Executions.getCurrent().getArg().get("relatorio"); - + if (relatorio.getInfoMsg().size() > 0) + { + String msg = ""; + for (String msgItem : relatorio.getInfoMsg()) + msg = msg.concat(msgItem+"\n"); + Messagebox.show( + msg, "", + Messagebox.OK, Messagebox.INFORMATION); + } + super.doAfterCompose(comp); final InputStream mediais = new ByteArrayInputStream(this.relatorio.getConteudo(SaidaRelatorio.PDF)); - conteudoRelatorioPDF = new AMedia("relatorio.pdf", "pdf", null, mediais); - - - iframeRelatorio.setContent(conteudoRelatorioPDF); - - + } - - public void onClick$btnSalvarPDF(Event ev) { - Filedownload.save(conteudoRelatorioPDF.getStreamData(), "application/pdf", "relatorio.pdf"); + public void onClick$btnSalvarPDF(Event ev) { + Filedownload.save(conteudoRelatorioPDF.getStreamData(), "application/pdf", "relatorio.pdf"); } - - public void onClick$btnSalvarXLS(Event ev) throws Exception { + + public void onClick$btnSalvarXLS(Event ev) throws Exception { final InputStream mediais = new ByteArrayInputStream(this.relatorio.getConteudo(SaidaRelatorio.XLS)); conteudoRelatorioXLS = new AMedia("relatorio.xls", "xls", null, mediais); - Filedownload.save(conteudoRelatorioXLS.getStreamData(), "application/xls", "relatorio.xls"); + Filedownload.save(conteudoRelatorioXLS.getStreamData(), "application/xls", "relatorio.xls"); } - - - - - - } diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/relatorios/RelatorioReceitaDiariaAgenciaController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/relatorios/RelatorioReceitaDiariaAgenciaController.java index cb877efc3..9eba0d2a8 100644 --- a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/relatorios/RelatorioReceitaDiariaAgenciaController.java +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/relatorios/RelatorioReceitaDiariaAgenciaController.java @@ -5,6 +5,7 @@ package com.rjconsultores.ventaboletos.web.gui.controladores.relatorios; import java.util.ArrayList; +import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -16,19 +17,28 @@ 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.zk.ui.event.EventListener; import org.zkoss.zul.Bandbox; +import org.zkoss.zul.Button; import org.zkoss.zul.Checkbox; import org.zkoss.zul.Combobox; import org.zkoss.zul.Comboitem; import org.zkoss.zul.Datebox; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; import org.zkoss.zul.Paging; +import org.zkoss.zul.Radio; import org.zkoss.zul.Textbox; +import com.rjconsultores.ventaboletos.entidad.Empresa; import com.rjconsultores.ventaboletos.entidad.Estado; import com.rjconsultores.ventaboletos.entidad.PuntoVenta; +import com.rjconsultores.ventaboletos.entidad.TipoPuntoVenta; import com.rjconsultores.ventaboletos.relatorios.impl.RelatorioReceitaDiariaAgencia; import com.rjconsultores.ventaboletos.relatorios.utilitarios.Relatorio; +import com.rjconsultores.ventaboletos.service.EmpresaService; import com.rjconsultores.ventaboletos.service.EstadoService; import com.rjconsultores.ventaboletos.service.PuntoVentaService; +import com.rjconsultores.ventaboletos.service.TipoPuntoVentaService; import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject; @@ -47,12 +57,19 @@ public class RelatorioReceitaDiariaAgenciaController extends MyGenericForwardCom @Autowired private EstadoService estadoService; @Autowired + private EmpresaService empresaService; + @Autowired private PuntoVentaService puntoVentaService; @Autowired + private TipoPuntoVentaService tipoPuntoVentaService; + @Autowired private DataSource dataSource; - private List lsEstado; - private ArrayList lsNumPuntoVenta = new ArrayList(); + private List lsEstado; + private List lsEmpresa; + private List lsTipoPuntoVenta; + + private List lsNumPuntoVenta; @Autowired private transient PagedListWrapper plwPuntoVenta; @@ -64,10 +81,15 @@ public class RelatorioReceitaDiariaAgenciaController extends MyGenericForwardCom private Textbox txtPalavraPesquisa; private Combobox cmbEstado; + private Combobox cmbEmpresa; private Combobox cmbPuntoVenta; + private Combobox cmbTipoPuntoVenta; private Datebox datInicial; private Datebox datFinal; private Checkbox chkExcessoBagagem; + private Checkbox chkContemplarGap; + private Radio rd1; + public Datebox getDatInicial() { return datInicial; @@ -157,31 +179,44 @@ public class RelatorioReceitaDiariaAgenciaController extends MyGenericForwardCom this.puntoVentaSelList = puntoVentaSelList; } + public List getLsEmpresa() { + return lsEmpresa; + } + + public void setLsEmpresa(List lsEmpresa) { + this.lsEmpresa = lsEmpresa; + } + + public List getLsTipoPuntoVenta() { + return lsTipoPuntoVenta; + } + + public void setLsTipoPuntoVenta(List lsTipoPuntoVenta) { + this.lsTipoPuntoVenta = lsTipoPuntoVenta; + } + public void onClick$btnExecutarRelatorio(Event ev) throws Exception { executarRelatorio(); } public void onDoubleClick$puntoVentaList(Event ev) { - + PuntoVenta puntoVentaSel = (PuntoVenta) puntoVentaList.getSelected(); - Boolean bExiste = false; + puntoVentaSelList.addItemNovo(puntoVentaSel); + + + } - for (PuntoVenta objPuntoVenta : lsNumPuntoVenta) { - if (objPuntoVenta.equals(puntoVentaSel)) - bExiste = true; - } + public void onDoubleClick$puntoVentaSelList(Event ev) { + + PuntoVenta puntoVentaSel = (PuntoVenta) puntoVentaSelList.getSelected(); + puntoVentaSelList.removeItem(puntoVentaSel); - if (!bExiste) { - lsNumPuntoVenta.add(puntoVentaSel); - puntoVentaSelList.setData(lsNumPuntoVenta); - } } public void onSelect$puntoVentaList(Event ev) { - - } public void onClick$btnLimpar(Event ev) { @@ -196,8 +231,7 @@ public class RelatorioReceitaDiariaAgenciaController extends MyGenericForwardCom * */ private void limparPesquisaAgencia() { - lsNumPuntoVenta.clear(); - puntoVentaSelList.setData(lsNumPuntoVenta); + puntoVentaSelList.setData(new ArrayList()); } @@ -238,8 +272,14 @@ public class RelatorioReceitaDiariaAgenciaController extends MyGenericForwardCom parametros.put("DATA_INICIO", new java.sql.Date(((java.util.Date) this.datInicial.getValue()).getTime())); parametros.put("DATA_FINAL", new java.sql.Date(((java.util.Date) this.datFinal.getValue()).getTime())); parametros.put("B_EXCLUI_BAGAGEM", chkExcessoBagagem.isChecked()); + parametros.put("B_CONTEMPLAR_GAP", chkExcessoBagagem.isChecked()); parametros.put("NOME_RELATORIO", Labels.getLabel("relatorioReceitaDiariaAgenciaController.window.title")); + parametros.put("ISDEVOLUCAODESTINO", rd1.isChecked() ? 0 : 1); + + lsNumPuntoVenta = new ArrayList(Arrays.asList(puntoVentaSelList.getData())); + + if (lsNumPuntoVenta.size() > 0) { parametros.put("NUMPUNTOVENTA", lsNumPuntoVenta); parametros.put("ISNUMPUNTOVENTATODOS", "N"); @@ -253,6 +293,19 @@ public class RelatorioReceitaDiariaAgenciaController extends MyGenericForwardCom parametros.put("ESTADO_ID", estado.getEstadoId()); } + Comboitem itemEmpresa = cmbEmpresa.getSelectedItem(); + if (itemEmpresa != null) { + Empresa empresa = (Empresa) itemEmpresa.getValue(); + parametros.put("EMPRESA_ID", empresa.getEmpresaId()); + parametros.put("EMPRESA_NOME", empresa.getNombempresa()); + } + + Comboitem itemTipoPunto = cmbTipoPuntoVenta.getSelectedItem(); + if (itemTipoPunto != null) { + TipoPuntoVenta tipoPuntoVenta = (TipoPuntoVenta) itemTipoPunto.getValue(); + parametros.put("TIPOPTOVTA_ID", tipoPuntoVenta.getTipoptovtaId().intValue()); + } + Relatorio relatorio = new RelatorioReceitaDiariaAgencia(parametros, dataSource.getConnection()); Map args = new HashMap(); @@ -266,11 +319,16 @@ public class RelatorioReceitaDiariaAgenciaController extends MyGenericForwardCom @Override public void doAfterCompose(Component comp) throws Exception { lsEstado = estadoService.obtenerTodos(); + lsEmpresa = empresaService.obtenerTodos(); + setLsTipoPuntoVenta(tipoPuntoVentaService.obtenerTodos()); super.doAfterCompose(comp); puntoVentaList.setItemRenderer(new RenderPuntoVentaSimple()); puntoVentaSelList.setItemRenderer(new RenderPuntoVentaSimple()); + } + + } diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/relatorios/RelatorioResumoLinhasController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/relatorios/RelatorioResumoLinhasController.java new file mode 100644 index 000000000..bd2d814df --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/relatorios/RelatorioResumoLinhasController.java @@ -0,0 +1,136 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.relatorios; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import javax.sql.DataSource; + +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.zk.ui.Component; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zul.Comboitem; +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.entidad.Ruta; +import com.rjconsultores.ventaboletos.relatorios.impl.RelatorioResumoLinhas; +import com.rjconsultores.ventaboletos.relatorios.impl.RelatorioResumoLinhasAnalitico; +import com.rjconsultores.ventaboletos.relatorios.utilitarios.Relatorio; +import com.rjconsultores.ventaboletos.service.EmpresaService; +import com.rjconsultores.ventaboletos.service.PuntoVentaService; +import com.rjconsultores.ventaboletos.service.RutaService; +import com.rjconsultores.ventaboletos.service.TipoPuntoVentaService; +import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; + +/** + * + * @author Administrador + */ +@Controller("relatorioResumoLinhasController") +@Scope("prototype") +public class RelatorioResumoLinhasController extends MyGenericForwardComposer { + + @Autowired + private DataSource dataSource; + @Autowired + private EmpresaService empresaService; + @Autowired + private RutaService rutaService; + + private List lsRuta; + private List lsEmpresa; + + private Datebox fecCorridaIni; + private Datebox fecCorridaFin; + private MyComboboxEstandar cmbRuta; + private MyComboboxEstandar cmbEmpresa; + + private Radio rd1; + + public void onClick$btnExecutarRelatorio(Event ev) throws Exception { + executarRelatorio(); + } + + /** + * @throws Exception + * + */ + private void executarRelatorio() throws Exception { + + Relatorio relatorio; + Map parametros = new HashMap(); + + parametros.put("DATA_INICIAL", (java.util.Date) this.fecCorridaIni.getValue()); + parametros.put("DATA_FINAL", (java.util.Date) this.fecCorridaFin.getValue()); + parametros.put("NOME_RELATORIO", Labels.getLabel("relatorioResumoLinhasController.window.title")); + + Comboitem itemRuta = cmbRuta.getSelectedItem(); + if (itemRuta != null) { + Ruta ruta = (Ruta) itemRuta.getValue(); + parametros.put("RUTA_ID", ruta.getRutaId()); + } + + Comboitem itemEmpresa = cmbEmpresa.getSelectedItem(); + if (itemEmpresa != null) { + Empresa empresa = (Empresa) itemEmpresa.getValue(); + parametros.put("EMPRESA_ID", empresa.getEmpresaId()); + parametros.put("EMPRESA", empresa.getNombempresa()); + } + + if (rd1.isChecked()) + relatorio = new RelatorioResumoLinhas(parametros, dataSource.getConnection()); + else + relatorio = new RelatorioResumoLinhasAnalitico(parametros, dataSource.getConnection()); + + Map args = new HashMap(); + args.put("relatorio", relatorio); + + openWindow("/component/reportView.zul", + Labels.getLabel("relatorioResumoLinhasController.window.title"), args, MODAL); + + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + setLsRuta(rutaService.obtenerTodos()); + lsEmpresa = empresaService.obtenerTodos(); + + super.doAfterCompose(comp); + } + + public List getLsRuta() { + return lsRuta; + } + + public void setLsRuta(List lsRuta) { + this.lsRuta = lsRuta; + } + + public MyComboboxEstandar getCmbRuta() { + return cmbRuta; + } + + public void setCmbRuta(MyComboboxEstandar cmbRuta) { + this.cmbRuta = cmbRuta; + } + + public List getLsEmpresa() { + return lsEmpresa; + } + + public void setLsEmpresa(List lsEmpresa) { + this.lsEmpresa = lsEmpresa; + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/StringPercentToDecimalConverter.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/StringPercentToDecimalConverter.java index a23b25a13..61e4edd21 100644 --- a/src/java/com/rjconsultores/ventaboletos/web/utilerias/StringPercentToDecimalConverter.java +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/StringPercentToDecimalConverter.java @@ -26,7 +26,7 @@ public class StringPercentToDecimalConverter implements TypeConverter { if (format == null) { format = FORMAT; } - DecimalFormat df = new DecimalFormat(format, new java.text.DecimalFormatSymbols(new Locale("us"))); + DecimalFormat df = new DecimalFormat(format, new java.text.DecimalFormatSymbols(new Locale("pt", "BR"))); return df.format(val); } return null; @@ -39,7 +39,7 @@ public class StringPercentToDecimalConverter implements TypeConverter { if (val instanceof String) { - return (val.toString().trim().isEmpty()) ? (BigDecimal) null : new BigDecimal(val.toString().replace(",", "")); + return (val.toString().trim().isEmpty()) ? (BigDecimal) null : new BigDecimal(val.toString().replace(".", "").replace(",", ".")); } return null; } diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/catalogos/ItemMenuGrupoRuta.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/catalogos/ItemMenuGrupoRuta.java new file mode 100644 index 000000000..3972466d5 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/catalogos/ItemMenuGrupoRuta.java @@ -0,0 +1,26 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.catalogos; + +import org.zkoss.util.resource.Labels; + +import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria; +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class ItemMenuGrupoRuta extends DefaultItemMenuSistema { + + public ItemMenuGrupoRuta() { + super("indexController.mniGrupoRuta.label"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.CATALOGO.MENU.GRUPORUTA"; + } + + @Override + public void ejecutar() { + PantallaUtileria.openWindow("/gui/catalogos/busquedaGrupoRuta.zul", + Labels.getLabel("busquedaGrupoRutaController.window.title"), null,desktop); + + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/confcomerciales/ItemMenuImportarClientes.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/confcomerciales/ItemMenuImportarClientes.java new file mode 100644 index 000000000..bb180cfbc --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/confcomerciales/ItemMenuImportarClientes.java @@ -0,0 +1,24 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.confcomerciales; + +import org.zkoss.util.resource.Labels; + +import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria; +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class ItemMenuImportarClientes extends DefaultItemMenuSistema { + + public ItemMenuImportarClientes() { + super("indexController.mniImportarClientes.label"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.CONFIGURACIONECCOMERCIALES.MENU.IMPORTARCLIENTES"; + } + + @Override + public void ejecutar() { + PantallaUtileria.openWindow("/gui/configuraciones_comerciales/importarClientes.zul", + Labels.getLabel("importarClientesController.window.title"), null, desktop); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/relatorios/ItemMenuRelatorioResumoLinhas.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/relatorios/ItemMenuRelatorioResumoLinhas.java new file mode 100644 index 000000000..9e966f524 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/relatorios/ItemMenuRelatorioResumoLinhas.java @@ -0,0 +1,25 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorios; + +import org.zkoss.util.resource.Labels; + +import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria; +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class ItemMenuRelatorioResumoLinhas extends DefaultItemMenuSistema { + + public ItemMenuRelatorioResumoLinhas() { + super("indexController.mniRelatorioResumoLinhas.label"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.RELATORIOS.MENU.RELATORIORESUMOLINHAS"; + } + + @Override + public void ejecutar() { + PantallaUtileria.openWindow("/gui/relatorios/filtroRelatorioResumoLinhas.zul", + Labels.getLabel("relatorioResumoLinhasController.window.title"), null,desktop); + + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/menu_original.properties b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/menu_original.properties index 4539dace0..831260e86 100644 --- a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/menu_original.properties +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/menu_original.properties @@ -1,76 +1,66 @@ catalogos=com.rjconsultores.ventaboletos.web.utilerias.menu.item.catalogos.MenuCatalogos -catalogos.articulos=com.rjconsultores.ventaboletos.web.utilerias.menu.item.catalogos.ItemMenuArticulo -catalogos.tipoCorte=com.rjconsultores.ventaboletos.web.utilerias.menu.item.catalogos.ItemMenuTipoCorte catalogos.claseServicio=com.rjconsultores.ventaboletos.web.utilerias.menu.item.catalogos.ItemMenuClaseServicio catalogos.categoria=com.rjconsultores.ventaboletos.web.utilerias.menu.item.catalogos.ItemMenuCategoria catalogos.estado=com.rjconsultores.ventaboletos.web.utilerias.menu.item.catalogos.ItemMenuEstado catalogos.ciudad=com.rjconsultores.ventaboletos.web.utilerias.menu.item.catalogos.ItemMenuCiudad -catalogos.colonia=com.rjconsultores.ventaboletos.web.utilerias.menu.item.catalogos.ItemMenuColonia catalogos.cuponConvenio=com.rjconsultores.ventaboletos.web.utilerias.menu.item.catalogos.ItemMenuCuponConvenio catalogos.empresa=com.rjconsultores.ventaboletos.web.utilerias.menu.item.catalogos.ItemMenuEmpresa catalogos.formaPago=com.rjconsultores.ventaboletos.web.utilerias.menu.item.catalogos.ItemMenuFormaPago +catalogos.grupoRuta=com.rjconsultores.ventaboletos.web.utilerias.menu.item.catalogos.ItemMenuGrupoRuta catalogos.marcas=com.rjconsultores.ventaboletos.web.utilerias.menu.item.catalogos.ItemMenuMarcas catalogos.monedas=com.rjconsultores.ventaboletos.web.utilerias.menu.item.catalogos.ItemMenuMoneda catalogos.pais=com.rjconsultores.ventaboletos.web.utilerias.menu.item.catalogos.ItemMenuPais catalogos.plaza=com.rjconsultores.ventaboletos.web.utilerias.menu.item.catalogos.ItemMenuPlaza -catalogos.productoServicio=com.rjconsultores.ventaboletos.web.utilerias.menu.item.catalogos.ItemMenuProductoServicio catalogos.tipoConvenio=com.rjconsultores.ventaboletos.web.utilerias.menu.item.catalogos.ItemMenuTipoConvenio catalogos.tipoPuntoVenta=com.rjconsultores.ventaboletos.web.utilerias.menu.item.catalogos.ItemMenuTipoPuntoVenta catalogos.tipoServicio=com.rjconsultores.ventaboletos.web.utilerias.menu.item.catalogos.ItemMenuTipoServicio catalogos.associacioClaseServicioMarca=com.rjconsultores.ventaboletos.web.utilerias.menu.item.catalogos.ItemMenuAssociacionClaseServicioMarca -catalogos.tipoVenta=com.rjconsultores.ventaboletos.web.utilerias.menu.item.catalogos.ItemMenuTipoVenta +catalogos.orgaoConcedente=com.rjconsultores.ventaboletos.web.utilerias.menu.item.catalogos.ItemMenuOrgaoConcedente catalogos.puntoVenta=com.rjconsultores.ventaboletos.web.utilerias.menu.item.catalogos.ItemMenuPuntoVenta +catalogos.coeficientetarifa=com.rjconsultores.ventaboletos.web.utilerias.menu.item.catalogos.ItemMenuCoeficienteTarifa catalogos.turno=com.rjconsultores.ventaboletos.web.utilerias.menu.item.catalogos.ItemMenuTurno confComerciales=com.rjconsultores.ventaboletos.web.utilerias.menu.item.confcomerciales.MenuConfiguracionesComerciales confComerciales.secretaria=com.rjconsultores.ventaboletos.web.utilerias.menu.item.confcomerciales.ItemMenuSecretaria confComerciales.convenio=com.rjconsultores.ventaboletos.web.utilerias.menu.item.confcomerciales.ItemMenuConvenio confComerciales.tipoCambioCiudad=com.rjconsultores.ventaboletos.web.utilerias.menu.item.confcomerciales.ItemMenuTipoCambioCiudad -confComerciales.comisionistaExterno=com.rjconsultores.ventaboletos.web.utilerias.menu.item.confcomerciales.ItemMenuComisionistaExterno +confComerciales.motivoCancelacion=com.rjconsultores.ventaboletos.web.utilerias.menu.item.confcomerciales.ItemMenuMotivoCancelacion confComerciales.configuracionCancelacion=com.rjconsultores.ventaboletos.web.utilerias.menu.item.confcomerciales.ItemMenuConfiguracionCancelacion confComerciales.configuracionCategorias=com.rjconsultores.ventaboletos.web.utilerias.menu.item.confcomerciales.ItemMenuConfiguracionCategorias -confComerciales.configuracionGeneral=com.rjconsultores.ventaboletos.web.utilerias.menu.item.confcomerciales.ItemMenuConfiguracionGeneral confComerciales.configuracionReservacion=com.rjconsultores.ventaboletos.web.utilerias.menu.item.confcomerciales.ItemMenuConfiguracionReservacion confComerciales.restriccionFormaPago=com.rjconsultores.ventaboletos.web.utilerias.menu.item.confcomerciales.ItemMenuRestriccionFormaPago -confComerciales.configuracionServicio=com.rjconsultores.ventaboletos.web.utilerias.menu.item.confcomerciales.ItemMenuConfiguracionServicio confComerciales.configuracionAlerta=com.rjconsultores.ventaboletos.web.utilerias.menu.item.confcomerciales.ItemMenuConfiguracionAlerta -confComerciales.motivoCancelacion=com.rjconsultores.ventaboletos.web.utilerias.menu.item.confcomerciales.ItemMenuMotivoCancelacion -confComerciales.motivoReimpresion=com.rjconsultores.ventaboletos.web.utilerias.menu.item.confcomerciales.ItemMenuMotivoReimpresion -confComerciales.periodoVacacional=com.rjconsultores.ventaboletos.web.utilerias.menu.item.confcomerciales.ItemMenuPeriodoVacacional +confComerciales.configlayoutimpressaoboleto=com.rjconsultores.ventaboletos.web.utilerias.menu.item.confcomerciales.ItemMenuConfigLayoutImpressaoBoleto confComerciales.excepcionRedondeo=com.rjconsultores.ventaboletos.web.utilerias.menu.item.tarifas.ItemMenuExcepcionRedondeo -cortesias=com.rjconsultores.ventaboletos.web.utilerias.menu.item.cortesias.MenuCortesias -cortesias.grupoCortesia=com.rjconsultores.ventaboletos.web.utilerias.menu.item.cortesias.ItemMenuGrupoCortesia -cortesias.tipoCortesia=com.rjconsultores.ventaboletos.web.utilerias.menu.item.cortesias.ItemMenuTipoCortesia -cortesias.tipoCortesiaDescuento=com.rjconsultores.ventaboletos.web.utilerias.menu.item.cortesias.ItemMenuTipoCortesiaDescuento -cortesias.cortesiaDireccion=com.rjconsultores.ventaboletos.web.utilerias.menu.item.cortesias.ItemMenuCortesiaDireccion -cortesias.altaCortesiaRH=com.rjconsultores.ventaboletos.web.utilerias.menu.item.cortesias.ItemMenuAltaCortesiaRH +confComerciales.configuracionGeneral=com.rjconsultores.ventaboletos.web.utilerias.menu.item.confcomerciales.ItemMenuConfiguracionGeneral +confComerciales.configuracionFeriado=com.rjconsultores.ventaboletos.web.utilerias.menu.item.confcomerciales.ItemMenuConfiguracionFeriado +confComerciales.tarjetacredito=com.rjconsultores.ventaboletos.web.utilerias.menu.item.confcomerciales.ItemMenuTarjetaCredito esquemaOperacional=com.rjconsultores.ventaboletos.web.utilerias.menu.item.esquemaoperacional.MenuEsquemaOperacional esquemaOperacional.tipoParadas=com.rjconsultores.ventaboletos.web.utilerias.menu.item.esquemaoperacional.ItemMenuTipoParadas esquemaOperacional.paradas=com.rjconsultores.ventaboletos.web.utilerias.menu.item.esquemaoperacional.ItemMenuEsquemaOperacionalParadas +esquemaOperacional.aliasservico=com.rjconsultores.ventaboletos.web.utilerias.menu.item.esquemaoperacional.ItemMenuAliasServico esquemaOperacional.autobus=com.rjconsultores.ventaboletos.web.utilerias.menu.item.esquemaoperacional.ItemMenuAutobus esquemaOperacional.diagramaAutobus=com.rjconsultores.ventaboletos.web.utilerias.menu.item.esquemaoperacional.ItemMenuDiagramaAutobus -esquemaOperacional.via=com.rjconsultores.ventaboletos.web.utilerias.menu.item.esquemaoperacional.ItemMenuVia +esquemaOperacional.rolOperativo=com.rjconsultores.ventaboletos.web.utilerias.menu.item.esquemaoperacional.ItemMenuRolOperativo esquemaOperacional.generacionAutomaticaTramoRuta=com.rjconsultores.ventaboletos.web.utilerias.menu.item.esquemaoperacional.ItemMenuGeneracionAutomaticaTramoRuta +esquemaOperacional.via=com.rjconsultores.ventaboletos.web.utilerias.menu.item.esquemaoperacional.ItemMenuVia esquemaOperacional.tramo=com.rjconsultores.ventaboletos.web.utilerias.menu.item.esquemaoperacional.ItemMenuTramo -esquemaOperacional.tramoKmServicio=com.rjconsultores.ventaboletos.web.utilerias.menu.item.esquemaoperacional.ItemMenuTramoKmServicio esquemaOperacional.ruta=com.rjconsultores.ventaboletos.web.utilerias.menu.item.esquemaoperacional.ItemMenuEsquemaOperacionalRuta esquemaOperacional.corrida=com.rjconsultores.ventaboletos.web.utilerias.menu.item.esquemaoperacional.ItemMenuCorrida -esquemaOperacional.rolOperativo=com.rjconsultores.ventaboletos.web.utilerias.menu.item.esquemaoperacional.ItemMenuRolOperativo +esquemaOperacional.paramConexion=com.rjconsultores.ventaboletos.web.utilerias.menu.item.esquemaoperacional.ItemMenuParamConexion +esquemaOperacional.conexion=com.rjconsultores.ventaboletos.web.utilerias.menu.item.esquemaoperacional.ItemMenuConexion esquemaOperacional.generacionCorrida=com.rjconsultores.ventaboletos.web.utilerias.menu.item.esquemaoperacional.ItemMenuGeneracionCorrida -pricing=com.rjconsultores.ventaboletos.web.utilerias.menu.item.pricing.MenuPricing -pricing.general=com.rjconsultores.ventaboletos.web.utilerias.menu.item.pricing.ItemMenuPricing -pricing.especifico=com.rjconsultores.ventaboletos.web.utilerias.menu.item.pricing.ItemMenuPricingEspecifico +esquemaOperacional.confrestricaocanalventa=com.rjconsultores.ventaboletos.web.utilerias.menu.item.esquemaoperacional.ItemMenuConfRestricaoCanalVenta +esquemaOperacional.selecionarservicosgerar=com.rjconsultores.ventaboletos.web.utilerias.menu.item.esquemaoperacional.ItemSelecionarServicosGerar tarifasOficial=com.rjconsultores.ventaboletos.web.utilerias.menu.item.tarifasOficial.MenuTarifasOficial tarifasOficial.seguroKm=com.rjconsultores.ventaboletos.web.utilerias.menu.item.tarifasOficial.ItemMenuSeguroKm tarifasOficial.seguroTarifa=com.rjconsultores.ventaboletos.web.utilerias.menu.item.tarifasOficial.ItemMenuSeguroTarifa tarifasOficial.taxaEmbarqueKm=com.rjconsultores.ventaboletos.web.utilerias.menu.item.tarifasOficial.ItemMenuTarifasTaxaEmbarqueKm tarifasOficial.taxaEmbarqueParada=com.rjconsultores.ventaboletos.web.utilerias.menu.item.tarifasOficial.ItemMenuTarifasTaxaEmbarqueParada tarifasOficial.generarTarifasOrgao=com.rjconsultores.ventaboletos.web.utilerias.menu.item.tarifasOficial.ItemMenuGenerarTarifasOrgao -tarifasOficial.copiarTarifaOficial=com.rjconsultores.ventaboletos.web.utilerias.menu.item.tarifasOficial.ItemMenuCopiarTarifaOficial tarifasOficial.tarifaOficialExcel=com.rjconsultores.ventaboletos.web.utilerias.menu.item.tarifasOficial.ItemMenuTarifaOficialExcel tarifasOficial.tarifaOficial=com.rjconsultores.ventaboletos.web.utilerias.menu.item.tarifasOficial.ItemMenuTarifasOficial tarifas=com.rjconsultores.ventaboletos.web.utilerias.menu.item.tarifas.MenuTarifas tarifas.copiarTarifaOficial=com.rjconsultores.ventaboletos.web.utilerias.menu.item.tarifas.ItemMenuCopiarTarifaOficial -tarifas.redondeo=com.rjconsultores.ventaboletos.web.utilerias.menu.item.tarifas.ItemMenuRedondeo tarifas.vigenciaTarifa=com.rjconsultores.ventaboletos.web.utilerias.menu.item.tarifas.ItemMenuVigenciaTarifa tarifas.tarifasMinimas=com.rjconsultores.ventaboletos.web.utilerias.menu.item.tarifas.ItemMenuTarifasMinimas tarifas.cambioVigencia=com.rjconsultores.ventaboletos.web.utilerias.menu.item.tarifas.ItemMenuCambioVigencia @@ -78,37 +68,27 @@ tarifas.mercadoCompetido=com.rjconsultores.ventaboletos.web.utilerias.menu.item. tarifas.modificacionMasiva=com.rjconsultores.ventaboletos.web.utilerias.menu.item.tarifas.ItemMenuModificacionMasiva tarifas.tarifas=com.rjconsultores.ventaboletos.web.utilerias.menu.item.tarifas.ItemMenuTarifas tarifas.tarifaEscala=com.rjconsultores.ventaboletos.web.utilerias.menu.item.tarifas.ItemMenuTarifaEscala -pasajeroFrecuente=com.rjconsultores.ventaboletos.web.utilerias.menu.item.pasajerofrecuente.MenuPasajeroFrecuente -pasajeroFrecuente.tipoDomicilio=com.rjconsultores.ventaboletos.web.utilerias.menu.item.pasajerofrecuente.ItemMenuTipoDomicilio -pasajeroFrecuente.tipoOcupacion=com.rjconsultores.ventaboletos.web.utilerias.menu.item.pasajerofrecuente.ItemMenuTipoOcupacion -pasajeroFrecuente.tipoMovimiento=com.rjconsultores.ventaboletos.web.utilerias.menu.item.pasajerofrecuente.ItemMenuTipoMovimiento -pasajeroFrecuente.paramAcumulacionMasivo=com.rjconsultores.ventaboletos.web.utilerias.menu.item.pasajerofrecuente.ItemMenuParamAcumulacionMasivo -pasajeroFrecuente.acumulacionPorVenta=com.rjconsultores.ventaboletos.web.utilerias.menu.item.pasajerofrecuente.ItemMenuAcumulacionPorVenta -pasajeroFrecuente.canjePuntos=com.rjconsultores.ventaboletos.web.utilerias.menu.item.pasajerofrecuente.ItemMenuCanjePuntos -pasajeroFrecuente.paramCompraPuntos=com.rjconsultores.ventaboletos.web.utilerias.menu.item.pasajerofrecuente.ItemMenuParamCompraPuntos -pasajeroFrecuente.paramCostoTarjeta=com.rjconsultores.ventaboletos.web.utilerias.menu.item.pasajerofrecuente.ItemMenuParamCostoTarjeta -pasajeroFrecuente.generacionTarjeta=com.rjconsultores.ventaboletos.web.utilerias.menu.item.pasajerofrecuente.ItemMenuGeneracionTarjeta +pricing=com.rjconsultores.ventaboletos.web.utilerias.menu.item.pricing.MenuPricing +pricing.general=com.rjconsultores.ventaboletos.web.utilerias.menu.item.pricing.ItemMenuPricing +pricing.especifico=com.rjconsultores.ventaboletos.web.utilerias.menu.item.pricing.ItemMenuPricingEspecifico +cortesias=com.rjconsultores.ventaboletos.web.utilerias.menu.item.cortesias.MenuCortesias +cortesias.grupoCortesia=com.rjconsultores.ventaboletos.web.utilerias.menu.item.cortesias.ItemMenuGrupoCortesia +cortesias.tipoCortesia=com.rjconsultores.ventaboletos.web.utilerias.menu.item.cortesias.ItemMenuTipoCortesia +cortesias.tipoCortesiaDescuento=com.rjconsultores.ventaboletos.web.utilerias.menu.item.cortesias.ItemMenuTipoCortesiaDescuento +cortesias.cortesiaDireccion=com.rjconsultores.ventaboletos.web.utilerias.menu.item.cortesias.ItemMenuCortesiaDireccion +ingresosExtras=com.rjconsultores.ventaboletos.web.utilerias.menu.item.ingreso.MenuIngreso +ingresosExtras.ingreso=com.rjconsultores.ventaboletos.web.utilerias.menu.item.ingreso.ItemMenuIngreso seguridad=com.rjconsultores.ventaboletos.web.utilerias.menu.item.seguridad.MenuSeguridad -seguridad.companiaBancaria=com.rjconsultores.ventaboletos.web.utilerias.menu.item.seguridad.ItemMenuCompaniaBancaria seguridad.estacion=com.rjconsultores.ventaboletos.web.utilerias.menu.item.seguridad.ItemMenuEstacion seguridad.autorizacion=com.rjconsultores.ventaboletos.web.utilerias.menu.item.seguridad.ItemMenuAutorizacion seguridad.perfil=com.rjconsultores.ventaboletos.web.utilerias.menu.item.seguridad.ItemMenuPerfil seguridad.autorizacionPerfil=com.rjconsultores.ventaboletos.web.utilerias.menu.item.seguridad.ItemMenuAutorizacionPerfil seguridad.usuario=com.rjconsultores.ventaboletos.web.utilerias.menu.item.seguridad.ItemMenuUsuario -equivalencia=com.rjconsultores.ventaboletos.web.utilerias.menu.item.equivalencia.MenuEquivalencia -equivalencia.parada=com.rjconsultores.ventaboletos.web.utilerias.menu.item.equivalencia.ItemMenuParadaEquivalencia -equivalencia.empresa=com.rjconsultores.ventaboletos.web.utilerias.menu.item.equivalencia.ItemMenuEmpresaEquivalencia -equivalencia.claseServicio=com.rjconsultores.ventaboletos.web.utilerias.menu.item.equivalencia.ItemMenuClaseServicioEquivalencia -equivalencia.motivoCancelacion=com.rjconsultores.ventaboletos.web.utilerias.menu.item.equivalencia.ItemMenuMotivoCancelacionEquivalencia -ingresosExtras=com.rjconsultores.ventaboletos.web.utilerias.menu.item.ingreso.MenuIngreso -ingresosExtras.bancos=com.rjconsultores.ventaboletos.web.utilerias.menu.item.ingreso.ItemMenuBancos -ingresosExtras.ingreso=com.rjconsultores.ventaboletos.web.utilerias.menu.item.ingreso.ItemMenuIngreso -informes=com.rjconsultores.ventaboletos.web.utilerias.menu.item.informes.MenuInformes -informes.pasajeroServicio=com.rjconsultores.ventaboletos.web.utilerias.menu.item.informes.ItemMenuPasajeroServicio -informes.servicioDiario=com.rjconsultores.ventaboletos.web.utilerias.menu.item.informes.ItemMenuServicioDiario -informes.categoriaVenta=com.rjconsultores.ventaboletos.web.utilerias.menu.item.informes.ItemMenuCategoriaVenta -informes.ventasPuntoVenta=com.rjconsultores.ventaboletos.web.utilerias.menu.item.informes.ItemMenuVentasPuntoVenta -ayuda=com.rjconsultores.ventaboletos.web.utilerias.menu.item.ayuda.MenuAyuda -ayuda.version=com.rjconsultores.ventaboletos.web.utilerias.menu.item.ayuda.ItemMenuVersion -relatorios=com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorios.MenuRelatorios +pasajerofrecuente=com.rjconsultores.ventaboletos.web.utilerias.menu.item.pasajerofrecuente.MenuPasajeroFrecuente +pasajerofrecuente.cliente=com.rjconsultores.ventaboletos.web.utilerias.menu.item.pasajerofrecuente.ItemMenuCliente +pasatorios=com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorios.MenuRelatorios relatorios.relatorioAproveitamento=com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorios.ItemMenuRelatorioAproveitamento +relatorios.relatorioReceitaDiariaAgencia=com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorios.ItemMenuRelatorioReceitaDiariaAgencia +relatorios.relatorioResumoLinhas=com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorios.ItemMenuRelatorioResumoLinhas +ayuda=com.rjconsultores.ventaboletos.web.utilerias.menu.item.ayuda.MenuAyuda +ayuda.version=com.rjconsultores.ventaboletos.web.utilerias.menu.item.ayuda.ItemMenuVersion \ No newline at end of file diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderGrupoRuta.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderGrupoRuta.java new file mode 100644 index 000000000..d83d6af88 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderGrupoRuta.java @@ -0,0 +1,30 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.GrupoRuta; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Bruno H. G. Gouvêa + * + */ +public class RenderGrupoRuta implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + GrupoRuta grupoRuta = (GrupoRuta) o; + + Listcell lc = new Listcell(grupoRuta.getGrupoRutaId().toString()); + lc.setParent(lstm); + + lc = new Listcell(grupoRuta.getDescGrupo()); + lc.setParent(lstm); + + lstm.setAttribute("data", grupoRuta); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderPtovtaComissao.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderPtovtaComissao.java new file mode 100644 index 000000000..0b4437da6 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderPtovtaComissao.java @@ -0,0 +1,29 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +import com.rjconsultores.ventaboletos.entidad.EmpresaImposto; +import com.rjconsultores.ventaboletos.entidad.PtovtaComissao; + +/** + * + * @author Bruno H. G. Gouvêa + * + */ +public class RenderPtovtaComissao implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + PtovtaComissao ptovtaComissao = (PtovtaComissao) o; + + Listcell lc = new Listcell(ptovtaComissao.getEmpresaId().getNombempresa()); + lc.setParent(lstm); + + lstm.setAttribute("data", ptovtaComissao); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderPuntoVentaSimple.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderPuntoVentaSimple.java index 2b033c782..dce7eb695 100644 --- a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderPuntoVentaSimple.java +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderPuntoVentaSimple.java @@ -4,12 +4,17 @@ */ package com.rjconsultores.ventaboletos.web.utilerias.render; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zul.Button; import org.zkoss.zul.Listcell; import org.zkoss.zul.Listitem; import org.zkoss.zul.ListitemRenderer; import com.rjconsultores.ventaboletos.entidad.Empresa; +import com.rjconsultores.ventaboletos.entidad.EmpresaImposto; import com.rjconsultores.ventaboletos.entidad.PuntoVenta; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; /** * @@ -27,7 +32,28 @@ public class RenderPuntoVentaSimple implements ListitemRenderer { lc = new Listcell(puntoVenta.getNombpuntoventa()); lc.setParent(lstm); + + + Button btn = new Button(); + + lc = new Listcell(); + lc.setParent(lstm); + + btn.setWidth("16"); + btn.setHeight("16"); + btn.setImage("/gui/img/remove.png"); + + btn.addEventListener("onClick", new EventListener() { + @Override + public void onEvent(Event event) throws Exception { + MyListbox listBox = (MyListbox)event.getTarget().getParent().getParent().getParent(); + Listitem listItem = (Listitem)event.getTarget().getParent().getParent(); + listBox.removeItem((PuntoVenta) listItem.getAttribute("data")); + } + }); + + lc.appendChild(btn); lstm.setAttribute("data", puntoVenta); } } diff --git a/src/java/spring-config.xml b/src/java/spring-config.xml index 9372980f6..3841d3dce 100644 --- a/src/java/spring-config.xml +++ b/src/java/spring-config.xml @@ -119,6 +119,7 @@ com.rjconsultores.ventaboletos.entidad.FormaPago com.rjconsultores.ventaboletos.entidad.FormaPagoDet com.rjconsultores.ventaboletos.entidad.GrupoCortesia + com.rjconsultores.ventaboletos.entidad.GrupoRuta com.rjconsultores.ventaboletos.entidad.FuncionSistema com.rjconsultores.ventaboletos.entidad.Marca com.rjconsultores.ventaboletos.entidad.MercadoCompetido diff --git a/web/WEB-INF/i3-label_pt_BR.label b/web/WEB-INF/i3-label_pt_BR.label index 960884399..a83ae45dc 100644 --- a/web/WEB-INF/i3-label_pt_BR.label +++ b/web/WEB-INF/i3-label_pt_BR.label @@ -95,6 +95,7 @@ indexController.mniMarcas.label = Marcas indexController.mniMoneda.label = Moeda indexController.mniPlaza.label = Praça indexController.mniClaseServicio.label = Tipo de Classe +indexController.mniGrupoRuta.label = Grupo de Linha indexController.mniCorrida.label = Configuração de Serviços indexController.mniConexion.label = Conexões indexController.mniParamConexion.label = Parâmetros de Conexão @@ -216,6 +217,7 @@ indexController.mniRelatorioReceitaDiariaAgencia.label = Relatório de Receita D indexController.mniRelatorioLinhaOperacional.label = Relatório de Linha Operacional indexController.mniRelatorioTrechoVendido.label = Relatório de Trecho Vendido Por Agência indexController.mniRelatorioPassageirosViajar.label = Passageiros a Viajar +indexController.mniRelatorioResumoLinhas.label = Relatório Resumo de Linhas #PARTE REALIZADA POR MANUEL indexController.mnCortesias.label = Cortesias Para Funcionários @@ -239,8 +241,37 @@ busquedaClaseServicioController.btnPesquisa.label = Pesquisa busquedaClaseServicioController.lhDesc.label = Descrição busquedaClaseServicioController.lhId.label = ID + +# Grupo Ruta +busquedaGrupoRutaController.window.title = Grupo de Linha +busquedaGrupoRutaController.btnRefresh.tooltiptext = Atualizar +busquedaGrupoRutaController.btnNovo.tooltiptext = Incluir +busquedaGrupoRutaController.btnCerrar.tooltiptext = Fechar +busquedaGrupoRutaController.btnPesquisa.label = Pesquisa +busquedaGrupoRutaController.lhDesc.label = Descrição +busquedaGrupoRutaController.lhId.label = ID + + +editarGrupoRutaController.window.title = Grupo de Linha +editarGrupoRutaController.btnApagar.tooltiptext = Eliminar +editarGrupoRutaController.btnSalvar.tooltiptext = Salvar +editarGrupoRutaController.btnFechar.tooltiptext = Fechar +editarGrupoRutaController.lbNome.value = Grupo de Linha +editarGrupoRutaController.MSG.suscribirOK = Grupo de linha registrado com sucesso. +editarGrupoRutaController.MSG.borrarPergunta = Deseja eliminar grupo de linha? +editarGrupoRutaController.MSG.borrarOK = Grupo de linha excluido com sucesso. + #Relatórios +#Resumo de linhas +relatorioResumoLinhasController.window.title = Relatório Resumo de Linhas +relatorioResumoLinhasController.lbRuta.value = Linha +relatorioResumoLinhasController.lbFecCorrida.value = Período de Viagem +relatorioResumoLinhasController.lbEmpresa.value = Empresa +relatorioResumoLinhasController.lbConexao.value = Conexão +relatorioResumoLinhasController.lbLote.value = Lote + + #Aproveitamento relatorioAproveitamentoController.window.title = Relatório de Aproveitamento relatorioAproveitamentoController.lbFecCorrida.value = Data Serviço @@ -274,7 +305,15 @@ relatorioReceitaDiariaAgenciaController.lbEstado.value = Estado relatorioReceitaDiariaAgenciaController.lbPuntoVenta.value = Agência relatorioReceitaDiariaAgenciaController.btnPesquisa.label = Pesquisar relatorioReceitaDiariaAgenciaController.btnLimpar.label = Limpar Seleção - +relatorioReceitaDiariaAgenciaController.puntoVentaSelList.codigo = Código +relatorioReceitaDiariaAgenciaController.puntoVentaSelList.nome = Nome +relatorioReceitaDiariaAgenciaController.chkExcessoBagagem.label = Excluso Excesso de Bagagem +relatorioReceitaDiariaAgenciaController.chkContemplarGap.label = Contemplar GAP +relatorioReceitaDiariaAgenciaController.lbEmpresa.value = Empresa +relatorioReceitaDiariaAgenciaController.lbTipoPuntoVenta.value = Tipo Agência +relatorioReceitaDiariaAgenciaController.lbDevolucao.value = Devolução baseadas na ag. de +relatorioReceitaDiariaAgenciaController.rdIndAgenciaDevol.rd1.label = Origem +relatorioReceitaDiariaAgenciaController.rdIndAgenciaDevol.rd2.label = Destino # Pantalla Editar Classe editarClaseServicioController.window.title = Tipo de Classe @@ -645,6 +684,12 @@ editarPuntoVentaController.registroNumPtoVtaExiste = Já existe uma agência com editarPuntoVentaController.lbStock.value = Estoque editarPuntoVentaController.lbCheckStock.value = Validar Estoque +# Editar comissão ponto de venda +editarPuntoVentaComissaoController.window.title = Comissão Empresa/Ponto de Venda +editarPuntoVentaComissaoController.MSG.suscribirOK = Comissão da Empresa/Ponto de Venda registrada com cucesso. +editarPuntoVentaComissaoController.MSG.borrarPergunta = Deseja eliminar esta Comissão da Empresa/Ponto de Venda? +editarPuntoVentaComissaoController.MSG.borrarOK = Comissão da Empresa/Ponto de Venda excluida com sucesso. + # Muestra o TipoVenta Pesquisa busquedaTipoVentaController.window.title = Modalidade de Venda busquedaTipoVentaController.btnRefresh.tooltiptext = Atualizar @@ -4217,6 +4262,7 @@ editarClienteController.lbTipoDomicilio.value = Tipo Domícílio editarClienteController.lbCP.value = CEP editarClienteController.msg.clienteimportacao = Cliente inserido por importação de arquivo poderá somente ser visualizado. + # BusquedaConfigFeriado busquedaConfigFeriadoController.window.title = Configuração de Feriado busquedaConfigFeriadoController.btnRefresh.tooltiptext = Atualizar diff --git a/web/component/reportView.zul b/web/component/reportView.zul index 341334c61..c4df5e6d8 100644 --- a/web/component/reportView.zul +++ b/web/component/reportView.zul @@ -6,7 +6,7 @@ + contentStyle="overflow:auto" height="768px" width="980px" border="normal" maximizable="true" >
@@ -20,7 +20,7 @@ -