diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/pricing/EditarPricingOcupaAntecipaController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/pricing/EditarPricingOcupaAntecipaController.java index fc7ca7f2d..8cc6ffb34 100644 --- a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/pricing/EditarPricingOcupaAntecipaController.java +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/pricing/EditarPricingOcupaAntecipaController.java @@ -54,22 +54,44 @@ public class EditarPricingOcupaAntecipaController extends MyGenericForwardCompos } public void onClick$btnAdicionarOcupaAntecipa(Event ev) throws Exception { + + if ((cantasientosmin.getValue() != null || cantasientosmax.getValue() != null) + && (ocupacioninicial.getValue() != null || ocupacionfinal.getValue() != null)){ + Messagebox.show(Labels.getLabel("editarPricingController.ocupacionErrada.centoPorCant"), + Labels.getLabel("editarPricingController.windowOcupacion.title"), + Messagebox.OK, Messagebox.EXCLAMATION); -// if ((cantasientosmin.getValue() != null || cantasientosmax.getValue() != null) -// && (ocupacioninicial.getValue() != null || ocupacionfinal.getValue() != null)){ -// Messagebox.show(Labels.getLabel("editarPricingController.ocupacionErrada.centoPorCant"), -// Labels.getLabel("editarPricingController.windowOcupacion.title"), -// Messagebox.OK, Messagebox.EXCLAMATION); -// -// return; -// } -// -// -// if ((cantasientosmin.getValue() != null && cantasientosmax.getValue() != null) -// || (cantdiasmin.getValue() != null && cantdiasmax.getValue() != null)) { + return; + } + + if ((cantasientosmin.getValue() == null && cantasientosmax.getValue() == null) + && (cantasientosmin.getValue() == null && cantasientosmax.getValue() == null) + && (ocupacioninicial.getValue() == null && ocupacionfinal.getValue() == null) + && (ocupacioninicial.getValue() == null && ocupacionfinal.getValue() == null) + && (cantdiasmin.getValue() == null && cantdiasmax.getValue() == null) + && (cantdiasmin.getValue() == null && cantdiasmax.getValue() == null)) { + Messagebox.show(Labels.getLabel("editarPricingController.ocupacionErrada.ocAnt"), + Labels.getLabel("editarPricingController.windowOcupacion.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + + return; + } + + if ((cantasientosmin.getValue() == null && cantasientosmax.getValue() != null) + || (cantasientosmin.getValue() != null && cantasientosmax.getValue() == null) + || (ocupacioninicial.getValue() == null && ocupacionfinal.getValue() != null) + || (ocupacioninicial.getValue() != null && ocupacionfinal.getValue() == null) + || (cantdiasmin.getValue() == null && cantdiasmax.getValue() != null) + || (cantdiasmin.getValue() != null && cantdiasmax.getValue() == null)) { + Messagebox.show(Labels.getLabel("editarPricingController.ocupacionErrada.MinMax"), + Labels.getLabel("editarPricingController.windowOcupacion.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + + return; + } if (porcentaje.getValueDecimal() != null && importe.getValueDecimal() != null) { - + Messagebox.show(Labels.getLabel("editarPricingController.ocupacionErrada.centoDin"), Labels.getLabel("editarPricingController.windowOcupacion.title"), Messagebox.OK, Messagebox.EXCLAMATION); @@ -96,12 +118,6 @@ public class EditarPricingOcupaAntecipaController extends MyGenericForwardCompos } } } - -// } else { -// Messagebox.show(Labels.getLabel("editarPricingController.ocupacionErrada.ocAnt"), -// Labels.getLabel("editarPricingController.windowOcupacion.title"), -// Messagebox.OK, Messagebox.EXCLAMATION); -// } } public void onClick$btnRemoverOcupaAntecipa(Event ev) { diff --git a/web/WEB-INF/i3-label_pt_BR.label b/web/WEB-INF/i3-label_pt_BR.label index 337f6b58e..ad64f99b8 100644 --- a/web/WEB-INF/i3-label_pt_BR.label +++ b/web/WEB-INF/i3-label_pt_BR.label @@ -2166,6 +2166,7 @@ editarPricingController.ocupacionErrada.value = Ocupação mínima maior que ocu editarPricingController.ocupacionErrada.centoDin = Deve ser inserido a quantidade em porcentagem % ou em R$. editarPricingController.ocupacionErrada.centoPorCant = Informe ou a quantiade poltronas ou a porcentagem de ocupação editarPricingController.ocupacionErrada.ocAnt = Deve ser inserido ocupação e/ou os dias de antecipação. +editarPricingController.ocupacionErrada.MinMax = Deve ser inserido Máximo/Inicio e Máximo/Final. editarPricingController.ocupacionErrada = Ocupação informada se sobrepõe com outra já existente. editarPricingController.anticipacionPorcentaje.value = Porcentagem maior que 100% editarPricingController.anticipacionErrada.value = Antecipação mínima maior que ocupação máxima.