fixes bug#19632

qua:
dev:Valdir
Implementado relatório para mostrar caixa por órgão concedente pode filtrar por usuário e por agência.

git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@102910 d1611594-4594-4d17-8e1d-87c2c4800839
master
valdevir 2020-08-17 14:20:42 +00:00
parent f314c0eccc
commit e2f55ce099
4 changed files with 52 additions and 14 deletions

View File

@ -1,7 +1,6 @@
package com.rjconsultores.ventaboletos.web.gui.controladores.relatorios;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -69,6 +68,9 @@ public class RelatorioCaixaOrgaoConcedenteController extends MyGenericForwardCom
Map<String, Object> parametros = new HashMap<String, Object>();
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
if(!validaCampos()) {
return;
}
if (this.dataInicial.getValue() != null) {
parametros.put("fecInicio", sdf.format(this.dataInicial.getValue()));
@ -77,19 +79,7 @@ public class RelatorioCaixaOrgaoConcedenteController extends MyGenericForwardCom
parametros.put("fecFinal", sdf.format(this.dataFinal.getValue()));
}
if ((parametros.get("fecInicio") != null || parametros.get("fecFinal") != null) &&
((parametros.get("fecInicio") == null || parametros.get("fecFinal") == null))) {
Messagebox.show(Labels.getLabel("relatorioCaixaOrgaoConcedenteController.window.title"),
Labels.getLabel("relatorioCaixaOrgaoConcedenteController.window.title"),
Messagebox.OK, Messagebox.INFORMATION);
return;
}
if(DateUtil.compareOnlyDate(dataInicial.getValue()) >0 ) {
Messagebox.show(Labels.getLabel("relatorio.parametro.dataMenorDataAtual"),
Labels.getLabel("relatorioCaixaOrgaoConcedenteController.window.title"),
Messagebox.OK, Messagebox.INFORMATION);
}
if (cmbEmpresa.getSelectedIndex() != -1) {
parametros.put("empresa", ((Empresa) cmbEmpresa.getSelectedItem().getValue()).getEmpresaId());
parametros.put("nomb_empresa", ((Empresa) cmbEmpresa.getSelectedItem().getValue()).getNombempresa());
@ -151,6 +141,48 @@ public class RelatorioCaixaOrgaoConcedenteController extends MyGenericForwardCom
}
private boolean validaCampos() throws Exception{
if (dataInicial.getValue() == null || dataFinal.getValue() ==null ) {
Messagebox.show(Labels.getLabel("MSG.Error.invalida.dataInicialOuDataFinalNaoInformada"),
Labels.getLabel("relatorioCaixaOrgaoConcedenteController.window.title"),
Messagebox.OK, Messagebox.INFORMATION);
return false;
}
if(DateUtil.compareOnlyDate(dataInicial.getValue(), dataFinal.getValue() ) >0 ) {
Messagebox.show(Labels.getLabel("MSG.Error.invalida.dataInicialDepoisDataFinal"),
Labels.getLabel("relatorioCaixaOrgaoConcedenteController.window.title"),
Messagebox.OK, Messagebox.ERROR);
return false;
}
if(DateUtil.compareOnlyDate(dataInicial.getValue()) >0 ) {
Messagebox.show(Labels.getLabel("relatorio.parametro.dataMenorDataAtual"),
Labels.getLabel("relatorioCaixaOrgaoConcedenteController.window.title"),
Messagebox.OK, Messagebox.ERROR);
return false;
}
if(cmbEmpresa.getValue()==null || cmbEmpresa.getValue().isEmpty()) {
Messagebox.show(Labels.getLabel("MSG.Error.empresa.naoinformado"),
Labels.getLabel("relatorioCaixaOrgaoConcedenteController.window.title"),
Messagebox.OK, Messagebox.ERROR);
return false;
}
if(DateUtil.diferencaEntreDatasEmdias(dataInicial.getValue(), dataFinal.getValue()) > 30) {
Messagebox.show(Labels.getLabel("MSG.Error.data.maiorquelimite"),
Labels.getLabel("relatorioCaixaOrgaoConcedenteController.window.title"),
Messagebox.OK, Messagebox.ERROR);
return false;
}
return true;
}
public List<Empresa> getLsEmpresas() {
return lsEmpresas;
}

View File

@ -65,6 +65,8 @@ MSG.Error.invalida.intervaloInvalidoDias=dia(s).
MSG.Error.invalida.puntoVentaSemFechamentoParaEmpresa=Esta agência não possui fechamento para esta empresa.
MSG.ATIVADO=Ativado
MSG.DESATIVADO=Desativado
MSG.Error.empresa.naoinformado = Empresa não informada
MSG.Error.data.maiorquelimite = Intervalo de datas deve ser menor que 30 dias
# Labels Default
lb.id=ID

View File

@ -64,6 +64,8 @@ MSG.Error.invalida.intervaloInvalidoDias = dia(s).
MSG.Error.invalida.puntoVentaSemFechamentoParaEmpresa = Esta agência não possui fechamento para esta empresa.
MSG.ATIVADO = Ativado
MSG.DESATIVADO = Desativado
MSG.Error.empresa.naoinformado = Empresa não informada
MSG.Error.data.maiorquelimite = Intervalo de datas deve ser menor que 30 dias
# Labels Default
lb.id = ID

View File

@ -63,6 +63,8 @@ MSG.Error.necessita.puntoVenta = Ponto de Venda (Agência) Obrigatório
MSG.Error.invalida.intervaloInvalido = Intervalo inválido, o período de pesquisa deve ser de
MSG.Error.invalida.intervaloInvalidoDias = dia(s).
MSG.Error.invalida.puntoVentaSemFechamentoParaEmpresa = Esta agência não possui fechamento para esta empresa.
MSG.Error.empresa.naoinformado = Empresa não informada
MSG.Error.data.maiorquelimite = Intervalo de datas deve ser menor que 30 dias
MSG.ATIVADO = Ativado
MSG.DESATIVADO = Desativado