fixes bug#6777
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@49512 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
ab71ff9b12
commit
ac785770ae
|
@ -12,7 +12,7 @@ import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import com.rjconsultores.ventaboletos.relatorios.negocio.CalculoImposto;
|
import com.rjconsultores.ventaboletos.relatorios.negocio.CalculoImposto;
|
||||||
import com.rjconsultores.ventaboletos.relatorios.utilitarios.ArrayDataSource;
|
import com.rjconsultores.ventaboletos.relatorios.utilitarios.DataSource;
|
||||||
import com.rjconsultores.ventaboletos.relatorios.utilitarios.ExceptionConfiguracao;
|
import com.rjconsultores.ventaboletos.relatorios.utilitarios.ExceptionConfiguracao;
|
||||||
import com.rjconsultores.ventaboletos.relatorios.utilitarios.Relatorio;
|
import com.rjconsultores.ventaboletos.relatorios.utilitarios.Relatorio;
|
||||||
import com.rjconsultores.ventaboletos.utilerias.DateUtil;
|
import com.rjconsultores.ventaboletos.utilerias.DateUtil;
|
||||||
|
@ -33,7 +33,7 @@ public class RelatorioTaxasLinha extends Relatorio {
|
||||||
super(parametros, conexao);
|
super(parametros, conexao);
|
||||||
CalculoImposto.limpaCache();
|
CalculoImposto.limpaCache();
|
||||||
|
|
||||||
this.setCustomDataSource(new ArrayDataSource(this) {
|
this.setCustomDataSource(false,new DataSource(this) {
|
||||||
|
|
||||||
public void initDados() throws Exception {
|
public void initDados() throws Exception {
|
||||||
Connection conexao = this.relatorio.getConexao();
|
Connection conexao = this.relatorio.getConexao();
|
||||||
|
@ -65,31 +65,6 @@ public class RelatorioTaxasLinha extends Relatorio {
|
||||||
|
|
||||||
ResultSet rset = stmt.executeQuery();
|
ResultSet rset = stmt.executeQuery();
|
||||||
|
|
||||||
while (rset.next()) {
|
|
||||||
|
|
||||||
Map<String, Object> dataResult = new HashMap<String, Object>();
|
|
||||||
|
|
||||||
dataResult.put("PREFIXO", rset.getString("PREFIXO"));
|
|
||||||
dataResult.put("CIDADE_ORIGEM", rset.getString("CIDADE_ORIGEM"));
|
|
||||||
dataResult.put("CIDADE_DESTINO", rset.getString("CIDADE_DESTINO"));
|
|
||||||
dataResult.put("IMPORTETAXAEMBARQUE", rset.getBigDecimal("IMPORTETAXAEMBARQUE"));
|
|
||||||
dataResult.put("IMPORTEPEDAGIO", rset.getBigDecimal("IMPORTEPEDAGIO"));
|
|
||||||
dataResult.put("IMPORTESEGURO", rset.getBigDecimal("IMPORTESEGURO"));
|
|
||||||
dataResult.put("NOMBEMPRESA", rset.getString("NOMBEMPRESA"));
|
|
||||||
dataResult.put("NOMBPUNTOVENTA", rset.getString("NOMBPUNTOVENTA"));
|
|
||||||
dataResult.put("EMBARQUE_VENDIDOS", rset.getBigDecimal("EMBARQUE_VENDIDOS"));
|
|
||||||
dataResult.put("PEDAGIO_VENDIDOS", rset.getBigDecimal("PEDAGIO_VENDIDOS"));
|
|
||||||
dataResult.put("SEGURO_VENDIDOS", rset.getBigDecimal("SEGURO_VENDIDOS"));
|
|
||||||
dataResult.put("ORIGEM_ESTADO_ID", rset.getInt("ORIGEM_ESTADO_ID"));
|
|
||||||
dataResult.put("DESTINO_ESTADO_ID", rset.getInt("DESTINO_ESTADO_ID"));
|
|
||||||
dataResult.put("INTERESTADUAL", rset.getString("INTERESTADUAL"));
|
|
||||||
dataResult.put("TOTAL_EMBARQUE", rset.getBigDecimal("TOTAL_EMBARQUE"));
|
|
||||||
dataResult.put("TOTAL_PEDAGIO", rset.getBigDecimal("TOTAL_PEDAGIO"));
|
|
||||||
dataResult.put("TOTAL_SEGURO", rset.getBigDecimal("TOTAL_SEGURO"));
|
|
||||||
|
|
||||||
this.dados.add(dataResult);
|
|
||||||
}
|
|
||||||
|
|
||||||
this.resultSet = rset;
|
this.resultSet = rset;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -81,13 +81,21 @@ public abstract class Relatorio {
|
||||||
* the customDataSource to set
|
* the customDataSource to set
|
||||||
*/
|
*/
|
||||||
public void setCustomDataSource(IDataSource iDataSource) {
|
public void setCustomDataSource(IDataSource iDataSource) {
|
||||||
|
setCustomDataSource(true,iDataSource);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @param iDataSource
|
||||||
|
* the customDataSource to set
|
||||||
|
*/
|
||||||
|
public void setCustomDataSource(boolean closeConnection,IDataSource iDataSource) {
|
||||||
this.customDataSource = iDataSource;
|
this.customDataSource = iDataSource;
|
||||||
|
if (closeConnection){
|
||||||
try {
|
try {
|
||||||
if (!this.conexao.isClosed())
|
if (!this.conexao.isClosed())
|
||||||
this.conexao.close();
|
this.conexao.close();
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
log.error("Erro ao fechar a conexion", e);
|
log.error("Erro ao fechar a conexion", e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
*/
|
*/
|
||||||
package com.rjconsultores.ventaboletos.web.gui.controladores.relatorios;
|
package com.rjconsultores.ventaboletos.web.gui.controladores.relatorios;
|
||||||
|
|
||||||
|
import java.sql.Connection;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
@ -227,14 +228,21 @@ public class RelatorioTaxasLinhaController extends MyGenericForwardComposer {
|
||||||
filtro.append("Todos;");
|
filtro.append("Todos;");
|
||||||
}
|
}
|
||||||
|
|
||||||
parametros.put("FILTROS", filtro.toString());
|
Connection connection = dataSourceRead.getConnection();
|
||||||
relatorio = new RelatorioTaxasLinha(parametros, dataSourceRead.getConnection());
|
try{
|
||||||
|
parametros.put("FILTROS", filtro.toString());
|
||||||
|
relatorio = new RelatorioTaxasLinha(parametros, connection);
|
||||||
|
|
||||||
Map args = new HashMap();
|
Map args = new HashMap();
|
||||||
args.put("relatorio", relatorio);
|
args.put("relatorio", relatorio);
|
||||||
|
|
||||||
openWindow("/component/reportView.zul",
|
openWindow("/component/reportView.zul",
|
||||||
Labels.getLabel("relatorioTaxasLinhaController.window.title"), args, MODAL);
|
Labels.getLabel("relatorioTaxasLinhaController.window.title"), args, MODAL);
|
||||||
|
}finally{
|
||||||
|
if ( (connection != null) && !connection.isClosed()){
|
||||||
|
connection.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<Empresa> getLsEmpresa() {
|
public List<Empresa> getLsEmpresa() {
|
||||||
|
|
Loading…
Reference in New Issue