From b10ac5c78bfc28f4872285cdd0b050e1e2619fb0 Mon Sep 17 00:00:00 2001 From: julio Date: Thu, 3 Feb 2022 17:51:31 +0000 Subject: [PATCH] fixes bug#23738 dev: Julio qua: git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@110724 d1611594-4594-4d17-8e1d-87c2c4800839 --- ...latorioBaixasVendasInternetController.java | 38 +++++++++++++------ 1 file changed, 26 insertions(+), 12 deletions(-) diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/relatorios/RelatorioBaixasVendasInternetController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/relatorios/RelatorioBaixasVendasInternetController.java index d06ff87ee..9fe7ec217 100644 --- a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/relatorios/RelatorioBaixasVendasInternetController.java +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/relatorios/RelatorioBaixasVendasInternetController.java @@ -1,5 +1,6 @@ package com.rjconsultores.ventaboletos.web.gui.controladores.relatorios; +import java.util.Date; import java.util.HashMap; import java.util.Map; @@ -15,6 +16,7 @@ import org.zkoss.zul.Datebox; import com.rjconsultores.ventaboletos.entidad.PuntoVenta; import com.rjconsultores.ventaboletos.relatorios.impl.RelatorioBaixasVendasInternet; import com.rjconsultores.ventaboletos.relatorios.impl.RelatorioBaixasVendasInternetSintetico; +import com.rjconsultores.ventaboletos.utilerias.DateUtil; import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxPuntoVenta; import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; @@ -33,20 +35,32 @@ public class RelatorioBaixasVendasInternetController extends MyGenericForwardCom public void onClick$btnExecutarRelatorio(Event ev) throws Exception { Map args = new HashMap(); + String title = null; + PuntoVenta puntoVenta = (PuntoVenta) cmbPuntoVenta.getSelectedItem().getValue(); - if (puntoVenta != null && puntoVenta.getPuntoventaId() != null && puntoVenta.getPuntoventaId() != -1) { - RelatorioBaixasVendasInternet relatorio = new RelatorioBaixasVendasInternet(dataSourceRead.getConnection(), fecInicio.getValue(), fecFinal.getValue(), puntoVenta); - args.put("relatorio", relatorio); - openWindow("/component/reportView.zul", - Labels.getLabel("indexController.mniRelatorioBaixasVendasInternet.label"), args, MODAL); - } else { - // criar o relatorio sintetico com a outra consulta - RelatorioBaixasVendasInternetSintetico relatorio = new RelatorioBaixasVendasInternetSintetico(dataSourceRead.getConnection(), fecInicio.getValue(), fecFinal.getValue()); - args.put("relatorio", relatorio); - openWindow("/component/reportView.zul", - Labels.getLabel("indexController.mniRelatorioBaixasVendasInternetSintetico.label"), args, MODAL); + + Date datInicial = null; + if (this.fecInicio.getValue() != null) { + datInicial = DateUtil.inicioFecha(this.fecInicio.getValue()); + } + + Date datFinal = null; + if (this.fecFinal.getValue() != null) { + datFinal = DateUtil.fimFecha(this.fecFinal.getValue()); } + if (puntoVenta != null && puntoVenta.getPuntoventaId() != null && puntoVenta.getPuntoventaId() != -1) { + RelatorioBaixasVendasInternet relatorio = new RelatorioBaixasVendasInternet(dataSourceRead.getConnection(), datInicial, datFinal, puntoVenta); + args.put("relatorio", relatorio); + title = Labels.getLabel("indexController.mniRelatorioBaixasVendasInternet.label"); + + } else { + // criar o relatorio sintetico com a outra consulta + RelatorioBaixasVendasInternetSintetico relatorio = new RelatorioBaixasVendasInternetSintetico(dataSourceRead.getConnection(), datInicial, datFinal); + args.put("relatorio", relatorio); + title = Labels.getLabel("indexController.mniRelatorioBaixasVendasInternetSintetico.label"); + } + + openWindow("/component/reportView.zul", title, args, MODAL); } - } \ No newline at end of file