fixed bug#13109
qua:Renato dev:Thiago git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@88896 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
8cdf760ccf
commit
bce3dc0d47
|
@ -24,6 +24,7 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
import java.util.Observable;
|
||||
import java.util.Observer;
|
||||
import java.util.Set;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.zip.ZipEntry;
|
||||
|
@ -65,6 +66,7 @@ import org.zkoss.zul.Messagebox;
|
|||
import org.zkoss.zul.Radio;
|
||||
import org.zkoss.zul.Row;
|
||||
import org.zkoss.zul.Textbox;
|
||||
import org.zkoss.zul.api.Listitem;
|
||||
import org.zkoss.zul.api.Timebox;
|
||||
|
||||
import com.rjconsultores.ventaboletos.constantes.Constantes;
|
||||
|
@ -230,6 +232,7 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
|||
|
||||
private PuntoVenta puntoVenta;
|
||||
private Textbox txtCP;
|
||||
private MyListbox categoriaList;
|
||||
private MyListbox puntoVentaList;
|
||||
private MyListbox paramRecoleccionList;
|
||||
private MyListbox formaPagoList;
|
||||
|
@ -325,7 +328,6 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
|||
private Combobox cmbEmpresaComissao;
|
||||
private Combobox cmbEmpresas;
|
||||
private MyComboboxEstandar cmbEmpresasContaBancarias;
|
||||
private Combobox cmbCategorias;
|
||||
private Combobox cmbUsuarioEmpresa;
|
||||
private Combobox cmbEmpresaFechamentoParamptovta;
|
||||
private Combobox cmbLogFiles;
|
||||
|
@ -500,6 +502,11 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
|||
|
||||
super.doAfterCompose(comp);
|
||||
|
||||
|
||||
for (Categoria c : lsCategoriaBloquear) {
|
||||
categoriaList.addItemNovo(c);
|
||||
}
|
||||
|
||||
getTxtTaxaConvenienciaPorc().setConstraint(getCt());
|
||||
cmbBanco.addEventListener("onAfterRender", new org.zkoss.zk.ui.event.EventListener() {
|
||||
@Override
|
||||
|
@ -510,7 +517,7 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
|||
|
||||
aplicarMascara();
|
||||
|
||||
popularCombobox(cmbTipoConta, cmbPessoa, cmbForm, cmbLote, cmbPosicao, cmbReceita, cmbEmpresas, cmbCategorias, cmbUsuarioEmpresa);
|
||||
popularCombobox(cmbTipoConta, cmbPessoa, cmbForm, cmbLote, cmbPosicao, cmbReceita, cmbEmpresas, cmbUsuarioEmpresa);
|
||||
|
||||
ptovtaEmpresasBloqueadasList.setItemRenderer(new RenderEmpresaBloquear());
|
||||
ptovtaPtoVtaCheckinList.setItemRenderer(new RenderParadaPtoVtaCheckin());
|
||||
|
@ -953,7 +960,7 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
|||
}
|
||||
}
|
||||
|
||||
public void popularCombobox(Combobox cmbConta, Combobox cmbPessoa, Combobox cmbForm, Combobox cmbLote, Combobox cmbPosicao, Combobox cmbReceita, Combobox cmbEmpresas, Combobox cmbCategorias, Combobox cmbUsuarioEmpresa) throws Exception {
|
||||
public void popularCombobox(Combobox cmbConta, Combobox cmbPessoa, Combobox cmbForm, Combobox cmbLote, Combobox cmbPosicao, Combobox cmbReceita, Combobox cmbEmpresas, Combobox cmbUsuarioEmpresa) throws Exception {
|
||||
|
||||
clearCombobox(cmbConta);
|
||||
clearCombobox(cmbPessoa);
|
||||
|
@ -962,7 +969,6 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
|||
clearCombobox(cmbPosicao);
|
||||
clearCombobox(cmbEmpresas);
|
||||
clearCombobox(cmbEmpresas);
|
||||
clearCombobox(cmbCategorias);
|
||||
clearCombobox(cmbUsuarioEmpresa);
|
||||
|
||||
for (Empresa e : lsEmpresasBloquear) {
|
||||
|
@ -1007,12 +1013,6 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
|||
comboItem.setParent(cmbReceita);
|
||||
}
|
||||
|
||||
for (Categoria c : lsCategoriaBloquear) {
|
||||
Comboitem comboItem = new Comboitem(c.getDesccategoria());
|
||||
comboItem.setValue(c);
|
||||
comboItem.setParent(cmbCategorias);
|
||||
}
|
||||
|
||||
if (lsEmpresas != null && !lsEmpresas.isEmpty()) {
|
||||
Empresa empresaTodos = new Empresa(-1, "TODAS");
|
||||
lsEmpresas.add(empresaTodos);
|
||||
|
@ -1405,21 +1405,46 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
|||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public void onClick$btnAdicionarPtovtaCatInd(Event ev) {
|
||||
if (cmbCategorias.getSelectedItem() != null) {
|
||||
Categoria categoria = (Categoria) cmbCategorias.getSelectedItem().getValue();
|
||||
if (!categoriaList.getSelectedItems().isEmpty()) {
|
||||
|
||||
PtovtaCatInd pto = new PtovtaCatInd();
|
||||
pto.setCategoria(categoria);
|
||||
pto.setPuntoVenta(puntoVenta);
|
||||
pto.setUsuarioBloqueado((Usuario) cmbUsuarioBloq.getSelectedItem().getValue());
|
||||
pto.setEmpresa((Empresa) cmbUsuarioEmpresa.getSelectedItem().getValue());
|
||||
puntoVenta.addPtovtaCatInd(pto);
|
||||
for (Listitem item : (Set<Listitem>) categoriaList.getSelectedItems()) {
|
||||
Categoria categoria = (Categoria) item.getValue();
|
||||
|
||||
ptovtaCatIndList.setData(puntoVenta.getPtovtaCatIndList());
|
||||
|
||||
PtovtaCatInd pto = new PtovtaCatInd();
|
||||
pto.setCategoria(categoria);
|
||||
pto.setPuntoVenta(puntoVenta);
|
||||
pto.setUsuarioBloqueado((Usuario) cmbUsuarioBloq.getSelectedItem().getValue());
|
||||
pto.setEmpresa((Empresa) cmbUsuarioEmpresa.getSelectedItem().getValue());
|
||||
|
||||
if(existePtoVtaCat(pto)){
|
||||
return;
|
||||
}
|
||||
|
||||
puntoVenta.addPtovtaCatInd(pto);
|
||||
|
||||
|
||||
ptovtaCatIndList.setData(puntoVenta.getPtovtaCatIndList());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private boolean existePtoVtaCat(PtovtaCatInd ptoVtaCat) {
|
||||
|
||||
for (PtovtaCatInd p : puntoVenta.getPtovtaCatIndList()) {
|
||||
if (p.getActivo()
|
||||
&& p.getCategoria().equals(ptoVtaCat.getCategoria())
|
||||
&& p.getEmpresa().equals(ptoVtaCat.getEmpresa())
|
||||
&& p.getUsuarioBloqueado().equals(ptoVtaCat.getUsuarioBloqueado())) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public void onClick$btnApagarPtovtaCatInd(Event ev) {
|
||||
try {
|
||||
if (ptovtaCatIndList.getSelected() != null) {
|
||||
|
@ -3691,4 +3716,12 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
|||
return lsEmpresasSemTodos;
|
||||
}
|
||||
|
||||
public MyListbox getCategoriaList() {
|
||||
return categoriaList;
|
||||
}
|
||||
|
||||
public void setCategoriaList(MyListbox categoriaList) {
|
||||
this.categoriaList = categoriaList;
|
||||
}
|
||||
|
||||
}
|
|
@ -1581,15 +1581,20 @@
|
|||
<column width="70%" />
|
||||
</columns>
|
||||
<rows>
|
||||
<row>
|
||||
<label
|
||||
value="${c:l('editarPuntoVentaController.label.tipoPassagem')}" />
|
||||
<combobox id="cmbCategorias"
|
||||
constraint="no empty"
|
||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar"
|
||||
width="70%" mold="rounded" buttonVisible="true" />
|
||||
</row>
|
||||
<row>
|
||||
|
||||
<row>
|
||||
<label
|
||||
value="${c:l('editarPuntoVentaController.label.tipoPassagem')}" />
|
||||
<bandbox id="bdCategoria">
|
||||
<bandpopup width="200px">
|
||||
<listbox id="categoriaList"
|
||||
checkmark="true" multiple="true"
|
||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyListbox">
|
||||
</listbox>
|
||||
</bandpopup>
|
||||
</bandbox>
|
||||
</row>
|
||||
<row>
|
||||
<label
|
||||
value="${c:l('editarPuntoVentaController.label.usuario')}" />
|
||||
<combobox id="cmbUsuarioBloq"
|
||||
|
|
Loading…
Reference in New Issue