Correção de informações em relatório BGM
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/Integracion/IntegracaoReceitaDespesa/trunk/IntegracaoReceitaDespesa@51184 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
c21852234f
commit
95612e0dbb
|
@ -99,7 +99,8 @@ public class Totalbus {
|
||||||
sb.append(" e.empresa_id AS empresa, ");
|
sb.append(" e.empresa_id AS empresa, ");
|
||||||
sb.append(" pv.puntoventa_id AS puntoventaId, ");
|
sb.append(" pv.puntoventa_id AS puntoventaId, ");
|
||||||
sb.append(" sum(cdp.importe) AS valor, ");
|
sb.append(" sum(cdp.importe) AS valor, ");
|
||||||
sb.append(" tee.contacontabil AS contacontabil ");
|
sb.append(" tee.contacontabil AS contacontabil, ");
|
||||||
|
sb.append(" pv.numpuntoventa AS numpuntoventa ");
|
||||||
sb.append(" from ");
|
sb.append(" from ");
|
||||||
sb.append(" caja_diversos cd ");
|
sb.append(" caja_diversos cd ");
|
||||||
sb.append(" left join evento_extra ev on ev.eventoextra_id = cd.eventoextra_id ");
|
sb.append(" left join evento_extra ev on ev.eventoextra_id = cd.eventoextra_id ");
|
||||||
|
@ -123,7 +124,8 @@ public class Totalbus {
|
||||||
sb.append(" cd.feccorte, ");
|
sb.append(" cd.feccorte, ");
|
||||||
sb.append(" e.empresa_id, ");
|
sb.append(" e.empresa_id, ");
|
||||||
sb.append(" pv.puntoventa_id, ");
|
sb.append(" pv.puntoventa_id, ");
|
||||||
sb.append(" tee.contacontabil ");
|
sb.append(" tee.contacontabil, ");
|
||||||
|
sb.append(" pv.numpuntoventa ");
|
||||||
|
|
||||||
|
|
||||||
PreparedStatement stmt = null;
|
PreparedStatement stmt = null;
|
||||||
|
@ -145,7 +147,7 @@ public class Totalbus {
|
||||||
receita.setCodigoReceitaDespesa(rs.getInt(5));
|
receita.setCodigoReceitaDespesa(rs.getInt(5));
|
||||||
receita.setDataLancamento(rs.getDate(1));
|
receita.setDataLancamento(rs.getDate(1));
|
||||||
receita.setDataMovimento(rs.getDate(1));
|
receita.setDataMovimento(rs.getDate(1));
|
||||||
receita.setLocalArrecadação(rs.getInt(3));
|
receita.setLocalArrecadação(rs.getInt(6));
|
||||||
receita.setValorLançamento(rs.getBigDecimal(4).toString());
|
receita.setValorLançamento(rs.getBigDecimal(4).toString());
|
||||||
receita.setIdentificadorReceitaDespesa("R");
|
receita.setIdentificadorReceitaDespesa("R");
|
||||||
despesas.add(receita);
|
despesas.add(receita);
|
||||||
|
@ -165,7 +167,7 @@ public class Totalbus {
|
||||||
sb.append(" select ");
|
sb.append(" select ");
|
||||||
sb.append(" cd.feccorte as feccorte, ");
|
sb.append(" cd.feccorte as feccorte, ");
|
||||||
sb.append(" e.empresa_id as empresa_id, ");
|
sb.append(" e.empresa_id as empresa_id, ");
|
||||||
sb.append(" pv.puntoventa_id as puntoventa_id, ");
|
sb.append(" pv.numpuntoventa as numpuntoventa, ");
|
||||||
sb.append(" cdp.importe as valor, ");
|
sb.append(" cdp.importe as valor, ");
|
||||||
sb.append(" tee.contacontabil as contacontabil ");
|
sb.append(" tee.contacontabil as contacontabil ");
|
||||||
sb.append(" from ");
|
sb.append(" from ");
|
||||||
|
@ -226,17 +228,19 @@ 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();
|
StringBuilder sb = new StringBuilder();
|
||||||
sb.append("select i.instifinanceira_id, i.codigo, fdep.fechamentodeposito_id, fdep.valor, fdep.numdeposito, fdep.fecha_deposito ");
|
sb.append("select fdep.fechamentodeposito_id, fdep.valor, fdep.numdeposito, fdep.fecha_deposito ");
|
||||||
sb.append("from fechamento_deposito fdep ");
|
sb.append("from fechamento_deposito fdep ");
|
||||||
sb.append("inner join insti_financeira i on i.instifinanceira_id = fdep.instifinanceira_id ");
|
//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 fecha_deposito = :fecha and fdep.activo = 1 ");
|
||||||
|
|
||||||
|
|
||||||
StringBuilder strFechamentos = new StringBuilder();
|
StringBuilder strFechamentos = new StringBuilder();
|
||||||
strFechamentos.append("Select fc.fecfechamento, fc.empresa_id, fc.puntoventa_id, fd.valor_pago, ec.numagencia, ec.numconta ");
|
strFechamentos.append("Select fc.fecfechamento, fc.empresa_id, pv.numpuntoventa, fd.valor_pago, ec.numagencia, ec.numconta, if.CODIGO ");
|
||||||
strFechamentos.append("from fechamento_cct_deposito fd ");
|
strFechamentos.append("from fechamento_cct_deposito fd ");
|
||||||
strFechamentos.append("inner join fechamento_cntcorrente fc on fc.fechamentocntcorrente_id = fd.fechamentocntcorrente_id ");
|
strFechamentos.append("inner join fechamento_cntcorrente fc on fc.fechamentocntcorrente_id = fd.fechamentocntcorrente_id ");
|
||||||
strFechamentos.append("left join empresa_contabancaria ec on ec.empresa_id = fc.empresa_id and ec.instifinanceira_id = :instifinanceiraId and ec.activo = 1 ");
|
strFechamentos.append("inner join PUNTO_VENTA pv on FC.PUNTOVENTA_ID = PV.PUNTOVENTA_ID ");
|
||||||
|
strFechamentos.append("left join empresa_contabancaria ec on ec.empresa_id = fc.empresa_id and ec.activo = 1 ");
|
||||||
|
strFechamentos.append("left join INSTI_FINANCEIRA if on EC.INSTIFINANCEIRA_ID = if.INSTIFINANCEIRA_ID and if.ACTIVO = 1 ");
|
||||||
strFechamentos.append("where fd.fechamentodeposito_id = :fechamentodepositoId and fd.activo <> 0 and fc.activo <> 0 ");
|
strFechamentos.append("where fd.fechamentodeposito_id = :fechamentodepositoId and fd.activo <> 0 and fc.activo <> 0 ");
|
||||||
|
|
||||||
if (puntoventaId != null && !puntoventaId.equals(-1)){
|
if (puntoventaId != null && !puntoventaId.equals(-1)){
|
||||||
|
@ -266,17 +270,16 @@ public class Totalbus {
|
||||||
|
|
||||||
while (rs.next()){
|
while (rs.next()){
|
||||||
pstmtFechamentos.setInt(1, rs.getInt(1));
|
pstmtFechamentos.setInt(1, rs.getInt(1));
|
||||||
pstmtFechamentos.setInt(2, rs.getInt(3));
|
|
||||||
|
|
||||||
ResultSet rsFechamentos = pstmtFechamentos.executeQuery();
|
ResultSet rsFechamentos = pstmtFechamentos.executeQuery();
|
||||||
|
|
||||||
Integer empId = null;
|
Integer empId = null;
|
||||||
Integer pvId = null;
|
Integer pvId = null;
|
||||||
String banco = "Bco: " + DespesaReceita.lpad(rs.getString(2), "0", 3) ;
|
String banco = "" ;
|
||||||
String agencia = "";
|
String agencia = "";
|
||||||
String contaCorrente = "";
|
String contaCorrente = "";
|
||||||
String numDep = " Dep: " + rs.getString(5);
|
String numDep = " Dep: " + rs.getString(3);
|
||||||
String valor = " R$ " + df.format(rs.getBigDecimal(4));
|
String valor = " R$ " + df.format(rs.getBigDecimal(2));
|
||||||
String ref = " Ref: ";
|
String ref = " Ref: ";
|
||||||
|
|
||||||
Boolean podeAdicionar = false;
|
Boolean podeAdicionar = false;
|
||||||
|
@ -284,6 +287,7 @@ public class Totalbus {
|
||||||
while (rsFechamentos.next()){
|
while (rsFechamentos.next()){
|
||||||
podeAdicionar = true;
|
podeAdicionar = true;
|
||||||
if (empId == null ){ empId = rsFechamentos.getInt(2); }
|
if (empId == null ){ empId = rsFechamentos.getInt(2); }
|
||||||
|
if (banco.isEmpty()){banco = "Bco: " + DespesaReceita.lpad(rsFechamentos.getString(7), "0", 3);}
|
||||||
if (pvId == null){ pvId = rsFechamentos.getInt(3); }
|
if (pvId == null){ pvId = rsFechamentos.getInt(3); }
|
||||||
if (agencia.isEmpty()){ agencia = " Ag: " + rsFechamentos.getString(5); }
|
if (agencia.isEmpty()){ agencia = " Ag: " + rsFechamentos.getString(5); }
|
||||||
if (contaCorrente.isEmpty()){ contaCorrente = " C/C: " + rsFechamentos.getString(6); }
|
if (contaCorrente.isEmpty()){ contaCorrente = " C/C: " + rsFechamentos.getString(6); }
|
||||||
|
@ -294,10 +298,10 @@ public class Totalbus {
|
||||||
if (podeAdicionar){ // se não tiver dados da subquery não é um depósito válido.
|
if (podeAdicionar){ // se não tiver dados da subquery não é um depósito válido.
|
||||||
DespesaReceita deposito = new DespesaReceita();
|
DespesaReceita deposito = new DespesaReceita();
|
||||||
deposito.setCodigoEmpresa(empId);
|
deposito.setCodigoEmpresa(empId);
|
||||||
deposito.setDataLancamento(rs.getDate(6));
|
deposito.setDataLancamento(rs.getDate(4));
|
||||||
deposito.setDataMovimento(rs.getDate(6));
|
deposito.setDataMovimento(rs.getDate(4));
|
||||||
deposito.setLocalArrecadação(pvId);
|
deposito.setLocalArrecadação(pvId);
|
||||||
deposito.setValorLançamento(rs.getBigDecimal(4).toString());
|
deposito.setValorLançamento(rs.getBigDecimal(2).toString());
|
||||||
deposito.setIdentificadorReceitaDespesa("R");
|
deposito.setIdentificadorReceitaDespesa("R");
|
||||||
deposito.setCodigoReceitaDespesa(codigoReceitaDespesaGlobus);
|
deposito.setCodigoReceitaDespesa(codigoReceitaDespesaGlobus);
|
||||||
deposito.setDescricaoDetalhada(banco + agencia + contaCorrente + numDep + valor + ref);
|
deposito.setDescricaoDetalhada(banco + agencia + contaCorrente + numDep + valor + ref);
|
||||||
|
|
|
@ -4,8 +4,6 @@ import java.text.SimpleDateFormat;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.rjconsultores.integracaoreceitadespesa.dao.Totalbus;
|
|
||||||
|
|
||||||
public class DespesaReceita {
|
public class DespesaReceita {
|
||||||
private String dataLancamento; // DD/MM/YYYY
|
private String dataLancamento; // DD/MM/YYYY
|
||||||
private String codigoEmpresa; // 011 003 Numérico
|
private String codigoEmpresa; // 011 003 Numérico
|
||||||
|
|
Loading…
Reference in New Issue