fixes bug#AL-3977

master
wallace.henrique 2024-03-12 22:28:55 -03:00
parent 45a42b66c0
commit bb10111a25
18 changed files with 739 additions and 24 deletions

View File

@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>br.com.rjconsultores</groupId>
<artifactId>ventaboletosadm</artifactId>
<version>1.55.11</version>
<version>1.56.0</version>
<packaging>war</packaging>
<properties>

View File

@ -192,6 +192,7 @@ public class RelatorioBilhetesVendidosEstoqueAgencia extends Relatorio {
sql.append(" em.nombEmpresa, AIT.DESCTIPO ");
sql.append(" )TB ");
sql.append(" ORDER BY to_number(TB.FOLIO) ");
System.out.println(sql.toString());
return sql.toString();

View File

@ -0,0 +1,291 @@
/**
*
*/
package com.rjconsultores.ventaboletos.relatorios.impl;
import java.math.BigDecimal;
import java.sql.Connection;
import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.rjconsultores.ventaboletos.relatorios.utilitarios.ArrayDataSource;
import com.rjconsultores.ventaboletos.relatorios.utilitarios.Relatorio;
import com.rjconsultores.ventaboletos.relatorios.utilitarios.RelatorioBilhetesVendidosEstoqueAgenciaBean;
import com.rjconsultores.ventaboletos.utilerias.DateUtil;
import com.rjconsultores.ventaboletos.web.utilerias.NamedParameterStatement;
import net.sf.jasperreports.engine.data.JRBeanCollectionDataSource;
/**
* @author Wallace
*
*/
public class RelatorioBilhetesVendidosEstoqueAgenciaNovoLayout extends Relatorio {
private List<RelatorioBilhetesVendidosEstoqueAgenciaBean> lsDadosRelatorio;
public RelatorioBilhetesVendidosEstoqueAgenciaNovoLayout(Map<String, Object> parametros, Connection conexao) throws Exception {
super(parametros, conexao);
this.setCustomDataSource(new ArrayDataSource(this) {
@SuppressWarnings("unused")
@Override
public void initDados() throws Exception {
Connection conexao = this.relatorio.getConexao();
Map<String, Object> parametros = this.relatorio.getParametros();
String pnutoVentasIds = (String) parametros.get("NUMPUNTOVENTA");
Integer empresa = (Integer) parametros.get("EMPRESA_ID");
Date datainicial = (Date) parametros.get("DATA_INICIAL");
Date dataFinal = (Date) parametros.get("DATA_FINAL");
Integer aidfTipoId = (Integer) parametros.get("AIDFTIPO_ID");
NamedParameterStatement stmt = new NamedParameterStatement(conexao, sql(pnutoVentasIds, aidfTipoId));
stmt.setInt("EMPRESA_ID", empresa);
stmt.setString("dataInicio", DateUtil.getStringDate(datainicial, "dd/MM/yyyy") + " 00:00:00");
stmt.setString("dataFinal", DateUtil.getStringDate(dataFinal, "dd/MM/yyyy") + " 23:59:59");
if(aidfTipoId != null) {
stmt.setInt("aidfTipo",aidfTipoId);
}
ResultSet rset = stmt.executeQuery();
List<RelatorioBilhetesVendidosEstoqueAgenciaBean> lsTemp = new ArrayList<>();
List<RelatorioBilhetesVendidosEstoqueAgenciaBean> lsRelatorioBilhetesVendidosEstoqueAgenciaBean = new ArrayList<>();
List<RelatorioBilhetesVendidosEstoqueAgenciaBean> lsRelatorioBilhetesVendidosEstoqueAgenciaBeanGeradoSequencia = new ArrayList<>();
while (rset.next()) {
Map<String, Object> dataResult = new HashMap<String, Object>();
RelatorioBilhetesVendidosEstoqueAgenciaBean bean = new RelatorioBilhetesVendidosEstoqueAgenciaBean();
bean.setAidfId(rset.getInt("aidfId"));
bean.setNombpuntoventa(rset.getString("descpuntoVenta"));
bean.setSerie(rset.getString("serie"));
bean.setFechorVenta(DateUtil.getDateFromString(rset.getString("dataVenda"), "ddMMyyyy"));
bean.setChave(rset.getString("chave"));
bean.setFolio(rset.getString("folio"));
bean.setNomeEmpresa(rset.getString("nomeEmpresa"));
bean.setTipoEvento(rset.getString("tipoAidf"));
bean.setValorContabil((BigDecimal)rset.getObject("valorContabil"));
bean.setOrigem(rset.getString("origem"));
bean.setDestino(rset.getString("destino"));
bean.setEstado(rset.getString("estado"));
lsRelatorioBilhetesVendidosEstoqueAgenciaBean.add(bean);
this.dados.add(dataResult);
}
this.resultSet = rset;
setLsDadosRelatorio(lsRelatorioBilhetesVendidosEstoqueAgenciaBean);
}
});
}
public void setLsDadosRelatorio(List<RelatorioBilhetesVendidosEstoqueAgenciaBean> lsDadosRelatorio) {
this.setCollectionDataSource(new JRBeanCollectionDataSource(lsDadosRelatorio));
this.lsDadosRelatorio = lsDadosRelatorio;
}
public List<RelatorioBilhetesVendidosEstoqueAgenciaBean> getLsDadosRelatorio() {
return lsDadosRelatorio;
}
private String sql(String puntoVentasId, Integer aidfTipoId) {
StringBuilder sql = new StringBuilder();
sql.append(" SELECT TB.aidfId AS aidfId, ");
sql.append(" TB.descpuntoVenta AS descpuntoVenta, ");
sql.append(" TB.SERIE AS serie, ");
sql.append(" TB.puntoventaId, ");
sql.append(" TB.dataVenda AS dataVenda, ");
sql.append(" TB.chave AS chave, ");
sql.append(" TB.nomeEmpresa AS nomeEmpresa, ");
sql.append(" TB.folio AS folio, ");
sql.append(" TB.tipoAidf AS tipoAidf, ");
sql.append(" tb.VALOR AS valorContabil, ");
sql.append(" tb.origen as origem, ");
sql.append(" tb.destino as destino, ");
sql.append(" tb.estado as estado ");
sql.append(" FROM ");
sql.append(" (SELECT DAB.AIDF_ID AS aidfId, ");
sql.append(" pv.nombpuntoventa AS descpuntoVenta, ");
sql.append(" c.numseriepreimpresa AS SERIE, ");
sql.append(" c.puntoventa_id AS puntoventaId, ");
sql.append(" to_char(c.fechorventa, 'ddMMyyyy') AS dataVenda,");
sql.append(" DAB.AIDF_ID || c.numseriepreimpresa || c.puntoventa_id || to_char(c.fechorventa, 'ddMMyyyy') AS chave, ");
sql.append(" em.nombEmpresa AS nomeEmpresa, ");
sql.append(" c.numfoliopreimpreso AS folio, ");
sql.append(" AIT.DESCTIPO tipoAidf,");
sql.append(" COALESCE(COALESCE(c.PRECIOPAGADO, 0) + COALESCE(c.IMPORTETAXAEMBARQUE, 0) + COALESCE(c.IMPORTESEGURO, 0) + COALESCE(c.IMPORTEPEDAGIO, 0) + COALESCE(c.IMPORTEOUTROS, 0), 0) AS VALOR, ");
sql.append(" po.descparada AS origen, ");
sql.append(" pd.descparada AS destino, est.nombestado as estado ");
sql.append(" FROM caja c, ");
sql.append(" PUNTO_VENTA PV, ");
sql.append(" EMPRESA EM, ");
sql.append(" parada po, ");
sql.append(" ciudad co, ");
sql.append(" parada pd, ");
sql.append(" ciudad cd, ");
sql.append(" estado est, ");
sql.append(" AIDF_TIPO AIT, ");
sql.append(" AIDF AI, ");
sql.append(" ABASTO_BOLETO AB ");
sql.append(" LEFT JOIN DET_ABASTO_BOLETO DAB ON (AB.ABASTOBOLETO_ID = DAB.ABASTOBOLETO_ID) ");
sql.append(" WHERE fechorventa BETWEEN TO_DATE(:dataInicio,'dd/mm/yyyy hh24:mi:ss') AND TO_DATE(:dataFinal,'dd/mm/yyyy hh24:mi:ss') ");
sql.append(" AND TO_NUMBER(c.NUMFOLIOPREIMPRESO) BETWEEN TO_NUMBER(DAB.NUMFOLIOINICIAL) AND TO_NUMBER(DAB.NUMFOLIOFINAL) ");
sql.append(" AND c.PUNTOVENTA_ID = AB.PUNTOVENTA_ID ");
if (puntoVentasId != null && !puntoVentasId.equals("-1")) {
sql.append(" AND c.PUNTOVENTA_ID in (" + puntoVentasId + ") ");
}
sql.append(" AND EM.EMPRESA_ID = AB.EMPRESA_ID ");
sql.append(" AND c.PUNTOVENTA_ID = PV.PUNTOVENTA_ID ");
sql.append(" AND DAB.AIDF_ID = AI.AIDF_ID ");
sql.append(" AND AIT.AIDFTIPO_ID = AI.AIDFTIPO_ID ");
sql.append(" AND EM.EMPRESA_ID =:EMPRESA_ID ");
sql.append(" AND po.parada_id = c.origen_id ");
sql.append(" AND co.ciudad_id = po.ciudad_id ");
sql.append(" AND pd.parada_id = c.destino_id ");
sql.append(" AND cd.ciudad_id = pd.ciudad_id ");
sql.append(" AND est.estado_id = co.estado_id ");
sql.append(" and c.INDSTATUSBOLETO = 'V' AND c.MOTIVOCANCELACION_ID IS NULL ");
sql.append(" AND EM.EMPRESA_ID =:EMPRESA_ID ");
sql.append(" GROUP BY DAB.AIDF_ID, ");
sql.append(" c.numseriepreimpresa, ");
sql.append(" c.numfoliopreimpreso, ");
sql.append(" c.puntoventa_id, ");
sql.append(" to_char(c.fechorventa, 'ddMMyyyy'), ");
sql.append(" pv.nombpuntoventa, ");
sql.append(" em.nombEmpresa, ");
sql.append(" AIT.DESCTIPO, ");
sql.append(" c.preciopagado, ");
sql.append(" c.IMPORTETAXAEMBARQUE, ");
sql.append(" c.IMPORTESEGURO, ");
sql.append(" c.importepedagio, ");
sql.append(" c.IMPORTEOUTROS, ");
sql.append(" po.descparada, ");
sql.append(" pd.descparada, est.nombestado ");
sql.append(" UNION ALL SELECT DAB.AIDF_ID AS aidfId, ");
sql.append(" pv.nombpuntoventa AS descpuntoVenta, ");
sql.append(" c.numseriepreimpresa AS SERIE, ");
sql.append(" c.puntoventa_id AS puntoventaId, ");
sql.append(" to_char(c.FECHORVTA, 'ddMMyyyy') AS dataVenda, ");
sql.append(" DAB.AIDF_ID || c.numseriepreimpresa || c.puntoventa_id || to_char(c.FECHORVTA, 'ddMMyyyy') AS chave, ");
sql.append(" em.nombEmpresa AS nomeEmpresa, ");
sql.append(" c.numfoliopreimpreso AS folio,");
sql.append(" AIT.DESCTIPO tipoAidf, ");
sql.append(" c.PRECIO, ");
sql.append(" ' ' AS origen, ");
sql.append(" ' ' AS desgtino, ");
sql.append(" ' ' AS estado ");
sql.append(" FROM caja_diversos c, ");
sql.append(" PUNTO_VENTA PV, ");
sql.append(" EMPRESA EM, ");
sql.append(" AIDF AI, ");
sql.append(" AIDF_TIPO AIT, ");
sql.append(" ABASTO_BOLETO AB ");
sql.append(" LEFT JOIN DET_ABASTO_BOLETO DAB ON (AB.ABASTOBOLETO_ID = DAB.ABASTOBOLETO_ID) ");
sql.append(" WHERE FECHORVTA BETWEEN TO_DATE(:dataInicio,'dd/mm/yyyy hh24:mi:ss') AND TO_DATE(:dataFinal,'dd/mm/yyyy hh24:mi:ss') ");
sql.append(" AND TO_NUMBER(c.NUMFOLIOPREIMPRESO) BETWEEN TO_NUMBER(DAB.NUMFOLIOINICIAL) AND TO_NUMBER(DAB.NUMFOLIOFINAL) ");
sql.append(" AND c.PUNTOVENTA_ID = AB.PUNTOVENTA_ID ");
if (puntoVentasId != null && !puntoVentasId.equals("-1")) {
sql.append(" AND c.PUNTOVENTA_ID in (" + puntoVentasId + ") ");
}
sql.append(" AND EM.EMPRESA_ID = AB.EMPRESA_ID ");
sql.append(" AND c.PUNTOVENTA_ID = PV.PUNTOVENTA_ID ");
sql.append(" AND DAB.AIDF_ID = AI.AIDF_ID ");
sql.append(aidfTipoId != null ? " AND (AI.AIDFTIPO_ID =:aidfTipo AND AIT.AIDFTIPO_ID = AI.AIDFTIPO_ID) " : " AND AIT.AIDFTIPO_ID = AI.AIDFTIPO_ID ");
sql.append(" AND EM.EMPRESA_ID =:EMPRESA_ID ");
sql.append(" GROUP BY DAB.AIDF_ID, ");
sql.append(" c.numseriepreimpresa, ");
sql.append(" c.numfoliopreimpreso, ");
sql.append(" c.puntoventa_id, ");
sql.append(" to_char(c.FECHORVTA, 'ddMMyyyy'), ");
sql.append(" pv.nombpuntoventa, ");
sql.append(" em.nombEmpresa, ");
sql.append(" AIT.DESCTIPO, ");
sql.append(" c.PRECIO)TB ");
sql.append(" ORDER BY to_number(TB.FOLIO) ");
return sql.toString();
}
private List<RelatorioBilhetesVendidosEstoqueAgenciaBean> agruparSequenciasBilhetes(List<RelatorioBilhetesVendidosEstoqueAgenciaBean> lista) {
int[] bilhetesInt = new int[lista.size()];
int i = 0;
for (RelatorioBilhetesVendidosEstoqueAgenciaBean relatorioBilhetesVendidosEstoqueAgenciaBean : lista) {
bilhetesInt[i] = Integer.parseInt(relatorioBilhetesVendidosEstoqueAgenciaBean.getFolio());
i++;
}
Arrays.sort(bilhetesInt);
List<RelatorioBilhetesVendidosEstoqueAgenciaBean> listaAgrupada = new ArrayList<>();
RelatorioBilhetesVendidosEstoqueAgenciaBean bean = lista.get(0);
bilhetesInt = reajustarPosicaoArray(bilhetesInt.length, bilhetesInt, bilhetesInt[0], 1);
int inicio = bilhetesInt[0];
int fim = bilhetesInt.length == 1 ? bilhetesInt[0] : bilhetesInt[1];
BigDecimal valorContabil = BigDecimal.ZERO;
for (int j = 2; j < bilhetesInt.length; ++j) {
if (fim + 1 == bilhetesInt[j]) {
fim++;
} else {
listaAgrupada.add(gerarAgrupamento(inicio, fim, new RelatorioBilhetesVendidosEstoqueAgenciaBean(bean)));
inicio = bilhetesInt[j];
fim = bilhetesInt[j];
}
}
listaAgrupada.add(gerarAgrupamento(inicio, fim, bean));
return listaAgrupada;
}
private RelatorioBilhetesVendidosEstoqueAgenciaBean gerarAgrupamento(int inicio, int fim, RelatorioBilhetesVendidosEstoqueAgenciaBean bean) {
RelatorioBilhetesVendidosEstoqueAgenciaBean object = new RelatorioBilhetesVendidosEstoqueAgenciaBean(bean);
if (inicio != fim) {
object.setQuantidade((fim-inicio+1));
object.setFolioInicial(inicio);
object.setFolioFinal(fim);
} else {
object.setQuantidade(1);
object.setFolioInicial(inicio);
object.setFolioFinal(inicio);
}
return object;
}
private int[] reajustarPosicaoArray(int numero, int arr[],int x, int posicao)
{
int novoArray[] = new int[numero + 1];
for (int i = 0; i < numero + 1; i++) {
if (i < posicao - 1)
novoArray[i] = arr[i];
else if (i == posicao - 1)
novoArray[i] = x;
else
novoArray[i] = arr[i - 1];
}
return novoArray;
}
@Override
protected void processaParametros() throws Exception {
}
}

View File

@ -35,6 +35,7 @@ public class RelatorioEstoque extends Relatorio {
Date dtInicio = (Date) parametros.get("DATA_INICIO");
Date dtFim = (Date) parametros.get("DATA_FIM");
Integer aidfTipoId = (Integer) parametros.get("AIDFTIPO_ID");
Integer aidfId = (Integer) parametros.get("AIDF_ID");
if (parametros.get("EMPRESA_ID") != null) {
empresaId = Integer.valueOf(parametros.get("EMPRESA_ID").toString());
@ -42,7 +43,7 @@ public class RelatorioEstoque extends Relatorio {
if (parametros.get("NUMPUNTOVENTA") != null) {
puntoVentaId = String.valueOf(parametros.get("NUMPUNTOVENTA"));
}
String sql = retornarItensConsultaPorPuloFolio(puntoVentaId,empresaId, dtInicio, dtFim, aidfTipoId);
String sql = retornarItensConsultaPorPuloFolio(puntoVentaId,empresaId, dtInicio, dtFim, aidfTipoId, aidfId);
NamedParameterStatement stmt = new NamedParameterStatement(conexao, sql);
if(dtInicio != null && dtFim != null) {
stmt.setString("dataInicio", DateUtil.getStringDate(dtInicio, "dd/MM/yyyy") + " 00:00:00");
@ -53,6 +54,9 @@ public class RelatorioEstoque extends Relatorio {
if(aidfTipoId != null) {
stmt.setInt("aidfTipo",aidfTipoId);
}
if(aidfId != null) {
stmt.setInt("aidfId",aidfId);
}
lsDadosRelatorio = new ArrayList<ItemReporteControleEstoqueBoletos>();
ResultSet rset = null;
@ -81,7 +85,7 @@ public class RelatorioEstoque extends Relatorio {
this.resultSet = rset;
String sqlretornEstoque = sQLretornarEstoque(puntoVentaId, dtInicio, dtFim,empresaId, aidfTipoId);
String sqlretornEstoque = sQLretornarEstoque(puntoVentaId, dtInicio, dtFim,empresaId, aidfTipoId, aidfId);
NamedParameterStatement stmt2 = new NamedParameterStatement(conexao, sqlretornEstoque);
@ -94,6 +98,9 @@ public class RelatorioEstoque extends Relatorio {
if(aidfTipoId != null) {
stmt2.setInt("aidfTipo",aidfTipoId);
}
if(aidfId != null) {
stmt2.setInt("aidfId",aidfId);
}
ResultSet rset2 = null;
rset2 = stmt2.executeQuery();
@ -143,6 +150,7 @@ public class RelatorioEstoque extends Relatorio {
for (ItemReporteControleEstoqueBoletos itemEstoque : lsEstoque) {
if(!lsTempRetornoAux.contains(itemEstoque)) {
itemEstoque.setQuantidade(calcularQuantidade(itemEstoque.getFolioInicial(), itemEstoque.getFolioFinal()));
lsTempRetornoAux.add(itemEstoque);
}
}
@ -172,7 +180,7 @@ public class RelatorioEstoque extends Relatorio {
private String retornarItensConsultaPorPuloFolio(String puntoVentaId, Integer empresaId, Date dataInicio, Date dataFim, Integer aidfTipo) {
private String retornarItensConsultaPorPuloFolio(String puntoVentaId, Integer empresaId, Date dataInicio, Date dataFim, Integer aidfTipo, Integer aidfId) {
StringBuilder sb = new StringBuilder();
@ -246,7 +254,7 @@ public class RelatorioEstoque extends Relatorio {
sb.append(" AND A.ARTICULO_ID = AB.ARTICULO_ID ");
sb.append(" AND EM.EMPRESA_ID = AB.EMPRESA_ID ");
sb.append(" AND M.EMPRESA_ID = EM.EMPRESA_ID ");
sb.append(" AND M.ACTIVO = 1 AND DAB.AIDF_ID = AI.AIDF_ID ");
sb.append(" AND M.ACTIVO = 1 ");
sb.append(" AND CJ.USUARIO_ID = U.USUARIO_ID ");
sb.append(" AND (CJ.INDREIMPRESION = 0 ");
sb.append(" OR (CJ.INDREIMPRESION = 1 ");
@ -255,6 +263,7 @@ public class RelatorioEstoque extends Relatorio {
sb.append(" AND DAB.ACTIVO = 1 ");
sb.append(" AND AB.activo =1 AND AI.activo = 1 and est.estado_id = ai.ESTADO_ID ");
sb.append(aidfTipo != null ? " AND (AI.AIDFTIPO_ID =:aidfTipo AND AIT.AIDFTIPO_ID = AI.AIDFTIPO_ID) " : " AND AIT.AIDFTIPO_ID = AI.AIDFTIPO_ID ");
sb.append(aidfId != null ? " AND (AI.AIDF_ID =:aidfId AND DAB.AIDF_ID = AI.AIDF_ID) " : " AND DAB.AIDF_ID = AI.AIDF_ID ");
sb.append(" GROUP BY DAB.AIDF_ID, ");
sb.append(" DAB.NUMSERIEPREIMPRESA, ");
sb.append(" CJ.NUMFOLIOPREIMPRESO, ");
@ -326,12 +335,13 @@ public class RelatorioEstoque extends Relatorio {
sb.append(" AND A.ARTICULO_ID = AB.ARTICULO_ID ");
sb.append(" AND EM.EMPRESA_ID = AB.EMPRESA_ID ");
sb.append(" AND M.EMPRESA_ID = EM.EMPRESA_ID ");
sb.append(" AND M.ACTIVO = 1 AND DAB.AIDF_ID = AI.AIDF_ID ");
sb.append(" AND M.ACTIVO = 1 ");
sb.append(" AND CJ.USUARIO_ID = U.USUARIO_ID ");
sb.append(" AND CJ.PUNTOVENTA_ID = PV.PUNTOVENTA_ID ");
sb.append(" AND DAB.ACTIVO = 1 ");
sb.append(" AND AB.activo =1 AND AI.activo = 1 and est.estado_id = ai.ESTADO_ID ");
sb.append(aidfTipo != null ? " AND (AI.AIDFTIPO_ID =:aidfTipo AND AIT.AIDFTIPO_ID = AI.AIDFTIPO_ID) " : " AND AIT.AIDFTIPO_ID = AI.AIDFTIPO_ID ");
sb.append(aidfId != null ? " AND (AI.AIDF_ID =:aidfId AND DAB.AIDF_ID = AI.AIDF_ID) " : " AND DAB.AIDF_ID = AI.AIDF_ID ");
sb.append(" GROUP BY DAB.AIDF_ID, ");
sb.append(" DAB.NUMSERIEPREIMPRESA, ");
sb.append(" CJ.NUMFOLIOPREIMPRESO, ");
@ -351,11 +361,13 @@ public class RelatorioEstoque extends Relatorio {
sb.append(" ORDER BY TB.aidfId, ");
sb.append(" TB.serie, ");
sb.append(" TB.folioCaja ");
System.out.println(sb.toString());
return sb.toString();
}
private String sQLretornarEstoque(String puntoVentaId, Date dataInicio, Date dataFim, Integer empresaId, Integer aidfTipo) {
private String sQLretornarEstoque(String puntoVentaId, Date dataInicio, Date dataFim, Integer empresaId, Integer aidfTipo, Integer aidfId) {
StringBuilder queryString = new StringBuilder("SELECT DISTINCT to_date(to_char(ai.fecvencimiento, 'dd/MM/yyyy'), 'dd/MM/yyyy') as fecVencimento, to_date(to_char(AI.fecadquisicion, 'dd/MM/yyyy'), 'dd/MM/yyyy') as fechorAquisicion, ")
.append("dab.NUMSERIEPREIMPRESA as serie, ")
@ -413,7 +425,8 @@ public class RelatorioEstoque extends Relatorio {
.append("AND dab.ACTIVO = 1 ")
.append(" and dab.NUMFOLIOFINAL < 2147483647 ")
.append(" AND DAB.AIDF_ID = AI.AIDF_ID and ai.activo = 1 ")
.append(aidfTipo != null ? " AND AI.AIDFTIPO_ID = :aidfTipo " : " ");
.append(aidfTipo != null ? " AND AI.AIDFTIPO_ID = :aidfTipo " : " ")
.append(aidfId != null ? " AND AI.AIDF_ID = :aidfId " : " ");
@ -472,6 +485,7 @@ public class RelatorioEstoque extends Relatorio {
ItemReporteStockBoletos.setFolioInicial(String.valueOf(a[i - length]));
ItemReporteStockBoletos.setFolioAtual(String.valueOf(a[i - length]));
ItemReporteStockBoletos.setFolioFinal(String.valueOf(a[i - length]));
ItemReporteStockBoletos.setQuantidade(calcularQuantidade(ItemReporteStockBoletos.getFolioInicial(), ItemReporteStockBoletos.getFolioFinal()));
list.add(ItemReporteStockBoletos);
}
}
@ -480,6 +494,7 @@ public class RelatorioEstoque extends Relatorio {
ItemReporteStockBoletos.setFolioInicial(String.valueOf(a[i - length]));
ItemReporteStockBoletos.setFolioAtual(String.valueOf(a[i - length]));
ItemReporteStockBoletos.setFolioFinal(String.valueOf(a[i - 1]));
ItemReporteStockBoletos.setQuantidade(calcularQuantidade(ItemReporteStockBoletos.getFolioInicial(), ItemReporteStockBoletos.getFolioFinal()));
list.add(ItemReporteStockBoletos);
}
length = 1;
@ -492,6 +507,14 @@ public class RelatorioEstoque extends Relatorio {
return list;
}
private Integer calcularQuantidade(String folioInicial, String folioFinal) {
Integer folioInicialInt = Integer.valueOf(folioInicial);
Integer folioFinalInt = Integer.valueOf(folioFinal);
return folioInicialInt == folioFinalInt ? 1 : (folioFinalInt - folioInicialInt);
}
private int[] recuperarOsFaltantes(List<ItemReporteControleEstoqueBoletos> listEstoque) {
int arrayTemp[] = null;
ItemReporteControleEstoqueBoletos item = new ItemReporteControleEstoqueBoletos();

View File

@ -0,0 +1,20 @@
#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=Impressor por:
cabecalho.pagina=Página
cabecalho.de=de
cabecalho.filtros=Filtros:
#Labels header
label.aidf=AIDF
label.empresa=Empresa
label.agencia=Agencia
label.serie=Serie
label.bilhete=Bilhetes
label.numeracao=Numeração

View File

@ -0,0 +1,20 @@
#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=Impressor por:
cabecalho.pagina=Página
cabecalho.de=de
cabecalho.filtros=Filtros:
#Labels header
label.aidf=AIDF
label.empresa=Empresa
label.agencia=Agencia
label.serie=Serie
label.bilhete=Bilhetes
label.numeracao=Numeração

View File

@ -0,0 +1,264 @@
<?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="RelatorioEstoque" pageWidth="842" pageHeight="595" orientation="Landscape" whenNoDataType="NoDataSection" columnWidth="802" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" resourceBundle="/ventaboletosadm/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioBilhetesVendidosEstoqueAgencia_pt_BR" uuid="c092ef85-9334-4225-93d7-1acb7cf4d021">
<property name="ireport.zoom" value="2.8531167061100313"/>
<property name="ireport.x" value="460"/>
<property name="ireport.y" value="136"/>
<property name="net.sf.jasperreports.export.xls.exclude.origin.keep.first.band.2" value="pageHeader"/>
<property name="net.sf.jasperreports.export.xls.exclude.origin.keep.first.band.1" value="columnHeader"/>
<parameter name="NOME_RELATORIO" class="java.lang.String"/>
<parameter name="DATA_INICIAL" class="java.util.Date"/>
<parameter name="DATA_FINAL" class="java.util.Date"/>
<parameter name="USUARIO" class="java.lang.String"/>
<parameter name="FILTROS" class="java.lang.String"/>
<queryString>
<![CDATA[]]>
</queryString>
<field name="aidfId" class="java.lang.Integer"/>
<field name="nomeEmpresa" class="java.lang.String"/>
<field name="nombpuntoventa" class="java.lang.String"/>
<field name="serie" class="java.lang.String"/>
<field name="folio" class="java.lang.String"/>
<field name="folioFinal" class="java.lang.Integer"/>
<field name="tipoEvento" class="java.lang.String"/>
<field name="quantidade" class="java.lang.Integer"/>
<field name="fechorVenta" class="java.util.Date"/>
<field name="origem" class="java.lang.String"/>
<field name="destino" class="java.lang.String"/>
<field name="valorContabil" class="java.math.BigDecimal"/>
<field name="estado" class="java.lang.String"/>
<background>
<band splitType="Stretch"/>
</background>
<pageHeader>
<band height="82" splitType="Stretch">
<textField pattern="" isBlankWhenNull="false">
<reportElement mode="Transparent" x="0" y="0" width="457" height="41" forecolor="#000000" backcolor="#FFFFFF" uuid="136a5066-d141-4362-af36-0780f0d16542"/>
<textElement textAlignment="Left" verticalAlignment="Top" rotation="None" markup="none">
<font fontName="SansSerif" size="14" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/>
</textElement>
<textFieldExpression><![CDATA[$P{NOME_RELATORIO}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="513" y="0" width="185" height="25" uuid="a9d471fb-1e1d-4d9a-9783-bbf988931192"/>
<textElement textAlignment="Right">
<font size="9" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$R{cabecalho.dataHora}]]></textFieldExpression>
</textField>
<textField pattern="dd/MM/yyyy HH:mm" isBlankWhenNull="false">
<reportElement mode="Transparent" x="698" y="0" width="104" height="25" forecolor="#000000" backcolor="#FFFFFF" uuid="0d200750-aabf-4c7e-b27b-c0e7af4802a9"/>
<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[new java.util.Date()]]></textFieldExpression>
</textField>
<line>
<reportElement x="0" y="57" width="802" height="1" uuid="bbf33a72-515f-42fc-8c79-e859aebca31d"/>
</line>
<textField pattern="" isBlankWhenNull="false">
<reportElement mode="Transparent" x="513" y="25" width="267" height="16" forecolor="#000000" backcolor="#FFFFFF" uuid="bae9bec6-8c42-4bee-a070-34b0a7f1aee4"/>
<textElement textAlignment="Right" verticalAlignment="Top" rotation="None" markup="none">
<font fontName="SansSerif" size="9" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/>
</textElement>
<textFieldExpression><![CDATA[$R{cabecalho.pagina}+" "+$V{PAGE_NUMBER}+" "+$R{cabecalho.de}]]></textFieldExpression>
</textField>
<textField evaluationTime="Report" pattern="" isBlankWhenNull="false">
<reportElement mode="Transparent" x="781" y="25" width="21" height="16" forecolor="#000000" backcolor="#FFFFFF" uuid="314e312c-8f24-42de-8354-3c1f7241a985"/>
<textElement textAlignment="Center" 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[$V{PAGE_NUMBER}]]></textFieldExpression>
</textField>
<textField pattern="" isBlankWhenNull="false">
<reportElement mode="Transparent" x="698" y="42" width="104" height="15" forecolor="#000000" backcolor="#FFFFFF" uuid="4e030613-9cee-443e-9eaa-b19fa3090976"/>
<textElement textAlignment="Right" verticalAlignment="Top" rotation="None" markup="none">
<font fontName="SansSerif" size="10" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/>
</textElement>
<textFieldExpression><![CDATA[$R{cabecalho.impressorPor}+" "+$P{USUARIO}]]></textFieldExpression>
</textField>
<line>
<reportElement x="0" y="77" width="802" height="1" uuid="6ca45088-a58d-43b3-b196-8fc26e128fbf"/>
</line>
<textField>
<reportElement x="0" y="58" width="803" height="15" uuid="b29d0494-2695-420b-bdc1-b13c08bdbcda"/>
<textElement verticalAlignment="Middle">
<font size="10"/>
</textElement>
<textFieldExpression><![CDATA[$P{FILTROS}]]></textFieldExpression>
</textField>
</band>
</pageHeader>
<columnHeader>
<band height="35" splitType="Stretch">
<line>
<reportElement x="1" y="34" width="801" height="1" uuid="a11636cc-5ee1-44cc-8cd1-cbe2ebc47abb"/>
</line>
<staticText>
<reportElement x="162" y="16" width="92" height="17" uuid="d60cb698-201c-4315-bec2-498effeea474"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="10" isBold="true"/>
</textElement>
<text><![CDATA[Agência]]></text>
</staticText>
<staticText>
<reportElement x="436" y="16" width="57" height="17" uuid="a26b9060-8bd5-4586-af31-e01b0ccf88f9"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="10" isBold="true"/>
</textElement>
<text><![CDATA[Folio]]></text>
</staticText>
<staticText>
<reportElement x="687" y="16" width="115" height="17" uuid="fcf366c0-0f13-44f7-84de-38ae1122b647"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="10" isBold="true"/>
</textElement>
<text><![CDATA[Tipo Aidf]]></text>
</staticText>
<staticText>
<reportElement x="1" y="16" width="101" height="17" uuid="6db7e341-bc01-4843-8be5-fe74d78b7529"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="10" isBold="true"/>
</textElement>
<text><![CDATA[UF]]></text>
</staticText>
<staticText>
<reportElement x="632" y="16" width="55" height="17" uuid="ed0c0a45-151a-400e-a30c-fd8afa88438b"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="10" isBold="true"/>
</textElement>
<text><![CDATA[AIDF]]></text>
</staticText>
<staticText>
<reportElement x="493" y="16" width="62" height="17" uuid="0bc3df3b-544b-4e68-ace9-f725d4541781"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="10" isBold="true"/>
</textElement>
<text><![CDATA[Série]]></text>
</staticText>
<staticText>
<reportElement x="102" y="16" width="60" height="17" uuid="8ad497bf-a305-41d2-a412-40dd3a7d6b88"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="10" isBold="true"/>
</textElement>
<text><![CDATA[Data Venda ]]></text>
</staticText>
<staticText>
<reportElement x="254" y="16" width="93" height="17" uuid="39b986a4-6fb1-4f49-86ce-f0a13c174351"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="10" isBold="true"/>
</textElement>
<text><![CDATA[Origem]]></text>
</staticText>
<staticText>
<reportElement x="347" y="16" width="89" height="17" uuid="19e0e087-f6cd-488e-843b-6571dc2f9061"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="10" isBold="true"/>
</textElement>
<text><![CDATA[Destino]]></text>
</staticText>
<staticText>
<reportElement x="555" y="16" width="77" height="17" uuid="30b69c31-208d-4815-bc97-85149e5a7ba0"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="10" isBold="true"/>
</textElement>
<text><![CDATA[Valor Contábil]]></text>
</staticText>
</band>
</columnHeader>
<detail>
<band height="22" splitType="Stretch">
<textField>
<reportElement x="162" y="2" width="92" height="18" uuid="c35afacb-b160-4ace-b7be-c2e2f54ac1c0"/>
<textElement textAlignment="Center">
<font size="8" isBold="false" isItalic="false"/>
</textElement>
<textFieldExpression><![CDATA[$F{nombpuntoventa}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true">
<reportElement mode="Transparent" x="436" y="2" width="57" height="18" forecolor="#000000" backcolor="#FFFFFF" uuid="3dbaaef7-dae9-402d-89d4-a8055462f563"/>
<textElement textAlignment="Center" verticalAlignment="Top" rotation="None" markup="none">
<font fontName="SansSerif" size="8" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/>
</textElement>
<textFieldExpression><![CDATA[$F{folio}]]></textFieldExpression>
</textField>
<textField isBlankWhenNull="true">
<reportElement x="1" y="2" width="101" height="18" uuid="73582b2a-b21b-4637-990c-aff7423a8e27"/>
<textElement textAlignment="Center">
<font size="8" isBold="false" isItalic="false"/>
</textElement>
<textFieldExpression><![CDATA[$F{estado}]]></textFieldExpression>
</textField>
<textField pattern="">
<reportElement x="632" y="2" width="55" height="18" uuid="bfb9d635-bbc1-4e92-890a-df8299bc8daa"/>
<textElement textAlignment="Center">
<font size="8" isBold="false" isItalic="false"/>
</textElement>
<textFieldExpression><![CDATA[$F{aidfId}]]></textFieldExpression>
</textField>
<textField pattern="dd/MM/yyyy" isBlankWhenNull="true">
<reportElement x="102" y="2" width="60" height="18" uuid="efb76809-2760-4e07-abd7-182d252318a0"/>
<textElement textAlignment="Center">
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$F{fechorVenta}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="dd/MM/yyyy" isBlankWhenNull="true">
<reportElement mode="Transparent" x="493" y="2" width="62" height="18" forecolor="#000000" backcolor="#FFFFFF" uuid="29ae3fa8-9db1-46c8-bcf7-cb9aa7bc6eb3"/>
<textElement textAlignment="Center" verticalAlignment="Top" rotation="None" markup="none">
<font fontName="SansSerif" size="8" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/>
</textElement>
<textFieldExpression><![CDATA[$F{serie}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="687" y="2" width="115" height="18" uuid="f1e52aa0-f61d-4c94-bb09-e51cde37f2cc"/>
<textElement textAlignment="Center">
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$F{tipoEvento}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="254" y="2" width="93" height="18" uuid="61695f96-821f-4b4d-ac86-5472eaefa0c4"/>
<textElement textAlignment="Center">
<font size="8" isBold="false" isItalic="false"/>
</textElement>
<textFieldExpression><![CDATA[$F{origem}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="¤ #,##0.00" isBlankWhenNull="true">
<reportElement mode="Transparent" x="555" y="2" width="62" height="18" forecolor="#000000" backcolor="#FFFFFF" uuid="b199a47a-408e-4011-8c28-f3782c664e8f"/>
<textElement textAlignment="Center" verticalAlignment="Top" rotation="None" markup="none">
<font fontName="SansSerif" size="8" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/>
</textElement>
<textFieldExpression><![CDATA[$F{valorContabil}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="347" y="2" width="89" height="18" uuid="8446f0d3-6761-4ba1-8ec6-273c408bf0fa"/>
<textElement textAlignment="Center">
<font size="8" isBold="false" isItalic="false"/>
</textElement>
<textFieldExpression><![CDATA[$F{destino}]]></textFieldExpression>
</textField>
</band>
</detail>
<summary>
<band height="77" splitType="Stretch"/>
</summary>
<noData>
<band height="50">
<textField>
<reportElement x="1" y="24" width="575" height="26" uuid="6f13c961-dd50-4e44-ba73-65e0752b8b83"/>
<textElement markup="none">
<font size="11" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$R{msg.noData}]]></textFieldExpression>
</textField>
</band>
</noData>
</jasperReport>

View File

@ -1,8 +1,8 @@
<?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="RelatorioEstoque" pageWidth="842" pageHeight="595" orientation="Landscape" whenNoDataType="NoDataSection" columnWidth="802" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" resourceBundle="/ventaboletosadm/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioAidfDetalhado_es_BR" uuid="c092ef85-9334-4225-93d7-1acb7cf4d021">
<property name="ireport.zoom" value="1.464100000000009"/>
<property name="ireport.x" value="0"/>
<property name="ireport.y" value="0"/>
<property name="ireport.zoom" value="3.797498335832437"/>
<property name="ireport.x" value="637"/>
<property name="ireport.y" value="445"/>
<property name="net.sf.jasperreports.export.xls.exclude.origin.keep.first.band.2" value="pageHeader"/>
<property name="net.sf.jasperreports.export.xls.exclude.origin.keep.first.band.1" value="columnHeader"/>
<parameter name="NOME_RELATORIO" class="java.lang.String"/>
@ -24,6 +24,7 @@
<field name="nomeEstado" class="java.lang.String"/>
<field name="fechorAquisicion" class="java.util.Date"/>
<field name="fecVencimento" class="java.util.Date"/>
<field name="quantidade" class="java.lang.Integer"/>
<background>
<band splitType="Stretch"/>
</background>
@ -111,7 +112,7 @@
<text><![CDATA[De]]></text>
</staticText>
<staticText>
<reportElement x="350" y="16" width="102" height="18" uuid="fcf366c0-0f13-44f7-84de-38ae1122b647"/>
<reportElement x="405" y="16" width="75" height="18" uuid="fcf366c0-0f13-44f7-84de-38ae1122b647"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="10" isBold="true"/>
</textElement>
@ -146,7 +147,7 @@
<text><![CDATA[Até]]></text>
</staticText>
<staticText>
<reportElement x="452" y="16" width="83" height="18" uuid="ea11f3f2-8b0d-4fc9-a87b-c190b8dab51f"/>
<reportElement x="480" y="16" width="55" height="18" uuid="ea11f3f2-8b0d-4fc9-a87b-c190b8dab51f"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="10" isBold="true"/>
</textElement>
@ -173,6 +174,13 @@
</textElement>
<text><![CDATA[Data Vencimento ]]></text>
</staticText>
<staticText>
<reportElement x="350" y="16" width="55" height="18" uuid="0df8c358-831f-4013-9b52-5e082ff250a5"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="10" isBold="true"/>
</textElement>
<text><![CDATA[Saldo]]></text>
</staticText>
</band>
</columnHeader>
<detail>
@ -193,7 +201,7 @@
<textFieldExpression><![CDATA[$F{folioInicial}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="350" y="2" width="102" height="18" uuid="f1e52aa0-f61d-4c94-bb09-e51cde37f2cc"/>
<reportElement x="405" y="2" width="75" height="18" uuid="f1e52aa0-f61d-4c94-bb09-e51cde37f2cc"/>
<textElement textAlignment="Center">
<font size="8"/>
</textElement>
@ -230,7 +238,7 @@
<textFieldExpression><![CDATA[$F{folioFinal}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="452" y="2" width="83" height="18" uuid="a0ee8a4d-39ef-458a-895d-b12b794876d9"/>
<reportElement x="480" y="2" width="55" height="18" uuid="a0ee8a4d-39ef-458a-895d-b12b794876d9"/>
<textElement textAlignment="Center">
<font size="8"/>
</textElement>
@ -257,6 +265,14 @@
</textElement>
<textFieldExpression><![CDATA[$F{fecVencimento}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true">
<reportElement mode="Transparent" x="350" y="2" width="55" height="18" forecolor="#000000" backcolor="#FFFFFF" uuid="5dbce9fd-364b-4f4c-a95f-dd7d474e4243"/>
<textElement textAlignment="Center" verticalAlignment="Top" rotation="None" markup="none">
<font fontName="SansSerif" size="8" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/>
</textElement>
<textFieldExpression><![CDATA[$F{quantidade}]]></textFieldExpression>
</textField>
</band>
</detail>
<summary>

View File

@ -32,6 +32,7 @@ public class ItemReporteControleEstoqueBoletos {
private Integer numfoliopreimpreso;
private String ID;
private String tipoAidf;
private Integer quantidade;
public Integer getEstacionId() {
@ -191,6 +192,13 @@ public class ItemReporteControleEstoqueBoletos {
public void setTipoAidf(String tipoAidf) {
this.tipoAidf = tipoAidf;
}
public Integer getQuantidade() {
return quantidade;
}
public void setQuantidade(Integer quantidade) {
this.quantidade = quantidade;
}
@Override
public int hashCode() {
final int prime = 31;

View File

@ -1,5 +1,6 @@
package com.rjconsultores.ventaboletos.relatorios.utilitarios;
import java.math.BigDecimal;
import java.util.Date;
public class RelatorioBilhetesVendidosEstoqueAgenciaBean {
@ -16,6 +17,10 @@ public class RelatorioBilhetesVendidosEstoqueAgenciaBean {
private String range;
private String chave;
private String folio;
private String origem;
private String destino;
private BigDecimal valorContabil;
private String estado;
public RelatorioBilhetesVendidosEstoqueAgenciaBean(RelatorioBilhetesVendidosEstoqueAgenciaBean bean) {
@ -108,4 +113,36 @@ public class RelatorioBilhetesVendidosEstoqueAgenciaBean {
this.folio = folio;
}
public String getOrigem() {
return origem;
}
public void setOrigem(String origem) {
this.origem = origem;
}
public String getDestino() {
return destino;
}
public void setDestino(String destino) {
this.destino = destino;
}
public BigDecimal getValorContabil() {
return valorContabil;
}
public void setValorContabil(BigDecimal valorContabil) {
this.valorContabil = valorContabil;
}
public String getEstado() {
return estado;
}
public void setEstado(String estado) {
this.estado = estado;
}
}

View File

@ -2,6 +2,8 @@ package com.rjconsultores.ventaboletos.web.gui.controladores.relatorios;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -19,16 +21,20 @@ import org.zkoss.zul.Bandbox;
import org.zkoss.zul.Combobox;
import org.zkoss.zul.Comboitem;
import org.zkoss.zul.Datebox;
import org.zkoss.zul.Intbox;
import org.zkoss.zul.Paging;
import org.zkoss.zul.Textbox;
import com.rjconsultores.ventaboletos.entidad.Aidf;
import com.rjconsultores.ventaboletos.entidad.AidfTipo;
import com.rjconsultores.ventaboletos.entidad.Empresa;
import com.rjconsultores.ventaboletos.entidad.PuntoVenta;
import com.rjconsultores.ventaboletos.relatorios.impl.RelatorioEstoque;
import com.rjconsultores.ventaboletos.relatorios.utilitarios.Relatorio;
import com.rjconsultores.ventaboletos.relatorios.utilitarios.RelatorioBilhetesVendidosEstoqueAgenciaBean;
import com.rjconsultores.ventaboletos.service.AidfService;
import com.rjconsultores.ventaboletos.service.EmpresaService;
import com.rjconsultores.ventaboletos.utilerias.DateUtil;
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar;
import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer;
@ -55,6 +61,9 @@ public class RelatorioAidfDetalhadoController extends MyGenericForwardComposer {
private Textbox txtFimForm;
private List<AidfTipo> lsAidfTipo;
private Combobox cmbAidfTipo;
private Intbox aidfIdIntBox;
@Autowired
private transient PagedListWrapper<PuntoVenta> plwPuntoVenta;
@ -81,6 +90,7 @@ public class RelatorioAidfDetalhadoController extends MyGenericForwardComposer {
puntoVentaList.setItemRenderer(new RenderRelatorioVendasBilheteiro());
puntoVentaSelList.setItemRenderer(new RenderRelatorioVendasBilheteiroSelecionados());
lsAidfTipo = aidfService.obtenerTodosAdifTipo();
}
/**
@ -139,6 +149,15 @@ public class RelatorioAidfDetalhadoController extends MyGenericForwardComposer {
filtro.append(" Todas; ");
}
if (aidfIdIntBox.getValue() != null) {
Integer aidfId = aidfIdIntBox.getValue();
parametros.put("AIDF_ID", aidfId );
filtro.append(aidfId + ";");
} else {
filtro.append(" Todas; ");
}
parametros.put("FILTROS", filtro.toString());
relatorio = new RelatorioEstoque(parametros, dataSourceRead.getConnection());
@ -304,4 +323,5 @@ public class RelatorioAidfDetalhadoController extends MyGenericForwardComposer {
this.lsAidfTipo = lsAidfTipo;
}
}

View File

@ -31,6 +31,7 @@ import com.rjconsultores.ventaboletos.entidad.PuntoVenta;
import com.rjconsultores.ventaboletos.enums.IndStatusBoleto;
import com.rjconsultores.ventaboletos.relatorios.impl.RelatorioBilhetesVendidos;
import com.rjconsultores.ventaboletos.relatorios.impl.RelatorioBilhetesVendidosEstoqueAgencia;
import com.rjconsultores.ventaboletos.relatorios.impl.RelatorioBilhetesVendidosEstoqueAgenciaNovoLayout;
import com.rjconsultores.ventaboletos.relatorios.impl.RelatorioBilhetesVendidosNovoLayout;
import com.rjconsultores.ventaboletos.relatorios.utilitarios.Relatorio;
import com.rjconsultores.ventaboletos.service.AidfService;
@ -135,7 +136,7 @@ public class RelatorioBilhetesVendidosEstoqueAgenciaController extends MyGeneric
executarRelatorio(false);
}
public void onClick$btnExecutarRelatorioNovoLayout(Event ev) throws Exception {
public void onClick$btnExecutarRelatorioConsumoDetalhado(Event ev) throws Exception {
executarRelatorio(true);
}
@ -200,13 +201,17 @@ public class RelatorioBilhetesVendidosEstoqueAgenciaController extends MyGeneric
filtro.append(" Todas; ");
}
relatorio = new RelatorioBilhetesVendidosEstoqueAgencia(parametros, dataSourceRead.getConnection());
if(novoLayout) {
relatorio = new RelatorioBilhetesVendidosEstoqueAgenciaNovoLayout(parametros, dataSourceRead.getConnection());
}else{
relatorio = new RelatorioBilhetesVendidosEstoqueAgencia(parametros, dataSourceRead.getConnection());
}
parametros.put("FILTROS", filtro.toString());
Map args = new HashMap();
args.put("relatorio", relatorio);
openWindow("/component/reportView.zul", Labels.getLabel("relatorioBilhetesVendidosController.window.title"), args, MODAL);
openWindow("/component/reportView.zul", Labels.getLabel("relatorioBilhetesVendidosEstoqueAgenciaController.window.title"), args, MODAL);
}
public List<AidfTipo> getLsAidfTipo() {

View File

@ -1104,6 +1104,7 @@ relatorioAidfDetalhadoController.lbFormInicial.value = Form. Inicial
relatorioAidfDetalhadoController.lbFormFinal.value = Form. Final
relatorioAidfDetalhadoController.msg.agencia.obrigatorio = Uma Agência deve ser selecionada
relatorioAidfDetalhadoController.aidfTipo.label=Tipo Aidf
relatorioAidfDetalhadoController.aidf.label=Aidf
#Relatório de Vendas PTA
relatorioVendasPTAController.window.title = Reporte de Ventas PTA

View File

@ -1217,7 +1217,6 @@ relatorioAidfController.lbEmpresa.value = Empresa
relatorioAidfController.lbSerie.value = Série
#Relatorio Aidf Detalhado
relatorioAidfDetalhadoController.window.title = Relatório Estoque
relatorioAidfDetalhadoController.datainicial.value = Data Inicial Aquisição
relatorioAidfDetalhadoController.dataFinal.value = Data Final Aquisição
relatorioAidfDetalhadoController.lbEmpresa.value = Empresa
@ -1226,6 +1225,9 @@ relatorioAidfDetalhadoController.lbFormInicial.value = Form. Inicial
relatorioAidfDetalhadoController.lbFormFinal.value = Form. Final
relatorioAidfDetalhadoController.msg.agencia.obrigatorio = Uma Agência deve ser selecionada
relatorioAidfDetalhadoController.aidfTipo.label=Tipo Aidf
relatorioAidfDetalhadoController.aidf.label=Aidf ID
relatorioAidfDetalhadoController.window.title = Relatório Saldo de Estoque
relatorioBilhetesVendidosEstoqueAgenciaController.consumoEstoqueDetalhado.label = Consumo Estoque - Detalhado
#Relatorio Movimentacao Estoque
relatorioMovimentacaoEstoqueController.window.title = Relatório Movimentação de Estoque

View File

@ -7,7 +7,7 @@
<zk xmlns="http://www.zkoss.org/2005/zul">
<window id="winFiltroRelatorioAidfDetalhado" apply="${relatorioAidfDetalhadoController}"
contentStyle="overflow:auto"
height="320px" width="738px" border="normal">
height="340px" width="738px" border="normal">
<grid fixedLayout="true">
<columns>
<column width="25%" />
@ -89,6 +89,11 @@
</listhead>
</listbox>
<paging id="pagingSelPuntoVenta" pageSize="10" />
</row>
<row spans="1,3">
<label
value="${c:l('relatorioAidfDetalhadoController.aidf.label')}" />
<intbox id="aidfIdIntBox"></intbox>
</row>
<row spans="1,3">
<label

View File

@ -113,6 +113,8 @@
<toolbar>
<button id="btnExecutarRelatorio" image="/gui/img/find.png"
label="${c:l('relatorio.lb.btnExecutarRelatorio')}" />
<button id="btnExecutarRelatorioConsumoDetalhado" image="/gui/img/find.png"
label="${c:l('relatorioBilhetesVendidosEstoqueAgenciaController.consumoEstoqueDetalhado.label')}" />
</toolbar>
</window>