fixes bug #7288
fixes bug #7287 git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/Integracion/IntegracaoReceitaDespesa/trunk/IntegracaoReceitaDespesa@54283 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
106596f4bf
commit
370b1e3f10
|
@ -306,11 +306,6 @@ public class Totalbus {
|
||||||
|
|
||||||
public List<DespesaReceita> getDepositos(Integer puntoventaId, Integer empresaId, Date fechaParam){
|
public List<DespesaReceita> getDepositos(Integer puntoventaId, Integer empresaId, Date fechaParam){
|
||||||
List<DespesaReceita> depositos = new ArrayList<DespesaReceita>();
|
List<DespesaReceita> depositos = new ArrayList<DespesaReceita>();
|
||||||
// StringBuilder sb = new StringBuilder();
|
|
||||||
// sb.append("select fdep.fechamentodeposito_id, fdep.valor, fdep.numdeposito, fdep.FECCREACION, fdep.fecha_deposito ");
|
|
||||||
// sb.append("from fechamento_deposito fdep ");
|
|
||||||
// sb.append("where trunc(FECCREACION) = :fecha and fdep.activo = 1 ");
|
|
||||||
|
|
||||||
|
|
||||||
StringBuilder strFechamentos = new StringBuilder();
|
StringBuilder strFechamentos = new StringBuilder();
|
||||||
strFechamentos.append("Select sum(fdep.valor), fdep.numdeposito, fdep.fecha_deposito, fc.empresa_id, pv.numpuntoventa, ec.numagencia, ec.numconta, if.CODIGO, ec.numintegracion, fdep.feccreacion ");
|
strFechamentos.append("Select sum(fdep.valor), fdep.numdeposito, fdep.fecha_deposito, fc.empresa_id, pv.numpuntoventa, ec.numagencia, ec.numconta, if.CODIGO, ec.numintegracion, fdep.feccreacion ");
|
||||||
|
@ -337,60 +332,45 @@ public class Totalbus {
|
||||||
if(fechaParam == null){
|
if(fechaParam == null){
|
||||||
fecha = getData();
|
fecha = getData();
|
||||||
}
|
}
|
||||||
|
|
||||||
//PreparedStatement pstmt = null;
|
|
||||||
//ResultSet rs = null;
|
|
||||||
|
|
||||||
|
PreparedStatement pstmtFechamentos = null;
|
||||||
// pstmt = getConnection().prepareStatement(sb.toString());
|
ResultSet rsFechamentos = null;
|
||||||
// pstmt.setDate(1, new java.sql.Date(fecha.getTime()));
|
BigDecimal soma = BigDecimal.ZERO;
|
||||||
//
|
try{
|
||||||
// rs = pstmt.executeQuery();
|
pstmtFechamentos = getConnection().prepareStatement(strFechamentos.toString());
|
||||||
Integer codigoReceitaDespesaGlobus = getCodigoReceitaDespesaGlobus();
|
pstmtFechamentos.setDate(1, new java.sql.Date(fecha.getTime()));
|
||||||
|
|
||||||
SimpleDateFormat sdf = new SimpleDateFormat("MM/yy");
|
rsFechamentos = pstmtFechamentos.executeQuery();
|
||||||
|
|
||||||
PreparedStatement pstmtFechamentos = null;
|
while (rsFechamentos.next()){
|
||||||
ResultSet rsFechamentos = null;
|
Integer empId = null;
|
||||||
BigDecimal soma = BigDecimal.ZERO;
|
Integer pvId = null;
|
||||||
try{
|
String banco = "" ;
|
||||||
// while (rs.next()){
|
String agencia = "";
|
||||||
pstmtFechamentos = getConnection().prepareStatement(strFechamentos.toString());
|
String contaCorrente = "";
|
||||||
pstmtFechamentos.setDate(1, new java.sql.Date(fecha.getTime()));
|
String numDep = " Dep: " + rsFechamentos.getString(2);
|
||||||
|
Integer codRecDesp = null;
|
||||||
rsFechamentos = pstmtFechamentos.executeQuery();
|
|
||||||
|
|
||||||
while (rsFechamentos.next()){
|
|
||||||
Integer empId = null;
|
|
||||||
Integer pvId = null;
|
|
||||||
String banco = "" ;
|
|
||||||
String agencia = "";
|
|
||||||
String contaCorrente = "";
|
|
||||||
String numDep = " Dep: " + rsFechamentos.getString(2);
|
|
||||||
String valor = " R$ " + df.format(rsFechamentos.getBigDecimal(1));
|
|
||||||
String ref = " Ref: ";
|
|
||||||
Integer codRecDesp = null;
|
|
||||||
|
|
||||||
if (empId == null ){ empId = rsFechamentos.getInt(4); }
|
if (empId == null ){ empId = rsFechamentos.getInt(4); }
|
||||||
if (banco.isEmpty()){banco = "Bco: " + DespesaReceita.lpad(rsFechamentos.getString(8), "0", 3);}
|
if (banco.isEmpty()){banco = "Bco: " + DespesaReceita.lpad(rsFechamentos.getString(8), "0", 3);}
|
||||||
if (pvId == null){ pvId = rsFechamentos.getInt(5); }
|
if (pvId == null){ pvId = rsFechamentos.getInt(5); }
|
||||||
if (agencia.isEmpty()){ agencia = " Ag: " + rsFechamentos.getString(6); }
|
if (agencia.isEmpty()){ agencia = " Ag: " + rsFechamentos.getString(6); }
|
||||||
if (contaCorrente.isEmpty()){ contaCorrente = " C/C: " + rsFechamentos.getString(7); }
|
if (contaCorrente.isEmpty()){ contaCorrente = " C/C: " + rsFechamentos.getString(7); }
|
||||||
//ref += ref.length() <= 6 ? sdf.format(rsFechamentos.getDate(3)) : ", " + sdf.format(rsFechamentos.getDate(3));
|
//ref += ref.length() <= 6 ? sdf.format(rsFechamentos.getDate(3)) : ", " + sdf.format(rsFechamentos.getDate(3));
|
||||||
if (codRecDesp == null){ codRecDesp = rsFechamentos.getInt(9); }
|
if (codRecDesp == null){ codRecDesp = rsFechamentos.getInt(9); }
|
||||||
|
|
||||||
DespesaReceita deposito = new DespesaReceita();
|
DespesaReceita deposito = new DespesaReceita();
|
||||||
deposito.setCodigoEmpresa(empId);
|
deposito.setCodigoEmpresa(empId);
|
||||||
deposito.setDataLancamento(rsFechamentos.getDate(10));
|
deposito.setDataLancamento(rsFechamentos.getDate(10));
|
||||||
deposito.setDataMovimento(rsFechamentos.getDate(3));
|
deposito.setDataMovimento(rsFechamentos.getDate(3));
|
||||||
deposito.setLocalArrecadação(pvId);
|
deposito.setLocalArrecadação(pvId);
|
||||||
deposito.setValorLancamento(df.format(rsFechamentos.getBigDecimal(1)));
|
deposito.setValorLancamento(df.format(rsFechamentos.getBigDecimal(1)));
|
||||||
deposito.setIdentificadorReceitaDespesa("D");
|
deposito.setIdentificadorReceitaDespesa("D");
|
||||||
deposito.setCodigoReceitaDespesa(codRecDesp);
|
deposito.setCodigoReceitaDespesa(codRecDesp);
|
||||||
deposito.setDescricaoDetalhada(banco + agencia + contaCorrente + numDep);
|
deposito.setDescricaoDetalhada(banco + agencia + contaCorrente + numDep);
|
||||||
depositos.add(deposito);
|
depositos.add(deposito);
|
||||||
soma = soma.add(rsFechamentos.getBigDecimal(1));
|
soma = soma.add(rsFechamentos.getBigDecimal(1));
|
||||||
}
|
}
|
||||||
log.debug("Total depósitos: " + soma);
|
log.debug("Total depósitos: " + soma);
|
||||||
} catch (Exception e){
|
} catch (Exception e){
|
||||||
log.error(e.getMessage(), e);
|
log.error(e.getMessage(), e);
|
||||||
|
|
Loading…
Reference in New Issue