Correção do filtro de data
fixes bug 6792 git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@49645 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
7d93e1cde3
commit
c7f878b530
|
@ -1,9 +1,11 @@
|
|||
package com.rjconsultores.ventaboletos.relatorios.impl;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.Connection;
|
||||
import java.sql.Date;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Timestamp;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
@ -28,8 +30,8 @@ public class RelatorioVendasComissao extends Relatorio {
|
|||
|
||||
private List<RelatorioVendasComissaoBean> lsDadosRelatorio;
|
||||
|
||||
private Date fecInicio;
|
||||
private Date fecFinal;
|
||||
private Timestamp fecInicio;
|
||||
private Timestamp fecFinal;
|
||||
private Integer marcaId;
|
||||
|
||||
public RelatorioVendasComissao(Map<String, Object> parametros, Connection conexao) throws Exception {
|
||||
|
@ -40,8 +42,8 @@ public class RelatorioVendasComissao extends Relatorio {
|
|||
@Override
|
||||
public void initDados() throws Exception {
|
||||
Map<String, Object> parametros = this.relatorio.getParametros();
|
||||
fecInicio = new java.sql.Date(sdf.parse(parametros.get("fecInicio").toString()).getTime());
|
||||
fecFinal = new java.sql.Date(sdf.parse(parametros.get("fecFinal").toString()).getTime());
|
||||
fecInicio = (Timestamp) parametros.get("dataFiltroInicial");
|
||||
fecFinal = (Timestamp) parametros.get("dataFiltroFinal");
|
||||
if(parametros.get("MARCA_ID")!=null){
|
||||
marcaId = Integer.valueOf(parametros.get("MARCA_ID").toString());
|
||||
}
|
||||
|
@ -106,14 +108,14 @@ public class RelatorioVendasComissao extends Relatorio {
|
|||
}
|
||||
|
||||
if(isVenda(indstatusboleto)) {
|
||||
relatorioVendasPacotesBoletosBean.setTotalVendas(relatorioVendasPacotesBoletosBean.getTotalVendas().add(rset.getBigDecimal("TOTAL")));
|
||||
relatorioVendasPacotesBoletosBean.setTotalTaxasVendas(relatorioVendasPacotesBoletosBean.getTotalTaxasVendas().add(rset.getBigDecimal("TOTAL_TAXAS")));
|
||||
relatorioVendasPacotesBoletosBean.setTotalVendas(relatorioVendasPacotesBoletosBean.getTotalVendas().add(rset.getBigDecimal("TOTAL") != null ? rset.getBigDecimal("TOTAL") : new BigDecimal(0)));
|
||||
relatorioVendasPacotesBoletosBean.setTotalTaxasVendas(relatorioVendasPacotesBoletosBean.getTotalTaxasVendas().add(rset.getBigDecimal("TOTAL_TAXAS") != null ? rset.getBigDecimal("TOTAL_TAXAS") : new BigDecimal(0)));
|
||||
} else if(isCancelamentoCaja(indstatusboleto, motivocancelacionId)) {
|
||||
relatorioVendasPacotesBoletosBean.setTotalVendasCanceladas(relatorioVendasPacotesBoletosBean.getTotalVendasCanceladas().add(rset.getBigDecimal("TOTAL")));
|
||||
relatorioVendasPacotesBoletosBean.setTotalTaxasVendasCanceladas(relatorioVendasPacotesBoletosBean.getTotalTaxasVendasCanceladas().add(rset.getBigDecimal("TOTAL_TAXAS")));
|
||||
relatorioVendasPacotesBoletosBean.setTotalVendasCanceladas(relatorioVendasPacotesBoletosBean.getTotalVendasCanceladas().add(rset.getBigDecimal("TOTAL") != null ? rset.getBigDecimal("TOTAL") : new BigDecimal(0)));
|
||||
relatorioVendasPacotesBoletosBean.setTotalTaxasVendasCanceladas(relatorioVendasPacotesBoletosBean.getTotalTaxasVendasCanceladas().add(rset.getBigDecimal("TOTAL_TAXAS") != null ? rset.getBigDecimal("TOTAL_TAXAS") : new BigDecimal(0)));
|
||||
} else if(isDevolucaoCaja(indstatusboleto, motivocancelacionId)) {
|
||||
relatorioVendasPacotesBoletosBean.setTotalVendasDevolucao(relatorioVendasPacotesBoletosBean.getTotalVendasDevolucao().add(rset.getBigDecimal("TOTAL")));
|
||||
relatorioVendasPacotesBoletosBean.setTotalTaxasVendasDevolucao(relatorioVendasPacotesBoletosBean.getTotalTaxasVendasDevolucao().add(rset.getBigDecimal("TOTAL_TAXAS")));
|
||||
relatorioVendasPacotesBoletosBean.setTotalVendasDevolucao(relatorioVendasPacotesBoletosBean.getTotalVendasDevolucao().add(rset.getBigDecimal("TOTAL") != null ? rset.getBigDecimal("TOTAL") : new BigDecimal(0)));
|
||||
relatorioVendasPacotesBoletosBean.setTotalTaxasVendasDevolucao(relatorioVendasPacotesBoletosBean.getTotalTaxasVendasDevolucao().add(rset.getBigDecimal("TOTAL_TAXAS") != null ? rset.getBigDecimal("TOTAL_TAXAS") : new BigDecimal(0)));
|
||||
}
|
||||
|
||||
if(!contain) {
|
||||
|
@ -150,10 +152,10 @@ public class RelatorioVendasComissao extends Relatorio {
|
|||
NamedParameterStatement stmt = new NamedParameterStatement(conexao, sql);
|
||||
|
||||
if(fecInicio != null) {
|
||||
stmt.setDate("fecInicio", fecInicio);
|
||||
stmt.setTimestamp("fecInicio", fecInicio);
|
||||
}
|
||||
if(fecFinal != null) {
|
||||
stmt.setDate("fecFinal", fecFinal);
|
||||
stmt.setTimestamp("fecFinal", fecFinal);
|
||||
}
|
||||
if(marcaId != null){
|
||||
stmt.setInt("MARCA_ID", marcaId);
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.rjconsultores.ventaboletos.web.gui.controladores.relatorios;
|
||||
|
||||
import java.sql.Timestamp;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
|
@ -21,6 +22,7 @@ import com.rjconsultores.ventaboletos.entidad.Empresa;
|
|||
import com.rjconsultores.ventaboletos.relatorios.impl.RelatorioVendasComissao;
|
||||
import com.rjconsultores.ventaboletos.relatorios.utilitarios.Relatorio;
|
||||
import com.rjconsultores.ventaboletos.service.EmpresaService;
|
||||
import com.rjconsultores.ventaboletos.utilerias.DateUtil;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer;
|
||||
|
||||
|
@ -52,11 +54,16 @@ public class RelatorioVendasComissaoController extends MyGenericForwardComposer
|
|||
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
|
||||
Date dataDe = dataInicial.getValue();
|
||||
Date dataAte = dataFinal.getValue();
|
||||
|
||||
|
||||
Timestamp fecVentaInicial = new Timestamp(DateUtil.inicioFecha(dataDe).getTime());
|
||||
Timestamp fecVentaFinal = new Timestamp(DateUtil.fimFecha(dataAte).getTime());
|
||||
|
||||
Map<String, Object> parametros = new HashMap<String, Object>();
|
||||
parametros.put("fecInicio", sdf.format(dataDe));
|
||||
parametros.put("fecFinal", sdf.format(dataAte));
|
||||
|
||||
parametros.put("dataFiltroInicial", fecVentaInicial);
|
||||
parametros.put("dataFiltroFinal", fecVentaFinal);
|
||||
|
||||
Comboitem itemEmpresa = cmbEmpresa.getSelectedItem();
|
||||
if (itemEmpresa != null) {
|
||||
|
|
Loading…
Reference in New Issue