correções no código, melhorar os combobox estático
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@23913 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
b512e111b3
commit
2140b62108
|
@ -38,6 +38,7 @@ import org.zkoss.zul.api.Timebox;
|
||||||
import com.rjconsultores.ventaboletos.entidad.Ciudad;
|
import com.rjconsultores.ventaboletos.entidad.Ciudad;
|
||||||
import com.rjconsultores.ventaboletos.entidad.Colonia;
|
import com.rjconsultores.ventaboletos.entidad.Colonia;
|
||||||
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.EsquemaCorrida;
|
||||||
import com.rjconsultores.ventaboletos.entidad.FormaPago;
|
import com.rjconsultores.ventaboletos.entidad.FormaPago;
|
||||||
import com.rjconsultores.ventaboletos.entidad.FormaPagoDet;
|
import com.rjconsultores.ventaboletos.entidad.FormaPagoDet;
|
||||||
import com.rjconsultores.ventaboletos.entidad.Moneda;
|
import com.rjconsultores.ventaboletos.entidad.Moneda;
|
||||||
|
@ -254,12 +255,7 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
||||||
|
|
||||||
super.doAfterCompose(comp);
|
super.doAfterCompose(comp);
|
||||||
|
|
||||||
MyComboboxEstandar.popularCombobox(cmbPessoa, this.getPessoa());
|
popularCombobox(cmbTipoConta,cmbPessoa, cmbForm,cmbLote,cmbPosicao);
|
||||||
MyComboboxEstandar.popularCombobox(cmbTipoConta, this.getTipoConta());
|
|
||||||
MyComboboxEstandar.popularCombobox(cmbForm, this.getForm());
|
|
||||||
MyComboboxEstandar.popularCombobox(cmbLote, this.getLote());
|
|
||||||
MyComboboxEstandar.popularCombobox(cmbReceita, this.getTipoConta());
|
|
||||||
MyComboboxEstandar.popularCombobox(cmbPosicao, this.getPosicao());
|
|
||||||
|
|
||||||
lsEmpresas = UsuarioLogado.getUsuarioLogado().getEmpresa();
|
lsEmpresas = UsuarioLogado.getUsuarioLogado().getEmpresa();
|
||||||
|
|
||||||
|
@ -424,12 +420,20 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
||||||
txtNomeBanco.setText(puntoVenta.getAgenciaId().getInstiFinanceiraId().getNome());
|
txtNomeBanco.setText(puntoVenta.getAgenciaId().getInstiFinanceiraId().getNome());
|
||||||
}
|
}
|
||||||
|
|
||||||
// if(puntoVenta.getAgenciaId().getPessoa() != null){
|
if(puntoVenta.getAgenciaId().getPessoa() != null){
|
||||||
// cmbPessoa.setText(puntoVenta.getAgenciaId().getPessoa());
|
if(puntoVenta.getAgenciaId().getPessoa().equals("F")){
|
||||||
// }
|
cmbPessoa.setSelectedIndex(0);
|
||||||
|
}else if(puntoVenta.getAgenciaId().getPessoa().equals("J")){
|
||||||
|
cmbPessoa.setSelectedIndex(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(puntoVenta.getAgenciaId().getTipo() != null){
|
if(puntoVenta.getAgenciaId().getTipo() != null){
|
||||||
cmbTipoConta.setText(puntoVenta.getAgenciaId().getTipo());
|
if(puntoVenta.getAgenciaId().getTipo().equals("RL")){
|
||||||
|
cmbTipoConta.setSelectedIndex(0);
|
||||||
|
}else if(puntoVenta.getAgenciaId().getTipo().equals("RB")){
|
||||||
|
cmbTipoConta.setSelectedIndex(1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
|
@ -455,9 +459,15 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// if(puntoVenta.getDiversosId().getPosicao()!= null){
|
if(puntoVenta.getDiversosId().getPosicao() != null){
|
||||||
// cmbPosicao.setText(puntoVenta.getDiversosId().getPosicao());
|
if(puntoVenta.getDiversosId().getPosicao() .equals("FEL")){
|
||||||
// }
|
cmbTipoConta.setSelectedIndex(0);
|
||||||
|
}else if(puntoVenta.getDiversosId().getPosicao() .equals("EL")){
|
||||||
|
cmbTipoConta.setSelectedIndex(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if(puntoVenta.getDiversosId().getVendaInternet()!= null){
|
if(puntoVenta.getDiversosId().getVendaInternet()!= null){
|
||||||
if(puntoVenta.getDiversosId().getVendaInternet()){
|
if(puntoVenta.getDiversosId().getVendaInternet()){
|
||||||
|
@ -573,6 +583,7 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
||||||
puntoVenta.setPtovtaEstoqueList(new ArrayList<PtovtaEstoque>());
|
puntoVenta.setPtovtaEstoqueList(new ArrayList<PtovtaEstoque>());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
lsEstoque = puntoVenta.getPtovtaEstoqueList();
|
lsEstoque = puntoVenta.getPtovtaEstoqueList();
|
||||||
ptovtaEstoqueList.setData(lsEstoque);
|
ptovtaEstoqueList.setData(lsEstoque);
|
||||||
|
|
||||||
|
@ -602,6 +613,55 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void clearCombobox(Combobox combobox) {
|
||||||
|
|
||||||
|
int size = combobox.getItemCount();
|
||||||
|
|
||||||
|
for (int i = size - 1; i >= 0; i--){
|
||||||
|
combobox.removeItemAt(i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void popularCombobox(Combobox cmbConta, Combobox cmbPessoa, Combobox cmbForm, Combobox cmbLote, Combobox cmbPosicao) throws Exception{
|
||||||
|
|
||||||
|
clearCombobox(cmbConta);
|
||||||
|
clearCombobox(cmbPessoa);
|
||||||
|
clearCombobox(cmbForm);
|
||||||
|
clearCombobox(cmbLote);
|
||||||
|
clearCombobox(cmbPosicao);
|
||||||
|
|
||||||
|
for(PtovtaAgencia.enumTipoConta p : PtovtaAgencia.enumTipoConta.values() ){
|
||||||
|
Comboitem comboItem = new Comboitem(p.descricao());
|
||||||
|
comboItem.setValue(p.valor());
|
||||||
|
comboItem.setParent(cmbConta);
|
||||||
|
}
|
||||||
|
|
||||||
|
for(PtovtaAgencia.enumTipoPessoa p : PtovtaAgencia.enumTipoPessoa.values() ){
|
||||||
|
Comboitem comboItem = new Comboitem(p.descricao());
|
||||||
|
comboItem.setValue(p.valor());
|
||||||
|
comboItem.setParent(cmbPessoa);
|
||||||
|
}
|
||||||
|
|
||||||
|
for(PtovtaEstoque.gerarEnum p : PtovtaEstoque.gerarEnum.values() ){
|
||||||
|
Comboitem comboItem = new Comboitem(p.descricao());
|
||||||
|
comboItem.setValue(p.valor());
|
||||||
|
comboItem.setParent(cmbLote);
|
||||||
|
}
|
||||||
|
|
||||||
|
for(PtovtaEstoque.gerarEnum p : PtovtaEstoque.gerarEnum.values() ){
|
||||||
|
Comboitem comboItem = new Comboitem(p.descricao());
|
||||||
|
comboItem.setValue(p.valor());
|
||||||
|
comboItem.setParent(cmbForm);
|
||||||
|
}
|
||||||
|
|
||||||
|
for(PtovtaDiversos.gerarEnum p : PtovtaDiversos.gerarEnum.values() ){
|
||||||
|
Comboitem comboItem = new Comboitem(p.descricao());
|
||||||
|
comboItem.setValue(p.valor());
|
||||||
|
comboItem.setParent(cmbPosicao);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -1035,8 +1095,13 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
||||||
|
|
||||||
|
|
||||||
estoque.setEspecie(txtEspecie.getValue());
|
estoque.setEspecie(txtEspecie.getValue());
|
||||||
estoque.setFormCont((String) cmbForm.getSelectedItem().getValue());
|
if(cmbForm.getSelectedItem() != null){
|
||||||
estoque.setLoteform((String)cmbLote.getSelectedItem().getValue());
|
estoque.setFormCont( Integer.valueOf((String) cmbForm.getSelectedItem().getValue()));
|
||||||
|
}
|
||||||
|
if(cmbLote.getSelectedItem() != null){
|
||||||
|
estoque.setLoteform(Integer.valueOf((String) cmbLote.getSelectedItem().getValue()));
|
||||||
|
}
|
||||||
|
|
||||||
estoque.setQuantidade(txtQuant.getValue());
|
estoque.setQuantidade(txtQuant.getValue());
|
||||||
estoque.setPuntoventaId(puntoVenta);
|
estoque.setPuntoventaId(puntoVenta);
|
||||||
|
|
||||||
|
@ -1350,25 +1415,9 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
||||||
return PtovtaComissao.getReceitaList();
|
return PtovtaComissao.getReceitaList();
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<String> getPosicao(){
|
|
||||||
return PtovtaDiversos.getPosicaoList();
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<String> getPessoa() {
|
|
||||||
return PtovtaAgencia.getPessoaList();
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<String> getTipoConta() {
|
|
||||||
return PtovtaAgencia.getTipoContaList();
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<String> getForm() {
|
|
||||||
return PtovtaEstoque.getFormList();
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<String> getLote() {
|
|
||||||
return PtovtaEstoque.getLoteList();
|
|
||||||
}
|
|
||||||
|
|
||||||
public PuntoVenta getPuntoVenta() {
|
public PuntoVenta getPuntoVenta() {
|
||||||
return puntoVenta;
|
return puntoVenta;
|
||||||
|
|
|
@ -179,7 +179,7 @@ public class EditarCorridaController extends MyGenericForwardComposer {
|
||||||
@Override
|
@Override
|
||||||
public void doAfterCompose(Component comp) throws Exception {
|
public void doAfterCompose(Component comp) throws Exception {
|
||||||
super.doAfterCompose(comp);
|
super.doAfterCompose(comp);
|
||||||
MyComboboxEstandar.popularCombobox(cmbIndGeneraFeriado, this.getIndGeneraFeriado());
|
popularCombobox(cmbIndGeneraFeriado);
|
||||||
|
|
||||||
|
|
||||||
esquemaCorrida = (EsquemaCorrida) Executions.getCurrent().getArg().get("esquemaCorrida");
|
esquemaCorrida = (EsquemaCorrida) Executions.getCurrent().getArg().get("esquemaCorrida");
|
||||||
|
@ -198,7 +198,7 @@ public class EditarCorridaController extends MyGenericForwardComposer {
|
||||||
if (esquemaCorrida.getEsquemacorridaId() == null) {
|
if (esquemaCorrida.getEsquemacorridaId() == null) {
|
||||||
btnAdicionarTramo.setDisabled(true);
|
btnAdicionarTramo.setDisabled(true);
|
||||||
btnRemoverTramo.setDisabled(true);
|
btnRemoverTramo.setDisabled(true);
|
||||||
cmbIndGeneraFeriado.setSelectedIndex(0);
|
|
||||||
} else {
|
} else {
|
||||||
// 01 - Não se pode mudar dados básicos da corrida.
|
// 01 - Não se pode mudar dados básicos da corrida.
|
||||||
// 02 - Segundo a Lety os campos CLASE, MARCA E EMPRESAS...
|
// 02 - Segundo a Lety os campos CLASE, MARCA E EMPRESAS...
|
||||||
|
@ -339,6 +339,31 @@ public class EditarCorridaController extends MyGenericForwardComposer {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void clearCombobox(Combobox combobox) {
|
||||||
|
|
||||||
|
int size = combobox.getItemCount();
|
||||||
|
|
||||||
|
for (int i = size - 1; i >= 0; i--){
|
||||||
|
combobox.removeItemAt(i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void popularCombobox(Combobox cmb) throws Exception{
|
||||||
|
|
||||||
|
clearCombobox(cmb);
|
||||||
|
for(EsquemaCorrida.gerarFeriado p : EsquemaCorrida.gerarFeriado.values()){
|
||||||
|
Comboitem comboItem = new Comboitem(p.descricao());
|
||||||
|
comboItem.setValue(p.valor());
|
||||||
|
comboItem.setParent(cmb);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
cmb.setSelectedIndex(0);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
private void exibirDivision() {
|
private void exibirDivision() {
|
||||||
if (ApplicationProperties.getInstance().exibirDivisionConfiguracionCorrida()) {
|
if (ApplicationProperties.getInstance().exibirDivisionConfiguracionCorrida()) {
|
||||||
|
|
||||||
|
@ -480,13 +505,7 @@ public class EditarCorridaController extends MyGenericForwardComposer {
|
||||||
esquemaCorrida.setDiagramaAutobusId(esquemaCorrida.getRolOperativo().getDiagramaAutobus().getDiagramaautobusId().intValue());
|
esquemaCorrida.setDiagramaAutobusId(esquemaCorrida.getRolOperativo().getDiagramaAutobus().getDiagramaautobusId().intValue());
|
||||||
|
|
||||||
if(cmbIndGeneraFeriado.getSelectedItem() != null){
|
if(cmbIndGeneraFeriado.getSelectedItem() != null){
|
||||||
if(cmbIndGeneraFeriado.getSelectedItem().getValue().equals("GERAR SEMPRE")){
|
esquemaCorrida.setIndGeneraFeriado((String) cmbIndGeneraFeriado.getSelectedItem().getValue());
|
||||||
esquemaCorrida.setIndGeneraFeriado("S");
|
|
||||||
}else if (cmbIndGeneraFeriado.getSelectedItem().getValue().equals("GERAR SO QUANDO FOR FERIADO")){
|
|
||||||
esquemaCorrida.setIndGeneraFeriado("F");
|
|
||||||
}else if (cmbIndGeneraFeriado.getSelectedItem().getValue().equals("GERAR QUANDO NAO FOR FERIADO")){
|
|
||||||
esquemaCorrida.setIndGeneraFeriado("N");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (latente.isChecked()) {
|
if (latente.isChecked()) {
|
||||||
|
@ -1580,9 +1599,9 @@ public class EditarCorridaController extends MyGenericForwardComposer {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public List<String> getIndGeneraFeriado() {
|
// public List<String> getIndGeneraFeriado() {
|
||||||
return EsquemaCorrida.getTpGeneraFeriadoList();
|
// return EsquemaCorrida.getTpGeneraFeriadoList();
|
||||||
}
|
// }
|
||||||
|
|
||||||
public Button getBtnApagar() {
|
public Button getBtnApagar() {
|
||||||
return btnApagar;
|
return btnApagar;
|
||||||
|
|
|
@ -38,32 +38,6 @@ public class MyComboboxEstandar extends Combobox {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void clearCombobox(Combobox combobox) {
|
|
||||||
|
|
||||||
int size = combobox.getItemCount();
|
|
||||||
|
|
||||||
for (int i = size - 1; i >= 0; i--){
|
|
||||||
combobox.removeItemAt(i);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void popularCombobox(Combobox cmb, List<String> lista) throws Exception{
|
|
||||||
|
|
||||||
clearCombobox(cmb);
|
|
||||||
|
|
||||||
List<String> getList = lista;
|
|
||||||
|
|
||||||
if(!getList.isEmpty()){
|
|
||||||
|
|
||||||
for (String obj : getList) {
|
|
||||||
|
|
||||||
Comboitem comboItem = new Comboitem(obj);
|
|
||||||
comboItem.setValue(obj);
|
|
||||||
comboItem.setParent(cmb);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,14 +28,27 @@ public class PtovtaEstoqueRender implements ListitemRenderer {
|
||||||
Listcell lc = new Listcell(estoque.getEspecie());
|
Listcell lc = new Listcell(estoque.getEspecie());
|
||||||
lc.setParent(lstm);
|
lc.setParent(lstm);
|
||||||
|
|
||||||
lc = new Listcell(estoque.getFormCont());
|
if(estoque.getFormCont().equals(1)){
|
||||||
|
lc = new Listcell("SIM");
|
||||||
lc.setParent(lstm);
|
lc.setParent(lstm);
|
||||||
|
}else if(estoque.getFormCont().equals(0)){
|
||||||
|
lc = new Listcell("NÃO");
|
||||||
|
lc.setParent(lstm);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
lc = new Listcell(String.valueOf(estoque.getQuantidade()));
|
lc = new Listcell(String.valueOf(estoque.getQuantidade()));
|
||||||
lc.setParent(lstm);
|
lc.setParent(lstm);
|
||||||
|
|
||||||
lc = new Listcell(estoque.getLoteform());
|
|
||||||
|
if(estoque.getLoteform().equals(1)){
|
||||||
|
lc = new Listcell("SIM");
|
||||||
lc.setParent(lstm);
|
lc.setParent(lstm);
|
||||||
|
}else if(estoque.getLoteform().equals(0)){
|
||||||
|
lc = new Listcell("NÃO");
|
||||||
|
lc.setParent(lstm);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
lstm.setAttribute("data", estoque);
|
lstm.setAttribute("data", estoque);
|
||||||
|
|
|
@ -37,7 +37,7 @@
|
||||||
<tab label="${c:l('editarPuntoVentaController.tab.label.horario')}" />
|
<tab label="${c:l('editarPuntoVentaController.tab.label.horario')}" />
|
||||||
<tab label="${c:l('indexController.mniFormaPago.label')}" />
|
<tab label="${c:l('indexController.mniFormaPago.label')}" />
|
||||||
<tab label="${c:l('editarPuntoVentaController.tab.label.recoleccion')}" />
|
<tab label="${c:l('editarPuntoVentaController.tab.label.recoleccion')}" />
|
||||||
<tab label="${c:l('editarPuntoVentaController.tab.label.empVenta')}" />
|
<tab visible="false" label="${c:l('editarPuntoVentaController.tab.label.empVenta')}" />
|
||||||
<tab visible="false" label="${c:l('editarPuntoVentaController.tab.label.usuBancario')}" />
|
<tab visible="false" label="${c:l('editarPuntoVentaController.tab.label.usuBancario')}" />
|
||||||
<tab label="${c:l('editarPuntoVentaController.tab.label.estoque')}" />
|
<tab label="${c:l('editarPuntoVentaController.tab.label.estoque')}" />
|
||||||
</tabs>
|
</tabs>
|
||||||
|
@ -589,8 +589,6 @@
|
||||||
<row>
|
<row>
|
||||||
<label value="${c:l('editarConfiguracionAgenciaBancariaController.lbPessoa.value')}" />
|
<label value="${c:l('editarConfiguracionAgenciaBancariaController.lbPessoa.value')}" />
|
||||||
<combobox id="cmbPessoa"
|
<combobox id="cmbPessoa"
|
||||||
value="@{winEditarPuntoVenta$composer.puntoVenta.agenciaId.pessoa}"
|
|
||||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar"
|
|
||||||
width="70%" mold="rounded" buttonVisible="true"/>
|
width="70%" mold="rounded" buttonVisible="true"/>
|
||||||
|
|
||||||
</row>
|
</row>
|
||||||
|
@ -1039,7 +1037,7 @@
|
||||||
<rows>
|
<rows>
|
||||||
<row>
|
<row>
|
||||||
<label value="${c:l('editarConfiguracionEstoqueController.lbEspecie.value')}" />
|
<label value="${c:l('editarConfiguracionEstoqueController.lbEspecie.value')}" />
|
||||||
<textbox id="txtEspecie" maxlength="15"
|
<textbox id="txtEspecie" maxlength="3"
|
||||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyTextbox"
|
use="com.rjconsultores.ventaboletos.web.utilerias.MyTextbox"
|
||||||
constraint="no empty" width="70%" />
|
constraint="no empty" width="70%" />
|
||||||
</row>
|
</row>
|
||||||
|
|
Loading…
Reference in New Issue