Issue #9792: Impresora en red con stock de pasaje único

git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@74219 d1611594-4594-4d17-8e1d-87c2c4800839
master
luis 2017-09-25 18:17:17 +00:00
parent 96c6243de7
commit bceba25ec0
1 changed files with 32 additions and 2 deletions

View File

@ -631,8 +631,8 @@ public class EditarEstacionController extends MyGenericForwardComposer {
} }
txtNomImpressoara.setText(""); txtNomImpressoara.setText("");
txtNomeArquivoLayout.setText(""); txtNomeArquivoLayout.setText("");
txtNomImpressoara.setDisabled(Boolean.FALSE); txtNomImpressoara.setDisabled(Boolean.TRUE);
txtNomeArquivoLayout.setDisabled(Boolean.FALSE); txtNomeArquivoLayout.setDisabled(Boolean.TRUE);
cmbEstacion.setSelectedItem(null); cmbEstacion.setSelectedItem(null);
List<Estacion> lsEstacion = estacionService.buscarEstacionesStockCentral(estacion.getPuntoVenta()); List<Estacion> lsEstacion = estacionService.buscarEstacionesStockCentral(estacion.getPuntoVenta());
BindingListModel dictModel = new BindingListModelList(lsEstacion, false); BindingListModel dictModel = new BindingListModelList(lsEstacion, false);
@ -640,4 +640,34 @@ public class EditarEstacionController extends MyGenericForwardComposer {
} }
} }
public void onChange$cmbEstacion(Event ev) {
Comboitem item = (Comboitem) cmbEstacion.getSelectedItem();
if (item == null || item.getValue() == null) {
return;
}
try{
Comboitem cbiEmpresa = cmbEmpresaImpressora.getSelectedItem();
Estacion est = (Estacion)item.getValue();
est = estacionService.obtenerID(est.getEstacionId());
Empresa empresa = (Empresa) cbiEmpresa.getValue();
for(EstacionImpresora ei: est.getLsEstacionImpresora()){
//Si la mepresa es la misma que se selecciono para la nueva impresora
if(empresa != null &&
empresa.getEmpresaId().intValue() == ei.getEmpresa().getEmpresaId().intValue()){
//Si el tipo de impresora es STOCK_CENTRAL
if(ei.getTipoImpressora().intValue() == 6){
txtNomImpressoara.setText(ei.getNombImpresora());
txtNomeArquivoLayout.setText(ei.getNombArchivoLayout());
break;
}
}
}
}catch(Exception e){
e.printStackTrace();
}
}
} }