leonardo 2016-05-18 18:44:45 +00:00
parent 4d159a3066
commit 494a1ca4e8
1 changed files with 9 additions and 4 deletions

View File

@ -201,7 +201,7 @@ public class Totalbus {
sb.append(" and e.empresa_id = " + empresaId); sb.append(" and e.empresa_id = " + empresaId);
} }
sb.append(" and cd.activo = 1 "); sb.append(" and cd.activo = 1 ");
sb.append(" and tee.indtipo = 1 "); sb.append(" and tee.indtipo = 1 ");
//sb.append(" and cd.usuario_id=7061 "); //sb.append(" and cd.usuario_id=7061 ");
sb.append(" group by "); sb.append(" group by ");
sb.append(" cd.feccorte, "); sb.append(" cd.feccorte, ");
@ -231,8 +231,13 @@ public class Totalbus {
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(6)); receita.setLocalArrecadação(rs.getInt(6));
receita.setValorLancamento(df.format(rs.getBigDecimal(4))); if (rs.getBigDecimal(4).signum() == -1){
receita.setIdentificadorReceitaDespesa("R"); receita.setIdentificadorReceitaDespesa("D");
receita.setValorLancamento(df.format(rs.getBigDecimal(4).multiply(new BigDecimal(-1))));
} else {
receita.setIdentificadorReceitaDespesa("R");
receita.setValorLancamento(df.format(rs.getBigDecimal(4)));
}
despesas.add(receita); despesas.add(receita);
} }
} catch (Exception e){ } catch (Exception e){
@ -263,7 +268,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(" left join ptovta_integra pi on e.empresa_id = pi.empresa_id and pi.puntoventa_id = pv.puntoventa_id ");
sb.append(" where "); sb.append(" where ");
sb.append(" cd.feccorte = ? "); sb.append(" cd.feccorte = ? ");
sb.append(" and tee.indtipo = 0 "); sb.append(" and tee.indtipo = 0 ");
if (puntoventaId != null && !puntoventaId.equals(-1)){ if (puntoventaId != null && !puntoventaId.equals(-1)){
sb.append(" and cd.puntoventa_id = " + puntoventaId); sb.append(" and cd.puntoventa_id = " + puntoventaId);
} }