package adm.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, "adm.keymon.com.mx.c_cliente");
            if (htSubs == null) {
                ba.loadHtSubs(this.getClass());
                htSubs = ba.htSubs;
            }
            
        }
        if (BA.isShellModeRuntimeCheck(ba)) 
			   this.getClass().getMethod("_class_globals", adm.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 adm.keymon.com.mx.dbrequestmanager _reqmanager = null;
public adm.keymon.com.mx.dbrequestmanager._dbcommand _cmd = null;
public anywheresoftware.b4a.objects.IME _ime = null;
public adm.keymon.com.mx.fileprovider _provider = 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 adm.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 adm.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 anywheresoftware.b4a.objects.PanelWrapper _p_camara = null;
public anywheresoftware.b4a.objects.PanelWrapper _p_cam = null;
public anywheresoftware.b4a.objects.ButtonWrapper _b_foto_inci = null;
public adm.keymon.com.mx.cameraexclass _camex = null;
public boolean _frontcamera = false;
public String _fototomada = "";
public anywheresoftware.b4a.objects.PanelWrapper _p_tipopago = null;
public anywheresoftware.b4a.objects.CompoundButtonWrapper.RadioButtonWrapper _rb_efectivo = null;
public anywheresoftware.b4a.objects.CompoundButtonWrapper.RadioButtonWrapper _rb_tranfe = null;
public anywheresoftware.b4a.objects.CompoundButtonWrapper.RadioButtonWrapper _rb_tarjetadebito = null;
public anywheresoftware.b4a.objects.CompoundButtonWrapper.RadioButtonWrapper _rb_tarjetacredito = null;
public anywheresoftware.b4a.objects.EditTextWrapper _et_com_tp = null;
public anywheresoftware.b4a.objects.ButtonWrapper _b_cancel_tp = null;
public anywheresoftware.b4a.objects.ButtonWrapper _b_acept_tp = null;
public anywheresoftware.b4a.objects.CompoundButtonWrapper.CheckBoxWrapper _chb_impreso = null;
public String _nombrepdf = "";
public b4a.example.dateutils _dateutils = null;
public adm.keymon.com.mx.main _main = null;
public adm.keymon.com.mx.appupdater _appupdater = null;
public adm.keymon.com.mx.mapa_rutas _mapa_rutas = null;
public adm.keymon.com.mx.notificationservice _notificationservice = null;
public adm.keymon.com.mx.pendientes _pendientes = null;
public adm.keymon.com.mx.starter _starter = null;
public adm.keymon.com.mx.subs _subs = null;
public adm.keymon.com.mx.tracker _tracker = null;
public adm.keymon.com.mx.newinst2 _newinst2 = null;
public adm.keymon.com.mx.b4xpages _b4xpages = null;
public adm.keymon.com.mx.b4xcollections _b4xcollections = null;
public adm.keymon.com.mx.httputils2service _httputils2service = null;
public adm.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(adm.keymon.com.mx.c_cliente parent) {
this.parent = parent;
}
adm.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 = 2627;BA.debugLine="p_abono.Visible = False";
parent._p_abono.setVisible(parent.__c.False);
 //BA.debugLineNum = 2628;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 = 2629;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 = 2631;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 = 2632;BA.debugLine="Msgbox2Async($\"¿Seguro que quieres realizar un a";
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 = 2633;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 = 2634;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 = 2635;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.__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 = 2636;BA.debugLine="ToastMessageShow(\"Abono guardado\", False)";
parent.__c.ToastMessageShow(BA.ObjectToCharSequence("Abono guardado"),parent.__c.False);
 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 = 2640;BA.debugLine="et_abono.Text = \"\"";
parent._et_abono.setText(BA.ObjectToCharSequence(""));
 //BA.debugLineNum = 2641;BA.debugLine="ime.HideKeyboard";
parent._ime.HideKeyboard(ba);
 //BA.debugLineNum = 2642;BA.debugLine="End Sub";
if (true) break;

            }
        }
    }
}
public void  _msgbox_result(int _resultado) throws Exception{
}
public String  _b_abono1_click() throws Exception{
 //BA.debugLineNum = 2650;BA.debugLine="Private Sub b_abono1_Click";
 //BA.debugLineNum = 2651;BA.debugLine="p_abono.Visible = True";
_p_abono.setVisible(__c.True);
 //BA.debugLineNum = 2652;BA.debugLine="End Sub";
return "";
}
public void  _b_acept_tp_click() throws Exception{
ResumableSub_b_acept_tp_Click rsub = new ResumableSub_b_acept_tp_Click(this);
rsub.resume(ba, null);
}
public static class ResumableSub_b_acept_tp_Click extends BA.ResumableSub {
public ResumableSub_b_acept_tp_Click(adm.keymon.com.mx.c_cliente parent) {
this.parent = parent;
}
adm.keymon.com.mx.c_cliente parent;
String _metopago = "";
String _pdffilename = "";
anywheresoftware.b4a.phone.Phone.Email _email = null;
anywheresoftware.b4a.objects.IntentWrapper _in = null;

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

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

case 0:
//C
this.state = 1;
 //BA.debugLineNum = 3136;BA.debugLine="If rb_efectivo.Checked Or rb_tranfe.Checked Or rb";
if (true) break;

case 1:
//if
this.state = 28;
if (parent._rb_efectivo.getChecked() || parent._rb_tranfe.getChecked() || parent._rb_tarjetacredito.getChecked() || parent._rb_tarjetadebito.getChecked()) { 
this.state = 3;
}else {
this.state = 27;
}if (true) break;

case 3:
//C
this.state = 4;
 //BA.debugLineNum = 3138;BA.debugLine="Dim metopago As String";
_metopago = "";
 //BA.debugLineNum = 3139;BA.debugLine="If rb_efectivo.Checked Then";
if (true) break;

case 4:
//if
this.state = 13;
if (parent._rb_efectivo.getChecked()) { 
this.state = 6;
}else if(parent._rb_tranfe.getChecked()) { 
this.state = 8;
}else if(parent._rb_tarjetadebito.getChecked()) { 
this.state = 10;
}else if(parent._rb_tarjetacredito.getChecked()) { 
this.state = 12;
}if (true) break;

case 6:
//C
this.state = 13;
 //BA.debugLineNum = 3140;BA.debugLine="metopago = \"EFECTIVO\"";
_metopago = "EFECTIVO";
 if (true) break;

case 8:
//C
this.state = 13;
 //BA.debugLineNum = 3142;BA.debugLine="metopago = \"TRANSFERENCIA\"";
_metopago = "TRANSFERENCIA";
 if (true) break;

case 10:
//C
this.state = 13;
 //BA.debugLineNum = 3144;BA.debugLine="metopago = \"TARJETA DE DEBITO\"";
_metopago = "TARJETA DE DEBITO";
 if (true) break;

case 12:
//C
this.state = 13;
 //BA.debugLineNum = 3146;BA.debugLine="metopago = \"TARJETA DE CREDITO\"";
_metopago = "TARJETA DE CREDITO";
 if (true) break;

case 13:
//C
this.state = 14;
;
 //BA.debugLineNum = 3149;BA.debugLine="Guardar.Enabled = True";
parent._guardar.setEnabled(parent.__c.True);
 //BA.debugLineNum = 3150;BA.debugLine="gest.Enabled = True";
parent._gest.setEnabled(parent.__c.True);
 //BA.debugLineNum = 3151;BA.debugLine="b_cxc.Enabled = True";
parent._b_cxc.setEnabled(parent.__c.True);
 //BA.debugLineNum = 3152;BA.debugLine="Tar.Enabled = True";
parent._tar.setEnabled(parent.__c.True);
 //BA.debugLineNum = 3153;BA.debugLine="Tels.Enabled = True";
parent._tels.setEnabled(parent.__c.True);
 //BA.debugLineNum = 3154;BA.debugLine="b_ventaabordo.Enabled = True";
parent._b_ventaabordo.setEnabled(parent.__c.True);
 //BA.debugLineNum = 3155;BA.debugLine="HIST.Enabled = True";
parent._hist.setEnabled(parent.__c.True);
 //BA.debugLineNum = 3156;BA.debugLine="banderaimp = 1";
parent._banderaimp = (int) (1);
 //BA.debugLineNum = 3158;BA.debugLine="If chb_impreso.Checked Then";
if (true) break;

case 14:
//if
this.state = 25;
if (parent._chb_impreso.getChecked()) { 
this.state = 16;
}else {
this.state = 24;
}if (true) break;

case 16:
//C
this.state = 17;
 //BA.debugLineNum = 3160;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"update PE";
parent._b4xpages._mainpage /*adm.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("update PEDIDO set PE_TIPOPAGO = ?, PE_COMENTARIO = ?, PE_TICKET = ? where PE_CLIENTE IN (SELECT CUENTA FROM CUENTAA) ",anywheresoftware.b4a.keywords.Common.ArrayToList(new String[]{_metopago,parent._et_com_tp.getText(),"CORREO"}));
 //BA.debugLineNum = 3164;BA.debugLine="PDFGENERAR";
parent._pdfgenerar();
 //BA.debugLineNum = 3167;BA.debugLine="Sleep(500)";
parent.__c.Sleep(ba,this,(int) (500));
this.state = 29;
return;
case 29:
//C
this.state = 17;
;
 //BA.debugLineNum = 3170;BA.debugLine="Dim pdfFileName As String =nombrepdf";
_pdffilename = parent._nombrepdf;
 //BA.debugLineNum = 3173;BA.debugLine="Log(xui.DefaultFolder)";
parent.__c.LogImpl("345154342",parent._xui.getDefaultFolder(),0);
 //BA.debugLineNum = 3174;BA.debugLine="Log(nombrepdf)";
parent.__c.LogImpl("345154343",parent._nombrepdf,0);
 //BA.debugLineNum = 3175;BA.debugLine="If File.Exists(Starter.fFileProvider.SharedFold";
if (true) break;

case 17:
//if
this.state = 22;
if (parent.__c.File.Exists(parent._starter._ffileprovider /*adm.keymon.com.mx.fileprovider*/ ._sharedfolder /*String*/ ,_pdffilename)) { 
this.state = 19;
}else {
this.state = 21;
}if (true) break;

case 19:
//C
this.state = 22;
 //BA.debugLineNum = 3177;BA.debugLine="Dim email As Email";
_email = new anywheresoftware.b4a.phone.Phone.Email();
 //BA.debugLineNum = 3179;BA.debugLine="email.Subject = \"Adjunto encontrará el ticket";
_email.Subject = "Adjunto encontrará el ticket de venta";
 //BA.debugLineNum = 3180;BA.debugLine="email.Attachments.Add(Provider.GetFileUri(pdfF";
_email.Attachments.Add(parent._provider._getfileuri /*Object*/ (_pdffilename));
 //BA.debugLineNum = 3182;BA.debugLine="Dim in As Intent = email.GetIntent";
_in = new anywheresoftware.b4a.objects.IntentWrapper();
_in = (anywheresoftware.b4a.objects.IntentWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.IntentWrapper(), (android.content.Intent)(_email.GetIntent()));
 //BA.debugLineNum = 3183;BA.debugLine="in.Flags = 1 'FLAG_GRANT_READ_URI_PERMISSION";
_in.setFlags((int) (1));
 //BA.debugLineNum = 3184;BA.debugLine="StartActivity(in)";
parent.__c.StartActivity(ba,(Object)(_in.getObject()));
 if (true) break;

case 21:
//C
this.state = 22;
 //BA.debugLineNum = 3187;BA.debugLine="ToastMessageShow(\"No se encontró el archivo PD";
parent.__c.ToastMessageShow(BA.ObjectToCharSequence("No se encontró el archivo PDF para enviar"),parent.__c.True);
 if (true) break;

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

case 24:
//C
this.state = 25;
 //BA.debugLineNum = 3191;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"update PE";
parent._b4xpages._mainpage /*adm.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("update PEDIDO set PE_TIPOPAGO = ?, PE_COMENTARIO = ?, PE_TICKET = ? where PE_CLIENTE IN (SELECT CUENTA FROM CUENTAA) ",anywheresoftware.b4a.keywords.Common.ArrayToList(new String[]{_metopago,parent._et_com_tp.getText(),"IMPRESO"}));
 //BA.debugLineNum = 3193;BA.debugLine="PDFGENERAR";
parent._pdfgenerar();
 if (true) break;

case 25:
//C
this.state = 28;
;
 //BA.debugLineNum = 3197;BA.debugLine="rb_efectivo.Checked = False";
parent._rb_efectivo.setChecked(parent.__c.False);
 //BA.debugLineNum = 3198;BA.debugLine="rb_tranfe.Checked = False";
parent._rb_tranfe.setChecked(parent.__c.False);
 //BA.debugLineNum = 3199;BA.debugLine="rb_tarjetadebito.Checked = False";
parent._rb_tarjetadebito.setChecked(parent.__c.False);
 //BA.debugLineNum = 3200;BA.debugLine="rb_tarjetacredito.Checked = False";
parent._rb_tarjetacredito.setChecked(parent.__c.False);
 //BA.debugLineNum = 3201;BA.debugLine="et_com_tp.Text = \"\"";
parent._et_com_tp.setText(BA.ObjectToCharSequence(""));
 //BA.debugLineNum = 3202;BA.debugLine="p_tipopago.Visible = False";
parent._p_tipopago.setVisible(parent.__c.False);
 if (true) break;

case 27:
//C
this.state = 28;
 //BA.debugLineNum = 3204;BA.debugLine="MsgboxAsync(\"Selecciona un metodo de pago.\", \"At";
parent.__c.MsgboxAsync(BA.ObjectToCharSequence("Selecciona un metodo de pago."),BA.ObjectToCharSequence("Atención"),ba);
 if (true) break;

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

            }
        }
    }
}
public String  _b_acred_click() throws Exception{
anywheresoftware.b4a.sql.SQL.CursorWrapper _limitcred = null;
 //BA.debugLineNum = 744;BA.debugLine="Private Sub b_acred_Click";
 //BA.debugLineNum = 745;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 /*adm.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select USUARIO from usuarioa")));
 //BA.debugLineNum = 746;BA.debugLine="c2.Position=0";
_c2.setPosition((int) (0));
 //BA.debugLineNum = 747;BA.debugLine="usuario = c2.GetString(\"USUARIO\")";
_usuario = _c2.GetString("USUARIO");
 //BA.debugLineNum = 748;BA.debugLine="c2.Close";
_c2.Close();
 //BA.debugLineNum = 749;BA.debugLine="Dim limitcred As Cursor";
_limitcred = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
 //BA.debugLineNum = 750;BA.debugLine="DateTime.DateFormat = \"MM/dd/yyyy\"";
__c.DateTime.setDateFormat("MM/dd/yyyy");
 //BA.debugLineNum = 751;BA.debugLine="DateTime.TimeFormat = \"HH:mm:ss\"";
__c.DateTime.setTimeFormat("HH:mm:ss");
 //BA.debugLineNum = 752;BA.debugLine="sDate = DateTime.Date(DateTime.Now)";
_sdate = __c.DateTime.Date(__c.DateTime.getNow());
 //BA.debugLineNum = 753;BA.debugLine="sTime = DateTime.Time(DateTime.Now)";
_stime = __c.DateTime.Time(__c.DateTime.getNow());
 //BA.debugLineNum = 754;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 /*adm.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_info2 WHERE CAT_CL_CODIGO IN (SELECT CUENTA FROM CUENTAA)")));
 //BA.debugLineNum = 755;BA.debugLine="limitcred.Position = 0";
_limitcred.setPosition((int) (0));
 //BA.debugLineNum = 756;BA.debugLine="l_limite.Text = \"Limite de credito: $\" & limitcre";
_l_limite.setText(BA.ObjectToCharSequence("Limite de credito: $"+_limitcred.GetString("CAT_CL_LIMITECREDITO")));
 //BA.debugLineNum = 757;BA.debugLine="If Subs.traeTotalClientepreventaparacredito >=  l";
if (_subs._traetotalclientepreventaparacredito /*double*/ (ba)>=(double)(Double.parseDouble(_limitcred.GetString("CAT_CL_LIMITECREDITO")))) { 
 //BA.debugLineNum = 759;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 = 760;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 = 761;BA.debugLine="et_montoacredito.Text = limitcred.GetString(\"CA";
_et_montoacredito.setText(BA.ObjectToCharSequence(_limitcred.GetString("CAT_CL_LIMITECREDITO")));
 }else {
 //BA.debugLineNum = 763;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 /*adm.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 = 764;BA.debugLine="c.Position = 0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 765;BA.debugLine="If c.GetString(\"REGISTRADO\") = 0 Then";
if ((_c.GetString("REGISTRADO")).equals(BA.NumberToString(0))) { 
 //BA.debugLineNum = 767;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"INSERT I";
_b4xpages._mainpage /*adm.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 = 768;BA.debugLine="GuardaVenta";
_guardaventa();
 //BA.debugLineNum = 769;BA.debugLine="p_credito.Visible = False";
_p_credito.setVisible(__c.False);
 }else {
 //BA.debugLineNum = 772;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"UPDATE P";
_b4xpages._mainpage /*adm.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 = 773;BA.debugLine="GuardaVenta";
_guardaventa();
 //BA.debugLineNum = 774;BA.debugLine="p_credito.Visible = False";
_p_credito.setVisible(__c.False);
 };
 };
 }else if(_subs._traetotalclientepreventaparacredito /*double*/ (ba)<(double)(Double.parseDouble(_limitcred.GetString("CAT_CL_LIMITECREDITO")))) { 
 //BA.debugLineNum = 778;BA.debugLine="If et_montoacredito.Text > Subs.traeTotalCliente";
if ((double)(Double.parseDouble(_et_montoacredito.getText()))>_subs._traetotalclientepreventaparacredito /*double*/ (ba)) { 
 //BA.debugLineNum = 779;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 = 780;BA.debugLine="et_montoacredito.Text = Subs.traeTotalClientepr";
_et_montoacredito.setText(BA.ObjectToCharSequence(_subs._traetotalclientepreventaparacredito /*double*/ (ba)));
 }else {
 //BA.debugLineNum = 782;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 /*adm.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 = 783;BA.debugLine="c.Position = 0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 784;BA.debugLine="If c.GetString(\"REGISTRADO\") = 0 Then";
if ((_c.GetString("REGISTRADO")).equals(BA.NumberToString(0))) { 
 //BA.debugLineNum = 786;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"INSERT I";
_b4xpages._mainpage /*adm.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 = 787;BA.debugLine="GuardaVenta";
_guardaventa();
 //BA.debugLineNum = 788;BA.debugLine="p_credito.Visible = False";
_p_credito.setVisible(__c.False);
 }else {
 //BA.debugLineNum = 791;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"UPDATE P";
_b4xpages._mainpage /*adm.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 = 792;BA.debugLine="GuardaVenta";
_guardaventa();
 //BA.debugLineNum = 793;BA.debugLine="p_credito.Visible = False";
_p_credito.setVisible(__c.False);
 };
 };
 };
 //BA.debugLineNum = 797;BA.debugLine="limitcred.Close";
_limitcred.Close();
 //BA.debugLineNum = 798;BA.debugLine="End Sub";
return "";
}
public String  _b_cancel_tp_click() throws Exception{
 //BA.debugLineNum = 2991;BA.debugLine="Private Sub b_cancel_tp_Click";
 //BA.debugLineNum = 2992;BA.debugLine="p_tipopago.Visible = False";
_p_tipopago.setVisible(__c.False);
 //BA.debugLineNum = 2993;BA.debugLine="rb_efectivo.Checked = False";
_rb_efectivo.setChecked(__c.False);
 //BA.debugLineNum = 2994;BA.debugLine="rb_tranfe.Checked = False";
_rb_tranfe.setChecked(__c.False);
 //BA.debugLineNum = 2995;BA.debugLine="rb_tarjetadebito.Checked = False";
_rb_tarjetadebito.setChecked(__c.False);
 //BA.debugLineNum = 2996;BA.debugLine="rb_tarjetacredito.Checked = False";
_rb_tarjetacredito.setChecked(__c.False);
 //BA.debugLineNum = 2997;BA.debugLine="et_com_tp.Text = \"\"";
_et_com_tp.setText(BA.ObjectToCharSequence(""));
 //BA.debugLineNum = 2998;BA.debugLine="End Sub";
return "";
}
public String  _b_cancelar_click() throws Exception{
 //BA.debugLineNum = 2644;BA.debugLine="Private Sub b_cancelar_Click";
 //BA.debugLineNum = 2645;BA.debugLine="et_abono.Text = \"\"";
_et_abono.setText(BA.ObjectToCharSequence(""));
 //BA.debugLineNum = 2646;BA.debugLine="p_abono.Visible = False";
_p_abono.setVisible(__c.False);
 //BA.debugLineNum = 2647;BA.debugLine="ime.HideKeyboard";
_ime.HideKeyboard(ba);
 //BA.debugLineNum = 2648;BA.debugLine="End Sub";
return "";
}
public String  _b_cancred_click() throws Exception{
 //BA.debugLineNum = 800;BA.debugLine="Private Sub b_cancred_Click";
 //BA.debugLineNum = 801;BA.debugLine="p_credito.Visible = False";
_p_credito.setVisible(__c.False);
 //BA.debugLineNum = 802;BA.debugLine="End Sub";
return "";
}
public String  _b_cxc_click() throws Exception{
String _total = "";
int _i = 0;
 //BA.debugLineNum = 2654;BA.debugLine="Private Sub b_cxc_Click";
 //BA.debugLineNum = 2656;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 /*adm.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("SELECT CUENTA from CUENTAA")));
 //BA.debugLineNum = 2657;BA.debugLine="h.Position = 0";
_h.setPosition((int) (0));
 //BA.debugLineNum = 2658;BA.debugLine="Log(h.GetString(\"CUENTA\"))";
__c.LogImpl("344302340",_h.GetString("CUENTA"),0);
 //BA.debugLineNum = 2659;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 /*adm.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 = 2660;BA.debugLine="j.position = 0";
_j.setPosition((int) (0));
 //BA.debugLineNum = 2661;BA.debugLine="Log(j.RowCount)";
__c.LogImpl("344302343",BA.NumberToString(_j.getRowCount()),0);
 //BA.debugLineNum = 2662;BA.debugLine="If j.RowCount = 0 Then";
if (_j.getRowCount()==0) { 
 //BA.debugLineNum = 2664;BA.debugLine="p_abono.Visible = True";
_p_abono.setVisible(__c.True);
 //BA.debugLineNum = 2665;BA.debugLine="Dim total As String = 0";
_total = BA.NumberToString(0);
 //BA.debugLineNum = 2666;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 /*adm.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("SELECT CUENTA FROM CUENTAA")));
 //BA.debugLineNum = 2667;BA.debugLine="f.Position = 0";
_f.setPosition((int) (0));
 //BA.debugLineNum = 2669;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 /*adm.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 = 2670;BA.debugLine="clv_abonos.Clear";
_clv_abonos._clear();
 //BA.debugLineNum = 2671;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 = 2672;BA.debugLine="d.Position = i";
_d.setPosition(_i);
 //BA.debugLineNum = 2673;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 = 2674;BA.debugLine="Log(d.GetString(\"NOTA\"))";
__c.LogImpl("344302356",_d.GetString("NOTA"),0);
 //BA.debugLineNum = 2675;BA.debugLine="Log(d.GetString(\"SALDO_PENDIENTE\"))";
__c.LogImpl("344302357",_d.GetString("SALDO_PENDIENTE"),0);
 //BA.debugLineNum = 2676;BA.debugLine="total = total + d.GetString(\"SALDO_PENDIENTE\")";
_total = BA.NumberToString((double)(Double.parseDouble(_total))+(double)(Double.parseDouble(_d.GetString("SALDO_PENDIENTE"))));
 //BA.debugLineNum = 2677;BA.debugLine="Log(total)";
__c.LogImpl("344302359",_total,0);
 }
};
 //BA.debugLineNum = 2679;BA.debugLine="l_montoabonostotal.Text = total";
_l_montoabonostotal.setText(BA.ObjectToCharSequence(_total));
 //BA.debugLineNum = 2680;BA.debugLine="d.Close";
_d.Close();
 //BA.debugLineNum = 2681;BA.debugLine="f.Close";
_f.Close();
 }else if(_j.getRowCount()>0) { 
 //BA.debugLineNum = 2684;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 = 2686;BA.debugLine="h.Close";
_h.Close();
 //BA.debugLineNum = 2687;BA.debugLine="j.Close";
_j.Close();
 //BA.debugLineNum = 2690;BA.debugLine="End Sub";
return "";
}
public String  _b_e_next_click() throws Exception{
 //BA.debugLineNum = 2164;BA.debugLine="Sub B_E_NEXT_Click";
 //BA.debugLineNum = 2165;BA.debugLine="If E_RES_E.Text <> \"\" Then";
if ((_e_res_e.getText()).equals("") == false) { 
 //BA.debugLineNum = 2166;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"insert int";
_b4xpages._mainpage /*adm.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 = 2167;BA.debugLine="Panel2.Visible = False";
_panel2.setVisible(__c.False);
 //BA.debugLineNum = 2168;BA.debugLine="B4XPages.ShowPage(\"Productos\")";
_b4xpages._showpage /*String*/ (ba,"Productos");
 }else {
 //BA.debugLineNum = 2170;BA.debugLine="Msgbox(\"SIN RESPUESTA\",\"AVISO\") 'Ignore";
__c.Msgbox(BA.ObjectToCharSequence("SIN RESPUESTA"),BA.ObjectToCharSequence("AVISO"),ba);
 };
 //BA.debugLineNum = 2172;BA.debugLine="End Sub";
return "";
}
public String  _b_foto_inci_click() throws Exception{
 //BA.debugLineNum = 2826;BA.debugLine="Private Sub b_foto_inci_Click";
 //BA.debugLineNum = 2827;BA.debugLine="camEx.TakePicture";
_camex._takepicture /*String*/ ();
 //BA.debugLineNum = 2828;BA.debugLine="End Sub";
return "";
}
public String  _b_guarda_c_click() throws Exception{
 //BA.debugLineNum = 2108;BA.debugLine="Sub B_GUARDA_C_Click";
 //BA.debugLineNum = 2109;BA.debugLine="DateTime.DateFormat = \"MM/dd/yyyy\"";
__c.DateTime.setDateFormat("MM/dd/yyyy");
 //BA.debugLineNum = 2110;BA.debugLine="sDate=DateTime.Date(DateTime.Now)";
_sdate = __c.DateTime.Date(__c.DateTime.getNow());
 //BA.debugLineNum = 2111;BA.debugLine="sTime=DateTime.Time(DateTime.Now)";
_stime = __c.DateTime.Time(__c.DateTime.getNow());
 //BA.debugLineNum = 2112;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 /*adm.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("Select CUENTA from cuentaa")));
 //BA.debugLineNum = 2113;BA.debugLine="c.Position=0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 2114;BA.debugLine="clie_id = c.GetString(\"CUENTA\")";
_clie_id = _c.GetString("CUENTA");
 //BA.debugLineNum = 2115;BA.debugLine="c.Close";
_c.Close();
 //BA.debugLineNum = 2116;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 /*adm.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select USUARIO from usuarioa")));
 //BA.debugLineNum = 2117;BA.debugLine="c.Position=0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 2118;BA.debugLine="usuario = c.GetString(\"USUARIO\")";
_usuario = _c.GetString("USUARIO");
 //BA.debugLineNum = 2119;BA.debugLine="c.Close";
_c.Close();
 //BA.debugLineNum = 2120;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"INSERT INTO";
_b4xpages._mainpage /*adm.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 = 2121;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"INSERT INTO";
_b4xpages._mainpage /*adm.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 = 2122;BA.debugLine="Panel1.Visible = False";
_panel1.setVisible(__c.False);
 //BA.debugLineNum = 2124;BA.debugLine="Tar.Visible = True";
_tar.setVisible(__c.True);
 //BA.debugLineNum = 2128;BA.debugLine="Guardar.Visible = True";
_guardar.setVisible(__c.True);
 //BA.debugLineNum = 2129;BA.debugLine="End Sub";
return "";
}
public String  _b_imp_click() throws Exception{
 //BA.debugLineNum = 1027;BA.debugLine="Sub B_IMP_Click";
 //BA.debugLineNum = 1029;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[]{"VENTA"})));
 //BA.debugLineNum = 1030;BA.debugLine="If c.RowCount > 0 Then";
if (_c.getRowCount()>0) { 
 //BA.debugLineNum = 1031;BA.debugLine="imprime_venta";
_imprime_venta();
 //BA.debugLineNum = 1032;BA.debugLine="t1.Initialize(\"T1\", 5000) ' 1000 = 1 second";
_t1.Initialize(ba,"T1",(long) (5000));
 //BA.debugLineNum = 1033;BA.debugLine="t1.Enabled = True";
_t1.setEnabled(__c.True);
 }else if(_c.getRowCount()==0) { 
 //BA.debugLineNum = 1035;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 = 1036;BA.debugLine="If s.RowCount > 0 Then";
if (_s.getRowCount()>0) { 
 //BA.debugLineNum = 1037;BA.debugLine="imprime_preventa";
_imprime_preventa();
 };
 };
 //BA.debugLineNum = 1041;BA.debugLine="End Sub";
return "";
}
public String  _b_mapa_click() throws Exception{
 //BA.debugLineNum = 1023;BA.debugLine="Sub b_mapa_Click";
 //BA.debugLineNum = 1024;BA.debugLine="B4XPages.ShowPage(\"mapas\")";
_b4xpages._showpage /*String*/ (ba,"mapas");
 //BA.debugLineNum = 1025;BA.debugLine="End Sub";
return "";
}
public String  _b_venta_click() throws Exception{
 //BA.debugLineNum = 2131;BA.debugLine="Sub b_venta_Click";
 //BA.debugLineNum = 2132;BA.debugLine="DateTime.DateFormat = \"MM/dd/yyyy\"";
__c.DateTime.setDateFormat("MM/dd/yyyy");
 //BA.debugLineNum = 2133;BA.debugLine="sDate=DateTime.Date(DateTime.Now)";
_sdate = __c.DateTime.Date(__c.DateTime.getNow());
 //BA.debugLineNum = 2134;BA.debugLine="sTime=DateTime.Time(DateTime.Now)";
_stime = __c.DateTime.Time(__c.DateTime.getNow());
 //BA.debugLineNum = 2162;BA.debugLine="End Sub";
return "";
}
public String  _b_ventaabordo_click() throws Exception{
 //BA.debugLineNum = 2773;BA.debugLine="Private Sub b_ventaabordo_Click";
 //BA.debugLineNum = 2775;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 /*adm.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery2("Select * From CAT_GUNAPROD2 where cat_gp_tipo <> ? ",new String[]{"PROMOS"})));
 //BA.debugLineNum = 2776;BA.debugLine="If c.RowCount > 0 Then";
if (_c.getRowCount()>0) { 
 //BA.debugLineNum = 2780;BA.debugLine="B4XPages.MainPage.tipo_venta = \"VENTA\"";
_b4xpages._mainpage /*adm.keymon.com.mx.b4xmainpage*/ (ba)._tipo_venta /*String*/  = "VENTA";
 //BA.debugLineNum = 2815;BA.debugLine="B4XPages.ShowPage(\"productos\")";
_b4xpages._showpage /*String*/ (ba,"productos");
 }else if(_c.getRowCount()==0) { 
 //BA.debugLineNum = 2820;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 = 2824;BA.debugLine="End Sub";
return "";
}
public String  _b4xpage_appear() throws Exception{
String _cabonos = "";
String _factura = "";
anywheresoftware.b4a.sql.SQL.CursorWrapper _credi2 = null;
anywheresoftware.b4a.sql.SQL.CursorWrapper _credi3 = null;
 //BA.debugLineNum = 256;BA.debugLine="Sub B4XPage_Appear";
 //BA.debugLineNum = 257;BA.debugLine="Tels.Visible = False";
_tels.setVisible(__c.False);
 //BA.debugLineNum = 258;BA.debugLine="gest.Visible = False";
_gest.setVisible(__c.False);
 //BA.debugLineNum = 259;BA.debugLine="b_ventaabordo.Visible = False";
_b_ventaabordo.setVisible(__c.False);
 //BA.debugLineNum = 260;BA.debugLine="p_camara.Height = Root.Height";
_p_camara.setHeight(_root.getHeight());
 //BA.debugLineNum = 261;BA.debugLine="p_camara.Width = Root.Width";
_p_camara.setWidth(_root.getWidth());
 //BA.debugLineNum = 262;BA.debugLine="p_tipopago.Height = Root.Height";
_p_tipopago.setHeight(_root.getHeight());
 //BA.debugLineNum = 263;BA.debugLine="p_tipopago.Width = Root.Width";
_p_tipopago.setWidth(_root.getWidth());
 //BA.debugLineNum = 264;BA.debugLine="banderaimp = 0";
_banderaimp = (int) (0);
 //BA.debugLineNum = 265;BA.debugLine="reqManager.Initialize(Me, Starter.DBReqServer)";
_reqmanager._initialize /*String*/ (ba,this,_starter._dbreqserver /*String*/ );
 //BA.debugLineNum = 266;BA.debugLine="LA_GPS.TextColor = Colors.Red";
_la_gps.setTextColor(__c.Colors.Red);
 //BA.debugLineNum = 267;BA.debugLine="LA_GPS.Text = \"SIN UBICACION GPS\"";
_la_gps.setText(BA.ObjectToCharSequence("SIN UBICACION GPS"));
 //BA.debugLineNum = 268;BA.debugLine="cercavalor = 0";
_cercavalor = BA.NumberToString(0);
 //BA.debugLineNum = 269;BA.debugLine="If Not(Starter.gps.GPSEnabled) Then";
if (__c.Not(_starter._gps /*anywheresoftware.b4a.gps.GPS*/ .getGPSEnabled())) { 
 //BA.debugLineNum = 270;BA.debugLine="ToastMessageShow(\"Es necesario tener el GPS ence";
__c.ToastMessageShow(BA.ObjectToCharSequence("Es necesario tener el GPS encendido"),__c.True);
 //BA.debugLineNum = 271;BA.debugLine="StartActivity(Starter.gps.LocationSettingsIntent";
__c.StartActivity(ba,(Object)(_starter._gps /*anywheresoftware.b4a.gps.GPS*/ .getLocationSettingsIntent()));
 };
 //BA.debugLineNum = 274;BA.debugLine="cb_factura.Checked = False";
_cb_factura.setChecked(__c.False);
 //BA.debugLineNum = 275;BA.debugLine="p_abono.Visible = False";
_p_abono.setVisible(__c.False);
 //BA.debugLineNum = 276;BA.debugLine="Subs.centraPanel(p_abono, Root.Width)";
_subs._centrapanel /*String*/ (ba,_p_abono,_root.getWidth());
 //BA.debugLineNum = 277;BA.debugLine="Subs.centraPanel(p_credito, Root.Width)";
_subs._centrapanel /*String*/ (ba,_p_credito,_root.getWidth());
 //BA.debugLineNum = 278;BA.debugLine="skmt.Initialize(ruta,\"kmt.db\", True)";
_skmt.Initialize(_ruta,"kmt.db",__c.True);
 //BA.debugLineNum = 279;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 /*adm.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_info2 where CAT_CL_CODIGO In (Select cuenta from cuentaa)")));
 //BA.debugLineNum = 280;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 /*adm.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 = 281;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 /*adm.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 = 282;BA.debugLine="b.Position = 0";
_b.setPosition((int) (0));
 //BA.debugLineNum = 283;BA.debugLine="Dim cabonos As String = b.GetString(\"CLIENTE\")";
_cabonos = _b.GetString("CLIENTE");
 //BA.debugLineNum = 284;BA.debugLine="If cabonos = 0 Then";
if ((_cabonos).equals(BA.NumberToString(0))) { 
 //BA.debugLineNum = 285;BA.debugLine="b_cxc.Visible = False";
_b_cxc.setVisible(__c.False);
 }else {
 //BA.debugLineNum = 287;BA.debugLine="b_cxc.Visible = True";
_b_cxc.setVisible(__c.True);
 };
 //BA.debugLineNum = 290;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 = 291;BA.debugLine="p_cbFactura.Visible = False";
_p_cbfactura.setVisible(__c.False);
 //BA.debugLineNum = 292;BA.debugLine="l_factura.Visible = False";
_l_factura.setVisible(__c.False);
 //BA.debugLineNum = 293;BA.debugLine="b_ventaabordo.Visible = False";
_b_ventaabordo.setVisible(__c.False);
 }else {
 //BA.debugLineNum = 295;BA.debugLine="p_cbFactura.Visible = False";
_p_cbfactura.setVisible(__c.False);
 //BA.debugLineNum = 296;BA.debugLine="l_factura.Visible = False";
_l_factura.setVisible(__c.False);
 //BA.debugLineNum = 297;BA.debugLine="b_ventaabordo.Visible = False";
_b_ventaabordo.setVisible(__c.False);
 };
 //BA.debugLineNum = 299;BA.debugLine="chb_impreso.Checked = False";
_chb_impreso.setChecked(__c.False);
 //BA.debugLineNum = 300;BA.debugLine="s.Position=0";
_s.setPosition((int) (0));
 //BA.debugLineNum = 301;BA.debugLine="If c.RowCount > 0 Then";
if (_c.getRowCount()>0) { 
 //BA.debugLineNum = 302;BA.debugLine="c.Position=0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 303;BA.debugLine="la_cuenta.Text = c.GetString(\"CAT_CL_CODIGO\")";
_la_cuenta.setText(BA.ObjectToCharSequence(_c.GetString("CAT_CL_CODIGO")));
 //BA.debugLineNum = 304;BA.debugLine="La_nombre.Text = c.GetString(\"CAT_CL_NOMBRE\")";
_la_nombre.setText(BA.ObjectToCharSequence(_c.GetString("CAT_CL_NOMBRE")));
 //BA.debugLineNum = 305;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 = 306;BA.debugLine="la_col.Text = c.GetString(\"CAT_CL_COLONIA\")";
_la_col.setText(BA.ObjectToCharSequence(_c.GetString("CAT_CL_COLONIA")));
 //BA.debugLineNum = 307;BA.debugLine="la_edo.Text = c.GetString(\"CAT_CL_EDO\")";
_la_edo.setText(BA.ObjectToCharSequence(_c.GetString("CAT_CL_EDO")));
 //BA.debugLineNum = 308;BA.debugLine="l_entre1.Text = c.GetString(\"CAT_CL_CALLE1\")";
_l_entre1.setText(BA.ObjectToCharSequence(_c.GetString("CAT_CL_CALLE1")));
 //BA.debugLineNum = 309;BA.debugLine="l_entre2.Text = c.GetString(\"CAT_CL_CALLE2\")";
_l_entre2.setText(BA.ObjectToCharSequence(_c.GetString("CAT_CL_CALLE2")));
 //BA.debugLineNum = 310;BA.debugLine="l_atiende.Text = c.GetString(\"CAT_CL_ATIENDE1\")";
_l_atiende.setText(BA.ObjectToCharSequence(_c.GetString("CAT_CL_ATIENDE1")));
 //BA.debugLineNum = 311;BA.debugLine="l_atiende2.Text = c.GetString(\"CAT_CL_ATIENTE2\")";
_l_atiende2.setText(BA.ObjectToCharSequence(_c.GetString("CAT_CL_ATIENTE2")));
 //BA.debugLineNum = 312;BA.debugLine="TELEFONO  = c.GetString(\"CAT_CL_TELEFONO\")";
_telefono = _c.GetString("CAT_CL_TELEFONO");
 //BA.debugLineNum = 313;BA.debugLine="l_total.Text = s.GetString(\"TOTAL_CLIE\")";
_l_total.setText(BA.ObjectToCharSequence(_s.GetString("TOTAL_CLIE")));
 //BA.debugLineNum = 314;BA.debugLine="total_cliente = s.GetString(\"TOTAL_CLIE\")";
_total_cliente = _s.GetString("TOTAL_CLIE");
 //BA.debugLineNum = 315;BA.debugLine="Private factura As String = 0";
_factura = BA.NumberToString(0);
 //BA.debugLineNum = 316;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 = 317;BA.debugLine="If factura = \"1\" Then cb_factura.Checked = True";
if ((_factura).equals("1")) { 
_cb_factura.setChecked(__c.True);};
 //BA.debugLineNum = 318;BA.debugLine="m_lat = \"0\"";
_m_lat = "0";
 //BA.debugLineNum = 319;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 = 320;BA.debugLine="If m_lat.Length < 5 Then m_lat = \"0\"";
if (_m_lat.length()<5) { 
_m_lat = "0";};
 //BA.debugLineNum = 321;BA.debugLine="m_lon = \"0\"";
_m_lon = "0";
 //BA.debugLineNum = 322;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 = 323;BA.debugLine="If m_lon.Length < 5 Then m_lon = \"0\"";
if (_m_lon.length()<5) { 
_m_lon = "0";};
 //BA.debugLineNum = 324;BA.debugLine="LA_RUTA = c.GetString(\"CAT_CL_RUTA\")";
_la_ruta = _c.GetString("CAT_CL_RUTA");
 //BA.debugLineNum = 326;BA.debugLine="If c.GetString(\"CAT_CL_NUM_SERIEFISICO\") = \"0\"";
if ((_c.GetString("CAT_CL_NUM_SERIEFISICO")).equals("0")) { 
 //BA.debugLineNum = 327;BA.debugLine="L_QR.TEXT = \"SIN CODIGO\"";
_l_qr.setText(BA.ObjectToCharSequence("SIN CODIGO"));
 //BA.debugLineNum = 328;BA.debugLine="L_QR.TextColor = Colors.Red";
_l_qr.setTextColor(__c.Colors.Red);
 //BA.debugLineNum = 329;BA.debugLine="gest.VISIBLE = False";
_gest.setVisible(__c.False);
 //BA.debugLineNum = 330;BA.debugLine="BT_QR.Visible = True";
_bt_qr.setVisible(__c.True);
 }else {
 //BA.debugLineNum = 332;BA.debugLine="L_QR.TEXT = c.GetString(\"CAT_CL_NUM_SERIEFISICO";
_l_qr.setText(BA.ObjectToCharSequence(_c.GetString("CAT_CL_NUM_SERIEFISICO")));
 //BA.debugLineNum = 333;BA.debugLine="L_QR.TextColor = Colors.Blue";
_l_qr.setTextColor(__c.Colors.Blue);
 //BA.debugLineNum = 334;BA.debugLine="BT_QR.Visible = False";
_bt_qr.setVisible(__c.False);
 };
 };
 //BA.debugLineNum = 337;BA.debugLine="c.Close";
_c.Close();
 //BA.debugLineNum = 338;BA.debugLine="s.Close";
_s.Close();
 //BA.debugLineNum = 339;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 /*adm.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 = 340;BA.debugLine="S2.Position =0";
_s2.setPosition((int) (0));
 //BA.debugLineNum = 341;BA.debugLine="CUANTOS = S2.GetString(\"CUANTOS\")";
_cuantos = _s2.GetString("CUANTOS");
 //BA.debugLineNum = 342;BA.debugLine="S2.Close";
_s2.Close();
 //BA.debugLineNum = 343;BA.debugLine="If CUANTOS > 0 Then";
if ((double)(Double.parseDouble(_cuantos))>0) { 
 //BA.debugLineNum = 344;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 /*adm.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 = 345;BA.debugLine="c2.Position =0";
_c2.setPosition((int) (0));
 //BA.debugLineNum = 346;BA.debugLine="MONTO_COMPRA = c2.GetString(\"TOTAL\")";
_monto_compra = _c2.GetString("TOTAL");
 //BA.debugLineNum = 347;BA.debugLine="c2.Close";
_c2.Close();
 }else {
 //BA.debugLineNum = 349;BA.debugLine="MONTO_COMPRA = \"0\"";
_monto_compra = "0";
 };
 //BA.debugLineNum = 352;BA.debugLine="la_saldotot.Text = MONTO_COMPRA";
_la_saldotot.setText(BA.ObjectToCharSequence(_monto_compra));
 //BA.debugLineNum = 353;BA.debugLine="If MONTO_COMPRA <> \"0\" Then";
if ((_monto_compra).equals("0") == false) { 
 //BA.debugLineNum = 354;BA.debugLine="META2 = 300 -  MONTO_COMPRA";
_meta2 = BA.NumberToString(300-(double)(Double.parseDouble(_monto_compra)));
 }else {
 //BA.debugLineNum = 356;BA.debugLine="META2 = 300";
_meta2 = BA.NumberToString(300);
 };
 //BA.debugLineNum = 358;BA.debugLine="If META2 < 1 Then";
if ((double)(Double.parseDouble(_meta2))<1) { 
 //BA.debugLineNum = 359;BA.debugLine="META2 = \"CUBIERTO\"";
_meta2 = "CUBIERTO";
 };
 //BA.debugLineNum = 361;BA.debugLine="la_saldooper.Text = META2";
_la_saldooper.setText(BA.ObjectToCharSequence(_meta2));
 //BA.debugLineNum = 362;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 /*adm.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select ID_ALMACEN from CAT_ALMACEN")));
 //BA.debugLineNum = 363;BA.debugLine="If c.RowCount>0 Then";
if (_c.getRowCount()>0) { 
 //BA.debugLineNum = 364;BA.debugLine="C.Position=0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 365;BA.debugLine="ALMACEN = C.GetString(\"ID_ALMACEN\")";
_almacen = _c.GetString("ID_ALMACEN");
 };
 //BA.debugLineNum = 367;BA.debugLine="c.Close";
_c.Close();
 //BA.debugLineNum = 373;BA.debugLine="If ALMACEN = \"4\"  Then";
if ((_almacen).equals("4")) { 
 //BA.debugLineNum = 375;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 /*adm.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 = 376;BA.debugLine="DD.Position =0";
_dd.setPosition((int) (0));
 //BA.debugLineNum = 377;BA.debugLine="If DD.GetString(\"CUANTOS\")  = 0 Then";
if ((_dd.GetString("CUANTOS")).equals(BA.NumberToString(0))) { 
 //BA.debugLineNum = 378;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 /*adm.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 = 379;BA.debugLine="c.Position =0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 385;BA.debugLine="c.Close";
_c.Close();
 }else {
 };
 //BA.debugLineNum = 389;BA.debugLine="DD.Close";
_dd.Close();
 }else {
 };
 //BA.debugLineNum = 397;BA.debugLine="CallSubDelayed(Tracker, \"Track\")";
__c.CallSubDelayed(ba,(Object)(_tracker.getObject()),"Track");
 //BA.debugLineNum = 398;BA.debugLine="CallSubDelayed(Tracker, \"StartFLPSmall\")";
__c.CallSubDelayed(ba,(Object)(_tracker.getObject()),"StartFLPSmall");
 //BA.debugLineNum = 399;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 = 400;BA.debugLine="B4XPages.MainPage.lat_gps = Tracker.FLP.GetLastK";
_b4xpages._mainpage /*adm.keymon.com.mx.b4xmainpage*/ (ba)._lat_gps /*String*/  = BA.NumberToString(_tracker._flp /*uk.co.martinpearman.b4a.fusedlocationprovider.FusedLocationProviderWrapper*/ .GetLastKnownLocation().getLatitude());
 //BA.debugLineNum = 401;BA.debugLine="B4XPages.MainPage.lon_gps = Tracker.FLP.GetLastK";
_b4xpages._mainpage /*adm.keymon.com.mx.b4xmainpage*/ (ba)._lon_gps /*String*/  = BA.NumberToString(_tracker._flp /*uk.co.martinpearman.b4a.fusedlocationprovider.FusedLocationProviderWrapper*/ .GetLastKnownLocation().getLongitude());
 //BA.debugLineNum = 403;BA.debugLine="GPS_LocationChanged(Tracker.FLP.GetLastKnownLoca";
_gps_locationchanged(_tracker._flp /*uk.co.martinpearman.b4a.fusedlocationprovider.FusedLocationProviderWrapper*/ .GetLastKnownLocation());
 };
 //BA.debugLineNum = 430;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 = 431;BA.debugLine="If c.RowCount > 0 Then";
if (_c.getRowCount()>0) { 
 //BA.debugLineNum = 432;BA.debugLine="c.Position = 0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 433;BA.debugLine="Starter.MAC_IMPRESORA = c.GetString(\"CAT_VA_VALO";
_starter._mac_impresora /*String*/  = _c.GetString("CAT_VA_VALOR");
 };
 //BA.debugLineNum = 435;BA.debugLine="If Starter.MAC_IMPRESORA = \"\" Then Starter.MAC_IM";
if ((_starter._mac_impresora /*String*/ ).equals("")) { 
_starter._mac_impresora /*String*/  = "0";};
 //BA.debugLineNum = 437;BA.debugLine="Printer1.Initialize(Me, \"Printer1\")";
_printer1._initialize /*String*/ (ba,this,"Printer1");
 //BA.debugLineNum = 439;BA.debugLine="If Printer1.IsConnected = False Then";
if (_printer1._isconnected /*boolean*/ ()==__c.False) { 
 }else {
 //BA.debugLineNum = 443;BA.debugLine="Printer1.DisConnect";
_printer1._disconnect /*String*/ ();
 //BA.debugLineNum = 444;BA.debugLine="Printer1.Connect";
_printer1._connect /*boolean*/ ();
 //BA.debugLineNum = 445;BA.debugLine="Log(\"2\")";
__c.LogImpl("341025725","2",0);
 };
 //BA.debugLineNum = 450;BA.debugLine="pre_act = Subs.traeTotalClientepreventaparacredit";
_pre_act = (float) (_subs._traetotalclientepreventaparacredito /*double*/ (ba));
 //BA.debugLineNum = 454;BA.debugLine="Private credi2 As Cursor = B4XPages.MainPage.skmt";
_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 /*adm.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("SELECT CAT_CL_BCREDITO, CAT_CL_CODIGO, Ifnull(SALDO_PENDIENTE,0) As SALDO_PENDIENTE FROM KMT_INFO INNER JOIN ABONOSP ON CAT_CL_CODIGO = CLIENTE WHERE CAT_CL_CODIGO IN (SELECT CUENTA FROM CUENTAA) UNION SELECT CAT_CL_BCREDITO, CAT_CL_CODIGO, Ifnull(SALDO_PENDIENTE,0) As SALDO_PENDIENTE FROM KMT_INFO2 INNER JOIN ABONOSP ON CAT_CL_CODIGO = CLIENTE WHERE CAT_CL_CODIGO IN (SELECT CUENTA FROM CUENTAA)")));
 //BA.debugLineNum = 455;BA.debugLine="If credi2.RowCount > 0 Then";
if (_credi2.getRowCount()>0) { 
 //BA.debugLineNum = 456;BA.debugLine="credi2.Position = 0";
_credi2.setPosition((int) (0));
 //BA.debugLineNum = 457;BA.debugLine="If credi2.GetString (\"CAT_CL_BCREDITO\") = \"1\" Th";
if ((_credi2.GetString("CAT_CL_BCREDITO")).equals("1")) { 
 //BA.debugLineNum = 458;BA.debugLine="Log(2)";
__c.LogImpl("341025738",BA.NumberToString(2),0);
 //BA.debugLineNum = 459;BA.debugLine="Private credi3 As Cursor = B4XPages.MainPage.sk";
_credi3 = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_credi3 = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*adm.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("SELECT a_abono, CAT_CL_CODIGO FROM KMT_INFO INNER JOIN ABONOS ON CAT_CL_CODIGO = a_cliente WHERE CAT_CL_CODIGO IN (SELECT CUENTA FROM CUENTAA) UNION SELECT a_abono, CAT_CL_CODIGO FROM KMT_INFO2 INNER JOIN ABONOS ON CAT_CL_CODIGO = a_cliente WHERE CAT_CL_CODIGO IN (SELECT CUENTA FROM CUENTAA)")));
 //BA.debugLineNum = 460;BA.debugLine="If credi3.RowCount > 0 Then";
if (_credi3.getRowCount()>0) { 
 //BA.debugLineNum = 461;BA.debugLine="credi3.Position = 0";
_credi3.setPosition((int) (0));
 //BA.debugLineNum = 462;BA.debugLine="If credi2.GetString (\"SALDO_PENDIENTE\") <> cre";
if ((_credi2.GetString("SALDO_PENDIENTE")).equals(_credi3.GetString("a_abono")) == false) { 
 //BA.debugLineNum = 463;BA.debugLine="MsgboxAsync(\"La venta sera en efectivo porque";
__c.MsgboxAsync(BA.ObjectToCharSequence("La venta sera en efectivo porque el pago del pagare en menor al total de la deuda."),BA.ObjectToCharSequence("Atención"),ba);
 }else if((_credi2.GetString("SALDO_PENDIENTE")).equals(_credi3.GetString("a_abono"))) { 
 };
 }else {
 //BA.debugLineNum = 467;BA.debugLine="MsgboxAsync(\"La venta sera en efectivo por que";
__c.MsgboxAsync(BA.ObjectToCharSequence("La venta sera en efectivo por que hay un pagare pendiente de pago"),BA.ObjectToCharSequence("Atención"),ba);
 };
 //BA.debugLineNum = 469;BA.debugLine="credi3.Close";
_credi3.Close();
 }else {
 //BA.debugLineNum = 471;BA.debugLine="Log(1)";
__c.LogImpl("341025751",BA.NumberToString(1),0);
 //BA.debugLineNum = 472;BA.debugLine="Private credi3 As Cursor = B4XPages.MainPage.sk";
_credi3 = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_credi3 = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*adm.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("SELECT a_abono, CAT_CL_CODIGO FROM KMT_INFO INNER JOIN ABONOS ON CAT_CL_CODIGO = a_cliente WHERE CAT_CL_CODIGO IN (SELECT CUENTA FROM CUENTAA) UNION SELECT a_abono, CAT_CL_CODIGO FROM KMT_INFO2 INNER JOIN ABONOS ON CAT_CL_CODIGO = a_cliente WHERE CAT_CL_CODIGO IN (SELECT CUENTA FROM CUENTAA)")));
 //BA.debugLineNum = 473;BA.debugLine="If credi3.RowCount > 0 Then";
if (_credi3.getRowCount()>0) { 
 //BA.debugLineNum = 474;BA.debugLine="credi3.Position = 0";
_credi3.setPosition((int) (0));
 //BA.debugLineNum = 475;BA.debugLine="If credi2.GetString (\"SALDO_PENDIENTE\") <> cre";
if ((_credi2.GetString("SALDO_PENDIENTE")).equals(_credi3.GetString("a_abono")) == false) { 
 //BA.debugLineNum = 476;BA.debugLine="MsgboxAsync(\"La venta sera en efectivo porque";
__c.MsgboxAsync(BA.ObjectToCharSequence("La venta sera en efectivo porque el pago del pagare en menor al total de la deuda."),BA.ObjectToCharSequence("Atención"),ba);
 }else if((_credi2.GetString("SALDO_PENDIENTE")).equals(_credi3.GetString("a_abono"))) { 
 };
 }else {
 //BA.debugLineNum = 480;BA.debugLine="MsgboxAsync(\"La venta sera en efectivo por que";
__c.MsgboxAsync(BA.ObjectToCharSequence("La venta sera en efectivo por que hay un pagare pendiente de pago"),BA.ObjectToCharSequence("Atención"),ba);
 };
 //BA.debugLineNum = 482;BA.debugLine="credi3.Close";
_credi3.Close();
 };
 };
 //BA.debugLineNum = 485;BA.debugLine="credi2.Close";
_credi2.Close();
 //BA.debugLineNum = 486;BA.debugLine="If la_cuenta.Text = \"0\" Then";
if ((_la_cuenta.getText()).equals("0")) { 
 //BA.debugLineNum = 487;BA.debugLine="gest.Text = \"Abordo\"";
_gest.setText(BA.ObjectToCharSequence("Abordo"));
 //BA.debugLineNum = 488;BA.debugLine="B4XPages.MainPage.recarga = \"0\"";
_b4xpages._mainpage /*adm.keymon.com.mx.b4xmainpage*/ (ba)._recarga /*String*/  = "0";
 }else if((_la_cuenta.getText()).equals("1")) { 
 //BA.debugLineNum = 490;BA.debugLine="gest.Text = \"Recarga\"";
_gest.setText(BA.ObjectToCharSequence("Recarga"));
 //BA.debugLineNum = 491;BA.debugLine="B4XPages.MainPage.recarga = \"1\"";
_b4xpages._mainpage /*adm.keymon.com.mx.b4xmainpage*/ (ba)._recarga /*String*/  = "1";
 }else {
 //BA.debugLineNum = 493;BA.debugLine="gest.Text = \"Pre-venta\"";
_gest.setText(BA.ObjectToCharSequence("Pre-venta"));
 //BA.debugLineNum = 494;BA.debugLine="B4XPages.MainPage.recarga = \"0\"";
_b4xpages._mainpage /*adm.keymon.com.mx.b4xmainpage*/ (ba)._recarga /*String*/  = "0";
 };
 //BA.debugLineNum = 496;BA.debugLine="LogColor(B4XPages.MainPage.recarga,Colors.Blue)";
__c.LogImpl("341025776",_b4xpages._mainpage /*adm.keymon.com.mx.b4xmainpage*/ (ba)._recarga /*String*/ ,__c.Colors.Blue);
 //BA.debugLineNum = 498;BA.debugLine="If camEx.IsInitialized Then";
if (_camex.IsInitialized /*boolean*/ ()) { 
 //BA.debugLineNum = 499;BA.debugLine="camEx.Release";
_camex._release /*String*/ ();
 };
 //BA.debugLineNum = 501;BA.debugLine="InitializeCamera";
_initializecamera();
 //BA.debugLineNum = 502;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(adm.keymon.com.mx.c_cliente parent) {
this.parent = parent;
}
adm.keymon.com.mx.c_cliente parent;
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 = 606;BA.debugLine="If Starter.pre_viejo = pre_act Then";
if (true) break;

case 1:
//if
this.state = 32;
if (parent._starter._pre_viejo /*float*/ ==parent._pre_act) { 
this.state = 3;
}else {
this.state = 27;
}if (true) break;

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

case 4:
//if
this.state = 25;
if (((parent._la_cuenta.getText()).equals("0") == false && (parent._la_cuenta.getText()).equals("1") == false)) { 
this.state = 6;
}else {
this.state = 24;
}if (true) break;

case 6:
//C
this.state = 7;
 //BA.debugLineNum = 608;BA.debugLine="If banderaimp = 1 Then";
if (true) break;

case 7:
//if
this.state = 22;
if (parent._banderaimp==1) { 
this.state = 9;
}else {
this.state = 11;
}if (true) break;

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

case 11:
//C
this.state = 12;
 //BA.debugLineNum = 610;BA.debugLine="cuest.encuestaIniciada = False";
parent._cuest._encuestainiciada /*boolean*/  = parent.__c.False;
 //BA.debugLineNum = 611;BA.debugLine="cuest.ocultPanelPregunta";
parent._cuest._ocultpanelpregunta /*String*/ ();
 //BA.debugLineNum = 612;BA.debugLine="If IsNumber(l_total.text) And Not(Subs.pedidoG";
if (true) break;

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

case 14:
//C
this.state = 15;
 //BA.debugLineNum = 613;BA.debugLine="LogColor(\"Hay Venta\", Colors.Red)";
parent.__c.LogImpl("341353227","Hay Venta",parent.__c.Colors.Red);
 //BA.debugLineNum = 614;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 = 615;BA.debugLine="If resultado1 = DialogResponse.POSITIVE Then";
if (true) break;

case 15:
//if
this.state = 20;
if (_resultado1==parent.__c.DialogResponse.POSITIVE) { 
this.state = 17;
}else if(_resultado1==parent.__c.DialogResponse.CANCEL) { 
this.state = 19;
}if (true) break;

case 17:
//C
this.state = 20;
 //BA.debugLineNum = 616;BA.debugLine="Log(\"Borrra venta\")";
parent.__c.LogImpl("341353230","Borrra venta",0);
 //BA.debugLineNum = 617;BA.debugLine="Subs.borraPedidoClienteActual";
parent._subs._borrapedidoclienteactual /*String*/ (ba);
 //BA.debugLineNum = 618;BA.debugLine="ToastMessageShow(\"Venta Borrada\", False)";
parent.__c.ToastMessageShow(BA.ObjectToCharSequence("Venta Borrada"),parent.__c.False);
 //BA.debugLineNum = 620;BA.debugLine="B4XPages.ShowPage(\"Principal\")";
parent._b4xpages._showpage /*String*/ (ba,"Principal");
 if (true) break;

case 19:
//C
this.state = 20;
 //BA.debugLineNum = 622;BA.debugLine="Log(\"Pedido guardado\")";
parent.__c.LogImpl("341353236","Pedido guardado",0);
 //BA.debugLineNum = 623;BA.debugLine="Guardar_Click";
parent._guardar_click();
 //BA.debugLineNum = 624;BA.debugLine="ToastMessageShow(\"Venta Guardada\", False)";
parent.__c.ToastMessageShow(BA.ObjectToCharSequence("Venta Guardada"),parent.__c.False);
 if (true) break;

case 20:
//C
this.state = 21;
;
 if (true) break;

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

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

case 24:
//C
this.state = 25;
 if (true) break;

case 25:
//C
this.state = 32;
;
 if (true) break;

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

case 28:
//if
this.state = 31;
if ((parent._b4xpages._mainpage /*adm.keymon.com.mx.b4xmainpage*/ (ba)._recarga /*String*/ ).equals("1")) { 
this.state = 30;
}if (true) break;

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

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

case 32:
//C
this.state = -1;
;
 //BA.debugLineNum = 643;BA.debugLine="Return False";
if (true) {
parent.__c.ReturnFromResumableSub(this,(Object)(parent.__c.False));return;};
 //BA.debugLineNum = 644;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(adm.keymon.com.mx.c_cliente parent,anywheresoftware.b4a.objects.B4XViewWrapper _root1) {
this.parent = parent;
this._root1 = _root1;
}
adm.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 = 185;BA.debugLine="Root = Root1";
parent._root = _root1;
 //BA.debugLineNum = 188;BA.debugLine="Root.LoadLayout(\"cliente\")";
parent._root.LoadLayout("cliente",ba);
 //BA.debugLineNum = 189;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 = 190;BA.debugLine="ruta = File.DirInternal";
parent._ruta = parent.__c.File.getDirInternal();
 //BA.debugLineNum = 191;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 = 192;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 = 194;BA.debugLine="skmt.Initialize(ruta,\"kmt.db\", True)";
parent._skmt.Initialize(parent._ruta,"kmt.db",parent.__c.True);
 //BA.debugLineNum = 195;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 = 196;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 = 197;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 = 198;BA.debugLine="b.Position = 0";
parent._b.setPosition((int) (0));
 //BA.debugLineNum = 199;BA.debugLine="Dim cabonos As String = b.GetString(\"CLIENTE\")";
_cabonos = parent._b.GetString("CLIENTE");
 //BA.debugLineNum = 200;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 = 201;BA.debugLine="b_cxc.Visible = False";
parent._b_cxc.setVisible(parent.__c.False);
 if (true) break;

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

case 10:
//C
this.state = 11;
;
 //BA.debugLineNum = 205;BA.debugLine="xui.SetDataFolder(\"B4Xpdf\")";
parent._xui.SetDataFolder("B4Xpdf");
 //BA.debugLineNum = 206;BA.debugLine="File.Copy(File.DirAssets,\"intmex_logo_192x192.jpg";
parent.__c.File.Copy(parent.__c.File.getDirAssets(),"intmex_logo_192x192.jpg",parent._xui.getDefaultFolder(),"intmex_logo_192x192.jpg");
 //BA.debugLineNum = 207;BA.debugLine="File.Copy(File.DirAssets,\"mariana1.jpg\",xui.Defau";
parent.__c.File.Copy(parent.__c.File.getDirAssets(),"mariana1.jpg",parent._xui.getDefaultFolder(),"mariana1.jpg");
 //BA.debugLineNum = 208;BA.debugLine="Provider.Initialize";
parent._provider._initialize /*String*/ (ba);
 //BA.debugLineNum = 209;BA.debugLine="s.Position=0";
parent._s.setPosition((int) (0));
 //BA.debugLineNum = 210;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 = 211;BA.debugLine="c.Position=0";
parent._c.setPosition((int) (0));
 //BA.debugLineNum = 212;BA.debugLine="la_cuenta.Text = c.GetString(\"CAT_CL_CODIGO\")";
parent._la_cuenta.setText(BA.ObjectToCharSequence(parent._c.GetString("CAT_CL_CODIGO")));
 //BA.debugLineNum = 213;BA.debugLine="cuenta = c.GetString(\"CAT_CL_CODIGO\")";
parent._cuenta = parent._c.GetString("CAT_CL_CODIGO");
 //BA.debugLineNum = 214;BA.debugLine="La_nombre.Text = c.GetString(\"CAT_CL_NOMBRE\")";
parent._la_nombre.setText(BA.ObjectToCharSequence(parent._c.GetString("CAT_CL_NOMBRE")));
 //BA.debugLineNum = 215;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 = 216;BA.debugLine="la_col.Text = c.GetString(\"CAT_CL_COLONIA\")";
parent._la_col.setText(BA.ObjectToCharSequence(parent._c.GetString("CAT_CL_COLONIA")));
 //BA.debugLineNum = 217;BA.debugLine="la_edo.Text = c.GetString(\"CAT_CL_EDO\")";
parent._la_edo.setText(BA.ObjectToCharSequence(parent._c.GetString("CAT_CL_EDO")));
 //BA.debugLineNum = 219;BA.debugLine="l_entre1.Text = c.GetString(\"CAT_CL_CALLE1\")";
parent._l_entre1.setText(BA.ObjectToCharSequence(parent._c.GetString("CAT_CL_CALLE1")));
 //BA.debugLineNum = 220;BA.debugLine="l_entre2.Text = c.GetString(\"CAT_CL_CALLE2\")";
parent._l_entre2.setText(BA.ObjectToCharSequence(parent._c.GetString("CAT_CL_CALLE2")));
 //BA.debugLineNum = 221;BA.debugLine="l_atiende.Text = c.GetString(\"CAT_CL_ATIENDE1\")";
parent._l_atiende.setText(BA.ObjectToCharSequence(parent._c.GetString("CAT_CL_ATIENDE1")));
 //BA.debugLineNum = 222;BA.debugLine="l_atiende2.Text = c.GetString(\"CAT_CL_ATIENTE2\")";
parent._l_atiende2.setText(BA.ObjectToCharSequence(parent._c.GetString("CAT_CL_ATIENTE2")));
 //BA.debugLineNum = 223;BA.debugLine="la_saldotot.Text = c.GetString(\"CAT_CL_TELEFONO\"";
parent._la_saldotot.setText(BA.ObjectToCharSequence(parent._c.GetString("CAT_CL_TELEFONO")));
 //BA.debugLineNum = 224;BA.debugLine="la_saldooper.Text = c.GetString(\"CAT_CL_EMAIL\")";
parent._la_saldooper.setText(BA.ObjectToCharSequence(parent._c.GetString("CAT_CL_EMAIL")));
 //BA.debugLineNum = 225;BA.debugLine="l_total.Text = s.GetString(\"TOTAL_CLIE\")";
parent._l_total.setText(BA.ObjectToCharSequence(parent._s.GetString("TOTAL_CLIE")));
 //BA.debugLineNum = 226;BA.debugLine="total_cliente = s.GetString(\"TOTAL_CLIE\")";
parent._total_cliente = parent._s.GetString("TOTAL_CLIE");
 //BA.debugLineNum = 227;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 = 229;BA.debugLine="c.Close";
parent._c.Close();
 //BA.debugLineNum = 230;BA.debugLine="s.Close";
parent._s.Close();
 //BA.debugLineNum = 231;BA.debugLine="btAdmin.Initialize(\"BlueTeeth\")";
parent._btadmin.Initialize(ba,"BlueTeeth");
 //BA.debugLineNum = 232;BA.debugLine="cmp20.Initialize(\"Printer\")";
parent._cmp20.Initialize("Printer");
 //BA.debugLineNum = 233;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 = 234;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 = 235;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 = 236;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 = 252;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 = 965;BA.debugLine="Sub BT_QR_Click";
 //BA.debugLineNum = 973;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 = 1008;BA.debugLine="Sub calc_ean_checksum(number As String) As String";
 //BA.debugLineNum = 1009;BA.debugLine="Dim i As Int";
_i = 0;
 //BA.debugLineNum = 1010;BA.debugLine="Dim cO As Char";
_co = '\0';
 //BA.debugLineNum = 1011;BA.debugLine="Dim soma As Int";
_soma = 0;
 //BA.debugLineNum = 1012;BA.debugLine="Dim n As Int";
_n = 0;
 //BA.debugLineNum = 1013;BA.debugLine="Dim digit As Float";
_digit = 0f;
 //BA.debugLineNum = 1014;BA.debugLine="soma = 0";
_soma = (int) (0);
 //BA.debugLineNum = 1015;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 = 1016;BA.debugLine="digit = number.SubString2(i,i+1)";
_digit = (float)(Double.parseDouble(_number.substring(_i,(int) (_i+1))));
 //BA.debugLineNum = 1017;BA.debugLine="n= digit * ((i Mod 2) * 2 + 1)";
_n = (int) (_digit*((_i%2)*2+1));
 //BA.debugLineNum = 1018;BA.debugLine="soma=soma+n";
_soma = (int) (_soma+_n);
 }
};
 //BA.debugLineNum = 1020;BA.debugLine="Return number & ( ( 10 - ( soma Mod 10 )) Mod 10";
if (true) return _number+BA.NumberToString(((10-(_soma%10))%10));
 //BA.debugLineNum = 1021;BA.debugLine="End Sub";
return "";
}
public String  _camera1_picturetaken(byte[] _data) throws Exception{
String _filename = "";
String _dir = "";
String _dirp = "";
String _dir2 = "";
anywheresoftware.b4a.objects.B4XViewWrapper.B4XBitmapWrapper _img = null;
anywheresoftware.b4a.objects.streams.File.OutputStreamWrapper _out = null;
 //BA.debugLineNum = 2854;BA.debugLine="Sub Camera1_PictureTaken (Data() As Byte)";
 //BA.debugLineNum = 2856;BA.debugLine="If b_foto_inci.Text = \"Foto tienda\" Then";
if ((_b_foto_inci.getText()).equals("Foto tienda")) { 
 //BA.debugLineNum = 2858;BA.debugLine="DateTime.DateFormat=\"ddMMyyyyHHmmss\"";
__c.DateTime.setDateFormat("ddMMyyyyHHmmss");
 //BA.debugLineNum = 2859;BA.debugLine="fototomada = DateTime.Now & \"_cliente.jpg\"";
_fototomada = BA.NumberToString(__c.DateTime.getNow())+"_cliente.jpg";
 //BA.debugLineNum = 2860;BA.debugLine="Dim filename As String = fototomada";
_filename = _fototomada;
 //BA.debugLineNum = 2861;BA.debugLine="Dim dir As String = File.DirInternal";
_dir = __c.File.getDirInternal();
 //BA.debugLineNum = 2862;BA.debugLine="camEx.SavePictureToFile(Data, dir, filename)";
_camex._savepicturetofile /*String*/ (_data,_dir,_filename);
 //BA.debugLineNum = 2863;BA.debugLine="camEx.StartPreview 'restart preview";
_camex._startpreview /*String*/ ();
 //BA.debugLineNum = 2864;BA.debugLine="ToastMessageShow(\"Picture saved.\" & CRLF  & \"Fil";
__c.ToastMessageShow(BA.ObjectToCharSequence("Picture saved."+__c.CRLF+"File size: "+BA.NumberToString(__c.File.Size(_dir,_filename))),__c.True);
 //BA.debugLineNum = 2866;BA.debugLine="Dim Dirp As String = File.DirInternal";
_dirp = __c.File.getDirInternal();
 //BA.debugLineNum = 2867;BA.debugLine="Dim dir As String";
_dir = "";
 //BA.debugLineNum = 2868;BA.debugLine="Dim Dir2 As String";
_dir2 = "";
 //BA.debugLineNum = 2869;BA.debugLine="Try";
try { //BA.debugLineNum = 2870;BA.debugLine="File.MakeDir(Dirp,\"/adm\")";
__c.File.MakeDir(_dirp,"/adm");
 //BA.debugLineNum = 2871;BA.debugLine="dir = \"/amd\"";
_dir = "/amd";
 //BA.debugLineNum = 2872;BA.debugLine="Log(\"creado en promotoria \" & Dirp & dir)";
__c.LogImpl("344761106","creado en promotoria "+_dirp+_dir,0);
 } 
       catch (Exception e17) {
			ba.setLastException(e17); //BA.debugLineNum = 2874;BA.debugLine="dir = \"\"";
_dir = "";
 //BA.debugLineNum = 2875;BA.debugLine="Log(\"creado en raiz\")";
__c.LogImpl("344761109","creado en raiz",0);
 };
 //BA.debugLineNum = 2878;BA.debugLine="Try";
try { //BA.debugLineNum = 2879;BA.debugLine="File.MakeDir(Dirp & dir,\"/reduccion\")";
__c.File.MakeDir(_dirp+_dir,"/reduccion");
 //BA.debugLineNum = 2880;BA.debugLine="Dir2 = \"/reduccion\"";
_dir2 = "/reduccion";
 //BA.debugLineNum = 2881;BA.debugLine="Log(\"creado en promotoria \" & Dirp & dir & Dir2";
__c.LogImpl("344761115","creado en promotoria "+_dirp+_dir+_dir2,0);
 } 
       catch (Exception e25) {
			ba.setLastException(e25); //BA.debugLineNum = 2883;BA.debugLine="dir = \"\"";
_dir = "";
 //BA.debugLineNum = 2884;BA.debugLine="Log(\"creado en raiz\")";
__c.LogImpl("344761118","creado en raiz",0);
 };
 //BA.debugLineNum = 2887;BA.debugLine="DateTime.DateFormat = \"MM/dd/yyyy\"";
__c.DateTime.setDateFormat("MM/dd/yyyy");
 //BA.debugLineNum = 2888;BA.debugLine="DateTime.TimeFormat = \"HH:mm:ss\"";
__c.DateTime.setTimeFormat("HH:mm:ss");
 //BA.debugLineNum = 2889;BA.debugLine="sDate = DateTime.Date(DateTime.Now)";
_sdate = __c.DateTime.Date(__c.DateTime.getNow());
 //BA.debugLineNum = 2890;BA.debugLine="sTime = DateTime.Time(DateTime.Now)";
_stime = __c.DateTime.Time(__c.DateTime.getNow());
 //BA.debugLineNum = 2892;BA.debugLine="camEx.SavePictureToFile(Data, Dirp&dir, filename";
_camex._savepicturetofile /*String*/ (_data,_dirp+_dir,_filename);
 //BA.debugLineNum = 2893;BA.debugLine="camEx.StartPreview 'restart preview";
_camex._startpreview /*String*/ ();
 //BA.debugLineNum = 2894;BA.debugLine="ToastMessageShow(\"Picture saved.\" & CRLF  & \"Fil";
__c.ToastMessageShow(BA.ObjectToCharSequence("Picture saved."+__c.CRLF+"File size: "+BA.NumberToString(__c.File.Size(_dir,_filename))+_dir+","+_filename),__c.True);
 //BA.debugLineNum = 2895;BA.debugLine="Log(\"Picture saved.\" & CRLF  & \"File size: \" & F";
__c.LogImpl("344761129","Picture saved."+__c.CRLF+"File size: "+BA.NumberToString(__c.File.Size(_dir,_filename))+_dir+","+_filename,0);
 //BA.debugLineNum = 2897;BA.debugLine="Dim img As B4XBitmap = xui.LoadBitmapResize(File";
_img = new anywheresoftware.b4a.objects.B4XViewWrapper.B4XBitmapWrapper();
_img = _xui.LoadBitmapResize(__c.File.getDirInternal()+_dir,_filename,(int) (450),(int) (600),__c.True);
 //BA.debugLineNum = 2898;BA.debugLine="Dim out As OutputStream = File.OpenOutput(File.D";
_out = new anywheresoftware.b4a.objects.streams.File.OutputStreamWrapper();
_out = __c.File.OpenOutput(__c.File.getDirInternal()+_dir+_dir2,_filename,__c.False);
 //BA.debugLineNum = 2899;BA.debugLine="img.WriteToStream(out, 100, \"PNG\")";
_img.WriteToStream((java.io.OutputStream)(_out.getObject()),(int) (100),BA.getEnumFromString(android.graphics.Bitmap.CompressFormat.class,"PNG"));
 //BA.debugLineNum = 2900;BA.debugLine="out.Close";
_out.Close();
 //BA.debugLineNum = 2902;BA.debugLine="Starter.skmt.ExecNonQuery2(\"INSERT INTO FOTOINIC";
_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("INSERT INTO FOTOINICIAL (RUTAA, ALMACEN, LATITUD, LONGITUD, FECHAHORA, FOTO, USUARIO) VALUES (?,?,?,?,?,?,?)",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(_la_ruta),(Object)(_almacen),(Object)(_b4xpages._mainpage /*adm.keymon.com.mx.b4xmainpage*/ (ba)._lat_gps /*String*/ ),(Object)(_b4xpages._mainpage /*adm.keymon.com.mx.b4xmainpage*/ (ba)._lon_gps /*String*/ ),(Object)(_sdate+" "+_stime),(Object)(__c.File.ReadBytes(__c.File.getDirInternal()+_dir+_dir2,_fototomada)),(Object)(_subs._traeusuariodebd /*String*/ (ba))}));
 //BA.debugLineNum = 2903;BA.debugLine="b_foto_inci.Text = \"Foto usuario\"";
_b_foto_inci.setText(BA.ObjectToCharSequence("Foto usuario"));
 //BA.debugLineNum = 2904;BA.debugLine="ChangeCamera_Click";
_changecamera_click();
 }else if((_b_foto_inci.getText()).equals("Foto usuario")) { 
 //BA.debugLineNum = 2906;BA.debugLine="DateTime.DateFormat=\"ddMMyyyyHHmmss\"";
__c.DateTime.setDateFormat("ddMMyyyyHHmmss");
 //BA.debugLineNum = 2907;BA.debugLine="fototomada = DateTime.Now & \"_cliente.jpg\"";
_fototomada = BA.NumberToString(__c.DateTime.getNow())+"_cliente.jpg";
 //BA.debugLineNum = 2908;BA.debugLine="Dim filename As String = fototomada";
_filename = _fototomada;
 //BA.debugLineNum = 2909;BA.debugLine="Dim dir As String = File.DirInternal";
_dir = __c.File.getDirInternal();
 //BA.debugLineNum = 2910;BA.debugLine="camEx.SavePictureToFile(Data, dir, filename)";
_camex._savepicturetofile /*String*/ (_data,_dir,_filename);
 //BA.debugLineNum = 2911;BA.debugLine="camEx.StartPreview 'restart preview";
_camex._startpreview /*String*/ ();
 //BA.debugLineNum = 2912;BA.debugLine="ToastMessageShow(\"Picture saved.\" & CRLF  & \"Fil";
__c.ToastMessageShow(BA.ObjectToCharSequence("Picture saved."+__c.CRLF+"File size: "+BA.NumberToString(__c.File.Size(_dir,_filename))),__c.True);
 //BA.debugLineNum = 2914;BA.debugLine="Dim Dirp As String = File.DirInternal";
_dirp = __c.File.getDirInternal();
 //BA.debugLineNum = 2915;BA.debugLine="Dim dir As String";
_dir = "";
 //BA.debugLineNum = 2916;BA.debugLine="Dim Dir2 As String";
_dir2 = "";
 //BA.debugLineNum = 2917;BA.debugLine="Try";
try { //BA.debugLineNum = 2918;BA.debugLine="File.MakeDir(Dirp,\"/adm\")";
__c.File.MakeDir(_dirp,"/adm");
 //BA.debugLineNum = 2919;BA.debugLine="dir = \"/amd\"";
_dir = "/amd";
 //BA.debugLineNum = 2920;BA.debugLine="Log(\"creado en promotoria \" & Dirp & dir)";
__c.LogImpl("344761154","creado en promotoria "+_dirp+_dir,0);
 } 
       catch (Exception e59) {
			ba.setLastException(e59); //BA.debugLineNum = 2922;BA.debugLine="dir = \"\"";
_dir = "";
 //BA.debugLineNum = 2923;BA.debugLine="Log(\"creado en raiz\")";
__c.LogImpl("344761157","creado en raiz",0);
 };
 //BA.debugLineNum = 2926;BA.debugLine="Try";
try { //BA.debugLineNum = 2927;BA.debugLine="File.MakeDir(Dirp & dir,\"/reduccion\")";
__c.File.MakeDir(_dirp+_dir,"/reduccion");
 //BA.debugLineNum = 2928;BA.debugLine="Dir2 = \"/reduccion\"";
_dir2 = "/reduccion";
 //BA.debugLineNum = 2929;BA.debugLine="Log(\"creado en promotoria \" & Dirp & dir & Dir2";
__c.LogImpl("344761163","creado en promotoria "+_dirp+_dir+_dir2,0);
 } 
       catch (Exception e67) {
			ba.setLastException(e67); //BA.debugLineNum = 2931;BA.debugLine="dir = \"\"";
_dir = "";
 //BA.debugLineNum = 2932;BA.debugLine="Log(\"creado en raiz\")";
__c.LogImpl("344761166","creado en raiz",0);
 };
 //BA.debugLineNum = 2935;BA.debugLine="DateTime.DateFormat = \"MM/dd/yyyy\"";
__c.DateTime.setDateFormat("MM/dd/yyyy");
 //BA.debugLineNum = 2936;BA.debugLine="DateTime.TimeFormat = \"HH:mm:ss\"";
__c.DateTime.setTimeFormat("HH:mm:ss");
 //BA.debugLineNum = 2937;BA.debugLine="sDate = DateTime.Date(DateTime.Now)";
_sdate = __c.DateTime.Date(__c.DateTime.getNow());
 //BA.debugLineNum = 2938;BA.debugLine="sTime = DateTime.Time(DateTime.Now)";
_stime = __c.DateTime.Time(__c.DateTime.getNow());
 //BA.debugLineNum = 2940;BA.debugLine="camEx.SavePictureToFile(Data, Dirp&dir, filename";
_camex._savepicturetofile /*String*/ (_data,_dirp+_dir,_filename);
 //BA.debugLineNum = 2941;BA.debugLine="camEx.StartPreview 'restart preview";
_camex._startpreview /*String*/ ();
 //BA.debugLineNum = 2942;BA.debugLine="ToastMessageShow(\"Picture saved.\" & CRLF  & \"Fil";
__c.ToastMessageShow(BA.ObjectToCharSequence("Picture saved."+__c.CRLF+"File size: "+BA.NumberToString(__c.File.Size(_dir,_filename))+_dir+","+_filename),__c.True);
 //BA.debugLineNum = 2943;BA.debugLine="Log(\"Picture saved.\" & CRLF  & \"File size: \" & F";
__c.LogImpl("344761177","Picture saved."+__c.CRLF+"File size: "+BA.NumberToString(__c.File.Size(_dir,_filename))+_dir+","+_filename,0);
 //BA.debugLineNum = 2945;BA.debugLine="Dim img As B4XBitmap = xui.LoadBitmapResize(File";
_img = new anywheresoftware.b4a.objects.B4XViewWrapper.B4XBitmapWrapper();
_img = _xui.LoadBitmapResize(__c.File.getDirInternal()+_dir,_filename,(int) (450),(int) (600),__c.True);
 //BA.debugLineNum = 2946;BA.debugLine="Dim out As OutputStream = File.OpenOutput(File.D";
_out = new anywheresoftware.b4a.objects.streams.File.OutputStreamWrapper();
_out = __c.File.OpenOutput(__c.File.getDirInternal()+_dir+_dir2,_filename,__c.False);
 //BA.debugLineNum = 2947;BA.debugLine="img.WriteToStream(out, 100, \"PNG\")";
_img.WriteToStream((java.io.OutputStream)(_out.getObject()),(int) (100),BA.getEnumFromString(android.graphics.Bitmap.CompressFormat.class,"PNG"));
 //BA.debugLineNum = 2948;BA.debugLine="out.Close";
_out.Close();
 //BA.debugLineNum = 2951;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"UPDATE FOT";
_b4xpages._mainpage /*adm.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("UPDATE FOTOINICIAL set FOTO2 = ? where USUARIO = ? and RUTAA = ? and ALMACEN = ? ",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(__c.File.ReadBytes(__c.File.getDirInternal()+_dir+_dir2,_fototomada)),(Object)(_subs._traeusuariodebd /*String*/ (ba)),(Object)(_la_ruta),(Object)(_almacen)}));
 //BA.debugLineNum = 2952;BA.debugLine="b_foto_inci.Text = \"Foto tienda\"";
_b_foto_inci.setText(BA.ObjectToCharSequence("Foto tienda"));
 //BA.debugLineNum = 2953;BA.debugLine="ChangeCamera_Click";
_changecamera_click();
 //BA.debugLineNum = 2954;BA.debugLine="p_camara.Visible = False";
_p_camara.setVisible(__c.False);
 //BA.debugLineNum = 2955;BA.debugLine="StopCamera";
_stopcamera();
 //BA.debugLineNum = 2956;BA.debugLine="If la_cuenta.Text = \"0\" Then";
if ((_la_cuenta.getText()).equals("0")) { 
 //BA.debugLineNum = 2957;BA.debugLine="B4XPages.MainPage.tipo_venta = \"ABORDO\"";
_b4xpages._mainpage /*adm.keymon.com.mx.b4xmainpage*/ (ba)._tipo_venta /*String*/  = "ABORDO";
 }else if((_la_cuenta.getText()).equals("1")) { 
 //BA.debugLineNum = 2959;BA.debugLine="B4XPages.MainPage.tipo_venta = \"RECARGA\"";
_b4xpages._mainpage /*adm.keymon.com.mx.b4xmainpage*/ (ba)._tipo_venta /*String*/  = "RECARGA";
 }else {
 //BA.debugLineNum = 2961;BA.debugLine="B4XPages.MainPage.tipo_venta = \"PREVENTA\"";
_b4xpages._mainpage /*adm.keymon.com.mx.b4xmainpage*/ (ba)._tipo_venta /*String*/  = "PREVENTA";
 };
 //BA.debugLineNum = 2963;BA.debugLine="B4XPages.ShowPage(\"productos\")";
_b4xpages._showpage /*String*/ (ba,"productos");
 };
 //BA.debugLineNum = 2966;BA.debugLine="End Sub";
return "";
}
public String  _camera1_ready(boolean _success) throws Exception{
 //BA.debugLineNum = 2841;BA.debugLine="Sub Camera1_Ready (Success As Boolean)";
 //BA.debugLineNum = 2842;BA.debugLine="If Success Then";
if (_success) { 
 //BA.debugLineNum = 2843;BA.debugLine="camEx.SetJpegQuality(90)";
_camex._setjpegquality /*String*/ ((int) (90));
 //BA.debugLineNum = 2844;BA.debugLine="camEx.SetContinuousAutoFocus";
_camex._setcontinuousautofocus /*String*/ ();
 //BA.debugLineNum = 2845;BA.debugLine="camEx.CommitParameters";
_camex._commitparameters /*String*/ ();
 //BA.debugLineNum = 2846;BA.debugLine="camEx.StartPreview";
_camex._startpreview /*String*/ ();
 //BA.debugLineNum = 2847;BA.debugLine="Log(camEx.GetPreviewSize)";
__c.LogImpl("344695558",BA.ObjectToString(_camex._getpreviewsize /*adm.keymon.com.mx.cameraexclass._camerasize*/ ()),0);
 }else {
 //BA.debugLineNum = 2849;BA.debugLine="ToastMessageShow(\"Cannot open camera.\", True)";
__c.ToastMessageShow(BA.ObjectToCharSequence("Cannot open camera."),__c.True);
 };
 //BA.debugLineNum = 2851;BA.debugLine="End Sub";
return "";
}
public String  _cb_factura_checkedchange(boolean _checked) throws Exception{
 //BA.debugLineNum = 2221;BA.debugLine="Private Sub cb_factura_CheckedChange(Checked As Bo";
 //BA.debugLineNum = 2223;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 = 2224;BA.debugLine="End Sub";
return "";
}
public String  _changecamera_click() throws Exception{
 //BA.debugLineNum = 2969;BA.debugLine="Sub ChangeCamera_Click";
 //BA.debugLineNum = 2970;BA.debugLine="camEx.Release";
_camex._release /*String*/ ();
 //BA.debugLineNum = 2971;BA.debugLine="frontCamera = Not(frontCamera)";
_frontcamera = __c.Not(_frontcamera);
 //BA.debugLineNum = 2972;BA.debugLine="InitializeCamera";
_initializecamera();
 //BA.debugLineNum = 2973;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 adm.keymon.com.mx.dbrequestmanager();
 //BA.debugLineNum = 10;BA.debugLine="Dim cmd As DBCommand";
_cmd = new adm.keymon.com.mx.dbrequestmanager._dbcommand();
 //BA.debugLineNum = 11;BA.debugLine="Dim ime As IME";
_ime = new anywheresoftware.b4a.objects.IME();
 //BA.debugLineNum = 12;BA.debugLine="Dim Provider As FileProvider";
_provider = new adm.keymon.com.mx.fileprovider();
 //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\"";
_tipo_venta = "PREVENTA";
 //BA.debugLineNum = 31;BA.debugLine="Dim MAC_IMPRESORA As String";
_mac_impresora = "";
 //BA.debugLineNum = 32;BA.debugLine="Dim Printer1 As EscPosPrinter";
_printer1 = new adm.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 adm.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 = 158;BA.debugLine="Private p_camara As Panel";
_p_camara = new anywheresoftware.b4a.objects.PanelWrapper();
 //BA.debugLineNum = 159;BA.debugLine="Private p_cam As Panel";
_p_cam = new anywheresoftware.b4a.objects.PanelWrapper();
 //BA.debugLineNum = 162;BA.debugLine="Private b_foto_inci As Button";
_b_foto_inci = new anywheresoftware.b4a.objects.ButtonWrapper();
 //BA.debugLineNum = 163;BA.debugLine="Private camEx As CameraExClass";
_camex = new adm.keymon.com.mx.cameraexclass();
 //BA.debugLineNum = 164;BA.debugLine="Private frontCamera As Boolean = False";
_frontcamera = __c.False;
 //BA.debugLineNum = 165;BA.debugLine="Dim fototomada As String = \"0\"";
_fototomada = "0";
 //BA.debugLineNum = 166;BA.debugLine="Private p_tipopago As Panel";
_p_tipopago = new anywheresoftware.b4a.objects.PanelWrapper();
 //BA.debugLineNum = 167;BA.debugLine="Private rb_efectivo As RadioButton";
_rb_efectivo = new anywheresoftware.b4a.objects.CompoundButtonWrapper.RadioButtonWrapper();
 //BA.debugLineNum = 168;BA.debugLine="Private rb_tranfe As RadioButton";
_rb_tranfe = new anywheresoftware.b4a.objects.CompoundButtonWrapper.RadioButtonWrapper();
 //BA.debugLineNum = 169;BA.debugLine="Private rb_tarjetadebito As RadioButton";
_rb_tarjetadebito = new anywheresoftware.b4a.objects.CompoundButtonWrapper.RadioButtonWrapper();
 //BA.debugLineNum = 170;BA.debugLine="Private rb_tarjetacredito As RadioButton";
_rb_tarjetacredito = new anywheresoftware.b4a.objects.CompoundButtonWrapper.RadioButtonWrapper();
 //BA.debugLineNum = 171;BA.debugLine="Private et_com_tp As EditText";
_et_com_tp = new anywheresoftware.b4a.objects.EditTextWrapper();
 //BA.debugLineNum = 172;BA.debugLine="Private b_cancel_tp As Button";
_b_cancel_tp = new anywheresoftware.b4a.objects.ButtonWrapper();
 //BA.debugLineNum = 173;BA.debugLine="Private b_acept_tp As Button";
_b_acept_tp = new anywheresoftware.b4a.objects.ButtonWrapper();
 //BA.debugLineNum = 174;BA.debugLine="Private chb_impreso As CheckBox";
_chb_impreso = new anywheresoftware.b4a.objects.CompoundButtonWrapper.CheckBoxWrapper();
 //BA.debugLineNum = 175;BA.debugLine="Dim nombrepdf As String";
_nombrepdf = "";
 //BA.debugLineNum = 176;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 = 2692;BA.debugLine="Sub CreateListItem(mostrar As String, mostrar1 As";
 //BA.debugLineNum = 2693;BA.debugLine="Dim p As B4XView = xui.CreatePanel(\"\")";
_p = new anywheresoftware.b4a.objects.B4XViewWrapper();
_p = _xui.CreatePanel(ba,"");
 //BA.debugLineNum = 2694;BA.debugLine="p.SetLayoutAnimated(0, 0, 0, 1, 10)";
_p.SetLayoutAnimated((int) (0),(int) (0),(int) (0),(int) (1),(int) (10));
 //BA.debugLineNum = 2695;BA.debugLine="p.LoadLayout(\"folioabono\")";
_p.LoadLayout("folioabono",ba);
 //BA.debugLineNum = 2696;BA.debugLine="p.Height= 32dip";
_p.setHeight(__c.DipToCurrent((int) (32)));
 //BA.debugLineNum = 2697;BA.debugLine="p.Width = 80dip";
_p.setWidth(__c.DipToCurrent((int) (80)));
 //BA.debugLineNum = 2699;BA.debugLine="l_folio.Text = mostrar";
_l_folio.setText(BA.ObjectToCharSequence(_mostrar));
 //BA.debugLineNum = 2700;BA.debugLine="l_saldo.Text = mostrar1";
_l_saldo.setText(BA.ObjectToCharSequence(_mostrar1));
 //BA.debugLineNum = 2703;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 = 2704;BA.debugLine="End Sub";
return null;
}
public String  _cuest_preguntacontestada(anywheresoftware.b4a.objects.collections.Map _m) throws Exception{
 //BA.debugLineNum = 2706;BA.debugLine="Sub cuest_preguntaContestada(m As Map)";
 //BA.debugLineNum = 2708;BA.debugLine="Log(m)";
__c.LogImpl("344433410",BA.ObjectToString(_m),0);
 //BA.debugLineNum = 2711;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 = 2712;BA.debugLine="DateTime.DateFormat = \"dd/MM/yyyy\"";
__c.DateTime.setDateFormat("dd/MM/yyyy");
 //BA.debugLineNum = 2713;BA.debugLine="DateTime.TimeFormat = \"HH:mm:ss\"";
__c.DateTime.setTimeFormat("HH:mm:ss");
 //BA.debugLineNum = 2714;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 = 2715;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)))+"', '"+__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 = 2716;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 = 2718;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 = 2719;BA.debugLine="Log(\"Tiendajon / Ventana / Kiosko\")";
__c.LogImpl("344433421","Tiendajon / Ventana / Kiosko",0);
 //BA.debugLineNum = 2720;BA.debugLine="ToastMessageShow(\"Tiendajon / Ventana / Kiosko";
__c.ToastMessageShow(BA.ObjectToCharSequence("Tiendajon / Ventana / Kiosko"),__c.False);
 //BA.debugLineNum = 2721;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 = 2723;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 = 2726;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 = 2727;BA.debugLine="Log(\"Mini-Super\")";
__c.LogImpl("344433429","Mini-Super",0);
 //BA.debugLineNum = 2728;BA.debugLine="ToastMessageShow(\"Mini-Super\", False)";
__c.ToastMessageShow(BA.ObjectToCharSequence("Mini-Super"),__c.False);
 //BA.debugLineNum = 2729;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 = 2731;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 = 2734;BA.debugLine="Log(\"|\"&m.Get(\"respuesta\")&\"|\")";
__c.LogImpl("344433436","|"+BA.ObjectToString(_m.Get((Object)("respuesta")))+"|",0);
 //BA.debugLineNum = 2735;BA.debugLine="If m.Get(\"respuesta\") = \"Si\" Then";
if ((_m.Get((Object)("respuesta"))).equals((Object)("Si"))) { 
 //BA.debugLineNum = 2736;BA.debugLine="Log(\"Miscelanea\")";
__c.LogImpl("344433438","Miscelanea",0);
 //BA.debugLineNum = 2737;BA.debugLine="ToastMessageShow(\"Miscelanea\", False)";
__c.ToastMessageShow(BA.ObjectToCharSequence("Miscelanea"),__c.False);
 //BA.debugLineNum = 2738;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 = 2740;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 = 2743;BA.debugLine="If m.Get(\"respuesta\") = \"No\" Then";
if ((_m.Get((Object)("respuesta"))).equals((Object)("No"))) { 
 //BA.debugLineNum = 2744;BA.debugLine="Log(\"Abarrotera\")";
__c.LogImpl("344433446","Abarrotera",0);
 //BA.debugLineNum = 2745;BA.debugLine="ToastMessageShow(\"Abarrotera\", False)";
__c.ToastMessageShow(BA.ObjectToCharSequence("Abarrotera"),__c.False);
 //BA.debugLineNum = 2746;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 = 2748;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 = 2751;BA.debugLine="Log(m.Get(\"respuesta\"))";
__c.LogImpl("344433453",BA.ObjectToString(_m.Get((Object)("respuesta"))),0);
 //BA.debugLineNum = 2752;BA.debugLine="ToastMessageShow(m.Get(\"respuesta\"), False)";
__c.ToastMessageShow(BA.ObjectToCharSequence(_m.Get((Object)("respuesta"))),__c.False);
 //BA.debugLineNum = 2757;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 = 2760;BA.debugLine="Log(m.Get(\"respuesta\"))";
__c.LogImpl("344433462",BA.ObjectToString(_m.Get((Object)("respuesta"))),0);
 //BA.debugLineNum = 2761;BA.debugLine="ToastMessageShow(m.Get(\"respuesta\"), False)";
__c.ToastMessageShow(BA.ObjectToCharSequence(_m.Get((Object)("respuesta"))),__c.False);
 //BA.debugLineNum = 2762;BA.debugLine="Log(\">>>>>>>>>>  \" & cuest.encuestaIniciada)";
__c.LogImpl("344433464",">>>>>>>>>>  "+BA.ObjectToString(_cuest._encuestainiciada /*boolean*/ ),0);
 //BA.debugLineNum = 2763;BA.debugLine="cuest.encuestaIniciada = False";
_cuest._encuestainiciada /*boolean*/  = __c.False;
 //BA.debugLineNum = 2764;BA.debugLine="Log(\">>>>>>>>>>  \" & cuest.encuestaIniciada)";
__c.LogImpl("344433466",">>>>>>>>>>  "+BA.ObjectToString(_cuest._encuestainiciada /*boolean*/ ),0);
 //BA.debugLineNum = 2767;BA.debugLine="B4XPage_Appear";
_b4xpage_appear();
 break; }
}
;
 //BA.debugLineNum = 2770;BA.debugLine="End Sub";
return "";
}
public String  _datos_click() throws Exception{
 //BA.debugLineNum = 654;BA.debugLine="Sub DATOS_Click";
 //BA.debugLineNum = 655;BA.debugLine="B4XPages.ShowPage(\"telefonos\")";
_b4xpages._showpage /*String*/ (ba,"telefonos");
 //BA.debugLineNum = 656;BA.debugLine="End Sub";
return "";
}
public String  _gest_click() throws Exception{
 //BA.debugLineNum = 547;BA.debugLine="Sub gest_Click";
 //BA.debugLineNum = 549;BA.debugLine="c = Starter.skmt.ExecQuery(\"SELECT * FROM FOTOINI";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("SELECT * FROM FOTOINICIAL")));
 //BA.debugLineNum = 550;BA.debugLine="If c.RowCount = 0 Then";
if (_c.getRowCount()==0) { 
 //BA.debugLineNum = 551;BA.debugLine="p_camara.Visible = True";
_p_camara.setVisible(__c.True);
 //BA.debugLineNum = 552;BA.debugLine="InitializeCamera";
_initializecamera();
 //BA.debugLineNum = 553;BA.debugLine="Subs.panelVisible(p_camara, 0, 0)";
_subs._panelvisible /*String*/ (ba,_p_camara,(int) (0),(int) (0));
 //BA.debugLineNum = 554;BA.debugLine="b_foto_inci.Text = \"Foto tienda\"";
_b_foto_inci.setText(BA.ObjectToCharSequence("Foto tienda"));
 }else {
 //BA.debugLineNum = 557;BA.debugLine="If la_cuenta.Text = \"0\" Then";
if ((_la_cuenta.getText()).equals("0")) { 
 //BA.debugLineNum = 558;BA.debugLine="B4XPages.MainPage.tipo_venta = \"ABORDO\"";
_b4xpages._mainpage /*adm.keymon.com.mx.b4xmainpage*/ (ba)._tipo_venta /*String*/  = "ABORDO";
 }else if((_la_cuenta.getText()).equals("1")) { 
 //BA.debugLineNum = 560;BA.debugLine="B4XPages.MainPage.tipo_venta = \"RECARGA\"";
_b4xpages._mainpage /*adm.keymon.com.mx.b4xmainpage*/ (ba)._tipo_venta /*String*/  = "RECARGA";
 }else {
 //BA.debugLineNum = 562;BA.debugLine="B4XPages.MainPage.tipo_venta = \"PREVENTA\"";
_b4xpages._mainpage /*adm.keymon.com.mx.b4xmainpage*/ (ba)._tipo_venta /*String*/  = "PREVENTA";
 };
 //BA.debugLineNum = 594;BA.debugLine="B4XPages.ShowPage(\"productos\")";
_b4xpages._showpage /*String*/ (ba,"productos");
 };
 //BA.debugLineNum = 596;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 = 504;BA.debugLine="Sub GPS_LocationChanged (Location1 As Location)";
 //BA.debugLineNum = 506;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 = 507;BA.debugLine="B4XPages.MainPage.lat_gps = Tracker.FLP.GetLastK";
_b4xpages._mainpage /*adm.keymon.com.mx.b4xmainpage*/ (ba)._lat_gps /*String*/  = BA.NumberToString(_tracker._flp /*uk.co.martinpearman.b4a.fusedlocationprovider.FusedLocationProviderWrapper*/ .GetLastKnownLocation().getLatitude());
 //BA.debugLineNum = 508;BA.debugLine="B4XPages.MainPage.lon_gps = Tracker.FLP.GetLastK";
_b4xpages._mainpage /*adm.keymon.com.mx.b4xmainpage*/ (ba)._lon_gps /*String*/  = BA.NumberToString(_tracker._flp /*uk.co.martinpearman.b4a.fusedlocationprovider.FusedLocationProviderWrapper*/ .GetLastKnownLocation().getLongitude());
 };
 //BA.debugLineNum = 514;BA.debugLine="Dim l1, l2 As Location";
_l1 = new anywheresoftware.b4a.gps.LocationWrapper();
_l2 = new anywheresoftware.b4a.gps.LocationWrapper();
 //BA.debugLineNum = 515;BA.debugLine="l1.Initialize2(B4XPages.MainPage.lat_gps, B4XPage";
_l1.Initialize2(_b4xpages._mainpage /*adm.keymon.com.mx.b4xmainpage*/ (ba)._lat_gps /*String*/ ,_b4xpages._mainpage /*adm.keymon.com.mx.b4xmainpage*/ (ba)._lon_gps /*String*/ );
 //BA.debugLineNum = 517;BA.debugLine="l2.Initialize2(m_lat, m_lon)";
_l2.Initialize2(_m_lat,_m_lon);
 //BA.debugLineNum = 519;BA.debugLine="BT_QR.Enabled = True";
_bt_qr.setEnabled(__c.True);
 //BA.debugLineNum = 520;BA.debugLine="LA_GPS.TextColor = Colors.Blue";
_la_gps.setTextColor(__c.Colors.Blue);
 //BA.debugLineNum = 521;BA.debugLine="LA_GPS.Text = \"CON UBICACION GPS\"";
_la_gps.setText(BA.ObjectToCharSequence("CON UBICACION GPS"));
 //BA.debugLineNum = 524;BA.debugLine="distance =    l1.DistanceTo(l2)  'the result is i";
_distance = (long) (_l1.DistanceTo((android.location.Location)(_l2.getObject())));
 //BA.debugLineNum = 526;BA.debugLine="If distance < 100000000000000000000000000000000 T";
if (_distance<100000000000000000000000000000000d) { 
 //BA.debugLineNum = 527;BA.debugLine="LA_GEO.TextColor = Colors.Blue";
_la_geo.setTextColor(__c.Colors.Blue);
 //BA.debugLineNum = 528;BA.debugLine="Tels.Visible = True";
_tels.setVisible(__c.True);
 //BA.debugLineNum = 529;BA.debugLine="gest.Visible = True";
_gest.setVisible(__c.True);
 //BA.debugLineNum = 530;BA.debugLine="b_ventaabordo.Visible = True";
_b_ventaabordo.setVisible(__c.True);
 }else {
 //BA.debugLineNum = 532;BA.debugLine="Tels.Visible = False";
_tels.setVisible(__c.False);
 //BA.debugLineNum = 533;BA.debugLine="gest.Visible = False";
_gest.setVisible(__c.False);
 //BA.debugLineNum = 534;BA.debugLine="b_ventaabordo.Visible = False";
_b_ventaabordo.setVisible(__c.False);
 //BA.debugLineNum = 535;BA.debugLine="LA_GEO.TextColor = Colors.Red";
_la_geo.setTextColor(__c.Colors.Red);
 };
 //BA.debugLineNum = 537;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 = 538;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"DELETE FROM";
_b4xpages._mainpage /*adm.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("DELETE FROM HIST_GPS");
 //BA.debugLineNum = 539;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"INSERT INTO";
_b4xpages._mainpage /*adm.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 /*adm.keymon.com.mx.b4xmainpage*/ (ba)._lat_gps /*String*/ ),(Object)(_b4xpages._mainpage /*adm.keymon.com.mx.b4xmainpage*/ (ba)._lon_gps /*String*/ )}));
 //BA.debugLineNum = 540;BA.debugLine="CallSubDelayed(Tracker, \"CreateLocationRequest\")";
__c.CallSubDelayed(ba,(Object)(_tracker.getObject()),"CreateLocationRequest");
 //BA.debugLineNum = 541;BA.debugLine="End Sub";
return "";
}
public String  _guadaventa2() throws Exception{
int _cbfactura = 0;
 //BA.debugLineNum = 826;BA.debugLine="Sub GUADAVENTA2";
 //BA.debugLineNum = 827;BA.debugLine="Log(B4XPages.MainPage.recarga)";
__c.LogImpl("341811969",_b4xpages._mainpage /*adm.keymon.com.mx.b4xmainpage*/ (ba)._recarga /*String*/ ,0);
 //BA.debugLineNum = 828;BA.debugLine="If B4XPages.MainPage.recarga = \"0\" Then";
if ((_b4xpages._mainpage /*adm.keymon.com.mx.b4xmainpage*/ (ba)._recarga /*String*/ ).equals("0")) { 
 //BA.debugLineNum = 829;BA.debugLine="DateTime.DateFormat = \"MM/dd/yyyy\"";
__c.DateTime.setDateFormat("MM/dd/yyyy");
 //BA.debugLineNum = 830;BA.debugLine="sDate=DateTime.Date(DateTime.Now)";
_sdate = __c.DateTime.Date(__c.DateTime.getNow());
 //BA.debugLineNum = 831;BA.debugLine="sTime=DateTime.Time(DateTime.Now)";
_stime = __c.DateTime.Time(__c.DateTime.getNow());
 //BA.debugLineNum = 832;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 /*adm.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("Select CUENTA from cuentaa")));
 //BA.debugLineNum = 833;BA.debugLine="c.Position=0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 834;BA.debugLine="clie_id = c.GetString(\"CUENTA\")";
_clie_id = _c.GetString("CUENTA");
 //BA.debugLineNum = 835;BA.debugLine="c.Close";
_c.Close();
 //BA.debugLineNum = 836;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 /*adm.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select USUARIO from usuarioa")));
 //BA.debugLineNum = 837;BA.debugLine="c.Position=0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 838;BA.debugLine="usuario = c.GetString(\"USUARIO\")";
_usuario = _c.GetString("USUARIO");
 //BA.debugLineNum = 839;BA.debugLine="c.Close";
_c.Close();
 //BA.debugLineNum = 840;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 /*adm.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 = 841;BA.debugLine="c.Position=0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 843;BA.debugLine="If c.GetString(\"CUANTOS\") > 0 Then";
if ((double)(Double.parseDouble(_c.GetString("CUANTOS")))>0) { 
 //BA.debugLineNum = 844;BA.debugLine="Private cbFactura As Int = 0";
_cbfactura = (int) (0);
 //BA.debugLineNum = 845;BA.debugLine="If cb_factura.Checked Then cbFactura = 1";
if (_cb_factura.getChecked()) { 
_cbfactura = (int) (1);};
 //BA.debugLineNum = 846;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"delete fro";
_b4xpages._mainpage /*adm.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("delete from NOVENTA where NV_CLIENTE In (select cuenta from cuentaa)");
 //BA.debugLineNum = 847;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"delete fro";
_b4xpages._mainpage /*adm.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 = 848;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"insert in";
_b4xpages._mainpage /*adm.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 /*adm.keymon.com.mx.b4xmainpage*/ (ba)._lon_gps /*String*/ ),(Object)(_b4xpages._mainpage /*adm.keymon.com.mx.b4xmainpage*/ (ba)._lat_gps /*String*/ ),(Object)(0),(Object)(_cbfactura)}));
 //BA.debugLineNum = 849;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"UPDATE kmt";
_b4xpages._mainpage /*adm.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 = 850;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"UPDATE kmt";
_b4xpages._mainpage /*adm.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("UPDATE kmt_info2 set gestion = 2  where CAT_CL_CODIGO In (select cuenta from cuentaa)");
 };
 //BA.debugLineNum = 852;BA.debugLine="c.Close";
_c.Close();
 //BA.debugLineNum = 853;BA.debugLine="DateTime.TimeFormat = \"HHmmss\"";
__c.DateTime.setTimeFormat("HHmmss");
 //BA.debugLineNum = 854;BA.debugLine="sTime=DateTime.Time(DateTime.Now)";
_stime = __c.DateTime.Time(__c.DateTime.getNow());
 //BA.debugLineNum = 855;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"UPDATE HIS";
_b4xpages._mainpage /*adm.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 = 857;BA.debugLine="Try";
try { //BA.debugLineNum = 858;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 /*adm.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 = 864;BA.debugLine="c.Position = 0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 865;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 = 866;BA.debugLine="stay_mi = c.GetString(\"MINUTOS_TOTALES\") * 60";
_stay_mi = BA.NumberToString((double)(Double.parseDouble(_c.GetString("MINUTOS_TOTALES")))*60);
 //BA.debugLineNum = 867;BA.debugLine="stay_ss = c.GetString(\"SEGUNDOS_TOTALES\")";
_stay_ss = _c.GetString("SEGUNDOS_TOTALES");
 //BA.debugLineNum = 868;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"UPDATE HI";
_b4xpages._mainpage /*adm.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 = 869;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"UPDATE HI";
_b4xpages._mainpage /*adm.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 = 870;BA.debugLine="c.Close";
_c.Close();
 } 
       catch (Exception e39) {
			ba.setLastException(e39); //BA.debugLineNum = 872;BA.debugLine="ToastMessageShow(\".\",True)";
__c.ToastMessageShow(BA.ObjectToCharSequence("."),__c.True);
 };
 //BA.debugLineNum = 875;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 = 877;BA.debugLine="Subs.actualizaTET(la_cuenta.text)";
_subs._actualizatet /*String*/ (ba,_la_cuenta.getText());
 //BA.debugLineNum = 878;BA.debugLine="DateTime.TimeFormat = \"HH:mm:ss\"";
__c.DateTime.setTimeFormat("HH:mm:ss");
 //BA.debugLineNum = 880;BA.debugLine="mandaPendientes 'LO COMENTAMOS PARA PRUEBAS, ACT";
_mandapendientes();
 //BA.debugLineNum = 881;BA.debugLine="mandapiezas";
_mandapiezas();
 //BA.debugLineNum = 882;BA.debugLine="B4XPages.MainPage.productos.reiniciarlistaProds";
_b4xpages._mainpage /*adm.keymon.com.mx.b4xmainpage*/ (ba)._productos /*adm.keymon.com.mx.c_productos*/ ._reiniciarlistaprods /*boolean*/  = __c.True;
 //BA.debugLineNum = 883;BA.debugLine="B4XPages.MainPage.productos.prodsMap.Initialize";
_b4xpages._mainpage /*adm.keymon.com.mx.b4xmainpage*/ (ba)._productos /*adm.keymon.com.mx.c_productos*/ ._prodsmap /*anywheresoftware.b4a.objects.collections.Map*/ .Initialize();
 //BA.debugLineNum = 884;BA.debugLine="B4XPages.MainPage.promos.promosMap.Initialize";
_b4xpages._mainpage /*adm.keymon.com.mx.b4xmainpage*/ (ba)._promos /*adm.keymon.com.mx.c_promos*/ ._promosmap /*anywheresoftware.b4a.objects.collections.Map*/ .Initialize();
 //BA.debugLineNum = 885;BA.debugLine="Guardar.Enabled = True";
_guardar.setEnabled(__c.True);
 //BA.debugLineNum = 886;BA.debugLine="gest.Enabled = True";
_gest.setEnabled(__c.True);
 //BA.debugLineNum = 887;BA.debugLine="b_cxc.Enabled = True";
_b_cxc.setEnabled(__c.True);
 //BA.debugLineNum = 888;BA.debugLine="Tar.Enabled = True";
_tar.setEnabled(__c.True);
 //BA.debugLineNum = 889;BA.debugLine="Tels.Enabled = True";
_tels.setEnabled(__c.True);
 //BA.debugLineNum = 890;BA.debugLine="b_ventaabordo.Enabled = True";
_b_ventaabordo.setEnabled(__c.True);
 //BA.debugLineNum = 891;BA.debugLine="HIST.Enabled = True";
_hist.setEnabled(__c.True);
 //BA.debugLineNum = 892;BA.debugLine="banderaimp = 0";
_banderaimp = (int) (0);
 //BA.debugLineNum = 893;BA.debugLine="B4XPages.ShowPage(\"Principal\")";
_b4xpages._showpage /*String*/ (ba,"Principal");
 }else if((_b4xpages._mainpage /*adm.keymon.com.mx.b4xmainpage*/ (ba)._recarga /*String*/ ).equals("1")) { 
 //BA.debugLineNum = 895;BA.debugLine="DateTime.DateFormat = \"MM/dd/yyyy\"";
__c.DateTime.setDateFormat("MM/dd/yyyy");
 //BA.debugLineNum = 896;BA.debugLine="sDate=DateTime.Date(DateTime.Now)";
_sdate = __c.DateTime.Date(__c.DateTime.getNow());
 //BA.debugLineNum = 897;BA.debugLine="sTime=DateTime.Time(DateTime.Now)";
_stime = __c.DateTime.Time(__c.DateTime.getNow());
 //BA.debugLineNum = 898;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 /*adm.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("Select CUENTA from cuentaa")));
 //BA.debugLineNum = 899;BA.debugLine="c.Position=0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 900;BA.debugLine="clie_id = c.GetString(\"CUENTA\")";
_clie_id = _c.GetString("CUENTA");
 //BA.debugLineNum = 901;BA.debugLine="c.Close";
_c.Close();
 //BA.debugLineNum = 902;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 /*adm.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select USUARIO from usuarioa")));
 //BA.debugLineNum = 903;BA.debugLine="c.Position=0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 904;BA.debugLine="usuario = c.GetString(\"USUARIO\")";
_usuario = _c.GetString("USUARIO");
 //BA.debugLineNum = 905;BA.debugLine="c.Close";
_c.Close();
 //BA.debugLineNum = 906;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 /*adm.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 = 907;BA.debugLine="c.Position=0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 909;BA.debugLine="If c.GetString(\"CUANTOS\") > 0 Then";
if ((double)(Double.parseDouble(_c.GetString("CUANTOS")))>0) { 
 //BA.debugLineNum = 910;BA.debugLine="Private cbFactura As Int = 0";
_cbfactura = (int) (0);
 //BA.debugLineNum = 911;BA.debugLine="If cb_factura.Checked Then cbFactura = 1";
if (_cb_factura.getChecked()) { 
_cbfactura = (int) (1);};
 //BA.debugLineNum = 912;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"delete fro";
_b4xpages._mainpage /*adm.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("delete from NOVENTA where NV_CLIENTE In (select cuenta from cuentaa)");
 //BA.debugLineNum = 913;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"delete fro";
_b4xpages._mainpage /*adm.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 = 914;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"insert in";
_b4xpages._mainpage /*adm.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 /*adm.keymon.com.mx.b4xmainpage*/ (ba)._lon_gps /*String*/ ),(Object)(_b4xpages._mainpage /*adm.keymon.com.mx.b4xmainpage*/ (ba)._lat_gps /*String*/ ),(Object)(0),(Object)(_cbfactura)}));
 //BA.debugLineNum = 915;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"UPDATE kmt";
_b4xpages._mainpage /*adm.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 = 917;BA.debugLine="c.Close";
_c.Close();
 //BA.debugLineNum = 918;BA.debugLine="DateTime.TimeFormat = \"HHmmss\"";
__c.DateTime.setTimeFormat("HHmmss");
 //BA.debugLineNum = 919;BA.debugLine="sTime=DateTime.Time(DateTime.Now)";
_stime = __c.DateTime.Time(__c.DateTime.getNow());
 //BA.debugLineNum = 920;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"UPDATE HIS";
_b4xpages._mainpage /*adm.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 = 940;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 = 942;BA.debugLine="Subs.actualizaTET(la_cuenta.text)";
_subs._actualizatet /*String*/ (ba,_la_cuenta.getText());
 //BA.debugLineNum = 943;BA.debugLine="DateTime.TimeFormat = \"HH:mm:ss\"";
__c.DateTime.setTimeFormat("HH:mm:ss");
 //BA.debugLineNum = 947;BA.debugLine="mandaPendientesrecarga";
_mandapendientesrecarga();
 //BA.debugLineNum = 948;BA.debugLine="mandapiezasrecarga";
_mandapiezasrecarga();
 //BA.debugLineNum = 949;BA.debugLine="B4XPages.MainPage.productos.reiniciarlistaProds";
_b4xpages._mainpage /*adm.keymon.com.mx.b4xmainpage*/ (ba)._productos /*adm.keymon.com.mx.c_productos*/ ._reiniciarlistaprods /*boolean*/  = __c.True;
 //BA.debugLineNum = 950;BA.debugLine="B4XPages.MainPage.productos.prodsMap.Initialize";
_b4xpages._mainpage /*adm.keymon.com.mx.b4xmainpage*/ (ba)._productos /*adm.keymon.com.mx.c_productos*/ ._prodsmap /*anywheresoftware.b4a.objects.collections.Map*/ .Initialize();
 //BA.debugLineNum = 951;BA.debugLine="B4XPages.MainPage.promos.promosMap.Initialize";
_b4xpages._mainpage /*adm.keymon.com.mx.b4xmainpage*/ (ba)._promos /*adm.keymon.com.mx.c_promos*/ ._promosmap /*anywheresoftware.b4a.objects.collections.Map*/ .Initialize();
 //BA.debugLineNum = 952;BA.debugLine="B4XPages.ShowPage(\"login\")";
_b4xpages._showpage /*String*/ (ba,"login");
 //BA.debugLineNum = 953;BA.debugLine="B4XPages.MainPage.recarga = \"0\"";
_b4xpages._mainpage /*adm.keymon.com.mx.b4xmainpage*/ (ba)._recarga /*String*/  = "0";
 };
 //BA.debugLineNum = 955;BA.debugLine="End Sub";
return "";
}
public void  _guardar_click() throws Exception{
ResumableSub_Guardar_Click rsub = new ResumableSub_Guardar_Click(this);
rsub.resume(ba, null);
}
public static class ResumableSub_Guardar_Click extends BA.ResumableSub {
public ResumableSub_Guardar_Click(adm.keymon.com.mx.c_cliente parent) {
this.parent = parent;
}
adm.keymon.com.mx.c_cliente parent;
int _resultado = 0;
anywheresoftware.b4a.sql.SQL.CursorWrapper _limitcred = null;
anywheresoftware.b4a.sql.SQL.CursorWrapper _credi2 = null;

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

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

case 0:
//C
this.state = 1;
 //BA.debugLineNum = 660;BA.debugLine="c = B4XPages.MainPage.skmt.ExecQuery2(\"SELECT COU";
parent._c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(parent._b4xpages._mainpage /*adm.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 = 661;BA.debugLine="c.Position = 0";
parent._c.setPosition((int) (0));
 //BA.debugLineNum = 662;BA.debugLine="If c.GetString(\"CUANTOS\") > 0 Then";
if (true) break;

case 1:
//if
this.state = 70;
if ((double)(Double.parseDouble(parent._c.GetString("CUANTOS")))>0) { 
this.state = 3;
}else if((parent._c.GetString("CUANTOS")).equals(BA.NumberToString(0))) { 
this.state = 69;
}if (true) break;

case 3:
//C
this.state = 4;
 //BA.debugLineNum = 663;BA.debugLine="If la_cuenta.Text <> 0 Then";
if (true) break;

case 4:
//if
this.state = 67;
if ((parent._la_cuenta.getText()).equals(BA.NumberToString(0)) == false) { 
this.state = 6;
}else if((parent._la_cuenta.getText()).equals(BA.NumberToString(0))) { 
this.state = 66;
}if (true) break;

case 6:
//C
this.state = 7;
 //BA.debugLineNum = 664;BA.debugLine="Credi = B4XPages.MainPage.skmt.ExecQuery(\"Selec";
parent._credi = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(parent._b4xpages._mainpage /*adm.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_info2 Where CAT_CL_CODIGO IN (SELECT CUENTA FROM CUENTAA) and CAT_CL_CODIGO NOT IN (SELECT CLIENTE FROM ABONOSP)")));
 //BA.debugLineNum = 666;BA.debugLine="If Credi.RowCount > 0 Then";
if (true) break;

case 7:
//if
this.state = 64;
if (parent._credi.getRowCount()>0) { 
this.state = 9;
}else {
this.state = 35;
}if (true) break;

case 9:
//C
this.state = 10;
 //BA.debugLineNum = 667;BA.debugLine="Credi.Position = 0";
parent._credi.setPosition((int) (0));
 //BA.debugLineNum = 668;BA.debugLine="If Credi.GetString(\"CAT_CL_BCREDITO\") = \"1\" Th";
if (true) break;

case 10:
//if
this.state = 33;
if ((parent._credi.GetString("CAT_CL_BCREDITO")).equals("1")) { 
this.state = 12;
}else if((parent._credi.GetString("CAT_CL_BCREDITO")).equals("0")) { 
this.state = 32;
}if (true) break;

case 12:
//C
this.state = 13;
 //BA.debugLineNum = 672;BA.debugLine="If pre_act <> Starter.pre_viejo Then";
if (true) break;

case 13:
//if
this.state = 30;
if (parent._pre_act!=parent._starter._pre_viejo /*float*/ ) { 
this.state = 15;
}else if(parent._pre_act==parent._starter._pre_viejo /*float*/ ) { 
this.state = 29;
}if (true) break;

case 15:
//C
this.state = 16;
 //BA.debugLineNum = 675;BA.debugLine="Msgbox2Async(\"La venta es a credito?\", \"ATEN";
parent.__c.Msgbox2Async(BA.ObjectToCharSequence("La venta es a credito?"),BA.ObjectToCharSequence("ATENCION"),"SI","","NO",parent.__c.LoadBitmap(parent.__c.File.getDirAssets(),"alert2.png"),ba,parent.__c.False);
 //BA.debugLineNum = 676;BA.debugLine="Wait For Msgbox_Result (resultado As Int)";
parent.__c.WaitFor("msgbox_result", ba, this, null);
this.state = 71;
return;
case 71:
//C
this.state = 16;
_resultado = (Integer) result[0];
;
 //BA.debugLineNum = 677;BA.debugLine="If resultado = DialogResponse.POSITIVE Then";
if (true) break;

case 16:
//if
this.state = 27;
if (_resultado==parent.__c.DialogResponse.POSITIVE) { 
this.state = 18;
}else {
this.state = 26;
}if (true) break;

case 18:
//C
this.state = 19;
 //BA.debugLineNum = 678;BA.debugLine="p_credito.Visible = True";
parent._p_credito.setVisible(parent.__c.True);
 //BA.debugLineNum = 679;BA.debugLine="Dim limitcred As Cursor";
_limitcred = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
 //BA.debugLineNum = 680;BA.debugLine="limitcred = B4XPages.MainPage.skmt.ExecQuer";
_limitcred = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(parent._b4xpages._mainpage /*adm.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_info2 WHERE CAT_CL_CODIGO IN (SELECT CUENTA FROM CUENTAA)")));
 //BA.debugLineNum = 681;BA.debugLine="limitcred.Position = 0";
_limitcred.setPosition((int) (0));
 //BA.debugLineNum = 682;BA.debugLine="l_limite.Text = \"Limite de credito: $\" & li";
parent._l_limite.setText(BA.ObjectToCharSequence("Limite de credito: $"+_limitcred.GetString("CAT_CL_LIMITECREDITO")));
 //BA.debugLineNum = 683;BA.debugLine="If Subs.traeTotalClientepreventaparacredito";
if (true) break;

case 19:
//if
this.state = 24;
if (parent._subs._traetotalclientepreventaparacredito /*double*/ (ba)>=(double)(Double.parseDouble(_limitcred.GetString("CAT_CL_LIMITECREDITO")))) { 
this.state = 21;
}else {
this.state = 23;
}if (true) break;

case 21:
//C
this.state = 24;
 //BA.debugLineNum = 684;BA.debugLine="et_montoacredito.Text = limitcred.GetStrin";
parent._et_montoacredito.setText(BA.ObjectToCharSequence(_limitcred.GetString("CAT_CL_LIMITECREDITO")));
 if (true) break;

case 23:
//C
this.state = 24;
 //BA.debugLineNum = 686;BA.debugLine="et_montoacredito.Text = Subs.traeTotalClie";
parent._et_montoacredito.setText(BA.ObjectToCharSequence(parent._subs._traetotalclientepreventaparacredito /*double*/ (ba)));
 if (true) break;

case 24:
//C
this.state = 27;
;
 //BA.debugLineNum = 688;BA.debugLine="limitcred.Close";
_limitcred.Close();
 if (true) break;

case 26:
//C
this.state = 27;
 //BA.debugLineNum = 690;BA.debugLine="GuardaVenta";
parent._guardaventa();
 if (true) break;

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

case 29:
//C
this.state = 30;
 //BA.debugLineNum = 694;BA.debugLine="GuardaVenta";
parent._guardaventa();
 if (true) break;

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

case 32:
//C
this.state = 33;
 //BA.debugLineNum = 699;BA.debugLine="GuardaVenta";
parent._guardaventa();
 if (true) break;

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

case 35:
//C
this.state = 36;
 //BA.debugLineNum = 702;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)(parent._b4xpages._mainpage /*adm.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_INFO2 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 = 703;BA.debugLine="If credi2.RowCount > 0 Then";
if (true) break;

case 36:
//if
this.state = 63;
if (_credi2.getRowCount()>0) { 
this.state = 38;
}if (true) break;

case 38:
//C
this.state = 39;
 //BA.debugLineNum = 704;BA.debugLine="credi2.Position = 0";
_credi2.setPosition((int) (0));
 //BA.debugLineNum = 705;BA.debugLine="If credi2.GetString (\"CAT_CL_BCREDITO\") = \"1\"";
if (true) break;

case 39:
//if
this.state = 62;
if ((_credi2.GetString("CAT_CL_BCREDITO")).equals("1") && (_credi2.GetString("a_abono")).equals(_credi2.GetString("SALDO_PENDIENTE"))) { 
this.state = 41;
}else {
this.state = 61;
}if (true) break;

case 41:
//C
this.state = 42;
 //BA.debugLineNum = 706;BA.debugLine="If pre_act <> Starter.pre_viejo Then";
if (true) break;

case 42:
//if
this.state = 59;
if (parent._pre_act!=parent._starter._pre_viejo /*float*/ ) { 
this.state = 44;
}else if(parent._pre_act==parent._starter._pre_viejo /*float*/ ) { 
this.state = 58;
}if (true) break;

case 44:
//C
this.state = 45;
 //BA.debugLineNum = 708;BA.debugLine="Msgbox2Async(\"La venta es a credito?\", \"ATE";
parent.__c.Msgbox2Async(BA.ObjectToCharSequence("La venta es a credito?"),BA.ObjectToCharSequence("ATENCION"),"SI","","NO",parent.__c.LoadBitmap(parent.__c.File.getDirAssets(),"alert2.png"),ba,parent.__c.False);
 //BA.debugLineNum = 709;BA.debugLine="Wait For Msgbox_Result (resultado As Int)";
parent.__c.WaitFor("msgbox_result", ba, this, null);
this.state = 72;
return;
case 72:
//C
this.state = 45;
_resultado = (Integer) result[0];
;
 //BA.debugLineNum = 710;BA.debugLine="If resultado = DialogResponse.POSITIVE Then";
if (true) break;

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

case 47:
//C
this.state = 48;
 //BA.debugLineNum = 711;BA.debugLine="p_credito.Visible = True";
parent._p_credito.setVisible(parent.__c.True);
 //BA.debugLineNum = 712;BA.debugLine="Dim limitcred As Cursor";
_limitcred = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
 //BA.debugLineNum = 713;BA.debugLine="limitcred = B4XPages.MainPage.skmt.ExecQue";
_limitcred = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(parent._b4xpages._mainpage /*adm.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_info2 WHERE CAT_CL_CODIGO IN (SELECT CUENTA FROM CUENTAA)")));
 //BA.debugLineNum = 714;BA.debugLine="limitcred.Position = 0";
_limitcred.setPosition((int) (0));
 //BA.debugLineNum = 715;BA.debugLine="l_limite.Text = \"Limite de credito: $\" & l";
parent._l_limite.setText(BA.ObjectToCharSequence("Limite de credito: $"+_limitcred.GetString("CAT_CL_LIMITECREDITO")));
 //BA.debugLineNum = 716;BA.debugLine="If Subs.traeTotalClientepreventaparacredit";
if (true) break;

case 48:
//if
this.state = 53;
if (parent._subs._traetotalclientepreventaparacredito /*double*/ (ba)>=(double)(Double.parseDouble(_limitcred.GetString("CAT_CL_LIMITECREDITO")))) { 
this.state = 50;
}else {
this.state = 52;
}if (true) break;

case 50:
//C
this.state = 53;
 //BA.debugLineNum = 717;BA.debugLine="et_montoacredito.Text = limitcred.GetStri";
parent._et_montoacredito.setText(BA.ObjectToCharSequence(_limitcred.GetString("CAT_CL_LIMITECREDITO")));
 if (true) break;

case 52:
//C
this.state = 53;
 //BA.debugLineNum = 719;BA.debugLine="et_montoacredito.Text = Subs.traeTotalCli";
parent._et_montoacredito.setText(BA.ObjectToCharSequence(parent._subs._traetotalclientepreventaparacredito /*double*/ (ba)));
 if (true) break;

case 53:
//C
this.state = 56;
;
 //BA.debugLineNum = 721;BA.debugLine="limitcred.Close";
_limitcred.Close();
 if (true) break;

case 55:
//C
this.state = 56;
 //BA.debugLineNum = 723;BA.debugLine="GuardaVenta";
parent._guardaventa();
 if (true) break;

case 56:
//C
this.state = 59;
;
 if (true) break;

case 58:
//C
this.state = 59;
 //BA.debugLineNum = 727;BA.debugLine="GuardaVenta";
parent._guardaventa();
 if (true) break;

case 59:
//C
this.state = 62;
;
 if (true) break;

case 61:
//C
this.state = 62;
 //BA.debugLineNum = 730;BA.debugLine="GuardaVenta";
parent._guardaventa();
 if (true) break;

case 62:
//C
this.state = 63;
;
 if (true) break;

case 63:
//C
this.state = 64;
;
 if (true) break;

case 64:
//C
this.state = 67;
;
 if (true) break;

case 66:
//C
this.state = 67;
 //BA.debugLineNum = 736;BA.debugLine="GuardaVenta";
parent._guardaventa();
 if (true) break;

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

case 69:
//C
this.state = 70;
 //BA.debugLineNum = 739;BA.debugLine="GuardaVenta";
parent._guardaventa();
 if (true) break;

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

            }
        }
    }
}
public String  _guardaventa() throws Exception{
 //BA.debugLineNum = 804;BA.debugLine="Sub GuardaVenta";
 //BA.debugLineNum = 805;BA.debugLine="If pre_act <> Starter.pre_viejo Then";
if (_pre_act!=_starter._pre_viejo /*float*/ ) { 
 //BA.debugLineNum = 806;BA.debugLine="p_tipopago.Visible = True";
_p_tipopago.setVisible(__c.True);
 //BA.debugLineNum = 807;BA.debugLine="rb_efectivo.Checked = False";
_rb_efectivo.setChecked(__c.False);
 //BA.debugLineNum = 808;BA.debugLine="rb_tranfe.Checked = False";
_rb_tranfe.setChecked(__c.False);
 //BA.debugLineNum = 809;BA.debugLine="rb_tarjetadebito.Checked = False";
_rb_tarjetadebito.setChecked(__c.False);
 //BA.debugLineNum = 810;BA.debugLine="rb_tarjetacredito.Checked = False";
_rb_tarjetacredito.setChecked(__c.False);
 //BA.debugLineNum = 811;BA.debugLine="et_com_tp.Text = \"\"";
_et_com_tp.setText(BA.ObjectToCharSequence(""));
 }else if(_pre_act==_starter._pre_viejo /*float*/ ) { 
 //BA.debugLineNum = 822;BA.debugLine="GUADAVENTA2";
_guadaventa2();
 };
 //BA.debugLineNum = 824;BA.debugLine="End Sub";
return "";
}
public String  _hist_click() throws Exception{
 //BA.debugLineNum = 961;BA.debugLine="Sub HIST_Click";
 //BA.debugLineNum = 962;BA.debugLine="B4XPages.ShowPage(\"Historico\")";
_b4xpages._showpage /*String*/ (ba,"Historico");
 //BA.debugLineNum = 963;BA.debugLine="End Sub";
return "";
}
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(adm.keymon.com.mx.c_cliente parent) {
this.parent = parent;
}
adm.keymon.com.mx.c_cliente parent;
int _cont = 0;
int _i = 0;
int _e = 0;
int _resultado = 0;
int step56;
int limit56;
int step89;
int limit89;
int step113;
int limit113;
int step144;
int limit144;

@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 = 1052;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 = 1053;BA.debugLine="c.Position=0";
parent._c.setPosition((int) (0));
 //BA.debugLineNum = 1054;BA.debugLine="usuario = c.GetString(\"USUARIO\")";
parent._usuario = parent._c.GetString("USUARIO");
 //BA.debugLineNum = 1055;BA.debugLine="DateTime.DateFormat = \"MM/dd/yyyy\"";
parent.__c.DateTime.setDateFormat("MM/dd/yyyy");
 //BA.debugLineNum = 1056;BA.debugLine="sDate=DateTime.Date(DateTime.Now)";
parent._sdate = parent.__c.DateTime.Date(parent.__c.DateTime.getNow());
 //BA.debugLineNum = 1057;BA.debugLine="sTime=DateTime.Time(DateTime.Now)";
parent._stime = parent.__c.DateTime.Time(parent.__c.DateTime.getNow());
 //BA.debugLineNum = 1058;BA.debugLine="c.Close";
parent._c.Close();
 //BA.debugLineNum = 1064;BA.debugLine="ProgressDialogShow(\"Imprimiendo, un momento ...\")";
parent.__c.ProgressDialogShow(ba,BA.ObjectToCharSequence("Imprimiendo, un momento ..."));
 //BA.debugLineNum = 1065;BA.debugLine="Printer1.DisConnect";
parent._printer1._disconnect /*String*/ ();
 //BA.debugLineNum = 1066;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 = 1067;BA.debugLine="Log(\"Conectando a impresora ...\")";
parent.__c.LogImpl("342532880","Conectando a impresora ...",0);
 //BA.debugLineNum = 1068;BA.debugLine="Printer1.Connect";
parent._printer1._connect /*boolean*/ ();
 //BA.debugLineNum = 1069;BA.debugLine="Private cont As Int = 0";
_cont = (int) (0);
 //BA.debugLineNum = 1070;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 = 1071;BA.debugLine="Sleep(1000)";
parent.__c.Sleep(ba,this,(int) (1000));
this.state = 131;
return;
case 131:
//C
this.state = 7;
;
 //BA.debugLineNum = 1072;BA.debugLine="Log(\"++++++  \" & cont)";
parent.__c.LogImpl("342532885","++++++  "+BA.NumberToString(_cont),0);
 //BA.debugLineNum = 1073;BA.debugLine="cont = cont + 1";
_cont = (int) (_cont+1);
 //BA.debugLineNum = 1074;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 = 1075;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 = 1077;BA.debugLine="Sleep(500)";
parent.__c.Sleep(ba,this,(int) (500));
this.state = 132;
return;
case 132:
//C
this.state = 38;
;
 //BA.debugLineNum = 1078;BA.debugLine="impresoraConectada = False";
parent._impresoraconectada = parent.__c.False;
 if (true) break;

case 21:
//C
this.state = 22;
 //BA.debugLineNum = 1080;BA.debugLine="Log(\"conectando 2\")";
parent.__c.LogImpl("342532893","conectando 2",0);
 //BA.debugLineNum = 1081;BA.debugLine="Printer1.Connect";
parent._printer1._connect /*boolean*/ ();
 //BA.debugLineNum = 1082;BA.debugLine="Private cont As Int = 0";
_cont = (int) (0);
 //BA.debugLineNum = 1083;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 = 1084;BA.debugLine="Sleep(1000)";
parent.__c.Sleep(ba,this,(int) (1000));
this.state = 133;
return;
case 133:
//C
this.state = 25;
;
 //BA.debugLineNum = 1085;BA.debugLine="Log(\"******  \" & cont)";
parent.__c.LogImpl("342532898","******  "+BA.NumberToString(_cont),0);
 //BA.debugLineNum = 1086;BA.debugLine="cont = cont + 1";
_cont = (int) (_cont+1);
 //BA.debugLineNum = 1087;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 = 1088;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 = 1090;BA.debugLine="Sleep(500)";
parent.__c.Sleep(ba,this,(int) (500));
this.state = 134;
return;
case 134:
//C
this.state = 38;
;
 //BA.debugLineNum = 1091;BA.debugLine="impresoraConectada = False";
parent._impresoraconectada = parent.__c.False;
 if (true) break;

case 38:
//C
this.state = 39;
;
 //BA.debugLineNum = 1094;BA.debugLine="TAMANO = 0";
parent._tamano = (int) (0);
 //BA.debugLineNum = 1095;BA.debugLine="ESPACIO = 22";
parent._espacio = (int) (22);
 //BA.debugLineNum = 1096;BA.debugLine="BLANCO = \" \"";
parent._blanco = " ";
 //BA.debugLineNum = 1113;BA.debugLine="Printer1.WriteString(\"ADM Distribuciones\" &  CRLF";
parent._printer1._writestring /*String*/ ("ADM Distribuciones"+parent.__c.CRLF);
 //BA.debugLineNum = 1115;BA.debugLine="Printer1.WriteString(sDate &  CRLF)";
parent._printer1._writestring /*String*/ (parent._sdate+parent.__c.CRLF);
 //BA.debugLineNum = 1116;BA.debugLine="Printer1.WriteString(sTime &  CRLF)";
parent._printer1._writestring /*String*/ (parent._stime+parent.__c.CRLF);
 //BA.debugLineNum = 1117;BA.debugLine="Printer1.WriteString(\"Vendedor:\" & usuario &  CRL";
parent._printer1._writestring /*String*/ ("Vendedor:"+parent._usuario+parent.__c.CRLF);
 //BA.debugLineNum = 1118;BA.debugLine="Printer1.WriteString(\"Tienda: \" & La_nombre.Text";
parent._printer1._writestring /*String*/ ("Tienda: "+parent._la_nombre.getText()+parent.__c.CRLF);
 //BA.debugLineNum = 1119;BA.debugLine="Printer1.WriteString(\"ID.Cliente: \" &  la_cuenta.";
parent._printer1._writestring /*String*/ ("ID.Cliente: "+parent._la_cuenta.getText()+parent.__c.CRLF);
 //BA.debugLineNum = 1120;BA.debugLine="Printer1.WriteString(\"Calle: \" & la_Calle.Text &";
parent._printer1._writestring /*String*/ ("Calle: "+parent._la_calle.getText()+parent.__c.CRLF);
 //BA.debugLineNum = 1121;BA.debugLine="Printer1.WriteString(\"Colonia: \" & la_col.Text &";
parent._printer1._writestring /*String*/ ("Colonia: "+parent._la_col.getText()+parent.__c.CRLF);
 //BA.debugLineNum = 1125;BA.debugLine="Printer1.WriteString(\" \" &  CRLF)";
parent._printer1._writestring /*String*/ (" "+parent.__c.CRLF);
 //BA.debugLineNum = 1126;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 = 1127;BA.debugLine="If c.RowCount > 0 Then";
if (true) break;

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

case 41:
//C
this.state = 42;
 //BA.debugLineNum = 1128;BA.debugLine="Printer1.WriteString(\"-----------PREVENTA-------";
parent._printer1._writestring /*String*/ ("-----------PREVENTA-----------"+parent.__c.CRLF);
 //BA.debugLineNum = 1131;BA.debugLine="Printer1.WriteString(\"Cant.      Precio        I";
parent._printer1._writestring /*String*/ ("Cant.      Precio        Importe"+parent.__c.CRLF);
 //BA.debugLineNum = 1133;BA.debugLine="Printer1.WriteString(\"--------------------------";
parent._printer1._writestring /*String*/ ("------------------------------"+parent.__c.CRLF);
 //BA.debugLineNum = 1135;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) < 4 AND PE_CLIENTE IN (Select CUENTA from cuentaa)  order by  PE_PROID",new String[]{"PREVENTA"})));
 //BA.debugLineNum = 1136;BA.debugLine="If S.RowCount>0 Then";
if (true) break;

case 42:
//if
this.state = 82;
if (parent._s.getRowCount()>0) { 
this.state = 44;
}if (true) break;

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

case 45:
//for
this.state = 81;
step56 = 1;
limit56 = (int) (parent._s.getRowCount()-1);
_i = (int) (0) ;
this.state = 135;
if (true) break;

case 135:
//C
this.state = 81;
if ((step56 > 0 && _i <= limit56) || (step56 < 0 && _i >= limit56)) this.state = 47;
if (true) break;

case 136:
//C
this.state = 135;
_i = ((int)(0 + _i + step56)) ;
if (true) break;

case 47:
//C
this.state = 48;
 //BA.debugLineNum = 1138;BA.debugLine="S.Position=i";
parent._s.setPosition(_i);
 //BA.debugLineNum = 1139;BA.debugLine="If s.GetString(\"PE_CEDIS\") = s.GetString(\"PE_P";
if (true) break;

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

case 50:
//C
this.state = 80;
 //BA.debugLineNum = 1140;BA.debugLine="Printer1.WriteString(s.GetString(\"PE_PRONOMBR";
parent._printer1._writestring /*String*/ (parent._s.GetString("PE_PRONOMBRE")+parent.__c.CRLF);
 if (true) break;

case 52:
//C
this.state = 53;
 //BA.debugLineNum = 1144;BA.debugLine="Printer1.WriteString(s.GetString(\"PE_PRONOMBR";
parent._printer1._writestring /*String*/ (parent._s.GetString("PE_PRONOMBRE")+parent.__c.CRLF);
 //BA.debugLineNum = 1145;BA.debugLine="LogColor(s.GetLong(\"L_CANT\"),Colors.Magenta)";
parent.__c.LogImpl("342532958",BA.NumberToString(parent._s.GetLong("L_CANT")),parent.__c.Colors.Magenta);
 //BA.debugLineNum = 1146;BA.debugLine="LogColor(s.GetLong(\"L_COSTOU\"),Colors.Magenta";
parent.__c.LogImpl("342532959",BA.NumberToString(parent._s.GetLong("L_COSTOU")),parent.__c.Colors.Magenta);
 //BA.debugLineNum = 1147;BA.debugLine="LogColor(s.GetLong(\"L_COSTO_TOT\"),Colors.Mage";
parent.__c.LogImpl("342532960",BA.NumberToString(parent._s.GetLong("L_COSTO_TOT")),parent.__c.Colors.Magenta);
 //BA.debugLineNum = 1148;BA.debugLine="TAMANO = s.GetLong(\"L_CANT\") + TAMANO";
parent._tamano = (int) (parent._s.GetLong("L_CANT")+parent._tamano);
 //BA.debugLineNum = 1150;BA.debugLine="If s.GetLong(\"L_COSTOU\") = 1 Then";
if (true) break;

case 53:
//if
this.state = 64;
if (parent._s.GetLong("L_COSTOU")==1) { 
this.state = 55;
}else if(parent._s.GetLong("L_COSTOU")==2) { 
this.state = 57;
}else if(parent._s.GetLong("L_COSTOU")==3) { 
this.state = 59;
}else if(parent._s.GetLong("L_COSTOU")==4) { 
this.state = 61;
}else {
this.state = 63;
}if (true) break;

case 55:
//C
this.state = 64;
 //BA.debugLineNum = 1151;BA.debugLine="TAMANO = s.GetLong(\"L_COSTOU\") + TAMANO + 4";
parent._tamano = (int) (parent._s.GetLong("L_COSTOU")+parent._tamano+4);
 if (true) break;

case 57:
//C
this.state = 64;
 //BA.debugLineNum = 1153;BA.debugLine="TAMANO = s.GetLong(\"L_COSTOU\") + TAMANO + 3";
parent._tamano = (int) (parent._s.GetLong("L_COSTOU")+parent._tamano+3);
 if (true) break;

case 59:
//C
this.state = 64;
 //BA.debugLineNum = 1155;BA.debugLine="TAMANO = s.GetLong(\"L_COSTOU\") + TAMANO + 2";
parent._tamano = (int) (parent._s.GetLong("L_COSTOU")+parent._tamano+2);
 if (true) break;

case 61:
//C
this.state = 64;
 //BA.debugLineNum = 1157;BA.debugLine="TAMANO = s.GetLong(\"L_COSTOU\") + TAMANO + 1";
parent._tamano = (int) (parent._s.GetLong("L_COSTOU")+parent._tamano+1);
 if (true) break;

case 63:
//C
this.state = 64;
 //BA.debugLineNum = 1159;BA.debugLine="TAMANO = s.GetLong(\"L_COSTOU\") + TAMANO";
parent._tamano = (int) (parent._s.GetLong("L_COSTOU")+parent._tamano);
 if (true) break;
;
 //BA.debugLineNum = 1186;BA.debugLine="If s.GetLong(\"L_COSTO_TOT\") = 1 Then";

case 64:
//if
this.state = 75;
if (parent._s.GetLong("L_COSTO_TOT")==1) { 
this.state = 66;
}else if(parent._s.GetLong("L_COSTO_TOT")==2) { 
this.state = 68;
}else if(parent._s.GetLong("L_COSTO_TOT")==3) { 
this.state = 70;
}else if(parent._s.GetLong("L_COSTO_TOT")==4) { 
this.state = 72;
}else {
this.state = 74;
}if (true) break;

case 66:
//C
this.state = 75;
 //BA.debugLineNum = 1187;BA.debugLine="TAMANO = s.GetLong(\"L_COSTO_TOT\") + TAMANO +";
parent._tamano = (int) (parent._s.GetLong("L_COSTO_TOT")+parent._tamano+4);
 if (true) break;

case 68:
//C
this.state = 75;
 //BA.debugLineNum = 1189;BA.debugLine="TAMANO = s.GetLong(\"L_COSTO_TOT\") + TAMANO +";
parent._tamano = (int) (parent._s.GetLong("L_COSTO_TOT")+parent._tamano+3);
 if (true) break;

case 70:
//C
this.state = 75;
 //BA.debugLineNum = 1191;BA.debugLine="TAMANO = s.GetLong(\"L_COSTO_TOT\") + TAMANO +";
parent._tamano = (int) (parent._s.GetLong("L_COSTO_TOT")+parent._tamano+2);
 if (true) break;

case 72:
//C
this.state = 75;
 //BA.debugLineNum = 1193;BA.debugLine="TAMANO = s.GetLong(\"L_COSTO_TOT\") + TAMANO +";
parent._tamano = (int) (parent._s.GetLong("L_COSTO_TOT")+parent._tamano+1);
 if (true) break;

case 74:
//C
this.state = 75;
 //BA.debugLineNum = 1195;BA.debugLine="TAMANO = s.GetLong(\"L_COSTO_TOT\") + TAMANO";
parent._tamano = (int) (parent._s.GetLong("L_COSTO_TOT")+parent._tamano);
 if (true) break;

case 75:
//C
this.state = 76;
;
 //BA.debugLineNum = 1198;BA.debugLine="ESPACIO = ESPACIO - TAMANO";
parent._espacio = (int) (parent._espacio-parent._tamano);
 //BA.debugLineNum = 1200;BA.debugLine="For E=0 To ESPACIO -1";
if (true) break;

case 76:
//for
this.state = 79;
step89 = 1;
limit89 = (int) (parent._espacio-1);
_e = (int) (0) ;
this.state = 137;
if (true) break;

case 137:
//C
this.state = 79;
if ((step89 > 0 && _e <= limit89) || (step89 < 0 && _e >= limit89)) this.state = 78;
if (true) break;

case 138:
//C
this.state = 137;
_e = ((int)(0 + _e + step89)) ;
if (true) break;

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

case 79:
//C
this.state = 80;
;
 //BA.debugLineNum = 1203;BA.debugLine="Printer1.Justify = 0";
parent._printer1._setjustify((int) (0));
 //BA.debugLineNum = 1204;BA.debugLine="Printer1.WriteString( s.GETSTRING(\"PE_CANT\")&";
parent._printer1._writestring /*String*/ (parent._s.GetString("PE_CANT")+parent._blanco);
 //BA.debugLineNum = 1205;BA.debugLine="Printer1.Justify = 1";
parent._printer1._setjustify((int) (1));
 //BA.debugLineNum = 1206;BA.debugLine="Printer1.WriteString(s.GETSTRING(\"PE_COSTOU\")";
parent._printer1._writestring /*String*/ (parent._s.GetString("PE_COSTOU")+parent._blanco);
 //BA.debugLineNum = 1207;BA.debugLine="Printer1.Justify = 2";
parent._printer1._setjustify((int) (2));
 //BA.debugLineNum = 1208;BA.debugLine="Printer1.WriteString(s.GETSTRING(\"PE_COSTO_TO";
parent._printer1._writestring /*String*/ (parent._s.GetString("PE_COSTO_TOT")+parent.__c.CRLF);
 //BA.debugLineNum = 1209;BA.debugLine="TAMANO = 0";
parent._tamano = (int) (0);
 //BA.debugLineNum = 1210;BA.debugLine="ESPACIO = 22";
parent._espacio = (int) (22);
 //BA.debugLineNum = 1211;BA.debugLine="BLANCO = \" \"";
parent._blanco = " ";
 //BA.debugLineNum = 1212;BA.debugLine="Printer1.Justify = 0";
parent._printer1._setjustify((int) (0));
 if (true) break;

case 80:
//C
this.state = 136;
;
 if (true) break;
if (true) break;

case 81:
//C
this.state = 82;
;
 if (true) break;

case 82:
//C
this.state = 83;
;
 //BA.debugLineNum = 1216;BA.debugLine="Printer1.Justify = 0";
parent._printer1._setjustify((int) (0));
 //BA.debugLineNum = 1217;BA.debugLine="s.Close";
parent._s.Close();
 //BA.debugLineNum = 1218;BA.debugLine="Printer1.WriteString(\" \" &  CRLF)";
parent._printer1._writestring /*String*/ (" "+parent.__c.CRLF);
 //BA.debugLineNum = 1219;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_PROID NOT IN (SELECT CAT_PA_ID FROM PROMOS_COMP ) AND PE_CLIENTE IN (Select CUENTA from cuentaa) order by  PE_CEDIS, PE_COSTOU",new String[]{"PREVENTA"})));
 //BA.debugLineNum = 1220;BA.debugLine="If S.RowCount>0 Then";
if (true) break;

case 83:
//if
this.state = 123;
if (parent._s.getRowCount()>0) { 
this.state = 85;
}if (true) break;

case 85:
//C
this.state = 86;
 //BA.debugLineNum = 1221;BA.debugLine="Printer1.WriteString(\"-------PROMOS PREVENTA---";
parent._printer1._writestring /*String*/ ("-------PROMOS PREVENTA--------"+parent.__c.CRLF);
 //BA.debugLineNum = 1222;BA.debugLine="Printer1.WriteString(\"Cant.      Precio";
parent._printer1._writestring /*String*/ ("Cant.      Precio        Importe"+parent.__c.CRLF);
 //BA.debugLineNum = 1223;BA.debugLine="Printer1.WriteString(\"-------------------------";
parent._printer1._writestring /*String*/ ("------------------------------"+parent.__c.CRLF);
 //BA.debugLineNum = 1224;BA.debugLine="For i=0 To S.RowCount -1";
if (true) break;

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

case 139:
//C
this.state = 122;
if ((step113 > 0 && _i <= limit113) || (step113 < 0 && _i >= limit113)) this.state = 88;
if (true) break;

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

case 88:
//C
this.state = 89;
 //BA.debugLineNum = 1225;BA.debugLine="S.Position=i";
parent._s.setPosition(_i);
 //BA.debugLineNum = 1226;BA.debugLine="If s.GetString(\"PE_CEDIS\") = s.GetString(\"PE_P";
if (true) break;

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

case 91:
//C
this.state = 121;
 //BA.debugLineNum = 1227;BA.debugLine="Printer1.WriteString(s.GetString(\"PE_PRONOMBR";
parent._printer1._writestring /*String*/ (parent._s.GetString("PE_PRONOMBRE")+parent.__c.CRLF);
 if (true) break;

case 93:
//C
this.state = 94;
 //BA.debugLineNum = 1230;BA.debugLine="TAMANO = 0";
parent._tamano = (int) (0);
 //BA.debugLineNum = 1231;BA.debugLine="Printer1.WriteString(s.GetString(\"PE_PRONOMBR";
parent._printer1._writestring /*String*/ (parent._s.GetString("PE_PRONOMBRE")+parent.__c.CRLF);
 //BA.debugLineNum = 1232;BA.debugLine="TAMANO = s.GetLong(\"L_CANT\") + TAMANO";
parent._tamano = (int) (parent._s.GetLong("L_CANT")+parent._tamano);
 //BA.debugLineNum = 1233;BA.debugLine="If s.GetLong(\"L_COSTOU\") = 1 Then";
if (true) break;

case 94:
//if
this.state = 105;
if (parent._s.GetLong("L_COSTOU")==1) { 
this.state = 96;
}else if(parent._s.GetLong("L_COSTOU")==2) { 
this.state = 98;
}else if(parent._s.GetLong("L_COSTOU")==3) { 
this.state = 100;
}else if(parent._s.GetLong("L_COSTOU")==4) { 
this.state = 102;
}else {
this.state = 104;
}if (true) break;

case 96:
//C
this.state = 105;
 //BA.debugLineNum = 1234;BA.debugLine="TAMANO = s.GetLong(\"L_COSTOU\") + TAMANO + 3";
parent._tamano = (int) (parent._s.GetLong("L_COSTOU")+parent._tamano+3);
 if (true) break;

case 98:
//C
this.state = 105;
 //BA.debugLineNum = 1236;BA.debugLine="TAMANO = s.GetLong(\"L_COSTOU\") + TAMANO + 3";
parent._tamano = (int) (parent._s.GetLong("L_COSTOU")+parent._tamano+3);
 if (true) break;

case 100:
//C
this.state = 105;
 //BA.debugLineNum = 1238;BA.debugLine="TAMANO = s.GetLong(\"L_COSTOU\") + TAMANO + 2";
parent._tamano = (int) (parent._s.GetLong("L_COSTOU")+parent._tamano+2);
 if (true) break;

case 102:
//C
this.state = 105;
 //BA.debugLineNum = 1240;BA.debugLine="TAMANO = s.GetLong(\"L_COSTOU\") + TAMANO + 1";
parent._tamano = (int) (parent._s.GetLong("L_COSTOU")+parent._tamano+1);
 if (true) break;

case 104:
//C
this.state = 105;
 //BA.debugLineNum = 1242;BA.debugLine="TAMANO = s.GetLong(\"L_COSTOU\") + TAMANO";
parent._tamano = (int) (parent._s.GetLong("L_COSTOU")+parent._tamano);
 if (true) break;
;
 //BA.debugLineNum = 1245;BA.debugLine="If s.GetLong(\"L_COSTO_TOT\") = 1 Then";

case 105:
//if
this.state = 116;
if (parent._s.GetLong("L_COSTO_TOT")==1) { 
this.state = 107;
}else if(parent._s.GetLong("L_COSTO_TOT")==2) { 
this.state = 109;
}else if(parent._s.GetLong("L_COSTO_TOT")==3) { 
this.state = 111;
}else if(parent._s.GetLong("L_COSTO_TOT")==4) { 
this.state = 113;
}else {
this.state = 115;
}if (true) break;

case 107:
//C
this.state = 116;
 //BA.debugLineNum = 1246;BA.debugLine="TAMANO = s.GetLong(\"L_COSTO_TOT\") + TAMANO +";
parent._tamano = (int) (parent._s.GetLong("L_COSTO_TOT")+parent._tamano+3);
 if (true) break;

case 109:
//C
this.state = 116;
 //BA.debugLineNum = 1248;BA.debugLine="TAMANO = s.GetLong(\"L_COSTO_TOT\") + TAMANO +";
parent._tamano = (int) (parent._s.GetLong("L_COSTO_TOT")+parent._tamano+3);
 if (true) break;

case 111:
//C
this.state = 116;
 //BA.debugLineNum = 1250;BA.debugLine="TAMANO = s.GetLong(\"L_COSTO_TOT\") + TAMANO +";
parent._tamano = (int) (parent._s.GetLong("L_COSTO_TOT")+parent._tamano+2);
 if (true) break;

case 113:
//C
this.state = 116;
 //BA.debugLineNum = 1252;BA.debugLine="TAMANO = s.GetLong(\"L_COSTO_TOT\") + TAMANO +";
parent._tamano = (int) (parent._s.GetLong("L_COSTO_TOT")+parent._tamano+1);
 if (true) break;

case 115:
//C
this.state = 116;
 //BA.debugLineNum = 1254;BA.debugLine="TAMANO = s.GetLong(\"L_COSTO_TOT\") + TAMANO";
parent._tamano = (int) (parent._s.GetLong("L_COSTO_TOT")+parent._tamano);
 if (true) break;

case 116:
//C
this.state = 117;
;
 //BA.debugLineNum = 1257;BA.debugLine="ESPACIO = ESPACIO - TAMANO";
parent._espacio = (int) (parent._espacio-parent._tamano);
 //BA.debugLineNum = 1259;BA.debugLine="For E=0 To ESPACIO -1";
if (true) break;

case 117:
//for
this.state = 120;
step144 = 1;
limit144 = (int) (parent._espacio-1);
_e = (int) (0) ;
this.state = 141;
if (true) break;

case 141:
//C
this.state = 120;
if ((step144 > 0 && _e <= limit144) || (step144 < 0 && _e >= limit144)) this.state = 119;
if (true) break;

case 142:
//C
this.state = 141;
_e = ((int)(0 + _e + step144)) ;
if (true) break;

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

case 120:
//C
this.state = 121;
;
 //BA.debugLineNum = 1263;BA.debugLine="Printer1.Justify = 0";
parent._printer1._setjustify((int) (0));
 //BA.debugLineNum = 1264;BA.debugLine="Printer1.WriteString( s.GETSTRING(\"PE_CANT\")&";
parent._printer1._writestring /*String*/ (parent._s.GetString("PE_CANT")+parent._blanco);
 //BA.debugLineNum = 1265;BA.debugLine="Printer1.Justify = 1";
parent._printer1._setjustify((int) (1));
 //BA.debugLineNum = 1266;BA.debugLine="Printer1.WriteString(s.GETSTRING(\"PE_COSTOU\")";
parent._printer1._writestring /*String*/ (parent._s.GetString("PE_COSTOU")+parent._blanco);
 //BA.debugLineNum = 1267;BA.debugLine="Printer1.Justify = 2";
parent._printer1._setjustify((int) (2));
 //BA.debugLineNum = 1268;BA.debugLine="Printer1.WriteString(s.GETSTRING(\"PE_COSTO_TO";
parent._printer1._writestring /*String*/ (parent._s.GetString("PE_COSTO_TOT")+parent.__c.CRLF);
 //BA.debugLineNum = 1269;BA.debugLine="TAMANO = 0";
parent._tamano = (int) (0);
 //BA.debugLineNum = 1270;BA.debugLine="ESPACIO = 22";
parent._espacio = (int) (22);
 //BA.debugLineNum = 1271;BA.debugLine="BLANCO = \" \"";
parent._blanco = " ";
 //BA.debugLineNum = 1272;BA.debugLine="Printer1.Justify = 0";
parent._printer1._setjustify((int) (0));
 if (true) break;

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

case 122:
//C
this.state = 123;
;
 //BA.debugLineNum = 1275;BA.debugLine="Printer1.WriteString(\" \" &  CRLF)";
parent._printer1._writestring /*String*/ (" "+parent.__c.CRLF);
 if (true) break;

case 123:
//C
this.state = 124;
;
 //BA.debugLineNum = 1277;BA.debugLine="s.Close";
parent._s.Close();
 //BA.debugLineNum = 1278;BA.debugLine="Printer1.Justify = 0";
parent._printer1._setjustify((int) (0));
 //BA.debugLineNum = 1279;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 = 1280;BA.debugLine="s.Position =0";
parent._s.setPosition((int) (0));
 //BA.debugLineNum = 1284;BA.debugLine="Printer1.WriteString(\"Total preventa:   $\" & s.G";
parent._printer1._writestring /*String*/ ("Total preventa:   $"+parent._s.GetString("TOTAL")+parent.__c.CRLF);
 //BA.debugLineNum = 1285;BA.debugLine="s.Close";
parent._s.Close();
 //BA.debugLineNum = 1286;BA.debugLine="c= skmt.ExecQuery2(\"select sum(PE_CANT) as PC_NO";
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 = 1287;BA.debugLine="C.Position=0";
parent._c.setPosition((int) (0));
 //BA.debugLineNum = 1288;BA.debugLine="Printer1.WriteString(\"Total articulos preventa:";
parent._printer1._writestring /*String*/ ("Total articulos preventa:   "+parent._c.GetString("PC_NOART")+parent.__c.CRLF);
 //BA.debugLineNum = 1289;BA.debugLine="c.Close";
parent._c.Close();
 if (true) break;

case 124:
//C
this.state = 125;
;
 //BA.debugLineNum = 1310;BA.debugLine="Printer1.WriteString(\" \" &  CRLF)";
parent._printer1._writestring /*String*/ (" "+parent.__c.CRLF);
 //BA.debugLineNum = 1311;BA.debugLine="Printer1.WriteString(\"---------------------------";
parent._printer1._writestring /*String*/ ("------------------------------"+parent.__c.CRLF);
 //BA.debugLineNum = 1314;BA.debugLine="Printer1.WriteString(\"----ESTE TICKET NO ES UN --";
parent._printer1._writestring /*String*/ ("----ESTE TICKET NO ES UN -----"+parent.__c.CRLF);
 //BA.debugLineNum = 1315;BA.debugLine="Printer1.WriteString(\"--COMPROBANTE FISCAL, SOLO";
parent._printer1._writestring /*String*/ ("--COMPROBANTE FISCAL, SOLO ES-"+parent.__c.CRLF);
 //BA.debugLineNum = 1316;BA.debugLine="Printer1.WriteString(\"--------INFORMATIVO--------";
parent._printer1._writestring /*String*/ ("--------INFORMATIVO-----------"+parent.__c.CRLF);
 //BA.debugLineNum = 1317;BA.debugLine="Printer1.WriteString(\"---------------------------";
parent._printer1._writestring /*String*/ ("------------------------------"+parent.__c.CRLF);
 //BA.debugLineNum = 1318;BA.debugLine="Printer1.WriteString(\" \" &  CRLF)";
parent._printer1._writestring /*String*/ (" "+parent.__c.CRLF);
 //BA.debugLineNum = 1319;BA.debugLine="Printer1.WriteString(\" \" &  CRLF)";
parent._printer1._writestring /*String*/ (" "+parent.__c.CRLF);
 //BA.debugLineNum = 1320;BA.debugLine="Printer1.WriteString(\" \" &  CRLF)";
parent._printer1._writestring /*String*/ (" "+parent.__c.CRLF);
 //BA.debugLineNum = 1321;BA.debugLine="Sleep(1000)";
parent.__c.Sleep(ba,this,(int) (1000));
this.state = 143;
return;
case 143:
//C
this.state = 125;
;
 //BA.debugLineNum = 1322;BA.debugLine="Printer1.DisConnect";
parent._printer1._disconnect /*String*/ ();
 //BA.debugLineNum = 1324;BA.debugLine="ProgressDialogHide";
parent.__c.ProgressDialogHide();
 //BA.debugLineNum = 1327;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 = 1328;BA.debugLine="Wait For Msgbox_Result (resultado As Int)";
parent.__c.WaitFor("msgbox_result", ba, this, null);
this.state = 144;
return;
case 144:
//C
this.state = 125;
_resultado = (Integer) result[0];
;
 //BA.debugLineNum = 1329;BA.debugLine="If resultado = DialogResponse.POSITIVE Then";
if (true) break;

case 125:
//if
this.state = 130;
if (_resultado==parent.__c.DialogResponse.POSITIVE) { 
this.state = 127;
}else {
this.state = 129;
}if (true) break;

case 127:
//C
this.state = 130;
 //BA.debugLineNum = 1330;BA.debugLine="B_IMP_Click";
parent._b_imp_click();
 if (true) break;

case 129:
//C
this.state = 130;
 //BA.debugLineNum = 1332;BA.debugLine="GUADAVENTA2";
parent._guadaventa2();
 if (true) break;

case 130:
//C
this.state = -1;
;
 //BA.debugLineNum = 1337;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(adm.keymon.com.mx.c_cliente parent) {
this.parent = parent;
}
adm.keymon.com.mx.c_cliente parent;
int _cont = 0;
int _i = 0;
int _e = 0;
int _resultado = 0;
int step56;
int limit56;
int step86;
int limit86;
int step109;
int limit109;
int step139;
int limit139;

@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 = 1780;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 = 1781;BA.debugLine="c.Position=0";
parent._c.setPosition((int) (0));
 //BA.debugLineNum = 1782;BA.debugLine="usuario = c.GetString(\"USUARIO\")";
parent._usuario = parent._c.GetString("USUARIO");
 //BA.debugLineNum = 1783;BA.debugLine="DateTime.DateFormat = \"MM/dd/yyyy\"";
parent.__c.DateTime.setDateFormat("MM/dd/yyyy");
 //BA.debugLineNum = 1784;BA.debugLine="sDate=DateTime.Date(DateTime.Now)";
parent._sdate = parent.__c.DateTime.Date(parent.__c.DateTime.getNow());
 //BA.debugLineNum = 1785;BA.debugLine="sTime=DateTime.Time(DateTime.Now)";
parent._stime = parent.__c.DateTime.Time(parent.__c.DateTime.getNow());
 //BA.debugLineNum = 1786;BA.debugLine="c.Close";
parent._c.Close();
 //BA.debugLineNum = 1792;BA.debugLine="ProgressDialogShow(\"Imprimiendo, un momento ...\")";
parent.__c.ProgressDialogShow(ba,BA.ObjectToCharSequence("Imprimiendo, un momento ..."));
 //BA.debugLineNum = 1793;BA.debugLine="Printer1.DisConnect";
parent._printer1._disconnect /*String*/ ();
 //BA.debugLineNum = 1794;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 = 1795;BA.debugLine="Log(\"Conectando a impresora ...\")";
parent.__c.LogImpl("342860560","Conectando a impresora ...",0);
 //BA.debugLineNum = 1796;BA.debugLine="Printer1.Connect";
parent._printer1._connect /*boolean*/ ();
 //BA.debugLineNum = 1797;BA.debugLine="Private cont As Int = 0";
_cont = (int) (0);
 //BA.debugLineNum = 1798;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 = 1799;BA.debugLine="Sleep(1000)";
parent.__c.Sleep(ba,this,(int) (1000));
this.state = 135;
return;
case 135:
//C
this.state = 7;
;
 //BA.debugLineNum = 1800;BA.debugLine="Log(\"++++++  \" & cont)";
parent.__c.LogImpl("342860565","++++++  "+BA.NumberToString(_cont),0);
 //BA.debugLineNum = 1801;BA.debugLine="cont = cont + 1";
_cont = (int) (_cont+1);
 //BA.debugLineNum = 1802;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 = 1803;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 = 1805;BA.debugLine="Sleep(500)";
parent.__c.Sleep(ba,this,(int) (500));
this.state = 136;
return;
case 136:
//C
this.state = 38;
;
 //BA.debugLineNum = 1806;BA.debugLine="impresoraConectada = False";
parent._impresoraconectada = parent.__c.False;
 if (true) break;

case 21:
//C
this.state = 22;
 //BA.debugLineNum = 1808;BA.debugLine="Log(\"conectando 2\")";
parent.__c.LogImpl("342860573","conectando 2",0);
 //BA.debugLineNum = 1809;BA.debugLine="Printer1.Connect";
parent._printer1._connect /*boolean*/ ();
 //BA.debugLineNum = 1810;BA.debugLine="Private cont As Int = 0";
_cont = (int) (0);
 //BA.debugLineNum = 1811;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 = 1812;BA.debugLine="Sleep(1000)";
parent.__c.Sleep(ba,this,(int) (1000));
this.state = 137;
return;
case 137:
//C
this.state = 25;
;
 //BA.debugLineNum = 1813;BA.debugLine="Log(\"******  \" & cont)";
parent.__c.LogImpl("342860578","******  "+BA.NumberToString(_cont),0);
 //BA.debugLineNum = 1814;BA.debugLine="cont = cont + 1";
_cont = (int) (_cont+1);
 //BA.debugLineNum = 1815;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 = 1816;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 = 1818;BA.debugLine="Sleep(500)";
parent.__c.Sleep(ba,this,(int) (500));
this.state = 138;
return;
case 138:
//C
this.state = 38;
;
 //BA.debugLineNum = 1819;BA.debugLine="impresoraConectada = False";
parent._impresoraconectada = parent.__c.False;
 if (true) break;

case 38:
//C
this.state = 39;
;
 //BA.debugLineNum = 1822;BA.debugLine="TAMANO = 0";
parent._tamano = (int) (0);
 //BA.debugLineNum = 1823;BA.debugLine="ESPACIO = 22";
parent._espacio = (int) (22);
 //BA.debugLineNum = 1824;BA.debugLine="BLANCO = \" \"";
parent._blanco = " ";
 //BA.debugLineNum = 1841;BA.debugLine="Printer1.WriteString(\"ADM Distribuciones\" &  CRLF";
parent._printer1._writestring /*String*/ ("ADM Distribuciones"+parent.__c.CRLF);
 //BA.debugLineNum = 1843;BA.debugLine="Printer1.WriteString(sDate &  CRLF)";
parent._printer1._writestring /*String*/ (parent._sdate+parent.__c.CRLF);
 //BA.debugLineNum = 1844;BA.debugLine="Printer1.WriteString(sTime &  CRLF)";
parent._printer1._writestring /*String*/ (parent._stime+parent.__c.CRLF);
 //BA.debugLineNum = 1845;BA.debugLine="Printer1.WriteString(\"Vendedor:\" & usuario &  CRL";
parent._printer1._writestring /*String*/ ("Vendedor:"+parent._usuario+parent.__c.CRLF);
 //BA.debugLineNum = 1846;BA.debugLine="Printer1.WriteString(\"Tienda: \" & La_nombre.Text";
parent._printer1._writestring /*String*/ ("Tienda: "+parent._la_nombre.getText()+parent.__c.CRLF);
 //BA.debugLineNum = 1847;BA.debugLine="Printer1.WriteString(\"ID.Cliente: \" &  la_cuenta.";
parent._printer1._writestring /*String*/ ("ID.Cliente: "+parent._la_cuenta.getText()+parent.__c.CRLF);
 //BA.debugLineNum = 1848;BA.debugLine="Printer1.WriteString(\"Calle: \" & la_Calle.Text &";
parent._printer1._writestring /*String*/ ("Calle: "+parent._la_calle.getText()+parent.__c.CRLF);
 //BA.debugLineNum = 1849;BA.debugLine="Printer1.WriteString(\"Colonia: \" & la_col.Text &";
parent._printer1._writestring /*String*/ ("Colonia: "+parent._la_col.getText()+parent.__c.CRLF);
 //BA.debugLineNum = 1853;BA.debugLine="Printer1.WriteString(\" \" &  CRLF)";
parent._printer1._writestring /*String*/ (" "+parent.__c.CRLF);
 //BA.debugLineNum = 1854;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[]{"VENTA"})));
 //BA.debugLineNum = 1855;BA.debugLine="If c.RowCount > 0 Then";
if (true) break;

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

case 41:
//C
this.state = 42;
 //BA.debugLineNum = 1856;BA.debugLine="Printer1.WriteString(\"-----------VENTA----------";
parent._printer1._writestring /*String*/ ("-----------VENTA-----------"+parent.__c.CRLF);
 //BA.debugLineNum = 1859;BA.debugLine="Printer1.WriteString(\"Cant.      Precio        I";
parent._printer1._writestring /*String*/ ("Cant.      Precio        Importe"+parent.__c.CRLF);
 //BA.debugLineNum = 1861;BA.debugLine="Printer1.WriteString(\"--------------------------";
parent._printer1._writestring /*String*/ ("------------------------------"+parent.__c.CRLF);
 //BA.debugLineNum = 1863;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) < 4 AND PE_CLIENTE IN (Select CUENTA from cuentaa)  order by  PE_PROID",new String[]{"VENTA"})));
 //BA.debugLineNum = 1864;BA.debugLine="If S.RowCount>0 Then";
if (true) break;

case 42:
//if
this.state = 82;
if (parent._s.getRowCount()>0) { 
this.state = 44;
}if (true) break;

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

case 45:
//for
this.state = 81;
step56 = 1;
limit56 = (int) (parent._s.getRowCount()-1);
_i = (int) (0) ;
this.state = 139;
if (true) break;

case 139:
//C
this.state = 81;
if ((step56 > 0 && _i <= limit56) || (step56 < 0 && _i >= limit56)) this.state = 47;
if (true) break;

case 140:
//C
this.state = 139;
_i = ((int)(0 + _i + step56)) ;
if (true) break;

case 47:
//C
this.state = 48;
 //BA.debugLineNum = 1866;BA.debugLine="S.Position=i";
parent._s.setPosition(_i);
 //BA.debugLineNum = 1867;BA.debugLine="If s.GetString(\"PE_CEDIS\") = s.GetString(\"PE_P";
if (true) break;

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

case 50:
//C
this.state = 80;
 //BA.debugLineNum = 1868;BA.debugLine="Printer1.WriteString(s.GetString(\"PE_PRONOMBR";
parent._printer1._writestring /*String*/ (parent._s.GetString("PE_PRONOMBRE")+parent.__c.CRLF);
 if (true) break;

case 52:
//C
this.state = 53;
 //BA.debugLineNum = 1872;BA.debugLine="Printer1.WriteString(s.GetString(\"PE_PRONOMBR";
parent._printer1._writestring /*String*/ (parent._s.GetString("PE_PRONOMBRE")+parent.__c.CRLF);
 //BA.debugLineNum = 1873;BA.debugLine="TAMANO = s.GetLong(\"L_CANT\") + TAMANO";
parent._tamano = (int) (parent._s.GetLong("L_CANT")+parent._tamano);
 //BA.debugLineNum = 1874;BA.debugLine="If s.GetLong(\"L_COSTOU\") = 1 Then";
if (true) break;

case 53:
//if
this.state = 64;
if (parent._s.GetLong("L_COSTOU")==1) { 
this.state = 55;
}else if(parent._s.GetLong("L_COSTOU")==2) { 
this.state = 57;
}else if(parent._s.GetLong("L_COSTOU")==3) { 
this.state = 59;
}else if(parent._s.GetLong("L_COSTOU")==4) { 
this.state = 61;
}else {
this.state = 63;
}if (true) break;

case 55:
//C
this.state = 64;
 //BA.debugLineNum = 1875;BA.debugLine="TAMANO = s.GetLong(\"L_COSTOU\") + TAMANO + 4";
parent._tamano = (int) (parent._s.GetLong("L_COSTOU")+parent._tamano+4);
 if (true) break;

case 57:
//C
this.state = 64;
 //BA.debugLineNum = 1877;BA.debugLine="TAMANO = s.GetLong(\"L_COSTOU\") + TAMANO + 3";
parent._tamano = (int) (parent._s.GetLong("L_COSTOU")+parent._tamano+3);
 if (true) break;

case 59:
//C
this.state = 64;
 //BA.debugLineNum = 1879;BA.debugLine="TAMANO = s.GetLong(\"L_COSTOU\") + TAMANO + 2";
parent._tamano = (int) (parent._s.GetLong("L_COSTOU")+parent._tamano+2);
 if (true) break;

case 61:
//C
this.state = 64;
 //BA.debugLineNum = 1881;BA.debugLine="TAMANO = s.GetLong(\"L_COSTOU\") + TAMANO + 1";
parent._tamano = (int) (parent._s.GetLong("L_COSTOU")+parent._tamano+1);
 if (true) break;

case 63:
//C
this.state = 64;
 //BA.debugLineNum = 1883;BA.debugLine="TAMANO = s.GetLong(\"L_COSTOU\") + TAMANO";
parent._tamano = (int) (parent._s.GetLong("L_COSTOU")+parent._tamano);
 if (true) break;
;
 //BA.debugLineNum = 1886;BA.debugLine="If s.GetLong(\"L_COSTO_TOT\") = 1 Then";

case 64:
//if
this.state = 75;
if (parent._s.GetLong("L_COSTO_TOT")==1) { 
this.state = 66;
}else if(parent._s.GetLong("L_COSTO_TOT")==2) { 
this.state = 68;
}else if(parent._s.GetLong("L_COSTO_TOT")==3) { 
this.state = 70;
}else if(parent._s.GetLong("L_COSTO_TOT")==4) { 
this.state = 72;
}else {
this.state = 74;
}if (true) break;

case 66:
//C
this.state = 75;
 //BA.debugLineNum = 1887;BA.debugLine="TAMANO = s.GetLong(\"L_COSTO_TOT\") + TAMANO +";
parent._tamano = (int) (parent._s.GetLong("L_COSTO_TOT")+parent._tamano+4);
 if (true) break;

case 68:
//C
this.state = 75;
 //BA.debugLineNum = 1889;BA.debugLine="TAMANO = s.GetLong(\"L_COSTO_TOT\") + TAMANO +";
parent._tamano = (int) (parent._s.GetLong("L_COSTO_TOT")+parent._tamano+3);
 if (true) break;

case 70:
//C
this.state = 75;
 //BA.debugLineNum = 1891;BA.debugLine="TAMANO = s.GetLong(\"L_COSTO_TOT\") + TAMANO +";
parent._tamano = (int) (parent._s.GetLong("L_COSTO_TOT")+parent._tamano+2);
 if (true) break;

case 72:
//C
this.state = 75;
 //BA.debugLineNum = 1893;BA.debugLine="TAMANO = s.GetLong(\"L_COSTO_TOT\") + TAMANO +";
parent._tamano = (int) (parent._s.GetLong("L_COSTO_TOT")+parent._tamano+1);
 if (true) break;

case 74:
//C
this.state = 75;
 //BA.debugLineNum = 1895;BA.debugLine="TAMANO = s.GetLong(\"L_COSTO_TOT\") + TAMANO";
parent._tamano = (int) (parent._s.GetLong("L_COSTO_TOT")+parent._tamano);
 if (true) break;

case 75:
//C
this.state = 76;
;
 //BA.debugLineNum = 1898;BA.debugLine="ESPACIO = ESPACIO - TAMANO";
parent._espacio = (int) (parent._espacio-parent._tamano);
 //BA.debugLineNum = 1900;BA.debugLine="For E=0 To ESPACIO -1";
if (true) break;

case 76:
//for
this.state = 79;
step86 = 1;
limit86 = (int) (parent._espacio-1);
_e = (int) (0) ;
this.state = 141;
if (true) break;

case 141:
//C
this.state = 79;
if ((step86 > 0 && _e <= limit86) || (step86 < 0 && _e >= limit86)) this.state = 78;
if (true) break;

case 142:
//C
this.state = 141;
_e = ((int)(0 + _e + step86)) ;
if (true) break;

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

case 79:
//C
this.state = 80;
;
 //BA.debugLineNum = 1903;BA.debugLine="Printer1.Justify = 0";
parent._printer1._setjustify((int) (0));
 //BA.debugLineNum = 1904;BA.debugLine="Printer1.WriteString( s.GETSTRING(\"PE_CANT\")&";
parent._printer1._writestring /*String*/ (parent._s.GetString("PE_CANT")+parent._blanco);
 //BA.debugLineNum = 1905;BA.debugLine="Printer1.Justify = 1";
parent._printer1._setjustify((int) (1));
 //BA.debugLineNum = 1906;BA.debugLine="Printer1.WriteString(s.GETSTRING(\"PE_COSTOU\")";
parent._printer1._writestring /*String*/ (parent._s.GetString("PE_COSTOU")+parent._blanco);
 //BA.debugLineNum = 1907;BA.debugLine="Printer1.Justify = 2";
parent._printer1._setjustify((int) (2));
 //BA.debugLineNum = 1908;BA.debugLine="Printer1.WriteString(s.GETSTRING(\"PE_COSTO_TO";
parent._printer1._writestring /*String*/ (parent._s.GetString("PE_COSTO_TOT")+parent.__c.CRLF);
 //BA.debugLineNum = 1909;BA.debugLine="TAMANO = 0";
parent._tamano = (int) (0);
 //BA.debugLineNum = 1910;BA.debugLine="ESPACIO = 22";
parent._espacio = (int) (22);
 //BA.debugLineNum = 1911;BA.debugLine="BLANCO = \" \"";
parent._blanco = " ";
 if (true) break;

case 80:
//C
this.state = 140;
;
 if (true) break;
if (true) break;

case 81:
//C
this.state = 82;
;
 if (true) break;

case 82:
//C
this.state = 83;
;
 //BA.debugLineNum = 1915;BA.debugLine="Printer1.Justify = 0";
parent._printer1._setjustify((int) (0));
 //BA.debugLineNum = 1916;BA.debugLine="s.Close";
parent._s.Close();
 //BA.debugLineNum = 1917;BA.debugLine="Printer1.WriteString(\" \" &  CRLF)";
parent._printer1._writestring /*String*/ (" "+parent.__c.CRLF);
 //BA.debugLineNum = 1918;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_PROID NOT IN (SELECT CAT_PA_ID FROM PROMOS_COMP ) AND PE_CLIENTE IN (Select CUENTA from cuentaa) order by  PE_CEDIS, PE_COSTOU",new String[]{"VENTA"})));
 //BA.debugLineNum = 1919;BA.debugLine="If S.RowCount>0 Then";
if (true) break;

case 83:
//if
this.state = 123;
if (parent._s.getRowCount()>0) { 
this.state = 85;
}if (true) break;

case 85:
//C
this.state = 86;
 //BA.debugLineNum = 1920;BA.debugLine="Printer1.WriteString(\"-------PROMOS VENTA------";
parent._printer1._writestring /*String*/ ("-------PROMOS VENTA--------"+parent.__c.CRLF);
 //BA.debugLineNum = 1921;BA.debugLine="Printer1.WriteString(\"Cant.      Precio";
parent._printer1._writestring /*String*/ ("Cant.      Precio        Importe"+parent.__c.CRLF);
 //BA.debugLineNum = 1922;BA.debugLine="Printer1.WriteString(\"-------------------------";
parent._printer1._writestring /*String*/ ("------------------------------"+parent.__c.CRLF);
 //BA.debugLineNum = 1923;BA.debugLine="For i=0 To S.RowCount -1";
if (true) break;

case 86:
//for
this.state = 122;
step109 = 1;
limit109 = (int) (parent._s.getRowCount()-1);
_i = (int) (0) ;
this.state = 143;
if (true) break;

case 143:
//C
this.state = 122;
if ((step109 > 0 && _i <= limit109) || (step109 < 0 && _i >= limit109)) this.state = 88;
if (true) break;

case 144:
//C
this.state = 143;
_i = ((int)(0 + _i + step109)) ;
if (true) break;

case 88:
//C
this.state = 89;
 //BA.debugLineNum = 1924;BA.debugLine="S.Position=i";
parent._s.setPosition(_i);
 //BA.debugLineNum = 1925;BA.debugLine="If s.GetString(\"PE_CEDIS\") = s.GetString(\"PE_P";
if (true) break;

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

case 91:
//C
this.state = 121;
 //BA.debugLineNum = 1926;BA.debugLine="Printer1.WriteString(s.GetString(\"PE_PRONOMBR";
parent._printer1._writestring /*String*/ (parent._s.GetString("PE_PRONOMBRE")+parent.__c.CRLF);
 if (true) break;

case 93:
//C
this.state = 94;
 //BA.debugLineNum = 1930;BA.debugLine="Printer1.WriteString(s.GetString(\"PE_PRONOMBR";
parent._printer1._writestring /*String*/ (parent._s.GetString("PE_PRONOMBRE")+parent.__c.CRLF);
 //BA.debugLineNum = 1931;BA.debugLine="TAMANO = s.GetLong(\"L_CANT\") + TAMANO";
parent._tamano = (int) (parent._s.GetLong("L_CANT")+parent._tamano);
 //BA.debugLineNum = 1932;BA.debugLine="If s.GetLong(\"L_COSTOU\") = 1 Then";
if (true) break;

case 94:
//if
this.state = 105;
if (parent._s.GetLong("L_COSTOU")==1) { 
this.state = 96;
}else if(parent._s.GetLong("L_COSTOU")==2) { 
this.state = 98;
}else if(parent._s.GetLong("L_COSTOU")==3) { 
this.state = 100;
}else if(parent._s.GetLong("L_COSTOU")==4) { 
this.state = 102;
}else {
this.state = 104;
}if (true) break;

case 96:
//C
this.state = 105;
 //BA.debugLineNum = 1933;BA.debugLine="TAMANO = s.GetLong(\"L_COSTOU\") + TAMANO + 3";
parent._tamano = (int) (parent._s.GetLong("L_COSTOU")+parent._tamano+3);
 if (true) break;

case 98:
//C
this.state = 105;
 //BA.debugLineNum = 1935;BA.debugLine="TAMANO = s.GetLong(\"L_COSTOU\") + TAMANO + 3";
parent._tamano = (int) (parent._s.GetLong("L_COSTOU")+parent._tamano+3);
 if (true) break;

case 100:
//C
this.state = 105;
 //BA.debugLineNum = 1937;BA.debugLine="TAMANO = s.GetLong(\"L_COSTOU\") + TAMANO + 2";
parent._tamano = (int) (parent._s.GetLong("L_COSTOU")+parent._tamano+2);
 if (true) break;

case 102:
//C
this.state = 105;
 //BA.debugLineNum = 1939;BA.debugLine="TAMANO = s.GetLong(\"L_COSTOU\") + TAMANO + 1";
parent._tamano = (int) (parent._s.GetLong("L_COSTOU")+parent._tamano+1);
 if (true) break;

case 104:
//C
this.state = 105;
 //BA.debugLineNum = 1941;BA.debugLine="TAMANO = s.GetLong(\"L_COSTOU\") + TAMANO";
parent._tamano = (int) (parent._s.GetLong("L_COSTOU")+parent._tamano);
 if (true) break;
;
 //BA.debugLineNum = 1944;BA.debugLine="If s.GetLong(\"L_COSTO_TOT\") = 1 Then";

case 105:
//if
this.state = 116;
if (parent._s.GetLong("L_COSTO_TOT")==1) { 
this.state = 107;
}else if(parent._s.GetLong("L_COSTO_TOT")==2) { 
this.state = 109;
}else if(parent._s.GetLong("L_COSTO_TOT")==3) { 
this.state = 111;
}else if(parent._s.GetLong("L_COSTO_TOT")==4) { 
this.state = 113;
}else {
this.state = 115;
}if (true) break;

case 107:
//C
this.state = 116;
 //BA.debugLineNum = 1945;BA.debugLine="TAMANO = s.GetLong(\"L_COSTO_TOT\") + TAMANO +";
parent._tamano = (int) (parent._s.GetLong("L_COSTO_TOT")+parent._tamano+3);
 if (true) break;

case 109:
//C
this.state = 116;
 //BA.debugLineNum = 1947;BA.debugLine="TAMANO = s.GetLong(\"L_COSTO_TOT\") + TAMANO +";
parent._tamano = (int) (parent._s.GetLong("L_COSTO_TOT")+parent._tamano+3);
 if (true) break;

case 111:
//C
this.state = 116;
 //BA.debugLineNum = 1949;BA.debugLine="TAMANO = s.GetLong(\"L_COSTO_TOT\") + TAMANO +";
parent._tamano = (int) (parent._s.GetLong("L_COSTO_TOT")+parent._tamano+2);
 if (true) break;

case 113:
//C
this.state = 116;
 //BA.debugLineNum = 1951;BA.debugLine="TAMANO = s.GetLong(\"L_COSTO_TOT\") + TAMANO +";
parent._tamano = (int) (parent._s.GetLong("L_COSTO_TOT")+parent._tamano+1);
 if (true) break;

case 115:
//C
this.state = 116;
 //BA.debugLineNum = 1953;BA.debugLine="TAMANO = s.GetLong(\"L_COSTO_TOT\") + TAMANO";
parent._tamano = (int) (parent._s.GetLong("L_COSTO_TOT")+parent._tamano);
 if (true) break;

case 116:
//C
this.state = 117;
;
 //BA.debugLineNum = 1956;BA.debugLine="ESPACIO = ESPACIO - TAMANO";
parent._espacio = (int) (parent._espacio-parent._tamano);
 //BA.debugLineNum = 1958;BA.debugLine="For E=0 To ESPACIO -1";
if (true) break;

case 117:
//for
this.state = 120;
step139 = 1;
limit139 = (int) (parent._espacio-1);
_e = (int) (0) ;
this.state = 145;
if (true) break;

case 145:
//C
this.state = 120;
if ((step139 > 0 && _e <= limit139) || (step139 < 0 && _e >= limit139)) this.state = 119;
if (true) break;

case 146:
//C
this.state = 145;
_e = ((int)(0 + _e + step139)) ;
if (true) break;

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

case 120:
//C
this.state = 121;
;
 //BA.debugLineNum = 1962;BA.debugLine="Printer1.Justify = 0";
parent._printer1._setjustify((int) (0));
 //BA.debugLineNum = 1963;BA.debugLine="Printer1.WriteString( s.GETSTRING(\"PE_CANT\")&";
parent._printer1._writestring /*String*/ (parent._s.GetString("PE_CANT")+parent._blanco);
 //BA.debugLineNum = 1964;BA.debugLine="Printer1.Justify = 1";
parent._printer1._setjustify((int) (1));
 //BA.debugLineNum = 1965;BA.debugLine="Printer1.WriteString(s.GETSTRING(\"PE_COSTOU\")";
parent._printer1._writestring /*String*/ (parent._s.GetString("PE_COSTOU")+parent._blanco);
 //BA.debugLineNum = 1966;BA.debugLine="Printer1.Justify = 2";
parent._printer1._setjustify((int) (2));
 //BA.debugLineNum = 1967;BA.debugLine="Printer1.WriteString(s.GETSTRING(\"PE_COSTO_TO";
parent._printer1._writestring /*String*/ (parent._s.GetString("PE_COSTO_TOT")+parent.__c.CRLF);
 //BA.debugLineNum = 1968;BA.debugLine="TAMANO = 0";
parent._tamano = (int) (0);
 //BA.debugLineNum = 1969;BA.debugLine="ESPACIO = 22";
parent._espacio = (int) (22);
 //BA.debugLineNum = 1970;BA.debugLine="BLANCO = \" \"";
parent._blanco = " ";
 if (true) break;

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

case 122:
//C
this.state = 123;
;
 //BA.debugLineNum = 1973;BA.debugLine="Printer1.WriteString(\" \" &  CRLF)";
parent._printer1._writestring /*String*/ (" "+parent.__c.CRLF);
 if (true) break;

case 123:
//C
this.state = 124;
;
 //BA.debugLineNum = 1975;BA.debugLine="s.Close";
parent._s.Close();
 //BA.debugLineNum = 1976;BA.debugLine="Printer1.Justify = 0";
parent._printer1._setjustify((int) (0));
 //BA.debugLineNum = 1977;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[]{"VENTA"})));
 //BA.debugLineNum = 1978;BA.debugLine="s.Position =0";
parent._s.setPosition((int) (0));
 //BA.debugLineNum = 1982;BA.debugLine="Printer1.WriteString(\"Total venta:   $\" & s.GetS";
parent._printer1._writestring /*String*/ ("Total venta:   $"+parent._s.GetString("TOTAL")+parent.__c.CRLF);
 //BA.debugLineNum = 1983;BA.debugLine="s.Close";
parent._s.Close();
 //BA.debugLineNum = 1984;BA.debugLine="c= skmt.ExecQuery2(\"select sum(PE_CANT) as PC_NO";
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[]{"VENTA"})));
 //BA.debugLineNum = 1985;BA.debugLine="C.Position=0";
parent._c.setPosition((int) (0));
 //BA.debugLineNum = 1986;BA.debugLine="Printer1.WriteString(\"Total articulos venta:   \"";
parent._printer1._writestring /*String*/ ("Total articulos venta:   "+parent._c.GetString("PC_NOART")+parent.__c.CRLF);
 //BA.debugLineNum = 1987;BA.debugLine="c.Close";
parent._c.Close();
 if (true) break;

case 124:
//C
this.state = 125;
;
 //BA.debugLineNum = 2008;BA.debugLine="Printer1.WriteString(\" \" &  CRLF)";
parent._printer1._writestring /*String*/ (" "+parent.__c.CRLF);
 //BA.debugLineNum = 2009;BA.debugLine="Printer1.WriteString(\"---------------------------";
parent._printer1._writestring /*String*/ ("------------------------------"+parent.__c.CRLF);
 //BA.debugLineNum = 2012;BA.debugLine="Printer1.WriteString(\"----ESTE TICKET NO ES UN --";
parent._printer1._writestring /*String*/ ("----ESTE TICKET NO ES UN -----"+parent.__c.CRLF);
 //BA.debugLineNum = 2013;BA.debugLine="Printer1.WriteString(\"--COMPROBANTE FISCAL, SOLO";
parent._printer1._writestring /*String*/ ("--COMPROBANTE FISCAL, SOLO ES-"+parent.__c.CRLF);
 //BA.debugLineNum = 2014;BA.debugLine="Printer1.WriteString(\"--------INFORMATIVO--------";
parent._printer1._writestring /*String*/ ("--------INFORMATIVO-----------"+parent.__c.CRLF);
 //BA.debugLineNum = 2015;BA.debugLine="Printer1.WriteString(\"---------------------------";
parent._printer1._writestring /*String*/ ("------------------------------"+parent.__c.CRLF);
 //BA.debugLineNum = 2016;BA.debugLine="Printer1.WriteString(\" \" &  CRLF)";
parent._printer1._writestring /*String*/ (" "+parent.__c.CRLF);
 //BA.debugLineNum = 2017;BA.debugLine="Printer1.WriteString(\" \" &  CRLF)";
parent._printer1._writestring /*String*/ (" "+parent.__c.CRLF);
 //BA.debugLineNum = 2018;BA.debugLine="Printer1.WriteString(\" \" &  CRLF)";
parent._printer1._writestring /*String*/ (" "+parent.__c.CRLF);
 //BA.debugLineNum = 2019;BA.debugLine="Sleep(1000)";
parent.__c.Sleep(ba,this,(int) (1000));
this.state = 147;
return;
case 147:
//C
this.state = 125;
;
 //BA.debugLineNum = 2020;BA.debugLine="Printer1.DisConnect";
parent._printer1._disconnect /*String*/ ();
 //BA.debugLineNum = 2022;BA.debugLine="ProgressDialogHide";
parent.__c.ProgressDialogHide();
 //BA.debugLineNum = 2024;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 = 2025;BA.debugLine="If s.RowCount = 0 Then";
if (true) break;

case 125:
//if
this.state = 134;
if (parent._s.getRowCount()==0) { 
this.state = 127;
}if (true) break;

case 127:
//C
this.state = 128;
 //BA.debugLineNum = 2026;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 = 2027;BA.debugLine="Wait For Msgbox_Result (resultado As Int)";
parent.__c.WaitFor("msgbox_result", ba, this, null);
this.state = 148;
return;
case 148:
//C
this.state = 128;
_resultado = (Integer) result[0];
;
 //BA.debugLineNum = 2028;BA.debugLine="If resultado = DialogResponse.POSITIVE Then";
if (true) break;

case 128:
//if
this.state = 133;
if (_resultado==parent.__c.DialogResponse.POSITIVE) { 
this.state = 130;
}else {
this.state = 132;
}if (true) break;

case 130:
//C
this.state = 133;
 //BA.debugLineNum = 2029;BA.debugLine="B_IMP_Click";
parent._b_imp_click();
 if (true) break;

case 132:
//C
this.state = 133;
 //BA.debugLineNum = 2031;BA.debugLine="GUADAVENTA2";
parent._guadaventa2();
 if (true) break;

case 133:
//C
this.state = 134;
;
 if (true) break;

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

            }
        }
    }
}
public Object  _initialize(anywheresoftware.b4a.BA _ba) throws Exception{
innerInitialize(_ba);
 //BA.debugLineNum = 179;BA.debugLine="Public Sub Initialize As Object";
 //BA.debugLineNum = 180;BA.debugLine="Return Me";
if (true) return this;
 //BA.debugLineNum = 181;BA.debugLine="End Sub";
return null;
}
public void  _initializecamera() throws Exception{
ResumableSub_InitializeCamera rsub = new ResumableSub_InitializeCamera(this);
rsub.resume(ba, null);
}
public static class ResumableSub_InitializeCamera extends BA.ResumableSub {
public ResumableSub_InitializeCamera(adm.keymon.com.mx.c_cliente parent) {
this.parent = parent;
}
adm.keymon.com.mx.c_cliente parent;
String _permission = "";
boolean _resulta = 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 = 2831;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 = 2832;BA.debugLine="Wait For B4XPage_PermissionResult (Permission As";
parent.__c.WaitFor("b4xpage_permissionresult", ba, this, null);
this.state = 7;
return;
case 7:
//C
this.state = 1;
_permission = (String) result[0];
_resulta = (Boolean) result[1];
;
 //BA.debugLineNum = 2833;BA.debugLine="If resulta Then";
if (true) break;

case 1:
//if
this.state = 6;
if (_resulta) { 
this.state = 3;
}else {
this.state = 5;
}if (true) break;

case 3:
//C
this.state = 6;
 //BA.debugLineNum = 2834;BA.debugLine="camEx.Initialize(p_cam, frontCamera, Me, \"Camera";
parent._camex._initialize /*String*/ (ba,parent._p_cam,parent._frontcamera,parent,"Camera1");
 //BA.debugLineNum = 2835;BA.debugLine="frontCamera = camEx.Front";
parent._frontcamera = parent._camex._front /*boolean*/ ;
 if (true) break;

case 5:
//C
this.state = 6;
 //BA.debugLineNum = 2837;BA.debugLine="ToastMessageShow(\"No permission!!!\", True)";
parent.__c.ToastMessageShow(BA.ObjectToCharSequence("No permission!!!"),parent.__c.True);
 if (true) break;

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

            }
        }
    }
}
public String  _jobdone(adm.keymon.com.mx.httpjob _job) throws Exception{
adm.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 = 2416;BA.debugLine="Sub JobDone(Job As HttpJob)";
 //BA.debugLineNum = 2418;BA.debugLine="If Job.Success = False Then";
if (_job._success /*boolean*/ ==__c.False) { 
 }else {
 //BA.debugLineNum = 2421;BA.debugLine="LogColor(\"JobDone: '\" & reqManager.HandleJob(Job";
__c.LogImpl("343974661","JobDone: '"+BA.ObjectToString(_reqmanager._handlejob /*adm.keymon.com.mx.dbrequestmanager._dbresult*/ (_job).Tag /*Object*/ )+"' - Registros: "+BA.NumberToString(_reqmanager._handlejob /*adm.keymon.com.mx.dbrequestmanager._dbresult*/ (_job).Rows /*anywheresoftware.b4a.objects.collections.List*/ .getSize()),__c.Colors.Green);
 //BA.debugLineNum = 2422;BA.debugLine="If Job.JobName = \"DBRequest\" Then";
if ((_job._jobname /*String*/ ).equals("DBRequest")) { 
 //BA.debugLineNum = 2423;BA.debugLine="Dim resultado As DBResult = reqManager.HandleJo";
_resultado = _reqmanager._handlejob /*adm.keymon.com.mx.dbrequestmanager._dbresult*/ (_job);
 //BA.debugLineNum = 2424;BA.debugLine="If resultado.Tag.As(String).IndexOf(\"ins_pedido";
if ((BA.ObjectToString(_resultado.Tag /*Object*/ )).indexOf("ins_pedidosPendientes_head_")>-1) { 
 //BA.debugLineNum = 2425;BA.debugLine="Subs.logJobDoneResultados(resultado)";
_subs._logjobdoneresultados /*String*/ (ba,_resultado);
 //BA.debugLineNum = 2426;BA.debugLine="Private cliente As String= resultado.Tag";
_cliente = BA.ObjectToString(_resultado.Tag /*Object*/ );
 //BA.debugLineNum = 2427;BA.debugLine="cliente = cliente.SubString(cliente.IndexOf(\"_";
_cliente = _cliente.substring((int) (_cliente.indexOf("_")+24));
 //BA.debugLineNum = 2429;BA.debugLine="For Each records() As Object In resultado.Rows";
{
final anywheresoftware.b4a.BA.IterableList group10 = _resultado.Rows /*anywheresoftware.b4a.objects.collections.List*/ ;
final int groupLen10 = group10.getSize()
;int index10 = 0;
;
for (; index10 < groupLen10;index10++){
_records = (Object[])(group10.Get(index10));
 //BA.debugLineNum = 2430;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 = 2432;BA.debugLine="Private pars() As String = Regex.Split(\"_\",";
_pars = __c.Regex.Split("_",BA.ObjectToString(_resultado.Tag /*Object*/ ));
 //BA.debugLineNum = 2433;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery($\"update";
_b4xpages._mainpage /*adm.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 = 2443;BA.debugLine="If Job.JobName = \"DBRequest\" Then";
if ((_job._jobname /*String*/ ).equals("DBRequest")) { 
 //BA.debugLineNum = 2444;BA.debugLine="Dim resultado As DBResult = reqManager.HandleJo";
_resultado = _reqmanager._handlejob /*adm.keymon.com.mx.dbrequestmanager._dbresult*/ (_job);
 //BA.debugLineNum = 2445;BA.debugLine="If resultado.Tag = \"piezas\" Then 'query tag";
if ((_resultado.Tag /*Object*/ ).equals((Object)("piezas"))) { 
 //BA.debugLineNum = 2447;BA.debugLine="Dim piezasexiste As Int";
_piezasexiste = 0;
 //BA.debugLineNum = 2449;BA.debugLine="For Each records() As Object In resultado.Rows";
{
final anywheresoftware.b4a.BA.IterableList group22 = _resultado.Rows /*anywheresoftware.b4a.objects.collections.List*/ ;
final int groupLen22 = group22.getSize()
;int index22 = 0;
;
for (; index22 < groupLen22;index22++){
_records = (Object[])(group22.Get(index22));
 //BA.debugLineNum = 2451;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 = 2452;BA.debugLine="Log(piezasexiste)";
__c.LogImpl("343974692",BA.NumberToString(_piezasexiste),0);
 //BA.debugLineNum = 2453;BA.debugLine="DateTime.DateFormat = \"MM/dd/yyyy\"";
__c.DateTime.setDateFormat("MM/dd/yyyy");
 //BA.debugLineNum = 2454;BA.debugLine="DateTime.TimeFormat = \"HH:mm:ss\"";
__c.DateTime.setTimeFormat("HH:mm:ss");
 //BA.debugLineNum = 2455;BA.debugLine="sDate=DateTime.Date(DateTime.Now)";
_sdate = __c.DateTime.Date(__c.DateTime.getNow());
 //BA.debugLineNum = 2456;BA.debugLine="sTime=DateTime.Time(DateTime.Now)";
_stime = __c.DateTime.Time(__c.DateTime.getNow());
 //BA.debugLineNum = 2457;BA.debugLine="If piezasexiste =  0 Then";
if (_piezasexiste==0) { 
 //BA.debugLineNum = 2459;BA.debugLine="Dim PCNoArts As String";
_pcnoarts = "";
 //BA.debugLineNum = 2460;BA.debugLine="Dim PCMonto As String";
_pcmonto = "";
 //BA.debugLineNum = 2461;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 = 2463;BA.debugLine="If c.RowCount > 0 Then";
if (_c.getRowCount()>0) { 
 //BA.debugLineNum = 2464;BA.debugLine="c.Position = 0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 2465;BA.debugLine="PCNoArts = c.GetString(\"PC_NOART\")";
_pcnoarts = _c.GetString("PC_NOART");
 //BA.debugLineNum = 2466;BA.debugLine="PCMonto = c.GetString(\"PC_MONTO\")";
_pcmonto = _c.GetString("PC_MONTO");
 };
 //BA.debugLineNum = 2469;BA.debugLine="Dim cmd As DBCommand";
_cmd = new adm.keymon.com.mx.dbrequestmanager._dbcommand();
 //BA.debugLineNum = 2470;BA.debugLine="cmd.Initialize";
_cmd.Initialize();
 //BA.debugLineNum = 2471;BA.debugLine="cmd.Name = \"insert_HVC_ADM\"";
_cmd.Name /*String*/  = "insert_HVC_ADM";
 //BA.debugLineNum = 2472;BA.debugLine="cmd.Parameters = Array As Object((sDate & \"";
_cmd.Parameters /*Object[]*/  = new Object[]{(Object)((_sdate+" "+_stime)),(Object)(_la_cuenta.getText()),(Object)(_pcnoarts),(Object)(_pcmonto),(Object)(_almacen),(Object)(_la_ruta)};
 //BA.debugLineNum = 2473;BA.debugLine="reqManager.ExecuteCommand(cmd , \"insert_hvc\"";
_reqmanager._executecommand /*String*/ (_cmd,(Object)("insert_hvc"));
 }else if(_piezasexiste==1) { 
 //BA.debugLineNum = 2477;BA.debugLine="Dim PCNoArts As String";
_pcnoarts = "";
 //BA.debugLineNum = 2478;BA.debugLine="Dim PCMonto As String";
_pcmonto = "";
 //BA.debugLineNum = 2479;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 = 2481;BA.debugLine="If c.RowCount > 0 Then";
if (_c.getRowCount()>0) { 
 //BA.debugLineNum = 2482;BA.debugLine="c.Position = 0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 2483;BA.debugLine="PCNoArts = c.GetString(\"PC_NOART\")";
_pcnoarts = _c.GetString("PC_NOART");
 //BA.debugLineNum = 2484;BA.debugLine="PCMonto = c.GetString(\"PC_MONTO\")";
_pcmonto = _c.GetString("PC_MONTO");
 };
 //BA.debugLineNum = 2486;BA.debugLine="cmd.Initialize";
_cmd.Initialize();
 //BA.debugLineNum = 2487;BA.debugLine="cmd.Name = \"update_HVC_ADM\"";
_cmd.Name /*String*/  = "update_HVC_ADM";
 //BA.debugLineNum = 2488;BA.debugLine="cmd.Parameters = Array As Object((sDate & \"";
_cmd.Parameters /*Object[]*/  = new Object[]{(Object)((_sdate+" "+_stime)),(Object)(_la_cuenta.getText()),(Object)(_pcnoarts),(Object)(_pcmonto),(Object)(_almacen),(Object)(_la_ruta),(Object)(_la_cuenta.getText()),(Object)(_almacen),(Object)(_la_ruta)};
 //BA.debugLineNum = 2489;BA.debugLine="reqManager.ExecuteCommand(cmd, \"update_hvc\")";
_reqmanager._executecommand /*String*/ (_cmd,(Object)("update_hvc"));
 };
 }
};
 };
 };
 //BA.debugLineNum = 2498;BA.debugLine="If Job.JobName = \"DBRequest\" Then";
if ((_job._jobname /*String*/ ).equals("DBRequest")) { 
 //BA.debugLineNum = 2499;BA.debugLine="Dim resultado As DBResult = reqManager.HandleJo";
_resultado = _reqmanager._handlejob /*adm.keymon.com.mx.dbrequestmanager._dbresult*/ (_job);
 //BA.debugLineNum = 2500;BA.debugLine="If resultado.Tag = \"piezasrecarga\" Then 'query";
if ((_resultado.Tag /*Object*/ ).equals((Object)("piezasrecarga"))) { 
 //BA.debugLineNum = 2502;BA.debugLine="Dim piezasexiste As Int";
_piezasexiste = 0;
 //BA.debugLineNum = 2503;BA.debugLine="For Each records() As Object In resultado.Rows";
{
final anywheresoftware.b4a.BA.IterableList group64 = _resultado.Rows /*anywheresoftware.b4a.objects.collections.List*/ ;
final int groupLen64 = group64.getSize()
;int index64 = 0;
;
for (; index64 < groupLen64;index64++){
_records = (Object[])(group64.Get(index64));
 //BA.debugLineNum = 2504;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 = 2505;BA.debugLine="Log(piezasexiste)";
__c.LogImpl("343974745",BA.NumberToString(_piezasexiste),0);
 //BA.debugLineNum = 2506;BA.debugLine="DateTime.DateFormat = \"MM/dd/yyyy\"";
__c.DateTime.setDateFormat("MM/dd/yyyy");
 //BA.debugLineNum = 2507;BA.debugLine="DateTime.TimeFormat = \"HH:mm:ss\"";
__c.DateTime.setTimeFormat("HH:mm:ss");
 //BA.debugLineNum = 2508;BA.debugLine="sDate=DateTime.Date(DateTime.Now)";
_sdate = __c.DateTime.Date(__c.DateTime.getNow());
 //BA.debugLineNum = 2509;BA.debugLine="sTime=DateTime.Time(DateTime.Now)";
_stime = __c.DateTime.Time(__c.DateTime.getNow());
 //BA.debugLineNum = 2510;BA.debugLine="If piezasexiste =  0 Then";
if (_piezasexiste==0) { 
 //BA.debugLineNum = 2511;BA.debugLine="Dim PCNoArts As String";
_pcnoarts = "";
 //BA.debugLineNum = 2512;BA.debugLine="Dim PCMonto As String";
_pcmonto = "";
 //BA.debugLineNum = 2513;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 = 2514;BA.debugLine="If c.RowCount > 0 Then";
if (_c.getRowCount()>0) { 
 //BA.debugLineNum = 2515;BA.debugLine="c.Position = 0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 2516;BA.debugLine="PCNoArts = c.GetString(\"PC_NOART\")";
_pcnoarts = _c.GetString("PC_NOART");
 //BA.debugLineNum = 2517;BA.debugLine="PCMonto = c.GetString(\"PC_MONTO\")";
_pcmonto = _c.GetString("PC_MONTO");
 };
 //BA.debugLineNum = 2519;BA.debugLine="Dim cmd As DBCommand";
_cmd = new adm.keymon.com.mx.dbrequestmanager._dbcommand();
 //BA.debugLineNum = 2520;BA.debugLine="cmd.Initialize";
_cmd.Initialize();
 //BA.debugLineNum = 2521;BA.debugLine="cmd.Name = \"insert_HVC_ADM\"";
_cmd.Name /*String*/  = "insert_HVC_ADM";
 //BA.debugLineNum = 2522;BA.debugLine="cmd.Parameters = Array As Object((sDate & \"";
_cmd.Parameters /*Object[]*/  = new Object[]{(Object)((_sdate+" "+_stime)),(Object)("0"),(Object)(_pcnoarts),(Object)(_pcmonto),(Object)(_almacen),(Object)(_la_ruta)};
 //BA.debugLineNum = 2523;BA.debugLine="reqManager.ExecuteCommand(cmd , \"insert_hvc\"";
_reqmanager._executecommand /*String*/ (_cmd,(Object)("insert_hvc"));
 }else if(_piezasexiste==1) { 
 //BA.debugLineNum = 2526;BA.debugLine="Dim PCNoArts As String";
_pcnoarts = "";
 //BA.debugLineNum = 2527;BA.debugLine="Dim PCMonto As String";
_pcmonto = "";
 //BA.debugLineNum = 2528;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 = 2529;BA.debugLine="If c.RowCount > 0 Then";
if (_c.getRowCount()>0) { 
 //BA.debugLineNum = 2530;BA.debugLine="c.Position = 0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 2531;BA.debugLine="PCNoArts = c.GetString(\"PC_NOART\")";
_pcnoarts = _c.GetString("PC_NOART");
 //BA.debugLineNum = 2532;BA.debugLine="PCMonto = c.GetString(\"PC_MONTO\")";
_pcmonto = _c.GetString("PC_MONTO");
 };
 //BA.debugLineNum = 2534;BA.debugLine="cmd.Initialize";
_cmd.Initialize();
 //BA.debugLineNum = 2535;BA.debugLine="cmd.Name = \"update_HVC_ADM\"";
_cmd.Name /*String*/  = "update_HVC_ADM";
 //BA.debugLineNum = 2536;BA.debugLine="cmd.Parameters = Array As Object((sDate & \"";
_cmd.Parameters /*Object[]*/  = new Object[]{(Object)((_sdate+" "+_stime)),(Object)("0"),(Object)(_pcnoarts),(Object)(_pcmonto),(Object)(_almacen),(Object)(_la_ruta),(Object)(_la_cuenta.getText()),(Object)(_almacen),(Object)(_la_ruta)};
 //BA.debugLineNum = 2537;BA.debugLine="reqManager.ExecuteCommand(cmd, \"update_hvc\")";
_reqmanager._executecommand /*String*/ (_cmd,(Object)("update_hvc"));
 };
 }
};
 };
 };
 //BA.debugLineNum = 2543;BA.debugLine="If Job.JobName = \"DBRequest\" Then";
if ((_job._jobname /*String*/ ).equals("DBRequest")) { 
 //BA.debugLineNum = 2544;BA.debugLine="Dim resultado As DBResult = reqManager.HandleJo";
_resultado = _reqmanager._handlejob /*adm.keymon.com.mx.dbrequestmanager._dbresult*/ (_job);
 //BA.debugLineNum = 2545;BA.debugLine="If resultado.Tag.As(String).IndexOf(\"ins_pedido";
if ((BA.ObjectToString(_resultado.Tag /*Object*/ )).indexOf("ins_pedidosPendientes_prods_")>-1) { 
 //BA.debugLineNum = 2546;BA.debugLine="Subs.logJobDoneResultados(resultado)";
_subs._logjobdoneresultados /*String*/ (ba,_resultado);
 //BA.debugLineNum = 2547;BA.debugLine="Private cliente As String= resultado.Tag";
_cliente = BA.ObjectToString(_resultado.Tag /*Object*/ );
 //BA.debugLineNum = 2548;BA.debugLine="cliente = cliente.SubString(cliente.IndexOf(\"_";
_cliente = _cliente.substring((int) (_cliente.indexOf("_")+25));
 //BA.debugLineNum = 2549;BA.debugLine="Log($\"Cliente2:${cliente}\"$)";
__c.LogImpl("343974789",("Cliente2:"+__c.SmartStringFormatter("",(Object)(_cliente))+""),0);
 //BA.debugLineNum = 2550;BA.debugLine="For Each records() As Object In resultado.Rows";
{
final anywheresoftware.b4a.BA.IterableList group109 = _resultado.Rows /*anywheresoftware.b4a.objects.collections.List*/ ;
final int groupLen109 = group109.getSize()
;int index109 = 0;
;
for (; index109 < groupLen109;index109++){
_records = (Object[])(group109.Get(index109));
 //BA.debugLineNum = 2552;BA.debugLine="Private pars() As String = Regex.Split(\"_\", r";
_pars = __c.Regex.Split("_",BA.ObjectToString(_resultado.Tag /*Object*/ ));
 //BA.debugLineNum = 2553;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery($\"update";
_b4xpages._mainpage /*adm.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("update PEDIDO set PE_ENVIO_OK = 1 where PE_CLIENTE = '"+__c.SmartStringFormatter("",(Object)(_pars[(int) (3)]))+"' and PE_PROID = '"+__c.SmartStringFormatter("",(Object)(_pars[(int) (4)]))+"' and PE_ENVIO_OK = 0"));
 }
};
 };
 };
 //BA.debugLineNum = 2563;BA.debugLine="If Job.JobName = \"DBRequest\" Then";
if ((_job._jobname /*String*/ ).equals("DBRequest")) { 
 //BA.debugLineNum = 2564;BA.debugLine="Dim resultado As DBResult = reqManager.HandleJo";
_resultado = _reqmanager._handlejob /*adm.keymon.com.mx.dbrequestmanager._dbresult*/ (_job);
 //BA.debugLineNum = 2565;BA.debugLine="If resultado.Tag.As(String).IndexOf(\"ins_abonos";
if ((BA.ObjectToString(_resultado.Tag /*Object*/ )).indexOf("ins_abonosPendientes_")>-1) { 
 //BA.debugLineNum = 2566;BA.debugLine="Private cliente As String= resultado.Tag";
_cliente = BA.ObjectToString(_resultado.Tag /*Object*/ );
 //BA.debugLineNum = 2567;BA.debugLine="cliente = cliente.SubString(cliente.IndexOf(\"_";
_cliente = _cliente.substring((int) (_cliente.indexOf("_")+18));
 //BA.debugLineNum = 2568;BA.debugLine="Log($\"Cliente2:${cliente}\"$)";
__c.LogImpl("343974808",("Cliente2:"+__c.SmartStringFormatter("",(Object)(_cliente))+""),0);
 //BA.debugLineNum = 2569;BA.debugLine="For Each records() As Object In resultado.Rows";
{
final anywheresoftware.b4a.BA.IterableList group121 = _resultado.Rows /*anywheresoftware.b4a.objects.collections.List*/ ;
final int groupLen121 = group121.getSize()
;int index121 = 0;
;
for (; index121 < groupLen121;index121++){
_records = (Object[])(group121.Get(index121));
 //BA.debugLineNum = 2570;BA.debugLine="For Each k As String In resultado.Columns.Key";
{
final anywheresoftware.b4a.BA.IterableList group122 = _resultado.Columns /*anywheresoftware.b4a.objects.collections.Map*/ .Keys();
final int groupLen122 = group122.getSize()
;int index122 = 0;
;
for (; index122 < groupLen122;index122++){
_k = BA.ObjectToString(group122.Get(index122));
 //BA.debugLineNum = 2571;BA.debugLine="Log(resultado.Tag & \": \" & k & \": \" & record";
__c.LogImpl("343974811",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 = 2574;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery($\"UPDATE A";
_b4xpages._mainpage /*adm.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 = 2579;BA.debugLine="If Job.JobName = \"DBRequest\" Then";
if ((_job._jobname /*String*/ ).equals("DBRequest")) { 
 //BA.debugLineNum = 2580;BA.debugLine="Dim resultado As DBResult = reqManager.HandleJo";
_resultado = _reqmanager._handlejob /*adm.keymon.com.mx.dbrequestmanager._dbresult*/ (_job);
 //BA.debugLineNum = 2581;BA.debugLine="If resultado.Tag.As(String).IndexOf(\"insert_cli";
if ((BA.ObjectToString(_resultado.Tag /*Object*/ )).indexOf("insert_cliente_")>-1) { 
 //BA.debugLineNum = 2582;BA.debugLine="Private cliente As String= resultado.Tag";
_cliente = BA.ObjectToString(_resultado.Tag /*Object*/ );
 //BA.debugLineNum = 2583;BA.debugLine="cliente = cliente.SubString(cliente.IndexOf(\"_";
_cliente = _cliente.substring((int) (_cliente.indexOf("_")+9));
 //BA.debugLineNum = 2584;BA.debugLine="Log($\"Cliente2:${cliente}\"$)";
__c.LogImpl("343974824",("Cliente2:"+__c.SmartStringFormatter("",(Object)(_cliente))+""),0);
 //BA.debugLineNum = 2585;BA.debugLine="For Each records() As Object In resultado.Rows";
{
final anywheresoftware.b4a.BA.IterableList group135 = _resultado.Rows /*anywheresoftware.b4a.objects.collections.List*/ ;
final int groupLen135 = group135.getSize()
;int index135 = 0;
;
for (; index135 < groupLen135;index135++){
_records = (Object[])(group135.Get(index135));
 //BA.debugLineNum = 2586;BA.debugLine="For Each k As String In resultado.Columns.Key";
{
final anywheresoftware.b4a.BA.IterableList group136 = _resultado.Columns /*anywheresoftware.b4a.objects.collections.Map*/ .Keys();
final int groupLen136 = group136.getSize()
;int index136 = 0;
;
for (; index136 < groupLen136;index136++){
_k = BA.ObjectToString(group136.Get(index136));
 //BA.debugLineNum = 2587;BA.debugLine="Log(resultado.Tag & \": \" & k & \": \" & record";
__c.LogImpl("343974827",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 = 2590;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery($\"UPDATE C";
_b4xpages._mainpage /*adm.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 = 2595;BA.debugLine="If Job.JobName = \"DBRequest\" Then";
if ((_job._jobname /*String*/ ).equals("DBRequest")) { 
 //BA.debugLineNum = 2596;BA.debugLine="Dim resultado As DBResult = reqManager.HandleJo";
_resultado = _reqmanager._handlejob /*adm.keymon.com.mx.dbrequestmanager._dbresult*/ (_job);
 //BA.debugLineNum = 2597;BA.debugLine="If resultado.Tag.As(String).IndexOf(\"insert_cue";
if ((BA.ObjectToString(_resultado.Tag /*Object*/ )).indexOf("insert_cuestionario_")>-1) { 
 //BA.debugLineNum = 2598;BA.debugLine="Private pars() As String = Regex.Split(\"_\", re";
_pars = __c.Regex.Split("_",(BA.ObjectToString(_resultado.Tag /*Object*/ )));
 //BA.debugLineNum = 2599;BA.debugLine="Log($\"${resultado.tag}|${pars(0)}\"$)";
__c.LogImpl("343974839",(""+__c.SmartStringFormatter("",_resultado.Tag /*Object*/ )+"|"+__c.SmartStringFormatter("",(Object)(_pars[(int) (0)]))+""),0);
 //BA.debugLineNum = 2600;BA.debugLine="Log($\"${pars(1)}\"$)";
__c.LogImpl("343974840",(""+__c.SmartStringFormatter("",(Object)(_pars[(int) (1)]))+""),0);
 //BA.debugLineNum = 2601;BA.debugLine="Log($\"${pars(2)}\"$)";
__c.LogImpl("343974841",(""+__c.SmartStringFormatter("",(Object)(_pars[(int) (2)]))+""),0);
 //BA.debugLineNum = 2602;BA.debugLine="Log($\"${pars(3)}\"$)";
__c.LogImpl("343974842",(""+__c.SmartStringFormatter("",(Object)(_pars[(int) (3)]))+""),0);
 //BA.debugLineNum = 2603;BA.debugLine="Log($\"${pars(4)}\"$)";
__c.LogImpl("343974843",(""+__c.SmartStringFormatter("",(Object)(_pars[(int) (4)]))+""),0);
 //BA.debugLineNum = 2604;BA.debugLine="Private cliente As String = pars(2)";
_cliente = _pars[(int) (2)];
 //BA.debugLineNum = 2605;BA.debugLine="Private idPreg As String = pars(3)";
_idpreg = _pars[(int) (3)];
 //BA.debugLineNum = 2606;BA.debugLine="Private idResp As String = pars(4)";
_idresp = _pars[(int) (4)];
 //BA.debugLineNum = 2607;BA.debugLine="Log($\"Cliente2:${cliente}, preg:${idPreg}, res";
__c.LogImpl("343974847",("Cliente2:"+__c.SmartStringFormatter("",(Object)(_cliente))+", preg:"+__c.SmartStringFormatter("",(Object)(_idpreg))+", res:"+__c.SmartStringFormatter("",(Object)(_idresp))+""),0);
 //BA.debugLineNum = 2608;BA.debugLine="For Each records() As Object In resultado.Rows";
{
final anywheresoftware.b4a.BA.IterableList group156 = _resultado.Rows /*anywheresoftware.b4a.objects.collections.List*/ ;
final int groupLen156 = group156.getSize()
;int index156 = 0;
;
for (; index156 < groupLen156;index156++){
_records = (Object[])(group156.Get(index156));
 //BA.debugLineNum = 2609;BA.debugLine="For Each k As String In resultado.Columns.Key";
{
final anywheresoftware.b4a.BA.IterableList group157 = _resultado.Columns /*anywheresoftware.b4a.objects.collections.Map*/ .Keys();
final int groupLen157 = group157.getSize()
;int index157 = 0;
;
for (; index157 < groupLen157;index157++){
_k = BA.ObjectToString(group157.Get(index157));
 //BA.debugLineNum = 2610;BA.debugLine="Log(resultado.Tag & \": \" & k & \": \" & record";
__c.LogImpl("343974850",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 = 2613;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery($\"UPDATE C";
_b4xpages._mainpage /*adm.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 = 2617;BA.debugLine="Job.Release";
_job._release /*String*/ ();
 };
 //BA.debugLineNum = 2620;BA.debugLine="End Sub";
return "";
}
public String  _label20_longclick() throws Exception{
adm.keymon.com.mx.cpdf _pdf = null;
anywheresoftware.b4a.sql.SQL.CursorWrapper _s56 = null;
anywheresoftware.b4a.sql.SQL.CursorWrapper _s57 = null;
double _pagina = 0;
int _multiplicador = 0;
int _i = 0;
int _e = 0;
 //BA.debugLineNum = 1339;BA.debugLine="Private Sub Label20_LongClick";
 //BA.debugLineNum = 1340;BA.debugLine="xui.SetDataFolder(\"B4Xpdf\")";
_xui.SetDataFolder("B4Xpdf");
 //BA.debugLineNum = 1341;BA.debugLine="File.Copy(File.DirAssets,\"intmex_logo_192x192.jpg";
__c.File.Copy(__c.File.getDirAssets(),"intmex_logo_192x192.jpg",_xui.getDefaultFolder(),"intmex_logo_192x192.jpg");
 //BA.debugLineNum = 1342;BA.debugLine="File.Copy(File.DirAssets,\"mariana1.jpg\",xui.Defau";
__c.File.Copy(__c.File.getDirAssets(),"mariana1.jpg",_xui.getDefaultFolder(),"mariana1.jpg");
 //BA.debugLineNum = 1343;BA.debugLine="File.Copy(File.DirAssets,\"guna-fondo.jpg\",xui.Def";
__c.File.Copy(__c.File.getDirAssets(),"guna-fondo.jpg",_xui.getDefaultFolder(),"guna-fondo.jpg");
 //BA.debugLineNum = 1344;BA.debugLine="ESPACIO = 0";
_espacio = (int) (0);
 //BA.debugLineNum = 1345;BA.debugLine="DateTime.DateFormat = \"MM/dd/yyyy\"";
__c.DateTime.setDateFormat("MM/dd/yyyy");
 //BA.debugLineNum = 1346;BA.debugLine="DateTime.TimeFormat = \"HH:mm:ss\"";
__c.DateTime.setTimeFormat("HH:mm:ss");
 //BA.debugLineNum = 1347;BA.debugLine="sDate=DateTime.Date(DateTime.Now)";
_sdate = __c.DateTime.Date(__c.DateTime.getNow());
 //BA.debugLineNum = 1348;BA.debugLine="sTime=DateTime.Time(DateTime.Now)";
_stime = __c.DateTime.Time(__c.DateTime.getNow());
 //BA.debugLineNum = 1349;BA.debugLine="Dim PDF As cPDF";
_pdf = new adm.keymon.com.mx.cpdf();
 //BA.debugLineNum = 1351;BA.debugLine="PDF.Initialize(\"mm\")";
_pdf._initialize /*adm.keymon.com.mx.cpdf*/ (ba,"mm");
 //BA.debugLineNum = 1354;BA.debugLine="PDF.sProperty(PDF.PropertyAuthor,\"Keymonsoft\"). _";
_pdf._sproperty /*adm.keymon.com.mx.cpdf*/ (_pdf._propertyauthor /*String*/ ,"Keymonsoft")._sproperty /*adm.keymon.com.mx.cpdf*/ (_pdf._propertytitle /*String*/ ,"Ticket")._sproperty /*adm.keymon.com.mx.cpdf*/ (_pdf._propertykeywords /*String*/ ,"B4X,PDF,Cross platform");
 //BA.debugLineNum = 1358;BA.debugLine="Dim s56 As Cursor=skmt.ExecQuery2(\"select PE_PRON";
_s56 = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_s56 = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_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) < 4 AND PE_CLIENTE IN (Select CUENTA from cuentaa)  order by  PE_PROID",new String[]{"PREVENTA"})));
 //BA.debugLineNum = 1359;BA.debugLine="Dim s57 As Cursor = skmt.ExecQuery2(\"select PE_PR";
_s57 = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_s57 = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_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 = 1362;BA.debugLine="Dim pagina As Double = ((18 + (s56.RowCount*2) +";
_pagina = ((18+(_s56.getRowCount()*2)+(_s57.getRowCount()*2)+2)*(6))+22;
 //BA.debugLineNum = 1363;BA.debugLine="Dim multiplicador As Int = 0";
_multiplicador = (int) (0);
 //BA.debugLineNum = 1365;BA.debugLine="PDF.pageAdd(-300,pagina)";
_pdf._pageadd /*adm.keymon.com.mx.cpdf*/ (-300,_pagina);
 //BA.debugLineNum = 1367;BA.debugLine="PDF.sFont(PDF.fontHelvetica,0,10,PDF.colorBlack)";
_pdf._sfont /*adm.keymon.com.mx.cpdf*/ (_pdf._fonthelvetica /*String*/ ,(int) (0),10,_pdf._colorblack /*double[]*/ );
 //BA.debugLineNum = 1369;BA.debugLine="PDF.outImage(xui.DefaultFolder,\"mariana1.jpg\",1,p";
_pdf._outimage /*adm.keymon.com.mx.cpdf*/ (_xui.getDefaultFolder(),"mariana1.jpg",1,_pagina-55,70,0);
 //BA.debugLineNum = 1370;BA.debugLine="multiplicador = multiplicador +1";
_multiplicador = (int) (_multiplicador+1);
 //BA.debugLineNum = 1371;BA.debugLine="PDF.outtext(1,pagina-multiplicador*6,\"ADM Distrib";
_pdf._outtext /*adm.keymon.com.mx.cpdf*/ (1,_pagina-_multiplicador*6,"ADM Distribuciones");
 //BA.debugLineNum = 1373;BA.debugLine="multiplicador = multiplicador +1";
_multiplicador = (int) (_multiplicador+1);
 //BA.debugLineNum = 1374;BA.debugLine="PDF.outtext(1,pagina-multiplicador*6,sDate& \" \" &";
_pdf._outtext /*adm.keymon.com.mx.cpdf*/ (1,_pagina-_multiplicador*6,_sdate+" "+_stime);
 //BA.debugLineNum = 1376;BA.debugLine="multiplicador = multiplicador +1";
_multiplicador = (int) (_multiplicador+1);
 //BA.debugLineNum = 1377;BA.debugLine="PDF.outtext(1,pagina-multiplicador*6,\"Vendedor:\"";
_pdf._outtext /*adm.keymon.com.mx.cpdf*/ (1,_pagina-_multiplicador*6,"Vendedor:"+_subs._traeusuariodebd /*String*/ (ba));
 //BA.debugLineNum = 1379;BA.debugLine="multiplicador = multiplicador +1";
_multiplicador = (int) (_multiplicador+1);
 //BA.debugLineNum = 1380;BA.debugLine="PDF.outtext(1,pagina-multiplicador*6,\"Tienda: \" &";
_pdf._outtext /*adm.keymon.com.mx.cpdf*/ (1,_pagina-_multiplicador*6,"Tienda: "+_la_nombre.getText());
 //BA.debugLineNum = 1382;BA.debugLine="multiplicador = multiplicador +1";
_multiplicador = (int) (_multiplicador+1);
 //BA.debugLineNum = 1383;BA.debugLine="PDF.outtext(1,pagina-multiplicador*6,\"ID.Cliente:";
_pdf._outtext /*adm.keymon.com.mx.cpdf*/ (1,_pagina-_multiplicador*6,"ID.Cliente: "+_la_cuenta.getText());
 //BA.debugLineNum = 1385;BA.debugLine="multiplicador = multiplicador +1";
_multiplicador = (int) (_multiplicador+1);
 //BA.debugLineNum = 1386;BA.debugLine="PDF.outtext(1,pagina-multiplicador*6,\"Calle: \" &";
_pdf._outtext /*adm.keymon.com.mx.cpdf*/ (1,_pagina-_multiplicador*6,"Calle: "+_la_calle.getText());
 //BA.debugLineNum = 1388;BA.debugLine="multiplicador = multiplicador +1";
_multiplicador = (int) (_multiplicador+1);
 //BA.debugLineNum = 1389;BA.debugLine="PDF.outtext(1,pagina-multiplicador*6,\"Colonia: \"";
_pdf._outtext /*adm.keymon.com.mx.cpdf*/ (1,_pagina-_multiplicador*6,"Colonia: "+_la_col.getText());
 //BA.debugLineNum = 1391;BA.debugLine="multiplicador = multiplicador +1";
_multiplicador = (int) (_multiplicador+1);
 //BA.debugLineNum = 1392;BA.debugLine="PDF.outtext(1,pagina-multiplicador*6,\" \")";
_pdf._outtext /*adm.keymon.com.mx.cpdf*/ (1,_pagina-_multiplicador*6," ");
 //BA.debugLineNum = 1394;BA.debugLine="multiplicador = multiplicador +1";
_multiplicador = (int) (_multiplicador+1);
 //BA.debugLineNum = 1395;BA.debugLine="PDF.outtext(1,pagina-multiplicador*6,\" \")";
_pdf._outtext /*adm.keymon.com.mx.cpdf*/ (1,_pagina-_multiplicador*6," ");
 //BA.debugLineNum = 1397;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 = ?",new String[]{"PREVENTA"})));
 //BA.debugLineNum = 1398;BA.debugLine="If c.RowCount > 0 Then";
if (_c.getRowCount()>0) { 
 //BA.debugLineNum = 1400;BA.debugLine="s=skmt.ExecQuery2(\"select PE_PRONOMBRE, PE_CANT,";
_s = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_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) < 4 AND PE_CLIENTE IN (Select CUENTA from cuentaa)  order by  PE_PROID",new String[]{"PREVENTA"})));
 //BA.debugLineNum = 1401;BA.debugLine="If S.RowCount>0 Then";
if (_s.getRowCount()>0) { 
 //BA.debugLineNum = 1402;BA.debugLine="multiplicador = multiplicador +1";
_multiplicador = (int) (_multiplicador+1);
 //BA.debugLineNum = 1403;BA.debugLine="PDF.outtext(1,pagina-multiplicador*6,\"---------";
_pdf._outtext /*adm.keymon.com.mx.cpdf*/ (1,_pagina-_multiplicador*6,"------------------------------------PREVENTA-----------------------------------------");
 //BA.debugLineNum = 1404;BA.debugLine="multiplicador = multiplicador +1";
_multiplicador = (int) (_multiplicador+1);
 //BA.debugLineNum = 1405;BA.debugLine="PDF.outtext(1,pagina-multiplicador*6,\"Cant.";
_pdf._outtext /*adm.keymon.com.mx.cpdf*/ (1,_pagina-_multiplicador*6,"Cant.                                    Precio                                    Importe");
 //BA.debugLineNum = 1406;BA.debugLine="multiplicador = multiplicador +1";
_multiplicador = (int) (_multiplicador+1);
 //BA.debugLineNum = 1407;BA.debugLine="PDF.outtext(1,pagina-multiplicador*6,\"---------";
_pdf._outtext /*adm.keymon.com.mx.cpdf*/ (1,_pagina-_multiplicador*6,"-----------------------------------------------------------------------------------------");
 //BA.debugLineNum = 1408;BA.debugLine="For i=0 To S.RowCount -1";
{
final int step48 = 1;
final int limit48 = (int) (_s.getRowCount()-1);
_i = (int) (0) ;
for (;_i <= limit48 ;_i = _i + step48 ) {
 //BA.debugLineNum = 1409;BA.debugLine="S.Position=i";
_s.setPosition(_i);
 //BA.debugLineNum = 1410;BA.debugLine="If s.GetString(\"PE_CEDIS\") = s.GetString(\"PE_P";
if ((_s.GetString("PE_CEDIS")).equals(_s.GetString("PE_PROID"))) { 
 //BA.debugLineNum = 1411;BA.debugLine="multiplicador = multiplicador +1";
_multiplicador = (int) (_multiplicador+1);
 //BA.debugLineNum = 1412;BA.debugLine="PDF.outtext(1,pagina-multiplicador*6,s.GetStr";
_pdf._outtext /*adm.keymon.com.mx.cpdf*/ (1,_pagina-_multiplicador*6,_s.GetString("PE_PRONOMBRE"));
 }else {
 //BA.debugLineNum = 1415;BA.debugLine="PDF.sFont(PDF.fontHelvetica,0,7,PDF.colorBlac";
_pdf._sfont /*adm.keymon.com.mx.cpdf*/ (_pdf._fonthelvetica /*String*/ ,(int) (0),7,_pdf._colorblack /*double[]*/ );
 //BA.debugLineNum = 1416;BA.debugLine="multiplicador = multiplicador +1";
_multiplicador = (int) (_multiplicador+1);
 //BA.debugLineNum = 1417;BA.debugLine="PDF.outtext(1,pagina-multiplicador*6,s.GetStr";
_pdf._outtext /*adm.keymon.com.mx.cpdf*/ (1,_pagina-_multiplicador*6,_s.GetString("PE_PRONOMBRE"));
 //BA.debugLineNum = 1418;BA.debugLine="LogColor(s.GetLong(\"L_CANT\"),Colors.Magenta)";
__c.LogImpl("342598479",BA.NumberToString(_s.GetLong("L_CANT")),__c.Colors.Magenta);
 //BA.debugLineNum = 1419;BA.debugLine="LogColor(s.GetLong(\"L_COSTOU\"),Colors.Magenta";
__c.LogImpl("342598480",BA.NumberToString(_s.GetLong("L_COSTOU")),__c.Colors.Magenta);
 //BA.debugLineNum = 1420;BA.debugLine="LogColor(s.GetLong(\"L_COSTO_TOT\"),Colors.Mage";
__c.LogImpl("342598481",BA.NumberToString(_s.GetLong("L_COSTO_TOT")),__c.Colors.Magenta);
 //BA.debugLineNum = 1422;BA.debugLine="TAMANO = s.GetLong(\"L_CANT\") + s.GetLong(\"L_C";
_tamano = (int) (_s.GetLong("L_CANT")+_s.GetLong("L_COSTOU")+_s.GetLong("L_COSTO_TOT"));
 //BA.debugLineNum = 1423;BA.debugLine="ESPACIO = 92";
_espacio = (int) (92);
 //BA.debugLineNum = 1424;BA.debugLine="BLANCO = \" \"";
_blanco = " ";
 //BA.debugLineNum = 1425;BA.debugLine="ESPACIO = ESPACIO - TAMANO";
_espacio = (int) (_espacio-_tamano);
 //BA.debugLineNum = 1426;BA.debugLine="ESPACIO = ESPACIO / 2";
_espacio = (int) (_espacio/(double)2);
 //BA.debugLineNum = 1427;BA.debugLine="For E=0 To ESPACIO -1";
{
final int step65 = 1;
final int limit65 = (int) (_espacio-1);
_e = (int) (0) ;
for (;_e <= limit65 ;_e = _e + step65 ) {
 //BA.debugLineNum = 1428;BA.debugLine="BLANCO = \" \" & BLANCO";
_blanco = " "+_blanco;
 }
};
 //BA.debugLineNum = 1430;BA.debugLine="PDF.sFont(PDF.fontHelvetica,0,10,PDF.colorBla";
_pdf._sfont /*adm.keymon.com.mx.cpdf*/ (_pdf._fonthelvetica /*String*/ ,(int) (0),10,_pdf._colorblack /*double[]*/ );
 //BA.debugLineNum = 1431;BA.debugLine="multiplicador = multiplicador +1";
_multiplicador = (int) (_multiplicador+1);
 //BA.debugLineNum = 1432;BA.debugLine="PDF.outtext(1,pagina-multiplicador*6, s.GETST";
_pdf._outtext /*adm.keymon.com.mx.cpdf*/ (1,_pagina-_multiplicador*6,_s.GetString("PE_CANT")+_blanco+_s.GetString("PE_COSTOU")+_blanco+_s.GetString("PE_COSTO_TOT"));
 };
 }
};
 };
 //BA.debugLineNum = 1437;BA.debugLine="s.Close";
_s.Close();
 //BA.debugLineNum = 1438;BA.debugLine="PDF.outtext(1,108-9*6,\" \" )";
_pdf._outtext /*adm.keymon.com.mx.cpdf*/ (1,108-9*6," ");
 //BA.debugLineNum = 1439;BA.debugLine="s=skmt.ExecQuery2(\"select PE_PRONOMBRE, PE_CANT,";
_s = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_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 = 1440;BA.debugLine="If S.RowCount>0 Then";
if (_s.getRowCount()>0) { 
 //BA.debugLineNum = 1441;BA.debugLine="multiplicador = multiplicador +1";
_multiplicador = (int) (_multiplicador+1);
 //BA.debugLineNum = 1442;BA.debugLine="PDF.outtext(1,pagina-multiplicador*6,\"---------";
_pdf._outtext /*adm.keymon.com.mx.cpdf*/ (1,_pagina-_multiplicador*6,"--------------------------PROMOS PREVENTA-------------------------------------");
 //BA.debugLineNum = 1443;BA.debugLine="multiplicador = multiplicador +1";
_multiplicador = (int) (_multiplicador+1);
 //BA.debugLineNum = 1444;BA.debugLine="PDF.outtext(1,pagina-multiplicador*6,\"Cant.";
_pdf._outtext /*adm.keymon.com.mx.cpdf*/ (1,_pagina-_multiplicador*6,"Cant.                                   Precio                                    Importe");
 //BA.debugLineNum = 1445;BA.debugLine="multiplicador = multiplicador +1";
_multiplicador = (int) (_multiplicador+1);
 //BA.debugLineNum = 1446;BA.debugLine="PDF.outtext(1,pagina-multiplicador*6,\"---------";
_pdf._outtext /*adm.keymon.com.mx.cpdf*/ (1,_pagina-_multiplicador*6,"-----------------------------------------------------------------------------------------");
 //BA.debugLineNum = 1447;BA.debugLine="For i=0 To S.RowCount -1";
{
final int step84 = 1;
final int limit84 = (int) (_s.getRowCount()-1);
_i = (int) (0) ;
for (;_i <= limit84 ;_i = _i + step84 ) {
 //BA.debugLineNum = 1448;BA.debugLine="S.Position=i";
_s.setPosition(_i);
 //BA.debugLineNum = 1449;BA.debugLine="If s.GetString(\"PE_CEDIS\") = s.GetString(\"PE_P";
if ((_s.GetString("PE_CEDIS")).equals(_s.GetString("PE_PROID"))) { 
 //BA.debugLineNum = 1451;BA.debugLine="multiplicador = multiplicador +1";
_multiplicador = (int) (_multiplicador+1);
 //BA.debugLineNum = 1452;BA.debugLine="PDF.outtext(1,pagina-multiplicador*6,s.GetStr";
_pdf._outtext /*adm.keymon.com.mx.cpdf*/ (1,_pagina-_multiplicador*6,_s.GetString("PE_PRONOMBRE"));
 }else {
 //BA.debugLineNum = 1456;BA.debugLine="PDF.sFont(PDF.fontHelvetica,0,7,PDF.colorBlac";
_pdf._sfont /*adm.keymon.com.mx.cpdf*/ (_pdf._fonthelvetica /*String*/ ,(int) (0),7,_pdf._colorblack /*double[]*/ );
 //BA.debugLineNum = 1457;BA.debugLine="multiplicador = multiplicador +1";
_multiplicador = (int) (_multiplicador+1);
 //BA.debugLineNum = 1458;BA.debugLine="PDF.outtext(1,pagina-multiplicador*6,s.GetStr";
_pdf._outtext /*adm.keymon.com.mx.cpdf*/ (1,_pagina-_multiplicador*6,_s.GetString("PE_PRONOMBRE"));
 //BA.debugLineNum = 1459;BA.debugLine="LogColor(s.GetLong(\"L_CANT\"),Colors.Magenta)";
__c.LogImpl("342598520",BA.NumberToString(_s.GetLong("L_CANT")),__c.Colors.Magenta);
 //BA.debugLineNum = 1460;BA.debugLine="LogColor(s.GetLong(\"L_COSTOU\"),Colors.Magenta";
__c.LogImpl("342598521",BA.NumberToString(_s.GetLong("L_COSTOU")),__c.Colors.Magenta);
 //BA.debugLineNum = 1461;BA.debugLine="LogColor(s.GetLong(\"L_COSTO_TOT\"),Colors.Mage";
__c.LogImpl("342598522",BA.NumberToString(_s.GetLong("L_COSTO_TOT")),__c.Colors.Magenta);
 //BA.debugLineNum = 1463;BA.debugLine="TAMANO = s.GetLong(\"L_CANT\") + s.GetLong(\"L_C";
_tamano = (int) (_s.GetLong("L_CANT")+_s.GetLong("L_COSTOU")+_s.GetLong("L_COSTO_TOT"));
 //BA.debugLineNum = 1464;BA.debugLine="ESPACIO = 92";
_espacio = (int) (92);
 //BA.debugLineNum = 1465;BA.debugLine="BLANCO = \" \"";
_blanco = " ";
 //BA.debugLineNum = 1466;BA.debugLine="ESPACIO = ESPACIO - TAMANO";
_espacio = (int) (_espacio-_tamano);
 //BA.debugLineNum = 1467;BA.debugLine="ESPACIO = ESPACIO / 2";
_espacio = (int) (_espacio/(double)2);
 //BA.debugLineNum = 1468;BA.debugLine="For E=0 To ESPACIO -1";
{
final int step101 = 1;
final int limit101 = (int) (_espacio-1);
_e = (int) (0) ;
for (;_e <= limit101 ;_e = _e + step101 ) {
 //BA.debugLineNum = 1469;BA.debugLine="BLANCO = \" \" & BLANCO";
_blanco = " "+_blanco;
 }
};
 //BA.debugLineNum = 1471;BA.debugLine="PDF.sFont(PDF.fontHelvetica,0,10,PDF.colorBla";
_pdf._sfont /*adm.keymon.com.mx.cpdf*/ (_pdf._fonthelvetica /*String*/ ,(int) (0),10,_pdf._colorblack /*double[]*/ );
 //BA.debugLineNum = 1472;BA.debugLine="multiplicador = multiplicador +1";
_multiplicador = (int) (_multiplicador+1);
 //BA.debugLineNum = 1473;BA.debugLine="PDF.outtext(1,pagina-multiplicador*6, s.GETST";
_pdf._outtext /*adm.keymon.com.mx.cpdf*/ (1,_pagina-_multiplicador*6,_s.GetString("PE_CANT")+_blanco+_s.GetString("PE_COSTOU")+_blanco+_s.GetString("PE_COSTO_TOT"));
 };
 }
};
 };
 //BA.debugLineNum = 1478;BA.debugLine="s.Close";
_s.Close();
 //BA.debugLineNum = 1480;BA.debugLine="multiplicador = multiplicador +1";
_multiplicador = (int) (_multiplicador+1);
 //BA.debugLineNum = 1481;BA.debugLine="PDF.outtext(1,pagina-multiplicador*6,\" \" )";
_pdf._outtext /*adm.keymon.com.mx.cpdf*/ (1,_pagina-_multiplicador*6," ");
 //BA.debugLineNum = 1482;BA.debugLine="multiplicador = multiplicador +1";
_multiplicador = (int) (_multiplicador+1);
 //BA.debugLineNum = 1483;BA.debugLine="PDF.outtext(1,pagina-multiplicador*6,\"----------";
_pdf._outtext /*adm.keymon.com.mx.cpdf*/ (1,_pagina-_multiplicador*6,"-----------------------------------------------------------------------------------------");
 //BA.debugLineNum = 1485;BA.debugLine="s=skmt.ExecQuery2(\"select SUM(PE_COSTO_TOT) AS T";
_s = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_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 = 1486;BA.debugLine="s.Position =0";
_s.setPosition((int) (0));
 //BA.debugLineNum = 1487;BA.debugLine="multiplicador = multiplicador +1";
_multiplicador = (int) (_multiplicador+1);
 //BA.debugLineNum = 1488;BA.debugLine="PDF.outtext(1,pagina-multiplicador*6,\"Total prev";
_pdf._outtext /*adm.keymon.com.mx.cpdf*/ (1,_pagina-_multiplicador*6,"Total preventa:   $"+_s.GetString("TOTAL"));
 //BA.debugLineNum = 1489;BA.debugLine="s.Close";
_s.Close();
 //BA.debugLineNum = 1490;BA.debugLine="c= skmt.ExecQuery2(\"select sum(PE_CANT) as PC_NO";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_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 = 1491;BA.debugLine="C.Position=0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 1492;BA.debugLine="multiplicador = multiplicador +1";
_multiplicador = (int) (_multiplicador+1);
 //BA.debugLineNum = 1493;BA.debugLine="PDF.outtext(1,pagina-multiplicador*6,\"Total arti";
_pdf._outtext /*adm.keymon.com.mx.cpdf*/ (1,_pagina-_multiplicador*6,"Total articulos preventa:   "+_c.GetString("PC_NOART"));
 //BA.debugLineNum = 1494;BA.debugLine="c.Close";
_c.Close();
 };
 //BA.debugLineNum = 1497;BA.debugLine="multiplicador = multiplicador +1";
_multiplicador = (int) (_multiplicador+1);
 //BA.debugLineNum = 1498;BA.debugLine="PDF.outtext(1,pagina-multiplicador*6,\"-----------";
_pdf._outtext /*adm.keymon.com.mx.cpdf*/ (1,_pagina-_multiplicador*6,"-----------------------------------------------------------------------------------------");
 //BA.debugLineNum = 1499;BA.debugLine="multiplicador = multiplicador +1";
_multiplicador = (int) (_multiplicador+1);
 //BA.debugLineNum = 1500;BA.debugLine="PDF.outtext(1,pagina-multiplicador*6,\"-----------";
_pdf._outtext /*adm.keymon.com.mx.cpdf*/ (1,_pagina-_multiplicador*6,"--------------------------ESTE TICKET NO ES UN ---------------------------");
 //BA.debugLineNum = 1501;BA.debugLine="multiplicador = multiplicador +1";
_multiplicador = (int) (_multiplicador+1);
 //BA.debugLineNum = 1502;BA.debugLine="PDF.outtext(1,pagina-multiplicador*6,\"-----------";
_pdf._outtext /*adm.keymon.com.mx.cpdf*/ (1,_pagina-_multiplicador*6,"-------------------COMPROBANTE FISCAL, SOLO ES--------------------");
 //BA.debugLineNum = 1503;BA.debugLine="multiplicador = multiplicador +1";
_multiplicador = (int) (_multiplicador+1);
 //BA.debugLineNum = 1504;BA.debugLine="PDF.outtext(1,pagina-multiplicador*6,\"-----------";
_pdf._outtext /*adm.keymon.com.mx.cpdf*/ (1,_pagina-_multiplicador*6,"---------------------------------INFORMATIVO-----------------------------------");
 //BA.debugLineNum = 1505;BA.debugLine="multiplicador = multiplicador +1";
_multiplicador = (int) (_multiplicador+1);
 //BA.debugLineNum = 1506;BA.debugLine="PDF.outtext(1,pagina-multiplicador*6,\"-----------";
_pdf._outtext /*adm.keymon.com.mx.cpdf*/ (1,_pagina-_multiplicador*6,"-----------------------------------------------------------------------------------------");
 //BA.debugLineNum = 1507;BA.debugLine="multiplicador = multiplicador +1";
_multiplicador = (int) (_multiplicador+1);
 //BA.debugLineNum = 1508;BA.debugLine="PDF.outtext(1,pagina-multiplicador*6,\" \" )";
_pdf._outtext /*adm.keymon.com.mx.cpdf*/ (1,_pagina-_multiplicador*6," ");
 //BA.debugLineNum = 1509;BA.debugLine="multiplicador = multiplicador +1";
_multiplicador = (int) (_multiplicador+1);
 //BA.debugLineNum = 1510;BA.debugLine="PDF.outtext(1,pagina-multiplicador*6,\" \" )";
_pdf._outtext /*adm.keymon.com.mx.cpdf*/ (1,_pagina-_multiplicador*6," ");
 //BA.debugLineNum = 1512;BA.debugLine="DateTime.DateFormat = \"ddmmyyyy\"";
__c.DateTime.setDateFormat("ddmmyyyy");
 //BA.debugLineNum = 1513;BA.debugLine="DateTime.TimeFormat = \"HHmmss\"";
__c.DateTime.setTimeFormat("HHmmss");
 //BA.debugLineNum = 1514;BA.debugLine="sDate=DateTime.Date(DateTime.Now)";
_sdate = __c.DateTime.Date(__c.DateTime.getNow());
 //BA.debugLineNum = 1515;BA.debugLine="sTime=DateTime.Time(DateTime.Now)";
_stime = __c.DateTime.Time(__c.DateTime.getNow());
 //BA.debugLineNum = 1517;BA.debugLine="savePDF(PDF,sDate&sTime&\".pdf\",PDF.CompressAlways";
_savepdf(_pdf,_sdate+_stime+".pdf",_pdf._compressalways /*int*/ );
 //BA.debugLineNum = 1520;BA.debugLine="openPDF(sDate&sTime&\".pdf\")";
_openpdf(_sdate+_stime+".pdf");
 //BA.debugLineNum = 1521;BA.debugLine="End Sub";
return "";
}
public String  _listview1_itemlongclick(int _position,Object _value) throws Exception{
 //BA.debugLineNum = 543;BA.debugLine="Sub ListView1_ItemLongClick (Position As Int, Valu";
 //BA.debugLineNum = 545;BA.debugLine="End Sub";
return "";
}
public String  _mandapendientes() throws Exception{
String _pcnoarts = "";
String _pcmonto = "";
int _i = 0;
anywheresoftware.b4a.sql.SQL.CursorWrapper _ab = null;
anywheresoftware.b4a.sql.SQL.CursorWrapper _bb = null;
anywheresoftware.b4a.sql.SQL.CursorWrapper _cb = null;
 //BA.debugLineNum = 2226;BA.debugLine="Sub mandaPendientes";
 //BA.debugLineNum = 2228;BA.debugLine="Log(\">>>>>>>  MANDA PENDIENTES\")";
__c.LogImpl("343712514",">>>>>>>  MANDA PENDIENTES",0);
 //BA.debugLineNum = 2229;BA.debugLine="Dim PCNoArts As String";
_pcnoarts = "";
 //BA.debugLineNum = 2230;BA.debugLine="Dim PCMonto As String";
_pcmonto = "";
 //BA.debugLineNum = 2231;BA.debugLine="If usuario <> \"KMTS1\"  Then";
if ((_usuario).equals("KMTS1") == false) { 
 //BA.debugLineNum = 2232;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")));
 //BA.debugLineNum = 2233;BA.debugLine="Log($\"Pedido_Cliente PENDIENTE: ${c.RowCount}\"$)";
__c.LogImpl("343712519",("Pedido_Cliente PENDIENTE: "+__c.SmartStringFormatter("",(Object)(_c.getRowCount()))+""),0);
 //BA.debugLineNum = 2234;BA.debugLine="If c.RowCount > 0 Then";
if (_c.getRowCount()>0) { 
 //BA.debugLineNum = 2235;BA.debugLine="For i = 0 To c.RowCount - 1";
{
final int step8 = 1;
final int limit8 = (int) (_c.getRowCount()-1);
_i = (int) (0) ;
for (;_i <= limit8 ;_i = _i + step8 ) {
 //BA.debugLineNum = 2236;BA.debugLine="c.Position = i";
_c.setPosition(_i);
 //BA.debugLineNum = 2237;BA.debugLine="Log($\"${c.GetString(\"PC_CLIENTE\")}|${c.GetStri";
__c.LogImpl("343712523",(""+__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 = 2238;BA.debugLine="Dim cmd As DBCommand";
_cmd = new adm.keymon.com.mx.dbrequestmanager._dbcommand();
 //BA.debugLineNum = 2239;BA.debugLine="cmd.Initialize";
_cmd.Initialize();
 //BA.debugLineNum = 2240;BA.debugLine="cmd.Name = \"insert_pedidos_ADM\"";
_cmd.Name /*String*/  = "insert_pedidos_ADM";
 //BA.debugLineNum = 2241;BA.debugLine="cmd.Parameters = Array As Object(c.GetString(\"";
_cmd.Parameters /*Object[]*/  = new Object[]{(Object)(_c.GetString("PC_CLIENTE")),(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)(_b4xpages._mainpage /*adm.keymon.com.mx.b4xmainpage*/ (ba)._principal /*adm.keymon.com.mx.c_principal*/ ._l_ruta /*anywheresoftware.b4a.objects.LabelWrapper*/ .getText()),(Object)(_c.GetString("PC_COSTO_SIN")),(Object)(_c.GetString("PC_FACTURA"))};
 //BA.debugLineNum = 2242;BA.debugLine="PCNoArts = c.GetString(\"PC_NOART\")";
_pcnoarts = _c.GetString("PC_NOART");
 //BA.debugLineNum = 2243;BA.debugLine="PCMonto = c.GetString(\"PC_MONTO\")";
_pcmonto = _c.GetString("PC_MONTO");
 //BA.debugLineNum = 2245;BA.debugLine="reqManager.ExecuteCommand(cmd , $\"ins_pedidosP";
_reqmanager._executecommand /*String*/ (_cmd,(Object)(("ins_pedidosPendientes_head_"+__c.SmartStringFormatter("",(Object)(_c.GetString("PC_CLIENTE")))+"")));
 }
};
 };
 //BA.debugLineNum = 2250;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, PE_TIPOPAGO, PE_COMENTARIO FROM PEDIDO where PE_ENVIO_OK <> 1"))));
 //BA.debugLineNum = 2251;BA.debugLine="Log($\"Pedido PENDIENTE: ${c.RowCount}\"$)";
__c.LogImpl("343712537",("Pedido PENDIENTE: "+__c.SmartStringFormatter("",(Object)(_c.getRowCount()))+""),0);
 //BA.debugLineNum = 2252;BA.debugLine="If c.RowCount>0 Then";
if (_c.getRowCount()>0) { 
 //BA.debugLineNum = 2253;BA.debugLine="For i=0 To c.RowCount -1";
{
final int step23 = 1;
final int limit23 = (int) (_c.getRowCount()-1);
_i = (int) (0) ;
for (;_i <= limit23 ;_i = _i + step23 ) {
 //BA.debugLineNum = 2254;BA.debugLine="c.Position=i";
_c.setPosition(_i);
 //BA.debugLineNum = 2255;BA.debugLine="Dim cmd As DBCommand";
_cmd = new adm.keymon.com.mx.dbrequestmanager._dbcommand();
 //BA.debugLineNum = 2256;BA.debugLine="cmd.Initialize";
_cmd.Initialize();
 //BA.debugLineNum = 2257;BA.debugLine="cmd.Name = \"insert_pedido2_ADM\"";
_cmd.Name /*String*/  = "insert_pedido2_ADM";
 //BA.debugLineNum = 2258;BA.debugLine="cmd.Parameters = Array As Object(c.GetString(\"";
_cmd.Parameters /*Object[]*/  = new Object[]{(Object)(_c.GetString("PE_CEDIS")),(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)(_c.GetString("PE_CLIENTE")),(Object)(_c.GetString("PE_FECHA")),(Object)(_c.GetString("PE_USUARIO")),(Object)(_subs._traeruta2 /*String*/ (ba,_c.GetString("PE_CLIENTE"))),(Object)(_c.GetString("PE_COSTO_SIN")),(Object)(_c.GetString("PE_DESC")),(Object)(_c.GetString("PE_FOLIO")),(Object)(_c.GetString("PE_CANTC")),(Object)(_c.GetString("PE_BCAJAS")),(Object)(_c.GetString("PE_TIPOPAGO")),(Object)(_c.GetString("PE_COMENTARIO"))};
 //BA.debugLineNum = 2259;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 = 2260;BA.debugLine="Log($\">>>>  INS_PEDIDO= ${C.GetString(\"PE_CEDI";
__c.LogImpl("343712546",(">>>>  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 = 2267;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 /*adm.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery(("SELECT * from ABONOS where a_enviado is null"))));
 //BA.debugLineNum = 2268;BA.debugLine="Log(ab.RowCount)";
__c.LogImpl("343712554",BA.NumberToString(_ab.getRowCount()),0);
 //BA.debugLineNum = 2269;BA.debugLine="If ab.RowCount > 0 Then";
if (_ab.getRowCount()>0) { 
 //BA.debugLineNum = 2270;BA.debugLine="For i=0 To ab.RowCount -1";
{
final int step36 = 1;
final int limit36 = (int) (_ab.getRowCount()-1);
_i = (int) (0) ;
for (;_i <= limit36 ;_i = _i + step36 ) {
 //BA.debugLineNum = 2271;BA.debugLine="ab.Position = i";
_ab.setPosition(_i);
 //BA.debugLineNum = 2272;BA.debugLine="Dim cmd As DBCommand";
_cmd = new adm.keymon.com.mx.dbrequestmanager._dbcommand();
 //BA.debugLineNum = 2273;BA.debugLine="cmd.Initialize";
_cmd.Initialize();
 //BA.debugLineNum = 2274;BA.debugLine="cmd.Name = \"insert_abono_ADM\"";
_cmd.Name /*String*/  = "insert_abono_ADM";
 //BA.debugLineNum = 2275;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 = 2276;BA.debugLine="reqManager.ExecuteCommand(cmd , $\"ins_abonosPe";
_reqmanager._executecommand /*String*/ (_cmd,(Object)(("ins_abonosPendientes_"+__c.SmartStringFormatter("",(Object)(_ab.GetString("a_cliente")))+"")));
 //BA.debugLineNum = 2277;BA.debugLine="Log($\"ins_abonosPendientes_${ab.GetString(\"a_c";
__c.LogImpl("343712563",("ins_abonosPendientes_"+__c.SmartStringFormatter("",(Object)(_ab.GetString("a_cliente")))+""),0);
 }
};
 };
 //BA.debugLineNum = 2280;BA.debugLine="ab.Close";
_ab.Close();
 //BA.debugLineNum = 2283;BA.debugLine="Dim bb As Cursor = B4XPages.MainPage.skmt.ExecQu";
_bb = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_bb = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*adm.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery(("SELECT * from CLIENTE_NUEVO where CN_enviado is null"))));
 //BA.debugLineNum = 2284;BA.debugLine="Dim cb As Cursor = B4XPages.MainPage.skmt.ExecQu";
_cb = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_cb = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*adm.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("SELECT ID_ALMACEN from CAT_ALMACEN")));
 //BA.debugLineNum = 2285;BA.debugLine="cb.Position = 0";
_cb.setPosition((int) (0));
 //BA.debugLineNum = 2286;BA.debugLine="If bb.RowCount > 0 Then";
if (_bb.getRowCount()>0) { 
 //BA.debugLineNum = 2287;BA.debugLine="For i=0 To bb.RowCount -1";
{
final int step51 = 1;
final int limit51 = (int) (_bb.getRowCount()-1);
_i = (int) (0) ;
for (;_i <= limit51 ;_i = _i + step51 ) {
 //BA.debugLineNum = 2288;BA.debugLine="bb.Position = i";
_bb.setPosition(_i);
 //BA.debugLineNum = 2289;BA.debugLine="Dim cmd As DBCommand";
_cmd = new adm.keymon.com.mx.dbrequestmanager._dbcommand();
 //BA.debugLineNum = 2290;BA.debugLine="cmd.Initialize";
_cmd.Initialize();
 //BA.debugLineNum = 2291;BA.debugLine="cmd.Name = \"insert_cliente_ADM\"";
_cmd.Name /*String*/  = "insert_cliente_ADM";
 //BA.debugLineNum = 2292;BA.debugLine="cmd.Parameters = Array As Object( bb.GetString";
_cmd.Parameters /*Object[]*/  = new Object[]{(Object)(_bb.GetString("CN_ID_CLIENTE")),(Object)(_bb.GetString("CN_NOMBRE")),(Object)(_b4xpages._mainpage /*adm.keymon.com.mx.b4xmainpage*/ (ba)._principal /*adm.keymon.com.mx.c_principal*/ ._l_ruta /*anywheresoftware.b4a.objects.LabelWrapper*/ .getText()),(Object)(_cb.GetString("ID_ALMACEN"))};
 //BA.debugLineNum = 2293;BA.debugLine="reqManager.ExecuteCommand(cmd , $\"insert_clien";
_reqmanager._executecommand /*String*/ (_cmd,(Object)(("insert_cliente_"+__c.SmartStringFormatter("",(Object)(_bb.GetString("CN_ID_CLIENTE")))+"")));
 //BA.debugLineNum = 2294;BA.debugLine="Log($\"insert_cliente_${bb.GetString(\"CN_ID_CLI";
__c.LogImpl("343712580",("insert_cliente_"+__c.SmartStringFormatter("",(Object)(_bb.GetString("CN_ID_CLIENTE")))+""),0);
 }
};
 //BA.debugLineNum = 2296;BA.debugLine="Log(\"si lo hice\")";
__c.LogImpl("343712582","si lo hice",0);
 };
 //BA.debugLineNum = 2298;BA.debugLine="bb.Close";
_bb.Close();
 //BA.debugLineNum = 2299;BA.debugLine="cb.Close";
_cb.Close();
 };
 //BA.debugLineNum = 2334;BA.debugLine="End Sub";
return "";
}
public String  _mandapendientesrecarga() throws Exception{
String _pcnoarts = "";
String _pcmonto = "";
int _i = 0;
 //BA.debugLineNum = 2336;BA.debugLine="Sub mandaPendientesrecarga";
 //BA.debugLineNum = 2338;BA.debugLine="Log(\">>>>>>>  MANDA PENDIENTES\")";
__c.LogImpl("343778050",">>>>>>>  MANDA PENDIENTES",0);
 //BA.debugLineNum = 2339;BA.debugLine="Dim PCNoArts As String";
_pcnoarts = "";
 //BA.debugLineNum = 2340;BA.debugLine="Dim PCMonto As String";
_pcmonto = "";
 //BA.debugLineNum = 2341;BA.debugLine="If usuario <> \"KMTS1\"  Then";
if ((_usuario).equals("KMTS1") == false) { 
 //BA.debugLineNum = 2342;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 /*adm.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select CAT_CL_RUTA from kmt_info")));
 //BA.debugLineNum = 2343;BA.debugLine="f.Position=0";
_f.setPosition((int) (0));
 //BA.debugLineNum = 2344;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 = 2345;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 = 2346;BA.debugLine="Log($\"Pedido_Cliente PENDIENTE: ${c.RowCount}\"$)";
__c.LogImpl("343778058",("Pedido_Cliente PENDIENTE: "+__c.SmartStringFormatter("",(Object)(_c.getRowCount()))+""),0);
 //BA.debugLineNum = 2347;BA.debugLine="If c.RowCount > 0 Then";
if (_c.getRowCount()>0) { 
 //BA.debugLineNum = 2348;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 = 2349;BA.debugLine="c.Position = i";
_c.setPosition(_i);
 //BA.debugLineNum = 2350;BA.debugLine="Log($\"${c.GetString(\"PC_CLIENTE\")}|${c.GetStri";
__c.LogImpl("343778062",(""+__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 = 2351;BA.debugLine="Dim cmd As DBCommand";
_cmd = new adm.keymon.com.mx.dbrequestmanager._dbcommand();
 //BA.debugLineNum = 2352;BA.debugLine="cmd.Initialize";
_cmd.Initialize();
 //BA.debugLineNum = 2353;BA.debugLine="cmd.Name = \"insert_pedidos_ADM\"";
_cmd.Name /*String*/  = "insert_pedidos_ADM";
 //BA.debugLineNum = 2354;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 = 2355;BA.debugLine="PCNoArts = c.GetString(\"PC_NOART\")";
_pcnoarts = _c.GetString("PC_NOART");
 //BA.debugLineNum = 2356;BA.debugLine="PCMonto = c.GetString(\"PC_MONTO\")";
_pcmonto = _c.GetString("PC_MONTO");
 //BA.debugLineNum = 2358;BA.debugLine="reqManager.ExecuteCommand(cmd , $\"ins_pedidosP";
_reqmanager._executecommand /*String*/ (_cmd,(Object)(("ins_pedidosPendientes_head_"+__c.SmartStringFormatter("",(Object)(_c.GetString("PC_CLIENTE")))+"")));
 }
};
 };
 //BA.debugLineNum = 2361;BA.debugLine="f.Close";
_f.Close();
 //BA.debugLineNum = 2363;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 = 2364;BA.debugLine="Log($\"Pedido PENDIENTE: ${c.RowCount}\"$)";
__c.LogImpl("343778076",("Pedido PENDIENTE: "+__c.SmartStringFormatter("",(Object)(_c.getRowCount()))+""),0);
 //BA.debugLineNum = 2365;BA.debugLine="If c.RowCount>0 Then";
if (_c.getRowCount()>0) { 
 //BA.debugLineNum = 2366;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 = 2367;BA.debugLine="c.Position=i";
_c.setPosition(_i);
 //BA.debugLineNum = 2368;BA.debugLine="Dim cmd As DBCommand";
_cmd = new adm.keymon.com.mx.dbrequestmanager._dbcommand();
 //BA.debugLineNum = 2369;BA.debugLine="cmd.Initialize";
_cmd.Initialize();
 //BA.debugLineNum = 2370;BA.debugLine="cmd.Name = \"insert_pedido3_ADM\"";
_cmd.Name /*String*/  = "insert_pedido3_ADM";
 //BA.debugLineNum = 2371;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 = 2372;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 = 2373;BA.debugLine="Log($\">>>>  INS_PEDIDO= ${C.GetString(\"PE_CEDI";
__c.LogImpl("343778085",(">>>>  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 = 2379;BA.debugLine="End Sub";
return "";
}
public String  _mandapiezas() throws Exception{
String _pcnoarts = "";
String _pcmonto = "";
 //BA.debugLineNum = 2398;BA.debugLine="Sub mandapiezas";
 //BA.debugLineNum = 2399;BA.debugLine="If l_total.Text <>  Null Or l_total.Text <> \"null";
if (_l_total.getText()!= null || (_l_total.getText()).equals("null") == false) { 
 //BA.debugLineNum = 2400;BA.debugLine="Dim PCNoArts As String";
_pcnoarts = "";
 //BA.debugLineNum = 2401;BA.debugLine="Dim PCMonto As String";
_pcmonto = "";
 //BA.debugLineNum = 2402;BA.debugLine="c = skmt.ExecQuery2(\"SELECT * FROM PEDIDO_CLIENT";
_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 = 2403;BA.debugLine="If c.RowCount > 0 Then";
if (_c.getRowCount()>0) { 
 //BA.debugLineNum = 2404;BA.debugLine="c.Position = 0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 2405;BA.debugLine="Log(la_cuenta.Text&\", \"& ALMACEN&\", \"& LA_RUTA)";
__c.LogImpl("343909127",_la_cuenta.getText()+", "+_almacen+", "+_la_ruta,0);
 //BA.debugLineNum = 2406;BA.debugLine="Dim cmd As DBCommand";
_cmd = new adm.keymon.com.mx.dbrequestmanager._dbcommand();
 //BA.debugLineNum = 2407;BA.debugLine="cmd.Initialize";
_cmd.Initialize();
 //BA.debugLineNum = 2408;BA.debugLine="cmd.Name = \"select_piezas_ADM\"";
_cmd.Name /*String*/  = "select_piezas_ADM";
 //BA.debugLineNum = 2409;BA.debugLine="cmd.Parameters = Array As Object(la_cuenta.Text";
_cmd.Parameters /*Object[]*/  = new Object[]{(Object)(_la_cuenta.getText()),(Object)(_almacen),(Object)(_la_ruta)};
 //BA.debugLineNum = 2410;BA.debugLine="reqManager.ExecuteQuery(cmd , 0, \"piezas\")";
_reqmanager._executequery /*String*/ (_cmd,(int) (0),(Object)("piezas"));
 };
 };
 //BA.debugLineNum = 2414;BA.debugLine="End Sub";
return "";
}
public String  _mandapiezasrecarga() throws Exception{
String _pcnoarts = "";
String _pcmonto = "";
 //BA.debugLineNum = 2381;BA.debugLine="Sub mandapiezasrecarga";
 //BA.debugLineNum = 2382;BA.debugLine="If l_total.Text <>  Null Or l_total.Text <> \"null";
if (_l_total.getText()!= null || (_l_total.getText()).equals("null") == false) { 
 //BA.debugLineNum = 2383;BA.debugLine="Dim PCNoArts As String";
_pcnoarts = "";
 //BA.debugLineNum = 2384;BA.debugLine="Dim PCMonto As String";
_pcmonto = "";
 //BA.debugLineNum = 2385;BA.debugLine="c = skmt.ExecQuery2(\"SELECT * FROM PEDIDO_CLIENT";
_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 = 2386;BA.debugLine="If c.RowCount > 0 Then";
if (_c.getRowCount()>0) { 
 //BA.debugLineNum = 2387;BA.debugLine="c.Position = 0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 2388;BA.debugLine="Log(la_cuenta.Text&\", \"& ALMACEN&\", \"& LA_RUTA)";
__c.LogImpl("343843591",_la_cuenta.getText()+", "+_almacen+", "+_la_ruta,0);
 //BA.debugLineNum = 2389;BA.debugLine="Dim cmd As DBCommand";
_cmd = new adm.keymon.com.mx.dbrequestmanager._dbcommand();
 //BA.debugLineNum = 2390;BA.debugLine="cmd.Initialize";
_cmd.Initialize();
 //BA.debugLineNum = 2391;BA.debugLine="cmd.Name = \"select_piezas_ADM\"";
_cmd.Name /*String*/  = "select_piezas_ADM";
 //BA.debugLineNum = 2392;BA.debugLine="cmd.Parameters = Array As Object(la_cuenta.Text";
_cmd.Parameters /*Object[]*/  = new Object[]{(Object)(_la_cuenta.getText()),(Object)(_almacen),(Object)(_la_ruta)};
 //BA.debugLineNum = 2393;BA.debugLine="reqManager.ExecuteQuery(cmd , 0, \"piezasrecarga";
_reqmanager._executequery /*String*/ (_cmd,(int) (0),(Object)("piezasrecarga"));
 };
 };
 //BA.debugLineNum = 2396;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 = 957;BA.debugLine="Sub NUEVO_Click";
 //BA.debugLineNum = 958;BA.debugLine="B4XPages.ShowPage(\"NuevoCliente\")";
_b4xpages._showpage /*String*/ (ba,"NuevoCliente");
 //BA.debugLineNum = 959;BA.debugLine="End Sub";
return "";
}
public String  _openpdf(String _afile) throws Exception{
anywheresoftware.b4a.objects.IntentWrapper _in = null;
 //BA.debugLineNum = 1761;BA.debugLine="private Sub openPDF(afile As String)";
 //BA.debugLineNum = 1766;BA.debugLine="Dim in As Intent";
_in = new anywheresoftware.b4a.objects.IntentWrapper();
 //BA.debugLineNum = 1767;BA.debugLine="in.Initialize(in.ACTION_VIEW, \"\")";
_in.Initialize(_in.ACTION_VIEW,"");
 //BA.debugLineNum = 1768;BA.debugLine="Starter.ffileProvider.SetFileUriAsIntentData(in,";
_starter._ffileprovider /*adm.keymon.com.mx.fileprovider*/ ._setfileuriasintentdata /*String*/ (_in,_afile);
 //BA.debugLineNum = 1769;BA.debugLine="in.SetComponent(\"android/com.android.internal.app";
_in.SetComponent("android/com.android.internal.app.ResolverActivity");
 //BA.debugLineNum = 1770;BA.debugLine="in.SetType(\"application/pdf\")";
_in.SetType("application/pdf");
 //BA.debugLineNum = 1771;BA.debugLine="StartActivity(in)";
__c.StartActivity(ba,(Object)(_in.getObject()));
 //BA.debugLineNum = 1776;BA.debugLine="End Sub";
return "";
}
public String  _p_abono_click() throws Exception{
 //BA.debugLineNum = 2622;BA.debugLine="Private Sub p_abono_Click";
 //BA.debugLineNum = 2624;BA.debugLine="End Sub";
return "";
}
public String  _p_camara_click() throws Exception{
 //BA.debugLineNum = 2983;BA.debugLine="Private Sub p_camara_Click";
 //BA.debugLineNum = 2985;BA.debugLine="End Sub";
return "";
}
public String  _p_cliente_click() throws Exception{
 //BA.debugLineNum = 2217;BA.debugLine="Private Sub p_cliente_Click";
 //BA.debugLineNum = 2219;BA.debugLine="End Sub";
return "";
}
public String  _p_tipopago_click() throws Exception{
 //BA.debugLineNum = 2987;BA.debugLine="Private Sub p_tipopago_Click";
 //BA.debugLineNum = 2989;BA.debugLine="End Sub";
return "";
}
public String  _pdfgenerar() throws Exception{
adm.keymon.com.mx.cpdf _pdf = null;
anywheresoftware.b4a.sql.SQL.CursorWrapper _s56 = null;
anywheresoftware.b4a.sql.SQL.CursorWrapper _s57 = null;
double _pagina = 0;
int _multiplicador = 0;
int _i = 0;
int _e = 0;
 //BA.debugLineNum = 1523;BA.debugLine="Private Sub PDFGENERAR";
 //BA.debugLineNum = 1526;BA.debugLine="ESPACIO = 0";
_espacio = (int) (0);
 //BA.debugLineNum = 1527;BA.debugLine="DateTime.DateFormat = \"MM/dd/yyyy\"";
__c.DateTime.setDateFormat("MM/dd/yyyy");
 //BA.debugLineNum = 1528;BA.debugLine="DateTime.TimeFormat = \"HH:mm:ss\"";
__c.DateTime.setTimeFormat("HH:mm:ss");
 //BA.debugLineNum = 1529;BA.debugLine="sDate=DateTime.Date(DateTime.Now)";
_sdate = __c.DateTime.Date(__c.DateTime.getNow());
 //BA.debugLineNum = 1530;BA.debugLine="sTime=DateTime.Time(DateTime.Now)";
_stime = __c.DateTime.Time(__c.DateTime.getNow());
 //BA.debugLineNum = 1531;BA.debugLine="Dim PDF As cPDF";
_pdf = new adm.keymon.com.mx.cpdf();
 //BA.debugLineNum = 1533;BA.debugLine="PDF.Initialize(\"mm\")";
_pdf._initialize /*adm.keymon.com.mx.cpdf*/ (ba,"mm");
 //BA.debugLineNum = 1536;BA.debugLine="PDF.sProperty(PDF.PropertyAuthor,\"Keymonsoft\"). _";
_pdf._sproperty /*adm.keymon.com.mx.cpdf*/ (_pdf._propertyauthor /*String*/ ,"Keymonsoft")._sproperty /*adm.keymon.com.mx.cpdf*/ (_pdf._propertytitle /*String*/ ,"Ticket")._sproperty /*adm.keymon.com.mx.cpdf*/ (_pdf._propertykeywords /*String*/ ,"B4X,PDF,Cross platform");
 //BA.debugLineNum = 1542;BA.debugLine="Dim s56 As Cursor=skmt.ExecQuery2(\"select PE_PRON";
_s56 = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_s56 = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_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) < 4 AND PE_CLIENTE IN (Select CUENTA from cuentaa)  order by  PE_PROID",new String[]{"PREVENTA"})));
 //BA.debugLineNum = 1543;BA.debugLine="Dim s57 As Cursor = skmt.ExecQuery2(\"select PE_PR";
_s57 = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_s57 = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_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 = 1545;BA.debugLine="Dim pagina As Double = ((18 + (s56.RowCount*2) +";
_pagina = ((18+(_s56.getRowCount()*2)+(_s57.getRowCount()*2))*(6))+18;
 //BA.debugLineNum = 1547;BA.debugLine="Dim multiplicador As Int = 0";
_multiplicador = (int) (0);
 //BA.debugLineNum = 1548;BA.debugLine="PDF.pageAdd(-300,pagina)";
_pdf._pageadd /*adm.keymon.com.mx.cpdf*/ (-300,_pagina);
 //BA.debugLineNum = 1551;BA.debugLine="PDF.sFont(PDF.fontHelvetica,0,10,PDF.colorBlack)";
_pdf._sfont /*adm.keymon.com.mx.cpdf*/ (_pdf._fonthelvetica /*String*/ ,(int) (0),10,_pdf._colorblack /*double[]*/ );
 //BA.debugLineNum = 1553;BA.debugLine="PDF.outImage(xui.DefaultFolder,\"mariana1.jpg\",1,p";
_pdf._outimage /*adm.keymon.com.mx.cpdf*/ (_xui.getDefaultFolder(),"mariana1.jpg",1,_pagina-55,70,0);
 //BA.debugLineNum = 1554;BA.debugLine="multiplicador = multiplicador +1";
_multiplicador = (int) (_multiplicador+1);
 //BA.debugLineNum = 1555;BA.debugLine="PDF.outtext(1,pagina-multiplicador*6,\"ADM Distrib";
_pdf._outtext /*adm.keymon.com.mx.cpdf*/ (1,_pagina-_multiplicador*6,"ADM Distribuciones");
 //BA.debugLineNum = 1557;BA.debugLine="multiplicador = multiplicador +1";
_multiplicador = (int) (_multiplicador+1);
 //BA.debugLineNum = 1558;BA.debugLine="PDF.outtext(1,pagina-multiplicador*6,sDate& \" \" &";
_pdf._outtext /*adm.keymon.com.mx.cpdf*/ (1,_pagina-_multiplicador*6,_sdate+" "+_stime);
 //BA.debugLineNum = 1560;BA.debugLine="multiplicador = multiplicador +1";
_multiplicador = (int) (_multiplicador+1);
 //BA.debugLineNum = 1561;BA.debugLine="PDF.outtext(1,pagina-multiplicador*6,\"Vendedor:\"";
_pdf._outtext /*adm.keymon.com.mx.cpdf*/ (1,_pagina-_multiplicador*6,"Vendedor:"+_subs._traeusuariodebd /*String*/ (ba));
 //BA.debugLineNum = 1563;BA.debugLine="multiplicador = multiplicador +1";
_multiplicador = (int) (_multiplicador+1);
 //BA.debugLineNum = 1564;BA.debugLine="PDF.outtext(1,pagina-multiplicador*6,\"Tienda: \" &";
_pdf._outtext /*adm.keymon.com.mx.cpdf*/ (1,_pagina-_multiplicador*6,"Tienda: "+_la_nombre.getText());
 //BA.debugLineNum = 1566;BA.debugLine="multiplicador = multiplicador +1";
_multiplicador = (int) (_multiplicador+1);
 //BA.debugLineNum = 1567;BA.debugLine="PDF.outtext(1,pagina-multiplicador*6,\"ID.Cliente:";
_pdf._outtext /*adm.keymon.com.mx.cpdf*/ (1,_pagina-_multiplicador*6,"ID.Cliente: "+_la_cuenta.getText());
 //BA.debugLineNum = 1569;BA.debugLine="multiplicador = multiplicador +1";
_multiplicador = (int) (_multiplicador+1);
 //BA.debugLineNum = 1570;BA.debugLine="PDF.outtext(1,pagina-multiplicador*6,\"Calle: \" &";
_pdf._outtext /*adm.keymon.com.mx.cpdf*/ (1,_pagina-_multiplicador*6,"Calle: "+_la_calle.getText());
 //BA.debugLineNum = 1572;BA.debugLine="multiplicador = multiplicador +1";
_multiplicador = (int) (_multiplicador+1);
 //BA.debugLineNum = 1573;BA.debugLine="PDF.outtext(1,pagina-multiplicador*6,\"Colonia: \"";
_pdf._outtext /*adm.keymon.com.mx.cpdf*/ (1,_pagina-_multiplicador*6,"Colonia: "+_la_col.getText());
 //BA.debugLineNum = 1575;BA.debugLine="multiplicador = multiplicador +1";
_multiplicador = (int) (_multiplicador+1);
 //BA.debugLineNum = 1576;BA.debugLine="PDF.outtext(1,pagina-multiplicador*6,\" \")";
_pdf._outtext /*adm.keymon.com.mx.cpdf*/ (1,_pagina-_multiplicador*6," ");
 //BA.debugLineNum = 1578;BA.debugLine="multiplicador = multiplicador +1";
_multiplicador = (int) (_multiplicador+1);
 //BA.debugLineNum = 1579;BA.debugLine="PDF.outtext(1,pagina-multiplicador*6,\" \")";
_pdf._outtext /*adm.keymon.com.mx.cpdf*/ (1,_pagina-_multiplicador*6," ");
 //BA.debugLineNum = 1581;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 = ?",new String[]{"PREVENTA"})));
 //BA.debugLineNum = 1582;BA.debugLine="If c.RowCount > 0 Then";
if (_c.getRowCount()>0) { 
 //BA.debugLineNum = 1584;BA.debugLine="multiplicador = multiplicador +1";
_multiplicador = (int) (_multiplicador+1);
 //BA.debugLineNum = 1585;BA.debugLine="PDF.outtext(1,pagina-multiplicador*6,\"----------";
_pdf._outtext /*adm.keymon.com.mx.cpdf*/ (1,_pagina-_multiplicador*6,"------------------------------------PREVENTA-----------------------------------------");
 //BA.debugLineNum = 1586;BA.debugLine="multiplicador = multiplicador +1";
_multiplicador = (int) (_multiplicador+1);
 //BA.debugLineNum = 1587;BA.debugLine="PDF.outtext(1,pagina-multiplicador*6,\"Cant.";
_pdf._outtext /*adm.keymon.com.mx.cpdf*/ (1,_pagina-_multiplicador*6,"Cant.                                    Precio                                    Importe");
 //BA.debugLineNum = 1588;BA.debugLine="multiplicador = multiplicador +1";
_multiplicador = (int) (_multiplicador+1);
 //BA.debugLineNum = 1589;BA.debugLine="PDF.outtext(1,pagina-multiplicador*6,\"----------";
_pdf._outtext /*adm.keymon.com.mx.cpdf*/ (1,_pagina-_multiplicador*6,"-----------------------------------------------------------------------------------------");
 //BA.debugLineNum = 1592;BA.debugLine="s=skmt.ExecQuery2(\"select PE_PRONOMBRE, PE_CANT,";
_s = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_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) < 4 AND PE_CLIENTE IN (Select CUENTA from cuentaa)  order by  PE_PROID",new String[]{"PREVENTA"})));
 //BA.debugLineNum = 1593;BA.debugLine="If S.RowCount>0 Then";
if (_s.getRowCount()>0) { 
 //BA.debugLineNum = 1594;BA.debugLine="For i=0 To S.RowCount -1";
{
final int step44 = 1;
final int limit44 = (int) (_s.getRowCount()-1);
_i = (int) (0) ;
for (;_i <= limit44 ;_i = _i + step44 ) {
 //BA.debugLineNum = 1595;BA.debugLine="S.Position=i";
_s.setPosition(_i);
 //BA.debugLineNum = 1596;BA.debugLine="If s.GetString(\"PE_CEDIS\") = s.GetString(\"PE_P";
if ((_s.GetString("PE_CEDIS")).equals(_s.GetString("PE_PROID"))) { 
 //BA.debugLineNum = 1597;BA.debugLine="multiplicador = multiplicador +1";
_multiplicador = (int) (_multiplicador+1);
 //BA.debugLineNum = 1598;BA.debugLine="PDF.outtext(1,pagina-multiplicador*6,s.GetStr";
_pdf._outtext /*adm.keymon.com.mx.cpdf*/ (1,_pagina-_multiplicador*6,_s.GetString("PE_PRONOMBRE"));
 }else {
 //BA.debugLineNum = 1601;BA.debugLine="PDF.sFont(PDF.fontHelvetica,0,7,PDF.colorBlac";
_pdf._sfont /*adm.keymon.com.mx.cpdf*/ (_pdf._fonthelvetica /*String*/ ,(int) (0),7,_pdf._colorblack /*double[]*/ );
 //BA.debugLineNum = 1602;BA.debugLine="multiplicador = multiplicador +1";
_multiplicador = (int) (_multiplicador+1);
 //BA.debugLineNum = 1603;BA.debugLine="PDF.outtext(1,pagina-multiplicador*6,s.GetStr";
_pdf._outtext /*adm.keymon.com.mx.cpdf*/ (1,_pagina-_multiplicador*6,_s.GetString("PE_PRONOMBRE"));
 //BA.debugLineNum = 1604;BA.debugLine="LogColor(s.GetLong(\"L_CANT\"),Colors.Magenta)";
__c.LogImpl("342664017",BA.NumberToString(_s.GetLong("L_CANT")),__c.Colors.Magenta);
 //BA.debugLineNum = 1605;BA.debugLine="LogColor(s.GetLong(\"L_COSTOU\"),Colors.Magenta";
__c.LogImpl("342664018",BA.NumberToString(_s.GetLong("L_COSTOU")),__c.Colors.Magenta);
 //BA.debugLineNum = 1606;BA.debugLine="LogColor(s.GetLong(\"L_COSTO_TOT\"),Colors.Mage";
__c.LogImpl("342664019",BA.NumberToString(_s.GetLong("L_COSTO_TOT")),__c.Colors.Magenta);
 //BA.debugLineNum = 1608;BA.debugLine="TAMANO = s.GetLong(\"L_CANT\") + s.GetLong(\"L_C";
_tamano = (int) (_s.GetLong("L_CANT")+_s.GetLong("L_COSTOU")+_s.GetLong("L_COSTO_TOT"));
 //BA.debugLineNum = 1609;BA.debugLine="ESPACIO = 92";
_espacio = (int) (92);
 //BA.debugLineNum = 1610;BA.debugLine="BLANCO = \" \"";
_blanco = " ";
 //BA.debugLineNum = 1611;BA.debugLine="ESPACIO = ESPACIO - TAMANO";
_espacio = (int) (_espacio-_tamano);
 //BA.debugLineNum = 1612;BA.debugLine="ESPACIO = ESPACIO / 2";
_espacio = (int) (_espacio/(double)2);
 //BA.debugLineNum = 1613;BA.debugLine="For E=0 To ESPACIO -1";
{
final int step61 = 1;
final int limit61 = (int) (_espacio-1);
_e = (int) (0) ;
for (;_e <= limit61 ;_e = _e + step61 ) {
 //BA.debugLineNum = 1614;BA.debugLine="BLANCO = \" \" & BLANCO";
_blanco = " "+_blanco;
 }
};
 //BA.debugLineNum = 1616;BA.debugLine="PDF.sFont(PDF.fontHelvetica,0,10,PDF.colorBla";
_pdf._sfont /*adm.keymon.com.mx.cpdf*/ (_pdf._fonthelvetica /*String*/ ,(int) (0),10,_pdf._colorblack /*double[]*/ );
 //BA.debugLineNum = 1617;BA.debugLine="multiplicador = multiplicador +1";
_multiplicador = (int) (_multiplicador+1);
 //BA.debugLineNum = 1618;BA.debugLine="PDF.outtext(1,pagina-multiplicador*6, s.GETST";
_pdf._outtext /*adm.keymon.com.mx.cpdf*/ (1,_pagina-_multiplicador*6,_s.GetString("PE_CANT")+_blanco+_s.GetString("PE_COSTOU")+_blanco+_s.GetString("PE_COSTO_TOT"));
 };
 }
};
 };
 //BA.debugLineNum = 1629;BA.debugLine="s.Close";
_s.Close();
 //BA.debugLineNum = 1630;BA.debugLine="PDF.outtext(1,108-9*6,\" \" )";
_pdf._outtext /*adm.keymon.com.mx.cpdf*/ (1,108-9*6," ");
 //BA.debugLineNum = 1631;BA.debugLine="s=skmt.ExecQuery2(\"select PE_PRONOMBRE, PE_CANT,";
_s = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_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 = 1632;BA.debugLine="If S.RowCount>0 Then";
if (_s.getRowCount()>0) { 
 //BA.debugLineNum = 1633;BA.debugLine="multiplicador = multiplicador +1";
_multiplicador = (int) (_multiplicador+1);
 //BA.debugLineNum = 1634;BA.debugLine="PDF.outtext(1,pagina-multiplicador*6,\"---------";
_pdf._outtext /*adm.keymon.com.mx.cpdf*/ (1,_pagina-_multiplicador*6,"--------------------------PROMOS PREVENTA-------------------------------------");
 //BA.debugLineNum = 1635;BA.debugLine="multiplicador = multiplicador +1";
_multiplicador = (int) (_multiplicador+1);
 //BA.debugLineNum = 1636;BA.debugLine="PDF.outtext(1,pagina-multiplicador*6,\"Cant.";
_pdf._outtext /*adm.keymon.com.mx.cpdf*/ (1,_pagina-_multiplicador*6,"Cant.                                   Precio                                    Importe");
 //BA.debugLineNum = 1637;BA.debugLine="multiplicador = multiplicador +1";
_multiplicador = (int) (_multiplicador+1);
 //BA.debugLineNum = 1638;BA.debugLine="PDF.outtext(1,pagina-multiplicador*6,\"---------";
_pdf._outtext /*adm.keymon.com.mx.cpdf*/ (1,_pagina-_multiplicador*6,"-----------------------------------------------------------------------------------------");
 //BA.debugLineNum = 1639;BA.debugLine="For i=0 To S.RowCount -1";
{
final int step80 = 1;
final int limit80 = (int) (_s.getRowCount()-1);
_i = (int) (0) ;
for (;_i <= limit80 ;_i = _i + step80 ) {
 //BA.debugLineNum = 1640;BA.debugLine="S.Position=i";
_s.setPosition(_i);
 //BA.debugLineNum = 1641;BA.debugLine="If s.GetString(\"PE_CEDIS\") = s.GetString(\"PE_P";
if ((_s.GetString("PE_CEDIS")).equals(_s.GetString("PE_PROID"))) { 
 //BA.debugLineNum = 1642;BA.debugLine="multiplicador = multiplicador +1";
_multiplicador = (int) (_multiplicador+1);
 //BA.debugLineNum = 1643;BA.debugLine="PDF.outtext(1,pagina-multiplicador*6,s.GetStr";
_pdf._outtext /*adm.keymon.com.mx.cpdf*/ (1,_pagina-_multiplicador*6,_s.GetString("PE_PRONOMBRE"));
 }else {
 //BA.debugLineNum = 1647;BA.debugLine="PDF.sFont(PDF.fontHelvetica,0,7,PDF.colorBlac";
_pdf._sfont /*adm.keymon.com.mx.cpdf*/ (_pdf._fonthelvetica /*String*/ ,(int) (0),7,_pdf._colorblack /*double[]*/ );
 //BA.debugLineNum = 1648;BA.debugLine="multiplicador = multiplicador +1";
_multiplicador = (int) (_multiplicador+1);
 //BA.debugLineNum = 1649;BA.debugLine="PDF.outtext(1,pagina-multiplicador*6,s.GetStr";
_pdf._outtext /*adm.keymon.com.mx.cpdf*/ (1,_pagina-_multiplicador*6,_s.GetString("PE_PRONOMBRE"));
 //BA.debugLineNum = 1650;BA.debugLine="LogColor(s.GetLong(\"L_CANT\"),Colors.Magenta)";
__c.LogImpl("342664063",BA.NumberToString(_s.GetLong("L_CANT")),__c.Colors.Magenta);
 //BA.debugLineNum = 1651;BA.debugLine="LogColor(s.GetLong(\"L_COSTOU\"),Colors.Magenta";
__c.LogImpl("342664064",BA.NumberToString(_s.GetLong("L_COSTOU")),__c.Colors.Magenta);
 //BA.debugLineNum = 1652;BA.debugLine="LogColor(s.GetLong(\"L_COSTO_TOT\"),Colors.Mage";
__c.LogImpl("342664065",BA.NumberToString(_s.GetLong("L_COSTO_TOT")),__c.Colors.Magenta);
 //BA.debugLineNum = 1654;BA.debugLine="TAMANO = s.GetLong(\"L_CANT\") + s.GetLong(\"L_C";
_tamano = (int) (_s.GetLong("L_CANT")+_s.GetLong("L_COSTOU")+_s.GetLong("L_COSTO_TOT"));
 //BA.debugLineNum = 1655;BA.debugLine="ESPACIO = 92";
_espacio = (int) (92);
 //BA.debugLineNum = 1656;BA.debugLine="BLANCO = \" \"";
_blanco = " ";
 //BA.debugLineNum = 1657;BA.debugLine="ESPACIO = ESPACIO - TAMANO";
_espacio = (int) (_espacio-_tamano);
 //BA.debugLineNum = 1658;BA.debugLine="ESPACIO = ESPACIO / 2";
_espacio = (int) (_espacio/(double)2);
 //BA.debugLineNum = 1659;BA.debugLine="For E=0 To ESPACIO -1";
{
final int step97 = 1;
final int limit97 = (int) (_espacio-1);
_e = (int) (0) ;
for (;_e <= limit97 ;_e = _e + step97 ) {
 //BA.debugLineNum = 1660;BA.debugLine="BLANCO = \" \" & BLANCO";
_blanco = " "+_blanco;
 }
};
 //BA.debugLineNum = 1662;BA.debugLine="PDF.sFont(PDF.fontHelvetica,0,10,PDF.colorBla";
_pdf._sfont /*adm.keymon.com.mx.cpdf*/ (_pdf._fonthelvetica /*String*/ ,(int) (0),10,_pdf._colorblack /*double[]*/ );
 //BA.debugLineNum = 1663;BA.debugLine="multiplicador = multiplicador +1";
_multiplicador = (int) (_multiplicador+1);
 //BA.debugLineNum = 1664;BA.debugLine="PDF.outtext(1,pagina-multiplicador*6, s.GETST";
_pdf._outtext /*adm.keymon.com.mx.cpdf*/ (1,_pagina-_multiplicador*6,_s.GetString("PE_CANT")+_blanco+_s.GetString("PE_COSTOU")+_blanco+_s.GetString("PE_COSTO_TOT"));
 };
 }
};
 };
 //BA.debugLineNum = 1669;BA.debugLine="s.Close";
_s.Close();
 //BA.debugLineNum = 1673;BA.debugLine="multiplicador = multiplicador +1";
_multiplicador = (int) (_multiplicador+1);
 //BA.debugLineNum = 1674;BA.debugLine="PDF.outtext(1,pagina-multiplicador*6,\" \" )";
_pdf._outtext /*adm.keymon.com.mx.cpdf*/ (1,_pagina-_multiplicador*6," ");
 //BA.debugLineNum = 1675;BA.debugLine="multiplicador = multiplicador +1";
_multiplicador = (int) (_multiplicador+1);
 //BA.debugLineNum = 1676;BA.debugLine="PDF.outtext(1,pagina-multiplicador*6,\"----------";
_pdf._outtext /*adm.keymon.com.mx.cpdf*/ (1,_pagina-_multiplicador*6,"-----------------------------------------------------------------------------------------");
 //BA.debugLineNum = 1678;BA.debugLine="s=skmt.ExecQuery2(\"select SUM(PE_COSTO_TOT) AS T";
_s = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_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 = 1679;BA.debugLine="s.Position =0";
_s.setPosition((int) (0));
 //BA.debugLineNum = 1680;BA.debugLine="multiplicador = multiplicador +1";
_multiplicador = (int) (_multiplicador+1);
 //BA.debugLineNum = 1681;BA.debugLine="PDF.outtext(1,pagina-multiplicador*6,\"Total prev";
_pdf._outtext /*adm.keymon.com.mx.cpdf*/ (1,_pagina-_multiplicador*6,"Total preventa:   $"+_s.GetString("TOTAL"));
 //BA.debugLineNum = 1682;BA.debugLine="s.Close";
_s.Close();
 //BA.debugLineNum = 1683;BA.debugLine="c= skmt.ExecQuery2(\"select sum(PE_CANT) as PC_NO";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_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 = 1684;BA.debugLine="C.Position=0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 1685;BA.debugLine="multiplicador = multiplicador +1";
_multiplicador = (int) (_multiplicador+1);
 //BA.debugLineNum = 1686;BA.debugLine="PDF.outtext(1,pagina-multiplicador*6,\"Total arti";
_pdf._outtext /*adm.keymon.com.mx.cpdf*/ (1,_pagina-_multiplicador*6,"Total articulos preventa:   "+_c.GetString("PC_NOART"));
 //BA.debugLineNum = 1687;BA.debugLine="c.Close";
_c.Close();
 };
 //BA.debugLineNum = 1692;BA.debugLine="multiplicador = multiplicador +1";
_multiplicador = (int) (_multiplicador+1);
 //BA.debugLineNum = 1693;BA.debugLine="PDF.outtext(1,pagina-multiplicador*6,\"-----------";
_pdf._outtext /*adm.keymon.com.mx.cpdf*/ (1,_pagina-_multiplicador*6,"-----------------------------------------------------------------------------------------");
 //BA.debugLineNum = 1694;BA.debugLine="multiplicador = multiplicador +1";
_multiplicador = (int) (_multiplicador+1);
 //BA.debugLineNum = 1695;BA.debugLine="PDF.outtext(1,pagina-multiplicador*6,\"-----------";
_pdf._outtext /*adm.keymon.com.mx.cpdf*/ (1,_pagina-_multiplicador*6,"--------------------------ESTE TICKET NO ES UN ---------------------------");
 //BA.debugLineNum = 1696;BA.debugLine="multiplicador = multiplicador +1";
_multiplicador = (int) (_multiplicador+1);
 //BA.debugLineNum = 1697;BA.debugLine="PDF.outtext(1,pagina-multiplicador*6,\"-----------";
_pdf._outtext /*adm.keymon.com.mx.cpdf*/ (1,_pagina-_multiplicador*6,"-------------------COMPROBANTE FISCAL, SOLO ES--------------------");
 //BA.debugLineNum = 1698;BA.debugLine="multiplicador = multiplicador +1";
_multiplicador = (int) (_multiplicador+1);
 //BA.debugLineNum = 1699;BA.debugLine="PDF.outtext(1,pagina-multiplicador*6,\"-----------";
_pdf._outtext /*adm.keymon.com.mx.cpdf*/ (1,_pagina-_multiplicador*6,"---------------------------------INFORMATIVO-----------------------------------");
 //BA.debugLineNum = 1700;BA.debugLine="multiplicador = multiplicador +1";
_multiplicador = (int) (_multiplicador+1);
 //BA.debugLineNum = 1701;BA.debugLine="PDF.outtext(1,pagina-multiplicador*6,\"-----------";
_pdf._outtext /*adm.keymon.com.mx.cpdf*/ (1,_pagina-_multiplicador*6,"-----------------------------------------------------------------------------------------");
 //BA.debugLineNum = 1702;BA.debugLine="multiplicador = multiplicador +1";
_multiplicador = (int) (_multiplicador+1);
 //BA.debugLineNum = 1703;BA.debugLine="PDF.outtext(1,pagina-multiplicador*6,\" \" )";
_pdf._outtext /*adm.keymon.com.mx.cpdf*/ (1,_pagina-_multiplicador*6," ");
 //BA.debugLineNum = 1704;BA.debugLine="multiplicador = multiplicador +1";
_multiplicador = (int) (_multiplicador+1);
 //BA.debugLineNum = 1705;BA.debugLine="PDF.outtext(1,pagina-multiplicador*6,\" \" )";
_pdf._outtext /*adm.keymon.com.mx.cpdf*/ (1,_pagina-_multiplicador*6," ");
 //BA.debugLineNum = 1715;BA.debugLine="DateTime.DateFormat = \"ddmmyyyy\"";
__c.DateTime.setDateFormat("ddmmyyyy");
 //BA.debugLineNum = 1716;BA.debugLine="DateTime.TimeFormat = \"HHmmss\"";
__c.DateTime.setTimeFormat("HHmmss");
 //BA.debugLineNum = 1717;BA.debugLine="sDate=DateTime.Date(DateTime.Now)";
_sdate = __c.DateTime.Date(__c.DateTime.getNow());
 //BA.debugLineNum = 1718;BA.debugLine="sTime=DateTime.Time(DateTime.Now)";
_stime = __c.DateTime.Time(__c.DateTime.getNow());
 //BA.debugLineNum = 1720;BA.debugLine="savePDF(PDF,sDate&sTime&\".pdf\",PDF.CompressAlways";
_savepdf(_pdf,_sdate+_stime+".pdf",_pdf._compressalways /*int*/ );
 //BA.debugLineNum = 1723;BA.debugLine="If chb_impreso.Checked = False Then";
if (_chb_impreso.getChecked()==__c.False) { 
 //BA.debugLineNum = 1724;BA.debugLine="openPDF(sDate&sTime&\".pdf\")";
_openpdf(_sdate+_stime+".pdf");
 };
 //BA.debugLineNum = 1726;BA.debugLine="nombrepdf =sDate&sTime&\".pdf\"";
_nombrepdf = _sdate+_stime+".pdf";
 //BA.debugLineNum = 1727;BA.debugLine="GUADAVENTA2";
_guadaventa2();
 //BA.debugLineNum = 1728;BA.debugLine="End Sub";
return "";
}
public String  _printer_connected(boolean _success) throws Exception{
 //BA.debugLineNum = 2060;BA.debugLine="Sub Printer_Connected (Success As Boolean)";
 //BA.debugLineNum = 2061;BA.debugLine="If Success Then";
if (_success) { 
 //BA.debugLineNum = 2062;BA.debugLine="B_IMP.Enabled = True";
_b_imp.setEnabled(__c.True);
 }else {
 //BA.debugLineNum = 2064;BA.debugLine="B_IMP.Enabled = False";
_b_imp.setEnabled(__c.False);
 //BA.debugLineNum = 2065;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 = 2066;BA.debugLine="StartPrinter";
_startprinter();
 };
 };
 //BA.debugLineNum = 2069;BA.debugLine="End Sub";
return "";
}
public String  _printer1_connected(boolean _success) throws Exception{
 //BA.debugLineNum = 2039;BA.debugLine="Sub Printer1_Connected (Success As Boolean)";
 //BA.debugLineNum = 2041;BA.debugLine="If Success Then";
if (_success) { 
 //BA.debugLineNum = 2042;BA.debugLine="ToastMessageShow(\"Impresora conectada\", False)";
__c.ToastMessageShow(BA.ObjectToCharSequence("Impresora conectada"),__c.False);
 //BA.debugLineNum = 2043;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 = 2044;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 = 2045;BA.debugLine="LogColor(\"Impresora conectada\", Colors.Green)";
__c.LogImpl("342926086","Impresora conectada",__c.Colors.Green);
 //BA.debugLineNum = 2047;BA.debugLine="impresoraConectada = True";
_impresoraconectada = __c.True;
 }else {
 //BA.debugLineNum = 2051;BA.debugLine="LogColor(\"Error conectando la impresora\", Colors";
__c.LogImpl("342926092","Error conectando la impresora",__c.Colors.Red);
 //BA.debugLineNum = 2052;BA.debugLine="errorImpresora = errorImpresora + 1";
_errorimpresora = (int) (_errorimpresora+1);
 //BA.debugLineNum = 2053;BA.debugLine="If errorImpresora > 1 Then";
if (_errorimpresora>1) { 
 //BA.debugLineNum = 2054;BA.debugLine="Starter.MAC_IMPRESORA = \"0\"";
_starter._mac_impresora /*String*/  = "0";
 //BA.debugLineNum = 2055;BA.debugLine="errorImpresora = 0";
_errorimpresora = (int) (0);
 };
 };
 //BA.debugLineNum = 2058;BA.debugLine="End Sub";
return "";
}
public String  _rb1_checkedchange(boolean _checked) throws Exception{
 //BA.debugLineNum = 2174;BA.debugLine="Sub RB1_CheckedChange(Checked As Boolean)";
 //BA.debugLineNum = 2175;BA.debugLine="If RB1.Checked = True Then";
if (_rb1.getChecked()==__c.True) { 
 //BA.debugLineNum = 2176;BA.debugLine="E_RES_E.Text = \"CENTRAL DE ABASTOS\"";
_e_res_e.setText(BA.ObjectToCharSequence("CENTRAL DE ABASTOS"));
 };
 //BA.debugLineNum = 2178;BA.debugLine="End Sub";
return "";
}
public String  _rb2_checkedchange(boolean _checked) throws Exception{
 //BA.debugLineNum = 2180;BA.debugLine="Sub RB2_CheckedChange(Checked As Boolean)";
 //BA.debugLineNum = 2181;BA.debugLine="If RB2.Checked = True Then";
if (_rb2.getChecked()==__c.True) { 
 //BA.debugLineNum = 2182;BA.debugLine="E_RES_E.Text = \"AUTOSERVICIO\"";
_e_res_e.setText(BA.ObjectToCharSequence("AUTOSERVICIO"));
 };
 //BA.debugLineNum = 2184;BA.debugLine="End Sub";
return "";
}
public String  _rb3_checkedchange(boolean _checked) throws Exception{
 //BA.debugLineNum = 2186;BA.debugLine="Sub RB3_CheckedChange(Checked As Boolean)";
 //BA.debugLineNum = 2187;BA.debugLine="If RB3.Checked = True Then";
if (_rb3.getChecked()==__c.True) { 
 //BA.debugLineNum = 2188;BA.debugLine="E_RES_E.Text = \"CLUB DE PRECIO\"";
_e_res_e.setText(BA.ObjectToCharSequence("CLUB DE PRECIO"));
 };
 //BA.debugLineNum = 2190;BA.debugLine="End Sub";
return "";
}
public String  _rb4_checkedchange(boolean _checked) throws Exception{
 //BA.debugLineNum = 2192;BA.debugLine="Sub RB4_CheckedChange(Checked As Boolean)";
 //BA.debugLineNum = 2193;BA.debugLine="If RB4.Checked = True Then";
if (_rb4.getChecked()==__c.True) { 
 //BA.debugLineNum = 2194;BA.debugLine="E_RES_E.Text = \"DIRECTO PEDEGREE\"";
_e_res_e.setText(BA.ObjectToCharSequence("DIRECTO PEDEGREE"));
 };
 //BA.debugLineNum = 2196;BA.debugLine="End Sub";
return "";
}
public String  _savepdf(adm.keymon.com.mx.cpdf _apdf,String _afile,int _acompress) throws Exception{
String _folder = "";
 //BA.debugLineNum = 1730;BA.debugLine="private Sub savePDF(apdf As cPDF,afile As String,a";
 //BA.debugLineNum = 1743;BA.debugLine="Dim folder As String";
_folder = "";
 //BA.debugLineNum = 1748;BA.debugLine="folder = Starter.fFileProvider.SharedFolder";
_folder = _starter._ffileprovider /*adm.keymon.com.mx.fileprovider*/ ._sharedfolder /*String*/ ;
 //BA.debugLineNum = 1755;BA.debugLine="apdf.saveToFile(folder, afile, acompress)";
_apdf._savetofile /*adm.keymon.com.mx.cpdf*/ (_folder,_afile,_acompress);
 //BA.debugLineNum = 1758;BA.debugLine="Log($\"PDF guardado en: ${File.Combine(folder, afi";
__c.LogImpl("342729500",("PDF guardado en: "+__c.SmartStringFormatter("",(Object)(__c.File.Combine(_folder,_afile)))+""),0);
 //BA.debugLineNum = 1759;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(adm.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;
}
adm.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 = 978;BA.debugLine="CODIGO = Values";
parent._codigo = _values;
 //BA.debugLineNum = 979;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 /*adm.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 = 980;BA.debugLine="DD.Position =0";
parent._dd.setPosition((int) (0));
 //BA.debugLineNum = 981;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 = 982;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 = 984;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 = 985;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 = 986;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 = 987;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 = 988;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"UPDATE k";
parent._b4xpages._mainpage /*adm.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 /*adm.keymon.com.mx.b4xmainpage*/ (ba)._lon_gps /*String*/ ),(Object)(parent._b4xpages._mainpage /*adm.keymon.com.mx.b4xmainpage*/ (ba)._lat_gps /*String*/ )}));
 //BA.debugLineNum = 989;BA.debugLine="L_QR.TEXT =CODIGO";
parent._l_qr.setText(BA.ObjectToCharSequence(parent._codigo));
 //BA.debugLineNum = 990;BA.debugLine="L_QR.TextColor = Colors.Blue";
parent._l_qr.setTextColor(parent.__c.Colors.Blue);
 //BA.debugLineNum = 991;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"insert i";
parent._b4xpages._mainpage /*adm.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 /*adm.keymon.com.mx.b4xmainpage*/ (ba)._lon_gps /*String*/ ),(Object)(parent._b4xpages._mainpage /*adm.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 = 994;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 = 997;BA.debugLine="DD.Close";
parent._dd.Close();
 //BA.debugLineNum = 998;BA.debugLine="End Sub";
if (true) break;

            }
        }
    }
}
public String  _sc_timedout(boolean _timedout) throws Exception{
 //BA.debugLineNum = 1000;BA.debugLine="Sub sc_timedout(timedOut As Boolean)";
 //BA.debugLineNum = 1001;BA.debugLine="Log(\"timedOut \" & timedOut)";
__c.LogImpl("342139649","timedOut "+BA.ObjectToString(_timedout),0);
 //BA.debugLineNum = 1002;BA.debugLine="End Sub";
return "";
}
public String  _sc_usercancelled(boolean _usercancelled) throws Exception{
 //BA.debugLineNum = 1004;BA.debugLine="Sub sc_usercancelled(userCancelled As Boolean)";
 //BA.debugLineNum = 1005;BA.debugLine="Log(\"userCancelled \" & userCancelled)";
__c.LogImpl("342205185","userCancelled "+BA.ObjectToString(_usercancelled),0);
 //BA.debugLineNum = 1006;BA.debugLine="End Sub";
return "";
}
public String  _startprinter() throws Exception{
int _resimp = 0;
int _i = 0;
 //BA.debugLineNum = 2071;BA.debugLine="Sub StartPrinter";
 //BA.debugLineNum = 2072;BA.debugLine="Dim PairedDevices As Map";
_paireddevices = new anywheresoftware.b4a.objects.collections.Map();
 //BA.debugLineNum = 2073;BA.debugLine="Dim L As List";
_l = new anywheresoftware.b4a.objects.collections.List();
 //BA.debugLineNum = 2074;BA.debugLine="Dim resimp As Int";
_resimp = 0;
 //BA.debugLineNum = 2075;BA.debugLine="ToastMessageShow(\"Printing.....\",True)";
__c.ToastMessageShow(BA.ObjectToCharSequence("Printing....."),__c.True);
 //BA.debugLineNum = 2076;BA.debugLine="PairedDevices.Initialize";
_paireddevices.Initialize();
 //BA.debugLineNum = 2077;BA.debugLine="Try";
try { //BA.debugLineNum = 2078;BA.debugLine="PairedDevices = cmp20.GetPairedDevices";
_paireddevices = _cmp20.GetPairedDevices();
 } 
       catch (Exception e9) {
			ba.setLastException(e9); //BA.debugLineNum = 2080;BA.debugLine="Msgbox(\"Getting Paired Devices\",\"Printer Error\")";
__c.Msgbox(BA.ObjectToCharSequence("Getting Paired Devices"),BA.ObjectToCharSequence("Printer Error"),ba);
 //BA.debugLineNum = 2081;BA.debugLine="printer.Close";
_printer.Close();
 //BA.debugLineNum = 2082;BA.debugLine="cmp20.Disconnect";
_cmp20.Disconnect();
 };
 //BA.debugLineNum = 2084;BA.debugLine="If PairedDevices.Size = 0 Then";
if (_paireddevices.getSize()==0) { 
 //BA.debugLineNum = 2085;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 = 2086;BA.debugLine="Return";
if (true) return "";
 };
 //BA.debugLineNum = 2088;BA.debugLine="If PairedDevices.Size = 1 Then";
if (_paireddevices.getSize()==1) { 
 //BA.debugLineNum = 2089;BA.debugLine="Try";
try { //BA.debugLineNum = 2090;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 = 2092;BA.debugLine="Msgbox(\"Connecting\",\"Printer Error\") 'Ignore";
__c.Msgbox(BA.ObjectToCharSequence("Connecting"),BA.ObjectToCharSequence("Printer Error"),ba);
 //BA.debugLineNum = 2093;BA.debugLine="printer.Close";
_printer.Close();
 //BA.debugLineNum = 2094;BA.debugLine="cmp20.Disconnect";
_cmp20.Disconnect();
 };
 }else {
 //BA.debugLineNum = 2097;BA.debugLine="L.Initialize";
_l.Initialize();
 //BA.debugLineNum = 2098;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 = 2099;BA.debugLine="L.Add(PairedDevices.GetKeyAt(i))";
_l.Add(_paireddevices.GetKeyAt(_i));
 }
};
 //BA.debugLineNum = 2101;BA.debugLine="resimp = InputList(L, \"Choose device\", -1) 'Igno";
_resimp = __c.InputList(_l,BA.ObjectToCharSequence("Choose device"),(int) (-1),ba);
 //BA.debugLineNum = 2102;BA.debugLine="If resimp <> DialogResponse.CANCEL Then";
if (_resimp!=__c.DialogResponse.CANCEL) { 
 //BA.debugLineNum = 2103;BA.debugLine="cmp20.Connect(PairedDevices.Get(L.Get(resimp)))";
_cmp20.Connect(ba,BA.ObjectToString(_paireddevices.Get(_l.Get(_resimp))));
 };
 };
 //BA.debugLineNum = 2106;BA.debugLine="End Sub";
return "";
}
public String  _stopcamera() throws Exception{
 //BA.debugLineNum = 2975;BA.debugLine="Private Sub StopCamera";
 //BA.debugLineNum = 2977;BA.debugLine="If camEx.IsInitialized Then";
if (_camex.IsInitialized /*boolean*/ ()) { 
 //BA.debugLineNum = 2978;BA.debugLine="camEx.Release";
_camex._release /*String*/ ();
 };
 //BA.debugLineNum = 2980;BA.debugLine="End Sub";
return "";
}
public String  _t1_tick() throws Exception{
 //BA.debugLineNum = 1043;BA.debugLine="Sub t1_tick";
 //BA.debugLineNum = 1044;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 = 1045;BA.debugLine="If s.RowCount > 0 Then";
if (_s.getRowCount()>0) { 
 //BA.debugLineNum = 1046;BA.debugLine="imprime_preventa";
_imprime_preventa();
 };
 //BA.debugLineNum = 1048;BA.debugLine="t1.Enabled = False";
_t1.setEnabled(__c.False);
 //BA.debugLineNum = 1049;BA.debugLine="End Sub";
return "";
}
public String  _tar_click() throws Exception{
 //BA.debugLineNum = 646;BA.debugLine="Sub Tar_Click";
 //BA.debugLineNum = 647;BA.debugLine="B4XPages.ShowPage(\"Nota\")";
_b4xpages._showpage /*String*/ (ba,"Nota");
 //BA.debugLineNum = 648;BA.debugLine="End Sub";
return "";
}
public String  _tels_click() throws Exception{
 //BA.debugLineNum = 598;BA.debugLine="Sub Tels_Click";
 //BA.debugLineNum = 599;BA.debugLine="B4XPages.ShowPage(\"NoVenta\")";
_b4xpages._showpage /*String*/ (ba,"NoVenta");
 //BA.debugLineNum = 600;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((adm.keymon.com.mx.httpjob) args[0]);
return BA.SubDelegator.SubNotFound;
}
}
