fixes bug#11058

dev:lucas
qua:gleimar

git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@81584 d1611594-4594-4d17-8e1d-87c2c4800839
master
changelogweb 2018-05-03 22:38:34 +00:00
parent f5982a7f47
commit 15ffe79da2
2 changed files with 26 additions and 32 deletions

View File

@ -14,6 +14,7 @@ import org.zkoss.util.resource.Labels;
import org.zkoss.zk.ui.Component; import org.zkoss.zk.ui.Component;
import org.zkoss.zk.ui.event.Event; import org.zkoss.zk.ui.event.Event;
import org.zkoss.zk.ui.event.EventListener; import org.zkoss.zk.ui.event.EventListener;
import org.zkoss.zul.Combobox;
import org.zkoss.zul.Comboitem; import org.zkoss.zul.Comboitem;
import org.zkoss.zul.Datebox; import org.zkoss.zul.Datebox;
import org.zkoss.zul.Intbox; import org.zkoss.zul.Intbox;
@ -43,10 +44,9 @@ public class BusquedaIntegracaoTotvsController extends MyGenericForwardComposer
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private static Logger log = Logger.getLogger(BusquedaIntegracaoTotvsController.class); private static Logger log = Logger.getLogger(BusquedaIntegracaoTotvsController.class);
private List<Empresa> lsEmpresas; private List<Empresa> lsEmpresas;
private MyComboboxEmpresa cmbEmpresa; private Combobox cmbEmpresa;
private MyComboboxEmpresa cmbEmpresaServico; private Combobox cmbEmpresaServico;
private MyComboboxPuntoVenta cmbPuntoVenta; private Combobox cmbPuntoVenta;
private List<PuntoVenta> lsPuntoVenta;
private Datebox fecInicioIntervalo; private Datebox fecInicioIntervalo;
private Datebox fecFinIntervalo; private Datebox fecFinIntervalo;
private Datebox fecInicioCorrida; private Datebox fecInicioCorrida;
@ -106,7 +106,7 @@ public class BusquedaIntegracaoTotvsController extends MyGenericForwardComposer
dataDe = new Date(); dataDe = new Date();
dataAte = new Date(); dataAte = new Date();
lsEmpresas = UsuarioLogado.getUsuarioLogado().getEmpresa(); lsEmpresas = UsuarioLogado.getUsuarioLogado().getEmpresa();
lsPuntoVenta = new ArrayList<PuntoVenta>();
cajaList.setItemRenderer(new RenderCajaTotvs()); cajaList.setItemRenderer(new RenderCajaTotvs());
cajaList.addEventListener("onDoubleClick", new EventListener() { cajaList.addEventListener("onDoubleClick", new EventListener() {
@ -132,29 +132,12 @@ public class BusquedaIntegracaoTotvsController extends MyGenericForwardComposer
this.lsEmpresas = lsEmpresas; this.lsEmpresas = lsEmpresas;
} }
public MyComboboxPuntoVenta getCmbPuntoVenta() {
return cmbPuntoVenta;
}
public void setCmbPuntoVenta(MyComboboxPuntoVenta cmbPuntoVenta) {
this.cmbPuntoVenta = cmbPuntoVenta;
}
public MyComboboxEmpresa getCmbEmpresa() {
return cmbEmpresa;
}
public void setCmbEmpresa(MyComboboxEmpresa cmbEmpresa) { public void setCmbEmpresa(MyComboboxEmpresa cmbEmpresa) {
this.cmbEmpresa = cmbEmpresa; this.cmbEmpresa = cmbEmpresa;
} }
public List<PuntoVenta> getLsPuntoVenta() {
return lsPuntoVenta;
}
public void setLsPuntoVenta(List<PuntoVenta> lsPuntoVenta) {
this.lsPuntoVenta = lsPuntoVenta;
}
private void refreshLista() { private void refreshLista() {
HibernateSearchObject<Caja> cajaBusqueda = new HibernateSearchObject<Caja>(Caja.class, pagingCaja.getPageSize()); HibernateSearchObject<Caja> cajaBusqueda = new HibernateSearchObject<Caja>(Caja.class, pagingCaja.getPageSize());
@ -176,11 +159,18 @@ public class BusquedaIntegracaoTotvsController extends MyGenericForwardComposer
cajaBusqueda.addFilterEqual("puntoventaId", puntoVenta.getPuntoventaId()); cajaBusqueda.addFilterEqual("puntoventaId", puntoVenta.getPuntoventaId());
} }
} }
Date valueFecInicio = fecInicioIntervalo.getValue();
Date valueFecFin = fecFinIntervalo.getValue();
valueFecInicio = valueFecInicio==null?new Date():valueFecInicio;
valueFecFin = valueFecFin==null?new Date():valueFecFin;
valueFecInicio = DateUtil.inicioFecha(valueFecInicio);
valueFecFin = DateUtil.fimFecha(valueFecFin);
// Filtro data // Filtro data
Date dataInicio = fecInicioIntervalo.getValue() != null ? DateUtil.inicioFecha(fecInicioIntervalo.getValue()) : null; cajaBusqueda.addFilterGreaterOrEqual("fechorventa", valueFecInicio);
Date dataFim = fecFinIntervalo.getValue() != null ? DateUtil.fimFecha(fecFinIntervalo.getValue()) : null; cajaBusqueda.addFilterLessOrEqual("fechorventa", valueFecFin);
cajaBusqueda.addFilterGreaterOrEqual("fechorventa", dataInicio);
cajaBusqueda.addFilterLessOrEqual("fechorventa", dataFim);
plwCaja.init(cajaBusqueda, cajaList, pagingCaja); plwCaja.init(cajaBusqueda, cajaList, pagingCaja);
if (cajaList.getData().length == 0) { if (cajaList.getData().length == 0) {
try { try {

View File

@ -44,15 +44,17 @@
<label <label
value="${c:l('integracaoTotvsController.cmbEmpresa.value')}" /> value="${c:l('integracaoTotvsController.cmbEmpresa.value')}" />
<combobox id="cmbEmpresa" <combobox id="cmbEmpresa"
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEmpresa" mold="rounded" buttonVisible="true" width="40%" use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar"
model="@{winIntegracaoTotvs$composer.lsEmpresas}"/> mold="rounded" buttonVisible="true" width="60%"
model="@{winIntegracaoTotvs$composer.lsEmpresas}"
/>
</row> </row>
<row> <row>
<label <label
value="${c:l('integracaoTotvsController.lbPuntoVenta.value')}" /> value="${c:l('integracaoTotvsController.lbPuntoVenta.value')}" />
<combobox id="cmbPuntoVenta" <combobox id="cmbPuntoVenta"
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxPuntoVenta" use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxPuntoVenta"
mold="rounded" buttonVisible="true" width="90%" model="@{winIntegracaoTotvs$composer.lsPuntoVenta}" /> mold="rounded" buttonVisible="true" width="60%"/>
</row> </row>
<row> <row>
<label <label
@ -130,7 +132,8 @@
<label <label
value="${c:l('integracaoTotvsController.cmbEmpresa.value')}" /> value="${c:l('integracaoTotvsController.cmbEmpresa.value')}" />
<combobox id="cmbEmpresaServico" <combobox id="cmbEmpresaServico"
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEmpresa" mold="rounded" buttonVisible="true" width="40%" use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar"
mold="rounded" buttonVisible="true" width="40%"
model="@{winIntegracaoTotvs$composer.lsEmpresas}"/> model="@{winIntegracaoTotvs$composer.lsEmpresas}"/>
</row> </row>
<row> <row>
@ -166,7 +169,8 @@
<label <label
value="${c:l('integracaoTotvsController.cmbEmpresa.value')}" /> value="${c:l('integracaoTotvsController.cmbEmpresa.value')}" />
<combobox id="cmbEmpresaCorrida" <combobox id="cmbEmpresaCorrida"
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEmpresa" mold="rounded" buttonVisible="true" width="40%" use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar"
mold="rounded" buttonVisible="true" width="40%"
model="@{winIntegracaoTotvs$composer.lsEmpresas}"/> model="@{winIntegracaoTotvs$composer.lsEmpresas}"/>
</row> </row>
<row> <row>