diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioAproveitamentoFinanceiro.java b/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioAproveitamentoFinanceiro.java new file mode 100644 index 000000000..7d9dcb3d5 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioAproveitamentoFinanceiro.java @@ -0,0 +1,240 @@ +/** + * + */ +package com.rjconsultores.ventaboletos.relatorios.impl; + +import java.math.BigDecimal; +import java.sql.Connection; +import java.sql.ResultSet; +import java.sql.Timestamp; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; + +import com.rjconsultores.ventaboletos.relatorios.utilitarios.ArrayDataSource; +import com.rjconsultores.ventaboletos.relatorios.utilitarios.Relatorio; +import com.rjconsultores.ventaboletos.utilerias.DateUtil; +import com.rjconsultores.ventaboletos.web.utilerias.NamedParameterStatement; + + +public class RelatorioAproveitamentoFinanceiro extends Relatorio { + + private final BigDecimal cem = new BigDecimal("100"); + + public RelatorioAproveitamentoFinanceiro(Map parametros, Connection conexao) throws Exception { + super(parametros, conexao); + + this.setCustomDataSource(new ArrayDataSource(this) { + @Override + public void initDados() throws Exception { + + Connection conexao = this.relatorio.getConexao(); + Map parametros = this.relatorio.getParametros(); + + StringBuilder sql = new StringBuilder(); + + sql.append("select * from ( "); + sql.append(" SELECT "); + sql.append(" r.DESCRUTA as linha, "); + sql.append(" count( c.caja_id) as passageiros, "); + sql.append(" sum( c.PRECIOPAGADO )as valor, "); + sql.append(" to_char( c.FECHORVENTA, 'DY') as dia, "); + sql.append(" count(DISTINCT to_char( c.FECHORVENTA, 'WW')) as qtde, "); + sql.append(" r.indsentidoida as sentido, "); + sql.append(" da.cantasientos as assentos, "); + sql.append(" TO_CHAR(c.fechorviaje ,'HH24:mi') as horario, "); + sql.append(" c.CORRIDA_ID as servico, "); + sql.append(" max(c.preciobase) as tarifa "); + sql.append(" FROM CAJA c "); + sql.append(" inner join corrida co "); + sql.append(" on c.CORRIDA_ID = co.CORRIDA_ID "); + sql.append(" and c.FECCORRIDA = co.FECCORRIDA "); + sql.append(" and co.ACTIVO = 1 "); + sql.append(" inner join ruta r "); + sql.append(" on c.RUTA_ID = r.RUTA_ID "); + sql.append(" and r.ACTIVO = 1 "); + sql.append(" inner join MARCA m "); + sql.append(" on m.marca_id = c.marca_id "); + sql.append(" and m.activo = 1 "); + sql.append(" left join rol_operativo ro "); + sql.append(" on ro.roloperativo_id = co.roloperativo_id "); + sql.append(" left join diagrama_autobus da "); + sql.append(" on ro.diagramaautobus_id = da.diagramaautobus_id "); + sql.append(" WHERE c.activo = 1 "); + sql.append(" AND m.EMPRESA_ID = :EMPRESA_ID "); + sql.append(" and c.FECHORVENTA >= :DATA_INICIAL "); + sql.append(" and c.FECHORVENTA <= :DATA_FINAL "); + + if (parametros.get("LINHAS") != null && !possuiFiltroTodos("LINHAS")) { + sql.append(" and c.ruta_id IN (" + parametros.get("LINHAS").toString() + ")"); + } + + sql.append(" and c.MOTIVOCANCELACION_ID is null "); + sql.append(" and c.INDSTATUSBOLETO = 'V' "); + sql.append(" GROUP by r.DESCRUTA, r.indsentidoida, da.cantasientos, "); + sql.append(" to_char( c.FECHORVENTA, 'DY'), TO_CHAR(c.fechorviaje ,'HH24:mi'), "); + sql.append(" c.CORRIDA_ID "); + sql.append(" ORDER by r.DESCRUTA, r.indsentidoida desc, to_char( c.FECHORVENTA, 'DY') "); + sql.append(" ) "); + sql.append("PIVOT "); + sql.append("( "); + sql.append(" max(valor) receita_ope, "); + sql.append(" count(qtde) qtde, "); + sql.append(" max(passageiros) tot "); + sql.append(" for dia in ('SEG', 'TER', 'QUA', 'QUI', 'SEX', 'SAB', 'DOM') "); + sql.append(") "); + + NamedParameterStatement stmt = new NamedParameterStatement(conexao, sql.toString()); + + stmt.setInt("EMPRESA_ID", Integer.valueOf(parametros.get("EMPRESA_ID").toString())); + stmt.setTimestamp("DATA_INICIAL", new Timestamp(DateUtil.inicioFecha((Date) parametros.get("DATA_INICIAL")).getTime())); + stmt.setTimestamp("DATA_FINAL", new Timestamp(DateUtil.fimFecha((Date) parametros.get("DATA_FINAL")).getTime())); + + ResultSet rset = stmt.executeQuery(); + + rset.setFetchSize(500); + + while (rset.next()) { + + Map dataResult = new HashMap(); + + dataResult.put("LINHA", rset.getString("linha")); + dataResult.put("SENTIDO", rset.getString("sentido")); + dataResult.put("SERVICO", rset.getString("servico")); + dataResult.put("HORARIO", rset.getString("horario")); + + BigDecimal assentos = limpaNulo(rset.getBigDecimal("assentos")); + BigDecimal tarifa = limpaNulo(rset.getBigDecimal("tarifa")); + BigDecimal totPassageiros = BigDecimal.ZERO; + BigDecimal totReceita = BigDecimal.ZERO; + BigDecimal viagens = BigDecimal.ZERO; + + BigDecimal segReceitaOpe = limpaNulo(rset.getBigDecimal("'SEG'_RECEITA_OPE")); + BigDecimal segQtde = limpaNulo(rset.getBigDecimal("'SEG'_QTDE")); + BigDecimal segTot = limpaNulo(rset.getBigDecimal("'SEG'_TOT")); + totPassageiros = totPassageiros.add(segTot); + totReceita = totReceita.add(segReceitaOpe); + viagens = viagens.add(segQtde); + + BigDecimal terReceitaOpe = limpaNulo(rset.getBigDecimal("'TER'_RECEITA_OPE")); + BigDecimal terQtde = limpaNulo(rset.getBigDecimal("'TER'_QTDE")); + BigDecimal terTot = limpaNulo(rset.getBigDecimal("'TER'_TOT")); + totPassageiros = totPassageiros.add(terTot); + totReceita = totReceita.add(terReceitaOpe); + viagens = viagens.add(terQtde); + + BigDecimal quaReceitaOpe = limpaNulo(rset.getBigDecimal("'QUA'_RECEITA_OPE")); + BigDecimal quaQtde = limpaNulo(rset.getBigDecimal("'QUA'_QTDE")); + BigDecimal quaTot = limpaNulo(rset.getBigDecimal("'QUA'_TOT")); + totPassageiros = totPassageiros.add(quaTot); + totReceita = totReceita.add(quaReceitaOpe); + viagens = viagens.add(quaQtde); + + BigDecimal quiReceitaOpe = limpaNulo(rset.getBigDecimal("'QUI'_RECEITA_OPE")); + BigDecimal quiQtde = limpaNulo(rset.getBigDecimal("'QUI'_QTDE")); + BigDecimal quiTot = limpaNulo(rset.getBigDecimal("'QUI'_TOT")); + totPassageiros = totPassageiros.add(quiTot); + totReceita = totReceita.add(quiReceitaOpe); + viagens = viagens.add(quiQtde); + + BigDecimal sexReceitaOpe = limpaNulo(rset.getBigDecimal("'SEX'_RECEITA_OPE")); + BigDecimal sexQtde = limpaNulo(rset.getBigDecimal("'SEX'_QTDE")); + BigDecimal sexTot = limpaNulo(rset.getBigDecimal("'SEX'_TOT")); + totPassageiros = totPassageiros.add(sexTot); + totReceita = totReceita.add(sexReceitaOpe); + viagens = viagens.add(sexQtde); + + BigDecimal sabReceitaOpe = limpaNulo(rset.getBigDecimal("'SAB'_RECEITA_OPE")); + BigDecimal sabQtde = limpaNulo(rset.getBigDecimal("'SAB'_QTDE")); + BigDecimal sabTot = limpaNulo(rset.getBigDecimal("'SAB'_TOT")); + totPassageiros = totPassageiros.add(sabTot); + totReceita = totReceita.add(sabReceitaOpe); + viagens = viagens.add(sabQtde); + + BigDecimal domReceitaOpe = limpaNulo(rset.getBigDecimal("'DOM'_RECEITA_OPE")); + BigDecimal domQtde = limpaNulo(rset.getBigDecimal("'DOM'_QTDE")); + BigDecimal domTot = limpaNulo(rset.getBigDecimal("'DOM'_TOT")); + totPassageiros = totPassageiros.add(domTot); + totReceita = totReceita.add(domReceitaOpe); + viagens = viagens.add(domQtde); + + dataResult.put("VIAGENS", viagens); + dataResult.put("ASSENTOS", assentos); + dataResult.put("TARIFA", tarifa); + dataResult.put("TOT_PASSAGEIROS", totPassageiros); + dataResult.put("TOT_RECEITA", totReceita); + + dataResult.put("SEG_RECEITA_OPE", segReceitaOpe); + dataResult.put("SEG_QTDE", segQtde); + dataResult.put("SEG_TOT", segTot); + dataResult.put("SEG_FIN", calculaMedia(totReceita, segReceitaOpe, viagens)); + + dataResult.put("TER_RECEITA_OPE", terReceitaOpe); + dataResult.put("TER_QTDE", terQtde); + dataResult.put("TER_TOT", terTot); + dataResult.put("TER_FIN", calculaMedia(totReceita, terReceitaOpe, viagens)); + + dataResult.put("QUA_RECEITA_OPE", quaReceitaOpe); + dataResult.put("QUA_QTDE", quaQtde); + dataResult.put("QUA_TOT", quaTot); + dataResult.put("QUA_FIN", calculaMedia(totReceita, quaReceitaOpe, viagens)); + + dataResult.put("QUI_RECEITA_OPE", quiReceitaOpe); + dataResult.put("QUI_QTDE", quiQtde); + dataResult.put("QUI_TOT", quiTot); + dataResult.put("QUI_FIN", calculaMedia(totReceita, quiReceitaOpe, viagens)); + + dataResult.put("SEX_RECEITA_OPE", sexReceitaOpe); + dataResult.put("SEX_QTDE", sexQtde); + dataResult.put("SEX_TOT", sexTot); + dataResult.put("SEX_FIN", calculaMedia( totReceita, sexReceitaOpe, viagens)); + + dataResult.put("SAB_RECEITA_OPE", sabReceitaOpe); + dataResult.put("SAB_QTDE", sabQtde); + dataResult.put("SAB_TOT", sabTot); + dataResult.put("SAB_FIN", calculaMedia(totReceita, sabReceitaOpe, viagens)); + + dataResult.put("DOM_RECEITA_OPE", domReceitaOpe); + dataResult.put("DOM_QTDE", domQtde); + dataResult.put("DOM_TOT", domTot); + dataResult.put("DOM_FIN", calculaMedia(totReceita, domReceitaOpe, domQtde)); + + this.dados.add(dataResult); + } + + this.resultSet = rset; + } + }); + } + + @Override + protected void processaParametros() throws Exception { + + } + + private BigDecimal limpaNulo( BigDecimal val ) { + if( val == null ) { + return BigDecimal.ZERO; + }else { + return val; + } + } + + private BigDecimal calculaMedia(BigDecimal totReceita, BigDecimal receitaOpe, BigDecimal qtde) { + if( qtde.intValue() != 0 ) { + BigDecimal dividendo = receitaOpe.multiply(qtde); + + if(dividendo.intValue() == 0 ) { + return BigDecimal.ZERO; + } + + BigDecimal fin = totReceita.divide(dividendo, 4, BigDecimal.ROUND_HALF_UP); + fin = fin.multiply(cem); + fin.setScale(2); + return fin; + }else{ + return BigDecimal.ZERO; + } + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioAproveitamentoFinanceiro_pt_BR.properties b/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioAproveitamentoFinanceiro_pt_BR.properties new file mode 100644 index 000000000..03412d849 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioAproveitamentoFinanceiro_pt_BR.properties @@ -0,0 +1,13 @@ +#geral +msg.noData=Não foi possivel obter dados com os parâmetros informados. + + +#Labels cabeçalho +cabecalho.relatorio=Relatório: +cabecalho.periodo=Período: +cabecalho.periodoA=à +cabecalho.dataHora=Data/Hora: +cabecalho.impressorPor=Impresso por: +cabecalho.pagina=Página +cabecalho.de=de +cabecalho.filtros=Filtros: \ No newline at end of file diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioAproveitamentoFinanceiro.jasper b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioAproveitamentoFinanceiro.jasper new file mode 100644 index 000000000..d0e378963 Binary files /dev/null and b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioAproveitamentoFinanceiro.jasper differ diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioAproveitamentoFinanceiro.jrxml b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioAproveitamentoFinanceiro.jrxml new file mode 100644 index 000000000..a1d7fc381 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioAproveitamentoFinanceiro.jrxml @@ -0,0 +1,1646 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/relatorios/RelatorioAproveitamentoFinanceiroController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/relatorios/RelatorioAproveitamentoFinanceiroController.java new file mode 100644 index 000000000..1e81c42f5 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/relatorios/RelatorioAproveitamentoFinanceiroController.java @@ -0,0 +1,166 @@ +/** + * + */ +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; + +import javax.sql.DataSource; + +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zul.Comboitem; +import org.zkoss.zul.Datebox; +import org.zkoss.zul.Textbox; + +import com.rjconsultores.ventaboletos.entidad.Empresa; +import com.rjconsultores.ventaboletos.entidad.Ruta; +import com.rjconsultores.ventaboletos.relatorios.impl.RelatorioAproveitamentoFinanceiro; +import com.rjconsultores.ventaboletos.relatorios.utilitarios.Relatorio; +import com.rjconsultores.ventaboletos.service.RutaService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderRelatorioAproveitamentoFinanceiro; + + +@Controller("relatorioAproveitamentoFinanceiroController") +@Scope("prototype") +@SuppressWarnings({ "rawtypes", "unchecked" }) +public class RelatorioAproveitamentoFinanceiroController extends MyGenericForwardComposer { + + private static final long serialVersionUID = 1L; + private static Logger log = Logger.getLogger(RelatorioAproveitamentoFinanceiroController.class); + + @Autowired + private DataSource dataSourceRead; + + private Datebox datInicial; + private Datebox datFinal; + + private MyComboboxEstandar cmbEmpresa; + private List lsEmpresa; + + @Autowired + private RutaService rutaService; + + private MyListbox linhaList; + private MyListbox linhaListSelList; + private Textbox txtPalavraPesquisaLinha; + private ArrayList lsNumLinha = new ArrayList(); + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + + lsEmpresa = UsuarioLogado.getUsuarioLogado().getEmpresa(); + linhaList.setItemRenderer(new RenderRelatorioAproveitamentoFinanceiro()); + linhaListSelList.setItemRenderer(new RenderRelatorioAproveitamentoFinanceiro()); + } + + public List getLsEmpresa() { + return lsEmpresa; + } + + public void setLsEmpresa(List lsEmpresa) { + this.lsEmpresa = lsEmpresa; + } + + public void onDoubleClick$linhaList(Event ev) { + Ruta rutaAux = (Ruta) linhaList.getSelected(); + linhaListSelList.addItemNovo(rutaAux); + } + + private void executarPesquisaLinha() { + + String palavraPesquisaRuta = txtPalavraPesquisaLinha.getText(); + linhaList.setData(rutaService.buscaRuta(palavraPesquisaRuta)); + + if (linhaList.getData().length == 0) { + try { + Messagebox.show(Labels.getLabel("MSG.ningunRegistro"), + Labels.getLabel("relatorioLinhasHorarioController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } catch (InterruptedException ex) { + log.error(ex); + } + } + } + + public void onClick$btnPesquisaLinha(Event ev) { + executarPesquisaLinha(); + } + + public void onClick$btnLimparLinha(Event ev) { + linhaList.clearSelection(); + lsNumLinha.clear(); + } + + public void onClick$btnExecutarRelatorio(Event ev) throws Exception { + executarRelatorio(); + } + + private void executarRelatorio() throws Exception { + Relatorio relatorio; + Map parametros = new HashMap(); + StringBuilder filtro = new StringBuilder(); + + filtro.append("Linha: "); + String linhaIds = ""; + String linhas = ""; + List lslinhaSelecionados = new ArrayList(Arrays.asList(linhaListSelList.getData())); + if (lslinhaSelecionados.isEmpty()) { + linhas = "Todas"; + } else { + for (int i = 0; i < lslinhaSelecionados.size(); i++) { + Ruta linha = lslinhaSelecionados.get(i); + linhas = linhas + linha.getDescruta() + ", "; + + linhaIds = linhaIds + linha.getRutaId() + ", "; + } + + // removendo ultima virgula + linhaIds = linhaIds.substring(0, linhaIds.length() - 2); + linhas = linhas.substring(0, linhas.length() - 2); + parametros.put("LINHAS", linhaIds); + } + filtro.append(linhas).append(";"); + + parametros.put("DATA_INICIAL", (java.util.Date) this.datInicial.getValue()); + parametros.put("DATA_FINAL", (java.util.Date) this.datFinal.getValue()); + parametros.put("NOME_RELATORIO", Labels.getLabel("relatorioAproveitamentoFinanceiroController.window.title")); + parametros.put("USUARIO", UsuarioLogado.getUsuarioLogado().getNombusuario()); + + filtro.append(" Empresa: "); + + Comboitem itemEmpresa = cmbEmpresa.getSelectedItem(); + if (itemEmpresa != null) { + Empresa empresa = (Empresa) itemEmpresa.getValue(); + parametros.put("EMPRESA_ID", empresa.getEmpresaId()); + parametros.put("EMPRESA", empresa.getNombempresa()); + filtro.append(empresa.getNombempresa() + ";"); + } else { + filtro.append(" Todas;"); + } + + parametros.put("FILTROS", filtro.toString()); + relatorio = new RelatorioAproveitamentoFinanceiro(parametros, dataSourceRead.getConnection()); + + Map args = new HashMap(); + args.put("relatorio", relatorio); + + openWindow("/component/reportView.zul", + Labels.getLabel("relatorioAproveitamentoFinanceiroController.window.title"), args, MODAL); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/relatorios/RelatorioVendasBilheteiroController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/relatorios/RelatorioVendasBilheteiroController.java index 30cde89d0..c49a8b083 100644 --- a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/relatorios/RelatorioVendasBilheteiroController.java +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/relatorios/RelatorioVendasBilheteiroController.java @@ -109,7 +109,7 @@ public class RelatorioVendasBilheteiroController extends MyGenericForwardCompose Labels.getLabel("relatorioVendasBilheteiroController.window.title"), Messagebox.OK, Messagebox.INFORMATION); } catch (InterruptedException ex) { - ex.printStackTrace(); + log.error(ex); } } } diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/relatorios/ItemMenuRelatorioAproveitamentoFinanceiro.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/relatorios/ItemMenuRelatorioAproveitamentoFinanceiro.java new file mode 100644 index 000000000..942e512ff --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/relatorios/ItemMenuRelatorioAproveitamentoFinanceiro.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 ItemMenuRelatorioAproveitamentoFinanceiro extends DefaultItemMenuSistema { + + public ItemMenuRelatorioAproveitamentoFinanceiro() { + super("indexController.mniRelatorioAproveitamentoFinanceiro.label"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.RELATORIOS.MENU.RELATORIOAPROVEITAMENTOFINANCEIRO"; + } + + @Override + public void ejecutar() { + PantallaUtileria.openWindow("/gui/relatorios/filtroRelatorioAproveitamentoFinanceiro.zul", + Labels.getLabel("relatorioAproveitamentoFinanceiroController.window.title"), getArgs() ,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 46ad71360..e0955afab 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 @@ -216,6 +216,7 @@ analitico.gerenciais.financeiro.relatorioDocumentosFiscais=com.rjconsultores.ven analitico.gerenciais.financeiro.relatorioVendasPercurso=com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorios.ItemMenuRelatorioVendasPercurso analitico.gerenciais.financeiro.vendasConexao=com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorios.ItemMenuRelatorioVendasConexao analitico.gerenciais.financeiro.vendasRequisicao=com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorios.ItemMenuRelatorioVendasRequisicao +analitico.gerenciais.financeiro.aproveitamentoFinanceiro=com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorios.ItemMenuRelatorioAproveitamentoFinanceiro analitico.gerenciais.pacote=com.rjconsultores.ventaboletos.web.utilerias.menu.item.analitico.gerenciais.pacote.SubMenuRelatorioPacote analitico.gerenciais.pacote.boletos=com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorios.ItemMenuRelatorioVendasPacotesBoletos analitico.gerenciais.pacote.detalhado=com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorios.ItemMenuRelatorioVendasPacotesDetalhado diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderRelatorioAproveitamentoFinanceiro.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderRelatorioAproveitamentoFinanceiro.java new file mode 100644 index 000000000..8dc4a2a6d --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderRelatorioAproveitamentoFinanceiro.java @@ -0,0 +1,69 @@ +/** + * + */ +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.OrgaoConcedente; +import com.rjconsultores.ventaboletos.entidad.PuntoVenta; +import com.rjconsultores.ventaboletos.entidad.Ruta; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; + +/** + * @author Thiago + * + */ +public class RenderRelatorioAproveitamentoFinanceiro implements ListitemRenderer { + + @Override + public void render(Listitem lstm, Object o) throws Exception { + Ruta ruta = (Ruta) o; + + Listcell lc = new Listcell(ruta.getNumRuta().toString()); + lc.setParent(lstm); + + lc = new Listcell(ruta.getPrefixo()); + lc.setParent(lstm); + + lc = new Listcell(ruta.getDescruta()); + lc.setParent(lstm); + + OrgaoConcedente orgaoConcedente = ruta.getOrgaoConcedente(); + if (orgaoConcedente != null) { + lc = new Listcell(orgaoConcedente.getDescOrgao()); + } else { + lc = new Listcell("-"); + } + 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((Ruta) listItem.getAttribute("data")); + } + }); + + lc.appendChild(btn); + + lstm.setAttribute("data", ruta); + } + +} diff --git a/web/WEB-INF/i3-label_es_MX.label b/web/WEB-INF/i3-label_es_MX.label index 44fe81e21..1762e49a5 100644 --- a/web/WEB-INF/i3-label_es_MX.label +++ b/web/WEB-INF/i3-label_es_MX.label @@ -299,6 +299,7 @@ indexController.mniRelatorioGratuidade.label = Gratuidades indexController.mniRelatorioGratuidadeANTT.label = Gratuidades ANTT indexController.mniRelatorioExportacaoIdosoARTESP.label = Reporte Exportación Ancianos ARTESP indexController.mniRelatorioGratuidadeIdosoDeficiente.label = Gratuidades Idoso/Deficiente +indexController.mniRelatorioAproveitamentoFinanceiro.label = Aproveitamento Financeiro indexController.mniRelatorioVendasBilheteiro.label = Ventas por agente de pasajes indexController.mniRelatorioVendasBilheteiroSintetico.label = Ventas por agentes sintético indexController.mniRelatorioAgenciasNaoImportadas.label = Reporte puntos venta no importados @@ -1369,8 +1370,10 @@ editarEmpresaController.emiteDABpeVdaCallCenter.ajuda = Emite DABP-e em uma Vend editarEmpresaController.outrasFPVdaCallCenter.ajuda = Permite várias formas de pagamento para uma Venda Call Center editarEmpresaController.emiteDABpeVdaInternet = Emite DABP-e Venda Internet editarEmpresaController.emiteDABpeVdaIntJ3 = Emite DABP-e Venda Internet J3 +editarEmpresaController.emiteDABpeVdaFidelidade = Emite DABP-e Venda Fidelidade editarEmpresaController.emiteDABpeVdaInternet.ajuda = Emite DABP-e Venda Internet editarEmpresaController.emiteDABpeVdaIntJ3.ajuda = Emite DABP-e Venda Internet J3 +editarEmpresaController.emiteDABpeVdaFidelidade.ajuda = Emite DABP-e Venda Fidelidade editarEmpresaController.exigeClienteCompradorVdaCallCenter = Cliente Comprador Obrigatório Venda Call Center editarEmpresaController.exigeClienteCompradorVdaCallCenter.ajuda = Cliente Comprador Obrigatório Venda Call Center editarEmpresaController.habilitaIEDescentralizadaText.label = Permite Descentralizar Inscrição Estadual para Emissão BP-e por Origem @@ -8633,4 +8636,14 @@ filtroTaxaEmbarqueW2i.labelAviso.value= Atenção. Certifique-se que todos os da indexController.mniLimparCacheLocalidadesAPI.label = Recarregar Cache de Localidades (API) limparCacheLocalidadesAPI.title = Localidades (API) -limparCacheLocalidadesAPI.message.naoconfigurado=A constante de configuração da URL da API não foi encontrada. \ No newline at end of file +limparCacheLocalidadesAPI.message.naoconfigurado=A constante de configuração da URL da API não foi encontrada. + +#Relatório de Aproveitamento Financeiro +relatorioAproveitamentoFinanceiroController.window.title = Relatório de Aproveitamento Financeiro +relatorioAproveitamentoFinanceiroController.lbDatInicial.value = Data inicial +relatorioAproveitamentoFinanceiroController.lbDatFinal.value = Data final +relatorioAproveitamentoFinanceiroController.lbPuntoVenta.value = Agência +relatorioAproveitamentoFinanceiroController.lbEmpresa.value = Empresa +relatorioAproveitamentoFinanceiroController.btnPesquisa.label = Buscar +relatorioAproveitamentoFinanceiroController.btnLimpar.label = Limpar +relatorioAproveitamentoFinanceiroController.lbNumero.value = Número Agência \ No newline at end of file diff --git a/web/gui/relatorios/filtroRelatorioAproveitamentoFinanceiro.zul b/web/gui/relatorios/filtroRelatorioAproveitamentoFinanceiro.zul new file mode 100644 index 000000000..e481fa8c2 --- /dev/null +++ b/web/gui/relatorios/filtroRelatorioAproveitamentoFinanceiro.zul @@ -0,0 +1,130 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +