master
Fabio 2024-05-22 09:06:06 -03:00
commit a66e62e9fb
3 changed files with 69 additions and 16 deletions

View File

@ -115,7 +115,7 @@
<artifactId>slf4j-reload4j</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependency>
<dependency>
<groupId>br.com.rjconsultores</groupId>

View File

@ -19,6 +19,7 @@ import java.util.Arrays;
import java.util.Calendar;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
@ -592,11 +593,15 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
private Checkbox checkIndBloqueioDescontoWEB;
private Checkbox checkIndTaxaConvenienciaOrgaoConcedente;
private final String constanteIndMotivoBloqueio= "IND_MOTIVO_BLOQUEIO";
@Autowired
private CobrancaAdcPuntoVentaService cobrancaAdcService;
private List<OrgaoConcedente> lsOrgaoConcedentes;
private boolean indMotivoBloqueio;
public Button getBtnApagar() {
return btnApagar;
}
@ -610,7 +615,7 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
"jQuery('#" + txtNumFax.getUuid() + "').mask('(999)9999-9999?9');" +
"jQuery('#" + numtelefonodos.getUuid() + "').mask('(999)9999-9999?9');" +
"jQuery('#" + numtelefonouno.getUuid() + "').mask('(999)9999-9999?9');");
}
}
private List<String> getLogFiles() {
List<String> files = new ArrayList<String>();
@ -773,7 +778,17 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
ptovtaPtoVtaSeguroList.setData(puntoVenta.getPtovtaSeguroList());
ptovtaCatIndList.setData(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());
categoriasBloqImpPosteriorList.setData(puntoVenta.getCategoriaBloqImpPosteriorList());
cobrancaAdicionalList.setData(puntoVenta.getCobrancaAdicionalList());
@ -864,9 +879,17 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
}
statusAprobacionInicial = radAprobacionAutorizado.isChecked() ? "A" : "L";
motivoBloqueio.setValue(puntoVenta.getMotivoBloqueio());
obterOValorConstanteIndMotivoBloqueio();
if (indMotivoBloqueio) {
rowMotivoBloqueio.setVisible(true);
}
if (puntoVenta.getPuntoventaId() != null) {
motivoBloqueio.setValue(puntoVenta.getMotivoBloqueio());
if (puntoVenta.getAgenciaId() != null) {
if (puntoVenta.getAgenciaId().getInstiFinanceiraId() != null) {
@ -894,13 +917,11 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
}
if (puntoVenta.getDateAbertura() != null) {
dateAbertura.setValue(puntoVenta.getDateAbertura());
}
}
if (radAprobacionLatente.isChecked()) {
dateFechamento.setValue(puntoVenta.getDateFechamento());
rowDateFechamento.setVisible(true);
motivoBloqueio.setValue(puntoVenta.getMotivoBloqueio());
rowMotivoBloqueio.setVisible(true);
}
} else {
dateAbertura.setValue(new Date());
@ -1147,7 +1168,10 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
}
}
});
});
}
/**
@ -1920,7 +1944,19 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
txtAntecipPercentual.getValue();
numtelefonodos.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();
if (getTxtTaxaConvenienciaPorc().getValue() != null &&
getTxtTaxaConvenienciaPorc().getValue().compareTo(BigDecimal.ZERO) == 1) {
@ -2152,7 +2188,7 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
}
puntoVenta.setDateFechamento(dateFechamento.getValue());
puntoVenta.setMotivoBloqueio(motivoBloqueio.getValue());
String getString = null;
puntoVenta.setNumfax(null);
@ -2245,6 +2281,16 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
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)){
HistoricoPuntoVenta h = new HistoricoPuntoVenta();
h.setPuntoVenta(puntoVenta);
@ -4167,8 +4213,7 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
public void onClick$radAprobacionLatente(Event event) {
if (radAprobacionLatente.isChecked()) {
rowDateFechamento.setVisible(Boolean.TRUE);
rowMotivoBloqueio.setVisible(Boolean.TRUE);
rowDateFechamento.setVisible(Boolean.TRUE);
}
}
@ -4176,8 +4221,6 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
if (!radAprobacionLatente.isChecked()) {
dateFechamento.setValue(puntoVenta.getDateFechamento());
rowDateFechamento.setVisible(Boolean.FALSE);
motivoBloqueio.setValue(null);
rowMotivoBloqueio.setVisible(Boolean.FALSE);
}
}
@ -4861,4 +4904,14 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
}
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
value="${c:l('editarPuntoVentaController.lbMotivoBloqueio.value')}" />
<textbox id="motivoBloqueio"
constraint="no zero" width="70%" maxlength="15"
constraint="no zero" width="70%" maxlength="100"
use="com.rjconsultores.ventaboletos.web.utilerias.MyTextbox" />
</row>