fixes bug#19272
dev: qua: git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@102130 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
4c18579011
commit
dfdb0caf09
|
@ -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<String, Object> 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<String, Object> 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<String, Object> dataResult = new HashMap<String, Object>();
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -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:
|
Binary file not shown.
File diff suppressed because it is too large
Load Diff
|
@ -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<Empresa> lsEmpresa;
|
||||
|
||||
@Autowired
|
||||
private RutaService rutaService;
|
||||
|
||||
private MyListbox linhaList;
|
||||
private MyListbox linhaListSelList;
|
||||
private Textbox txtPalavraPesquisaLinha;
|
||||
private ArrayList<Ruta> lsNumLinha = new ArrayList<Ruta>();
|
||||
|
||||
@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<Empresa> getLsEmpresa() {
|
||||
return lsEmpresa;
|
||||
}
|
||||
|
||||
public void setLsEmpresa(List<Empresa> 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<String, Object> parametros = new HashMap<String, Object>();
|
||||
StringBuilder filtro = new StringBuilder();
|
||||
|
||||
filtro.append("Linha: ");
|
||||
String linhaIds = "";
|
||||
String linhas = "";
|
||||
List<Ruta> 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);
|
||||
}
|
||||
}
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
|
@ -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
|
||||
|
@ -8634,3 +8637,13 @@ 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.
|
||||
|
||||
#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
|
|
@ -0,0 +1,130 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<?page contentType="text/html;charset=UTF-8"?>
|
||||
<?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?>
|
||||
<?init class="org.zkoss.zkplus.databind.AnnotateDataBinderInit" arg0="winFiltroRelatorioAproveitamentoFinanceiro"?>
|
||||
<?taglib uri="http://www.zkoss.org/dsp/web/core" prefix="c"?>
|
||||
<zk xmlns="http://www.zkoss.org/2005/zul">
|
||||
<window id="winFiltroRelatorioAproveitamentoFinanceiro"
|
||||
apply="${relatorioAproveitamentoFinanceiroController}"
|
||||
contentStyle="overflow:auto" height="286px" width="550px"
|
||||
border="normal">
|
||||
|
||||
<grid fixedLayout="true">
|
||||
<columns>
|
||||
<column width="20%"/>
|
||||
<column width="30%"/>
|
||||
<column width="20%"/>
|
||||
<column width="30%"/>
|
||||
</columns>
|
||||
<rows>
|
||||
<row>
|
||||
<label
|
||||
value="${c:l('relatorioAproveitamentoFinanceiroController.lbDatInicial.value')}" />
|
||||
<datebox id="datInicial" width="90%"
|
||||
format="dd/MM/yyyy" constraint="no empty"
|
||||
maxlength="10" />
|
||||
<label
|
||||
value="${c:l('relatorioAproveitamentoFinanceiroController.lbDatFinal.value')}" />
|
||||
<datebox id="datFinal" width="90%"
|
||||
format="dd/MM/yyyy" constraint="no empty"
|
||||
maxlength="10" />
|
||||
</row>
|
||||
</rows>
|
||||
</grid>
|
||||
<grid fixedLayout="true">
|
||||
<columns>
|
||||
<column width="20%"/>
|
||||
<column width="80%"/>
|
||||
</columns>
|
||||
<rows>
|
||||
<row spans="1,1,2">
|
||||
<label
|
||||
value="${c:l('relatorioAproveitamentoFinanceiroController.lbEmpresa.value')}" />
|
||||
<combobox id="cmbEmpresa"
|
||||
buttonVisible="true" constraint="no empty"
|
||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar"
|
||||
model="@{winFiltroRelatorioAproveitamentoFinanceiro$composer.lsEmpresa}"
|
||||
width="95%" />
|
||||
</row>
|
||||
<row spans="1,3">
|
||||
<label
|
||||
value="${c:l('relatorioLinhasHorarioController.lbLinha.label')}" />
|
||||
|
||||
<bandbox id="bbPesquisaLinha" width="100%"
|
||||
mold="rounded" readonly="true">
|
||||
<bandpopup>
|
||||
<vbox>
|
||||
<hbox>
|
||||
<textbox
|
||||
id="txtPalavraPesquisaLinha" />
|
||||
<button id="btnPesquisaLinha"
|
||||
image="/gui/img/find.png"
|
||||
label="${c:l('relatorioLinhasHorarioController.btnPesquisa.label')}" />
|
||||
<button id="btnLimparLinha"
|
||||
image="/gui/img/eraser.png"
|
||||
label="${c:l('relatorioLinhasHorarioController.btnLimpar.label')}" />
|
||||
</hbox>
|
||||
|
||||
<listbox id="linhaList" mold="paging"
|
||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyListbox"
|
||||
vflex="true" multiple="false" height="60%" width="410px">
|
||||
<listhead>
|
||||
|
||||
<listheader
|
||||
label="${c:l('relatorioLinhasHorarioController.lbNumRuta.label')}"
|
||||
width="18%" />
|
||||
|
||||
<listheader
|
||||
label="${c:l('relatorioLinhasHorarioController.lbPrefixo.label')}"
|
||||
width="20%" />
|
||||
<listheader
|
||||
label="${c:l('lb.dec')}" width="35%" />
|
||||
<listheader
|
||||
label="${c:l('relatorioLinhasHorarioController.lbOrgao.label')}"
|
||||
width="27%" />
|
||||
</listhead>
|
||||
</listbox>
|
||||
<paging id="pagingLinha" pageSize="10" />
|
||||
</vbox>
|
||||
</bandpopup>
|
||||
</bandbox>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<cell colspan="4">
|
||||
<borderlayout height="124px">
|
||||
|
||||
<center border="0">
|
||||
<listbox id="linhaListSelList"
|
||||
mold="paging"
|
||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyListbox"
|
||||
vflex="true" multiple="true" height="60%" width="100%">
|
||||
<listhead>
|
||||
<listheader
|
||||
label="${c:l('relatorioLinhasHorarioController.lbNumRuta.label')}"
|
||||
width="18%" />
|
||||
<listheader
|
||||
label="${c:l('relatorioLinhasHorarioController.lbPrefixo.label')}"
|
||||
width="20%" />
|
||||
<listheader
|
||||
label="${c:l('lb.dec')}" width="30%" />
|
||||
<listheader
|
||||
label="${c:l('relatorioLinhasHorarioController.lbOrgao.label')}"
|
||||
width="22%" />
|
||||
<listheader width="10%" />
|
||||
</listhead>
|
||||
</listbox>
|
||||
</center>
|
||||
</borderlayout>
|
||||
</cell>
|
||||
</row>
|
||||
</rows>
|
||||
</grid>
|
||||
|
||||
<toolbar>
|
||||
<button id="btnExecutarRelatorio" image="/gui/img/find.png"
|
||||
label="${c:l('relatorio.lb.btnExecutarRelatorio')}" />
|
||||
</toolbar>
|
||||
|
||||
</window>
|
||||
</zk>
|
Loading…
Reference in New Issue