fixes bug#9803

fixes bug#9100

Commit de código... (Ainda em desenvolvimento... )

git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@76189 d1611594-4594-4d17-8e1d-87c2c4800839
master
rafael.henrique 2017-11-08 18:31:09 +00:00
parent 594888873f
commit 7c92da34f3
8 changed files with 307 additions and 1 deletions

View File

@ -0,0 +1,116 @@
package com.rjconsultores.ventaboletos.web.gui.controladores.relatorios;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import org.zkoss.zhtml.Filedownload;
import org.zkoss.zk.ui.Component;
import org.zkoss.zk.ui.event.Event;
import org.zkoss.zul.Combobox;
import org.zkoss.zul.Comboitem;
import org.zkoss.zul.Datebox;
import com.rjconsultores.ventaboletos.ArquivoRemessa;
import com.rjconsultores.ventaboletos.entidad.Empresa;
import com.rjconsultores.ventaboletos.entidad.FechamentoBoleto;
import com.rjconsultores.ventaboletos.layouts.CNABFactory;
import com.rjconsultores.ventaboletos.layouts.RemessaInterface;
import com.rjconsultores.ventaboletos.service.ArquivoRemessaCNAB;
import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer;
import com.rjconsultores.ventaboletos.web.utilerias.MyListbox;
import com.rjconsultores.ventaboletos.web.utilerias.render.RenderFechamentoBoleto;
@Controller("relatorioArquivoRemessaCNABController")
@Scope("prototype")
public class RelatorioArquivoRemessaCNABController extends MyGenericForwardComposer {
private MyListbox boletoFechamentoList;
private List<Empresa> lsEmpresas;
private List<FechamentoBoleto> lsFechamentoBoletos;
private Empresa empresa;
private Combobox cmbEmpresa;
private Datebox fecBoletoIni;
private Datebox fecBoletoFin;
@Autowired
private ArquivoRemessaCNAB arquivoRemessaCNAB;
@Override
public void doAfterCompose(Component comp) throws Exception {
this.lsFechamentoBoletos = this.arquivoRemessaCNAB.obtenerTodosParaRemessa(null, null, null);
this.lsEmpresas = this.arquivoRemessaCNAB.getEmpresas();
super.doAfterCompose(comp);
for (Empresa e : this.lsEmpresas) {
Comboitem comboItem = new Comboitem(e.getNombempresa());
comboItem.setValue(e);
comboItem.setParent(this.cmbEmpresa);
}
this.boletoFechamentoList.setItemRenderer(new RenderFechamentoBoleto());
this.boletoFechamentoList.setData(this.lsFechamentoBoletos);
}
public void onClick$btnPesquisar(Event ev) throws Exception {
Empresa empresa = (Empresa) cmbEmpresa.getSelectedItem().getValue();
this.lsFechamentoBoletos = arquivoRemessaCNAB.obtenerTodosParaRemessa(empresa, this.fecBoletoIni.getValue(), this.fecBoletoFin.getValue());
this.boletoFechamentoList.setData(this.lsFechamentoBoletos);
}
public void onClick$btnExecutarRemessa(Event ev) throws Exception {
empresa = (Empresa) cmbEmpresa.getSelectedItem().getValue();
if(empresa == null){
return;
}
if(fecBoletoIni.getValue() == null || fecBoletoFin.getValue() == null){
return;
}
ArquivoRemessa arquivoRemessa = arquivoRemessaCNAB.remessa(empresa, fecBoletoIni.getValue(), fecBoletoFin.getValue());
RemessaInterface remessaInterface = CNABFactory.createRemessa(arquivoRemessa.getBancoLayout());
File fileRemessa = new File(arquivoRemessa.getNomeArquivo());
List<String> conteudoArquivoRemessa = remessaInterface.gerarRemessa(fileRemessa, arquivoRemessa);
InputStream is = null;
is = new FileInputStream(fileRemessa);
Filedownload.save(is, "application/txt", arquivoRemessa.getNomeArquivo());
arquivoRemessaCNAB.atualizaRemessa(empresa, arquivoRemessa);
}
public void onClick$btnImportarRetornoRemessa(Event ev) throws Exception {
}
public Empresa getEmpresa() {
return empresa;
}
public void setEmpresa(Empresa empresa) {
this.empresa = empresa;
}
}

View File

@ -0,0 +1,25 @@
package com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorios;
import org.zkoss.util.resource.Labels;
import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria;
import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema;
public class ItemMenuRelatorioRemessaCNAB extends DefaultItemMenuSistema {
public ItemMenuRelatorioRemessaCNAB() {
super("indexController.mniRelatorioRemessaCNAB.label");
}
@Override
public String getClaveMenu() {
return "COM.RJCONSULTORES.ADMINISTRACION.GUI.RELATORIOS.MENU.RELATORIOREMESSACNAB";
}
@Override
public void ejecutar() {
PantallaUtileria.openWindow("/gui/relatorios/filtroRelatorioRemessaCNAB.zul",
Labels.getLabel("relatorioRemessaCNAB.window.title"), getArgs(), desktop);
}
}

View File

@ -191,6 +191,7 @@ analitico.gerenciais.pacote=com.rjconsultores.ventaboletos.web.utilerias.menu.it
analitico.gerenciais.pacote.boletos=com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorios.ItemMenuRelatorioVendasPacotesBoletos analitico.gerenciais.pacote.boletos=com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorios.ItemMenuRelatorioVendasPacotesBoletos
analitico.gerenciais.pacote.detalhado=com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorios.ItemMenuRelatorioVendasPacotesDetalhado analitico.gerenciais.pacote.detalhado=com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorios.ItemMenuRelatorioVendasPacotesDetalhado
analitico.gerenciais.pacote.resumido=com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorios.ItemMenuRelatorioVendasPacotesResumido analitico.gerenciais.pacote.resumido=com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorios.ItemMenuRelatorioVendasPacotesResumido
analitico.gerenciais.relatorioRemessaCNAB=com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorios.ItemMenuRelatorioRemessaCNAB
analitico.integracion=com.rjconsultores.ventaboletos.web.utilerias.menu.item.analitico.integracion.SubMenuIntegracion analitico.integracion=com.rjconsultores.ventaboletos.web.utilerias.menu.item.analitico.integracion.SubMenuIntegracion
analitico.integracion.sisdap=com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorios.ItemMenuRelatorioSisdap analitico.integracion.sisdap=com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorios.ItemMenuRelatorioSisdap
analitico.integracion.aidf=com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorios.ItemMenuRelatorioAidf analitico.integracion.aidf=com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorios.ItemMenuRelatorioAidf

View File

@ -0,0 +1,48 @@
package com.rjconsultores.ventaboletos.web.utilerias.render;
import java.text.DecimalFormat;
import java.text.NumberFormat;
import java.text.SimpleDateFormat;
import java.util.Locale;
import org.zkoss.zul.Listcell;
import org.zkoss.zul.Listitem;
import org.zkoss.zul.ListitemRenderer;
import com.rjconsultores.ventaboletos.entidad.FechamentoBoleto;
public class RenderFechamentoBoleto implements ListitemRenderer {
NumberFormat numberFormat = NumberFormat.getCurrencyInstance(new Locale("pt", "BR"));
@Override
public void render(Listitem lstm, Object o) throws Exception {
FechamentoBoleto fechamentoBoleto = (FechamentoBoleto) o;
Listcell lc = new Listcell();
lc = new Listcell(fechamentoBoleto.getFechamentoCntcorrente().getEmpresa().getNombempresa());
lc.setParent(lstm);
lc = new Listcell(fechamentoBoleto.getFechamentoCntcorrente().getPuntoventa().getNombpuntoventa());
lc.setParent(lstm);
lc = new Listcell(fechamentoBoleto.getNossonumero());
lc.setParent(lstm);
lc = new Listcell(new SimpleDateFormat("dd/MM/yyyy").format(fechamentoBoleto.getFecdocumento()));
lc.setParent(lstm);
lc = new Listcell(numberFormat.format(fechamentoBoleto.getValordocumento().doubleValue()));
lc.setParent(lstm);
String id = (fechamentoBoleto.getRemessaId() != null) ? "Sim" : "Não";
lc = new Listcell(id);
lc.setParent(lstm);
lstm.setAttribute("data", fechamentoBoleto);
}
}

View File

@ -392,6 +392,8 @@
<value>com.rjconsultores.ventaboletos.entidad.FiscalImpressoraEstado</value> <value>com.rjconsultores.ventaboletos.entidad.FiscalImpressoraEstado</value>
<value>com.rjconsultores.ventaboletos.entidad.FechamentoParamgeral</value> <value>com.rjconsultores.ventaboletos.entidad.FechamentoParamgeral</value>
<value>com.rjconsultores.ventaboletos.entidad.FechamentoParamptovta</value> <value>com.rjconsultores.ventaboletos.entidad.FechamentoParamptovta</value>
<value>com.rjconsultores.ventaboletos.entidad.FechamentoBoleto</value>
<value>com.rjconsultores.ventaboletos.entidad.FechamentoCntcorrente</value>
<value>com.rjconsultores.ventaboletos.entidad.TipoIdentificacion</value> <value>com.rjconsultores.ventaboletos.entidad.TipoIdentificacion</value>
<value>com.rjconsultores.ventaboletos.entidad.Hotel</value> <value>com.rjconsultores.ventaboletos.entidad.Hotel</value>
<value>com.rjconsultores.ventaboletos.entidad.PrecoApanhe</value> <value>com.rjconsultores.ventaboletos.entidad.PrecoApanhe</value>
@ -459,7 +461,9 @@
<value>com.rjconsultores.ventaboletos.entidad.RutaEmbarqueDesembarque</value> <value>com.rjconsultores.ventaboletos.entidad.RutaEmbarqueDesembarque</value>
<value>com.rjconsultores.ventaboletos.entidad.EsquemaCorridaEmbarqueDesembarque</value> <value>com.rjconsultores.ventaboletos.entidad.EsquemaCorridaEmbarqueDesembarque</value>
<value>com.rjconsultores.ventaboletos.entidad.ContaMD</value> <value>com.rjconsultores.ventaboletos.entidad.ContaMD</value>
<value>com.rjconsultores.ventaboletos.entidad.PtovtaContaMD</value> <value>com.rjconsultores.ventaboletos.entidad.MensagemRecusa</value> </list> <value>com.rjconsultores.ventaboletos.entidad.PtovtaContaMD</value>
<value>com.rjconsultores.ventaboletos.entidad.MensagemRecusa</value>
</list>
</property> </property>
<property name="hibernateProperties"> <property name="hibernateProperties">

View File

@ -294,6 +294,8 @@ indexController.mniRelatorioImpressaoPosterior.label=Impresión posterior
indexController.mniRelatorioServicoBloqueadoVendaInternet.label = Corrida bloqueada en venta internet indexController.mniRelatorioServicoBloqueadoVendaInternet.label = Corrida bloqueada en venta internet
indexController.mniRelatorioDocumentosFiscais.label = Report Documentos Fiscais indexController.mniRelatorioDocumentosFiscais.label = Report Documentos Fiscais
indexController.mniRelatorioRemessaCNAB.label = Remessa de Lote (CNAB 400)
indexController.mnSubMenuImpressaoFiscal.label=Impresión fiscal indexController.mnSubMenuImpressaoFiscal.label=Impresión fiscal
indexController.mnSubMenuRelatorioImpressaoFiscal.label=Importación fiscal indexController.mnSubMenuRelatorioImpressaoFiscal.label=Importación fiscal
indexController.mniTotnaofiscalEmpresa.label=Totalizadores No-Fiscales indexController.mniTotnaofiscalEmpresa.label=Totalizadores No-Fiscales
@ -7183,6 +7185,22 @@ relatorioFinanceiroReceitasDespesasController.lb.evento = Por Evento
relatorioFinanceiroReceitasDespesasController.lbEventoExtra.value = Evento relatorioFinanceiroReceitasDespesasController.lbEventoExtra.value = Evento
relatorioFinanceiroReceitasDespesasController.lbNumDocumento.value=Nº Documento relatorioFinanceiroReceitasDespesasController.lbNumDocumento.value=Nº Documento
# Relatório CNAB
indexController.mniRelatorioRemessaCNAB.label = Remessa de Lote (CNAB 400)
relatorioRemessaCNAB.window.title = Remessa de Lote de Boletos Bancários
relatorioRemessaCNAB.lbEmpresa.value = Empresa
relatorioRemessaCNAB.lbFec.value = Data emissão
relatorioRemessaCNAB.lbAte.value = até
relatorioRemessaCNAB.btnPesquisar.label = Pequisar
relatorioRemessaCNAB.btnGerarRemessa.label = Gerar Remessa
relatorioRemessaCNAB.btnImportarRetornoRemessa.label = Importar Retorno
relatorioRemessaCNAB.lbEmpresa.value = Empresa
relatorioRemessaCNAB.lbEmpresaSacado.value = Sacador
relatorioRemessaCNAB.lbNossoNumero.value = Nosso Número
relatorioRemessaCNAB.lbDataEmissao.value = Dt. Emissão
relatorioRemessaCNAB.lbValor.value = Valor
relatorioRemessaCNAB.lbRemessa.value = Enviado
# Relatório Vendas com Parcelamento # Relatório Vendas com Parcelamento
relatorioVendasParcelamentoController.window.title = Ventas con Parcelamiento relatorioVendasParcelamentoController.window.title = Ventas con Parcelamiento
relatorioVendasParcelamentoController.lbDataFin.value = Fecha Final relatorioVendasParcelamentoController.lbDataFin.value = Fecha Final

View File

@ -7672,6 +7672,22 @@ relatorioBaixasVendasInternetController.lbFecInicio.value=Data Início
relatorioBaixasVendasInternetController.lbFecFinal.value=Data Fim relatorioBaixasVendasInternetController.lbFecFinal.value=Data Fim
relatorioBaixasVendasInternetController.lbPuntoVenta.value=Ponto de Venda relatorioBaixasVendasInternetController.lbPuntoVenta.value=Ponto de Venda
# Relatório CNAB
indexController.mniRelatorioRemessaCNAB.label = Remessa de Lote (CNAB 400)
relatorioRemessaCNAB.window.title = Remessa de Lote de Boletos Bancários
relatorioRemessaCNAB.lbEmpresa.value = Empresa
relatorioRemessaCNAB.lbFec.value = Data emissão
relatorioRemessaCNAB.lbAte.value = até
relatorioRemessaCNAB.btnPesquisar.label = Pequisar
relatorioRemessaCNAB.btnGerarRemessa.label = Gerar Remessa
relatorioRemessaCNAB.btnImportarRetornoRemessa.label = Importar Retorno
relatorioRemessaCNAB.lbEmpresa.value = Empresa
relatorioRemessaCNAB.lbEmpresaSacado.value = Sacador
relatorioRemessaCNAB.lbNossoNumero.value = Nosso Número
relatorioRemessaCNAB.lbDataEmissao.value = Dt. Emissão
relatorioRemessaCNAB.lbValor.value = Valor
relatorioRemessaCNAB.lbRemessa.value = Enviado
# Relatório Vendas com Parcelamento # Relatório Vendas com Parcelamento
relatorioVendasParcelamentoController.window.title = Vendas com Parcelamento relatorioVendasParcelamentoController.window.title = Vendas com Parcelamento

View File

@ -0,0 +1,78 @@
<?xml version="1.0" encoding="UTF-8"?>
<?page contentType="text/html;charset=UTF-8"?>
<?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?>
<?init class="org.zkoss.zkplus.databind.AnnotateDataBinderInit" arg0="winFiltroRelatorioRemessaCNAB"?>
<?taglib uri="http://www.zkoss.org/dsp/web/core" prefix="c"?>
<zk xmlns="http://www.zkoss.org/2005/zul">
<window id="winFiltroRelatorioRemessaCNAB" border="normal"
apply="${relatorioArquivoRemessaCNABController}" width="480px"
height="590px" contentStyle="overflow:auto"
title="${c:l('relatorioRemessaCNAB.window.title')}"
xmlns:h="http://www.w3.org/1999/xhtml">
<grid fixedLayout="true">
<columns>
<column width="30%" />
<column width="35%" />
<column width="35%" />
</columns>
<rows>
<row>
<!-- Empresa -->
<label
value="${c:l('relatorioRemessaCNAB.lbEmpresa.value')}" />
<combobox id="cmbEmpresa"
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar"
mold="rounded" buttonVisible="true" width="70%"
selectedItem="@{winFiltroRelatorioRemessaCNAB$composer.empresa}" />
</row>
<row>
<label
value="${c:l('relatorioRemessaCNAB.lbFec.value')}" />
<cell colspan="2">
<datebox id="fecBoletoIni" width="130px"
format="dd/MM/yyyy" constraint="no empty"
maxlength="10" />
<space />
<label
value="${c:l('relatorioRemessaCNAB.lbAte.value')}" />
<space />
<datebox id="fecBoletoFin" width="130px"
format="dd/MM/yyyy" constraint="no empty"
maxlength="10" />
</cell>
</row>
</rows>
</grid>
<toolbar>
<button id="btnPesquisar"
image="/gui/img/enginer.png"
label="${c:l('relatorioRemessaCNAB.btnPesquisar.label')}" />
<button id="btnExecutarRemessa"
image="/gui/img/enginer.png"
label="${c:l('relatorioRemessaCNAB.btnGerarRemessa.label')}" />
<button id="btnImportarRetorno"
image="/gui/img/enginer.png"
label="${c:l('relatorioRemessaCNAB.btnImportarRetornoRemessa.label')}" />
</toolbar>
<listbox id="boletoFechamentoList"
use="com.rjconsultores.ventaboletos.web.utilerias.MyListbox"
multiple="false" height="90%">
<listhead sizable="true">
<listheader image="/gui/img/builder.gif" label="${c:l('relatorioRemessaCNAB.lbEmpresa.value')}" width="20%"/>
<listheader image="/gui/img/builder.gif" label="${c:l('relatorioRemessaCNAB.lbEmpresaSacado.value')}" width="20%" />
<listheader image="/gui/img/builder.gif" label="${c:l('relatorioRemessaCNAB.lbNossoNumero.value')}" width="20%" />
<listheader image="/gui/img/builder.gif" label="${c:l('relatorioRemessaCNAB.lbDataEmissao.value')}" width="20%" />
<listheader image="/gui/img/builder.gif" label="${c:l('relatorioRemessaCNAB.lbValor.value')}" width="20%" />
<listheader image="/gui/img/builder.gif" label="${c:l('relatorioRemessaCNAB.lbRemessa.value')}" width="20%" />
</listhead>
</listbox>
</window>
</zk>