diff --git a/pom.xml b/pom.xml
index ff14d85d6..25b41cc19 100644
--- a/pom.xml
+++ b/pom.xml
@@ -4,7 +4,7 @@
4.0.0
br.com.rjconsultores
ventaboletosadm
- 1.0.43
+ 1.0.44
war
diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/EditarPuntoVentaController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/EditarPuntoVentaController.java
index 367135ca3..d4bfb6f21 100644
--- a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/EditarPuntoVentaController.java
+++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/EditarPuntoVentaController.java
@@ -34,6 +34,7 @@ import java.util.zip.ZipOutputStream;
import javax.activation.MimetypesFileTypeMap;
import javax.sql.DataSource;
+import javax.swing.text.MaskFormatter;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.Predicate;
@@ -200,6 +201,8 @@ import com.rjconsultores.wsag.GeradorTitulosAG;
//import com.rjconsultores.wsag.WSAGLog;
import com.rjconsultores.wsag.WSAGLog;
+import bsh.ParseException;
+
/**
*
* @author Rafius
@@ -657,6 +660,9 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
}
});
+
+
+
inserirItensLista(lsCategoriaBloquear);
getTxtTaxaConvenienciaPorc().setConstraint(getCt());
@@ -712,6 +718,30 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
abrirPtovtaComissao(ptovtaComissao);
}
});
+
+ numtelefonodos.addEventListener(Events.ON_CHANGE, new EventListener() {
+
+ @Override
+ public void onEvent(Event event) throws Exception {
+ numtelefonodos.setValue(mascaraTelefone(numtelefonodos.getValue()));
+ }
+ });
+
+ numtelefonouno.addEventListener(Events.ON_CHANGE, new EventListener() {
+ @Override
+ public void onEvent(Event event) throws Exception {
+ numtelefonouno.setValue(mascaraTelefone(numtelefonouno.getValue()));
+ }
+ });
+
+ txtNumFax.addEventListener(Events.ON_CHANGE, new EventListener() {
+
+ @Override
+ public void onEvent(Event event) throws Exception {
+ txtNumFax.setValue(mascaraTelefone(txtNumFax.getValue()));
+ }
+ });
+
try {
fechamentoParamptovtaList.setItemRenderer(new FechamentoParamptovtaListItemRenderer());
@@ -2080,29 +2110,32 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
puntoVenta.setDateFechamento(dateFechamento.getValue());
String getString = null;
-
+
puntoVenta.setNumfax(null);
if (!txtNumFax.getValue().equals("")) {
getString = this.replaceTextbox(txtNumFax);
- if (getString.length() >= 11) {
+ if (getString.indexOf("_") > 0) {
puntoVenta.setNumfax(txtNumFax.getValue().replace("_", ""));
- }
+ }else
+ puntoVenta.setNumfax(txtNumFax.getValue());
}
-
+
puntoVenta.setNumtelefonouno(null);
if (!numtelefonouno.getValue().equals("")) {
getString = this.replaceTextbox(numtelefonouno);
- if (getString.length() >= 11) {
+ if (getString.indexOf("_") > 0) {
puntoVenta.setNumtelefonouno(numtelefonouno.getValue().replace("_", ""));
- }
+ }else
+ puntoVenta.setNumtelefonouno(numtelefonouno.getValue());
}
-
+
puntoVenta.setNumtelefonodos(null);
if (!numtelefonodos.getValue().equals("")) {
getString = this.replaceTextbox(numtelefonodos);
- if (getString.length() >= 11) {
+ if (getString.indexOf("_") > 0) {
puntoVenta.setNumtelefonodos(numtelefonodos.getValue().replace("_", ""));
- }
+ }else
+ puntoVenta.setNumtelefonodos(numtelefonodos.getValue());
}
if (cmbBanco.getSelectedItem() == null) {
@@ -4744,6 +4777,21 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
this.tabEndereco = tabEndereco;
}
+ private String mascaraTelefone(String campo) {
+ campo = formatString(campo,"(###)####-####");
+ return campo;
+ }
+
+ private static String formatString(String value, String pattern) {
+ MaskFormatter mf;
+ try {
+ mf = new MaskFormatter(pattern);
+ mf.setValueContainsLiteralCharacters(false);
+ return mf.valueToString(value);
+ } catch (Exception e) {
+ return value;
+ }
+ }
}
\ No newline at end of file
diff --git a/web/gui/catalogos/editarPuntoVenta.zul b/web/gui/catalogos/editarPuntoVenta.zul
index 6fbda91da..7e9adce76 100644
--- a/web/gui/catalogos/editarPuntoVenta.zul
+++ b/web/gui/catalogos/editarPuntoVenta.zul
@@ -266,7 +266,7 @@
@@ -274,7 +274,7 @@