fixes bug#24233

dev: Aristides
qua: 

git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@111384 d1611594-4594-4d17-8e1d-87c2c4800839
master
celio 2022-03-18 14:26:50 +00:00
parent c69855358c
commit 053a06b32e
1 changed files with 16 additions and 10 deletions

View File

@ -98,13 +98,15 @@ public abstract class RelatorioAgenciaFechamento extends Relatorio {
* @throws ParseException
*/
protected void carregarDadosTotaisVenda(String fecInicio, String fecFinal, String empresa, String empresaNome, String puntoVenta) throws SQLException, ParseException {
boolean isDiario = TipoRelatorioFechamentoEnum.DIARIO.equals(tipoRelatorio);
NamedParameterStatement stmt = new NamedParameterStatement(getConexao(), criarQueryBilhetesVenda(puntoVenta, empresa));
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy hh:mm:ss") , sdf2 = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
SimpleDateFormat sdf = (isDiario ? new SimpleDateFormat("yyyy-MM-dd hh:mm:ss") : new SimpleDateFormat("dd/MM/yyyy hh:mm:ss") );
ResultSet rset1 = criaResultSet(fecInicio, fecFinal, sdf, stmt);
String dataInicial = fecInicio;
String dataFinal = fecFinal;
StringBuilder puntoVentaIds = new StringBuilder();
puntoVentaIds.append(" 0");
@ -121,9 +123,11 @@ public abstract class RelatorioAgenciaFechamento extends Relatorio {
Integer qtdedigitado = rset1.getInt("qtdedigitado");
Integer qtdeAnulado = rset1.getInt("qtdeAnulado");
Integer qtdeDevolvido = rset1.getInt("qtdeDevolvido");
String dataInicial = rset1.getString("DATA");
String dataFinal = rset1.getString("DATA");
if (isDiario) {
dataInicial = rset1.getString("DATA");
dataFinal = rset1.getString("DATA");
}
vendido = rset1.getBigDecimal("vendido");
BigDecimal digitado = rset1.getBigDecimal("digitado");
@ -132,7 +136,7 @@ public abstract class RelatorioAgenciaFechamento extends Relatorio {
total = preencherAgenciaFechamento(empresaNome, rset1, agenciaFechamento, total, vendido, qtdevendido, qtdedigitado, qtdeAnulado, qtdeDevolvido, digitado, anulado, devolvido);
carregarDadosReceitaDespesa(dataInicial, dataFinal, empresa, sdf2, agenciaFechamento, total, vendido, puntoVentaId);
carregarDadosReceitaDespesa(dataInicial, dataFinal, isDiario, empresa, sdf, agenciaFechamento, total, vendido, puntoVentaId);
lsDadosRelatorio.add(agenciaFechamento);
}
@ -158,11 +162,13 @@ public abstract class RelatorioAgenciaFechamento extends Relatorio {
* @throws SQLException
* @throws ParseException
*/
protected void carregarDadosReceitaDespesa(String fecInicio, String fecFinal, String empresa, SimpleDateFormat sdf, RelatorioAgenciaFechamentoAntigoBean agenciaFechamento, BigDecimal total, BigDecimal vendido, String puntoVentaId) throws SQLException, ParseException {
protected void carregarDadosReceitaDespesa(String fecInicio, String fecFinal, Boolean isDiario, String empresa, SimpleDateFormat sdf, RelatorioAgenciaFechamentoAntigoBean agenciaFechamento, BigDecimal total, BigDecimal vendido, String puntoVentaId) throws SQLException, ParseException {
NamedParameterStatement stmt = new NamedParameterStatement(getConexao(), criarQueryReceitaDespesa(puntoVentaId, empresa));
if (isDiario) {
fecInicio = fecInicio.substring(0, 10).toString() + " 00:00:00";
fecFinal = fecFinal.substring(0, 10).toString() + " 23:59:59";
}
fecInicio = fecInicio.substring(0, 10).toString() + " 00:00:00";
fecFinal = fecFinal.substring(0, 10).toString() + " 23:59:59";
stmt.setTimestamp("de", new java.sql.Timestamp(sdf.parse(fecInicio).getTime()));
stmt.setTimestamp("ate", new java.sql.Timestamp(sdf.parse(fecFinal).getTime()));