diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioKmProgramada_pt_BR.properties b/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioKmProgramada_pt_BR.properties new file mode 100644 index 000000000..01f6ecc2b --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioKmProgramada_pt_BR.properties @@ -0,0 +1,13 @@ +#geral +msg.noData=Não foi possivel obter dados com os parâmetros informados. + + +#Labels cabeçalho +cabecalho.relatorio=Relatório: +cabecalho.periodo=Período: +cabecalho.periodoA=à +cabecalho.dataHora=Data/Hora: +cabecalho.impressorPor=Impressor por: +cabecalho.pagina=Página +cabecalho.de=de +cabecalho.filtros=Filtros: \ No newline at end of file diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioKMProgramadaa.jrxml b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioKMProgramadaa.jrxml new file mode 100644 index 000000000..3d6911ab5 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioKMProgramadaa.jrxml @@ -0,0 +1,27 @@ + + + + + + + <band height="79" splitType="Stretch"/> + + + + + + + + + + + + + + + + + + + + diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioKmProgramada.jasper b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioKmProgramada.jasper new file mode 100644 index 000000000..fdb4e1ab3 Binary files /dev/null and b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioKmProgramada.jasper differ diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioKmProgramada.jrxml b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioKmProgramada.jrxml new file mode 100644 index 000000000..b0da223f0 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioKmProgramada.jrxml @@ -0,0 +1,251 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <band height="73" splitType="Stretch"> + <staticText> + <reportElement x="0" y="0" width="247" height="20" uuid="68f4ea28-b08b-4655-ab65-5f181721909f"/> + <textElement> + <font size="14" isBold="true"/> + </textElement> + <text><![CDATA[Kilometragem Programada]]></text> + </staticText> + <textField pattern="dd/MM/yyyy HH:mm"> + <reportElement x="403" y="0" width="152" height="20" uuid="d0203404-283e-4281-a85f-9fe7c3f0e121"/> + <textElement textAlignment="Right"> + <font isBold="true"/> + </textElement> + <textFieldExpression><![CDATA[new java.util.Date()]]></textFieldExpression> + </textField> + <textField> + <reportElement x="0" y="31" width="291" height="20" uuid="7adb9127-4696-4a5a-9ebb-ab4430744550"/> + <textElement verticalAlignment="Middle"> + <font isBold="true"/> + </textElement> + <textFieldExpression><![CDATA["Período: " + $P{DATA_INICIAL} + " a " + $P{DATA_FINAL}]]></textFieldExpression> + </textField> + <staticText> + <reportElement x="0" y="51" width="46" height="20" uuid="4edc7c1b-38fc-4738-a3eb-a8002b23ae18"/> + <textElement verticalAlignment="Middle"> + <font isBold="true"/> + </textElement> + <text><![CDATA[Filtros:]]></text> + </staticText> + <line> + <reportElement positionType="Float" x="0" y="71" width="555" height="1" uuid="001cfcc7-c18f-4b8f-9bd1-01568512ca0c"/> + </line> + <textField> + <reportElement x="46" y="51" width="509" height="20" uuid="9b9ca6f0-2531-42dc-8d40-e54c9dba2064"/> + <textElement verticalAlignment="Middle"/> + <textFieldExpression><![CDATA[$P{FILTROS}]]></textFieldExpression> + </textField> + </band> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioKmProgramada1.jasper b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioKmProgramada1.jasper new file mode 100644 index 000000000..d248ca4ce Binary files /dev/null and b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioKmProgramada1.jasper differ diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioKmProgramada1.jrxml b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioKmProgramada1.jrxml new file mode 100644 index 000000000..7332125ca --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioKmProgramada1.jrxml @@ -0,0 +1,465 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/EditarFechamentoParamgeralController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/EditarFechamentoParamgeralController.java index 64dcbe7bc..1f125a353 100644 --- a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/EditarFechamentoParamgeralController.java +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/EditarFechamentoParamgeralController.java @@ -30,6 +30,7 @@ public class EditarFechamentoParamgeralController extends MyGenericForwardCompos private enum BancosSuportados { ITAU("341", "Itaú"), + SANTANDER("033", "Santander"), BRADESCO("237", "Bradesco"); private String codBanco; diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/relatorios/RelatorioKmProgramadaController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/relatorios/RelatorioKmProgramadaController.java new file mode 100644 index 000000000..d0d2df1ef --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/relatorios/RelatorioKmProgramadaController.java @@ -0,0 +1,167 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.relatorios; + +import java.text.SimpleDateFormat; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import javax.sql.DataSource; + +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.zk.ui.Component; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zul.Comboitem; +import org.zkoss.zul.Datebox; + +import com.rjconsultores.ventaboletos.entidad.Empresa; +import com.rjconsultores.ventaboletos.entidad.GrupoRuta; +import com.rjconsultores.ventaboletos.entidad.Ruta; +import com.rjconsultores.ventaboletos.relatorios.impl.RelatorioKmProgramada; +import com.rjconsultores.ventaboletos.relatorios.utilitarios.Relatorio; +import com.rjconsultores.ventaboletos.service.ConstanteService; +import com.rjconsultores.ventaboletos.service.EmpresaService; +import com.rjconsultores.ventaboletos.service.GrupoRutaService; +import com.rjconsultores.ventaboletos.service.RutaService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; + +/** + * + * @author Administrador + */ +@Controller("relatorioKmProgramadaController") +@Scope("prototype") +public class RelatorioKmProgramadaController extends MyGenericForwardComposer { + + private static final long serialVersionUID = 1L; + + @Autowired + private DataSource dataSourceRead; + @Autowired + private EmpresaService empresaService; + @Autowired + private RutaService rutaService; + @Autowired + private GrupoRutaService grupoRutaService; + @Autowired + private ConstanteService constanteService; + + private List lsRuta; + private List lsEmpresa; + private List lsGrupoRuta; + + private Datebox fecCorridaIni; + private Datebox fecCorridaFin; + private MyComboboxEstandar cmbRuta; + private MyComboboxEstandar cmbEmpresa; + + + public void onClick$btnExecutarRelatorio(Event ev) throws Exception { + executarRelatorio(); + } + + /** + * @throws Exception + * + */ + @SuppressWarnings({ "rawtypes", "unchecked" }) + private void executarRelatorio() throws Exception { + + Relatorio relatorio; + Map parametros = new HashMap(); + StringBuilder filtro = new StringBuilder(); + SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy"); + + parametros.put("DATA_INICIAL", sdf.format((java.util.Date) this.fecCorridaIni.getValue())); + parametros.put("DATA_FINAL", sdf.format((java.util.Date) this.fecCorridaFin.getValue())); + parametros.put("NOME_RELATORIO", Labels.getLabel("relatorioResumoLinhasController.window.title")); + parametros.put("USUARIO", UsuarioLogado.getUsuarioLogado().getUsuarioId().toString()); + + Comboitem itemRuta = cmbRuta.getSelectedItem(); + + filtro.append("Linha: "); + if (itemRuta != null) { + Ruta ruta = (Ruta) itemRuta.getValue(); + parametros.put("RUTA_ID", ruta.getRutaId()); + filtro.append(ruta.getDescruta() + ";"); + } + else + filtro.append("Todas;"); + + + + Comboitem itemEmpresa = cmbEmpresa.getSelectedItem(); + filtro.append(" Empresa: "); + if (itemEmpresa != null) { + Empresa empresa = (Empresa) itemEmpresa.getValue(); + parametros.put("EMPRESA_ID", empresa.getEmpresaId()); + parametros.put("EMPRESA", empresa.getNombempresa()); + filtro.append(empresa.getNombempresa()); + }else{ + parametros.put("EMPRESA_ID", null); + filtro.append("Todas;"); + } + + parametros.put("FILTROS", filtro.toString()); + + relatorio = new RelatorioKmProgramada(parametros, dataSourceRead.getConnection(), constanteService); + + + Map args = new HashMap(); + args.put("relatorio", relatorio); + + openWindow("/component/reportView.zul", + Labels.getLabel("relatorioKmProgramadaController.window.title"), args, MODAL); + + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + setLsRuta(rutaService.obtenerTodos()); + lsEmpresa = empresaService.obtenerTodos(); + lsGrupoRuta = grupoRutaService.obtenerTodos(); + + super.doAfterCompose(comp); + } + + public List getLsRuta() { + return lsRuta; + } + + public void setLsRuta(List lsRuta) { + this.lsRuta = lsRuta; + } + + public MyComboboxEstandar getCmbRuta() { + return cmbRuta; + } + + public void setCmbRuta(MyComboboxEstandar cmbRuta) { + this.cmbRuta = cmbRuta; + } + + public List getLsEmpresa() { + return lsEmpresa; + } + + public void setLsEmpresa(List lsEmpresa) { + this.lsEmpresa = lsEmpresa; + } + + public List getLsGrupoRuta() { + return lsGrupoRuta; + } + + public void setLsGrupoRuta(List lsGrupoRuta) { + this.lsGrupoRuta = lsGrupoRuta; + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/relatorios/ItemMenuRelatorioKmProgramada.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/relatorios/ItemMenuRelatorioKmProgramada.java new file mode 100644 index 000000000..e54a50a6c --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/relatorios/ItemMenuRelatorioKmProgramada.java @@ -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 ItemMenuRelatorioKmProgramada extends DefaultItemMenuSistema { + + public ItemMenuRelatorioKmProgramada() { + super("indexController.mniRelatorioKmProgramada.label"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.RELATORIOS.MENU.RELATORIOKMPROGRAMADA"; + } + + @Override + public void ejecutar() { + PantallaUtileria.openWindow("/gui/relatorios/filtroRelatorioKmProgramada.zul", + Labels.getLabel("relatorioKmProgramadaController.window.title"), getArgs(), desktop); + + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/menu_original.properties b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/menu_original.properties index 4dc1538df..3a4695a43 100644 --- a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/menu_original.properties +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/menu_original.properties @@ -133,6 +133,7 @@ analitico.gerenciais.trip=com.rjconsultores.ventaboletos.web.utilerias.menu.item analitico.gerenciais.operacionais=com.rjconsultores.ventaboletos.web.utilerias.menu.item.analitico.gerenciais.operacionais.SubMenuRelatorioOperacionais analitico.gerenciais.operacionais.aproveitamento=com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorios.ItemMenuRelatorioAproveitamento analitico.gerenciais.operacionais.resumoLinhas=com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorios.ItemMenuRelatorioResumoLinhas +analitico.gerenciais.operacionais.kmProgramada=com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorios.ItemMenuRelatorioKmProgramada analitico.gerenciais.operacionais.acompanhamentoEquivalentes=com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorios.ItemMenuRelatorioAcompanhamentoEquivalentes analitico.gerenciais.operacionais.linhasHorario=com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorios.ItemMenuRelatorioLinhasHorario analitico.gerenciais.operacionais.demandas=com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorios.ItemMenuRelatorioDemandas