bug#13186
dev:lucas qua: git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@89380 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
fbf5362355
commit
63493d03a2
|
@ -8,7 +8,6 @@ import java.util.HashMap;
|
|||
import java.util.Map;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.Constante;
|
||||
import com.rjconsultores.ventaboletos.enums.TipoFormapago;
|
||||
import com.rjconsultores.ventaboletos.relatorios.utilitarios.ArrayDataSource;
|
||||
import com.rjconsultores.ventaboletos.relatorios.utilitarios.Relatorio;
|
||||
import com.rjconsultores.ventaboletos.service.ConstanteService;
|
||||
|
@ -29,12 +28,14 @@ public class RelatorioCancelamentoVendaCartao extends Relatorio {
|
|||
public void initDados() throws Exception {
|
||||
Connection conexao = this.relatorio.getConexao();
|
||||
Map<String, Object> parametros = this.relatorio.getParametros();
|
||||
final Integer CARTAO_CREDITO = 2;
|
||||
String sql = getSql();
|
||||
|
||||
NamedParameterStatement stmt = new NamedParameterStatement(conexao, sql);
|
||||
|
||||
stmt.setTimestamp("data_inicial", new Timestamp(DateUtil.inicioFecha((Date) parametros.get("DATA_INICIAL")).getTime()));
|
||||
stmt.setTimestamp("data_final", new Timestamp(DateUtil.fimFecha((Date) parametros.get("DATA_FINAL")).getTime()));
|
||||
stmt.setInt("formaPagoCredito", CARTAO_CREDITO);
|
||||
stmt.setInt("empresaId", Integer.valueOf(parametros.get("EMPRESA_ID") + ""));
|
||||
|
||||
ResultSet rset = stmt.executeQuery();
|
||||
|
@ -71,9 +72,6 @@ public class RelatorioCancelamentoVendaCartao extends Relatorio {
|
|||
}
|
||||
|
||||
private String getSql() {
|
||||
final int FORMA_PAGO_CREDITO = 2;
|
||||
final int FORMA_PAGO_DEBITO = 3;
|
||||
String tiposFormapago = String.format("%d, %d", FORMA_PAGO_CREDITO, FORMA_PAGO_DEBITO);
|
||||
StringBuilder sql = new StringBuilder();
|
||||
|
||||
/* Boletos apenas com venda e cancelamento direto com corrida */
|
||||
|
@ -103,7 +101,7 @@ public class RelatorioCancelamentoVendaCartao extends Relatorio {
|
|||
.append("INNER JOIN PUNTO_VENTA PO ON PO.PUNTOVENTA_ID = O.PUNTOVENTA_ID ")
|
||||
.append("WHERE O.FECINC BETWEEN :data_inicial AND :data_final ")
|
||||
.append("AND O.NSU is not null ")
|
||||
.append("AND BFP.FORMAPAGO_ID in ("+tiposFormapago+" ) ")
|
||||
.append("AND BFP.FORMAPAGO_ID = :formaPagoCredito ")
|
||||
.append("AND M.EMPRESA_ID = :empresaId ");
|
||||
|
||||
if (parametros.get("NUMPUNTOVENTA") != null) {
|
||||
|
@ -151,7 +149,7 @@ public class RelatorioCancelamentoVendaCartao extends Relatorio {
|
|||
.append("INNER JOIN PUNTO_VENTA PO ON PO.PUNTOVENTA_ID = O.PUNTOVENTA_ID ")
|
||||
.append("WHERE O.FECINC BETWEEN :data_inicial AND :data_final ")
|
||||
.append("AND O.NSU is not null ")
|
||||
.append("AND BFP.FORMAPAGO_ID in ("+tiposFormapago+" ) ")
|
||||
.append("AND BFP.FORMAPAGO_ID = :formaPagoCredito ")
|
||||
.append("AND M.EMPRESA_ID = :empresaId ");
|
||||
|
||||
if (parametros.get("NUMPUNTOVENTA") != null) {
|
||||
|
@ -199,7 +197,7 @@ public class RelatorioCancelamentoVendaCartao extends Relatorio {
|
|||
.append("INNER JOIN PUNTO_VENTA PO ON PO.PUNTOVENTA_ID = O.PUNTOVENTA_ID ")
|
||||
.append("WHERE O.FECINC BETWEEN :data_inicial AND :data_final ")
|
||||
.append("AND O.NSU is not null ")
|
||||
.append("AND BFP.FORMAPAGO_ID in ("+tiposFormapago+" ) ")
|
||||
.append("AND BFP.FORMAPAGO_ID = :formaPagoCredito ")
|
||||
.append("AND M.EMPRESA_ID = :empresaId ");
|
||||
|
||||
if (parametros.get("NUMPUNTOVENTA") != null) {
|
||||
|
|
Loading…
Reference in New Issue