From 494a1ca4e8d3e6c26c970f48a9142cd473f1501b Mon Sep 17 00:00:00 2001 From: leonardo Date: Wed, 18 May 2016 18:44:45 +0000 Subject: [PATCH] fixes bug #7493 git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/Integracion/IntegracaoReceitaDespesa/trunk/IntegracaoReceitaDespesa@56128 d1611594-4594-4d17-8e1d-87c2c4800839 --- .../integracaoreceitadespesa/dao/Totalbus.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/com/rjconsultores/integracaoreceitadespesa/dao/Totalbus.java b/src/com/rjconsultores/integracaoreceitadespesa/dao/Totalbus.java index 47f048d1d..e2c82b697 100644 --- a/src/com/rjconsultores/integracaoreceitadespesa/dao/Totalbus.java +++ b/src/com/rjconsultores/integracaoreceitadespesa/dao/Totalbus.java @@ -201,7 +201,7 @@ public class Totalbus { sb.append(" and e.empresa_id = " + empresaId); } 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(" group by "); sb.append(" cd.feccorte, "); @@ -231,8 +231,13 @@ public class Totalbus { receita.setDataLancamento(rs.getDate(1)); receita.setDataMovimento(rs.getDate(1)); receita.setLocalArrecadação(rs.getInt(6)); - receita.setValorLancamento(df.format(rs.getBigDecimal(4))); - receita.setIdentificadorReceitaDespesa("R"); + if (rs.getBigDecimal(4).signum() == -1){ + 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); } } 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(" where "); sb.append(" cd.feccorte = ? "); - sb.append(" and tee.indtipo = 0 "); + sb.append(" and tee.indtipo = 0 "); if (puntoventaId != null && !puntoventaId.equals(-1)){ sb.append(" and cd.puntoventa_id = " + puntoventaId); }