Alteração para permitir iteração diária
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/Integracion/IntegracaoReceitaDespesa/trunk/IntegracaoReceitaDespesa@50941 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
1a473b016a
commit
b2b9eca369
|
@ -33,10 +33,10 @@ public class Totalbus {
|
|||
loadPuntosVenta();
|
||||
}
|
||||
|
||||
public List<String> getDespesasReceitas(Integer puntoventaId, Integer empresaId){
|
||||
List<DespesaReceita> despesasReceitas = getDepositos(puntoventaId, empresaId);
|
||||
despesasReceitas.addAll(getDespesas(puntoventaId, empresaId));
|
||||
despesasReceitas.addAll(getReceitas(puntoventaId, empresaId));
|
||||
public List<String> getDespesasReceitas(Integer puntoventaId, Integer empresaId,Date fechaParam){
|
||||
List<DespesaReceita> despesasReceitas = getDepositos(puntoventaId, empresaId, fechaParam);
|
||||
despesasReceitas.addAll(getDespesas(puntoventaId, empresaId, fechaParam));
|
||||
despesasReceitas.addAll(getReceitas(puntoventaId, empresaId, fechaParam));
|
||||
List<String> rows = new ArrayList<String>();
|
||||
|
||||
for (DespesaReceita item : despesasReceitas){
|
||||
|
@ -91,7 +91,7 @@ public class Totalbus {
|
|||
return this.conn;
|
||||
}
|
||||
|
||||
public List<DespesaReceita> getReceitas(final Integer puntoVentaId, final Integer empresaId) {
|
||||
public List<DespesaReceita> getReceitas(final Integer puntoVentaId, final Integer empresaId, Date fechaParam) {
|
||||
List<DespesaReceita> despesas = new ArrayList<DespesaReceita>();
|
||||
StringBuffer sb = new StringBuffer();
|
||||
sb.append(" select ");
|
||||
|
@ -110,7 +110,7 @@ public class Totalbus {
|
|||
sb.append(" left join ptovta_integra pi on e.empresa_id = pi.empresa_id and pi.puntoventa_id = pv.puntoventa_id ");
|
||||
sb.append(" where ");
|
||||
sb.append(" cd.feccorte = ? ");
|
||||
if (puntoVentaId != null){
|
||||
if (puntoVentaId != null && !puntoVentaId.equals(-1)){
|
||||
sb.append(" and cd.puntoventa_id = " + puntoVentaId);
|
||||
}
|
||||
if (empresaId != null){
|
||||
|
@ -129,7 +129,10 @@ public class Totalbus {
|
|||
PreparedStatement stmt = null;
|
||||
ResultSet rs = null;
|
||||
|
||||
Date fecha = getData();
|
||||
Date fecha = fechaParam;
|
||||
if(fechaParam== null){
|
||||
fecha = getData();
|
||||
}
|
||||
|
||||
try{
|
||||
stmt = getConnection().prepareStatement(sb.toString());
|
||||
|
@ -156,7 +159,7 @@ public class Totalbus {
|
|||
return despesas;
|
||||
}
|
||||
|
||||
public List<DespesaReceita> getDespesas(Integer puntoventaId, Integer empresaId){
|
||||
public List<DespesaReceita> getDespesas(Integer puntoventaId, Integer empresaId, Date fechaParam){
|
||||
List<DespesaReceita> despesas = new ArrayList<DespesaReceita>();
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(" select ");
|
||||
|
@ -176,7 +179,7 @@ public class Totalbus {
|
|||
sb.append(" where ");
|
||||
sb.append(" cd.feccorte = ? ");
|
||||
sb.append(" and tee.indtipo = 0 ");
|
||||
if (puntoventaId != null){
|
||||
if (puntoventaId != null && !puntoventaId.equals(-1)){
|
||||
sb.append(" and cd.puntoventa_id = " + puntoventaId);
|
||||
}
|
||||
if (empresaId != null){
|
||||
|
@ -187,7 +190,10 @@ public class Totalbus {
|
|||
sb.append(" and not exists (select ee.EVENTOEXTRA_ID from evento_extra ee where ev.EVENTOEXTRA_ID = ee.EVENTOEXTRACANC_ID) ");
|
||||
sb.append(" and ev.EVENTOEXTRACANC_ID is null ");
|
||||
|
||||
Date fecha = getData();
|
||||
Date fecha = fechaParam;
|
||||
if(fechaParam== null){
|
||||
fecha = getData();
|
||||
}
|
||||
|
||||
PreparedStatement pstmt = null;
|
||||
ResultSet rs = null;
|
||||
|
@ -217,7 +223,7 @@ public class Totalbus {
|
|||
return despesas;
|
||||
}
|
||||
|
||||
public List<DespesaReceita> getDepositos(Integer puntoventaId, Integer empresaId){
|
||||
public List<DespesaReceita> getDepositos(Integer puntoventaId, Integer empresaId, Date fechaParam){
|
||||
List<DespesaReceita> depositos = new ArrayList<DespesaReceita>();
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("select i.instifinanceira_id, i.codigo, fdep.fechamentodeposito_id, fdep.valor, fdep.numdeposito, fdep.fecha_deposito ");
|
||||
|
@ -233,15 +239,16 @@ public class Totalbus {
|
|||
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("where fd.fechamentodeposito_id = :fechamentodepositoId and fd.activo <> 0 and fc.activo <> 0 ");
|
||||
|
||||
if (puntoventaId != null){
|
||||
if (puntoventaId != null && !puntoventaId.equals(-1)){
|
||||
strFechamentos.append(" and fc.puntoventa_id = " + puntoventaId);
|
||||
}
|
||||
if (empresaId != null){
|
||||
strFechamentos.append(" and fc.empresa_id = " + empresaId);
|
||||
}
|
||||
|
||||
|
||||
Date fecha = getData();
|
||||
Date fecha = fechaParam;
|
||||
if(fechaParam == null){
|
||||
fecha = getData();
|
||||
}
|
||||
|
||||
PreparedStatement pstmt = null;
|
||||
ResultSet rs = null;
|
||||
|
@ -330,6 +337,7 @@ public class Totalbus {
|
|||
|
||||
private Date getData(){
|
||||
Calendar cal = Calendar.getInstance();
|
||||
cal.set(2015, 10, 13);
|
||||
cal.setTime(new Date());
|
||||
cal.add(Calendar.DAY_OF_MONTH, DAYS_AGO);
|
||||
return cal.getTime();
|
||||
|
|
Loading…
Reference in New Issue