diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioBilhetesVendidos.java b/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioBilhetesVendidos.java index 7b73e5664..9c048cd8f 100644 --- a/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioBilhetesVendidos.java +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioBilhetesVendidos.java @@ -79,7 +79,13 @@ public class RelatorioBilhetesVendidos extends Relatorio { sql.append(" and pv.PUNTOVENTA_ID IN (" + parametros.get("NUMPUNTOVENTA").toString() + ")"); } if (parametros.get("STATUS") != null) { - sql.append(" and b.INDSTATUSBOLETO in (" + parametros.get("STATUS") + ") "); + if (parametros.get("STATUS").toString().contains("V") && parametros.get("STATUS").toString().contains("C")) { + sql.append(" AND ((b.INDSTATUSBOLETO = 'C' AND B.INDCANCELACION = 1) OR (b.INDSTATUSBOLETO = 'V' AND B.INDCANCELACION = 0)) "); + } else if (parametros.get("STATUS").toString().contains("C")) { + sql.append(" AND b.INDSTATUSBOLETO = 'C' AND B.INDCANCELACION = 1 "); + } else if (parametros.get("STATUS").toString().contains("V")) { + sql.append(" AND b.INDSTATUSBOLETO = 'V' AND B.INDCANCELACION = 0 "); + } } sql.append(" and B.BOLETOORIGINAL_ID is null "); sql.append(" order by u.CVEUSUARIO, ");