diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioAproveitamento_pt_BR.properties b/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioAproveitamento_pt_BR.properties new file mode 100644 index 000000000..813be549a --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioAproveitamento_pt_BR.properties @@ -0,0 +1,16 @@ +#geral +msg.noData=Não foi possivel obter dados com os parâmetros informados. + +#Labels cabeçalho +cabecalho.relatorio=Relatório: +cabecalho.servico=Serviço: +cabecalho.data=Data: + +#Labels header +sumario.totalArrecadado=Total Arrecadado: +sumario.arrecadadoKm=Arrecadado/KM: +sumario.nominalKm=Nominal/KM: +sumario.ocupacao=Ocupação: +sumario.ocupacaoComArrecadacao=Ocupação com Arrecadação: +sumario.ocupacaoSemArrecadacao=Ocupação sem Arrecadação +sumario.totalNominal=Total Nominal: diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/parametros/RendimentoParamsImpl.java b/src/java/com/rjconsultores/ventaboletos/relatorios/parametros/RendimentoParamsImpl.java index ade2fb06b..5bdb2ce1d 100644 --- a/src/java/com/rjconsultores/ventaboletos/relatorios/parametros/RendimentoParamsImpl.java +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/parametros/RendimentoParamsImpl.java @@ -7,6 +7,7 @@ package com.rjconsultores.ventaboletos.relatorios.parametros; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; +import java.util.Locale; import java.util.Map; import com.rjconsultores.ventaboletos.relatorios.utilitarios.IParametros; import com.rjconsultores.ventaboletos.web.utilerias.CurrencyUtil; @@ -23,7 +24,7 @@ public class RendimentoParamsImpl implements IParametros { * @see com.rjconsultores.ventaboletos.relatorios.utilitarios.IParametros#initParametros() */ @Override - public void initParametros(Map parametros, Connection connection) throws Exception { + public void processaParametros(Map parametros, Connection connection) throws Exception { String sql = this.getSql(); PreparedStatement stmt = null; @@ -35,13 +36,18 @@ public class RendimentoParamsImpl implements IParametros { rset = stmt.executeQuery(); if (rset.next()) { - parametros.put("P_NOMINAL_KM", CurrencyUtil.getCurrencyStrFromStr(rset.getString("NOMINAL_KM"))); - parametros.put("P_TOTAL_ARRECADADO", CurrencyUtil.getCurrencyStrFromStr(rset.getString("TOTAL_ARRECADADO"))); - parametros.put("P_ARRECADO_KM", CurrencyUtil.getCurrencyStrFromStr(rset.getString("ARRECADADO_KM"))); - parametros.put("P_OCUPACAO", rset.getString("OCUPACAO")+" %"); - parametros.put("P_OCUPACAO_ARRECADACAO", rset.getString("OCUPACAO_ARRECADACAO") +" %"); - parametros.put("P_TOTAL_NOMINAL", CurrencyUtil.getCurrencyStrFromStr(rset.getString("TOTAL_NOMINAL"))); - parametros.put("P_OCUPACAO_S_ARRECADACAO", rset.getString("OCUPACAO_S_ARRECADACAO") +" %"); + + // 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"); + + + parametros.put("P_NOMINAL_KM", CurrencyUtil.getCurrencyStrFromStr(rset.getString("NOMINAL_KM"), locale)); + parametros.put("P_TOTAL_ARRECADADO", CurrencyUtil.getCurrencyStrFromStr(rset.getString("TOTAL_ARRECADADO"), locale)); + parametros.put("P_ARRECADO_KM", CurrencyUtil.getCurrencyStrFromStr(rset.getString("ARRECADADO_KM"), locale)); + parametros.put("P_OCUPACAO", CurrencyUtil.getPercentStrFromStr(rset.getString("OCUPACAO"), locale)); + parametros.put("P_OCUPACAO_ARRECADACAO", CurrencyUtil.getPercentStrFromStr(rset.getString("OCUPACAO_ARRECADACAO"), locale)); + parametros.put("P_TOTAL_NOMINAL", CurrencyUtil.getCurrencyStrFromStr(rset.getString("TOTAL_NOMINAL"), locale)); + parametros.put("P_OCUPACAO_S_ARRECADACAO", CurrencyUtil.getPercentStrFromStr(rset.getString("OCUPACAO_S_ARRECADACAO"), locale) ); } } @@ -109,23 +115,29 @@ public class RendimentoParamsImpl implements IParametros { sql.append(" AND RO.DIAGRAMAAUTOBUS_ID = DD.DIAGRAMAAUTOBUS_ID "); sql.append(" AND DD.VENDIBLE = 1 "); sql.append(" AND CT.ACTIVO = 1) KM_OCUPADA, "); - sql.append(" (SELECT SUM(TF.PRECIO) "); - sql.append(" FROM CORRIDA_TRAMO CT, "); - sql.append(" TRAMO TR, "); - sql.append(" ROL_OPERATIVO RO, "); - sql.append(" DET_DIAGRAMA_AUTOBUS DD, "); - sql.append(" TARIFA TF "); - sql.append(" WHERE "); - sql.append(" CR.FECCORRIDA = CT.FECCORRIDA "); - sql.append(" AND CR.CORRIDA_ID = CT.CORRIDA_ID "); - sql.append(" AND CT.TRAMO_ID = TR.TRAMO_ID "); - sql.append(" AND CR.ROLOPERATIVO_ID = RO.ROLOPERATIVO_ID "); - sql.append(" AND RO.DIAGRAMAAUTOBUS_ID = DD.DIAGRAMAAUTOBUS_ID "); - sql.append(" AND TF.TRAMO_ID = CT.TRAMO_ID "); - sql.append(" AND TF.ORIGEN_ID = CT.ORIGEN_ID "); - sql.append(" AND TF.DESTINO_ID = CT.DESTINO_ID "); - sql.append(" AND DD.VENDIBLE = 1 "); - sql.append(" AND CT.ACTIVO = 1) TOTAL_NOMINAL, "); + + sql.append(" (SELECT SUM(TF.PRECIO) "); + sql.append(" FROM TRAMO TR, "); + sql.append(" ROL_OPERATIVO RO, "); + sql.append(" DET_DIAGRAMA_AUTOBUS DD, "); + sql.append(" TARIFA TF, "); + sql.append(" VIGENCIA_TARIFA VT "); + sql.append(" WHERE RO.ROLOPERATIVO_ID = CR.ROLOPERATIVO_ID "); + sql.append(" AND RO.DIAGRAMAAUTOBUS_ID = DD.DIAGRAMAAUTOBUS_ID "); + sql.append(" AND TF.CLASESERVICIO_ID = CR.CLASESERVICIO_ID "); + sql.append(" AND DD.VENDIBLE = 1 "); + sql.append(" AND TR.ORIGEN_ID = CR.ORIGEN_ID "); + sql.append(" AND TR.DESTINO_ID = CR.DESTINO_ID "); + sql.append(" AND TF.MARCA_ID = CR.MARCA_ID "); + sql.append(" AND TF.RUTA_ID = CR.RUTA_ID "); + sql.append(" AND TF.TRAMO_ID = TR.TRAMO_ID "); + sql.append(" AND TF.STATUSTARIFA = 'A' "); + sql.append(" AND TF.ACTIVO = 1 "); + sql.append(" AND TF.VIGENCIATARIFA_ID = VT.VIGENCIATARIFA_ID "); + sql.append(" AND VT.ACTIVO = 1 "); + sql.append(" AND CR.FECCORRIDA BETWEEN VT.FECINICIOVIGENCIA AND "); + sql.append(" VT.FECFINVIGENCIA) TOTAL_NOMINAL,"); + sql.append(" "); sql.append(" (SELECT COUNT(1) "); sql.append(" FROM CORRIDA_TRAMO CT, "); diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/render/RenderRelatorioAbstract.java b/src/java/com/rjconsultores/ventaboletos/relatorios/render/RenderRelatorioAbstract.java index a95901904..5fd231e11 100644 --- a/src/java/com/rjconsultores/ventaboletos/relatorios/render/RenderRelatorioAbstract.java +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/render/RenderRelatorioAbstract.java @@ -58,7 +58,16 @@ public abstract class RenderRelatorioAbstract implements IRenderRelatorio { public void setParametros(Map parametros) { this.parametros = parametros; - this.parametros.put("NOME_RELATORIO", this.relatorio.getNome()); + } + + public void preRender(){ + this.initParametros(); + } + + public void initParametros(){ + this.parametros.put("NOME_RELATORIO", this.relatorio.getDescricao()); + this.parametros.put("MSG_NO_DATA", this.relatorio.getNome()); + } /* @@ -68,7 +77,7 @@ public abstract class RenderRelatorioAbstract implements IRenderRelatorio { */ @Override public byte[] getConteudo(SaidaRelatorio saida) throws Exception { - + this.preRender(); 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 d8fd4e8a9..f1f7a3d46 100644 --- a/src/java/com/rjconsultores/ventaboletos/relatorios/render/RenderRelatorioJasper.java +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/render/RenderRelatorioJasper.java @@ -3,8 +3,11 @@ package com.rjconsultores.ventaboletos.relatorios.render; import java.io.ByteArrayOutputStream; import java.io.InputStream; import java.sql.Connection; +import java.util.Locale; +import java.util.ResourceBundle; import net.sf.jasperreports.engine.JRDataSource; +import net.sf.jasperreports.engine.JRParameter; import net.sf.jasperreports.engine.JasperExportManager; import net.sf.jasperreports.engine.JasperFillManager; import net.sf.jasperreports.engine.JasperPrint; @@ -53,6 +56,21 @@ 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(){ + super.preRender(); + this.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); + } /* * (non-Javadoc) @@ -66,9 +84,9 @@ public class RenderRelatorioJasper extends RenderRelatorioAbstract { if (this.jasperPrint == null) { if (this.relatorio.getParametros() != null) - this.relatorio.getParametros().initParametros(this.parametros, this.connection); + this.relatorio.getParametros().processaParametros(this.parametros, this.connection); - InputStream iStemplate = this.getClass().getResourceAsStream("/com/rjconsultores/ventaboletos/relatorios/templates/" + this.relatorio.getTemplate()); + 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); diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioAproveitamento.jasper b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioAproveitamento.jasper index 2a899db91..c566556f6 100644 Binary files a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioAproveitamento.jasper and b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioAproveitamento.jasper differ diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioAproveitamento.jrxml b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioAproveitamento.jrxml index 22e6b961f..598ed8583 100644 --- a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioAproveitamento.jrxml +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioAproveitamento.jrxml @@ -1,5 +1,5 @@ - + @@ -95,20 +95,13 @@ ORDER BY VT.NUMSECUENCIA, TO_NUMBER(DD.ASIENTO)]]> - <band height="85" splitType="Stretch"> + <band height="84" splitType="Stretch"> <rectangle> <reportElement uuid="8f226d21-ccdb-41b4-a01d-fb0712f0b4d3" x="0" y="0" width="555" height="30"/> </rectangle> <rectangle> <reportElement uuid="b6aa9717-79c4-4f13-91df-9b0255003a16" x="0" y="40" width="555" height="39"/> </rectangle> - <staticText> - <reportElement uuid="2e854857-9e82-43ae-bc7b-232319c1f259" x="12" y="0" width="65" height="15"/> - <textElement> - <font size="11" isBold="true"/> - </textElement> - <text><![CDATA[Relatório: ]]></text> - </staticText> <textField> <reportElement uuid="eb300dc6-1610-409d-8589-72b1539f86d3" x="77" y="0" width="478" height="15"/> <textElement> @@ -116,20 +109,20 @@ ORDER BY VT.NUMSECUENCIA, TO_NUMBER(DD.ASIENTO)]]> </textElement> <textFieldExpression><![CDATA[$P{NOME_RELATORIO}]]></textFieldExpression> </textField> - <staticText> - <reportElement uuid="b76b0e17-99b2-4681-8f60-b5bd5512e897" x="12" y="15" width="65" height="15"/> - <textElement> + <textField> + <reportElement uuid="a125ac5c-e00c-4ac5-bc03-317c514f1ad8" x="12" y="15" width="65" height="15"/> + <textElement markup="none"> <font size="11" isBold="true"/> </textElement> - <text><![CDATA[Serviço: ]]></text> - </staticText> - <staticText> - <reportElement uuid="bd889fb9-30d9-4023-b811-7f55e3213705" x="244" y="15" width="65" height="15"/> - <textElement> + <textFieldExpression><![CDATA[$R{cabecalho.servico}]]></textFieldExpression> + </textField> + <textField> + <reportElement uuid="88bb80e0-40a4-490c-914a-01a41178168b" x="244" y="15" width="65" height="15"/> + <textElement markup="none"> <font size="11" isBold="true"/> </textElement> - <text><![CDATA[Data:]]></text> - </staticText> + <textFieldExpression><![CDATA[$R{cabecalho.data}]]></textFieldExpression> + </textField> <textField> <reportElement uuid="a3d3c093-a9f4-4b32-823f-b4f548e46c2f" x="77" y="15" width="167" height="15"/> <textElement> @@ -137,55 +130,55 @@ ORDER BY VT.NUMSECUENCIA, TO_NUMBER(DD.ASIENTO)]]> </textElement> <textFieldExpression><![CDATA[$P{CORRIDA_ID}]]></textFieldExpression> </textField> - <staticText> - <reportElement uuid="021e9662-43c5-4054-a0d2-3fc8f6003111" x="12" y="40" width="78" height="11"/> - <textElement> + <textField> + <reportElement uuid="995111bb-4726-421b-a538-db8b53b3f206" x="12" y="40" width="78" height="11"/> + <textElement markup="none"> <font size="8"/> </textElement> - <text><![CDATA[Total Arrecadado:]]></text> - </staticText> - <staticText> - <reportElement uuid="062b6b12-00e3-4389-8359-bf59b8879b4d" x="12" y="51" width="78" height="11"/> - <textElement> + <textFieldExpression><![CDATA[$R{sumario.totalArrecadado}]]></textFieldExpression> + </textField> + <textField> + <reportElement uuid="3a0c6793-e57f-44c7-8588-1692055bf62a" x="12" y="51" width="78" height="11"/> + <textElement markup="none"> <font size="8"/> </textElement> - <text><![CDATA[Arrecadado/KM:]]></text> - </staticText> - <staticText> - <reportElement uuid="f2b94d48-f3b5-4781-ac11-ff28a41e0d90" x="197" y="40" width="105" height="11"/> - <textElement> + <textFieldExpression><![CDATA[$R{sumario.arrecadadoKm}]]></textFieldExpression> + </textField> + <textField> + <reportElement uuid="a0ec9db5-a7be-4407-b257-e49dd7fe6811" x="197" y="40" width="105" height="11"/> + <textElement markup="none"> <font size="8"/> </textElement> - <text><![CDATA[Ocupação:]]></text> - </staticText> - <staticText> - <reportElement uuid="58deb635-5e71-4614-b71e-d81d5dad85f0" x="197" y="51" width="105" height="11"/> - <textElement> + <textFieldExpression><![CDATA[$R{sumario.ocupacao}]]></textFieldExpression> + </textField> + <textField> + <reportElement uuid="0325af45-b23b-45ba-a8c6-dea75a36bb75" x="197" y="51" width="105" height="11"/> + <textElement markup="none"> <font size="8"/> </textElement> - <text><![CDATA[Ocupação com Arrecação:]]></text> - </staticText> - <staticText> - <reportElement uuid="eec1daa6-74c5-49bf-855f-602d5230dfa1" x="12" y="63" width="78" height="11"/> - <textElement> + <textFieldExpression><![CDATA[$R{sumario.ocupacaoComArrecadacao}]]></textFieldExpression> + </textField> + <textField> + <reportElement uuid="bec7dafe-b775-495d-8233-301b351597ac" x="12" y="63" width="78" height="11"/> + <textElement markup="none"> <font size="8"/> </textElement> - <text><![CDATA[Nominal/KM:]]></text> - </staticText> - <staticText> - <reportElement uuid="ccaffa74-0602-4168-b191-ba02c523221f" x="197" y="63" width="105" height="11"/> - <textElement> + <textFieldExpression><![CDATA[$R{sumario.nominalKm}]]></textFieldExpression> + </textField> + <textField> + <reportElement uuid="fcaa51c2-2057-4aa4-bb84-adae3ef5c34e" x="197" y="63" width="105" height="11"/> + <textElement markup="none"> <font size="8"/> </textElement> - <text><![CDATA[Ocupação sem Arrecação:]]></text> - </staticText> - <staticText> - <reportElement uuid="12cf983e-3909-4cf6-94d8-dfc008edc47d" x="382" y="40" width="78" height="11"/> - <textElement> + <textFieldExpression><![CDATA[$R{sumario.ocupacaoSemArrecadacao}]]></textFieldExpression> + </textField> + <textField> + <reportElement uuid="5cc7b439-0a60-4581-a67c-83519a4fd977" x="382" y="40" width="78" height="11"/> + <textElement markup="none"> <font size="8"/> </textElement> - <text><![CDATA[Total Nominal:]]></text> - </staticText> + <textFieldExpression><![CDATA[$R{sumario.totalNominal}]]></textFieldExpression> + </textField> <line> <reportElement uuid="5b56b7a4-1abd-43cc-8071-e949d5575a45" x="185" y="40" width="1" height="39" forecolor="#CCCCCC"/> </line> @@ -193,50 +186,50 @@ ORDER BY VT.NUMSECUENCIA, TO_NUMBER(DD.ASIENTO)]]> <reportElement uuid="98b93926-7900-4445-bbe6-024e456fd45e" x="370" y="40" width="1" height="39" forecolor="#CCCCCC"/> </line> <textField> - <reportElement uuid="bdfd7f9e-e50e-4a8b-bba4-2fc8a909f38b" x="90" y="63" width="78" height="11"/> - <textElement> + <reportElement uuid="bdfd7f9e-e50e-4a8b-bba4-2fc8a909f38b" x="90" y="63" width="85" height="11"/> + <textElement textAlignment="Right"> <font size="8"/> </textElement> <textFieldExpression><![CDATA[$P{P_NOMINAL_KM}]]></textFieldExpression> </textField> <textField> - <reportElement uuid="7eb2d8d3-4a3f-40cd-8117-8e53ab128f34" x="90" y="40" width="96" height="11"/> - <textElement> + <reportElement uuid="7eb2d8d3-4a3f-40cd-8117-8e53ab128f34" x="90" y="40" width="85" height="11"/> + <textElement textAlignment="Right"> <font size="8"/> </textElement> <textFieldExpression><![CDATA[$P{P_TOTAL_ARRECADADO}]]></textFieldExpression> </textField> <textField> - <reportElement uuid="64600377-6028-4c56-b0f1-3acf6ceeb708" x="90" y="51" width="95" height="11"/> - <textElement> + <reportElement uuid="64600377-6028-4c56-b0f1-3acf6ceeb708" x="90" y="51" width="85" height="11"/> + <textElement textAlignment="Right"> <font size="8"/> </textElement> <textFieldExpression><![CDATA[$P{P_ARRECADO_KM}]]></textFieldExpression> </textField> <textField> - <reportElement uuid="6b68d2b4-0fa0-41a4-bdf5-0eaccb7d1f59" x="302" y="40" width="100" height="11"/> - <textElement> + <reportElement uuid="6b68d2b4-0fa0-41a4-bdf5-0eaccb7d1f59" x="302" y="40" width="58" height="11"/> + <textElement textAlignment="Right"> <font size="8"/> </textElement> <textFieldExpression><![CDATA[$P{P_OCUPACAO}]]></textFieldExpression> </textField> <textField> - <reportElement uuid="66317ebd-e503-420c-8886-8385b782770d" x="302" y="51" width="69" height="11"/> - <textElement> + <reportElement uuid="66317ebd-e503-420c-8886-8385b782770d" x="302" y="51" width="58" height="11"/> + <textElement textAlignment="Right"> <font size="8"/> </textElement> <textFieldExpression><![CDATA[$P{P_OCUPACAO_ARRECADACAO}]]></textFieldExpression> </textField> <textField> - <reportElement uuid="a6ff7221-60b5-4d08-b7e8-7b10db0b97a6" x="302" y="63" width="68" height="11"/> - <textElement> + <reportElement uuid="a6ff7221-60b5-4d08-b7e8-7b10db0b97a6" x="302" y="63" width="58" height="11"/> + <textElement textAlignment="Right"> <font size="8"/> </textElement> <textFieldExpression><![CDATA[$P{P_OCUPACAO_S_ARRECADACAO}]]></textFieldExpression> </textField> <textField> - <reportElement uuid="9eebfdd7-504b-4e98-8893-63bdb8c02b54" x="468" y="40" width="87" height="11"/> - <textElement> + <reportElement uuid="9eebfdd7-504b-4e98-8893-63bdb8c02b54" x="468" y="40" width="74" height="11"/> + <textElement textAlignment="Right"> <font size="8"/> </textElement> <textFieldExpression><![CDATA[$P{P_TOTAL_NOMINAL}]]></textFieldExpression> @@ -246,12 +239,19 @@ ORDER BY VT.NUMSECUENCIA, TO_NUMBER(DD.ASIENTO)]]> <textElement/> <textFieldExpression><![CDATA[$P{DATA}]]></textFieldExpression> </textField> + <textField> + <reportElement uuid="11a895de-bf79-45dc-8d47-ea6ef8bf562c" x="12" y="0" width="65" height="15"/> + <textElement> + <font size="11" isBold="true"/> + </textElement> + <textFieldExpression><![CDATA[$R{cabecalho.relatorio}]]></textFieldExpression> + </textField> </band> - + - + @@ -385,4 +385,15 @@ ORDER BY VT.NUMSECUENCIA, TO_NUMBER(DD.ASIENTO)]]> + + + + + + + + + + + diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/utilitarios/IParametros.java b/src/java/com/rjconsultores/ventaboletos/relatorios/utilitarios/IParametros.java index fced7e5f7..91cbea577 100644 --- a/src/java/com/rjconsultores/ventaboletos/relatorios/utilitarios/IParametros.java +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/utilitarios/IParametros.java @@ -20,6 +20,6 @@ public interface IParametros { * @param connection * @throws Exception */ - void initParametros(Map parametros, Connection connection) throws Exception; + void processaParametros(Map parametros, Connection connection) throws Exception; } diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/utilitarios/IRenderRelatorio.java b/src/java/com/rjconsultores/ventaboletos/relatorios/utilitarios/IRenderRelatorio.java index 1f5b18db1..8902b65ce 100644 --- a/src/java/com/rjconsultores/ventaboletos/relatorios/utilitarios/IRenderRelatorio.java +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/utilitarios/IRenderRelatorio.java @@ -19,5 +19,5 @@ public interface IRenderRelatorio { */ public byte[] getConteudo(SaidaRelatorio saida) throws Exception; - + } \ No newline at end of file diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/utilitarios/Relatorio.java b/src/java/com/rjconsultores/ventaboletos/relatorios/utilitarios/Relatorio.java index 298b9c892..f56f26e5c 100644 --- a/src/java/com/rjconsultores/ventaboletos/relatorios/utilitarios/Relatorio.java +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/utilitarios/Relatorio.java @@ -19,13 +19,13 @@ import com.rjconsultores.ventaboletos.relatorios.parametros.*; */ public enum Relatorio { - RELATORIO_APROVEITAMENTO(1, "RelatorioAproveitamento.jasper", "Relatório de Aproveitamento",new RendimentoParamsImpl(), null), - RELATORIO_SERVICOS(2, "Servicos.jasper", "Relatório de Serviços", null, new Vendas2CustomDS()), - RELATORIO_EXEMPLO(3, "ExemploFoo.jrxml", "Relatório Foo", null, null); + 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); private int codigo; - private String template; private String nome; + private String descricao; protected IDataSource datasource; private IParametros parametros; @@ -41,9 +41,9 @@ public enum Relatorio { * @param datasource * Custom Data Source do relátorio, só deve ser informado caso o relátorio não possua acesso direto ao banco */ - private Relatorio(int codigo, String template, String nome, IParametros parametros, IDataSource datasource) { + private Relatorio(int codigo, String nome, String descricao, IParametros parametros, IDataSource datasource) { this.codigo = codigo; - this.setTemplate(template); + this.setDescricao(descricao); this.setNome(nome); this.datasource = datasource; this.parametros = parametros; @@ -63,13 +63,6 @@ public enum Relatorio { } } - public String getTemplate() { - return template; - } - - public void setTemplate(String template) { - this.template = template; - } public String getNome() { return nome; @@ -94,4 +87,12 @@ public enum Relatorio { public void setParametros(IParametros parametros) { this.parametros = parametros; } + + public String getDescricao() { + return descricao; + } + + public void setDescricao(String descricao) { + this.descricao = descricao; + } } \ No newline at end of file diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/CurrencyUtil.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/CurrencyUtil.java index 8cce24545..7b2762fe6 100644 --- a/src/java/com/rjconsultores/ventaboletos/web/utilerias/CurrencyUtil.java +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/CurrencyUtil.java @@ -3,28 +3,30 @@ */ package com.rjconsultores.ventaboletos.web.utilerias; -import java.text.DecimalFormat; -import java.util.Currency; +import java.text.NumberFormat; +import java.util.Locale; /** * @author Bruno H. G. Gouvêa - * + * */ public final class CurrencyUtil { + + public static String getCurrencyStrFromStr(String value, Locale locale) { + + NumberFormat moedaFormat = + NumberFormat.getCurrencyInstance(locale); + return moedaFormat.format(Double.parseDouble(value)); + + } - - public static String getCurrencyStrFromStr(String value){ - - - double doubleValue = Double.parseDouble(value); - Currency currency = Currency.getInstance("BRL"); - DecimalFormat formato = new DecimalFormat(currency.getSymbol() + "#,##0.00"); - - - - - return formato.format(doubleValue); + public static String getPercentStrFromStr(String value, Locale locale) { + + NumberFormat percentFormat = NumberFormat.getPercentInstance(locale); + percentFormat.setMinimumFractionDigits(2); + return percentFormat.format(Double.parseDouble(value)); + } } diff --git a/web/WEB-INF/i3-label_pt_BR.label b/web/WEB-INF/i3-label_pt_BR.label index 7c316a7ef..c606d4b57 100644 --- a/web/WEB-INF/i3-label_pt_BR.label +++ b/web/WEB-INF/i3-label_pt_BR.label @@ -56,10 +56,13 @@ MSG.necesita.formaPago = Forma de Pagamento Obrigatória lb.id = ID lb.dec = Descrição lb.Equivalencia = Equivalencia -lb.btnExecutarRelatorio = Executar Relatório -lb.btnSalvarRelatorio = Salvar Relatório -lb.btnSalvarRelatorioPdf = Salvar Relatório em PDF -lb.btnSalvarRelatorioXls = Salvar Relatório em XLS + +# Relatório +relatorio.lb.btnExecutarRelatorio = Executar Relatório +relatorio.lb.btnSalvarRelatorio = Salvar Relatório +relatorio.lb.btnSalvarRelatorioPdf = Salvar Relatório em PDF +relatorio.lb.btnSalvarRelatorioXls = Salvar Relatório em XLS +relatorio.parametro.msgNoData = Não foi possivel obter dados com os parâmetros informados. # tooltip botões diff --git a/web/component/reportView.zul b/web/component/reportView.zul index f790eeea6..341334c61 100644 --- a/web/component/reportView.zul +++ b/web/component/reportView.zul @@ -11,10 +11,10 @@
+ tooltiptext="${c:l('relatorio.lb.btnSalvarRelatorioPdf')}" /> + tooltiptext="${c:l('relatorio.lb.btnSalvarRelatorioXls')}" /> diff --git a/web/gui/relatorios/filtroRelatorioAproveitamento.zul b/web/gui/relatorios/filtroRelatorioAproveitamento.zul index 403a4b035..a22c450d5 100644 --- a/web/gui/relatorios/filtroRelatorioAproveitamento.zul +++ b/web/gui/relatorios/filtroRelatorioAproveitamento.zul @@ -15,17 +15,17 @@