diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioBilhetesVendidosNovoLayout.java b/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioBilhetesVendidosNovoLayout.java index 463f187c5..f97853674 100644 --- a/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioBilhetesVendidosNovoLayout.java +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioBilhetesVendidosNovoLayout.java @@ -61,7 +61,7 @@ public class RelatorioBilhetesVendidosNovoLayout extends Relatorio { sql.append(" (select distinct est.icms,"); sql.append(" est.cveestado as cveestado,"); sql.append(" ei.porcredbaseicms,"); - sql.append(" to_char(c.fechorventa, 'dd/mm/yyyy hh24:mi') as datavenda,"); + sql.append(" c.fechorventa as datavenda,"); sql.append(" c.indstatusboleto statuspassagem,"); sql.append(" ae.decespecie as especie,"); sql.append(" (select min(numfoliosistema) as maximo"); @@ -106,8 +106,8 @@ public class RelatorioBilhetesVendidosNovoLayout extends Relatorio { sql.append(" and c.INDSTATUSBOLETO = 'V' AND c.MOTIVOCANCELACION_ID IS NULL "); } } - sql.append(" ORDER BY cveestado, datavenda) "); - sql.append("t "); + sql.append(") t "); + sql.append("order by t.cveestado, t.datavenda "); NamedParameterStatement stmt = new NamedParameterStatement(conexao, sql.toString()); @@ -140,7 +140,7 @@ public class RelatorioBilhetesVendidosNovoLayout extends Relatorio { dataResult.put("statuspassagem", IndStatusBoleto.valueOf(rset.getString("statuspassagem")).getValue()); } - bean.setDataVenda(rset.getString("datavenda") == null ? "" : rset.getString("datavenda")); + bean.setDataVenda(rset.getDate("datavenda") == null ? "" : DateUtil.getStringDate(rset.getDate("datavenda"), "dd/MM/yy HH:mm")); bean.setFormInicial((String) (rset.getObject("formInicial") == null ? "" : rset.getObject("formInicial"))); bean.setFormFinal((String) (rset.getObject("formfinal") == null ? "" : rset.getObject("formfinal"))); bean.setSerie((String) (rset.getObject("serie") == null ? "" : rset.getObject("serie")));