diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioReceitaDiariaAgencia_pt_BR.properties b/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioReceitaDiariaAgencia_pt_BR.properties new file mode 100644 index 000000000..735c7ea62 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioReceitaDiariaAgencia_pt_BR.properties @@ -0,0 +1,10 @@ +#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=à + +rodape.pagina=Página +rodape.de=de \ No newline at end of file diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/parametros/RendimentoParamsImpl.java b/src/java/com/rjconsultores/ventaboletos/relatorios/parametros/RendimentoParamsImpl.java index 64dc0b6ff..ce9b3f682 100644 --- a/src/java/com/rjconsultores/ventaboletos/relatorios/parametros/RendimentoParamsImpl.java +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/parametros/RendimentoParamsImpl.java @@ -57,7 +57,7 @@ public class RendimentoParamsImpl implements IParametros { StringBuilder sql = new StringBuilder(); sql.append("SELECT round(NVL(TAB.TOTAL_ARRECADADO,0),2) TOTAL_ARRECADADO, "); - sql.append(" round(NVL(TAB.TOTAL_ARRECADADO / TAB.KM_OCUPADA,0),2) ARRECADADO_KM, "); + sql.append(" round(NVL(TAB.TOTAL_ARRECADADO / TAB.KM_NOMINAL,0),2) ARRECADADO_KM, "); sql.append(" round(NVL(TAB.TOTAL_NOMINAL,0),2) TOTAL_NOMINAL, "); sql.append(" round(TAB.TOTAL_NOMINAL / TAB.KM_NOMINAL,2) NOMINAL_KM,"); sql.append(" (TAB.TOTAL_OCUPADOS/TAB.TOTAL_ACENTOS) OCUPACAO, "); @@ -73,7 +73,7 @@ public class RendimentoParamsImpl implements IParametros { sql.append(" AND (BO.MOTIVOCANCELACION_ID IS NULL OR "); sql.append(" BO.MOTIVOCANCELACION_ID = 0)) TOTAL_ARRECADADO, "); sql.append(" "); - sql.append(" (SELECT SUM(TR.CANTKMREAL * DA.CANTASIENTOS) "); + sql.append(" (SELECT SUM(TR.CANTKMREAL) "); sql.append(" FROM CORRIDA_TRAMO CT, "); sql.append(" TRAMO TR, "); sql.append(" ROL_OPERATIVO RO, "); diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/render/RenderRelatorioAbstract.java b/src/java/com/rjconsultores/ventaboletos/relatorios/render/RenderRelatorioAbstract.java index 5fd231e11..12b59c2c0 100644 --- a/src/java/com/rjconsultores/ventaboletos/relatorios/render/RenderRelatorioAbstract.java +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/render/RenderRelatorioAbstract.java @@ -1,5 +1,6 @@ package com.rjconsultores.ventaboletos.relatorios.render; +import java.io.InputStream; import java.sql.Connection; import java.util.HashMap; import java.util.Map; @@ -43,6 +44,14 @@ public abstract class RenderRelatorioAbstract implements IRenderRelatorio { * Excessão durante a renderização do relatório */ protected abstract byte[] render(SaidaRelatorio saida) throws Exception; + + + protected abstract InputStream getTemplateInputStream() throws Exception; + + protected abstract byte[] renderPdf() throws Exception; + + protected abstract byte[] renderXls() throws Exception; + /** * @param relatorio @@ -66,8 +75,7 @@ public abstract class RenderRelatorioAbstract implements IRenderRelatorio { public void initParametros(){ this.parametros.put("NOME_RELATORIO", this.relatorio.getDescricao()); - this.parametros.put("MSG_NO_DATA", this.relatorio.getNome()); - + } /* @@ -81,5 +89,7 @@ public abstract class RenderRelatorioAbstract implements IRenderRelatorio { return this.render(saida); } + + } diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/render/RenderRelatorioJasper.java b/src/java/com/rjconsultores/ventaboletos/relatorios/render/RenderRelatorioJasper.java index f1f7a3d46..26c4b7411 100644 --- a/src/java/com/rjconsultores/ventaboletos/relatorios/render/RenderRelatorioJasper.java +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/render/RenderRelatorioJasper.java @@ -7,6 +7,7 @@ import java.util.Locale; import java.util.ResourceBundle; import net.sf.jasperreports.engine.JRDataSource; +import net.sf.jasperreports.engine.JRException; import net.sf.jasperreports.engine.JRParameter; import net.sf.jasperreports.engine.JasperExportManager; import net.sf.jasperreports.engine.JasperFillManager; @@ -56,20 +57,43 @@ public class RenderRelatorioJasper extends RenderRelatorioAbstract { throw new Exception("Este relatório esta configurado para utilizar uma conexão direta com banco de dados, utilize o construtor com a passagem de parametros correta."); } - + @Override - public void preRender(){ + public void preRender() { super.preRender(); this.initBundler(); - + this.initLocale(); + } - - private void initBundler(){ + + private void initBundler() { // TODO Alterar para injeção de acordo com usuário logado ou outro meio para obter o Locale correto Locale locale = new Locale("pt", "BR"); - ResourceBundle resource = ResourceBundle.getBundle("com.rjconsultores.ventaboletos.relatorios.internacionalizacao."+this.relatorio.getNome(), locale); - - this.parametros.put(JRParameter.REPORT_RESOURCE_BUNDLE, resource); + try { + + ResourceBundle resource = ResourceBundle.getBundle("com.rjconsultores.ventaboletos.relatorios.internacionalizacao." + this.relatorio.getNome(), locale); + this.parametros.put(JRParameter.REPORT_RESOURCE_BUNDLE, resource); + } catch (Exception e) { + } + } + + private void initLocale() { + // TODO Alterar para injeção de acordo com usuário logado ou outro meio para obter o Locale correto + Locale locale = new Locale("pt", "BR"); + this.parametros.put(JRParameter.REPORT_LOCALE, locale); + } + + protected InputStream getTemplateInputStream() throws Exception { + String diretorio = "/com/rjconsultores/ventaboletos/relatorios/templates/" + this.relatorio.getNome() + ".jasper"; + InputStream iStemplate = this.getClass().getResourceAsStream(diretorio); + + if (iStemplate == null) + { + throw new Exception("Não foi possivel localizar o template do relátorio no diretorio a seguir: " + diretorio); + } + + return iStemplate; + } /* @@ -86,36 +110,47 @@ public class RenderRelatorioJasper extends RenderRelatorioAbstract { if (this.relatorio.getParametros() != null) this.relatorio.getParametros().processaParametros(this.parametros, this.connection); - InputStream iStemplate = this.getClass().getResourceAsStream("/com/rjconsultores/ventaboletos/relatorios/templates/" + this.relatorio.getNome()+".jasper"); - if (this.relatorio.getDatasource() != null) - this.jasperPrint = JasperFillManager.fillReport(iStemplate, this.getParametros(), (JRDataSource) this.datasource); + this.jasperPrint = JasperFillManager.fillReport(this.getTemplateInputStream(), this.getParametros(), (JRDataSource) this.datasource); else - this.jasperPrint = JasperFillManager.fillReport(iStemplate, this.getParametros(), this.connection); + this.jasperPrint = JasperFillManager.fillReport(this.getTemplateInputStream(), this.getParametros(), this.connection); } + switch (saida) { case PDF: - conteudo = JasperExportManager.exportReportToPdf(this.jasperPrint); + conteudo = this.renderPdf(); break; case XLS: - JRXlsExporter exporterXLS = new JRXlsExporter(); - ByteArrayOutputStream output = new ByteArrayOutputStream(); - exporterXLS.setParameter(JRXlsExporterParameter.JASPER_PRINT, this.jasperPrint); - exporterXLS.setParameter(JRXlsExporterParameter.OUTPUT_STREAM, output); - exporterXLS.setParameter(JRXlsExporterParameter.IS_ONE_PAGE_PER_SHEET, Boolean.TRUE); - exporterXLS.setParameter(JRXlsExporterParameter.IS_DETECT_CELL_TYPE, Boolean.TRUE); - exporterXLS.setParameter(JRXlsExporterParameter.IS_WHITE_PAGE_BACKGROUND, Boolean.FALSE); - exporterXLS.setParameter(JRXlsExporterParameter.IS_REMOVE_EMPTY_SPACE_BETWEEN_ROWS, Boolean.TRUE); - exporterXLS.exportReport(); - conteudo = output.toByteArray(); + conteudo = this.renderXls(); break; } return conteudo; } + + protected byte[] renderXls() throws Exception { + + JRXlsExporter exporterXLS = new JRXlsExporter(); + ByteArrayOutputStream output = new ByteArrayOutputStream(); + exporterXLS.setParameter(JRXlsExporterParameter.JASPER_PRINT, this.jasperPrint); + exporterXLS.setParameter(JRXlsExporterParameter.OUTPUT_STREAM, output); + exporterXLS.setParameter(JRXlsExporterParameter.IS_ONE_PAGE_PER_SHEET, Boolean.TRUE); + exporterXLS.setParameter(JRXlsExporterParameter.IS_DETECT_CELL_TYPE, Boolean.TRUE); + exporterXLS.setParameter(JRXlsExporterParameter.IS_WHITE_PAGE_BACKGROUND, Boolean.FALSE); + exporterXLS.setParameter(JRXlsExporterParameter.IS_REMOVE_EMPTY_SPACE_BETWEEN_ROWS, Boolean.TRUE); + exporterXLS.exportReport(); + return output.toByteArray(); + + } + + protected byte[] renderPdf() throws Exception { + + return JasperExportManager.exportReportToPdf(this.jasperPrint); + + } } diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioReceitaDiariaAgencia.jasper b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioReceitaDiariaAgencia.jasper new file mode 100644 index 000000000..4c13e2f88 Binary files /dev/null and b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioReceitaDiariaAgencia.jasper differ diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioReceitaDiariaAgencia.jrxml b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioReceitaDiariaAgencia.jrxml new file mode 100644 index 000000000..c2d3c0214 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioReceitaDiariaAgencia.jrxml @@ -0,0 +1,799 @@ + + + + + + + + + + + + + + + + + 18 THEN + 1 + ELSE + 0 + END) total_bilhetes, + + sum(CASE + WHEN cj.motivocancelacion_id is not null THEN + 1 + ELSE + 0 + END) total_bilhetes_canc, + sum(CASE + WHEN cj.motivocancelacion_id is null and + cj.tipoventa_id = 18 THEN + 1 + ELSE + 0 + END) total_bilhetes_gap, + sum(CASE + WHEN cj.motivocancelacion_id is null and + cj.tipoventa_id <> 18 THEN + cj.preciopagado + ELSE + 0 + END) receita_tarifa, + sum(CASE + WHEN cj.motivocancelacion_id is null and + cj.tipoventa_id = 18 THEN + cj.preciopagado + ELSE + 0 + END) receita_tarifa_gap, + sum(CASE + WHEN cj.motivocancelacion_id is null and + cj.tipoventa_id <> 18 THEN + cj.importeseguro + ELSE + 0 + END) receita_seguro, + sum(CASE + WHEN cj.motivocancelacion_id is null and + cj.tipoventa_id = 18 THEN + cj.importeseguro + ELSE + 0 + END) receita_seguro_gap, + sum(CASE + WHEN cj.motivocancelacion_id is null and + cj.tipoventa_id <> 18 THEN + cj.importetaxaembarque + ELSE + 0 + END) receita_embarque, + sum(CASE + WHEN cj.motivocancelacion_id is null and + cj.tipoventa_id = 18 THEN + cj.importetaxaembarque + ELSE + 0 + END) receita_embarque_gap, + sum(CASE + WHEN cj.motivocancelacion_id is null and + cj.tipoventa_id <> 18 THEN + cj.importeoutros + ELSE + 0 + END) receita_outros, + sum(CASE + WHEN cj.motivocancelacion_id is null and + cj.tipoventa_id = 18 THEN + cj.importeoutros + ELSE + 0 + END) receita_outros_gap, + sum(CASE + WHEN cj.motivocancelacion_id is null and + cj.tipoventa_id <> 18 THEN + cj.importepedagio + ELSE + 0 + END) receita_pedagio, + sum(CASE + WHEN cj.motivocancelacion_id is null and + cj.tipoventa_id = 18 THEN + cj.importepedagio + ELSE + 0 + END) receita_pedagio_gap, + + sum(CASE + WHEN cj.motivocancelacion_id in (31, 32) and + cj.tipoventa_id <> 18 THEN + cj.preciopagado + ELSE + 0 + END) total_devol, + sum(CASE + WHEN cj.motivocancelacion_id in (31, 32) and + cj.tipoventa_id = 18 THEN + cj.preciopagado + ELSE + 0 + END) total_devol_gap + from vtabol.caja cj, + vtabol.punto_venta pv, + vtabol.parada pr, + vtabol.ciudad cd, + vtabol.estado es + where cj.puntoventa_id = pv.puntoventa_id + and trunc(cj.fechorventa) between $P{DATA_INICIO} and $P{DATA_FINAL} + and pr.parada_id = pv.parada_id + and cd.ciudad_id = pr.ciudad_id + and cd.estado_id = es.estado_id + and es.estado_id = nvl($P{ESTADO_ID}, es.estado_id) + and (($X{IN, numpuntoventa, NUMPUNTOVENTA} and $P{ISNUMPUNTOVENTATODOS} = 'N')or($P{ISNUMPUNTOVENTATODOS} = 'S')) + group by es.cveestado, pv.puntoventa_id, pv.numpuntoventa, pv.nombpuntoventa) tab, + vtabol.evento_extra ee + where trunc(ee.fechoringreso(+)) between $P{DATA_INICIO} and $P{DATA_FINAL} + and ee.puntoventa_id(+) = tab.puntoventa_id + + group by tab.cveestado, + tab.puntoventa_id, + tab.numpuntoventa, + tab.nombpuntoventa, + tab.total_bilhetes, + tab.total_bilhetes_gap, + tab.receita_tarifa, + tab.receita_seguro, + tab.total_devol, + tab.receita_tarifa_gap, + tab.receita_seguro_gap, + tab.total_devol_gap, + tab.total_bilhetes_canc) tab1]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <band height="74" splitType="Stretch"> + <rectangle> + <reportElement uuid="40951cf0-f721-444c-937e-a529296c7cc5" x="1" y="0" width="800" height="30"/> + </rectangle> + <textField pattern="" isBlankWhenNull="false"> + <reportElement uuid="51724883-07e3-4d85-9d83-8e4fb54a369f" mode="Transparent" x="71" y="0" width="369" height="15" forecolor="#000000" backcolor="#FFFFFF"/> + <textElement textAlignment="Left" verticalAlignment="Top" rotation="None" markup="none"> + <font fontName="SansSerif" size="9" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/> + <paragraph lineSpacing="Single"/> + </textElement> + <textFieldExpression><![CDATA[$P{NOME_RELATORIO}]]></textFieldExpression> + </textField> + <textField> + <reportElement uuid="9ab65a31-d370-435c-9797-bf9d01f7db8e" x="6" y="0" width="65" height="15"/> + <textElement> + <font size="9" isBold="true"/> + </textElement> + <textFieldExpression><![CDATA[$R{cabecalho.relatorio}]]></textFieldExpression> + </textField> + <textField pattern="" isBlankWhenNull="false"> + <reportElement uuid="3df44bfd-0b0d-408a-b69d-ce5a91fac303" mode="Transparent" x="6" y="15" width="65" height="15" forecolor="#000000" backcolor="#FFFFFF"/> + <textElement textAlignment="Left" verticalAlignment="Top" rotation="None" markup="none"> + <font fontName="SansSerif" size="9" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/> + <paragraph lineSpacing="Single"/> + </textElement> + <textFieldExpression><![CDATA[$R{cabecalho.periodo}]]></textFieldExpression> + </textField> + <textField pattern="dd/MM/yyyy" isBlankWhenNull="false"> + <reportElement uuid="2d8e8bb8-83e9-4e1b-87dc-60f3aa339144" mode="Transparent" x="71" y="15" width="53" height="15" forecolor="#000000" backcolor="#FFFFFF"/> + <textElement textAlignment="Left" verticalAlignment="Top" rotation="None" markup="none"> + <font fontName="SansSerif" size="9" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/> + <paragraph lineSpacing="Single"/> + </textElement> + <textFieldExpression><![CDATA[$P{DATA_INICIO}]]></textFieldExpression> + </textField> + <textField pattern="dd/MM/yyyy" isBlankWhenNull="false"> + <reportElement uuid="c29183cc-bb62-4ac1-b880-a218e54be0c0" mode="Transparent" x="137" y="15" width="59" height="15" forecolor="#000000" backcolor="#FFFFFF"/> + <textElement textAlignment="Left" verticalAlignment="Top" rotation="None" markup="none"> + <font fontName="SansSerif" size="9" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/> + <paragraph lineSpacing="Single"/> + </textElement> + <textFieldExpression><![CDATA[$P{DATA_FINAL}]]></textFieldExpression> + </textField> + <textField pattern="" isBlankWhenNull="false"> + <reportElement uuid="66de0d17-aaae-4bc7-97fc-c642bbcdf2fa" mode="Transparent" x="124" y="15" width="13" height="15" forecolor="#000000" backcolor="#FFFFFF"/> + <textElement textAlignment="Left" verticalAlignment="Top" rotation="None" markup="none"> + <font fontName="SansSerif" size="9" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/> + <paragraph lineSpacing="Single"/> + </textElement> + <textFieldExpression><![CDATA[$R{cabecalho.periodoA}]]></textFieldExpression> + </textField> + </band> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/utilitarios/Relatorio.java b/src/java/com/rjconsultores/ventaboletos/relatorios/utilitarios/Relatorio.java index f56f26e5c..af7c909ab 100644 --- a/src/java/com/rjconsultores/ventaboletos/relatorios/utilitarios/Relatorio.java +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/utilitarios/Relatorio.java @@ -20,8 +20,8 @@ import com.rjconsultores.ventaboletos.relatorios.parametros.*; public enum Relatorio { RELATORIO_APROVEITAMENTO(1, "RelatorioAproveitamento", "Relatório de Aproveitamento",new RendimentoParamsImpl(), null), - RELATORIO_SERVICOS(2, "Servicosr", "Relatório de Serviços", null, new Vendas2CustomDS()), - RELATORIO_EXEMPLO(3, "ExemploFoo", "Relatório Foo", null, null); + RELATORIO_RECEITA_DIARIA_AGENCIA(2, "RelatorioReceitaDiariaAgencia", "Relatório de Receita Diária por Agência", null, null), + RELATORIO_EXEMPLO(99, "ExemploFoo", "Relatório Foo", null, null); private int codigo; private String nome; diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/relatorios/RelatorioAproveitamentoController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/relatorios/RelatorioAproveitamentoController.java index 5b6f59e5c..15ac0289e 100644 --- a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/relatorios/RelatorioAproveitamentoController.java +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/relatorios/RelatorioAproveitamentoController.java @@ -4,6 +4,7 @@ */ package com.rjconsultores.ventaboletos.web.gui.controladores.relatorios; +import java.util.Date; import java.util.HashMap; import java.util.Map; @@ -12,17 +13,30 @@ 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.zhtml.Messagebox; import org.zkoss.zk.ui.Component; import org.zkoss.zk.ui.event.Event; +import org.zkoss.zul.Button; +import org.zkoss.zul.Comboitem; +import org.zkoss.zul.ComboitemRenderer; import org.zkoss.zul.Datebox; -import org.zkoss.zul.Div; -import org.zkoss.zul.Iframe; +import org.zkoss.zul.Paging; +import com.rjconsultores.ventaboletos.entidad.Corrida; +import com.rjconsultores.ventaboletos.entidad.Parada; import com.rjconsultores.ventaboletos.relatorios.render.RenderRelatorioJasper; import com.rjconsultores.ventaboletos.relatorios.utilitarios.Relatorio; import com.rjconsultores.ventaboletos.utilerias.DateUtil; +import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxParada; +import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxParadaCve; import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; import com.rjconsultores.ventaboletos.web.utilerias.MyTextbox; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderCorrida; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderCorridaAproveitamento; /** * @@ -33,28 +47,22 @@ import com.rjconsultores.ventaboletos.web.utilerias.MyTextbox; public class RelatorioAproveitamentoController extends MyGenericForwardComposer { private Datebox fecCorrida; - private Div divResultadoRelatorio; - private Iframe iframeRelatorio; private MyTextbox txtCorridaId; + private MyComboboxParada cmbParadaOrigem; + private MyComboboxParadaCve cmbParadaOrigemCve; + private MyComboboxParada cmbParadaDestino; + private MyComboboxParadaCve cmbParadaDestinoCve; + private Button btnExecutarRelatorio; + + private MyListbox corridaList; + private Paging pagingCorrida; + @Autowired private DataSource dataSource; - public Iframe getIframeRelatorio() { - return iframeRelatorio; - } - - public void setIframeRelatorio(Iframe iframeRelatorio) { - this.iframeRelatorio = iframeRelatorio; - } - - public Div getDivResultadoRelatorio() { - return divResultadoRelatorio; - } - - public void setDivResultadoRelatorio(Div divResultadoRelatorio) { - this.divResultadoRelatorio = divResultadoRelatorio; - } + @Autowired + private transient PagedListWrapper plwCorrida; public Datebox getFecCorrida() { return fecCorrida; @@ -68,10 +76,132 @@ public class RelatorioAproveitamentoController extends MyGenericForwardComposer public void doAfterCompose(Component comp) throws Exception { super.doAfterCompose(comp); + corridaList.setItemRenderer(new RenderCorridaAproveitamento()); + + btnExecutarRelatorio.setDisabled(true); + + cmbParadaOrigemCve.setItemRenderer(new ComboitemRenderer() { + + @Override + public void render(Comboitem cmbtm, Object o) throws Exception { + Parada parada = (Parada) o; + + cmbtm.setLabel(parada.getCveparada()); + cmbtm.setValue(parada); + + } + }); + + cmbParadaDestinoCve.setItemRenderer(new ComboitemRenderer() { + + @Override + public void render(Comboitem cmbtm, Object o) throws Exception { + Parada parada = (Parada) o; + + cmbtm.setLabel(parada.getCveparada()); + cmbtm.setValue(parada); + + } + }); + } + public void onClick$btnBuscarServico(Event ev) throws Exception { + refreshLista(); + } + + public void onClick$btnExecutarRelatorio(Event ev) throws Exception { - executarRelatorio(); + executarRelatorio(); + } + + public void onSelect$cmbParadaOrigemCve(Event ev) { + if (cmbParadaOrigemCve.getSelectedItem() != null) { + cmbParadaOrigem.setComboItemByParada((Parada) cmbParadaOrigemCve.getSelectedItem().getValue()); + } + + } + + public void onSelect$cmbParadaOrigem(Event ev) { + + if (cmbParadaOrigem.getSelectedItem() != null) + cmbParadaOrigemCve.setComboItemByParada((Parada) cmbParadaOrigem.getSelectedItem().getValue()); + + } + + public void onSelect$cmbParadaDestinoCve(Event ev) { + + if (cmbParadaDestinoCve.getSelectedItem() != null) + cmbParadaDestino.setComboItemByParada((Parada) cmbParadaDestinoCve.getSelectedItem().getValue()); + + } + + public void onSelect$cmbParadaDestino(Event ev) { + + if (cmbParadaDestino.getSelectedItem() != null) + cmbParadaDestinoCve.setComboItemByParada((Parada) cmbParadaDestino.getSelectedItem().getValue()); + + } + public void onSelect$corridaList(Event ev) { + txtCorridaId.setValue(((Corrida)corridaList.getSelected()).getId().getCorridaId().toString()); + btnExecutarRelatorio.setDisabled(false); + + } + + + + private void refreshLista() { + btnExecutarRelatorio.setDisabled(true); + HibernateSearchObject corridaBusqueda = + new HibernateSearchObject(Corrida.class, + pagingCorrida.getPageSize()); + + + Comboitem cbiOrigem = cmbParadaOrigem.getSelectedItem(); + if (cbiOrigem != null) { + Parada origem = (Parada) cbiOrigem.getValue(); + corridaBusqueda.addFilterEqual("origem", origem); + } + + Comboitem cbiDestino = cmbParadaDestino.getSelectedItem(); + if (cbiDestino != null) { + Parada destino = (Parada) cbiDestino.getValue(); + corridaBusqueda.addFilterEqual("destino", destino); + } + + if (fecCorrida.getValue() != null) { + Date data = fecCorrida.getValue(); + data.setHours(00); + data.setMinutes(00); + data.setSeconds(00); + corridaBusqueda.addFilterEqual("id.feccorrida", data); + } + + + if(txtCorridaId.getValue() != null && !txtCorridaId.getValue().isEmpty()){ + corridaBusqueda.addFilterEqual("id.corridaId", new Integer(txtCorridaId.getValue())); + } + + + corridaBusqueda.addFilterEqual("activo", Boolean.TRUE); + + plwCorrida.init(corridaBusqueda, corridaList, + pagingCorrida); + + if (corridaList.getData().length == 0) { + try { + Messagebox.show(Labels.getLabel("MSG.ningunRegistro"), + Labels.getLabel("relatorioAproveitamentoController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } catch (InterruptedException ex) { + } + } + + if (corridaList.getData().length == 1) { + corridaList.setSelectedIndex(0); + btnExecutarRelatorio.setDisabled(false); + } + } /** @@ -94,7 +224,7 @@ public class RelatorioAproveitamentoController extends MyGenericForwardComposer args.put("renderRelatorio", render); openWindow("/component/reportView.zul", - Relatorio.RELATORIO_APROVEITAMENTO.getNome(), args, MODAL); + Relatorio.RELATORIO_APROVEITAMENTO.getDescricao(), args, MODAL); } diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/relatorios/RelatorioReceitaDiariaAgenciaController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/relatorios/RelatorioReceitaDiariaAgenciaController.java new file mode 100644 index 000000000..55fdd5696 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/relatorios/RelatorioReceitaDiariaAgenciaController.java @@ -0,0 +1,276 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.relatorios; + +import java.util.ArrayList; +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.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zk.ui.event.ForwardEvent; +import org.zkoss.zul.Bandbox; +import org.zkoss.zul.Checkbox; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Comboitem; +import org.zkoss.zul.Datebox; +import org.zkoss.zul.Div; +import org.zkoss.zul.Iframe; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.Paging; +import org.zkoss.zul.Textbox; +import org.zkoss.zul.event.PagingEvent; + +import com.rjconsultores.ventaboletos.entidad.Articulo; +import com.rjconsultores.ventaboletos.entidad.Estado; +import com.rjconsultores.ventaboletos.entidad.Pais; +import com.rjconsultores.ventaboletos.entidad.PuntoVenta; +import com.rjconsultores.ventaboletos.relatorios.render.RenderRelatorioJasper; +import com.rjconsultores.ventaboletos.relatorios.utilitarios.Relatorio; +import com.rjconsultores.ventaboletos.service.EstadoService; +import com.rjconsultores.ventaboletos.service.PaisService; +import com.rjconsultores.ventaboletos.service.PuntoVentaService; +import com.rjconsultores.ventaboletos.utilerias.DateUtil; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.MyTextbox; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderArticulo; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderPuntoVenta; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderPuntoVentaSimple; +import com.trg.search.Filter; + +/** + * + * @author Administrador + */ +@Controller("relatorioReceitaDiariaAgenciaController") +@Scope("prototype") +public class RelatorioReceitaDiariaAgenciaController extends MyGenericForwardComposer { + + @Autowired + private EstadoService estadoService; + @Autowired + private PuntoVentaService puntoVentaService; + @Autowired + private DataSource dataSource; + private List lsEstado; + + private ArrayList lsNumPuntoVenta = new ArrayList(); + + @Autowired + private transient PagedListWrapper plwPuntoVenta; + private MyListbox puntoVentaList; + private Paging pagingPuntoVenta; + + private Bandbox bbPesquisaPuntoVenta; + + private Textbox txtPalavraPesquisa; + private Combobox cmbEstado; + private Combobox cmbPuntoVenta; + private Datebox datInicial; + private Datebox datFinal; + private Checkbox chkExcessoBagagem; + + public Datebox getDatInicial() { + return datInicial; + } + + public void setDatInicial(Datebox datInicial) { + this.datInicial = datInicial; + } + + public Datebox getDatFinal() { + return datFinal; + } + + public void setDatFinal(Datebox datFinal) { + this.datFinal = datFinal; + } + + public List getLsEstado() { + return lsEstado; + } + + public void setLsEstado(List lsEstado) { + this.lsEstado = lsEstado; + } + + public Combobox getCmbEstado() { + return cmbEstado; + } + + public void setCmbEstado(Combobox cmbEstado) { + this.cmbEstado = cmbEstado; + } + + public Combobox getCmbPuntoVenta() { + return cmbPuntoVenta; + } + + public void setCmbPuntoVenta(Combobox cmbPuntoVenta) { + this.cmbPuntoVenta = cmbPuntoVenta; + } + + public MyListbox getPuntoVentaList() { + return puntoVentaList; + } + + public void setPuntoVentaList(MyListbox puntoVentaList) { + this.puntoVentaList = puntoVentaList; + } + + public Paging getPagingPuntoVenta() { + return pagingPuntoVenta; + } + + public void setPagingPuntoVenta(Paging pagingPuntoVenta) { + this.pagingPuntoVenta = pagingPuntoVenta; + } + + public Textbox getTxtPalavraPesquisa() { + return txtPalavraPesquisa; + } + + public void setTxtPalavraPesquisa(Textbox txtPalavraPesquisa) { + this.txtPalavraPesquisa = txtPalavraPesquisa; + } + + public Bandbox getBbPesquisaPuntoVenta() { + return bbPesquisaPuntoVenta; + } + + public void setBbPesquisaPuntoVenta(Bandbox bbPesquisaPuntoVenta) { + this.bbPesquisaPuntoVenta = bbPesquisaPuntoVenta; + } + + public Checkbox getChkExcessoBagagem() { + return chkExcessoBagagem; + } + + public void setChkExcessoBagagem(Checkbox chkExcessoBagagem) { + this.chkExcessoBagagem = chkExcessoBagagem; + } + + public void onClick$btnExecutarRelatorio(Event ev) throws Exception { + executarRelatorio(); + } + + public void onSelect$puntoVentaList(Event ev) { + + String strListPuntoVenta = new String(); + ArrayList lsSelecionados = (ArrayList) puntoVentaList.getSelectedsItens(); + + lsNumPuntoVenta.clear(); + for (Object objPuntoVenta : lsSelecionados) { + strListPuntoVenta = ((PuntoVenta) objPuntoVenta).getNombpuntoventa() + " " + strListPuntoVenta; + lsNumPuntoVenta.add(((PuntoVenta) objPuntoVenta).getNumPuntoVenta()); + } + this.bbPesquisaPuntoVenta.setValue(strListPuntoVenta); + + } + + public void onClick$btnLimpar(Event ev) { + limparPesquisaAgencia(); + } + + public void onClick$btnPesquisa(Event ev) { + executarPesquisa(); + } + + /** + * + */ + private void limparPesquisaAgencia() { + puntoVentaList.clearSelection(); + + lsNumPuntoVenta.clear(); + this.bbPesquisaPuntoVenta.setValue(""); + } + + /** + * + */ + private void executarPesquisa() { + HibernateSearchObject puntoVentaBusqueda = + new HibernateSearchObject(PuntoVenta.class, + pagingPuntoVenta.getPageSize()); + + puntoVentaBusqueda.addFilterOr(Filter.like("nombpuntoventa", "%" + txtPalavraPesquisa.getText().trim().toUpperCase().concat("%")), Filter.like("numPuntoVenta", "%" + txtPalavraPesquisa.getText().trim().toUpperCase().concat("%"))); + + puntoVentaBusqueda.addSortAsc("nombpuntoventa"); + + puntoVentaBusqueda.addFilterEqual("activo", Boolean.TRUE); + + plwPuntoVenta.init(puntoVentaBusqueda, puntoVentaList, pagingPuntoVenta); + + if (puntoVentaList.getData().length == 0) { + try { + Messagebox.show(Labels.getLabel("MSG.ningunRegistro"), + Labels.getLabel("relatorioReceitaDiariaAgenciaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } catch (InterruptedException ex) { + } + } + } + + /** + * @throws Exception + * + */ + private void executarRelatorio() throws Exception { + + Map parametros = new HashMap(); + + RenderRelatorioJasper render = new RenderRelatorioJasper(Relatorio.RELATORIO_RECEITA_DIARIA_AGENCIA, dataSource.getConnection()); + + parametros.put("DATA_INICIO", new java.sql.Date(((java.util.Date) this.datInicial.getValue()).getTime())); + parametros.put("DATA_FINAL", new java.sql.Date(((java.util.Date) this.datFinal.getValue()).getTime())); + + parametros.put("B_EXCLUI_BAGAGEM", chkExcessoBagagem.isChecked()); + + if (lsNumPuntoVenta.size() > 0) { + parametros.put("NUMPUNTOVENTA", lsNumPuntoVenta); + parametros.put("ISNUMPUNTOVENTATODOS", "N"); + } + else + parametros.put("ISNUMPUNTOVENTATODOS", "S"); + + Comboitem itemEstado = cmbEstado.getSelectedItem(); + if (itemEstado != null) { + Estado estado = (Estado) itemEstado.getValue(); + parametros.put("ESTADO_ID", estado.getEstadoId()); + } + + render.setParametros(parametros); + + Map args = new HashMap(); + args.put("renderRelatorio", render); + + openWindow("/component/reportView.zul", + Relatorio.RELATORIO_RECEITA_DIARIA_AGENCIA.getDescricao(), args, MODAL); + + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + lsEstado = estadoService.obtenerTodos(); + super.doAfterCompose(comp); + + puntoVentaList.setItemRenderer(new RenderPuntoVentaSimple()); + + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/MyComboboxParada.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/MyComboboxParada.java index db9ede2f2..0dae96c5b 100644 --- a/src/java/com/rjconsultores/ventaboletos/web/utilerias/MyComboboxParada.java +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/MyComboboxParada.java @@ -36,7 +36,7 @@ public class MyComboboxParada extends Combobox { public MyComboboxParada() { super(); - + paradaService = (ParadaService) SpringUtil.getBean("paradaService"); lsParadas = new ArrayList(); @@ -132,4 +132,13 @@ public class MyComboboxParada extends Combobox { public void setSinTodos(boolean sinTodos) { this.sinTodos = sinTodos; } + + public void setComboItemByParada(Parada parada) { + + List ls = new ArrayList(); + ls.add(parada); + + this.setModel(new BindingListModelList(ls, false)); + this.setText(parada.getDescparada()); + } } diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/MyComboboxParadaCve.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/MyComboboxParadaCve.java new file mode 100644 index 000000000..17cbf9ebe --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/MyComboboxParadaCve.java @@ -0,0 +1,145 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias; + +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.service.ParadaService; +import java.util.ArrayList; +import java.util.List; +import org.apache.log4j.Logger; +import org.zkoss.util.resource.Labels; +import org.zkoss.zk.ui.WrongValueException; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zk.ui.event.InputEvent; +import org.zkoss.zkplus.databind.BindingListModel; +import org.zkoss.zkplus.databind.BindingListModelList; +import org.zkoss.zkplus.spring.SpringUtil; +import org.zkoss.zul.Combobox; + +/** + * + * @author Administrador + */ +public class MyComboboxParadaCve extends Combobox { + + private static Logger log = Logger.getLogger(MyComboboxParadaCve.class); + public final static int minLength = 2; + private ParadaService paradaService; + private List lsParadas; + private Parada initialValue; + private Integer indiceSelected = null; + private boolean sinTodos = false; + private Integer ID_TODOS = -1; + + public MyComboboxParadaCve() { + super(); + + paradaService = (ParadaService) SpringUtil.getBean("paradaService"); + lsParadas = new ArrayList(); + + this.setAutodrop(false); + this.setAutocomplete(false); + + this.addEventListener("onOK", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + String strParada = MyComboboxParadaCve.this.getText().toUpperCase(); + if (strParada.length() < MyComboboxParadaCve.minLength) { + return; + } + if (!strParada.isEmpty()) { + lsParadas = paradaService.buscarCVE(strParada); + + if (sinTodos) { + log.debug("Sin todos"); + Parada p = paradaService.obtenerID(ID_TODOS); + lsParadas.remove(p); + } + + BindingListModel listModelParada = new BindingListModelList(lsParadas, true); + MyComboboxParadaCve.this.setModel(listModelParada); + indiceSelected = null; + if (!lsParadas.isEmpty()) { + indiceSelected = 0; + } + + MyComboboxParadaCve.this.open(); + } else { + lsParadas.clear(); + + BindingListModel listModelParada = new BindingListModelList(lsParadas, true); + MyComboboxParadaCve.this.setModel(listModelParada); + } + } + }); + + this.addEventListener("onChanging", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + InputEvent ev = (InputEvent) event; + String strParada = ev.getValue(); + if (strParada.length() < 2) { + lsParadas.clear(); + + BindingListModel listModelParada = new BindingListModelList(lsParadas, true); + MyComboboxParadaCve.this.setModel(listModelParada); + + MyComboboxParadaCve.this.close(); + } + } + }); + } + + public Parada getInitialValue() { + return initialValue; + } + + public void setInitialValue(Parada initialValue) { + if (initialValue == null) { + return; + } + List ls = new ArrayList(); + ls.add(initialValue); + + this.setModel(new BindingListModelList(ls, false)); + this.setText(initialValue.getDescparada()); + } + + /** + * + * @param checaBusqueda + * @throws WrongValueException + */ + public String getValue(boolean checaBusqueda) throws WrongValueException { + if (checaBusqueda) { + if (this.getSelectedItem() == null) { + throw new WrongValueException(this, Labels.getLabel("MSG.Error.combobox.hacerBusqueda")); + } + } + + return super.getValue(); + } + + public boolean isSinTodos() { + return sinTodos; + } + + public void setSinTodos(boolean sinTodos) { + this.sinTodos = sinTodos; + } + + public void setComboItemByParada(Parada parada) { + + List ls = new ArrayList(); + ls.add(parada); + + this.setModel(new BindingListModelList(ls, false)); + this.setText(parada.getCveparada()); + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/relatorios/ItemMenuRelatorioReceitaDiariaAgencia.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/relatorios/ItemMenuRelatorioReceitaDiariaAgencia.java new file mode 100644 index 000000000..882c37753 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/relatorios/ItemMenuRelatorioReceitaDiariaAgencia.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 ItemMenuRelatorioReceitaDiariaAgencia extends DefaultItemMenuSistema { + + public ItemMenuRelatorioReceitaDiariaAgencia() { + super("indexController.mniRelatorioReceitaDiariaAgencia.label"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.RELATORIOS.MENU.RELATORIORECEITADIARIAAGENCIA"; + } + + @Override + public void ejecutar() { + PantallaUtileria.openWindow("/gui/relatorios/filtroRelatorioReceitaDiariaAgencia.zul", + Labels.getLabel("relatorioReceitaDiariaAgenciaController.window.title"), null,desktop); + + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderCorridaAproveitamento.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderCorridaAproveitamento.java new file mode 100644 index 000000000..3a2eacdad --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderCorridaAproveitamento.java @@ -0,0 +1,65 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.Corrida; +import java.text.SimpleDateFormat; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Administrador + */ +public class RenderCorridaAproveitamento implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + Corrida corrida = (Corrida) o; + + Listcell lc = new Listcell(); + + lc = new Listcell(corrida.getId().getCorridaId().toString()); + lc.setParent(lstm); + + SimpleDateFormat formatData = new SimpleDateFormat("dd/MM/yyyy"); + lc = new Listcell(formatData.format(corrida.getFechorsalida())); + lc.setParent(lstm); + + SimpleDateFormat formatHora = new SimpleDateFormat("KK:mm"); + lc = new Listcell(formatHora.format(corrida.getFechorsalida())); + lc.setParent(lstm); + + if (corrida.getOrigem() != null) { + lc = new Listcell(corrida.getOrigem().getDescparada()); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + if (corrida.getDestino() != null) { + lc = new Listcell(corrida.getDestino().getDescparada()); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + if (corrida.getRuta() != null) { + lc = new Listcell(corrida.getRuta().getDescruta()); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + if (corrida.getClaseServicio() != null) { + lc = new Listcell(corrida.getClaseServicio().getDescclase()); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + lstm.setAttribute("data", corrida); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderPuntoVentaSimple.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderPuntoVentaSimple.java new file mode 100644 index 000000000..2b033c782 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderPuntoVentaSimple.java @@ -0,0 +1,33 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +import com.rjconsultores.ventaboletos.entidad.Empresa; +import com.rjconsultores.ventaboletos.entidad.PuntoVenta; + +/** + * + * @author Administrador + */ +public class RenderPuntoVentaSimple implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + PuntoVenta puntoVenta = (PuntoVenta) o; + + Listcell lc = new Listcell(puntoVenta.getNumPuntoVenta()); + lc.setParent(lstm); + + + + lc = new Listcell(puntoVenta.getNombpuntoventa()); + lc.setParent(lstm); + + lstm.setAttribute("data", puntoVenta); + } +} diff --git a/web/WEB-INF/i3-label_pt_BR.label b/web/WEB-INF/i3-label_pt_BR.label index 84656fb6c..e03e764c7 100644 --- a/web/WEB-INF/i3-label_pt_BR.label +++ b/web/WEB-INF/i3-label_pt_BR.label @@ -211,6 +211,7 @@ indexController.mniCliente.label = Cliente indexController.mniTarjetaCredito.label = Cartão de Crédito indexController.mniRelatorios.label = Relatórios indexController.mniRelatorioAproveitamento.label = Relatório de Aproveitamento +indexController.mniRelatorioReceitaDiariaAgencia.label = Relatório de Receita Diária por Agência #PARTE REALIZADA POR MANUEL indexController.mnCortesias.label = Cortesias Para Funcionários @@ -235,10 +236,33 @@ busquedaClaseServicioController.lhDesc.label = Descrição busquedaClaseServicioController.lhId.label = ID #Relatórios + +#Aproveitamento relatorioAproveitamentoController.window.title = Relatório de Aproveitamento relatorioAproveitamentoController.lbFecCorrida.value = Data Serviço relatorioAproveitamentoController.lbServico.value = N. Serviço + +relatorioAproveitamentoController.lhDesc.label = Descrição +relatorioAproveitamentoController.Origem.label = Origem +relatorioAproveitamentoController.Destino.label = Destino +relatorioAproveitamentoController.Servico.label = Serviço +relatorioAproveitamentoController.DataServico.label = Data Serviço +relatorioAproveitamentoController.HoraServico.label = Data Serviço +relatorioAproveitamentoController.Classe.label = Classe +relatorioAproveitamentoController.btnBuscarServico.label = Buscar Serviço + + +#Receita Diária por Agência +relatorioReceitaDiariaAgenciaController.window.title = Relatório de Receita Diária por Agência +relatorioReceitaDiariaAgenciaController.lbDataIni.value = Data Inicial +relatorioReceitaDiariaAgenciaController.lbDataFin.value = Data Final +relatorioReceitaDiariaAgenciaController.lbEstado.value = Estado +relatorioReceitaDiariaAgenciaController.lbPuntoVenta.value = Agência +relatorioReceitaDiariaAgenciaController.btnPesquisa.label = Pesquisar +relatorioReceitaDiariaAgenciaController.btnLimpar.label = Limpar Seleção + + # Pantalla Editar Classe editarClaseServicioController.window.title = Tipo de Classe editarClaseServicioController.btnApagar.tooltiptext = Eliminar diff --git a/web/gui/relatorios/filtroRelatorioAproveitamento.zul b/web/gui/relatorios/filtroRelatorioAproveitamento.zul index a22c450d5..566abde40 100644 --- a/web/gui/relatorios/filtroRelatorioAproveitamento.zul +++ b/web/gui/relatorios/filtroRelatorioAproveitamento.zul @@ -5,28 +5,87 @@ - - - - - - - - - - - - - - -