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-87c2c4800839
master
rafael.henrique 2017-05-27 00:29:05 +00:00
parent be5be58e20
commit 6cabbea5a1
4 changed files with 32 additions and 7 deletions

View File

@ -72,6 +72,7 @@ import com.rjconsultores.ventaboletos.entidad.Categoria;
import com.rjconsultores.ventaboletos.entidad.CategoriaBloqueioImpPosterior; import com.rjconsultores.ventaboletos.entidad.CategoriaBloqueioImpPosterior;
import com.rjconsultores.ventaboletos.entidad.Ciudad; import com.rjconsultores.ventaboletos.entidad.Ciudad;
import com.rjconsultores.ventaboletos.entidad.Colonia; import com.rjconsultores.ventaboletos.entidad.Colonia;
import com.rjconsultores.ventaboletos.entidad.Constante;
import com.rjconsultores.ventaboletos.entidad.Empresa; import com.rjconsultores.ventaboletos.entidad.Empresa;
import com.rjconsultores.ventaboletos.entidad.EmpresaContaBancaria; import com.rjconsultores.ventaboletos.entidad.EmpresaContaBancaria;
import com.rjconsultores.ventaboletos.entidad.FechamentoParamptovta; 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.CategoriaBloqueioImpPosteriorService;
import com.rjconsultores.ventaboletos.service.CategoriaService; import com.rjconsultores.ventaboletos.service.CategoriaService;
import com.rjconsultores.ventaboletos.service.ColoniaService; import com.rjconsultores.ventaboletos.service.ColoniaService;
import com.rjconsultores.ventaboletos.service.ConstanteService;
import com.rjconsultores.ventaboletos.service.EmpresaService; import com.rjconsultores.ventaboletos.service.EmpresaService;
import com.rjconsultores.ventaboletos.service.FechamentoParamptovtaService; import com.rjconsultores.ventaboletos.service.FechamentoParamptovtaService;
import com.rjconsultores.ventaboletos.service.FormaPagoService; 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.RenderPtoVtaSeguro;
import com.rjconsultores.ventaboletos.web.utilerias.render.RenderPtovtaCatInd; import com.rjconsultores.ventaboletos.web.utilerias.render.RenderPtovtaCatInd;
import com.rjconsultores.ventaboletos.web.utilerias.render.RenderPtovtaComissao; 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.GeradorTitulosIntegracion;
import com.rjconsultores.ws.totvs.service.GerenciadorEnvioTitulosWS; import com.rjconsultores.ws.totvs.service.GerenciadorEnvioTitulosWS;
import com.rjconsultores.ws.utileria.RetornoTotvs.TipoRetorno; import com.rjconsultores.ws.utileria.RetornoTotvs.TipoRetorno;
@ -1396,9 +1399,17 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
cmbTipoConta.getValue(); cmbTipoConta.getValue();
if(!validarEmail()){ if(!validarEmail()){
Messagebox.show(Labels.getLabel("editarTipoPuntoVentaController.MSG.emailInvalido"),
Labels.getLabel("editarPuntoVentaController.window.title"), if(descCorreo.getText() == null || descCorreo.getText().trim().isEmpty()){
Messagebox.OK, Messagebox.EXCLAMATION); 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(); descCorreo.focus();
return; return;
} }
@ -1738,16 +1749,28 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
} }
private boolean validarEmail() { private boolean validarEmail() throws InterruptedException {
if(descCorreo.getText() == null){
return true; 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(";")){ for(String email : descCorreo.getText().split(";")){
Matcher matcher = pattern.matcher(email); Matcher matcher = pattern.matcher(email);
if(!matcher.matches()){ if(!matcher.matches()){
return false; return false;
} }
} }
return true; return true;
} }

View File

@ -703,6 +703,7 @@ editarTipoPuntoVentaController.MSG.suscribirOK = Canal de venta se registró exi
editarTipoPuntoVentaController.MSG.borrarPergunta = Desea eliminar o canal de venta? editarTipoPuntoVentaController.MSG.borrarPergunta = Desea eliminar o canal de venta?
editarTipoPuntoVentaController.MSG.borrarOK = Canal de venta se eliminó exitosamente editarTipoPuntoVentaController.MSG.borrarOK = Canal de venta se eliminó exitosamente
editarTipoPuntoVentaController.MSG.emailInvalido = Email em formato inválido. Favor Verificar. editarTipoPuntoVentaController.MSG.emailInvalido = Email em formato inválido. Favor Verificar.
editarPuntoVentaController.MSG.emailObrigatorio = Email obrigatório.
lbEquivalencia.value = Equivalencia lbEquivalencia.value = Equivalencia
# Muestra o formulario de Búsqueda Restricción de Pago # Muestra o formulario de Búsqueda Restricción de Pago

View File

@ -747,6 +747,7 @@ editarTipoPuntoVentaController.MSG.suscribirOK = Canal de Venda Registrado com S
editarTipoPuntoVentaController.MSG.borrarPergunta = Deseja Eliminar o canal de Venda? editarTipoPuntoVentaController.MSG.borrarPergunta = Deseja Eliminar o canal de Venda?
editarTipoPuntoVentaController.MSG.borrarOK = Canal de Venda Excluido com Sucesso. editarTipoPuntoVentaController.MSG.borrarOK = Canal de Venda Excluido com Sucesso.
editarTipoPuntoVentaController.MSG.emailInvalido = Email em formato inválido. Favor Verificar. editarTipoPuntoVentaController.MSG.emailInvalido = Email em formato inválido. Favor Verificar.
editarPuntoVentaController.MSG.emailObrigatorio = Email obrigatório.
lbEquivalencia.value = Equivalencia lbEquivalencia.value = Equivalencia
# Muestra o formulario de Pesquisa Restrição de Pago # Muestra o formulario de Pesquisa Restrição de Pago

View File

@ -418,7 +418,7 @@
<label <label
value="${c:l('editarPuntoVentaController.lbDescCorreo.value')}" /> value="${c:l('editarPuntoVentaController.lbDescCorreo.value')}" />
<textbox id="descCorreo" <textbox id="descCorreo"
constraint="no empty" width="70%" maxlength="60" width="70%" maxlength="60"
value="@{winEditarPuntoVenta$composer.puntoVenta.descCorreo}" value="@{winEditarPuntoVenta$composer.puntoVenta.descCorreo}"
use="com.rjconsultores.ventaboletos.web.utilerias.MyTextbox" /> use="com.rjconsultores.ventaboletos.web.utilerias.MyTextbox" />
</row> </row>