diff --git a/src/com/rjconsultores/ventaboletos/service/impl/ConferenciaComissaoServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/ConferenciaComissaoServiceImpl.java index 9299f4e2a..e0113f55a 100644 --- a/src/com/rjconsultores/ventaboletos/service/impl/ConferenciaComissaoServiceImpl.java +++ b/src/com/rjconsultores/ventaboletos/service/impl/ConferenciaComissaoServiceImpl.java @@ -39,6 +39,7 @@ import com.rjconsultores.ventaboletos.service.EmpresaService; import com.rjconsultores.ventaboletos.service.PuntoVentaService; import com.rjconsultores.ventaboletos.utilerias.DateUtil; import com.rjconsultores.ventaboletos.utilerias.LocaleUtil; +import com.rjconsultores.ventaboletos.utilerias.MoneyHelper; import com.rjconsultores.ventaboletos.utilerias.SendMail; import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; import com.rjconsultores.ventaboletos.vo.comissao.BoletoComissao; @@ -392,8 +393,10 @@ public class ConferenciaComissaoServiceImpl implements ConferenciaComissaoServic continue; } + if ((lStatusBilhete == null || lStatusBilhete.contains(boletoComissao.getIndstatusboletoEnum())) && !boletoComissao.isVendaBilheteConfirmaAberto(boletoComissao.getTipoVenta())) { + //log.info(boletoComissao.toString()); total = total.add(boletoComissao.getTotal()); } } @@ -467,29 +470,34 @@ public class ConferenciaComissaoServiceImpl implements ConferenciaComissaoServic subtrairOcdFormapagoDinheiro(totalOcd, resumoComissao); - resumoComissao.setValorDeposito(carregarTotalFormapagoDinheiro(resumoComissao)); + resumoComissao.setValorDeposito(carregarTotalDeposito(resumoComissao)); resumoComissao.setQuantidadeEcf(puntoVentaDAO.quantidadeECFPorPuntoVenta(conferencia.getEmpresa().getEmpresaId(), conferencia.getPuntoVenta().getPuntoventaId())); return resumoComissao; } /** - * Retorna o valor total de forma pago do tipo DINHEIRO + * Retorna o valor total de deposito * @param resumoComissao * @return */ - private BigDecimal carregarTotalFormapagoDinheiro(ResumoComissao resumoComissao) { - for (FormapagoVO formapagoVO : resumoComissao.getTotalFormapago()) { - if(formapagoVO.getFormapagoId().equals(Constantes.FORMA_PAGO_DINHEIRO.intValue())) { - return formapagoVO.getImporte(); + private BigDecimal carregarTotalDeposito(ResumoComissao resumoComissao) { + List formaspagosDeposito = new ArrayList(Arrays.asList(Constantes.FORMA_PAGO_DINHEIRO.intValue(), + Constantes.FORMA_PAGO_TROCA_PASSAGEM.intValue())); + + BigDecimal total = BigDecimal.ZERO; + + for (FormapagoVO formapago : resumoComissao.getTotalFormapago()) { + if(formaspagosDeposito.contains(formapago.getFormapagoId())) { + total = MoneyHelper.somar(total, formapago.getImporte()); } } - return BigDecimal.ZERO; + return total; } /** - * Subtrai do total de forma pago o total pago das ocds. + * Subtrai do total de forma pago em dinheiro o valor total pago das ocds. * @param totalOcd * @param resumoComissao */ @@ -514,9 +522,9 @@ public class ConferenciaComissaoServiceImpl implements ConferenciaComissaoServic } /** - * Totaliza os valores conforme o forma pago, apenas do bilhetes que geraram registros em caixa - * (+) Abas: Bilhetes Manual, Bilhetes, Gap Venda - * (-) Abas: Bilhetes Cancelados, Bilhetes Devolvidos, Gap Cancelados, Gap Devolvidos + * Totaliza os valores conforme o forma pago, apenas do bilhetes que geraram registros em caixa
+ * (+) Abas: Bilhetes Manual, Bilhetes, Gap Venda
+ * (-) Abas: Bilhetes Cancelados, Bilhetes Devolvidos, Gap Cancelados, Gap Devolvidos
* @param resumoComissao * @param boletoComissaos * @param lsEventosFinanceiros diff --git a/src/com/rjconsultores/ventaboletos/vo/comissao/BoletoComissao.java b/src/com/rjconsultores/ventaboletos/vo/comissao/BoletoComissao.java index 07895e8db..386936f02 100644 --- a/src/com/rjconsultores/ventaboletos/vo/comissao/BoletoComissao.java +++ b/src/com/rjconsultores/ventaboletos/vo/comissao/BoletoComissao.java @@ -388,11 +388,15 @@ public class BoletoComissao { } public String getSituacaoBilhete() { + if("768596".equals(getNumFolioSistema())) { + System.out.println(""); + } + if (isOcd()) { return "OCD"; } - if(isMotivocancelacionAgrupamento() || isMotivocancelacionCheckin()) { + if(isMotivocancelacionAgrupamento()) { return getDescmotivocancelacion(); } @@ -420,6 +424,8 @@ public class BoletoComissao { return "B. DA TRANSFERENCIA"; } else if (isVendaBilheteConfirmaAberto(getTipoVenta())) { return "CONFIRMAÇÃO ABERTO"; + } else if (isVendaBilheteCheckin(getTipoVenta())) { + return "CHECKIN"; } } @@ -957,12 +963,20 @@ public class BoletoComissao { if(isStatusTroca() && isVendaBilheteTransferencia(getTipoVenta())) { return true; } + + if(isStatusTroca() && isVendaBilheteCheckin(getTipoVenta())) { + return true; + } + + if(isStatusTroca() && isVendaBilheteConfirmaAberto(getTipoVenta())) { + return true; + } if(isStatusEntregue()) { return true; } - if(isMotivocancelacionAgrupamento() || isMotivocancelacionCheckin()) { + if(isMotivocancelacionAgrupamento()) { return true; }