bug#10938

dev:veloso
qua:wallysson

git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@81553 d1611594-4594-4d17-8e1d-87c2c4800839
master
frederico 2018-05-03 17:58:27 +00:00
parent 27eef07faf
commit f5982a7f47
2 changed files with 39 additions and 12 deletions

View File

@ -1,6 +1,7 @@
package com.rjconsultores.ventaboletos.web.gui.controladores.gr; package com.rjconsultores.ventaboletos.web.gui.controladores.gr;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
@ -16,6 +17,7 @@ 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.Label; import org.zkoss.zul.Label;
import org.zkoss.zul.ListModelArray;
import org.zkoss.zul.Longbox; import org.zkoss.zul.Longbox;
import org.zkoss.zul.Textbox; import org.zkoss.zul.Textbox;
@ -48,6 +50,7 @@ public class MovimentacionBilhetesController extends MyGenericForwardComposer {
private EstadoService estadoService; private EstadoService estadoService;
private Combobox cmbAidf; private Combobox cmbAidf;
private Combobox cmbEmpresa;
private List<Aidf> lsAidf; private List<Aidf> lsAidf;
private Combobox cmbTipoMovimentacion; private Combobox cmbTipoMovimentacion;
@ -66,13 +69,11 @@ public class MovimentacionBilhetesController extends MyGenericForwardComposer {
private Label aidfEstado, aidfSerie, aidfSubserie; private Label aidfEstado, aidfSerie, aidfSubserie;
List<Empresa> lsEmpresas;
@Override @Override
public void doAfterCompose(Component comp) throws Exception { public void doAfterCompose(Component comp) throws Exception {
lsEmpresas = UsuarioLogado.getUsuarioLogado().getEmpresa();
List<Empresa> lsEmpresas = UsuarioLogado.getUsuarioLogado().getEmpresa();
lsAidf = aidfService.buscaAidfsPorEmpresas(lsEmpresas);
lsTipoMovimentacion = movimentacionBilhetesService.obtenerTiposMovimetacion(); lsTipoMovimentacion = movimentacionBilhetesService.obtenerTiposMovimetacion();
setLsPuntoVenta(new ArrayList<PuntoVenta>()); setLsPuntoVenta(new ArrayList<PuntoVenta>());
fecmovimentacion = new Date(); fecmovimentacion = new Date();
@ -112,12 +113,21 @@ public class MovimentacionBilhetesController extends MyGenericForwardComposer {
this.cmbAidf = cmbAidf; this.cmbAidf = cmbAidf;
} }
public List<Aidf> getLsAidf() { public Combobox getCmbEmpresa() {
return lsAidf; return cmbEmpresa;
} }
public void setLsAidf(List<Aidf> lsAidf) { public void setCmbEmpresa(Combobox cmbEmpresa) {
this.lsAidf = lsAidf; this.cmbEmpresa = cmbEmpresa;
}
public List<Empresa> getLsEmpresas() {
return lsEmpresas;
}
public void setLsEmpresas(List<Empresa> lsEmpresas) {
this.lsEmpresas = lsEmpresas;
} }
public Datebox getDtbFecMovimentacion() { public Datebox getDtbFecMovimentacion() {
@ -191,6 +201,15 @@ public class MovimentacionBilhetesController extends MyGenericForwardComposer {
getAidfSubserie().setValue(aidf.getSubserie()); getAidfSubserie().setValue(aidf.getSubserie());
} }
public void onChange$cmbEmpresa(Event evt) throws InterruptedException {
Comboitem empresaSelecionada = cmbEmpresa.getSelectedItem();
Empresa empresa = (Empresa) empresaSelecionada.getValue();
lsAidf = aidfService.buscaAidfsPorEmpresas(Arrays.asList(empresa));
cmbAidf.setModel(new ListModelArray(lsAidf));
}
public List<TipoMovimentacion> getLsTipoMovimentacion() { public List<TipoMovimentacion> getLsTipoMovimentacion() {
return lsTipoMovimentacion; return lsTipoMovimentacion;
} }

View File

@ -49,7 +49,7 @@
<combobox id="cmbPuntoVentaOrigem" <combobox id="cmbPuntoVentaOrigem"
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxPuntoVenta" use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxPuntoVenta"
width="70%" mold="rounded" buttonVisible="true" width="70%" mold="rounded" buttonVisible="true"
model="@{winMovimentacionBilhetes$composer.lsPuntoVenta}"/> model="@{winMovimentacionBilhetes$composer.lsPuntoVenta}" constraint="no empty"/>
</row> </row>
<row> <row>
<label <label
@ -57,7 +57,16 @@
<combobox id="cmbPuntoVentaDestino" <combobox id="cmbPuntoVentaDestino"
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxPuntoVenta" use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxPuntoVenta"
width="70%" mold="rounded" buttonVisible="true" width="70%" mold="rounded" buttonVisible="true"
model="@{winMovimentacionBilhetes$composer.lsPuntoVenta}"/> model="@{winMovimentacionBilhetes$composer.lsPuntoVenta}" constraint="no empty"/>
</row>
<row>
<label
value="${c:l('winMovimentacionBilhetes.empresa.label')}" />
<combobox id="cmbEmpresa"
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar"
width="70%" mold="rounded" buttonVisible="true"
model="@{winMovimentacionBilhetes$composer.lsEmpresas}" />
</row> </row>
<row> <row>
@ -65,8 +74,7 @@
value="${c:l('winMovimentacionBilhetes.aidf.label')}" /> value="${c:l('winMovimentacionBilhetes.aidf.label')}" />
<combobox id="cmbAidf" <combobox id="cmbAidf"
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar" use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar"
width="70%" mold="rounded" buttonVisible="true" width="70%" mold="rounded" buttonVisible="true" constraint="no empty" />
model="@{winMovimentacionBilhetes$composer.lsAidf}" />
</row> </row>
<row> <row>