lucas.calixto 2017-04-11 20:18:56 +00:00
parent bcf1408b7a
commit 30394fccc8
1 changed files with 6 additions and 5 deletions

View File

@ -163,10 +163,10 @@ public class RelatorioVendasComissao extends Relatorio {
RelatorioVendasComissaoCancelamentoBean relatorioVendaComissao = new RelatorioVendasComissaoCancelamentoBean(); RelatorioVendasComissaoCancelamentoBean relatorioVendaComissao = new RelatorioVendasComissaoCancelamentoBean();
relatorioVendaComissao.setNumFolioSistema(rset.getString("NUMFOLIOSISTEMA")); relatorioVendaComissao.setNumFolioSistema(rset.getString("NUMFOLIOSISTEMA"));
relatorioVendaComissao.setCorridaId(rset.getInt("CORRIDA_ID")); relatorioVendaComissao.setCorridaId(rset.getInt("CORRIDA_ID"));
relatorioVendaComissao.setFecHorViaje(rset.getDate("FECHORVIAJE")); relatorioVendaComissao.setFecHorViaje(rset.getTimestamp("FECHORVIAJE"));
relatorioVendaComissao.setNumAsiento(rset.getString("NUMASIENTO")); relatorioVendaComissao.setNumAsiento(rset.getString("NUMASIENTO"));
relatorioVendaComissao.setPrecioTotalPagado(rset.getBigDecimal("TOTAL")); relatorioVendaComissao.setPrecioTotalPagado(rset.getBigDecimal("TOTAL"));
relatorioVendaComissao.setFecHorVenta(rset.getDate("FECHORVENTA")); relatorioVendaComissao.setFecHorVenta(rset.getTimestamp("FECHORVENTA"));
relatorioVendaComissao.setNombPuntoVenta(rset.getString("NOMBPUNTOVENTA")); relatorioVendaComissao.setNombPuntoVenta(rset.getString("NOMBPUNTOVENTA"));
lsDadosRelatorioCancelamento.add(relatorioVendaComissao); lsDadosRelatorioCancelamento.add(relatorioVendaComissao);
} }
@ -259,11 +259,12 @@ public class RelatorioVendasComissao extends Relatorio {
StringBuilder sQuery = new StringBuilder(); StringBuilder sQuery = new StringBuilder();
sQuery.append("SELECT C.NUMFOLIOSISTEMA, C.CORRIDA_ID, C.FECHORVIAJE, C.NUMASIENTO, C.PRECIOPAGADO, C.FECHORVENTA, PV.NOMBPUNTOVENTA, ") sQuery.append("SELECT C.NUMFOLIOSISTEMA, C.CORRIDA_ID, C.FECHORVIAJE, C.NUMASIENTO, C.PRECIOPAGADO, C.FECHORVENTA, COALESCE(PV2.NOMBPUNTOVENTA, PV1.NOMBPUNTOVENTA) NOMBPUNTOVENTA, ")
.append("(COALESCE (C.PRECIOPAGADO,0) + COALESCE (C.IMPORTETAXAEMBARQUE,0) + COALESCE (C.IMPORTESEGURO,0) + COALESCE (C.IMPORTEPEDAGIO,0) + COALESCE (C.IMPORTEOUTROS,0)) AS TOTAL ") .append("(COALESCE (C.PRECIOPAGADO,0) + COALESCE (C.IMPORTETAXAEMBARQUE,0) + COALESCE (C.IMPORTESEGURO,0) + COALESCE (C.IMPORTEPEDAGIO,0) + COALESCE (C.IMPORTEOUTROS,0)) AS TOTAL ")
.append("FROM CAJA C ") .append("FROM CAJA C ")
.append("JOIN MARCA M ON M.MARCA_ID = C.MARCA_ID ") .append("LEFT JOIN MARCA M ON M.MARCA_ID = C.MARCA_ID ")
.append("JOIN PUNTO_VENTA PV ON PV.PUNTOVENTA_ID = C.PTOVTAVENTA_ID ") .append("LEFT JOIN PUNTO_VENTA PV1 ON PV1.PUNTOVENTA_ID = C.PUNTOVENTA_ID ")
.append("LEFT JOIN PUNTO_VENTA PV2 ON PV2.PUNTOVENTA_ID = C.PTOVTAVENTA_ID ")
.append("WHERE C.INDSTATUSBOLETO = 'C' ") .append("WHERE C.INDSTATUSBOLETO = 'C' ")
.append("AND ((C.MOTIVOCANCELACION_ID IN(32, 10) AND C.INDREIMPRESION = 0) ") .append("AND ((C.MOTIVOCANCELACION_ID IN(32, 10) AND C.INDREIMPRESION = 0) ")
.append("OR (C.MOTIVOCANCELACION_ID = 99 AND C.INDREIMPRESION = 1)) "); .append("OR (C.MOTIVOCANCELACION_ID = 99 AND C.INDREIMPRESION = 1)) ");