fixes bug#8669
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@65853 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
996b640187
commit
f46c9cd38c
|
@ -596,11 +596,68 @@ public class ConferenciaController extends MyGenericForwardComposer {
|
|||
carregarOcds();
|
||||
carregarLogsConferencia();
|
||||
carregarResumo(boletosComissaos);
|
||||
|
||||
|
||||
this.ajustarPendentes(boletosComissaos);
|
||||
|
||||
} catch (BusinessException e) {
|
||||
log.error(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Metodo criado com o objetivo de adicionar os bilhetes não classificados previamente.
|
||||
*
|
||||
* Ou seja, casos ainda existam bilhetes após a classificação, os mesmos serão separadas em cancelados e vendidos
|
||||
*
|
||||
* @param boletosComissaos
|
||||
* @throws BusinessException
|
||||
*/
|
||||
private void ajustarPendentes(List<BoletoComissao> boletosComissaos) throws BusinessException {
|
||||
|
||||
boletosComissaos.removeAll(this.lsBilhetes);
|
||||
boletosComissaos.removeAll(this.lsBilhetesCancelados);
|
||||
boletosComissaos.removeAll(this.lsBilhetesDevolvidos);
|
||||
boletosComissaos.removeAll(this.lsBilhetesGap);
|
||||
boletosComissaos.removeAll(this.lsBilhetesGapCancelados);
|
||||
boletosComissaos.removeAll(this.lsBilhetesGapDevolvidos);
|
||||
boletosComissaos.removeAll(this.lsBilhetesManual);
|
||||
|
||||
boolean vendidosAtualizado = false;
|
||||
boolean canceladoAtualizado = false;
|
||||
boolean devolvidoAtualizado = false;
|
||||
|
||||
for (BoletoComissao b: boletosComissaos){
|
||||
if (b.getIndCancelacion()){
|
||||
if (b.isMotivocancelacionDevolvido()){
|
||||
this.lsBilhetesDevolvidos.add(b);
|
||||
devolvidoAtualizado = true;
|
||||
}else{
|
||||
this.lsBilhetesCancelados.add(b);
|
||||
canceladoAtualizado = true;
|
||||
}
|
||||
}else{
|
||||
this.lsBilhetes.add(b);
|
||||
vendidosAtualizado = true;
|
||||
}
|
||||
}
|
||||
//recarrega as informações
|
||||
if (vendidosAtualizado){
|
||||
this.carregarBilhetesVendidos();
|
||||
}
|
||||
|
||||
//recarrega as informações
|
||||
if (canceladoAtualizado){
|
||||
this.carregarBilhetesCancelados();
|
||||
}
|
||||
|
||||
//recarrega as informações
|
||||
if (devolvidoAtualizado){
|
||||
this.carregarBilhetesDevolvidos();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void carregarResumo(List<BoletoComissao> boletosComissaos) throws BusinessException {
|
||||
resumo = conferenciaComissaoService.gerarResumo(conferencia, boletosComissaos, lsEventosFinanceiros, totalBilhetesManual, totalBilhetesVendidos, totalBilhetesCancelados, totalBilhetesDevolvidos, totalBilhetesGap, totalBilhetesGapCancelados, totalBilhetesGapDevolvidos, totalCreditosEventoFinanceiros, totalDebitosEventoFinanceiros, ocdTotal);
|
||||
formapagosList.setData(resumo.getTotalFormapago());
|
||||
|
@ -617,7 +674,11 @@ public class ConferenciaController extends MyGenericForwardComposer {
|
|||
}
|
||||
|
||||
private void carregarBilhetesVendidos(List<BoletoComissao> boletosComissaos) throws BusinessException {
|
||||
|
||||
if (boletosComissaos != null){
|
||||
lsBilhetes = conferenciaComissaoService.carregarBilhetesComissao(boletosComissaos, conferencia, BoletoStatusComissao.BOLETOS_VENDIDOS);
|
||||
}
|
||||
|
||||
totalBilhetesVendidos = conferenciaComissaoService.totalizarBoletoComissao(lsBilhetes, IndStatusBoleto.V, IndStatusBoleto.T);
|
||||
txtTotalBilhetes.setValue(BigDecimalUtil.getBigDecimalToStringDouble2CasasDecimaisFormatado(totalBilhetesVendidos, LocaleUtil.getLocale()));
|
||||
txtQtdeTotalBilhetes.setValue(String.valueOf(lsBilhetes.size()));
|
||||
|
@ -626,8 +687,18 @@ public class ConferenciaController extends MyGenericForwardComposer {
|
|||
verificarBilhetesSemConferencia(lsBilhetes, tabBilhetesVenda);
|
||||
}
|
||||
|
||||
private void carregarBilhetesVendidos() throws BusinessException {
|
||||
this.carregarBilhetesVendidos(null);
|
||||
}
|
||||
|
||||
private void carregarBilhetesCancelados() throws BusinessException {
|
||||
this.carregarBilhetesCancelados(null);
|
||||
}
|
||||
private void carregarBilhetesCancelados(List<BoletoComissao> boletosComissaos) throws BusinessException {
|
||||
if (boletosComissaos != null){
|
||||
lsBilhetesCancelados = conferenciaComissaoService.carregarBilhetesComissao(boletosComissaos, conferencia, BoletoStatusComissao.BOLETO_CANCELADO);
|
||||
}
|
||||
|
||||
totalBilhetesCancelados = conferenciaComissaoService.totalizarBoletoComissao(lsBilhetesCancelados);
|
||||
txtTotalBilhetesCancelados.setValue(BigDecimalUtil.getBigDecimalToStringDouble2CasasDecimaisFormatado(totalBilhetesCancelados, LocaleUtil.getLocale()));
|
||||
txtQtdeTotalBilhetesCancelados.setValue(String.valueOf(lsBilhetesCancelados.size()));
|
||||
|
@ -636,9 +707,16 @@ public class ConferenciaController extends MyGenericForwardComposer {
|
|||
verificarBilhetesSemConferencia(lsBilhetesCancelados, tabBilhetesCancelados);
|
||||
}
|
||||
|
||||
private void carregarBilhetesDevolvidos() throws BusinessException {
|
||||
this.carregarBilhetesDevolvidos(null);
|
||||
}
|
||||
private void carregarBilhetesDevolvidos(List<BoletoComissao> boletosComissaos) throws BusinessException {
|
||||
totalBilhetesDevolvidos = BigDecimal.ZERO;
|
||||
|
||||
if (boletosComissaos != null){
|
||||
lsBilhetesDevolvidos = conferenciaComissaoService.carregarBilhetesComissao(boletosComissaos, conferencia, BoletoStatusComissao.BOLETO_DEVOLVIDO);
|
||||
}
|
||||
|
||||
Map<BoletoStatusComissao, BigDecimal> totais = conferenciaComissaoService.totalizarBoletoComissaoDevolvidosTrocaOcd(lsBilhetesDevolvidos);
|
||||
|
||||
totalBilhetesDevolvidos = totais.get(BoletoStatusComissao.BOLETO_DEVOLVIDO);
|
||||
|
|
Loading…
Reference in New Issue