diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/EditarConfiguracionCancelacionController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/EditarConfiguracionCancelacionController.java index 66f6173f8..d6454e7cd 100644 --- a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/EditarConfiguracionCancelacionController.java +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/EditarConfiguracionCancelacionController.java @@ -151,8 +151,6 @@ public class EditarConfiguracionCancelacionController extends MyGenericForwardCo radioImp.setChecked(true); onClick$radioImp(null); - txtMaximo.setValue("0"); - txtMaximo.setDisabled(true); } else { cancelacionCtrl = cancelacionCtrlService.obtenerID(cancelacionCtrl.getCancelacionctrlId()); @@ -191,26 +189,24 @@ public class EditarConfiguracionCancelacionController extends MyGenericForwardCo } public void motivosCancelacion() { - if (cancelacionCtrl.getMotivoCancelacion() == null) { + if(!txtMaximo.getValue().equals("") && txtMinimo.getValue().equals("")){ + txtMinimo.setValue(""); + txtMinimo.setDisabled(true); + }else if(!txtMinimo.getValue().equals("") && txtMaximo.getValue().equals("")){ txtMaximo.setValue(""); txtMaximo.setDisabled(true); + }else{ + txtMaximo.setDisabled(false); txtMinimo.setDisabled(false); - txtMinimo.setConstraint("no empty"); - } else { - if (cancelacionCtrl.getMotivoCancelacion().getMotivocancelacionId().equals(13)) { - txtMinimo.setConstraint(""); - txtMinimo.setValue(""); - txtMinimo.setDisabled(true); - txtMaximo.setDisabled(false); - txtMaximo.setConstraint("no empty"); - } else { - txtMaximo.setConstraint(""); - txtMaximo.setValue(""); - txtMaximo.setDisabled(true); - txtMinimo.setDisabled(false); - txtMinimo.setConstraint("no empty"); - } } + + } + + public void onChange$txtMaximo(Event e){ + motivosCancelacion(); + } + public void onChange$txtMinimo(Event e){ + motivosCancelacion(); } public void onChange$cmbParadaOrigem(Event e) { @@ -430,9 +426,26 @@ public class EditarConfiguracionCancelacionController extends MyGenericForwardCo boolean existe = false; for (CancelacionCargo cc : lsCancelacionCargo) { + if(cc.getTiempominimo()!= null && txtMaximo!=null && !txtMaximo.getValue().isEmpty() + && txtMaximo.getValueDecimal().compareTo(cc.getTiempominimo()) > 0){ + Messagebox.show( + Labels.getLabel("editarConfiguracionCancelacionController.MSG.tempoMaximoMaior"), + Labels.getLabel("editarCategoriaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + return; + + }else if(cc.getTiempomaximo()!= null && txtMinimo!=null && txtMinimo.getValueDecimal()!= null + && txtMinimo.getValueDecimal().compareTo(cc.getTiempomaximo()) < 0){ + Messagebox.show( + Labels.getLabel("editarConfiguracionCancelacionController.MSG.tempoMinimoMenor"), + Labels.getLabel("editarCategoriaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + return; + } if (cc.getTiempomaximo() == null) { continue; } + } if (!existe) { diff --git a/web/WEB-INF/i3-label_pt_BR.label b/web/WEB-INF/i3-label_pt_BR.label index 3054c5d6c..f0ddb42db 100644 --- a/web/WEB-INF/i3-label_pt_BR.label +++ b/web/WEB-INF/i3-label_pt_BR.label @@ -1332,9 +1332,11 @@ editarConfiguracionCancelacionController.importe.label = Valor editarConfiguracionCancelacionController.btnAddCorrida.tooltiptext = Incluir editarConfiguracionCancelacionController.btnBorrarCorrida.tooltiptext = Eliminar editarConfiguracionCancelacionController.MSG.obsAntes = Antes da saída do serviço -editarConfiguracionCancelacionController.MSG.obsDespues = Depois da saída do serviço +editarConfiguracionCancelacionController.MSG.obsDespues = Até a saída do serviço editarConfiguracionCancelacionController.MSG.selectItemDiferente = Igualdade de origem e de destino. editarConfiguracionCancelacionController.MSG.selectItemTodas = Somente aceita TODOS em destino quando origem também é TODOS. +editarConfiguracionCancelacionController.MSG.tempoMinimoMenor = Tempo mínimo não pode ser menor que tempo máximo. +editarConfiguracionCancelacionController.MSG.tempoMaximoMaior = Tempo máximo não pode ser maior que tempo máximo. # Muestra o formulario de Pesquisa configuracional Pago busquedaConfiguracionFormaPagoController.window.title = Configuração de método de Forma de Pagamento