bug #8373
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@63971 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
cc3a1c3ee0
commit
ad72795c15
|
@ -25,6 +25,7 @@ import org.zkoss.zul.Comboitem;
|
|||
import org.zkoss.zul.Listcell;
|
||||
import org.zkoss.zul.Listitem;
|
||||
import org.zkoss.zul.Radio;
|
||||
import org.zkoss.zul.Tab;
|
||||
|
||||
import com.rjconsultores.ventaboletos.constantes.Constantes;
|
||||
import com.rjconsultores.ventaboletos.entidad.Conferencia;
|
||||
|
@ -182,6 +183,16 @@ public class ConferenciaController extends MyGenericForwardComposer {
|
|||
private MyComboboxEstandar cmbConferenciaPendencia;
|
||||
private List<ConferenciaPendencia> lsConferenciaPendencia;
|
||||
|
||||
private Tab tabBilhetesManual;
|
||||
private Tab tabBilhetesVenda;
|
||||
private Tab tabBilhetesCancelados;
|
||||
private Tab tabBilhetesDevolvidos;
|
||||
private Tab tabGapVenda;
|
||||
private Tab tabGapCancelado;
|
||||
private Tab tabGapDevolvido;
|
||||
private Tab tabEventosFinanceiros;
|
||||
private Tab tabOcd;
|
||||
|
||||
@Override
|
||||
public void doAfterCompose(Component comp) throws Exception {
|
||||
lsTipoInformativo = tipoInformativoComissaoService.obtenerTodos();
|
||||
|
@ -206,6 +217,7 @@ public class ConferenciaController extends MyGenericForwardComposer {
|
|||
|
||||
ocdsList.setItemRenderer(new RenderOcd() {
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public void render(Listitem lstm, Object o) throws Exception {
|
||||
super.render(lstm, o);
|
||||
final OcdVO ocd = (OcdVO) o;
|
||||
|
@ -234,12 +246,13 @@ public class ConferenciaController extends MyGenericForwardComposer {
|
|||
@Override
|
||||
public void onEvent(Event event) throws Exception {
|
||||
OcdVO ocd = (OcdVO) ocdsList.getSelected();
|
||||
lancarLogConferenciaOcd(ocd, ocdsList);
|
||||
lancarLogConferenciaOcd(ocd, ocdsList, tabOcd);
|
||||
}
|
||||
});
|
||||
|
||||
eventosFinanceirosList.setItemRenderer(new RenderEventosFinanceiros() {
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public void render(Listitem lstm, Object o) throws Exception {
|
||||
super.render(lstm, o);
|
||||
final EventosFinanceirosVO eventoFinanceiro = (EventosFinanceirosVO) o;
|
||||
|
@ -316,6 +329,7 @@ public class ConferenciaController extends MyGenericForwardComposer {
|
|||
private void ajustarListsBilhetes() {
|
||||
bilhetesManualList.setItemRenderer(new RenderBoletoComissao() {
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public void render(Listitem lstm, Object o) throws Exception {
|
||||
super.render(lstm, o);
|
||||
final BoletoComissao boletoComissao = (BoletoComissao) o;
|
||||
|
@ -330,9 +344,9 @@ public class ConferenciaController extends MyGenericForwardComposer {
|
|||
public void onEvent(Event event) throws Exception {
|
||||
CheckEvent checkEvent = (CheckEvent) event;
|
||||
if (checkEvent.isChecked() && boletoComissao.getLogconferenciaId() == null) {
|
||||
gravarLogConferenciaBilhete(bilhetesManualList, boletoComissao);
|
||||
gravarLogConferenciaBilhete(bilhetesManualList, boletoComissao, tabBilhetesManual, "conferenciaController.tab.bilhetesManual");
|
||||
} else if (!checkEvent.isChecked() && boletoComissao.getLogconferenciaId() != null) {
|
||||
removerLogConferenciaBilhete(bilhetesManualList, boletoComissao);
|
||||
removerLogConferenciaBilhete(bilhetesManualList, boletoComissao, tabBilhetesManual, "conferenciaController.tab.bilhetesManual");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -344,12 +358,13 @@ public class ConferenciaController extends MyGenericForwardComposer {
|
|||
@Override
|
||||
public void onEvent(Event event) throws Exception {
|
||||
BoletoComissao boletoComissao = (BoletoComissao) bilhetesManualList.getSelected();
|
||||
lancarLogConferenciaBilhete(boletoComissao, bilhetesManualList);
|
||||
lancarLogConferenciaBilhete(boletoComissao, bilhetesManualList, tabBilhetesManual);
|
||||
}
|
||||
});
|
||||
|
||||
bilhetesList.setItemRenderer(new RenderBoletoComissao() {
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public void render(Listitem lstm, Object o) throws Exception {
|
||||
super.render(lstm, o);
|
||||
final BoletoComissao boletoComissao = (BoletoComissao) o;
|
||||
|
@ -364,9 +379,9 @@ public class ConferenciaController extends MyGenericForwardComposer {
|
|||
public void onEvent(Event event) throws Exception {
|
||||
CheckEvent checkEvent = (CheckEvent) event;
|
||||
if (checkEvent.isChecked() && boletoComissao.getLogconferenciaId() == null) {
|
||||
gravarLogConferenciaBilhete(bilhetesList, boletoComissao);
|
||||
gravarLogConferenciaBilhete(bilhetesList, boletoComissao, tabBilhetesVenda, "conferenciaController.tab.bilhetes");
|
||||
} else if (!checkEvent.isChecked() && boletoComissao.getLogconferenciaId() != null) {
|
||||
removerLogConferenciaBilhete(bilhetesList, boletoComissao);
|
||||
removerLogConferenciaBilhete(bilhetesList, boletoComissao, tabBilhetesVenda, "conferenciaController.tab.bilhetes");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -378,12 +393,13 @@ public class ConferenciaController extends MyGenericForwardComposer {
|
|||
@Override
|
||||
public void onEvent(Event event) throws Exception {
|
||||
BoletoComissao boletoComissao = (BoletoComissao) bilhetesList.getSelected();
|
||||
lancarLogConferenciaBilhete(boletoComissao, bilhetesList);
|
||||
lancarLogConferenciaBilhete(boletoComissao, bilhetesList, tabBilhetesVenda);
|
||||
}
|
||||
});
|
||||
|
||||
bilhetesCanceladosList.setItemRenderer(new RenderBoletoComissao() {
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public void render(Listitem lstm, Object o) throws Exception {
|
||||
super.render(lstm, o);
|
||||
final BoletoComissao boletoComissao = (BoletoComissao) o;
|
||||
|
@ -398,9 +414,9 @@ public class ConferenciaController extends MyGenericForwardComposer {
|
|||
public void onEvent(Event event) throws Exception {
|
||||
CheckEvent checkEvent = (CheckEvent) event;
|
||||
if (checkEvent.isChecked() && boletoComissao.getLogconferenciaId() == null) {
|
||||
gravarLogConferenciaBilhete(bilhetesCanceladosList, boletoComissao);
|
||||
gravarLogConferenciaBilhete(bilhetesCanceladosList, boletoComissao, tabBilhetesCancelados, "conferenciaController.tab.bilhetesCancelados");
|
||||
} else if (!checkEvent.isChecked() && boletoComissao.getLogconferenciaId() != null) {
|
||||
removerLogConferenciaBilhete(bilhetesCanceladosList, boletoComissao);
|
||||
removerLogConferenciaBilhete(bilhetesCanceladosList, boletoComissao, tabBilhetesCancelados, "conferenciaController.tab.bilhetesCancelados");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -412,12 +428,13 @@ public class ConferenciaController extends MyGenericForwardComposer {
|
|||
@Override
|
||||
public void onEvent(Event event) throws Exception {
|
||||
BoletoComissao boletoComissao = (BoletoComissao) bilhetesCanceladosList.getSelected();
|
||||
lancarLogConferenciaBilhete(boletoComissao, bilhetesCanceladosList);
|
||||
lancarLogConferenciaBilhete(boletoComissao, bilhetesCanceladosList, tabBilhetesCancelados);
|
||||
}
|
||||
});
|
||||
|
||||
bilhetesDevolvidosList.setItemRenderer(new RenderBoletoComissao() {
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public void render(Listitem lstm, Object o) throws Exception {
|
||||
super.render(lstm, o);
|
||||
final BoletoComissao boletoComissao = (BoletoComissao) o;
|
||||
|
@ -432,9 +449,9 @@ public class ConferenciaController extends MyGenericForwardComposer {
|
|||
public void onEvent(Event event) throws Exception {
|
||||
CheckEvent checkEvent = (CheckEvent) event;
|
||||
if (checkEvent.isChecked() && boletoComissao.getLogconferenciaId() == null) {
|
||||
gravarLogConferenciaBilhete(bilhetesDevolvidosList, boletoComissao);
|
||||
gravarLogConferenciaBilhete(bilhetesDevolvidosList, boletoComissao, tabBilhetesDevolvidos, "conferenciaController.tab.bilhetesDevolvidos");
|
||||
} else if (!checkEvent.isChecked() && boletoComissao.getLogconferenciaId() != null) {
|
||||
removerLogConferenciaBilhete(bilhetesDevolvidosList, boletoComissao);
|
||||
removerLogConferenciaBilhete(bilhetesDevolvidosList, boletoComissao, tabBilhetesDevolvidos, "conferenciaController.tab.bilhetesDevolvidos");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -446,12 +463,13 @@ public class ConferenciaController extends MyGenericForwardComposer {
|
|||
@Override
|
||||
public void onEvent(Event event) throws Exception {
|
||||
BoletoComissao boletoComissao = (BoletoComissao) bilhetesDevolvidosList.getSelected();
|
||||
lancarLogConferenciaBilhete(boletoComissao, bilhetesDevolvidosList);
|
||||
lancarLogConferenciaBilhete(boletoComissao, bilhetesDevolvidosList, tabBilhetesDevolvidos);
|
||||
}
|
||||
});
|
||||
|
||||
bilhetesGapList.setItemRenderer(new RenderBoletoComissao() {
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public void render(Listitem lstm, Object o) throws Exception {
|
||||
super.render(lstm, o);
|
||||
final BoletoComissao boletoComissao = (BoletoComissao) o;
|
||||
|
@ -466,9 +484,9 @@ public class ConferenciaController extends MyGenericForwardComposer {
|
|||
public void onEvent(Event event) throws Exception {
|
||||
CheckEvent checkEvent = (CheckEvent) event;
|
||||
if (checkEvent.isChecked() && boletoComissao.getLogconferenciaId() == null) {
|
||||
gravarLogConferenciaBilhete(bilhetesGapList, boletoComissao);
|
||||
gravarLogConferenciaBilhete(bilhetesGapList, boletoComissao, tabGapVenda, "conferenciaController.tab.gabVenda");
|
||||
} else if (!checkEvent.isChecked() && boletoComissao.getLogconferenciaId() != null) {
|
||||
removerLogConferenciaBilhete(bilhetesGapList, boletoComissao);
|
||||
removerLogConferenciaBilhete(bilhetesGapList, boletoComissao, tabGapVenda, "conferenciaController.tab.gabVenda");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -480,12 +498,13 @@ public class ConferenciaController extends MyGenericForwardComposer {
|
|||
@Override
|
||||
public void onEvent(Event event) throws Exception {
|
||||
BoletoComissao boletoComissao = (BoletoComissao) bilhetesGapList.getSelected();
|
||||
lancarLogConferenciaBilhete(boletoComissao, bilhetesGapList);
|
||||
lancarLogConferenciaBilhete(boletoComissao, bilhetesGapList, tabGapVenda);
|
||||
}
|
||||
});
|
||||
|
||||
bilhetesGapCanceladosList.setItemRenderer(new RenderBoletoComissao() {
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public void render(Listitem lstm, Object o) throws Exception {
|
||||
super.render(lstm, o);
|
||||
final BoletoComissao boletoComissao = (BoletoComissao) o;
|
||||
|
@ -500,9 +519,9 @@ public class ConferenciaController extends MyGenericForwardComposer {
|
|||
public void onEvent(Event event) throws Exception {
|
||||
CheckEvent checkEvent = (CheckEvent) event;
|
||||
if (checkEvent.isChecked() && boletoComissao.getLogconferenciaId() == null) {
|
||||
gravarLogConferenciaBilhete(bilhetesGapCanceladosList, boletoComissao);
|
||||
gravarLogConferenciaBilhete(bilhetesGapCanceladosList, boletoComissao, tabGapCancelado, "conferenciaController.tab.gabCancelado");
|
||||
} else if (!checkEvent.isChecked() && boletoComissao.getLogconferenciaId() != null) {
|
||||
removerLogConferenciaBilhete(bilhetesGapCanceladosList, boletoComissao);
|
||||
removerLogConferenciaBilhete(bilhetesGapCanceladosList, boletoComissao, tabGapCancelado, "conferenciaController.tab.gabCancelado");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -514,12 +533,13 @@ public class ConferenciaController extends MyGenericForwardComposer {
|
|||
@Override
|
||||
public void onEvent(Event event) throws Exception {
|
||||
BoletoComissao boletoComissao = (BoletoComissao) bilhetesGapCanceladosList.getSelected();
|
||||
lancarLogConferenciaBilhete(boletoComissao, bilhetesCanceladosList);
|
||||
lancarLogConferenciaBilhete(boletoComissao, bilhetesCanceladosList, tabGapCancelado);
|
||||
}
|
||||
});
|
||||
|
||||
bilhetesGapDevolvidosList.setItemRenderer(new RenderBoletoComissao() {
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public void render(Listitem lstm, Object o) throws Exception {
|
||||
super.render(lstm, o);
|
||||
final BoletoComissao boletoComissao = (BoletoComissao) o;
|
||||
|
@ -534,9 +554,9 @@ public class ConferenciaController extends MyGenericForwardComposer {
|
|||
public void onEvent(Event event) throws Exception {
|
||||
CheckEvent checkEvent = (CheckEvent) event;
|
||||
if (checkEvent.isChecked() && boletoComissao.getLogconferenciaId() == null) {
|
||||
gravarLogConferenciaBilhete(bilhetesGapDevolvidosList, boletoComissao);
|
||||
gravarLogConferenciaBilhete(bilhetesGapDevolvidosList, boletoComissao, tabGapDevolvido, "conferenciaController.tab.gabDevolvido");
|
||||
} else if (!checkEvent.isChecked() && boletoComissao.getLogconferenciaId() != null) {
|
||||
removerLogConferenciaBilhete(bilhetesGapDevolvidosList, boletoComissao);
|
||||
removerLogConferenciaBilhete(bilhetesGapDevolvidosList, boletoComissao, tabGapDevolvido, "conferenciaController.tab.gabDevolvido");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -548,7 +568,7 @@ public class ConferenciaController extends MyGenericForwardComposer {
|
|||
@Override
|
||||
public void onEvent(Event event) throws Exception {
|
||||
BoletoComissao boletoComissao = (BoletoComissao) bilhetesGapDevolvidosList.getSelected();
|
||||
lancarLogConferenciaBilhete(boletoComissao, bilhetesDevolvidosList);
|
||||
lancarLogConferenciaBilhete(boletoComissao, bilhetesDevolvidosList, tabGapDevolvido);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -592,6 +612,8 @@ public class ConferenciaController extends MyGenericForwardComposer {
|
|||
txtTotalBilhetesManual.setValue(BigDecimalUtil.getBigDecimalToStringDouble2CasasDecimaisFormatado(totalBilhetesManual, LocaleUtil.getLocale()));
|
||||
txtQtdeTotalBilhetesManual.setValue(String.valueOf(lsBilhetesManual.size()));
|
||||
bilhetesManualList.setData(lsBilhetesManual);
|
||||
|
||||
verificarBilhetesSemConferencia(lsBilhetesManual, tabBilhetesManual);
|
||||
}
|
||||
|
||||
private void carregarBilhetesVendidos(List<BoletoComissao> boletosComissaos) throws BusinessException {
|
||||
|
@ -600,6 +622,8 @@ public class ConferenciaController extends MyGenericForwardComposer {
|
|||
txtTotalBilhetes.setValue(BigDecimalUtil.getBigDecimalToStringDouble2CasasDecimaisFormatado(totalBilhetesVendidos, LocaleUtil.getLocale()));
|
||||
txtQtdeTotalBilhetes.setValue(String.valueOf(lsBilhetes.size()));
|
||||
bilhetesList.setData(lsBilhetes);
|
||||
|
||||
verificarBilhetesSemConferencia(lsBilhetes, tabBilhetesVenda);
|
||||
}
|
||||
|
||||
private void carregarBilhetesCancelados(List<BoletoComissao> boletosComissaos) throws BusinessException {
|
||||
|
@ -608,6 +632,8 @@ public class ConferenciaController extends MyGenericForwardComposer {
|
|||
txtTotalBilhetesCancelados.setValue(BigDecimalUtil.getBigDecimalToStringDouble2CasasDecimaisFormatado(totalBilhetesCancelados, LocaleUtil.getLocale()));
|
||||
txtQtdeTotalBilhetesCancelados.setValue(String.valueOf(lsBilhetesCancelados.size()));
|
||||
bilhetesCanceladosList.setData(lsBilhetesCancelados);
|
||||
|
||||
verificarBilhetesSemConferencia(lsBilhetesCancelados, tabBilhetesCancelados);
|
||||
}
|
||||
|
||||
private void carregarBilhetesDevolvidos(List<BoletoComissao> boletosComissaos) throws BusinessException {
|
||||
|
@ -625,6 +651,8 @@ public class ConferenciaController extends MyGenericForwardComposer {
|
|||
txtQtdeTotalBilhetesDevolvidos.setValue(String.valueOf(lsBilhetesDevolvidos.size()));
|
||||
|
||||
bilhetesDevolvidosList.setData(lsBilhetesDevolvidos);
|
||||
|
||||
verificarBilhetesSemConferencia(lsBilhetesDevolvidos, tabBilhetesDevolvidos);
|
||||
}
|
||||
|
||||
private void carregarBilhetesGap(List<BoletoComissao> boletosComissaos) throws BusinessException {
|
||||
|
@ -633,6 +661,8 @@ public class ConferenciaController extends MyGenericForwardComposer {
|
|||
txtTotalBilhetesGap.setValue(BigDecimalUtil.getBigDecimalToStringDouble2CasasDecimaisFormatado(totalBilhetesGap, LocaleUtil.getLocale()));
|
||||
txtQtdeTotalBilhetesGap.setValue(String.valueOf(lsBilhetesGap.size()));
|
||||
bilhetesGapList.setData(lsBilhetesGap);
|
||||
|
||||
verificarBilhetesSemConferencia(lsBilhetesGap, tabGapVenda);
|
||||
}
|
||||
|
||||
private void carregarBilhetesGapCancelados(List<BoletoComissao> boletosComissaos) throws BusinessException {
|
||||
|
@ -641,6 +671,8 @@ public class ConferenciaController extends MyGenericForwardComposer {
|
|||
txtTotalBilhetesGapCancelados.setValue(BigDecimalUtil.getBigDecimalToStringDouble2CasasDecimaisFormatado(totalBilhetesGapCancelados, LocaleUtil.getLocale()));
|
||||
txtQtdeTotalBilhetesGapCancelados.setValue(String.valueOf(lsBilhetesGapCancelados.size()));
|
||||
bilhetesGapCanceladosList.setData(lsBilhetesGapCancelados);
|
||||
|
||||
verificarBilhetesSemConferencia(lsBilhetesGapCancelados, tabGapCancelado);
|
||||
}
|
||||
|
||||
private void carregarBilhetesGapDevolvidos(List<BoletoComissao> boletosComissaos) throws BusinessException {
|
||||
|
@ -658,6 +690,8 @@ public class ConferenciaController extends MyGenericForwardComposer {
|
|||
|
||||
txtQtdeTotalBilhetesGapDevolvidos.setValue(String.valueOf(lsBilhetesGapDevolvidos.size()));
|
||||
bilhetesGapDevolvidosList.setData(lsBilhetesGapDevolvidos);
|
||||
|
||||
verificarBilhetesSemConferencia(lsBilhetesGapDevolvidos, tabGapDevolvido);
|
||||
}
|
||||
|
||||
private void carregarLogsConferencia() throws BusinessException {
|
||||
|
@ -692,6 +726,8 @@ public class ConferenciaController extends MyGenericForwardComposer {
|
|||
txtTotalCreditosEventoFinanceiros.setValue(BigDecimalUtil.getBigDecimalToStringDouble2CasasDecimaisFormatado(totalCreditosEventoFinanceiros, LocaleUtil.getLocale()));
|
||||
txtTotalDebitosEventoFinanceiros.setValue(BigDecimalUtil.getBigDecimalToStringDouble2CasasDecimaisFormatado(totalDebitosEventoFinanceiros, LocaleUtil.getLocale()));
|
||||
txtTotalDiferencaEventoFinanceiros.setValue(BigDecimalUtil.getBigDecimalToStringDouble2CasasDecimaisFormatado(totalCreditosEventoFinanceiros.subtract(totalDebitosEventoFinanceiros), LocaleUtil.getLocale()));
|
||||
|
||||
verificarEventosFinanceirosSemConferencia(lsEventosFinanceiros, tabEventosFinanceiros);
|
||||
}
|
||||
|
||||
private void carregarOcds() throws BusinessException {
|
||||
|
@ -703,6 +739,8 @@ public class ConferenciaController extends MyGenericForwardComposer {
|
|||
txtQtdeTotalOcd.setValue(String.valueOf(lsOcds.size()));
|
||||
}
|
||||
ocdsList.setData(lsOcds);
|
||||
|
||||
verificarOcdsSemConferencia(lsOcds, tabOcd);
|
||||
}
|
||||
|
||||
public void onClick$btnChegadaMalote(Event event) throws InterruptedException {
|
||||
|
@ -930,7 +968,7 @@ public class ConferenciaController extends MyGenericForwardComposer {
|
|||
}
|
||||
}
|
||||
|
||||
private void lancarLogConferenciaBilhete(BoletoComissao boletoComissao, MyListbox localBilhetesList) {
|
||||
private void lancarLogConferenciaBilhete(BoletoComissao boletoComissao, MyListbox localBilhetesList, Tab tab) {
|
||||
if (boletoComissao == null || isObservacaoLancada(boletoComissao) || isMovimentoEncerrado() || (!isMaloteRecebido() && isNaopermiteconfsemmalote())) {
|
||||
return;
|
||||
}
|
||||
|
@ -940,6 +978,7 @@ public class ConferenciaController extends MyGenericForwardComposer {
|
|||
args.put("logsConferenciaList", logsConferenciaList);
|
||||
args.put("bilhetesList", localBilhetesList);
|
||||
args.put("conferencia", conferencia);
|
||||
args.put("tab", tab);
|
||||
|
||||
openWindow("/gui/comissao/editarLogConferenciaComissao.zul",
|
||||
Labels.getLabel("editarLogConferenciaComissaoController.window.title"), args, MODAL);
|
||||
|
@ -955,12 +994,13 @@ public class ConferenciaController extends MyGenericForwardComposer {
|
|||
args.put("logsConferenciaList", logsConferenciaList);
|
||||
args.put("eventosFinanceirosList", eventosFinanceirosList);
|
||||
args.put("conferencia", conferencia);
|
||||
args.put("tab", tabEventosFinanceiros);
|
||||
|
||||
openWindow("/gui/comissao/editarLogConferenciaComissao.zul",
|
||||
Labels.getLabel("editarLogConferenciaComissaoController.window.title"), args, MODAL);
|
||||
}
|
||||
|
||||
private void lancarLogConferenciaOcd(OcdVO ocd, MyListbox ocdsList) {
|
||||
private void lancarLogConferenciaOcd(OcdVO ocd, MyListbox ocdsList, Tab tabOcd) {
|
||||
if (ocd == null || isObservacaoLancada(ocd) || isMovimentoEncerrado() || (!isMaloteRecebido() && isNaopermiteconfsemmalote())) {
|
||||
return;
|
||||
}
|
||||
|
@ -970,6 +1010,7 @@ public class ConferenciaController extends MyGenericForwardComposer {
|
|||
args.put("logsConferenciaList", logsConferenciaList);
|
||||
args.put("ocdsList", ocdsList);
|
||||
args.put("conferencia", conferencia);
|
||||
args.put("tab", tabOcd);
|
||||
|
||||
openWindow("/gui/comissao/editarLogConferenciaComissao.zul",
|
||||
Labels.getLabel("editarLogConferenciaComissaoController.window.title"), args, MODAL);
|
||||
|
@ -1133,17 +1174,8 @@ public class ConferenciaController extends MyGenericForwardComposer {
|
|||
}
|
||||
|
||||
private void validarBilhetes() throws BusinessException {
|
||||
/*
|
||||
* validarListBilhetes(bilhetesManualList); validarListBilhetes(bilhetesList); validarListBilhetes(bilhetesCanceladosList); validarListBilhetes(bilhetesDevolvidosList); validarListBilhetes(bilhetesGapCanceladosList); validarListBilhetes(bilhetesGapDevolvidosList); validarListBilhetes(bilhetesGapList);
|
||||
*/
|
||||
}
|
||||
|
||||
/*
|
||||
* @SuppressWarnings("unchecked") private void validarListBilhetes(MyListbox bilhetes) throws BusinessException { int index = 0; List<Listitem> itens = bilhetes.getItems(); List<BoletoComissao> boletoComissaos = bilhetes.getListData(); for (Listitem item: itens) { BoletoComissao boletoComissao = boletoComissaos.get(index++); boletoComissao.setConferido(validarListitemMarcado(item, boletoComissao)); if(boletoComissao.isConferido() && boletoComissao.getLogconferenciaId() ==
|
||||
* null) { LogConferencia logConferencia = gravarLogConferencia(TipoLogConferencia.BOLETO, boletoComissao.getBoletoId(), boletoComissao.getNumFolioSistema()); boletoComissao.setLogconferenciaId(logConferencia.getLogconferenciaId()); boletoComissao.setStatus(logConferencia.getStatus().getValue()); boletoComissao.setConferido(Boolean.TRUE); bilhetes.updateItem(boletoComissao); } else if(!boletoComissao.isConferido() && boletoComissao.getLogconferenciaId() != null) {
|
||||
* LogConferencia logConferencia = conferenciaComissaoService.obtenerLogConferenciaID(boletoComissao.getLogconferenciaId()); conferenciaComissaoService.borrarLogConferencia(logConferencia); boletoComissao.setLogconferenciaId(null); boletoComissao.setStatus(null); boletoComissao.setConferido(Boolean.FALSE); removerLogConferencia(logConferencia); bilhetes.updateItem(boletoComissao); } } }
|
||||
*/
|
||||
|
||||
private void removerLogConferencia(Long logconferenciaId) {
|
||||
LogConferenciaVO log = new LogConferenciaVO(logconferenciaId);
|
||||
logsConferenciaList.removeItem(log);
|
||||
|
@ -1192,26 +1224,23 @@ public class ConferenciaController extends MyGenericForwardComposer {
|
|||
lsLogsConferencia.add(logConferenciaVO);
|
||||
}
|
||||
|
||||
/*
|
||||
* @SuppressWarnings("unchecked") private void addCheckboxEventListenerBilhetes(MyListbox bilhetes) { int index = 0; List<Listitem> itens = bilhetes.getItems(); List<BoletoComissao> boletoComissaos = bilhetes.getListData(); for (Listitem item: itens) { List<Component> com = item.getChildren(); for (Component component: com) { Listcell listCell = (Listcell) component; System.out.println(listCell.getFirstChild()); if(listCell.getFirstChild() instanceof Checkbox) { Checkbox
|
||||
* chk = (Checkbox)component.getFirstChild(); chk.setId(boletoComissaos.get(index++).getBoletoId()+""); chk.addEventListener("onCheck", new EventListener() {
|
||||
*
|
||||
* @Override public void onEvent(Event arg0) throws Exception { System.out.println("EXECUTOU"); } }); } } } }
|
||||
*/
|
||||
|
||||
private void gravarLogConferenciaBilhete(MyListbox bilhetes, BoletoComissao boletoComissao) {
|
||||
@SuppressWarnings("unchecked")
|
||||
private void gravarLogConferenciaBilhete(MyListbox bilhetes, BoletoComissao boletoComissao, Tab tab, String label) {
|
||||
try {
|
||||
LogConferencia logConferencia = gravarLogConferencia(TipoLogConferencia.BOLETO, boletoComissao.getBoletoId(), boletoComissao.getNumFolioSistema());
|
||||
boletoComissao.setLogconferenciaId(logConferencia.getLogconferenciaId());
|
||||
boletoComissao.setStatus(logConferencia.getStatus().getValue());
|
||||
boletoComissao.setConferido(Boolean.TRUE);
|
||||
bilhetes.updateItem(boletoComissao);
|
||||
|
||||
verificarBilhetesSemConferencia((List<BoletoComissao>)bilhetes.getListData(), tab);
|
||||
} catch (BusinessException e) {
|
||||
log.error(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
private void removerLogConferenciaBilhete(MyListbox bilhetes, BoletoComissao boletoComissao) {
|
||||
@SuppressWarnings("unchecked")
|
||||
private void removerLogConferenciaBilhete(MyListbox bilhetes, BoletoComissao boletoComissao, Tab tab, String label) {
|
||||
try {
|
||||
LogConferencia logConferencia = conferenciaComissaoService.obtenerLogConferenciaID(boletoComissao.getLogconferenciaId());
|
||||
conferenciaComissaoService.borrarLogConferencia(logConferencia);
|
||||
|
@ -1220,11 +1249,14 @@ public class ConferenciaController extends MyGenericForwardComposer {
|
|||
boletoComissao.setConferido(Boolean.FALSE);
|
||||
removerLogConferencia(logConferencia.getLogconferenciaId());
|
||||
bilhetes.updateItem(boletoComissao);
|
||||
|
||||
verificarBilhetesSemConferencia((List<BoletoComissao>)bilhetes.getListData(), tab);
|
||||
} catch (BusinessException e) {
|
||||
log.error(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private void gravarLogConferenciaEventoFinanceiro(EventosFinanceirosVO eventoFinanceiro) {
|
||||
try {
|
||||
LogConferencia logConferencia = gravarLogConferencia(TipoLogConferencia.EVENTO_FINANCEIRO, eventoFinanceiro.getEventoextraId(), null);
|
||||
|
@ -1232,11 +1264,14 @@ public class ConferenciaController extends MyGenericForwardComposer {
|
|||
eventoFinanceiro.setStatus(logConferencia.getStatus().getValue());
|
||||
eventoFinanceiro.setConferido(Boolean.TRUE);
|
||||
eventosFinanceirosList.updateItem(eventoFinanceiro);
|
||||
|
||||
verificarEventosFinanceirosSemConferencia((List<EventosFinanceirosVO>)eventosFinanceirosList.getListData(), tabEventosFinanceiros);
|
||||
} catch (BusinessException e) {
|
||||
log.error(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private void removerLogConferenciaEventoFinanceiro(EventosFinanceirosVO eventoFinanceiro) {
|
||||
try {
|
||||
LogConferencia logConferencia = conferenciaComissaoService.obtenerLogConferenciaID(eventoFinanceiro.getLogconferenciaId());
|
||||
|
@ -1246,11 +1281,14 @@ public class ConferenciaController extends MyGenericForwardComposer {
|
|||
eventoFinanceiro.setConferido(Boolean.FALSE);
|
||||
removerLogConferencia(logConferencia.getLogconferenciaId());
|
||||
eventosFinanceirosList.updateItem(eventoFinanceiro);
|
||||
|
||||
verificarEventosFinanceirosSemConferencia((List<EventosFinanceirosVO>)eventosFinanceirosList.getListData(), tabEventosFinanceiros);
|
||||
} catch (BusinessException e) {
|
||||
log.error(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private void gravarLogConferenciaOcd(OcdVO ocd) {
|
||||
try {
|
||||
LogConferencia logConferencia = gravarLogConferencia(TipoLogConferencia.OCD, ocd.getOcdId(), null);
|
||||
|
@ -1258,11 +1296,14 @@ public class ConferenciaController extends MyGenericForwardComposer {
|
|||
ocd.setStatus(logConferencia.getStatus().getValue());
|
||||
ocd.setConferido(Boolean.TRUE);
|
||||
ocdsList.updateItem(ocd);
|
||||
|
||||
verificarOcdsSemConferencia((List<OcdVO>) ocdsList.getListData(), tabOcd);
|
||||
} catch (BusinessException e) {
|
||||
log.error(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private void removerLogConferenciaOcd(OcdVO ocd) {
|
||||
try {
|
||||
LogConferencia logConferencia = conferenciaComissaoService.obtenerLogConferenciaID(ocd.getLogconferenciaId());
|
||||
|
@ -1272,6 +1313,8 @@ public class ConferenciaController extends MyGenericForwardComposer {
|
|||
ocd.setConferido(Boolean.FALSE);
|
||||
removerLogConferencia(logConferencia.getLogconferenciaId());
|
||||
ocdsList.updateItem(ocd);
|
||||
|
||||
verificarOcdsSemConferencia((List<OcdVO>) ocdsList.getListData(), tabOcd);
|
||||
} catch (BusinessException e) {
|
||||
log.error(e.getMessage(), e);
|
||||
}
|
||||
|
@ -1343,4 +1386,38 @@ public class ConferenciaController extends MyGenericForwardComposer {
|
|||
return empresa.getIndnaopermiteconfsemmalote() != null && empresa.getIndnaopermiteconfsemmalote();
|
||||
}
|
||||
|
||||
private void verificarBilhetesSemConferencia(List<BoletoComissao> lsBilhetes, Tab tab) throws BusinessException {
|
||||
if(conferenciaComissaoService.isBilhetesSemConferencia(lsBilhetes)) {
|
||||
setTabExigeConferencia(tab);
|
||||
} else {
|
||||
setTabNaoExigeConferencia(tab);
|
||||
}
|
||||
}
|
||||
|
||||
private void verificarOcdsSemConferencia(List<OcdVO> lsOcds, Tab tab) throws BusinessException {
|
||||
if(conferenciaComissaoService.isOcdSemConferencia(lsOcds)) {
|
||||
setTabExigeConferencia(tab);
|
||||
} else {
|
||||
setTabNaoExigeConferencia(tab);
|
||||
}
|
||||
}
|
||||
|
||||
private void verificarEventosFinanceirosSemConferencia(List<EventosFinanceirosVO> lsEventosFinanceiros, Tab tab) throws BusinessException {
|
||||
if(conferenciaComissaoService.isEventosFinanceirosSemConferencia(lsEventosFinanceiros)) {
|
||||
setTabExigeConferencia(tab);
|
||||
} else {
|
||||
setTabNaoExigeConferencia(tab);
|
||||
}
|
||||
}
|
||||
|
||||
private void setTabNaoExigeConferencia(Tab tab) {
|
||||
tab.setSclass("semConferencia");
|
||||
tab.invalidate();
|
||||
}
|
||||
|
||||
private void setTabExigeConferencia(Tab tab) {
|
||||
tab.setSclass("existeConferencia");
|
||||
tab.invalidate();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -15,6 +15,7 @@ import org.zkoss.zk.ui.event.Event;
|
|||
import org.zkoss.zul.Combobox;
|
||||
import org.zkoss.zul.Messagebox;
|
||||
import org.zkoss.zul.Radio;
|
||||
import org.zkoss.zul.Tab;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.Conferencia;
|
||||
import com.rjconsultores.ventaboletos.entidad.ConferenciaPendencia;
|
||||
|
@ -22,6 +23,7 @@ import com.rjconsultores.ventaboletos.entidad.LogConferencia;
|
|||
import com.rjconsultores.ventaboletos.entidad.TipoInformativoComissao;
|
||||
import com.rjconsultores.ventaboletos.enums.comissao.StatusLogConferencia;
|
||||
import com.rjconsultores.ventaboletos.enums.comissao.TipoLogConferencia;
|
||||
import com.rjconsultores.ventaboletos.exception.BusinessException;
|
||||
import com.rjconsultores.ventaboletos.service.ConferenciaComissaoService;
|
||||
import com.rjconsultores.ventaboletos.service.ConferenciaPendenciaService;
|
||||
import com.rjconsultores.ventaboletos.service.TipoInformativoComissaoService;
|
||||
|
@ -77,6 +79,8 @@ public class EditarLogConfenciaComissaoController extends MyGenericForwardCompos
|
|||
private MyComboboxEstandar cmbConferenciaPendencia;
|
||||
private List<ConferenciaPendencia> lsConferenciaPendencia;
|
||||
|
||||
private Tab tab;
|
||||
|
||||
@Override
|
||||
public void doAfterCompose(Component comp) throws Exception {
|
||||
lsTipoInformativo = tipoInformativoComissaoService.obtenerTodos();
|
||||
|
@ -85,6 +89,7 @@ public class EditarLogConfenciaComissaoController extends MyGenericForwardCompos
|
|||
ocd = (OcdVO) Executions.getCurrent().getArg().get("ocd");
|
||||
conferencia = (Conferencia) Executions.getCurrent().getArg().get("conferencia");
|
||||
logsConferenciaList = (MyListbox) Executions.getCurrent().getArg().get("logsConferenciaList");
|
||||
tab = (Tab) Executions.getCurrent().getArg().get("tab");
|
||||
|
||||
if(Executions.getCurrent().getArg().containsKey("ocdsList")) {
|
||||
atualizarList = (MyListbox) Executions.getCurrent().getArg().get("ocdsList");
|
||||
|
@ -223,13 +228,17 @@ public class EditarLogConfenciaComissaoController extends MyGenericForwardCompos
|
|||
return true;
|
||||
}
|
||||
|
||||
private void atualizarList() {
|
||||
@SuppressWarnings("unchecked")
|
||||
private void atualizarList() throws BusinessException {
|
||||
if(boletoComissao != null) {
|
||||
atualizarList.updateItem(boletoComissao);
|
||||
verificarBilhetesSemConferencia((List<BoletoComissao>)atualizarList.getListData(), tab);
|
||||
} else if(eventosFinanceiros != null) {
|
||||
atualizarList.updateItem(eventosFinanceiros);
|
||||
verificarEventosFinanceirosSemConferencia((List<EventosFinanceirosVO>)atualizarList.getListData(), tab);
|
||||
} else if(ocd != null) {
|
||||
atualizarList.updateItem(ocd);
|
||||
verificarOcdsSemConferencia((List<OcdVO>)atualizarList.getListData(), tab);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -296,5 +305,39 @@ public class EditarLogConfenciaComissaoController extends MyGenericForwardCompos
|
|||
this.lsConferenciaPendencia = lsConferenciaPendencia;
|
||||
}
|
||||
|
||||
private void verificarBilhetesSemConferencia(List<BoletoComissao> lsBilhetes, Tab tab) throws BusinessException {
|
||||
if(conferenciaComissaoService.isBilhetesSemConferencia(lsBilhetes)) {
|
||||
setTabExigeConferencia(tab);
|
||||
} else {
|
||||
setTabNaoExigeConferencia(tab);
|
||||
}
|
||||
}
|
||||
|
||||
private void verificarOcdsSemConferencia(List<OcdVO> lsOcds, Tab tab) throws BusinessException {
|
||||
if(conferenciaComissaoService.isOcdSemConferencia(lsOcds)) {
|
||||
setTabExigeConferencia(tab);
|
||||
} else {
|
||||
setTabNaoExigeConferencia(tab);
|
||||
}
|
||||
}
|
||||
|
||||
private void verificarEventosFinanceirosSemConferencia(List<EventosFinanceirosVO> lsEventosFinanceiros, Tab tab) throws BusinessException {
|
||||
if(conferenciaComissaoService.isEventosFinanceirosSemConferencia(lsEventosFinanceiros)) {
|
||||
setTabExigeConferencia(tab);
|
||||
} else {
|
||||
setTabNaoExigeConferencia(tab);
|
||||
}
|
||||
}
|
||||
|
||||
private void setTabNaoExigeConferencia(Tab tab) {
|
||||
tab.setSclass("semConferencia");
|
||||
tab.invalidate();
|
||||
}
|
||||
|
||||
private void setTabExigeConferencia(Tab tab) {
|
||||
tab.setSclass("existeConferencia");
|
||||
tab.invalidate();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -9,6 +9,17 @@
|
|||
title="${c:l('conferenciaController.window.title')}"
|
||||
apply="${conferenciaController}" contentStyle="overflow:auto"
|
||||
height="500px" width="1200px" border="normal">
|
||||
|
||||
<style>
|
||||
.existeConferencia .z-tab-text {
|
||||
color: #FF0000;
|
||||
}
|
||||
|
||||
.semConferencia .z-tab-text {
|
||||
color: #403E39;
|
||||
}
|
||||
</style>
|
||||
|
||||
<toolbar>
|
||||
<button id="btnCerrar" image="/gui/img/exit.png"
|
||||
width="35px"
|
||||
|
@ -59,26 +70,28 @@
|
|||
|
||||
<tabbox id="tabboxGeral">
|
||||
<tabs>
|
||||
<tab
|
||||
<tab id="tabBilhetesManual"
|
||||
label="${c:l('conferenciaController.tab.bilhetesManual')}" />
|
||||
<tab
|
||||
<tab id="tabBilhetesVenda"
|
||||
label="${c:l('conferenciaController.tab.bilhetes')}" />
|
||||
<tab
|
||||
<tab id="tabBilhetesCancelados"
|
||||
label="${c:l('conferenciaController.tab.bilhetesCancelados')}" />
|
||||
<tab
|
||||
<tab id="tabBilhetesDevolvidos"
|
||||
label="${c:l('conferenciaController.tab.bilhetesDevolvidos')}" />
|
||||
<tab
|
||||
<tab id="tabGapVenda"
|
||||
label="${c:l('conferenciaController.tab.gabVenda')}" />
|
||||
<tab
|
||||
<tab id="tabGapCancelado"
|
||||
label="${c:l('conferenciaController.tab.gabCancelado')}" />
|
||||
<tab
|
||||
<tab id="tabGapDevolvido"
|
||||
label="${c:l('conferenciaController.tab.gabDevolvido')}" />
|
||||
<tab
|
||||
<tab id="tabEventosFinanceiros"
|
||||
label="${c:l('conferenciaController.tab.eventosFinanceiros')}" />
|
||||
<tab label="${c:l('conferenciaController.tab.ocd')}" />
|
||||
<tab
|
||||
<tab id="tabOcd"
|
||||
label="${c:l('conferenciaController.tab.ocd')}" />
|
||||
<tab id="tabObservacoes"
|
||||
label="${c:l('conferenciaController.tab.observacoes')}" />
|
||||
<tab label="${c:l('conferenciaController.tab.resumo')}" />
|
||||
<tab id="tabResumo"
|
||||
label="${c:l('conferenciaController.tab.resumo')}" />
|
||||
</tabs>
|
||||
<tabpanels>
|
||||
|
||||
|
|
Loading…
Reference in New Issue