fixes bug#11035
dev:julio qua:julio git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@82304 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
a9272d85db
commit
c78c521731
|
@ -40,6 +40,7 @@ public class RelatorioFinanceiroAnalitico extends Relatorio {
|
|||
Date fim = (Date) parametros.get("fim");
|
||||
Empresa empresa = (Empresa) parametros.get("empresa");
|
||||
TipoPuntoVenta tipoPuntoVenta = (TipoPuntoVenta) parametros.get("tipoPuntoVenta");
|
||||
boolean isBpe = (Boolean) parametros.get("isBpe");
|
||||
|
||||
List<Estado> estados = (List<Estado>) parametros.get("estados");
|
||||
String ufs = null;
|
||||
|
@ -52,7 +53,7 @@ public class RelatorioFinanceiroAnalitico extends Relatorio {
|
|||
|
||||
String pdvs = (String) parametros.get("agencias");
|
||||
|
||||
NamedParameterStatement stmt = new NamedParameterStatement(getConexao(), getSql(ufs, pdvs, tipoPuntoVenta == null ? -1 : tipoPuntoVenta.getTipoptovtaId().intValue()));
|
||||
NamedParameterStatement stmt = new NamedParameterStatement(getConexao(), getSql(ufs, pdvs, tipoPuntoVenta == null ? -1 : tipoPuntoVenta.getTipoptovtaId().intValue(), isBpe));
|
||||
stmt.setInt("EMPRESA_ID", empresa.getEmpresaId());
|
||||
stmt.setTimestamp("DATE_INICIO", new java.sql.Timestamp(DateUtil.inicioFecha(inicio).getTime()));
|
||||
stmt.setTimestamp("DATE_FIM", new java.sql.Timestamp(DateUtil.fimFecha(fim).getTime()));
|
||||
|
@ -150,7 +151,7 @@ public class RelatorioFinanceiroAnalitico extends Relatorio {
|
|||
protected void processaParametros() throws Exception {
|
||||
}
|
||||
|
||||
private String getSql(String ufs, String pdvs, Integer tipoptovtaId) {
|
||||
private String getSql(String ufs, String pdvs, Integer tipoptovtaId, boolean isBpe) {
|
||||
|
||||
StringBuilder sql = new StringBuilder(18000);
|
||||
sql.append(" SELECT * ");
|
||||
|
@ -335,7 +336,8 @@ public class RelatorioFinanceiroAnalitico extends Relatorio {
|
|||
sql.append(" AND agrc.fechorVenta = eed.fechorVenta ");
|
||||
sql.append(" LEFT JOIN ");
|
||||
sql.append(" (select empresaId, fechorVenta, sum(tarifa) receita_rdi_bpr from ( ");
|
||||
sql.append(" SELECT DISTINCT c.caja_id AS cajaId, ");
|
||||
sql.append(" SELECT DISTINCT ");
|
||||
sql.append(isBpe ? " c.boleto_id as cajaId, " : " c.caja_id as cajaId, ");
|
||||
sql.append(" e.empresa_id AS empresaId, ");
|
||||
sql.append(" TRUNC(c.feccreacion) AS fechorVenta, ");
|
||||
sql.append(" COALESCE(c.preciopagado, 0)AS tarifa, ");
|
||||
|
@ -343,33 +345,20 @@ public class RelatorioFinanceiroAnalitico extends Relatorio {
|
|||
sql.append(" COALESCE(c.importepedagio, 0) AS pedagio, ");
|
||||
sql.append(" COALESCE(c.importeseguro, 0) AS seguro, ");
|
||||
sql.append(" COALESCE(c.importeoutros, 0) AS outros ");
|
||||
sql.append(" FROM caja c ");
|
||||
sql.append(" INNER JOIN marca m ");
|
||||
sql.append(" ON m.marca_id = c.marca_id ");
|
||||
sql.append(" AND m.activo = 1 ");
|
||||
sql.append(" INNER JOIN empresa e ");
|
||||
sql.append(" ON e.empresa_id = m.empresa_id ");
|
||||
sql.append(" INNER JOIN punto_venta pv ");
|
||||
sql.append(" ON pv.puntoventa_id = c.puntoventa_id ");
|
||||
sql.append(" INNER JOIN parada p ");
|
||||
sql.append(" ON pv.parada_id = p.parada_id ");
|
||||
sql.append(" INNER JOIN ciudad co ");
|
||||
sql.append(" ON co.ciudad_id = p.ciudad_id ");
|
||||
sql.append(" INNER JOIN estado eo ");
|
||||
sql.append(" ON eo.estado_id = co.estado_id ");
|
||||
sql.append(" WHERE c.activo = 1 ");
|
||||
sql.append(" AND p.activo = 1 ");
|
||||
sql.append(" AND co.activo = 1 ");
|
||||
sql.append(" AND eo.activo = 1 ");
|
||||
sql.append(" AND c.serieimpfiscal IS NOT NULL ");
|
||||
sql.append(" AND ((c.indreimpresion = 0 ");
|
||||
sql.append(" AND c.motivocancelacion_id IS NULL ");
|
||||
sql.append(" AND c.numfoliosistema IS NOT NULL) ");
|
||||
sql.append(" OR (c.indstatusboleto = 'E' ");
|
||||
sql.append(" AND c.indreimpresion = 1)) ");
|
||||
sql.append(isBpe ? " from boleto c " : " FROM caja c ");
|
||||
sql.append(isBpe ? " inner join bpe bpe on bpe.boleto_id = c.boleto_id " : "");
|
||||
sql.append(" INNER JOIN marca m ON m.marca_id = c.marca_id AND m.activo = 1 ");
|
||||
sql.append(" INNER JOIN empresa e ON e.empresa_id = m.empresa_id ");
|
||||
sql.append(" INNER JOIN punto_venta pv ON pv.puntoventa_id = c.puntoventa_id ");
|
||||
sql.append(" INNER JOIN parada p ON pv.parada_id = p.parada_id ");
|
||||
sql.append(" INNER JOIN ciudad co ON co.ciudad_id = p.ciudad_id ");
|
||||
sql.append(" INNER JOIN estado eo ON eo.estado_id = co.estado_id ");
|
||||
sql.append(" WHERE c.activo = 1 AND p.activo = 1 AND co.activo = 1 AND eo.activo = 1 ");
|
||||
sql.append(isBpe ? " and bpe.bpe_id is not null " : " AND c.serieimpfiscal IS NOT NULL ");
|
||||
sql.append(" AND ((c.indreimpresion = 0 AND c.motivocancelacion_id IS NULL ");
|
||||
sql.append(" AND c.numfoliosistema IS NOT NULL) OR (c.indstatusboleto = 'E' AND c.indreimpresion = 1)) ");
|
||||
sql.append(" AND (COALESCE(c.preciopagado,0) + COALESCE(c.importetaxaembarque,0) + COALESCE(c.importeseguro,0) + COALESCE(c.importepedagio,0) + COALESCE(c.importeoutros,0)) > 0 ");
|
||||
sql.append(" AND c.feccreacion >= :DATE_INICIO ");
|
||||
sql.append(" AND c.feccreacion <= :DATE_FIM ");
|
||||
sql.append(" AND c.feccreacion >= :DATE_INICIO AND c.feccreacion <= :DATE_FIM ");
|
||||
sql.append(" AND c.empresacorrida_id = 10 ");
|
||||
|
||||
sql.append(ufs == null ? "" : " and eo.estado_id in ( " + ufs + " ) ");
|
||||
|
|
|
@ -40,6 +40,7 @@ public class RelatorioFinanceiroSintetico extends Relatorio {
|
|||
Date fim = (Date) parametros.get("fim");
|
||||
Empresa empresa = (Empresa) parametros.get("empresa");
|
||||
TipoPuntoVenta tipoPuntoVenta = (TipoPuntoVenta) parametros.get("tipoPuntoVenta");
|
||||
boolean isBpe = (Boolean) parametros.get("isBpe");
|
||||
|
||||
List<Estado> estados = (List<Estado>) parametros.get("estados");
|
||||
String ufs = null;
|
||||
|
@ -52,7 +53,7 @@ public class RelatorioFinanceiroSintetico extends Relatorio {
|
|||
|
||||
String pdvs = (String)parametros.get("agencias");
|
||||
|
||||
NamedParameterStatement stmt = new NamedParameterStatement(getConexao(), getSql(ufs, pdvs, tipoPuntoVenta == null ? -1 : tipoPuntoVenta.getTipoptovtaId().intValue()));
|
||||
NamedParameterStatement stmt = new NamedParameterStatement(getConexao(), getSql(ufs, pdvs, tipoPuntoVenta == null ? -1 : tipoPuntoVenta.getTipoptovtaId().intValue(), isBpe));
|
||||
stmt.setInt("EMPRESA_ID", empresa.getEmpresaId());
|
||||
stmt.setTimestamp("DATE_INICIO", new java.sql.Timestamp(DateUtil.inicioFecha(inicio).getTime()));
|
||||
stmt.setTimestamp("DATE_FIM", new java.sql.Timestamp(DateUtil.fimFecha(fim).getTime()));
|
||||
|
@ -151,7 +152,7 @@ public class RelatorioFinanceiroSintetico extends Relatorio {
|
|||
protected void processaParametros() throws Exception {
|
||||
}
|
||||
|
||||
private String getSql(String ufs, String pdvs, Integer tipoptovtaId) {
|
||||
private String getSql(String ufs, String pdvs, Integer tipoptovtaId, boolean isBpe) {
|
||||
|
||||
StringBuilder sql = new StringBuilder(20000);
|
||||
sql.append(" SELECT * ");
|
||||
|
@ -358,7 +359,8 @@ public class RelatorioFinanceiroSintetico extends Relatorio {
|
|||
sql.append(" AND agrc.estadoId = eed.estadoId ");
|
||||
sql.append(" LEFT JOIN ");
|
||||
sql.append(" (select empresaId, puntoventaId, estadoId, sum(tarifa) receita_rdi_bpr from ( ");
|
||||
sql.append(" SELECT DISTINCT c.caja_id AS cajaId, ");
|
||||
sql.append(" SELECT DISTINCT ");
|
||||
sql.append(isBpe ? " c.boleto_id as cajaId, " : " c.caja_id as cajaId, ");
|
||||
sql.append(" e.empresa_id AS empresaId, ");
|
||||
sql.append(" pv.puntoventa_id AS puntoventaId, ");
|
||||
sql.append(" eo.estado_id AS estadoId, ");
|
||||
|
@ -367,33 +369,23 @@ public class RelatorioFinanceiroSintetico extends Relatorio {
|
|||
sql.append(" COALESCE(c.importepedagio, 0) AS pedagio, ");
|
||||
sql.append(" COALESCE(c.importeseguro, 0) AS seguro, ");
|
||||
sql.append(" COALESCE(c.importeoutros, 0) AS outros ");
|
||||
sql.append(" FROM caja c ");
|
||||
sql.append(" INNER JOIN marca m ");
|
||||
sql.append(" ON m.marca_id = c.marca_id ");
|
||||
sql.append(" AND m.activo = 1 ");
|
||||
sql.append(" INNER JOIN empresa e ");
|
||||
sql.append(" ON e.empresa_id = m.empresa_id ");
|
||||
sql.append(" INNER JOIN punto_venta pv ");
|
||||
sql.append(" ON pv.puntoventa_id = c.puntoventa_id ");
|
||||
sql.append(" INNER JOIN parada p ");
|
||||
sql.append(" ON pv.parada_id = p.parada_id ");
|
||||
sql.append(" INNER JOIN ciudad co ");
|
||||
sql.append(" ON co.ciudad_id = p.ciudad_id ");
|
||||
sql.append(" INNER JOIN estado eo ");
|
||||
sql.append(" ON eo.estado_id = co.estado_id ");
|
||||
sql.append(isBpe ? " from boleto c " : " FROM caja c ");
|
||||
sql.append(isBpe ? " inner join bpe bpe on bpe.boleto_id = c.boleto_id " : "");
|
||||
sql.append(" INNER JOIN marca m ON m.marca_id = c.marca_id AND m.activo = 1 ");
|
||||
sql.append(" INNER JOIN empresa e ON e.empresa_id = m.empresa_id ");
|
||||
sql.append(" INNER JOIN punto_venta pv ON pv.puntoventa_id = c.puntoventa_id ");
|
||||
sql.append(" INNER JOIN parada p ON pv.parada_id = p.parada_id ");
|
||||
sql.append(" INNER JOIN ciudad co ON co.ciudad_id = p.ciudad_id ");
|
||||
sql.append(" INNER JOIN estado eo ON eo.estado_id = co.estado_id ");
|
||||
sql.append(" WHERE c.activo = 1 ");
|
||||
sql.append(" AND p.activo = 1 ");
|
||||
sql.append(" AND co.activo = 1 ");
|
||||
sql.append(" AND eo.activo = 1 ");
|
||||
sql.append(" AND c.serieimpfiscal IS NOT NULL ");
|
||||
sql.append(" AND ((c.indreimpresion = 0 ");
|
||||
sql.append(" AND c.motivocancelacion_id IS NULL ");
|
||||
sql.append(" AND c.numfoliosistema IS NOT NULL) ");
|
||||
sql.append(" OR (c.indstatusboleto = 'E' ");
|
||||
sql.append(" AND c.indreimpresion = 1)) ");
|
||||
sql.append(isBpe ? " and bpe.bpe_id is not null " : " AND c.serieimpfiscal IS NOT NULL ");
|
||||
sql.append(" AND ((c.indreimpresion = 0 AND c.motivocancelacion_id IS NULL ");
|
||||
sql.append(" AND c.numfoliosistema IS NOT NULL) OR (c.indstatusboleto = 'E' AND c.indreimpresion = 1)) ");
|
||||
sql.append(" AND (COALESCE(c.preciopagado,0) + COALESCE(c.importetaxaembarque,0) + COALESCE(c.importeseguro,0) + COALESCE(c.importepedagio,0) + COALESCE(c.importeoutros,0)) > 0 ");
|
||||
sql.append(" AND c.feccreacion >= :DATE_INICIO ");
|
||||
sql.append(" AND c.feccreacion <= :DATE_FIM ");
|
||||
sql.append(" AND c.feccreacion >= :DATE_INICIO AND c.feccreacion <= :DATE_FIM ");
|
||||
sql.append(" AND c.empresacorrida_id = 10 ");
|
||||
|
||||
sql.append(ufs == null ? "" : " and eo.estado_id in ( " + ufs + " ) ");
|
||||
|
|
|
@ -0,0 +1,145 @@
|
|||
package com.rjconsultores.ventaboletos.web.gui.controladores.bpe;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.InputStream;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Scope;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.zkoss.zk.ui.Component;
|
||||
import org.zkoss.zk.ui.event.Event;
|
||||
import org.zkoss.zul.Comboitem;
|
||||
import org.zkoss.zul.Datebox;
|
||||
import org.zkoss.zul.Filedownload;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||
import com.rjconsultores.ventaboletos.entidad.Estado;
|
||||
import com.rjconsultores.ventaboletos.service.BpeService;
|
||||
import com.rjconsultores.ventaboletos.service.EmpresaService;
|
||||
import com.rjconsultores.ventaboletos.service.EstadoService;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer;
|
||||
|
||||
@Controller("busquedaBpeExportacaoController")
|
||||
@Scope("prototype")
|
||||
public class BusquedaBpeExportacaoController extends MyGenericForwardComposer {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private static Logger log = Logger.getLogger(BusquedaBpeExportacaoController.class);
|
||||
|
||||
@Autowired
|
||||
private BpeService bpeService;
|
||||
|
||||
@Autowired
|
||||
private EmpresaService empresaService;
|
||||
|
||||
@Autowired
|
||||
private EstadoService estadoService;
|
||||
|
||||
private List<Empresa> lsEmpresa;
|
||||
private List<Estado> lsEstado;
|
||||
|
||||
private Datebox datInicial;
|
||||
private Datebox datFinal;
|
||||
|
||||
private MyComboboxEstandar cmbEmpresa;
|
||||
private MyComboboxEstandar cmbEstado;
|
||||
|
||||
@Override
|
||||
public void doAfterCompose(Component comp) throws Exception {
|
||||
lsEmpresa = empresaService.obtenerTodos();
|
||||
lsEstado = estadoService.obtenerTodos();
|
||||
|
||||
super.doAfterCompose(comp);
|
||||
}
|
||||
|
||||
public void onClick$btnExeExportacao(Event ev) throws InterruptedException {
|
||||
Empresa empresa = null;
|
||||
Estado estado = null;
|
||||
|
||||
Comboitem itemEmpresa = cmbEmpresa.getSelectedItem();
|
||||
Comboitem itemEstado = cmbEstado.getSelectedItem();
|
||||
|
||||
if (itemEmpresa != null) {
|
||||
empresa = (Empresa) itemEmpresa.getValue();
|
||||
}
|
||||
|
||||
if (itemEstado != null) {
|
||||
estado = (Estado) itemEstado.getValue();
|
||||
}
|
||||
|
||||
if (empresa != null && estado != null) {
|
||||
String nomeArquivo = getNomeArquivoExportacaoECF(datInicial.getValue(), estado, "BPE");
|
||||
File arquivo = bpeService.buscarArquivoExportacaoBPE(datInicial.getValue(), datFinal.getValue(), empresa, estado, nomeArquivo);
|
||||
|
||||
try {
|
||||
downloadArquivo(arquivo, nomeArquivo);
|
||||
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private String getNomeArquivoExportacaoECF(Date dataInicial, Estado estado, String tipo) {
|
||||
String[] mesano = new SimpleDateFormat("MM/yyyy").format(dataInicial).split("/");
|
||||
|
||||
String mes = mesano[0].toString();
|
||||
String ano = mesano[1].toString();
|
||||
|
||||
String nome = "";
|
||||
|
||||
switch (Integer.valueOf(mes)) {
|
||||
case 1: nome = "Jan"; break;
|
||||
case 2: nome = "Fev"; break;
|
||||
case 3: nome = "Mar"; break;
|
||||
case 4: nome = "Abr"; break;
|
||||
case 5: nome = "Mai"; break;
|
||||
case 6: nome = "Jun"; break;
|
||||
case 7: nome = "Jul"; break;
|
||||
case 8: nome = "Ago"; break;
|
||||
case 9: nome = "Set"; break;
|
||||
case 10: nome = "Out"; break;
|
||||
case 11: nome = "Nov"; break;
|
||||
case 12: nome = "Dez"; break;
|
||||
default: break;
|
||||
}
|
||||
|
||||
String nomeArquivo = "TotalBus " + estado.getCveestado() + " " + tipo + " " + nome + ano;
|
||||
|
||||
return nomeArquivo;
|
||||
}
|
||||
|
||||
private void downloadArquivo(File arquivoTxt, String nome) throws Exception {
|
||||
String contentType = "application/notepad";
|
||||
InputStream isFile = new FileInputStream(arquivoTxt);
|
||||
String nomeArquivo = arquivoTxt.getName();
|
||||
|
||||
if (nome != null && !nome.isEmpty()) {
|
||||
nomeArquivo = nome + ".fs";
|
||||
}
|
||||
|
||||
Filedownload.save(isFile, contentType, nomeArquivo);
|
||||
|
||||
if (arquivoTxt != null) {
|
||||
arquivoTxt.delete();
|
||||
}
|
||||
}
|
||||
|
||||
public List<Empresa> getLsEmpresa() {
|
||||
return lsEmpresa;
|
||||
}
|
||||
|
||||
public List<Estado> getLsEstado() {
|
||||
return lsEstado;
|
||||
}
|
||||
|
||||
public void setLsEstado(List<Estado> lsEstado) {
|
||||
this.lsEstado = lsEstado;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,131 @@
|
|||
package com.rjconsultores.ventaboletos.web.gui.controladores.bpe;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Scope;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.zkoss.util.resource.Labels;
|
||||
import org.zkoss.zhtml.Messagebox;
|
||||
import org.zkoss.zk.ui.Component;
|
||||
import org.zkoss.zk.ui.event.Event;
|
||||
import org.zkoss.zul.Datebox;
|
||||
import org.zkoss.zul.Radio;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||
import com.rjconsultores.ventaboletos.entidad.Estado;
|
||||
import com.rjconsultores.ventaboletos.relatorios.impl.RelatorioRDI;
|
||||
import com.rjconsultores.ventaboletos.relatorios.utilitarios.Relatorio;
|
||||
import com.rjconsultores.ventaboletos.service.BpeService;
|
||||
import com.rjconsultores.ventaboletos.service.EmpresaService;
|
||||
import com.rjconsultores.ventaboletos.service.EstadoService;
|
||||
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||
import com.rjconsultores.ventaboletos.utilerias.fiscal.vo.FiscalRdi;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.MyListbox;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.render.RenderEstadoUf;
|
||||
|
||||
@Controller("busquedaBpeRdiController")
|
||||
@Scope("prototype")
|
||||
public class BusquedaBpeRdiController extends MyGenericForwardComposer {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private static Logger log = Logger.getLogger(BusquedaBpeRdiController.class);
|
||||
|
||||
@Autowired
|
||||
private DataSource dataSourceRead;
|
||||
|
||||
@Autowired
|
||||
private BpeService bpeService;
|
||||
|
||||
@Autowired
|
||||
private EmpresaService empresaService;
|
||||
|
||||
@Autowired
|
||||
private EstadoService estadoService;
|
||||
|
||||
private List<Empresa> lsEmpresa;
|
||||
private List<Estado> lsEstado;
|
||||
|
||||
private Datebox datInicial;
|
||||
private Datebox datFinal;
|
||||
|
||||
private MyComboboxEstandar cmbEmpresa;
|
||||
private MyListbox estadoList;
|
||||
|
||||
private Radio radSim;
|
||||
|
||||
@Override
|
||||
public void doAfterCompose(Component comp) throws Exception {
|
||||
lsEmpresa = empresaService.obtenerTodos();
|
||||
lsEstado = estadoService.obtenerTodos();
|
||||
|
||||
super.doAfterCompose(comp);
|
||||
|
||||
estadoList.setItemRenderer(new RenderEstadoUf());
|
||||
estadoList.setData(lsEstado);
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
private void executar() throws InterruptedException {
|
||||
|
||||
try {
|
||||
Empresa empresa = cmbEmpresa.getSelectedItem() == null ? null : (Empresa) cmbEmpresa.getSelectedItem().getValue();
|
||||
List<Estado> estados = new ArrayList<Estado>();
|
||||
for (Object ob : estadoList.getSelectedItemsByIndex()) {
|
||||
estados.add((Estado) ob);
|
||||
}
|
||||
|
||||
if (estados.isEmpty()) {
|
||||
Messagebox.show(Labels.getLabel("busquedaRelatorioRDIController.seleciona.estado"),
|
||||
Labels.getLabel("indexController.mnImpressaoRMD.label"),
|
||||
Messagebox.OK, Messagebox.ERROR);
|
||||
return;
|
||||
}
|
||||
|
||||
List<FiscalRdi> list = bpeService.buscarBpeRDI(datInicial.getValue(), datFinal.getValue(), empresa, estados, radSim.isChecked());
|
||||
|
||||
Map<String, Object> parametros = new HashMap<String, Object>();
|
||||
parametros.put("list", list);
|
||||
parametros.put("empresa", empresa.getNombempresa());
|
||||
parametros.put("inicio", datInicial.getValue());
|
||||
parametros.put("fim", datFinal.getValue());
|
||||
parametros.put("estados", estados);
|
||||
parametros.put("receitaTerceiros", radSim.isChecked());
|
||||
parametros.put("usuario", UsuarioLogado.getUsuarioLogado().getClaveUsuario());
|
||||
|
||||
Relatorio relatorio = new RelatorioRDI(parametros, dataSourceRead.getConnection());
|
||||
|
||||
Map args = new HashMap();
|
||||
args.put("relatorio", relatorio);
|
||||
|
||||
openWindow("/component/reportView.zul",
|
||||
Labels.getLabel("indexController.mnRelatorioRDI.label"), args, MODAL);
|
||||
|
||||
} catch (Exception e) {
|
||||
log.error("", e);
|
||||
Messagebox.show(e.getMessage(),
|
||||
Labels.getLabel("indexController.mnImpressaoRMD.label"),
|
||||
Messagebox.OK, Messagebox.INFORMATION);
|
||||
}
|
||||
}
|
||||
|
||||
public void onClick$btnExecutar(Event ev) throws InterruptedException {
|
||||
executar();
|
||||
}
|
||||
|
||||
public List<Empresa> getLsEmpresa() {
|
||||
return lsEmpresa;
|
||||
}
|
||||
|
||||
public List<Estado> getLsEstado() {
|
||||
return lsEstado;
|
||||
}
|
||||
}
|
|
@ -36,9 +36,6 @@ public class BusquedaExportacaoFiscalController extends MyGenericForwardComposer
|
|||
|
||||
private static Logger log = Logger.getLogger(BusquedaExportacaoFiscalController.class);
|
||||
|
||||
@Autowired
|
||||
private DataSource dataSourceRead;
|
||||
|
||||
@Autowired
|
||||
private FiscalService fiscalService;
|
||||
|
||||
|
|
|
@ -15,6 +15,7 @@ import org.springframework.stereotype.Controller;
|
|||
import org.zkoss.util.resource.Labels;
|
||||
import org.zkoss.zhtml.Messagebox;
|
||||
import org.zkoss.zk.ui.Component;
|
||||
import org.zkoss.zk.ui.Executions;
|
||||
import org.zkoss.zk.ui.event.Event;
|
||||
import org.zkoss.zul.Combobox;
|
||||
import org.zkoss.zul.Datebox;
|
||||
|
@ -81,6 +82,8 @@ public class BusquedaRelatorioFinanceiroController extends MyGenericForwardCompo
|
|||
private MyListbox puntoVentaSelList;
|
||||
private Paging pagingPuntoVenta;
|
||||
|
||||
private boolean isBpe;
|
||||
|
||||
@Override
|
||||
public void doAfterCompose(Component comp) throws Exception {
|
||||
lsEmpresa = empresaService.obtenerTodos();
|
||||
|
@ -93,6 +96,9 @@ public class BusquedaRelatorioFinanceiroController extends MyGenericForwardCompo
|
|||
estadoList.setData(lsEstado);
|
||||
puntoVentaList.setItemRenderer(new RenderPuntoVentaSimple());
|
||||
puntoVentaSelList.setItemRenderer(new RenderPuntoVentaSimple());
|
||||
|
||||
isBpe = Executions.getCurrent().getArg().get("isRelatorioFinanceiroBpe") == null ? Boolean.FALSE : (Boolean) Executions.getCurrent().getArg().get("isRelatorioFinanceiroBpe");
|
||||
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
|
@ -131,6 +137,8 @@ public class BusquedaRelatorioFinanceiroController extends MyGenericForwardCompo
|
|||
}
|
||||
filtro.append(puntoVentas).append(";");
|
||||
|
||||
|
||||
parametros.put("isBpe", isBpe);
|
||||
parametros.put("empresa", empresa);
|
||||
parametros.put("nombempresa", empresa.getNombempresa());
|
||||
parametros.put("tipoPuntoVenta", tipoPuntoVenta);
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package com.rjconsultores.ventaboletos.web.gui.controladores.impressaofiscal;
|
||||
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
@ -15,7 +14,6 @@ import org.springframework.stereotype.Controller;
|
|||
import org.zkoss.util.resource.Labels;
|
||||
import org.zkoss.zhtml.Messagebox;
|
||||
import org.zkoss.zk.ui.Component;
|
||||
import org.zkoss.zk.ui.WrongValueException;
|
||||
import org.zkoss.zk.ui.event.Event;
|
||||
import org.zkoss.zul.Datebox;
|
||||
import org.zkoss.zul.Radio;
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
package com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorio.bpe;
|
||||
|
||||
import org.zkoss.util.resource.Labels;
|
||||
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema;
|
||||
|
||||
public class ItemMenuBpeDevolucao extends DefaultItemMenuSistema {
|
||||
|
||||
public ItemMenuBpeDevolucao() {
|
||||
super("indexController.mnSubMenuBpeFiscal.devolucion.label");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getClaveMenu() {
|
||||
return "COM.RJCONSULTORES.ADMINISTRACION.GUI.RELATORIOS.BPE.DEVOLUCION";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void ejecutar() {
|
||||
PantallaUtileria.openWindow("/gui/relatorios/filtroRelatorioDevolucaoBilhetes.zul",
|
||||
Labels.getLabel("indexController.mnSubMenuBpeFiscal.devolucion.label"), getArgs(), desktop);
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
package com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorio.bpe;
|
||||
|
||||
import org.zkoss.util.resource.Labels;
|
||||
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema;
|
||||
|
||||
public class ItemMenuBpeExportacao extends DefaultItemMenuSistema {
|
||||
|
||||
public ItemMenuBpeExportacao() {
|
||||
super("indexController.mnSubMenuBpeFiscal.exportacao.label");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getClaveMenu() {
|
||||
return "COM.RJCONSULTORES.ADMINISTRACION.GUI.RELATORIOS.BPE.EXPORTACAO";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void ejecutar() {
|
||||
PantallaUtileria.openWindow("/gui/bpe/busquedaBpeExportacao.zul",
|
||||
Labels.getLabel("indexController.mnSubMenuBpeFiscal.exportacao.label"), getArgs(), desktop);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
package com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorio.bpe;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import org.zkoss.util.resource.Labels;
|
||||
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema;
|
||||
|
||||
public class ItemMenuBpeFinanceiro extends DefaultItemMenuSistema {
|
||||
|
||||
public ItemMenuBpeFinanceiro() {
|
||||
super("indexController.mnSubMenuBpeFiscal.financeiro.label");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getClaveMenu() {
|
||||
return "COM.RJCONSULTORES.ADMINISTRACION.GUI.RELATORIOS.BPE.FINANCIERO";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void ejecutar() {
|
||||
|
||||
Map map = getArgs();
|
||||
map.put("isRelatorioFinanceiroBpe", Boolean.TRUE);
|
||||
|
||||
PantallaUtileria.openWindow("/gui/impressaofiscal/busquedaRelatorioFinanceiro.zul",
|
||||
Labels.getLabel("indexController.mnSubMenuBpeFiscal.financeiro.label"), map, desktop);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
package com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorio.bpe;
|
||||
|
||||
import org.zkoss.util.resource.Labels;
|
||||
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema;
|
||||
|
||||
public class ItemMenuBpeRdi extends DefaultItemMenuSistema {
|
||||
|
||||
public ItemMenuBpeRdi() {
|
||||
super("indexController.mnSubMenuBpeFiscal.rdi.label");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getClaveMenu() {
|
||||
return "COM.RJCONSULTORES.ADMINISTRACION.GUI.RELATORIOS.BPE.RDI";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void ejecutar() {
|
||||
PantallaUtileria.openWindow("/gui/bpe/busquedaBpeRdi.zul",
|
||||
Labels.getLabel("indexController.mnSubMenuBpeFiscal.rdi.label"), getArgs(), desktop);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
package com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorio.bpe;
|
||||
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema;
|
||||
|
||||
public class SubMenuBpe extends DefaultItemMenuSistema {
|
||||
|
||||
public SubMenuBpe() {
|
||||
super("indexController.mnSubMenuBpeFiscal.label");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getClaveMenu() {
|
||||
return "COM.RJCONSULTORES.ADMINISTRACION.GUI.RELATORIOS.BPE";
|
||||
}
|
||||
|
||||
}
|
|
@ -219,6 +219,11 @@ analitico.integracion.exportacaoFiscal.rmd=com.rjconsultores.ventaboletos.web.ut
|
|||
analitico.integracion.exportacaoFiscal.impressaoRMD=com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorios.impressaofiscal.ItemMenuImpressaoRMD
|
||||
analitico.integracion.exportacaoFiscal.relatorioFinanceiro=com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorios.impressaofiscal.ItemMenuRelatorioFinanceiro
|
||||
analitico.integracion.exportacaoFiscal.relatorioRDI=com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorios.impressaofiscal.ItemMenuRelatorioRDI
|
||||
analitico.integracion.bpe=com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorio.bpe.SubMenuBpe
|
||||
analitico.integracion.bpe.exportacao=com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorio.bpe.ItemMenuBpeExportacao
|
||||
analitico.integracion.bpe.rdi=com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorio.bpe.ItemMenuBpeRdi
|
||||
analitico.integracion.bpe.financeiro=com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorio.bpe.ItemMenuBpeFinanceiro
|
||||
analitico.integracion.bpe.devolucion=com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorio.bpe.ItemMenuBpeDevolucao
|
||||
seguridad=com.rjconsultores.ventaboletos.web.utilerias.menu.item.seguridad.MenuSeguridad
|
||||
seguridad.estacion=com.rjconsultores.ventaboletos.web.utilerias.menu.item.seguridad.ItemMenuEstacion
|
||||
seguridad.autorizacion=com.rjconsultores.ventaboletos.web.utilerias.menu.item.seguridad.ItemMenuAutorizacion
|
||||
|
|
|
@ -331,6 +331,12 @@ indexController.mniExportacaoFiscalRMD.label=RMD
|
|||
indexController.mnImpressaoRMD.label=Impressão RMD
|
||||
indexController.mnRelatorioRDI.label=Relatório RDI
|
||||
|
||||
indexController.mnSubMenuBpeFiscal.label=BPE
|
||||
indexController.mnSubMenuBpeFiscal.exportacao.label=Exportación BPE
|
||||
indexController.mnSubMenuBpeFiscal.rdi.label=Reporte RDI BPE
|
||||
indexController.mnSubMenuBpeFiscal.financeiro.label=Reporte Financiero BPE
|
||||
indexController.mnSubMenuBpeFiscal.devolucion.label=Reporte Devolución BPE
|
||||
|
||||
indexController.mnRelatoriosFinanceiros.label=Reportes financeiros
|
||||
|
||||
indexController.mniSubMenuClientePacote.label=Paquete
|
||||
|
|
|
@ -348,6 +348,12 @@ indexController.mniExportacaoFiscalRMD.label=RMD
|
|||
indexController.mnImpressaoRMD.label=Impressão RMD
|
||||
indexController.mnRelatorioRDI.label=Relatório RDI
|
||||
|
||||
indexController.mnSubMenuBpeFiscal.label=BPE
|
||||
indexController.mnSubMenuBpeFiscal.exportacao.label=Exportação BPE
|
||||
indexController.mnSubMenuBpeFiscal.rdi.label=Relatório RDI BPE
|
||||
indexController.mnSubMenuBpeFiscal.financeiro.label=Relatório Financiero BPE
|
||||
indexController.mnSubMenuBpeFiscal.devolucion.label=Relatório Devolução BPE
|
||||
|
||||
indexController.mnRelatoriosFinanceiros.label=Relatórios Financeiros
|
||||
|
||||
indexController.mniSubMenuClientePacote.label=Pacote
|
||||
|
|
|
@ -0,0 +1,62 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<?page title="RelgerencialEmpresa" contentType="text/html;charset=UTF-8"?>
|
||||
<?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?>
|
||||
<?init class="org.zkoss.zkplus.databind.AnnotateDataBinderInit" arg0="winBusquedaBpeExportacao"?>
|
||||
<?taglib uri="http://www.zkoss.org/dsp/web/core" prefix="c"?>
|
||||
|
||||
<zk>
|
||||
<window id="winBusquedaBpeExportacao" apply="${busquedaBpeExportacaoController}"
|
||||
title="${c:l('indexController.mnSubMenuBpeFiscal.exportacao.label')}"
|
||||
contentStyle="overflow:auto" width="660px" border="normal">
|
||||
|
||||
<grid fixedLayout="true">
|
||||
<columns>
|
||||
<column width="20%" />
|
||||
<column width="30%" />
|
||||
<column width="20%" />
|
||||
<column width="30%" />
|
||||
</columns>
|
||||
|
||||
<rows>
|
||||
<row>
|
||||
<label
|
||||
value="${c:l('busquedaImportacionFiscalController.lbDataIni.value')}" />
|
||||
<datebox id="datInicial" width="90%"
|
||||
format="dd/MM/yyyy" constraint="no empty"
|
||||
maxlength="10" />
|
||||
<label
|
||||
value="${c:l('busquedaImportacionFiscalController.lbDataFin.value')}" />
|
||||
<datebox id="datFinal" width="90%"
|
||||
format="dd/MM/yyyy" constraint="no empty"
|
||||
maxlength="10" />
|
||||
</row>
|
||||
|
||||
<row spans="1, 3">
|
||||
<label
|
||||
value="${c:l('busquedaCiudadController.estado.label')}" />
|
||||
<combobox id="cmbEstado"
|
||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar"
|
||||
constraint="no empty" mold="rounded" buttonVisible="true"
|
||||
style="width: 483px;" model="@{winBusquedaBpeExportacao$composer.lsEstado}"/>
|
||||
</row>
|
||||
|
||||
<row spans="1, 3">
|
||||
<label
|
||||
value="${c:l('relatorioReceitaDiariaAgenciaController.lbEmpresa.value')}" />
|
||||
<combobox id="cmbEmpresa" style="width: 483px;" mold="rounded"
|
||||
buttonVisible="true"
|
||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar"
|
||||
model="@{winBusquedaBpeExportacao$composer.lsEmpresa}"
|
||||
constraint="no empty" />
|
||||
</row>
|
||||
</rows>
|
||||
</grid>
|
||||
|
||||
<toolbar>
|
||||
<button id="btnExeExportacao" image="/gui/img/enginer.png"
|
||||
label="${c:l('busquedaExportacaoFiscalController.btnExe.label')}" />
|
||||
|
||||
</toolbar>
|
||||
|
||||
</window>
|
||||
</zk>
|
|
@ -0,0 +1,73 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<?page title="RelgerencialEmpresa" contentType="text/html;charset=UTF-8"?>
|
||||
<?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?>
|
||||
<?init class="org.zkoss.zkplus.databind.AnnotateDataBinderInit" arg0="winBusquedaBpeRdi"?>
|
||||
<?taglib uri="http://www.zkoss.org/dsp/web/core" prefix="c"?>
|
||||
|
||||
<zk>
|
||||
<window id="winBusquedaBpeRdi"
|
||||
title="${c:l('indexController.mnSubMenuBpeFiscal.rdi.label')}"
|
||||
apply="${busquedaBpeRdiController}" contentStyle="overflow:auto"
|
||||
width="660px" border="normal">
|
||||
|
||||
<grid fixedLayout="true">
|
||||
<columns>
|
||||
<column width="20%" />
|
||||
<column width="30%" />
|
||||
<column width="20%" />
|
||||
<column width="30%" />
|
||||
</columns>
|
||||
|
||||
<rows>
|
||||
<row>
|
||||
<label
|
||||
value="${c:l('busquedaImportacionFiscalController.lbDataIni.value')}" />
|
||||
<datebox id="datInicial" width="90%"
|
||||
format="dd/MM/yyyy" constraint="no empty" maxlength="10" />
|
||||
<label
|
||||
value="${c:l('busquedaImportacionFiscalController.lbDataFin.value')}" />
|
||||
<datebox id="datFinal" width="90%"
|
||||
format="dd/MM/yyyy" constraint="no empty" maxlength="10" />
|
||||
</row>
|
||||
|
||||
<row spans="1, 3">
|
||||
<label
|
||||
value="${c:l('busquedaRelatorioRDIController.lbEmpresa.value')}" />
|
||||
<combobox id="cmbEmpresa" style="width: 483px;"
|
||||
mold="rounded" buttonVisible="true"
|
||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar"
|
||||
model="@{winBusquedaBpeRdi$composer.lsEmpresa}"
|
||||
constraint="no empty" />
|
||||
</row>
|
||||
|
||||
<row spans="1, 3">
|
||||
<label
|
||||
value="${c:l('busquedaRelatorioRDIController.estado.label')}" />
|
||||
<listbox id="estadoList" rows="10" vflex="false"
|
||||
width="90%" multiple="true" checkmark="true"
|
||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyListbox">
|
||||
</listbox>
|
||||
</row>
|
||||
|
||||
<row spans="1, 3">
|
||||
<label
|
||||
value="${c:l('busquedaRelatorioRDIController.receitaTerceiros.label')}" />
|
||||
<radiogroup id="receitaTerceiros">
|
||||
<radio id="radSim"
|
||||
label="${c:l('busquedaRelatorioRDIController.labelRadio.radSim')}"
|
||||
checked="true" />
|
||||
<radio id="radNao"
|
||||
label="${c:l('busquedaRelatorioRDIController.labelRadio.radNao')}" />
|
||||
</radiogroup>
|
||||
</row>
|
||||
|
||||
</rows>
|
||||
</grid>
|
||||
|
||||
<toolbar>
|
||||
<button id="btnExecutar" image="/gui/img/enginer.png"
|
||||
label="${c:l('busquedaRelatorioRDIController.btnExe.label')}" />
|
||||
</toolbar>
|
||||
|
||||
</window>
|
||||
</zk>
|
Loading…
Reference in New Issue