From a34e2135738f21c6700deddaced3642d8139f45e Mon Sep 17 00:00:00 2001 From: julio Date: Fri, 26 May 2017 20:17:58 +0000 Subject: [PATCH] bug #8977 git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@69361 d1611594-4594-4d17-8e1d-87c2c4800839 --- .../templates/RelatorioImpressaoRMD.jasper | Bin 31077 -> 31074 bytes .../templates/RelatorioImpressaoRMD.jrxml | 60 ++++++++-------- .../BusquedaImpressaoRMDController.java | 64 ++++++++++-------- .../ventaboletos/web/utilerias/MyAppInit.java | 35 +++++----- web/WEB-INF/i3-label_pt_BR.label | 4 +- .../impressaofiscal/busquedaImpressaoRMD.zul | 12 ++-- 6 files changed, 93 insertions(+), 82 deletions(-) diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioImpressaoRMD.jasper b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioImpressaoRMD.jasper index 21c7860825adcd6c6443860c53140c1dec23bae3..97394e7f087079e32b78f75dbe25cfb85f788d64 100644 GIT binary patch delta 1237 zcmZwG&ubGw6bJB~3Pmr?O1ID-X)r3923oQDCq_#$bAV>+Z#X{@uHo;$r zLGfB>9TlNaEaJg{D6Xd>o+^U3Vvn8#|A6);1##Y+so3u9;k_5W^W#IZ`L#`cZj<*n zG}0E#Xx|UAX7yGHYpb#A&{~hIKzkj(1uc5425s@U%NpIWd+4WFG{~GdLn3VoQTVf@ zC@o9$U92y7b216bHxoAri3G#RSfux`K9EhD89k$?_;bov9*~!HyeV2> zswiJ_9((=;(>y4L13F~4xAGI{hST1~N7#%cz^~mfLY)hjGVR1P7J{iG!yS2M^F8MsSGbA;$tbniDoUCOmfM?z;iMOZ1{+t$+i|vc$nt ziGv5|5FE*&vzzZ-3T4 zGuZ&Kh|*V@nyu8``5D)l^X8{&wTfFB8=2J8S;I`3x}l#ojY(s0P|pVOE5G9%nk=HJ GyT)IO5`CKh delta 1281 zcmZwF&1(}u7zXf}szpJ`#`Ht9jaJuM1BPr&wn=RSX_~k(X`5&eyo8{YwlpR-p|mPR zPzrjgPCyS*w6q63S+=Jhya{SSEcGuCJbJL;!HYQWJ7baTEbKc^_Sv2MSoYgC{k~1# zjIglmoKr->y$6AyfB4>>QEXWRAY9kzL`SY0pKU@8eIj z58Q(X>+w5$VGH^ZwwUa&6N!Gf`XC9qr`_VBVf9h!W|OHyten^A0k$V!XAe`ywKiZ> z_~u08qiKx&>^aQ7q%6GzKXFV{s?c8}& z%qt9{MT3lB5K&=}g~Kq9@8ZQ!0v)Ft9s7qZ{TVoL)D;fVqC-Y-h^TPL!r`c+WB15K zbYvSH(<7F?0uCHY3WsRXAtN|MR5)bea4fM4*~i*4|2`ex#jmWTuYm!_s=^>zG{^`B z5fuhmI1H=!E`H?JwGwwY-o@r+OaBZG92*LUXwe}fI7C!9WZ`gZpyT6}bM&VDCV!qr z{Ga};zvCo7jZxyujZPM8<*D(qRjN#lR;$HwE)y>pp=da0m_aiT3PlQ0!!Uc#+DEVc S?rLvUb~Sdt-^ - - + + @@ -39,131 +39,131 @@ - <band height="102" splitType="Stretch"> + <band splitType="Stretch"/> + + + - + - + - + - + - + - + - + - - - - + - + - + - + - + - + - + - + - + - + - + @@ -175,37 +175,37 @@ - + - + - + - + - + - + diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/impressaofiscal/BusquedaImpressaoRMDController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/impressaofiscal/BusquedaImpressaoRMDController.java index 81339e8ea..45716b095 100644 --- a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/impressaofiscal/BusquedaImpressaoRMDController.java +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/impressaofiscal/BusquedaImpressaoRMDController.java @@ -65,7 +65,7 @@ public class BusquedaImpressaoRMDController extends MyGenericForwardComposer { private Datebox datInicial; private Datebox datFinal; - + private MyTextbox folioInicial; private MyComboboxEstandar cmbEmpresa; @@ -112,43 +112,34 @@ public class BusquedaImpressaoRMDController extends MyGenericForwardComposer { }; cmbAidf.setItemRenderer(aidfRenderer); cmbAidf.setModel(new BindingListModelList(lsAidf, true)); - } @SuppressWarnings({ "rawtypes", "unchecked" }) - public void onClick$btnExecutar(Event ev) throws InterruptedException { + private void executarImpressao(boolean isView, boolean isExecutarRmd, boolean isCancelarRmd) throws InterruptedException { + Empresa empresa = cmbEmpresa.getSelectedItem() == null ? null : (Empresa) cmbEmpresa.getSelectedItem().getValue(); Estado estado = cmbEstado.getSelectedItem() == null ? null : (Estado) cmbEstado.getSelectedItem().getValue(); Aidf aidf = cmbAidf.getSelectedItem() == null ? null : (Aidf) cmbAidf.getSelectedItem().getValue(); - int respAidf = Messagebox.NO; - if (empresa != null && estado != null) { try { String rmd = null; if (aidf != null) { - rmd = aidf.getDocfiscal(); - respAidf = Messagebox.show( - Labels.getLabel("busquedaImpressaoRMDController.MSG.gravarRMDPergunta"), - Labels.getLabel("busquedaImpressaoRMDController.mnImpressaoRMD.label"), - Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); - // closeWindow(); - } else { Messagebox.show(Labels.getLabel("busquedaImpressaoRMDController.select.RMD"), Labels.getLabel("busquedaImpressaoRMDController.mnImpressaoRMD.label"), Messagebox.OK, Messagebox.INFORMATION); + return; } - - + String folio = folioInicial.getValue(); if (folio == null) { - respAidf = Messagebox.show( + Messagebox.show( Labels.getLabel("busquedaImpressaoRMDController.select.RMD"), Labels.getLabel("busquedaImpressaoRMDController.mnImpressaoRMD.label"), Messagebox.OK, Messagebox.INFORMATION); - return; + return; } List list = null; @@ -162,21 +153,25 @@ public class BusquedaImpressaoRMDController extends MyGenericForwardComposer { datInicial.getValue(), datFinal.getValue(), empresa, estado, rmd, folio); } - if (respAidf == Messagebox.YES) { - fiscalService.gravarRMDBoleto(dataSourceRead.getConnection(), list, aidf); + if (isExecutarRmd) + fiscalService.gravarRMDBoleto(dataSourceRead.getConnection(), list, aidf, folio); + + if (isCancelarRmd) + fiscalService.cancelarRMDBoleto(dataSourceRead.getConnection(), datInicial.getValue(), datFinal.getValue(), empresa, estado, aidf, folio); + + if (!isCancelarRmd) { + Map parametros = new HashMap(); + parametros.put("list", list); + + Relatorio relatorio = new RelatorioImpressaoRMD(parametros, dataSourceRead.getConnection()); + + Map args = new HashMap(); + args.put("relatorio", relatorio); + + openWindow("/component/reportView.zul", + Labels.getLabel("indexController.mnImpressaoRMD.label"), args, MODAL); } - Map parametros = new HashMap(); - parametros.put("list", list); - - Relatorio relatorio = new RelatorioImpressaoRMD(parametros, dataSourceRead.getConnection()); - - Map args = new HashMap(); - args.put("relatorio", relatorio); - - openWindow("/component/reportView.zul", - Labels.getLabel("indexController.mnImpressaoRMD.label"), args, MODAL); - } catch (InterruptedException e) { log.error("", e); } catch (WrongValueException e) { @@ -191,7 +186,18 @@ public class BusquedaImpressaoRMDController extends MyGenericForwardComposer { Messagebox.OK, Messagebox.INFORMATION); } } + } + public void onClick$btnView(Event ev) throws InterruptedException { + executarImpressao(true, false, false); + } + + public void onClick$btnExecutar(Event ev) throws InterruptedException { + executarImpressao(false, true, false); + } + + public void onClick$btnCancelar(Event ev) throws InterruptedException { + executarImpressao(false, false, true); } public List getLsEmpresa() { diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/MyAppInit.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/MyAppInit.java index d9ea00965..84142c6d6 100644 --- a/src/java/com/rjconsultores/ventaboletos/web/utilerias/MyAppInit.java +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/MyAppInit.java @@ -8,6 +8,7 @@ import javax.servlet.ServletContext; import javax.sql.DataSource; import org.apache.log4j.Logger; +import org.flywaydb.core.Flyway; import org.quartz.JobDetail; import org.quartz.Scheduler; import org.quartz.SchedulerException; @@ -85,23 +86,23 @@ public class MyAppInit implements org.zkoss.zk.ui.util.WebAppInit { FlyWay.getInstance().defineDataSource(getDataSoure()); FlyWay.getInstance().start(); -// log.info("Executando Flyway..."); -// -// try{ -// final Flyway flyway = new Flyway(); -// -// flyway.setDataSource(getDataSoure()); -// flyway.setValidateOnMigrate(false); -// flyway.setIgnoreFutureMigrations(true); -// flyway.setOutOfOrder(true); -// flyway.setBaselineOnMigrate(true); -// -// flyway.migrate(); -// }catch(Throwable t){ -// log.error("Erro ao executar o flyway",t); -// } -// -// log.info("Flyway executado."); + log.info("Executando Flyway..."); + + try{ + final Flyway flyway = new Flyway(); + + flyway.setDataSource(getDataSoure()); + flyway.setValidateOnMigrate(false); + flyway.setIgnoreFutureMigrations(true); + flyway.setOutOfOrder(true); + flyway.setBaselineOnMigrate(true); + + flyway.migrate(); + }catch(Throwable t){ + log.error("Erro ao executar o flyway",t); + } + + log.info("Flyway executado."); } private boolean ipBloqueadoGeracaoServico() { diff --git a/web/WEB-INF/i3-label_pt_BR.label b/web/WEB-INF/i3-label_pt_BR.label index 3dc4a7870..dda0489f7 100644 --- a/web/WEB-INF/i3-label_pt_BR.label +++ b/web/WEB-INF/i3-label_pt_BR.label @@ -6513,7 +6513,9 @@ busquedaImportacionFiscalController.btnExe.label = Executar Importação #busquedaImportacionFiscalController.btnExeNaoFiscal.label = Importação Não Fiscal #busquedaImportacionFiscalController.btnExeImportacionReducaoZ.label = Importação Fiscal Redução Z -busquedaExportacaoFiscalController.btnExe.label = Executar Exportação +busquedaExportacaoFiscalController.btnView.label = Visualização +busquedaExportacaoFiscalController.btnExe.label = Executar Exportação +busquedaExportacaoFiscalController.btnCancel.label = Cancelar/Inativar editarRelgerencialEmpresaController.MSG.suscribirOK=Relatorio Gerencial gravado com sucesso! editarRelgerencialEmpresaController.window.title=Impressão Fiscal :: Editar Relatorio Gerencial diff --git a/web/gui/impressaofiscal/busquedaImpressaoRMD.zul b/web/gui/impressaofiscal/busquedaImpressaoRMD.zul index acd9dbd83..71b623800 100644 --- a/web/gui/impressaofiscal/busquedaImpressaoRMD.zul +++ b/web/gui/impressaofiscal/busquedaImpressaoRMD.zul @@ -72,12 +72,8 @@ - @@ -85,8 +81,14 @@ +