Mantis 9099
Parametrizar para que o campo "Endereço de email" da Aba "Endereço" do cadastro de Ponto de venda seja opcional. Criar a constante "TOTALBUS_EMAIL_OPCIONAL_PV" na tabela constante. Por padrão, que não tiver a constante definida, será obrigatório. ** Essa constante deve ser inserida nos bancos de teste e produção da comporte. git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@69377 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
be5be58e20
commit
6cabbea5a1
|
@ -72,6 +72,7 @@ import com.rjconsultores.ventaboletos.entidad.Categoria;
|
|||
import com.rjconsultores.ventaboletos.entidad.CategoriaBloqueioImpPosterior;
|
||||
import com.rjconsultores.ventaboletos.entidad.Ciudad;
|
||||
import com.rjconsultores.ventaboletos.entidad.Colonia;
|
||||
import com.rjconsultores.ventaboletos.entidad.Constante;
|
||||
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||
import com.rjconsultores.ventaboletos.entidad.EmpresaContaBancaria;
|
||||
import com.rjconsultores.ventaboletos.entidad.FechamentoParamptovta;
|
||||
|
@ -109,6 +110,7 @@ import com.rjconsultores.ventaboletos.exception.ValidacionCampoException;
|
|||
import com.rjconsultores.ventaboletos.service.CategoriaBloqueioImpPosteriorService;
|
||||
import com.rjconsultores.ventaboletos.service.CategoriaService;
|
||||
import com.rjconsultores.ventaboletos.service.ColoniaService;
|
||||
import com.rjconsultores.ventaboletos.service.ConstanteService;
|
||||
import com.rjconsultores.ventaboletos.service.EmpresaService;
|
||||
import com.rjconsultores.ventaboletos.service.FechamentoParamptovtaService;
|
||||
import com.rjconsultores.ventaboletos.service.FormaPagoService;
|
||||
|
@ -152,6 +154,7 @@ import com.rjconsultores.ventaboletos.web.utilerias.render.RenderParadaPtoVtaChe
|
|||
import com.rjconsultores.ventaboletos.web.utilerias.render.RenderPtoVtaSeguro;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.render.RenderPtovtaCatInd;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.render.RenderPtovtaComissao;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.spring.AppContext;
|
||||
import com.rjconsultores.ws.totvs.service.GeradorTitulosIntegracion;
|
||||
import com.rjconsultores.ws.totvs.service.GerenciadorEnvioTitulosWS;
|
||||
import com.rjconsultores.ws.utileria.RetornoTotvs.TipoRetorno;
|
||||
|
@ -1396,9 +1399,17 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
|||
cmbTipoConta.getValue();
|
||||
|
||||
if(!validarEmail()){
|
||||
Messagebox.show(Labels.getLabel("editarTipoPuntoVentaController.MSG.emailInvalido"),
|
||||
Labels.getLabel("editarPuntoVentaController.window.title"),
|
||||
Messagebox.OK, Messagebox.EXCLAMATION);
|
||||
|
||||
if(descCorreo.getText() == null || descCorreo.getText().trim().isEmpty()){
|
||||
Messagebox.show(Labels.getLabel("editarPuntoVentaController.MSG.emailObrigatorio"),
|
||||
Labels.getLabel("editarPuntoVentaController.window.title"),
|
||||
Messagebox.OK, Messagebox.EXCLAMATION);
|
||||
}else{
|
||||
Messagebox.show(Labels.getLabel("editarTipoPuntoVentaController.MSG.emailInvalido"),
|
||||
Labels.getLabel("editarPuntoVentaController.window.title"),
|
||||
Messagebox.OK, Messagebox.EXCLAMATION);
|
||||
}
|
||||
|
||||
descCorreo.focus();
|
||||
return;
|
||||
}
|
||||
|
@ -1738,16 +1749,28 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
|
|||
}
|
||||
|
||||
|
||||
private boolean validarEmail() {
|
||||
if(descCorreo.getText() == null){
|
||||
return true;
|
||||
private boolean validarEmail() throws InterruptedException {
|
||||
|
||||
ConstanteService constanteService = (ConstanteService) AppContext.getApplicationContext().getBean("constanteService");
|
||||
Constante constante = constanteService.buscarPorNomeConstante("TOTALBUS_EMAIL_OPCIONAL_PV");
|
||||
|
||||
if(constante == null || constante.getValorconstante().equals("1")){
|
||||
if(descCorreo.getText() == null || descCorreo.getText().isEmpty()){
|
||||
return false;
|
||||
}
|
||||
}else{
|
||||
if(descCorreo.getText() == null || descCorreo.getText().isEmpty()){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
for(String email : descCorreo.getText().split(";")){
|
||||
Matcher matcher = pattern.matcher(email);
|
||||
if(!matcher.matches()){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -703,6 +703,7 @@ editarTipoPuntoVentaController.MSG.suscribirOK = Canal de venta se registró exi
|
|||
editarTipoPuntoVentaController.MSG.borrarPergunta = Desea eliminar o canal de venta?
|
||||
editarTipoPuntoVentaController.MSG.borrarOK = Canal de venta se eliminó exitosamente
|
||||
editarTipoPuntoVentaController.MSG.emailInvalido = Email em formato inválido. Favor Verificar.
|
||||
editarPuntoVentaController.MSG.emailObrigatorio = Email obrigatório.
|
||||
lbEquivalencia.value = Equivalencia
|
||||
|
||||
# Muestra o formulario de Búsqueda Restricción de Pago
|
||||
|
|
|
@ -747,6 +747,7 @@ editarTipoPuntoVentaController.MSG.suscribirOK = Canal de Venda Registrado com S
|
|||
editarTipoPuntoVentaController.MSG.borrarPergunta = Deseja Eliminar o canal de Venda?
|
||||
editarTipoPuntoVentaController.MSG.borrarOK = Canal de Venda Excluido com Sucesso.
|
||||
editarTipoPuntoVentaController.MSG.emailInvalido = Email em formato inválido. Favor Verificar.
|
||||
editarPuntoVentaController.MSG.emailObrigatorio = Email obrigatório.
|
||||
lbEquivalencia.value = Equivalencia
|
||||
|
||||
# Muestra o formulario de Pesquisa Restrição de Pago
|
||||
|
|
|
@ -418,7 +418,7 @@
|
|||
<label
|
||||
value="${c:l('editarPuntoVentaController.lbDescCorreo.value')}" />
|
||||
<textbox id="descCorreo"
|
||||
constraint="no empty" width="70%" maxlength="60"
|
||||
width="70%" maxlength="60"
|
||||
value="@{winEditarPuntoVenta$composer.puntoVenta.descCorreo}"
|
||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyTextbox" />
|
||||
</row>
|
||||
|
|
Loading…
Reference in New Issue