leonardo 2016-02-11 18:42:54 +00:00
parent 1cf9955b54
commit d0182870a2
1 changed files with 5 additions and 1 deletions

View File

@ -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 {