Large diffs are not rendered by default.

@@ -61,6 +61,7 @@ javadoc.windowtitle=
javafx.application.implementation.version=1.0
javafx.binarycss=false
javafx.classpath.extension=\
${java.home}/lib/jfxrt.jar:\
${java.home}/lib/javaws.jar:\
${java.home}/lib/deploy.jar:\
${java.home}/lib/plugin.jar
@@ -75,10 +75,7 @@
</Group>
</Group>
<Group type="103" groupAlignment="1" attributes="0">
<Group type="102" alignment="1" attributes="0">
<EmptySpace max="32767" attributes="0"/>
<Component id="jButton2" min="-2" pref="113" max="-2" attributes="0"/>
</Group>
<Component id="jButton2" alignment="1" min="-2" pref="113" max="-2" attributes="0"/>
<Group type="102" attributes="0">
<EmptySpace min="0" pref="37" max="32767" attributes="0"/>
<Group type="103" groupAlignment="1" attributes="0">
@@ -5,6 +5,7 @@
*/
package altel;

import com.sun.javafx.Utils;
import java.awt.event.KeyEvent;
import java.io.BufferedReader;
import java.io.IOException;
@@ -372,6 +373,8 @@ private void createUser(){
file.escribeFichero(txtUser.getText(),"Sesion/archivoUser.txt");
file.escribeFichero(txtId.getText(),"Sesion/archivoId.txt");
file.escribeFichero(txtNew.getText(),"Sesion/archivoPassword.txt");
// long serialNumber = Utils.getRandomLong(1, 999999999999999L);
// String serial_default = padleft(String.valueOf(serialNumber), 15, '0');
this.setVisible(false);
JOptionPane.showMessageDialog(null,"Ha ingresado los datos correctamente", "Éxito!", JOptionPane.INFORMATION_MESSAGE );

@@ -472,6 +475,22 @@ public void run() {
}
});
}

public static String padleft(String s, int len, char c){
s = s.trim();

if (s.length() <= len){
StringBuffer d = new StringBuffer(len);
int fill = len - s.length();
while (fill--> 0)
d.append(c);

d.append(s);
return d.toString();
} else
return s;

}

// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton jButton1;
@@ -28,12 +28,15 @@
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jPanel2" min="-2" max="-2" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
<Component id="jPanel2" max="32767" attributes="0"/>
<EmptySpace min="-2" pref="12" max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jPanel2" alignment="0" max="32767" attributes="0"/>
<Component id="jPanel2" alignment="1" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
</Layout>
@@ -50,61 +53,59 @@
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="102" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="107" max="-2" attributes="0"/>
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="103" alignment="0" groupAlignment="1" max="-2" attributes="0">
<Group type="102" alignment="1" attributes="0">
<Component id="jButton1" min="-2" pref="127" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
<Component id="jButton2" min="-2" pref="127" max="-2" attributes="0"/>
</Group>
<Group type="103" alignment="1" groupAlignment="0" attributes="0">
<Group type="102" alignment="1" attributes="0">
<Component id="jLabel5" min="-2" pref="80" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="190" max="-2" attributes="0"/>
<Component id="txtTotal" min="-2" pref="217" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="27" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" max="-2" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Component id="jLabel2" min="-2" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
<Component id="txtRecargas" min="-2" pref="147" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<Component id="jLabel6" min="-2" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
<Component id="txtFinal" min="-2" pref="147" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jLabel3" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="jLabel4" alignment="0" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="107" max="-2" attributes="0"/>
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="103" alignment="0" groupAlignment="1" max="-2" attributes="0">
<Group type="102" alignment="1" attributes="0">
<Component id="jButton1" min="-2" pref="127" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
<Component id="jButton2" min="-2" pref="127" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="27" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Component id="jLabel2" min="-2" max="-2" attributes="0"/>
<EmptySpace pref="80" max="32767" attributes="0"/>
<Component id="txtRecargas" min="-2" pref="147" max="-2" attributes="0"/>
</Group>
<EmptySpace min="-2" pref="147" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="txtPines" min="-2" pref="147" max="-2" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
<Component id="jLabel6" min="-2" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
<Component id="txtFinal" min="-2" pref="147" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<Component id="jLabel4" min="-2" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
<Component id="txtServicios" min="-2" pref="147" max="-2" attributes="0"/>
</Group>
</Group>
</Group>
</Group>
</Group>
</Group>
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="25" max="-2" attributes="0"/>
<Component id="jPanel1" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="25" max="-2" attributes="0"/>
<Component id="jPanel1" min="-2" max="-2" attributes="0"/>
<Group type="102" alignment="1" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="jLabel5" min="-2" pref="80" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
<Component id="txtTotal" min="-2" pref="217" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
@@ -115,7 +116,7 @@
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="jPanel1" min="-2" max="-2" attributes="0"/>
<EmptySpace pref="47" max="32767" attributes="0"/>
<EmptySpace pref="41" max="32767" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel6" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="txtFinal" alignment="3" min="-2" max="-2" attributes="0"/>
@@ -125,41 +126,27 @@
<Component id="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="txtRecargas" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="-2" pref="24" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel3" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="txtPines" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="-2" pref="26" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="34" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel4" alignment="3" min="-2" pref="37" max="-2" attributes="0"/>
<Component id="txtServicios" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="-2" pref="47" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel5" alignment="3" min="-2" pref="46" max="-2" attributes="0"/>
<Component id="txtTotal" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel5" alignment="3" min="-2" pref="46" max="-2" attributes="0"/>
</Group>
<EmptySpace type="separate" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="30" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jButton1" alignment="3" min="-2" pref="45" max="-2" attributes="0"/>
<Component id="jButton2" alignment="3" min="-2" pref="45" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<EmptySpace min="-2" pref="57" max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JTextField" name="txtPines">
<Properties>
<Property name="editable" type="boolean" value="false"/>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Tahoma" size="24" style="0"/>
</Property>
<Property name="horizontalAlignment" type="int" value="4"/>
</Properties>
</Component>
<Component class="javax.swing.JTextField" name="txtRecargas">
<Properties>
<Property name="editable" type="boolean" value="false"/>
@@ -177,14 +164,6 @@
<Property name="text" type="java.lang.String" value="Serv. P&#xfa;blicos:"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel3">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Tahoma" size="24" style="0"/>
</Property>
<Property name="text" type="java.lang.String" value="Venta de Pines:"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel2">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">

Large diffs are not rendered by default.

@@ -168,7 +168,7 @@ public void recargaTiempoAire(String monto,String operador,String producto,Strin
mac = "02-50-F2-CE-82-01";
}
String recarga = operador + ","+producto+","+celular+","+usuario+","+dispersion(usuario,clave)+","+tienda;
String extraInfo = "PC"+"|"+ip+"|"+mac+"|NA|Hardware id client"+System.getProperty("os.name").toLowerCase()+"|NA";
String extraInfo = "PC"+"|"+ip+"|"+mac+"|NA|Hardware id client "+System.getProperty("os.name").toLowerCase()+"|NA";
map = new HashMap<String, String>();
map.put("0","0200");
map.put("3",proceso);
@@ -206,7 +206,7 @@ public void consultaServiciosPublicos(String empresa,String numeroReferencia,Str
datos += ","+zonaSoloCabletica+","+tipoSoloCabletica;
}
datos += ",NA,NA,NA,NA";
String extraInfo = "PC"+"|"+InetAddress.getLocalHost()+"|"+ni.getHardwareAddress()+"|NA|Hardware id client "+System.getProperty("os.name").toLowerCase()+"|NA";
String extraInfo = "PC"+"|"+InetAddress.getLocalHost()+"|"+ni.getHardwareAddress()+"|NA||"+System.getProperty("os.name").toLowerCase()+"|NA";
map = new HashMap<String, String>();
map.put("0","0100");
map.put("3","000004");
@@ -322,12 +322,18 @@ private String getHora() {

private String getFecha() {
Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("GMT"));
return addCero(Integer.toString(cal.get(Calendar.MONTH))+1,2) + addCero(Integer.toString(cal.get(Calendar.DAY_OF_MONTH)-1),2) + Integer.toString(cal.get(Calendar.YEAR));
return addCero(Integer.toString(cal.get(Calendar.MONTH)+1),2) + addCero(Integer.toString(cal.get(Calendar.DAY_OF_MONTH)),2) + Integer.toString(cal.get(Calendar.YEAR));
}

private String getReferencia() {
auth file = new auth();
String secuencia = file.leerArchivo("Sesion\\archivoReferencia.txt");
String secuencia = "";
if(Static.isWindows()){
secuencia = file.leerArchivo("Sesion\\archivoReferencia.txt");
}
else {
secuencia = file.leerArchivo("Sesion/archivoReferencia.txt");
}

long sec = Long.parseLong(secuencia) + 1;
long max = Long.parseLong("999999999999");
@@ -454,4 +460,8 @@ public void pupulateServiciosMap() {
Logger.getLogger(Message.class.getName()).log(Level.SEVERE, null, ex);
}
}

// public String getHardwareId(){
//
// }
}
@@ -55,7 +55,7 @@ public int print(Graphics g, PageFormat pf, int page) throws
*/
Graphics2D g2d = (Graphics2D)g;
g2d.translate(pf.getImageableX(), pf.getImageableY());
int place=30;
int place=50;
/* Now we perform our rendering */
if(!caja){
BufferedReader br;
@@ -88,14 +88,22 @@ public int print(Graphics g, PageFormat pf, int page) throws
int cuenta=0;
String tipo="";
try {
g.drawString("Alternativas de Telecomunicaciones",0, 30);
if(tipo.equals("Recargas")){
g.drawString("Recarga automática (Tiempo Aire)",0, place);
}
if(tipo.equals("Servicios")){
g.drawString("Servicios Públicos",0, place);

}
while((line = br.readLine()) != null) {
if(cuenta==0)g.drawString("Punto de venta: "+line, 0, place);
if(cuenta==1)g.drawString("Fecha: "+line, 0, place);
if(cuenta==2)g.drawString("Hora: "+line, 0, place);
if(cuenta==3){tipo=line;place-=20;}
switch (tipo) {
case "Recargas":
if(cuenta==4)g.drawString("Recarga automática (Tiempo Aire) Teléfono: "+line, 0, place);
if(cuenta==4)g.drawString("Teléfono: "+line, 0, place);
if(cuenta==5)g.drawString("Transacción: "+line, 0, place);
if(cuenta==6)g.drawString("Monto: "+line, 0, place);
break;
@@ -174,14 +182,15 @@ public String loadFileToArea(Boolean selected, int cual){
int cuenta=0;
String tipo="";
try {
reporte+="Alternativas de Telecomunicaciones \n";
while((line = br.readLine()) != null) {
if(cuenta==0)reporte+="Punto de venta: "+line+"\n";
if(cuenta==1)reporte+="Fecha: "+line+"\n";
if(cuenta==2)reporte+="Hora: "+line+"\n";
if(cuenta==3)tipo=line;
switch (tipo) {
case "Recargas":
if(cuenta==4)reporte+="Recarga automática (Tiempo Aire) Teléfono: "+line+"\n";
if(cuenta==4)reporte+="Recarga automática (Tiempo Aire) \n Teléfono: "+line+"\n";
if(cuenta==5)reporte+="Transacción: "+line+", ";
if(cuenta==6)reporte+="Monto: "+line+"\n";
break;
@@ -193,7 +202,7 @@ public String loadFileToArea(Boolean selected, int cual){
break;

case "Servicios":
if(cuenta==4)reporte+="Identificador: "+line+"\n";
if(cuenta==4)reporte+="Servicios Públicos \n Identificador: "+line+"\n";
if(cuenta==5)reporte+="Servicio: "+line+"\n";
if(cuenta==6)reporte+="Monto: "+line+"\n";
break;
@@ -34,7 +34,7 @@
*/
public class Utilities {
String host = "190.26.241.209";
int port = 7001;
int port = 7011;
//int port = 7009;
Socket socket = null;

@@ -48,7 +48,7 @@ public Utilities() throws Exception{
socket = new Socket(host, port);
}

public Map<String, String> SendToServerNoSsl(String msg) throws Exception{
public Map<String, String> SendToServerNoSSL(String msg) throws Exception{
//create output stream attached to socket
String serverName = host;
Map<String, String> result = new HashMap<String, String>();
@@ -114,7 +114,7 @@ public boolean verify(String hostname, SSLSession session) {
HttpsURLConnection.setDefaultHostnameVerifier(allHostsValid);
}

public Map<String, String> SendToServerSSL(String msg) throws Exception{
public Map<String, String> SendToServerBad(String msg) throws Exception{
//disableCertificateValidation();
Map<String, String> result = new HashMap<>();
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
@@ -182,7 +182,7 @@ public Map<String, String> SendToServer(String msg) {
try {

org.com.ssl.MySSLSocketFactory sslsocketfactory = (org.com.ssl.MySSLSocketFactory) getSunJSSESocketFactory();
SSLSocket sslsocket = (SSLSocket) sslsocketfactory.createSocket("190.26.241.209", 7009);
SSLSocket sslsocket = (SSLSocket) sslsocketfactory.createSocket("66.165.180.245", 7014);
//SSLSocket sslsocket = (SSLSocket) sslsocketfactory.createSocket("66.165.180.245", 447);
sslsocket.setSoLinger(true, 0);
sslsocket.setSoTimeout(60000);
@@ -40,7 +40,7 @@ public httpCall() {
public JSONObject call(String type) throws IOException{
String content = "";
try {
URL data = new URL("http://66.165.180.245:8029/"+type+".json");
URL data = new URL("http://66.165.180.245:8028/"+type+".json");

URLConnection dataConnection = data.openConnection();