julio 2017-11-30 20:33:35 +00:00
parent 73bb5dd638
commit db959c22a9
1 changed files with 2 additions and 2 deletions

View File

@ -180,8 +180,8 @@ public class RelatorioFinanceiroSintetico extends Relatorio {
sql.append(" sum(case when (cd.indreimpresion = 0 and cd.indstatusboleto = 'V' and cd.tipoventa_id in (5,12,18,49)) then cd.valorpago else 0 end) as receita_gap, "); sql.append(" sum(case when (cd.indreimpresion = 0 and cd.indstatusboleto = 'V' and cd.tipoventa_id in (5,12,18,49)) then cd.valorpago else 0 end) as receita_gap, ");
sql.append(" sum(case when (cd.indstatusboleto in ('C', 'T') and cd.motivocancelacion_id in (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.indstatusboleto in ('C', 'T') and cd.motivocancelacion_id in (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.indstatusboleto = 'E') then cd.valorpago else 0 end) as entrega_gap, "); sql.append(" sum(case when (cd.indstatusboleto = 'E') then cd.valorpago else 0 end) as entrega_gap, ");
sql.append(" sum(case when (cd.motivocancelacion_id is null and cd.indreimpresion = 0 and cd.indstatusoperacion = 'F' and cd.formapago_id in (2,25)) then cd.valorpago else 0 end) as cartao_credito, "); sql.append(" sum(case when (cd.indreimpresion = 0 and cd.indstatusoperacion = 'F' and cd.motivocancelacion_id is null and cd.formapago_id in (2,25)) then cd.valorpago else 0 end) as cartao_credito, ");
sql.append(" sum(case when (cd.motivocancelacion_id is null and cd.indreimpresion = 0 and cd.indstatusoperacion = 'F' and cd.formapago_id in (3,26)) then cd.valorpago else 0 end) as cartao_debito, "); sql.append(" sum(case when (cd.indreimpresion = 0 and cd.indstatusoperacion = 'F' and cd.motivocancelacion_id is null and cd.formapago_id in (3,26)) then cd.valorpago else 0 end) as cartao_debito, ");
sql.append(" sum(case when (cd.indstatusboleto = 'C' and cd.motivocancelacion_id in (35)) then cd.valorpago else 0 end) as receita_ocd_deb, "); sql.append(" sum(case when (cd.indstatusboleto = 'C' and cd.motivocancelacion_id in (35)) then cd.valorpago else 0 end) as receita_ocd_deb, ");
sql.append(" sum(case when (cd.indstatusboleto = 'C' and cd.motivocancelacion_id in (99) ) then cd.valorpago else 0 end) as receita_ocd_cred "); sql.append(" sum(case when (cd.indstatusboleto = 'C' and cd.motivocancelacion_id in (99) ) then cd.valorpago else 0 end) as receita_ocd_cred ");
sql.append("from ( "); sql.append("from ( ");