package medicomed.keymon.com.mx;


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, "medicomed.keymon.com.mx.c_cliente");
            if (htSubs == null) {
                ba.loadHtSubs(this.getClass());
                htSubs = ba.htSubs;
            }
            
        }
        if (BA.isShellModeRuntimeCheck(ba)) 
			   this.getClass().getMethod("_class_globals", medicomed.keymon.com.mx.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.objects.PanelWrapper _p_cliente = null;
public medicomed.keymon.com.mx.dbrequestmanager _reqmanager = null;
public medicomed.keymon.com.mx.dbrequestmanager._dbcommand _cmd = null;
public anywheresoftware.b4a.objects.IME _ime = null;
public anywheresoftware.b4a.gps.GPS _g = null;
public String _ruta = "";
public anywheresoftware.b4a.sql.SQL _skmt = null;
public String _clie_id = "";
public String _sdate = "";
public String _stime = "";
public String _usuario = "";
public String _total_cliente = "";
public String _m_lat = "";
public String _m_lon = "";
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 String _cuenta = "";
public String _tipo_venta = "";
public String _mac_impresora = "";
public medicomed.keymon.com.mx.escposprinter _printer1 = null;
public anywheresoftware.b4a.sql.SQL.CursorWrapper _c = null;
public anywheresoftware.b4a.sql.SQL.CursorWrapper _s = null;
public anywheresoftware.b4a.sql.SQL.CursorWrapper _dd = null;
public anywheresoftware.b4a.sql.SQL.CursorWrapper _c2 = 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 boolean _impresoraconectada = false;
public anywheresoftware.b4a.objects.ButtonWrapper _tels = null;
public anywheresoftware.b4a.objects.LabelWrapper _label10 = null;
public anywheresoftware.b4a.objects.LabelWrapper _label11 = null;
public anywheresoftware.b4a.objects.ButtonWrapper _tar = null;
public int _errorimpresora = 0;
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.sql.SQL.CursorWrapper _s2 = null;
public String _res = "";
public anywheresoftware.b4a.sql.SQL.CursorWrapper _credi = null;
public anywheresoftware.b4a.objects.ButtonWrapper _hist = null;
public String _monto_compra = "";
public String _meta = "";
public String _meta2 = "";
public String _verifica = "";
public anywheresoftware.b4a.objects.LabelWrapper _l_qr = null;
public anywheresoftware.b4a.objects.ButtonWrapper _bt_qr = null;
public String _codigo = "";
public anywheresoftware.b4a.objects.ButtonWrapper _b_mapa = null;
public String _cuantos = "";
public anywheresoftware.b4a.objects.ButtonWrapper _b_imp = null;
public com.rootsoft.togglelibrary.ToggleLibrary _toggla = null;
public com.rootsoft.togglelibrary.ToggleLibrary _tgl = null;
public float _pre_act = 0f;
public anywheresoftware.b4a.objects.PanelWrapper _panel1 = null;
public anywheresoftware.b4a.objects.EditTextWrapper _i_compra = null;
public anywheresoftware.b4a.objects.ButtonWrapper _b_guarda_c = null;
public anywheresoftware.b4a.objects.ButtonWrapper _b_venta = null;
public String _almacen = "";
public anywheresoftware.b4a.objects.LabelWrapper _la_gps = null;
public anywheresoftware.b4a.objects.ButtonWrapper _b_e_next = null;
public anywheresoftware.b4a.objects.EditTextWrapper _e_res_e = null;
public anywheresoftware.b4a.objects.LabelWrapper _t_tenc = null;
public anywheresoftware.b4a.objects.PanelWrapper _panel2 = null;
public String _contador_e = "";
public String _hr_res1 = "";
public String _hr_res2 = "";
public String _hr_res3 = "";
public String _existe = "";
public String _telefono = "";
public anywheresoftware.b4a.objects.Timer _t1 = null;
public anywheresoftware.b4a.objects.CompoundButtonWrapper.RadioButtonWrapper _rb1 = null;
public anywheresoftware.b4a.objects.CompoundButtonWrapper.RadioButtonWrapper _rb2 = null;
public anywheresoftware.b4a.objects.CompoundButtonWrapper.RadioButtonWrapper _rb3 = null;
public anywheresoftware.b4a.objects.CompoundButtonWrapper.RadioButtonWrapper _rb4 = null;
public anywheresoftware.b4a.objects.CompoundButtonWrapper.RadioButtonWrapper _rb5 = null;
public String _stay_hh = "";
public String _stay_mi = "";
public String _stay_ss = "";
public anywheresoftware.b4a.objects.LabelWrapper _la_geo = null;
public int _result = 0;
public String _cercavalor = "";
public String _la_ruta = "";
public anywheresoftware.b4a.objects.ButtonWrapper _b_like = null;
public anywheresoftware.b4a.objects.ButtonWrapper _b_gps = null;
public anywheresoftware.b4a.objects.CompoundButtonWrapper.CheckBoxWrapper _cb_factura = null;
public anywheresoftware.b4a.objects.PanelWrapper _p_cbfactura = null;
public boolean _venimosdeticketsdia = false;
public anywheresoftware.b4a.objects.PanelWrapper _p_abono = null;
public anywheresoftware.b4a.objects.EditTextWrapper _et_abono = null;
public anywheresoftware.b4a.objects.ButtonWrapper _b_abono = null;
public anywheresoftware.b4a.objects.ButtonWrapper _b_cancelar = null;
public anywheresoftware.b4a.objects.ButtonWrapper _b_abono1 = null;
public anywheresoftware.b4a.sql.SQL.CursorWrapper _b = null;
public anywheresoftware.b4a.objects.ButtonWrapper _b_cxc = null;
public b4a.example3.customlistview _clv_abonos = null;
public anywheresoftware.b4a.objects.LabelWrapper _l_folio = null;
public anywheresoftware.b4a.objects.LabelWrapper _l_saldo = null;
public anywheresoftware.b4a.sql.SQL.CursorWrapper _d = null;
public anywheresoftware.b4a.sql.SQL.CursorWrapper _f = null;
public anywheresoftware.b4a.objects.LabelWrapper _l_montoabonostotal = null;
public anywheresoftware.b4a.sql.SQL.CursorWrapper _j = null;
public anywheresoftware.b4a.sql.SQL.CursorWrapper _h = null;
public long _distance = 0L;
public medicomed.keymon.com.mx.c_cuestionario _cuest = null;
public anywheresoftware.b4a.objects.ButtonWrapper _b_ventaabordo = null;
public anywheresoftware.b4a.objects.LabelWrapper _l_factura = null;
public anywheresoftware.b4a.objects.LabelWrapper _l_limite = null;
public anywheresoftware.b4a.objects.EditTextWrapper _et_montoacredito = null;
public anywheresoftware.b4a.objects.ButtonWrapper _b_cancred = null;
public anywheresoftware.b4a.objects.ButtonWrapper _b_acred = null;
public anywheresoftware.b4a.objects.PanelWrapper _p_credito = null;
public int _banderaimp = 0;
public String _k1 = "";
public String _k2 = "";
public String _k3 = "";
public anywheresoftware.b4a.objects.ButtonWrapper _b_ubicar = null;
public medicomed.keymon.com.mx.c_bitacora _bitacora = null;
public String _motivonoventa = "";
public String _motivonovisita = "";
public String _imprimirsolo = "";
public String _siimprimio = "";
public b4a.example.dateutils _dateutils = null;
public medicomed.keymon.com.mx.main _main = null;
public medicomed.keymon.com.mx.starter _starter = null;
public medicomed.keymon.com.mx.appupdater _appupdater = null;
public medicomed.keymon.com.mx.mapa_rutas _mapa_rutas = null;
public medicomed.keymon.com.mx.mapa_cliente _mapa_cliente = null;
public medicomed.keymon.com.mx.subs _subs = null;
public medicomed.keymon.com.mx.notificationservice _notificationservice = null;
public medicomed.keymon.com.mx.pendientes _pendientes = null;
public medicomed.keymon.com.mx.tracker _tracker = null;
public medicomed.keymon.com.mx.newinst2 _newinst2 = null;
public medicomed.keymon.com.mx.b4xpages _b4xpages = null;
public medicomed.keymon.com.mx.b4xcollections _b4xcollections = null;
public medicomed.keymon.com.mx.httputils2service _httputils2service = null;
public medicomed.keymon.com.mx.xuiviewsutils _xuiviewsutils = null;
public void  _b_abono_click() throws Exception{
ResumableSub_b_abono_Click rsub = new ResumableSub_b_abono_Click(this);
rsub.resume(ba, null);
}
public static class ResumableSub_b_abono_Click extends BA.ResumableSub {
public ResumableSub_b_abono_Click(medicomed.keymon.com.mx.c_cliente parent) {
this.parent = parent;
}
medicomed.keymon.com.mx.c_cliente parent;
int _resultado = 0;

@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 = 2434;BA.debugLine="If et_abono.text > l_montoabonostotal.text Then";
if (true) break;

case 1:
//if
this.state = 14;
if ((double)(Double.parseDouble(parent._et_abono.getText()))>(double)(Double.parseDouble(parent._l_montoabonostotal.getText()))) { 
this.state = 3;
}else {
this.state = 5;
}if (true) break;

case 3:
//C
this.state = 14;
 //BA.debugLineNum = 2435;BA.debugLine="MsgboxAsync(\"El monto a abonar no puede ser mayo";
parent.__c.MsgboxAsync(BA.ObjectToCharSequence("El monto a abonar no puede ser mayor que el monto total"),BA.ObjectToCharSequence("Atención"),ba);
 if (true) break;

case 5:
//C
this.state = 6;
 //BA.debugLineNum = 2437;BA.debugLine="If et_abono.Text <> \"\" Then";
if (true) break;

case 6:
//if
this.state = 13;
if ((parent._et_abono.getText()).equals("") == false) { 
this.state = 8;
}if (true) break;

case 8:
//C
this.state = 9;
 //BA.debugLineNum = 2438;BA.debugLine="Msgbox2Async($\"¿Seguro que quieres realizar un";
parent.__c.Msgbox2Async(BA.ObjectToCharSequence(("¿Seguro que quieres realizar un abono de $"+parent.__c.SmartStringFormatter("",(Object)(parent._et_abono.getText()))+" para este cliente?")),BA.ObjectToCharSequence("Guardar Abono"),"Guardar","Cancelar","",(anywheresoftware.b4a.objects.drawable.CanvasWrapper.BitmapWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.drawable.CanvasWrapper.BitmapWrapper(), (android.graphics.Bitmap)(parent.__c.Null)),ba,parent.__c.True);
 //BA.debugLineNum = 2439;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 = 9;
_resultado = (Integer) result[0];
;
 //BA.debugLineNum = 2440;BA.debugLine="If resultado = DialogResponse.POSITIVE Then";
if (true) break;

case 9:
//if
this.state = 12;
if (_resultado==parent.__c.DialogResponse.POSITIVE) { 
this.state = 11;
}if (true) break;

case 11:
//C
this.state = 12;
 //BA.debugLineNum = 2441;BA.debugLine="imprime_pagare";
parent._imprime_pagare();
 if (true) break;

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

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

case 14:
//C
this.state = -1;
;
 //BA.debugLineNum = 2446;BA.debugLine="ime.HideKeyboard";
parent._ime.HideKeyboard(ba);
 //BA.debugLineNum = 2447;BA.debugLine="End Sub";
if (true) break;

            }
        }
    }
}
public void  _msgbox_result(int _resultado) throws Exception{
}
public String  _b_abono1_click() throws Exception{
 //BA.debugLineNum = 2455;BA.debugLine="Private Sub b_abono1_Click";
 //BA.debugLineNum = 2456;BA.debugLine="p_abono.Visible = True";
_p_abono.setVisible(__c.True);
 //BA.debugLineNum = 2457;BA.debugLine="End Sub";
return "";
}
public String  _b_acred_click() throws Exception{
anywheresoftware.b4a.sql.SQL.CursorWrapper _limitcred = null;
 //BA.debugLineNum = 803;BA.debugLine="Private Sub b_acred_Click";
 //BA.debugLineNum = 804;BA.debugLine="c2=B4XPages.MainPage.skmt.ExecQuery(\"select USUAR";
_c2 = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select USUARIO from usuarioa")));
 //BA.debugLineNum = 805;BA.debugLine="c2.Position=0";
_c2.setPosition((int) (0));
 //BA.debugLineNum = 806;BA.debugLine="usuario = c2.GetString(\"USUARIO\")";
_usuario = _c2.GetString("USUARIO");
 //BA.debugLineNum = 807;BA.debugLine="c2.Close";
_c2.Close();
 //BA.debugLineNum = 808;BA.debugLine="Dim limitcred As Cursor";
_limitcred = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
 //BA.debugLineNum = 809;BA.debugLine="DateTime.DateFormat = \"MM/dd/yyyy\"";
__c.DateTime.setDateFormat("MM/dd/yyyy");
 //BA.debugLineNum = 810;BA.debugLine="DateTime.TimeFormat = \"HH:mm:ss\"";
__c.DateTime.setTimeFormat("HH:mm:ss");
 //BA.debugLineNum = 811;BA.debugLine="sDate = DateTime.Date(DateTime.Now)";
_sdate = __c.DateTime.Date(__c.DateTime.getNow());
 //BA.debugLineNum = 812;BA.debugLine="sTime = DateTime.Time(DateTime.Now)";
_stime = __c.DateTime.Time(__c.DateTime.getNow());
 //BA.debugLineNum = 813;BA.debugLine="limitcred = B4XPages.MainPage.skmt.ExecQuery(\"SEL";
_limitcred = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("SELECT CAT_CL_LIMITECREDITO FROM kmt_info WHERE CAT_CL_CODIGO IN (SELECT CUENTA FROM CUENTAA) UNION SELECT CAT_CL_LIMITECREDITO FROM kmt_info WHERE CAT_CL_CODIGO IN (SELECT CUENTA FROM CUENTAA)")));
 //BA.debugLineNum = 814;BA.debugLine="limitcred.Position = 0";
_limitcred.setPosition((int) (0));
 //BA.debugLineNum = 815;BA.debugLine="l_limite.Text = \"Limite de credito: $\" & limitcre";
_l_limite.setText(BA.ObjectToCharSequence("Limite de credito: $"+_limitcred.GetString("CAT_CL_LIMITECREDITO")));
 //BA.debugLineNum = 816;BA.debugLine="If Subs.traeTotalClientepreventaparacredito(la_cu";
if (_subs._traetotalclientepreventaparacredito /*double*/ (ba,_la_cuenta.getText())>=(double)(Double.parseDouble(_limitcred.GetString("CAT_CL_LIMITECREDITO")))) { 
 //BA.debugLineNum = 818;BA.debugLine="If et_montoacredito.Text > limitcred.GetString(\"";
if ((double)(Double.parseDouble(_et_montoacredito.getText()))>(double)(Double.parseDouble(_limitcred.GetString("CAT_CL_LIMITECREDITO")))) { 
 //BA.debugLineNum = 819;BA.debugLine="MsgboxAsync(\"El monto del pagare no puede ser m";
__c.MsgboxAsync(BA.ObjectToCharSequence("El monto del pagare no puede ser mayor al limite del credito"),BA.ObjectToCharSequence("Atención"),ba);
 //BA.debugLineNum = 820;BA.debugLine="et_montoacredito.Text = limitcred.GetString(\"CA";
_et_montoacredito.setText(BA.ObjectToCharSequence(_limitcred.GetString("CAT_CL_LIMITECREDITO")));
 }else {
 //BA.debugLineNum = 822;BA.debugLine="c = B4XPages.MainPage.skmt.ExecQuery(\"SELECT CO";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("SELECT COUNT(*) As REGISTRADO FROM PAGARES WHERE PA_CLIENTE IN (SELECT CUENTA FROM CUENTAA)")));
 //BA.debugLineNum = 823;BA.debugLine="c.Position = 0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 824;BA.debugLine="If c.GetString(\"REGISTRADO\") = 0 Then";
if ((_c.GetString("REGISTRADO")).equals(BA.NumberToString(0))) { 
 //BA.debugLineNum = 826;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"INSERT I";
_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("INSERT INTO PAGARES (PA_ALMACEN, PA_RUTA, PA_FECHA, PA_CAPTURA, PA_MONTO, PA_USUARIO, PA_CLIENTE) VALUES(?,?,?,?,?,?,?) ",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(_almacen),(Object)(_la_ruta),(Object)((_sdate+" "+_stime)),(Object)((_sdate+" "+_stime)),(Object)(_et_montoacredito.getText()),(Object)(_usuario),(Object)(_la_cuenta.getText())}));
 //BA.debugLineNum = 827;BA.debugLine="GuardaVenta";
_guardaventa();
 //BA.debugLineNum = 828;BA.debugLine="p_credito.Visible = False";
_p_credito.setVisible(__c.False);
 }else {
 //BA.debugLineNum = 831;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"UPDATE P";
_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("UPDATE PAGARES set PA_FECHA = ?, PA_CAPTURA = ?, PA_MONTO = ? where PA_CLIENTE In (select cuenta from cuentaa)",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)((_sdate+" "+_stime)),(Object)((_sdate+" "+_stime)),(Object)(_et_montoacredito.getText())}));
 //BA.debugLineNum = 832;BA.debugLine="GuardaVenta";
_guardaventa();
 //BA.debugLineNum = 833;BA.debugLine="p_credito.Visible = False";
_p_credito.setVisible(__c.False);
 };
 };
 }else if(_subs._traetotalclientepreventaparacredito /*double*/ (ba,_la_cuenta.getText())<(double)(Double.parseDouble(_limitcred.GetString("CAT_CL_LIMITECREDITO")))) { 
 //BA.debugLineNum = 837;BA.debugLine="If et_montoacredito.Text > Subs.traeTotalCliente";
if ((double)(Double.parseDouble(_et_montoacredito.getText()))>_subs._traetotalclientepreventaparacredito /*double*/ (ba,_la_cuenta.getText())) { 
 //BA.debugLineNum = 838;BA.debugLine="MsgboxAsync(\"El monto del pagare no puede ser m";
__c.MsgboxAsync(BA.ObjectToCharSequence("El monto del pagare no puede ser mayor a la preventa registrada"),BA.ObjectToCharSequence("Atención"),ba);
 //BA.debugLineNum = 839;BA.debugLine="et_montoacredito.Text = Subs.traeTotalClientepr";
_et_montoacredito.setText(BA.ObjectToCharSequence(_subs._traetotalclientepreventaparacredito /*double*/ (ba,_la_cuenta.getText())));
 }else {
 //BA.debugLineNum = 841;BA.debugLine="c = B4XPages.MainPage.skmt.ExecQuery(\"SELECT CO";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("SELECT COUNT(*) As REGISTRADO FROM PAGARES WHERE PA_CLIENTE IN (SELECT CUENTA FROM CUENTAA)")));
 //BA.debugLineNum = 842;BA.debugLine="c.Position = 0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 843;BA.debugLine="If c.GetString(\"REGISTRADO\") = 0 Then";
if ((_c.GetString("REGISTRADO")).equals(BA.NumberToString(0))) { 
 //BA.debugLineNum = 845;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"INSERT I";
_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("INSERT INTO PAGARES (PA_ALMACEN, PA_RUTA, PA_FECHA, PA_CAPTURA, PA_MONTO, PA_USUARIO, PA_CLIENTE) VALUES(?,?,?,?,?,?,?) ",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(_almacen),(Object)(_la_ruta),(Object)((_sdate+" "+_stime)),(Object)((_sdate+" "+_stime)),(Object)(_et_montoacredito.getText()),(Object)(_usuario),(Object)(_la_cuenta.getText())}));
 //BA.debugLineNum = 846;BA.debugLine="GuardaVenta";
_guardaventa();
 //BA.debugLineNum = 847;BA.debugLine="p_credito.Visible = False";
_p_credito.setVisible(__c.False);
 }else {
 //BA.debugLineNum = 850;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"UPDATE P";
_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("UPDATE PAGARES set PA_FECHA = ?, PA_CAPTURA = ?, PA_MONTO = ? where PA_CLIENTE In (select cuenta from cuentaa)",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)((_sdate+" "+_stime)),(Object)((_sdate+" "+_stime)),(Object)(_et_montoacredito.getText())}));
 //BA.debugLineNum = 851;BA.debugLine="GuardaVenta";
_guardaventa();
 //BA.debugLineNum = 852;BA.debugLine="p_credito.Visible = False";
_p_credito.setVisible(__c.False);
 };
 };
 };
 //BA.debugLineNum = 856;BA.debugLine="limitcred.Close";
_limitcred.Close();
 //BA.debugLineNum = 857;BA.debugLine="End Sub";
return "";
}
public String  _b_cancelar_click() throws Exception{
 //BA.debugLineNum = 2449;BA.debugLine="Private Sub b_cancelar_Click";
 //BA.debugLineNum = 2450;BA.debugLine="et_abono.Text = \"\"";
_et_abono.setText(BA.ObjectToCharSequence(""));
 //BA.debugLineNum = 2451;BA.debugLine="p_abono.Visible = False";
_p_abono.setVisible(__c.False);
 //BA.debugLineNum = 2452;BA.debugLine="ime.HideKeyboard";
_ime.HideKeyboard(ba);
 //BA.debugLineNum = 2453;BA.debugLine="End Sub";
return "";
}
public String  _b_cancred_click() throws Exception{
 //BA.debugLineNum = 859;BA.debugLine="Private Sub b_cancred_Click";
 //BA.debugLineNum = 860;BA.debugLine="p_credito.Visible = False";
_p_credito.setVisible(__c.False);
 //BA.debugLineNum = 861;BA.debugLine="End Sub";
return "";
}
public String  _b_cxc_click() throws Exception{
String _total = "";
int _i = 0;
 //BA.debugLineNum = 2459;BA.debugLine="Private Sub b_cxc_Click";
 //BA.debugLineNum = 2461;BA.debugLine="h = B4XPages.MainPage.skmt.ExecQuery(\"SELECT CUEN";
_h = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("SELECT CUENTA from CUENTAA")));
 //BA.debugLineNum = 2462;BA.debugLine="h.Position = 0";
_h.setPosition((int) (0));
 //BA.debugLineNum = 2463;BA.debugLine="Log(h.GetString(\"CUENTA\"))";
__c.LogImpl("754657028",_h.GetString("CUENTA"),0);
 //BA.debugLineNum = 2464;BA.debugLine="j = B4XPages.MainPage.skmt.ExecQuery2(\"SELECT a_a";
_j = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery2("SELECT a_abono AS CUANTOS FROM ABONOS WHERE a_cliente = ?",new String[]{_h.GetString("CUENTA")})));
 //BA.debugLineNum = 2465;BA.debugLine="j.position = 0";
_j.setPosition((int) (0));
 //BA.debugLineNum = 2466;BA.debugLine="Log(j.RowCount)";
__c.LogImpl("754657031",BA.NumberToString(_j.getRowCount()),0);
 //BA.debugLineNum = 2467;BA.debugLine="If j.RowCount = 0 Then";
if (_j.getRowCount()==0) { 
 //BA.debugLineNum = 2469;BA.debugLine="p_abono.Visible = True";
_p_abono.setVisible(__c.True);
 //BA.debugLineNum = 2470;BA.debugLine="Dim total As String = 0";
_total = BA.NumberToString(0);
 //BA.debugLineNum = 2471;BA.debugLine="f = B4XPages.MainPage.skmt.ExecQuery(\"SELECT CUE";
_f = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("SELECT CUENTA FROM CUENTAA")));
 //BA.debugLineNum = 2472;BA.debugLine="f.Position = 0";
_f.setPosition((int) (0));
 //BA.debugLineNum = 2474;BA.debugLine="d = B4XPages.MainPage.skmt.ExecQuery2(\"SELECT NO";
_d = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery2("SELECT NOTA, SALDO_PENDIENTE FROM ABONOSP WHERE CLIENTE = ? ",new String[]{_f.GetString("CUENTA")})));
 //BA.debugLineNum = 2475;BA.debugLine="clv_abonos.Clear";
_clv_abonos._clear();
 //BA.debugLineNum = 2476;BA.debugLine="For i = 0 To d.RowCount - 1";
{
final int step14 = 1;
final int limit14 = (int) (_d.getRowCount()-1);
_i = (int) (0) ;
for (;_i <= limit14 ;_i = _i + step14 ) {
 //BA.debugLineNum = 2477;BA.debugLine="d.Position = i";
_d.setPosition(_i);
 //BA.debugLineNum = 2478;BA.debugLine="clv_abonos.Add(CreateListItem(d.GetString(\"NOTA";
_clv_abonos._add((anywheresoftware.b4a.objects.B4XViewWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.B4XViewWrapper(), (java.lang.Object)(_createlistitem(_d.GetString("NOTA"),"$ "+_d.GetString("SALDO_PENDIENTE")).getObject())),(Object)(_i));
 //BA.debugLineNum = 2479;BA.debugLine="Log(d.GetString(\"NOTA\"))";
__c.LogImpl("754657044",_d.GetString("NOTA"),0);
 //BA.debugLineNum = 2480;BA.debugLine="Log(d.GetString(\"SALDO_PENDIENTE\"))";
__c.LogImpl("754657045",_d.GetString("SALDO_PENDIENTE"),0);
 //BA.debugLineNum = 2481;BA.debugLine="total = total + d.GetString(\"SALDO_PENDIENTE\")";
_total = BA.NumberToString((double)(Double.parseDouble(_total))+(double)(Double.parseDouble(_d.GetString("SALDO_PENDIENTE"))));
 //BA.debugLineNum = 2482;BA.debugLine="Log(total)";
__c.LogImpl("754657047",_total,0);
 }
};
 //BA.debugLineNum = 2484;BA.debugLine="l_montoabonostotal.Text = total";
_l_montoabonostotal.setText(BA.ObjectToCharSequence(_total));
 //BA.debugLineNum = 2485;BA.debugLine="d.Close";
_d.Close();
 //BA.debugLineNum = 2486;BA.debugLine="f.Close";
_f.Close();
 }else if(_j.getRowCount()>0) { 
 //BA.debugLineNum = 2489;BA.debugLine="MsgboxAsync(\"Este cliente ya tiene un pago captu";
__c.MsgboxAsync(BA.ObjectToCharSequence("Este cliente ya tiene un pago capturado"),BA.ObjectToCharSequence("Atención"),ba);
 };
 //BA.debugLineNum = 2491;BA.debugLine="h.Close";
_h.Close();
 //BA.debugLineNum = 2492;BA.debugLine="j.Close";
_j.Close();
 //BA.debugLineNum = 2495;BA.debugLine="End Sub";
return "";
}
public String  _b_cxc_longclick() throws Exception{
 //BA.debugLineNum = 2729;BA.debugLine="Private Sub b_cxc_LongClick";
 //BA.debugLineNum = 2731;BA.debugLine="End Sub";
return "";
}
public String  _b_e_next_click() throws Exception{
 //BA.debugLineNum = 1970;BA.debugLine="Sub B_E_NEXT_Click";
 //BA.debugLineNum = 1971;BA.debugLine="If E_RES_E.Text <> \"\" Then";
if ((_e_res_e.getText()).equals("") == false) { 
 //BA.debugLineNum = 1972;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"insert int";
_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("insert into HIST_ENCUESTA(HE_CLIE, HE_RES, HE_FECHA, HE_TIPO) VALUES (?,?,?,?)",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(_la_cuenta.getText()),(Object)(_e_res_e.getText()),(Object)(_sdate+_stime),(Object)("DONDE")}));
 //BA.debugLineNum = 1973;BA.debugLine="Panel2.Visible = False";
_panel2.setVisible(__c.False);
 //BA.debugLineNum = 1974;BA.debugLine="B4XPages.ShowPage(\"Productos\")";
_b4xpages._showpage /*String*/ (ba,"Productos");
 }else {
 //BA.debugLineNum = 1976;BA.debugLine="Msgbox(\"SIN RESPUESTA\",\"AVISO\") 'Ignore";
__c.Msgbox(BA.ObjectToCharSequence("SIN RESPUESTA"),BA.ObjectToCharSequence("AVISO"),ba);
 };
 //BA.debugLineNum = 1978;BA.debugLine="End Sub";
return "";
}
public String  _b_guarda_c_click() throws Exception{
 //BA.debugLineNum = 1913;BA.debugLine="Sub B_GUARDA_C_Click";
 //BA.debugLineNum = 1914;BA.debugLine="DateTime.DateFormat = \"MM/dd/yyyy\"";
__c.DateTime.setDateFormat("MM/dd/yyyy");
 //BA.debugLineNum = 1915;BA.debugLine="sDate=DateTime.Date(DateTime.Now)";
_sdate = __c.DateTime.Date(__c.DateTime.getNow());
 //BA.debugLineNum = 1916;BA.debugLine="sTime=DateTime.Time(DateTime.Now)";
_stime = __c.DateTime.Time(__c.DateTime.getNow());
 //BA.debugLineNum = 1917;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"Select CUENTA";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("Select CUENTA from cuentaa")));
 //BA.debugLineNum = 1918;BA.debugLine="c.Position=0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 1919;BA.debugLine="clie_id = c.GetString(\"CUENTA\")";
_clie_id = _c.GetString("CUENTA");
 //BA.debugLineNum = 1920;BA.debugLine="c.Close";
_c.Close();
 //BA.debugLineNum = 1921;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"select USUARI";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select USUARIO from usuarioa")));
 //BA.debugLineNum = 1922;BA.debugLine="c.Position=0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 1923;BA.debugLine="usuario = c.GetString(\"USUARIO\")";
_usuario = _c.GetString("USUARIO");
 //BA.debugLineNum = 1924;BA.debugLine="c.Close";
_c.Close();
 //BA.debugLineNum = 1925;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"INSERT INTO";
_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("INSERT INTO  PEDIDO (PE_CEDIS,PE_COSTO_TOT,PE_COSTOU,PE_CANT,PE_PRONOMBRE,PE_PROID,PE_CLIENTE,PE_FECHA,PE_USUARIO,PE_RUTA) VALUES(?,?,?,?,?,?,?,?,?,?) ",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)("4"),(Object)(.01),(Object)(.01),(Object)(2),(Object)("KNORR RINDE MAS 70 GR"),(Object)("GUNA2"),(Object)(_la_cuenta.getText()),(Object)(_sdate+_stime),(Object)(_usuario),(Object)(_la_ruta)}));
 //BA.debugLineNum = 1926;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"INSERT INTO";
_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("INSERT INTO HIST_FACE(HFCLIENTE, HFALIAS,HFRUTA,HFALMACEN) VALUES (?,?,?,?) ",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(_la_cuenta.getText()),(Object)(_i_compra.getText()),(Object)(_la_ruta),(Object)(_almacen)}));
 //BA.debugLineNum = 1927;BA.debugLine="Panel1.Visible = False";
_panel1.setVisible(__c.False);
 //BA.debugLineNum = 1929;BA.debugLine="Tar.Visible = True";
_tar.setVisible(__c.True);
 //BA.debugLineNum = 1930;BA.debugLine="Tels.Visible = True";
_tels.setVisible(__c.True);
 //BA.debugLineNum = 1931;BA.debugLine="gest.Visible = True";
_gest.setVisible(__c.True);
 //BA.debugLineNum = 1933;BA.debugLine="Guardar.Visible = True";
_guardar.setVisible(__c.True);
 //BA.debugLineNum = 1934;BA.debugLine="End Sub";
return "";
}
public String  _b_imp_click() throws Exception{
 //BA.debugLineNum = 1186;BA.debugLine="Sub B_IMP_Click";
 //BA.debugLineNum = 1187;BA.debugLine="If imprimirsolo <> 1 Then";
if ((_imprimirsolo).equals(BA.NumberToString(1)) == false) { 
 //BA.debugLineNum = 1188;BA.debugLine="imprimirsolo = 0";
_imprimirsolo = BA.NumberToString(0);
 };
 //BA.debugLineNum = 1190;BA.debugLine="Log(imprimirsolo)";
__c.LogImpl("753018628",_imprimirsolo,0);
 //BA.debugLineNum = 1191;BA.debugLine="c = skmt.ExecQuery2(\"SELECT * FROM PEDIDO WHERE P";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_skmt.ExecQuery2("SELECT * FROM PEDIDO WHERE PE_FOLIO = ? AND PE_CLIENTE IN (SELECT CUENTA FROM CUENTAA)",new String[]{"PREVENTA_48"})));
 //BA.debugLineNum = 1192;BA.debugLine="If c.RowCount > 0 Then";
if (_c.getRowCount()>0) { 
 //BA.debugLineNum = 1193;BA.debugLine="imprime_venta";
_imprime_venta();
 //BA.debugLineNum = 1194;BA.debugLine="t1.Initialize(\"T1\", 3000) ' 1000 = 1 second";
_t1.Initialize(ba,"T1",(long) (3000));
 //BA.debugLineNum = 1195;BA.debugLine="t1.Enabled = True";
_t1.setEnabled(__c.True);
 }else if(_c.getRowCount()==0) { 
 //BA.debugLineNum = 1197;BA.debugLine="s = skmt.ExecQuery2(\"SELECT * FROM PEDIDO WHERE";
_s = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_skmt.ExecQuery2("SELECT * FROM PEDIDO WHERE PE_FOLIO = ? AND PE_CLIENTE IN (SELECT CUENTA FROM CUENTAA)",new String[]{"PREVENTA"})));
 //BA.debugLineNum = 1198;BA.debugLine="If s.RowCount > 0 Then";
if (_s.getRowCount()>0) { 
 //BA.debugLineNum = 1199;BA.debugLine="imprime_preventa";
_imprime_preventa();
 };
 };
 //BA.debugLineNum = 1203;BA.debugLine="End Sub";
return "";
}
public String  _b_mapa_click() throws Exception{
 //BA.debugLineNum = 1182;BA.debugLine="Sub b_mapa_Click";
 //BA.debugLineNum = 1183;BA.debugLine="B4XPages.ShowPage(\"mapas\")";
_b4xpages._showpage /*String*/ (ba,"mapas");
 //BA.debugLineNum = 1184;BA.debugLine="End Sub";
return "";
}
public String  _b_preventa_click() throws Exception{
 //BA.debugLineNum = 2741;BA.debugLine="Private Sub b_preventa_Click";
 //BA.debugLineNum = 2743;BA.debugLine="End Sub";
return "";
}
public String  _b_ubicar_click() throws Exception{
 //BA.debugLineNum = 2733;BA.debugLine="Private Sub b_ubicar_Click";
 //BA.debugLineNum = 2734;BA.debugLine="StartActivity(MAPA_CLIENTE)";
__c.StartActivity(ba,(Object)(_mapa_cliente.getObject()));
 //BA.debugLineNum = 2735;BA.debugLine="End Sub";
return "";
}
public String  _b_venta_click() throws Exception{
 //BA.debugLineNum = 1936;BA.debugLine="Sub b_venta_Click";
 //BA.debugLineNum = 1937;BA.debugLine="DateTime.DateFormat = \"MM/dd/yyyy\"";
__c.DateTime.setDateFormat("MM/dd/yyyy");
 //BA.debugLineNum = 1938;BA.debugLine="sDate=DateTime.Date(DateTime.Now)";
_sdate = __c.DateTime.Date(__c.DateTime.getNow());
 //BA.debugLineNum = 1939;BA.debugLine="sTime=DateTime.Time(DateTime.Now)";
_stime = __c.DateTime.Time(__c.DateTime.getNow());
 //BA.debugLineNum = 1940;BA.debugLine="B4XPages.MainPage.tipo_venta = \"PREVENTA_48\"";
_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._tipo_venta /*String*/  = "PREVENTA_48";
 //BA.debugLineNum = 1968;BA.debugLine="End Sub";
return "";
}
public String  _b_ventaabordo_click() throws Exception{
 //BA.debugLineNum = 2578;BA.debugLine="Private Sub b_ventaabordo_Click";
 //BA.debugLineNum = 2580;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery2(\"Select * Fro";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery2("Select * From CAT_GUNAPROD2 where cat_gp_tipo <> ? ",new String[]{"PROMOS"})));
 //BA.debugLineNum = 2581;BA.debugLine="If c.RowCount > 0 Then";
if (_c.getRowCount()>0) { 
 //BA.debugLineNum = 2583;BA.debugLine="B4XPages.MainPage.tipo_venta = \"PREVENTA_48\"";
_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._tipo_venta /*String*/  = "PREVENTA_48";
 //BA.debugLineNum = 2618;BA.debugLine="B4XPages.ShowPage(\"productos\")";
_b4xpages._showpage /*String*/ (ba,"productos");
 }else if(_c.getRowCount()==0) { 
 //BA.debugLineNum = 2623;BA.debugLine="MsgboxAsync(\"No puedes hacer venta porque no tie";
__c.MsgboxAsync(BA.ObjectToCharSequence("No puedes hacer venta porque no tienes inventario abordo"),BA.ObjectToCharSequence("Atención"),ba);
 };
 //BA.debugLineNum = 2627;BA.debugLine="End Sub";
return "";
}
public String  _b4xpage_appear() throws Exception{
String _cabonos = "";
String _factura = "";
 //BA.debugLineNum = 253;BA.debugLine="Sub B4XPage_Appear";
 //BA.debugLineNum = 256;BA.debugLine="Guardar.Enabled = True";
_guardar.setEnabled(__c.True);
 //BA.debugLineNum = 257;BA.debugLine="gest.Enabled = True";
_gest.setEnabled(__c.True);
 //BA.debugLineNum = 258;BA.debugLine="b_cxc.Enabled = False";
_b_cxc.setEnabled(__c.False);
 //BA.debugLineNum = 259;BA.debugLine="Tar.Enabled = True";
_tar.setEnabled(__c.True);
 //BA.debugLineNum = 260;BA.debugLine="Tels.Enabled = True";
_tels.setEnabled(__c.True);
 //BA.debugLineNum = 261;BA.debugLine="b_ventaabordo.Enabled = False";
_b_ventaabordo.setEnabled(__c.False);
 //BA.debugLineNum = 262;BA.debugLine="HIST.Enabled = True";
_hist.setEnabled(__c.True);
 //BA.debugLineNum = 263;BA.debugLine="reqManager.Initialize(Me, Starter.DBReqServer)";
_reqmanager._initialize /*String*/ (ba,this,_starter._dbreqserver /*String*/ );
 //BA.debugLineNum = 264;BA.debugLine="LA_GPS.TextColor = Colors.Red";
_la_gps.setTextColor(__c.Colors.Red);
 //BA.debugLineNum = 265;BA.debugLine="LA_GPS.Text = \"SIN UBICACION GPS\"";
_la_gps.setText(BA.ObjectToCharSequence("SIN UBICACION GPS"));
 //BA.debugLineNum = 266;BA.debugLine="cercavalor = 0";
_cercavalor = BA.NumberToString(0);
 //BA.debugLineNum = 267;BA.debugLine="Tels.Visible = False";
_tels.setVisible(__c.False);
 //BA.debugLineNum = 268;BA.debugLine="gest.Visible = False";
_gest.setVisible(__c.False);
 //BA.debugLineNum = 271;BA.debugLine="b_ventaabordo.Visible = False";
_b_ventaabordo.setVisible(__c.False);
 //BA.debugLineNum = 273;BA.debugLine="If Subs.hayPedido Then 'Si hay pedido, deshabilit";
if (_subs._haypedido /*boolean*/ (ba)) { 
 //BA.debugLineNum = 274;BA.debugLine="Log(\">>>>>     HAY PEDIDO\")";
__c.LogImpl("751642389",">>>>>     HAY PEDIDO",0);
 //BA.debugLineNum = 275;BA.debugLine="Tels.Enabled = False";
_tels.setEnabled(__c.False);
 }else {
 //BA.debugLineNum = 277;BA.debugLine="Tels.Enabled = True";
_tels.setEnabled(__c.True);
 };
 //BA.debugLineNum = 280;BA.debugLine="If Not(Starter.gps.GPSEnabled) Then";
if (__c.Not(_starter._gps /*anywheresoftware.b4a.gps.GPS*/ .getGPSEnabled())) { 
 //BA.debugLineNum = 281;BA.debugLine="ToastMessageShow(\"Es necesario tener el GPS ence";
__c.ToastMessageShow(BA.ObjectToCharSequence("Es necesario tener el GPS encendido"),__c.True);
 //BA.debugLineNum = 282;BA.debugLine="StartActivity(Starter.gps.LocationSettingsIntent";
__c.StartActivity(ba,(Object)(_starter._gps /*anywheresoftware.b4a.gps.GPS*/ .getLocationSettingsIntent()));
 };
 //BA.debugLineNum = 285;BA.debugLine="cb_factura.Checked = False";
_cb_factura.setChecked(__c.False);
 //BA.debugLineNum = 286;BA.debugLine="p_abono.Visible = False";
_p_abono.setVisible(__c.False);
 //BA.debugLineNum = 287;BA.debugLine="Subs.centraPanel(p_abono, Root.Width)";
_subs._centrapanel /*String*/ (ba,_p_abono,_root.getWidth());
 //BA.debugLineNum = 288;BA.debugLine="Subs.centraPanel(p_credito, Root.Width)";
_subs._centrapanel /*String*/ (ba,_p_credito,_root.getWidth());
 //BA.debugLineNum = 289;BA.debugLine="skmt.Initialize(ruta,\"kmt.db\", True)";
_skmt.Initialize(_ruta,"kmt.db",__c.True);
 //BA.debugLineNum = 290;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"select CAT_CL";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._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_MTOCOMPRA,CAT_CL_NUM_SERIEFISICO  from kmt_info where CAT_CL_CODIGO In (Select cuenta from cuentaa) UNION ALL 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_MTOCOMPRA,CAT_CL_NUM_SERIEFISICO  from kmt_info where CAT_CL_CODIGO In (Select cuenta from cuentaa)")));
 //BA.debugLineNum = 291;BA.debugLine="s=B4XPages.MainPage.skmt.ExecQuery(\"Select SUM(PE";
_s = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("Select SUM(PE_COSTO_TOT)  As TOTAL_CLIE, SUM(PE_CANT)  As CANT_CLIE, PC_FACTURA FROM PEDIDO_CLIENTE INNER JOIN PEDIDO ON PEDIDO_CLIENTE.PC_CLIENTE = PEDIDO.PE_CLIENTE WHERE (PE_CLIENTE IN (Select cuenta from cuentaa))")));
 //BA.debugLineNum = 292;BA.debugLine="b = B4XPages.MainPage.skmt.ExecQuery(\"select COUN";
_b = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select COUNT(*) AS CLIENTE FROM ABONOSP WHERE CLIENTE IN (Select CUENTA from cuentaa)")));
 //BA.debugLineNum = 293;BA.debugLine="b.Position = 0";
_b.setPosition((int) (0));
 //BA.debugLineNum = 294;BA.debugLine="Dim cabonos As String = b.GetString(\"CLIENTE\")";
_cabonos = _b.GetString("CLIENTE");
 //BA.debugLineNum = 295;BA.debugLine="If cabonos = 0 Then";
if ((_cabonos).equals(BA.NumberToString(0))) { 
 //BA.debugLineNum = 296;BA.debugLine="b_cxc.Visible = False";
_b_cxc.setVisible(__c.False);
 }else {
 //BA.debugLineNum = 298;BA.debugLine="b_cxc.Visible = False";
_b_cxc.setVisible(__c.False);
 };
 //BA.debugLineNum = 301;BA.debugLine="s.Position=0";
_s.setPosition((int) (0));
 //BA.debugLineNum = 302;BA.debugLine="If c.RowCount > 0 Then";
if (_c.getRowCount()>0) { 
 //BA.debugLineNum = 303;BA.debugLine="c.Position=0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 304;BA.debugLine="la_cuenta.Text = c.GetString(\"CAT_CL_CODIGO\")";
_la_cuenta.setText(BA.ObjectToCharSequence(_c.GetString("CAT_CL_CODIGO")));
 //BA.debugLineNum = 305;BA.debugLine="La_nombre.Text = c.GetString(\"CAT_CL_NOMBRE\")";
_la_nombre.setText(BA.ObjectToCharSequence(_c.GetString("CAT_CL_NOMBRE")));
 //BA.debugLineNum = 306;BA.debugLine="la_Calle.Text = c.GetString(\"CAT_CL_CALLE\") & \"";
_la_calle.setText(BA.ObjectToCharSequence(_c.GetString("CAT_CL_CALLE")+" "+_c.GetString("CAT_CL_NOEXT")));
 //BA.debugLineNum = 307;BA.debugLine="la_col.Text = c.GetString(\"CAT_CL_COLONIA\")";
_la_col.setText(BA.ObjectToCharSequence(_c.GetString("CAT_CL_COLONIA")));
 //BA.debugLineNum = 308;BA.debugLine="la_edo.Text = c.GetString(\"CAT_CL_EDO\")";
_la_edo.setText(BA.ObjectToCharSequence(_c.GetString("CAT_CL_EDO")));
 //BA.debugLineNum = 309;BA.debugLine="l_entre1.Text = c.GetString(\"CAT_CL_CALLE1\")";
_l_entre1.setText(BA.ObjectToCharSequence(_c.GetString("CAT_CL_CALLE1")));
 //BA.debugLineNum = 310;BA.debugLine="l_entre2.Text = c.GetString(\"CAT_CL_CALLE2\")";
_l_entre2.setText(BA.ObjectToCharSequence(_c.GetString("CAT_CL_CALLE2")));
 //BA.debugLineNum = 311;BA.debugLine="l_atiende.Text = c.GetString(\"CAT_CL_ATIENDE1\")";
_l_atiende.setText(BA.ObjectToCharSequence(_c.GetString("CAT_CL_ATIENDE1")));
 //BA.debugLineNum = 312;BA.debugLine="l_atiende2.Text = c.GetString(\"CAT_CL_ATIENTE2\")";
_l_atiende2.setText(BA.ObjectToCharSequence(_c.GetString("CAT_CL_ATIENTE2")));
 //BA.debugLineNum = 313;BA.debugLine="TELEFONO  = c.GetString(\"CAT_CL_TELEFONO\")";
_telefono = _c.GetString("CAT_CL_TELEFONO");
 //BA.debugLineNum = 314;BA.debugLine="l_total.Text = s.GetString(\"TOTAL_CLIE\")";
_l_total.setText(BA.ObjectToCharSequence(_s.GetString("TOTAL_CLIE")));
 //BA.debugLineNum = 315;BA.debugLine="total_cliente = s.GetString(\"TOTAL_CLIE\")";
_total_cliente = _s.GetString("TOTAL_CLIE");
 //BA.debugLineNum = 316;BA.debugLine="Private factura As String = 0";
_factura = BA.NumberToString(0);
 //BA.debugLineNum = 317;BA.debugLine="If s.GetString(\"PC_FACTURA\") <> Null And IsNumbe";
if (_s.GetString("PC_FACTURA")!= null && __c.IsNumber(_s.GetString("PC_FACTURA"))) { 
_factura = _s.GetString("PC_FACTURA");};
 //BA.debugLineNum = 318;BA.debugLine="If factura = \"1\" Then cb_factura.Checked = True";
if ((_factura).equals("1")) { 
_cb_factura.setChecked(__c.True);};
 //BA.debugLineNum = 319;BA.debugLine="m_lat = \"0\"";
_m_lat = "0";
 //BA.debugLineNum = 320;BA.debugLine="If c.GetString(\"CAT_CL_LAT\") <> \"\" Then m_lat =c";
if ((_c.GetString("CAT_CL_LAT")).equals("") == false) { 
_m_lat = _c.GetString("CAT_CL_LAT");};
 //BA.debugLineNum = 321;BA.debugLine="If m_lat.Length < 5 Then m_lat = \"0\"";
if (_m_lat.length()<5) { 
_m_lat = "0";};
 //BA.debugLineNum = 322;BA.debugLine="m_lon = \"0\"";
_m_lon = "0";
 //BA.debugLineNum = 323;BA.debugLine="If c.GetString(\"CAT_CL_LONG\") <> \"\" Then m_lon =";
if ((_c.GetString("CAT_CL_LONG")).equals("") == false) { 
_m_lon = _c.GetString("CAT_CL_LONG");};
 //BA.debugLineNum = 324;BA.debugLine="If m_lon.Length < 5 Then m_lon = \"0\"";
if (_m_lon.length()<5) { 
_m_lon = "0";};
 //BA.debugLineNum = 325;BA.debugLine="LA_RUTA = c.GetString(\"CAT_CL_RUTA\")";
_la_ruta = _c.GetString("CAT_CL_RUTA");
 //BA.debugLineNum = 327;BA.debugLine="If c.GetString(\"CAT_CL_NUM_SERIEFISICO\") = \"0\"";
if ((_c.GetString("CAT_CL_NUM_SERIEFISICO")).equals("0")) { 
 //BA.debugLineNum = 328;BA.debugLine="L_QR.TEXT = \"SIN CODIGO\"";
_l_qr.setText(BA.ObjectToCharSequence("SIN CODIGO"));
 //BA.debugLineNum = 329;BA.debugLine="L_QR.TextColor = Colors.Red";
_l_qr.setTextColor(__c.Colors.Red);
 //BA.debugLineNum = 330;BA.debugLine="gest.VISIBLE = False";
_gest.setVisible(__c.False);
 //BA.debugLineNum = 331;BA.debugLine="BT_QR.Visible = True";
_bt_qr.setVisible(__c.True);
 }else {
 //BA.debugLineNum = 333;BA.debugLine="L_QR.TEXT = c.GetString(\"CAT_CL_NUM_SERIEFISICO";
_l_qr.setText(BA.ObjectToCharSequence(_c.GetString("CAT_CL_NUM_SERIEFISICO")));
 //BA.debugLineNum = 334;BA.debugLine="L_QR.TextColor = Colors.Blue";
_l_qr.setTextColor(__c.Colors.Blue);
 //BA.debugLineNum = 335;BA.debugLine="BT_QR.Visible = False";
_bt_qr.setVisible(__c.False);
 };
 };
 //BA.debugLineNum = 338;BA.debugLine="c.Close";
_c.Close();
 //BA.debugLineNum = 339;BA.debugLine="s.Close";
_s.Close();
 //BA.debugLineNum = 340;BA.debugLine="S2=B4XPages.MainPage.skmt.ExecQuery(\"select count";
_s2 = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select count(*) AS CUANTOS from HIST_VENTAS WHERE HVD_CLIENTE IN (Select CUENTA from cuentaa)")));
 //BA.debugLineNum = 341;BA.debugLine="S2.Position =0";
_s2.setPosition((int) (0));
 //BA.debugLineNum = 342;BA.debugLine="CUANTOS = S2.GetString(\"CUANTOS\")";
_cuantos = _s2.GetString("CUANTOS");
 //BA.debugLineNum = 343;BA.debugLine="S2.Close";
_s2.Close();
 //BA.debugLineNum = 344;BA.debugLine="If CUANTOS > 0 Then";
if ((double)(Double.parseDouble(_cuantos))>0) { 
 //BA.debugLineNum = 345;BA.debugLine="c2=B4XPages.MainPage.skmt.ExecQuery(\"select sum(";
_c2 = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select sum(HVD_COSTO_TOT) AS TOTAL from HIST_VENTAS WHERE HVD_CLIENTE IN (Select CUENTA from cuentaa)")));
 //BA.debugLineNum = 346;BA.debugLine="c2.Position =0";
_c2.setPosition((int) (0));
 //BA.debugLineNum = 347;BA.debugLine="MONTO_COMPRA = c2.GetString(\"TOTAL\")";
_monto_compra = _c2.GetString("TOTAL");
 //BA.debugLineNum = 348;BA.debugLine="c2.Close";
_c2.Close();
 }else {
 //BA.debugLineNum = 350;BA.debugLine="MONTO_COMPRA = \"0\"";
_monto_compra = "0";
 };
 //BA.debugLineNum = 353;BA.debugLine="la_saldotot.Text = MONTO_COMPRA";
_la_saldotot.setText(BA.ObjectToCharSequence(_monto_compra));
 //BA.debugLineNum = 355;BA.debugLine="If MONTO_COMPRA <> \"0\" Then";
if ((_monto_compra).equals("0") == false) { 
 //BA.debugLineNum = 356;BA.debugLine="META2 = 300 -  MONTO_COMPRA";
_meta2 = BA.NumberToString(300-(double)(Double.parseDouble(_monto_compra)));
 }else {
 //BA.debugLineNum = 358;BA.debugLine="META2 = 300";
_meta2 = BA.NumberToString(300);
 };
 //BA.debugLineNum = 360;BA.debugLine="If META2 < 1 Then";
if ((double)(Double.parseDouble(_meta2))<1) { 
 //BA.debugLineNum = 361;BA.debugLine="META2 = \"CUBIERTO\"";
_meta2 = "CUBIERTO";
 };
 //BA.debugLineNum = 363;BA.debugLine="la_saldooper.Text = META2";
_la_saldooper.setText(BA.ObjectToCharSequence(_meta2));
 //BA.debugLineNum = 364;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"select ID_ALM";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select ID_ALMACEN from CAT_ALMACEN")));
 //BA.debugLineNum = 365;BA.debugLine="If c.RowCount>0 Then";
if (_c.getRowCount()>0) { 
 //BA.debugLineNum = 366;BA.debugLine="C.Position=0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 367;BA.debugLine="ALMACEN = C.GetString(\"ID_ALMACEN\")";
_almacen = _c.GetString("ID_ALMACEN");
 };
 //BA.debugLineNum = 369;BA.debugLine="c.Close";
_c.Close();
 //BA.debugLineNum = 370;BA.debugLine="If ALMACEN = \"1\" Then";
if ((_almacen).equals("1")) { 
 //BA.debugLineNum = 371;BA.debugLine="Tels.Visible = False";
_tels.setVisible(__c.False);
 //BA.debugLineNum = 372;BA.debugLine="gest.Visible = False";
_gest.setVisible(__c.False);
 };
 //BA.debugLineNum = 375;BA.debugLine="If ALMACEN = \"4\"  Then";
if ((_almacen).equals("4")) { 
 //BA.debugLineNum = 377;BA.debugLine="DD=B4XPages.MainPage.skmt.ExecQuery2(\"SELECT COU";
_dd = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery2("SELECT COUNT(*) AS CUANTOS FROM HIST_VENTAS WHERE HVD_CLIENTE IN (Select cuenta from cuentaa) AND HVD_PRONOMBRE =?",new String[]{"KNORR RINDE MAS 70 GR"})));
 //BA.debugLineNum = 378;BA.debugLine="DD.Position =0";
_dd.setPosition((int) (0));
 //BA.debugLineNum = 379;BA.debugLine="If DD.GetString(\"CUANTOS\")  = 0 Then";
if ((_dd.GetString("CUANTOS")).equals(BA.NumberToString(0))) { 
 //BA.debugLineNum = 380;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery2(\"SELECT COU";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery2("SELECT COUNT(*) AS CUANTOS FROM PEDIDO  WHERE PE_CLIENTE  IN (Select cuenta from cuentaa) AND PE_PRONOMBRE =?",new String[]{"KNORR RINDE MAS 70 GR"})));
 //BA.debugLineNum = 381;BA.debugLine="c.Position =0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 387;BA.debugLine="c.Close";
_c.Close();
 }else {
 };
 //BA.debugLineNum = 391;BA.debugLine="DD.Close";
_dd.Close();
 }else {
 };
 //BA.debugLineNum = 395;BA.debugLine="If ALMACEN = \"16\" Or ALMACEN = \"13\" Then";
if ((_almacen).equals("16") || (_almacen).equals("13")) { 
 //BA.debugLineNum = 396;BA.debugLine="Tels.Visible = True";
_tels.setVisible(__c.True);
 //BA.debugLineNum = 397;BA.debugLine="gest.Visible = True";
_gest.setVisible(__c.True);
 };
 //BA.debugLineNum = 400;BA.debugLine="Tels.Visible = True";
_tels.setVisible(__c.True);
 //BA.debugLineNum = 401;BA.debugLine="gest.Visible = True";
_gest.setVisible(__c.True);
 //BA.debugLineNum = 417;BA.debugLine="If la_cuenta.Text = \"0\" Or la_cuenta.Text = \"1\" T";
if ((_la_cuenta.getText()).equals("0") || (_la_cuenta.getText()).equals("1")) { 
 //BA.debugLineNum = 418;BA.debugLine="p_cbFactura.Visible = False";
_p_cbfactura.setVisible(__c.False);
 //BA.debugLineNum = 419;BA.debugLine="l_factura.Visible = False";
_l_factura.setVisible(__c.False);
 //BA.debugLineNum = 420;BA.debugLine="b_ventaabordo.Visible = False";
_b_ventaabordo.setVisible(__c.False);
 }else {
 //BA.debugLineNum = 422;BA.debugLine="p_cbFactura.Visible = False";
_p_cbfactura.setVisible(__c.False);
 //BA.debugLineNum = 423;BA.debugLine="l_factura.Visible = False";
_l_factura.setVisible(__c.False);
 //BA.debugLineNum = 424;BA.debugLine="b_ventaabordo.Visible = False";
_b_ventaabordo.setVisible(__c.False);
 };
 //BA.debugLineNum = 428;BA.debugLine="c = skmt.ExecQuery2(\"select CAT_VA_VALOR from CAT";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_skmt.ExecQuery2("select CAT_VA_VALOR from CAT_VARIABLES WHERE CAT_VA_DESCRIPCION = ?",new String[]{"MACIMP"})));
 //BA.debugLineNum = 429;BA.debugLine="If c.RowCount > 0 Then";
if (_c.getRowCount()>0) { 
 //BA.debugLineNum = 430;BA.debugLine="c.Position = 0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 431;BA.debugLine="Starter.MAC_IMPRESORA = c.GetString(\"CAT_VA_VALO";
_starter._mac_impresora /*String*/  = _c.GetString("CAT_VA_VALOR");
 };
 //BA.debugLineNum = 433;BA.debugLine="If Starter.MAC_IMPRESORA = \"\" Then Starter.MAC_IM";
if ((_starter._mac_impresora /*String*/ ).equals("")) { 
_starter._mac_impresora /*String*/  = "0";};
 //BA.debugLineNum = 435;BA.debugLine="Printer1.Initialize(Me, \"Printer1\")";
_printer1._initialize /*String*/ (ba,this,"Printer1");
 //BA.debugLineNum = 437;BA.debugLine="If Printer1.IsConnected = False Then";
if (_printer1._isconnected /*boolean*/ ()==__c.False) { 
 }else {
 //BA.debugLineNum = 441;BA.debugLine="Printer1.DisConnect";
_printer1._disconnect /*String*/ ();
 //BA.debugLineNum = 442;BA.debugLine="Printer1.Connect";
_printer1._connect /*boolean*/ ();
 //BA.debugLineNum = 443;BA.debugLine="Log(\"2\")";
__c.LogImpl("751642558","2",0);
 };
 //BA.debugLineNum = 446;BA.debugLine="pre_act = Subs.traeTotalClientepreventaparacredit";
_pre_act = (float) (_subs._traetotalclientepreventaparacredito /*double*/ (ba,_la_cuenta.getText()));
 //BA.debugLineNum = 447;BA.debugLine="Log(la_cuenta.Text)";
__c.LogImpl("751642562",_la_cuenta.getText(),0);
 //BA.debugLineNum = 448;BA.debugLine="LogColor(Subs.traeTotalClientepreventaparacredito";
__c.LogImpl("751642563",BA.NumberToString(_subs._traetotalclientepreventaparacredito /*double*/ (ba,_la_cuenta.getText())),__c.Colors.Blue);
 //BA.debugLineNum = 485;BA.debugLine="If la_cuenta.Text = \"0\" Then";
if ((_la_cuenta.getText()).equals("0")) { 
 //BA.debugLineNum = 486;BA.debugLine="gest.Text = \"Abordo\"";
_gest.setText(BA.ObjectToCharSequence("Abordo"));
 //BA.debugLineNum = 487;BA.debugLine="B4XPages.MainPage.recarga = \"0\"";
_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._recarga /*String*/  = "0";
 }else if((_la_cuenta.getText()).equals("1")) { 
 //BA.debugLineNum = 489;BA.debugLine="gest.Text = \"Recarga\"";
_gest.setText(BA.ObjectToCharSequence("Recarga"));
 //BA.debugLineNum = 490;BA.debugLine="B4XPages.MainPage.recarga = \"1\"";
_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._recarga /*String*/  = "1";
 }else {
 //BA.debugLineNum = 492;BA.debugLine="gest.Text = \"PREVENTA\"";
_gest.setText(BA.ObjectToCharSequence("PREVENTA"));
 //BA.debugLineNum = 493;BA.debugLine="B4XPages.MainPage.recarga = \"0\"";
_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._recarga /*String*/  = "0";
 };
 //BA.debugLineNum = 500;BA.debugLine="Tels.Visible = False";
_tels.setVisible(__c.False);
 //BA.debugLineNum = 501;BA.debugLine="gest.Visible = False";
_gest.setVisible(__c.False);
 //BA.debugLineNum = 504;BA.debugLine="b_ventaabordo.Visible = False";
_b_ventaabordo.setVisible(__c.False);
 //BA.debugLineNum = 506;BA.debugLine="CallSubDelayed(Tracker, \"Track\")";
__c.CallSubDelayed(ba,(Object)(_tracker.getObject()),"Track");
 //BA.debugLineNum = 507;BA.debugLine="CallSubDelayed(Tracker, \"StartFLPSmall\")";
__c.CallSubDelayed(ba,(Object)(_tracker.getObject()),"StartFLPSmall");
 //BA.debugLineNum = 508;BA.debugLine="If Tracker.FLP.IsInitialized And Tracker.FLP.GetL";
if (_tracker._flp /*uk.co.martinpearman.b4a.fusedlocationprovider.FusedLocationProviderWrapper*/ .IsInitialized() && _tracker._flp /*uk.co.martinpearman.b4a.fusedlocationprovider.FusedLocationProviderWrapper*/ .GetLastKnownLocation().IsInitialized()) { 
 //BA.debugLineNum = 509;BA.debugLine="B4XPages.MainPage.lat_gps = Tracker.FLP.GetLastK";
_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._lat_gps /*String*/  = BA.NumberToString(_tracker._flp /*uk.co.martinpearman.b4a.fusedlocationprovider.FusedLocationProviderWrapper*/ .GetLastKnownLocation().getLatitude());
 //BA.debugLineNum = 510;BA.debugLine="B4XPages.MainPage.lon_gps = Tracker.FLP.GetLastK";
_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._lon_gps /*String*/  = BA.NumberToString(_tracker._flp /*uk.co.martinpearman.b4a.fusedlocationprovider.FusedLocationProviderWrapper*/ .GetLastKnownLocation().getLongitude());
 //BA.debugLineNum = 512;BA.debugLine="GPS_LocationChanged(Tracker.FLP.GetLastKnownLoca";
_gps_locationchanged(_tracker._flp /*uk.co.martinpearman.b4a.fusedlocationprovider.FusedLocationProviderWrapper*/ .GetLastKnownLocation());
 };
 //BA.debugLineNum = 514;BA.debugLine="Log(imprimirsolo)";
__c.LogImpl("751642629",_imprimirsolo,0);
 //BA.debugLineNum = 515;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(medicomed.keymon.com.mx.c_cliente parent) {
this.parent = parent;
}
medicomed.keymon.com.mx.c_cliente parent;
String _comprarar = "";
int _resultado1 = 0;

@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 = 622;BA.debugLine="If l_total.Text = \"null\" Then";
if (true) break;

case 1:
//if
this.state = 6;
if ((parent._l_total.getText()).equals("null")) { 
this.state = 3;
}else {
this.state = 5;
}if (true) break;

case 3:
//C
this.state = 6;
 //BA.debugLineNum = 623;BA.debugLine="Dim comprarar As String = 0";
_comprarar = BA.NumberToString(0);
 if (true) break;

case 5:
//C
this.state = 6;
 //BA.debugLineNum = 625;BA.debugLine="comprarar = l_total.Text";
_comprarar = parent._l_total.getText();
 if (true) break;
;
 //BA.debugLineNum = 627;BA.debugLine="If bitacora.p_transparenteInicioFin2.Visible And";

case 6:
//if
this.state = 41;
if (parent._bitacora._p_transparenteiniciofin2 /*anywheresoftware.b4a.objects.PanelWrapper*/ .getVisible() && (parent._bitacora._b_inicio_fin_venta2 /*anywheresoftware.b4a.objects.ButtonWrapper*/ .getText()).equals("TERMINAR VENTA")) { 
this.state = 8;
}else if(parent._subs._haypedido /*boolean*/ (ba)) { 
this.state = 10;
}else if(parent._starter._pre_viejo /*float*/ ==parent._pre_act) { 
this.state = 12;
}else {
this.state = 36;
}if (true) break;

case 8:
//C
this.state = 41;
 //BA.debugLineNum = 628;BA.debugLine="ToastMessageShow(\"Por favor presione el botón de";
parent.__c.ToastMessageShow(BA.ObjectToCharSequence("Por favor presione el botón de TERMINAR VENTA"),parent.__c.True);
 //BA.debugLineNum = 629;BA.debugLine="Return False";
if (true) {
parent.__c.ReturnFromResumableSub(this,(Object)(parent.__c.False));return;};
 if (true) break;

case 10:
//C
this.state = 41;
 //BA.debugLineNum = 631;BA.debugLine="ToastMessageShow(\"Por favor presione el botón de";
parent.__c.ToastMessageShow(BA.ObjectToCharSequence("Por favor presione el botón de GUARDAR"),parent.__c.True);
 //BA.debugLineNum = 632;BA.debugLine="Return False";
if (true) {
parent.__c.ReturnFromResumableSub(this,(Object)(parent.__c.False));return;};
 if (true) break;

case 12:
//C
this.state = 13;
 //BA.debugLineNum = 634;BA.debugLine="If (la_cuenta.Text <> \"0\" And la_cuenta.Text <>";
if (true) break;

case 13:
//if
this.state = 34;
if (((parent._la_cuenta.getText()).equals("0") == false && (parent._la_cuenta.getText()).equals("1") == false)) { 
this.state = 15;
}else {
this.state = 33;
}if (true) break;

case 15:
//C
this.state = 16;
 //BA.debugLineNum = 635;BA.debugLine="If banderaimp = 1 Then";
if (true) break;

case 16:
//if
this.state = 31;
if (parent._banderaimp==1) { 
this.state = 18;
}else {
this.state = 20;
}if (true) break;

case 18:
//C
this.state = 31;
 if (true) break;

case 20:
//C
this.state = 21;
 //BA.debugLineNum = 637;BA.debugLine="cuest.encuestaIniciada = False";
parent._cuest._encuestainiciada /*boolean*/  = parent.__c.False;
 //BA.debugLineNum = 638;BA.debugLine="cuest.ocultPanelPregunta";
parent._cuest._ocultpanelpregunta /*String*/ ();
 //BA.debugLineNum = 639;BA.debugLine="If IsNumber(l_total.text) And Not(Subs.pedidoG";
if (true) break;

case 21:
//if
this.state = 30;
if (parent.__c.IsNumber(parent._l_total.getText()) && parent.__c.Not(parent._subs._pedidoguardado /*boolean*/ (ba))) { 
this.state = 23;
}if (true) break;

case 23:
//C
this.state = 24;
 //BA.debugLineNum = 640;BA.debugLine="LogColor(\"Hay Venta\", Colors.Red)";
parent.__c.LogImpl("751970070","Hay Venta",parent.__c.Colors.Red);
 //BA.debugLineNum = 641;BA.debugLine="Private resultado1 As Int = Msgbox2($\"Va sali";
_resultado1 = parent.__c.Msgbox2(BA.ObjectToCharSequence(("Va salir sin haber guardado la venta, si continua, la venta se BORRARA."+parent.__c.SmartStringFormatter("",(Object)(parent.__c.CRLF))+""+parent.__c.SmartStringFormatter("",(Object)(parent.__c.CRLF))+"¿Esta seguro que desea continuar?")),BA.ObjectToCharSequence("SE VA A BORRAR LA VENTA"),"Borrar Venta","Guardar Venta","",(android.graphics.Bitmap)(parent.__c.LoadBitmap(parent.__c.File.getDirAssets(),"alert2.png").getObject()),ba);
 //BA.debugLineNum = 642;BA.debugLine="If resultado1 = DialogResponse.POSITIVE Then";
if (true) break;

case 24:
//if
this.state = 29;
if (_resultado1==parent.__c.DialogResponse.POSITIVE) { 
this.state = 26;
}else if(_resultado1==parent.__c.DialogResponse.CANCEL) { 
this.state = 28;
}if (true) break;

case 26:
//C
this.state = 29;
 //BA.debugLineNum = 643;BA.debugLine="Log(\"Borrra venta\")";
parent.__c.LogImpl("751970073","Borrra venta",0);
 //BA.debugLineNum = 644;BA.debugLine="Subs.borraPedidoClienteActual";
parent._subs._borrapedidoclienteactual /*String*/ (ba);
 //BA.debugLineNum = 645;BA.debugLine="ToastMessageShow(\"Venta Borrada\", False)";
parent.__c.ToastMessageShow(BA.ObjectToCharSequence("Venta Borrada"),parent.__c.False);
 //BA.debugLineNum = 647;BA.debugLine="B4XPages.ShowPage(\"Principal\")";
parent._b4xpages._showpage /*String*/ (ba,"Principal");
 if (true) break;

case 28:
//C
this.state = 29;
 //BA.debugLineNum = 649;BA.debugLine="Log(\"Pedido guardado\")";
parent.__c.LogImpl("751970079","Pedido guardado",0);
 //BA.debugLineNum = 650;BA.debugLine="Guardar_Click";
parent._guardar_click();
 //BA.debugLineNum = 651;BA.debugLine="ToastMessageShow(\"Venta Guardada\", False)";
parent.__c.ToastMessageShow(BA.ObjectToCharSequence("Venta Guardada"),parent.__c.False);
 if (true) break;

case 29:
//C
this.state = 30;
;
 if (true) break;

case 30:
//C
this.state = 31;
;
 //BA.debugLineNum = 655;BA.debugLine="B4XPages.ShowPage(\"Clientes\")";
parent._b4xpages._showpage /*String*/ (ba,"Clientes");
 if (true) break;

case 31:
//C
this.state = 34;
;
 if (true) break;

case 33:
//C
this.state = 34;
 if (true) break;

case 34:
//C
this.state = 41;
;
 if (true) break;

case 36:
//C
this.state = 37;
 //BA.debugLineNum = 664;BA.debugLine="If B4XPages.MainPage.recarga = \"1\" Then";
if (true) break;

case 37:
//if
this.state = 40;
if ((parent._b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._recarga /*String*/ ).equals("1")) { 
this.state = 39;
}if (true) break;

case 39:
//C
this.state = 40;
 //BA.debugLineNum = 665;BA.debugLine="B4XPages.ShowPage(\"login\")";
parent._b4xpages._showpage /*String*/ (ba,"login");
 if (true) break;

case 40:
//C
this.state = 41;
;
 if (true) break;

case 41:
//C
this.state = -1;
;
 //BA.debugLineNum = 669;BA.debugLine="Return False";
if (true) {
parent.__c.ReturnFromResumableSub(this,(Object)(parent.__c.False));return;};
 //BA.debugLineNum = 670;BA.debugLine="End Sub";
if (true) break;

            }
        }
    }
}
public void  _b4xpage_created(anywheresoftware.b4a.objects.B4XViewWrapper _root1) throws Exception{
ResumableSub_B4XPage_Created rsub = new ResumableSub_B4XPage_Created(this,_root1);
rsub.resume(ba, null);
}
public static class ResumableSub_B4XPage_Created extends BA.ResumableSub {
public ResumableSub_B4XPage_Created(medicomed.keymon.com.mx.c_cliente parent,anywheresoftware.b4a.objects.B4XViewWrapper _root1) {
this.parent = parent;
this._root1 = _root1;
}
medicomed.keymon.com.mx.c_cliente parent;
anywheresoftware.b4a.objects.B4XViewWrapper _root1;
String _cabonos = "";
String _permission = "";
boolean _resultc = false;

@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 = 179;BA.debugLine="Root = Root1";
parent._root = _root1;
 //BA.debugLineNum = 182;BA.debugLine="Root.LoadLayout(\"cliente\")";
parent._root.LoadLayout("cliente",ba);
 //BA.debugLineNum = 183;BA.debugLine="cuest.Initialize(Me, \"cuest\", Root, Starter.skmt)";
parent._cuest._initialize /*Object*/ (ba,parent,"cuest",parent._root,parent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ );
 //BA.debugLineNum = 184;BA.debugLine="ruta = File.DirInternal";
parent._ruta = parent.__c.File.getDirInternal();
 //BA.debugLineNum = 185;BA.debugLine="If File.Exists(ruta, \"kmt.db\") = False Then";
if (true) break;

case 1:
//if
this.state = 4;
if (parent.__c.File.Exists(parent._ruta,"kmt.db")==parent.__c.False) { 
this.state = 3;
}if (true) break;

case 3:
//C
this.state = 4;
 //BA.debugLineNum = 186;BA.debugLine="File.Copy(File.DirAssets, \"kmt.db\", ruta, \"kmt.d";
parent.__c.File.Copy(parent.__c.File.getDirAssets(),"kmt.db",parent._ruta,"kmt.db");
 if (true) break;

case 4:
//C
this.state = 5;
;
 //BA.debugLineNum = 188;BA.debugLine="skmt.Initialize(ruta,\"kmt.db\", True)";
parent._skmt.Initialize(parent._ruta,"kmt.db",parent.__c.True);
 //BA.debugLineNum = 189;BA.debugLine="c = skmt.ExecQuery(\"select CAT_CL_CODIGO,CAT_CL_R";
parent._c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(parent._skmt.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_MTOCOMPRA  from kmt_info where CAT_CL_CODIGO In (Select cuenta from cuentaa)")));
 //BA.debugLineNum = 190;BA.debugLine="s = skmt.ExecQuery(\"select sum(pe_costo_tot) as T";
parent._s = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(parent._skmt.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 = 191;BA.debugLine="b = skmt.ExecQuery(\"select COUNT(*) AS CLIENTE FR";
parent._b = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(parent._skmt.ExecQuery("select COUNT(*) AS CLIENTE FROM ABONOSP WHERE CLIENTE IN (Select CUENTA from cuentaa)")));
 //BA.debugLineNum = 192;BA.debugLine="b.Position = 0";
parent._b.setPosition((int) (0));
 //BA.debugLineNum = 193;BA.debugLine="Dim cabonos As String = b.GetString(\"CLIENTE\")";
_cabonos = parent._b.GetString("CLIENTE");
 //BA.debugLineNum = 194;BA.debugLine="If cabonos = 0 Then";
if (true) break;

case 5:
//if
this.state = 10;
if ((_cabonos).equals(BA.NumberToString(0))) { 
this.state = 7;
}else {
this.state = 9;
}if (true) break;

case 7:
//C
this.state = 10;
 //BA.debugLineNum = 195;BA.debugLine="b_cxc.Visible = False";
parent._b_cxc.setVisible(parent.__c.False);
 if (true) break;

case 9:
//C
this.state = 10;
 //BA.debugLineNum = 197;BA.debugLine="b_cxc.Visible = False";
parent._b_cxc.setVisible(parent.__c.False);
 if (true) break;

case 10:
//C
this.state = 11;
;
 //BA.debugLineNum = 200;BA.debugLine="s.Position=0";
parent._s.setPosition((int) (0));
 //BA.debugLineNum = 201;BA.debugLine="If c.RowCount>0 Then";
if (true) break;

case 11:
//if
this.state = 14;
if (parent._c.getRowCount()>0) { 
this.state = 13;
}if (true) break;

case 13:
//C
this.state = 14;
 //BA.debugLineNum = 202;BA.debugLine="c.Position=0";
parent._c.setPosition((int) (0));
 //BA.debugLineNum = 203;BA.debugLine="la_cuenta.Text = c.GetString(\"CAT_CL_CODIGO\")";
parent._la_cuenta.setText(BA.ObjectToCharSequence(parent._c.GetString("CAT_CL_CODIGO")));
 //BA.debugLineNum = 204;BA.debugLine="cuenta = c.GetString(\"CAT_CL_CODIGO\")";
parent._cuenta = parent._c.GetString("CAT_CL_CODIGO");
 //BA.debugLineNum = 205;BA.debugLine="La_nombre.Text = c.GetString(\"CAT_CL_NOMBRE\")";
parent._la_nombre.setText(BA.ObjectToCharSequence(parent._c.GetString("CAT_CL_NOMBRE")));
 //BA.debugLineNum = 206;BA.debugLine="la_Calle.Text = c.GetString(\"CAT_CL_CALLE\") & c.";
parent._la_calle.setText(BA.ObjectToCharSequence(parent._c.GetString("CAT_CL_CALLE")+parent._c.GetString("CAT_CL_NOEXT")));
 //BA.debugLineNum = 207;BA.debugLine="la_col.Text = c.GetString(\"CAT_CL_COLONIA\")";
parent._la_col.setText(BA.ObjectToCharSequence(parent._c.GetString("CAT_CL_COLONIA")));
 //BA.debugLineNum = 208;BA.debugLine="la_edo.Text = c.GetString(\"CAT_CL_EDO\")";
parent._la_edo.setText(BA.ObjectToCharSequence(parent._c.GetString("CAT_CL_EDO")));
 //BA.debugLineNum = 210;BA.debugLine="l_entre1.Text = c.GetString(\"CAT_CL_CALLE1\")";
parent._l_entre1.setText(BA.ObjectToCharSequence(parent._c.GetString("CAT_CL_CALLE1")));
 //BA.debugLineNum = 211;BA.debugLine="l_entre2.Text = c.GetString(\"CAT_CL_CALLE2\")";
parent._l_entre2.setText(BA.ObjectToCharSequence(parent._c.GetString("CAT_CL_CALLE2")));
 //BA.debugLineNum = 212;BA.debugLine="l_atiende.Text = c.GetString(\"CAT_CL_ATIENDE1\")";
parent._l_atiende.setText(BA.ObjectToCharSequence(parent._c.GetString("CAT_CL_ATIENDE1")));
 //BA.debugLineNum = 213;BA.debugLine="l_atiende2.Text = c.GetString(\"CAT_CL_ATIENTE2\")";
parent._l_atiende2.setText(BA.ObjectToCharSequence(parent._c.GetString("CAT_CL_ATIENTE2")));
 //BA.debugLineNum = 214;BA.debugLine="la_saldotot.Text = c.GetString(\"CAT_CL_TELEFONO\"";
parent._la_saldotot.setText(BA.ObjectToCharSequence(parent._c.GetString("CAT_CL_TELEFONO")));
 //BA.debugLineNum = 215;BA.debugLine="la_saldooper.Text = c.GetString(\"CAT_CL_EMAIL\")";
parent._la_saldooper.setText(BA.ObjectToCharSequence(parent._c.GetString("CAT_CL_EMAIL")));
 //BA.debugLineNum = 216;BA.debugLine="l_total.Text = s.GetString(\"TOTAL_CLIE\")";
parent._l_total.setText(BA.ObjectToCharSequence(parent._s.GetString("TOTAL_CLIE")));
 //BA.debugLineNum = 217;BA.debugLine="total_cliente = s.GetString(\"TOTAL_CLIE\")";
parent._total_cliente = parent._s.GetString("TOTAL_CLIE");
 //BA.debugLineNum = 218;BA.debugLine="MONTO_COMPRA = c.GetString(\"CAT_CL_MTOCOMPRA\")";
parent._monto_compra = parent._c.GetString("CAT_CL_MTOCOMPRA");
 if (true) break;

case 14:
//C
this.state = -1;
;
 //BA.debugLineNum = 220;BA.debugLine="c.Close";
parent._c.Close();
 //BA.debugLineNum = 221;BA.debugLine="s.Close";
parent._s.Close();
 //BA.debugLineNum = 222;BA.debugLine="bitacora.Initialize(\"bitacora\", \"bitacora\", Root,";
parent._bitacora._initialize /*Object*/ (ba,(Object)("bitacora"),"bitacora",parent._root,parent._b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ ,parent._reqmanager);
 //BA.debugLineNum = 223;BA.debugLine="LogColor(\"---------->Iniciamos Permisos\",Colors.B";
parent.__c.LogImpl("751576877","---------->Iniciamos Permisos",parent.__c.Colors.Blue);
 //BA.debugLineNum = 224;BA.debugLine="btAdmin.Initialize(\"BlueTeeth\")";
parent._btadmin.Initialize(ba,"BlueTeeth");
 //BA.debugLineNum = 226;BA.debugLine="cmp20.Initialize(\"Printer\")";
parent._cmp20.Initialize("Printer");
 //BA.debugLineNum = 227;BA.debugLine="Starter.rp.CheckAndRequest(Starter.rp.PERMISSION_";
parent._starter._rp /*anywheresoftware.b4a.objects.RuntimePermissions*/ .CheckAndRequest(ba,parent._starter._rp /*anywheresoftware.b4a.objects.RuntimePermissions*/ .PERMISSION_CAMERA);
 //BA.debugLineNum = 228;BA.debugLine="Wait For B4XPage_PermissionResult (Permission As";
parent.__c.WaitFor("b4xpage_permissionresult", ba, this, null);
this.state = 15;
return;
case 15:
//C
this.state = -1;
_permission = (String) result[0];
_resultc = (Boolean) result[1];
;
 //BA.debugLineNum = 229;BA.debugLine="Starter.rp.CheckAndRequest(Starter.rp.PERMISSION_";
parent._starter._rp /*anywheresoftware.b4a.objects.RuntimePermissions*/ .CheckAndRequest(ba,parent._starter._rp /*anywheresoftware.b4a.objects.RuntimePermissions*/ .PERMISSION_WRITE_EXTERNAL_STORAGE);
 //BA.debugLineNum = 230;BA.debugLine="Wait For B4XPage_PermissionResult (Permission As";
parent.__c.WaitFor("b4xpage_permissionresult", ba, this, null);
this.state = 16;
return;
case 16:
//C
this.state = -1;
_permission = (String) result[0];
_resultc = (Boolean) result[1];
;
 //BA.debugLineNum = 249;BA.debugLine="End Sub";
if (true) break;

            }
        }
    }
}
public void  _b4xpage_permissionresult(String _permission,boolean _resultc) throws Exception{
}
public String  _bt_qr_click() throws Exception{
 //BA.debugLineNum = 1124;BA.debugLine="Sub BT_QR_Click";
 //BA.debugLineNum = 1132;BA.debugLine="End Sub";
return "";
}
public String  _calc_ean_checksum(String _number) throws Exception{
int _i = 0;
char _co = '\0';
int _soma = 0;
int _n = 0;
float _digit = 0f;
 //BA.debugLineNum = 1167;BA.debugLine="Sub calc_ean_checksum(number As String) As String";
 //BA.debugLineNum = 1168;BA.debugLine="Dim i As Int";
_i = 0;
 //BA.debugLineNum = 1169;BA.debugLine="Dim cO As Char";
_co = '\0';
 //BA.debugLineNum = 1170;BA.debugLine="Dim soma As Int";
_soma = 0;
 //BA.debugLineNum = 1171;BA.debugLine="Dim n As Int";
_n = 0;
 //BA.debugLineNum = 1172;BA.debugLine="Dim digit As Float";
_digit = 0f;
 //BA.debugLineNum = 1173;BA.debugLine="soma = 0";
_soma = (int) (0);
 //BA.debugLineNum = 1174;BA.debugLine="For i=0 To number.Length - 1";
{
final int step7 = 1;
final int limit7 = (int) (_number.length()-1);
_i = (int) (0) ;
for (;_i <= limit7 ;_i = _i + step7 ) {
 //BA.debugLineNum = 1175;BA.debugLine="digit = number.SubString2(i,i+1)";
_digit = (float)(Double.parseDouble(_number.substring(_i,(int) (_i+1))));
 //BA.debugLineNum = 1176;BA.debugLine="n= digit * ((i Mod 2) * 2 + 1)";
_n = (int) (_digit*((_i%2)*2+1));
 //BA.debugLineNum = 1177;BA.debugLine="soma=soma+n";
_soma = (int) (_soma+_n);
 }
};
 //BA.debugLineNum = 1179;BA.debugLine="Return number & ( ( 10 - ( soma Mod 10 )) Mod 10";
if (true) return _number+BA.NumberToString(((10-(_soma%10))%10));
 //BA.debugLineNum = 1180;BA.debugLine="End Sub";
return "";
}
public String  _cb_factura_checkedchange(boolean _checked) throws Exception{
 //BA.debugLineNum = 2027;BA.debugLine="Private Sub cb_factura_CheckedChange(Checked As Bo";
 //BA.debugLineNum = 2029;BA.debugLine="If Checked Then p_cbFactura.Color = Colors.Green";
if (_checked) { 
_p_cbfactura.setColor(__c.Colors.Green);}
else {
_p_cbfactura.setColor(__c.Colors.Red);};
 //BA.debugLineNum = 2030;BA.debugLine="End Sub";
return "";
}
public String  _class_globals() throws Exception{
 //BA.debugLineNum = 5;BA.debugLine="Sub Class_Globals";
 //BA.debugLineNum = 6;BA.debugLine="Private Root As B4XView 'ignore";
_root = new anywheresoftware.b4a.objects.B4XViewWrapper();
 //BA.debugLineNum = 7;BA.debugLine="Private xui As XUI 'ignore";
_xui = new anywheresoftware.b4a.objects.B4XViewWrapper.XUI();
 //BA.debugLineNum = 8;BA.debugLine="Private p_cliente As Panel";
_p_cliente = new anywheresoftware.b4a.objects.PanelWrapper();
 //BA.debugLineNum = 9;BA.debugLine="Dim reqManager As DBRequestManager";
_reqmanager = new medicomed.keymon.com.mx.dbrequestmanager();
 //BA.debugLineNum = 10;BA.debugLine="Dim cmd As DBCommand";
_cmd = new medicomed.keymon.com.mx.dbrequestmanager._dbcommand();
 //BA.debugLineNum = 11;BA.debugLine="Dim ime As IME";
_ime = new anywheresoftware.b4a.objects.IME();
 //BA.debugLineNum = 13;BA.debugLine="Dim g As GPS";
_g = new anywheresoftware.b4a.gps.GPS();
 //BA.debugLineNum = 14;BA.debugLine="Dim ruta As String";
_ruta = "";
 //BA.debugLineNum = 15;BA.debugLine="Dim skmt As SQL";
_skmt = new anywheresoftware.b4a.sql.SQL();
 //BA.debugLineNum = 16;BA.debugLine="Dim clie_id As String";
_clie_id = "";
 //BA.debugLineNum = 17;BA.debugLine="Dim sDate,sTime As String";
_sdate = "";
_stime = "";
 //BA.debugLineNum = 18;BA.debugLine="Dim usuario As String";
_usuario = "";
 //BA.debugLineNum = 19;BA.debugLine="Dim total_cliente As String";
_total_cliente = "";
 //BA.debugLineNum = 20;BA.debugLine="Dim m_lat, m_lon As String";
_m_lat = "";
_m_lon = "";
 //BA.debugLineNum = 21;BA.debugLine="Dim btAdmin As BluetoothAdmin";
_btadmin = new anywheresoftware.b4a.objects.Serial.BluetoothAdmin();
 //BA.debugLineNum = 22;BA.debugLine="Dim cmp20 As Serial";
_cmp20 = new anywheresoftware.b4a.objects.Serial();
 //BA.debugLineNum = 23;BA.debugLine="Dim printer As TextWriter";
_printer = new anywheresoftware.b4a.objects.streams.File.TextWriterWrapper();
 //BA.debugLineNum = 24;BA.debugLine="Dim PairedDevices As Map";
_paireddevices = new anywheresoftware.b4a.objects.collections.Map();
 //BA.debugLineNum = 25;BA.debugLine="Dim L As List";
_l = new anywheresoftware.b4a.objects.collections.List();
 //BA.debugLineNum = 26;BA.debugLine="Dim TAMANO As Int";
_tamano = 0;
 //BA.debugLineNum = 27;BA.debugLine="Dim ESPACIO As Int";
_espacio = 0;
 //BA.debugLineNum = 28;BA.debugLine="Dim BLANCO As String";
_blanco = "";
 //BA.debugLineNum = 29;BA.debugLine="Dim cuenta As String";
_cuenta = "";
 //BA.debugLineNum = 30;BA.debugLine="Dim tipo_venta As String = \"PREVENTA_48\"";
_tipo_venta = "PREVENTA_48";
 //BA.debugLineNum = 31;BA.debugLine="Dim MAC_IMPRESORA As String";
_mac_impresora = "";
 //BA.debugLineNum = 32;BA.debugLine="Dim Printer1 As EscPosPrinter";
_printer1 = new medicomed.keymon.com.mx.escposprinter();
 //BA.debugLineNum = 33;BA.debugLine="Dim c As Cursor";
_c = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
 //BA.debugLineNum = 34;BA.debugLine="Dim s As Cursor";
_s = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
 //BA.debugLineNum = 35;BA.debugLine="Dim DD As Cursor";
_dd = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
 //BA.debugLineNum = 36;BA.debugLine="Dim c2 As Cursor";
_c2 = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
 //BA.debugLineNum = 37;BA.debugLine="Dim ListView1 As ListView";
_listview1 = new anywheresoftware.b4a.objects.ListViewWrapper();
 //BA.debugLineNum = 38;BA.debugLine="Dim la_cuenta As Label";
_la_cuenta = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 39;BA.debugLine="Dim La_nombre As Label";
_la_nombre = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 40;BA.debugLine="Dim la_Calle As Label";
_la_calle = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 41;BA.debugLine="Dim la_numero As Label";
_la_numero = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 42;BA.debugLine="Dim la_nint As Label";
_la_nint = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 43;BA.debugLine="Dim la_edo As Label";
_la_edo = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 44;BA.debugLine="Dim la_pob As Label";
_la_pob = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 45;BA.debugLine="Dim la_col As Label";
_la_col = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 46;BA.debugLine="Dim la_cp As Label";
_la_cp = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 47;BA.debugLine="Dim la_zona As Label";
_la_zona = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 48;BA.debugLine="Dim gest As Button";
_gest = new anywheresoftware.b4a.objects.ButtonWrapper();
 //BA.debugLineNum = 49;BA.debugLine="Dim la_saldotot As Label";
_la_saldotot = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 50;BA.debugLine="Dim la_saldooper As Label";
_la_saldooper = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 51;BA.debugLine="Dim impresoraConectada As Boolean = False";
_impresoraconectada = __c.False;
 //BA.debugLineNum = 52;BA.debugLine="Dim Tels As Button";
_tels = new anywheresoftware.b4a.objects.ButtonWrapper();
 //BA.debugLineNum = 53;BA.debugLine="Dim Label10 As Label";
_label10 = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 54;BA.debugLine="Dim Label11 As Label";
_label11 = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 55;BA.debugLine="Dim btAdmin As BluetoothAdmin";
_btadmin = new anywheresoftware.b4a.objects.Serial.BluetoothAdmin();
 //BA.debugLineNum = 56;BA.debugLine="Dim Tar As Button";
_tar = new anywheresoftware.b4a.objects.ButtonWrapper();
 //BA.debugLineNum = 57;BA.debugLine="Dim errorImpresora As Int = 0";
_errorimpresora = (int) (0);
 //BA.debugLineNum = 58;BA.debugLine="Dim la_comm As Label";
_la_comm = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 59;BA.debugLine="Dim la_actdte As Label";
_la_actdte = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 60;BA.debugLine="Dim la_usuario As Label";
_la_usuario = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 61;BA.debugLine="Dim la_resultado As Label";
_la_resultado = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 62;BA.debugLine="Dim l_entre1 As Label";
_l_entre1 = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 63;BA.debugLine="Dim l_entre2 As Label";
_l_entre2 = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 64;BA.debugLine="Dim l_atiende As Label";
_l_atiende = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 65;BA.debugLine="Dim l_atiende2 As Label";
_l_atiende2 = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 66;BA.debugLine="Dim DATOS As Button";
_datos = new anywheresoftware.b4a.objects.ButtonWrapper();
 //BA.debugLineNum = 67;BA.debugLine="Dim Guardar As Button";
_guardar = new anywheresoftware.b4a.objects.ButtonWrapper();
 //BA.debugLineNum = 68;BA.debugLine="Dim NUEVO As Button";
_nuevo = new anywheresoftware.b4a.objects.ButtonWrapper();
 //BA.debugLineNum = 71;BA.debugLine="Dim l_total As Label";
_l_total = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 72;BA.debugLine="Dim c2 As Cursor";
_c2 = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
 //BA.debugLineNum = 73;BA.debugLine="Dim S2 As Cursor";
_s2 = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
 //BA.debugLineNum = 74;BA.debugLine="Private s As Cursor";
_s = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
 //BA.debugLineNum = 75;BA.debugLine="Dim res As String";
_res = "";
 //BA.debugLineNum = 76;BA.debugLine="Dim Credi As Cursor";
_credi = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
 //BA.debugLineNum = 77;BA.debugLine="Private HIST As Button";
_hist = new anywheresoftware.b4a.objects.ButtonWrapper();
 //BA.debugLineNum = 78;BA.debugLine="Private MONTO_COMPRA As String";
_monto_compra = "";
 //BA.debugLineNum = 79;BA.debugLine="Private META As String";
_meta = "";
 //BA.debugLineNum = 80;BA.debugLine="Private META2 As String";
_meta2 = "";
 //BA.debugLineNum = 81;BA.debugLine="Private VERIFICA As String";
_verifica = "";
 //BA.debugLineNum = 82;BA.debugLine="Private L_QR As Label";
_l_qr = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 83;BA.debugLine="Private BT_QR As Button";
_bt_qr = new anywheresoftware.b4a.objects.ButtonWrapper();
 //BA.debugLineNum = 85;BA.debugLine="Dim CODIGO As String";
_codigo = "";
 //BA.debugLineNum = 87;BA.debugLine="Private b_mapa As Button";
_b_mapa = new anywheresoftware.b4a.objects.ButtonWrapper();
 //BA.debugLineNum = 88;BA.debugLine="Dim CUANTOS As String";
_cuantos = "";
 //BA.debugLineNum = 89;BA.debugLine="Private B_IMP As Button";
_b_imp = new anywheresoftware.b4a.objects.ButtonWrapper();
 //BA.debugLineNum = 90;BA.debugLine="Dim Toggla As Toggle";
_toggla = new com.rootsoft.togglelibrary.ToggleLibrary();
 //BA.debugLineNum = 91;BA.debugLine="Dim tgl As Toggle";
_tgl = new com.rootsoft.togglelibrary.ToggleLibrary();
 //BA.debugLineNum = 92;BA.debugLine="Dim pre_act As Float";
_pre_act = 0f;
 //BA.debugLineNum = 94;BA.debugLine="Private Panel1 As Panel";
_panel1 = new anywheresoftware.b4a.objects.PanelWrapper();
 //BA.debugLineNum = 95;BA.debugLine="Private I_COMPRA As EditText";
_i_compra = new anywheresoftware.b4a.objects.EditTextWrapper();
 //BA.debugLineNum = 96;BA.debugLine="Private B_GUARDA_C As Button";
_b_guarda_c = new anywheresoftware.b4a.objects.ButtonWrapper();
 //BA.debugLineNum = 97;BA.debugLine="Private b_venta As Button";
_b_venta = new anywheresoftware.b4a.objects.ButtonWrapper();
 //BA.debugLineNum = 98;BA.debugLine="Dim ALMACEN As String";
_almacen = "";
 //BA.debugLineNum = 99;BA.debugLine="Private LA_GPS As Label";
_la_gps = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 100;BA.debugLine="Private B_E_NEXT As Button";
_b_e_next = new anywheresoftware.b4a.objects.ButtonWrapper();
 //BA.debugLineNum = 101;BA.debugLine="Private E_RES_E As EditText";
_e_res_e = new anywheresoftware.b4a.objects.EditTextWrapper();
 //BA.debugLineNum = 102;BA.debugLine="Private t_tenc As Label";
_t_tenc = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 103;BA.debugLine="Private Panel2 As Panel";
_panel2 = new anywheresoftware.b4a.objects.PanelWrapper();
 //BA.debugLineNum = 104;BA.debugLine="Private CONTADOR_E As String";
_contador_e = "";
 //BA.debugLineNum = 105;BA.debugLine="Private HR_RES1 As String";
_hr_res1 = "";
 //BA.debugLineNum = 106;BA.debugLine="Private HR_RES2 As String";
_hr_res2 = "";
 //BA.debugLineNum = 107;BA.debugLine="Private HR_RES3 As String";
_hr_res3 = "";
 //BA.debugLineNum = 108;BA.debugLine="Private EXISTE As String";
_existe = "";
 //BA.debugLineNum = 109;BA.debugLine="Private TELEFONO As String";
_telefono = "";
 //BA.debugLineNum = 110;BA.debugLine="Dim t1 As Timer";
_t1 = new anywheresoftware.b4a.objects.Timer();
 //BA.debugLineNum = 111;BA.debugLine="Private RB1 As RadioButton";
_rb1 = new anywheresoftware.b4a.objects.CompoundButtonWrapper.RadioButtonWrapper();
 //BA.debugLineNum = 112;BA.debugLine="Private RB2 As RadioButton";
_rb2 = new anywheresoftware.b4a.objects.CompoundButtonWrapper.RadioButtonWrapper();
 //BA.debugLineNum = 113;BA.debugLine="Private RB3 As RadioButton";
_rb3 = new anywheresoftware.b4a.objects.CompoundButtonWrapper.RadioButtonWrapper();
 //BA.debugLineNum = 114;BA.debugLine="Private RB4 As RadioButton";
_rb4 = new anywheresoftware.b4a.objects.CompoundButtonWrapper.RadioButtonWrapper();
 //BA.debugLineNum = 115;BA.debugLine="Private RB5 As RadioButton";
_rb5 = new anywheresoftware.b4a.objects.CompoundButtonWrapper.RadioButtonWrapper();
 //BA.debugLineNum = 117;BA.debugLine="Private stay_hh As String";
_stay_hh = "";
 //BA.debugLineNum = 118;BA.debugLine="Private stay_mi As String";
_stay_mi = "";
 //BA.debugLineNum = 119;BA.debugLine="Private stay_ss As String";
_stay_ss = "";
 //BA.debugLineNum = 121;BA.debugLine="Private LA_GEO As Label";
_la_geo = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 122;BA.debugLine="Dim result As Int";
_result = 0;
 //BA.debugLineNum = 123;BA.debugLine="Private cercavalor As String";
_cercavalor = "";
 //BA.debugLineNum = 124;BA.debugLine="Private LA_RUTA As String";
_la_ruta = "";
 //BA.debugLineNum = 126;BA.debugLine="Private b_like As Button";
_b_like = new anywheresoftware.b4a.objects.ButtonWrapper();
 //BA.debugLineNum = 127;BA.debugLine="Private B_GPS As Button";
_b_gps = new anywheresoftware.b4a.objects.ButtonWrapper();
 //BA.debugLineNum = 129;BA.debugLine="Dim CODIGO As String";
_codigo = "";
 //BA.debugLineNum = 130;BA.debugLine="Private cb_factura As CheckBox";
_cb_factura = new anywheresoftware.b4a.objects.CompoundButtonWrapper.CheckBoxWrapper();
 //BA.debugLineNum = 131;BA.debugLine="Private p_cbFactura As Panel";
_p_cbfactura = new anywheresoftware.b4a.objects.PanelWrapper();
 //BA.debugLineNum = 132;BA.debugLine="Dim venimosDeTicketsDia As Boolean = False";
_venimosdeticketsdia = __c.False;
 //BA.debugLineNum = 133;BA.debugLine="Private p_abono As Panel";
_p_abono = new anywheresoftware.b4a.objects.PanelWrapper();
 //BA.debugLineNum = 134;BA.debugLine="Private et_abono As EditText";
_et_abono = new anywheresoftware.b4a.objects.EditTextWrapper();
 //BA.debugLineNum = 135;BA.debugLine="Private b_abono As Button";
_b_abono = new anywheresoftware.b4a.objects.ButtonWrapper();
 //BA.debugLineNum = 136;BA.debugLine="Private b_cancelar As Button";
_b_cancelar = new anywheresoftware.b4a.objects.ButtonWrapper();
 //BA.debugLineNum = 137;BA.debugLine="Private b_abono1 As Button";
_b_abono1 = new anywheresoftware.b4a.objects.ButtonWrapper();
 //BA.debugLineNum = 138;BA.debugLine="Dim b As Cursor";
_b = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
 //BA.debugLineNum = 139;BA.debugLine="Private b_cxc As Button";
_b_cxc = new anywheresoftware.b4a.objects.ButtonWrapper();
 //BA.debugLineNum = 140;BA.debugLine="Private clv_abonos As CustomListView";
_clv_abonos = new b4a.example3.customlistview();
 //BA.debugLineNum = 141;BA.debugLine="Private l_folio As Label";
_l_folio = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 142;BA.debugLine="Private l_saldo As Label";
_l_saldo = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 143;BA.debugLine="Dim d As Cursor";
_d = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
 //BA.debugLineNum = 144;BA.debugLine="Dim f As Cursor";
_f = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
 //BA.debugLineNum = 145;BA.debugLine="Private l_montoabonostotal As Label";
_l_montoabonostotal = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 146;BA.debugLine="Dim j As Cursor";
_j = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
 //BA.debugLineNum = 147;BA.debugLine="Dim h As Cursor";
_h = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
 //BA.debugLineNum = 148;BA.debugLine="Dim distance As Long";
_distance = 0L;
 //BA.debugLineNum = 149;BA.debugLine="Dim cuest As C_Cuestionario";
_cuest = new medicomed.keymon.com.mx.c_cuestionario();
 //BA.debugLineNum = 150;BA.debugLine="Private b_ventaabordo As Button";
_b_ventaabordo = new anywheresoftware.b4a.objects.ButtonWrapper();
 //BA.debugLineNum = 151;BA.debugLine="Private l_factura As Label";
_l_factura = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 152;BA.debugLine="Private l_limite As Label";
_l_limite = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 153;BA.debugLine="Private et_montoacredito As EditText";
_et_montoacredito = new anywheresoftware.b4a.objects.EditTextWrapper();
 //BA.debugLineNum = 154;BA.debugLine="Private b_cancred As Button";
_b_cancred = new anywheresoftware.b4a.objects.ButtonWrapper();
 //BA.debugLineNum = 155;BA.debugLine="Private b_acred As Button";
_b_acred = new anywheresoftware.b4a.objects.ButtonWrapper();
 //BA.debugLineNum = 156;BA.debugLine="Private p_credito As Panel";
_p_credito = new anywheresoftware.b4a.objects.PanelWrapper();
 //BA.debugLineNum = 157;BA.debugLine="Dim banderaimp As Int = 0";
_banderaimp = (int) (0);
 //BA.debugLineNum = 159;BA.debugLine="Dim k1,k2,k3 As String";
_k1 = "";
_k2 = "";
_k3 = "";
 //BA.debugLineNum = 160;BA.debugLine="Private b_ubicar As Button";
_b_ubicar = new anywheresoftware.b4a.objects.ButtonWrapper();
 //BA.debugLineNum = 162;BA.debugLine="Dim bitacora As C_Bitacora";
_bitacora = new medicomed.keymon.com.mx.c_bitacora();
 //BA.debugLineNum = 164;BA.debugLine="Dim motivoNoVenta, motivoNoVisita As String";
_motivonoventa = "";
_motivonovisita = "";
 //BA.debugLineNum = 166;BA.debugLine="Dim imprimirsolo As String = 0";
_imprimirsolo = BA.NumberToString(0);
 //BA.debugLineNum = 167;BA.debugLine="Dim siimprimio As String = 0";
_siimprimio = BA.NumberToString(0);
 //BA.debugLineNum = 170;BA.debugLine="End Sub";
return "";
}
public anywheresoftware.b4a.objects.PanelWrapper  _createlistitem(String _mostrar,String _mostrar1) throws Exception{
anywheresoftware.b4a.objects.B4XViewWrapper _p = null;
 //BA.debugLineNum = 2497;BA.debugLine="Sub CreateListItem(mostrar As String, mostrar1 As";
 //BA.debugLineNum = 2498;BA.debugLine="Dim p As B4XView = xui.CreatePanel(\"\")";
_p = new anywheresoftware.b4a.objects.B4XViewWrapper();
_p = _xui.CreatePanel(ba,"");
 //BA.debugLineNum = 2499;BA.debugLine="p.SetLayoutAnimated(0, 0, 0, 1, 10)";
_p.SetLayoutAnimated((int) (0),(int) (0),(int) (0),(int) (1),(int) (10));
 //BA.debugLineNum = 2500;BA.debugLine="p.LoadLayout(\"folioabono\")";
_p.LoadLayout("folioabono",ba);
 //BA.debugLineNum = 2501;BA.debugLine="p.Height= 32dip";
_p.setHeight(__c.DipToCurrent((int) (32)));
 //BA.debugLineNum = 2502;BA.debugLine="p.Width = 80dip";
_p.setWidth(__c.DipToCurrent((int) (80)));
 //BA.debugLineNum = 2504;BA.debugLine="l_folio.Text = mostrar";
_l_folio.setText(BA.ObjectToCharSequence(_mostrar));
 //BA.debugLineNum = 2505;BA.debugLine="l_saldo.Text = mostrar1";
_l_saldo.setText(BA.ObjectToCharSequence(_mostrar1));
 //BA.debugLineNum = 2508;BA.debugLine="Return p";
if (true) return (anywheresoftware.b4a.objects.PanelWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.PanelWrapper(), (android.view.ViewGroup)(_p.getObject()));
 //BA.debugLineNum = 2509;BA.debugLine="End Sub";
return null;
}
public String  _cuest_preguntacontestada(anywheresoftware.b4a.objects.collections.Map _m) throws Exception{
 //BA.debugLineNum = 2511;BA.debugLine="Sub cuest_preguntaContestada(m As Map)";
 //BA.debugLineNum = 2513;BA.debugLine="Log(m)";
__c.LogImpl("754788098",BA.ObjectToString(_m),0);
 //BA.debugLineNum = 2516;BA.debugLine="m.Get(\"panel\").As(Panel).RemoveView 'Quitamos le";
((anywheresoftware.b4a.objects.PanelWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.PanelWrapper(), (android.view.ViewGroup)(_m.Get((Object)("panel"))))).RemoveView();
 //BA.debugLineNum = 2517;BA.debugLine="DateTime.DateFormat = \"dd/MM/yyyy\"";
__c.DateTime.setDateFormat("dd/MM/yyyy");
 //BA.debugLineNum = 2518;BA.debugLine="DateTime.TimeFormat = \"HH:mm:ss\"";
__c.DateTime.setTimeFormat("HH:mm:ss");
 //BA.debugLineNum = 2519;BA.debugLine="Starter.skmt.ExecNonQuery($\"delete from CUESTIONA";
_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("delete from CUESTIONARIO where Q_IDCLIENTE = '"+__c.SmartStringFormatter("",(Object)(_subs._traecliente /*String*/ (ba)))+"' and Q_IDPREGUNTA = '"+__c.SmartStringFormatter("",_m.Get((Object)("idPregunta")))+"'"));
 //BA.debugLineNum = 2520;BA.debugLine="Starter.skmt.ExecNonQuery($\"insert into CUESTIONA";
_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("insert into CUESTIONARIO (Q_RUTA, Q_ALMACEN, Q_IDCLIENTE, Q_IDPREGUNTA, Q_PREGUNTA, Q_IDRESPUESTA, Q_RESPUESTA, Q_FECHA) values ('"+__c.SmartStringFormatter("",(Object)(_subs._traeruta /*String*/ (ba,_subs._traecliente /*String*/ (ba))))+"', '"+__c.SmartStringFormatter("",(Object)(_subs._traealmacen /*String*/ (ba)))+"', '"+__c.SmartStringFormatter("",(Object)(_subs._traecliente /*String*/ (ba)))+"', '"+__c.SmartStringFormatter("",_m.Get((Object)("idPregunta")))+"', '"+__c.SmartStringFormatter("",_m.Get((Object)("pregunta")))+"', '"+__c.SmartStringFormatter("",_m.Get((Object)("idRespuesta")))+"', '"+__c.SmartStringFormatter("",_m.Get((Object)("respuesta")))+"', '"+__c.SmartStringFormatter("",(Object)(__c.DateTime.Date(__c.DateTime.getNow())))+" "+__c.SmartStringFormatter("",(Object)(__c.DateTime.Time(__c.DateTime.getNow())))+"')"));
 //BA.debugLineNum = 2521;BA.debugLine="Select Case m.Get(\"idPregunta\")";
switch (BA.switchObjectToInt(_m.Get((Object)("idPregunta")),(Object)("1"),(Object)("2"),(Object)("3"),(Object)("4"),(Object)("5"),(Object)("6"))) {
case 0: {
 //BA.debugLineNum = 2523;BA.debugLine="If m.Get(\"respuesta\") = \"No, está enrejado o no";
if ((_m.Get((Object)("respuesta"))).equals((Object)("No, está enrejado o no se tiene acceso"))) { 
 //BA.debugLineNum = 2524;BA.debugLine="Log(\"Tiendajon / Ventana / Kiosko\")";
__c.LogImpl("754788109","Tiendajon / Ventana / Kiosko",0);
 //BA.debugLineNum = 2525;BA.debugLine="ToastMessageShow(\"Tiendajon / Ventana / Kiosko";
__c.ToastMessageShow(BA.ObjectToCharSequence("Tiendajon / Ventana / Kiosko"),__c.False);
 //BA.debugLineNum = 2526;BA.debugLine="cuest.agregaPregunta(\"6\", \"¿Cuenta con caja de";
_cuest._agregapregunta /*String*/ ("6","¿Cuenta con caja de salida para cobro con sistema de computo?",anywheresoftware.b4a.keywords.Common.ArrayToList(new String[]{"Si, tiene sistema de computo para cobro","No"}));
 }else if((_m.Get((Object)("respuesta"))).equals((Object)("Si se pude acceder"))) { 
 //BA.debugLineNum = 2528;BA.debugLine="cuest.agregaPregunta(\"2\", \"¿Tiene al menos 2 p";
_cuest._agregapregunta /*String*/ ("2","¿Tiene al menos 2 pasillos con acceso directo a la mercancía?",anywheresoftware.b4a.keywords.Common.ArrayToList(new String[]{"Si tiene al menos 2 pasillos con acceso directo a la mercancía","No tiene pasillos o solo uno central"}));
 };
 break; }
case 1: {
 //BA.debugLineNum = 2531;BA.debugLine="If m.Get(\"respuesta\") = \"Si tiene al menos 2 pa";
if ((_m.Get((Object)("respuesta"))).equals((Object)("Si tiene al menos 2 pasillos con acceso directo a la mercancía"))) { 
 //BA.debugLineNum = 2532;BA.debugLine="Log(\"Mini-Super\")";
__c.LogImpl("754788117","Mini-Super",0);
 //BA.debugLineNum = 2533;BA.debugLine="ToastMessageShow(\"Mini-Super\", False)";
__c.ToastMessageShow(BA.ObjectToCharSequence("Mini-Super"),__c.False);
 //BA.debugLineNum = 2534;BA.debugLine="cuest.agregaPregunta(\"6\", \"¿Cuenta con caja de";
_cuest._agregapregunta /*String*/ ("6","¿Cuenta con caja de salida para cobro con sistema de computo?",anywheresoftware.b4a.keywords.Common.ArrayToList(new String[]{"Si, tiene sistema de computo para cobro","No"}));
 }else if((_m.Get((Object)("respuesta"))).equals((Object)("No tiene pasillos o solo uno central"))) { 
 //BA.debugLineNum = 2536;BA.debugLine="cuest.agregaPregunta(\"3\", \"¿Cuenta con enfriad";
_cuest._agregapregunta /*String*/ ("3","¿Cuenta con enfriador horizontal para venta de perecederos como queso, jamon, crema, etc.?",anywheresoftware.b4a.keywords.Common.ArrayToList(new String[]{"Si","No tiene enfriador horizontal."}));
 };
 break; }
case 2: {
 //BA.debugLineNum = 2539;BA.debugLine="Log(\"|\"&m.Get(\"respuesta\")&\"|\")";
__c.LogImpl("754788124","|"+BA.ObjectToString(_m.Get((Object)("respuesta")))+"|",0);
 //BA.debugLineNum = 2540;BA.debugLine="If m.Get(\"respuesta\") = \"Si\" Then";
if ((_m.Get((Object)("respuesta"))).equals((Object)("Si"))) { 
 //BA.debugLineNum = 2541;BA.debugLine="Log(\"Miscelanea\")";
__c.LogImpl("754788126","Miscelanea",0);
 //BA.debugLineNum = 2542;BA.debugLine="ToastMessageShow(\"Miscelanea\", False)";
__c.ToastMessageShow(BA.ObjectToCharSequence("Miscelanea"),__c.False);
 //BA.debugLineNum = 2543;BA.debugLine="cuest.agregaPregunta(\"6\", \"¿Cuenta con caja de";
_cuest._agregapregunta /*String*/ ("6","¿Cuenta con caja de salida para cobro con sistema de computo?",anywheresoftware.b4a.keywords.Common.ArrayToList(new String[]{"Si, tiene sistema de computo para cobro","No"}));
 }else if((_m.Get((Object)("respuesta"))).equals((Object)("No tiene enfriador horizontal."))) { 
 //BA.debugLineNum = 2545;BA.debugLine="cuest.agregaPregunta(\"4\", \"¿El local esta enfo";
_cuest._agregapregunta /*String*/ ("4","¿El local esta enfocado a venta especializada?",anywheresoftware.b4a.keywords.Common.ArrayToList(new String[]{"No","Si"}));
 };
 break; }
case 3: {
 //BA.debugLineNum = 2548;BA.debugLine="If m.Get(\"respuesta\") = \"No\" Then";
if ((_m.Get((Object)("respuesta"))).equals((Object)("No"))) { 
 //BA.debugLineNum = 2549;BA.debugLine="Log(\"Abarrotera\")";
__c.LogImpl("754788134","Abarrotera",0);
 //BA.debugLineNum = 2550;BA.debugLine="ToastMessageShow(\"Abarrotera\", False)";
__c.ToastMessageShow(BA.ObjectToCharSequence("Abarrotera"),__c.False);
 //BA.debugLineNum = 2551;BA.debugLine="cuest.agregaPregunta(\"6\", \"¿Cuenta con caja de";
_cuest._agregapregunta /*String*/ ("6","¿Cuenta con caja de salida para cobro con sistema de computo?",anywheresoftware.b4a.keywords.Common.ArrayToList(new String[]{"Si, tiene sistema de computo para cobro","No"}));
 }else if((_m.Get((Object)("respuesta"))).equals((Object)("Si"))) { 
 //BA.debugLineNum = 2553;BA.debugLine="cuest.agregaPregunta(\"5\", \"¿Cual venta especia";
_cuest._agregapregunta /*String*/ ("5","¿Cual venta especializada?",anywheresoftware.b4a.keywords.Common.ArrayToList(new String[]{"Carnicería / Pollería","Cremería","Depósito / Vinateria","Dulcería","Farmacia","Fonda / Restaurante / Cafetería","Verdulería"}));
 };
 break; }
case 4: {
 //BA.debugLineNum = 2556;BA.debugLine="Log(m.Get(\"respuesta\"))";
__c.LogImpl("754788141",BA.ObjectToString(_m.Get((Object)("respuesta"))),0);
 //BA.debugLineNum = 2557;BA.debugLine="ToastMessageShow(m.Get(\"respuesta\"), False)";
__c.ToastMessageShow(BA.ObjectToCharSequence(_m.Get((Object)("respuesta"))),__c.False);
 //BA.debugLineNum = 2562;BA.debugLine="cuest.agregaPregunta(\"6\", \"¿Cuenta con caja de";
_cuest._agregapregunta /*String*/ ("6","¿Cuenta con caja de salida para cobro con sistema de computo?",anywheresoftware.b4a.keywords.Common.ArrayToList(new String[]{"Si, tiene sistema de computo para cobro","No"}));
 break; }
case 5: {
 //BA.debugLineNum = 2565;BA.debugLine="Log(m.Get(\"respuesta\"))";
__c.LogImpl("754788150",BA.ObjectToString(_m.Get((Object)("respuesta"))),0);
 //BA.debugLineNum = 2566;BA.debugLine="ToastMessageShow(m.Get(\"respuesta\"), False)";
__c.ToastMessageShow(BA.ObjectToCharSequence(_m.Get((Object)("respuesta"))),__c.False);
 //BA.debugLineNum = 2567;BA.debugLine="Log(\">>>>>>>>>>  \" & cuest.encuestaIniciada)";
__c.LogImpl("754788152",">>>>>>>>>>  "+BA.ObjectToString(_cuest._encuestainiciada /*boolean*/ ),0);
 //BA.debugLineNum = 2568;BA.debugLine="cuest.encuestaIniciada = False";
_cuest._encuestainiciada /*boolean*/  = __c.False;
 //BA.debugLineNum = 2569;BA.debugLine="Log(\">>>>>>>>>>  \" & cuest.encuestaIniciada)";
__c.LogImpl("754788154",">>>>>>>>>>  "+BA.ObjectToString(_cuest._encuestainiciada /*boolean*/ ),0);
 //BA.debugLineNum = 2572;BA.debugLine="B4XPage_Appear";
_b4xpage_appear();
 break; }
}
;
 //BA.debugLineNum = 2575;BA.debugLine="End Sub";
return "";
}
public String  _datos_click() throws Exception{
 //BA.debugLineNum = 680;BA.debugLine="Sub DATOS_Click";
 //BA.debugLineNum = 681;BA.debugLine="B4XPages.ShowPage(\"telefonos\")";
_b4xpages._showpage /*String*/ (ba,"telefonos");
 //BA.debugLineNum = 682;BA.debugLine="End Sub";
return "";
}
public String  _gest_click() throws Exception{
 //BA.debugLineNum = 571;BA.debugLine="Sub gest_Click";
 //BA.debugLineNum = 572;BA.debugLine="Starter.BanderaActualizar = \"1\"";
_starter._banderaactualizar /*String*/  = "1";
 //BA.debugLineNum = 573;BA.debugLine="Log(\"---------> Estoy en boton 24HRS:\"&Starter.Ba";
__c.LogImpl("751838978","---------> Estoy en boton 24HRS:"+_starter._banderaactualizar /*String*/ ,0);
 //BA.debugLineNum = 574;BA.debugLine="If la_cuenta.Text = \"0\" Then";
if ((_la_cuenta.getText()).equals("0")) { 
 //BA.debugLineNum = 575;BA.debugLine="B4XPages.MainPage.tipo_venta = \"ABORDO\"";
_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._tipo_venta /*String*/  = "ABORDO";
 }else if((_la_cuenta.getText()).equals("1")) { 
 //BA.debugLineNum = 577;BA.debugLine="B4XPages.MainPage.tipo_venta = \"RECARGA\"";
_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._tipo_venta /*String*/  = "RECARGA";
 }else {
 //BA.debugLineNum = 579;BA.debugLine="B4XPages.MainPage.tipo_venta = \"PREVENTA\"";
_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._tipo_venta /*String*/  = "PREVENTA";
 };
 //BA.debugLineNum = 611;BA.debugLine="B4XPages.ShowPage(\"productos\")";
_b4xpages._showpage /*String*/ (ba,"productos");
 //BA.debugLineNum = 612;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 = 517;BA.debugLine="Sub GPS_LocationChanged (Location1 As Location)";
 //BA.debugLineNum = 519;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 = 520;BA.debugLine="B4XPages.MainPage.lat_gps = Tracker.FLP.GetLastK";
_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._lat_gps /*String*/  = BA.NumberToString(_tracker._flp /*uk.co.martinpearman.b4a.fusedlocationprovider.FusedLocationProviderWrapper*/ .GetLastKnownLocation().getLatitude());
 //BA.debugLineNum = 521;BA.debugLine="B4XPages.MainPage.lon_gps = Tracker.FLP.GetLastK";
_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._lon_gps /*String*/  = BA.NumberToString(_tracker._flp /*uk.co.martinpearman.b4a.fusedlocationprovider.FusedLocationProviderWrapper*/ .GetLastKnownLocation().getLongitude());
 //BA.debugLineNum = 522;BA.debugLine="Log(\"Coords set to: \" & B4XPages.MainPage.lat_gp";
__c.LogImpl("751707909","Coords set to: "+_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._lat_gps /*String*/ +" and "+_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._lon_gps /*String*/ ,0);
 };
 //BA.debugLineNum = 525;BA.debugLine="If m_lat.Length < 5 Then";
if (_m_lat.length()<5) { 
 }else {
 //BA.debugLineNum = 530;BA.debugLine="Dim l1, l2 As Location";
_l1 = new anywheresoftware.b4a.gps.LocationWrapper();
_l2 = new anywheresoftware.b4a.gps.LocationWrapper();
 //BA.debugLineNum = 531;BA.debugLine="l1.Initialize2(B4XPages.MainPage.lat_gps, B4XPage";
_l1.Initialize2(_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._lat_gps /*String*/ ,_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._lon_gps /*String*/ );
 //BA.debugLineNum = 532;BA.debugLine="Log($\"Coordenadas de la tienda - lat:${m_lat}, lo";
__c.LogImpl("751707919",("Coordenadas de la tienda - lat:"+__c.SmartStringFormatter("",(Object)(_m_lat))+", lon:"+__c.SmartStringFormatter("",(Object)(_m_lon))+""),0);
 //BA.debugLineNum = 533;BA.debugLine="l2.Initialize2(m_lat, m_lon)";
_l2.Initialize2(_m_lat,_m_lon);
 //BA.debugLineNum = 535;BA.debugLine="BT_QR.Enabled = True";
_bt_qr.setEnabled(__c.True);
 //BA.debugLineNum = 536;BA.debugLine="LA_GPS.TextColor = Colors.Blue";
_la_gps.setTextColor(__c.Colors.Blue);
 //BA.debugLineNum = 537;BA.debugLine="LA_GPS.Text = \"CON UBICACION GPS\"";
_la_gps.setText(BA.ObjectToCharSequence("CON UBICACION GPS"));
 //BA.debugLineNum = 540;BA.debugLine="distance =    l1.DistanceTo(l2)  'the result is i";
_distance = (long) (_l1.DistanceTo((android.location.Location)(_l2.getObject())));
 //BA.debugLineNum = 541;BA.debugLine="gest.Visible = True";
_gest.setVisible(__c.True);
 //BA.debugLineNum = 542;BA.debugLine="If distance < 5000000000000000 Then";
if (_distance<5000000000000000L) { 
 //BA.debugLineNum = 543;BA.debugLine="LA_GEO.TextColor = Colors.Blue";
_la_geo.setTextColor(__c.Colors.Blue);
 //BA.debugLineNum = 544;BA.debugLine="Tels.Visible = True";
_tels.setVisible(__c.True);
 //BA.debugLineNum = 545;BA.debugLine="gest.Visible = True";
_gest.setVisible(__c.True);
 //BA.debugLineNum = 546;BA.debugLine="bitacora.inicioFin";
_bitacora._iniciofin /*String*/ ();
 //BA.debugLineNum = 549;BA.debugLine="b_ventaabordo.Visible = False";
_b_ventaabordo.setVisible(__c.False);
 }else {
 //BA.debugLineNum = 551;BA.debugLine="Tels.Visible = False";
_tels.setVisible(__c.False);
 //BA.debugLineNum = 552;BA.debugLine="gest.Visible = False";
_gest.setVisible(__c.False);
 //BA.debugLineNum = 553;BA.debugLine="bitacora.p_transparenteInicioFin2.Visible = Fals";
_bitacora._p_transparenteiniciofin2 /*anywheresoftware.b4a.objects.PanelWrapper*/ .setVisible(__c.False);
 //BA.debugLineNum = 555;BA.debugLine="b_ventaabordo.Visible = False";
_b_ventaabordo.setVisible(__c.False);
 //BA.debugLineNum = 556;BA.debugLine="LA_GEO.TextColor = Colors.Red";
_la_geo.setTextColor(__c.Colors.Red);
 };
 //BA.debugLineNum = 558;BA.debugLine="LA_GEO.Text= $\"$1.2{distance/1000} kms\"$";
_la_geo.setText(BA.ObjectToCharSequence((""+__c.SmartStringFormatter("1.2",(Object)(_distance/(double)1000))+" kms")));
 };
 //BA.debugLineNum = 562;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"DELETE FROM";
_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("DELETE FROM HIST_GPS");
 //BA.debugLineNum = 563;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"INSERT INTO";
_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._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 /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._lat_gps /*String*/ ),(Object)(_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._lon_gps /*String*/ )}));
 //BA.debugLineNum = 564;BA.debugLine="CallSubDelayed(Tracker, \"CreateLocationRequest\")";
__c.CallSubDelayed(ba,(Object)(_tracker.getObject()),"CreateLocationRequest");
 //BA.debugLineNum = 565;BA.debugLine="End Sub";
return "";
}
public String  _guadaventa2() throws Exception{
int _cbfactura = 0;
 //BA.debugLineNum = 976;BA.debugLine="Sub GUADAVENTA2";
 //BA.debugLineNum = 977;BA.debugLine="Log(B4XPages.MainPage.recarga)";
__c.LogImpl("752428801",_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._recarga /*String*/ ,0);
 //BA.debugLineNum = 978;BA.debugLine="Log(\"----> Entramos a guardara venta 2 <-------\")";
__c.LogImpl("752428802","----> Entramos a guardara venta 2 <-------",0);
 //BA.debugLineNum = 979;BA.debugLine="If B4XPages.MainPage.recarga = \"0\" Then";
if ((_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._recarga /*String*/ ).equals("0")) { 
 //BA.debugLineNum = 980;BA.debugLine="DateTime.DateFormat = \"MM/dd/yyyy\"";
__c.DateTime.setDateFormat("MM/dd/yyyy");
 //BA.debugLineNum = 981;BA.debugLine="sDate=DateTime.Date(DateTime.Now)";
_sdate = __c.DateTime.Date(__c.DateTime.getNow());
 //BA.debugLineNum = 982;BA.debugLine="sTime=DateTime.Time(DateTime.Now)";
_stime = __c.DateTime.Time(__c.DateTime.getNow());
 //BA.debugLineNum = 983;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"Select CUENT";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("Select CUENTA from cuentaa")));
 //BA.debugLineNum = 984;BA.debugLine="c.Position=0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 985;BA.debugLine="clie_id = c.GetString(\"CUENTA\")";
_clie_id = _c.GetString("CUENTA");
 //BA.debugLineNum = 986;BA.debugLine="c.Close";
_c.Close();
 //BA.debugLineNum = 987;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"select USUAR";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select USUARIO from usuarioa")));
 //BA.debugLineNum = 988;BA.debugLine="c.Position=0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 989;BA.debugLine="usuario = c.GetString(\"USUARIO\")";
_usuario = _c.GetString("USUARIO");
 //BA.debugLineNum = 990;BA.debugLine="c.Close";
_c.Close();
 //BA.debugLineNum = 991;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"select sum(p";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select sum(pe_costo_tot) as TOTAL_CLIE, SUM(PE_CANT) AS CANT_CLIE, COUNT(*) AS CUANTOS FROM PEDIDO WHERE PE_CLIENTE IN (Select CUENTA from cuentaa)")));
 //BA.debugLineNum = 992;BA.debugLine="c.Position=0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 994;BA.debugLine="If c.GetString(\"CUANTOS\") > 0 Then";
if ((double)(Double.parseDouble(_c.GetString("CUANTOS")))>0) { 
 //BA.debugLineNum = 995;BA.debugLine="Private cbFactura As Int = 0";
_cbfactura = (int) (0);
 //BA.debugLineNum = 996;BA.debugLine="If cb_factura.Checked Then cbFactura = 1";
if (_cb_factura.getChecked()) { 
_cbfactura = (int) (1);};
 //BA.debugLineNum = 997;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"delete fro";
_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("delete from NOVENTA where NV_CLIENTE In (select cuenta from cuentaa)");
 //BA.debugLineNum = 998;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"delete fro";
_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("delete from pedido_cliente where PC_CLIENTE In (select cuenta from cuentaa)");
 //BA.debugLineNum = 999;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"insert in";
_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("insert into pedido_cliente(PC_CLIENTE, PC_FECHA, PC_USER, PC_NOART, PC_MONTO, PC_LON, PC_LAT, PC_ENVIO_OK, PC_FACTURA) VALUES (?,?,?,?,?,?,?,?,?)",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(_clie_id),(Object)(_sdate+_stime),(Object)(_usuario),(Object)(_c.GetString("CANT_CLIE")),(Object)(_c.GetString("TOTAL_CLIE")),(Object)(_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._lon_gps /*String*/ ),(Object)(_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._lat_gps /*String*/ ),(Object)(0),(Object)(_cbfactura)}));
 //BA.debugLineNum = 1000;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"UPDATE kmt";
_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("UPDATE kmt_info set gestion = 2  where CAT_CL_CODIGO In (select cuenta from cuentaa)");
 //BA.debugLineNum = 1001;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"UPDATE kmt";
_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("UPDATE kmt_info set gestion = 2  where CAT_CL_CODIGO In (select cuenta from cuentaa)");
 };
 //BA.debugLineNum = 1003;BA.debugLine="c.Close";
_c.Close();
 //BA.debugLineNum = 1004;BA.debugLine="DateTime.TimeFormat = \"HHmmss\"";
__c.DateTime.setTimeFormat("HHmmss");
 //BA.debugLineNum = 1005;BA.debugLine="sTime=DateTime.Time(DateTime.Now)";
_stime = __c.DateTime.Time(__c.DateTime.getNow());
 //BA.debugLineNum = 1006;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"UPDATE HIS";
_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("UPDATE HIST_STAY_STORE set HSS_OUT = ?  where HSS_OUT = 0 AND  HSS_CODIGO In (select cuenta from cuentaa)",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(_stime)}));
 //BA.debugLineNum = 1008;BA.debugLine="Try";
try { //BA.debugLineNum = 1009;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\" Select (su";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery(" Select (substr(HSS_OUT,1,2) - substr(HSS_IN,1,2)) - Case when  (substr(HSS_OUT,3,2) - substr(HSS_IN,3,2)) < 0 Then 1 Else 0 end HORAS_TOTALES, "+"Case when  (substr(HSS_OUT,3,2) - substr(HSS_IN,3,2)) < 0 Then (substr(HSS_OUT,3,2) + 60 - substr(HSS_IN,3,2)) "+"	Else (substr(HSS_OUT,3,2) - substr(HSS_IN,3,2)) End - Case when  (substr(HSS_OUT,5,2) - substr(HSS_IN,5,2)) < 0 Then 1 Else 0 end  MINUTOS_TOTALES, "+"Case when  (substr(HSS_OUT,5,2) - substr(HSS_IN,5,2)) < 0 Then (substr(HSS_OUT,5,2) + 60 - substr(HSS_IN,5,2)) "+"	Else (substr(HSS_OUT,5,2) - substr(HSS_IN,5,2)) end SEGUNDOS_TOTALES "+"	from HIST_STAY_STORE where HSS_CODIGO In (Select cuenta from cuentaa) ")));
 //BA.debugLineNum = 1015;BA.debugLine="c.Position = 0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 1016;BA.debugLine="stay_hh = c.GetString(\"HORAS_TOTALES\") * 60 * 6";
_stay_hh = BA.NumberToString((double)(Double.parseDouble(_c.GetString("HORAS_TOTALES")))*60*60);
 //BA.debugLineNum = 1017;BA.debugLine="stay_mi = c.GetString(\"MINUTOS_TOTALES\") * 60";
_stay_mi = BA.NumberToString((double)(Double.parseDouble(_c.GetString("MINUTOS_TOTALES")))*60);
 //BA.debugLineNum = 1018;BA.debugLine="stay_ss = c.GetString(\"SEGUNDOS_TOTALES\")";
_stay_ss = _c.GetString("SEGUNDOS_TOTALES");
 //BA.debugLineNum = 1019;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"UPDATE HI";
_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("UPDATE HIST_STAY_STORE set HSS_TOT = ?  where HSS_CODIGO In (select cuenta from cuentaa)",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)((double)(Double.parseDouble(_stay_hh))+(double)(Double.parseDouble(_stay_mi))+(double)(Double.parseDouble(_stay_ss)))}));
 //BA.debugLineNum = 1020;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"UPDATE HI";
_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("UPDATE HIST_STAY_OUT set HSO_FIN = ?  ",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(_stime)}));
 //BA.debugLineNum = 1021;BA.debugLine="c.Close";
_c.Close();
 } 
       catch (Exception e40) {
			ba.setLastException(e40); //BA.debugLineNum = 1023;BA.debugLine="ToastMessageShow(\".\",True)";
__c.ToastMessageShow(BA.ObjectToCharSequence("."),__c.True);
 };
 //BA.debugLineNum = 1026;BA.debugLine="skmt.ExecNonQuery2(\"update PEDIDO_INICIO_FINAL s";
_skmt.ExecNonQuery2("update PEDIDO_INICIO_FINAL set PIF_HORA_FINAL = ? where PIF_CLIENTE = ? and PIF_HORA_FINAL = 0",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(__c.DateTime.getNow()),(Object)(_la_cuenta.getText())}));
 //BA.debugLineNum = 1028;BA.debugLine="Subs.actualizaTET(la_cuenta.text)";
_subs._actualizatet /*String*/ (ba,_la_cuenta.getText());
 //BA.debugLineNum = 1029;BA.debugLine="DateTime.TimeFormat = \"HH:mm:ss\"";
__c.DateTime.setTimeFormat("HH:mm:ss");
 //BA.debugLineNum = 1031;BA.debugLine="Log(\"para mostrar que aqui me quedo \")";
__c.LogImpl("752428855","para mostrar que aqui me quedo ",0);
 //BA.debugLineNum = 1034;BA.debugLine="B4XPages.MainPage.productos.reiniciarlistaProds";
_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._productos /*medicomed.keymon.com.mx.c_productos*/ ._reiniciarlistaprods /*boolean*/  = __c.True;
 //BA.debugLineNum = 1035;BA.debugLine="B4XPages.MainPage.productos.prodsMap.Initialize";
_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._productos /*medicomed.keymon.com.mx.c_productos*/ ._prodsmap /*anywheresoftware.b4a.objects.collections.Map*/ .Initialize();
 //BA.debugLineNum = 1036;BA.debugLine="B4XPages.MainPage.promos.promosMap.Initialize";
_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._promos /*medicomed.keymon.com.mx.c_promos*/ ._promosmap /*anywheresoftware.b4a.objects.collections.Map*/ .Initialize();
 //BA.debugLineNum = 1037;BA.debugLine="Guardar.Enabled = True";
_guardar.setEnabled(__c.True);
 //BA.debugLineNum = 1038;BA.debugLine="bitacora.b_Inicio_Fin_venta2.Enabled = True";
_bitacora._b_inicio_fin_venta2 /*anywheresoftware.b4a.objects.ButtonWrapper*/ .setEnabled(__c.True);
 //BA.debugLineNum = 1039;BA.debugLine="gest.Enabled = True";
_gest.setEnabled(__c.True);
 //BA.debugLineNum = 1040;BA.debugLine="b_cxc.Enabled = False";
_b_cxc.setEnabled(__c.False);
 //BA.debugLineNum = 1041;BA.debugLine="Tar.Enabled = True";
_tar.setEnabled(__c.True);
 //BA.debugLineNum = 1042;BA.debugLine="Tels.Enabled = True";
_tels.setEnabled(__c.True);
 //BA.debugLineNum = 1043;BA.debugLine="b_ventaabordo.Enabled = False";
_b_ventaabordo.setEnabled(__c.False);
 //BA.debugLineNum = 1044;BA.debugLine="HIST.Enabled = True";
_hist.setEnabled(__c.True);
 //BA.debugLineNum = 1045;BA.debugLine="banderaimp = 0";
_banderaimp = (int) (0);
 //BA.debugLineNum = 1046;BA.debugLine="bitacora.b_Inicio_Fin_venta2.Text = \"TERMINAR VE";
_bitacora._b_inicio_fin_venta2 /*anywheresoftware.b4a.objects.ButtonWrapper*/ .setText(BA.ObjectToCharSequence("TERMINAR VENTA"));
 //BA.debugLineNum = 1047;BA.debugLine="bitacora.enVenta = False";
_bitacora._enventa /*boolean*/  = __c.False;
 //BA.debugLineNum = 1048;BA.debugLine="bitacora.inicioFin";
_bitacora._iniciofin /*String*/ ();
 //BA.debugLineNum = 1049;BA.debugLine="imprimirsolo = 0";
_imprimirsolo = BA.NumberToString(0);
 }else if((_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._recarga /*String*/ ).equals("1")) { 
 //BA.debugLineNum = 1052;BA.debugLine="DateTime.DateFormat = \"MM/dd/yyyy\"";
__c.DateTime.setDateFormat("MM/dd/yyyy");
 //BA.debugLineNum = 1053;BA.debugLine="sDate=DateTime.Date(DateTime.Now)";
_sdate = __c.DateTime.Date(__c.DateTime.getNow());
 //BA.debugLineNum = 1054;BA.debugLine="sTime=DateTime.Time(DateTime.Now)";
_stime = __c.DateTime.Time(__c.DateTime.getNow());
 //BA.debugLineNum = 1055;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"Select CUENT";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("Select CUENTA from cuentaa")));
 //BA.debugLineNum = 1056;BA.debugLine="c.Position=0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 1057;BA.debugLine="clie_id = c.GetString(\"CUENTA\")";
_clie_id = _c.GetString("CUENTA");
 //BA.debugLineNum = 1058;BA.debugLine="c.Close";
_c.Close();
 //BA.debugLineNum = 1059;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"select USUAR";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select USUARIO from usuarioa")));
 //BA.debugLineNum = 1060;BA.debugLine="c.Position=0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 1061;BA.debugLine="usuario = c.GetString(\"USUARIO\")";
_usuario = _c.GetString("USUARIO");
 //BA.debugLineNum = 1062;BA.debugLine="c.Close";
_c.Close();
 //BA.debugLineNum = 1063;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"select sum(p";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select sum(pe_costo_tot) as TOTAL_CLIE, SUM(PE_CANT) AS CANT_CLIE, COUNT(*) AS CUANTOS FROM PEDIDO WHERE PE_CLIENTE IN (Select CUENTA from cuentaa)")));
 //BA.debugLineNum = 1064;BA.debugLine="c.Position=0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 1066;BA.debugLine="If c.GetString(\"CUANTOS\") > 0 Then";
if ((double)(Double.parseDouble(_c.GetString("CUANTOS")))>0) { 
 //BA.debugLineNum = 1067;BA.debugLine="Private cbFactura As Int = 0";
_cbfactura = (int) (0);
 //BA.debugLineNum = 1068;BA.debugLine="If cb_factura.Checked Then cbFactura = 1";
if (_cb_factura.getChecked()) { 
_cbfactura = (int) (1);};
 //BA.debugLineNum = 1069;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"delete fro";
_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("delete from NOVENTA where NV_CLIENTE In (select cuenta from cuentaa)");
 //BA.debugLineNum = 1070;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"delete fro";
_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("delete from pedido_cliente where PC_CLIENTE In (select cuenta from cuentaa)");
 //BA.debugLineNum = 1071;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"insert in";
_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("insert into pedido_cliente(PC_CLIENTE, PC_FECHA, PC_USER, PC_NOART, PC_MONTO, PC_LON, PC_LAT, PC_ENVIO_OK, PC_FACTURA) VALUES (?,?,?,?,?,?,?,?,?)",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(_clie_id),(Object)(_sdate+_stime),(Object)(_usuario),(Object)(_c.GetString("CANT_CLIE")),(Object)(_c.GetString("TOTAL_CLIE")),(Object)(_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._lon_gps /*String*/ ),(Object)(_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._lat_gps /*String*/ ),(Object)(0),(Object)(_cbfactura)}));
 //BA.debugLineNum = 1072;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"UPDATE kmt";
_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("UPDATE kmt_info set gestion = 2  where CAT_CL_CODIGO In (select cuenta from cuentaa)");
 };
 //BA.debugLineNum = 1074;BA.debugLine="c.Close";
_c.Close();
 //BA.debugLineNum = 1075;BA.debugLine="DateTime.TimeFormat = \"HHmmss\"";
__c.DateTime.setTimeFormat("HHmmss");
 //BA.debugLineNum = 1076;BA.debugLine="sTime=DateTime.Time(DateTime.Now)";
_stime = __c.DateTime.Time(__c.DateTime.getNow());
 //BA.debugLineNum = 1077;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"UPDATE HIS";
_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("UPDATE HIST_STAY_STORE set HSS_OUT = ?  where HSS_OUT = 0 AND  HSS_CODIGO In (select cuenta from cuentaa)",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(_stime)}));
 //BA.debugLineNum = 1097;BA.debugLine="skmt.ExecNonQuery2(\"update PEDIDO_INICIO_FINAL s";
_skmt.ExecNonQuery2("update PEDIDO_INICIO_FINAL set PIF_HORA_FINAL = ? where PIF_CLIENTE = ? and PIF_HORA_FINAL = 0",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(__c.DateTime.getNow()),(Object)(_la_cuenta.getText())}));
 //BA.debugLineNum = 1099;BA.debugLine="Subs.actualizaTET(la_cuenta.text)";
_subs._actualizatet /*String*/ (ba,_la_cuenta.getText());
 //BA.debugLineNum = 1100;BA.debugLine="DateTime.TimeFormat = \"HH:mm:ss\"";
__c.DateTime.setTimeFormat("HH:mm:ss");
 //BA.debugLineNum = 1106;BA.debugLine="B4XPages.MainPage.productos.reiniciarlistaProds";
_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._productos /*medicomed.keymon.com.mx.c_productos*/ ._reiniciarlistaprods /*boolean*/  = __c.True;
 //BA.debugLineNum = 1107;BA.debugLine="B4XPages.MainPage.productos.prodsMap.Initialize";
_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._productos /*medicomed.keymon.com.mx.c_productos*/ ._prodsmap /*anywheresoftware.b4a.objects.collections.Map*/ .Initialize();
 //BA.debugLineNum = 1108;BA.debugLine="B4XPages.MainPage.promos.promosMap.Initialize";
_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._promos /*medicomed.keymon.com.mx.c_promos*/ ._promosmap /*anywheresoftware.b4a.objects.collections.Map*/ .Initialize();
 //BA.debugLineNum = 1110;BA.debugLine="B4XPages.MainPage.recarga = \"0\"";
_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._recarga /*String*/  = "0";
 //BA.debugLineNum = 1111;BA.debugLine="imprimirsolo = 0";
_imprimirsolo = BA.NumberToString(0);
 };
 //BA.debugLineNum = 1114;BA.debugLine="End Sub";
return "";
}
public String  _guardar_click() throws Exception{
String _comprarar = "";
anywheresoftware.b4a.sql.SQL.CursorWrapper _credi2 = null;
 //BA.debugLineNum = 684;BA.debugLine="Sub Guardar_Click";
 //BA.debugLineNum = 689;BA.debugLine="If l_total.Text = \"null\" Then";
if ((_l_total.getText()).equals("null")) { 
 //BA.debugLineNum = 690;BA.debugLine="Dim comprarar As String = 0";
_comprarar = BA.NumberToString(0);
 }else {
 //BA.debugLineNum = 692;BA.debugLine="comprarar = l_total.Text";
_comprarar = _l_total.getText();
 };
 //BA.debugLineNum = 694;BA.debugLine="c = B4XPages.MainPage.skmt.ExecQuery2(\"SELECT COU";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery2("SELECT COUNT(*) AS CUANTOS FROM PEDIDO WHERE PE_CLIENTE IN (SELECT CUENTA FROM CUENTAA) and PE_FOLIO = ?",new String[]{"PREVENTA"})));
 //BA.debugLineNum = 695;BA.debugLine="c.Position = 0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 696;BA.debugLine="If c.GetString(\"CUANTOS\") > 0 Then";
if ((double)(Double.parseDouble(_c.GetString("CUANTOS")))>0) { 
 //BA.debugLineNum = 697;BA.debugLine="Log(\"1\")";
__c.LogImpl("752166669","1",0);
 //BA.debugLineNum = 698;BA.debugLine="If la_cuenta.Text <> 0 Then";
if ((_la_cuenta.getText()).equals(BA.NumberToString(0)) == false) { 
 //BA.debugLineNum = 699;BA.debugLine="Log(\"2\")";
__c.LogImpl("752166671","2",0);
 //BA.debugLineNum = 700;BA.debugLine="Credi = B4XPages.MainPage.skmt.ExecQuery(\"Sele";
_credi = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("Select IFNULL(CAT_CL_BCREDITO,0) AS CAT_CL_BCREDITO FROM kmt_info Where CAT_CL_CODIGO IN (SELECT CUENTA FROM CUENTAA) and CAT_CL_CODIGO NOT IN (SELECT CLIENTE FROM ABONOSP) UNION Select IFNULL(CAT_CL_BCREDITO,0) AS CAT_CL_BCREDITO FROM kmt_info Where CAT_CL_CODIGO IN (SELECT CUENTA FROM CUENTAA) and CAT_CL_CODIGO NOT IN (SELECT CLIENTE FROM ABONOSP)")));
 //BA.debugLineNum = 702;BA.debugLine="If Credi.RowCount > 0 Then";
if (_credi.getRowCount()>0) { 
 //BA.debugLineNum = 703;BA.debugLine="Log(\"3\")";
__c.LogImpl("752166675","3",0);
 //BA.debugLineNum = 704;BA.debugLine="Credi.Position = 0";
_credi.setPosition((int) (0));
 //BA.debugLineNum = 705;BA.debugLine="If Credi.GetString(\"CAT_CL_BCREDITO\") = \"1\" T";
if ((_credi.GetString("CAT_CL_BCREDITO")).equals("1")) { 
 //BA.debugLineNum = 706;BA.debugLine="Log(\"4\")";
__c.LogImpl("752166678","4",0);
 //BA.debugLineNum = 707;BA.debugLine="If l_total.Text <> \"null\" Then";
if ((_l_total.getText()).equals("null") == false) { 
 //BA.debugLineNum = 708;BA.debugLine="Log(\"5\")";
__c.LogImpl("752166680","5",0);
 //BA.debugLineNum = 709;BA.debugLine="If pre_act <> Starter.pre_viejo Then";
if (_pre_act!=_starter._pre_viejo /*float*/ ) { 
 //BA.debugLineNum = 710;BA.debugLine="Log(\"6\")";
__c.LogImpl("752166682","6",0);
 //BA.debugLineNum = 726;BA.debugLine="GuardaVenta";
_guardaventa();
 }else if(_pre_act==_starter._pre_viejo /*float*/ ) { 
 //BA.debugLineNum = 733;BA.debugLine="Log(\"7\")";
__c.LogImpl("752166705","7",0);
 //BA.debugLineNum = 734;BA.debugLine="GuardaVenta";
_guardaventa();
 };
 }else if((_l_total.getText()).equals("null")) { 
 //BA.debugLineNum = 737;BA.debugLine="Log(\"8\")";
__c.LogImpl("752166709","8",0);
 //BA.debugLineNum = 738;BA.debugLine="GuardaVenta";
_guardaventa();
 };
 }else if((_credi.GetString("CAT_CL_BCREDITO")).equals("0")) { 
 //BA.debugLineNum = 743;BA.debugLine="Log(\"9\")";
__c.LogImpl("752166715","9",0);
 //BA.debugLineNum = 744;BA.debugLine="GuardaVenta";
_guardaventa();
 };
 }else {
 //BA.debugLineNum = 747;BA.debugLine="Private credi2 As Cursor = B4XPages.MainPage.s";
_credi2 = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_credi2 = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("SELECT CAT_CL_BCREDITO, a_abono, SALDO_PENDIENTE FROM KMT_INFO INNER JOIN ABONOSP ON CAT_CL_CODIGO = CLIENTE INNER JOIN ABONOS ON CAT_CL_CODIGO = a_cliente WHERE CAT_CL_CODIGO IN (SELECT CUENTA FROM CUENTAA) UNION SELECT CAT_CL_BCREDITO, a_abono, SALDO_PENDIENTE FROM kmt_info INNER JOIN ABONOSP ON CAT_CL_CODIGO = CLIENTE INNER JOIN ABONOS ON CAT_CL_CODIGO = a_cliente WHERE CAT_CL_CODIGO IN (SELECT CUENTA FROM CUENTAA)")));
 //BA.debugLineNum = 748;BA.debugLine="If credi2.RowCount > 0 Then";
if (_credi2.getRowCount()>0) { 
 //BA.debugLineNum = 749;BA.debugLine="credi2.Position = 0";
_credi2.setPosition((int) (0));
 //BA.debugLineNum = 750;BA.debugLine="If credi2.GetString (\"CAT_CL_BCREDITO\") = \"1\"";
if ((_credi2.GetString("CAT_CL_BCREDITO")).equals("1") && (_credi2.GetString("a_abono")).equals(_credi2.GetString("SALDO_PENDIENTE"))) { 
 //BA.debugLineNum = 751;BA.debugLine="If l_total.Text <> \"null\" Then";
if ((_l_total.getText()).equals("null") == false) { 
 //BA.debugLineNum = 752;BA.debugLine="If pre_act <> Starter.pre_viejo Then";
if (_pre_act!=_starter._pre_viejo /*float*/ ) { 
 //BA.debugLineNum = 768;BA.debugLine="Log(\"10\")";
__c.LogImpl("752166740","10",0);
 //BA.debugLineNum = 769;BA.debugLine="GuardaVenta";
_guardaventa();
 }else if(_pre_act==_starter._pre_viejo /*float*/ ) { 
 //BA.debugLineNum = 772;BA.debugLine="Log(\"11\")";
__c.LogImpl("752166744","11",0);
 //BA.debugLineNum = 773;BA.debugLine="GuardaVenta";
_guardaventa();
 };
 }else if((_l_total.getText()).equals("null")) { 
 //BA.debugLineNum = 776;BA.debugLine="Log(\"11\")";
__c.LogImpl("752166748","11",0);
 //BA.debugLineNum = 777;BA.debugLine="GuardaVenta";
_guardaventa();
 };
 }else {
 //BA.debugLineNum = 780;BA.debugLine="Log(\"12\")";
__c.LogImpl("752166752","12",0);
 //BA.debugLineNum = 781;BA.debugLine="GuardaVenta";
_guardaventa();
 };
 }else {
 //BA.debugLineNum = 784;BA.debugLine="Log(\"13\")";
__c.LogImpl("752166756","13",0);
 //BA.debugLineNum = 785;BA.debugLine="GuardaVenta";
_guardaventa();
 };
 };
 }else if((_la_cuenta.getText()).equals(BA.NumberToString(0))) { 
 //BA.debugLineNum = 790;BA.debugLine="Log(\"14\")";
__c.LogImpl("752166762","14",0);
 //BA.debugLineNum = 791;BA.debugLine="GuardaVenta";
_guardaventa();
 };
 }else if((_c.GetString("CUANTOS")).equals(BA.NumberToString(0))) { 
 //BA.debugLineNum = 794;BA.debugLine="Log(\"15\")";
__c.LogImpl("752166766","15",0);
 //BA.debugLineNum = 798;BA.debugLine="GuardaVenta";
_guardaventa();
 };
 //BA.debugLineNum = 801;BA.debugLine="End Sub";
return "";
}
public String  _guardaventa() throws Exception{
String _comprarar = "";
 //BA.debugLineNum = 863;BA.debugLine="Sub GuardaVenta";
 //BA.debugLineNum = 864;BA.debugLine="imprimirsolo = 0";
_imprimirsolo = BA.NumberToString(0);
 //BA.debugLineNum = 865;BA.debugLine="If l_total.Text = \"null\" Then";
if ((_l_total.getText()).equals("null")) { 
 //BA.debugLineNum = 866;BA.debugLine="Dim comprarar As String = 0";
_comprarar = BA.NumberToString(0);
 }else {
 //BA.debugLineNum = 868;BA.debugLine="comprarar = l_total.Text";
_comprarar = _l_total.getText();
 };
 //BA.debugLineNum = 870;BA.debugLine="LogColor(comprarar,Colors.Green)";
__c.LogImpl("752363271",_comprarar,__c.Colors.Green);
 //BA.debugLineNum = 871;BA.debugLine="If comprarar = Starter.pre_viejo Then";
if ((_comprarar).equals(BA.NumberToString(_starter._pre_viejo /*float*/ ))) { 
 //BA.debugLineNum = 872;BA.debugLine="If bitacora.enVenta Then";
if (_bitacora._enventa /*boolean*/ ) { 
 //BA.debugLineNum = 873;BA.debugLine="bitacora.b_Inicio_Fin_venta2.Text = \"TERMINAR V";
_bitacora._b_inicio_fin_venta2 /*anywheresoftware.b4a.objects.ButtonWrapper*/ .setText(BA.ObjectToCharSequence("TERMINAR VENTA"));
 //BA.debugLineNum = 874;BA.debugLine="bitacora.enVenta = False";
_bitacora._enventa /*boolean*/  = __c.False;
 //BA.debugLineNum = 875;BA.debugLine="bitacora.inicioFin";
_bitacora._iniciofin /*String*/ ();
 //BA.debugLineNum = 876;BA.debugLine="banderaimp = 0";
_banderaimp = (int) (0);
 //BA.debugLineNum = 877;BA.debugLine="Log(\"2.1\")";
__c.LogImpl("752363278","2.1",0);
 }else {
 //BA.debugLineNum = 879;BA.debugLine="GUADAVENTA2";
_guadaventa2();
 //BA.debugLineNum = 880;BA.debugLine="B4XPages.ShowPage(\"Principal\")";
_b4xpages._showpage /*String*/ (ba,"Principal");
 //BA.debugLineNum = 881;BA.debugLine="banderaimp = 0";
_banderaimp = (int) (0);
 //BA.debugLineNum = 882;BA.debugLine="Log(\"2.2\")";
__c.LogImpl("752363283","2.2",0);
 };
 }else {
 //BA.debugLineNum = 972;BA.debugLine="GUADAVENTA2";
_guadaventa2();
 };
 //BA.debugLineNum = 974;BA.debugLine="End Sub";
return "";
}
public String  _hist_click() throws Exception{
 //BA.debugLineNum = 1120;BA.debugLine="Sub HIST_Click";
 //BA.debugLineNum = 1121;BA.debugLine="B4XPages.ShowPage(\"Historico\")";
_b4xpages._showpage /*String*/ (ba,"Historico");
 //BA.debugLineNum = 1122;BA.debugLine="End Sub";
return "";
}
public void  _imprime_pagare() throws Exception{
ResumableSub_imprime_pagare rsub = new ResumableSub_imprime_pagare(this);
rsub.resume(ba, null);
}
public static class ResumableSub_imprime_pagare extends BA.ResumableSub {
public ResumableSub_imprime_pagare(medicomed.keymon.com.mx.c_cliente parent) {
this.parent = parent;
}
medicomed.keymon.com.mx.c_cliente parent;
int _cont = 0;
String _notaabono = "";
int _resultado = 0;

@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 = 2630;BA.debugLine="c=skmt.ExecQuery(\"select USUARIO from usuarioa\")";
parent._c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(parent._skmt.ExecQuery("select USUARIO from usuarioa")));
 //BA.debugLineNum = 2631;BA.debugLine="c.Position=0";
parent._c.setPosition((int) (0));
 //BA.debugLineNum = 2632;BA.debugLine="usuario = c.GetString(\"USUARIO\")";
parent._usuario = parent._c.GetString("USUARIO");
 //BA.debugLineNum = 2633;BA.debugLine="DateTime.DateFormat = \"MM/dd/yyyy\"";
parent.__c.DateTime.setDateFormat("MM/dd/yyyy");
 //BA.debugLineNum = 2634;BA.debugLine="DateTime.TimeFormat = \"HH:mm:ss\"";
parent.__c.DateTime.setTimeFormat("HH:mm:ss");
 //BA.debugLineNum = 2635;BA.debugLine="sDate=DateTime.Date(DateTime.Now)";
parent._sdate = parent.__c.DateTime.Date(parent.__c.DateTime.getNow());
 //BA.debugLineNum = 2636;BA.debugLine="sTime=DateTime.Time(DateTime.Now)";
parent._stime = parent.__c.DateTime.Time(parent.__c.DateTime.getNow());
 //BA.debugLineNum = 2637;BA.debugLine="c.Close";
parent._c.Close();
 //BA.debugLineNum = 2639;BA.debugLine="ProgressDialogShow(\"Imprimiendo, un momento ...\")";
parent.__c.ProgressDialogShow(ba,BA.ObjectToCharSequence("Imprimiendo, un momento ..."));
 //BA.debugLineNum = 2640;BA.debugLine="Printer1.DisConnect";
parent._printer1._disconnect /*String*/ ();
 //BA.debugLineNum = 2641;BA.debugLine="If Not(Printer1.IsConnected) Then";
if (true) break;

case 1:
//if
this.state = 38;
if (parent.__c.Not(parent._printer1._isconnected /*boolean*/ ())) { 
this.state = 3;
}else {
this.state = 21;
}if (true) break;

case 3:
//C
this.state = 4;
 //BA.debugLineNum = 2642;BA.debugLine="Log(\"Conectando a impresora ...\")";
parent.__c.LogImpl("754919181","Conectando a impresora ...",0);
 //BA.debugLineNum = 2643;BA.debugLine="Printer1.Connect";
parent._printer1._connect /*boolean*/ ();
 //BA.debugLineNum = 2644;BA.debugLine="Private cont As Int = 0";
_cont = (int) (0);
 //BA.debugLineNum = 2645;BA.debugLine="Do While Not(impresoraConectada)";
if (true) break;

case 4:
//do while
this.state = 19;
while (parent.__c.Not(parent._impresoraconectada)) {
this.state = 6;
if (true) break;
}
if (true) break;

case 6:
//C
this.state = 7;
 //BA.debugLineNum = 2646;BA.debugLine="Sleep(1000)";
parent.__c.Sleep(ba,this,(int) (1000));
this.state = 49;
return;
case 49:
//C
this.state = 7;
;
 //BA.debugLineNum = 2647;BA.debugLine="Log(\"++++++  \" & cont)";
parent.__c.LogImpl("754919186","++++++  "+BA.NumberToString(_cont),0);
 //BA.debugLineNum = 2648;BA.debugLine="cont = cont + 1";
_cont = (int) (_cont+1);
 //BA.debugLineNum = 2649;BA.debugLine="If cont = 2 Then Printer1.Connect 'Tratamos de";
if (true) break;

case 7:
//if
this.state = 12;
if (_cont==2) { 
this.state = 9;
;}if (true) break;

case 9:
//C
this.state = 12;
parent._printer1._connect /*boolean*/ ();
if (true) break;

case 12:
//C
this.state = 13;
;
 //BA.debugLineNum = 2650;BA.debugLine="If cont > 3 Then impresoraConectada = True";
if (true) break;

case 13:
//if
this.state = 18;
if (_cont>3) { 
this.state = 15;
;}if (true) break;

case 15:
//C
this.state = 18;
parent._impresoraconectada = parent.__c.True;
if (true) break;

case 18:
//C
this.state = 4;
;
 if (true) break;

case 19:
//C
this.state = 38;
;
 //BA.debugLineNum = 2652;BA.debugLine="Sleep(500)";
parent.__c.Sleep(ba,this,(int) (500));
this.state = 50;
return;
case 50:
//C
this.state = 38;
;
 //BA.debugLineNum = 2653;BA.debugLine="impresoraConectada = False";
parent._impresoraconectada = parent.__c.False;
 if (true) break;

case 21:
//C
this.state = 22;
 //BA.debugLineNum = 2655;BA.debugLine="Log(\"conectando 2\")";
parent.__c.LogImpl("754919194","conectando 2",0);
 //BA.debugLineNum = 2656;BA.debugLine="Printer1.Connect";
parent._printer1._connect /*boolean*/ ();
 //BA.debugLineNum = 2657;BA.debugLine="Private cont As Int = 0";
_cont = (int) (0);
 //BA.debugLineNum = 2658;BA.debugLine="Do While Not(impresoraConectada) Or Not(Printer1";
if (true) break;

case 22:
//do while
this.state = 37;
while (parent.__c.Not(parent._impresoraconectada) || parent.__c.Not(parent._printer1._isconnected /*boolean*/ ())) {
this.state = 24;
if (true) break;
}
if (true) break;

case 24:
//C
this.state = 25;
 //BA.debugLineNum = 2659;BA.debugLine="Sleep(1000)";
parent.__c.Sleep(ba,this,(int) (1000));
this.state = 51;
return;
case 51:
//C
this.state = 25;
;
 //BA.debugLineNum = 2660;BA.debugLine="Log(\"******  \" & cont)";
parent.__c.LogImpl("754919199","******  "+BA.NumberToString(_cont),0);
 //BA.debugLineNum = 2661;BA.debugLine="cont = cont + 1";
_cont = (int) (_cont+1);
 //BA.debugLineNum = 2662;BA.debugLine="If cont = 2 Then Printer1.Connect";
if (true) break;

case 25:
//if
this.state = 30;
if (_cont==2) { 
this.state = 27;
;}if (true) break;

case 27:
//C
this.state = 30;
parent._printer1._connect /*boolean*/ ();
if (true) break;

case 30:
//C
this.state = 31;
;
 //BA.debugLineNum = 2663;BA.debugLine="If cont > 3 Then impresoraConectada = True";
if (true) break;

case 31:
//if
this.state = 36;
if (_cont>3) { 
this.state = 33;
;}if (true) break;

case 33:
//C
this.state = 36;
parent._impresoraconectada = parent.__c.True;
if (true) break;

case 36:
//C
this.state = 22;
;
 if (true) break;

case 37:
//C
this.state = 38;
;
 //BA.debugLineNum = 2665;BA.debugLine="Sleep(500)";
parent.__c.Sleep(ba,this,(int) (500));
this.state = 52;
return;
case 52:
//C
this.state = 38;
;
 //BA.debugLineNum = 2666;BA.debugLine="impresoraConectada = False";
parent._impresoraconectada = parent.__c.False;
 if (true) break;

case 38:
//C
this.state = 39;
;
 //BA.debugLineNum = 2669;BA.debugLine="TAMANO = 0";
parent._tamano = (int) (0);
 //BA.debugLineNum = 2670;BA.debugLine="ESPACIO = 22";
parent._espacio = (int) (22);
 //BA.debugLineNum = 2671;BA.debugLine="BLANCO = \" \"";
parent._blanco = " ";
 //BA.debugLineNum = 2673;BA.debugLine="Printer1.WriteString(\"medicomed Distribuciones\" &";
parent._printer1._writestring /*String*/ ("medicomed Distribuciones"+parent.__c.CRLF);
 //BA.debugLineNum = 2675;BA.debugLine="Printer1.WriteString(sDate &  CRLF)";
parent._printer1._writestring /*String*/ (parent._sdate+parent.__c.CRLF);
 //BA.debugLineNum = 2676;BA.debugLine="Printer1.WriteString(sTime &  CRLF)";
parent._printer1._writestring /*String*/ (parent._stime+parent.__c.CRLF);
 //BA.debugLineNum = 2677;BA.debugLine="Printer1.WriteString(\"Vendedor:\" & usuario &  CRL";
parent._printer1._writestring /*String*/ ("Vendedor:"+parent._usuario+parent.__c.CRLF);
 //BA.debugLineNum = 2678;BA.debugLine="Printer1.WriteString(\"Tienda: \" & La_nombre.Text";
parent._printer1._writestring /*String*/ ("Tienda: "+parent._la_nombre.getText()+parent.__c.CRLF);
 //BA.debugLineNum = 2679;BA.debugLine="Printer1.WriteString(\"ID.Cliente: \" &  la_cuenta.";
parent._printer1._writestring /*String*/ ("ID.Cliente: "+parent._la_cuenta.getText()+parent.__c.CRLF);
 //BA.debugLineNum = 2680;BA.debugLine="Printer1.WriteString(\"Calle: \" & la_Calle.Text &";
parent._printer1._writestring /*String*/ ("Calle: "+parent._la_calle.getText()+parent.__c.CRLF);
 //BA.debugLineNum = 2681;BA.debugLine="Printer1.WriteString(\"Colonia: \" & la_col.Text &";
parent._printer1._writestring /*String*/ ("Colonia: "+parent._la_col.getText()+parent.__c.CRLF);
 //BA.debugLineNum = 2682;BA.debugLine="Printer1.WriteString(\" \" &  CRLF)";
parent._printer1._writestring /*String*/ (" "+parent.__c.CRLF);
 //BA.debugLineNum = 2683;BA.debugLine="Dim notaabono As String";
_notaabono = "";
 //BA.debugLineNum = 2684;BA.debugLine="c = Starter.skmt.ExecQuery(\"SELECT NOTA FROM ABON";
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 NOTA FROM ABONOSP WHERE CLIENTE IN (SELECT CUENTA FROM CUENTAA)")));
 //BA.debugLineNum = 2685;BA.debugLine="If c.RowCount > 0 Then";
if (true) break;

case 39:
//if
this.state = 42;
if (parent._c.getRowCount()>0) { 
this.state = 41;
}if (true) break;

case 41:
//C
this.state = 42;
 //BA.debugLineNum = 2686;BA.debugLine="c.Position = 0";
parent._c.setPosition((int) (0));
 //BA.debugLineNum = 2687;BA.debugLine="notaabono = c.GetString(\"NOTA\")";
_notaabono = parent._c.GetString("NOTA");
 if (true) break;

case 42:
//C
this.state = 43;
;
 //BA.debugLineNum = 2689;BA.debugLine="Printer1.WriteString(\"Comprobante de pago del pag";
parent._printer1._writestring /*String*/ ("Comprobante de pago del pagare"+parent.__c.CRLF);
 //BA.debugLineNum = 2690;BA.debugLine="Printer1.WriteString(\"con folio:  \" & notaabono &";
parent._printer1._writestring /*String*/ ("con folio:  "+_notaabono+parent.__c.CRLF);
 //BA.debugLineNum = 2691;BA.debugLine="Printer1.WriteString(\"por el monto: \" &(NumberFor";
parent._printer1._writestring /*String*/ ("por el monto: "+(parent.__c.NumberFormat((double)(Double.parseDouble(parent._et_abono.getText())),(int) (0),(int) (2)))+parent.__c.CRLF);
 //BA.debugLineNum = 2692;BA.debugLine="Printer1.WriteString(\"el dia: \" & sDate &  CRLF)";
parent._printer1._writestring /*String*/ ("el dia: "+parent._sdate+parent.__c.CRLF);
 //BA.debugLineNum = 2694;BA.debugLine="Printer1.WriteString(\" \" &  CRLF)";
parent._printer1._writestring /*String*/ (" "+parent.__c.CRLF);
 //BA.debugLineNum = 2695;BA.debugLine="Printer1.WriteString(\" \" &  CRLF)";
parent._printer1._writestring /*String*/ (" "+parent.__c.CRLF);
 //BA.debugLineNum = 2696;BA.debugLine="Printer1.WriteString(\" \" &  CRLF)";
parent._printer1._writestring /*String*/ (" "+parent.__c.CRLF);
 //BA.debugLineNum = 2697;BA.debugLine="Printer1.WriteString(\" \" &  CRLF)";
parent._printer1._writestring /*String*/ (" "+parent.__c.CRLF);
 //BA.debugLineNum = 2698;BA.debugLine="Printer1.WriteString(\" \" &  CRLF)";
parent._printer1._writestring /*String*/ (" "+parent.__c.CRLF);
 //BA.debugLineNum = 2699;BA.debugLine="Printer1.WriteString(\" \" &  CRLF)";
parent._printer1._writestring /*String*/ (" "+parent.__c.CRLF);
 //BA.debugLineNum = 2700;BA.debugLine="Printer1.WriteString(\" \" &  CRLF)";
parent._printer1._writestring /*String*/ (" "+parent.__c.CRLF);
 //BA.debugLineNum = 2702;BA.debugLine="Printer1.WriteString(\"---------------------------";
parent._printer1._writestring /*String*/ ("------------------------------"+parent.__c.CRLF);
 //BA.debugLineNum = 2703;BA.debugLine="Printer1.WriteString(\"-------------FIRMA---------";
parent._printer1._writestring /*String*/ ("-------------FIRMA------------"+parent.__c.CRLF);
 //BA.debugLineNum = 2705;BA.debugLine="Printer1.WriteString(\" \" &  CRLF)";
parent._printer1._writestring /*String*/ (" "+parent.__c.CRLF);
 //BA.debugLineNum = 2706;BA.debugLine="Printer1.WriteString(\" \" &  CRLF)";
parent._printer1._writestring /*String*/ (" "+parent.__c.CRLF);
 //BA.debugLineNum = 2707;BA.debugLine="Sleep(1000)";
parent.__c.Sleep(ba,this,(int) (1000));
this.state = 53;
return;
case 53:
//C
this.state = 43;
;
 //BA.debugLineNum = 2708;BA.debugLine="Printer1.DisConnect";
parent._printer1._disconnect /*String*/ ();
 //BA.debugLineNum = 2710;BA.debugLine="ProgressDialogHide";
parent.__c.ProgressDialogHide();
 //BA.debugLineNum = 2713;BA.debugLine="Msgbox2Async(\"Deseas imprimir de nuevo el ticket?";
parent.__c.Msgbox2Async(BA.ObjectToCharSequence("Deseas imprimir de nuevo el ticket?"),BA.ObjectToCharSequence("ATENCION"),"SI","","NO",parent.__c.LoadBitmap(parent.__c.File.getDirAssets(),"alert2.png"),ba,parent.__c.False);
 //BA.debugLineNum = 2714;BA.debugLine="Wait For Msgbox_Result (resultado As Int)";
parent.__c.WaitFor("msgbox_result", ba, this, null);
this.state = 54;
return;
case 54:
//C
this.state = 43;
_resultado = (Integer) result[0];
;
 //BA.debugLineNum = 2715;BA.debugLine="If resultado = DialogResponse.POSITIVE Then";
if (true) break;

case 43:
//if
this.state = 48;
if (_resultado==parent.__c.DialogResponse.POSITIVE) { 
this.state = 45;
}else {
this.state = 47;
}if (true) break;

case 45:
//C
this.state = 48;
 //BA.debugLineNum = 2716;BA.debugLine="imprime_pagare";
parent._imprime_pagare();
 if (true) break;

case 47:
//C
this.state = 48;
 //BA.debugLineNum = 2718;BA.debugLine="p_abono.Visible = False";
parent._p_abono.setVisible(parent.__c.False);
 //BA.debugLineNum = 2720;BA.debugLine="skmt.ExecNonQuery($\"INSERT INTO ABONOS(a_usuari";
parent._skmt.ExecNonQuery(("INSERT INTO ABONOS(a_usuario, a_ruta, a_cliente, a_abono, a_fecha) VALUES ('"+parent.__c.SmartStringFormatter("",(Object)(parent._subs._traeusuariodebd /*String*/ (ba)))+"', '"+parent.__c.SmartStringFormatter("",(Object)(parent._subs._traeruta /*String*/ (ba,parent._subs._traecliente /*String*/ (ba))))+"', '"+parent.__c.SmartStringFormatter("",(Object)(parent._subs._traecliente /*String*/ (ba)))+"' ,'"+parent.__c.SmartStringFormatter("",(Object)(parent._et_abono.getText()))+"', '"+parent.__c.SmartStringFormatter("",(Object)(parent._subs._fechakmt /*String*/ (ba,BA.NumberToString(parent.__c.DateTime.getNow()))))+"')"));
 //BA.debugLineNum = 2721;BA.debugLine="ToastMessageShow(\"Abono guardado\", False)";
parent.__c.ToastMessageShow(BA.ObjectToCharSequence("Abono guardado"),parent.__c.False);
 //BA.debugLineNum = 2722;BA.debugLine="et_abono.Text = \"\"";
parent._et_abono.setText(BA.ObjectToCharSequence(""));
 if (true) break;

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

            }
        }
    }
}
public void  _imprime_preventa() throws Exception{
ResumableSub_imprime_preventa rsub = new ResumableSub_imprime_preventa(this);
rsub.resume(ba, null);
}
public static class ResumableSub_imprime_preventa extends BA.ResumableSub {
public ResumableSub_imprime_preventa(medicomed.keymon.com.mx.c_cliente parent) {
this.parent = parent;
}
medicomed.keymon.com.mx.c_cliente parent;
String _elinefeed = "";
String _tel = "";
anywheresoftware.b4a.sql.SQL.CursorWrapper _t = null;
String _imei_base = "";
int _cont = 0;
anywheresoftware.b4a.sql.SQL.CursorWrapper _siesacredi = null;
int _i = 0;
int _e = 0;
double _subtotal = 0;
anywheresoftware.b4a.sql.SQL.CursorWrapper _subtot = null;
double _descuento = 0;
double _total = 0;
int _resultado = 0;
int step71;
int limit71;
int step85;
int limit85;
int step101;
int limit101;
int step120;
int limit120;
int step134;
int limit134;

@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 = 1214;BA.debugLine="c=skmt.ExecQuery(\"select USUARIO from usuarioa\")";
parent._c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(parent._skmt.ExecQuery("select USUARIO from usuarioa")));
 //BA.debugLineNum = 1215;BA.debugLine="c.Position=0";
parent._c.setPosition((int) (0));
 //BA.debugLineNum = 1216;BA.debugLine="usuario = c.GetString(\"USUARIO\")";
parent._usuario = parent._c.GetString("USUARIO");
 //BA.debugLineNum = 1217;BA.debugLine="DateTime.DateFormat = \"MM/dd/yyyy\"";
parent.__c.DateTime.setDateFormat("MM/dd/yyyy");
 //BA.debugLineNum = 1218;BA.debugLine="sDate=DateTime.Date(DateTime.Now)";
parent._sdate = parent.__c.DateTime.Date(parent.__c.DateTime.getNow());
 //BA.debugLineNum = 1219;BA.debugLine="sTime=DateTime.Time(DateTime.Now)";
parent._stime = parent.__c.DateTime.Time(parent.__c.DateTime.getNow());
 //BA.debugLineNum = 1220;BA.debugLine="c.Close";
parent._c.Close();
 //BA.debugLineNum = 1221;BA.debugLine="Public Const eLINEFEED As String = \"\" & Chr(0x0D)";
_elinefeed = ""+BA.ObjectToString(parent.__c.Chr(((int)0x0d)))+BA.ObjectToString(parent.__c.Chr(((int)0x0a)));
 //BA.debugLineNum = 1222;BA.debugLine="Dim tel As String = \"\"";
_tel = "";
 //BA.debugLineNum = 1223;BA.debugLine="Dim t As Cursor = B4XPages.MainPage.skmt.ExecQuer";
_t = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_t = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(parent._b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("SELECT CAT_VA_VALOR FROM CAT_VARIABLES WHERE CAT_VA_DESCRIPCION = 'TELEFONO'")));
 //BA.debugLineNum = 1224;BA.debugLine="If t.RowCount > 0 Then";
if (true) break;

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

case 3:
//C
this.state = 4;
 //BA.debugLineNum = 1225;BA.debugLine="t.Position = 0";
_t.setPosition((int) (0));
 //BA.debugLineNum = 1226;BA.debugLine="tel = t.GetString(\"CAT_VA_VALOR\")";
_tel = _t.GetString("CAT_VA_VALOR");
 if (true) break;

case 4:
//C
this.state = 5;
;
 //BA.debugLineNum = 1228;BA.debugLine="t.Close";
_t.Close();
 //BA.debugLineNum = 1230;BA.debugLine="Dim IMEI_BASE As String = Starter.IMEI_BASE";
_imei_base = parent._starter._imei_base /*String*/ ;
 //BA.debugLineNum = 1231;BA.debugLine="Log(\"IMEI_BASE desde otra clase: \" & IMEI_BASE)";
parent.__c.LogImpl("753149714","IMEI_BASE desde otra clase: "+_imei_base,0);
 //BA.debugLineNum = 1233;BA.debugLine="ProgressDialogShow(\"Imprimiendo, un momento ...\")";
parent.__c.ProgressDialogShow(ba,BA.ObjectToCharSequence("Imprimiendo, un momento ..."));
 //BA.debugLineNum = 1234;BA.debugLine="Printer1.DisConnect";
parent._printer1._disconnect /*String*/ ();
 //BA.debugLineNum = 1235;BA.debugLine="If Not(Printer1.IsConnected) Then";
if (true) break;

case 5:
//if
this.state = 42;
if (parent.__c.Not(parent._printer1._isconnected /*boolean*/ ())) { 
this.state = 7;
}else {
this.state = 25;
}if (true) break;

case 7:
//C
this.state = 8;
 //BA.debugLineNum = 1236;BA.debugLine="Log(\"Conectando a impresora ...\")";
parent.__c.LogImpl("753149719","Conectando a impresora ...",0);
 //BA.debugLineNum = 1237;BA.debugLine="Printer1.Connect";
parent._printer1._connect /*boolean*/ ();
 //BA.debugLineNum = 1238;BA.debugLine="Private cont As Int = 0";
_cont = (int) (0);
 //BA.debugLineNum = 1239;BA.debugLine="Do While Not(impresoraConectada)";
if (true) break;

case 8:
//do while
this.state = 23;
while (parent.__c.Not(parent._impresoraconectada)) {
this.state = 10;
if (true) break;
}
if (true) break;

case 10:
//C
this.state = 11;
 //BA.debugLineNum = 1240;BA.debugLine="Sleep(1000)";
parent.__c.Sleep(ba,this,(int) (1000));
this.state = 116;
return;
case 116:
//C
this.state = 11;
;
 //BA.debugLineNum = 1241;BA.debugLine="cont = cont + 1";
_cont = (int) (_cont+1);
 //BA.debugLineNum = 1242;BA.debugLine="If cont = 2 Then Printer1.Connect 'Tratamos de";
if (true) break;

case 11:
//if
this.state = 16;
if (_cont==2) { 
this.state = 13;
;}if (true) break;

case 13:
//C
this.state = 16;
parent._printer1._connect /*boolean*/ ();
if (true) break;

case 16:
//C
this.state = 17;
;
 //BA.debugLineNum = 1243;BA.debugLine="If cont > 3 Then impresoraConectada = True";
if (true) break;

case 17:
//if
this.state = 22;
if (_cont>3) { 
this.state = 19;
;}if (true) break;

case 19:
//C
this.state = 22;
parent._impresoraconectada = parent.__c.True;
if (true) break;

case 22:
//C
this.state = 8;
;
 if (true) break;

case 23:
//C
this.state = 42;
;
 //BA.debugLineNum = 1245;BA.debugLine="Sleep(500)";
parent.__c.Sleep(ba,this,(int) (500));
this.state = 117;
return;
case 117:
//C
this.state = 42;
;
 //BA.debugLineNum = 1246;BA.debugLine="impresoraConectada = False";
parent._impresoraconectada = parent.__c.False;
 if (true) break;

case 25:
//C
this.state = 26;
 //BA.debugLineNum = 1248;BA.debugLine="Log(\"conectando 2\")";
parent.__c.LogImpl("753149731","conectando 2",0);
 //BA.debugLineNum = 1249;BA.debugLine="Printer1.Connect";
parent._printer1._connect /*boolean*/ ();
 //BA.debugLineNum = 1250;BA.debugLine="Private cont As Int = 0";
_cont = (int) (0);
 //BA.debugLineNum = 1251;BA.debugLine="Do While Not(impresoraConectada) Or Not(Printer1";
if (true) break;

case 26:
//do while
this.state = 41;
while (parent.__c.Not(parent._impresoraconectada) || parent.__c.Not(parent._printer1._isconnected /*boolean*/ ())) {
this.state = 28;
if (true) break;
}
if (true) break;

case 28:
//C
this.state = 29;
 //BA.debugLineNum = 1252;BA.debugLine="Sleep(1000)";
parent.__c.Sleep(ba,this,(int) (1000));
this.state = 118;
return;
case 118:
//C
this.state = 29;
;
 //BA.debugLineNum = 1253;BA.debugLine="Log(\"******  \" & cont)";
parent.__c.LogImpl("753149736","******  "+BA.NumberToString(_cont),0);
 //BA.debugLineNum = 1254;BA.debugLine="cont = cont + 1";
_cont = (int) (_cont+1);
 //BA.debugLineNum = 1255;BA.debugLine="If cont = 2 Then Printer1.Connect";
if (true) break;

case 29:
//if
this.state = 34;
if (_cont==2) { 
this.state = 31;
;}if (true) break;

case 31:
//C
this.state = 34;
parent._printer1._connect /*boolean*/ ();
if (true) break;

case 34:
//C
this.state = 35;
;
 //BA.debugLineNum = 1256;BA.debugLine="If cont > 3 Then impresoraConectada = True";
if (true) break;

case 35:
//if
this.state = 40;
if (_cont>3) { 
this.state = 37;
;}if (true) break;

case 37:
//C
this.state = 40;
parent._impresoraconectada = parent.__c.True;
if (true) break;

case 40:
//C
this.state = 26;
;
 if (true) break;

case 41:
//C
this.state = 42;
;
 //BA.debugLineNum = 1258;BA.debugLine="Sleep(500)";
parent.__c.Sleep(ba,this,(int) (500));
this.state = 119;
return;
case 119:
//C
this.state = 42;
;
 //BA.debugLineNum = 1259;BA.debugLine="impresoraConectada = False";
parent._impresoraconectada = parent.__c.False;
 if (true) break;

case 42:
//C
this.state = 43;
;
 //BA.debugLineNum = 1261;BA.debugLine="TAMANO = 0";
parent._tamano = (int) (0);
 //BA.debugLineNum = 1262;BA.debugLine="ESPACIO = 22";
parent._espacio = (int) (22);
 //BA.debugLineNum = 1263;BA.debugLine="BLANCO = \" \"";
parent._blanco = " ";
 //BA.debugLineNum = 1264;BA.debugLine="Printer1.WriteString(\"Compania Logistica Medicome";
parent._printer1._writestring /*String*/ ("Compania Logistica Medicomed."+_elinefeed);
 //BA.debugLineNum = 1265;BA.debugLine="Printer1.WriteString(sDate &  eLINEFEED)";
parent._printer1._writestring /*String*/ (parent._sdate+_elinefeed);
 //BA.debugLineNum = 1266;BA.debugLine="Printer1.WriteString(sTime &  eLINEFEED)";
parent._printer1._writestring /*String*/ (parent._stime+_elinefeed);
 //BA.debugLineNum = 1267;BA.debugLine="Printer1.WriteString(\"Vendedor:\" & usuario &  eLI";
parent._printer1._writestring /*String*/ ("Vendedor:"+parent._usuario+_elinefeed);
 //BA.debugLineNum = 1268;BA.debugLine="Printer1.WriteString(\"Tel vendedor:\" & tel &  eLI";
parent._printer1._writestring /*String*/ ("Tel vendedor:"+_tel+_elinefeed);
 //BA.debugLineNum = 1269;BA.debugLine="Printer1.WriteString(\"Ruta:\" & Subs.traeRuta(la_c";
parent._printer1._writestring /*String*/ ("Ruta:"+parent._subs._traeruta /*String*/ (ba,parent._la_cuenta.getText())+_elinefeed);
 //BA.debugLineNum = 1270;BA.debugLine="Printer1.WriteString(\"Tienda: \" & La_nombre.Text";
parent._printer1._writestring /*String*/ ("Tienda: "+parent._la_nombre.getText()+_elinefeed);
 //BA.debugLineNum = 1271;BA.debugLine="Printer1.WriteString(\"ID.Cliente: \" &  la_cuenta.";
parent._printer1._writestring /*String*/ ("ID.Cliente: "+parent._la_cuenta.getText()+_elinefeed);
 //BA.debugLineNum = 1272;BA.debugLine="Printer1.WriteString(\"Calle: \" & la_Calle.Text &";
parent._printer1._writestring /*String*/ ("Calle: "+parent._la_calle.getText()+_elinefeed);
 //BA.debugLineNum = 1273;BA.debugLine="Printer1.WriteString(\"Colonia: \" & la_col.Text &";
parent._printer1._writestring /*String*/ ("Colonia: "+parent._la_col.getText()+_elinefeed);
 //BA.debugLineNum = 1274;BA.debugLine="Printer1.WriteString(\" \" &  eLINEFEED)";
parent._printer1._writestring /*String*/ (" "+_elinefeed);
 //BA.debugLineNum = 1275;BA.debugLine="c = skmt.ExecQuery2(\"SELECT * FROM PEDIDO WHERE P";
parent._c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(parent._skmt.ExecQuery2("SELECT * FROM PEDIDO WHERE PE_FOLIO = ?",new String[]{"PREVENTA"})));
 //BA.debugLineNum = 1276;BA.debugLine="Dim siesacredi As Cursor = skmt.ExecQuery(\"SELECT";
_siesacredi = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_siesacredi = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(parent._skmt.ExecQuery("SELECT * FROM PAGARES WHERE PA_CLIENTE IN (SELECT CUENTA FROM CUENTAA)")));
 //BA.debugLineNum = 1277;BA.debugLine="If siesacredi.RowCount > 0 Then";
if (true) break;

case 43:
//if
this.state = 46;
if (_siesacredi.getRowCount()>0) { 
this.state = 45;
}if (true) break;

case 45:
//C
this.state = 46;
 //BA.debugLineNum = 1278;BA.debugLine="Printer1.WriteString(\"------PREVENTA A CREDITO--";
parent._printer1._writestring /*String*/ ("------PREVENTA A CREDITO------"+_elinefeed);
 if (true) break;
;
 //BA.debugLineNum = 1280;BA.debugLine="If c.RowCount > 0 Then";

case 46:
//if
this.state = 95;
if (parent._c.getRowCount()>0) { 
this.state = 48;
}if (true) break;

case 48:
//C
this.state = 49;
 //BA.debugLineNum = 1281;BA.debugLine="Printer1.WriteString(\"--------PREVENTA--------\"";
parent._printer1._writestring /*String*/ ("--------PREVENTA--------"+_elinefeed);
 //BA.debugLineNum = 1282;BA.debugLine="Printer1.WriteString(\"Cant.      Precio        I";
parent._printer1._writestring /*String*/ ("Cant.      Precio        Importe"+_elinefeed);
 //BA.debugLineNum = 1283;BA.debugLine="Printer1.WriteString(\"--------------------------";
parent._printer1._writestring /*String*/ ("------------------------------"+_elinefeed);
 //BA.debugLineNum = 1284;BA.debugLine="s=skmt.ExecQuery2(\"select PE_BCAJAS,PE_PRONOMBRE";
parent._s = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(parent._skmt.ExecQuery2("select PE_BCAJAS,PE_PRONOMBRE, PE_CANT, length(pe_cant) as L_CANT, PE_COSTOU, length(PE_COSTOU) as L_COSTOU, PE_COSTO_TOT, length(PE_CANT * PE_COSTOU) as L_COSTO_TOT,PE_PROID, PE_CEDIS  FROM PEDIDO WHERE PE_FOLIO = ? AND LENGTH(PE_CEDIS) < 4 AND PE_CLIENTE IN (Select CUENTA from cuentaa)  order by  PE_PROID",new String[]{"PREVENTA"})));
 //BA.debugLineNum = 1285;BA.debugLine="If S.RowCount>0 Then";
if (true) break;

case 49:
//if
this.state = 76;
if (parent._s.getRowCount()>0) { 
this.state = 51;
}if (true) break;

case 51:
//C
this.state = 52;
 //BA.debugLineNum = 1286;BA.debugLine="For i=0 To S.RowCount -1";
if (true) break;

case 52:
//for
this.state = 75;
step71 = 1;
limit71 = (int) (parent._s.getRowCount()-1);
_i = (int) (0) ;
this.state = 120;
if (true) break;

case 120:
//C
this.state = 75;
if ((step71 > 0 && _i <= limit71) || (step71 < 0 && _i >= limit71)) this.state = 54;
if (true) break;

case 121:
//C
this.state = 120;
_i = ((int)(0 + _i + step71)) ;
if (true) break;

case 54:
//C
this.state = 55;
 //BA.debugLineNum = 1287;BA.debugLine="S.Position=i";
parent._s.setPosition(_i);
 //BA.debugLineNum = 1288;BA.debugLine="If s.GetString(\"PE_CEDIS\") = s.GetString(\"PE_P";
if (true) break;

case 55:
//if
this.state = 74;
if ((parent._s.GetString("PE_CEDIS")).equals(parent._s.GetString("PE_PROID"))) { 
this.state = 57;
}else {
this.state = 59;
}if (true) break;

case 57:
//C
this.state = 74;
 //BA.debugLineNum = 1289;BA.debugLine="Printer1.WriteString(s.GetString(\"PE_PRONOMBR";
parent._printer1._writestring /*String*/ (parent._s.GetString("PE_PRONOMBRE")+_elinefeed);
 if (true) break;

case 59:
//C
this.state = 60;
 //BA.debugLineNum = 1291;BA.debugLine="If s.GetString(\"PE_BCAJAS\") = 0 Then";
if (true) break;

case 60:
//if
this.state = 73;
if ((parent._s.GetString("PE_BCAJAS")).equals(BA.NumberToString(0))) { 
this.state = 62;
}else {
this.state = 68;
}if (true) break;

case 62:
//C
this.state = 63;
 //BA.debugLineNum = 1292;BA.debugLine="Printer1.WriteString(s.GetString(\"PE_PRONOMB";
parent._printer1._writestring /*String*/ (parent._s.GetString("PE_PRONOMBRE")+_elinefeed);
 //BA.debugLineNum = 1293;BA.debugLine="k1 = NumberFormat(s.GETSTRING(\"PE_COSTOU\"),0";
parent._k1 = parent.__c.NumberFormat((double)(Double.parseDouble(parent._s.GetString("PE_COSTOU"))),(int) (0),(int) (2));
 //BA.debugLineNum = 1294;BA.debugLine="k2 = NumberFormat(s.GETSTRING(\"PE_COSTO_TOT\"";
parent._k2 = parent.__c.NumberFormat((double)(Double.parseDouble(parent._s.GetString("PE_COSTO_TOT"))),(int) (0),(int) (2));
 //BA.debugLineNum = 1295;BA.debugLine="TAMANO = s.GetLong(\"L_CANT\") + k1.Length + k";
parent._tamano = (int) (parent._s.GetLong("L_CANT")+parent._k1.length()+parent._k2.length());
 //BA.debugLineNum = 1296;BA.debugLine="ESPACIO = 23";
parent._espacio = (int) (23);
 //BA.debugLineNum = 1297;BA.debugLine="BLANCO = \" \"";
parent._blanco = " ";
 //BA.debugLineNum = 1298;BA.debugLine="ESPACIO = ESPACIO - TAMANO";
parent._espacio = (int) (parent._espacio-parent._tamano);
 //BA.debugLineNum = 1299;BA.debugLine="ESPACIO = ESPACIO / 2";
parent._espacio = (int) (parent._espacio/(double)2);
 //BA.debugLineNum = 1300;BA.debugLine="For E=0 To ESPACIO -1";
if (true) break;

case 63:
//for
this.state = 66;
step85 = 1;
limit85 = (int) (parent._espacio-1);
_e = (int) (0) ;
this.state = 122;
if (true) break;

case 122:
//C
this.state = 66;
if ((step85 > 0 && _e <= limit85) || (step85 < 0 && _e >= limit85)) this.state = 65;
if (true) break;

case 123:
//C
this.state = 122;
_e = ((int)(0 + _e + step85)) ;
if (true) break;

case 65:
//C
this.state = 123;
 //BA.debugLineNum = 1301;BA.debugLine="BLANCO = \" \" & BLANCO";
parent._blanco = " "+parent._blanco;
 if (true) break;
if (true) break;

case 66:
//C
this.state = 73;
;
 //BA.debugLineNum = 1303;BA.debugLine="Printer1.WriteString(s.GETSTRING(\"PE_CANT\")&";
parent._printer1._writestring /*String*/ (parent._s.GetString("PE_CANT")+" "+"Piezas"+parent._blanco+parent._k1+parent._blanco+parent._k2+_elinefeed);
 //BA.debugLineNum = 1304;BA.debugLine="TAMANO = 0";
parent._tamano = (int) (0);
 //BA.debugLineNum = 1305;BA.debugLine="ESPACIO = 23";
parent._espacio = (int) (23);
 //BA.debugLineNum = 1306;BA.debugLine="BLANCO = \" \"";
parent._blanco = " ";
 if (true) break;

case 68:
//C
this.state = 69;
 //BA.debugLineNum = 1308;BA.debugLine="Printer1.WriteString(s.GetString(\"PE_PRONOMB";
parent._printer1._writestring /*String*/ (parent._s.GetString("PE_PRONOMBRE")+_elinefeed);
 //BA.debugLineNum = 1309;BA.debugLine="k1 = NumberFormat((s.GETSTRING(\"PE_COSTO_TOT";
parent._k1 = parent.__c.NumberFormat(((double)(Double.parseDouble(parent._s.GetString("PE_COSTO_TOT")))/(double)(double)(Double.parseDouble(parent._s.GetString("PE_CANT")))),(int) (0),(int) (2));
 //BA.debugLineNum = 1310;BA.debugLine="k2 = NumberFormat(s.GETSTRING(\"PE_COSTO_TOT\"";
parent._k2 = parent.__c.NumberFormat((double)(Double.parseDouble(parent._s.GetString("PE_COSTO_TOT"))),(int) (0),(int) (2));
 //BA.debugLineNum = 1311;BA.debugLine="TAMANO = s.GetLong(\"L_CANT\") + k1.Length + k";
parent._tamano = (int) (parent._s.GetLong("L_CANT")+parent._k1.length()+parent._k2.length());
 //BA.debugLineNum = 1312;BA.debugLine="ESPACIO = 23";
parent._espacio = (int) (23);
 //BA.debugLineNum = 1313;BA.debugLine="BLANCO = \" \"";
parent._blanco = " ";
 //BA.debugLineNum = 1314;BA.debugLine="ESPACIO = ESPACIO - TAMANO";
parent._espacio = (int) (parent._espacio-parent._tamano);
 //BA.debugLineNum = 1315;BA.debugLine="ESPACIO = ESPACIO / 2";
parent._espacio = (int) (parent._espacio/(double)2);
 //BA.debugLineNum = 1316;BA.debugLine="For E=0 To ESPACIO -1";
if (true) break;

case 69:
//for
this.state = 72;
step101 = 1;
limit101 = (int) (parent._espacio-1);
_e = (int) (0) ;
this.state = 124;
if (true) break;

case 124:
//C
this.state = 72;
if ((step101 > 0 && _e <= limit101) || (step101 < 0 && _e >= limit101)) this.state = 71;
if (true) break;

case 125:
//C
this.state = 124;
_e = ((int)(0 + _e + step101)) ;
if (true) break;

case 71:
//C
this.state = 125;
 //BA.debugLineNum = 1317;BA.debugLine="BLANCO = \" \" & BLANCO";
parent._blanco = " "+parent._blanco;
 if (true) break;
if (true) break;

case 72:
//C
this.state = 73;
;
 //BA.debugLineNum = 1319;BA.debugLine="Log(k1)";
parent.__c.LogImpl("753149802",parent._k1,0);
 //BA.debugLineNum = 1320;BA.debugLine="Printer1.WriteString(s.GETSTRING(\"PE_CANT\")&";
parent._printer1._writestring /*String*/ (parent._s.GetString("PE_CANT")+" "+"Piezas"+parent._blanco+parent._k1+parent._blanco+parent._k2+_elinefeed);
 //BA.debugLineNum = 1321;BA.debugLine="TAMANO = 0";
parent._tamano = (int) (0);
 //BA.debugLineNum = 1322;BA.debugLine="ESPACIO = 23";
parent._espacio = (int) (23);
 //BA.debugLineNum = 1323;BA.debugLine="BLANCO = \" \"";
parent._blanco = " ";
 if (true) break;

case 73:
//C
this.state = 74;
;
 if (true) break;

case 74:
//C
this.state = 121;
;
 if (true) break;
if (true) break;

case 75:
//C
this.state = 76;
;
 if (true) break;

case 76:
//C
this.state = 77;
;
 //BA.debugLineNum = 1328;BA.debugLine="s.Close";
parent._s.Close();
 //BA.debugLineNum = 1329;BA.debugLine="Printer1.WriteString(\" \" &  eLINEFEED)";
parent._printer1._writestring /*String*/ (" "+_elinefeed);
 //BA.debugLineNum = 1330;BA.debugLine="s=skmt.ExecQuery2(\"select PE_PRONOMBRE, PE_CANT,";
parent._s = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(parent._skmt.ExecQuery2("select PE_PRONOMBRE, PE_CANT, length(pe_cant) as L_CANT, PE_COSTOU, length(PE_COSTOU) as L_COSTOU,PE_CANT * PE_COSTOU AS  PE_COSTO_TOT, length(PE_CANT * PE_COSTOU) as L_COSTO_TOT,PE_PROID, PE_CEDIS  FROM PEDIDO WHERE PE_FOLIO = ? AND LENGTH(PE_CEDIS) > 3 AND PE_CLIENTE IN (Select CUENTA from cuentaa) order by  PE_CEDIS, PE_COSTOU",new String[]{"PREVENTA"})));
 //BA.debugLineNum = 1331;BA.debugLine="If s.RowCount>0 Then";
if (true) break;

case 77:
//if
this.state = 94;
if (parent._s.getRowCount()>0) { 
this.state = 79;
}if (true) break;

case 79:
//C
this.state = 80;
 //BA.debugLineNum = 1332;BA.debugLine="Printer1.WriteString(\"-------PROMOS PREVENTA---";
parent._printer1._writestring /*String*/ ("-------PROMOS PREVENTA--------"+_elinefeed);
 //BA.debugLineNum = 1333;BA.debugLine="Printer1.WriteString(\"Cant.      Precio";
parent._printer1._writestring /*String*/ ("Cant.      Precio        Importe"+_elinefeed);
 //BA.debugLineNum = 1334;BA.debugLine="Printer1.WriteString(\"-------------------------";
parent._printer1._writestring /*String*/ ("------------------------------"+_elinefeed);
 //BA.debugLineNum = 1335;BA.debugLine="For i=0 To S.RowCount -1";
if (true) break;

case 80:
//for
this.state = 93;
step120 = 1;
limit120 = (int) (parent._s.getRowCount()-1);
_i = (int) (0) ;
this.state = 126;
if (true) break;

case 126:
//C
this.state = 93;
if ((step120 > 0 && _i <= limit120) || (step120 < 0 && _i >= limit120)) this.state = 82;
if (true) break;

case 127:
//C
this.state = 126;
_i = ((int)(0 + _i + step120)) ;
if (true) break;

case 82:
//C
this.state = 83;
 //BA.debugLineNum = 1336;BA.debugLine="s.Position=i";
parent._s.setPosition(_i);
 //BA.debugLineNum = 1337;BA.debugLine="If s.GetString(\"PE_CEDIS\") = s.GetString(\"PE_P";
if (true) break;

case 83:
//if
this.state = 92;
if ((parent._s.GetString("PE_CEDIS")).equals(parent._s.GetString("PE_PROID"))) { 
this.state = 85;
}else {
this.state = 87;
}if (true) break;

case 85:
//C
this.state = 92;
 //BA.debugLineNum = 1338;BA.debugLine="Printer1.WriteString(\"* \"& s.GetString(\"PE_PR";
parent._printer1._writestring /*String*/ ("* "+parent._s.GetString("PE_PRONOMBRE")+_elinefeed);
 //BA.debugLineNum = 1339;BA.debugLine="Log(\"promo\")";
parent.__c.LogImpl("753149822","promo",0);
 if (true) break;

case 87:
//C
this.state = 88;
 //BA.debugLineNum = 1341;BA.debugLine="Printer1.WriteString(s.GetString(\"PE_PRONOMBR";
parent._printer1._writestring /*String*/ (parent._s.GetString("PE_PRONOMBRE")+_elinefeed);
 //BA.debugLineNum = 1342;BA.debugLine="k1 = NumberFormat(s.GETSTRING(\"PE_COSTOU\"),0,";
parent._k1 = parent.__c.NumberFormat((double)(Double.parseDouble(parent._s.GetString("PE_COSTOU"))),(int) (0),(int) (2));
 //BA.debugLineNum = 1343;BA.debugLine="k2 = NumberFormat(s.GETSTRING(\"PE_COSTO_TOT\")";
parent._k2 = parent.__c.NumberFormat((double)(Double.parseDouble(parent._s.GetString("PE_COSTO_TOT"))),(int) (0),(int) (2));
 //BA.debugLineNum = 1344;BA.debugLine="TAMANO = s.GetLong(\"L_CANT\") + k1.Length + k2";
parent._tamano = (int) (parent._s.GetLong("L_CANT")+parent._k1.length()+parent._k2.length());
 //BA.debugLineNum = 1345;BA.debugLine="ESPACIO = 23";
parent._espacio = (int) (23);
 //BA.debugLineNum = 1346;BA.debugLine="BLANCO = \" \"";
parent._blanco = " ";
 //BA.debugLineNum = 1347;BA.debugLine="ESPACIO = ESPACIO - TAMANO";
parent._espacio = (int) (parent._espacio-parent._tamano);
 //BA.debugLineNum = 1348;BA.debugLine="ESPACIO = ESPACIO / 2";
parent._espacio = (int) (parent._espacio/(double)2);
 //BA.debugLineNum = 1349;BA.debugLine="For E=0 To ESPACIO -1";
if (true) break;

case 88:
//for
this.state = 91;
step134 = 1;
limit134 = (int) (parent._espacio-1);
_e = (int) (0) ;
this.state = 128;
if (true) break;

case 128:
//C
this.state = 91;
if ((step134 > 0 && _e <= limit134) || (step134 < 0 && _e >= limit134)) this.state = 90;
if (true) break;

case 129:
//C
this.state = 128;
_e = ((int)(0 + _e + step134)) ;
if (true) break;

case 90:
//C
this.state = 129;
 //BA.debugLineNum = 1350;BA.debugLine="BLANCO = \" \" & BLANCO";
parent._blanco = " "+parent._blanco;
 if (true) break;
if (true) break;

case 91:
//C
this.state = 92;
;
 //BA.debugLineNum = 1352;BA.debugLine="Printer1.WriteString(s.GETSTRING(\"PE_CANT\")&";
parent._printer1._writestring /*String*/ (parent._s.GetString("PE_CANT")+" "+"Piezas"+parent._blanco+parent._k1+parent._blanco+parent._k2+_elinefeed);
 //BA.debugLineNum = 1353;BA.debugLine="TAMANO = 0";
parent._tamano = (int) (0);
 //BA.debugLineNum = 1354;BA.debugLine="ESPACIO = 23";
parent._espacio = (int) (23);
 //BA.debugLineNum = 1355;BA.debugLine="BLANCO = \" \"";
parent._blanco = " ";
 if (true) break;

case 92:
//C
this.state = 127;
;
 if (true) break;
if (true) break;

case 93:
//C
this.state = 94;
;
 //BA.debugLineNum = 1358;BA.debugLine="Printer1.WriteString(\" \" &  eLINEFEED)";
parent._printer1._writestring /*String*/ (" "+_elinefeed);
 if (true) break;

case 94:
//C
this.state = 95;
;
 //BA.debugLineNum = 1360;BA.debugLine="s.Close";
parent._s.Close();
 //BA.debugLineNum = 1361;BA.debugLine="s = skmt.ExecQuery($\"SELECT SUM(CAT_GP_PRECIO *";
parent._s = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(parent._skmt.ExecQuery(("SELECT SUM(CAT_GP_PRECIO * PE_CANT) As SUBTOTAL FROM PEDIDO P INNER JOIN CAT_GUNAPROD C ON P.PE_PROID = C.CAT_GP_ID And P.PE_CEDIS = P.PE_PROID WHERE PE_CLIENTE IN (Select cuenta FROM CUENTAA) And PE_FOLIO = 'PREVENTA'"))));
 //BA.debugLineNum = 1362;BA.debugLine="Dim subtotal As Double";
_subtotal = 0;
 //BA.debugLineNum = 1363;BA.debugLine="s.Position = 0";
parent._s.setPosition((int) (0));
 //BA.debugLineNum = 1364;BA.debugLine="subtotal = s.GetDouble(\"SUBTOTAL\")";
_subtotal = parent._s.GetDouble("SUBTOTAL");
 //BA.debugLineNum = 1365;BA.debugLine="s.Close";
parent._s.Close();
 //BA.debugLineNum = 1367;BA.debugLine="Dim subtot As Cursor = skmt.ExecQuery(\"SELECT SU";
_subtot = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_subtot = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(parent._skmt.ExecQuery("SELECT SUM(P.PE_COSTO_TOT) As TOTAL_SIN_PROMO FROM PEDIDO P INNER JOIN CAT_GUNAPROD C ON P.PE_PROID = C.CAT_GP_ID WHERE P.PE_CLIENTE IN (Select cuenta FROM CUENTAA) And P.PE_FOLIO = 'PREVENTA' And PE_CEDIS Not IN (Select DISTINCT PE_PROID FROM PEDIDO)")));
 //BA.debugLineNum = 1368;BA.debugLine="subtot.Position = 0";
_subtot.setPosition((int) (0));
 //BA.debugLineNum = 1369;BA.debugLine="subtotal = subtotal + subtot.GetDouble(\"TOTAL_SI";
_subtotal = _subtotal+_subtot.GetDouble("TOTAL_SIN_PROMO");
 //BA.debugLineNum = 1370;BA.debugLine="subtot.Close";
_subtot.Close();
 //BA.debugLineNum = 1372;BA.debugLine="subtotal = Round2(subtotal, 2)";
_subtotal = parent.__c.Round2(_subtotal,(int) (2));
 //BA.debugLineNum = 1373;BA.debugLine="Printer1.WriteString(\"Subtotal:   $\" & NumberFor";
parent._printer1._writestring /*String*/ ("Subtotal:   $"+parent.__c.NumberFormat(_subtotal,(int) (0),(int) (2))+_elinefeed);
 //BA.debugLineNum = 1376;BA.debugLine="Dim descuento As Double";
_descuento = 0;
 //BA.debugLineNum = 1377;BA.debugLine="s = skmt.ExecQuery2(\"SELECT SUM(PE_COSTO_TOT) AS";
parent._s = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(parent._skmt.ExecQuery2("SELECT SUM(PE_COSTO_TOT) AS TOTAL FROM PEDIDO WHERE PE_CLIENTE IN (Select CUENTA from cuentaa) AND PE_FOLIO = ?",new String[]{"PREVENTA"})));
 //BA.debugLineNum = 1378;BA.debugLine="s.Position = 0";
parent._s.setPosition((int) (0));
 //BA.debugLineNum = 1379;BA.debugLine="Dim total As Double = s.GetDouble(\"TOTAL\")";
_total = parent._s.GetDouble("TOTAL");
 //BA.debugLineNum = 1380;BA.debugLine="descuento = subtotal - total";
_descuento = _subtotal-_total;
 //BA.debugLineNum = 1381;BA.debugLine="descuento = Round2(descuento, 2) ' Redondear des";
_descuento = parent.__c.Round2(_descuento,(int) (2));
 //BA.debugLineNum = 1382;BA.debugLine="s.Close";
parent._s.Close();
 //BA.debugLineNum = 1384;BA.debugLine="Printer1.WriteString(\"Descuento:   $\" & NumberFo";
parent._printer1._writestring /*String*/ ("Descuento:   $"+parent.__c.NumberFormat(_descuento,(int) (0),(int) (2))+_elinefeed);
 //BA.debugLineNum = 1387;BA.debugLine="Printer1.WriteString(\"Total preventa:   $\" & Num";
parent._printer1._writestring /*String*/ ("Total preventa:   $"+parent.__c.NumberFormat(_total,(int) (0),(int) (2))+_elinefeed);
 //BA.debugLineNum = 1390;BA.debugLine="Dim c As Cursor = skmt.ExecQuery2(\"SELECT SUM(PE";
parent._c = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
parent._c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(parent._skmt.ExecQuery2("SELECT SUM(PE_CANT) AS PC_NOART FROM PEDIDO WHERE PE_CLIENTE IN (Select CUENTA from cuentaa) AND PE_PROID NOT IN (SELECT CAT_PA_ID FROM PROMOS_COMP) AND PE_FOLIO = ?",new String[]{"PREVENTA"})));
 //BA.debugLineNum = 1391;BA.debugLine="c.Position = 0";
parent._c.setPosition((int) (0));
 //BA.debugLineNum = 1392;BA.debugLine="Printer1.WriteString(\"Total art. preventa: \" & N";
parent._printer1._writestring /*String*/ ("Total art. preventa: "+parent.__c.NumberFormat(parent._c.GetDouble("PC_NOART"),(int) (0),(int) (0))+_elinefeed);
 //BA.debugLineNum = 1393;BA.debugLine="c.Close";
parent._c.Close();
 if (true) break;

case 95:
//C
this.state = 96;
;
 //BA.debugLineNum = 1396;BA.debugLine="Dim siesacredi As Cursor = skmt.ExecQuery(\"SELECT";
_siesacredi = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_siesacredi = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(parent._skmt.ExecQuery("SELECT * FROM PAGARES WHERE PA_CLIENTE IN (SELECT CUENTA FROM CUENTAA)")));
 //BA.debugLineNum = 1397;BA.debugLine="If siesacredi.RowCount > 0 Then";
if (true) break;

case 96:
//if
this.state = 103;
if (_siesacredi.getRowCount()>0) { 
this.state = 98;
}if (true) break;

case 98:
//C
this.state = 99;
 //BA.debugLineNum = 1398;BA.debugLine="siesacredi.Position = 0";
_siesacredi.setPosition((int) (0));
 //BA.debugLineNum = 1399;BA.debugLine="Printer1.WriteString(\"Total a credito:   $\" & Nu";
parent._printer1._writestring /*String*/ ("Total a credito:   $"+parent.__c.NumberFormat((double)(Double.parseDouble(_siesacredi.GetString("PA_MONTO"))),(int) (0),(int) (2))+_elinefeed);
 //BA.debugLineNum = 1400;BA.debugLine="s=skmt.ExecQuery2(\"select SUM(PE_COSTO_TOT) AS T";
parent._s = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(parent._skmt.ExecQuery2("select SUM(PE_COSTO_TOT) AS TOTAL FROM PEDIDO WHERE PE_CLIENTE IN (Select CUENTA from cuentaa) AND PE_FOLIO = ?",new String[]{"PREVENTA"})));
 //BA.debugLineNum = 1401;BA.debugLine="s.Position =0";
parent._s.setPosition((int) (0));
 //BA.debugLineNum = 1402;BA.debugLine="If s.GetString(\"TOTAL\") > siesacredi.GetString(\"";
if (true) break;

case 99:
//if
this.state = 102;
if ((double)(Double.parseDouble(parent._s.GetString("TOTAL")))>(double)(Double.parseDouble(_siesacredi.GetString("PA_MONTO")))) { 
this.state = 101;
}if (true) break;

case 101:
//C
this.state = 102;
 //BA.debugLineNum = 1403;BA.debugLine="Printer1.WriteString(\"Total a contado:   $\" & N";
parent._printer1._writestring /*String*/ ("Total a contado:   $"+parent.__c.NumberFormat(((double)(Double.parseDouble(parent._s.GetString("TOTAL")))-(double)(Double.parseDouble(_siesacredi.GetString("PA_MONTO")))),(int) (0),(int) (2))+_elinefeed);
 if (true) break;

case 102:
//C
this.state = 103;
;
 //BA.debugLineNum = 1405;BA.debugLine="s.Close";
parent._s.Close();
 if (true) break;

case 103:
//C
this.state = 104;
;
 //BA.debugLineNum = 1407;BA.debugLine="Printer1.WriteString(\" \" &  eLINEFEED)";
parent._printer1._writestring /*String*/ (" "+_elinefeed);
 //BA.debugLineNum = 1408;BA.debugLine="Printer1.WriteString(\"---------------------------";
parent._printer1._writestring /*String*/ ("------------------------------"+_elinefeed);
 //BA.debugLineNum = 1409;BA.debugLine="Printer1.WriteString(\"----ESTE TICKET NO ES UN --";
parent._printer1._writestring /*String*/ ("----ESTE TICKET NO ES UN -----"+_elinefeed);
 //BA.debugLineNum = 1410;BA.debugLine="Printer1.WriteString(\"--COMPROBANTE FISCAL, SOLO";
parent._printer1._writestring /*String*/ ("--COMPROBANTE FISCAL, SOLO ES-"+_elinefeed);
 //BA.debugLineNum = 1411;BA.debugLine="Printer1.WriteString(\"--------INFORMATIVO--------";
parent._printer1._writestring /*String*/ ("--------INFORMATIVO-----------"+_elinefeed);
 //BA.debugLineNum = 1412;BA.debugLine="Printer1.WriteString(\"-POR FAVOR REVISE SU PEDIDO";
parent._printer1._writestring /*String*/ ("-POR FAVOR REVISE SU PEDIDO,--"+_elinefeed);
 //BA.debugLineNum = 1413;BA.debugLine="Printer1.WriteString(\"-UNA VEZ REALIZADA LA ENTRE";
parent._printer1._writestring /*String*/ ("-UNA VEZ REALIZADA LA ENTREGA-"+_elinefeed);
 //BA.debugLineNum = 1414;BA.debugLine="Printer1.WriteString(\"NO HAY CAMBIOS NI DEVOLUCIO";
parent._printer1._writestring /*String*/ ("NO HAY CAMBIOS NI DEVOLUCIONES"+_elinefeed);
 //BA.debugLineNum = 1415;BA.debugLine="Printer1.WriteString(\"---------------------------";
parent._printer1._writestring /*String*/ ("------------------------------"+_elinefeed);
 //BA.debugLineNum = 1416;BA.debugLine="Printer1.WriteString(\" \" &  eLINEFEED)";
parent._printer1._writestring /*String*/ (" "+_elinefeed);
 //BA.debugLineNum = 1417;BA.debugLine="Printer1.WriteString(\" \" &  eLINEFEED)";
parent._printer1._writestring /*String*/ (" "+_elinefeed);
 //BA.debugLineNum = 1418;BA.debugLine="Printer1.WriteString(\" \" &  eLINEFEED)";
parent._printer1._writestring /*String*/ (" "+_elinefeed);
 //BA.debugLineNum = 1419;BA.debugLine="Sleep(1000)";
parent.__c.Sleep(ba,this,(int) (1000));
this.state = 130;
return;
case 130:
//C
this.state = 104;
;
 //BA.debugLineNum = 1420;BA.debugLine="Printer1.DisConnect";
parent._printer1._disconnect /*String*/ ();
 //BA.debugLineNum = 1421;BA.debugLine="ProgressDialogHide";
parent.__c.ProgressDialogHide();
 //BA.debugLineNum = 1422;BA.debugLine="Msgbox2Async(\"Deseas imprimir de nuevo el ticket?";
parent.__c.Msgbox2Async(BA.ObjectToCharSequence("Deseas imprimir de nuevo el ticket?"),BA.ObjectToCharSequence("ATENCION"),"SI","","NO",parent.__c.LoadBitmap(parent.__c.File.getDirAssets(),"alert2.png"),ba,parent.__c.False);
 //BA.debugLineNum = 1423;BA.debugLine="Wait For Msgbox_Result (resultado As Int)";
parent.__c.WaitFor("msgbox_result", ba, this, null);
this.state = 131;
return;
case 131:
//C
this.state = 104;
_resultado = (Integer) result[0];
;
 //BA.debugLineNum = 1424;BA.debugLine="If resultado = DialogResponse.POSITIVE Then";
if (true) break;

case 104:
//if
this.state = 115;
if (_resultado==parent.__c.DialogResponse.POSITIVE) { 
this.state = 106;
}else {
this.state = 108;
}if (true) break;

case 106:
//C
this.state = 115;
 //BA.debugLineNum = 1425;BA.debugLine="B_IMP_Click";
parent._b_imp_click();
 if (true) break;

case 108:
//C
this.state = 109;
 //BA.debugLineNum = 1427;BA.debugLine="If imprimirsolo = 0 Then";
if (true) break;

case 109:
//if
this.state = 114;
if ((parent._imprimirsolo).equals(BA.NumberToString(0))) { 
this.state = 111;
}else if((parent._imprimirsolo).equals(BA.NumberToString(1))) { 
this.state = 113;
}if (true) break;

case 111:
//C
this.state = 114;
 if (true) break;

case 113:
//C
this.state = 114;
 //BA.debugLineNum = 1430;BA.debugLine="bitacora.b_Inicio_Fin_venta2.Text = \"TERMINAR V";
parent._bitacora._b_inicio_fin_venta2 /*anywheresoftware.b4a.objects.ButtonWrapper*/ .setText(BA.ObjectToCharSequence("TERMINAR VENTA"));
 //BA.debugLineNum = 1431;BA.debugLine="bitacora.enVenta = False";
parent._bitacora._enventa /*boolean*/  = parent.__c.False;
 //BA.debugLineNum = 1432;BA.debugLine="bitacora.inicioFin";
parent._bitacora._iniciofin /*String*/ ();
 //BA.debugLineNum = 1433;BA.debugLine="GUADAVENTA2";
parent._guadaventa2();
 if (true) break;

case 114:
//C
this.state = 115;
;
 if (true) break;

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

            }
        }
    }
}
public void  _imprime_venta() throws Exception{
ResumableSub_imprime_venta rsub = new ResumableSub_imprime_venta(this);
rsub.resume(ba, null);
}
public static class ResumableSub_imprime_venta extends BA.ResumableSub {
public ResumableSub_imprime_venta(medicomed.keymon.com.mx.c_cliente parent) {
this.parent = parent;
}
medicomed.keymon.com.mx.c_cliente parent;
String _elinefeed = "";
String _tel = "";
anywheresoftware.b4a.sql.SQL.CursorWrapper _t = null;
int _cont = 0;
int _i = 0;
int _e = 0;
double _subtotal = 0;
anywheresoftware.b4a.sql.SQL.CursorWrapper _subtot = null;
double _descuento = 0;
double _total = 0;
int _resultado = 0;
int step65;
int limit65;
int step79;
int limit79;
int step95;
int limit95;
int step113;
int limit113;
int step127;
int limit127;

@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 = 1440;BA.debugLine="c=skmt.ExecQuery(\"select USUARIO from usuarioa\")";
parent._c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(parent._skmt.ExecQuery("select USUARIO from usuarioa")));
 //BA.debugLineNum = 1441;BA.debugLine="c.Position=0";
parent._c.setPosition((int) (0));
 //BA.debugLineNum = 1442;BA.debugLine="usuario = c.GetString(\"USUARIO\")";
parent._usuario = parent._c.GetString("USUARIO");
 //BA.debugLineNum = 1443;BA.debugLine="DateTime.DateFormat = \"MM/dd/yyyy\"";
parent.__c.DateTime.setDateFormat("MM/dd/yyyy");
 //BA.debugLineNum = 1444;BA.debugLine="sDate=DateTime.Date(DateTime.Now)";
parent._sdate = parent.__c.DateTime.Date(parent.__c.DateTime.getNow());
 //BA.debugLineNum = 1445;BA.debugLine="sTime=DateTime.Time(DateTime.Now)";
parent._stime = parent.__c.DateTime.Time(parent.__c.DateTime.getNow());
 //BA.debugLineNum = 1446;BA.debugLine="c.Close";
parent._c.Close();
 //BA.debugLineNum = 1447;BA.debugLine="Public Const eLINEFEED As String = \"\" & Chr(0x0D)";
_elinefeed = ""+BA.ObjectToString(parent.__c.Chr(((int)0x0d)))+BA.ObjectToString(parent.__c.Chr(((int)0x0a)));
 //BA.debugLineNum = 1448;BA.debugLine="Dim tel As String = \"\"";
_tel = "";
 //BA.debugLineNum = 1449;BA.debugLine="Dim t As Cursor = B4XPages.MainPage.skmt.ExecQuer";
_t = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_t = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(parent._b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("SELECT CAT_VA_VALOR FROM CAT_VARIABLES WHERE CAT_VA_DESCRIPCION = 'TELEFONO'")));
 //BA.debugLineNum = 1450;BA.debugLine="If t.RowCount > 0 Then";
if (true) break;

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

case 3:
//C
this.state = 4;
 //BA.debugLineNum = 1451;BA.debugLine="t.Position = 0";
_t.setPosition((int) (0));
 //BA.debugLineNum = 1452;BA.debugLine="tel = t.GetString(\"CAT_VA_VALOR\")";
_tel = _t.GetString("CAT_VA_VALOR");
 if (true) break;

case 4:
//C
this.state = 5;
;
 //BA.debugLineNum = 1454;BA.debugLine="t.Close";
_t.Close();
 //BA.debugLineNum = 1461;BA.debugLine="ProgressDialogShow(\"Imprimiendo, un momento ...\")";
parent.__c.ProgressDialogShow(ba,BA.ObjectToCharSequence("Imprimiendo, un momento ..."));
 //BA.debugLineNum = 1462;BA.debugLine="Printer1.DisConnect";
parent._printer1._disconnect /*String*/ ();
 //BA.debugLineNum = 1463;BA.debugLine="If Not(Printer1.IsConnected) Then";
if (true) break;

case 5:
//if
this.state = 42;
if (parent.__c.Not(parent._printer1._isconnected /*boolean*/ ())) { 
this.state = 7;
}else {
this.state = 25;
}if (true) break;

case 7:
//C
this.state = 8;
 //BA.debugLineNum = 1464;BA.debugLine="Log(\"Conectando a impresora ...\")";
parent.__c.LogImpl("753215257","Conectando a impresora ...",0);
 //BA.debugLineNum = 1465;BA.debugLine="Printer1.Connect";
parent._printer1._connect /*boolean*/ ();
 //BA.debugLineNum = 1466;BA.debugLine="Private cont As Int = 0";
_cont = (int) (0);
 //BA.debugLineNum = 1467;BA.debugLine="Do While Not(impresoraConectada)";
if (true) break;

case 8:
//do while
this.state = 23;
while (parent.__c.Not(parent._impresoraconectada)) {
this.state = 10;
if (true) break;
}
if (true) break;

case 10:
//C
this.state = 11;
 //BA.debugLineNum = 1468;BA.debugLine="Sleep(1000)";
parent.__c.Sleep(ba,this,(int) (1000));
this.state = 109;
return;
case 109:
//C
this.state = 11;
;
 //BA.debugLineNum = 1469;BA.debugLine="Log(\"++++++  \" & cont)";
parent.__c.LogImpl("753215262","++++++  "+BA.NumberToString(_cont),0);
 //BA.debugLineNum = 1470;BA.debugLine="cont = cont + 1";
_cont = (int) (_cont+1);
 //BA.debugLineNum = 1471;BA.debugLine="If cont = 2 Then Printer1.Connect 'Tratamos de";
if (true) break;

case 11:
//if
this.state = 16;
if (_cont==2) { 
this.state = 13;
;}if (true) break;

case 13:
//C
this.state = 16;
parent._printer1._connect /*boolean*/ ();
if (true) break;

case 16:
//C
this.state = 17;
;
 //BA.debugLineNum = 1472;BA.debugLine="If cont > 3 Then impresoraConectada = True";
if (true) break;

case 17:
//if
this.state = 22;
if (_cont>3) { 
this.state = 19;
;}if (true) break;

case 19:
//C
this.state = 22;
parent._impresoraconectada = parent.__c.True;
if (true) break;

case 22:
//C
this.state = 8;
;
 if (true) break;

case 23:
//C
this.state = 42;
;
 //BA.debugLineNum = 1474;BA.debugLine="Sleep(500)";
parent.__c.Sleep(ba,this,(int) (500));
this.state = 110;
return;
case 110:
//C
this.state = 42;
;
 //BA.debugLineNum = 1475;BA.debugLine="impresoraConectada = False";
parent._impresoraconectada = parent.__c.False;
 if (true) break;

case 25:
//C
this.state = 26;
 //BA.debugLineNum = 1477;BA.debugLine="Log(\"conectando 2\")";
parent.__c.LogImpl("753215270","conectando 2",0);
 //BA.debugLineNum = 1478;BA.debugLine="Printer1.Connect";
parent._printer1._connect /*boolean*/ ();
 //BA.debugLineNum = 1479;BA.debugLine="Private cont As Int = 0";
_cont = (int) (0);
 //BA.debugLineNum = 1480;BA.debugLine="Do While Not(impresoraConectada) Or Not(Printer1";
if (true) break;

case 26:
//do while
this.state = 41;
while (parent.__c.Not(parent._impresoraconectada) || parent.__c.Not(parent._printer1._isconnected /*boolean*/ ())) {
this.state = 28;
if (true) break;
}
if (true) break;

case 28:
//C
this.state = 29;
 //BA.debugLineNum = 1481;BA.debugLine="Sleep(1000)";
parent.__c.Sleep(ba,this,(int) (1000));
this.state = 111;
return;
case 111:
//C
this.state = 29;
;
 //BA.debugLineNum = 1482;BA.debugLine="Log(\"******  \" & cont)";
parent.__c.LogImpl("753215275","******  "+BA.NumberToString(_cont),0);
 //BA.debugLineNum = 1483;BA.debugLine="cont = cont + 1";
_cont = (int) (_cont+1);
 //BA.debugLineNum = 1484;BA.debugLine="If cont = 2 Then Printer1.Connect";
if (true) break;

case 29:
//if
this.state = 34;
if (_cont==2) { 
this.state = 31;
;}if (true) break;

case 31:
//C
this.state = 34;
parent._printer1._connect /*boolean*/ ();
if (true) break;

case 34:
//C
this.state = 35;
;
 //BA.debugLineNum = 1485;BA.debugLine="If cont > 3 Then impresoraConectada = True";
if (true) break;

case 35:
//if
this.state = 40;
if (_cont>3) { 
this.state = 37;
;}if (true) break;

case 37:
//C
this.state = 40;
parent._impresoraconectada = parent.__c.True;
if (true) break;

case 40:
//C
this.state = 26;
;
 if (true) break;

case 41:
//C
this.state = 42;
;
 //BA.debugLineNum = 1487;BA.debugLine="Sleep(500)";
parent.__c.Sleep(ba,this,(int) (500));
this.state = 112;
return;
case 112:
//C
this.state = 42;
;
 //BA.debugLineNum = 1488;BA.debugLine="impresoraConectada = False";
parent._impresoraconectada = parent.__c.False;
 if (true) break;

case 42:
//C
this.state = 43;
;
 //BA.debugLineNum = 1491;BA.debugLine="TAMANO = 0";
parent._tamano = (int) (0);
 //BA.debugLineNum = 1492;BA.debugLine="ESPACIO = 22";
parent._espacio = (int) (22);
 //BA.debugLineNum = 1493;BA.debugLine="BLANCO = \" \"";
parent._blanco = " ";
 //BA.debugLineNum = 1510;BA.debugLine="Printer1.WriteString(\"Compania Logistica Medicome";
parent._printer1._writestring /*String*/ ("Compania Logistica Medicomed."+_elinefeed);
 //BA.debugLineNum = 1512;BA.debugLine="Printer1.WriteString(sDate &  eLINEFEED)";
parent._printer1._writestring /*String*/ (parent._sdate+_elinefeed);
 //BA.debugLineNum = 1513;BA.debugLine="Printer1.WriteString(sTime &  eLINEFEED)";
parent._printer1._writestring /*String*/ (parent._stime+_elinefeed);
 //BA.debugLineNum = 1514;BA.debugLine="Printer1.WriteString(\"Vendedor:\" & usuario &  eLI";
parent._printer1._writestring /*String*/ ("Vendedor:"+parent._usuario+_elinefeed);
 //BA.debugLineNum = 1515;BA.debugLine="Printer1.WriteString(\"Tel vendedor:\" & tel &  eLI";
parent._printer1._writestring /*String*/ ("Tel vendedor:"+_tel+_elinefeed);
 //BA.debugLineNum = 1516;BA.debugLine="Printer1.WriteString(\"Tienda: \" & La_nombre.Text";
parent._printer1._writestring /*String*/ ("Tienda: "+parent._la_nombre.getText()+_elinefeed);
 //BA.debugLineNum = 1517;BA.debugLine="Printer1.WriteString(\"ID.Cliente: \" &  la_cuenta.";
parent._printer1._writestring /*String*/ ("ID.Cliente: "+parent._la_cuenta.getText()+_elinefeed);
 //BA.debugLineNum = 1518;BA.debugLine="Printer1.WriteString(\"Calle: \" & la_Calle.Text &";
parent._printer1._writestring /*String*/ ("Calle: "+parent._la_calle.getText()+_elinefeed);
 //BA.debugLineNum = 1519;BA.debugLine="Printer1.WriteString(\"Colonia: \" & la_col.Text &";
parent._printer1._writestring /*String*/ ("Colonia: "+parent._la_col.getText()+_elinefeed);
 //BA.debugLineNum = 1523;BA.debugLine="Printer1.WriteString(\" \" &  eLINEFEED)";
parent._printer1._writestring /*String*/ (" "+_elinefeed);
 //BA.debugLineNum = 1524;BA.debugLine="c = skmt.ExecQuery2(\"SELECT * FROM PEDIDO WHERE P";
parent._c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(parent._skmt.ExecQuery2("SELECT * FROM PEDIDO WHERE PE_FOLIO = ?",new String[]{"PREVENTA_48"})));
 //BA.debugLineNum = 1525;BA.debugLine="If c.RowCount > 0 Then";
if (true) break;

case 43:
//if
this.state = 92;
if (parent._c.getRowCount()>0) { 
this.state = 45;
}if (true) break;

case 45:
//C
this.state = 46;
 //BA.debugLineNum = 1526;BA.debugLine="Printer1.WriteString(\"--------PREVENTA_48-------";
parent._printer1._writestring /*String*/ ("--------PREVENTA_48--------"+_elinefeed);
 //BA.debugLineNum = 1529;BA.debugLine="Printer1.WriteString(\"Cant.      Precio        I";
parent._printer1._writestring /*String*/ ("Cant.      Precio        Importe"+_elinefeed);
 //BA.debugLineNum = 1531;BA.debugLine="Printer1.WriteString(\"--------------------------";
parent._printer1._writestring /*String*/ ("------------------------------"+_elinefeed);
 //BA.debugLineNum = 1533;BA.debugLine="s=skmt.ExecQuery2(\"select PE_BCAJAS, PE_PRONOMBR";
parent._s = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(parent._skmt.ExecQuery2("select PE_BCAJAS, PE_PRONOMBRE, PE_CANT, length(pe_cant) as L_CANT, PE_COSTOU, length(PE_COSTOU) as L_COSTOU, PE_COSTO_TOT, length(PE_CANT * PE_COSTOU) as L_COSTO_TOT,PE_PROID, PE_CEDIS  FROM PEDIDO WHERE PE_FOLIO = ? AND LENGTH(PE_CEDIS) < 4 AND PE_CLIENTE IN (Select CUENTA from cuentaa)  order by  PE_PROID",new String[]{"PREVENTA_48"})));
 //BA.debugLineNum = 1534;BA.debugLine="If S.RowCount>0 Then";
if (true) break;

case 46:
//if
this.state = 73;
if (parent._s.getRowCount()>0) { 
this.state = 48;
}if (true) break;

case 48:
//C
this.state = 49;
 //BA.debugLineNum = 1535;BA.debugLine="For i=0 To S.RowCount -1";
if (true) break;

case 49:
//for
this.state = 72;
step65 = 1;
limit65 = (int) (parent._s.getRowCount()-1);
_i = (int) (0) ;
this.state = 113;
if (true) break;

case 113:
//C
this.state = 72;
if ((step65 > 0 && _i <= limit65) || (step65 < 0 && _i >= limit65)) this.state = 51;
if (true) break;

case 114:
//C
this.state = 113;
_i = ((int)(0 + _i + step65)) ;
if (true) break;

case 51:
//C
this.state = 52;
 //BA.debugLineNum = 1536;BA.debugLine="S.Position=i";
parent._s.setPosition(_i);
 //BA.debugLineNum = 1537;BA.debugLine="If s.GetString(\"PE_CEDIS\") = s.GetString(\"PE_P";
if (true) break;

case 52:
//if
this.state = 71;
if ((parent._s.GetString("PE_CEDIS")).equals(parent._s.GetString("PE_PROID"))) { 
this.state = 54;
}else {
this.state = 56;
}if (true) break;

case 54:
//C
this.state = 71;
 //BA.debugLineNum = 1538;BA.debugLine="Printer1.WriteString(s.GetString(\"PE_PRONOMBR";
parent._printer1._writestring /*String*/ (parent._s.GetString("PE_PRONOMBRE")+_elinefeed);
 if (true) break;

case 56:
//C
this.state = 57;
 //BA.debugLineNum = 1542;BA.debugLine="If s.GetString(\"PE_BCAJAS\") = 0 Then";
if (true) break;

case 57:
//if
this.state = 70;
if ((parent._s.GetString("PE_BCAJAS")).equals(BA.NumberToString(0))) { 
this.state = 59;
}else {
this.state = 65;
}if (true) break;

case 59:
//C
this.state = 60;
 //BA.debugLineNum = 1545;BA.debugLine="Printer1.WriteString(s.GetString(\"PE_PRONOMB";
parent._printer1._writestring /*String*/ (parent._s.GetString("PE_PRONOMBRE")+_elinefeed);
 //BA.debugLineNum = 1583;BA.debugLine="k1 = NumberFormat(s.GETSTRING(\"PE_COSTOU\"),0";
parent._k1 = parent.__c.NumberFormat((double)(Double.parseDouble(parent._s.GetString("PE_COSTOU"))),(int) (0),(int) (2));
 //BA.debugLineNum = 1584;BA.debugLine="k2 = NumberFormat(s.GETSTRING(\"PE_COSTO_TOT\"";
parent._k2 = parent.__c.NumberFormat((double)(Double.parseDouble(parent._s.GetString("PE_COSTO_TOT"))),(int) (0),(int) (2));
 //BA.debugLineNum = 1586;BA.debugLine="TAMANO = s.GetLong(\"L_CANT\") + k1.Length + k";
parent._tamano = (int) (parent._s.GetLong("L_CANT")+parent._k1.length()+parent._k2.length());
 //BA.debugLineNum = 1587;BA.debugLine="ESPACIO = 23";
parent._espacio = (int) (23);
 //BA.debugLineNum = 1588;BA.debugLine="BLANCO = \" \"";
parent._blanco = " ";
 //BA.debugLineNum = 1589;BA.debugLine="ESPACIO = ESPACIO - TAMANO";
parent._espacio = (int) (parent._espacio-parent._tamano);
 //BA.debugLineNum = 1590;BA.debugLine="ESPACIO = ESPACIO / 2";
parent._espacio = (int) (parent._espacio/(double)2);
 //BA.debugLineNum = 1591;BA.debugLine="For E=0 To ESPACIO -1";
if (true) break;

case 60:
//for
this.state = 63;
step79 = 1;
limit79 = (int) (parent._espacio-1);
_e = (int) (0) ;
this.state = 115;
if (true) break;

case 115:
//C
this.state = 63;
if ((step79 > 0 && _e <= limit79) || (step79 < 0 && _e >= limit79)) this.state = 62;
if (true) break;

case 116:
//C
this.state = 115;
_e = ((int)(0 + _e + step79)) ;
if (true) break;

case 62:
//C
this.state = 116;
 //BA.debugLineNum = 1592;BA.debugLine="BLANCO = \" \" & BLANCO";
parent._blanco = " "+parent._blanco;
 if (true) break;
if (true) break;

case 63:
//C
this.state = 70;
;
 //BA.debugLineNum = 1595;BA.debugLine="Printer1.WriteString(s.GETSTRING(\"PE_CANT\")&";
parent._printer1._writestring /*String*/ (parent._s.GetString("PE_CANT")+" "+"Piezas"+parent._blanco+parent._k1+parent._blanco+parent._k2+_elinefeed);
 //BA.debugLineNum = 1597;BA.debugLine="TAMANO = 0";
parent._tamano = (int) (0);
 //BA.debugLineNum = 1598;BA.debugLine="ESPACIO = 23";
parent._espacio = (int) (23);
 //BA.debugLineNum = 1599;BA.debugLine="BLANCO = \" \"";
parent._blanco = " ";
 if (true) break;

case 65:
//C
this.state = 66;
 //BA.debugLineNum = 1602;BA.debugLine="Printer1.WriteString(s.GetString(\"PE_PRONOMB";
parent._printer1._writestring /*String*/ (parent._s.GetString("PE_PRONOMBRE")+_elinefeed);
 //BA.debugLineNum = 1646;BA.debugLine="k1 = NumberFormat((s.GETSTRING(\"PE_COSTO_TOT";
parent._k1 = parent.__c.NumberFormat(((double)(Double.parseDouble(parent._s.GetString("PE_COSTO_TOT")))/(double)(double)(Double.parseDouble(parent._s.GetString("PE_CANT")))),(int) (0),(int) (2));
 //BA.debugLineNum = 1647;BA.debugLine="k2 = NumberFormat(s.GETSTRING(\"PE_COSTO_TOT\"";
parent._k2 = parent.__c.NumberFormat((double)(Double.parseDouble(parent._s.GetString("PE_COSTO_TOT"))),(int) (0),(int) (2));
 //BA.debugLineNum = 1649;BA.debugLine="TAMANO = s.GetLong(\"L_CANT\") + k1.Length + k";
parent._tamano = (int) (parent._s.GetLong("L_CANT")+parent._k1.length()+parent._k2.length());
 //BA.debugLineNum = 1650;BA.debugLine="ESPACIO = 23";
parent._espacio = (int) (23);
 //BA.debugLineNum = 1651;BA.debugLine="BLANCO = \" \"";
parent._blanco = " ";
 //BA.debugLineNum = 1652;BA.debugLine="ESPACIO = ESPACIO - TAMANO";
parent._espacio = (int) (parent._espacio-parent._tamano);
 //BA.debugLineNum = 1653;BA.debugLine="ESPACIO = ESPACIO / 2";
parent._espacio = (int) (parent._espacio/(double)2);
 //BA.debugLineNum = 1654;BA.debugLine="For E=0 To ESPACIO -1";
if (true) break;

case 66:
//for
this.state = 69;
step95 = 1;
limit95 = (int) (parent._espacio-1);
_e = (int) (0) ;
this.state = 117;
if (true) break;

case 117:
//C
this.state = 69;
if ((step95 > 0 && _e <= limit95) || (step95 < 0 && _e >= limit95)) this.state = 68;
if (true) break;

case 118:
//C
this.state = 117;
_e = ((int)(0 + _e + step95)) ;
if (true) break;

case 68:
//C
this.state = 118;
 //BA.debugLineNum = 1655;BA.debugLine="BLANCO = \" \" & BLANCO";
parent._blanco = " "+parent._blanco;
 if (true) break;
if (true) break;

case 69:
//C
this.state = 70;
;
 //BA.debugLineNum = 1658;BA.debugLine="Printer1.WriteString(s.GETSTRING(\"PE_CANT\")&";
parent._printer1._writestring /*String*/ (parent._s.GetString("PE_CANT")+" "+"Piezas"+parent._blanco+parent._k1+parent._blanco+parent._k2+_elinefeed);
 //BA.debugLineNum = 1660;BA.debugLine="TAMANO = 0";
parent._tamano = (int) (0);
 //BA.debugLineNum = 1661;BA.debugLine="ESPACIO = 23";
parent._espacio = (int) (23);
 //BA.debugLineNum = 1662;BA.debugLine="BLANCO = \" \"";
parent._blanco = " ";
 if (true) break;

case 70:
//C
this.state = 71;
;
 if (true) break;

case 71:
//C
this.state = 114;
;
 if (true) break;
if (true) break;

case 72:
//C
this.state = 73;
;
 if (true) break;

case 73:
//C
this.state = 74;
;
 //BA.debugLineNum = 1669;BA.debugLine="s.Close";
parent._s.Close();
 //BA.debugLineNum = 1670;BA.debugLine="Printer1.WriteString(\" \" &  eLINEFEED)";
parent._printer1._writestring /*String*/ (" "+_elinefeed);
 //BA.debugLineNum = 1671;BA.debugLine="s=skmt.ExecQuery2(\"select PE_PRONOMBRE, PE_CANT,";
parent._s = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(parent._skmt.ExecQuery2("select PE_PRONOMBRE, PE_CANT, length(pe_cant) as L_CANT, PE_COSTOU, length(PE_COSTOU) as L_COSTOU,PE_CANT * PE_COSTOU AS  PE_COSTO_TOT, length(PE_CANT * PE_COSTOU) as L_COSTO_TOT,PE_PROID, PE_CEDIS  FROM PEDIDO WHERE PE_FOLIO = ? AND LENGTH(PE_CEDIS) > 3 AND PE_CLIENTE IN (Select CUENTA from cuentaa) order by  PE_CEDIS, PE_COSTOU",new String[]{"PREVENTA_48"})));
 //BA.debugLineNum = 1672;BA.debugLine="If S.RowCount>0 Then";
if (true) break;

case 74:
//if
this.state = 91;
if (parent._s.getRowCount()>0) { 
this.state = 76;
}if (true) break;

case 76:
//C
this.state = 77;
 //BA.debugLineNum = 1673;BA.debugLine="Printer1.WriteString(\"-------PROMOS VENTA------";
parent._printer1._writestring /*String*/ ("-------PROMOS VENTA--------"+_elinefeed);
 //BA.debugLineNum = 1674;BA.debugLine="Printer1.WriteString(\"Cant.      Precio";
parent._printer1._writestring /*String*/ ("Cant.      Precio        Importe"+_elinefeed);
 //BA.debugLineNum = 1675;BA.debugLine="Printer1.WriteString(\"-------------------------";
parent._printer1._writestring /*String*/ ("------------------------------"+_elinefeed);
 //BA.debugLineNum = 1676;BA.debugLine="For i=0 To S.RowCount -1";
if (true) break;

case 77:
//for
this.state = 90;
step113 = 1;
limit113 = (int) (parent._s.getRowCount()-1);
_i = (int) (0) ;
this.state = 119;
if (true) break;

case 119:
//C
this.state = 90;
if ((step113 > 0 && _i <= limit113) || (step113 < 0 && _i >= limit113)) this.state = 79;
if (true) break;

case 120:
//C
this.state = 119;
_i = ((int)(0 + _i + step113)) ;
if (true) break;

case 79:
//C
this.state = 80;
 //BA.debugLineNum = 1677;BA.debugLine="s.Position=i";
parent._s.setPosition(_i);
 //BA.debugLineNum = 1678;BA.debugLine="If s.GetString(\"PE_CEDIS\") = s.GetString(\"PE_P";
if (true) break;

case 80:
//if
this.state = 89;
if ((parent._s.GetString("PE_CEDIS")).equals(parent._s.GetString("PE_PROID"))) { 
this.state = 82;
}else {
this.state = 84;
}if (true) break;

case 82:
//C
this.state = 89;
 //BA.debugLineNum = 1679;BA.debugLine="Printer1.WriteString(\"* \"& s.GetString(\"PE_PR";
parent._printer1._writestring /*String*/ ("* "+parent._s.GetString("PE_PRONOMBRE")+_elinefeed);
 //BA.debugLineNum = 1680;BA.debugLine="Log(\"promo\")";
parent.__c.LogImpl("753215473","promo",0);
 if (true) break;

case 84:
//C
this.state = 85;
 //BA.debugLineNum = 1683;BA.debugLine="Printer1.WriteString(s.GetString(\"PE_PRONOMBR";
parent._printer1._writestring /*String*/ (parent._s.GetString("PE_PRONOMBRE")+_elinefeed);
 //BA.debugLineNum = 1725;BA.debugLine="k1 = NumberFormat(s.GETSTRING(\"PE_COSTOU\"),0,";
parent._k1 = parent.__c.NumberFormat((double)(Double.parseDouble(parent._s.GetString("PE_COSTOU"))),(int) (0),(int) (2));
 //BA.debugLineNum = 1726;BA.debugLine="k2 = NumberFormat(s.GETSTRING(\"PE_COSTO_TOT\")";
parent._k2 = parent.__c.NumberFormat((double)(Double.parseDouble(parent._s.GetString("PE_COSTO_TOT"))),(int) (0),(int) (2));
 //BA.debugLineNum = 1728;BA.debugLine="TAMANO = s.GetLong(\"L_CANT\") + k1.Length + k2";
parent._tamano = (int) (parent._s.GetLong("L_CANT")+parent._k1.length()+parent._k2.length());
 //BA.debugLineNum = 1729;BA.debugLine="ESPACIO = 23";
parent._espacio = (int) (23);
 //BA.debugLineNum = 1730;BA.debugLine="BLANCO = \" \"";
parent._blanco = " ";
 //BA.debugLineNum = 1731;BA.debugLine="ESPACIO = ESPACIO - TAMANO";
parent._espacio = (int) (parent._espacio-parent._tamano);
 //BA.debugLineNum = 1732;BA.debugLine="ESPACIO = ESPACIO / 2";
parent._espacio = (int) (parent._espacio/(double)2);
 //BA.debugLineNum = 1733;BA.debugLine="For E=0 To ESPACIO -1";
if (true) break;

case 85:
//for
this.state = 88;
step127 = 1;
limit127 = (int) (parent._espacio-1);
_e = (int) (0) ;
this.state = 121;
if (true) break;

case 121:
//C
this.state = 88;
if ((step127 > 0 && _e <= limit127) || (step127 < 0 && _e >= limit127)) this.state = 87;
if (true) break;

case 122:
//C
this.state = 121;
_e = ((int)(0 + _e + step127)) ;
if (true) break;

case 87:
//C
this.state = 122;
 //BA.debugLineNum = 1734;BA.debugLine="BLANCO = \" \" & BLANCO";
parent._blanco = " "+parent._blanco;
 if (true) break;
if (true) break;

case 88:
//C
this.state = 89;
;
 //BA.debugLineNum = 1737;BA.debugLine="Printer1.WriteString(s.GETSTRING(\"PE_CANT\")&";
parent._printer1._writestring /*String*/ (parent._s.GetString("PE_CANT")+" "+"Piezas"+parent._blanco+parent._k1+parent._blanco+parent._k2+_elinefeed);
 //BA.debugLineNum = 1739;BA.debugLine="TAMANO = 0";
parent._tamano = (int) (0);
 //BA.debugLineNum = 1740;BA.debugLine="ESPACIO = 23";
parent._espacio = (int) (23);
 //BA.debugLineNum = 1741;BA.debugLine="BLANCO = \" \"";
parent._blanco = " ";
 if (true) break;

case 89:
//C
this.state = 120;
;
 if (true) break;
if (true) break;

case 90:
//C
this.state = 91;
;
 //BA.debugLineNum = 1745;BA.debugLine="Printer1.WriteString(\" \" &  eLINEFEED)";
parent._printer1._writestring /*String*/ (" "+_elinefeed);
 if (true) break;

case 91:
//C
this.state = 92;
;
 //BA.debugLineNum = 1747;BA.debugLine="s.Close";
parent._s.Close();
 //BA.debugLineNum = 1748;BA.debugLine="s = skmt.ExecQuery($\"SELECT SUM(CAT_GP_PRECIO *";
parent._s = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(parent._skmt.ExecQuery(("SELECT SUM(CAT_GP_PRECIO * PE_CANT) As SUBTOTAL FROM PEDIDO P INNER JOIN CAT_GUNAPROD C ON P.PE_PROID = C.CAT_GP_ID And P.PE_CEDIS = P.PE_PROID WHERE PE_CLIENTE IN (Select cuenta FROM CUENTAA) And PE_FOLIO = 'PREVENTA_48'"))));
 //BA.debugLineNum = 1749;BA.debugLine="Dim subtotal As Double";
_subtotal = 0;
 //BA.debugLineNum = 1750;BA.debugLine="s.Position = 0";
parent._s.setPosition((int) (0));
 //BA.debugLineNum = 1751;BA.debugLine="subtotal = s.GetDouble(\"SUBTOTAL\")";
_subtotal = parent._s.GetDouble("SUBTOTAL");
 //BA.debugLineNum = 1752;BA.debugLine="s.Close";
parent._s.Close();
 //BA.debugLineNum = 1754;BA.debugLine="Dim subtot As Cursor = skmt.ExecQuery(\"SELECT SU";
_subtot = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_subtot = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(parent._skmt.ExecQuery("SELECT SUM(P.PE_COSTO_TOT) As TOTAL_SIN_PROMO FROM PEDIDO P INNER JOIN CAT_GUNAPROD C ON P.PE_PROID = C.CAT_GP_ID WHERE P.PE_CLIENTE IN (Select cuenta FROM CUENTAA) And P.PE_FOLIO = 'PREVENTA_48' And PE_CEDIS Not IN (Select DISTINCT PE_PROID FROM PEDIDO)")));
 //BA.debugLineNum = 1755;BA.debugLine="subtot.Position = 0";
_subtot.setPosition((int) (0));
 //BA.debugLineNum = 1756;BA.debugLine="subtotal = subtotal + subtot.GetDouble(\"TOTAL_SI";
_subtotal = _subtotal+_subtot.GetDouble("TOTAL_SIN_PROMO");
 //BA.debugLineNum = 1757;BA.debugLine="subtot.Close";
_subtot.Close();
 //BA.debugLineNum = 1759;BA.debugLine="subtotal = Round2(subtotal, 2)";
_subtotal = parent.__c.Round2(_subtotal,(int) (2));
 //BA.debugLineNum = 1760;BA.debugLine="Printer1.WriteString(\"Subtotal:   $\" & NumberFor";
parent._printer1._writestring /*String*/ ("Subtotal:   $"+parent.__c.NumberFormat(_subtotal,(int) (0),(int) (2))+_elinefeed);
 //BA.debugLineNum = 1763;BA.debugLine="Dim descuento As Double";
_descuento = 0;
 //BA.debugLineNum = 1764;BA.debugLine="s = skmt.ExecQuery2(\"SELECT SUM(PE_COSTO_TOT) AS";
parent._s = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(parent._skmt.ExecQuery2("SELECT SUM(PE_COSTO_TOT) AS TOTAL FROM PEDIDO WHERE PE_CLIENTE IN (Select CUENTA from cuentaa) AND PE_FOLIO = ?",new String[]{"PREVENTA_48"})));
 //BA.debugLineNum = 1765;BA.debugLine="s.Position = 0";
parent._s.setPosition((int) (0));
 //BA.debugLineNum = 1766;BA.debugLine="Dim total As Double = s.GetDouble(\"TOTAL\")";
_total = parent._s.GetDouble("TOTAL");
 //BA.debugLineNum = 1767;BA.debugLine="descuento = subtotal - total";
_descuento = _subtotal-_total;
 //BA.debugLineNum = 1768;BA.debugLine="descuento = Round2(descuento, 2) ' Redondear des";
_descuento = parent.__c.Round2(_descuento,(int) (2));
 //BA.debugLineNum = 1769;BA.debugLine="s.Close";
parent._s.Close();
 //BA.debugLineNum = 1771;BA.debugLine="Printer1.WriteString(\"Descuento:   $\" & NumberFo";
parent._printer1._writestring /*String*/ ("Descuento:   $"+parent.__c.NumberFormat(_descuento,(int) (0),(int) (2))+_elinefeed);
 //BA.debugLineNum = 1774;BA.debugLine="Printer1.WriteString(\"Total preventa:   $\" & Num";
parent._printer1._writestring /*String*/ ("Total preventa:   $"+parent.__c.NumberFormat(_total,(int) (0),(int) (2))+_elinefeed);
 //BA.debugLineNum = 1777;BA.debugLine="Dim c As Cursor = skmt.ExecQuery2(\"SELECT SUM(PE";
parent._c = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
parent._c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(parent._skmt.ExecQuery2("SELECT SUM(PE_CANT) AS PC_NOART FROM PEDIDO WHERE PE_CLIENTE IN (Select CUENTA from cuentaa) AND PE_PROID NOT IN (SELECT CAT_PA_ID FROM PROMOS_COMP) AND PE_FOLIO = ?",new String[]{"PREVENTA_48"})));
 //BA.debugLineNum = 1778;BA.debugLine="c.Position = 0";
parent._c.setPosition((int) (0));
 //BA.debugLineNum = 1779;BA.debugLine="Printer1.WriteString(\"Total art. preventa: \" & N";
parent._printer1._writestring /*String*/ ("Total art. preventa: "+parent.__c.NumberFormat(parent._c.GetDouble("PC_NOART"),(int) (0),(int) (0))+_elinefeed);
 //BA.debugLineNum = 1780;BA.debugLine="c.Close";
parent._c.Close();
 if (true) break;

case 92:
//C
this.state = 93;
;
 //BA.debugLineNum = 1801;BA.debugLine="Printer1.WriteString(\" \" &  eLINEFEED)";
parent._printer1._writestring /*String*/ (" "+_elinefeed);
 //BA.debugLineNum = 1802;BA.debugLine="Printer1.WriteString(\"---------------------------";
parent._printer1._writestring /*String*/ ("------------------------------"+_elinefeed);
 //BA.debugLineNum = 1805;BA.debugLine="Printer1.WriteString(\"----ESTE TICKET NO ES UN --";
parent._printer1._writestring /*String*/ ("----ESTE TICKET NO ES UN -----"+_elinefeed);
 //BA.debugLineNum = 1806;BA.debugLine="Printer1.WriteString(\"--COMPROBANTE FISCAL, SOLO";
parent._printer1._writestring /*String*/ ("--COMPROBANTE FISCAL, SOLO ES-"+_elinefeed);
 //BA.debugLineNum = 1807;BA.debugLine="Printer1.WriteString(\"--------INFORMATIVO--------";
parent._printer1._writestring /*String*/ ("--------INFORMATIVO-----------"+_elinefeed);
 //BA.debugLineNum = 1808;BA.debugLine="Printer1.WriteString(\"-POR FAVOR REVISE SU PEDIDO";
parent._printer1._writestring /*String*/ ("-POR FAVOR REVISE SU PEDIDO,--"+_elinefeed);
 //BA.debugLineNum = 1809;BA.debugLine="Printer1.WriteString(\"-UNA VEZ REALIZADA LA ENTRE";
parent._printer1._writestring /*String*/ ("-UNA VEZ REALIZADA LA ENTREGA-"+_elinefeed);
 //BA.debugLineNum = 1810;BA.debugLine="Printer1.WriteString(\"NO HAY CAMBIOS NI DEVOLUCIO";
parent._printer1._writestring /*String*/ ("NO HAY CAMBIOS NI DEVOLUCIONES"+_elinefeed);
 //BA.debugLineNum = 1811;BA.debugLine="Printer1.WriteString(\"---------------------------";
parent._printer1._writestring /*String*/ ("------------------------------"+_elinefeed);
 //BA.debugLineNum = 1812;BA.debugLine="Printer1.WriteString(\" \" &  eLINEFEED)";
parent._printer1._writestring /*String*/ (" "+_elinefeed);
 //BA.debugLineNum = 1813;BA.debugLine="Printer1.WriteString(\" \" &  eLINEFEED)";
parent._printer1._writestring /*String*/ (" "+_elinefeed);
 //BA.debugLineNum = 1814;BA.debugLine="Printer1.WriteString(\" \" &  eLINEFEED)";
parent._printer1._writestring /*String*/ (" "+_elinefeed);
 //BA.debugLineNum = 1815;BA.debugLine="Sleep(1000)";
parent.__c.Sleep(ba,this,(int) (1000));
this.state = 123;
return;
case 123:
//C
this.state = 93;
;
 //BA.debugLineNum = 1816;BA.debugLine="Printer1.DisConnect";
parent._printer1._disconnect /*String*/ ();
 //BA.debugLineNum = 1818;BA.debugLine="ProgressDialogHide";
parent.__c.ProgressDialogHide();
 //BA.debugLineNum = 1820;BA.debugLine="s = skmt.ExecQuery2(\"SELECT * FROM PEDIDO WHERE P";
parent._s = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(parent._skmt.ExecQuery2("SELECT * FROM PEDIDO WHERE PE_FOLIO = ? AND PE_CLIENTE IN (SELECT CUENTA FROM CUENTAA)",new String[]{"PREVENTA"})));
 //BA.debugLineNum = 1821;BA.debugLine="If s.RowCount = 0 Then";
if (true) break;

case 93:
//if
this.state = 108;
if (parent._s.getRowCount()==0) { 
this.state = 95;
}if (true) break;

case 95:
//C
this.state = 96;
 //BA.debugLineNum = 1822;BA.debugLine="Msgbox2Async(\"Deseas imprimir de nuevo el ticket";
parent.__c.Msgbox2Async(BA.ObjectToCharSequence("Deseas imprimir de nuevo el ticket?"),BA.ObjectToCharSequence("ATENCION"),"SI","","NO",parent.__c.LoadBitmap(parent.__c.File.getDirAssets(),"alert2.png"),ba,parent.__c.False);
 //BA.debugLineNum = 1823;BA.debugLine="Wait For Msgbox_Result (resultado As Int)";
parent.__c.WaitFor("msgbox_result", ba, this, null);
this.state = 124;
return;
case 124:
//C
this.state = 96;
_resultado = (Integer) result[0];
;
 //BA.debugLineNum = 1824;BA.debugLine="If resultado = DialogResponse.POSITIVE Then";
if (true) break;

case 96:
//if
this.state = 107;
if (_resultado==parent.__c.DialogResponse.POSITIVE) { 
this.state = 98;
}else {
this.state = 100;
}if (true) break;

case 98:
//C
this.state = 107;
 //BA.debugLineNum = 1825;BA.debugLine="B_IMP_Click";
parent._b_imp_click();
 if (true) break;

case 100:
//C
this.state = 101;
 //BA.debugLineNum = 1827;BA.debugLine="If imprimirsolo = 0 Then";
if (true) break;

case 101:
//if
this.state = 106;
if ((parent._imprimirsolo).equals(BA.NumberToString(0))) { 
this.state = 103;
}else if((parent._imprimirsolo).equals(BA.NumberToString(1))) { 
this.state = 105;
}if (true) break;

case 103:
//C
this.state = 106;
 if (true) break;

case 105:
//C
this.state = 106;
 //BA.debugLineNum = 1830;BA.debugLine="bitacora.b_Inicio_Fin_venta2.Text = \"TERMINAR";
parent._bitacora._b_inicio_fin_venta2 /*anywheresoftware.b4a.objects.ButtonWrapper*/ .setText(BA.ObjectToCharSequence("TERMINAR VENTA"));
 //BA.debugLineNum = 1831;BA.debugLine="bitacora.enVenta = False";
parent._bitacora._enventa /*boolean*/  = parent.__c.False;
 //BA.debugLineNum = 1832;BA.debugLine="bitacora.inicioFin";
parent._bitacora._iniciofin /*String*/ ();
 //BA.debugLineNum = 1833;BA.debugLine="GUADAVENTA2";
parent._guadaventa2();
 if (true) break;

case 106:
//C
this.state = 107;
;
 if (true) break;

case 107:
//C
this.state = 108;
;
 if (true) break;

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

            }
        }
    }
}
public Object  _initialize(anywheresoftware.b4a.BA _ba) throws Exception{
innerInitialize(_ba);
 //BA.debugLineNum = 173;BA.debugLine="Public Sub Initialize As Object";
 //BA.debugLineNum = 174;BA.debugLine="Return Me";
if (true) return this;
 //BA.debugLineNum = 175;BA.debugLine="End Sub";
return null;
}
public String  _jobdone(medicomed.keymon.com.mx.httpjob _job) throws Exception{
medicomed.keymon.com.mx.dbrequestmanager._dbresult _resultado = null;
String _cliente = "";
Object[] _records = null;
String[] _pars = null;
int _piezasexiste = 0;
String _pcnoarts = "";
String _pcmonto = "";
String _k = "";
String _idpreg = "";
String _idresp = "";
 //BA.debugLineNum = 2222;BA.debugLine="Sub JobDone(Job As HttpJob)";
 //BA.debugLineNum = 2224;BA.debugLine="If Job.Success = False Then";
if (_job._success /*boolean*/ ==__c.False) { 
 }else {
 //BA.debugLineNum = 2228;BA.debugLine="If Job.JobName = \"DBRequest\" Then";
if ((_job._jobname /*String*/ ).equals("DBRequest")) { 
 //BA.debugLineNum = 2229;BA.debugLine="Dim resultado As DBResult = reqManager.HandleJo";
_resultado = _reqmanager._handlejob /*medicomed.keymon.com.mx.dbrequestmanager._dbresult*/ (_job);
 //BA.debugLineNum = 2230;BA.debugLine="If resultado.Tag.As(String).IndexOf(\"ins_pedido";
if ((BA.ObjectToString(_resultado.Tag /*Object*/ )).indexOf("ins_pedidosPendientes_head_")>-1) { 
 //BA.debugLineNum = 2231;BA.debugLine="Subs.logJobDoneResultados(resultado)";
_subs._logjobdoneresultados /*String*/ (ba,_resultado);
 //BA.debugLineNum = 2232;BA.debugLine="Private cliente As String= resultado.Tag";
_cliente = BA.ObjectToString(_resultado.Tag /*Object*/ );
 //BA.debugLineNum = 2233;BA.debugLine="cliente = cliente.SubString(cliente.IndexOf(\"_";
_cliente = _cliente.substring((int) (_cliente.indexOf("_")+24));
 //BA.debugLineNum = 2235;BA.debugLine="For Each records() As Object In resultado.Rows";
{
final anywheresoftware.b4a.BA.IterableList group9 = _resultado.Rows /*anywheresoftware.b4a.objects.collections.List*/ ;
final int groupLen9 = group9.getSize()
;int index9 = 0;
;
for (; index9 < groupLen9;index9++){
_records = (Object[])(group9.Get(index9));
 //BA.debugLineNum = 2236;BA.debugLine="If records(resultado.Columns.Get(\"AffectedRow";
if (((int)(BA.ObjectToNumber(_records[(int)(BA.ObjectToNumber(_resultado.Columns /*anywheresoftware.b4a.objects.collections.Map*/ .Get((Object)("AffectedRows"))))])))==1) { 
 //BA.debugLineNum = 2238;BA.debugLine="Private pars() As String = Regex.Split(\"_\",";
_pars = __c.Regex.Split("_",BA.ObjectToString(_resultado.Tag /*Object*/ ));
 //BA.debugLineNum = 2239;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery($\"update";
_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("update PEDIDO_CLIENTE set PC_ENVIO_OK = 1 where PC_CLIENTE = '"+__c.SmartStringFormatter("",(Object)(_pars[(int) (3)]))+"'"));
 };
 }
};
 };
 };
 //BA.debugLineNum = 2249;BA.debugLine="If Job.JobName = \"DBRequest\" Then";
if ((_job._jobname /*String*/ ).equals("DBRequest")) { 
 //BA.debugLineNum = 2250;BA.debugLine="Dim resultado As DBResult = reqManager.HandleJo";
_resultado = _reqmanager._handlejob /*medicomed.keymon.com.mx.dbrequestmanager._dbresult*/ (_job);
 //BA.debugLineNum = 2251;BA.debugLine="If resultado.Tag = \"piezas\" Then 'query tag";
if ((_resultado.Tag /*Object*/ ).equals((Object)("piezas"))) { 
 //BA.debugLineNum = 2253;BA.debugLine="Dim piezasexiste As Int";
_piezasexiste = 0;
 //BA.debugLineNum = 2255;BA.debugLine="For Each records() As Object In resultado.Rows";
{
final anywheresoftware.b4a.BA.IterableList group21 = _resultado.Rows /*anywheresoftware.b4a.objects.collections.List*/ ;
final int groupLen21 = group21.getSize()
;int index21 = 0;
;
for (; index21 < groupLen21;index21++){
_records = (Object[])(group21.Get(index21));
 //BA.debugLineNum = 2257;BA.debugLine="piezasexiste = records(resultado.Columns.Get(";
_piezasexiste = (int)(BA.ObjectToNumber(_records[(int)(BA.ObjectToNumber(_resultado.Columns /*anywheresoftware.b4a.objects.collections.Map*/ .Get((Object)("COUNT(*)"))))]));
 //BA.debugLineNum = 2258;BA.debugLine="Log(piezasexiste)";
__c.LogImpl("754329380",BA.NumberToString(_piezasexiste),0);
 //BA.debugLineNum = 2259;BA.debugLine="DateTime.DateFormat = \"MM/dd/yyyy\"";
__c.DateTime.setDateFormat("MM/dd/yyyy");
 //BA.debugLineNum = 2260;BA.debugLine="DateTime.TimeFormat = \"HH:mm:ss\"";
__c.DateTime.setTimeFormat("HH:mm:ss");
 //BA.debugLineNum = 2261;BA.debugLine="sDate=DateTime.Date(DateTime.Now)";
_sdate = __c.DateTime.Date(__c.DateTime.getNow());
 //BA.debugLineNum = 2262;BA.debugLine="sTime=DateTime.Time(DateTime.Now)";
_stime = __c.DateTime.Time(__c.DateTime.getNow());
 //BA.debugLineNum = 2263;BA.debugLine="If piezasexiste =  0 Then";
if (_piezasexiste==0) { 
 //BA.debugLineNum = 2265;BA.debugLine="Dim PCNoArts As String";
_pcnoarts = "";
 //BA.debugLineNum = 2266;BA.debugLine="Dim PCMonto As String";
_pcmonto = "";
 //BA.debugLineNum = 2267;BA.debugLine="c = skmt.ExecQuery2(\"SELECT * FROM PEDIDO_CL";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_skmt.ExecQuery2("SELECT * FROM PEDIDO_CLIENTE WHERE PC_CLIENTE = ?",new String[]{_la_cuenta.getText()})));
 //BA.debugLineNum = 2269;BA.debugLine="If c.RowCount > 0 Then";
if (_c.getRowCount()>0) { 
 //BA.debugLineNum = 2270;BA.debugLine="c.Position = 0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 2271;BA.debugLine="PCNoArts = c.GetString(\"PC_NOART\")";
_pcnoarts = _c.GetString("PC_NOART");
 //BA.debugLineNum = 2272;BA.debugLine="PCMonto = c.GetString(\"PC_MONTO\")";
_pcmonto = _c.GetString("PC_MONTO");
 };
 }else if(_piezasexiste==1) { 
 //BA.debugLineNum = 2283;BA.debugLine="Dim PCNoArts As String";
_pcnoarts = "";
 //BA.debugLineNum = 2284;BA.debugLine="Dim PCMonto As String";
_pcmonto = "";
 //BA.debugLineNum = 2285;BA.debugLine="c = skmt.ExecQuery2(\"SELECT * FROM PEDIDO_CL";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_skmt.ExecQuery2("SELECT * FROM PEDIDO_CLIENTE WHERE PC_CLIENTE = ?",new String[]{_la_cuenta.getText()})));
 //BA.debugLineNum = 2287;BA.debugLine="If c.RowCount > 0 Then";
if (_c.getRowCount()>0) { 
 //BA.debugLineNum = 2288;BA.debugLine="c.Position = 0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 2289;BA.debugLine="PCNoArts = c.GetString(\"PC_NOART\")";
_pcnoarts = _c.GetString("PC_NOART");
 //BA.debugLineNum = 2290;BA.debugLine="PCMonto = c.GetString(\"PC_MONTO\")";
_pcmonto = _c.GetString("PC_MONTO");
 };
 //BA.debugLineNum = 2292;BA.debugLine="cmd.Initialize";
_cmd.Initialize();
 };
 }
};
 };
 };
 //BA.debugLineNum = 2304;BA.debugLine="If Job.JobName = \"DBRequest\" Then";
if ((_job._jobname /*String*/ ).equals("DBRequest")) { 
 //BA.debugLineNum = 2305;BA.debugLine="Dim resultado As DBResult = reqManager.HandleJo";
_resultado = _reqmanager._handlejob /*medicomed.keymon.com.mx.dbrequestmanager._dbresult*/ (_job);
 //BA.debugLineNum = 2306;BA.debugLine="If resultado.Tag = \"piezasrecarga\" Then 'query";
if ((_resultado.Tag /*Object*/ ).equals((Object)("piezasrecarga"))) { 
 //BA.debugLineNum = 2308;BA.debugLine="Dim piezasexiste As Int";
_piezasexiste = 0;
 //BA.debugLineNum = 2309;BA.debugLine="For Each records() As Object In resultado.Rows";
{
final anywheresoftware.b4a.BA.IterableList group55 = _resultado.Rows /*anywheresoftware.b4a.objects.collections.List*/ ;
final int groupLen55 = group55.getSize()
;int index55 = 0;
;
for (; index55 < groupLen55;index55++){
_records = (Object[])(group55.Get(index55));
 //BA.debugLineNum = 2310;BA.debugLine="piezasexiste = records(resultado.Columns.Get(";
_piezasexiste = (int)(BA.ObjectToNumber(_records[(int)(BA.ObjectToNumber(_resultado.Columns /*anywheresoftware.b4a.objects.collections.Map*/ .Get((Object)("COUNT(*)"))))]));
 //BA.debugLineNum = 2311;BA.debugLine="Log(piezasexiste)";
__c.LogImpl("754329433",BA.NumberToString(_piezasexiste),0);
 //BA.debugLineNum = 2312;BA.debugLine="DateTime.DateFormat = \"MM/dd/yyyy\"";
__c.DateTime.setDateFormat("MM/dd/yyyy");
 //BA.debugLineNum = 2313;BA.debugLine="DateTime.TimeFormat = \"HH:mm:ss\"";
__c.DateTime.setTimeFormat("HH:mm:ss");
 //BA.debugLineNum = 2314;BA.debugLine="sDate=DateTime.Date(DateTime.Now)";
_sdate = __c.DateTime.Date(__c.DateTime.getNow());
 //BA.debugLineNum = 2315;BA.debugLine="sTime=DateTime.Time(DateTime.Now)";
_stime = __c.DateTime.Time(__c.DateTime.getNow());
 //BA.debugLineNum = 2316;BA.debugLine="If piezasexiste =  0 Then";
if (_piezasexiste==0) { 
 //BA.debugLineNum = 2317;BA.debugLine="Dim PCNoArts As String";
_pcnoarts = "";
 //BA.debugLineNum = 2318;BA.debugLine="Dim PCMonto As String";
_pcmonto = "";
 //BA.debugLineNum = 2319;BA.debugLine="c = skmt.ExecQuery2(\"SELECT * FROM PEDIDO_CL";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_skmt.ExecQuery2("SELECT * FROM PEDIDO_CLIENTE WHERE PC_CLIENTE = ?",new String[]{"1"})));
 //BA.debugLineNum = 2320;BA.debugLine="If c.RowCount > 0 Then";
if (_c.getRowCount()>0) { 
 //BA.debugLineNum = 2321;BA.debugLine="c.Position = 0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 2322;BA.debugLine="PCNoArts = c.GetString(\"PC_NOART\")";
_pcnoarts = _c.GetString("PC_NOART");
 //BA.debugLineNum = 2323;BA.debugLine="PCMonto = c.GetString(\"PC_MONTO\")";
_pcmonto = _c.GetString("PC_MONTO");
 };
 }else if(_piezasexiste==1) { 
 //BA.debugLineNum = 2332;BA.debugLine="Dim PCNoArts As String";
_pcnoarts = "";
 //BA.debugLineNum = 2333;BA.debugLine="Dim PCMonto As String";
_pcmonto = "";
 //BA.debugLineNum = 2334;BA.debugLine="c = skmt.ExecQuery2(\"SELECT * FROM PEDIDO_CL";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_skmt.ExecQuery2("SELECT * FROM PEDIDO_CLIENTE WHERE PC_CLIENTE = ?",new String[]{"1"})));
 //BA.debugLineNum = 2335;BA.debugLine="If c.RowCount > 0 Then";
if (_c.getRowCount()>0) { 
 //BA.debugLineNum = 2336;BA.debugLine="c.Position = 0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 2337;BA.debugLine="PCNoArts = c.GetString(\"PC_NOART\")";
_pcnoarts = _c.GetString("PC_NOART");
 //BA.debugLineNum = 2338;BA.debugLine="PCMonto = c.GetString(\"PC_MONTO\")";
_pcmonto = _c.GetString("PC_MONTO");
 };
 };
 }
};
 };
 };
 //BA.debugLineNum = 2369;BA.debugLine="If Job.JobName = \"DBRequest\" Then";
if ((_job._jobname /*String*/ ).equals("DBRequest")) { 
 //BA.debugLineNum = 2370;BA.debugLine="Dim resultado As DBResult = reqManager.HandleJo";
_resultado = _reqmanager._handlejob /*medicomed.keymon.com.mx.dbrequestmanager._dbresult*/ (_job);
 //BA.debugLineNum = 2371;BA.debugLine="If resultado.Tag.As(String).IndexOf(\"ins_abonos";
if ((BA.ObjectToString(_resultado.Tag /*Object*/ )).indexOf("ins_abonosPendientes_")>-1) { 
 //BA.debugLineNum = 2372;BA.debugLine="Private cliente As String= resultado.Tag";
_cliente = BA.ObjectToString(_resultado.Tag /*Object*/ );
 //BA.debugLineNum = 2373;BA.debugLine="cliente = cliente.SubString(cliente.IndexOf(\"_";
_cliente = _cliente.substring((int) (_cliente.indexOf("_")+18));
 //BA.debugLineNum = 2374;BA.debugLine="Log($\"Cliente2:${cliente}\"$)";
__c.LogImpl("754329496",("Cliente2:"+__c.SmartStringFormatter("",(Object)(_cliente))+""),0);
 //BA.debugLineNum = 2375;BA.debugLine="For Each records() As Object In resultado.Rows";
{
final anywheresoftware.b4a.BA.IterableList group90 = _resultado.Rows /*anywheresoftware.b4a.objects.collections.List*/ ;
final int groupLen90 = group90.getSize()
;int index90 = 0;
;
for (; index90 < groupLen90;index90++){
_records = (Object[])(group90.Get(index90));
 //BA.debugLineNum = 2376;BA.debugLine="For Each k As String In resultado.Columns.Key";
{
final anywheresoftware.b4a.BA.IterableList group91 = _resultado.Columns /*anywheresoftware.b4a.objects.collections.Map*/ .Keys();
final int groupLen91 = group91.getSize()
;int index91 = 0;
;
for (; index91 < groupLen91;index91++){
_k = BA.ObjectToString(group91.Get(index91));
 //BA.debugLineNum = 2377;BA.debugLine="Log(resultado.Tag & \": \" & k & \": \" & record";
__c.LogImpl("754329499",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 = 2380;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery($\"UPDATE A";
_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("UPDATE ABONOS set a_enviado = 1  where a_cliente = '"+__c.SmartStringFormatter("",(Object)(_cliente))+"'"));
 };
 };
 //BA.debugLineNum = 2385;BA.debugLine="If Job.JobName = \"DBRequest\" Then";
if ((_job._jobname /*String*/ ).equals("DBRequest")) { 
 //BA.debugLineNum = 2386;BA.debugLine="Dim resultado As DBResult = reqManager.HandleJo";
_resultado = _reqmanager._handlejob /*medicomed.keymon.com.mx.dbrequestmanager._dbresult*/ (_job);
 //BA.debugLineNum = 2387;BA.debugLine="If resultado.Tag.As(String).IndexOf(\"insert_cli";
if ((BA.ObjectToString(_resultado.Tag /*Object*/ )).indexOf("insert_cliente_")>-1) { 
 //BA.debugLineNum = 2388;BA.debugLine="Private cliente As String= resultado.Tag";
_cliente = BA.ObjectToString(_resultado.Tag /*Object*/ );
 //BA.debugLineNum = 2389;BA.debugLine="cliente = cliente.SubString(cliente.IndexOf(\"_";
_cliente = _cliente.substring((int) (_cliente.indexOf("_")+9));
 //BA.debugLineNum = 2390;BA.debugLine="Log($\"Cliente2:${cliente}\"$)";
__c.LogImpl("754329512",("Cliente2:"+__c.SmartStringFormatter("",(Object)(_cliente))+""),0);
 //BA.debugLineNum = 2391;BA.debugLine="For Each records() As Object In resultado.Rows";
{
final anywheresoftware.b4a.BA.IterableList group104 = _resultado.Rows /*anywheresoftware.b4a.objects.collections.List*/ ;
final int groupLen104 = group104.getSize()
;int index104 = 0;
;
for (; index104 < groupLen104;index104++){
_records = (Object[])(group104.Get(index104));
 //BA.debugLineNum = 2392;BA.debugLine="For Each k As String In resultado.Columns.Key";
{
final anywheresoftware.b4a.BA.IterableList group105 = _resultado.Columns /*anywheresoftware.b4a.objects.collections.Map*/ .Keys();
final int groupLen105 = group105.getSize()
;int index105 = 0;
;
for (; index105 < groupLen105;index105++){
_k = BA.ObjectToString(group105.Get(index105));
 //BA.debugLineNum = 2393;BA.debugLine="Log(resultado.Tag & \": \" & k & \": \" & record";
__c.LogImpl("754329515",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 = 2396;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery($\"UPDATE C";
_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("UPDATE CLIENTE_NUEVO set CN_enviado = 1  where CN_ID_CLIENTE = '"+__c.SmartStringFormatter("",(Object)(_cliente))+"'"));
 };
 };
 //BA.debugLineNum = 2401;BA.debugLine="If Job.JobName = \"DBRequest\" Then";
if ((_job._jobname /*String*/ ).equals("DBRequest")) { 
 //BA.debugLineNum = 2402;BA.debugLine="Dim resultado As DBResult = reqManager.HandleJo";
_resultado = _reqmanager._handlejob /*medicomed.keymon.com.mx.dbrequestmanager._dbresult*/ (_job);
 //BA.debugLineNum = 2403;BA.debugLine="If resultado.Tag.As(String).IndexOf(\"insert_cue";
if ((BA.ObjectToString(_resultado.Tag /*Object*/ )).indexOf("insert_cuestionario_")>-1) { 
 //BA.debugLineNum = 2404;BA.debugLine="Private pars() As String = Regex.Split(\"_\", re";
_pars = __c.Regex.Split("_",(BA.ObjectToString(_resultado.Tag /*Object*/ )));
 //BA.debugLineNum = 2405;BA.debugLine="Log($\"${resultado.tag}|${pars(0)}\"$)";
__c.LogImpl("754329527",(""+__c.SmartStringFormatter("",_resultado.Tag /*Object*/ )+"|"+__c.SmartStringFormatter("",(Object)(_pars[(int) (0)]))+""),0);
 //BA.debugLineNum = 2406;BA.debugLine="Log($\"${pars(1)}\"$)";
__c.LogImpl("754329528",(""+__c.SmartStringFormatter("",(Object)(_pars[(int) (1)]))+""),0);
 //BA.debugLineNum = 2407;BA.debugLine="Log($\"${pars(2)}\"$)";
__c.LogImpl("754329529",(""+__c.SmartStringFormatter("",(Object)(_pars[(int) (2)]))+""),0);
 //BA.debugLineNum = 2408;BA.debugLine="Log($\"${pars(3)}\"$)";
__c.LogImpl("754329530",(""+__c.SmartStringFormatter("",(Object)(_pars[(int) (3)]))+""),0);
 //BA.debugLineNum = 2409;BA.debugLine="Log($\"${pars(4)}\"$)";
__c.LogImpl("754329531",(""+__c.SmartStringFormatter("",(Object)(_pars[(int) (4)]))+""),0);
 //BA.debugLineNum = 2410;BA.debugLine="Private cliente As String = pars(2)";
_cliente = _pars[(int) (2)];
 //BA.debugLineNum = 2411;BA.debugLine="Private idPreg As String = pars(3)";
_idpreg = _pars[(int) (3)];
 //BA.debugLineNum = 2412;BA.debugLine="Private idResp As String = pars(4)";
_idresp = _pars[(int) (4)];
 //BA.debugLineNum = 2413;BA.debugLine="Log($\"Cliente2:${cliente}, preg:${idPreg}, res";
__c.LogImpl("754329535",("Cliente2:"+__c.SmartStringFormatter("",(Object)(_cliente))+", preg:"+__c.SmartStringFormatter("",(Object)(_idpreg))+", res:"+__c.SmartStringFormatter("",(Object)(_idresp))+""),0);
 //BA.debugLineNum = 2414;BA.debugLine="For Each records() As Object In resultado.Rows";
{
final anywheresoftware.b4a.BA.IterableList group125 = _resultado.Rows /*anywheresoftware.b4a.objects.collections.List*/ ;
final int groupLen125 = group125.getSize()
;int index125 = 0;
;
for (; index125 < groupLen125;index125++){
_records = (Object[])(group125.Get(index125));
 //BA.debugLineNum = 2415;BA.debugLine="For Each k As String In resultado.Columns.Key";
{
final anywheresoftware.b4a.BA.IterableList group126 = _resultado.Columns /*anywheresoftware.b4a.objects.collections.Map*/ .Keys();
final int groupLen126 = group126.getSize()
;int index126 = 0;
;
for (; index126 < groupLen126;index126++){
_k = BA.ObjectToString(group126.Get(index126));
 //BA.debugLineNum = 2416;BA.debugLine="Log(resultado.Tag & \": \" & k & \": \" & record";
__c.LogImpl("754329538",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 = 2419;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery($\"UPDATE C";
_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("UPDATE CUESTIONARIO set Q_ENVIO_OK = 1  where Q_IDCLIENTE = '"+__c.SmartStringFormatter("",(Object)(_cliente))+"' and Q_IDPREGUNTA='"+__c.SmartStringFormatter("",(Object)(_idpreg))+"' and Q_IDRESPUESTA='"+__c.SmartStringFormatter("",(Object)(_idresp))+"'"));
 };
 };
 //BA.debugLineNum = 2423;BA.debugLine="Job.Release";
_job._release /*String*/ ();
 };
 //BA.debugLineNum = 2426;BA.debugLine="End Sub";
return "";
}
public String  _listview1_itemlongclick(int _position,Object _value) throws Exception{
 //BA.debugLineNum = 567;BA.debugLine="Sub ListView1_ItemLongClick (Position As Int, Valu";
 //BA.debugLineNum = 569;BA.debugLine="End Sub";
return "";
}
public String  _mandapendientes() throws Exception{
String _pcnoarts = "";
String _pcmonto = "";
anywheresoftware.b4a.sql.SQL.CursorWrapper _ab = null;
int _i = 0;
 //BA.debugLineNum = 2032;BA.debugLine="Sub mandaPendientes";
 //BA.debugLineNum = 2034;BA.debugLine="Log(\">>>>>>>  MANDA PENDIENTES\")";
__c.LogImpl("754067202",">>>>>>>  MANDA PENDIENTES",0);
 //BA.debugLineNum = 2035;BA.debugLine="Dim PCNoArts As String";
_pcnoarts = "";
 //BA.debugLineNum = 2036;BA.debugLine="Dim PCMonto As String";
_pcmonto = "";
 //BA.debugLineNum = 2037;BA.debugLine="If usuario <> \"KMTS1\"  Then";
if ((_usuario).equals("KMTS1") == false) { 
 //BA.debugLineNum = 2073;BA.debugLine="Dim ab As Cursor = B4XPages.MainPage.skmt.ExecQu";
_ab = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_ab = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery(("SELECT * from ABONOS where a_enviado is null"))));
 //BA.debugLineNum = 2074;BA.debugLine="Log(ab.RowCount)";
__c.LogImpl("754067242",BA.NumberToString(_ab.getRowCount()),0);
 //BA.debugLineNum = 2075;BA.debugLine="If ab.RowCount > 0 Then";
if (_ab.getRowCount()>0) { 
 //BA.debugLineNum = 2076;BA.debugLine="For i=0 To ab.RowCount -1";
{
final int step8 = 1;
final int limit8 = (int) (_ab.getRowCount()-1);
_i = (int) (0) ;
for (;_i <= limit8 ;_i = _i + step8 ) {
 //BA.debugLineNum = 2077;BA.debugLine="ab.Position = i";
_ab.setPosition(_i);
 //BA.debugLineNum = 2078;BA.debugLine="Dim cmd As DBCommand";
_cmd = new medicomed.keymon.com.mx.dbrequestmanager._dbcommand();
 //BA.debugLineNum = 2079;BA.debugLine="cmd.Initialize";
_cmd.Initialize();
 //BA.debugLineNum = 2080;BA.debugLine="cmd.Name = \"insert_abono_MEDI_V2\"";
_cmd.Name /*String*/  = "insert_abono_MEDI_V2";
 //BA.debugLineNum = 2081;BA.debugLine="cmd.Parameters = Array As Object( ab.GetString";
_cmd.Parameters /*Object[]*/  = new Object[]{(Object)(_ab.GetString("a_usuario")),(Object)(_ab.GetString("a_ruta")),(Object)(_ab.GetString("a_cliente")),(Object)(_ab.GetString("a_abono")),(Object)(_ab.GetString("a_fecha")),(Object)(_almacen)};
 //BA.debugLineNum = 2082;BA.debugLine="reqManager.ExecuteCommand(cmd , $\"ins_abonosPe";
_reqmanager._executecommand /*String*/ (_cmd,(Object)(("ins_abonosPendientes_"+__c.SmartStringFormatter("",(Object)(_ab.GetString("a_cliente")))+"")));
 //BA.debugLineNum = 2083;BA.debugLine="Log($\"ins_abonosPendientes_${ab.GetString(\"a_c";
__c.LogImpl("754067251",("ins_abonosPendientes_"+__c.SmartStringFormatter("",(Object)(_ab.GetString("a_cliente")))+""),0);
 }
};
 };
 //BA.debugLineNum = 2086;BA.debugLine="ab.Close";
_ab.Close();
 };
 //BA.debugLineNum = 2140;BA.debugLine="End Sub";
return "";
}
public String  _mandapendientesrecarga() throws Exception{
String _pcnoarts = "";
String _pcmonto = "";
int _i = 0;
 //BA.debugLineNum = 2142;BA.debugLine="Sub mandaPendientesrecarga";
 //BA.debugLineNum = 2144;BA.debugLine="Log(\">>>>>>>  MANDA PENDIENTES\")";
__c.LogImpl("754132738",">>>>>>>  MANDA PENDIENTES",0);
 //BA.debugLineNum = 2145;BA.debugLine="Dim PCNoArts As String";
_pcnoarts = "";
 //BA.debugLineNum = 2146;BA.debugLine="Dim PCMonto As String";
_pcmonto = "";
 //BA.debugLineNum = 2147;BA.debugLine="If usuario <> \"KMTS1\"  Then";
if ((_usuario).equals("KMTS1") == false) { 
 //BA.debugLineNum = 2148;BA.debugLine="f=B4XPages.MainPage.skmt.ExecQuery(\"select CAT_C";
_f = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select CAT_CL_RUTA from kmt_info")));
 //BA.debugLineNum = 2149;BA.debugLine="f.Position=0";
_f.setPosition((int) (0));
 //BA.debugLineNum = 2150;BA.debugLine="d = skmt.ExecQuery(\"SELECT * FROM PEDIDO_CLIENTE";
_d = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_skmt.ExecQuery("SELECT * FROM PEDIDO_CLIENTE where PC_ENVIO_OK = 0 AND PC_CLIENTE = 1")));
 //BA.debugLineNum = 2151;BA.debugLine="c = skmt.ExecQuery(\"SELECT * FROM PEDIDO_CLIENTE";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_skmt.ExecQuery("SELECT * FROM PEDIDO_CLIENTE where PC_ENVIO_OK = 0 AND PC_CLIENTE = 1")));
 //BA.debugLineNum = 2152;BA.debugLine="Log($\"Pedido_Cliente PENDIENTE: ${c.RowCount}\"$)";
__c.LogImpl("754132746",("Pedido_Cliente PENDIENTE: "+__c.SmartStringFormatter("",(Object)(_c.getRowCount()))+""),0);
 //BA.debugLineNum = 2153;BA.debugLine="If c.RowCount > 0 Then";
if (_c.getRowCount()>0) { 
 //BA.debugLineNum = 2154;BA.debugLine="For i = 0 To c.RowCount - 1";
{
final int step11 = 1;
final int limit11 = (int) (_c.getRowCount()-1);
_i = (int) (0) ;
for (;_i <= limit11 ;_i = _i + step11 ) {
 //BA.debugLineNum = 2155;BA.debugLine="c.Position = i";
_c.setPosition(_i);
 //BA.debugLineNum = 2156;BA.debugLine="Log($\"${c.GetString(\"PC_CLIENTE\")}|${c.GetStri";
__c.LogImpl("754132750",(""+__c.SmartStringFormatter("",(Object)(_c.GetString("PC_CLIENTE")))+"|"+__c.SmartStringFormatter("",(Object)(_c.GetString("PC_FECHA")))+"|"+__c.SmartStringFormatter("",(Object)(_c.GetString("PC_ENVIO_OK")))+"|"),0);
 //BA.debugLineNum = 2157;BA.debugLine="Dim cmd As DBCommand";
_cmd = new medicomed.keymon.com.mx.dbrequestmanager._dbcommand();
 //BA.debugLineNum = 2158;BA.debugLine="cmd.Initialize";
_cmd.Initialize();
 //BA.debugLineNum = 2159;BA.debugLine="cmd.Name = \"insert_pedidos_MEDI_V2\"";
_cmd.Name /*String*/  = "insert_pedidos_MEDI_V2";
 //BA.debugLineNum = 2160;BA.debugLine="cmd.Parameters = Array As Object(\"0\", c.GetStr";
_cmd.Parameters /*Object[]*/  = new Object[]{(Object)("0"),(Object)(_c.GetString("PC_FECHA")),(Object)(_c.GetString("PC_USER")),(Object)(_c.GetString("PC_NOART")),(Object)(_c.GetString("PC_MONTO")),(Object)(_c.GetString("PC_LON")),(Object)(_c.GetString("PC_LAT")),(Object)(_subs._traealmacen /*String*/ (ba)),(Object)(_f.GetString("CAT_CL_RUTA")),(Object)(_c.GetString("PC_COSTO_SIN")),(Object)(_c.GetString("PC_FACTURA"))};
 //BA.debugLineNum = 2161;BA.debugLine="PCNoArts = c.GetString(\"PC_NOART\")";
_pcnoarts = _c.GetString("PC_NOART");
 //BA.debugLineNum = 2162;BA.debugLine="PCMonto = c.GetString(\"PC_MONTO\")";
_pcmonto = _c.GetString("PC_MONTO");
 //BA.debugLineNum = 2164;BA.debugLine="reqManager.ExecuteCommand(cmd , $\"ins_pedidosP";
_reqmanager._executecommand /*String*/ (_cmd,(Object)(("ins_pedidosPendientes_head_"+__c.SmartStringFormatter("",(Object)(_c.GetString("PC_CLIENTE")))+"")));
 }
};
 };
 //BA.debugLineNum = 2167;BA.debugLine="f.Close";
_f.Close();
 //BA.debugLineNum = 2169;BA.debugLine="c = skmt.ExecQuery($\"SELECT PE_ENVIO_OK, PE_CEDI";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_skmt.ExecQuery(("SELECT PE_ENVIO_OK, PE_CEDIS, PE_COSTO_TOT, PE_COSTOU, PE_CANT, PE_PRONOMBRE, PE_PROID, PE_CLIENTE, PE_FECHA, PE_USUARIO, PE_COSTO_SIN, PE_RUTA, PE_DESC, PE_FOLIO, PE_CANTC, PE_BCAJAS FROM PEDIDO where PE_ENVIO_OK <> 1 AND PE_FOLIO = 'RECARGA'"))));
 //BA.debugLineNum = 2170;BA.debugLine="Log($\"Pedido PENDIENTE: ${c.RowCount}\"$)";
__c.LogImpl("754132764",("Pedido PENDIENTE: "+__c.SmartStringFormatter("",(Object)(_c.getRowCount()))+""),0);
 //BA.debugLineNum = 2171;BA.debugLine="If c.RowCount>0 Then";
if (_c.getRowCount()>0) { 
 //BA.debugLineNum = 2172;BA.debugLine="For i=0 To c.RowCount -1";
{
final int step27 = 1;
final int limit27 = (int) (_c.getRowCount()-1);
_i = (int) (0) ;
for (;_i <= limit27 ;_i = _i + step27 ) {
 //BA.debugLineNum = 2173;BA.debugLine="c.Position=i";
_c.setPosition(_i);
 //BA.debugLineNum = 2174;BA.debugLine="Dim cmd As DBCommand";
_cmd = new medicomed.keymon.com.mx.dbrequestmanager._dbcommand();
 //BA.debugLineNum = 2175;BA.debugLine="cmd.Initialize";
_cmd.Initialize();
 //BA.debugLineNum = 2176;BA.debugLine="cmd.Name = \"insert_pedido_MEDI_V2\"";
_cmd.Name /*String*/  = "insert_pedido_MEDI_V2";
 //BA.debugLineNum = 2177;BA.debugLine="cmd.Parameters = Array As Object(C.GetString(\"";
_cmd.Parameters /*Object[]*/  = new Object[]{(Object)(_c.GetString("PE_CEDIS")),(Object)(_almacen),(Object)(_c.GetString("PE_COSTO_TOT")),(Object)(_c.GetString("PE_COSTOU")),(Object)(_c.GetString("PE_CANT")),(Object)(_c.GetString("PE_PRONOMBRE")),(Object)(_c.GetString("PE_PROID")),(Object)("0"),(Object)(_c.GetString("PE_FECHA")),(Object)(_c.GetString("PE_USUARIO")),(Object)(_c.GetString("PE_RUTA")),(Object)(_c.GetString("PE_COSTO_SIN")),(Object)(_c.GetString("PE_DESC")),(Object)("ABORDO"),(Object)(_c.GetString("PE_CANTC")),(Object)(_c.GetString("PE_BCAJAS")),(Object)("RECARGA")};
 //BA.debugLineNum = 2178;BA.debugLine="reqManager.ExecuteCommand(cmd , $\"ins_pedidosP";
_reqmanager._executecommand /*String*/ (_cmd,(Object)(("ins_pedidosPendientes_prods_"+__c.SmartStringFormatter("",(Object)(_c.GetString("PE_CLIENTE")))+"_"+__c.SmartStringFormatter("",(Object)(_c.GetString("PE_PROID")))+"")));
 //BA.debugLineNum = 2179;BA.debugLine="Log($\">>>>  INS_PEDIDO= ${C.GetString(\"PE_CEDI";
__c.LogImpl("754132773",(">>>>  INS_PEDIDO= "+__c.SmartStringFormatter("",(Object)(_c.GetString("PE_CEDIS")))+","+__c.SmartStringFormatter("",(Object)(_almacen))+","+__c.SmartStringFormatter("",(Object)(_c.GetString("PE_COSTO_TOT")))+","+__c.SmartStringFormatter("",(Object)(_c.GetString("PE_COSTOU")))+","+__c.SmartStringFormatter("",(Object)(_c.GetString("PE_CANT")))+", "+__c.SmartStringFormatter("",(Object)(_c.GetString("PE_PRONOMBRE")))+", "+__c.SmartStringFormatter("",(Object)(_c.GetString("PE_PROID")))+", "+__c.SmartStringFormatter("",(Object)(_c.GetString("PE_CLIENTE")))+", "+__c.SmartStringFormatter("",(Object)(_c.GetString("PE_FECHA")))+", "+__c.SmartStringFormatter("",(Object)(_c.GetString("PE_USUARIO")))+", "+__c.SmartStringFormatter("",(Object)(_c.GetString("PE_RUTA")))+", "+__c.SmartStringFormatter("",(Object)(_c.GetString("PE_COSTO_SIN")))+", "+__c.SmartStringFormatter("",(Object)(_c.GetString("PE_DESC")))+", "+__c.SmartStringFormatter("",(Object)(_c.GetString("PE_FOLIO")))+", "+__c.SmartStringFormatter("",(Object)(_pcnoarts))+", "+__c.SmartStringFormatter("",(Object)(_pcmonto))+""),0);
 }
};
 };
 };
 //BA.debugLineNum = 2185;BA.debugLine="End Sub";
return "";
}
public String  _mandapiezas() throws Exception{
 //BA.debugLineNum = 2204;BA.debugLine="Sub mandapiezas";
 //BA.debugLineNum = 2220;BA.debugLine="End Sub";
return "";
}
public String  _mandapiezasrecarga() throws Exception{
 //BA.debugLineNum = 2187;BA.debugLine="Sub mandapiezasrecarga";
 //BA.debugLineNum = 2202;BA.debugLine="End Sub";
return "";
}
public String  _mods() throws Exception{
 //BA.debugLineNum = 1;BA.debugLine="Sub MODS 'ignore";
 //BA.debugLineNum = 3;BA.debugLine="End Sub";
return "";
}
public String  _nuevo_click() throws Exception{
 //BA.debugLineNum = 1116;BA.debugLine="Sub NUEVO_Click";
 //BA.debugLineNum = 1117;BA.debugLine="B4XPages.ShowPage(\"NuevoCliente\")";
_b4xpages._showpage /*String*/ (ba,"NuevoCliente");
 //BA.debugLineNum = 1118;BA.debugLine="End Sub";
return "";
}
public String  _p_abono_click() throws Exception{
 //BA.debugLineNum = 2428;BA.debugLine="Private Sub p_abono_Click";
 //BA.debugLineNum = 2430;BA.debugLine="End Sub";
return "";
}
public String  _p_cliente_click() throws Exception{
 //BA.debugLineNum = 2023;BA.debugLine="Private Sub p_cliente_Click";
 //BA.debugLineNum = 2025;BA.debugLine="End Sub";
return "";
}
public String  _p_transparenteiniciofin_click() throws Exception{
 //BA.debugLineNum = 2737;BA.debugLine="Private Sub p_transparenteInicioFin_Click";
 //BA.debugLineNum = 2739;BA.debugLine="End Sub";
return "";
}
public String  _printer_connected(boolean _success) throws Exception{
 //BA.debugLineNum = 1865;BA.debugLine="Sub Printer_Connected (Success As Boolean)";
 //BA.debugLineNum = 1866;BA.debugLine="If Success Then";
if (_success) { 
 //BA.debugLineNum = 1867;BA.debugLine="B_IMP.Enabled = True";
_b_imp.setEnabled(__c.True);
 }else {
 //BA.debugLineNum = 1869;BA.debugLine="B_IMP.Enabled = False";
_b_imp.setEnabled(__c.False);
 //BA.debugLineNum = 1870;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 = 1871;BA.debugLine="StartPrinter";
_startprinter();
 };
 };
 //BA.debugLineNum = 1874;BA.debugLine="End Sub";
return "";
}
public String  _printer1_connected(boolean _success) throws Exception{
 //BA.debugLineNum = 1842;BA.debugLine="Sub Printer1_Connected (Success As Boolean)";
 //BA.debugLineNum = 1844;BA.debugLine="If Success Then";
if (_success) { 
 //BA.debugLineNum = 1845;BA.debugLine="ToastMessageShow(\"Impresora conectada\", False)";
__c.ToastMessageShow(BA.ObjectToCharSequence("Impresora conectada"),__c.False);
 //BA.debugLineNum = 1846;BA.debugLine="skmt.ExecNonQuery2(\"delete from CAT_VARIABLES wh";
_skmt.ExecNonQuery2("delete from CAT_VARIABLES where CAT_VA_DESCRIPCION = ?",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)("MACIMP")}));
 //BA.debugLineNum = 1847;BA.debugLine="skmt.ExecNonQuery2(\"INSERT INTO CAT_VARIABLES(CA";
_skmt.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 = 1848;BA.debugLine="LogColor(\"Impresora conectada\", Colors.Green)";
__c.LogImpl("753280774","Impresora conectada",__c.Colors.Green);
 //BA.debugLineNum = 1850;BA.debugLine="impresoraConectada = True";
_impresoraconectada = __c.True;
 //BA.debugLineNum = 1851;BA.debugLine="siimprimio = 1";
_siimprimio = BA.NumberToString(1);
 }else {
 //BA.debugLineNum = 1855;BA.debugLine="LogColor(\"Error conectando la impresora\", Colors";
__c.LogImpl("753280781","Error conectando la impresora",__c.Colors.Red);
 //BA.debugLineNum = 1856;BA.debugLine="errorImpresora = errorImpresora + 1";
_errorimpresora = (int) (_errorimpresora+1);
 //BA.debugLineNum = 1857;BA.debugLine="If errorImpresora > 1 Then";
if (_errorimpresora>1) { 
 //BA.debugLineNum = 1858;BA.debugLine="Starter.MAC_IMPRESORA = \"0\"";
_starter._mac_impresora /*String*/  = "0";
 //BA.debugLineNum = 1859;BA.debugLine="errorImpresora = 0";
_errorimpresora = (int) (0);
 };
 //BA.debugLineNum = 1861;BA.debugLine="siimprimio = 0";
_siimprimio = BA.NumberToString(0);
 };
 //BA.debugLineNum = 1863;BA.debugLine="End Sub";
return "";
}
public String  _rb1_checkedchange(boolean _checked) throws Exception{
 //BA.debugLineNum = 1980;BA.debugLine="Sub RB1_CheckedChange(Checked As Boolean)";
 //BA.debugLineNum = 1981;BA.debugLine="If RB1.Checked = True Then";
if (_rb1.getChecked()==__c.True) { 
 //BA.debugLineNum = 1982;BA.debugLine="E_RES_E.Text = \"CENTRAL DE ABASTOS\"";
_e_res_e.setText(BA.ObjectToCharSequence("CENTRAL DE ABASTOS"));
 };
 //BA.debugLineNum = 1984;BA.debugLine="End Sub";
return "";
}
public String  _rb2_checkedchange(boolean _checked) throws Exception{
 //BA.debugLineNum = 1986;BA.debugLine="Sub RB2_CheckedChange(Checked As Boolean)";
 //BA.debugLineNum = 1987;BA.debugLine="If RB2.Checked = True Then";
if (_rb2.getChecked()==__c.True) { 
 //BA.debugLineNum = 1988;BA.debugLine="E_RES_E.Text = \"AUTOSERVICIO\"";
_e_res_e.setText(BA.ObjectToCharSequence("AUTOSERVICIO"));
 };
 //BA.debugLineNum = 1990;BA.debugLine="End Sub";
return "";
}
public String  _rb3_checkedchange(boolean _checked) throws Exception{
 //BA.debugLineNum = 1992;BA.debugLine="Sub RB3_CheckedChange(Checked As Boolean)";
 //BA.debugLineNum = 1993;BA.debugLine="If RB3.Checked = True Then";
if (_rb3.getChecked()==__c.True) { 
 //BA.debugLineNum = 1994;BA.debugLine="E_RES_E.Text = \"CLUB DE PRECIO\"";
_e_res_e.setText(BA.ObjectToCharSequence("CLUB DE PRECIO"));
 };
 //BA.debugLineNum = 1996;BA.debugLine="End Sub";
return "";
}
public String  _rb4_checkedchange(boolean _checked) throws Exception{
 //BA.debugLineNum = 1998;BA.debugLine="Sub RB4_CheckedChange(Checked As Boolean)";
 //BA.debugLineNum = 1999;BA.debugLine="If RB4.Checked = True Then";
if (_rb4.getChecked()==__c.True) { 
 //BA.debugLineNum = 2000;BA.debugLine="E_RES_E.Text = \"DIRECTO PEDEGREE\"";
_e_res_e.setText(BA.ObjectToCharSequence("DIRECTO PEDEGREE"));
 };
 //BA.debugLineNum = 2002;BA.debugLine="End Sub";
return "";
}
public void  _sc_result(String _atype,String _values,anywheresoftware.b4a.objects.drawable.CanvasWrapper.BitmapWrapper _image) throws Exception{
ResumableSub_sc_result rsub = new ResumableSub_sc_result(this,_atype,_values,_image);
rsub.resume(ba, null);
}
public static class ResumableSub_sc_result extends BA.ResumableSub {
public ResumableSub_sc_result(medicomed.keymon.com.mx.c_cliente parent,String _atype,String _values,anywheresoftware.b4a.objects.drawable.CanvasWrapper.BitmapWrapper _image) {
this.parent = parent;
this._atype = _atype;
this._values = _values;
this._image = _image;
}
medicomed.keymon.com.mx.c_cliente parent;
String _atype;
String _values;
anywheresoftware.b4a.objects.drawable.CanvasWrapper.BitmapWrapper _image;
int _resultado = 0;

@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 = 1137;BA.debugLine="CODIGO = Values";
parent._codigo = _values;
 //BA.debugLineNum = 1138;BA.debugLine="DD=B4XPages.MainPage.skmt.ExecQuery2(\"SELECT COUN";
parent._dd = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(parent._b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery2("SELECT COUNT(*) AS CUANTOS FROM kmt_info WHERE CAT_CL_NUM_SERIEFISICO = ?",new String[]{parent._codigo})));
 //BA.debugLineNum = 1139;BA.debugLine="DD.Position =0";
parent._dd.setPosition((int) (0));
 //BA.debugLineNum = 1140;BA.debugLine="If DD.GetString(\"CUANTOS\") > 0 Then";
if (true) break;

case 1:
//if
this.state = 16;
if ((double)(Double.parseDouble(parent._dd.GetString("CUANTOS")))>0) { 
this.state = 3;
}else {
this.state = 5;
}if (true) break;

case 3:
//C
this.state = 16;
 //BA.debugLineNum = 1141;BA.debugLine="MsgboxAsync(\"Código ya asignado\", \"AVISO\")";
parent.__c.MsgboxAsync(BA.ObjectToCharSequence("Código ya asignado"),BA.ObjectToCharSequence("AVISO"),ba);
 if (true) break;

case 5:
//C
this.state = 6;
 //BA.debugLineNum = 1143;BA.debugLine="If CODIGO.Length = 7 Then";
if (true) break;

case 6:
//if
this.state = 15;
if (parent._codigo.length()==7) { 
this.state = 8;
}else {
this.state = 14;
}if (true) break;

case 8:
//C
this.state = 9;
 //BA.debugLineNum = 1144;BA.debugLine="Msgbox2Async(\"El código \"& CODIGO & \" es correc";
parent.__c.Msgbox2Async(BA.ObjectToCharSequence("El código "+parent._codigo+" es correcto?"),BA.ObjectToCharSequence("Title"),"Yes","Cancel","No",(anywheresoftware.b4a.objects.drawable.CanvasWrapper.BitmapWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.drawable.CanvasWrapper.BitmapWrapper(), (android.graphics.Bitmap)(parent.__c.Null)),ba,parent.__c.False);
 //BA.debugLineNum = 1145;BA.debugLine="Wait For Msgbox_Result (resultado As Int)";
parent.__c.WaitFor("msgbox_result", ba, this, null);
this.state = 17;
return;
case 17:
//C
this.state = 9;
_resultado = (Integer) result[0];
;
 //BA.debugLineNum = 1146;BA.debugLine="If resultado = DialogResponse.POSITIVE Then";
if (true) break;

case 9:
//if
this.state = 12;
if (_resultado==parent.__c.DialogResponse.POSITIVE) { 
this.state = 11;
}if (true) break;

case 11:
//C
this.state = 12;
 //BA.debugLineNum = 1147;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"UPDATE k";
parent._b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("UPDATE kmt_info set CAT_CL_NUM_SERIEFISICO = ?, CAT_CL_LONG = ?, CAT_CL_LAT =? where CAT_CL_CODIGO In (select cuenta from cuentaa)",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(parent._codigo),(Object)(parent._b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._lon_gps /*String*/ ),(Object)(parent._b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._lat_gps /*String*/ )}));
 //BA.debugLineNum = 1148;BA.debugLine="L_QR.TEXT =CODIGO";
parent._l_qr.setText(BA.ObjectToCharSequence(parent._codigo));
 //BA.debugLineNum = 1149;BA.debugLine="L_QR.TextColor = Colors.Blue";
parent._l_qr.setTextColor(parent.__c.Colors.Blue);
 //BA.debugLineNum = 1150;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"insert i";
parent._b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("insert into HIST_CODIGO_BARRAS(CODIGOKMTS, CODIGOB, LAT, LON) VALUES (?,?,?,?)",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(parent._la_cuenta.getText()),(Object)(parent._codigo),(Object)(parent._b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._lon_gps /*String*/ ),(Object)(parent._b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._lat_gps /*String*/ )}));
 if (true) break;

case 12:
//C
this.state = 15;
;
 if (true) break;

case 14:
//C
this.state = 15;
 //BA.debugLineNum = 1153;BA.debugLine="MsgboxAsync(\"Código No Valido\", \"AVISO\")";
parent.__c.MsgboxAsync(BA.ObjectToCharSequence("Código No Valido"),BA.ObjectToCharSequence("AVISO"),ba);
 if (true) break;

case 15:
//C
this.state = 16;
;
 if (true) break;

case 16:
//C
this.state = -1;
;
 //BA.debugLineNum = 1156;BA.debugLine="DD.Close";
parent._dd.Close();
 //BA.debugLineNum = 1157;BA.debugLine="End Sub";
if (true) break;

            }
        }
    }
}
public String  _sc_timedout(boolean _timedout) throws Exception{
 //BA.debugLineNum = 1159;BA.debugLine="Sub sc_timedout(timedOut As Boolean)";
 //BA.debugLineNum = 1160;BA.debugLine="Log(\"timedOut \" & timedOut)";
__c.LogImpl("752756481","timedOut "+BA.ObjectToString(_timedout),0);
 //BA.debugLineNum = 1161;BA.debugLine="End Sub";
return "";
}
public String  _sc_usercancelled(boolean _usercancelled) throws Exception{
 //BA.debugLineNum = 1163;BA.debugLine="Sub sc_usercancelled(userCancelled As Boolean)";
 //BA.debugLineNum = 1164;BA.debugLine="Log(\"userCancelled \" & userCancelled)";
__c.LogImpl("752822017","userCancelled "+BA.ObjectToString(_usercancelled),0);
 //BA.debugLineNum = 1165;BA.debugLine="End Sub";
return "";
}
public String  _startprinter() throws Exception{
int _resimp = 0;
int _i = 0;
 //BA.debugLineNum = 1876;BA.debugLine="Sub StartPrinter";
 //BA.debugLineNum = 1877;BA.debugLine="Dim PairedDevices As Map";
_paireddevices = new anywheresoftware.b4a.objects.collections.Map();
 //BA.debugLineNum = 1878;BA.debugLine="Dim L As List";
_l = new anywheresoftware.b4a.objects.collections.List();
 //BA.debugLineNum = 1879;BA.debugLine="Dim resimp As Int";
_resimp = 0;
 //BA.debugLineNum = 1880;BA.debugLine="ToastMessageShow(\"Printing.....\",True)";
__c.ToastMessageShow(BA.ObjectToCharSequence("Printing....."),__c.True);
 //BA.debugLineNum = 1881;BA.debugLine="PairedDevices.Initialize";
_paireddevices.Initialize();
 //BA.debugLineNum = 1882;BA.debugLine="Try";
try { //BA.debugLineNum = 1883;BA.debugLine="PairedDevices = cmp20.GetPairedDevices";
_paireddevices = _cmp20.GetPairedDevices();
 } 
       catch (Exception e9) {
			ba.setLastException(e9); //BA.debugLineNum = 1885;BA.debugLine="Msgbox(\"Getting Paired Devices\",\"Printer Error\")";
__c.Msgbox(BA.ObjectToCharSequence("Getting Paired Devices"),BA.ObjectToCharSequence("Printer Error"),ba);
 //BA.debugLineNum = 1886;BA.debugLine="printer.Close";
_printer.Close();
 //BA.debugLineNum = 1887;BA.debugLine="cmp20.Disconnect";
_cmp20.Disconnect();
 };
 //BA.debugLineNum = 1889;BA.debugLine="If PairedDevices.Size = 0 Then";
if (_paireddevices.getSize()==0) { 
 //BA.debugLineNum = 1890;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 = 1891;BA.debugLine="Return";
if (true) return "";
 };
 //BA.debugLineNum = 1893;BA.debugLine="If PairedDevices.Size = 1 Then";
if (_paireddevices.getSize()==1) { 
 //BA.debugLineNum = 1894;BA.debugLine="Try";
try { //BA.debugLineNum = 1895;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 = 1897;BA.debugLine="Msgbox(\"Connecting\",\"Printer Error\") 'Ignore";
__c.Msgbox(BA.ObjectToCharSequence("Connecting"),BA.ObjectToCharSequence("Printer Error"),ba);
 //BA.debugLineNum = 1898;BA.debugLine="printer.Close";
_printer.Close();
 //BA.debugLineNum = 1899;BA.debugLine="cmp20.Disconnect";
_cmp20.Disconnect();
 };
 }else {
 //BA.debugLineNum = 1902;BA.debugLine="L.Initialize";
_l.Initialize();
 //BA.debugLineNum = 1903;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 = 1904;BA.debugLine="L.Add(PairedDevices.GetKeyAt(i))";
_l.Add(_paireddevices.GetKeyAt(_i));
 }
};
 //BA.debugLineNum = 1906;BA.debugLine="resimp = InputList(L, \"Choose device\", -1) 'Igno";
_resimp = __c.InputList(_l,BA.ObjectToCharSequence("Choose device"),(int) (-1),ba);
 //BA.debugLineNum = 1907;BA.debugLine="If resimp <> DialogResponse.CANCEL Then";
if (_resimp!=__c.DialogResponse.CANCEL) { 
 //BA.debugLineNum = 1908;BA.debugLine="cmp20.Connect(PairedDevices.Get(L.Get(resimp)))";
_cmp20.Connect(ba,BA.ObjectToString(_paireddevices.Get(_l.Get(_resimp))));
 };
 };
 //BA.debugLineNum = 1911;BA.debugLine="End Sub";
return "";
}
public String  _t1_tick() throws Exception{
 //BA.debugLineNum = 1205;BA.debugLine="Sub t1_tick";
 //BA.debugLineNum = 1206;BA.debugLine="s = skmt.ExecQuery2(\"SELECT * FROM PEDIDO WHERE P";
_s = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_skmt.ExecQuery2("SELECT * FROM PEDIDO WHERE PE_FOLIO = ? AND PE_CLIENTE IN (SELECT CUENTA FROM CUENTAA)",new String[]{"PREVENTA"})));
 //BA.debugLineNum = 1207;BA.debugLine="If s.RowCount > 0 Then";
if (_s.getRowCount()>0) { 
 //BA.debugLineNum = 1208;BA.debugLine="imprime_preventa";
_imprime_preventa();
 };
 //BA.debugLineNum = 1210;BA.debugLine="t1.Enabled = False";
_t1.setEnabled(__c.False);
 //BA.debugLineNum = 1211;BA.debugLine="End Sub";
return "";
}
public String  _tar_click() throws Exception{
 //BA.debugLineNum = 672;BA.debugLine="Sub Tar_Click";
 //BA.debugLineNum = 673;BA.debugLine="B4XPages.ShowPage(\"Nota\")";
_b4xpages._showpage /*String*/ (ba,"Nota");
 //BA.debugLineNum = 674;BA.debugLine="End Sub";
return "";
}
public String  _tels_click() throws Exception{
 //BA.debugLineNum = 614;BA.debugLine="Sub Tels_Click";
 //BA.debugLineNum = 615;BA.debugLine="B4XPages.ShowPage(\"NoVenta\")";
_b4xpages._showpage /*String*/ (ba,"NoVenta");
 //BA.debugLineNum = 616;BA.debugLine="End Sub";
return "";
}
public Object callSub(String sub, Object sender, Object[] args) throws Exception {
BA.senderHolder.set(sender);
if (BA.fastSubCompare(sub, "GPS_LOCATIONCHANGED"))
	return _gps_locationchanged((anywheresoftware.b4a.gps.LocationWrapper) args[0]);
if (BA.fastSubCompare(sub, "JOBDONE"))
	return _jobdone((medicomed.keymon.com.mx.httpjob) args[0]);
return BA.SubDelegator.SubNotFound;
}
}
