fixes bug#AL-4368

master
Aristides dos Reis Júnior 2024-05-21 17:42:47 -03:00
parent 9c5f1c0fa3
commit bad23629cd
3 changed files with 69 additions and 16 deletions

View File

@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>br.com.rjconsultores</groupId> <groupId>br.com.rjconsultores</groupId>
<artifactId>ventaboletosadm</artifactId> <artifactId>ventaboletosadm</artifactId>
<version>1.77.5</version> <version>1.77.6</version>
<packaging>war</packaging> <packaging>war</packaging>
<properties> <properties>

View File

@ -19,6 +19,7 @@ import java.util.Arrays;
import java.util.Calendar; import java.util.Calendar;
import java.util.Collection; import java.util.Collection;
import java.util.Collections; import java.util.Collections;
import java.util.Comparator;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.HashSet; import java.util.HashSet;
@ -592,11 +593,15 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
private Checkbox checkIndBloqueioDescontoWEB; private Checkbox checkIndBloqueioDescontoWEB;
private Checkbox checkIndTaxaConvenienciaOrgaoConcedente; private Checkbox checkIndTaxaConvenienciaOrgaoConcedente;
private final String constanteIndMotivoBloqueio= "IND_MOTIVO_BLOQUEIO";
@Autowired @Autowired
private CobrancaAdcPuntoVentaService cobrancaAdcService; private CobrancaAdcPuntoVentaService cobrancaAdcService;
private List<OrgaoConcedente> lsOrgaoConcedentes; private List<OrgaoConcedente> lsOrgaoConcedentes;
private boolean indMotivoBloqueio;
public Button getBtnApagar() { public Button getBtnApagar() {
return btnApagar; return btnApagar;
} }
@ -773,7 +778,17 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
ptovtaPtoVtaSeguroList.setData(puntoVenta.getPtovtaSeguroList()); ptovtaPtoVtaSeguroList.setData(puntoVenta.getPtovtaSeguroList());
ptovtaCatIndList.setData(puntoVenta.getPtovtaCatIndList()); ptovtaCatIndList.setData(puntoVenta.getPtovtaCatIndList());
ptovtaCatIndListTemp.addAll(puntoVenta.getPtovtaCatIndList()); ptovtaCatIndListTemp.addAll(puntoVenta.getPtovtaCatIndList());
ptovtaHistoricoList.setData(puntoVenta.getHistoricoPuntoVentaList()); List<HistoricoPuntoVenta> lsHistoricoPuntoVentaOrdenada =puntoVenta.getHistoricoPuntoVentaList();
Collections.sort(lsHistoricoPuntoVentaOrdenada, new Comparator() {
public int compare(Object o1, Object o2) {
HistoricoPuntoVenta c1 = (HistoricoPuntoVenta) o1;
HistoricoPuntoVenta c2 = (HistoricoPuntoVenta) o2;
return c1.getFecBloqueio().compareTo( c2.getFecBloqueio());
}
});
ptovtaHistoricoList.setData(lsHistoricoPuntoVentaOrdenada);
ptovtaHistoricoFormaPagoList.setData(puntoVenta.getHistoricoFormaPagoPuntoVentaList()); ptovtaHistoricoFormaPagoList.setData(puntoVenta.getHistoricoFormaPagoPuntoVentaList());
categoriasBloqImpPosteriorList.setData(puntoVenta.getCategoriaBloqImpPosteriorList()); categoriasBloqImpPosteriorList.setData(puntoVenta.getCategoriaBloqImpPosteriorList());
cobrancaAdicionalList.setData(puntoVenta.getCobrancaAdicionalList()); cobrancaAdicionalList.setData(puntoVenta.getCobrancaAdicionalList());
@ -864,9 +879,17 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
} }
statusAprobacionInicial = radAprobacionAutorizado.isChecked() ? "A" : "L"; statusAprobacionInicial = radAprobacionAutorizado.isChecked() ? "A" : "L";
motivoBloqueio.setValue(puntoVenta.getMotivoBloqueio());
obterOValorConstanteIndMotivoBloqueio();
if (indMotivoBloqueio) {
rowMotivoBloqueio.setVisible(true);
}
if (puntoVenta.getPuntoventaId() != null) { if (puntoVenta.getPuntoventaId() != null) {
motivoBloqueio.setValue(puntoVenta.getMotivoBloqueio());
if (puntoVenta.getAgenciaId() != null) { if (puntoVenta.getAgenciaId() != null) {
if (puntoVenta.getAgenciaId().getInstiFinanceiraId() != null) { if (puntoVenta.getAgenciaId().getInstiFinanceiraId() != null) {
@ -895,12 +918,10 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
if (puntoVenta.getDateAbertura() != null) { if (puntoVenta.getDateAbertura() != null) {
dateAbertura.setValue(puntoVenta.getDateAbertura()); dateAbertura.setValue(puntoVenta.getDateAbertura());
} }
if (radAprobacionLatente.isChecked()) { if (radAprobacionLatente.isChecked()) {
dateFechamento.setValue(puntoVenta.getDateFechamento()); dateFechamento.setValue(puntoVenta.getDateFechamento());
rowDateFechamento.setVisible(true); rowDateFechamento.setVisible(true);
motivoBloqueio.setValue(puntoVenta.getMotivoBloqueio());
rowMotivoBloqueio.setVisible(true);
} }
} else { } else {
dateAbertura.setValue(new Date()); dateAbertura.setValue(new Date());
@ -1148,6 +1169,9 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
} }
}); });
} }
/** /**
@ -1920,6 +1944,18 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
txtAntecipPercentual.getValue(); txtAntecipPercentual.getValue();
numtelefonodos.getValue(); numtelefonodos.getValue();
numtelefonouno.getValue(); numtelefonouno.getValue();
if (indMotivoBloqueio) {
if (puntoVenta.getPuntoventaId() != null) {
String statusAprobacionAtual = radAprobacionAutorizado.isChecked() ? "A" : "L";
if (!statusAprobacionAtual.equals(statusAprobacionInicial)) {
motivoBloqueio.setConstraint("no empty");
motivoBloqueio.getValue();
}
} else {
motivoBloqueio.setConstraint("no empty");
motivoBloqueio.getValue();
}
}
getTxtTaxaConvenienciaPorc().getValue(); getTxtTaxaConvenienciaPorc().getValue();
if (getTxtTaxaConvenienciaPorc().getValue() != null && if (getTxtTaxaConvenienciaPorc().getValue() != null &&
@ -2152,7 +2188,7 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
} }
puntoVenta.setDateFechamento(dateFechamento.getValue()); puntoVenta.setDateFechamento(dateFechamento.getValue());
puntoVenta.setMotivoBloqueio(motivoBloqueio.getValue());
String getString = null; String getString = null;
puntoVenta.setNumfax(null); puntoVenta.setNumfax(null);
@ -2245,6 +2281,16 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
puntoVenta.setStatusaprobacion("L"); puntoVenta.setStatusaprobacion("L");
} }
if (indMotivoBloqueio) {
if (puntoVenta.getPuntoventaId() != null) {
if (!puntoVenta.getStatusaprobacion().equals(statusAprobacionInicial)) {
puntoVenta.setMotivoBloqueio(motivoBloqueio.getValue());
}
} else {
puntoVenta.setMotivoBloqueio(motivoBloqueio.getValue());
}
}
if(!puntoVenta.getStatusaprobacion().equals(statusAprobacionInicial)){ if(!puntoVenta.getStatusaprobacion().equals(statusAprobacionInicial)){
HistoricoPuntoVenta h = new HistoricoPuntoVenta(); HistoricoPuntoVenta h = new HistoricoPuntoVenta();
h.setPuntoVenta(puntoVenta); h.setPuntoVenta(puntoVenta);
@ -4168,7 +4214,6 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
public void onClick$radAprobacionLatente(Event event) { public void onClick$radAprobacionLatente(Event event) {
if (radAprobacionLatente.isChecked()) { if (radAprobacionLatente.isChecked()) {
rowDateFechamento.setVisible(Boolean.TRUE); rowDateFechamento.setVisible(Boolean.TRUE);
rowMotivoBloqueio.setVisible(Boolean.TRUE);
} }
} }
@ -4176,8 +4221,6 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
if (!radAprobacionLatente.isChecked()) { if (!radAprobacionLatente.isChecked()) {
dateFechamento.setValue(puntoVenta.getDateFechamento()); dateFechamento.setValue(puntoVenta.getDateFechamento());
rowDateFechamento.setVisible(Boolean.FALSE); rowDateFechamento.setVisible(Boolean.FALSE);
motivoBloqueio.setValue(null);
rowMotivoBloqueio.setVisible(Boolean.FALSE);
} }
} }
@ -4861,4 +4904,14 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
} }
return false; return false;
} }
private void obterOValorConstanteIndMotivoBloqueio() {
Constante constante = constanteService.buscarPorNomeConstante(constanteIndMotivoBloqueio);
if (constante != null && StringUtils.isNotBlank(constante.getValorconstante())
&& constante.getValorconstante().equalsIgnoreCase("true")) {
indMotivoBloqueio = true;
}
}
} }

View File

@ -265,7 +265,7 @@
<label <label
value="${c:l('editarPuntoVentaController.lbMotivoBloqueio.value')}" /> value="${c:l('editarPuntoVentaController.lbMotivoBloqueio.value')}" />
<textbox id="motivoBloqueio" <textbox id="motivoBloqueio"
constraint="no zero" width="70%" maxlength="15" constraint="no zero" width="70%" maxlength="100"
use="com.rjconsultores.ventaboletos.web.utilerias.MyTextbox" /> use="com.rjconsultores.ventaboletos.web.utilerias.MyTextbox" />
</row> </row>