Merge pull request 'AL-2518' (!178) from AL-2518 into master

Reviewed-on: adm/VentaBoletosAdm#178
Reviewed-by: Valdir Cordeiro <valdir.cordeiro@totvs.com.br>
master 1.7.0
Célio de Souza Ribeiro JR 2023-06-01 12:01:41 +00:00
commit 88664e1781
15 changed files with 1719 additions and 2 deletions

View File

@ -4,12 +4,12 @@
<modelVersion>4.0.0</modelVersion>
<groupId>br.com.rjconsultores</groupId>
<artifactId>ventaboletosadm</artifactId>
<version>1.6.9</version>
<version>1.7.0</version>
<packaging>war</packaging>
<properties>
<modelWeb.version>1.5.2</modelWeb.version>
<flyway.version>1.3.7</flyway.version>
<flyway.version>1.4.0</flyway.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>

View File

@ -0,0 +1,493 @@
/**
*
*/
package com.rjconsultores.ventaboletos.relatorios.impl;
import java.math.BigDecimal;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import com.rjconsultores.ventaboletos.entidad.PuntoVenta;
import com.rjconsultores.ventaboletos.relatorios.negocio.CalculoImposto;
import com.rjconsultores.ventaboletos.relatorios.utilitarios.DataSource;
import com.rjconsultores.ventaboletos.relatorios.utilitarios.ExceptionConfiguracao;
import com.rjconsultores.ventaboletos.relatorios.utilitarios.Relatorio;
import com.rjconsultores.ventaboletos.relatorios.utilitarios.RelatorioComissaoSinteticoBean;
import com.rjconsultores.ventaboletos.utilerias.DateUtil;
import com.rjconsultores.ventaboletos.utilerias.MoneyHelper;
import com.rjconsultores.ventaboletos.web.utilerias.NamedParameterStatement;
import net.sf.jasperreports.engine.data.JRBeanCollectionDataSource;
public class RelatorioComissaoSintetico extends Relatorio {
private List<RelatorioComissaoSinteticoBean> lsDadosRelatorio;
private LinkedHashMap<String, LinkedHashMap<String, Object>> mapCacheConfigComissao;
private Set<PuntoVenta> pontoVendaConfiguracao;
public RelatorioComissaoSintetico(Map<String, Object> parametros, Connection conexao) throws Exception {
super(parametros, conexao);
CalculoImposto.limpaCache();
this.mapCacheConfigComissao = new LinkedHashMap<String, LinkedHashMap<String, Object>>();
this.setCustomDataSource(new DataSource(this) {
@Override
public void initDados() throws Exception {
Connection conexao = this.relatorio.getConexao();
Map<String, Object> parametros = this.relatorio.getParametros();
String empresaID = parametros.get("EMPRESA_ID") != null ? parametros.get("EMPRESA_ID").toString() : "";
String puntoVentaID = parametros.get("NUMPUNTOVENTA").equals("-1") ? "" : parametros.get("NUMPUNTOVENTA").toString();
String sqlTotaisVendas = getSqlDadosTotaisdeVenda(empresaID,puntoVentaID);
NamedParameterStatement stmt = new NamedParameterStatement(conexao, sqlTotaisVendas);
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_INICIAL")).getTime()));
if(empresaID != null && !empresaID.equals("")){
stmt.setInt("EMPRESA_ID", Integer.parseInt(empresaID));
}
pontoVendaConfiguracao = new HashSet<PuntoVenta>();
ResultSet rset = stmt.executeQuery();
lsDadosRelatorio = new ArrayList<RelatorioComissaoSinteticoBean>();
while (rset.next()) {
// Busca as configurações de comissão
LinkedHashMap<String, Object> configComissao = getConfigComissao(rset.getInt("puntoventa_id"), rset.getInt("empresa_id"));
Integer agenciaID = rset.getInt("puntoventa_id");
Integer retEmpresaID = rset.getInt("empresa_id");
Integer estadoId = rset.getInt("estado_id");
Date fecCorrida = rset.getDate("feccorrida");
BigDecimal totalPassgens = rset.getBigDecimal("total_passagem");
BigDecimal totalImpPost = rset.getBigDecimal("total_imp_posterior");
BigDecimal totalVendaImpPost = rset.getBigDecimal("total_venda_imp_posterior");
BigDecimal totalSeguro = rset.getBigDecimal("total_seguro");
BigDecimal totalVenda = rset.getBigDecimal("total_venda");
RelatorioComissaoSinteticoBean existingBean = findExistingBean(lsDadosRelatorio, agenciaID, retEmpresaID);
if (existingBean != null) {
// Registro já existe, adicionar os valores aos existentes
existingBean.setTotalTarifa(existingBean.getTotalTarifa().add(totalPassgens));
existingBean.setTotalImpPosterior(existingBean.getTotalImpPosterior().add(totalImpPost));
existingBean.setTotalVendaImpPosterior(existingBean.getTotalVendaImpPosterior().add(totalVendaImpPost));
existingBean.setTotalSeguro(existingBean.getTotalSeguro().add(totalSeguro));
existingBean.setTotalPagado(existingBean.getTotalPagado().add(totalVenda));
//aplica comissão dos totais
if (configComissao != null) {
comissaoCalc(configComissao, retEmpresaID, estadoId, fecCorrida, totalPassgens, totalImpPost, totalVendaImpPost, totalSeguro,
null, existingBean, false);
}
} else {
// Registro não existe, criar um novo objeto e adicioná-lo à lista
RelatorioComissaoSinteticoBean comissaoBean = new RelatorioComissaoSinteticoBean();
comissaoBean.setPontoVendaID(agenciaID);
comissaoBean.setEmpresaID(retEmpresaID);
comissaoBean.setPontoVenda(rset.getString("nombpuntoventa"));
comissaoBean.setTotalTarifa(totalPassgens);
comissaoBean.setTotalImpPosterior(totalImpPost);
comissaoBean.setTotalVendaImpPosterior(totalVendaImpPost);
comissaoBean.setTotalSeguro(totalSeguro);
comissaoBean.setTotalPagado(totalVenda);
//aplica comissão dos totais
if (configComissao != null) {
comissaoCalc(configComissao, retEmpresaID, estadoId, fecCorrida, totalPassgens, totalImpPost, totalVendaImpPost, totalSeguro,
null, comissaoBean, false);
}
lsDadosRelatorio.add(comissaoBean);
}
}
if (lsDadosRelatorio.size() > 0) {
String sqlTotaisEeventos = getSqlDadosTotaisEvento(empresaID,puntoVentaID);
NamedParameterStatement stmtEventos = new NamedParameterStatement(conexao, sqlTotaisEeventos);
stmtEventos.setTimestamp("DATA_INICIAL", new Timestamp(DateUtil.inicioFecha((Date) parametros.get("DATA_INICIAL")).getTime()));
stmtEventos.setTimestamp("DATA_FINAL", new Timestamp(DateUtil.inicioFecha((Date) parametros.get("DATA_INICIAL")).getTime()));
if(empresaID != null && !empresaID.equals("")){
stmtEventos.setInt("EMPRESA_ID", Integer.parseInt(empresaID));
}
ResultSet rsetEventos = stmtEventos.executeQuery();
while(rsetEventos.next()) {
LinkedHashMap<String, Object> configComissao = getConfigComissao(rset.getInt("puntoventa_id"), rset.getInt("empresa_id"));
Integer agenciaID = rsetEventos.getInt("puntoventa_id");
Integer retEmpresaID = rsetEventos.getInt("empresa_id");
if(empresaID != null && !empresaID.equals("")){
stmt.setInt("EMPRESA_ID", Integer.parseInt(empresaID));
}
Integer estadoId = rsetEventos.getInt("estado_id");
Date fecCorrida = rset.getDate("feccorrida");
Boolean isOutros = rsetEventos.getString("desctipoevento") == "EXCESSO BAGAGEM" ? false : true;
BigDecimal totalEvento = rsetEventos.getBigDecimal("total_evento");
RelatorioComissaoSinteticoBean existingBean = findExistingBean(lsDadosRelatorio, agenciaID, retEmpresaID);
if (existingBean != null) {
if(isOutros) {
existingBean.setTotalOutros(totalEvento);
} else {
existingBean.setTotalExcBagagem(totalEvento);
}
//aplica comissão dos totais
if (configComissao != null) {
comissaoCalc(configComissao, retEmpresaID, estadoId, fecCorrida, null, null, null, null, totalEvento, existingBean, isOutros);
}
}
}
setLsDadosRelatorio(lsDadosRelatorio);
}
}
private void comissaoCalc(LinkedHashMap<String, Object> configComissao, Integer retEmpresaID, Integer estadoId, Date fecCorrida,
BigDecimal baseCalculoTarifa, BigDecimal baseCalculoImpPost, BigDecimal baseCalculoVendaImpPost, BigDecimal baseCalculoSeguro, BigDecimal TotalEventos,
RelatorioComissaoSinteticoBean comissaoBean, Boolean isEventoOutros) throws Exception {
BigDecimal percComissaoTarifa = BigDecimal.ZERO;
BigDecimal percComissaoSeguro = BigDecimal.ZERO;
BigDecimal percComissaoImpPost = BigDecimal.ZERO;
BigDecimal percComissaoVendaImpPost = BigDecimal.ZERO;
BigDecimal percComissaoOutros = BigDecimal.ZERO;
BigDecimal valorComissaoSeguro = BigDecimal.ZERO;
BigDecimal valorComissaoTarifa = BigDecimal.ZERO;
BigDecimal valorComissaoImpPost = BigDecimal.ZERO;
BigDecimal valorComissaoVendaImpPost = BigDecimal.ZERO;
BigDecimal valorComissaoExcBagagem = BigDecimal.ZERO;
BigDecimal valorComissaoOutros = BigDecimal.ZERO;
Boolean isAltaTemporada = false;
if(fecCorrida != null) {
String mes = new SimpleDateFormat("M").format(fecCorrida);
HashMap<String, Object> configImposto = getConfigImposto((Integer) retEmpresaID, estadoId);
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("INDABRIL"))
|| (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;
}
if (!isEventoOutros) {
percComissaoTarifa = isAltaTemporada ? (BigDecimal) configComissao.get("PASSAGEMALTA") : (BigDecimal) configComissao.get("PASSAGEMBAIXA");
percComissaoSeguro = isAltaTemporada ? (BigDecimal) configComissao.get("SEGUROALTA") : (BigDecimal) configComissao.get("SEGUROBAIXA");
percComissaoImpPost = isAltaTemporada ? (BigDecimal) configComissao.get("VENDAIMPGAPALTA") : (BigDecimal) configComissao.get("VENDAIMPGAPBAIXA");
percComissaoVendaImpPost = isAltaTemporada ? (BigDecimal) configComissao.get("VENDAGAPALTA") : (BigDecimal) configComissao.get("VENDAGAPBAIXA");
if (percComissaoTarifa == null) {
percComissaoTarifa = BigDecimal.ZERO;
}
if (percComissaoSeguro == null) {
percComissaoSeguro = BigDecimal.ZERO;
}
if (percComissaoImpPost == null) {
percComissaoImpPost = BigDecimal.ZERO;
}
if (percComissaoVendaImpPost == null) {
percComissaoVendaImpPost = BigDecimal.ZERO;
}
// VALOR COMISSAO = BASE DE CALCULO * (PERCENTUAL COMISSAO / 100)
valorComissaoTarifa = baseCalculoTarifa.multiply(MoneyHelper.dividir(percComissaoTarifa, MoneyHelper.HUNDRED, 4));
valorComissaoSeguro = baseCalculoSeguro.multiply(MoneyHelper.dividir(percComissaoSeguro, MoneyHelper.HUNDRED, 4));
valorComissaoImpPost = baseCalculoImpPost.multiply(MoneyHelper.dividir(percComissaoImpPost, MoneyHelper.HUNDRED, 4));
valorComissaoVendaImpPost = baseCalculoVendaImpPost.multiply(MoneyHelper.dividir(percComissaoVendaImpPost, MoneyHelper.HUNDRED, 4));;
if(comissaoBean.getComissaoTarifa() == null) {
comissaoBean.setComissaoTarifa(valorComissaoTarifa);
} else {
comissaoBean.setComissaoTarifa(comissaoBean.getComissaoTarifa().add(valorComissaoTarifa));
}
if(comissaoBean.getComissaoSeguro() == null) {
comissaoBean.setComissaoSeguro(valorComissaoSeguro);
} else {
comissaoBean.setComissaoSeguro(comissaoBean.getComissaoSeguro().add(valorComissaoSeguro));
}
if(comissaoBean.getComissaoImpPosterior() == null) {
comissaoBean.setComissaoImpPosterior(valorComissaoImpPost);
} else {
comissaoBean.setComissaoImpPosterior(comissaoBean.getComissaoImpPosterior().add(valorComissaoImpPost));
}
if(comissaoBean.getComissaoVendaImpPosterior() == null) {
comissaoBean.setComissaoVendaImpPosterior(valorComissaoVendaImpPost);
} else {
comissaoBean.setComissaoVendaImpPosterior(comissaoBean.getComissaoVendaImpPosterior().add(valorComissaoVendaImpPost));
}
} else {
percComissaoOutros = isEventoOutros ? (isAltaTemporada ? (BigDecimal) configComissao.get("OUTROSALTA") : (BigDecimal) configComissao.get("OUTROSBAIXA") )
:(isAltaTemporada ? (BigDecimal) configComissao.get("EXCESSOALTA") : (BigDecimal) configComissao.get("EXCESSOBAIXA"));
if(percComissaoOutros == null) {
percComissaoOutros = BigDecimal.ZERO;
}
if(isEventoOutros) {
// VALOR COMISSAO = BASE DE CALCULO * (PERCENTUAL COMISSAO / 100)
valorComissaoOutros = comissaoBean.getTotalOutros().multiply(MoneyHelper.dividir(percComissaoSeguro, MoneyHelper.HUNDRED, 4));
if(comissaoBean.getComissaoOutros() == null) {
comissaoBean.setComissaoOutros(valorComissaoOutros);
} else {
comissaoBean.setComissaoOutros(comissaoBean.getComissaoOutros().add(valorComissaoOutros));
}
comissaoBean.setComissaoOutros(comissaoBean.getComissaoOutros().add(valorComissaoOutros));
} else {
valorComissaoExcBagagem = comissaoBean.getTotalExcBagagem().multiply(MoneyHelper.dividir(percComissaoOutros, MoneyHelper.HUNDRED, 4));
if(comissaoBean.getComissaoExcBagagem() == null) {
comissaoBean.setComissaoExcBagagem(valorComissaoExcBagagem);
} else {
comissaoBean.setComissaoExcBagagem(comissaoBean.getComissaoExcBagagem().add(valorComissaoExcBagagem));
}
}
}
}
});
}
public void setLsDadosRelatorio(List<RelatorioComissaoSinteticoBean> lsDadosRelatorio) {
this.setCollectionDataSource(new JRBeanCollectionDataSource(lsDadosRelatorio));
this.lsDadosRelatorio = lsDadosRelatorio;
}
public HashMap<String, Object> getConfigImposto(Integer empresaId, Integer estadoId) throws Exception {
HashMap<String, Object> cacheConfig = null;
try {
cacheConfig = (HashMap<String, Object>) CalculoImposto.getConfigImpostoByEstadoOrigem(this.getConexao(), estadoId, empresaId);
} catch (Exception e) {
if (e instanceof ExceptionConfiguracao)
this.addInfoMsg(e.getMessage());
else
throw e;
}
return cacheConfig;
}
private static RelatorioComissaoSinteticoBean findExistingBean(List<RelatorioComissaoSinteticoBean> list, Integer agenciaID, Integer empresaID) {
for (RelatorioComissaoSinteticoBean bean : list) {
if (Objects.equals(bean.getPontoVendaID(), agenciaID) && Objects.equals(bean.getEmpresaID(), empresaID)) {
return bean;
}
}
return null;
}
@Override
protected void processaParametros() throws Exception {
}
private String getSqlDadosTotaisdeVenda(String empresa, String agencia) {
StringBuilder sql = new StringBuilder(3400);
sql.append(" SELECT pv.nombpuntoventa, ");
sql.append(" b.puntoventa_id, ");
sql.append(" ep.empresa_id, ");
sql.append(" ci.estado_id, ");
sql.append(" b.feccorrida, ");
sql.append(" Count(*), ");
sql.append(" SUM(CASE WHEN (b.indreimpresion = 1 AND b.tipoventa_id = 18 or (b.indreimpresion = 0 AND b.tipoventa_id = 18)) ");
sql.append(" THEN 0 ELSE b.preciobase END) AS total_passagem, ");
sql.append(" SUM(CASE WHEN b.indreimpresion = 1 AND b.tipoventa_id = 18 THEN b.preciobase ELSE 0 END) AS total_imp_posterior, ");
sql.append(" SUM(CASE WHEN b.indreimpresion = 0 AND b.tipoventa_id = 18 THEN b.preciobase ELSE 0 END) AS total_venda_imp_posterior, ");
sql.append(" SUM(b.importeseguro) AS total_seguro, ");
sql.append(" SUM(b.importetaxaembarque) AS total_tax_emb, ");
sql.append(" SUM(b.importepedagio) AS total_pedagio, ");
sql.append(" SUM(b.importeoutros) AS total_outros, ");
sql.append(" SUM(b.preciopagado) AS total_venda ");
sql.append(" FROM boleto b ");
sql.append(" LEFT JOIN punto_venta pv ON (b.puntoventa_id = pv.puntoventa_id) ");
sql.append(" LEFT JOIN marca mc ON (b.marca_id = mc.marca_id) ");
sql.append(" LEFT JOIN empresa ep ON (mc.empresa_id = ep.empresa_id) ");
sql.append(" LEFT JOIN ciudad ci ON (ep.ciudad_id = ci.ciudad_id) ");
sql.append(" WHERE (b.motivocancelacion_id IS NULL or (b.motivocancelacion_id = 16 and b.tipoventa_id =18 )) ");
sql.append(" AND b.motivoreimpresion_id IS NULL ");
sql.append(" AND (b.boletooriginal_id IS NULL or ( b.indreimpresion = 1 AND b.tipoventa_id =18) ) ");
sql.append(" AND b.activo = 1 ");
sql.append(" AND b.fechorventa BETWEEN :DATA_INICIAL AND :DATA_FINAL ");
if (!agencia.isEmpty()) {
sql.append(" AND b.puntoventa_id in ("+agencia+") ");
}
if (!empresa.isEmpty()) {
sql.append(" AND ep.empresa_id = :EMPRESA_ID ");
}
sql.append(" GROUP BY pv.nombpuntoventa, b.puntoventa_id, ep.empresa_id, ci.estado_id, b.feccorrida ");
sql.append(" ORDER BY pv.nombpuntoventa, b.puntoventa_id, ci.estado_id ");
return sql.toString();
}
private String getSqlDadosTotaisEvento(String empresa, String agencia ) {
StringBuilder sql = new StringBuilder(3400);
sql.append("SELECT ");
sql.append(" tee.desctipoevento, ");
sql.append(" ee.puntoventa_id, ");
sql.append(" pv.nombpuntoventa, ");
sql.append(" ee.empresa_id, ");
sql.append(" ci.estado_id, ");
sql.append(" bo.fechorventa, ");
sql.append(" SUM(ee.impingreso) AS total_evento ");
sql.append("FROM ");
sql.append(" evento_extra ee ");
sql.append(" INNER JOIN tipo_evento_extra tee ON ee.tipoeventoextra_id = tee.tipoeventoextra_id ");
sql.append(" LEFT JOIN punto_venta pv ON ( ee.puntoventa_id = pv.puntoventa_id ) ");
sql.append(" LEFT JOIN empresa emp ON (emp.empresa_id = ee.empresa_id) ");
sql.append(" LEFT JOIN ciudad ci ON (emp.ciudad_id = ci.ciudad_id) ");
sql.append(" LEFT JOIN boleto bo ON (ee.boleto_id = bo.boleto_id) ");
sql.append("WHERE ");
sql.append(" ee.activo = 1 ");
sql.append(" AND tee.desctipoevento IN ('EXCESSO BAGAGEM', 'ANIMAL 50%' ) ");
sql.append(" AND ee.fechoringreso BETWEEN :DATA_INICIAL AND :DATA_FINAL ");
if (!agencia.isEmpty()) {
sql.append(" AND ee.puntoventa_id IN ("+agencia+") ");
}
if (!empresa.isEmpty()) {
sql.append(" AND ee.empresa_id = :EMPRESA_ID ");
}
sql.append("GROUP BY ");
sql.append(" tee.desctipoevento, ");
sql.append(" ee.puntoventa_id, ");
sql.append(" pv.nombpuntoventa, ");
sql.append(" ee.empresa_id, ");
sql.append(" ci.estado_id, ");
sql.append(" bo.fechorventa ");
sql.append("ORDER BY ");
sql.append(" tee.desctipoevento, ");
sql.append(" ee.puntoventa_id, ");
sql.append(" pv.nombpuntoventa, ");
sql.append(" ee.empresa_id ");
return sql.toString();
}
public LinkedHashMap<String, Object> getConfigComissao(Integer puntoVentaId, Integer empresaId) throws Exception {
LinkedHashMap<String, Object> cacheConfig = null;
// Verifica se existe configuração na memoria, caso não exista, realiza busca no banco
if (mapCacheConfigComissao == null || !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.DESCTIPO AS 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, PC.SEGUROOBRIGATORIOALTA, PC.SEGUROOBRIGATORIOBAIXA, ");
sql.append(" CASE WHEN pc.valor_imp_gap_alta_comp IS NULL THEN pc.valor_impressao_gap_alta ELSE pc.valor_imp_gap_alta_comp END AS VALOR_IMPRESSAO_ALTA, ");
sql.append(" CASE WHEN pc.valor_imp_gap_comp IS NULL THEN pc.valor_impressao_gap ELSE pc.valor_imp_gap_comp END AS VALOR_IMPRESSAO_BAIXA, ");
sql.append(" CASE WHEN pc.valor_venda_gap_alta_comp IS NULL THEN pc.passagemalta ELSE pc.valor_venda_gap_alta_comp END AS VALOR_VENDA_IMP_ALTA, ");
sql.append(" CASE WHEN pc.valor_venda_gap_comp IS NULL THEN pc.passagembaixa ELSE pc.valor_venda_gap_comp END AS VALOR_VENDA_IMP_BAIXA ");
sql.append(" FROM PTOVTA_COMISSAO PC ");
sql.append(" INNER JOIN PUNTO_VENTA PV ON PV.PUNTOVENTA_ID = PC.PUNTOVENTA_ID AND PC.PTOVTADESCOMISSAO_ID = PV.PUNTOVENTA_ID ");
sql.append(" INNER JOIN PARADA PR ON PR.PARADA_ID = PV.PARADA_ID ");
sql.append(" INNER JOIN CIUDAD CD ON CD.CIUDAD_ID = PR.CIUDAD_ID ");
sql.append(" INNER JOIN ESTADO ES ON ES.ESTADO_ID = CD.ESTADO_ID ");
sql.append(" INNER JOIN TIPO_PTOVTA TP ON TP.TIPOPTOVTA_ID = PV.TIPOPTOVTA_ID");
sql.append(" WHERE PC.EMPRESA_ID = :EMPRESA_ID ");
sql.append(" AND PC.PUNTOVENTA_ID = :PUNTOVENTA_ID ");
sql.append(" AND PC.ACTIVO = 1 ");
NamedParameterStatement stmt = new NamedParameterStatement(this.getConexao(), sql.toString());
stmt.setInt("EMPRESA_ID", empresaId);
stmt.setInt("PUNTOVENTA_ID", puntoVentaId);
ResultSet rs = stmt.executeQuery();
if (rs.next()) {
cacheConfig = new LinkedHashMap<String, Object>();
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("SEGUROOBRIGATORIOBAIXA", rs.getBigDecimal("SEGUROOBRIGATORIOBAIXA"));
cacheConfig.put("SEGUROOBRIGATORIOALTA", rs.getBigDecimal("SEGUROOBRIGATORIOALTA"));
cacheConfig.put("VENDAIMPGAPALTA", rs.getBigDecimal("VALOR_IMPRESSAO_ALTA"));
cacheConfig.put("VENDAIMPGAPBAIXA", rs.getBigDecimal("VALOR_IMPRESSAO_BAIXA"));
cacheConfig.put("VENDAGAPALTA", rs.getBigDecimal("VALOR_VENDA_IMP_ALTA"));
cacheConfig.put("VENDAGAPBAIXA", rs.getBigDecimal("VALOR_VENDA_IMP_BAIXA"));
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);
} else {
StringBuilder sqlParam = new StringBuilder();
sqlParam.append(" SELECT EM.NOMBEMPRESA, PV.NOMBPUNTOVENTA, PV.PUNTOVENTA_ID, PV.NUMPUNTOVENTA ");
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()){
pontoVendaConfiguracao.add(new PuntoVenta(new Integer (rsParam.getString("PUNTOVENTA_ID")), rsParam.getString("NOMBPUNTOVENTA"), rsParam.getString("NUMPUNTOVENTA")));
}
rsParam.close();
stmtParam.close();
}
rs.close();
stmt.close();
}
else
cacheConfig = mapCacheConfigComissao.get(puntoVentaId.toString() + "_" + empresaId.toString());
return cacheConfig;
}
}

View File

@ -0,0 +1,32 @@
#geral
msg.noData=No se pudieron obtener datos con los parámetros proporcionados.
#Labels cabeçalho
header.relatorio=Informe:
header.periodo.venda=Período:
header.periodoA=a
header.empresa=Empresa:
header.data.hora=Fecha/Hora:
header.impressorPor=Impreso por:
header.pagina=Página
header.de=de
header.filtros=Filtros:
header.filtro.pontoVenda=Agencia:
header.titulo=Informe de Comisión Sintético
header.pagina=Pagina:
#Labels HEADER
label.agencia=Agencia
label.total.passagem=Total Venta de Boletos
label.comissao.passagem=Comisión Venta de Boletos
label.total.venda.imp=Total Venda Imp. Posterior
label.comissao.v.imp=Comisión Venda Imp. Posterior
label.total.imp=Total Imp. Posterior
label.comissao.imp=Comisión Imp. Posterior
label.total.excesso=Total Exceso de Equipaje
label.comissao.excesso=Comisión Exceso de Equipaje
label.total.outros=Total Otros (Animal 50%)
label.comissao.outros=Comisión Otros
label.faturamento.total=Facturación Total (Venta)
label.comissão.total=Valor Total de Comisión
label.total.geral=Total Geral

View File

@ -0,0 +1,32 @@
#geral
msg.noData=Não foi possivel obter dados com os parâmetros informados.
#Labels cabeçalho
header.relatorio=Relatório:
header.periodo.venda=Período:
header.periodoA=à
header.empresa=Empresa:
header.data.hora=Data/Hora:
header.impressorPor=Impressor por:
header.pagina=Página
header.de=de
header.filtros=Filtros:
header.filtro.pontoVenda=Agnecia:
header.titulo=Relatório Comissão Sintético
header.pagina=Pagina:
#Labels HEADER
label.agencia=Agencia
label.total.passagem=Total Venda Passagem
label.comissao.passagem=Comissão Venda Passagem
label.total.venda.imp=Total Venda Imp. Posterior
label.comissao.v.imp=Comissão Venda Imp. Posterior
label.total.imp=Total Imp. Posterior
label.comissao.imp=Comissão Imp. Posterior
label.total.excesso=Total Excesso Bagagem
label.comissao.excesso=Comissão Excesso Bagagem
label.total.outros=Total Outros (Animal 50%)
label.comissao.outros=Comissão Outros
label.faturamento.total=Faturamento Total (Venda)
label.comissão.total=Valor Total Comissão
label.total.geral=Total Geral

View File

@ -0,0 +1,586 @@
<?xml version="1.0" encoding="UTF-8"?>
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="RelatorioComissaoSintetico" pageWidth="595" pageHeight="842" columnWidth="575" leftMargin="10" rightMargin="10" topMargin="20" bottomMargin="20" uuid="3ee05e26-199e-4ad2-a96b-dd421627aceb">
<property name="ireport.zoom" value="1.815000000000003"/>
<property name="ireport.x" value="0"/>
<property name="ireport.y" value="0"/>
<property name="net.sf.jasperreports.export.xls.exclude.origin.keep.first.band.2" value="columnHeader"/>
<property name="net.sf.jasperreports.export.xls.remove.empty.space.between.rows" value="true"/>
<property name="net.sf.jasperreports.export.xls.remove.empty.space.between.columns" value="true"/>
<parameter name="USUARIO_ID" class="java.lang.String"/>
<parameter name="NUMPUNTOVENTA" class="java.lang.String"/>
<parameter name="TITULO" class="java.lang.String"/>
<parameter name="DATA_INICIAL" class="java.util.Date"/>
<parameter name="DATA_FINAL" class="java.util.Date"/>
<parameter name="EMPRESA" class="java.lang.String"/>
<parameter name="FILTROS" class="java.lang.String"/>
<parameter name="USUARIO" class="java.lang.String"/>
<field name="pontoVenda" class="java.lang.String"/>
<field name="pontoVendaID" class="java.lang.String"/>
<field name="empresaID" class="java.lang.String"/>
<field name="totalTarifa" class="java.math.BigDecimal"/>
<field name="comissaoTarifa" class="java.math.BigDecimal"/>
<field name="totalVendaImpPosterior" class="java.math.BigDecimal"/>
<field name="comissaoVendaImpPosterior" class="java.math.BigDecimal"/>
<field name="totalImpPosterior" class="java.math.BigDecimal"/>
<field name="comissaoImpPosterior" class="java.math.BigDecimal"/>
<field name="totalExcBagagem" class="java.math.BigDecimal"/>
<field name="comissaoExcBagagem" class="java.math.BigDecimal"/>
<field name="totalOutros" class="java.math.BigDecimal"/>
<field name="comissaoOutros" class="java.math.BigDecimal"/>
<field name="totalPagado" class="java.math.BigDecimal"/>
<field name="comissaoTotal" class="java.math.BigDecimal"/>
<field name="totalSeguro" class="java.math.BigDecimal"/>
<field name="totalTaxaEmb" class="java.math.BigDecimal"/>
<field name="comissaoSeguro" class="java.math.BigDecimal"/>
<variable name="comissaoTotal" class="java.math.BigDecimal" calculation="Sum">
<variableExpression><![CDATA[$V{comissaoTotal}.add($F{comissaoTarifa} != null ? $F{comissaoTarifa} : BigDecimal.ZERO)
.add($F{comissaoVendaImpPosterior} != null ? $F{comissaoVendaImpPosterior} : BigDecimal.ZERO)
.add($F{comissaoImpPosterior} != null ? $F{comissaoImpPosterior} : BigDecimal.ZERO)
.add($F{comissaoExcBagagem} != null ? $F{comissaoExcBagagem} : BigDecimal.ZERO)
.add($F{comissaoOutros} != null ? $F{comissaoOutros} : BigDecimal.ZERO)]]></variableExpression>
<initialValueExpression><![CDATA[BigDecimal.ZERO]]></initialValueExpression>
</variable>
<variable name="totalVendaPassagens" class="java.math.BigDecimal" calculation="Sum">
<variableExpression><![CDATA[$F{totalTarifa}]]></variableExpression>
</variable>
<variable name="totalComissaoVenda" class="java.math.BigDecimal" calculation="Sum"/>
<variable name="totalVendaImpPosterior" class="java.math.BigDecimal" calculation="Sum">
<variableExpression><![CDATA[$F{totalVendaImpPosterior}]]></variableExpression>
</variable>
<variable name="totalComissaoVendaImpPos" class="java.math.BigDecimal" calculation="Sum">
<variableExpression><![CDATA[$F{comissaoVendaImpPosterior}]]></variableExpression>
</variable>
<variable name="totalVendaImpPos" class="java.math.BigDecimal" calculation="Sum">
<variableExpression><![CDATA[$F{totalVendaImpPosterior}]]></variableExpression>
</variable>
<variable name="totalComissaoImpPosterior" class="java.math.BigDecimal" calculation="Sum">
<variableExpression><![CDATA[$F{comissaoImpPosterior}]]></variableExpression>
</variable>
<variable name="totalExcBagagem" class="java.math.BigDecimal" calculation="Sum">
<variableExpression><![CDATA[$F{totalExcBagagem}]]></variableExpression>
</variable>
<variable name="totalComissaoExcBagagem" class="java.math.BigDecimal" calculation="Sum">
<variableExpression><![CDATA[$F{comissaoExcBagagem}]]></variableExpression>
</variable>
<variable name="totalOutros" class="java.math.BigDecimal" calculation="Sum">
<variableExpression><![CDATA[$F{totalOutros}]]></variableExpression>
</variable>
<variable name="totalComissaoOutros" class="java.math.BigDecimal" calculation="Sum">
<variableExpression><![CDATA[$F{comissaoOutros}]]></variableExpression>
</variable>
<variable name="totalPagado" class="java.math.BigDecimal" calculation="Sum">
<variableExpression><![CDATA[$F{totalPagado}]]></variableExpression>
</variable>
<variable name="totalComissaoTotal" class="java.math.BigDecimal" calculation="Sum">
<variableExpression><![CDATA[$V{comissaoTotal}]]></variableExpression>
</variable>
<title>
<band height="127">
<textField pattern="dd/MM/yyyy HH:mm">
<reportElement uuid="32538cdd-7697-4a03-8035-f9474e869395" x="495" y="0" width="80" height="16"/>
<textElement textAlignment="Right" verticalAlignment="Middle">
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[new java.util.Date()]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="abc399f3-d012-46aa-b4e9-678ab812bee4" x="382" y="0" width="113" height="16"/>
<textElement textAlignment="Right" verticalAlignment="Middle">
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$R{header.data.hora}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="f25e6675-4dcb-4d37-8586-e50abe4013af" x="70" y="53" width="505" height="20"/>
<textElement>
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[($P{DATA_INICIAL} != null ? new SimpleDateFormat("dd/MM/yyyy").format($P{DATA_INICIAL}) + " à " + new SimpleDateFormat("dd/MM/yyyy").format($P{DATA_FINAL}) : "")]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="e15cecc4-995a-4cbc-934e-44970c809849" x="2" y="53" width="68" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$R{header.periodo.venda}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="d3d41ddb-2dbb-4b0e-bf82-02af7f81b63f" x="2" y="72" width="68" height="20" isRemoveLineWhenBlank="true"/>
<textElement/>
<textFieldExpression><![CDATA[$R{header.empresa}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="7bc881ef-b270-4178-8416-54ad2602eaab" x="70" y="92" width="505" height="20" isRemoveLineWhenBlank="true"/>
<textElement>
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$P{NUMPUNTOVENTA}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="33bc773a-8bd3-4bc0-946c-664d78a19f5c" x="70" y="72" width="505" height="20" isRemoveLineWhenBlank="true"/>
<textElement>
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$P{EMPRESA}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="c3b8e525-e015-4aaa-a505-1a92f3d6b0fb" x="2" y="92" width="68" height="20" isRemoveLineWhenBlank="true"/>
<textElement/>
<textFieldExpression><![CDATA[$R{header.filtro.pontoVenda}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true">
<reportElement uuid="3bc4a172-01c3-4821-a595-9b2f7e794e90" stretchType="RelativeToTallestObject" x="70" y="112" width="505" height="14"/>
<textElement>
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$P{FILTROS}]]></textFieldExpression>
</textField>
<textField pattern="" isBlankWhenNull="false">
<reportElement uuid="7057e2fc-1c0c-4600-9052-26476c93b8f1" mode="Transparent" x="2" y="112" width="42" height="14" 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{header.filtros}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="83ba776d-57a0-428e-a059-7e0f7412ba27" x="357" y="36" width="218" height="16"/>
<textElement textAlignment="Right" verticalAlignment="Middle">
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$R{header.impressorPor}+" "+$P{USUARIO}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="46a0fd96-3aa5-4f54-9315-5402efe99381" x="2" y="0" width="355" height="53"/>
<textElement>
<font size="20" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$R{header.titulo}]]></textFieldExpression>
</textField>
<textField evaluationTime="Report">
<reportElement uuid="4458c46c-d661-4cf5-999e-fd9b7e5d60ad" x="546" y="16" width="29" height="20"/>
<textElement textAlignment="Right" verticalAlignment="Middle">
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$V{PAGE_NUMBER}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="8b45dca8-0cf5-4c10-aaa7-fce7b2d596c5" x="470" y="16" width="76" height="20"/>
<textElement textAlignment="Right" verticalAlignment="Middle">
<font size="8"/>
<paragraph rightIndent="2"/>
</textElement>
<textFieldExpression><![CDATA[$R{header.pagina}+" "+$V{PAGE_NUMBER}+" de"]]></textFieldExpression>
</textField>
</band>
</title>
<columnHeader>
<band height="31">
<textField isStretchWithOverflow="true">
<reportElement uuid="a8630efd-6599-4fff-964c-32a8fa6d44be" stretchType="RelativeToBandHeight" x="2" y="0" width="93" height="29"/>
<box>
<topPen lineWidth="0.5"/>
<leftPen lineWidth="0.5"/>
<bottomPen lineWidth="0.5"/>
<rightPen lineWidth="0.5"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle" markup="styled">
<font fontName="SansSerif" size="8"/>
</textElement>
<textFieldExpression><![CDATA[$R{label.agencia}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true">
<reportElement uuid="b7de9705-89ba-4b32-96b6-c576a8c837c9" stretchType="RelativeToBandHeight" x="95" y="0" width="40" height="29" backcolor="#FFFFFF"/>
<box>
<topPen lineWidth="0.5"/>
<leftPen lineWidth="0.5"/>
<bottomPen lineWidth="0.5"/>
<rightPen lineWidth="0.5"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle" markup="styled">
<font fontName="SansSerif" size="8"/>
</textElement>
<textFieldExpression><![CDATA[$R{label.total.passagem}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true">
<reportElement uuid="9f26b982-6b13-4453-96b1-ca4d117dd01e" stretchType="RelativeToBandHeight" x="135" y="0" width="40" height="29" backcolor="#D0D0D0"/>
<box>
<topPen lineWidth="0.5"/>
<leftPen lineWidth="0.5"/>
<bottomPen lineWidth="0.5"/>
<rightPen lineWidth="0.5"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle" markup="styled">
<font fontName="SansSerif" size="8"/>
</textElement>
<textFieldExpression><![CDATA[$R{label.comissao.passagem}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true">
<reportElement uuid="3c63f463-1b5e-4669-ab70-951cfa86df61" stretchType="RelativeToBandHeight" x="255" y="0" width="40" height="29"/>
<box>
<topPen lineWidth="0.5"/>
<leftPen lineWidth="0.5"/>
<bottomPen lineWidth="0.5"/>
<rightPen lineWidth="0.5"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle" markup="styled">
<font fontName="SansSerif" size="8"/>
</textElement>
<textFieldExpression><![CDATA[$R{label.total.imp}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true">
<reportElement uuid="e8df569a-2fae-4c3e-8e54-826f96b2a3b3" stretchType="RelativeToBandHeight" x="295" y="0" width="40" height="29" backcolor="#D0D0D0"/>
<box>
<topPen lineWidth="0.5"/>
<leftPen lineWidth="0.5"/>
<bottomPen lineWidth="0.5"/>
<rightPen lineWidth="0.5"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle" markup="styled">
<font fontName="SansSerif" size="8"/>
</textElement>
<textFieldExpression><![CDATA[$R{label.comissao.imp}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true">
<reportElement uuid="c43f5d68-7ede-499f-b41e-7bea4c2633ba" stretchType="RelativeToBandHeight" x="335" y="0" width="40" height="29"/>
<box>
<topPen lineWidth="0.5"/>
<leftPen lineWidth="0.5"/>
<bottomPen lineWidth="0.5"/>
<rightPen lineWidth="0.5"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle" markup="styled">
<font fontName="SansSerif" size="8"/>
</textElement>
<textFieldExpression><![CDATA[$R{label.total.excesso}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true">
<reportElement uuid="f53eb468-e59a-4d52-912f-d74d6f3b5b55" stretchType="RelativeToBandHeight" x="375" y="0" width="40" height="29" backcolor="#D0D0D0"/>
<box>
<topPen lineWidth="0.5"/>
<leftPen lineWidth="0.5"/>
<bottomPen lineWidth="0.5"/>
<rightPen lineWidth="0.5"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle" markup="styled">
<font fontName="SansSerif" size="8"/>
</textElement>
<textFieldExpression><![CDATA[$R{label.comissao.excesso}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true">
<reportElement uuid="f4d17e8b-9174-4eb9-a636-4cccffcc326c" stretchType="RelativeToBandHeight" x="415" y="0" width="40" height="29"/>
<box>
<topPen lineWidth="0.5"/>
<leftPen lineWidth="0.5"/>
<bottomPen lineWidth="0.5"/>
<rightPen lineWidth="0.5"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle" markup="styled">
<font fontName="SansSerif" size="8"/>
</textElement>
<textFieldExpression><![CDATA[$R{label.total.outros}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true">
<reportElement uuid="ab5e35b3-ad08-4264-b5a3-311d394cd505" stretchType="RelativeToBandHeight" x="455" y="0" width="40" height="29" backcolor="#D0D0D0"/>
<box>
<topPen lineWidth="0.5"/>
<leftPen lineWidth="0.5"/>
<bottomPen lineWidth="0.5"/>
<rightPen lineWidth="0.5"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle" markup="styled">
<font fontName="SansSerif" size="8"/>
</textElement>
<textFieldExpression><![CDATA[$R{label.comissao.outros}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true">
<reportElement uuid="baa3fc3e-8161-4723-b203-53e5aec20236" stretchType="RelativeToBandHeight" x="495" y="0" width="40" height="29"/>
<box>
<topPen lineWidth="0.5"/>
<leftPen lineWidth="0.5"/>
<bottomPen lineWidth="0.5"/>
<rightPen lineWidth="0.5"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle" markup="styled">
<font fontName="SansSerif" size="8"/>
</textElement>
<textFieldExpression><![CDATA[$R{label.faturamento.total}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true">
<reportElement uuid="702500a1-67d5-4b1f-afed-f5cf7ef46f7a" stretchType="RelativeToBandHeight" x="535" y="0" width="40" height="29" backcolor="#D0D0D0"/>
<box>
<topPen lineWidth="0.5"/>
<leftPen lineWidth="0.5"/>
<bottomPen lineWidth="0.5"/>
<rightPen lineWidth="0.5"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle" markup="styled">
<font fontName="SansSerif" size="8"/>
</textElement>
<textFieldExpression><![CDATA[$R{label.comissão.total}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true">
<reportElement uuid="ec3f23c3-4ed8-4ed9-a444-be0d183d7b2f" stretchType="RelativeToBandHeight" x="175" y="0" width="40" height="29" backcolor="#FFFFFF"/>
<box>
<topPen lineWidth="0.5"/>
<leftPen lineWidth="0.5"/>
<bottomPen lineWidth="0.5"/>
<rightPen lineWidth="0.5"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle" markup="styled">
<font fontName="SansSerif" size="8"/>
</textElement>
<textFieldExpression><![CDATA[$R{label.total.venda.imp}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true">
<reportElement uuid="4011e3b5-50a3-4558-9451-dde1eaba6475" stretchType="RelativeToBandHeight" x="215" y="0" width="40" height="29" backcolor="#D0D0D0"/>
<box>
<topPen lineWidth="0.5"/>
<leftPen lineWidth="0.5"/>
<bottomPen lineWidth="0.5"/>
<rightPen lineWidth="0.5"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle" markup="styled">
<font fontName="SansSerif" size="8"/>
</textElement>
<textFieldExpression><![CDATA[$R{label.comissao.v.imp}]]></textFieldExpression>
</textField>
</band>
</columnHeader>
<detail>
<band height="20" splitType="Prevent">
<textField>
<reportElement uuid="37f5c197-8660-4330-ac3b-b157a0f8e6c1" x="2" y="0" width="93" height="20"/>
<box>
<leftPen lineWidth="0.5"/>
<bottomPen lineWidth="0.5"/>
</box>
<textElement verticalAlignment="Middle">
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$F{pontoVenda}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="d4925633-14a7-4e0a-9ba1-72c9898f01a2" x="95" y="0" width="40" height="20"/>
<box>
<bottomPen lineWidth="0.5"/>
</box>
<textElement textAlignment="Right" verticalAlignment="Middle">
<font size="7"/>
</textElement>
<textFieldExpression><![CDATA[($F{totalTarifa} == null || $F{totalTarifa}.equals(BigDecimal.ZERO)) ? "-" : "R$" + new DecimalFormat("###,##0.00").format($F{totalTarifa})]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="6740083a-5616-40b5-ad6e-474a9ff42a95" x="135" y="0" width="40" height="20" backcolor="#D0D0D0"/>
<box>
<bottomPen lineWidth="0.5"/>
</box>
<textElement textAlignment="Right" verticalAlignment="Middle">
<font size="7"/>
</textElement>
<textFieldExpression><![CDATA[($F{comissaoTarifa} == null || $F{comissaoTarifa}.equals(BigDecimal.ZERO)) ? "-" : "R$" + new DecimalFormat("###,##0.00").format($F{comissaoTarifa})]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="ba43930c-8783-4551-89d4-72310c5fcc0b" x="255" y="0" width="40" height="20"/>
<box>
<bottomPen lineWidth="0.5"/>
</box>
<textElement textAlignment="Right" verticalAlignment="Middle">
<font size="7"/>
</textElement>
<textFieldExpression><![CDATA[($F{totalImpPosterior} == null || $F{totalImpPosterior}.equals(BigDecimal.ZERO)) ? "-" : "R$" + new DecimalFormat("###,##0.00").format($F{totalImpPosterior})]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="70f4eefa-dc33-4308-bfd5-b6c131309473" x="295" y="0" width="40" height="20" backcolor="#D0D0D0"/>
<box>
<bottomPen lineWidth="0.5"/>
</box>
<textElement textAlignment="Right" verticalAlignment="Middle">
<font size="7"/>
</textElement>
<textFieldExpression><![CDATA[($F{comissaoImpPosterior} == null || $F{comissaoImpPosterior}.equals(BigDecimal.ZERO)) ? "-" : "R$" + new DecimalFormat("###,##0.00").format($F{comissaoImpPosterior})]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="a4559a53-c150-40c0-87ed-c311960f5138" x="335" y="0" width="40" height="20"/>
<box>
<bottomPen lineWidth="0.5"/>
</box>
<textElement textAlignment="Right" verticalAlignment="Middle">
<font size="7"/>
</textElement>
<textFieldExpression><![CDATA[($F{totalExcBagagem} == null || $F{totalExcBagagem}.equals(BigDecimal.ZERO)) ? "-" : "R$" + new DecimalFormat("###,##0.00").format($F{totalExcBagagem})]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="e4dadd17-b2c3-4136-aaa3-90b26167d3ed" x="375" y="0" width="40" height="20" backcolor="#D0D0D0"/>
<box>
<bottomPen lineWidth="0.5"/>
</box>
<textElement textAlignment="Right" verticalAlignment="Middle">
<font size="7"/>
</textElement>
<textFieldExpression><![CDATA[($F{comissaoExcBagagem} == null || $F{comissaoExcBagagem}.equals(BigDecimal.ZERO)) ? "-" : "R$" + new DecimalFormat("###,##0.00").format($F{comissaoExcBagagem})]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="86df5436-569d-48f2-a94c-3175a75332a2" x="415" y="0" width="40" height="20"/>
<box>
<bottomPen lineWidth="0.5"/>
</box>
<textElement textAlignment="Right" verticalAlignment="Middle">
<font size="7"/>
</textElement>
<textFieldExpression><![CDATA[($F{totalOutros} == null || $F{totalOutros}.equals(BigDecimal.ZERO)) ? "-" : "R$" + new DecimalFormat("###,##0.00").format($F{totalOutros})]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="b2c68c6a-164f-4dd9-be3e-44bbcefe8c01" x="455" y="0" width="40" height="20" backcolor="#D0D0D0"/>
<box>
<bottomPen lineWidth="0.5"/>
</box>
<textElement textAlignment="Right" verticalAlignment="Middle">
<font size="7"/>
</textElement>
<textFieldExpression><![CDATA[($F{comissaoOutros} == null || $F{comissaoOutros}.equals(BigDecimal.ZERO)) ? "-" : "R$" + new DecimalFormat("###,##0.00").format($F{comissaoOutros})]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="c5274583-1165-41f6-a551-ce4afc5ebd96" x="495" y="0" width="40" height="20"/>
<box>
<bottomPen lineWidth="0.5"/>
</box>
<textElement textAlignment="Right" verticalAlignment="Middle">
<font size="7"/>
</textElement>
<textFieldExpression><![CDATA[($F{totalPagado} == null || $F{totalPagado}.equals(BigDecimal.ZERO)) ? "-" : "R$" + new DecimalFormat("###,##0.00").format($F{totalPagado})]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="964c06b9-0092-4b22-b48f-09a7e12223ea" x="535" y="0" width="40" height="20" backcolor="#D0D0D0"/>
<box>
<bottomPen lineWidth="0.5"/>
<rightPen lineWidth="0.5"/>
</box>
<textElement textAlignment="Right" verticalAlignment="Middle">
<font size="7"/>
<paragraph spacingAfter="1"/>
</textElement>
<textFieldExpression><![CDATA[($V{comissaoTotal}.compareTo(BigDecimal.ZERO) != 0) ? "R$" + new DecimalFormat("###,##0.00").format($V{comissaoTotal}) : "-"]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="7ddb5de3-1cc2-4d54-b687-8d3373200d44" x="175" y="0" width="40" height="20"/>
<box>
<bottomPen lineWidth="0.5"/>
</box>
<textElement textAlignment="Right" verticalAlignment="Middle">
<font size="7"/>
</textElement>
<textFieldExpression><![CDATA[($F{totalVendaImpPosterior} == null || $F{totalVendaImpPosterior}.equals(BigDecimal.ZERO)) ? "-" : "R$" + new DecimalFormat("###,##0.00").format($F{totalVendaImpPosterior})]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="3ccff4d1-442a-4076-97d3-b0df4fc380c9" x="215" y="0" width="40" height="20" backcolor="#D0D0D0"/>
<box>
<bottomPen lineWidth="0.5"/>
</box>
<textElement textAlignment="Right" verticalAlignment="Middle">
<font size="7"/>
</textElement>
<textFieldExpression><![CDATA[($F{comissaoVendaImpPosterior} == null || $F{comissaoVendaImpPosterior}.equals(BigDecimal.ZERO)) ? "-" : "R$" + new DecimalFormat("###,##0.00").format($F{comissaoVendaImpPosterior})]]></textFieldExpression>
</textField>
</band>
</detail>
<summary>
<band height="24">
<textField>
<reportElement uuid="254c9278-71b2-4ffa-926c-5b0055e02cda" x="0" y="2" width="95" height="20"/>
<textElement verticalAlignment="Middle">
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$R{label.total.geral}]]></textFieldExpression>
</textField>
<textField pattern="¤ #,##0.00" isBlankWhenNull="true">
<reportElement uuid="f73d0e76-f4b7-4f0d-9829-1e2e0ac136e2" x="95" y="2" width="40" height="20"/>
<textElement textAlignment="Right" verticalAlignment="Middle">
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$V{totalVendaPassagens}]]></textFieldExpression>
</textField>
<textField pattern="¤ #,##0.00" isBlankWhenNull="true">
<reportElement uuid="8d5c13c7-22b3-4d98-aa90-2f29c66b27df" x="135" y="2" width="40" height="20"/>
<textElement textAlignment="Right" verticalAlignment="Middle">
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$V{totalComissaoVenda}]]></textFieldExpression>
</textField>
<textField pattern="¤ #,##0.00" isBlankWhenNull="true">
<reportElement uuid="5283241a-48aa-4a14-9055-fa4556740285" x="175" y="2" width="40" height="20"/>
<textElement textAlignment="Right" verticalAlignment="Middle">
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$V{totalVendaImpPosterior}]]></textFieldExpression>
</textField>
<textField pattern="¤ #,##0.00" isBlankWhenNull="true">
<reportElement uuid="1e757c53-6a63-4631-8cf1-1947ef2e5655" x="215" y="2" width="40" height="20"/>
<textElement textAlignment="Right" verticalAlignment="Middle">
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$V{totalComissaoVendaImpPos}]]></textFieldExpression>
</textField>
<textField pattern="¤ #,##0.00" isBlankWhenNull="true">
<reportElement uuid="28d68769-ee18-4e75-876f-3831440e4d6d" x="255" y="2" width="40" height="20"/>
<textElement textAlignment="Right" verticalAlignment="Middle">
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$V{totalVendaImpPosterior}]]></textFieldExpression>
</textField>
<textField pattern="¤ #,##0.00" isBlankWhenNull="true">
<reportElement uuid="6a225efc-3b35-4d11-88a6-b91bcc0f46c4" x="295" y="2" width="40" height="20"/>
<textElement textAlignment="Right" verticalAlignment="Middle">
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$V{totalComissaoImpPosterior}]]></textFieldExpression>
</textField>
<textField pattern="¤ #,##0.00" isBlankWhenNull="true">
<reportElement uuid="692797f2-804c-475c-8850-3298c8929bff" x="335" y="2" width="40" height="20"/>
<textElement textAlignment="Right" verticalAlignment="Middle">
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$V{totalExcBagagem}]]></textFieldExpression>
</textField>
<textField pattern="¤ #,##0.00" isBlankWhenNull="true">
<reportElement uuid="0bc22fcd-08c9-4aa6-ba57-86c622d4ab25" x="375" y="2" width="40" height="20"/>
<textElement textAlignment="Right" verticalAlignment="Middle">
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$V{totalComissaoExcBagagem}]]></textFieldExpression>
</textField>
<textField pattern="¤ #,##0.00" isBlankWhenNull="true">
<reportElement uuid="f36968b3-9d63-4a93-8b83-76aa7a7efac0" x="415" y="2" width="40" height="20"/>
<textElement textAlignment="Right" verticalAlignment="Middle">
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$V{totalOutros}]]></textFieldExpression>
</textField>
<textField pattern="¤ #,##0.00" isBlankWhenNull="true">
<reportElement uuid="13303515-a3f8-4c98-9faf-8cfc7fbf4fbb" x="455" y="2" width="40" height="20"/>
<textElement textAlignment="Right" verticalAlignment="Middle">
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$V{totalComissaoOutros}]]></textFieldExpression>
</textField>
<textField pattern="¤ #,##0.00" isBlankWhenNull="true">
<reportElement uuid="d13a8054-8d65-44f0-ab07-528d86eccabd" x="495" y="2" width="40" height="20"/>
<textElement textAlignment="Right" verticalAlignment="Middle">
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$V{totalPagado}]]></textFieldExpression>
</textField>
<textField pattern="¤ #,##0.00" isBlankWhenNull="true">
<reportElement uuid="9e75f6e6-ff85-4065-bc46-b1362f9294e1" x="535" y="2" width="40" height="20"/>
<textElement textAlignment="Right" verticalAlignment="Middle">
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$V{totalComissaoTotal}]]></textFieldExpression>
</textField>
<line>
<reportElement uuid="4a56d4c0-e2dc-4b24-bac3-fd5dd76b986c" x="2" y="1" width="573" height="1"/>
</line>
</band>
</summary>
<noData>
<band height="22"/>
</noData>
</jasperReport>

View File

@ -0,0 +1,196 @@
package com.rjconsultores.ventaboletos.relatorios.utilitarios;
import java.math.BigDecimal;
import java.util.Objects;
public class RelatorioComissaoSinteticoBean {
private String pontoVenda;
private Integer pontoVendaID;
private Integer empresaID;
private BigDecimal totalTarifa;
private BigDecimal comissaoTarifa;
private BigDecimal totalImpPosterior;
private BigDecimal comissaoImpPosterior;
private BigDecimal totalVendaImpPosterior;
private BigDecimal comissaoVendaImpPosterior;
private BigDecimal totalExcBagagem;
private BigDecimal comissaoExcBagagem;
private BigDecimal totalOutros;
private BigDecimal comissaoOutros;
private BigDecimal totalPagado;
private BigDecimal comissaoTotal;
private BigDecimal totalSeguro;
private BigDecimal totalPedagio;
private BigDecimal totalTaxaEmb;
private BigDecimal comissaoSeguro;
public Integer getPontoVendaID() {
return pontoVendaID;
}
public void setPontoVendaID(Integer pontoVendaID) {
this.pontoVendaID = pontoVendaID;
}
public Integer getEmpresaID() {
return empresaID;
}
public void setEmpresaID(Integer empresaID) {
this.empresaID = empresaID;
}
public String getPontoVenda() {
return pontoVenda;
}
public void setPontoVenda(String pontoVenda) {
this.pontoVenda = pontoVenda;
}
public BigDecimal getTotalSeguro() {
return totalSeguro;
}
public void setTotalSeguro(BigDecimal totalSeguro) {
this.totalSeguro = totalSeguro;
}
public BigDecimal getTotalTaxaEmb() {
return totalTaxaEmb;
}
public void setTotalTaxaEmb(BigDecimal totalTaxaEmb) {
this.totalTaxaEmb = totalTaxaEmb;
}
public BigDecimal getTotalPegadio() {
return totalPedagio;
}
public void setTotalPegadio(BigDecimal totalPegadio) {
this.totalPedagio = totalPegadio;
}
public BigDecimal getTotalTarifa() {
return totalTarifa;
}
public void setTotalTarifa(BigDecimal totalTarifa) {
this.totalTarifa = totalTarifa;
}
public BigDecimal getComissaoTarifa() {
return comissaoTarifa;
}
public void setComissaoTarifa(BigDecimal comissaoTarifa) {
this.comissaoTarifa = comissaoTarifa;
}
public BigDecimal getTotalImpPosterior() {
return totalImpPosterior;
}
public void setTotalImpPosterior(BigDecimal totalImpPosterior) {
this.totalImpPosterior = totalImpPosterior;
}
public BigDecimal getComissaoImpPosterior() {
return comissaoImpPosterior;
}
public BigDecimal getTotalVendaImpPosterior() {
return totalVendaImpPosterior;
}
public void setTotalVendaImpPosterior(BigDecimal totalVendaImpPosterior) {
this.totalVendaImpPosterior = totalVendaImpPosterior;
}
public BigDecimal getComissaoVendaImpPosterior() {
return comissaoVendaImpPosterior;
}
public void setComissaoVendaImpPosterior(BigDecimal comissaoVendaImpPosterior) {
this.comissaoVendaImpPosterior = comissaoVendaImpPosterior;
}
public void setComissaoImpPosterior(BigDecimal comissaoImpPosterior) {
this.comissaoImpPosterior = comissaoImpPosterior;
}
public BigDecimal getTotalExcBagagem() {
return totalExcBagagem;
}
public void setTotalExcBagagem(BigDecimal totalExcBagagem) {
this.totalExcBagagem = totalExcBagagem;
}
public BigDecimal getComissaoExcBagagem() {
return comissaoExcBagagem;
}
public void setComissaoExcBagagem(BigDecimal comissaoExcBagagem) {
this.comissaoExcBagagem = comissaoExcBagagem;
}
public BigDecimal getTotalOutros() {
return totalOutros;
}
public void setTotalOutros(BigDecimal totalOutros) {
this.totalOutros = totalOutros;
}
public BigDecimal getComissaoOutros() {
return comissaoOutros;
}
public void setComissaoOutros(BigDecimal comissaoOutros) {
this.comissaoOutros = comissaoOutros;
}
public BigDecimal getTotalPagado() {
return totalPagado;
}
public void setTotalPagado(BigDecimal totalPagado) {
this.totalPagado = totalPagado;
}
public BigDecimal getComissaoTotal() {
return comissaoTotal;
}
public void setComissaoTotal(BigDecimal comissaoTotal) {
this.comissaoTotal = comissaoTotal;
}
public BigDecimal getComissaoSeguro() {
return comissaoSeguro;
}
public void setComissaoSeguro(BigDecimal comissaoSeguro) {
this.comissaoSeguro = comissaoSeguro;
}
@Override
public int hashCode() {
return Objects.hash(empresaID, pontoVendaID);
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
RelatorioComissaoSinteticoBean other = (RelatorioComissaoSinteticoBean) obj;
return Objects.equals(empresaID, other.empresaID) && Objects.equals(pontoVendaID, other.pontoVendaID);
}
}

View File

@ -0,0 +1,6 @@
package com.rjconsultores.ventaboletos.relatorios.utilitarios;
public class RelatorioDetalhamentoComissaoRelBean {
}

View File

@ -0,0 +1,194 @@
package com.rjconsultores.ventaboletos.web.gui.controladores.relatorios;
import java.sql.Connection;
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.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.Bandbox;
import org.zkoss.zul.Comboitem;
import org.zkoss.zul.Paging;
import org.zkoss.zul.Radiogroup;
import com.rjconsultores.ventaboletos.entidad.Empresa;
import com.rjconsultores.ventaboletos.entidad.PuntoVenta;
import com.rjconsultores.ventaboletos.relatorios.impl.RelatorioComissaoSintetico;
import com.rjconsultores.ventaboletos.relatorios.utilitarios.Relatorio;
import com.rjconsultores.ventaboletos.service.EmpresaService;
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar;
import com.rjconsultores.ventaboletos.web.utilerias.MyDatebox;
import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer;
import com.rjconsultores.ventaboletos.web.utilerias.MyListbox;
import com.rjconsultores.ventaboletos.web.utilerias.MyTextbox;
import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject;
import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper;
import com.rjconsultores.ventaboletos.web.utilerias.render.RenderRelatorioTaxasLinhaPuntoVenta;
import com.rjconsultores.ventaboletos.web.utilerias.render.RenderRelatorioTaxasLinhaPuntoVentaSelecionados;
@Controller("relatorioComissaoController")
@Scope("prototype")
public class RelatorioComissaoController extends MyGenericForwardComposer {
/**
*
*/
private static final long serialVersionUID = 1L;
@Autowired
private transient PagedListWrapper<PuntoVenta> plwPuntoVenta;
@Autowired
private DataSource dataSourceRead;
@Autowired
private EmpresaService empresaService;
private List<Empresa> lsEmpresa;
private MyDatebox datInicial;
private MyDatebox datFinal;
private MyTextbox txtNombrePuntoVenta;
private Radiogroup rdGroupTipoRelatorio;
private MyComboboxEstandar cmbEmpresa;
private Bandbox bbPesquisaPuntoVenta;
private MyListbox puntoVentaList;
private MyListbox puntoVentaSelList;
private Paging pagingPuntoVenta;
@Override
public void doAfterCompose(Component comp) throws Exception {
lsEmpresa = empresaService.obtenerTodos();
super.doAfterCompose(comp);
puntoVentaList.setItemRenderer(new RenderRelatorioTaxasLinhaPuntoVenta());
puntoVentaSelList.setItemRenderer(new RenderRelatorioTaxasLinhaPuntoVentaSelecionados());
}
private void executarPesquisa() {
HibernateSearchObject<PuntoVenta> puntoVentaBusqueda = new HibernateSearchObject<PuntoVenta>(PuntoVenta.class, pagingPuntoVenta.getPageSize());
puntoVentaBusqueda.addFilterILike("nombpuntoventa", "%" + txtNombrePuntoVenta.getValue() + "%");
puntoVentaBusqueda.addFilterEqual("activo", Boolean.TRUE);
puntoVentaBusqueda.addSortAsc("nombpuntoventa");
puntoVentaBusqueda.addFilterEqual("activo", Boolean.TRUE);
plwPuntoVenta.init(puntoVentaBusqueda, puntoVentaList, pagingPuntoVenta);
if (puntoVentaList.getData().length == 0) {
try {
Messagebox.show(Labels.getLabel("MSG.ningunRegistro"),
Labels.getLabel("relatorioComissaoController.window.title"),
Messagebox.OK, Messagebox.INFORMATION);
} catch (InterruptedException ex) {
}
}
}
public void onClick$btnPesquisa(Event ev) {
executarPesquisa();
}
public void onDoubleClick$puntoVentaSelList(Event ev) {
PuntoVenta puntoVenta = (PuntoVenta) puntoVentaSelList.getSelected();
puntoVentaSelList.removeItem(puntoVenta);
}
public void onDoubleClick$puntoVentaList(Event ev) {
PuntoVenta puntoVenta = (PuntoVenta) puntoVentaList.getSelected();
puntoVentaSelList.addItemNovo(puntoVenta);
}
public void onClick$btnLimpar(Event ev) {
puntoVentaList.setData(new ArrayList<PuntoVenta>());
bbPesquisaPuntoVenta.setText("");
}
public void onClick$btnExecutarRelatorio(Event ev) throws Exception {
executarRelatorio();
}
@SuppressWarnings({ "rawtypes", "unchecked" })
private void executarRelatorio() throws Exception {
Relatorio relatorio;
Map<String, Object> parametros = new HashMap<String, Object>();
StringBuilder filtro = new StringBuilder();
filtro.append("Agência: ");
String puntoVentaIds = "";
String puntoVentas = "";
List<PuntoVenta> lsPuntoVentaSelecionados = new ArrayList(Arrays.asList(puntoVentaSelList.getData()));
if (lsPuntoVentaSelecionados.isEmpty()) {
puntoVentas = "Todas";
puntoVentaIds = "-1";
} else {
for (int i = 0; i < lsPuntoVentaSelecionados.size(); i++) {
PuntoVenta puntoVenta = lsPuntoVentaSelecionados.get(i);
puntoVentas = puntoVentas + puntoVenta.getNombpuntoventa() + ",";
puntoVentaIds = puntoVentaIds + puntoVenta.getPuntoventaId() + ",";
}
// removendo ultima virgulaUSU
puntoVentaIds = puntoVentaIds.substring(0, puntoVentaIds.length() - 1);
puntoVentas = puntoVentas.substring(0, puntoVentas.length() - 1);
}
filtro.append(puntoVentas).append(";");
parametros.put("DATA_INICIAL", (java.util.Date) this.datInicial.getValue());
parametros.put("DATA_FINAL", (java.util.Date) this.datFinal.getValue());
parametros.put("TITULO", Labels.getLabel("relatorioComissaoController.window.title"));
parametros.put("USUARIO", UsuarioLogado.getUsuarioLogado().getUsuarioId().toString());
parametros.put("NUMPUNTOVENTA", puntoVentaIds);
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;");
}
Connection connection = dataSourceRead.getConnection();
try {
parametros.put("FILTROS", filtro.toString());
relatorio = new RelatorioComissaoSintetico(parametros, connection);
Map args = new HashMap();
args.put("relatorio", relatorio);
openWindow("/component/reportView.zul",
Labels.getLabel("relatorioComissaoController.window.title"), args, MODAL);
} finally {
if ((connection != null) && !connection.isClosed()) {
connection.close();
}
}
}
public List<Empresa> getLsEmpresa() {
return lsEmpresa;
}
public void setLsEmpresa(List<Empresa> lsEmpresa) {
this.lsEmpresa = lsEmpresa;
}
public Radiogroup getRdGroupTipoRelatorio() {
return rdGroupTipoRelatorio;
}
public void setRdGroupTipoRelatorio(Radiogroup rdGroupTipoRelatorio) {
this.rdGroupTipoRelatorio = rdGroupTipoRelatorio;
}
}

View File

@ -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 ItemMenuRelatorioComissao extends DefaultItemMenuSistema {
public ItemMenuRelatorioComissao() {
super("indexController.mniRelatorioComissao.label");
}
@Override
public String getClaveMenu() {
return "COM.RJCONSULTORES.ADMINISTRACION.GUI.RELATORIOS.MENU.RELATORIOCOMISSAO";
}
@Override
public void ejecutar() {
PantallaUtileria.openWindow("/gui/relatorios/filtroRelatorioComissao.zul",
Labels.getLabel("relatorioComissaoController.window.title"), getArgs(), desktop);
}
}

View File

@ -211,6 +211,7 @@ analitico.gerenciais.estatisticos.encerramentocheckin=com.rjconsultores.ventabol
analitico.gerenciais.estatisticos.mmphDERPR=com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorios.ItemMenuRelatorioMmphDer
analitico.gerenciais.financeiro=com.rjconsultores.ventaboletos.web.utilerias.menu.item.analitico.gerenciais.financeiro.SubMenuRelatorioFinanceiro
analitico.gerenciais.financeiro.receitaDiariaAgencia=com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorios.ItemMenuRelatorioReceitaDiariaAgencia
analitico.gerenciais.financeiro.RelatorioComissao=com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorios.ItemMenuRelatorioComissao
analitico.gerenciais.financeiro.taxas=com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorios.ItemMenuRelatorioTaxasLinha
analitico.gerenciais.financeiro.ocd=com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorios.ItemMenuRelatorioOCD
analitico.gerenciais.financeiro.vendasBilheteiro=com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorios.ItemMenuRelatorioVendasBilheteiro

View File

@ -349,6 +349,7 @@ indexController.mniRelatorioGratuidade.label = Relatório Tipo Passagem
indexController.mniRelatorioGratuidadeANTT.label = Relatório Gratuidades ANTT
indexController.mniRelatorioGratuidadeAGR.label = Relatório Gratuidades AGR
indexController.mniRelatorioPassagensAGR.label = AGR Tickets Report
indexController.mniRelatorioComissao.label = Commission Report
indexController.mniRelatorioGratuidadeARTESP.label = Relatório Gratuidade ARTESP
indexController.mniRelatorioGratuidadeAGER.label = Relatório Gratuidade AGER
indexController.mniRelatorioPassagensAGER.label = Relatório Passagens AGER
@ -942,6 +943,20 @@ relatorioReceitaServicoController.lbEmpresa.value = Empresa
relatorioReceitaServicoController.lbClase.value = Classe
relatorioReceitaServicoController.lbServico.value = N. Serviço
#Relatorio Comissao
relatorioComissaoController.window.title = Commission Report
relatorioComissaoController.lbEmpresa.value = Company
relatorioComissaoController.lbNumero.value = Agency Number
relatorioComissaoController.lbAte.value = until
relatorioComissaoController.lbDatInicial.value = Start Date
relatorioComissaoController.lbDatFinal.value = End Date
relatorioComissaoController.lbTipoData.value = Date Type
relatorioComissaoController.lbTipoData.venda.value = Sales Date
relatorioComissaoController.lbPuntoVenta.value = Agency No.
relatorioComissaoController.lbPuntoVenta.value = Agency
relatorioComissaoController.lbTipoRelatorio.analitico.value=Analytical
relatorioComissaoController.lbTipoRelatorio.sintetico.value=Synthetic
#Relatorio de Diferencas de Transferencias
relatorioDiferencasTransferenciasController.window.title = Relatório de Diferenças em Transferências
relatorioDiferencasTransferenciasController.lbDePeriodoTransferencia.value = Data inicial

View File

@ -333,6 +333,7 @@ indexController.mniRelatorioGratuidade.label = Gratuidades
indexController.mniRelatorioGratuidadeANTT.label = Gratuidades ANTT
indexController.mniRelatorioGratuidadeAGR.label = Gratuidades AGR
indexController.mniRelatorioPassagensAGR.label = Relatório de Passagens AGR
indexController.mniRelatorioComissao.label = Relatório Comissão
indexController.mniRelatorioGratuidadeAGEPAN.label = Gratuidades AGEPAN
indexController.mniRelatorioExportacaoIdosoARTESP.label = Reporte Exportación Ancianos ARTESP
indexController.mniRelatorioGratuidadeIdosoDeficiente.label = Gratuidades Idoso/Deficiente
@ -823,6 +824,20 @@ relatorioReceitaServicoController.lbEmpresa.value = Empresa
relatorioReceitaServicoController.lbClase.value = Clase
relatorioReceitaServicoController.lbServico.value = N. Servicio
#Relatorio Comissao
relatorioComissaoController.window.title = Reporte de Comisión
relatorioComissaoController.lbEmpresa.value = Empresa
relatorioComissaoController.lbNumero.value = Número de Agencia
relatorioComissaoController.lbAte.value = hasta
relatorioComissaoController.lbDatInicial.value = Fecha Inicial
relatorioComissaoController.lbDatFinal.value = Fecha Final
relatorioComissaoController.lbTipoData.value = Tipo de Fecha
relatorioComissaoController.lbTipoData.venda.value = Fecha de Venta
relatorioComissaoController.lbPuntoVenta.value = N. de Agencia
relatorioComissaoController.lbPuntoVenta.value = Agencia
relatorioComissaoController.lbTipoRelatorio.analitico.value=Analítico
relatorioComissaoController.lbTipoRelatorio.sintetico.value=Sintético
#Relatorio de Diferencas de Transferencias
relatorioDiferencasTransferenciasController.window.title = Reporte de diferencias en transferencias
relatorioDiferencasTransferenciasController.lbDePeriodoTransferencia.value = Fecha inicial

View File

@ -350,6 +350,7 @@ indexController.mniRelatorioGratuidadeANTT.label = Relatório Gratuidades ANTT
indexController.mniRelatorioGratuidadeAGR.label = Relatório Gratuidades AGR
indexController.mniRelatorioPassagensAGR.label = Relatório Passagens AGR
indexController.mnSubMenuAGR.label=Relatório AGR
indexController.mniRelatorioComissao.label = Relatório Comissão
indexController.mniRelatorioGratuidadeARTESP.label = Relatório Gratuidade ARTESP
indexController.mniRelatorioGratuidadeAGER.label = Relatório Gratuidade AGER
indexController.mniRelatorioPassagensAGER.label = Relatório Passagens AGER
@ -942,6 +943,20 @@ relatorioReceitaServicoController.lbEmpresa.value = Empresa
relatorioReceitaServicoController.lbClase.value = Classe
relatorioReceitaServicoController.lbServico.value = N. Serviço
#Relatorio Comissao
relatorioComissaoController.window.title = Relatório Comissao
relatorioComissaoController.lbEmpresa.value = Empresa
relatorioComissaoController.lbNumero.value = Número Agência
relatorioComissaoController.lbAte.value = até
relatorioComissaoController.lbDatInicial.value = Data Inicial
relatorioComissaoController.lbDatFinal.value = Data Final
relatorioComissaoController.lbTipoData.value = Tipo de Data
relatorioComissaoController.lbTipoData.venda.value = Data Venda
relatorioComissaoController.lbPuntoVenta.value = N. Agência
relatorioComissaoController.lbPuntoVenta.value = Agência
relatorioComissaoController.lbTipoRelatorio.analitico.value=Analitico
relatorioComissaoController.lbTipoRelatorio.sintetico.value=Sintético
#Relatorio de Diferencas de Transferencias
relatorioDiferencasTransferenciasController.window.title = Relatório de Diferenças em Transferências
relatorioDiferencasTransferenciasController.lbDePeriodoTransferencia.value = Data inicial

View File

@ -0,0 +1,107 @@
<?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="winFiltroRelatorioW2I"?>
<?taglib uri="http://www.zkoss.org/dsp/web/core" prefix="c"?>
<zk xmlns="http://www.zkoss.org/2005/zul">
<window id="winFiltroRelatorioW2I" apply="${relatorioComissaoController}"
contentStyle="overflow:auto" width="800px" border="normal">
<grid fixedLayout="true">
<columns>
<column width="15%" />
<column width="35%" />
<column width="15%" />
<column width="35%" />
</columns>
<rows>
<row>
<label
value="${c:l('relatorioComissaoController.lbDatInicial.value')}" />
<datebox id="datInicial" width="95%"
use="com.rjconsultores.ventaboletos.web.utilerias.MyDatebox"
mold="rounded" lenient="true" constraint="no empty" />
<label
value="${c:l('relatorioComissaoController.lbDatFinal.value')}" />
<datebox id="datFinal" width="95%"
use="com.rjconsultores.ventaboletos.web.utilerias.MyDatebox"
mold="rounded" lenient="true" constraint="no empty" />
</row>
<row spans="1,1,2">
<cell rowspan="2" align="left">
<label
value="${c:l('relatorioComissaoController.lbEmpresa.value')}" />
</cell>
<cell rowspan="2" align="left">
<combobox id="cmbEmpresa" mold="rounded"
buttonVisible="true"
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar"
model="@{winFiltroRelatorioW2I$composer.lsEmpresa}" width="95%" />
</cell>
</row>
<row spans="1,3">
<label
value="${c:l('relatorioComissaoController.lbPuntoVenta.value')}" />
<bandbox id="bbPesquisaPuntoVenta" width="100%"
mold="rounded" readonly="true">
<bandpopup>
<vbox>
<hbox>
<label
value="${c:l('relatorioComissaoController.lbPuntoVenta.value')}" />
<textbox id="txtNombrePuntoVenta"
use="com.rjconsultores.ventaboletos.web.utilerias.MyTextbox"
width="300px" mold="rounded" />
<button id="btnPesquisa"
image="/gui/img/find.png"
label="${c:l('relatorioComissaoController.btnPesquisa.label')}" />
<button id="btnLimpar"
image="/gui/img/eraser.png"
label="${c:l('relatorioComissaoController.btnLimpar.label')}" />
</hbox>
<paging id="pagingPuntoVenta"
pageSize="10" />
<listbox id="puntoVentaList"
mold="paging"
use="com.rjconsultores.ventaboletos.web.utilerias.MyListbox"
vflex="true" height="100%" width="700px">
<listhead>
<listheader
label="${c:l('relatorioComissaoController.lbPuntoVenta.value')}" />
<listheader width="35%"
label="${c:l('relatorioComissaoController.lbEmpresa.value')}" />
<listheader width="20%"
label="${c:l('relatorioComissaoController.lbNumero.value')}" />
</listhead>
</listbox>
</vbox>
</bandpopup>
</bandbox>
</row>
<row spans="5">
<listbox id="puntoVentaSelList" mold="paging"
use="com.rjconsultores.ventaboletos.web.utilerias.MyListbox"
vflex="true" height="100px" width="100%">
<listhead>
<listheader
label="${c:l('relatorioComissaoController.lbPuntoVenta.value')}" />
<listheader width="35%"
label="${c:l('relatorioComissaoController.lbEmpresa.value')}" />
<listheader width="20%"
label="${c:l('relatorioComissaoController.lbNumero.value')}" />
<listheader width="5%" />
</listhead>
</listbox>
<paging id="pagingSelPuntoVenta" pageSize="10" />
</row>
</rows>
</grid>
<toolbar>
<button id="btnExecutarRelatorio" image="/gui/img/find.png"
label="${c:l('relatorio.lb.btnExecutarRelatorio')}" />
</toolbar>
</window>
</zk>