0013186: B1024- RELATÓRIO CANCELAMENTO VENDA CARTAO
fixes bug#13186 dev:Emerson qua:Juliane git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@88652 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
ccaf94e407
commit
caea6999b5
|
@ -8,6 +8,7 @@ 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;
|
||||
|
@ -28,14 +29,12 @@ 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();
|
||||
|
@ -72,6 +71,9 @@ 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 */
|
||||
|
@ -101,7 +103,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 = :formaPagoCredito ")
|
||||
.append("AND BFP.FORMAPAGO_ID in ("+tiposFormapago+" ) ")
|
||||
.append("AND M.EMPRESA_ID = :empresaId ");
|
||||
|
||||
if (parametros.get("NUMPUNTOVENTA") != null) {
|
||||
|
@ -149,7 +151,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 = :formaPagoCredito ")
|
||||
.append("AND BFP.FORMAPAGO_ID in ("+tiposFormapago+" ) ")
|
||||
.append("AND M.EMPRESA_ID = :empresaId ");
|
||||
|
||||
if (parametros.get("NUMPUNTOVENTA") != null) {
|
||||
|
@ -197,7 +199,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 = :formaPagoCredito ")
|
||||
.append("AND BFP.FORMAPAGO_ID in ("+tiposFormapago+" ) ")
|
||||
.append("AND M.EMPRESA_ID = :empresaId ");
|
||||
|
||||
if (parametros.get("NUMPUNTOVENTA") != null) {
|
||||
|
|
Loading…
Reference in New Issue