diff --git a/src/com/rjconsultores/integracaoreceitadespesa/dao/Totalbus.java b/src/com/rjconsultores/integracaoreceitadespesa/dao/Totalbus.java index 796024add..863972a2c 100644 --- a/src/com/rjconsultores/integracaoreceitadespesa/dao/Totalbus.java +++ b/src/com/rjconsultores/integracaoreceitadespesa/dao/Totalbus.java @@ -1,5 +1,6 @@ package com.rjconsultores.integracaoreceitadespesa.dao; +import java.math.BigDecimal; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; @@ -231,7 +232,7 @@ public class Totalbus { sb.append("select fdep.fechamentodeposito_id, fdep.valor, fdep.numdeposito, fdep.fecmodif "); sb.append("from fechamento_deposito fdep "); //sb.append("inner join insti_financeira i on i.instifinanceira_id = fdep.instifinanceira_id "); - sb.append("where fecha_deposito = :fecha and fdep.activo = 1 "); + sb.append("where trunc(fecmodif) = :fecha and fdep.activo = 1 "); StringBuilder strFechamentos = new StringBuilder(); @@ -269,6 +270,7 @@ public class Totalbus { SimpleDateFormat sdf = new SimpleDateFormat("MM/yy"); PreparedStatement pstmtFechamentos = getConnection().prepareStatement(strFechamentos.toString()); + BigDecimal soma = BigDecimal.ZERO; while (rs.next()){ pstmtFechamentos.setInt(1, rs.getInt(1)); @@ -308,8 +310,10 @@ public class Totalbus { deposito.setCodigoReceitaDespesa(codRecDesp); deposito.setDescricaoDetalhada(banco + agencia + contaCorrente + numDep + valor + ref); depositos.add(deposito); + soma = soma.add(rs.getBigDecimal(2)); } } + log.debug("Total depósitos: " + soma); } catch (Exception e){ log.error("", e); } finally {