package reparto_medicomed.keymon.lat;


import anywheresoftware.b4a.BA;
import anywheresoftware.b4a.B4AClass;
import anywheresoftware.b4a.BALayout;
import anywheresoftware.b4a.debug.*;

public class c_cliente extends B4AClass.ImplB4AClass implements BA.SubDelegator{
    private static java.util.HashMap<String, java.lang.reflect.Method> htSubs;
    private void innerInitialize(BA _ba) throws Exception {
        if (ba == null) {
            ba = new BA(_ba, this, htSubs, "reparto_medicomed.keymon.lat.c_cliente");
            if (htSubs == null) {
                ba.loadHtSubs(this.getClass());
                htSubs = ba.htSubs;
            }
            
        }
        if (BA.isShellModeRuntimeCheck(ba)) 
			   this.getClass().getMethod("_class_globals", reparto_medicomed.keymon.lat.c_cliente.class).invoke(this, new Object[] {null});
        else
            ba.raiseEvent2(null, true, "class_globals", false);
    }

 public anywheresoftware.b4a.keywords.Common __c = null;
public anywheresoftware.b4a.objects.B4XViewWrapper _root = null;
public anywheresoftware.b4a.objects.B4XViewWrapper.XUI _xui = null;
public anywheresoftware.b4a.gps.GPS _g = null;
public String _clie_id = "";
public String _sdate = "";
public String _stime = "";
public String _usuario = "";
public String _cuenta = "";
public anywheresoftware.b4a.objects.Serial.BluetoothAdmin _btadmin = null;
public anywheresoftware.b4a.objects.Serial _cmp20 = null;
public anywheresoftware.b4a.objects.streams.File.TextWriterWrapper _printer = null;
public anywheresoftware.b4a.objects.collections.Map _paireddevices = null;
public anywheresoftware.b4a.objects.collections.List _l = null;
public int _tamano = 0;
public int _espacio = 0;
public String _blanco = "";
public boolean _impresoraconectada = false;
public String _longitud = "";
public String _latitud = "";
public String _nombre = "";
public anywheresoftware.b4a.sql.SQL.CursorWrapper _c = null;
public anywheresoftware.b4a.sql.SQL.CursorWrapper _s = null;
public anywheresoftware.b4a.objects.ListViewWrapper _listview1 = null;
public anywheresoftware.b4a.objects.LabelWrapper _la_cuenta = null;
public anywheresoftware.b4a.objects.LabelWrapper _la_nombre = null;
public anywheresoftware.b4a.objects.LabelWrapper _la_calle = null;
public anywheresoftware.b4a.objects.LabelWrapper _la_numero = null;
public anywheresoftware.b4a.objects.LabelWrapper _la_nint = null;
public anywheresoftware.b4a.objects.LabelWrapper _la_edo = null;
public anywheresoftware.b4a.objects.LabelWrapper _la_pob = null;
public anywheresoftware.b4a.objects.LabelWrapper _la_col = null;
public anywheresoftware.b4a.objects.LabelWrapper _la_cp = null;
public anywheresoftware.b4a.objects.LabelWrapper _la_zona = null;
public anywheresoftware.b4a.objects.ButtonWrapper _gest = null;
public anywheresoftware.b4a.objects.LabelWrapper _la_saldotot = null;
public anywheresoftware.b4a.objects.LabelWrapper _la_saldooper = null;
public reparto_medicomed.keymon.lat.dbrequestmanager _reqmanager = null;
public anywheresoftware.b4a.objects.ButtonWrapper _b_noentrega = null;
public anywheresoftware.b4a.objects.LabelWrapper _label10 = null;
public anywheresoftware.b4a.objects.LabelWrapper _label11 = null;
public anywheresoftware.b4a.sql.SQL.CursorWrapper _d = null;
public anywheresoftware.b4a.objects.ButtonWrapper _tar = null;
public anywheresoftware.b4a.objects.LabelWrapper _l_qr = null;
public anywheresoftware.b4a.objects.ButtonWrapper _bt_qr = null;
public reparto_medicomed.keymon.lat.escposprinter _printer1 = null;
public anywheresoftware.b4a.objects.LabelWrapper _la_comm = null;
public anywheresoftware.b4a.objects.LabelWrapper _la_actdte = null;
public anywheresoftware.b4a.objects.LabelWrapper _la_usuario = null;
public anywheresoftware.b4a.objects.LabelWrapper _la_resultado = null;
public anywheresoftware.b4a.objects.LabelWrapper _l_entre1 = null;
public anywheresoftware.b4a.objects.LabelWrapper _l_entre2 = null;
public anywheresoftware.b4a.objects.LabelWrapper _l_atiende = null;
public anywheresoftware.b4a.objects.LabelWrapper _l_atiende2 = null;
public anywheresoftware.b4a.objects.ButtonWrapper _datos = null;
public anywheresoftware.b4a.objects.ButtonWrapper _guardar = null;
public anywheresoftware.b4a.objects.ButtonWrapper _nuevo = null;
public anywheresoftware.b4a.objects.LabelWrapper _l_total = null;
public anywheresoftware.b4a.objects.ButtonWrapper _hist = null;
public String _pasa_imp = "";
public anywheresoftware.b4a.objects.ButtonWrapper _b_imp = null;
public String _total_cliente = "";
public String _credito = "";
public anywheresoftware.b4a.objects.PanelWrapper _p_principal = null;
public anywheresoftware.b4a.objects.ButtonWrapper _b_paso2 = null;
public anywheresoftware.b4a.objects.LabelWrapper _l_cant = null;
public int _errorimpresora = 0;
public int _banderaimp = 0;
public anywheresoftware.b4a.objects.LabelWrapper _l_credi = null;
public anywheresoftware.b4a.objects.LabelWrapper _l_pagare = null;
public anywheresoftware.b4a.objects.LabelWrapper _l_montopag = null;
public anywheresoftware.b4a.objects.LabelWrapper _l_efectivo = null;
public anywheresoftware.b4a.objects.LabelWrapper _l_montoefec = null;
public long _distance = 0L;
public b4a.example.dateutils _dateutils = null;
public reparto_medicomed.keymon.lat.main _main = null;
public reparto_medicomed.keymon.lat.appupdater _appupdater = null;
public reparto_medicomed.keymon.lat.foto _foto = null;
public reparto_medicomed.keymon.lat.mapa_cliente _mapa_cliente = null;
public reparto_medicomed.keymon.lat.mapa_rutas _mapa_rutas = null;
public reparto_medicomed.keymon.lat.starter _starter = null;
public reparto_medicomed.keymon.lat.subs _subs = null;
public reparto_medicomed.keymon.lat.tracker _tracker = null;
public reparto_medicomed.keymon.lat.newinst2 _newinst2 = null;
public reparto_medicomed.keymon.lat.b4xpages _b4xpages = null;
public reparto_medicomed.keymon.lat.b4xcollections _b4xcollections = null;
public reparto_medicomed.keymon.lat.httputils2service _httputils2service = null;
public reparto_medicomed.keymon.lat.xuiviewsutils _xuiviewsutils = null;
public String  _activity_pause(boolean _userclosed) throws Exception{
 //BA.debugLineNum = 313;BA.debugLine="Sub Activity_Pause (UserClosed As Boolean)";
 //BA.debugLineNum = 315;BA.debugLine="End Sub";
return "";
}
public String  _b_imp_click() throws Exception{
 //BA.debugLineNum = 469;BA.debugLine="Sub B_IMP_Click";
 //BA.debugLineNum = 883;BA.debugLine="Guardado";
_guardado();
 //BA.debugLineNum = 884;BA.debugLine="End Sub";
return "";
}
public String  _b_noentrega_click() throws Exception{
 //BA.debugLineNum = 426;BA.debugLine="Sub b_noEntrega_Click";
 //BA.debugLineNum = 428;BA.debugLine="B4XPages.ShowPage(\"noVenta\")";
_b4xpages._showpage /*String*/ (ba,"noVenta");
 //BA.debugLineNum = 429;BA.debugLine="End Sub";
return "";
}
public String  _b_paso2_click() throws Exception{
anywheresoftware.b4a.sql.SQL.CursorWrapper _mandamapa = null;
 //BA.debugLineNum = 958;BA.debugLine="Sub B_PASO2_Click";
 //BA.debugLineNum = 959;BA.debugLine="DateTime.DateFormat = \"MM/dd/yyyy\"";
__c.DateTime.setDateFormat("MM/dd/yyyy");
 //BA.debugLineNum = 960;BA.debugLine="sDate=DateTime.Date(DateTime.Now)";
_sdate = __c.DateTime.Date(__c.DateTime.getNow());
 //BA.debugLineNum = 961;BA.debugLine="sTime=DateTime.Time(DateTime.Now)";
_stime = __c.DateTime.Time(__c.DateTime.getNow());
 //BA.debugLineNum = 962;BA.debugLine="c=Starter.skmt.ExecQuery(\"select CUENTA from cuen";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select CUENTA from cuentaa")));
 //BA.debugLineNum = 963;BA.debugLine="c.Position = 0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 964;BA.debugLine="cuenta = c.GetString(\"CUENTA\")";
_cuenta = _c.GetString("CUENTA");
 //BA.debugLineNum = 965;BA.debugLine="c=Starter.skmt.ExecQuery(\"select usuario from usu";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select usuario from usuarioa")));
 //BA.debugLineNum = 966;BA.debugLine="c.Position = 0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 967;BA.debugLine="usuario = c.GetString(\"USUARIO\")";
_usuario = _c.GetString("USUARIO");
 //BA.debugLineNum = 968;BA.debugLine="c.Close";
_c.Close();
 //BA.debugLineNum = 969;BA.debugLine="Starter.skmt.ExecNonQuery(\"DELETE FROM NOVENTA WH";
_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("DELETE FROM NOVENTA WHERE NV_CLIENTE IN (select cuenta from cuentaa)");
 //BA.debugLineNum = 970;BA.debugLine="Starter.skmt.ExecNonQuery2(\"INSERT INTO  NOVENTA";
_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("INSERT INTO  NOVENTA (NV_CLIENTE,NV_FECHA,NV_USER,NV_MOTIVO,NV_COMM,NV_LAT,NV_LON) VALUES(?,?,?,?,?,?,?) ",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(_cuenta),(Object)(_sdate+_stime),(Object)(_usuario),(Object)("PASO"),(Object)("PASO ESPERA"),(Object)(_b4xpages._mainpage /*reparto_medicomed.keymon.lat.b4xmainpage*/ (ba)._lat_gps /*String*/ ),(Object)(_b4xpages._mainpage /*reparto_medicomed.keymon.lat.b4xmainpage*/ (ba)._lon_gps /*String*/ )}));
 //BA.debugLineNum = 972;BA.debugLine="Dim mandamapa As Cursor = Starter.skmt.ExecQuery(";
_mandamapa = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_mandamapa = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("SELECT * FROM kmt_info WHERE gestion = 0")));
 //BA.debugLineNum = 973;BA.debugLine="If mandamapa.RowCount = 0 Then";
if (_mandamapa.getRowCount()==0) { 
 //BA.debugLineNum = 974;BA.debugLine="B4XPages.ShowPage(\"Principal\")";
_b4xpages._showpage /*String*/ (ba,"Principal");
 }else if(_mandamapa.getRowCount()>0) { 
 //BA.debugLineNum = 976;BA.debugLine="B4XPages.ShowPage(\"Principal\")";
_b4xpages._showpage /*String*/ (ba,"Principal");
 };
 //BA.debugLineNum = 978;BA.debugLine="End Sub";
return "";
}
public String  _b4xpage_appear() throws Exception{
anywheresoftware.b4a.objects.collections.Map _cym = null;
anywheresoftware.b4a.sql.SQL.CursorWrapper _vc = null;
String _cuenta0 = "";
String _arti = "";
int _i = 0;
anywheresoftware.b4a.sql.SQL.CursorWrapper _vc2 = null;
String _cuenta1 = "";
String _arti1 = "";
float _preu = 0f;
anywheresoftware.b4a.sql.SQL.CursorWrapper _vc3 = null;
anywheresoftware.b4a.sql.SQL.CursorWrapper _vc4 = null;
String _cuenta2 = "";
String _arti2 = "";
anywheresoftware.b4a.sql.SQL.CursorWrapper _vc5 = null;
anywheresoftware.b4a.sql.SQL.CursorWrapper _c4 = null;
String _cuenta3 = "";
String _arti3 = "";
anywheresoftware.b4a.sql.SQL.CursorWrapper _pag = null;
float _pagaremonto = 0f;
float _pagaremonto2 = 0f;
 //BA.debugLineNum = 121;BA.debugLine="Sub B4XPage_Appear";
 //BA.debugLineNum = 122;BA.debugLine="banderaimp = 0";
_banderaimp = (int) (0);
 //BA.debugLineNum = 123;BA.debugLine="Subs.centraPanel(p_principal, Root.Width)";
_subs._centrapanel /*String*/ (ba,_p_principal,_root.getWidth());
 //BA.debugLineNum = 124;BA.debugLine="Starter.skmt.Initialize(Starter.ruta,\"kmt.db\", Tr";
_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .Initialize(_starter._ruta /*String*/ ,"kmt.db",__c.True);
 //BA.debugLineNum = 125;BA.debugLine="reqManager.Initialize(Me, B4XPages.MainPage.SERVE";
_reqmanager._initialize /*String*/ (ba,this,_b4xpages._mainpage /*reparto_medicomed.keymon.lat.b4xmainpage*/ (ba)._server /*String*/ );
 //BA.debugLineNum = 126;BA.debugLine="Tar.Visible = False";
_tar.setVisible(__c.False);
 //BA.debugLineNum = 127;BA.debugLine="gest.Visible = False";
_gest.setVisible(__c.False);
 //BA.debugLineNum = 128;BA.debugLine="b_noEntrega.Visible = False";
_b_noentrega.setVisible(__c.False);
 //BA.debugLineNum = 129;BA.debugLine="HIST.Visible = False";
_hist.setVisible(__c.False);
 //BA.debugLineNum = 130;BA.debugLine="c=Starter.skmt.ExecQuery(\"select CAT_CL_CODIGO,CA";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select CAT_CL_CODIGO,CAT_CL_RUTA,CAT_CL_NOMBRE,CAT_CL_ATIENDE1,CAT_CL_ATIENTE2,CAT_CL_TELEFONO,CAT_CL_EMAIL,CAT_CL_CALLE,CAT_CL_NOEXT,CAT_CL_NOINT,CAT_CL_CALLE1,CAT_CL_CALLE2,CAT_CL_COLONIA,CAT_CL_MUNI,CAT_CL_EDO,CAT_CL_CP,CAT_CL_LONG,CAT_CL_LAT, CAT_CL_BCREDITO  from kmt_info where CAT_CL_CODIGO In (Select cuenta from cuentaa)")));
 //BA.debugLineNum = 131;BA.debugLine="s=Starter.skmt.ExecQuery(\"select sum(pe_costo_tot";
_s = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select sum(pe_costo_tot) as TOTAL_CLIE, SUM(PE_CANT) AS CANT_CLIE FROM PEDIDO WHERE PE_CLIENTE IN (Select CUENTA from cuentaa)")));
 //BA.debugLineNum = 132;BA.debugLine="s.Position=0";
_s.setPosition((int) (0));
 //BA.debugLineNum = 133;BA.debugLine="c.Position=0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 134;BA.debugLine="la_cuenta.Text = c.GetString(\"CAT_CL_CODIGO\")";
_la_cuenta.setText(BA.ObjectToCharSequence(_c.GetString("CAT_CL_CODIGO")));
 //BA.debugLineNum = 135;BA.debugLine="La_nombre.Text = c.GetString(\"CAT_CL_NOMBRE\")";
_la_nombre.setText(BA.ObjectToCharSequence(_c.GetString("CAT_CL_NOMBRE")));
 //BA.debugLineNum = 136;BA.debugLine="NOMBRE = c.GetString(\"CAT_CL_NOMBRE\")";
_nombre = _c.GetString("CAT_CL_NOMBRE");
 //BA.debugLineNum = 137;BA.debugLine="LONGITUD = c.GetString(\"CAT_CL_LONG\")";
_longitud = _c.GetString("CAT_CL_LONG");
 //BA.debugLineNum = 138;BA.debugLine="LATITUD = c.GetString(\"CAT_CL_LAT\")";
_latitud = _c.GetString("CAT_CL_LAT");
 //BA.debugLineNum = 139;BA.debugLine="la_Calle.Text = c.GetString(\"CAT_CL_CALLE\") & c.G";
_la_calle.setText(BA.ObjectToCharSequence(_c.GetString("CAT_CL_CALLE")+_c.GetString("CAT_CL_NOEXT")));
 //BA.debugLineNum = 140;BA.debugLine="la_col.Text = c.GetString(\"CAT_CL_COLONIA\")";
_la_col.setText(BA.ObjectToCharSequence(_c.GetString("CAT_CL_COLONIA")));
 //BA.debugLineNum = 141;BA.debugLine="la_edo.Text = c.GetString(\"CAT_CL_EDO\")";
_la_edo.setText(BA.ObjectToCharSequence(_c.GetString("CAT_CL_EDO")));
 //BA.debugLineNum = 142;BA.debugLine="la_cp.Text = c.GetString(\"CAT_CL_CP\")";
_la_cp.setText(BA.ObjectToCharSequence(_c.GetString("CAT_CL_CP")));
 //BA.debugLineNum = 143;BA.debugLine="l_entre1.Text = c.GetString(\"CAT_CL_CALLE1\")";
_l_entre1.setText(BA.ObjectToCharSequence(_c.GetString("CAT_CL_CALLE1")));
 //BA.debugLineNum = 144;BA.debugLine="l_entre2.Text = c.GetString(\"CAT_CL_CALLE2\")";
_l_entre2.setText(BA.ObjectToCharSequence(_c.GetString("CAT_CL_CALLE2")));
 //BA.debugLineNum = 145;BA.debugLine="If c.GetString(\"CAT_CL_ATIENDE1\") <> Null And c.G";
if (_c.GetString("CAT_CL_ATIENDE1")!= null && (_c.GetString("CAT_CL_ATIENDE1")).equals("null") == false) { 
 //BA.debugLineNum = 146;BA.debugLine="l_atiende.Text = c.GetString(\"CAT_CL_ATIENDE1\")";
_l_atiende.setText(BA.ObjectToCharSequence(_c.GetString("CAT_CL_ATIENDE1")));
 }else {
 //BA.debugLineNum = 148;BA.debugLine="l_atiende.Text = \" \"";
_l_atiende.setText(BA.ObjectToCharSequence(" "));
 };
 //BA.debugLineNum = 150;BA.debugLine="If c.GetString(\"CAT_CL_ATIENTE2\") <> Null And c.G";
if (_c.GetString("CAT_CL_ATIENTE2")!= null && (_c.GetString("CAT_CL_ATIENTE2")).equals("NULL") == false) { 
 //BA.debugLineNum = 151;BA.debugLine="l_atiende2.Text = c.GetString(\"CAT_CL_ATIENTE2\")";
_l_atiende2.setText(BA.ObjectToCharSequence(_c.GetString("CAT_CL_ATIENTE2")));
 }else {
 //BA.debugLineNum = 153;BA.debugLine="l_atiende2.Text = \" \"";
_l_atiende2.setText(BA.ObjectToCharSequence(" "));
 };
 //BA.debugLineNum = 155;BA.debugLine="la_saldotot.Text = c.GetString(\"CAT_CL_TELEFONO\")";
_la_saldotot.setText(BA.ObjectToCharSequence(_c.GetString("CAT_CL_TELEFONO")));
 //BA.debugLineNum = 156;BA.debugLine="la_saldooper.Text = c.GetString(\"CAT_CL_EMAIL\")";
_la_saldooper.setText(BA.ObjectToCharSequence(_c.GetString("CAT_CL_EMAIL")));
 //BA.debugLineNum = 158;BA.debugLine="CREDITO = C.GetString(\"CAT_CL_BCREDITO\")";
_credito = _c.GetString("CAT_CL_BCREDITO");
 //BA.debugLineNum = 161;BA.debugLine="Private cym As Map = Subs.traeCantYMonto2(Subs.tr";
_cym = new anywheresoftware.b4a.objects.collections.Map();
_cym = _subs._traecantymonto2 /*anywheresoftware.b4a.objects.collections.Map*/ (ba,_subs._traecliente /*String*/ (ba));
 //BA.debugLineNum = 162;BA.debugLine="L_CANT.Text = cym.Get(\"cantidad\")";
_l_cant.setText(BA.ObjectToCharSequence(_cym.Get((Object)("cantidad"))));
 //BA.debugLineNum = 163;BA.debugLine="l_total.Text = Round2(cym.Get(\"monto\"), 2)";
_l_total.setText(BA.ObjectToCharSequence(__c.Round2((double)(BA.ObjectToNumber(_cym.Get((Object)("monto")))),(int) (2))));
 //BA.debugLineNum = 171;BA.debugLine="Starter.skmt.ExecNonQuery(\"UPDATE HIST_VENTAS set";
_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("UPDATE HIST_VENTAS set ESPROMO = 1  where HVD_CODPROMO = HVD_PROID AND HVD_CLIENTE IN (SELECT CUENTA FROM CUENTAA)");
 //BA.debugLineNum = 172;BA.debugLine="Private vc As Cursor = Starter.skmt.ExecQuery($\"s";
_vc = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_vc = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery(("select HVD_PROID,HVD_COSTO_TOT, HVD_CANT, IFNULL(HVD_RECHAZOCANT, 0) AS HVD_RECHAZOCANT from HIST_VENTAS where BCAJAS = 0 and HVD_CODPROMO ='"+__c.SmartStringFormatter("",(Object)(_subs._traealmacen /*String*/ (ba)))+"' and HVD_CLIENTE in (select cuenta from cuentaa)"))));
 //BA.debugLineNum = 174;BA.debugLine="Private cuenta0 As String = 0";
_cuenta0 = BA.NumberToString(0);
 //BA.debugLineNum = 175;BA.debugLine="Private arti As String = 0";
_arti = BA.NumberToString(0);
 //BA.debugLineNum = 176;BA.debugLine="If vc.RowCount > 0 Then";
if (_vc.getRowCount()>0) { 
 //BA.debugLineNum = 177;BA.debugLine="For i = 0 To vc.RowCount - 1";
{
final int step45 = 1;
final int limit45 = (int) (_vc.getRowCount()-1);
_i = (int) (0) ;
for (;_i <= limit45 ;_i = _i + step45 ) {
 //BA.debugLineNum = 178;BA.debugLine="vc.Position = i";
_vc.setPosition(_i);
 //BA.debugLineNum = 181;BA.debugLine="cuenta0 = cuenta0 + ((vc.GetString(\"HVD_CANT\")";
_cuenta0 = BA.NumberToString((double)(Double.parseDouble(_cuenta0))+(((double)(Double.parseDouble(_vc.GetString("HVD_CANT")))-(double)(Double.parseDouble(_vc.GetString("HVD_RECHAZOCANT"))))*((double)(Double.parseDouble(_vc.GetString("HVD_COSTO_TOT")))/(double)(double)(Double.parseDouble(_vc.GetString("HVD_CANT"))))));
 //BA.debugLineNum = 186;BA.debugLine="arti = arti + (vc.GetString(\"HVD_CANT\") - vc.Ge";
_arti = BA.NumberToString((double)(Double.parseDouble(_arti))+((double)(Double.parseDouble(_vc.GetString("HVD_CANT")))-(double)(Double.parseDouble(_vc.GetString("HVD_RECHAZOCANT")))));
 }
};
 };
 //BA.debugLineNum = 192;BA.debugLine="Private vc2 As Cursor = Starter.skmt.ExecQuery(\"s";
_vc2 = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_vc2 = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select HVD_PROID, HVD_CANT, IFNULL(HVD_RECHAZOCANT, 0) AS HVD_RECHAZOCANT, CANTC,HVD_COSTO_TOT from HIST_VENTAS where HVD_CLIENTE in (select cuenta from cuentaa) AND BCAJAS = 1")));
 //BA.debugLineNum = 193;BA.debugLine="Private Cuenta1 As String = 0";
_cuenta1 = BA.NumberToString(0);
 //BA.debugLineNum = 194;BA.debugLine="Private arti1 As String = 0";
_arti1 = BA.NumberToString(0);
 //BA.debugLineNum = 195;BA.debugLine="If vc2.RowCount > 0 Then";
if (_vc2.getRowCount()>0) { 
 //BA.debugLineNum = 196;BA.debugLine="For i = 0 To vc2.RowCount - 1";
{
final int step55 = 1;
final int limit55 = (int) (_vc2.getRowCount()-1);
_i = (int) (0) ;
for (;_i <= limit55 ;_i = _i + step55 ) {
 //BA.debugLineNum = 197;BA.debugLine="vc2.Position = i";
_vc2.setPosition(_i);
 //BA.debugLineNum = 198;BA.debugLine="Dim preu As Float = NumberFormat2(vc2.GetString";
_preu = (float)(Double.parseDouble(__c.NumberFormat2((double)(Double.parseDouble(_vc2.GetString("HVD_COSTO_TOT")))/(double)(double)(Double.parseDouble(_vc2.GetString("CANTC"))),(int) (0),(int) (2),(int) (2),__c.False)));
 //BA.debugLineNum = 199;BA.debugLine="Private vc3 As Cursor = Starter.skmt.ExecQuery(";
_vc3 = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_vc3 = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery(("select PRECIOCONVER, CONVERSION from CAT_GUNAPROD where CAT_GP_ID = '"+__c.SmartStringFormatter("",(Object)(_vc2.GetString("HVD_PROID")))+"'"))));
 //BA.debugLineNum = 200;BA.debugLine="If vc3.RowCount > 0 Then";
if (_vc3.getRowCount()>0) { 
 //BA.debugLineNum = 201;BA.debugLine="vc3.Position = 0";
_vc3.setPosition((int) (0));
 //BA.debugLineNum = 202;BA.debugLine="Cuenta1 = Cuenta1 + ((vc2.GetString(\"CANTC\")-(";
_cuenta1 = BA.NumberToString((double)(Double.parseDouble(_cuenta1))+(((double)(Double.parseDouble(_vc2.GetString("CANTC")))-((double)(Double.parseDouble(_vc2.GetString("HVD_RECHAZOCANT")))/(double)(double)(Double.parseDouble(_vc3.GetString("CONVERSION")))))*_preu));
 //BA.debugLineNum = 203;BA.debugLine="arti1 = arti1 + (vc2.GetString(\"HVD_CANT\") - v";
_arti1 = BA.NumberToString((double)(Double.parseDouble(_arti1))+((double)(Double.parseDouble(_vc2.GetString("HVD_CANT")))-(double)(Double.parseDouble(_vc2.GetString("HVD_RECHAZOCANT")))));
 };
 }
};
 };
 //BA.debugLineNum = 209;BA.debugLine="Private vc4 As Cursor = Starter.skmt.ExecQuery($\"";
_vc4 = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_vc4 = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery(("select HVD_PROID,HVD_PRONOMBRE,HVD_COSTO_TOT, HVD_CANT, IFNULL(HVD_RECHAZOCANT, 0) AS HVD_RECHAZOCANT, CANTC,HVD_COSTO_TOT, HVD_RECHAZO, HVD_CODPROMO from HIST_VENTAS where HVD_CLIENTE in (select cuenta from cuentaa) AND BCAJAS = 0 and HVD_CODPROMO <> '"+__c.SmartStringFormatter("",(Object)(_subs._traealmacen /*String*/ (ba)))+"'"))));
 //BA.debugLineNum = 210;BA.debugLine="Private Cuenta2 As String = 0";
_cuenta2 = BA.NumberToString(0);
 //BA.debugLineNum = 211;BA.debugLine="Private arti2 As String = 0";
_arti2 = BA.NumberToString(0);
 //BA.debugLineNum = 212;BA.debugLine="If vc4.RowCount > 0 Then";
if (_vc4.getRowCount()>0) { 
 //BA.debugLineNum = 214;BA.debugLine="For i = 0 To vc4.RowCount - 1";
{
final int step70 = 1;
final int limit70 = (int) (_vc4.getRowCount()-1);
_i = (int) (0) ;
for (;_i <= limit70 ;_i = _i + step70 ) {
 //BA.debugLineNum = 215;BA.debugLine="vc4.Position = i";
_vc4.setPosition(_i);
 //BA.debugLineNum = 216;BA.debugLine="If vc4.GetString(\"HVD_PROID\") <> vc4.GetString(";
if ((_vc4.GetString("HVD_PROID")).equals(_vc4.GetString("HVD_CODPROMO")) == false) { 
 //BA.debugLineNum = 217;BA.debugLine="If vc4.GetString(\"HVD_RECHAZO\") = 0 Then";
if ((_vc4.GetString("HVD_RECHAZO")).equals(BA.NumberToString(0))) { 
 //BA.debugLineNum = 218;BA.debugLine="Cuenta2 = Cuenta2 + vc4.GetString(\"HVD_COSTO_";
_cuenta2 = BA.NumberToString((double)(Double.parseDouble(_cuenta2))+(double)(Double.parseDouble(_vc4.GetString("HVD_COSTO_TOT"))));
 //BA.debugLineNum = 219;BA.debugLine="arti2 = arti2 + vc4.GetString(\"HVD_CANT\")";
_arti2 = BA.NumberToString((double)(Double.parseDouble(_arti2))+(double)(Double.parseDouble(_vc4.GetString("HVD_CANT"))));
 }else {
 //BA.debugLineNum = 221;BA.debugLine="Private vc5 As Cursor = Starter.skmt.ExecQuer";
_vc5 = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_vc5 = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery(("select CAT_GP_PRECIO from CAT_GUNAPROD where CAT_GP_ID = '"+__c.SmartStringFormatter("",(Object)(_vc4.GetString("HVD_PROID")))+"'"))));
 //BA.debugLineNum = 222;BA.debugLine="If vc5.RowCount > 0 Then";
if (_vc5.getRowCount()>0) { 
 //BA.debugLineNum = 223;BA.debugLine="vc5.Position= 0";
_vc5.setPosition((int) (0));
 //BA.debugLineNum = 225;BA.debugLine="Cuenta2 = Cuenta2 +((vc4.GetString(\"HVD_CANT";
_cuenta2 = BA.NumberToString((double)(Double.parseDouble(_cuenta2))+(((double)(Double.parseDouble(_vc4.GetString("HVD_CANT")))-(double)(Double.parseDouble(_vc4.GetString("HVD_RECHAZOCANT"))))*((double)(Double.parseDouble(_vc4.GetString("HVD_COSTO_TOT")))/(double)(double)(Double.parseDouble(_vc4.GetString("HVD_CANT"))))));
 //BA.debugLineNum = 226;BA.debugLine="arti2 = arti2 +(vc4.GetString(\"HVD_CANT\")- v";
_arti2 = BA.NumberToString((double)(Double.parseDouble(_arti2))+((double)(Double.parseDouble(_vc4.GetString("HVD_CANT")))-(double)(Double.parseDouble(_vc4.GetString("HVD_RECHAZOCANT")))));
 };
 };
 };
 }
};
 };
 //BA.debugLineNum = 235;BA.debugLine="Private c4 As Cursor = Starter.skmt.ExecQuery($\"S";
_c4 = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_c4 = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery(("SELECT IFNULL(PE_CANT,0) AS PE_CANT, iFNULL(PE_COSTO_TOT,0) AS PE_COSTO_TOT FROM PEDIDO WHERE PE_CLIENTE IN (SELECT CUENTA FROM CUENTAA)"))));
 //BA.debugLineNum = 236;BA.debugLine="Private Cuenta3 As String = 0";
_cuenta3 = BA.NumberToString(0);
 //BA.debugLineNum = 237;BA.debugLine="Private arti3 As String = 0";
_arti3 = BA.NumberToString(0);
 //BA.debugLineNum = 238;BA.debugLine="If c4.RowCount > 0 Then";
if (_c4.getRowCount()>0) { 
 //BA.debugLineNum = 239;BA.debugLine="For i = 0 To c4.RowCount -1";
{
final int step91 = 1;
final int limit91 = (int) (_c4.getRowCount()-1);
_i = (int) (0) ;
for (;_i <= limit91 ;_i = _i + step91 ) {
 //BA.debugLineNum = 240;BA.debugLine="c4.Position = i";
_c4.setPosition(_i);
 //BA.debugLineNum = 241;BA.debugLine="arti3 = arti3 + c4.GetString(\"PE_CANT\")";
_arti3 = BA.NumberToString((double)(Double.parseDouble(_arti3))+(double)(Double.parseDouble(_c4.GetString("PE_CANT"))));
 //BA.debugLineNum = 242;BA.debugLine="Cuenta3 = Cuenta3 + c4.GetString(\"PE_COSTO_TOT\"";
_cuenta3 = BA.NumberToString((double)(Double.parseDouble(_cuenta3))+(double)(Double.parseDouble(_c4.GetString("PE_COSTO_TOT"))));
 }
};
 };
 //BA.debugLineNum = 245;BA.debugLine="Log(cuenta0)";
__c.LogImpl("08126588",_cuenta0,0);
 //BA.debugLineNum = 246;BA.debugLine="Log(Cuenta1)";
__c.LogImpl("08126589",_cuenta1,0);
 //BA.debugLineNum = 247;BA.debugLine="Log(Cuenta2)";
__c.LogImpl("08126590",_cuenta2,0);
 //BA.debugLineNum = 248;BA.debugLine="Log(Cuenta3)";
__c.LogImpl("08126591",_cuenta3,0);
 //BA.debugLineNum = 250;BA.debugLine="l_total.Text = NumberFormat2((cuenta0 + Cuenta1 +";
_l_total.setText(BA.ObjectToCharSequence(__c.NumberFormat2(((double)(Double.parseDouble(_cuenta0))+(double)(Double.parseDouble(_cuenta1))+(double)(Double.parseDouble(_cuenta2))+(double)(Double.parseDouble(_cuenta3))),(int) (0),(int) (2),(int) (2),__c.True)));
 //BA.debugLineNum = 251;BA.debugLine="L_CANT.Text = NumberFormat2((arti + arti1 +arti2";
_l_cant.setText(BA.ObjectToCharSequence(__c.NumberFormat2(((double)(Double.parseDouble(_arti))+(double)(Double.parseDouble(_arti1))+(double)(Double.parseDouble(_arti2))+(double)(Double.parseDouble(_arti3))),(int) (0),(int) (0),(int) (0),__c.True)));
 //BA.debugLineNum = 256;BA.debugLine="c = Starter.skmt.ExecQuery2(\"select CAT_VA_VALOR";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery2("select CAT_VA_VALOR from CAT_VARIABLES WHERE CAT_VA_DESCRIPCION = ?",new String[]{"MACIMP"})));
 //BA.debugLineNum = 257;BA.debugLine="If c.RowCount > 0 Then";
if (_c.getRowCount()>0) { 
 //BA.debugLineNum = 258;BA.debugLine="c.Position = 0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 259;BA.debugLine="Starter.MAC_IMPRESORA = c.GetString(\"CAT_VA_VALO";
_starter._mac_impresora /*String*/  = _c.GetString("CAT_VA_VALOR");
 };
 //BA.debugLineNum = 261;BA.debugLine="If Starter.MAC_IMPRESORA = \"\" Then Starter.MAC_IM";
if ((_starter._mac_impresora /*String*/ ).equals("")) { 
_starter._mac_impresora /*String*/  = "0";};
 //BA.debugLineNum = 263;BA.debugLine="Printer1.Initialize(Me, \"Printer1\")";
_printer1._initialize /*String*/ (ba,this,"Printer1");
 //BA.debugLineNum = 265;BA.debugLine="If Printer1.IsConnected = False Then";
if (_printer1._isconnected /*boolean*/ ()==__c.False) { 
 }else {
 //BA.debugLineNum = 269;BA.debugLine="Printer1.DisConnect";
_printer1._disconnect /*String*/ ();
 //BA.debugLineNum = 270;BA.debugLine="Printer1.Connect";
_printer1._connect /*boolean*/ ();
 //BA.debugLineNum = 271;BA.debugLine="Log(\"2\")";
__c.LogImpl("08126614","2",0);
 };
 //BA.debugLineNum = 274;BA.debugLine="Dim pag As Cursor = Starter.skmt.ExecQuery(\"selec";
_pag = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_pag = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select * FROM PAGARES WHERE TMP_CLIENTE IN (SELECT CUENTA FROM CUENTAA)")));
 //BA.debugLineNum = 275;BA.debugLine="If pag.RowCount > 0 Then";
if (_pag.getRowCount()>0) { 
 //BA.debugLineNum = 276;BA.debugLine="pag.Position = 0";
_pag.setPosition((int) (0));
 //BA.debugLineNum = 277;BA.debugLine="l_credi.Visible = True";
_l_credi.setVisible(__c.True);
 //BA.debugLineNum = 278;BA.debugLine="l_pagare.Visible = True";
_l_pagare.setVisible(__c.True);
 //BA.debugLineNum = 279;BA.debugLine="l_montoefec.Visible = True";
_l_montoefec.setVisible(__c.True);
 //BA.debugLineNum = 280;BA.debugLine="l_efectivo.Visible = True";
_l_efectivo.setVisible(__c.True);
 //BA.debugLineNum = 281;BA.debugLine="l_montopag.Visible = True";
_l_montopag.setVisible(__c.True);
 //BA.debugLineNum = 282;BA.debugLine="l_montopag.Text = pag.GetString(\"TMP_MONTO_PAGAR";
_l_montopag.setText(BA.ObjectToCharSequence(_pag.GetString("TMP_MONTO_PAGARE")));
 //BA.debugLineNum = 283;BA.debugLine="Dim PAGAREMONTO As Float = cuenta0 + Cuenta1 + C";
_pagaremonto = (float) ((double)(Double.parseDouble(_cuenta0))+(double)(Double.parseDouble(_cuenta1))+(double)(Double.parseDouble(_cuenta2))+(double)(Double.parseDouble(_cuenta3)));
 //BA.debugLineNum = 284;BA.debugLine="Dim PAGAREMONTO2 As Float = pag.GetString(\"TMP_M";
_pagaremonto2 = (float)(Double.parseDouble(_pag.GetString("TMP_MONTO_PAGARE")));
 //BA.debugLineNum = 286;BA.debugLine="If PAGAREMONTO - PAGAREMONTO2 < 0 Then";
if (_pagaremonto-_pagaremonto2<0) { 
 //BA.debugLineNum = 287;BA.debugLine="l_montoefec.Text = 0";
_l_montoefec.setText(BA.ObjectToCharSequence(0));
 }else {
 //BA.debugLineNum = 289;BA.debugLine="l_montoefec.Text = PAGAREMONTO - PAGAREMONTO2";
_l_montoefec.setText(BA.ObjectToCharSequence(_pagaremonto-_pagaremonto2));
 };
 }else if(_pag.getRowCount()==0) { 
 //BA.debugLineNum = 292;BA.debugLine="l_credi.Visible = False";
_l_credi.setVisible(__c.False);
 //BA.debugLineNum = 293;BA.debugLine="l_pagare.Visible = False";
_l_pagare.setVisible(__c.False);
 //BA.debugLineNum = 294;BA.debugLine="l_montoefec.Visible = False";
_l_montoefec.setVisible(__c.False);
 //BA.debugLineNum = 295;BA.debugLine="l_efectivo.Visible = False";
_l_efectivo.setVisible(__c.False);
 //BA.debugLineNum = 296;BA.debugLine="l_montopag.Visible = False";
_l_montopag.setVisible(__c.False);
 };
 //BA.debugLineNum = 299;BA.debugLine="If distance < 50 Then";
if (_distance<50) { 
 //BA.debugLineNum = 300;BA.debugLine="Tar.Visible = True";
_tar.setVisible(__c.True);
 //BA.debugLineNum = 301;BA.debugLine="gest.Visible = True";
_gest.setVisible(__c.True);
 //BA.debugLineNum = 302;BA.debugLine="b_noEntrega.Visible = True";
_b_noentrega.setVisible(__c.True);
 //BA.debugLineNum = 303;BA.debugLine="HIST.Visible = True";
_hist.setVisible(__c.True);
 }else {
 //BA.debugLineNum = 305;BA.debugLine="Tar.Visible = False";
_tar.setVisible(__c.False);
 //BA.debugLineNum = 306;BA.debugLine="gest.Visible = False";
_gest.setVisible(__c.False);
 //BA.debugLineNum = 307;BA.debugLine="b_noEntrega.Visible = False";
_b_noentrega.setVisible(__c.False);
 //BA.debugLineNum = 308;BA.debugLine="HIST.Visible = False";
_hist.setVisible(__c.False);
 };
 //BA.debugLineNum = 311;BA.debugLine="End Sub";
return "";
}
public anywheresoftware.b4a.keywords.Common.ResumableSubWrapper  _b4xpage_closerequest() throws Exception{
ResumableSub_B4XPage_CloseRequest rsub = new ResumableSub_B4XPage_CloseRequest(this);
rsub.resume(ba, null);
return (anywheresoftware.b4a.keywords.Common.ResumableSubWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.keywords.Common.ResumableSubWrapper(), rsub);
}
public static class ResumableSub_B4XPage_CloseRequest extends BA.ResumableSub {
public ResumableSub_B4XPage_CloseRequest(reparto_medicomed.keymon.lat.c_cliente parent) {
this.parent = parent;
}
reparto_medicomed.keymon.lat.c_cliente parent;

@Override
public void resume(BA ba, Object[] result) throws Exception{

    while (true) {
        switch (state) {
            case -1:
{
parent.__c.ReturnFromResumableSub(this,null);return;}
case 0:
//C
this.state = -1;
 //BA.debugLineNum = 434;BA.debugLine="B4XPages.ShowPage(\"Clientes\")";
parent._b4xpages._showpage /*String*/ (ba,"Clientes");
 //BA.debugLineNum = 435;BA.debugLine="Return False";
if (true) {
parent.__c.ReturnFromResumableSub(this,(Object)(parent.__c.False));return;};
 //BA.debugLineNum = 436;BA.debugLine="End Sub";
if (true) break;

            }
        }
    }
}
public String  _b4xpage_created(anywheresoftware.b4a.objects.B4XViewWrapper _root1) throws Exception{
 //BA.debugLineNum = 82;BA.debugLine="Private Sub B4XPage_Created (Root1 As B4XView)";
 //BA.debugLineNum = 83;BA.debugLine="Root = Root1";
_root = _root1;
 //BA.debugLineNum = 85;BA.debugLine="g.Initialize(\"GPS\")";
_g.Initialize("GPS");
 //BA.debugLineNum = 87;BA.debugLine="Root.LoadLayout(\"cliente\")";
_root.LoadLayout("cliente",ba);
 //BA.debugLineNum = 88;BA.debugLine="c=Starter.skmt.ExecQuery(\"select CAT_CL_CODIGO, C";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select CAT_CL_CODIGO, CAT_CL_RUTA, CAT_CL_NOMBRE, CAT_CL_ATIENDE1, CAT_CL_ATIENTE2, CAT_CL_TELEFONO, CAT_CL_EMAIL, CAT_CL_CALLE, CAT_CL_NOEXT,CAT_CL_NOINT,CAT_CL_CALLE1,CAT_CL_CALLE2,CAT_CL_COLONIA,CAT_CL_MUNI,CAT_CL_EDO,CAT_CL_CP,CAT_CL_LONG,CAT_CL_LAT  from kmt_info where CAT_CL_CODIGO In (Select cuenta from cuentaa)")));
 //BA.debugLineNum = 89;BA.debugLine="s=Starter.skmt.ExecQuery(\"select sum(pe_costo_tot";
_s = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select sum(pe_costo_tot) as TOTAL_CLIE, SUM(PE_CANT) AS CANT_CLIE FROM PEDIDO WHERE PE_CLIENTE IN (Select CUENTA from cuentaa)")));
 //BA.debugLineNum = 90;BA.debugLine="s.Position=0";
_s.setPosition((int) (0));
 //BA.debugLineNum = 91;BA.debugLine="c.Position=0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 92;BA.debugLine="la_cuenta.Text = c.GetString(\"CAT_CL_CODIGO\")";
_la_cuenta.setText(BA.ObjectToCharSequence(_c.GetString("CAT_CL_CODIGO")));
 //BA.debugLineNum = 93;BA.debugLine="La_nombre.Text = c.GetString(\"CAT_CL_NOMBRE\")";
_la_nombre.setText(BA.ObjectToCharSequence(_c.GetString("CAT_CL_NOMBRE")));
 //BA.debugLineNum = 94;BA.debugLine="la_Calle.Text = c.GetString(\"CAT_CL_CALLE\") & c.G";
_la_calle.setText(BA.ObjectToCharSequence(_c.GetString("CAT_CL_CALLE")+_c.GetString("CAT_CL_NOEXT")));
 //BA.debugLineNum = 95;BA.debugLine="la_col.Text = c.GetString(\"CAT_CL_COLONIA\")";
_la_col.setText(BA.ObjectToCharSequence(_c.GetString("CAT_CL_COLONIA")));
 //BA.debugLineNum = 96;BA.debugLine="la_edo.Text = c.GetString(\"CAT_CL_EDO\")";
_la_edo.setText(BA.ObjectToCharSequence(_c.GetString("CAT_CL_EDO")));
 //BA.debugLineNum = 97;BA.debugLine="la_cp.Text = c.GetString(\"CAT_CL_CP\")";
_la_cp.setText(BA.ObjectToCharSequence(_c.GetString("CAT_CL_CP")));
 //BA.debugLineNum = 98;BA.debugLine="l_entre1.Text = c.GetString(\"CAT_CL_CALLE1\")";
_l_entre1.setText(BA.ObjectToCharSequence(_c.GetString("CAT_CL_CALLE1")));
 //BA.debugLineNum = 99;BA.debugLine="l_entre2.Text = c.GetString(\"CAT_CL_CALLE2\")";
_l_entre2.setText(BA.ObjectToCharSequence(_c.GetString("CAT_CL_CALLE2")));
 //BA.debugLineNum = 100;BA.debugLine="If c.GetString(\"CAT_CL_ATIENDE1\") <> Null And c.G";
if (_c.GetString("CAT_CL_ATIENDE1")!= null && (_c.GetString("CAT_CL_ATIENDE1")).equals("null") == false) { 
 //BA.debugLineNum = 101;BA.debugLine="l_atiende.Text = c.GetString(\"CAT_CL_ATIENDE1\")";
_l_atiende.setText(BA.ObjectToCharSequence(_c.GetString("CAT_CL_ATIENDE1")));
 }else {
 //BA.debugLineNum = 103;BA.debugLine="l_atiende.Text = \" \"";
_l_atiende.setText(BA.ObjectToCharSequence(" "));
 };
 //BA.debugLineNum = 105;BA.debugLine="If c.GetString(\"CAT_CL_ATIENTE2\") <> Null And c.G";
if (_c.GetString("CAT_CL_ATIENTE2")!= null && (_c.GetString("CAT_CL_ATIENTE2")).equals("NULL") == false) { 
 //BA.debugLineNum = 106;BA.debugLine="l_atiende2.Text = c.GetString(\"CAT_CL_ATIENTE2\")";
_l_atiende2.setText(BA.ObjectToCharSequence(_c.GetString("CAT_CL_ATIENTE2")));
 //BA.debugLineNum = 107;BA.debugLine="Log(\"|\"&c.GetString(\"CAT_CL_ATIENTE2\")&\"|\")";
__c.LogImpl("08060953","|"+_c.GetString("CAT_CL_ATIENTE2")+"|",0);
 }else {
 //BA.debugLineNum = 109;BA.debugLine="l_atiende2.Text = \" \"";
_l_atiende2.setText(BA.ObjectToCharSequence(" "));
 };
 //BA.debugLineNum = 111;BA.debugLine="la_saldotot.Text = c.GetString(\"CAT_CL_TELEFONO\")";
_la_saldotot.setText(BA.ObjectToCharSequence(_c.GetString("CAT_CL_TELEFONO")));
 //BA.debugLineNum = 112;BA.debugLine="la_saldooper.Text = c.GetString(\"CAT_CL_EMAIL\")";
_la_saldooper.setText(BA.ObjectToCharSequence(_c.GetString("CAT_CL_EMAIL")));
 //BA.debugLineNum = 114;BA.debugLine="btAdmin.Initialize(\"BlueTeeth\")";
_btadmin.Initialize(ba,"BlueTeeth");
 //BA.debugLineNum = 115;BA.debugLine="cmp20.Initialize(\"Printer\")";
_cmp20.Initialize("Printer");
 //BA.debugLineNum = 116;BA.debugLine="reqManager.Initialize(Me, B4XPages.MainPage.SERVE";
_reqmanager._initialize /*String*/ (ba,this,_b4xpages._mainpage /*reparto_medicomed.keymon.lat.b4xmainpage*/ (ba)._server /*String*/ );
 //BA.debugLineNum = 117;BA.debugLine="End Sub";
return "";
}
public String  _class_globals() throws Exception{
 //BA.debugLineNum = 1;BA.debugLine="Sub Class_Globals";
 //BA.debugLineNum = 2;BA.debugLine="Private Root As B4XView 'ignore";
_root = new anywheresoftware.b4a.objects.B4XViewWrapper();
 //BA.debugLineNum = 3;BA.debugLine="Private xui As XUI 'ignore";
_xui = new anywheresoftware.b4a.objects.B4XViewWrapper.XUI();
 //BA.debugLineNum = 4;BA.debugLine="Dim g As GPS";
_g = new anywheresoftware.b4a.gps.GPS();
 //BA.debugLineNum = 5;BA.debugLine="Dim clie_id As String";
_clie_id = "";
 //BA.debugLineNum = 6;BA.debugLine="Dim sDate,sTime As String";
_sdate = "";
_stime = "";
 //BA.debugLineNum = 7;BA.debugLine="Dim usuario As String";
_usuario = "";
 //BA.debugLineNum = 8;BA.debugLine="Dim cuenta As String";
_cuenta = "";
 //BA.debugLineNum = 9;BA.debugLine="Dim btAdmin As BluetoothAdmin";
_btadmin = new anywheresoftware.b4a.objects.Serial.BluetoothAdmin();
 //BA.debugLineNum = 10;BA.debugLine="Dim cmp20 As Serial";
_cmp20 = new anywheresoftware.b4a.objects.Serial();
 //BA.debugLineNum = 11;BA.debugLine="Dim printer As TextWriter";
_printer = new anywheresoftware.b4a.objects.streams.File.TextWriterWrapper();
 //BA.debugLineNum = 12;BA.debugLine="Dim PairedDevices As Map";
_paireddevices = new anywheresoftware.b4a.objects.collections.Map();
 //BA.debugLineNum = 13;BA.debugLine="Dim L As List";
_l = new anywheresoftware.b4a.objects.collections.List();
 //BA.debugLineNum = 14;BA.debugLine="Dim TAMANO As Int";
_tamano = 0;
 //BA.debugLineNum = 15;BA.debugLine="Dim ESPACIO As Int";
_espacio = 0;
 //BA.debugLineNum = 16;BA.debugLine="Dim BLANCO As String";
_blanco = "";
 //BA.debugLineNum = 17;BA.debugLine="Dim impresoraConectada As Boolean = False";
_impresoraconectada = __c.False;
 //BA.debugLineNum = 18;BA.debugLine="Dim LONGITUD As String";
_longitud = "";
 //BA.debugLineNum = 19;BA.debugLine="Dim LATITUD As String";
_latitud = "";
 //BA.debugLineNum = 20;BA.debugLine="Dim NOMBRE As String";
_nombre = "";
 //BA.debugLineNum = 21;BA.debugLine="Dim c As Cursor";
_c = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
 //BA.debugLineNum = 22;BA.debugLine="Dim s As Cursor";
_s = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
 //BA.debugLineNum = 23;BA.debugLine="Dim ListView1 As ListView";
_listview1 = new anywheresoftware.b4a.objects.ListViewWrapper();
 //BA.debugLineNum = 24;BA.debugLine="Dim la_cuenta As Label";
_la_cuenta = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 25;BA.debugLine="Dim La_nombre As Label";
_la_nombre = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 26;BA.debugLine="Dim la_Calle As Label";
_la_calle = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 27;BA.debugLine="Dim la_numero As Label";
_la_numero = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 28;BA.debugLine="Dim la_nint As Label";
_la_nint = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 29;BA.debugLine="Dim la_edo As Label";
_la_edo = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 30;BA.debugLine="Dim la_pob As Label";
_la_pob = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 31;BA.debugLine="Dim la_col As Label";
_la_col = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 32;BA.debugLine="Dim la_cp As Label";
_la_cp = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 33;BA.debugLine="Dim la_zona As Label";
_la_zona = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 34;BA.debugLine="Dim gest As Button";
_gest = new anywheresoftware.b4a.objects.ButtonWrapper();
 //BA.debugLineNum = 35;BA.debugLine="Dim la_saldotot As Label";
_la_saldotot = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 36;BA.debugLine="Dim la_saldooper As Label";
_la_saldooper = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 37;BA.debugLine="Dim reqManager As DBRequestManager";
_reqmanager = new reparto_medicomed.keymon.lat.dbrequestmanager();
 //BA.debugLineNum = 38;BA.debugLine="Dim b_noEntrega As Button";
_b_noentrega = new anywheresoftware.b4a.objects.ButtonWrapper();
 //BA.debugLineNum = 39;BA.debugLine="Dim Label10 As Label";
_label10 = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 40;BA.debugLine="Dim Label11 As Label";
_label11 = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 41;BA.debugLine="Dim d As Cursor";
_d = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
 //BA.debugLineNum = 42;BA.debugLine="Dim Tar As Button";
_tar = new anywheresoftware.b4a.objects.ButtonWrapper();
 //BA.debugLineNum = 43;BA.debugLine="Private L_QR As Label";
_l_qr = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 44;BA.debugLine="Private BT_QR As Button";
_bt_qr = new anywheresoftware.b4a.objects.ButtonWrapper();
 //BA.debugLineNum = 45;BA.debugLine="Dim Printer1 As EscPosPrinter";
_printer1 = new reparto_medicomed.keymon.lat.escposprinter();
 //BA.debugLineNum = 46;BA.debugLine="Dim la_comm As Label";
_la_comm = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 47;BA.debugLine="Dim la_actdte As Label";
_la_actdte = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 48;BA.debugLine="Dim la_usuario As Label";
_la_usuario = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 49;BA.debugLine="Dim la_resultado As Label";
_la_resultado = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 50;BA.debugLine="Dim l_entre1 As Label";
_l_entre1 = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 51;BA.debugLine="Dim l_entre2 As Label";
_l_entre2 = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 52;BA.debugLine="Dim l_atiende As Label";
_l_atiende = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 53;BA.debugLine="Dim l_atiende2 As Label";
_l_atiende2 = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 54;BA.debugLine="Dim DATOS As Button";
_datos = new anywheresoftware.b4a.objects.ButtonWrapper();
 //BA.debugLineNum = 55;BA.debugLine="Dim Guardar As Button";
_guardar = new anywheresoftware.b4a.objects.ButtonWrapper();
 //BA.debugLineNum = 56;BA.debugLine="Dim NUEVO As Button";
_nuevo = new anywheresoftware.b4a.objects.ButtonWrapper();
 //BA.debugLineNum = 57;BA.debugLine="Private l_total As Label";
_l_total = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 58;BA.debugLine="Private HIST As Button";
_hist = new anywheresoftware.b4a.objects.ButtonWrapper();
 //BA.debugLineNum = 59;BA.debugLine="Dim PASA_IMP As String";
_pasa_imp = "";
 //BA.debugLineNum = 60;BA.debugLine="Private B_IMP As Button";
_b_imp = new anywheresoftware.b4a.objects.ButtonWrapper();
 //BA.debugLineNum = 61;BA.debugLine="Dim total_cliente As String";
_total_cliente = "";
 //BA.debugLineNum = 62;BA.debugLine="Dim CREDITO As String";
_credito = "";
 //BA.debugLineNum = 63;BA.debugLine="Private p_principal As Panel";
_p_principal = new anywheresoftware.b4a.objects.PanelWrapper();
 //BA.debugLineNum = 64;BA.debugLine="Private B_PASO2 As Button";
_b_paso2 = new anywheresoftware.b4a.objects.ButtonWrapper();
 //BA.debugLineNum = 65;BA.debugLine="Private L_CANT As Label";
_l_cant = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 66;BA.debugLine="Dim errorImpresora As Int = 0";
_errorimpresora = (int) (0);
 //BA.debugLineNum = 67;BA.debugLine="Dim banderaimp As Int";
_banderaimp = 0;
 //BA.debugLineNum = 68;BA.debugLine="Private l_credi As Label";
_l_credi = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 69;BA.debugLine="Private l_pagare As Label";
_l_pagare = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 70;BA.debugLine="Private l_montopag As Label";
_l_montopag = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 71;BA.debugLine="Private l_efectivo As Label";
_l_efectivo = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 72;BA.debugLine="Private l_montoefec As Label";
_l_montoefec = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 73;BA.debugLine="Dim distance As Long";
_distance = 0L;
 //BA.debugLineNum = 74;BA.debugLine="End Sub";
return "";
}
public String  _datos_click() throws Exception{
 //BA.debugLineNum = 443;BA.debugLine="Sub DATOS_Click";
 //BA.debugLineNum = 445;BA.debugLine="End Sub";
return "";
}
public String  _gest_click() throws Exception{
 //BA.debugLineNum = 368;BA.debugLine="Sub gest_Click";
 //BA.debugLineNum = 369;BA.debugLine="B_IMP_Click";
_b_imp_click();
 //BA.debugLineNum = 370;BA.debugLine="banderaimp = 1";
_banderaimp = (int) (1);
 //BA.debugLineNum = 371;BA.debugLine="End Sub";
return "";
}
public String  _gps_locationchanged(anywheresoftware.b4a.gps.LocationWrapper _location1) throws Exception{
anywheresoftware.b4a.gps.LocationWrapper _l1 = null;
anywheresoftware.b4a.gps.LocationWrapper _l2 = null;
 //BA.debugLineNum = 317;BA.debugLine="Sub GPS_LocationChanged (Location1 As Location)";
 //BA.debugLineNum = 319;BA.debugLine="If Tracker.FLP.GetLastKnownLocation.IsInitialized";
if (_tracker._flp /*uk.co.martinpearman.b4a.fusedlocationprovider.FusedLocationProviderWrapper*/ .GetLastKnownLocation().IsInitialized() && _tracker._flp /*uk.co.martinpearman.b4a.fusedlocationprovider.FusedLocationProviderWrapper*/ .GetLastKnownLocation().getLatitude()!=0) { 
 //BA.debugLineNum = 320;BA.debugLine="B4XPages.MainPage.lat_gps = Tracker.FLP.GetLastK";
_b4xpages._mainpage /*reparto_medicomed.keymon.lat.b4xmainpage*/ (ba)._lat_gps /*String*/  = BA.NumberToString(_tracker._flp /*uk.co.martinpearman.b4a.fusedlocationprovider.FusedLocationProviderWrapper*/ .GetLastKnownLocation().getLatitude());
 //BA.debugLineNum = 321;BA.debugLine="B4XPages.MainPage.lon_gps = Tracker.FLP.GetLastK";
_b4xpages._mainpage /*reparto_medicomed.keymon.lat.b4xmainpage*/ (ba)._lon_gps /*String*/  = BA.NumberToString(_tracker._flp /*uk.co.martinpearman.b4a.fusedlocationprovider.FusedLocationProviderWrapper*/ .GetLastKnownLocation().getLongitude());
 //BA.debugLineNum = 322;BA.debugLine="Log(\"Coords set to: \" & B4XPages.MainPage.lat_gp";
__c.LogImpl("08257541","Coords set to: "+_b4xpages._mainpage /*reparto_medicomed.keymon.lat.b4xmainpage*/ (ba)._lat_gps /*String*/ +" and "+_b4xpages._mainpage /*reparto_medicomed.keymon.lat.b4xmainpage*/ (ba)._lon_gps /*String*/ ,0);
 };
 //BA.debugLineNum = 325;BA.debugLine="If LATITUD.Length < 5 Then";
if (_latitud.length()<5) { 
 }else {
 //BA.debugLineNum = 330;BA.debugLine="Dim l1, l2 As Location";
_l1 = new anywheresoftware.b4a.gps.LocationWrapper();
_l2 = new anywheresoftware.b4a.gps.LocationWrapper();
 //BA.debugLineNum = 331;BA.debugLine="l1.Initialize2(B4XPages.MainPage.lat_gps, B4XPag";
_l1.Initialize2(_b4xpages._mainpage /*reparto_medicomed.keymon.lat.b4xmainpage*/ (ba)._lat_gps /*String*/ ,_b4xpages._mainpage /*reparto_medicomed.keymon.lat.b4xmainpage*/ (ba)._lon_gps /*String*/ );
 //BA.debugLineNum = 332;BA.debugLine="Log($\"Coordenadas de la tienda - lat:${LATITUD},";
__c.LogImpl("08257551",("Coordenadas de la tienda - lat:"+__c.SmartStringFormatter("",(Object)(_latitud))+", lon:"+__c.SmartStringFormatter("",(Object)(_longitud))+""),0);
 //BA.debugLineNum = 333;BA.debugLine="l2.Initialize2(LATITUD, LONGITUD)";
_l2.Initialize2(_latitud,_longitud);
 //BA.debugLineNum = 338;BA.debugLine="distance =    l1.DistanceTo(l2)  'the result is";
_distance = (long) (_l1.DistanceTo((android.location.Location)(_l2.getObject())));
 //BA.debugLineNum = 340;BA.debugLine="If distance < 50 Then";
if (_distance<50) { 
 //BA.debugLineNum = 341;BA.debugLine="Tar.Visible = True";
_tar.setVisible(__c.True);
 //BA.debugLineNum = 342;BA.debugLine="gest.Visible = True";
_gest.setVisible(__c.True);
 //BA.debugLineNum = 343;BA.debugLine="b_noEntrega.Visible = True";
_b_noentrega.setVisible(__c.True);
 //BA.debugLineNum = 344;BA.debugLine="HIST.Visible = True";
_hist.setVisible(__c.True);
 }else {
 //BA.debugLineNum = 346;BA.debugLine="Tar.Visible = False";
_tar.setVisible(__c.False);
 //BA.debugLineNum = 347;BA.debugLine="gest.Visible = False";
_gest.setVisible(__c.False);
 //BA.debugLineNum = 348;BA.debugLine="b_noEntrega.Visible = False";
_b_noentrega.setVisible(__c.False);
 //BA.debugLineNum = 349;BA.debugLine="HIST.Visible = False";
_hist.setVisible(__c.False);
 };
 //BA.debugLineNum = 352;BA.debugLine="Log(\"DISTANCIA \"&distance)";
__c.LogImpl("08257571","DISTANCIA "+BA.NumberToString(_distance),0);
 };
 //BA.debugLineNum = 355;BA.debugLine="Dim sDate,sTime As String";
_sdate = "";
_stime = "";
 //BA.debugLineNum = 356;BA.debugLine="DateTime.DateFormat = \"MM/dd/yyyy\"";
__c.DateTime.setDateFormat("MM/dd/yyyy");
 //BA.debugLineNum = 357;BA.debugLine="sDate=DateTime.Date(DateTime.Now)";
_sdate = __c.DateTime.Date(__c.DateTime.getNow());
 //BA.debugLineNum = 358;BA.debugLine="sTime=DateTime.Time(DateTime.Now)";
_stime = __c.DateTime.Time(__c.DateTime.getNow());
 //BA.debugLineNum = 359;BA.debugLine="Starter.skmt.ExecNonQuery(\"DELETE FROM HIST_GPS\")";
_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("DELETE FROM HIST_GPS");
 //BA.debugLineNum = 360;BA.debugLine="Starter.skmt.ExecNonQuery2(\"INSERT INTO  HIST_GPS";
_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("INSERT INTO  HIST_GPS (HGDATE, HGLAT, HGLON) VALUES(?,?,?) ",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(_sdate+_stime),(Object)(_b4xpages._mainpage /*reparto_medicomed.keymon.lat.b4xmainpage*/ (ba)._lat_gps /*String*/ ),(Object)(_b4xpages._mainpage /*reparto_medicomed.keymon.lat.b4xmainpage*/ (ba)._lon_gps /*String*/ )}));
 //BA.debugLineNum = 361;BA.debugLine="CallSubDelayed(Tracker, \"CreateLocationRequest\")";
__c.CallSubDelayed(ba,(Object)(_tracker.getObject()),"CreateLocationRequest");
 //BA.debugLineNum = 362;BA.debugLine="End Sub";
return "";
}
public void  _guardado() throws Exception{
ResumableSub_Guardado rsub = new ResumableSub_Guardado(this);
rsub.resume(ba, null);
}
public static class ResumableSub_Guardado extends BA.ResumableSub {
public ResumableSub_Guardado(reparto_medicomed.keymon.lat.c_cliente parent) {
this.parent = parent;
}
reparto_medicomed.keymon.lat.c_cliente parent;
String _ruta = "";
String _rutapre = "";
String _fechaprev = "";
String _rutaactualizar = "";
anywheresoftware.b4a.sql.SQL.CursorWrapper _rut = null;
int _resultado = 0;
anywheresoftware.b4a.sql.SQL.CursorWrapper _mandamapa = null;

@Override
public void resume(BA ba, Object[] result) throws Exception{

    while (true) {
        switch (state) {
            case -1:
return;

case 0:
//C
this.state = 1;
 //BA.debugLineNum = 374;BA.debugLine="DateTime.DateFormat = \"MM/dd/yyyy\"";
parent.__c.DateTime.setDateFormat("MM/dd/yyyy");
 //BA.debugLineNum = 375;BA.debugLine="DateTime.TimeFormat=\"HHmmss\"";
parent.__c.DateTime.setTimeFormat("HHmmss");
 //BA.debugLineNum = 376;BA.debugLine="sDate=DateTime.Date(DateTime.Now)";
parent._sdate = parent.__c.DateTime.Date(parent.__c.DateTime.getNow());
 //BA.debugLineNum = 377;BA.debugLine="sTime=DateTime.Time(DateTime.Now)";
parent._stime = parent.__c.DateTime.Time(parent.__c.DateTime.getNow());
 //BA.debugLineNum = 378;BA.debugLine="c=Starter.skmt.ExecQuery(\"select CUENTA from cuen";
parent._c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(parent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select CUENTA from cuentaa")));
 //BA.debugLineNum = 379;BA.debugLine="c.Position = 0";
parent._c.setPosition((int) (0));
 //BA.debugLineNum = 380;BA.debugLine="cuenta = c.GetString(\"CUENTA\")";
parent._cuenta = parent._c.GetString("CUENTA");
 //BA.debugLineNum = 381;BA.debugLine="c=Starter.skmt.ExecQuery(\"select usuario from usu";
parent._c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(parent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select usuario from usuarioa")));
 //BA.debugLineNum = 382;BA.debugLine="c.Position = 0";
parent._c.setPosition((int) (0));
 //BA.debugLineNum = 383;BA.debugLine="usuario = c.GetString(\"USUARIO\")";
parent._usuario = parent._c.GetString("USUARIO");
 //BA.debugLineNum = 384;BA.debugLine="c.Close";
parent._c.Close();
 //BA.debugLineNum = 385;BA.debugLine="d = Starter.skmt.ExecQuery(\"SELECT RUTAA FROM RUT";
parent._d = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(parent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("SELECT RUTAA FROM RUTAA")));
 //BA.debugLineNum = 386;BA.debugLine="d.Position = 0";
parent._d.setPosition((int) (0));
 //BA.debugLineNum = 387;BA.debugLine="Dim ruta As String = d.GetString(\"RUTAA\")";
_ruta = parent._d.GetString("RUTAA");
 //BA.debugLineNum = 388;BA.debugLine="d.Close";
parent._d.Close();
 //BA.debugLineNum = 389;BA.debugLine="d = Starter.skmt.ExecQuery(\"SELECT CAT_CL_RUTA FR";
parent._d = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(parent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("SELECT CAT_CL_RUTA FROM kmt_info WHERE CAT_CL_CODIGO IN (SELECT CUENTA FROM CUENTAA)")));
 //BA.debugLineNum = 390;BA.debugLine="d.Position = 0";
parent._d.setPosition((int) (0));
 //BA.debugLineNum = 391;BA.debugLine="Dim rutapre As String = d.GetString(\"CAT_CL_RUTA\"";
_rutapre = parent._d.GetString("CAT_CL_RUTA");
 //BA.debugLineNum = 392;BA.debugLine="d.Close";
parent._d.Close();
 //BA.debugLineNum = 396;BA.debugLine="Dim fechaprev As String = Subs.traefECHAPREV";
_fechaprev = parent._subs._traefechaprev /*String*/ (ba);
 //BA.debugLineNum = 399;BA.debugLine="Dim rutaactualizar As String";
_rutaactualizar = "";
 //BA.debugLineNum = 400;BA.debugLine="Dim rut As Cursor = Starter.skmt.ExecQuery(\"SELEC";
_rut = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_rut = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(parent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("SELECT CAT_CL_RUTA FROM kmt_info WHERE CAT_CL_CODIGO IN (SELECT CUENTA FROM CUENTAA)")));
 //BA.debugLineNum = 401;BA.debugLine="If rut.RowCount > 0 Then";
if (true) break;

case 1:
//if
this.state = 4;
if (_rut.getRowCount()>0) { 
this.state = 3;
}if (true) break;

case 3:
//C
this.state = 4;
 //BA.debugLineNum = 402;BA.debugLine="rut.Position = 0";
_rut.setPosition((int) (0));
 //BA.debugLineNum = 403;BA.debugLine="rutaactualizar = rut.GetString(\"CAT_CL_RUTA\")";
_rutaactualizar = _rut.GetString("CAT_CL_RUTA");
 if (true) break;

case 4:
//C
this.state = 5;
;
 //BA.debugLineNum = 406;BA.debugLine="Starter.skmt.ExecNonQuery($\"DELETE FROM NOVENTA W";
parent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("DELETE FROM NOVENTA WHERE NV_CLIENTE IN (select cuenta from cuentaa) AND NV_RUTA ='"+parent.__c.SmartStringFormatter("",(Object)(_rutaactualizar))+"' "));
 //BA.debugLineNum = 407;BA.debugLine="Starter.skmt.ExecNonQuery2(\"INSERT INTO NOVENTA (";
parent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("INSERT INTO NOVENTA (NV_CLIENTE,NV_FECHA,NV_USER,NV_MOTIVO,NV_COMM,NV_LAT,NV_LON,NV_RUTA) VALUES(?,?,?,?,?,?,?,?) ",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(parent._cuenta),(Object)(parent._sdate+" "+parent._stime),(Object)(parent._usuario),(Object)("ENTREGA"),(Object)("ENTREGA COMPLETA"),(Object)(parent._b4xpages._mainpage /*reparto_medicomed.keymon.lat.b4xmainpage*/ (ba)._lat_gps /*String*/ ),(Object)(parent._b4xpages._mainpage /*reparto_medicomed.keymon.lat.b4xmainpage*/ (ba)._lon_gps /*String*/ ),(Object)(_rutaactualizar)}));
 //BA.debugLineNum = 408;BA.debugLine="Starter.skmt.ExecNonQuery2(\"INSERT INTO REPARTO_G";
parent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("INSERT INTO REPARTO_GEO (CLIENTE, USUARIO, FECHA_PUNTEO, LATITUD, LONGITUD, ALMACEN, RUTA_REPARTO, RUTA_PREV, FECHA_PREVENTA, TIPO,ENVIO) VALUES(?,?,?,?,?,?,?,?,?,?,0)",anywheresoftware.b4a.keywords.Common.ArrayToList(new String[]{parent._la_cuenta.getText(),parent._usuario,parent._sdate+" "+parent._stime,parent._b4xpages._mainpage /*reparto_medicomed.keymon.lat.b4xmainpage*/ (ba)._lat_gps /*String*/ ,parent._b4xpages._mainpage /*reparto_medicomed.keymon.lat.b4xmainpage*/ (ba)._lon_gps /*String*/ ,parent._b4xpages._mainpage /*reparto_medicomed.keymon.lat.b4xmainpage*/ (ba)._almacen /*String*/ ,_ruta,_rutapre,_fechaprev,"ENTREGADO"}));
 //BA.debugLineNum = 409;BA.debugLine="Starter.skmt.ExecNonQuery($\"UPDATE kmt_info set g";
parent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("UPDATE kmt_info set gestion = 2, HORAENT = '"+parent.__c.SmartStringFormatter("",(Object)(parent._sdate+" "+parent._stime))+"' where CAT_CL_CODIGO In (select cuenta from cuentaa) and CAT_CL_RUTA = '"+parent.__c.SmartStringFormatter("",(Object)(_rutaactualizar))+"' "));
 //BA.debugLineNum = 410;BA.debugLine="Starter.skmt.ExecNonQuery(\"update HIST_VENTAS SET";
parent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("update HIST_VENTAS SET HVD_ESTATUS = 1 WHERE HVD_CLIENTE IN (SELECT CUENTA FROM CUENTAA)");
 //BA.debugLineNum = 411;BA.debugLine="mandaPendientesreparto";
parent._mandapendientesreparto();
 //BA.debugLineNum = 413;BA.debugLine="Msgbox2Async(\"Pedido entregado\",\"Atención\",\"Ok\",\"";
parent.__c.Msgbox2Async(BA.ObjectToCharSequence("Pedido entregado"),BA.ObjectToCharSequence("Atención"),"Ok","","",parent.__c.LoadBitmap(parent.__c.File.getDirAssets(),"alert2.png"),ba,parent.__c.False);
 //BA.debugLineNum = 414;BA.debugLine="Wait For Msgbox_Result (resultado As Int)";
parent.__c.WaitFor("msgbox_result", ba, this, null);
this.state = 15;
return;
case 15:
//C
this.state = 5;
_resultado = (Integer) result[0];
;
 //BA.debugLineNum = 415;BA.debugLine="If resultado = DialogResponse.POSITIVE Then";
if (true) break;

case 5:
//if
this.state = 14;
if (_resultado==parent.__c.DialogResponse.POSITIVE) { 
this.state = 7;
}if (true) break;

case 7:
//C
this.state = 8;
 //BA.debugLineNum = 416;BA.debugLine="Dim mandamapa As Cursor = Starter.skmt.ExecQuery";
_mandamapa = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_mandamapa = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(parent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("SELECT * FROM kmt_info WHERE gestion = 0 and CAT_CL_CODIGO <> 63403")));
 //BA.debugLineNum = 417;BA.debugLine="If mandamapa.RowCount = 0 Then";
if (true) break;

case 8:
//if
this.state = 13;
if (_mandamapa.getRowCount()==0) { 
this.state = 10;
}else if(_mandamapa.getRowCount()>0) { 
this.state = 12;
}if (true) break;

case 10:
//C
this.state = 13;
 //BA.debugLineNum = 418;BA.debugLine="B4XPages.ShowPage(\"Principal\")";
parent._b4xpages._showpage /*String*/ (ba,"Principal");
 if (true) break;

case 12:
//C
this.state = 13;
 //BA.debugLineNum = 420;BA.debugLine="B4XPages.ShowPage(\"Principal\")";
parent._b4xpages._showpage /*String*/ (ba,"Principal");
 if (true) break;

case 13:
//C
this.state = 14;
;
 if (true) break;

case 14:
//C
this.state = -1;
;
 //BA.debugLineNum = 424;BA.debugLine="End Sub";
if (true) break;

            }
        }
    }
}
public void  _msgbox_result(int _resultado) throws Exception{
}
public String  _guardar_click() throws Exception{
anywheresoftware.b4a.sql.SQL.CursorWrapper _mandamapa = null;
 //BA.debugLineNum = 447;BA.debugLine="Sub Guardar_Click";
 //BA.debugLineNum = 448;BA.debugLine="Dim mandamapa As Cursor = Starter.skmt.ExecQuery(";
_mandamapa = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_mandamapa = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("SELECT * FROM kmt_info WHERE gestion = 0 AND cat_cl_codigo <> 63403")));
 //BA.debugLineNum = 449;BA.debugLine="If mandamapa.RowCount = 0 Then";
if (_mandamapa.getRowCount()==0) { 
 //BA.debugLineNum = 450;BA.debugLine="B4XPages.ShowPage(\"Principal\")";
_b4xpages._showpage /*String*/ (ba,"Principal");
 }else if(_mandamapa.getRowCount()>0) { 
 //BA.debugLineNum = 452;BA.debugLine="B4XPages.ShowPage(\"Principal\")";
_b4xpages._showpage /*String*/ (ba,"Principal");
 };
 //BA.debugLineNum = 454;BA.debugLine="End Sub";
return "";
}
public String  _hist_click() throws Exception{
 //BA.debugLineNum = 460;BA.debugLine="Sub HIST_Click";
 //BA.debugLineNum = 464;BA.debugLine="B4XPages.MainPage.detalleVenta.prodsMap.Initializ";
_b4xpages._mainpage /*reparto_medicomed.keymon.lat.b4xmainpage*/ (ba)._detalleventa /*reparto_medicomed.keymon.lat.c_detalleventa*/ ._prodsmap /*anywheresoftware.b4a.objects.collections.Map*/ .Initialize();
 //BA.debugLineNum = 466;BA.debugLine="B4XPages.ShowPage(\"DetalleVenta\")";
_b4xpages._showpage /*String*/ (ba,"DetalleVenta");
 //BA.debugLineNum = 467;BA.debugLine="End Sub";
return "";
}
public Object  _initialize(anywheresoftware.b4a.BA _ba) throws Exception{
innerInitialize(_ba);
 //BA.debugLineNum = 77;BA.debugLine="Public Sub Initialize As Object";
 //BA.debugLineNum = 78;BA.debugLine="Return Me";
if (true) return this;
 //BA.debugLineNum = 79;BA.debugLine="End Sub";
return null;
}
public String  _jobdone(reparto_medicomed.keymon.lat.httpjob _job) throws Exception{
reparto_medicomed.keymon.lat.dbrequestmanager._dbresult _resultado = null;
String _cliente = "";
Object[] _records = null;
String _k = "";
 //BA.debugLineNum = 1001;BA.debugLine="Sub JobDone(Job As HttpJob)";
 //BA.debugLineNum = 1002;BA.debugLine="Log(Job.Success)";
__c.LogImpl("09371649",BA.ObjectToString(_job._success /*boolean*/ ),0);
 //BA.debugLineNum = 1003;BA.debugLine="If Job.Success = False Then";
if (_job._success /*boolean*/ ==__c.False) { 
 }else {
 //BA.debugLineNum = 1006;BA.debugLine="LogColor(\"JobDone: '\" & reqManager.HandleJob(Job";
__c.LogImpl("09371653","JobDone: '"+BA.ObjectToString(_reqmanager._handlejob /*reparto_medicomed.keymon.lat.dbrequestmanager._dbresult*/ (_job).Tag /*Object*/ )+"' - Registros: "+BA.NumberToString(_reqmanager._handlejob /*reparto_medicomed.keymon.lat.dbrequestmanager._dbresult*/ (_job).Rows /*anywheresoftware.b4a.objects.collections.List*/ .getSize()),__c.Colors.Green);
 //BA.debugLineNum = 1007;BA.debugLine="If Job.JobName = \"DBRequest\" Then";
if ((_job._jobname /*String*/ ).equals("DBRequest")) { 
 //BA.debugLineNum = 1008;BA.debugLine="Dim resultado As DBResult = reqManager.HandleJo";
_resultado = _reqmanager._handlejob /*reparto_medicomed.keymon.lat.dbrequestmanager._dbresult*/ (_job);
 //BA.debugLineNum = 1009;BA.debugLine="If resultado.Tag.As(String).IndexOf(\"ins_REPART";
if ((BA.ObjectToString(_resultado.Tag /*Object*/ )).indexOf("ins_REPARTOPendientes_head_")>-1) { 
 //BA.debugLineNum = 1010;BA.debugLine="Private cliente As String= resultado.Tag";
_cliente = BA.ObjectToString(_resultado.Tag /*Object*/ );
 //BA.debugLineNum = 1011;BA.debugLine="cliente = cliente.SubString(cliente.IndexOf(\"_";
_cliente = _cliente.substring((int) (_cliente.indexOf("_")+24));
 //BA.debugLineNum = 1012;BA.debugLine="Log($\"Cliente1:${cliente}\"$)";
__c.LogImpl("09371659",("Cliente1:"+__c.SmartStringFormatter("",(Object)(_cliente))+""),0);
 //BA.debugLineNum = 1013;BA.debugLine="Starter.skmt.ExecNonQuery2(\"update REPARTO_GEO";
_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("update REPARTO_GEO SET ENVIO = ? WHERE CLIENTE = ? AND ENVIO <> ?",anywheresoftware.b4a.keywords.Common.ArrayToList(new String[]{"1",_cliente,"1"}));
 //BA.debugLineNum = 1014;BA.debugLine="For Each records() As Object In resultado.Rows";
{
final anywheresoftware.b4a.BA.IterableList group12 = _resultado.Rows /*anywheresoftware.b4a.objects.collections.List*/ ;
final int groupLen12 = group12.getSize()
;int index12 = 0;
;
for (; index12 < groupLen12;index12++){
_records = (Object[])(group12.Get(index12));
 //BA.debugLineNum = 1015;BA.debugLine="For Each k As String In resultado.Columns.Key";
{
final anywheresoftware.b4a.BA.IterableList group13 = _resultado.Columns /*anywheresoftware.b4a.objects.collections.Map*/ .Keys();
final int groupLen13 = group13.getSize()
;int index13 = 0;
;
for (; index13 < groupLen13;index13++){
_k = BA.ObjectToString(group13.Get(index13));
 //BA.debugLineNum = 1016;BA.debugLine="Log(resultado.Tag & \": \" & k & \": \" & record";
__c.LogImpl("09371663",BA.ObjectToString(_resultado.Tag /*Object*/ )+": "+_k+": "+BA.ObjectToString(_records[(int)(BA.ObjectToNumber(_resultado.Columns /*anywheresoftware.b4a.objects.collections.Map*/ .Get((Object)(_k))))]),0);
 }
};
 }
};
 };
 };
 //BA.debugLineNum = 1021;BA.debugLine="Job.Release";
_job._release /*String*/ ();
 };
 //BA.debugLineNum = 1024;BA.debugLine="End Sub";
return "";
}
public String  _listview1_itemlongclick(int _position,Object _value) throws Exception{
 //BA.debugLineNum = 364;BA.debugLine="Sub ListView1_ItemLongClick (Position As Int, Valu";
 //BA.debugLineNum = 366;BA.debugLine="End Sub";
return "";
}
public String  _mandapendientesreparto() throws Exception{
int _i = 0;
reparto_medicomed.keymon.lat.dbrequestmanager._dbcommand _cmd = null;
 //BA.debugLineNum = 981;BA.debugLine="Sub mandaPendientesreparto";
 //BA.debugLineNum = 982;BA.debugLine="c=Starter.skmt.ExecQuery(\"SELECT  CLIENTE, USUARI";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("SELECT  CLIENTE, USUARIO, FECHA_PUNTEO, LATITUD, LONGITUD, ALMACEN, RUTA_REPARTO, RUTA_PREV, FECHA_PREVENTA, MOTIVO, COMENTARIO,TIPO FROM REPARTO_GEO where ENVIO <> 1")));
 //BA.debugLineNum = 983;BA.debugLine="Log($\"REPARTO_Cliente PENDIENTE: ${c.RowCount}\"$)";
__c.LogImpl("09306114",("REPARTO_Cliente PENDIENTE: "+__c.SmartStringFormatter("",(Object)(_c.getRowCount()))+""),0);
 //BA.debugLineNum = 984;BA.debugLine="If c.RowCount>0 Then";
if (_c.getRowCount()>0) { 
 //BA.debugLineNum = 985;BA.debugLine="For i=0 To c.RowCount -1";
{
final int step4 = 1;
final int limit4 = (int) (_c.getRowCount()-1);
_i = (int) (0) ;
for (;_i <= limit4 ;_i = _i + step4 ) {
 //BA.debugLineNum = 986;BA.debugLine="c.Position=i";
_c.setPosition(_i);
 //BA.debugLineNum = 988;BA.debugLine="Dim cmd As DBCommand";
_cmd = new reparto_medicomed.keymon.lat.dbrequestmanager._dbcommand();
 //BA.debugLineNum = 989;BA.debugLine="cmd.Initialize";
_cmd.Initialize();
 //BA.debugLineNum = 991;BA.debugLine="cmd.Parameters = Array As Object(c.GetString(\"C";
_cmd.Parameters /*Object[]*/  = new Object[]{(Object)(_c.GetString("CLIENTE")),(Object)(_c.GetString("USUARIO")),(Object)(_c.GetString("FECHA_PUNTEO")),(Object)(_c.GetString("LATITUD")),(Object)(_c.GetString("LONGITUD")),(Object)(_c.GetString("ALMACEN")),(Object)(_c.GetString("RUTA_REPARTO")),(Object)(_c.GetString("RUTA_PREV")),(Object)(_c.GetString("FECHA_PREVENTA")),(Object)(_c.GetString("MOTIVO")),(Object)(_c.GetString("COMENTARIO")),(Object)(_c.GetString("TIPO"))};
 //BA.debugLineNum = 992;BA.debugLine="reqManager.ExecuteCommand(cmd , $\"ins_REPARTOPe";
_reqmanager._executecommand /*String*/ (_cmd,(Object)(("ins_REPARTOPendientes_head_"+__c.SmartStringFormatter("",(Object)(_c.GetString("CLIENTE")))+"")));
 }
};
 };
 //BA.debugLineNum = 996;BA.debugLine="c.Close";
_c.Close();
 //BA.debugLineNum = 997;BA.debugLine="End Sub";
return "";
}
public String  _nuevo_click() throws Exception{
 //BA.debugLineNum = 456;BA.debugLine="Sub NUEVO_Click";
 //BA.debugLineNum = 457;BA.debugLine="StartActivity(MAPA_CLIENTE)";
__c.StartActivity(ba,(Object)(_mapa_cliente.getObject()));
 //BA.debugLineNum = 458;BA.debugLine="End Sub";
return "";
}
public String  _printer_connected(boolean _success) throws Exception{
 //BA.debugLineNum = 907;BA.debugLine="Sub Printer_Connected (Success As Boolean)";
 //BA.debugLineNum = 908;BA.debugLine="If Success Then";
if (_success) { 
 //BA.debugLineNum = 909;BA.debugLine="B_IMP.Enabled = True";
_b_imp.setEnabled(__c.True);
 //BA.debugLineNum = 910;BA.debugLine="PASA_IMP = \"1\"";
_pasa_imp = "1";
 }else {
 //BA.debugLineNum = 912;BA.debugLine="B_IMP.Enabled = False";
_b_imp.setEnabled(__c.False);
 //BA.debugLineNum = 913;BA.debugLine="If Msgbox2(\"\", \"Printer Error\",\"Reprint\",\"Cancel";
if (__c.Msgbox2(BA.ObjectToCharSequence(""),BA.ObjectToCharSequence("Printer Error"),"Reprint","Cancel","",(android.graphics.Bitmap)(__c.Null),ba)==__c.DialogResponse.POSITIVE) { 
 //BA.debugLineNum = 914;BA.debugLine="StartPrinter";
_startprinter();
 };
 };
 //BA.debugLineNum = 917;BA.debugLine="End Sub";
return "";
}
public String  _printer1_connected(boolean _success) throws Exception{
 //BA.debugLineNum = 886;BA.debugLine="Sub Printer1_Connected (Success As Boolean)";
 //BA.debugLineNum = 888;BA.debugLine="If Success Then";
if (_success) { 
 //BA.debugLineNum = 889;BA.debugLine="ToastMessageShow(\"Impresora conectada\", False)";
__c.ToastMessageShow(BA.ObjectToCharSequence("Impresora conectada"),__c.False);
 //BA.debugLineNum = 890;BA.debugLine="Starter.skmt.ExecNonQuery2(\"delete from CAT_VARI";
_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("delete from CAT_VARIABLES where CAT_VA_DESCRIPCION = ?",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)("MACIMP")}));
 //BA.debugLineNum = 891;BA.debugLine="Starter.skmt.ExecNonQuery2(\"INSERT INTO CAT_VARI";
_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("INSERT INTO CAT_VARIABLES(CAT_VA_DESCRIPCION, CAT_VA_VALOR) VALUES (?,?)",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)("MACIMP"),(Object)(_starter._mac_impresora /*String*/ )}));
 //BA.debugLineNum = 892;BA.debugLine="LogColor(\"Impresora conectada\", Colors.Green)";
__c.LogImpl("09043974","Impresora conectada",__c.Colors.Green);
 //BA.debugLineNum = 894;BA.debugLine="impresoraConectada = True";
_impresoraconectada = __c.True;
 }else {
 //BA.debugLineNum = 898;BA.debugLine="LogColor(\"Error conectando la impresora\", Colors";
__c.LogImpl("09043980","Error conectando la impresora",__c.Colors.Red);
 //BA.debugLineNum = 899;BA.debugLine="errorImpresora = errorImpresora + 1";
_errorimpresora = (int) (_errorimpresora+1);
 //BA.debugLineNum = 900;BA.debugLine="If errorImpresora > 1 Then";
if (_errorimpresora>1) { 
 //BA.debugLineNum = 901;BA.debugLine="Starter.MAC_IMPRESORA = \"0\"";
_starter._mac_impresora /*String*/  = "0";
 //BA.debugLineNum = 902;BA.debugLine="errorImpresora = 0";
_errorimpresora = (int) (0);
 };
 };
 //BA.debugLineNum = 905;BA.debugLine="End Sub";
return "";
}
public String  _startprinter() throws Exception{
int _resimp = 0;
int _i = 0;
 //BA.debugLineNum = 919;BA.debugLine="Sub StartPrinter";
 //BA.debugLineNum = 920;BA.debugLine="Dim PairedDevices As Map";
_paireddevices = new anywheresoftware.b4a.objects.collections.Map();
 //BA.debugLineNum = 921;BA.debugLine="Dim L As List";
_l = new anywheresoftware.b4a.objects.collections.List();
 //BA.debugLineNum = 922;BA.debugLine="Dim resimp As Int";
_resimp = 0;
 //BA.debugLineNum = 923;BA.debugLine="ToastMessageShow(\"Printing.....\",True)";
__c.ToastMessageShow(BA.ObjectToCharSequence("Printing....."),__c.True);
 //BA.debugLineNum = 924;BA.debugLine="PairedDevices.Initialize";
_paireddevices.Initialize();
 //BA.debugLineNum = 925;BA.debugLine="Try";
try { //BA.debugLineNum = 926;BA.debugLine="PairedDevices = cmp20.GetPairedDevices";
_paireddevices = _cmp20.GetPairedDevices();
 } 
       catch (Exception e9) {
			ba.setLastException(e9); //BA.debugLineNum = 928;BA.debugLine="Msgbox(\"Getting Paired Devices\",\"Printer Error\")";
__c.Msgbox(BA.ObjectToCharSequence("Getting Paired Devices"),BA.ObjectToCharSequence("Printer Error"),ba);
 //BA.debugLineNum = 929;BA.debugLine="printer.Close";
_printer.Close();
 //BA.debugLineNum = 930;BA.debugLine="cmp20.Disconnect";
_cmp20.Disconnect();
 };
 //BA.debugLineNum = 932;BA.debugLine="If PairedDevices.Size = 0 Then";
if (_paireddevices.getSize()==0) { 
 //BA.debugLineNum = 933;BA.debugLine="Msgbox(\"Error Connecting to Printer - Printer No";
__c.Msgbox(BA.ObjectToCharSequence("Error Connecting to Printer - Printer Not Found"),BA.ObjectToCharSequence(""),ba);
 //BA.debugLineNum = 934;BA.debugLine="Return";
if (true) return "";
 };
 //BA.debugLineNum = 936;BA.debugLine="If PairedDevices.Size = 1 Then";
if (_paireddevices.getSize()==1) { 
 //BA.debugLineNum = 937;BA.debugLine="Try";
try { //BA.debugLineNum = 939;BA.debugLine="cmp20.ConnectInsecure(btAdmin,PairedDevices.Get";
_cmp20.ConnectInsecure(ba,_btadmin,BA.ObjectToString(_paireddevices.Get(_paireddevices.GetKeyAt((int) (0)))),(int) (1));
 } 
       catch (Exception e21) {
			ba.setLastException(e21); //BA.debugLineNum = 942;BA.debugLine="Msgbox(\"Connecting\",\"Printer Error\") 'ignore";
__c.Msgbox(BA.ObjectToCharSequence("Connecting"),BA.ObjectToCharSequence("Printer Error"),ba);
 //BA.debugLineNum = 943;BA.debugLine="printer.Close";
_printer.Close();
 //BA.debugLineNum = 944;BA.debugLine="cmp20.Disconnect";
_cmp20.Disconnect();
 };
 }else {
 //BA.debugLineNum = 947;BA.debugLine="L.Initialize";
_l.Initialize();
 //BA.debugLineNum = 948;BA.debugLine="For i = 0 To PairedDevices.Size - 1";
{
final int step27 = 1;
final int limit27 = (int) (_paireddevices.getSize()-1);
_i = (int) (0) ;
for (;_i <= limit27 ;_i = _i + step27 ) {
 //BA.debugLineNum = 949;BA.debugLine="L.Add(PairedDevices.GetKeyAt(i))";
_l.Add(_paireddevices.GetKeyAt(_i));
 }
};
 //BA.debugLineNum = 951;BA.debugLine="resimp = InputList(L, \"Choose device\", -1) 'igno";
_resimp = __c.InputList(_l,BA.ObjectToCharSequence("Choose device"),(int) (-1),ba);
 //BA.debugLineNum = 952;BA.debugLine="If resimp <> DialogResponse.CANCEL Then";
if (_resimp!=__c.DialogResponse.CANCEL) { 
 //BA.debugLineNum = 953;BA.debugLine="cmp20.Connect(PairedDevices.Get(L.Get(resimp)))";
_cmp20.Connect(ba,BA.ObjectToString(_paireddevices.Get(_l.Get(_resimp))));
 };
 };
 //BA.debugLineNum = 956;BA.debugLine="End Sub";
return "";
}
public String  _tar_click() throws Exception{
 //BA.debugLineNum = 438;BA.debugLine="Sub Tar_Click";
 //BA.debugLineNum = 440;BA.debugLine="B4XPages.ShowPage(\"Productos\")";
_b4xpages._showpage /*String*/ (ba,"Productos");
 //BA.debugLineNum = 441;BA.debugLine="End Sub";
return "";
}
public Object callSub(String sub, Object sender, Object[] args) throws Exception {
BA.senderHolder.set(sender);
if (BA.fastSubCompare(sub, "B4XPAGE_CREATED"))
	return _b4xpage_created((anywheresoftware.b4a.objects.B4XViewWrapper) args[0]);
if (BA.fastSubCompare(sub, "GPS_LOCATIONCHANGED"))
	return _gps_locationchanged((anywheresoftware.b4a.gps.LocationWrapper) args[0]);
if (BA.fastSubCompare(sub, "JOBDONE"))
	return _jobdone((reparto_medicomed.keymon.lat.httpjob) args[0]);
return BA.SubDelegator.SubNotFound;
}
}
