fixes bug#15270
dev: qua: git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@96868 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
84c373f122
commit
73bb12c023
|
@ -40,7 +40,6 @@ public class RelatorioDepositos extends Relatorio {
|
||||||
Integer puntoventaId = parametros.get("puntoventaId") != null ? Integer.parseInt(parametros.get("puntoventaId").toString()) : null;
|
Integer puntoventaId = parametros.get("puntoventaId") != null ? Integer.parseInt(parametros.get("puntoventaId").toString()) : null;
|
||||||
Integer empresaId = parametros.get("empresaId") != null ? Integer.parseInt(parametros.get("empresaId").toString()) : null;
|
Integer empresaId = parametros.get("empresaId") != null ? Integer.parseInt(parametros.get("empresaId").toString()) : null;
|
||||||
Boolean filtrarPendentes = parametros.get("filtrarPendentes") != null ? Boolean.parseBoolean(parametros.get("filtrarPendentes").toString()) : false;
|
Boolean filtrarPendentes = parametros.get("filtrarPendentes") != null ? Boolean.parseBoolean(parametros.get("filtrarPendentes").toString()) : false;
|
||||||
Boolean isClassificaPorBanco = parametros.get("isClassificaPorBanco") != null ? Boolean.parseBoolean(parametros.get("isClassificaPorBanco").toString()) : false;
|
|
||||||
String fecInicio = parametros.get("fecInicio").toString() + " 00:00:00";
|
String fecInicio = parametros.get("fecInicio").toString() + " 00:00:00";
|
||||||
String fecFinal = parametros.get("fecFinal").toString() + " 23:59:59";
|
String fecFinal = parametros.get("fecFinal").toString() + " 23:59:59";
|
||||||
|
|
||||||
|
@ -61,19 +60,14 @@ public class RelatorioDepositos extends Relatorio {
|
||||||
while (rs.next()) {
|
while (rs.next()) {
|
||||||
|
|
||||||
RelatorioDepositoBean deposito = new RelatorioDepositoBean();
|
RelatorioDepositoBean deposito = new RelatorioDepositoBean();
|
||||||
deposito.setNombempresa(rs.getString(1));
|
deposito.setNombempresa(rs.getString("nombempresa"));
|
||||||
deposito.setNombpuntoventa(rs.getString(2));
|
deposito.setNombpuntoventa(rs.getString("nombpuntoventa"));
|
||||||
deposito.setNumpuntoventa(rs.getString(3));
|
deposito.setNumpuntoventa(rs.getString("numpuntoventa"));
|
||||||
deposito.setDtmotivo(rs.getDate(4));
|
deposito.setDtmotivo(rs.getDate("dtmotivo"));
|
||||||
deposito.setSaldo(rs.getBigDecimal(5).multiply(BigDecimal.valueOf(-1)));
|
deposito.setSaldo(rs.getBigDecimal("saldo").multiply(BigDecimal.valueOf(-1)));
|
||||||
deposito.setVrdeposito(rs.getBigDecimal(6));
|
deposito.setVrdeposito(rs.getBigDecimal("vrfechamento"));
|
||||||
deposito.setVrfechamento(rs.getBigDecimal(7));
|
deposito.setVrfechamento(rs.getBigDecimal("vrdeposito"));
|
||||||
deposito.setNumdeposito(rs.getString(8));
|
deposito.setNumdeposito(rs.getString("numdeposito"));
|
||||||
// Se checkbox não estiver marcado não preenche este campo e relatório não irá agrupar por nome banco
|
|
||||||
if (isClassificaPorBanco) {
|
|
||||||
deposito.setCodigoInstFinanceira(rs.getString(9));
|
|
||||||
deposito.setNomeInstFinanceira(rs.getString(10));
|
|
||||||
}
|
|
||||||
lsDadosRelatorio.add(deposito);
|
lsDadosRelatorio.add(deposito);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -109,14 +103,12 @@ public class RelatorioDepositos extends Relatorio {
|
||||||
sql.append(" tmp.dtmotivo, ");
|
sql.append(" tmp.dtmotivo, ");
|
||||||
sql.append(" tmp.saldo, ");
|
sql.append(" tmp.saldo, ");
|
||||||
sql.append(" tmp.vrfechamento, ");
|
sql.append(" tmp.vrfechamento, ");
|
||||||
sql.append(" tmp.vrdeposito, ");
|
|
||||||
|
|
||||||
if (! filtrarPendentes){
|
if (! filtrarPendentes){
|
||||||
sql.append(" tmp.numdeposito, ");
|
sql.append(" tmp.numdeposito, ");
|
||||||
}
|
}
|
||||||
|
|
||||||
sql.append(" tmp.codinstfin, ");
|
sql.append(" tmp.vrdeposito ");
|
||||||
sql.append(" tmp.nomeinstfin ");
|
|
||||||
sql.append(" FROM ");
|
sql.append(" FROM ");
|
||||||
sql.append(" ( SELECT DISTINCT e.nombempresa, ");
|
sql.append(" ( SELECT DISTINCT e.nombempresa, ");
|
||||||
sql.append(" p.nombpuntoventa, ");
|
sql.append(" p.nombpuntoventa, ");
|
||||||
|
@ -125,14 +117,12 @@ public class RelatorioDepositos extends Relatorio {
|
||||||
sql.append(" ( SUM(NVL(fd.valor_pago,0)) - f.total ) AS saldo, ");
|
sql.append(" ( SUM(NVL(fd.valor_pago,0)) - f.total ) AS saldo, ");
|
||||||
sql.append(" SUM(NVL(fd.valor_pago,0)) AS vrfechamento , ");
|
sql.append(" SUM(NVL(fd.valor_pago,0)) AS vrfechamento , ");
|
||||||
sql.append(" f.total AS vrdeposito, ");
|
sql.append(" f.total AS vrdeposito, ");
|
||||||
sql.append(" f.FECHAMENTOCNTCORRENTE_ID, ");
|
|
||||||
|
|
||||||
if (! filtrarPendentes){
|
if (! filtrarPendentes){
|
||||||
sql.append(" fdp.NUMDEPOSITO as numdeposito, ");
|
sql.append(" fdp.NUMDEPOSITO as numdeposito, ");
|
||||||
}
|
}
|
||||||
|
|
||||||
sql.append(" ifin.CODIGO as codinstfin, ");
|
sql.append(" f.FECHAMENTOCNTCORRENTE_ID ");
|
||||||
sql.append(" ifin.NOME as nomeinstfin ");
|
|
||||||
sql.append(" FROM fechamento_cntcorrente f ");
|
sql.append(" FROM fechamento_cntcorrente f ");
|
||||||
sql.append(" LEFT JOIN punto_venta p ");
|
sql.append(" LEFT JOIN punto_venta p ");
|
||||||
sql.append(" ON p.puntoventa_id = f.puntoventa_id ");
|
sql.append(" ON p.puntoventa_id = f.puntoventa_id ");
|
||||||
|
@ -147,9 +137,6 @@ public class RelatorioDepositos extends Relatorio {
|
||||||
sql.append(" LEFT JOIN empresa_contabancaria ecb ");
|
sql.append(" LEFT JOIN empresa_contabancaria ecb ");
|
||||||
sql.append(" ON ecb.EMPRESACONTABANCARIA_ID = fdp.EMPRESACONTABANCARIA_ID ");
|
sql.append(" ON ecb.EMPRESACONTABANCARIA_ID = fdp.EMPRESACONTABANCARIA_ID ");
|
||||||
sql.append(" AND ecb.activo = 1 ");
|
sql.append(" AND ecb.activo = 1 ");
|
||||||
sql.append(" LEFT JOIN INSTI_FINANCEIRA ifin ");
|
|
||||||
sql.append(" ON ifin.INSTIFINANCEIRA_ID = ecb.INSTIFINANCEIRA_ID ");
|
|
||||||
sql.append(" AND ifin.activo = 1 ");
|
|
||||||
sql.append(" WHERE f.fecfechamento BETWEEN ? AND ? ");
|
sql.append(" WHERE f.fecfechamento BETWEEN ? AND ? ");
|
||||||
sql.append(" AND f.activo = 1 ");
|
sql.append(" AND f.activo = 1 ");
|
||||||
sql.append(" AND e.activo = 1 ");
|
sql.append(" AND e.activo = 1 ");
|
||||||
|
@ -166,21 +153,18 @@ public class RelatorioDepositos extends Relatorio {
|
||||||
sql.append(" p.numpuntoventa, ");
|
sql.append(" p.numpuntoventa, ");
|
||||||
sql.append(" f.fecfechamento, ");
|
sql.append(" f.fecfechamento, ");
|
||||||
sql.append(" f.FECHAMENTOCNTCORRENTE_ID, ");
|
sql.append(" f.FECHAMENTOCNTCORRENTE_ID, ");
|
||||||
sql.append(" f.total, ");
|
|
||||||
|
|
||||||
if (!filtrarPendentes){
|
if (!filtrarPendentes){
|
||||||
sql.append(" fdp.NUMDEPOSITO, ");
|
sql.append(" fdp.NUMDEPOSITO, ");
|
||||||
}
|
}
|
||||||
|
|
||||||
sql.append(" ifin.CODIGO, ");
|
sql.append(" f.total ) tmp ");
|
||||||
sql.append(" ifin.NOME ) tmp ");
|
|
||||||
|
|
||||||
if (filtrarPendentes){
|
if (filtrarPendentes){
|
||||||
sql.append(" where ");
|
sql.append(" where ");
|
||||||
sql.append(" tmp.saldo < tmp.vrdeposito and tmp.saldo <> 0");
|
sql.append(" tmp.saldo < tmp.vrdeposito and tmp.saldo <> 0");
|
||||||
}
|
}
|
||||||
sql.append(" ORDER BY tmp.nombempresa, ");
|
sql.append(" ORDER BY tmp.nombempresa, ");
|
||||||
sql.append(" tmp.nomeinstfin, ");
|
|
||||||
sql.append(" tmp.nombpuntoventa, ");
|
sql.append(" tmp.nombpuntoventa, ");
|
||||||
sql.append(" tmp.dtmotivo, ");
|
sql.append(" tmp.dtmotivo, ");
|
||||||
sql.append(" tmp.vrdeposito ");
|
sql.append(" tmp.vrdeposito ");
|
||||||
|
|
Loading…
Reference in New Issue