package reparto_izca.keymon.lat;


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

public class c_noventa 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 anywheresoftware.b4a.ShellBA(_ba, this, htSubs, "reparto_izca.keymon.lat.c_noventa");
            if (htSubs == null) {
                ba.loadHtSubs(this.getClass());
                htSubs = ba.htSubs;
            }
            
        }
        if (BA.isShellModeRuntimeCheck(ba)) 
			   this.getClass().getMethod("_class_globals", reparto_izca.keymon.lat.c_noventa.class).invoke(this, new Object[] {null});
        else
            ba.raiseEvent2(null, true, "class_globals", false);
    }

 
    public void  innerInitializeHelper(anywheresoftware.b4a.BA _ba) throws Exception{
        innerInitialize(_ba);
    }
    public Object callSub(String sub, Object sender, Object[] args) throws Exception {
        return BA.SubDelegator.SubNotFound;
    }
public anywheresoftware.b4a.keywords.Common __c = null;
public anywheresoftware.b4a.objects.B4XViewWrapper _root = null;
public anywheresoftware.b4a.objects.B4XViewWrapper.XUI _xui = null;
public anywheresoftware.b4a.gps.GPS _g = null;
public anywheresoftware.b4a.sql.SQL.CursorWrapper _c = null;
public String _comentario = "";
public anywheresoftware.b4a.objects.ButtonWrapper _cancela = null;
public anywheresoftware.b4a.objects.ButtonWrapper _guarda = null;
public anywheresoftware.b4a.objects.CompoundButtonWrapper.RadioButtonWrapper _r_1 = null;
public anywheresoftware.b4a.objects.CompoundButtonWrapper.RadioButtonWrapper _r_2 = null;
public anywheresoftware.b4a.objects.CompoundButtonWrapper.RadioButtonWrapper _r_3 = null;
public anywheresoftware.b4a.objects.EditTextWrapper _e_comm = null;
public String _motivo = "";
public String _cuenta = "";
public String _usuario = "";
public String _sdate = "";
public String _stime = "";
public anywheresoftware.b4a.objects.CompoundButtonWrapper.RadioButtonWrapper _r_4 = null;
public anywheresoftware.b4a.objects.PanelWrapper _p_principal = null;
public anywheresoftware.b4a.sql.SQL.CursorWrapper _d = null;
public reparto_izca.keymon.lat.dbrequestmanager _reqmanager = null;
public anywheresoftware.b4a.objects.CompoundButtonWrapper.CheckBoxWrapper _cb_reprogramar = null;
public int _reprogramar = 0;
public String _pasa_imp = "";
public reparto_izca.keymon.lat.escposprinter _printer1 = null;
public boolean _impresoraconectada = false;
public int _errorimpresora = 0;
public anywheresoftware.b4a.objects.Serial _cmp20 = null;
public anywheresoftware.b4a.objects.Serial.BluetoothAdmin _btadmin = null;
public anywheresoftware.b4a.objects.streams.File.TextWriterWrapper _printer = null;
public b4a.example.dateutils _dateutils = null;
public reparto_izca.keymon.lat.main _main = null;
public reparto_izca.keymon.lat.appupdater _appupdater = null;
public reparto_izca.keymon.lat.subs _subs = null;
public reparto_izca.keymon.lat.foto _foto = null;
public reparto_izca.keymon.lat.mapa_cliente _mapa_cliente = null;
public reparto_izca.keymon.lat.mapa_rutas _mapa_rutas = null;
public reparto_izca.keymon.lat.starter _starter = null;
public reparto_izca.keymon.lat.tracker _tracker = null;
public reparto_izca.keymon.lat.newinst2 _newinst2 = null;
public reparto_izca.keymon.lat.b4xpages _b4xpages = null;
public reparto_izca.keymon.lat.b4xcollections _b4xcollections = null;
public reparto_izca.keymon.lat.httputils2service _httputils2service = null;
public reparto_izca.keymon.lat.xuiviewsutils _xuiviewsutils = null;
public Object  _initialize(reparto_izca.keymon.lat.c_noventa __ref,anywheresoftware.b4a.BA _ba) throws Exception{
__ref = this;
innerInitialize(_ba);
RDebugUtils.currentModule="c_noventa";
if (Debug.shouldDelegate(ba, "initialize", false))
	 {return ((Object) Debug.delegate(ba, "initialize", new Object[] {_ba}));}
RDebugUtils.currentLine=22806528;
 //BA.debugLineNum = 22806528;BA.debugLine="Public Sub Initialize As Object";
RDebugUtils.currentLine=22806529;
 //BA.debugLineNum = 22806529;BA.debugLine="Return Me";
if (true) return this;
RDebugUtils.currentLine=22806530;
 //BA.debugLineNum = 22806530;BA.debugLine="End Sub";
return null;
}
public void  _b_imp_click(reparto_izca.keymon.lat.c_noventa __ref) throws Exception{
RDebugUtils.currentModule="c_noventa";
if (Debug.shouldDelegate(ba, "b_imp_click", false))
	 {Debug.delegate(ba, "b_imp_click", null); return;}
ResumableSub_B_IMP_Click rsub = new ResumableSub_B_IMP_Click(this,__ref);
rsub.resume(ba, null);
}
public static class ResumableSub_B_IMP_Click extends BA.ResumableSub {
public ResumableSub_B_IMP_Click(reparto_izca.keymon.lat.c_noventa parent,reparto_izca.keymon.lat.c_noventa __ref) {
this.parent = parent;
this.__ref = __ref;
this.__ref = parent;
}
reparto_izca.keymon.lat.c_noventa __ref;
reparto_izca.keymon.lat.c_noventa parent;
int _cont = 0;
anywheresoftware.b4a.sql.SQL.CursorWrapper _clientecur = null;
int _resultado = 0;

@Override
public void resume(BA ba, Object[] result) throws Exception{
RDebugUtils.currentModule="c_noventa";

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

case 0:
//C
this.state = 1;
RDebugUtils.currentLine=23396353;
 //BA.debugLineNum = 23396353;BA.debugLine="c=Starter.skmt.ExecQuery(\"select USUARIO from usu";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/  = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(parent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select USUARIO from usuarioa")));
RDebugUtils.currentLine=23396354;
 //BA.debugLineNum = 23396354;BA.debugLine="c.Position=0";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition((int) (0));
RDebugUtils.currentLine=23396355;
 //BA.debugLineNum = 23396355;BA.debugLine="usuario = c.GetString(\"USUARIO\")";
__ref._usuario /*String*/  = __ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("USUARIO");
RDebugUtils.currentLine=23396357;
 //BA.debugLineNum = 23396357;BA.debugLine="DateTime.DateFormat = \"MM/dd/yyyy\"";
parent.__c.DateTime.setDateFormat("MM/dd/yyyy");
RDebugUtils.currentLine=23396358;
 //BA.debugLineNum = 23396358;BA.debugLine="DateTime.TimeFormat=\"HH:mm:ss\"";
parent.__c.DateTime.setTimeFormat("HH:mm:ss");
RDebugUtils.currentLine=23396359;
 //BA.debugLineNum = 23396359;BA.debugLine="sDate=DateTime.Date(DateTime.Now)";
__ref._sdate /*String*/  = parent.__c.DateTime.Date(parent.__c.DateTime.getNow());
RDebugUtils.currentLine=23396360;
 //BA.debugLineNum = 23396360;BA.debugLine="sTime=DateTime.Time(DateTime.Now)";
__ref._stime /*String*/  = parent.__c.DateTime.Time(parent.__c.DateTime.getNow());
RDebugUtils.currentLine=23396361;
 //BA.debugLineNum = 23396361;BA.debugLine="c.Close";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .Close();
RDebugUtils.currentLine=23396367;
 //BA.debugLineNum = 23396367;BA.debugLine="ProgressDialogShow(\"Imprimiendo, un momento ...\")";
parent.__c.ProgressDialogShow(ba,BA.ObjectToCharSequence("Imprimiendo, un momento ..."));
RDebugUtils.currentLine=23396368;
 //BA.debugLineNum = 23396368;BA.debugLine="Printer1.DisConnect";
__ref._printer1 /*reparto_izca.keymon.lat.escposprinter*/ ._disconnect /*String*/ (null);
RDebugUtils.currentLine=23396369;
 //BA.debugLineNum = 23396369;BA.debugLine="If Not(Printer1.IsConnected) Then";
if (true) break;

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

case 3:
//C
this.state = 4;
RDebugUtils.currentLine=23396371;
 //BA.debugLineNum = 23396371;BA.debugLine="Printer1.Connect";
__ref._printer1 /*reparto_izca.keymon.lat.escposprinter*/ ._connect /*boolean*/ (null);
RDebugUtils.currentLine=23396372;
 //BA.debugLineNum = 23396372;BA.debugLine="Private cont As Int = 0";
_cont = (int) (0);
RDebugUtils.currentLine=23396373;
 //BA.debugLineNum = 23396373;BA.debugLine="Do While Not(impresoraConectada)";
if (true) break;

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

case 6:
//C
this.state = 7;
RDebugUtils.currentLine=23396374;
 //BA.debugLineNum = 23396374;BA.debugLine="Sleep(1000)";
parent.__c.Sleep(ba,new anywheresoftware.b4a.shell.DebugResumableSub.DelegatableResumableSub(this, "c_noventa", "b_imp_click"),(int) (1000));
this.state = 55;
return;
case 55:
//C
this.state = 7;
;
RDebugUtils.currentLine=23396376;
 //BA.debugLineNum = 23396376;BA.debugLine="cont = cont + 1";
_cont = (int) (_cont+1);
RDebugUtils.currentLine=23396377;
 //BA.debugLineNum = 23396377;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;
__ref._printer1 /*reparto_izca.keymon.lat.escposprinter*/ ._connect /*boolean*/ (null);
if (true) break;

case 12:
//C
this.state = 13;
;
RDebugUtils.currentLine=23396378;
 //BA.debugLineNum = 23396378;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;
__ref._impresoraconectada /*boolean*/  = parent.__c.True;
if (true) break;

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

case 19:
//C
this.state = 38;
;
RDebugUtils.currentLine=23396380;
 //BA.debugLineNum = 23396380;BA.debugLine="Sleep(500)";
parent.__c.Sleep(ba,new anywheresoftware.b4a.shell.DebugResumableSub.DelegatableResumableSub(this, "c_noventa", "b_imp_click"),(int) (500));
this.state = 56;
return;
case 56:
//C
this.state = 38;
;
RDebugUtils.currentLine=23396381;
 //BA.debugLineNum = 23396381;BA.debugLine="impresoraConectada = False";
__ref._impresoraconectada /*boolean*/  = parent.__c.False;
 if (true) break;

case 21:
//C
this.state = 22;
RDebugUtils.currentLine=23396384;
 //BA.debugLineNum = 23396384;BA.debugLine="Printer1.Connect";
__ref._printer1 /*reparto_izca.keymon.lat.escposprinter*/ ._connect /*boolean*/ (null);
RDebugUtils.currentLine=23396385;
 //BA.debugLineNum = 23396385;BA.debugLine="Private cont As Int = 0";
_cont = (int) (0);
RDebugUtils.currentLine=23396386;
 //BA.debugLineNum = 23396386;BA.debugLine="Do While Not(impresoraConectada) Or Not(Printer1";
if (true) break;

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

case 24:
//C
this.state = 25;
RDebugUtils.currentLine=23396387;
 //BA.debugLineNum = 23396387;BA.debugLine="Sleep(1000)";
parent.__c.Sleep(ba,new anywheresoftware.b4a.shell.DebugResumableSub.DelegatableResumableSub(this, "c_noventa", "b_imp_click"),(int) (1000));
this.state = 57;
return;
case 57:
//C
this.state = 25;
;
RDebugUtils.currentLine=23396389;
 //BA.debugLineNum = 23396389;BA.debugLine="cont = cont + 1";
_cont = (int) (_cont+1);
RDebugUtils.currentLine=23396390;
 //BA.debugLineNum = 23396390;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;
__ref._printer1 /*reparto_izca.keymon.lat.escposprinter*/ ._connect /*boolean*/ (null);
if (true) break;

case 30:
//C
this.state = 31;
;
RDebugUtils.currentLine=23396391;
 //BA.debugLineNum = 23396391;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;
__ref._impresoraconectada /*boolean*/  = parent.__c.True;
if (true) break;

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

case 37:
//C
this.state = 38;
;
RDebugUtils.currentLine=23396393;
 //BA.debugLineNum = 23396393;BA.debugLine="Sleep(500)";
parent.__c.Sleep(ba,new anywheresoftware.b4a.shell.DebugResumableSub.DelegatableResumableSub(this, "c_noventa", "b_imp_click"),(int) (500));
this.state = 58;
return;
case 58:
//C
this.state = 38;
;
RDebugUtils.currentLine=23396394;
 //BA.debugLineNum = 23396394;BA.debugLine="impresoraConectada = False";
__ref._impresoraconectada /*boolean*/  = parent.__c.False;
 if (true) break;

case 38:
//C
this.state = 39;
;
RDebugUtils.currentLine=23396398;
 //BA.debugLineNum = 23396398;BA.debugLine="Printer1.WriteString(\"Izca Distribuciones\" &  CRL";
__ref._printer1 /*reparto_izca.keymon.lat.escposprinter*/ ._writestring /*String*/ (null,"Izca Distribuciones"+parent.__c.CRLF);
RDebugUtils.currentLine=23396400;
 //BA.debugLineNum = 23396400;BA.debugLine="Printer1.WriteString(\"Vendedor:\" & usuario &  CRL";
__ref._printer1 /*reparto_izca.keymon.lat.escposprinter*/ ._writestring /*String*/ (null,"Vendedor:"+__ref._usuario /*String*/ +parent.__c.CRLF);
RDebugUtils.currentLine=23396403;
 //BA.debugLineNum = 23396403;BA.debugLine="Dim clientecur As Cursor = Starter.skmt.ExecQuery";
_clientecur = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_clientecur = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(parent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("SELECT CAT_CL_NOMBRE FROM kmt_info WHERE CAT_CL_CODIGO IN (SELECT CUENTA FROM CUENTAA)")));
RDebugUtils.currentLine=23396404;
 //BA.debugLineNum = 23396404;BA.debugLine="clientecur.Position = 0";
_clientecur.setPosition((int) (0));
RDebugUtils.currentLine=23396406;
 //BA.debugLineNum = 23396406;BA.debugLine="Printer1.WriteString(\"ID.Cliente: \" &  Subs.traeC";
__ref._printer1 /*reparto_izca.keymon.lat.escposprinter*/ ._writestring /*String*/ (null,"ID.Cliente: "+parent._subs._traecliente /*String*/ (ba)+parent.__c.CRLF);
RDebugUtils.currentLine=23396408;
 //BA.debugLineNum = 23396408;BA.debugLine="Printer1.WriteString(\"Tienda: \" & clientecur.GetS";
__ref._printer1 /*reparto_izca.keymon.lat.escposprinter*/ ._writestring /*String*/ (null,"Tienda: "+_clientecur.GetString("CAT_CL_NOMBRE")+parent.__c.CRLF);
RDebugUtils.currentLine=23396410;
 //BA.debugLineNum = 23396410;BA.debugLine="Printer1.WriteString(sDate &\" \"& sTime &  CRLF)";
__ref._printer1 /*reparto_izca.keymon.lat.escposprinter*/ ._writestring /*String*/ (null,__ref._sdate /*String*/ +" "+__ref._stime /*String*/ +parent.__c.CRLF);
RDebugUtils.currentLine=23396411;
 //BA.debugLineNum = 23396411;BA.debugLine="If r_1.Checked Then";
if (true) break;

case 39:
//if
this.state = 48;
if (__ref._r_1 /*anywheresoftware.b4a.objects.CompoundButtonWrapper.RadioButtonWrapper*/ .getChecked()) { 
this.state = 41;
}else 
{RDebugUtils.currentLine=23396413;
 //BA.debugLineNum = 23396413;BA.debugLine="Else If r_2.Checked Then";
if (__ref._r_2 /*anywheresoftware.b4a.objects.CompoundButtonWrapper.RadioButtonWrapper*/ .getChecked()) { 
this.state = 43;
}else 
{RDebugUtils.currentLine=23396415;
 //BA.debugLineNum = 23396415;BA.debugLine="Else If r_3.Checked Then";
if (__ref._r_3 /*anywheresoftware.b4a.objects.CompoundButtonWrapper.RadioButtonWrapper*/ .getChecked()) { 
this.state = 45;
}else {
this.state = 47;
}}}
if (true) break;

case 41:
//C
this.state = 48;
RDebugUtils.currentLine=23396412;
 //BA.debugLineNum = 23396412;BA.debugLine="motivo = \"CERRADO\"";
__ref._motivo /*String*/  = "CERRADO";
 if (true) break;

case 43:
//C
this.state = 48;
RDebugUtils.currentLine=23396414;
 //BA.debugLineNum = 23396414;BA.debugLine="motivo = \"NO PIDIO\"";
__ref._motivo /*String*/  = "NO PIDIO";
 if (true) break;

case 45:
//C
this.state = 48;
RDebugUtils.currentLine=23396416;
 //BA.debugLineNum = 23396416;BA.debugLine="motivo = \"CANCELA\"";
__ref._motivo /*String*/  = "CANCELA";
 if (true) break;

case 47:
//C
this.state = 48;
RDebugUtils.currentLine=23396418;
 //BA.debugLineNum = 23396418;BA.debugLine="motivo = \"NO ESTA EL ENCARGADO\"";
__ref._motivo /*String*/  = "NO ESTA EL ENCARGADO";
 if (true) break;

case 48:
//C
this.state = 49;
;
RDebugUtils.currentLine=23396420;
 //BA.debugLineNum = 23396420;BA.debugLine="Printer1.WriteString(motivo &  CRLF)";
__ref._printer1 /*reparto_izca.keymon.lat.escposprinter*/ ._writestring /*String*/ (null,__ref._motivo /*String*/ +parent.__c.CRLF);
RDebugUtils.currentLine=23396424;
 //BA.debugLineNum = 23396424;BA.debugLine="Printer1.WriteString(\" \" &  CRLF)";
__ref._printer1 /*reparto_izca.keymon.lat.escposprinter*/ ._writestring /*String*/ (null," "+parent.__c.CRLF);
RDebugUtils.currentLine=23396425;
 //BA.debugLineNum = 23396425;BA.debugLine="Printer1.WriteString(\"--------INFORMATIVO--------";
__ref._printer1 /*reparto_izca.keymon.lat.escposprinter*/ ._writestring /*String*/ (null,"--------INFORMATIVO-----------"+parent.__c.CRLF);
RDebugUtils.currentLine=23396426;
 //BA.debugLineNum = 23396426;BA.debugLine="Printer1.WriteString(\"---------------------------";
__ref._printer1 /*reparto_izca.keymon.lat.escposprinter*/ ._writestring /*String*/ (null,"------------------------------"+parent.__c.CRLF);
RDebugUtils.currentLine=23396427;
 //BA.debugLineNum = 23396427;BA.debugLine="Printer1.WriteString(\" \" &  CRLF)";
__ref._printer1 /*reparto_izca.keymon.lat.escposprinter*/ ._writestring /*String*/ (null," "+parent.__c.CRLF);
RDebugUtils.currentLine=23396428;
 //BA.debugLineNum = 23396428;BA.debugLine="Printer1.WriteString(\" \" &  CRLF)";
__ref._printer1 /*reparto_izca.keymon.lat.escposprinter*/ ._writestring /*String*/ (null," "+parent.__c.CRLF);
RDebugUtils.currentLine=23396429;
 //BA.debugLineNum = 23396429;BA.debugLine="Printer1.WriteString(\" \" &  CRLF)";
__ref._printer1 /*reparto_izca.keymon.lat.escposprinter*/ ._writestring /*String*/ (null," "+parent.__c.CRLF);
RDebugUtils.currentLine=23396430;
 //BA.debugLineNum = 23396430;BA.debugLine="Sleep(1000)";
parent.__c.Sleep(ba,new anywheresoftware.b4a.shell.DebugResumableSub.DelegatableResumableSub(this, "c_noventa", "b_imp_click"),(int) (1000));
this.state = 59;
return;
case 59:
//C
this.state = 49;
;
RDebugUtils.currentLine=23396431;
 //BA.debugLineNum = 23396431;BA.debugLine="Printer1.DisConnect";
__ref._printer1 /*reparto_izca.keymon.lat.escposprinter*/ ._disconnect /*String*/ (null);
RDebugUtils.currentLine=23396433;
 //BA.debugLineNum = 23396433;BA.debugLine="ProgressDialogHide";
parent.__c.ProgressDialogHide();
RDebugUtils.currentLine=23396435;
 //BA.debugLineNum = 23396435;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);
RDebugUtils.currentLine=23396436;
 //BA.debugLineNum = 23396436;BA.debugLine="Wait For Msgbox_Result (resultado As Int)";
parent.__c.WaitFor("msgbox_result", ba, new anywheresoftware.b4a.shell.DebugResumableSub.DelegatableResumableSub(this, "c_noventa", "b_imp_click"), null);
this.state = 60;
return;
case 60:
//C
this.state = 49;
_resultado = (Integer) result[1];
;
RDebugUtils.currentLine=23396437;
 //BA.debugLineNum = 23396437;BA.debugLine="If resultado = DialogResponse.POSITIVE Then";
if (true) break;

case 49:
//if
this.state = 54;
if (_resultado==parent.__c.DialogResponse.POSITIVE) { 
this.state = 51;
}else {
this.state = 53;
}if (true) break;

case 51:
//C
this.state = 54;
RDebugUtils.currentLine=23396438;
 //BA.debugLineNum = 23396438;BA.debugLine="B_IMP_Click";
__ref._b_imp_click /*void*/ (null);
 if (true) break;

case 53:
//C
this.state = 54;
RDebugUtils.currentLine=23396440;
 //BA.debugLineNum = 23396440;BA.debugLine="Guardado";
__ref._guardado /*String*/ (null);
 if (true) break;

case 54:
//C
this.state = -1;
;
RDebugUtils.currentLine=23396442;
 //BA.debugLineNum = 23396442;BA.debugLine="End Sub";
if (true) break;

            }
        }
    }
}
public String  _guardado(reparto_izca.keymon.lat.c_noventa __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_noventa";
if (Debug.shouldDelegate(ba, "guardado", false))
	 {return ((String) Debug.delegate(ba, "guardado", null));}
String _rutaactualizar = "";
anywheresoftware.b4a.sql.SQL.CursorWrapper _rut = null;
String _estecliente = "";
anywheresoftware.b4a.sql.SQL.CursorWrapper _rv = null;
int _i2 = 0;
int _i = 0;
String _ruta = "";
String _rutapre = "";
String _fechaprev = "";
RDebugUtils.currentLine=23461888;
 //BA.debugLineNum = 23461888;BA.debugLine="Sub Guardado";
RDebugUtils.currentLine=23461890;
 //BA.debugLineNum = 23461890;BA.debugLine="If r_1.Checked Then";
if (__ref._r_1 /*anywheresoftware.b4a.objects.CompoundButtonWrapper.RadioButtonWrapper*/ .getChecked()) { 
RDebugUtils.currentLine=23461891;
 //BA.debugLineNum = 23461891;BA.debugLine="motivo = \"CERRADO\"";
__ref._motivo /*String*/  = "CERRADO";
 }else 
{RDebugUtils.currentLine=23461892;
 //BA.debugLineNum = 23461892;BA.debugLine="Else If r_2.Checked Then";
if (__ref._r_2 /*anywheresoftware.b4a.objects.CompoundButtonWrapper.RadioButtonWrapper*/ .getChecked()) { 
RDebugUtils.currentLine=23461893;
 //BA.debugLineNum = 23461893;BA.debugLine="motivo = \"NO PIDIO\"";
__ref._motivo /*String*/  = "NO PIDIO";
 }else 
{RDebugUtils.currentLine=23461894;
 //BA.debugLineNum = 23461894;BA.debugLine="Else If r_3.Checked Then";
if (__ref._r_3 /*anywheresoftware.b4a.objects.CompoundButtonWrapper.RadioButtonWrapper*/ .getChecked()) { 
RDebugUtils.currentLine=23461895;
 //BA.debugLineNum = 23461895;BA.debugLine="motivo = \"CANCELA\"";
__ref._motivo /*String*/  = "CANCELA";
 }else {
RDebugUtils.currentLine=23461897;
 //BA.debugLineNum = 23461897;BA.debugLine="motivo = \"NO ESTA EL ENCARGADO\"";
__ref._motivo /*String*/  = "NO ESTA EL ENCARGADO";
 }}}
;
RDebugUtils.currentLine=23461900;
 //BA.debugLineNum = 23461900;BA.debugLine="If motivo <> \"CERRADO\"  Or motivo = \"CERRADO\" The";
if ((__ref._motivo /*String*/ ).equals("CERRADO") == false || (__ref._motivo /*String*/ ).equals("CERRADO")) { 
RDebugUtils.currentLine=23461901;
 //BA.debugLineNum = 23461901;BA.debugLine="DateTime.DateFormat = \"MM/dd/yyyy\"";
__c.DateTime.setDateFormat("MM/dd/yyyy");
RDebugUtils.currentLine=23461902;
 //BA.debugLineNum = 23461902;BA.debugLine="DateTime.TimeFormat=\"HHmmss\"";
__c.DateTime.setTimeFormat("HHmmss");
RDebugUtils.currentLine=23461903;
 //BA.debugLineNum = 23461903;BA.debugLine="sDate=DateTime.Date(DateTime.Now)";
__ref._sdate /*String*/  = __c.DateTime.Date(__c.DateTime.getNow());
RDebugUtils.currentLine=23461904;
 //BA.debugLineNum = 23461904;BA.debugLine="sTime=DateTime.Time(DateTime.Now)";
__ref._stime /*String*/  = __c.DateTime.Time(__c.DateTime.getNow());
RDebugUtils.currentLine=23461905;
 //BA.debugLineNum = 23461905;BA.debugLine="c=Starter.skmt.ExecQuery(\"select CUENTA from cue";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/  = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select CUENTA from cuentaa")));
RDebugUtils.currentLine=23461906;
 //BA.debugLineNum = 23461906;BA.debugLine="c.Position = 0";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition((int) (0));
RDebugUtils.currentLine=23461907;
 //BA.debugLineNum = 23461907;BA.debugLine="cuenta = c.GetString(\"CUENTA\")";
__ref._cuenta /*String*/  = __ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CUENTA");
RDebugUtils.currentLine=23461908;
 //BA.debugLineNum = 23461908;BA.debugLine="c=Starter.skmt.ExecQuery(\"select usuario from us";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/  = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select usuario from usuarioa")));
RDebugUtils.currentLine=23461909;
 //BA.debugLineNum = 23461909;BA.debugLine="c.Position = 0";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition((int) (0));
RDebugUtils.currentLine=23461910;
 //BA.debugLineNum = 23461910;BA.debugLine="usuario = c.GetString(\"USUARIO\")";
__ref._usuario /*String*/  = __ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("USUARIO");
RDebugUtils.currentLine=23461911;
 //BA.debugLineNum = 23461911;BA.debugLine="c.Close";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .Close();
RDebugUtils.currentLine=23461912;
 //BA.debugLineNum = 23461912;BA.debugLine="Dim rutaactualizar As String";
_rutaactualizar = "";
RDebugUtils.currentLine=23461913;
 //BA.debugLineNum = 23461913;BA.debugLine="Dim rut As Cursor = Starter.skmt.ExecQuery(\"SELE";
_rut = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_rut = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("SELECT CAT_CL_RUTA FROM kmt_info WHERE CAT_CL_CODIGO IN (SELECT CUENTA FROM CUENTAA)")));
RDebugUtils.currentLine=23461914;
 //BA.debugLineNum = 23461914;BA.debugLine="If rut.RowCount > 0 Then";
if (_rut.getRowCount()>0) { 
RDebugUtils.currentLine=23461915;
 //BA.debugLineNum = 23461915;BA.debugLine="rut.Position = 0";
_rut.setPosition((int) (0));
RDebugUtils.currentLine=23461916;
 //BA.debugLineNum = 23461916;BA.debugLine="rutaactualizar = rut.GetString(\"CAT_CL_RUTA\")";
_rutaactualizar = _rut.GetString("CAT_CL_RUTA");
 };
RDebugUtils.currentLine=23461918;
 //BA.debugLineNum = 23461918;BA.debugLine="Starter.skmt.ExecNonQuery($\"DELETE FROM NOVENTA";
_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("DELETE FROM NOVENTA WHERE NV_CLIENTE IN (select cuenta from cuentaa) AND NV_RUTA ='"+__c.SmartStringFormatter("",(Object)(_rutaactualizar))+"' "));
RDebugUtils.currentLine=23461920;
 //BA.debugLineNum = 23461920;BA.debugLine="c=Starter.skmt.ExecQuery(\"select HVD_NUM_REGISTR";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/  = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select HVD_NUM_REGISTRO, HVD_CLIENTE, HVD_PRONOMBRE, HVD_CANT, HVD_COSTO_TOT, HVD_FECHA, HVD_PROID, CAT_GP_PRECIO from HIST_VENTAS2 join CAT_GUNAPROD on CAT_GP_ID = HVD_PROID WHERE HVD_CLIENTE IN (Select CUENTA from cuentaa) order by HVD_PRONOMBRE asc")));
RDebugUtils.currentLine=23461921;
 //BA.debugLineNum = 23461921;BA.debugLine="If c.RowCount > 0 Then 'Si  hay pedido en HIST_V";
if (__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .getRowCount()>0) { 
RDebugUtils.currentLine=23461924;
 //BA.debugLineNum = 23461924;BA.debugLine="Private esteCliente As String = Subs.traeClient";
_estecliente = _subs._traecliente /*String*/ (ba);
RDebugUtils.currentLine=23461925;
 //BA.debugLineNum = 23461925;BA.debugLine="Private rv As Cursor = Starter.skmt.ExecQuery($";
_rv = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_rv = (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 REPARTO where REP_CLIENTE = '"+__c.SmartStringFormatter("",(Object)(_estecliente))+"' and REP_CLI_ORIG <> '"+__c.SmartStringFormatter("",(Object)(_estecliente))+"' and REP_RECHAZO = 0"))));
RDebugUtils.currentLine=23461926;
 //BA.debugLineNum = 23461926;BA.debugLine="If rv.RowCount > 0 Then 'Si tenemos venta en el";
if (_rv.getRowCount()>0) { 
RDebugUtils.currentLine=23461927;
 //BA.debugLineNum = 23461927;BA.debugLine="For i2=0 To rv.RowCount - 1";
{
final int step34 = 1;
final int limit34 = (int) (_rv.getRowCount()-1);
_i2 = (int) (0) ;
for (;_i2 <= limit34 ;_i2 = _i2 + step34 ) {
RDebugUtils.currentLine=23461928;
 //BA.debugLineNum = 23461928;BA.debugLine="rv.Position = i2";
_rv.setPosition(_i2);
RDebugUtils.currentLine=23461929;
 //BA.debugLineNum = 23461929;BA.debugLine="Log($\"Actualizamos REPARTO - cliente=${rv.Get";
__c.LogImpl("823461929",("Actualizamos REPARTO - cliente="+__c.SmartStringFormatter("",(Object)(_rv.GetString("REP_CLIENTE")))+", cliente orignal="+__c.SmartStringFormatter("",(Object)(_rv.GetString("REP_CLI_ORIG")))+", le agregamos "+__c.SmartStringFormatter("",(Object)(_rv.GetString("REP_CANT")))+""),0);
RDebugUtils.currentLine=23461930;
 //BA.debugLineNum = 23461930;BA.debugLine="Starter.skmt.ExecNonQuery($\"update REPARTO se";
_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("update REPARTO set REP_CANT = REP_CANT + "+__c.SmartStringFormatter("",(Object)(_rv.GetString("REP_CANT")))+" where REP_RECHAZO = '1' and REP_CLIENTE = '"+__c.SmartStringFormatter("",(Object)(_rv.GetString("REP_CLI_ORIG")))+"' and REP_CLI_ORIG = '"+__c.SmartStringFormatter("",(Object)(_rv.GetString("REP_CLI_ORIG")))+"'"));
 }
};
 };
RDebugUtils.currentLine=23461934;
 //BA.debugLineNum = 23461934;BA.debugLine="Starter.skmt.ExecNonQuery(\"delete from reparto";
_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("delete from reparto where REP_CLIENTE IN (Select CUENTA from cuentaa)");
RDebugUtils.currentLine=23461935;
 //BA.debugLineNum = 23461935;BA.debugLine="For i=0 To c.RowCount - 1 'Insertamos los produ";
{
final int step41 = 1;
final int limit41 = (int) (__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .getRowCount()-1);
_i = (int) (0) ;
for (;_i <= limit41 ;_i = _i + step41 ) {
RDebugUtils.currentLine=23461936;
 //BA.debugLineNum = 23461936;BA.debugLine="c.Position=i";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition(_i);
RDebugUtils.currentLine=23461937;
 //BA.debugLineNum = 23461937;BA.debugLine="Log($\"REGISTRO= ${c.GetString(\"HVD_NUM_REGISTR";
__c.LogImpl("823461937",("REGISTRO= "+__c.SmartStringFormatter("",(Object)(__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("HVD_NUM_REGISTRO")))+""),0);
RDebugUtils.currentLine=23461938;
 //BA.debugLineNum = 23461938;BA.debugLine="Starter.skmt.ExecNonQuery2(\"insert into repart";
_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("insert into reparto(REP_CLIENTE, REP_PRONOMBRE, REP_CANT, REP_COSTO_TOT, REP_FECHA, REP_RECHAZO, REP_PRODID, REP_PRECIO, REP_PRODREGISTRO, REP_CLI_ORIG) VALUES (?,?,?,?,?,1,?,?,?,?) ",anywheresoftware.b4a.keywords.Common.ArrayToList(new String[]{__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("HVD_CLIENTE"),__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("HVD_PRONOMBRE"),__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("HVD_CANT"),__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("HVD_COSTO_TOT"),__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("HVD_FECHA"),__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("HVD_PROID"),__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CAT_GP_PRECIO"),__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("HVD_NUM_REGISTRO"),__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("HVD_CLIENTE")}));
RDebugUtils.currentLine=23461939;
 //BA.debugLineNum = 23461939;BA.debugLine="Starter.skmt.ExecNonQuery2(\"insert into repart";
_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("insert into reparto(REP_CLIENTE, REP_PRONOMBRE, REP_CANT, REP_COSTO_TOT, REP_FECHA, REP_RECHAZO, REP_PRODID, REP_PRECIO, REP_PRODREGISTRO, REP_CLI_ORIG) VALUES (?,?,?,?,?,0,?,?,?,?) ",anywheresoftware.b4a.keywords.Common.ArrayToList(new String[]{__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("HVD_CLIENTE"),__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("HVD_PRONOMBRE"),BA.NumberToString(0),__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("HVD_COSTO_TOT"),__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("HVD_FECHA"),__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("HVD_PROID"),__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CAT_GP_PRECIO"),__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("HVD_NUM_REGISTRO"),__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("HVD_CLIENTE")}));
RDebugUtils.currentLine=23461940;
 //BA.debugLineNum = 23461940;BA.debugLine="Starter.skmt.ExecNonQuery2(\"update cat_gunapro";
_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("update cat_gunaprod set cat_gp_almacen = cat_gp_almacen + ? where cat_gp_nombre = ?",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("HVD_CANT")),(Object)(__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("HVD_PRONOMBRE"))}));
 }
};
 };
RDebugUtils.currentLine=23461944;
 //BA.debugLineNum = 23461944;BA.debugLine="Starter.skmt.ExecNonQuery2(\"INSERT INTO NOVENTA";
_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("INSERT INTO NOVENTA (NV_CLIENTE,NV_FECHA,NV_USER,NV_MOTIVO,NV_COMM,NV_LAT,NV_LON,NV_FOTO,NV_REPROGRAMAR) VALUES(?,?,?,?,?,?,?,?,?) ",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(__ref._cuenta /*String*/ ),(Object)(__ref._sdate /*String*/ +__ref._stime /*String*/ ),(Object)(__ref._usuario /*String*/ ),(Object)(__ref._motivo /*String*/ ),(Object)(__ref._e_comm /*anywheresoftware.b4a.objects.EditTextWrapper*/ .getText()),(Object)(_b4xpages._mainpage /*reparto_izca.keymon.lat.b4xmainpage*/ (ba)._lat_gps /*String*/ ),(Object)(_b4xpages._mainpage /*reparto_izca.keymon.lat.b4xmainpage*/ (ba)._lon_gps /*String*/ ),(Object)(_rutaactualizar),(Object)(__ref._reprogramar /*int*/ )}));
RDebugUtils.currentLine=23461945;
 //BA.debugLineNum = 23461945;BA.debugLine="Starter.skmt.ExecNonQuery($\"UPDATE kmt_info set";
_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("UPDATE kmt_info set gestion = 3, HORAENT = '"+__c.SmartStringFormatter("",(Object)(__ref._sdate /*String*/ +" "+__ref._stime /*String*/ ))+"' where CAT_CL_CODIGO In (select cuenta from cuentaa) and CAT_CL_RUTA = '"+__c.SmartStringFormatter("",(Object)(_rutaactualizar))+"'"));
RDebugUtils.currentLine=23461946;
 //BA.debugLineNum = 23461946;BA.debugLine="Starter.skmt.ExecNonQuery(\"update HIST_VENTAS SE";
_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("update HIST_VENTAS SET HVD_RECHAZO = 1, HVD_RECHAZOCANT = HVD_CANT, HVD_RECHAZOCANTC = CANTC, BCAJAS = 0 , CANTC = 0 WHERE HVD_CLIENTE IN (SELECT CUENTA FROM CUENTAA)");
RDebugUtils.currentLine=23461947;
 //BA.debugLineNum = 23461947;BA.debugLine="Starter.skmt.ExecNonQuery($\"update HIST_VENTAS s";
_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("update HIST_VENTAS set HVD_RECHAZO = 2,  HVD_RECHAZOCANT = HVD_RECHAZOCANT  WHERE HVD_PROID = HVD_CODPROMO and HVD_CLIENTE in (Select CUENTA from cuentaa)"));
RDebugUtils.currentLine=23461948;
 //BA.debugLineNum = 23461948;BA.debugLine="Starter.skmt.ExecNonQuery(\"DELETE FROM PEDIDO WH";
_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("DELETE FROM PEDIDO WHERE PE_CLIENTE IN (SELECT CUENTA FROM CUENTAA)");
RDebugUtils.currentLine=23461949;
 //BA.debugLineNum = 23461949;BA.debugLine="d = Starter.skmt.ExecQuery(\"SELECT RUTAA FROM RU";
__ref._d /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/  = (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 RUTAA FROM RUTAA")));
RDebugUtils.currentLine=23461950;
 //BA.debugLineNum = 23461950;BA.debugLine="d.Position = 0";
__ref._d /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition((int) (0));
RDebugUtils.currentLine=23461951;
 //BA.debugLineNum = 23461951;BA.debugLine="Dim ruta As String = d.GetString(\"RUTAA\")";
_ruta = __ref._d /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("RUTAA");
RDebugUtils.currentLine=23461952;
 //BA.debugLineNum = 23461952;BA.debugLine="d.Close";
__ref._d /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .Close();
RDebugUtils.currentLine=23461953;
 //BA.debugLineNum = 23461953;BA.debugLine="d = Starter.skmt.ExecQuery(\"SELECT CAT_CL_RUTA F";
__ref._d /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/  = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("SELECT CAT_CL_RUTA FROM kmt_info WHERE CAT_CL_CODIGO IN (SELECT CUENTA FROM CUENTAA)")));
RDebugUtils.currentLine=23461954;
 //BA.debugLineNum = 23461954;BA.debugLine="d.Position = 0";
__ref._d /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition((int) (0));
RDebugUtils.currentLine=23461955;
 //BA.debugLineNum = 23461955;BA.debugLine="Dim rutapre As String = d.GetString(\"CAT_CL_RUTA";
_rutapre = __ref._d /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CAT_CL_RUTA");
RDebugUtils.currentLine=23461956;
 //BA.debugLineNum = 23461956;BA.debugLine="d.Close";
__ref._d /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .Close();
RDebugUtils.currentLine=23461957;
 //BA.debugLineNum = 23461957;BA.debugLine="d = Starter.skmt.ExecQuery(\"SELECT HVD_FECHA FRO";
__ref._d /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/  = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("SELECT HVD_FECHA FROM HIST_VENTAS WHERE HVD_CLIENTE IN (SELECT CUENTA FROM CUENTAA)")));
RDebugUtils.currentLine=23461958;
 //BA.debugLineNum = 23461958;BA.debugLine="d.Position = 0";
__ref._d /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition((int) (0));
RDebugUtils.currentLine=23461959;
 //BA.debugLineNum = 23461959;BA.debugLine="Dim fechaprev As String = d.GetString(\"HVD_FECHA";
_fechaprev = __ref._d /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("HVD_FECHA");
RDebugUtils.currentLine=23461960;
 //BA.debugLineNum = 23461960;BA.debugLine="d.Close";
__ref._d /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .Close();
RDebugUtils.currentLine=23461961;
 //BA.debugLineNum = 23461961;BA.debugLine="d = Starter.skmt.ExecQuery(\"SELECT CUENTA FROM C";
__ref._d /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/  = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("SELECT CUENTA FROM CUENTAA")));
RDebugUtils.currentLine=23461962;
 //BA.debugLineNum = 23461962;BA.debugLine="d.Position = 0";
__ref._d /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition((int) (0));
RDebugUtils.currentLine=23461963;
 //BA.debugLineNum = 23461963;BA.debugLine="Starter.skmt.ExecNonQuery2(\"INSERT INTO REPARTO_";
_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("INSERT INTO REPARTO_GEO (CLIENTE, USUARIO, FECHA_PUNTEO, LATITUD, LONGITUD, ALMACEN, RUTA_REPARTO, RUTA_PREV, FECHA_PREVENTA, MOTIVO, COMENTARIO,TIPO,ENVIO) VALUES(?,?,?,?,?,?,?,?,?,?,?,?,0)",anywheresoftware.b4a.keywords.Common.ArrayToList(new String[]{__ref._cuenta /*String*/ ,__ref._usuario /*String*/ ,__ref._sdate /*String*/ +" "+__ref._stime /*String*/ ,_b4xpages._mainpage /*reparto_izca.keymon.lat.b4xmainpage*/ (ba)._lat_gps /*String*/ ,_b4xpages._mainpage /*reparto_izca.keymon.lat.b4xmainpage*/ (ba)._lon_gps /*String*/ ,_b4xpages._mainpage /*reparto_izca.keymon.lat.b4xmainpage*/ (ba)._almacen /*String*/ ,_ruta,_rutapre,_fechaprev,__ref._motivo /*String*/ ,__ref._e_comm /*anywheresoftware.b4a.objects.EditTextWrapper*/ .getText(),"NO ENTREGADO"}));
RDebugUtils.currentLine=23461970;
 //BA.debugLineNum = 23461970;BA.debugLine="B4XPages.ShowPage(\"Principal\")";
_b4xpages._showpage /*String*/ (ba,"Principal");
 }else {
RDebugUtils.currentLine=23461973;
 //BA.debugLineNum = 23461973;BA.debugLine="COMENTARIO = e_comm.Text";
__ref._comentario /*String*/  = __ref._e_comm /*anywheresoftware.b4a.objects.EditTextWrapper*/ .getText();
 };
RDebugUtils.currentLine=23461978;
 //BA.debugLineNum = 23461978;BA.debugLine="End Sub";
return "";
}
public String  _b4xpage_appear(reparto_izca.keymon.lat.c_noventa __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_noventa";
if (Debug.shouldDelegate(ba, "b4xpage_appear", false))
	 {return ((String) Debug.delegate(ba, "b4xpage_appear", null));}
RDebugUtils.currentLine=22937600;
 //BA.debugLineNum = 22937600;BA.debugLine="Sub B4XPage_Appear";
RDebugUtils.currentLine=22937601;
 //BA.debugLineNum = 22937601;BA.debugLine="Printer1.Initialize(Me, \"Printer1\")";
__ref._printer1 /*reparto_izca.keymon.lat.escposprinter*/ ._initialize /*String*/ (null,ba,this,"Printer1");
RDebugUtils.currentLine=22937603;
 //BA.debugLineNum = 22937603;BA.debugLine="If Printer1.IsConnected = False Then";
if (__ref._printer1 /*reparto_izca.keymon.lat.escposprinter*/ ._isconnected /*boolean*/ (null)==__c.False) { 
 }else {
RDebugUtils.currentLine=22937607;
 //BA.debugLineNum = 22937607;BA.debugLine="Printer1.DisConnect";
__ref._printer1 /*reparto_izca.keymon.lat.escposprinter*/ ._disconnect /*String*/ (null);
RDebugUtils.currentLine=22937608;
 //BA.debugLineNum = 22937608;BA.debugLine="Printer1.Connect";
__ref._printer1 /*reparto_izca.keymon.lat.escposprinter*/ ._connect /*boolean*/ (null);
RDebugUtils.currentLine=22937609;
 //BA.debugLineNum = 22937609;BA.debugLine="Log(\"2\")";
__c.LogImpl("822937609","2",0);
 };
RDebugUtils.currentLine=22937611;
 //BA.debugLineNum = 22937611;BA.debugLine="btAdmin.Initialize(\"BlueTeeth\")";
__ref._btadmin /*anywheresoftware.b4a.objects.Serial.BluetoothAdmin*/ .Initialize(ba,"BlueTeeth");
RDebugUtils.currentLine=22937612;
 //BA.debugLineNum = 22937612;BA.debugLine="cmp20.Initialize(\"Printer\")";
__ref._cmp20 /*anywheresoftware.b4a.objects.Serial*/ .Initialize("Printer");
RDebugUtils.currentLine=22937614;
 //BA.debugLineNum = 22937614;BA.debugLine="reqManager.Initialize(Me, B4XPages.MainPage.SERVE";
__ref._reqmanager /*reparto_izca.keymon.lat.dbrequestmanager*/ ._initialize /*String*/ (null,ba,this,_b4xpages._mainpage /*reparto_izca.keymon.lat.b4xmainpage*/ (ba)._server /*String*/ );
RDebugUtils.currentLine=22937615;
 //BA.debugLineNum = 22937615;BA.debugLine="e_comm.Text=\"\"";
__ref._e_comm /*anywheresoftware.b4a.objects.EditTextWrapper*/ .setText(BA.ObjectToCharSequence(""));
RDebugUtils.currentLine=22937616;
 //BA.debugLineNum = 22937616;BA.debugLine="r_1.Checked = False";
__ref._r_1 /*anywheresoftware.b4a.objects.CompoundButtonWrapper.RadioButtonWrapper*/ .setChecked(__c.False);
RDebugUtils.currentLine=22937617;
 //BA.debugLineNum = 22937617;BA.debugLine="r_2.Checked = False";
__ref._r_2 /*anywheresoftware.b4a.objects.CompoundButtonWrapper.RadioButtonWrapper*/ .setChecked(__c.False);
RDebugUtils.currentLine=22937618;
 //BA.debugLineNum = 22937618;BA.debugLine="r_3.Checked = False";
__ref._r_3 /*anywheresoftware.b4a.objects.CompoundButtonWrapper.RadioButtonWrapper*/ .setChecked(__c.False);
RDebugUtils.currentLine=22937619;
 //BA.debugLineNum = 22937619;BA.debugLine="r_4.Checked = False";
__ref._r_4 /*anywheresoftware.b4a.objects.CompoundButtonWrapper.RadioButtonWrapper*/ .setChecked(__c.False);
RDebugUtils.currentLine=22937620;
 //BA.debugLineNum = 22937620;BA.debugLine="cb_reprogramar.Checked = False";
__ref._cb_reprogramar /*anywheresoftware.b4a.objects.CompoundButtonWrapper.CheckBoxWrapper*/ .setChecked(__c.False);
RDebugUtils.currentLine=22937621;
 //BA.debugLineNum = 22937621;BA.debugLine="End Sub";
return "";
}
public String  _b4xpage_created(reparto_izca.keymon.lat.c_noventa __ref,anywheresoftware.b4a.objects.B4XViewWrapper _root1) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_noventa";
if (Debug.shouldDelegate(ba, "b4xpage_created", false))
	 {return ((String) Debug.delegate(ba, "b4xpage_created", new Object[] {_root1}));}
RDebugUtils.currentLine=22872064;
 //BA.debugLineNum = 22872064;BA.debugLine="Private Sub B4XPage_Created (Root1 As B4XView)";
RDebugUtils.currentLine=22872065;
 //BA.debugLineNum = 22872065;BA.debugLine="Root = Root1";
__ref._root /*anywheresoftware.b4a.objects.B4XViewWrapper*/  = _root1;
RDebugUtils.currentLine=22872067;
 //BA.debugLineNum = 22872067;BA.debugLine="Root.LoadLayout(\"no_venta\")";
__ref._root /*anywheresoftware.b4a.objects.B4XViewWrapper*/ .LoadLayout("no_venta",ba);
RDebugUtils.currentLine=22872068;
 //BA.debugLineNum = 22872068;BA.debugLine="reqManager.Initialize(Me, B4XPages.MainPage.SERVE";
__ref._reqmanager /*reparto_izca.keymon.lat.dbrequestmanager*/ ._initialize /*String*/ (null,ba,this,_b4xpages._mainpage /*reparto_izca.keymon.lat.b4xmainpage*/ (ba)._server /*String*/ );
RDebugUtils.currentLine=22872069;
 //BA.debugLineNum = 22872069;BA.debugLine="End Sub";
return "";
}
public String  _cancela_click(reparto_izca.keymon.lat.c_noventa __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_noventa";
if (Debug.shouldDelegate(ba, "cancela_click", false))
	 {return ((String) Debug.delegate(ba, "cancela_click", null));}
RDebugUtils.currentLine=23068672;
 //BA.debugLineNum = 23068672;BA.debugLine="Sub CANCELA_Click";
RDebugUtils.currentLine=23068673;
 //BA.debugLineNum = 23068673;BA.debugLine="B4XPages.ShowPage(\"Cliente\")";
_b4xpages._showpage /*String*/ (ba,"Cliente");
RDebugUtils.currentLine=23068674;
 //BA.debugLineNum = 23068674;BA.debugLine="End Sub";
return "";
}
public String  _cb_reprogramar_checkedchange(reparto_izca.keymon.lat.c_noventa __ref,boolean _checked) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_noventa";
if (Debug.shouldDelegate(ba, "cb_reprogramar_checkedchange", false))
	 {return ((String) Debug.delegate(ba, "cb_reprogramar_checkedchange", new Object[] {_checked}));}
RDebugUtils.currentLine=23330816;
 //BA.debugLineNum = 23330816;BA.debugLine="Private Sub cb_reprogramar_CheckedChange(Checked A";
RDebugUtils.currentLine=23330817;
 //BA.debugLineNum = 23330817;BA.debugLine="If Checked Then";
if (_checked) { 
RDebugUtils.currentLine=23330818;
 //BA.debugLineNum = 23330818;BA.debugLine="reprogramar = 1";
__ref._reprogramar /*int*/  = (int) (1);
 }else {
RDebugUtils.currentLine=23330820;
 //BA.debugLineNum = 23330820;BA.debugLine="reprogramar = 0";
__ref._reprogramar /*int*/  = (int) (0);
 };
RDebugUtils.currentLine=23330822;
 //BA.debugLineNum = 23330822;BA.debugLine="End Sub";
return "";
}
public String  _class_globals(reparto_izca.keymon.lat.c_noventa __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_noventa";
RDebugUtils.currentLine=22740992;
 //BA.debugLineNum = 22740992;BA.debugLine="Sub Class_Globals";
RDebugUtils.currentLine=22740993;
 //BA.debugLineNum = 22740993;BA.debugLine="Private Root As B4XView 'ignore";
_root = new anywheresoftware.b4a.objects.B4XViewWrapper();
RDebugUtils.currentLine=22740994;
 //BA.debugLineNum = 22740994;BA.debugLine="Private xui As XUI 'ignore";
_xui = new anywheresoftware.b4a.objects.B4XViewWrapper.XUI();
RDebugUtils.currentLine=22740995;
 //BA.debugLineNum = 22740995;BA.debugLine="Dim g As GPS";
_g = new anywheresoftware.b4a.gps.GPS();
RDebugUtils.currentLine=22740996;
 //BA.debugLineNum = 22740996;BA.debugLine="Dim c As Cursor";
_c = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
RDebugUtils.currentLine=22740997;
 //BA.debugLineNum = 22740997;BA.debugLine="Dim COMENTARIO As String";
_comentario = "";
RDebugUtils.currentLine=22740998;
 //BA.debugLineNum = 22740998;BA.debugLine="Dim CANCELA As Button";
_cancela = new anywheresoftware.b4a.objects.ButtonWrapper();
RDebugUtils.currentLine=22740999;
 //BA.debugLineNum = 22740999;BA.debugLine="Dim GUARDA As Button";
_guarda = new anywheresoftware.b4a.objects.ButtonWrapper();
RDebugUtils.currentLine=22741000;
 //BA.debugLineNum = 22741000;BA.debugLine="Dim r_1 As RadioButton";
_r_1 = new anywheresoftware.b4a.objects.CompoundButtonWrapper.RadioButtonWrapper();
RDebugUtils.currentLine=22741001;
 //BA.debugLineNum = 22741001;BA.debugLine="Dim r_2 As RadioButton";
_r_2 = new anywheresoftware.b4a.objects.CompoundButtonWrapper.RadioButtonWrapper();
RDebugUtils.currentLine=22741002;
 //BA.debugLineNum = 22741002;BA.debugLine="Dim r_3 As RadioButton";
_r_3 = new anywheresoftware.b4a.objects.CompoundButtonWrapper.RadioButtonWrapper();
RDebugUtils.currentLine=22741003;
 //BA.debugLineNum = 22741003;BA.debugLine="Dim e_comm As EditText";
_e_comm = new anywheresoftware.b4a.objects.EditTextWrapper();
RDebugUtils.currentLine=22741004;
 //BA.debugLineNum = 22741004;BA.debugLine="Dim motivo As String";
_motivo = "";
RDebugUtils.currentLine=22741005;
 //BA.debugLineNum = 22741005;BA.debugLine="Dim cuenta As String";
_cuenta = "";
RDebugUtils.currentLine=22741006;
 //BA.debugLineNum = 22741006;BA.debugLine="Dim usuario As String";
_usuario = "";
RDebugUtils.currentLine=22741007;
 //BA.debugLineNum = 22741007;BA.debugLine="Dim sDate,sTime As String";
_sdate = "";
_stime = "";
RDebugUtils.currentLine=22741008;
 //BA.debugLineNum = 22741008;BA.debugLine="Dim r_4 As RadioButton";
_r_4 = new anywheresoftware.b4a.objects.CompoundButtonWrapper.RadioButtonWrapper();
RDebugUtils.currentLine=22741009;
 //BA.debugLineNum = 22741009;BA.debugLine="Private p_principal As Panel";
_p_principal = new anywheresoftware.b4a.objects.PanelWrapper();
RDebugUtils.currentLine=22741010;
 //BA.debugLineNum = 22741010;BA.debugLine="Dim d As Cursor";
_d = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
RDebugUtils.currentLine=22741011;
 //BA.debugLineNum = 22741011;BA.debugLine="Dim reqManager As DBRequestManager";
_reqmanager = new reparto_izca.keymon.lat.dbrequestmanager();
RDebugUtils.currentLine=22741012;
 //BA.debugLineNum = 22741012;BA.debugLine="Private cb_reprogramar As CheckBox";
_cb_reprogramar = new anywheresoftware.b4a.objects.CompoundButtonWrapper.CheckBoxWrapper();
RDebugUtils.currentLine=22741013;
 //BA.debugLineNum = 22741013;BA.debugLine="Dim reprogramar As Int = 0";
_reprogramar = (int) (0);
RDebugUtils.currentLine=22741014;
 //BA.debugLineNum = 22741014;BA.debugLine="Dim PASA_IMP As String";
_pasa_imp = "";
RDebugUtils.currentLine=22741015;
 //BA.debugLineNum = 22741015;BA.debugLine="Dim Printer1 As EscPosPrinter";
_printer1 = new reparto_izca.keymon.lat.escposprinter();
RDebugUtils.currentLine=22741016;
 //BA.debugLineNum = 22741016;BA.debugLine="Dim impresoraConectada As Boolean = False";
_impresoraconectada = __c.False;
RDebugUtils.currentLine=22741017;
 //BA.debugLineNum = 22741017;BA.debugLine="Dim errorImpresora As Int = 0";
_errorimpresora = (int) (0);
RDebugUtils.currentLine=22741018;
 //BA.debugLineNum = 22741018;BA.debugLine="Dim cmp20 As Serial";
_cmp20 = new anywheresoftware.b4a.objects.Serial();
RDebugUtils.currentLine=22741019;
 //BA.debugLineNum = 22741019;BA.debugLine="Dim btAdmin As BluetoothAdmin";
_btadmin = new anywheresoftware.b4a.objects.Serial.BluetoothAdmin();
RDebugUtils.currentLine=22741020;
 //BA.debugLineNum = 22741020;BA.debugLine="Dim printer As TextWriter";
_printer = new anywheresoftware.b4a.objects.streams.File.TextWriterWrapper();
RDebugUtils.currentLine=22741021;
 //BA.debugLineNum = 22741021;BA.debugLine="End Sub";
return "";
}
public String  _gps_locationchanged(reparto_izca.keymon.lat.c_noventa __ref,anywheresoftware.b4a.gps.LocationWrapper _location1) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_noventa";
if (Debug.shouldDelegate(ba, "gps_locationchanged", false))
	 {return ((String) Debug.delegate(ba, "gps_locationchanged", new Object[] {_location1}));}
RDebugUtils.currentLine=23003136;
 //BA.debugLineNum = 23003136;BA.debugLine="Sub GPS_LocationChanged (Location1 As Location)";
RDebugUtils.currentLine=23003139;
 //BA.debugLineNum = 23003139;BA.debugLine="End Sub";
return "";
}
public String  _guarda_click(reparto_izca.keymon.lat.c_noventa __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_noventa";
if (Debug.shouldDelegate(ba, "guarda_click", false))
	 {return ((String) Debug.delegate(ba, "guarda_click", null));}
RDebugUtils.currentLine=23134208;
 //BA.debugLineNum = 23134208;BA.debugLine="Sub GUARDA_Click";
RDebugUtils.currentLine=23134209;
 //BA.debugLineNum = 23134209;BA.debugLine="If r_1.Checked = False And r_2.Checked = False An";
if (__ref._r_1 /*anywheresoftware.b4a.objects.CompoundButtonWrapper.RadioButtonWrapper*/ .getChecked()==__c.False && __ref._r_2 /*anywheresoftware.b4a.objects.CompoundButtonWrapper.RadioButtonWrapper*/ .getChecked()==__c.False && __ref._r_3 /*anywheresoftware.b4a.objects.CompoundButtonWrapper.RadioButtonWrapper*/ .getChecked()==__c.False && __ref._r_4 /*anywheresoftware.b4a.objects.CompoundButtonWrapper.RadioButtonWrapper*/ .getChecked()==__c.False) { 
RDebugUtils.currentLine=23134210;
 //BA.debugLineNum = 23134210;BA.debugLine="MsgboxAsync(\"Selecciona un motivo de rechazo\",\"A";
__c.MsgboxAsync(BA.ObjectToCharSequence("Selecciona un motivo de rechazo"),BA.ObjectToCharSequence("Atención"),ba);
 }else {
RDebugUtils.currentLine=23134212;
 //BA.debugLineNum = 23134212;BA.debugLine="B_IMP_Click";
__ref._b_imp_click /*void*/ (null);
 };
RDebugUtils.currentLine=23134215;
 //BA.debugLineNum = 23134215;BA.debugLine="End Sub";
return "";
}
public String  _jobdone(reparto_izca.keymon.lat.c_noventa __ref,reparto_izca.keymon.lat.httpjob _job) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_noventa";
if (Debug.shouldDelegate(ba, "jobdone", false))
	 {return ((String) Debug.delegate(ba, "jobdone", new Object[] {_job}));}
reparto_izca.keymon.lat.dbrequestmanager._dbresult _resultado = null;
String _cliente = "";
Object[] _records = null;
String _k = "";
RDebugUtils.currentLine=23265280;
 //BA.debugLineNum = 23265280;BA.debugLine="Sub JobDone(Job As HttpJob)";
RDebugUtils.currentLine=23265281;
 //BA.debugLineNum = 23265281;BA.debugLine="Log(Job.Success)";
__c.LogImpl("823265281",BA.ObjectToString(_job._success /*boolean*/ ),0);
RDebugUtils.currentLine=23265282;
 //BA.debugLineNum = 23265282;BA.debugLine="If Job.Success = False Then";
if (_job._success /*boolean*/ ==__c.False) { 
 }else {
RDebugUtils.currentLine=23265285;
 //BA.debugLineNum = 23265285;BA.debugLine="LogColor(\"JobDone: '\" & reqManager.HandleJob(Job";
__c.LogImpl("823265285","JobDone: '"+BA.ObjectToString(__ref._reqmanager /*reparto_izca.keymon.lat.dbrequestmanager*/ ._handlejob /*reparto_izca.keymon.lat.dbrequestmanager._dbresult*/ (null,_job).Tag /*Object*/ )+"' - Registros: "+BA.NumberToString(__ref._reqmanager /*reparto_izca.keymon.lat.dbrequestmanager*/ ._handlejob /*reparto_izca.keymon.lat.dbrequestmanager._dbresult*/ (null,_job).Rows /*anywheresoftware.b4a.objects.collections.List*/ .getSize()),__c.Colors.Green);
RDebugUtils.currentLine=23265286;
 //BA.debugLineNum = 23265286;BA.debugLine="If Job.JobName = \"DBRequest\" Then";
if ((_job._jobname /*String*/ ).equals("DBRequest")) { 
RDebugUtils.currentLine=23265287;
 //BA.debugLineNum = 23265287;BA.debugLine="Dim resultado As DBResult = reqManager.HandleJo";
_resultado = __ref._reqmanager /*reparto_izca.keymon.lat.dbrequestmanager*/ ._handlejob /*reparto_izca.keymon.lat.dbrequestmanager._dbresult*/ (null,_job);
RDebugUtils.currentLine=23265288;
 //BA.debugLineNum = 23265288;BA.debugLine="If resultado.Tag.As(String).IndexOf(\"ins_REPART";
if ((BA.ObjectToString(_resultado.Tag /*Object*/ )).indexOf("ins_REPARTOPendientes_head_")>-1) { 
RDebugUtils.currentLine=23265289;
 //BA.debugLineNum = 23265289;BA.debugLine="Private cliente As String= resultado.Tag";
_cliente = BA.ObjectToString(_resultado.Tag /*Object*/ );
RDebugUtils.currentLine=23265290;
 //BA.debugLineNum = 23265290;BA.debugLine="cliente = cliente.SubString(cliente.IndexOf(\"_";
_cliente = _cliente.substring((int) (_cliente.indexOf("_")+24));
RDebugUtils.currentLine=23265291;
 //BA.debugLineNum = 23265291;BA.debugLine="Log($\"Cliente1:${cliente}\"$)";
__c.LogImpl("823265291",("Cliente1:"+__c.SmartStringFormatter("",(Object)(_cliente))+""),0);
RDebugUtils.currentLine=23265292;
 //BA.debugLineNum = 23265292;BA.debugLine="Starter.skmt.ExecNonQuery2(\"update REPARTO_GEO";
_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("update REPARTO_GEO SET ENVIO = ? WHERE CLIENTE = ? AND ENVIO <> ?",anywheresoftware.b4a.keywords.Common.ArrayToList(new String[]{"1",_cliente,"1"}));
RDebugUtils.currentLine=23265293;
 //BA.debugLineNum = 23265293;BA.debugLine="For Each records() As Object In resultado.Rows";
{
final anywheresoftware.b4a.BA.IterableList group12 = _resultado.Rows /*anywheresoftware.b4a.objects.collections.List*/ ;
final int groupLen12 = group12.getSize()
;int index12 = 0;
;
for (; index12 < groupLen12;index12++){
_records = (Object[])(group12.Get(index12));
RDebugUtils.currentLine=23265294;
 //BA.debugLineNum = 23265294;BA.debugLine="For Each k As String In resultado.Columns.Key";
{
final anywheresoftware.b4a.BA.IterableList group13 = _resultado.Columns /*anywheresoftware.b4a.objects.collections.Map*/ .Keys();
final int groupLen13 = group13.getSize()
;int index13 = 0;
;
for (; index13 < groupLen13;index13++){
_k = BA.ObjectToString(group13.Get(index13));
RDebugUtils.currentLine=23265295;
 //BA.debugLineNum = 23265295;BA.debugLine="Log(resultado.Tag & \": \" & k & \": \" & record";
__c.LogImpl("823265295",BA.ObjectToString(_resultado.Tag /*Object*/ )+": "+_k+": "+BA.ObjectToString(_records[(int)(BA.ObjectToNumber(_resultado.Columns /*anywheresoftware.b4a.objects.collections.Map*/ .Get((Object)(_k))))]),0);
 }
};
 }
};
 };
 };
RDebugUtils.currentLine=23265300;
 //BA.debugLineNum = 23265300;BA.debugLine="Job.Release";
_job._release /*String*/ (null);
 };
RDebugUtils.currentLine=23265303;
 //BA.debugLineNum = 23265303;BA.debugLine="End Sub";
return "";
}
public String  _mandapendientesreparto(reparto_izca.keymon.lat.c_noventa __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_noventa";
if (Debug.shouldDelegate(ba, "mandapendientesreparto", false))
	 {return ((String) Debug.delegate(ba, "mandapendientesreparto", null));}
RDebugUtils.currentLine=23199744;
 //BA.debugLineNum = 23199744;BA.debugLine="Sub mandaPendientesreparto";
RDebugUtils.currentLine=23199760;
 //BA.debugLineNum = 23199760;BA.debugLine="End Sub";
return "";
}
public String  _printer_connected(reparto_izca.keymon.lat.c_noventa __ref,boolean _success) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_noventa";
if (Debug.shouldDelegate(ba, "printer_connected", false))
	 {return ((String) Debug.delegate(ba, "printer_connected", new Object[] {_success}));}
RDebugUtils.currentLine=23658496;
 //BA.debugLineNum = 23658496;BA.debugLine="Sub Printer_Connected (Success As Boolean)";
RDebugUtils.currentLine=23658497;
 //BA.debugLineNum = 23658497;BA.debugLine="If Success Then";
if (_success) { 
RDebugUtils.currentLine=23658499;
 //BA.debugLineNum = 23658499;BA.debugLine="PASA_IMP = \"1\"";
__ref._pasa_imp /*String*/  = "1";
 }else {
RDebugUtils.currentLine=23658502;
 //BA.debugLineNum = 23658502;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) { 
RDebugUtils.currentLine=23658503;
 //BA.debugLineNum = 23658503;BA.debugLine="StartPrinter";
__ref._startprinter /*String*/ (null);
 };
 };
RDebugUtils.currentLine=23658506;
 //BA.debugLineNum = 23658506;BA.debugLine="End Sub";
return "";
}
public String  _startprinter(reparto_izca.keymon.lat.c_noventa __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_noventa";
if (Debug.shouldDelegate(ba, "startprinter", false))
	 {return ((String) Debug.delegate(ba, "startprinter", null));}
anywheresoftware.b4a.objects.collections.Map _paireddevices = null;
anywheresoftware.b4a.objects.collections.List _l1 = null;
int _resimp = 0;
int _i = 0;
RDebugUtils.currentLine=23724032;
 //BA.debugLineNum = 23724032;BA.debugLine="Sub StartPrinter";
RDebugUtils.currentLine=23724033;
 //BA.debugLineNum = 23724033;BA.debugLine="Dim PairedDevices As Map";
_paireddevices = new anywheresoftware.b4a.objects.collections.Map();
RDebugUtils.currentLine=23724034;
 //BA.debugLineNum = 23724034;BA.debugLine="Dim L1 As List";
_l1 = new anywheresoftware.b4a.objects.collections.List();
RDebugUtils.currentLine=23724035;
 //BA.debugLineNum = 23724035;BA.debugLine="Dim resimp As Int";
_resimp = 0;
RDebugUtils.currentLine=23724036;
 //BA.debugLineNum = 23724036;BA.debugLine="ToastMessageShow(\"Printing.....\",True)";
__c.ToastMessageShow(BA.ObjectToCharSequence("Printing....."),__c.True);
RDebugUtils.currentLine=23724037;
 //BA.debugLineNum = 23724037;BA.debugLine="PairedDevices.Initialize";
_paireddevices.Initialize();
RDebugUtils.currentLine=23724038;
 //BA.debugLineNum = 23724038;BA.debugLine="Try";
try {RDebugUtils.currentLine=23724039;
 //BA.debugLineNum = 23724039;BA.debugLine="PairedDevices = cmp20.GetPairedDevices";
_paireddevices = __ref._cmp20 /*anywheresoftware.b4a.objects.Serial*/ .GetPairedDevices();
 } 
       catch (Exception e9) {
			ba.setLastException(e9);RDebugUtils.currentLine=23724041;
 //BA.debugLineNum = 23724041;BA.debugLine="Msgbox(\"Getting Paired Devices\",\"Printer Error\")";
__c.Msgbox(BA.ObjectToCharSequence("Getting Paired Devices"),BA.ObjectToCharSequence("Printer Error"),ba);
RDebugUtils.currentLine=23724042;
 //BA.debugLineNum = 23724042;BA.debugLine="printer.Close";
__ref._printer /*anywheresoftware.b4a.objects.streams.File.TextWriterWrapper*/ .Close();
RDebugUtils.currentLine=23724043;
 //BA.debugLineNum = 23724043;BA.debugLine="cmp20.Disconnect";
__ref._cmp20 /*anywheresoftware.b4a.objects.Serial*/ .Disconnect();
 };
RDebugUtils.currentLine=23724046;
 //BA.debugLineNum = 23724046;BA.debugLine="If PairedDevices.Size = 0 Then";
if (_paireddevices.getSize()==0) { 
RDebugUtils.currentLine=23724047;
 //BA.debugLineNum = 23724047;BA.debugLine="Msgbox(\"Error Connecting to Printer - Printer No";
__c.Msgbox(BA.ObjectToCharSequence("Error Connecting to Printer - Printer Not Found"),BA.ObjectToCharSequence(""),ba);
RDebugUtils.currentLine=23724048;
 //BA.debugLineNum = 23724048;BA.debugLine="Return";
if (true) return "";
 };
RDebugUtils.currentLine=23724051;
 //BA.debugLineNum = 23724051;BA.debugLine="If PairedDevices.Size = 1 Then";
if (_paireddevices.getSize()==1) { 
RDebugUtils.currentLine=23724052;
 //BA.debugLineNum = 23724052;BA.debugLine="Try";
try {RDebugUtils.currentLine=23724053;
 //BA.debugLineNum = 23724053;BA.debugLine="cmp20.Connect(PairedDevices.Get(PairedDevices.G";
__ref._cmp20 /*anywheresoftware.b4a.objects.Serial*/ .Connect(ba,BA.ObjectToString(_paireddevices.Get(_paireddevices.GetKeyAt((int) (0)))));
 } 
       catch (Exception e21) {
			ba.setLastException(e21);RDebugUtils.currentLine=23724055;
 //BA.debugLineNum = 23724055;BA.debugLine="Msgbox(\"Connecting\",\"Printer Error\") 'ignore";
__c.Msgbox(BA.ObjectToCharSequence("Connecting"),BA.ObjectToCharSequence("Printer Error"),ba);
RDebugUtils.currentLine=23724056;
 //BA.debugLineNum = 23724056;BA.debugLine="printer.Close";
__ref._printer /*anywheresoftware.b4a.objects.streams.File.TextWriterWrapper*/ .Close();
RDebugUtils.currentLine=23724057;
 //BA.debugLineNum = 23724057;BA.debugLine="cmp20.Disconnect";
__ref._cmp20 /*anywheresoftware.b4a.objects.Serial*/ .Disconnect();
 };
 }else {
RDebugUtils.currentLine=23724060;
 //BA.debugLineNum = 23724060;BA.debugLine="L1.Initialize";
_l1.Initialize();
RDebugUtils.currentLine=23724061;
 //BA.debugLineNum = 23724061;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 ) {
RDebugUtils.currentLine=23724062;
 //BA.debugLineNum = 23724062;BA.debugLine="L1.Add(PairedDevices.GetKeyAt(i))";
_l1.Add(_paireddevices.GetKeyAt(_i));
 }
};
RDebugUtils.currentLine=23724064;
 //BA.debugLineNum = 23724064;BA.debugLine="resimp = InputList(L1, \"Choose device\", -1) 'ign";
_resimp = __c.InputList(_l1,BA.ObjectToCharSequence("Choose device"),(int) (-1),ba);
RDebugUtils.currentLine=23724065;
 //BA.debugLineNum = 23724065;BA.debugLine="If resimp <> DialogResponse.CANCEL Then";
if (_resimp!=__c.DialogResponse.CANCEL) { 
RDebugUtils.currentLine=23724066;
 //BA.debugLineNum = 23724066;BA.debugLine="cmp20.Connect(PairedDevices.Get(L1.Get(resimp))";
__ref._cmp20 /*anywheresoftware.b4a.objects.Serial*/ .Connect(ba,BA.ObjectToString(_paireddevices.Get(_l1.Get(_resimp))));
 };
 };
RDebugUtils.currentLine=23724069;
 //BA.debugLineNum = 23724069;BA.debugLine="End Sub";
return "";
}
public String  _printer1_connected(reparto_izca.keymon.lat.c_noventa __ref,boolean _success) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_noventa";
if (Debug.shouldDelegate(ba, "printer1_connected", false))
	 {return ((String) Debug.delegate(ba, "printer1_connected", new Object[] {_success}));}
RDebugUtils.currentLine=23527424;
 //BA.debugLineNum = 23527424;BA.debugLine="Sub Printer1_Connected (Success As Boolean)";
RDebugUtils.currentLine=23527426;
 //BA.debugLineNum = 23527426;BA.debugLine="If Success Then";
if (_success) { 
RDebugUtils.currentLine=23527427;
 //BA.debugLineNum = 23527427;BA.debugLine="ToastMessageShow(\"Impresora conectada\", False)";
__c.ToastMessageShow(BA.ObjectToCharSequence("Impresora conectada"),__c.False);
RDebugUtils.currentLine=23527428;
 //BA.debugLineNum = 23527428;BA.debugLine="Starter.skmt.ExecNonQuery2(\"delete from CAT_VARI";
_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("delete from CAT_VARIABLES where CAT_VA_DESCRIPCION = ?",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)("MACIMP")}));
RDebugUtils.currentLine=23527429;
 //BA.debugLineNum = 23527429;BA.debugLine="Starter.skmt.ExecNonQuery2(\"INSERT INTO CAT_VARI";
_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("INSERT INTO CAT_VARIABLES(CAT_VA_DESCRIPCION, CAT_VA_VALOR) VALUES (?,?)",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)("MACIMP"),(Object)(_starter._mac_impresora /*String*/ )}));
RDebugUtils.currentLine=23527432;
 //BA.debugLineNum = 23527432;BA.debugLine="impresoraConectada = True";
__ref._impresoraconectada /*boolean*/  = __c.True;
 }else {
RDebugUtils.currentLine=23527436;
 //BA.debugLineNum = 23527436;BA.debugLine="LogColor(\"Error conectando la impresora\", Colors";
__c.LogImpl("823527436","Error conectando la impresora",__c.Colors.Red);
RDebugUtils.currentLine=23527437;
 //BA.debugLineNum = 23527437;BA.debugLine="errorImpresora = errorImpresora + 1";
__ref._errorimpresora /*int*/  = (int) (__ref._errorimpresora /*int*/ +1);
RDebugUtils.currentLine=23527438;
 //BA.debugLineNum = 23527438;BA.debugLine="If errorImpresora > 1 Then";
if (__ref._errorimpresora /*int*/ >1) { 
RDebugUtils.currentLine=23527439;
 //BA.debugLineNum = 23527439;BA.debugLine="Starter.MAC_IMPRESORA = \"0\"";
_starter._mac_impresora /*String*/  = "0";
RDebugUtils.currentLine=23527440;
 //BA.debugLineNum = 23527440;BA.debugLine="errorImpresora = 0";
__ref._errorimpresora /*int*/  = (int) (0);
 };
 };
RDebugUtils.currentLine=23527443;
 //BA.debugLineNum = 23527443;BA.debugLine="End Sub";
return "";
}
public String  _printer1_error(reparto_izca.keymon.lat.c_noventa __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_noventa";
if (Debug.shouldDelegate(ba, "printer1_error", false))
	 {return ((String) Debug.delegate(ba, "printer1_error", null));}
RDebugUtils.currentLine=23592960;
 //BA.debugLineNum = 23592960;BA.debugLine="Sub Printer1_Error";
RDebugUtils.currentLine=23592961;
 //BA.debugLineNum = 23592961;BA.debugLine="Log(\"error printer\")";
__c.LogImpl("823592961","error printer",0);
RDebugUtils.currentLine=23592962;
 //BA.debugLineNum = 23592962;BA.debugLine="End Sub";
return "";
}
}