fixes bug #9389
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@73675 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
fc1d85ab6d
commit
d1b8661272
|
@ -111,8 +111,15 @@ public class RelatorioFinanceiroSintetico extends Relatorio {
|
|||
fs.setDespesas(getBigDecimal(rset, "despesas"));
|
||||
fs.setPgOCD(getBigDecimal(rset, "receita_ocd_deb"));
|
||||
fs.setDifTarifaMenor(getBigDecimal(rset, "receita_dif_dif_tarifa_menor"));
|
||||
fs.setCartaoCredito(getBigDecimal(rset, "cartao_credito"));
|
||||
fs.setCartaoDebito(getBigDecimal(rset, "cartao_debito"));
|
||||
|
||||
BigDecimal cartaoCredito = getBigDecimal(rset, "cartao_credito");
|
||||
cartaoCredito = cartaoCredito.add(getBigDecimal(rset, "cartao_credito_ee"));
|
||||
fs.setCartaoCredito(cartaoCredito);
|
||||
|
||||
BigDecimal cartaoDebito = getBigDecimal(rset, "cartao_debito");
|
||||
cartaoDebito = cartaoDebito.add(getBigDecimal(rset, "cartao_debito_ee"));
|
||||
fs.setCartaoDebito(cartaoDebito);
|
||||
|
||||
fs.setBoletoBancario(getBigDecimal(rset, "boleto_bnc"));
|
||||
fs.setDeposito(getBigDecimal(rset, "deposito"));
|
||||
|
||||
|
@ -162,12 +169,12 @@ public class RelatorioFinanceiroSintetico extends Relatorio {
|
|||
sql.append(" cd.codigo, ");
|
||||
sql.append(" cd.puntoventaId, ");
|
||||
sql.append(" cd.empresaId, ");
|
||||
sql.append(" sum(case when (cd.indcancelacion = 0 and cd.indstatusboleto = 'V') then cd.pedagio else 0 end) as pedagio, ");
|
||||
sql.append(" sum(case when (cd.indcancelacion = 0 and cd.indstatusboleto = 'V') then cd.valorpago else 0 end) as receita_bpr, ");
|
||||
sql.append(" sum(case when (cd.indcancelacion = 1 and cd.motivocancelacion_id in (31,32)) then cd.valorpago else 0 end) as receita_devol_bpr, ");
|
||||
sql.append(" sum(case when (cd.indcancelacion = 0 and cd.numfoliosistema is null) then cd.valorpago else 0 end) as receita_gap, ");
|
||||
sql.append(" sum(case when (cd.indcancelacion = 1 and cd.motivocancelacion_id in (31,32) and cd.numfoliosistema is null) then cd.valorpago else 0 end) as receita_devol_gap, ");
|
||||
sql.append(" sum(case when (cd.indstatusboleto = 'E') then cd.valorpago else 0 end) as entrega_gap, ");
|
||||
sql.append(" sum(case when (cd.indcancelacion = 0 and cd.indstatusboleto <> 'E' and cd.numfoliosistema is not null and cd.tipoventa_id not in (5,12,18,49)) then cd.pedagio else 0 end) as pedagio, ");
|
||||
sql.append(" sum(case when (cd.indcancelacion = 0 and cd.indstatusboleto <> 'E' and cd.numfoliosistema is not null) then cd.valorpago else 0 end) as receita_bpr, ");
|
||||
sql.append(" sum(case when (cd.indcancelacion = 1 and cd.motivocancelacion_id in (31,32,10,37)) then cd.valorpago else 0 end) as receita_devol_bpr, ");
|
||||
sql.append(" sum(case when (cd.indcancelacion = 0 and cd.numfoliosistema is null and cd.tipoventa_id in (5,12,18,49)) then cd.valorpago else 0 end) as receita_gap, ");
|
||||
sql.append(" sum(case when (cd.indcancelacion = 1 and cd.motivocancelacion_id in (31,32,10,37) and cd.numfoliosistema is null and cd.tipoventa_id in (5,12,18,49)) then cd.valorpago else 0 end) as receita_devol_gap, ");
|
||||
sql.append(" sum(case when (cd.indcancelacion = 0 and cd.indstatusboleto = 'E' and cd.tipoventa_id in (5,12,18,49)) then cd.valorpago else 0 end) as entrega_gap, ");
|
||||
sql.append(" sum(case when (cd.indcancelacion = 0 and cd.indstatusboleto = 'V' and cd.formapago_id in (2,25)) then cd.valorpago else 0 end) as cartao_credito, ");
|
||||
sql.append(" sum(case when (cd.indcancelacion = 0 and cd.indstatusboleto = 'V' and cd.formapago_id in (3,26)) then cd.valorpago else 0 end) as cartao_debito, ");
|
||||
sql.append(" sum(case when (cd.indcancelacion = 1 and cd.motivocancelacion_id in (35)) then cd.valorpago else 0 end) as receita_ocd_deb, ");
|
||||
|
@ -219,9 +226,14 @@ public class RelatorioFinanceiroSintetico extends Relatorio {
|
|||
sql.append(" sum(case when tipoeventoextra_id in (103,99978,99999) and indtipo = 1 then impingreso else 0 end) as receita_dif_troca_ocd, ");
|
||||
sql.append(" sum(case when tipoeventoextra_id in (43) and indtipo = 1 then impingreso else 0 end) as receita_dif_dif_tarifa_maior, ");
|
||||
sql.append(" sum(case when tipoeventoextra_id in (44) and indtipo = 0 then impingreso else 0 end) as receita_dif_dif_tarifa_menor, ");
|
||||
sql.append(" sum(case when tipoeventoextra_id not in (44) and indtipo = 0 then impingreso else 0 end) as despesas ");
|
||||
sql.append(" sum(case when tipoeventoextra_id not in (44) and indtipo = 0 then impingreso else 0 end) as despesas, ");
|
||||
sql.append(" sum(case when (formapago_id in (2,25) and tipoeventoextra_id in (2,25,82,41,43,103,99978,99999) ");
|
||||
sql.append(" and indtipo = 1) then impingreso else 0 end) as cartao_credito_ee, ");
|
||||
sql.append(" sum(case when (formapago_id in (3,26) and tipoeventoextra_id in (2,25,82,41,43,103,99978,99999) ");
|
||||
sql.append(" and indtipo = 1) then impingreso else 0 end) as cartao_debito_ee ");
|
||||
sql.append(" from ( ");
|
||||
sql.append(" select ee.tipoeventoextra_id, ee.impingreso, tee.indtipo, pv.puntoventa_id as puntoventaId, eo.estado_id as estadoId, ee.empresa_id as empresaId ");
|
||||
sql.append(" select ee.tipoeventoextra_id, ee.impingreso, tee.indtipo, pv.puntoventa_id as puntoventaId, ");
|
||||
sql.append(" eo.estado_id as estadoId, ee.empresa_id as empresaId, ee.formapago_id ");
|
||||
sql.append(" from evento_extra ee ");
|
||||
sql.append(" join tipo_evento_extra tee on ee.tipoeventoextra_id = tee.tipoeventoextra_id ");
|
||||
sql.append(" join punto_venta pv on pv.puntoventa_id = ee.puntoventa_id ");
|
||||
|
|
Loading…
Reference in New Issue