From d0263a7f637ecdd3e84ad39c3553a4e6577f24c8 Mon Sep 17 00:00:00 2001 From: "daniel.zauli" Date: Thu, 14 Jan 2016 17:39:30 +0000 Subject: [PATCH] fixes bug #7034 git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@51912 d1611594-4594-4d17-8e1d-87c2c4800839 --- .../gr/AidfListItemRenderer.java | 20 +++++++++---------- .../gr/EditarAidfController.java | 13 ++++++++++++ web/WEB-INF/i3-label_es_MX.label | 1 + web/WEB-INF/i3-label_pt_BR.label | 1 + web/gui/gr/editarAidf.zul | 9 ++++++--- 5 files changed, 31 insertions(+), 13 deletions(-) diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/gr/AidfListItemRenderer.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/gr/AidfListItemRenderer.java index a16457a33..9a5ba0de2 100644 --- a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/gr/AidfListItemRenderer.java +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/gr/AidfListItemRenderer.java @@ -18,37 +18,37 @@ public class AidfListItemRenderer implements ListitemRenderer { Listcell idCell = new Listcell(aidf.getAidfId().toString()); idCell.setParent(listItem); - Listcell especieCell = new Listcell(aidf.getAidfEspecie().toString()); + Listcell especieCell = aidf.getAidfEspecie() == null ? new Listcell("") : new Listcell(aidf.getAidfEspecie().toString()); especieCell.setParent(listItem); - Listcell tipoCell = new Listcell(aidf.getAidfTipo().toString()); + Listcell tipoCell = aidf.getAidfTipo() == null ? new Listcell("") : new Listcell(aidf.getAidfTipo().toString()); tipoCell.setParent(listItem); - Listcell estadoCell = new Listcell(aidf.getEstado().toString()); + Listcell estadoCell = aidf.getEstado() == null ? new Listcell("") : new Listcell(aidf.getEstado().toString()); estadoCell.setParent(listItem); - Listcell empresaCell = new Listcell(aidf.getEmpresa().toString()); + Listcell empresaCell = aidf.getEmpresa() == null ? new Listcell("") : new Listcell(aidf.getEmpresa().toString()); empresaCell.setParent(listItem); Listcell inscEstadualCell = StringUtils.isBlank(aidf.getInscestadual())?new Listcell("") :new Listcell(aidf.getInscestadual()); inscEstadualCell.setParent(listItem); - Listcell docFiscalCell = new Listcell(aidf.getDocfiscal()); + Listcell docFiscalCell = aidf.getDocfiscal() == null ? new Listcell("") : new Listcell(aidf.getDocfiscal()); docFiscalCell.setParent(listItem); - Listcell acFiscalCell = new Listcell(aidf.getAcfiscal()); + Listcell acFiscalCell = aidf.getAcfiscal() == null ? new Listcell("") : new Listcell(aidf.getAcfiscal()); acFiscalCell.setParent(listItem); - Listcell serieCell = new Listcell(aidf.getSerie()); + Listcell serieCell = aidf.getSerie() == null ? new Listcell("") : new Listcell(aidf.getSerie()); serieCell.setParent(listItem); - Listcell subserieCell = new Listcell(aidf.getSubserie()); + Listcell subserieCell = aidf.getSubserie() == null ? new Listcell("") : new Listcell(aidf.getSubserie()); subserieCell.setParent(listItem); - Listcell formInicialCell = new Listcell(aidf.getForminicial()); + Listcell formInicialCell = aidf.getForminicial() == null ? new Listcell("") : new Listcell(aidf.getForminicial()); formInicialCell.setParent(listItem); - Listcell formFinalCell = new Listcell(aidf.getFormfinal()); + Listcell formFinalCell = aidf.getFormfinal() == null ? new Listcell("") : new Listcell(aidf.getFormfinal()); formFinalCell.setParent(listItem); SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy"); diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/gr/EditarAidfController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/gr/EditarAidfController.java index 0b615eee3..1906aa410 100644 --- a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/gr/EditarAidfController.java +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/gr/EditarAidfController.java @@ -173,12 +173,25 @@ public class EditarAidfController extends MyGenericForwardComposer { cmbEstado.getValue(); cmbInscestadual.getValue(); txtSerie.getValue(); + txtForminicial.getValue(); + txtFormfinal.getValue(); + txtDocFiscal.getValue(); + Comboitem inscEstadualSeleccionada = cmbInscestadual.getSelectedItem(); String _inscestadual = inscEstadualSeleccionada != null ? inscEstadualSeleccionada.getValue().toString() : ""; aidf.setInscestadual(_inscestadual); + Long x = aidfService.validarDocFiscalSerieFormInicialFinal(aidf); + if(x != -1){ + Messagebox.show( + Labels.getLabel("editarAidfController.btnSalvar.MSG.conflitoFormIniFin", new Object[] { x }), + Labels.getLabel("editarAidfController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + return; + } + aidf.setActivo(true); aidf.setFecmodif(Calendar.getInstance().getTime()); aidf.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); diff --git a/web/WEB-INF/i3-label_es_MX.label b/web/WEB-INF/i3-label_es_MX.label index 03bb124ac..78074e11f 100644 --- a/web/WEB-INF/i3-label_es_MX.label +++ b/web/WEB-INF/i3-label_es_MX.label @@ -5518,6 +5518,7 @@ editarAidfController.MSG.suscribirOK=Aidf se guardó exitosamente! La movimentac editarAidfController.MSG.noWrite=Não será possível editar ou excluir esta AIDF uma vez que existem passagens vinculadas à mesma editarAidfController.btnApagar.MSG.Deseja.Borrar = Deseja eliminar esta AIDF? editarAidfController.btnApagar.MSG.borrarOK = AIDF Excluida com Sucesso. +editarAidfController.btnSalvar.MSG.conflitoFormIniFin = Os campos 'Form.Inicial' e/ou 'Form.Final' desta Aidf estão dentro do intervalo dos mesmos campos da Aidf de ID {0} de mesma 'Série' e 'Doc.Fiscal'. movimentacionBilhetesController.window.title=Movimentación de estoque movimentacionBilhetesController.MSG.suscribirOK=Movimentación se guardó exitosamente! diff --git a/web/WEB-INF/i3-label_pt_BR.label b/web/WEB-INF/i3-label_pt_BR.label index 8b88e4462..30d87f742 100644 --- a/web/WEB-INF/i3-label_pt_BR.label +++ b/web/WEB-INF/i3-label_pt_BR.label @@ -5599,6 +5599,7 @@ editarAidfController.MSG.suscribirOK=Aidf gravada com sucesso! A movimentação editarAidfController.MSG.noWrite=Não será possível editar ou excluir esta AIDF uma vez que existem passagens vinculadas à mesma editarAidfController.btnApagar.MSG.Deseja.Borrar = Deseja eliminar esta AIDF? editarAidfController.btnApagar.MSG.borrarOK = AIDF Excluida com Sucesso. +editarAidfController.btnSalvar.MSG.conflitoFormIniFin = Os campos 'Form.Inicial' e/ou 'Form.Final' desta Aidf estão dentro do intervalo dos mesmos campos da Aidf de ID {0} de mesma 'Série' e 'Doc.Fiscal'. movimentacionBilhetesController.window.title=Movimentação de Estoque movimentacionBilhetesController.MSG.suscribirOK=Movimentação gravada com sucesso! diff --git a/web/gui/gr/editarAidf.zul b/web/gui/gr/editarAidf.zul index 69b5a5b27..2a37f1b7e 100644 --- a/web/gui/gr/editarAidf.zul +++ b/web/gui/gr/editarAidf.zul @@ -61,7 +61,8 @@ value="${c:l('busquedaAidfController.docfiscal.label')}" /> + use="com.rjconsultores.ventaboletos.web.utilerias.MyTextbox" + constraint="no empty"/>