package reparto_intmex.keymon.lat;


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

public class subs {
private static subs mostCurrent = new subs();
public static Object getObject() {
    throw new RuntimeException("Code module does not support this method.");
}
 
public anywheresoftware.b4a.keywords.Common __c = null;
public static de.donmanfred.GZipStringswrapper _gzip = null;
public static anywheresoftware.b4a.objects.StringUtils _su = null;
public static anywheresoftware.b4a.phone.Phone _phn = null;
public static String _devmodel = "";
public static anywheresoftware.b4a.sql.SQL _kmt = null;
public static anywheresoftware.b4a.sql.SQL _errorlog = null;
public static String _ssid = "";
public static int _rutamaxpoints = 0;
public static int _rutahrsatras = 0;
public b4a.example.dateutils _dateutils = null;
public reparto_intmex.keymon.lat.main _main = null;
public reparto_intmex.keymon.lat.appupdater _appupdater = null;
public reparto_intmex.keymon.lat.foto _foto = null;
public reparto_intmex.keymon.lat.mapa_cliente _mapa_cliente = null;
public reparto_intmex.keymon.lat.mapa_rutas _mapa_rutas = null;
public reparto_intmex.keymon.lat.starter _starter = null;
public reparto_intmex.keymon.lat.tracker _tracker = null;
public reparto_intmex.keymon.lat.newinst2 _newinst2 = null;
public reparto_intmex.keymon.lat.b4xpages _b4xpages = null;
public reparto_intmex.keymon.lat.b4xcollections _b4xcollections = null;
public reparto_intmex.keymon.lat.httputils2service _httputils2service = null;
public reparto_intmex.keymon.lat.xuiviewsutils _xuiviewsutils = null;
public static String  _panelvisible(anywheresoftware.b4a.BA _ba,anywheresoftware.b4a.objects.PanelWrapper _panel,int _top,int _left) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "panelvisible", false))
	 {return ((String) Debug.delegate(null, "panelvisible", new Object[] {_ba,_panel,_top,_left}));}
RDebugUtils.currentLine=69206016;
 //BA.debugLineNum = 69206016;BA.debugLine="Sub panelVisible(panel As Panel, top As Int, left";
RDebugUtils.currentLine=69206017;
 //BA.debugLineNum = 69206017;BA.debugLine="panel.BringToFront";
_panel.BringToFront();
RDebugUtils.currentLine=69206018;
 //BA.debugLineNum = 69206018;BA.debugLine="panel.Visible = True";
_panel.setVisible(anywheresoftware.b4a.keywords.Common.True);
RDebugUtils.currentLine=69206019;
 //BA.debugLineNum = 69206019;BA.debugLine="panel.Top = top";
_panel.setTop(_top);
RDebugUtils.currentLine=69206020;
 //BA.debugLineNum = 69206020;BA.debugLine="panel.Left = left";
_panel.setLeft(_left);
RDebugUtils.currentLine=69206021;
 //BA.debugLineNum = 69206021;BA.debugLine="End Sub";
return "";
}
public static String  _centrapanel(anywheresoftware.b4a.BA _ba,anywheresoftware.b4a.objects.PanelWrapper _elemento,int _anchoelementosuperior) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "centrapanel", false))
	 {return ((String) Debug.delegate(null, "centrapanel", new Object[] {_ba,_elemento,_anchoelementosuperior}));}
RDebugUtils.currentLine=69533696;
 //BA.debugLineNum = 69533696;BA.debugLine="Sub centraPanel(elemento As Panel, anchoElementoSu";
RDebugUtils.currentLine=69533697;
 //BA.debugLineNum = 69533697;BA.debugLine="elemento.Left = Round(anchoElementoSuperior/2)-(e";
_elemento.setLeft((int) (anywheresoftware.b4a.keywords.Common.Round(_anchoelementosuperior/(double)2)-(_elemento.getWidth()/(double)2)));
RDebugUtils.currentLine=69533698;
 //BA.debugLineNum = 69533698;BA.debugLine="End Sub";
return "";
}
public static String  _agregacolumna(anywheresoftware.b4a.BA _ba,String _tabla,String _columna,String _tipo) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "agregacolumna", false))
	 {return ((String) Debug.delegate(null, "agregacolumna", new Object[] {_ba,_tabla,_columna,_tipo}));}
anywheresoftware.b4a.sql.SQL.CursorWrapper _c = null;
RDebugUtils.currentLine=70909952;
 //BA.debugLineNum = 70909952;BA.debugLine="Sub agregaColumna(tabla As String, columna As Stri";
RDebugUtils.currentLine=70909953;
 //BA.debugLineNum = 70909953;BA.debugLine="Try 'Intentamos usar \"pragma_table_info\" para rev";
try {RDebugUtils.currentLine=70909954;
 //BA.debugLineNum = 70909954;BA.debugLine="Private c As Cursor = Starter.skmt.ExecQuery($\"S";
_c = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(mostCurrent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery(("SELECT COUNT(*) AS fCol FROM pragma_table_info('"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_tabla))+"') WHERE name='"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_columna))+"'"))));
RDebugUtils.currentLine=70909955;
 //BA.debugLineNum = 70909955;BA.debugLine="c.Position = 0";
_c.setPosition((int) (0));
RDebugUtils.currentLine=70909956;
 //BA.debugLineNum = 70909956;BA.debugLine="If c.GetString(\"fCol\") = 0 Then 'Si no esta la c";
if ((_c.GetString("fCol")).equals(BA.NumberToString(0))) { 
RDebugUtils.currentLine=70909957;
 //BA.debugLineNum = 70909957;BA.debugLine="Starter.skmt.ExecNonQuery($\"ALTER TABLE ${tabla";
mostCurrent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("ALTER TABLE "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_tabla))+" ADD COLUMN "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_columna))+" "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_tipo))+""));
RDebugUtils.currentLine=70909958;
 //BA.debugLineNum = 70909958;BA.debugLine="Log($\"Columna \"${columna} ${tipo}\", agregada a";
anywheresoftware.b4a.keywords.Common.LogImpl("270909958",("Columna \""+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_columna))+" "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_tipo))+"\", agregada a \""+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_tabla))+"\"."),0);
 };
 } 
       catch (Exception e9) {
			(_ba.processBA == null ? _ba : _ba.processBA).setLastException(e9);RDebugUtils.currentLine=70909961;
 //BA.debugLineNum = 70909961;BA.debugLine="Try";
try {RDebugUtils.currentLine=70909962;
 //BA.debugLineNum = 70909962;BA.debugLine="Starter.skmt.ExecNonQuery($\"ALTER TABLE ${tabla";
mostCurrent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("ALTER TABLE "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_tabla))+" ADD COLUMN "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_columna))+" "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_tipo))+""));
RDebugUtils.currentLine=70909963;
 //BA.debugLineNum = 70909963;BA.debugLine="Log($\"Columna \"${columna} ${tipo}\", agregada a";
anywheresoftware.b4a.keywords.Common.LogImpl("270909963",("Columna \""+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_columna))+" "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_tipo))+"\", agregada a \""+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_tabla))+"\".."),0);
 } 
       catch (Exception e13) {
			(_ba.processBA == null ? _ba : _ba.processBA).setLastException(e13);RDebugUtils.currentLine=70909965;
 //BA.debugLineNum = 70909965;BA.debugLine="Log(LastException)";
anywheresoftware.b4a.keywords.Common.LogImpl("270909965",BA.ObjectToString(anywheresoftware.b4a.keywords.Common.LastException(_ba)),0);
 };
 };
RDebugUtils.currentLine=70909968;
 //BA.debugLineNum = 70909968;BA.debugLine="End Sub";
return "";
}
public static String  _centraboton(anywheresoftware.b4a.BA _ba,anywheresoftware.b4a.objects.ButtonWrapper _elemento,int _anchoelementosuperior) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "centraboton", false))
	 {return ((String) Debug.delegate(null, "centraboton", new Object[] {_ba,_elemento,_anchoelementosuperior}));}
RDebugUtils.currentLine=69664768;
 //BA.debugLineNum = 69664768;BA.debugLine="Sub centraBoton(elemento As Button, anchoElementoS";
RDebugUtils.currentLine=69664769;
 //BA.debugLineNum = 69664769;BA.debugLine="elemento.Left = Round(anchoElementoSuperior/2)-(e";
_elemento.setLeft((int) (anywheresoftware.b4a.keywords.Common.Round(_anchoelementosuperior/(double)2)-(_elemento.getWidth()/(double)2)));
RDebugUtils.currentLine=69664770;
 //BA.debugLineNum = 69664770;BA.debugLine="End Sub";
return "";
}
public static String  _traeusuariodebd(anywheresoftware.b4a.BA _ba) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "traeusuariodebd", false))
	 {return ((String) Debug.delegate(null, "traeusuariodebd", new Object[] {_ba}));}
anywheresoftware.b4a.sql.SQL.CursorWrapper _c = null;
String _u = "";
RDebugUtils.currentLine=68026368;
 //BA.debugLineNum = 68026368;BA.debugLine="Sub traeUsuarioDeBD As String 'ignore";
RDebugUtils.currentLine=68026369;
 //BA.debugLineNum = 68026369;BA.debugLine="Private c As Cursor";
_c = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
RDebugUtils.currentLine=68026370;
 //BA.debugLineNum = 68026370;BA.debugLine="Private u As String = \"SinUsuario\"";
_u = "SinUsuario";
RDebugUtils.currentLine=68026371;
 //BA.debugLineNum = 68026371;BA.debugLine="If Not(kmt.IsInitialized) Then revisaBD";
if (anywheresoftware.b4a.keywords.Common.Not(_kmt.IsInitialized())) { 
_revisabd(_ba);};
RDebugUtils.currentLine=68026372;
 //BA.debugLineNum = 68026372;BA.debugLine="c=kmt.ExecQuery(\"select USUARIO from usuarioa\")";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_kmt.ExecQuery("select USUARIO from usuarioa")));
RDebugUtils.currentLine=68026373;
 //BA.debugLineNum = 68026373;BA.debugLine="c.Position=0";
_c.setPosition((int) (0));
RDebugUtils.currentLine=68026374;
 //BA.debugLineNum = 68026374;BA.debugLine="If c.RowCount > 0 Then u = c.GetString(\"USUARIO\")";
if (_c.getRowCount()>0) { 
_u = _c.GetString("USUARIO");};
RDebugUtils.currentLine=68026375;
 //BA.debugLineNum = 68026375;BA.debugLine="c.Close";
_c.Close();
RDebugUtils.currentLine=68026376;
 //BA.debugLineNum = 68026376;BA.debugLine="Return u";
if (true) return _u;
RDebugUtils.currentLine=68026377;
 //BA.debugLineNum = 68026377;BA.debugLine="End Sub";
return "";
}
public static String  _traeruta(anywheresoftware.b4a.BA _ba,String _cliente) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "traeruta", false))
	 {return ((String) Debug.delegate(null, "traeruta", new Object[] {_ba,_cliente}));}
anywheresoftware.b4a.sql.SQL.CursorWrapper _c = null;
String _r = "";
RDebugUtils.currentLine=70189056;
 //BA.debugLineNum = 70189056;BA.debugLine="Sub traeRuta (cliente As String) As String 'ignore";
RDebugUtils.currentLine=70189057;
 //BA.debugLineNum = 70189057;BA.debugLine="Private c As Cursor";
_c = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
RDebugUtils.currentLine=70189058;
 //BA.debugLineNum = 70189058;BA.debugLine="Private r As String";
_r = "";
RDebugUtils.currentLine=70189059;
 //BA.debugLineNum = 70189059;BA.debugLine="c=Starter.skmt.ExecQuery($\"select CAT_CL_RUTA fro";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(mostCurrent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery(("select CAT_CL_RUTA from kmt_info where CAT_CL_CODIGO = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_cliente))+"'"))));
RDebugUtils.currentLine=70189060;
 //BA.debugLineNum = 70189060;BA.debugLine="r = \"0\"";
_r = "0";
RDebugUtils.currentLine=70189061;
 //BA.debugLineNum = 70189061;BA.debugLine="If c.RowCount > 0 Then";
if (_c.getRowCount()>0) { 
RDebugUtils.currentLine=70189062;
 //BA.debugLineNum = 70189062;BA.debugLine="c.Position=0";
_c.setPosition((int) (0));
RDebugUtils.currentLine=70189063;
 //BA.debugLineNum = 70189063;BA.debugLine="r = c.GetString(\"CAT_CL_RUTA\")";
_r = _c.GetString("CAT_CL_RUTA");
 };
RDebugUtils.currentLine=70189065;
 //BA.debugLineNum = 70189065;BA.debugLine="c.Close";
_c.Close();
RDebugUtils.currentLine=70189066;
 //BA.debugLineNum = 70189066;BA.debugLine="Return r";
if (true) return _r;
RDebugUtils.currentLine=70189067;
 //BA.debugLineNum = 70189067;BA.debugLine="End Sub";
return "";
}
public static String  _traecliente(anywheresoftware.b4a.BA _ba) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "traecliente", false))
	 {return ((String) Debug.delegate(null, "traecliente", new Object[] {_ba}));}
anywheresoftware.b4a.sql.SQL.CursorWrapper _cli = null;
String _cl = "";
RDebugUtils.currentLine=70057984;
 //BA.debugLineNum = 70057984;BA.debugLine="Sub traeCliente As String 'ignore";
RDebugUtils.currentLine=70057985;
 //BA.debugLineNum = 70057985;BA.debugLine="Private cli As Cursor = Starter.skmt.ExecQuery(\"S";
_cli = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_cli = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(mostCurrent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("Select CUENTA from cuentaa")));
RDebugUtils.currentLine=70057986;
 //BA.debugLineNum = 70057986;BA.debugLine="cli.Position = 0";
_cli.setPosition((int) (0));
RDebugUtils.currentLine=70057987;
 //BA.debugLineNum = 70057987;BA.debugLine="Private cl As String = cli.GetString(\"CUENTA\")";
_cl = _cli.GetString("CUENTA");
RDebugUtils.currentLine=70057988;
 //BA.debugLineNum = 70057988;BA.debugLine="cli.Close";
_cli.Close();
RDebugUtils.currentLine=70057989;
 //BA.debugLineNum = 70057989;BA.debugLine="Log(\"Algo paso...\"& cl)";
anywheresoftware.b4a.keywords.Common.LogImpl("270057989","Algo paso..."+_cl,0);
RDebugUtils.currentLine=70057990;
 //BA.debugLineNum = 70057990;BA.debugLine="Return cl";
if (true) return _cl;
RDebugUtils.currentLine=70057991;
 //BA.debugLineNum = 70057991;BA.debugLine="End Sub";
return "";
}
public static String  _fechakmt(anywheresoftware.b4a.BA _ba,String _fecha) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "fechakmt", false))
	 {return ((String) Debug.delegate(null, "fechakmt", new Object[] {_ba,_fecha}));}
String _origformat = "";
String _nuevafecha = "";
RDebugUtils.currentLine=67108864;
 //BA.debugLineNum = 67108864;BA.debugLine="Sub fechaKMT(fecha As String) As String 'ignore";
RDebugUtils.currentLine=67108866;
 //BA.debugLineNum = 67108866;BA.debugLine="Dim OrigFormat As String = DateTime.DateFormat  '";
_origformat = anywheresoftware.b4a.keywords.Common.DateTime.getDateFormat();
RDebugUtils.currentLine=67108867;
 //BA.debugLineNum = 67108867;BA.debugLine="DateTime.DateFormat=\"yyMMddHHmmss\"";
anywheresoftware.b4a.keywords.Common.DateTime.setDateFormat("yyMMddHHmmss");
RDebugUtils.currentLine=67108868;
 //BA.debugLineNum = 67108868;BA.debugLine="Dim nuevaFecha As String=DateTime.Date(fecha)";
_nuevafecha = anywheresoftware.b4a.keywords.Common.DateTime.Date((long)(Double.parseDouble(_fecha)));
RDebugUtils.currentLine=67108869;
 //BA.debugLineNum = 67108869;BA.debugLine="DateTime.DateFormat=OrigFormat  'return to orig d";
anywheresoftware.b4a.keywords.Common.DateTime.setDateFormat(_origformat);
RDebugUtils.currentLine=67108871;
 //BA.debugLineNum = 67108871;BA.debugLine="Return nuevaFecha";
if (true) return _nuevafecha;
RDebugUtils.currentLine=67108872;
 //BA.debugLineNum = 67108872;BA.debugLine="End Sub";
return "";
}
public static anywheresoftware.b4a.objects.collections.Map  _traecantymonto2(anywheresoftware.b4a.BA _ba,String _cliente) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "traecantymonto2", false))
	 {return ((anywheresoftware.b4a.objects.collections.Map) Debug.delegate(null, "traecantymonto2", new Object[] {_ba,_cliente}));}
int _cant = 0;
float _monto = 0f;
anywheresoftware.b4a.sql.SQL.CursorWrapper _ccym = null;
int _i = 0;
RDebugUtils.currentLine=70647808;
 //BA.debugLineNum = 70647808;BA.debugLine="Sub traeCantYMonto2(cliente As String) As Map";
RDebugUtils.currentLine=70647810;
 //BA.debugLineNum = 70647810;BA.debugLine="Private cant As Int = 0";
_cant = (int) (0);
RDebugUtils.currentLine=70647811;
 //BA.debugLineNum = 70647811;BA.debugLine="Private monto As Float = 0";
_monto = (float) (0);
RDebugUtils.currentLine=70647812;
 //BA.debugLineNum = 70647812;BA.debugLine="Private ccym As Cursor = Starter.skmt.ExecQuery($";
_ccym = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_ccym = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(mostCurrent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery(("Select hvd_codpromo, hvd_proid, HVD_CANT, (Select CAT_GP_PRECIO from cat_gunaprod where cat_gp_id = hvd_proid) As precio from HIST_VENTAS where HVD_CLIENTE = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_cliente))+"'"))));
RDebugUtils.currentLine=70647813;
 //BA.debugLineNum = 70647813;BA.debugLine="If ccym.RowCount > 0 Then";
if (_ccym.getRowCount()>0) { 
RDebugUtils.currentLine=70647814;
 //BA.debugLineNum = 70647814;BA.debugLine="For i=0 To ccym.RowCount -1";
{
final int step5 = 1;
final int limit5 = (int) (_ccym.getRowCount()-1);
_i = (int) (0) ;
for (;_i <= limit5 ;_i = _i + step5 ) {
RDebugUtils.currentLine=70647815;
 //BA.debugLineNum = 70647815;BA.debugLine="ccym.Position = i";
_ccym.setPosition(_i);
RDebugUtils.currentLine=70647816;
 //BA.debugLineNum = 70647816;BA.debugLine="If ccym.GetString(\"HVD_CODPROMO\") <> ccym.GetSt";
if ((_ccym.GetString("HVD_CODPROMO")).equals(_ccym.GetString("HVD_PROID")) == false && _ccym.GetString("precio")!= null) { 
RDebugUtils.currentLine=70647817;
 //BA.debugLineNum = 70647817;BA.debugLine="cant = cant + ccym.GetString(\"HVD_CANT\")";
_cant = (int) (_cant+(double)(Double.parseDouble(_ccym.GetString("HVD_CANT"))));
RDebugUtils.currentLine=70647819;
 //BA.debugLineNum = 70647819;BA.debugLine="monto = monto + (ccym.GetString(\"HVD_CANT\") *";
_monto = (float) (_monto+((double)(Double.parseDouble(_ccym.GetString("HVD_CANT")))*(double)(Double.parseDouble(_traeprecio(_ba,_ccym.GetString("HVD_PROID"),_ccym.GetString("HVD_CODPROMO"))))));
 };
 }
};
 };
RDebugUtils.currentLine=70647825;
 //BA.debugLineNum = 70647825;BA.debugLine="ccym = Starter.skmt.ExecQuery($\"Select rep_prodid";
_ccym = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(mostCurrent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery(("Select rep_prodid, iFNULL(REP_CANT, 0) AS REP_CANT, iFNULL((Select CAT_GP_PRECIO from cat_gunaprod where cat_gp_id = rep_prodid),0) As precio from REPARTO where REP_CLIENTE in (Select cuenta from cuentaa) And REP_RECHAZO = '0' and REP_CANT > 0"))));
RDebugUtils.currentLine=70647826;
 //BA.debugLineNum = 70647826;BA.debugLine="If ccym.RowCount > 0 Then";
if (_ccym.getRowCount()>0) { 
RDebugUtils.currentLine=70647827;
 //BA.debugLineNum = 70647827;BA.debugLine="For i=0 To ccym.RowCount -1";
{
final int step15 = 1;
final int limit15 = (int) (_ccym.getRowCount()-1);
_i = (int) (0) ;
for (;_i <= limit15 ;_i = _i + step15 ) {
RDebugUtils.currentLine=70647828;
 //BA.debugLineNum = 70647828;BA.debugLine="ccym.Position = i";
_ccym.setPosition(_i);
RDebugUtils.currentLine=70647829;
 //BA.debugLineNum = 70647829;BA.debugLine="If ccym.GetString(\"REP_CANT\") <> Null Then cant";
if (_ccym.GetString("REP_CANT")!= null) { 
_cant = (int) (_cant+(double)(Double.parseDouble(_ccym.GetString("REP_CANT"))));};
RDebugUtils.currentLine=70647830;
 //BA.debugLineNum = 70647830;BA.debugLine="monto = monto + (ccym.GetString(\"REP_CANT\") * c";
_monto = (float) (_monto+((double)(Double.parseDouble(_ccym.GetString("REP_CANT")))*(double)(Double.parseDouble(_ccym.GetString("precio")))));
 }
};
RDebugUtils.currentLine=70647832;
 //BA.debugLineNum = 70647832;BA.debugLine="Log($\"CANT=${cant}, MONTO=${monto}\"$)";
anywheresoftware.b4a.keywords.Common.LogImpl("270647832",("CANT="+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_cant))+", MONTO="+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_monto))+""),0);
 };
RDebugUtils.currentLine=70647835;
 //BA.debugLineNum = 70647835;BA.debugLine="ccym.Close";
_ccym.Close();
RDebugUtils.currentLine=70647836;
 //BA.debugLineNum = 70647836;BA.debugLine="Return CreateMap(\"cantidad\":cant, \"monto\":monto)";
if (true) return anywheresoftware.b4a.keywords.Common.createMap(new Object[] {(Object)("cantidad"),(Object)(_cant),(Object)("monto"),(Object)(_monto)});
RDebugUtils.currentLine=70647837;
 //BA.debugLineNum = 70647837;BA.debugLine="End Sub";
return null;
}
public static String  _traealmacen(anywheresoftware.b4a.BA _ba) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "traealmacen", false))
	 {return ((String) Debug.delegate(null, "traealmacen", new Object[] {_ba}));}
anywheresoftware.b4a.sql.SQL.CursorWrapper _c = null;
String _a = "";
RDebugUtils.currentLine=71041024;
 //BA.debugLineNum = 71041024;BA.debugLine="Sub traeAlmacen As String 'ignore";
RDebugUtils.currentLine=71041025;
 //BA.debugLineNum = 71041025;BA.debugLine="Private c As Cursor";
_c = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
RDebugUtils.currentLine=71041026;
 //BA.debugLineNum = 71041026;BA.debugLine="Private a As String";
_a = "";
RDebugUtils.currentLine=71041027;
 //BA.debugLineNum = 71041027;BA.debugLine="c = Starter.skmt.ExecQuery(\"select ID_ALMACEN fro";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(mostCurrent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select ID_ALMACEN from CAT_ALMACEN")));
RDebugUtils.currentLine=71041028;
 //BA.debugLineNum = 71041028;BA.debugLine="c.Position = 0";
_c.setPosition((int) (0));
RDebugUtils.currentLine=71041029;
 //BA.debugLineNum = 71041029;BA.debugLine="a = C.GetString(\"ID_ALMACEN\")";
_a = _c.GetString("ID_ALMACEN");
RDebugUtils.currentLine=71041030;
 //BA.debugLineNum = 71041030;BA.debugLine="c.Close";
_c.Close();
RDebugUtils.currentLine=71041031;
 //BA.debugLineNum = 71041031;BA.debugLine="Return a";
if (true) return _a;
RDebugUtils.currentLine=71041032;
 //BA.debugLineNum = 71041032;BA.debugLine="End Sub";
return "";
}
public static String  _traefechaprev(anywheresoftware.b4a.BA _ba) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "traefechaprev", false))
	 {return ((String) Debug.delegate(null, "traefechaprev", new Object[] {_ba}));}
anywheresoftware.b4a.sql.SQL.CursorWrapper _c = null;
String _a = "";
anywheresoftware.b4a.sql.SQL.CursorWrapper _clienteasing = null;
String[] _fecha = null;
String _fecha3 = "";
String[] _hora = null;
RDebugUtils.currentLine=71172096;
 //BA.debugLineNum = 71172096;BA.debugLine="Sub traefECHAPREV As String 'ignore";
RDebugUtils.currentLine=71172097;
 //BA.debugLineNum = 71172097;BA.debugLine="Private c As Cursor";
_c = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
RDebugUtils.currentLine=71172098;
 //BA.debugLineNum = 71172098;BA.debugLine="Private a As String";
_a = "";
RDebugUtils.currentLine=71172099;
 //BA.debugLineNum = 71172099;BA.debugLine="Private clienteasing As Cursor = Starter.skmt.Exe";
_clienteasing = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_clienteasing = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(mostCurrent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("SELECT CUENTA FROM CUENTAA")));
RDebugUtils.currentLine=71172100;
 //BA.debugLineNum = 71172100;BA.debugLine="clienteasing.Position = 0";
_clienteasing.setPosition((int) (0));
RDebugUtils.currentLine=71172101;
 //BA.debugLineNum = 71172101;BA.debugLine="If clienteasing.GetString(\"CUENTA\") <> \"63403\" Th";
if ((_clienteasing.GetString("CUENTA")).equals("63403") == false) { 
RDebugUtils.currentLine=71172102;
 //BA.debugLineNum = 71172102;BA.debugLine="c = Starter.skmt.ExecQuery(\"select HVD_FECHA fro";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(mostCurrent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select HVD_FECHA from HIST_VENTAS where HVD_CLIENTE IN (SELECT CUENTA FROM CUENTAA)")));
RDebugUtils.currentLine=71172103;
 //BA.debugLineNum = 71172103;BA.debugLine="c.Position = 0";
_c.setPosition((int) (0));
RDebugUtils.currentLine=71172104;
 //BA.debugLineNum = 71172104;BA.debugLine="Dim fecha() As String = Regex.Split(\" \", c.GetSt";
_fecha = anywheresoftware.b4a.keywords.Common.Regex.Split(" ",_c.GetString("HVD_FECHA"));
RDebugUtils.currentLine=71172105;
 //BA.debugLineNum = 71172105;BA.debugLine="Dim fecha3 As String = fecha(0)";
_fecha3 = _fecha[(int) (0)];
RDebugUtils.currentLine=71172106;
 //BA.debugLineNum = 71172106;BA.debugLine="Log(fecha3)";
anywheresoftware.b4a.keywords.Common.LogImpl("271172106",_fecha3,0);
RDebugUtils.currentLine=71172107;
 //BA.debugLineNum = 71172107;BA.debugLine="Dim hora() As String = Regex.Split(\"\\.\", fecha(1";
_hora = anywheresoftware.b4a.keywords.Common.Regex.Split("\\.",_fecha[(int) (1)]);
RDebugUtils.currentLine=71172108;
 //BA.debugLineNum = 71172108;BA.debugLine="a = fecha3 & \" \" & hora(0)";
_a = _fecha3+" "+_hora[(int) (0)];
RDebugUtils.currentLine=71172109;
 //BA.debugLineNum = 71172109;BA.debugLine="c.Close";
_c.Close();
 }else 
{RDebugUtils.currentLine=71172110;
 //BA.debugLineNum = 71172110;BA.debugLine="Else If clienteasing.GetString(\"CUENTA\") = \"63403";
if ((_clienteasing.GetString("CUENTA")).equals("63403")) { 
RDebugUtils.currentLine=71172111;
 //BA.debugLineNum = 71172111;BA.debugLine="c = Starter.skmt.ExecQuery(\"select HVD_FECHA fro";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(mostCurrent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select HVD_FECHA from HIST_VENTAS")));
RDebugUtils.currentLine=71172112;
 //BA.debugLineNum = 71172112;BA.debugLine="c.Position = 0";
_c.setPosition((int) (0));
RDebugUtils.currentLine=71172113;
 //BA.debugLineNum = 71172113;BA.debugLine="Dim fecha() As String = Regex.Split(\" \", c.GetSt";
_fecha = anywheresoftware.b4a.keywords.Common.Regex.Split(" ",_c.GetString("HVD_FECHA"));
RDebugUtils.currentLine=71172114;
 //BA.debugLineNum = 71172114;BA.debugLine="Dim fecha3 As String = fecha(0)";
_fecha3 = _fecha[(int) (0)];
RDebugUtils.currentLine=71172115;
 //BA.debugLineNum = 71172115;BA.debugLine="Log(fecha3)";
anywheresoftware.b4a.keywords.Common.LogImpl("271172115",_fecha3,0);
RDebugUtils.currentLine=71172116;
 //BA.debugLineNum = 71172116;BA.debugLine="Dim hora() As String = Regex.Split(\"\\.\", fecha(1";
_hora = anywheresoftware.b4a.keywords.Common.Regex.Split("\\.",_fecha[(int) (1)]);
RDebugUtils.currentLine=71172117;
 //BA.debugLineNum = 71172117;BA.debugLine="a = fecha3 & \" \" & hora(0)";
_a = _fecha3+" "+_hora[(int) (0)];
RDebugUtils.currentLine=71172118;
 //BA.debugLineNum = 71172118;BA.debugLine="c.Close";
_c.Close();
 }}
;
RDebugUtils.currentLine=71172120;
 //BA.debugLineNum = 71172120;BA.debugLine="Return a";
if (true) return _a;
RDebugUtils.currentLine=71172121;
 //BA.debugLineNum = 71172121;BA.debugLine="End Sub";
return "";
}
public static String  _centralistview(anywheresoftware.b4a.BA _ba,anywheresoftware.b4a.objects.ListViewWrapper _elemento,int _anchoelementosuperior) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "centralistview", false))
	 {return ((String) Debug.delegate(null, "centralistview", new Object[] {_ba,_elemento,_anchoelementosuperior}));}
RDebugUtils.currentLine=69468160;
 //BA.debugLineNum = 69468160;BA.debugLine="Sub centraListView(elemento As ListView, anchoElem";
RDebugUtils.currentLine=69468161;
 //BA.debugLineNum = 69468161;BA.debugLine="elemento.Left = Round(anchoElementoSuperior/2)-(e";
_elemento.setLeft((int) (anywheresoftware.b4a.keywords.Common.Round(_anchoelementosuperior/(double)2)-(_elemento.getWidth()/(double)2)));
RDebugUtils.currentLine=69468162;
 //BA.debugLineNum = 69468162;BA.debugLine="End Sub";
return "";
}
public static String  _setdivider(anywheresoftware.b4a.BA _ba,anywheresoftware.b4a.objects.ListViewWrapper _lv,int _color,int _height) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "setdivider", false))
	 {return ((String) Debug.delegate(null, "setdivider", new Object[] {_ba,_lv,_color,_height}));}
anywheresoftware.b4a.agraham.reflection.Reflection _r = null;
anywheresoftware.b4a.objects.drawable.ColorDrawable _cd = null;
RDebugUtils.currentLine=69402624;
 //BA.debugLineNum = 69402624;BA.debugLine="Sub SetDivider(lv As ListView, Color As Int, Heigh";
RDebugUtils.currentLine=69402625;
 //BA.debugLineNum = 69402625;BA.debugLine="Dim r As Reflector";
_r = new anywheresoftware.b4a.agraham.reflection.Reflection();
RDebugUtils.currentLine=69402626;
 //BA.debugLineNum = 69402626;BA.debugLine="r.Target = lv";
_r.Target = (Object)(_lv.getObject());
RDebugUtils.currentLine=69402627;
 //BA.debugLineNum = 69402627;BA.debugLine="Dim CD As ColorDrawable";
_cd = new anywheresoftware.b4a.objects.drawable.ColorDrawable();
RDebugUtils.currentLine=69402628;
 //BA.debugLineNum = 69402628;BA.debugLine="CD.Initialize(Color, 0)";
_cd.Initialize(_color,(int) (0));
RDebugUtils.currentLine=69402629;
 //BA.debugLineNum = 69402629;BA.debugLine="r.RunMethod4(\"setDivider\", Array As Object(CD), A";
_r.RunMethod4("setDivider",new Object[]{(Object)(_cd.getObject())},new String[]{"android.graphics.drawable.Drawable"});
RDebugUtils.currentLine=69402630;
 //BA.debugLineNum = 69402630;BA.debugLine="r.RunMethod2(\"setDividerHeight\", Height, \"java.la";
_r.RunMethod2("setDividerHeight",BA.NumberToString(_height),"java.lang.int");
RDebugUtils.currentLine=69402631;
 //BA.debugLineNum = 69402631;BA.debugLine="End Sub";
return "";
}
public static String  _centraetiqueta(anywheresoftware.b4a.BA _ba,anywheresoftware.b4a.objects.LabelWrapper _elemento,int _anchoelementosuperior) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "centraetiqueta", false))
	 {return ((String) Debug.delegate(null, "centraetiqueta", new Object[] {_ba,_elemento,_anchoelementosuperior}));}
RDebugUtils.currentLine=69599232;
 //BA.debugLineNum = 69599232;BA.debugLine="Sub centraEtiqueta(elemento As Label, anchoElement";
RDebugUtils.currentLine=69599233;
 //BA.debugLineNum = 69599233;BA.debugLine="elemento.Left = Round(anchoElementoSuperior/2)-(e";
_elemento.setLeft((int) (anywheresoftware.b4a.keywords.Common.Round(_anchoelementosuperior/(double)2)-(_elemento.getWidth()/(double)2)));
RDebugUtils.currentLine=69599234;
 //BA.debugLineNum = 69599234;BA.debugLine="End Sub";
return "";
}
public static String  _traerutareparto(anywheresoftware.b4a.BA _ba) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "traerutareparto", false))
	 {return ((String) Debug.delegate(null, "traerutareparto", new Object[] {_ba}));}
anywheresoftware.b4a.sql.SQL.CursorWrapper _c = null;
String _r = "";
RDebugUtils.currentLine=70975488;
 //BA.debugLineNum = 70975488;BA.debugLine="Sub traeRutaReparto As String 'ignore";
RDebugUtils.currentLine=70975489;
 //BA.debugLineNum = 70975489;BA.debugLine="Private c As Cursor";
_c = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
RDebugUtils.currentLine=70975490;
 //BA.debugLineNum = 70975490;BA.debugLine="Private r As String";
_r = "";
RDebugUtils.currentLine=70975491;
 //BA.debugLineNum = 70975491;BA.debugLine="c=Starter.skmt.ExecQuery(\"select RUTAA from RUTAA";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(mostCurrent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select RUTAA from RUTAA")));
RDebugUtils.currentLine=70975492;
 //BA.debugLineNum = 70975492;BA.debugLine="r = \"0\"";
_r = "0";
RDebugUtils.currentLine=70975493;
 //BA.debugLineNum = 70975493;BA.debugLine="If c.RowCount > 0 Then";
if (_c.getRowCount()>0) { 
RDebugUtils.currentLine=70975494;
 //BA.debugLineNum = 70975494;BA.debugLine="c.Position=0";
_c.setPosition((int) (0));
RDebugUtils.currentLine=70975495;
 //BA.debugLineNum = 70975495;BA.debugLine="r = c.GetString(\"RUTAA\")";
_r = _c.GetString("RUTAA");
 };
RDebugUtils.currentLine=70975497;
 //BA.debugLineNum = 70975497;BA.debugLine="c.Close";
_c.Close();
RDebugUtils.currentLine=70975498;
 //BA.debugLineNum = 70975498;BA.debugLine="Return r";
if (true) return _r;
RDebugUtils.currentLine=70975499;
 //BA.debugLineNum = 70975499;BA.debugLine="End Sub";
return "";
}
public static String  _prodventa(anywheresoftware.b4a.BA _ba,String _clienteoriginal,String _prodid) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "prodventa", false))
	 {return ((String) Debug.delegate(null, "prodventa", new Object[] {_ba,_clienteoriginal,_prodid}));}
String _precio = "";
RDebugUtils.currentLine=70451200;
 //BA.debugLineNum = 70451200;BA.debugLine="Sub prodVenta(clienteOriginal As String, prodId As";
RDebugUtils.currentLine=70451202;
 //BA.debugLineNum = 70451202;BA.debugLine="Private precio As String = traePrecio(prodId, tra";
_precio = _traeprecio(_ba,_prodid,_traealmacen(_ba));
RDebugUtils.currentLine=70451203;
 //BA.debugLineNum = 70451203;BA.debugLine="Starter.skmt.ExecNonQuery($\"update reparto set RE";
mostCurrent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("update reparto set REP_CANT = REP_CANT - 1 where REP_CLIENTE = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_clienteoriginal))+"' and REP_CLI_ORIG = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_clienteoriginal))+"' and REP_RECHAZO = 1 and REP_PRODID = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_prodid))+"'"));
RDebugUtils.currentLine=70451204;
 //BA.debugLineNum = 70451204;BA.debugLine="Starter.skmt.ExecNonQuery($\"update reparto set RE";
mostCurrent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("update reparto set REP_CANT = REP_CANT + 1 where REP_CLIENTE in (Select CUENTA from cuentaa) and REP_CLI_ORIG = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_clienteoriginal))+"' and REP_RECHAZO = 0 and REP_PRODID = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_prodid))+"'"));
RDebugUtils.currentLine=70451205;
 //BA.debugLineNum = 70451205;BA.debugLine="Log($\"update reparto set REP_CANT = REP_CANT - 1";
anywheresoftware.b4a.keywords.Common.LogImpl("270451205",("update reparto set REP_CANT = REP_CANT - 1 where REP_CLIENTE = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_clienteoriginal))+"' and REP_CLI_ORIG = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_clienteoriginal))+"' and REP_RECHAZO = 1 and REP_PRODID = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_prodid))+"'"),0);
RDebugUtils.currentLine=70451206;
 //BA.debugLineNum = 70451206;BA.debugLine="Log($\"update reparto set REP_CANT = REP_CANT + 1";
anywheresoftware.b4a.keywords.Common.LogImpl("270451206",("update reparto set REP_CANT = REP_CANT + 1 where REP_CLIENTE in (Select CUENTA from cuentaa) and REP_CLI_ORIG = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_clienteoriginal))+"' and REP_RECHAZO = 0 and REP_PRODID = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_prodid))+"'"),0);
RDebugUtils.currentLine=70451207;
 //BA.debugLineNum = 70451207;BA.debugLine="Starter.skmt.ExecNonQuery($\"update reparto set RE";
mostCurrent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("update reparto set REP_COSTO_TOT = REP_CANT * "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_precio))+", REP_PRECIO = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_precio))+"' where REP_CLIENTE in (Select CUENTA from cuentaa) and REP_CLI_ORIG = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_clienteoriginal))+"' and REP_RECHAZO = 0 and REP_PRODID = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_prodid))+"'"));
RDebugUtils.currentLine=70451228;
 //BA.debugLineNum = 70451228;BA.debugLine="End Sub";
return "";
}
public static String  _traeconversion(anywheresoftware.b4a.BA _ba,String _id) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "traeconversion", false))
	 {return ((String) Debug.delegate(null, "traeconversion", new Object[] {_ba,_id}));}
String _pu = "";
anywheresoftware.b4a.sql.SQL.CursorWrapper _idc = null;
RDebugUtils.currentLine=69992448;
 //BA.debugLineNum = 69992448;BA.debugLine="Sub traeConversion(id As String) As String";
RDebugUtils.currentLine=69992449;
 //BA.debugLineNum = 69992449;BA.debugLine="Private pu As String = \"0\"";
_pu = "0";
RDebugUtils.currentLine=69992451;
 //BA.debugLineNum = 69992451;BA.debugLine="Private idc As Cursor = kmt.ExecQuery($\"select C";
_idc = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_idc = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_kmt.ExecQuery(("select CONVERSION from CAT_GUNAPROD where CAT_GP_ID = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_id))+"'"))));
RDebugUtils.currentLine=69992452;
 //BA.debugLineNum = 69992452;BA.debugLine="If idc.RowCount > 0 Then";
if (_idc.getRowCount()>0) { 
RDebugUtils.currentLine=69992453;
 //BA.debugLineNum = 69992453;BA.debugLine="idc.Position=0";
_idc.setPosition((int) (0));
RDebugUtils.currentLine=69992454;
 //BA.debugLineNum = 69992454;BA.debugLine="If idc.RowCount > 0 And IsNumber(idc.GetString(";
if (_idc.getRowCount()>0 && anywheresoftware.b4a.keywords.Common.IsNumber(_idc.GetString("CONVERSION"))) { 
_pu = _idc.GetString("CONVERSION");};
 };
RDebugUtils.currentLine=69992457;
 //BA.debugLineNum = 69992457;BA.debugLine="idc.Close";
_idc.Close();
RDebugUtils.currentLine=69992459;
 //BA.debugLineNum = 69992459;BA.debugLine="Return pu";
if (true) return _pu;
RDebugUtils.currentLine=69992460;
 //BA.debugLineNum = 69992460;BA.debugLine="End Sub";
return "";
}
public static String  _traeprecioc(anywheresoftware.b4a.BA _ba,String _id) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "traeprecioc", false))
	 {return ((String) Debug.delegate(null, "traeprecioc", new Object[] {_ba,_id}));}
String _pu = "";
anywheresoftware.b4a.sql.SQL.CursorWrapper _idc = null;
RDebugUtils.currentLine=69926912;
 //BA.debugLineNum = 69926912;BA.debugLine="Sub traePrecioC(id As String) As String";
RDebugUtils.currentLine=69926913;
 //BA.debugLineNum = 69926913;BA.debugLine="Private pu As String = \"0\"";
_pu = "0";
RDebugUtils.currentLine=69926914;
 //BA.debugLineNum = 69926914;BA.debugLine="Private idc As Cursor = kmt.ExecQuery($\"select PR";
_idc = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_idc = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_kmt.ExecQuery(("select PRECIOCONVER from CAT_GUNAPROD where CAT_GP_ID = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_id))+"'"))));
RDebugUtils.currentLine=69926915;
 //BA.debugLineNum = 69926915;BA.debugLine="If idc.RowCount > 0 Then";
if (_idc.getRowCount()>0) { 
RDebugUtils.currentLine=69926916;
 //BA.debugLineNum = 69926916;BA.debugLine="idc.Position=0";
_idc.setPosition((int) (0));
RDebugUtils.currentLine=69926917;
 //BA.debugLineNum = 69926917;BA.debugLine="If idc.RowCount > 0 And IsNumber(idc.GetString(\"";
if (_idc.getRowCount()>0 && anywheresoftware.b4a.keywords.Common.IsNumber(_idc.GetString("PRECIOCONVER"))) { 
_pu = _idc.GetString("PRECIOCONVER");};
 };
RDebugUtils.currentLine=69926920;
 //BA.debugLineNum = 69926920;BA.debugLine="idc.Close";
_idc.Close();
RDebugUtils.currentLine=69926921;
 //BA.debugLineNum = 69926921;BA.debugLine="Return pu";
if (true) return _pu;
RDebugUtils.currentLine=69926922;
 //BA.debugLineNum = 69926922;BA.debugLine="End Sub";
return "";
}
public static String  _traeprecio2(anywheresoftware.b4a.BA _ba,String _id,String _quepromo,String _consecutivo) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "traeprecio2", false))
	 {return ((String) Debug.delegate(null, "traeprecio2", new Object[] {_ba,_id,_quepromo,_consecutivo}));}
String _pu = "";
anywheresoftware.b4a.sql.SQL.CursorWrapper _idc = null;
anywheresoftware.b4a.sql.SQL.CursorWrapper _pc = null;
RDebugUtils.currentLine=69861376;
 //BA.debugLineNum = 69861376;BA.debugLine="Sub traePrecio2(id As String, quePromo As String,";
RDebugUtils.currentLine=69861377;
 //BA.debugLineNum = 69861377;BA.debugLine="Private pu As String = \"0\"";
_pu = "0";
RDebugUtils.currentLine=69861379;
 //BA.debugLineNum = 69861379;BA.debugLine="If quePromo = traeAlmacen Then";
if ((_quepromo).equals(_traealmacen(_ba))) { 
RDebugUtils.currentLine=69861380;
 //BA.debugLineNum = 69861380;BA.debugLine="Private idc As Cursor = kmt.ExecQuery($\"select C";
_idc = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_idc = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_kmt.ExecQuery(("select CAT_GP_PRECIO from CAT_GUNAPROD where CAT_GP_ID = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_id))+"'"))));
RDebugUtils.currentLine=69861381;
 //BA.debugLineNum = 69861381;BA.debugLine="If idc.RowCount > 0 Then";
if (_idc.getRowCount()>0) { 
RDebugUtils.currentLine=69861382;
 //BA.debugLineNum = 69861382;BA.debugLine="idc.Position=0";
_idc.setPosition((int) (0));
RDebugUtils.currentLine=69861383;
 //BA.debugLineNum = 69861383;BA.debugLine="If idc.RowCount > 0 And IsNumber(idc.GetString(";
if (_idc.getRowCount()>0 && anywheresoftware.b4a.keywords.Common.IsNumber(_idc.GetString("CAT_GP_PRECIO"))) { 
_pu = _idc.GetString("CAT_GP_PRECIO");};
 };
RDebugUtils.currentLine=69861386;
 //BA.debugLineNum = 69861386;BA.debugLine="idc.Close";
_idc.Close();
 }else {
RDebugUtils.currentLine=69861388;
 //BA.debugLineNum = 69861388;BA.debugLine="Private pc As Cursor = Starter.skmt.ExecQuery($\"";
_pc = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_pc = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(mostCurrent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery(("select HVD_CANT, HVD_COSTO_TOT from HIST_VENTAS where HVD_CLIENTE in (select cuenta from cuentaa) and HVD_PROID = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_id))+"' and HVD_CODPROMO = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_quepromo))+"' AND CONSECUTIVO = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_consecutivo))+"'"))));
RDebugUtils.currentLine=69861389;
 //BA.debugLineNum = 69861389;BA.debugLine="If pc.RowCount > 0 Then";
if (_pc.getRowCount()>0) { 
RDebugUtils.currentLine=69861390;
 //BA.debugLineNum = 69861390;BA.debugLine="pc.Position = 0";
_pc.setPosition((int) (0));
RDebugUtils.currentLine=69861392;
 //BA.debugLineNum = 69861392;BA.debugLine="If pc.GetString(\"HVD_COSTO_TOT\")<> Null And pc.";
if (_pc.GetString("HVD_COSTO_TOT")!= null && _pc.GetString("HVD_CANT")!= null) { 
RDebugUtils.currentLine=69861393;
 //BA.debugLineNum = 69861393;BA.debugLine="pu = pc.GetString(\"HVD_COSTO_TOT\") / pc.GetStr";
_pu = BA.NumberToString((double)(Double.parseDouble(_pc.GetString("HVD_COSTO_TOT")))/(double)(double)(Double.parseDouble(_pc.GetString("HVD_CANT"))));
 };
 };
RDebugUtils.currentLine=69861397;
 //BA.debugLineNum = 69861397;BA.debugLine="pc.Close";
_pc.Close();
 };
RDebugUtils.currentLine=69861400;
 //BA.debugLineNum = 69861400;BA.debugLine="Return pu";
if (true) return _pu;
RDebugUtils.currentLine=69861402;
 //BA.debugLineNum = 69861402;BA.debugLine="End Sub";
return "";
}
public static anywheresoftware.b4a.objects.collections.Map  _traemoscantymonto(anywheresoftware.b4a.BA _ba,b4a.example3.customlistview _clv) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "traemoscantymonto", false))
	 {return ((anywheresoftware.b4a.objects.collections.Map) Debug.delegate(null, "traemoscantymonto", new Object[] {_ba,_clv}));}
int _cant = 0;
float _monto = 0f;
int _i = 0;
anywheresoftware.b4a.objects.B4XViewWrapper _p0 = null;
anywheresoftware.b4a.objects.B4XViewWrapper _p = null;
anywheresoftware.b4a.objects.B4XViewWrapper _cant1 = null;
anywheresoftware.b4a.objects.B4XViewWrapper _cant2 = null;
anywheresoftware.b4a.objects.collections.List _estetag = null;
RDebugUtils.currentLine=70582272;
 //BA.debugLineNum = 70582272;BA.debugLine="Sub traemosCantYMonto(clv As CustomListView) As Ma";
RDebugUtils.currentLine=70582274;
 //BA.debugLineNum = 70582274;BA.debugLine="Private cant As Int = 0";
_cant = (int) (0);
RDebugUtils.currentLine=70582275;
 //BA.debugLineNum = 70582275;BA.debugLine="Private monto As Float = 0";
_monto = (float) (0);
RDebugUtils.currentLine=70582276;
 //BA.debugLineNum = 70582276;BA.debugLine="For i = 0 To clv.GetSize - 1";
{
final int step3 = 1;
final int limit3 = (int) (_clv._getsize()-1);
_i = (int) (0) ;
for (;_i <= limit3 ;_i = _i + step3 ) {
RDebugUtils.currentLine=70582277;
 //BA.debugLineNum = 70582277;BA.debugLine="Private p0 As B4XView = clv.GetPanel(i)";
_p0 = new anywheresoftware.b4a.objects.B4XViewWrapper();
_p0 = _clv._getpanel(_i);
RDebugUtils.currentLine=70582278;
 //BA.debugLineNum = 70582278;BA.debugLine="Private p As B4XView = p0.GetView(0)";
_p = new anywheresoftware.b4a.objects.B4XViewWrapper();
_p = _p0.GetView((int) (0));
RDebugUtils.currentLine=70582279;
 //BA.debugLineNum = 70582279;BA.debugLine="Private cant1 As B4XView = p.GetView(2).GetView(";
_cant1 = new anywheresoftware.b4a.objects.B4XViewWrapper();
_cant1 = _p.GetView((int) (2)).GetView((int) (3));
RDebugUtils.currentLine=70582280;
 //BA.debugLineNum = 70582280;BA.debugLine="Private cant2 As B4XView = p.GetView(3).GetView(";
_cant2 = new anywheresoftware.b4a.objects.B4XViewWrapper();
_cant2 = _p.GetView((int) (3)).GetView((int) (3));
RDebugUtils.currentLine=70582282;
 //BA.debugLineNum = 70582282;BA.debugLine="If cant1.text <> \"\" Then";
if ((_cant1.getText()).equals("") == false) { 
RDebugUtils.currentLine=70582283;
 //BA.debugLineNum = 70582283;BA.debugLine="If cant1.Text = \"\" Then cant1.Text = 0";
if ((_cant1.getText()).equals("")) { 
_cant1.setText(BA.ObjectToCharSequence(0));};
RDebugUtils.currentLine=70582284;
 //BA.debugLineNum = 70582284;BA.debugLine="Private esteTag As List = Regex.Split(\"\\|\", can";
_estetag = new anywheresoftware.b4a.objects.collections.List();
_estetag = anywheresoftware.b4a.keywords.Common.ArrayToList(anywheresoftware.b4a.keywords.Common.Regex.Split("\\|",BA.ObjectToString(_cant1.getTag())));
RDebugUtils.currentLine=70582286;
 //BA.debugLineNum = 70582286;BA.debugLine="If esteTag.Get(2) <> esteTag.Get(3) Then cant =";
if ((_estetag.Get((int) (2))).equals(_estetag.Get((int) (3))) == false) { 
_cant = (int) (_cant+(double)(Double.parseDouble(_cant1.getText())));};
RDebugUtils.currentLine=70582287;
 //BA.debugLineNum = 70582287;BA.debugLine="monto = monto + (esteTag.Get(0) * cant1.Text)";
_monto = (float) (_monto+((double)(BA.ObjectToNumber(_estetag.Get((int) (0))))*(double)(Double.parseDouble(_cant1.getText()))));
 }else {
RDebugUtils.currentLine=70582289;
 //BA.debugLineNum = 70582289;BA.debugLine="If cant2.Text = \"\" Then cant2.Text = 0";
if ((_cant2.getText()).equals("")) { 
_cant2.setText(BA.ObjectToCharSequence(0));};
RDebugUtils.currentLine=70582290;
 //BA.debugLineNum = 70582290;BA.debugLine="Private esteTag As List = Regex.Split(\"\\|\", can";
_estetag = new anywheresoftware.b4a.objects.collections.List();
_estetag = anywheresoftware.b4a.keywords.Common.ArrayToList(anywheresoftware.b4a.keywords.Common.Regex.Split("\\|",BA.ObjectToString(_cant2.getTag())));
RDebugUtils.currentLine=70582292;
 //BA.debugLineNum = 70582292;BA.debugLine="If esteTag.Get(2) <> esteTag.Get(3) Then cant =";
if ((_estetag.Get((int) (2))).equals(_estetag.Get((int) (3))) == false) { 
_cant = (int) (_cant+(double)(Double.parseDouble(_cant2.getText())));};
RDebugUtils.currentLine=70582293;
 //BA.debugLineNum = 70582293;BA.debugLine="monto = monto + (esteTag.Get(0) * cant2.Text)";
_monto = (float) (_monto+((double)(BA.ObjectToNumber(_estetag.Get((int) (0))))*(double)(Double.parseDouble(_cant2.getText()))));
 };
 }
};
RDebugUtils.currentLine=70582297;
 //BA.debugLineNum = 70582297;BA.debugLine="Return CreateMap(\"cantidad\":cant, \"monto\":monto)";
if (true) return anywheresoftware.b4a.keywords.Common.createMap(new Object[] {(Object)("cantidad"),(Object)(_cant),(Object)("monto"),(Object)(_monto)});
RDebugUtils.currentLine=70582298;
 //BA.debugLineNum = 70582298;BA.debugLine="End Sub";
return null;
}
public static String  _prodrechazo(anywheresoftware.b4a.BA _ba,String _clienteoriginal,String _prodid) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "prodrechazo", false))
	 {return ((String) Debug.delegate(null, "prodrechazo", new Object[] {_ba,_clienteoriginal,_prodid}));}
anywheresoftware.b4a.sql.SQL.CursorWrapper _rr = null;
anywheresoftware.b4a.sql.SQL.CursorWrapper _chv = null;
String _precio = "";
RDebugUtils.currentLine=70516736;
 //BA.debugLineNum = 70516736;BA.debugLine="Sub prodRechazo(clienteOriginal As String, prodId";
RDebugUtils.currentLine=70516737;
 //BA.debugLineNum = 70516737;BA.debugLine="Log(\"RECHAZO DEVOLUCION\")";
anywheresoftware.b4a.keywords.Common.LogImpl("270516737","RECHAZO DEVOLUCION",0);
RDebugUtils.currentLine=70516738;
 //BA.debugLineNum = 70516738;BA.debugLine="Private rr As Cursor = Starter.skmt.ExecQuery($\"s";
_rr = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_rr = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(mostCurrent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery(("select count(REP_CLIENTE) as hayRechazo from REPARTO where rep_prodid = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_prodid))+"' and REP_CLIENTE in (Select CUENTA from cuentaa)"))));
RDebugUtils.currentLine=70516739;
 //BA.debugLineNum = 70516739;BA.debugLine="rr.Position = 0";
_rr.setPosition((int) (0));
RDebugUtils.currentLine=70516740;
 //BA.debugLineNum = 70516740;BA.debugLine="If rr.GetString(\"hayRechazo\") = 0 Then";
if ((_rr.GetString("hayRechazo")).equals(BA.NumberToString(0))) { 
RDebugUtils.currentLine=70516741;
 //BA.debugLineNum = 70516741;BA.debugLine="Log(\"INSERTAMOS EN REPARTO\")";
anywheresoftware.b4a.keywords.Common.LogImpl("270516741","INSERTAMOS EN REPARTO",0);
RDebugUtils.currentLine=70516743;
 //BA.debugLineNum = 70516743;BA.debugLine="Private chv As Cursor = Starter.skmt.ExecQuery($";
_chv = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_chv = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(mostCurrent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery(("select * from hist_ventas where hvd_cliente in (select cuenta from cuentaa) and hvd_proid = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_prodid))+"'"))));
RDebugUtils.currentLine=70516745;
 //BA.debugLineNum = 70516745;BA.debugLine="If chv.RowCount > 0 Then";
if (_chv.getRowCount()>0) { 
RDebugUtils.currentLine=70516746;
 //BA.debugLineNum = 70516746;BA.debugLine="chv.Position = 0";
_chv.setPosition((int) (0));
RDebugUtils.currentLine=70516748;
 //BA.debugLineNum = 70516748;BA.debugLine="Private precio As String = traePrecio(prodId, t";
_precio = _traeprecio(_ba,_prodid,_traealmacen(_ba));
RDebugUtils.currentLine=70516749;
 //BA.debugLineNum = 70516749;BA.debugLine="Starter.skmt.ExecNonQuery2(\"insert into reparto";
mostCurrent._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_CLI_ORIG)  VALUES (?,?,?,?,?,1,?,?,?) ",anywheresoftware.b4a.keywords.Common.ArrayToList(new String[]{_traecliente(_ba),_chv.GetString("HVD_PRONOMBRE"),BA.NumberToString(1),_precio,_chv.GetString("HVD_FECHA"),_prodid,_precio,_traecliente(_ba)}));
RDebugUtils.currentLine=70516750;
 //BA.debugLineNum = 70516750;BA.debugLine="Starter.skmt.ExecNonQuery2(\"insert into reparto";
mostCurrent._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_CLI_ORIG)  VALUES (?,?,?,?,?,0,?,?,?) ",anywheresoftware.b4a.keywords.Common.ArrayToList(new String[]{_traecliente(_ba),_chv.GetString("HVD_PRONOMBRE"),BA.NumberToString((double)(Double.parseDouble(_chv.GetString("HVD_CANT")))-1),BA.NumberToString(((double)(Double.parseDouble(_chv.GetString("HVD_CANT")))-1)*(double)(Double.parseDouble(_precio))),_chv.GetString("HVD_FECHA"),_prodid,_precio,_traecliente(_ba)}));
RDebugUtils.currentLine=70516751;
 //BA.debugLineNum = 70516751;BA.debugLine="Starter.skmt.ExecNonQuery($\"update HIST_VENTAS";
mostCurrent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("update HIST_VENTAS set HVD_PARCIAL = 1, HVD_CANT = 0, HVD_COSTO_TOT = '0' where HVD_PROID = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_prodid))+"' and HVD_CLIENTE in (Select CUENTA from cuentaa)"));
 };
 }else {
RDebugUtils.currentLine=70516754;
 //BA.debugLineNum = 70516754;BA.debugLine="Log($\"ACTUALIZAMOS REPARTO\"$)";
anywheresoftware.b4a.keywords.Common.LogImpl("270516754",("ACTUALIZAMOS REPARTO"),0);
RDebugUtils.currentLine=70516755;
 //BA.debugLineNum = 70516755;BA.debugLine="Private precio As String = traePrecio(prodId, tr";
_precio = _traeprecio(_ba,_prodid,_traealmacen(_ba));
RDebugUtils.currentLine=70516756;
 //BA.debugLineNum = 70516756;BA.debugLine="Starter.skmt.ExecNonQuery2(\"update HIST_VENTAS s";
mostCurrent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("update HIST_VENTAS set HVD_PARCIAL = 1, HVD_CANT = 0, HVD_COSTO_TOT = '0' WHERE HVD_PROID = ? and HVD_CLIENTE in (Select CUENTA from cuentaa)",anywheresoftware.b4a.keywords.Common.ArrayToList(new String[]{_prodid}));
RDebugUtils.currentLine=70516757;
 //BA.debugLineNum = 70516757;BA.debugLine="Starter.skmt.ExecNonQuery($\"update reparto set R";
mostCurrent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("update reparto set REP_CANT = REP_CANT + 1 where REP_CLIENTE = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_clienteoriginal))+"' and REP_CLI_ORIG = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_clienteoriginal))+"' and REP_RECHAZO = 1 and REP_PRODID = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_prodid))+"'"));
RDebugUtils.currentLine=70516758;
 //BA.debugLineNum = 70516758;BA.debugLine="Starter.skmt.ExecNonQuery($\"update reparto set R";
mostCurrent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("update reparto set REP_CANT = REP_CANT - 1 where REP_CLIENTE in (Select CUENTA from cuentaa) and REP_CLI_ORIG = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_clienteoriginal))+"' and REP_RECHAZO = 0 and REP_PRODID = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_prodid))+"'"));
RDebugUtils.currentLine=70516761;
 //BA.debugLineNum = 70516761;BA.debugLine="Starter.skmt.ExecNonQuery($\"update reparto set R";
mostCurrent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("update reparto set REP_COSTO_TOT = REP_CANT * "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_precio))+", REP_PRECIO = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_precio))+"' where REP_CLIENTE in (Select CUENTA from cuentaa) and REP_CLI_ORIG = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_clienteoriginal))+"'  and REP_PRODID = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_prodid))+"'"));
 };
RDebugUtils.currentLine=70516763;
 //BA.debugLineNum = 70516763;BA.debugLine="End Sub";
return "";
}
public static String  _traeprecio(anywheresoftware.b4a.BA _ba,String _id,String _quepromo) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "traeprecio", false))
	 {return ((String) Debug.delegate(null, "traeprecio", new Object[] {_ba,_id,_quepromo}));}
String _pu = "";
anywheresoftware.b4a.sql.SQL.CursorWrapper _idc = null;
anywheresoftware.b4a.sql.SQL.CursorWrapper _pc = null;
RDebugUtils.currentLine=69795840;
 //BA.debugLineNum = 69795840;BA.debugLine="Sub traePrecio(id As String, quePromo As String) A";
RDebugUtils.currentLine=69795841;
 //BA.debugLineNum = 69795841;BA.debugLine="Private pu As String = \"0\"";
_pu = "0";
RDebugUtils.currentLine=69795843;
 //BA.debugLineNum = 69795843;BA.debugLine="If quePromo = traeAlmacen Then";
if ((_quepromo).equals(_traealmacen(_ba))) { 
RDebugUtils.currentLine=69795844;
 //BA.debugLineNum = 69795844;BA.debugLine="Private idc As Cursor = kmt.ExecQuery($\"select C";
_idc = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_idc = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_kmt.ExecQuery(("select CAT_GP_PRECIO from CAT_GUNAPROD where CAT_GP_ID = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_id))+"'"))));
RDebugUtils.currentLine=69795845;
 //BA.debugLineNum = 69795845;BA.debugLine="If idc.RowCount > 0 Then";
if (_idc.getRowCount()>0) { 
RDebugUtils.currentLine=69795846;
 //BA.debugLineNum = 69795846;BA.debugLine="idc.Position=0";
_idc.setPosition((int) (0));
RDebugUtils.currentLine=69795847;
 //BA.debugLineNum = 69795847;BA.debugLine="If idc.RowCount > 0 And IsNumber(idc.GetString(";
if (_idc.getRowCount()>0 && anywheresoftware.b4a.keywords.Common.IsNumber(_idc.GetString("CAT_GP_PRECIO"))) { 
_pu = _idc.GetString("CAT_GP_PRECIO");};
 };
RDebugUtils.currentLine=69795850;
 //BA.debugLineNum = 69795850;BA.debugLine="idc.Close";
_idc.Close();
 }else {
RDebugUtils.currentLine=69795852;
 //BA.debugLineNum = 69795852;BA.debugLine="Private pc As Cursor = Starter.skmt.ExecQuery($\"";
_pc = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_pc = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(mostCurrent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery(("select HVD_CANT, HVD_COSTO_TOT from HIST_VENTAS2 where HVD_CLIENTE in (select cuenta from cuentaa) and HVD_PROID = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_id))+"' and HVD_CODPROMO = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_quepromo))+"'"))));
RDebugUtils.currentLine=69795853;
 //BA.debugLineNum = 69795853;BA.debugLine="If pc.RowCount > 0 Then";
if (_pc.getRowCount()>0) { 
RDebugUtils.currentLine=69795854;
 //BA.debugLineNum = 69795854;BA.debugLine="pc.Position = 0";
_pc.setPosition((int) (0));
RDebugUtils.currentLine=69795856;
 //BA.debugLineNum = 69795856;BA.debugLine="If pc.GetString(\"HVD_COSTO_TOT\")<> Null And pc.";
if (_pc.GetString("HVD_COSTO_TOT")!= null && _pc.GetString("HVD_CANT")!= null) { 
RDebugUtils.currentLine=69795857;
 //BA.debugLineNum = 69795857;BA.debugLine="pu = pc.GetString(\"HVD_COSTO_TOT\") / pc.GetStr";
_pu = BA.NumberToString((double)(Double.parseDouble(_pc.GetString("HVD_COSTO_TOT")))/(double)(double)(Double.parseDouble(_pc.GetString("HVD_CANT"))));
 };
 };
RDebugUtils.currentLine=69795861;
 //BA.debugLineNum = 69795861;BA.debugLine="pc.Close";
_pc.Close();
 };
RDebugUtils.currentLine=69795864;
 //BA.debugLineNum = 69795864;BA.debugLine="Return pu";
if (true) return _pu;
RDebugUtils.currentLine=69795866;
 //BA.debugLineNum = 69795866;BA.debugLine="End Sub";
return "";
}
public static int  _traecantidadrechazada(anywheresoftware.b4a.BA _ba,String _cliente,String _prodid) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "traecantidadrechazada", false))
	 {return ((Integer) Debug.delegate(null, "traecantidadrechazada", new Object[] {_ba,_cliente,_prodid}));}
int _cant = 0;
anywheresoftware.b4a.sql.SQL.CursorWrapper _cr = null;
RDebugUtils.currentLine=70254592;
 //BA.debugLineNum = 70254592;BA.debugLine="Sub traeCantidadRechazada(cliente As String, prodI";
RDebugUtils.currentLine=70254593;
 //BA.debugLineNum = 70254593;BA.debugLine="Private cant As Int = 0";
_cant = (int) (0);
RDebugUtils.currentLine=70254594;
 //BA.debugLineNum = 70254594;BA.debugLine="Private cr As Cursor = Starter.skmt.ExecQuery($\"S";
_cr = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_cr = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(mostCurrent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery(("Select rep_cliente, rep_prodid, REP_CANT, REP_RECHAZO from reparto where rep_cliente = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_cliente))+"' and rep_prodid = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_prodid))+"' and REP_RECHAZO = 1"))));
RDebugUtils.currentLine=70254595;
 //BA.debugLineNum = 70254595;BA.debugLine="If cr.RowCount > 0 Then";
if (_cr.getRowCount()>0) { 
RDebugUtils.currentLine=70254596;
 //BA.debugLineNum = 70254596;BA.debugLine="cr.Position = 0";
_cr.setPosition((int) (0));
RDebugUtils.currentLine=70254597;
 //BA.debugLineNum = 70254597;BA.debugLine="cant = cr.GetString(\"REP_CANT\")";
_cant = (int)(Double.parseDouble(_cr.GetString("REP_CANT")));
 };
RDebugUtils.currentLine=70254599;
 //BA.debugLineNum = 70254599;BA.debugLine="Log($\"${cliente}, ${prodId}, rowcont:${cr.RowCoun";
anywheresoftware.b4a.keywords.Common.LogImpl("270254599",(""+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_cliente))+", "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_prodid))+", rowcont:"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_cr.getRowCount()))+", cant: "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_cant))+""),0);
RDebugUtils.currentLine=70254600;
 //BA.debugLineNum = 70254600;BA.debugLine="Return cant";
if (true) return _cant;
RDebugUtils.currentLine=70254601;
 //BA.debugLineNum = 70254601;BA.debugLine="End Sub";
return 0;
}
public static String  _traenombre(anywheresoftware.b4a.BA _ba,String _id) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "traenombre", false))
	 {return ((String) Debug.delegate(null, "traenombre", new Object[] {_ba,_id}));}
String _nombre = "";
anywheresoftware.b4a.sql.SQL.CursorWrapper _idc = null;
RDebugUtils.currentLine=69730304;
 //BA.debugLineNum = 69730304;BA.debugLine="Sub traeNombre(id As String) As String";
RDebugUtils.currentLine=69730305;
 //BA.debugLineNum = 69730305;BA.debugLine="Private nombre As String";
_nombre = "";
RDebugUtils.currentLine=69730306;
 //BA.debugLineNum = 69730306;BA.debugLine="Private idc As Cursor = kmt.ExecQuery($\"select HV";
_idc = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_idc = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_kmt.ExecQuery(("select HVD_PRONOMBRE from HIST_VENTAS where HVD_PROID = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_id))+"'"))));
RDebugUtils.currentLine=69730307;
 //BA.debugLineNum = 69730307;BA.debugLine="idc.Position=0";
_idc.setPosition((int) (0));
RDebugUtils.currentLine=69730308;
 //BA.debugLineNum = 69730308;BA.debugLine="If idc.RowCount > 0 Then nombre = idc.GetString(\"";
if (_idc.getRowCount()>0) { 
_nombre = _idc.GetString("HVD_PRONOMBRE");};
RDebugUtils.currentLine=69730309;
 //BA.debugLineNum = 69730309;BA.debugLine="idc.Close";
_idc.Close();
RDebugUtils.currentLine=69730311;
 //BA.debugLineNum = 69730311;BA.debugLine="Return nombre";
if (true) return _nombre;
RDebugUtils.currentLine=69730312;
 //BA.debugLineNum = 69730312;BA.debugLine="End Sub";
return "";
}
public static String  _traefechareparto(anywheresoftware.b4a.BA _ba) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "traefechareparto", false))
	 {return ((String) Debug.delegate(null, "traefechareparto", new Object[] {_ba}));}
anywheresoftware.b4a.sql.SQL.CursorWrapper _fe = null;
String _f = "";
RDebugUtils.currentLine=70123520;
 //BA.debugLineNum = 70123520;BA.debugLine="Sub traeFechaReparto As String";
RDebugUtils.currentLine=70123521;
 //BA.debugLineNum = 70123521;BA.debugLine="Private fe As Cursor = Starter.skmt.ExecQuery(\"se";
_fe = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_fe = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(mostCurrent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select HVD_FECHA from HIST_VENTAS WHERE HVD_CLIENTE IN (Select CUENTA from cuentaa)")));
RDebugUtils.currentLine=70123522;
 //BA.debugLineNum = 70123522;BA.debugLine="Private f As String = \"-\"";
_f = "-";
RDebugUtils.currentLine=70123523;
 //BA.debugLineNum = 70123523;BA.debugLine="If fe.RowCount > 0 Then";
if (_fe.getRowCount()>0) { 
RDebugUtils.currentLine=70123524;
 //BA.debugLineNum = 70123524;BA.debugLine="fe.Position = 0";
_fe.setPosition((int) (0));
RDebugUtils.currentLine=70123525;
 //BA.debugLineNum = 70123525;BA.debugLine="f = fe.GetString(\"HVD_FECHA\")";
_f = _fe.GetString("HVD_FECHA");
 };
RDebugUtils.currentLine=70123527;
 //BA.debugLineNum = 70123527;BA.debugLine="fe.Close";
_fe.Close();
RDebugUtils.currentLine=70123528;
 //BA.debugLineNum = 70123528;BA.debugLine="Return f";
if (true) return _f;
RDebugUtils.currentLine=70123529;
 //BA.debugLineNum = 70123529;BA.debugLine="End Sub";
return "";
}
public static int  _traemaxcantidad(anywheresoftware.b4a.BA _ba,String _cliente,String _prodid) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "traemaxcantidad", false))
	 {return ((Integer) Debug.delegate(null, "traemaxcantidad", new Object[] {_ba,_cliente,_prodid}));}
int _cant = 0;
anywheresoftware.b4a.sql.SQL.CursorWrapper _cr = null;
RDebugUtils.currentLine=70385664;
 //BA.debugLineNum = 70385664;BA.debugLine="Sub traeMaxCantidad(cliente As String, prodId As S";
RDebugUtils.currentLine=70385665;
 //BA.debugLineNum = 70385665;BA.debugLine="Private cant As Int = 0";
_cant = (int) (0);
RDebugUtils.currentLine=70385666;
 //BA.debugLineNum = 70385666;BA.debugLine="Private cr As Cursor = Starter.skmt.ExecQuery($\"S";
_cr = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_cr = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(mostCurrent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery(("Select hvd_cant from hist_ventas2 where hvd_cliente = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_cliente))+"' and hvd_proid = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_prodid))+"'"))));
RDebugUtils.currentLine=70385668;
 //BA.debugLineNum = 70385668;BA.debugLine="If cr.RowCount > 0 Then";
if (_cr.getRowCount()>0) { 
RDebugUtils.currentLine=70385669;
 //BA.debugLineNum = 70385669;BA.debugLine="cr.Position = 0";
_cr.setPosition((int) (0));
RDebugUtils.currentLine=70385670;
 //BA.debugLineNum = 70385670;BA.debugLine="cant = cr.GetString(\"HVD_CANT\")";
_cant = (int)(Double.parseDouble(_cr.GetString("HVD_CANT")));
 };
RDebugUtils.currentLine=70385672;
 //BA.debugLineNum = 70385672;BA.debugLine="Return cant";
if (true) return _cant;
RDebugUtils.currentLine=70385673;
 //BA.debugLineNum = 70385673;BA.debugLine="End Sub";
return 0;
}
public static int  _traecantidadvendida(anywheresoftware.b4a.BA _ba,String _cliente,String _prodid) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "traecantidadvendida", false))
	 {return ((Integer) Debug.delegate(null, "traecantidadvendida", new Object[] {_ba,_cliente,_prodid}));}
int _cant = 0;
anywheresoftware.b4a.sql.SQL.CursorWrapper _cr = null;
RDebugUtils.currentLine=70320128;
 //BA.debugLineNum = 70320128;BA.debugLine="Sub traeCantidadVendida(cliente As String, prodId";
RDebugUtils.currentLine=70320129;
 //BA.debugLineNum = 70320129;BA.debugLine="Private cant As Int = 0";
_cant = (int) (0);
RDebugUtils.currentLine=70320130;
 //BA.debugLineNum = 70320130;BA.debugLine="Private cr As Cursor = Starter.skmt.ExecQuery($\"S";
_cr = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_cr = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(mostCurrent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery(("Select rep_cliente, rep_prodid, REP_CANT, REP_RECHAZO from reparto where rep_cli_orig = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_cliente))+"' and rep_prodid = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_prodid))+"' and REP_RECHAZO = 0 and REP_CANT > 0"))));
RDebugUtils.currentLine=70320132;
 //BA.debugLineNum = 70320132;BA.debugLine="If cr.RowCount > 0 Then";
if (_cr.getRowCount()>0) { 
RDebugUtils.currentLine=70320133;
 //BA.debugLineNum = 70320133;BA.debugLine="cr.Position = 0";
_cr.setPosition((int) (0));
RDebugUtils.currentLine=70320134;
 //BA.debugLineNum = 70320134;BA.debugLine="cant = cr.GetString(\"REP_CANT\")";
_cant = (int)(Double.parseDouble(_cr.GetString("REP_CANT")));
 };
RDebugUtils.currentLine=70320136;
 //BA.debugLineNum = 70320136;BA.debugLine="Return cant";
if (true) return _cant;
RDebugUtils.currentLine=70320137;
 //BA.debugLineNum = 70320137;BA.debugLine="End Sub";
return 0;
}
public static anywheresoftware.b4a.objects.collections.Map  _traeentregados(anywheresoftware.b4a.BA _ba) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "traeentregados", false))
	 {return ((anywheresoftware.b4a.objects.collections.Map) Debug.delegate(null, "traeentregados", new Object[] {_ba}));}
anywheresoftware.b4a.objects.collections.Map _m = null;
int _cant = 0;
String _monto = "";
anywheresoftware.b4a.sql.SQL.CursorWrapper _rc = null;
RDebugUtils.currentLine=70713344;
 //BA.debugLineNum = 70713344;BA.debugLine="Sub traeEntregados As Map";
RDebugUtils.currentLine=70713345;
 //BA.debugLineNum = 70713345;BA.debugLine="Private m As Map";
_m = new anywheresoftware.b4a.objects.collections.Map();
RDebugUtils.currentLine=70713346;
 //BA.debugLineNum = 70713346;BA.debugLine="Private cant As Int = 0";
_cant = (int) (0);
RDebugUtils.currentLine=70713347;
 //BA.debugLineNum = 70713347;BA.debugLine="Private monto As String = 0";
_monto = BA.NumberToString(0);
RDebugUtils.currentLine=70713348;
 //BA.debugLineNum = 70713348;BA.debugLine="Private rc As Cursor = Starter.skmt.ExecQuery($\"s";
_rc = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_rc = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(mostCurrent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery(("select sum(HVD_CANT) as CUANTOS, sum(HVD_COSTO_TOT) as CUANTO from HIST_VENTAS where HVD_ESTATUS = '1' and HVD_COSTO_TOT <> '0'"))));
RDebugUtils.currentLine=70713349;
 //BA.debugLineNum = 70713349;BA.debugLine="If rc.RowCount > 0 Then";
if (_rc.getRowCount()>0) { 
RDebugUtils.currentLine=70713350;
 //BA.debugLineNum = 70713350;BA.debugLine="rc.Position = 0";
_rc.setPosition((int) (0));
RDebugUtils.currentLine=70713351;
 //BA.debugLineNum = 70713351;BA.debugLine="If rc.GetString(\"CUANTOS\") <> Null Then";
if (_rc.GetString("CUANTOS")!= null) { 
RDebugUtils.currentLine=70713352;
 //BA.debugLineNum = 70713352;BA.debugLine="cant = cant + rc.GetString(\"CUANTOS\")";
_cant = (int) (_cant+(double)(Double.parseDouble(_rc.GetString("CUANTOS"))));
RDebugUtils.currentLine=70713353;
 //BA.debugLineNum = 70713353;BA.debugLine="monto = monto + rc.GetString(\"CUANTO\")";
_monto = BA.NumberToString((double)(Double.parseDouble(_monto))+(double)(Double.parseDouble(_rc.GetString("CUANTO"))));
 };
 };
RDebugUtils.currentLine=70713357;
 //BA.debugLineNum = 70713357;BA.debugLine="Return CreateMap(\"cantidad\": cant, \"monto\": monto";
if (true) return anywheresoftware.b4a.keywords.Common.createMap(new Object[] {(Object)("cantidad"),(Object)(_cant),(Object)("monto"),(Object)(_monto)});
RDebugUtils.currentLine=70713358;
 //BA.debugLineNum = 70713358;BA.debugLine="End Sub";
return null;
}
public static anywheresoftware.b4a.objects.collections.Map  _traerechazados(anywheresoftware.b4a.BA _ba) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "traerechazados", false))
	 {return ((anywheresoftware.b4a.objects.collections.Map) Debug.delegate(null, "traerechazados", new Object[] {_ba}));}
anywheresoftware.b4a.objects.collections.Map _m = null;
int _cant = 0;
String _monto = "";
anywheresoftware.b4a.sql.SQL.CursorWrapper _rc = null;
RDebugUtils.currentLine=70778880;
 //BA.debugLineNum = 70778880;BA.debugLine="Sub traeRechazados As Map";
RDebugUtils.currentLine=70778881;
 //BA.debugLineNum = 70778881;BA.debugLine="Private m As Map";
_m = new anywheresoftware.b4a.objects.collections.Map();
RDebugUtils.currentLine=70778882;
 //BA.debugLineNum = 70778882;BA.debugLine="Private cant As Int = 0";
_cant = (int) (0);
RDebugUtils.currentLine=70778883;
 //BA.debugLineNum = 70778883;BA.debugLine="Private monto As String = 0";
_monto = BA.NumberToString(0);
RDebugUtils.currentLine=70778884;
 //BA.debugLineNum = 70778884;BA.debugLine="Private rc As Cursor = Starter.skmt.ExecQuery($\"s";
_rc = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_rc = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(mostCurrent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery(("select sum(REP_CANT) as CUANTOS, sum(REP_CANT * REP_PRECIO) as CUANTO from REPARTO where REP_RECHAZO = '1' and REP_CANT <> '0'"))));
RDebugUtils.currentLine=70778885;
 //BA.debugLineNum = 70778885;BA.debugLine="If rc.RowCount > 0 Then";
if (_rc.getRowCount()>0) { 
RDebugUtils.currentLine=70778886;
 //BA.debugLineNum = 70778886;BA.debugLine="rc.Position = 0";
_rc.setPosition((int) (0));
RDebugUtils.currentLine=70778887;
 //BA.debugLineNum = 70778887;BA.debugLine="If rc.GetString(\"CUANTOS\") <> Null Then";
if (_rc.GetString("CUANTOS")!= null) { 
RDebugUtils.currentLine=70778888;
 //BA.debugLineNum = 70778888;BA.debugLine="cant = cant + rc.GetString(\"CUANTOS\")";
_cant = (int) (_cant+(double)(Double.parseDouble(_rc.GetString("CUANTOS"))));
RDebugUtils.currentLine=70778889;
 //BA.debugLineNum = 70778889;BA.debugLine="monto = monto + rc.GetString(\"CUANTO\")";
_monto = BA.NumberToString((double)(Double.parseDouble(_monto))+(double)(Double.parseDouble(_rc.GetString("CUANTO"))));
 };
 };
RDebugUtils.currentLine=70778893;
 //BA.debugLineNum = 70778893;BA.debugLine="Return CreateMap(\"cantidad\": cant, \"monto\": monto";
if (true) return anywheresoftware.b4a.keywords.Common.createMap(new Object[] {(Object)("cantidad"),(Object)(_cant),(Object)("monto"),(Object)(_monto)});
RDebugUtils.currentLine=70778894;
 //BA.debugLineNum = 70778894;BA.debugLine="End Sub";
return null;
}
public static anywheresoftware.b4a.objects.collections.Map  _traevendidos(anywheresoftware.b4a.BA _ba) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "traevendidos", false))
	 {return ((anywheresoftware.b4a.objects.collections.Map) Debug.delegate(null, "traevendidos", new Object[] {_ba}));}
anywheresoftware.b4a.objects.collections.Map _m = null;
int _cant = 0;
String _monto = "";
anywheresoftware.b4a.sql.SQL.CursorWrapper _rc = null;
RDebugUtils.currentLine=70844416;
 //BA.debugLineNum = 70844416;BA.debugLine="Sub traeVendidos As Map";
RDebugUtils.currentLine=70844417;
 //BA.debugLineNum = 70844417;BA.debugLine="Private m As Map";
_m = new anywheresoftware.b4a.objects.collections.Map();
RDebugUtils.currentLine=70844418;
 //BA.debugLineNum = 70844418;BA.debugLine="Private cant As Int = 0";
_cant = (int) (0);
RDebugUtils.currentLine=70844419;
 //BA.debugLineNum = 70844419;BA.debugLine="Private monto As String = 0";
_monto = BA.NumberToString(0);
RDebugUtils.currentLine=70844420;
 //BA.debugLineNum = 70844420;BA.debugLine="Private rc As Cursor = Starter.skmt.ExecQuery($\"s";
_rc = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_rc = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(mostCurrent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery(("select sum(REP_CANT) as CUANTOS, sum(REP_CANT * REP_PRECIO) as CUANTO from REPARTO where REP_RECHAZO = '0' and REP_CANT <> '0'"))));
RDebugUtils.currentLine=70844421;
 //BA.debugLineNum = 70844421;BA.debugLine="If rc.RowCount > 0 Then";
if (_rc.getRowCount()>0) { 
RDebugUtils.currentLine=70844422;
 //BA.debugLineNum = 70844422;BA.debugLine="rc.Position = 0";
_rc.setPosition((int) (0));
RDebugUtils.currentLine=70844423;
 //BA.debugLineNum = 70844423;BA.debugLine="If rc.GetString(\"CUANTOS\") <> Null Then";
if (_rc.GetString("CUANTOS")!= null) { 
RDebugUtils.currentLine=70844424;
 //BA.debugLineNum = 70844424;BA.debugLine="cant = cant + rc.GetString(\"CUANTOS\")";
_cant = (int) (_cant+(double)(Double.parseDouble(_rc.GetString("CUANTOS"))));
RDebugUtils.currentLine=70844425;
 //BA.debugLineNum = 70844425;BA.debugLine="monto = monto + rc.GetString(\"CUANTO\")";
_monto = BA.NumberToString((double)(Double.parseDouble(_monto))+(double)(Double.parseDouble(_rc.GetString("CUANTO"))));
 };
 };
RDebugUtils.currentLine=70844429;
 //BA.debugLineNum = 70844429;BA.debugLine="Return CreateMap(\"cantidad\": cant, \"monto\": monto";
if (true) return anywheresoftware.b4a.keywords.Common.createMap(new Object[] {(Object)("cantidad"),(Object)(_cant),(Object)("monto"),(Object)(_monto)});
RDebugUtils.currentLine=70844430;
 //BA.debugLineNum = 70844430;BA.debugLine="End Sub";
return null;
}
public static String  _dameusuariodedb(anywheresoftware.b4a.BA _ba) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "dameusuariodedb", false))
	 {return ((String) Debug.delegate(null, "dameusuariodedb", new Object[] {_ba}));}
anywheresoftware.b4a.sql.SQL.CursorWrapper _c = null;
String _u = "";
RDebugUtils.currentLine=69337088;
 //BA.debugLineNum = 69337088;BA.debugLine="Sub dameUsuarioDeDB As String 'ignore";
RDebugUtils.currentLine=69337089;
 //BA.debugLineNum = 69337089;BA.debugLine="Private c As Cursor";
_c = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
RDebugUtils.currentLine=69337090;
 //BA.debugLineNum = 69337090;BA.debugLine="Private u As String = \"SinUsuario\"";
_u = "SinUsuario";
RDebugUtils.currentLine=69337091;
 //BA.debugLineNum = 69337091;BA.debugLine="If Not(kmt.IsInitialized) Then revisaBD";
if (anywheresoftware.b4a.keywords.Common.Not(_kmt.IsInitialized())) { 
_revisabd(_ba);};
RDebugUtils.currentLine=69337092;
 //BA.debugLineNum = 69337092;BA.debugLine="c=kmt.ExecQuery(\"select USUARIO from usuarioa\")";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_kmt.ExecQuery("select USUARIO from usuarioa")));
RDebugUtils.currentLine=69337093;
 //BA.debugLineNum = 69337093;BA.debugLine="c.Position=0";
_c.setPosition((int) (0));
RDebugUtils.currentLine=69337094;
 //BA.debugLineNum = 69337094;BA.debugLine="If c.RowCount > 0 Then u = c.GetString(\"USUARIO\")";
if (_c.getRowCount()>0) { 
_u = _c.GetString("USUARIO");};
RDebugUtils.currentLine=69337095;
 //BA.debugLineNum = 69337095;BA.debugLine="c.Close";
_c.Close();
RDebugUtils.currentLine=69337096;
 //BA.debugLineNum = 69337096;BA.debugLine="Return u";
if (true) return _u;
RDebugUtils.currentLine=69337097;
 //BA.debugLineNum = 69337097;BA.debugLine="End Sub";
return "";
}
public static String  _traerutaprev(anywheresoftware.b4a.BA _ba) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "traerutaprev", false))
	 {return ((String) Debug.delegate(null, "traerutaprev", new Object[] {_ba}));}
anywheresoftware.b4a.sql.SQL.CursorWrapper _c = null;
String _a = "";
RDebugUtils.currentLine=71237632;
 //BA.debugLineNum = 71237632;BA.debugLine="Sub traerUTAPREV As String 'ignore";
RDebugUtils.currentLine=71237633;
 //BA.debugLineNum = 71237633;BA.debugLine="Private c As Cursor";
_c = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
RDebugUtils.currentLine=71237634;
 //BA.debugLineNum = 71237634;BA.debugLine="Private a As String";
_a = "";
RDebugUtils.currentLine=71237635;
 //BA.debugLineNum = 71237635;BA.debugLine="c = Starter.skmt.ExecQuery(\"select CAT_CL_RUTA fr";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(mostCurrent._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=71237636;
 //BA.debugLineNum = 71237636;BA.debugLine="c.Position = 0";
_c.setPosition((int) (0));
RDebugUtils.currentLine=71237637;
 //BA.debugLineNum = 71237637;BA.debugLine="a = C.GetString(\"CAT_CL_RUTA\")";
_a = _c.GetString("CAT_CL_RUTA");
RDebugUtils.currentLine=71237638;
 //BA.debugLineNum = 71237638;BA.debugLine="c.Close";
_c.Close();
RDebugUtils.currentLine=71237639;
 //BA.debugLineNum = 71237639;BA.debugLine="Return a";
if (true) return _a;
RDebugUtils.currentLine=71237640;
 //BA.debugLineNum = 71237640;BA.debugLine="End Sub";
return "";
}
public static String  _traeusuario(anywheresoftware.b4a.BA _ba) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "traeusuario", false))
	 {return ((String) Debug.delegate(null, "traeusuario", new Object[] {_ba}));}
anywheresoftware.b4a.sql.SQL.CursorWrapper _c = null;
String _a = "";
RDebugUtils.currentLine=71106560;
 //BA.debugLineNum = 71106560;BA.debugLine="Sub traeUsuario As String 'ignore";
RDebugUtils.currentLine=71106561;
 //BA.debugLineNum = 71106561;BA.debugLine="Private c As Cursor";
_c = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
RDebugUtils.currentLine=71106562;
 //BA.debugLineNum = 71106562;BA.debugLine="Private a As String";
_a = "";
RDebugUtils.currentLine=71106563;
 //BA.debugLineNum = 71106563;BA.debugLine="c = Starter.skmt.ExecQuery(\"select USUARIO from U";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(mostCurrent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select USUARIO from USUARIOA")));
RDebugUtils.currentLine=71106564;
 //BA.debugLineNum = 71106564;BA.debugLine="c.Position = 0";
_c.setPosition((int) (0));
RDebugUtils.currentLine=71106565;
 //BA.debugLineNum = 71106565;BA.debugLine="a = C.GetString(\"USUARIO\")";
_a = _c.GetString("USUARIO");
RDebugUtils.currentLine=71106566;
 //BA.debugLineNum = 71106566;BA.debugLine="c.Close";
_c.Close();
RDebugUtils.currentLine=71106567;
 //BA.debugLineNum = 71106567;BA.debugLine="Return a";
if (true) return _a;
RDebugUtils.currentLine=71106568;
 //BA.debugLineNum = 71106568;BA.debugLine="End Sub";
return "";
}
public static anywheresoftware.b4a.objects.drawable.CanvasWrapper.BitmapWrapper  _createbitmapwithnumber(anywheresoftware.b4a.BA _ba,anywheresoftware.b4a.objects.drawable.CanvasWrapper.BitmapWrapper _originalbitmap,int _number) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "createbitmapwithnumber", false))
	 {return ((anywheresoftware.b4a.objects.drawable.CanvasWrapper.BitmapWrapper) Debug.delegate(null, "createbitmapwithnumber", new Object[] {_ba,_originalbitmap,_number}));}
anywheresoftware.b4a.objects.drawable.CanvasWrapper.BitmapWrapper _newbitmap = null;
anywheresoftware.b4a.objects.drawable.CanvasWrapper _canvas = null;
anywheresoftware.b4a.objects.drawable.CanvasWrapper.RectWrapper _destrect = null;
RDebugUtils.currentLine=71303168;
 //BA.debugLineNum = 71303168;BA.debugLine="Sub CreateBitmapWithNumber(OriginalBitmap As Bitma";
RDebugUtils.currentLine=71303169;
 //BA.debugLineNum = 71303169;BA.debugLine="Dim NewBitmap As Bitmap";
_newbitmap = new anywheresoftware.b4a.objects.drawable.CanvasWrapper.BitmapWrapper();
RDebugUtils.currentLine=71303170;
 //BA.debugLineNum = 71303170;BA.debugLine="NewBitmap.InitializeMutable(OriginalBitmap.Width,";
_newbitmap.InitializeMutable(_originalbitmap.getWidth(),_originalbitmap.getHeight());
RDebugUtils.currentLine=71303172;
 //BA.debugLineNum = 71303172;BA.debugLine="Dim Canvas As Canvas";
_canvas = new anywheresoftware.b4a.objects.drawable.CanvasWrapper();
RDebugUtils.currentLine=71303173;
 //BA.debugLineNum = 71303173;BA.debugLine="Canvas.Initialize2(NewBitmap)";
_canvas.Initialize2((android.graphics.Bitmap)(_newbitmap.getObject()));
RDebugUtils.currentLine=71303176;
 //BA.debugLineNum = 71303176;BA.debugLine="Dim DestRect As Rect";
_destrect = new anywheresoftware.b4a.objects.drawable.CanvasWrapper.RectWrapper();
RDebugUtils.currentLine=71303177;
 //BA.debugLineNum = 71303177;BA.debugLine="DestRect.Initialize(0, 0, OriginalBitmap.Width, O";
_destrect.Initialize((int) (0),(int) (0),_originalbitmap.getWidth(),_originalbitmap.getHeight());
RDebugUtils.currentLine=71303180;
 //BA.debugLineNum = 71303180;BA.debugLine="Canvas.DrawBitmap(OriginalBitmap, Null, DestRect)";
_canvas.DrawBitmap((android.graphics.Bitmap)(_originalbitmap.getObject()),(android.graphics.Rect)(anywheresoftware.b4a.keywords.Common.Null),(android.graphics.Rect)(_destrect.getObject()));
RDebugUtils.currentLine=71303183;
 //BA.debugLineNum = 71303183;BA.debugLine="Canvas.DrawText(Number, (OriginalBitmap.Width / 2";
_canvas.DrawText(_ba,BA.NumberToString(_number),(float) ((_originalbitmap.getWidth()/(double)2)),(float) ((_originalbitmap.getHeight()/(double)2.4)),anywheresoftware.b4a.keywords.Common.Typeface.DEFAULT,(float) (20),anywheresoftware.b4a.keywords.Common.Colors.White,BA.getEnumFromString(android.graphics.Paint.Align.class,"CENTER"));
RDebugUtils.currentLine=71303185;
 //BA.debugLineNum = 71303185;BA.debugLine="Return NewBitmap";
if (true) return _newbitmap;
RDebugUtils.currentLine=71303186;
 //BA.debugLineNum = 71303186;BA.debugLine="End Sub";
return null;
}
public static String  _borraarribade100errores(anywheresoftware.b4a.BA _ba) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "borraarribade100errores", false))
	 {return ((String) Debug.delegate(null, "borraarribade100errores", new Object[] {_ba}));}
RDebugUtils.currentLine=68747264;
 //BA.debugLineNum = 68747264;BA.debugLine="Sub borraArribaDe100Errores 'ignore";
RDebugUtils.currentLine=68747265;
 //BA.debugLineNum = 68747265;BA.debugLine="If Not(errorLog.IsInitialized) Then revisaBD";
if (anywheresoftware.b4a.keywords.Common.Not(_errorlog.IsInitialized())) { 
_revisabd(_ba);};
RDebugUtils.currentLine=68747266;
 //BA.debugLineNum = 68747266;BA.debugLine="LogColor(\"Recortamos la tabla de Errores, limite";
anywheresoftware.b4a.keywords.Common.LogImpl("268747266","Recortamos la tabla de Errores, limite de 100",anywheresoftware.b4a.keywords.Common.Colors.Magenta);
RDebugUtils.currentLine=68747267;
 //BA.debugLineNum = 68747267;BA.debugLine="errorLog.ExecNonQuery(\"DELETE FROM errores WHERE";
_errorlog.ExecNonQuery("DELETE FROM errores WHERE fecha NOT in (SELECT fecha FROM errores ORDER BY fecha desc LIMIT 99 )");
RDebugUtils.currentLine=68747268;
 //BA.debugLineNum = 68747268;BA.debugLine="errorLog.ExecNonQuery(\"vacuum;\")";
_errorlog.ExecNonQuery("vacuum;");
RDebugUtils.currentLine=68747270;
 //BA.debugLineNum = 68747270;BA.debugLine="End Sub";
return "";
}
public static String  _revisabd(anywheresoftware.b4a.BA _ba) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "revisabd", false))
	 {return ((String) Debug.delegate(null, "revisabd", new Object[] {_ba}));}
anywheresoftware.b4a.sql.SQL.CursorWrapper _c = null;
RDebugUtils.currentLine=67764224;
 //BA.debugLineNum = 67764224;BA.debugLine="Sub revisaBD 'ignore";
RDebugUtils.currentLine=67764225;
 //BA.debugLineNum = 67764225;BA.debugLine="If Not(File.Exists(Starter.ruta, \"kmt.db\")) Then";
if (anywheresoftware.b4a.keywords.Common.Not(anywheresoftware.b4a.keywords.Common.File.Exists(mostCurrent._starter._ruta /*String*/ ,"kmt.db"))) { 
anywheresoftware.b4a.keywords.Common.File.Copy(anywheresoftware.b4a.keywords.Common.File.getDirAssets(),"kmt.db",mostCurrent._starter._ruta /*String*/ ,"kmt.db");};
RDebugUtils.currentLine=67764226;
 //BA.debugLineNum = 67764226;BA.debugLine="If Not(kmt.IsInitialized) Then kmt.Initialize(Sta";
if (anywheresoftware.b4a.keywords.Common.Not(_kmt.IsInitialized())) { 
_kmt.Initialize(mostCurrent._starter._ruta /*String*/ ,"kmt.db",anywheresoftware.b4a.keywords.Common.True);};
RDebugUtils.currentLine=67764227;
 //BA.debugLineNum = 67764227;BA.debugLine="kmt.ExecNonQuery(\"CREATE TABLE IF NOT EXISTS RUTA";
_kmt.ExecNonQuery("CREATE TABLE IF NOT EXISTS RUTA_GPS(FECHA INTEGER, LAT TEXT, LON TEXT)");
RDebugUtils.currentLine=67764229;
 //BA.debugLineNum = 67764229;BA.debugLine="kmt.ExecNonQuery(\"CREATE TABLE IF NOT EXISTS bita";
_kmt.ExecNonQuery("CREATE TABLE IF NOT EXISTS bitacora(fecha INTEGER, texto TEXT)");
RDebugUtils.currentLine=67764231;
 //BA.debugLineNum = 67764231;BA.debugLine="kmt.ExecNonQuery(\"DROP TABLE IF EXISTS CAT_FOLIOS";
_kmt.ExecNonQuery("DROP TABLE IF EXISTS CAT_FOLIOS");
RDebugUtils.currentLine=67764232;
 //BA.debugLineNum = 67764232;BA.debugLine="kmt.ExecNonQuery(\"CREATE TABLE IF NOT EXISTS REPA";
_kmt.ExecNonQuery("CREATE TABLE IF NOT EXISTS REPARTO_GEO (CLIENTE TEXT, USUARIO TEXT, FECHA_PUNTEO TEXT, LATITUD TEXT, LONGITUD TEXT, ALMACEN TEXT, RUTA_REPARTO TEXT, RUTA_PREV TEXT, FECHA_PREVENTA TEXT, MOTIVO TEXT, COMENTARIO TEXT, TIPO TEXT, ENVIO TEXT)");
RDebugUtils.currentLine=67764234;
 //BA.debugLineNum = 67764234;BA.debugLine="If Not(errorLog.IsInitialized) Then errorLog.Init";
if (anywheresoftware.b4a.keywords.Common.Not(_errorlog.IsInitialized())) { 
_errorlog.Initialize(mostCurrent._starter._ruta /*String*/ ,"errorLog.db",anywheresoftware.b4a.keywords.Common.True);};
RDebugUtils.currentLine=67764235;
 //BA.debugLineNum = 67764235;BA.debugLine="errorLog.ExecNonQuery(\"CREATE TABLE IF NOT EXISTS";
_errorlog.ExecNonQuery("CREATE TABLE IF NOT EXISTS errores(fecha INTEGER, error TEXT)");
RDebugUtils.currentLine=67764237;
 //BA.debugLineNum = 67764237;BA.debugLine="Try 'Intentamos usar \"pragma_table_info\" para rev";
try {RDebugUtils.currentLine=67764238;
 //BA.debugLineNum = 67764238;BA.debugLine="Dim c As Cursor=kmt.ExecQuery(\"SELECT COUNT(*) A";
_c = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_kmt.ExecQuery("SELECT COUNT(*) AS fCol FROM pragma_table_info('noventa') WHERE name='NV_REPROGRAMAR'")));
RDebugUtils.currentLine=67764239;
 //BA.debugLineNum = 67764239;BA.debugLine="c.Position = 0";
_c.setPosition((int) (0));
RDebugUtils.currentLine=67764240;
 //BA.debugLineNum = 67764240;BA.debugLine="If c.GetString(\"fCol\") = 0 Then 'Si no esta la c";
if ((_c.GetString("fCol")).equals(BA.NumberToString(0))) { 
RDebugUtils.currentLine=67764241;
 //BA.debugLineNum = 67764241;BA.debugLine="kmt.ExecNonQuery(\"ALTER TABLE noventa ADD COLUM";
_kmt.ExecNonQuery("ALTER TABLE noventa ADD COLUMN NV_REPROGRAMAR TEXT");
 };
 } 
       catch (Exception e16) {
			(_ba.processBA == null ? _ba : _ba.processBA).setLastException(e16);RDebugUtils.currentLine=67764244;
 //BA.debugLineNum = 67764244;BA.debugLine="Try";
try {RDebugUtils.currentLine=67764245;
 //BA.debugLineNum = 67764245;BA.debugLine="kmt.ExecNonQuery(\"ALTER TABLE noventa ADD COLUM";
_kmt.ExecNonQuery("ALTER TABLE noventa ADD COLUMN NV_REPROGRAMAR TEXT");
 } 
       catch (Exception e19) {
			(_ba.processBA == null ? _ba : _ba.processBA).setLastException(e19);RDebugUtils.currentLine=67764247;
 //BA.debugLineNum = 67764247;BA.debugLine="Log(LastException)";
anywheresoftware.b4a.keywords.Common.LogImpl("267764247",BA.ObjectToString(anywheresoftware.b4a.keywords.Common.LastException(_ba)),0);
 };
 };
RDebugUtils.currentLine=67764250;
 //BA.debugLineNum = 67764250;BA.debugLine="End Sub";
return "";
}
public static String  _borraarribade600renglonesbitacora(anywheresoftware.b4a.BA _ba) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "borraarribade600renglonesbitacora", false))
	 {return ((String) Debug.delegate(null, "borraarribade600renglonesbitacora", new Object[] {_ba}));}
anywheresoftware.b4a.sql.SQL.CursorWrapper _c = null;
RDebugUtils.currentLine=68812800;
 //BA.debugLineNum = 68812800;BA.debugLine="Sub borraArribaDe600RenglonesBitacora 'ignore";
RDebugUtils.currentLine=68812801;
 //BA.debugLineNum = 68812801;BA.debugLine="revisaBD";
_revisabd(_ba);
RDebugUtils.currentLine=68812802;
 //BA.debugLineNum = 68812802;BA.debugLine="LogColor(\"Recortamos la tabla de la Bitacora, lim";
anywheresoftware.b4a.keywords.Common.LogImpl("268812802","Recortamos la tabla de la Bitacora, limite de 600",anywheresoftware.b4a.keywords.Common.Colors.Magenta);
RDebugUtils.currentLine=68812803;
 //BA.debugLineNum = 68812803;BA.debugLine="Private c As Cursor";
_c = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
RDebugUtils.currentLine=68812804;
 //BA.debugLineNum = 68812804;BA.debugLine="c = kmt.ExecQuery(\"select fecha from bitacora\")";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_kmt.ExecQuery("select fecha from bitacora")));
RDebugUtils.currentLine=68812805;
 //BA.debugLineNum = 68812805;BA.debugLine="c.Position = 0";
_c.setPosition((int) (0));
RDebugUtils.currentLine=68812806;
 //BA.debugLineNum = 68812806;BA.debugLine="If c.RowCount > 650 Then";
if (_c.getRowCount()>650) { 
RDebugUtils.currentLine=68812807;
 //BA.debugLineNum = 68812807;BA.debugLine="kmt.ExecNonQuery(\"DELETE FROM bitacora WHERE fec";
_kmt.ExecNonQuery("DELETE FROM bitacora WHERE fecha NOT in (SELECT fecha FROM bitacora ORDER BY fecha desc LIMIT 599 )");
RDebugUtils.currentLine=68812808;
 //BA.debugLineNum = 68812808;BA.debugLine="kmt.ExecNonQuery(\"vacuum;\")";
_kmt.ExecNonQuery("vacuum;");
 };
RDebugUtils.currentLine=68812811;
 //BA.debugLineNum = 68812811;BA.debugLine="c.Close";
_c.Close();
RDebugUtils.currentLine=68812812;
 //BA.debugLineNum = 68812812;BA.debugLine="End Sub";
return "";
}
public static String  _borralogdb(anywheresoftware.b4a.BA _ba) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "borralogdb", false))
	 {return ((String) Debug.delegate(null, "borralogdb", new Object[] {_ba}));}
RDebugUtils.currentLine=68419584;
 //BA.debugLineNum = 68419584;BA.debugLine="Sub borraLogDB 'ignore";
RDebugUtils.currentLine=68419585;
 //BA.debugLineNum = 68419585;BA.debugLine="LogColor(\"Borramos BD de log\", Colors.Magenta)";
anywheresoftware.b4a.keywords.Common.LogImpl("268419585","Borramos BD de log",anywheresoftware.b4a.keywords.Common.Colors.Magenta);
RDebugUtils.currentLine=68419586;
 //BA.debugLineNum = 68419586;BA.debugLine="kmt.ExecNonQuery(\"delete from bitacora\")";
_kmt.ExecNonQuery("delete from bitacora");
RDebugUtils.currentLine=68419587;
 //BA.debugLineNum = 68419587;BA.debugLine="kmt.ExecNonQuery(\"vacuum;\")";
_kmt.ExecNonQuery("vacuum;");
RDebugUtils.currentLine=68419588;
 //BA.debugLineNum = 68419588;BA.debugLine="End Sub";
return "";
}
public static String  _borramosarchivogps(anywheresoftware.b4a.BA _ba) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "borramosarchivogps", false))
	 {return ((String) Debug.delegate(null, "borramosarchivogps", new Object[] {_ba}));}
anywheresoftware.b4a.objects.streams.File.OutputStreamWrapper _out = null;
String _s = "";
byte[] _t = null;
RDebugUtils.currentLine=67698688;
 //BA.debugLineNum = 67698688;BA.debugLine="Sub borramosArchivoGPS 'ignore";
RDebugUtils.currentLine=67698689;
 //BA.debugLineNum = 67698689;BA.debugLine="Dim out As OutputStream = File.OpenOutput(File.Di";
_out = new anywheresoftware.b4a.objects.streams.File.OutputStreamWrapper();
_out = anywheresoftware.b4a.keywords.Common.File.OpenOutput(anywheresoftware.b4a.keywords.Common.File.getDirInternal(),"gps.txt",anywheresoftware.b4a.keywords.Common.False);
RDebugUtils.currentLine=67698690;
 //BA.debugLineNum = 67698690;BA.debugLine="Dim s As String = \"\"";
_s = "";
RDebugUtils.currentLine=67698691;
 //BA.debugLineNum = 67698691;BA.debugLine="Dim t() As Byte = s.GetBytes(\"UTF-8\")";
_t = _s.getBytes("UTF-8");
RDebugUtils.currentLine=67698692;
 //BA.debugLineNum = 67698692;BA.debugLine="out.WriteBytes(t, 0, t.Length)";
_out.WriteBytes(_t,(int) (0),_t.length);
RDebugUtils.currentLine=67698693;
 //BA.debugLineNum = 67698693;BA.debugLine="out.Close";
_out.Close();
RDebugUtils.currentLine=67698694;
 //BA.debugLineNum = 67698694;BA.debugLine="End Sub";
return "";
}
public static String  _compress(anywheresoftware.b4a.BA _ba,String _str) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "compress", false))
	 {return ((String) Debug.delegate(null, "compress", new Object[] {_ba,_str}));}
byte[] _compressed = null;
String _base64 = "";
RDebugUtils.currentLine=66977792;
 //BA.debugLineNum = 66977792;BA.debugLine="Sub compress(str As String) As String 'ignore";
RDebugUtils.currentLine=66977794;
 //BA.debugLineNum = 66977794;BA.debugLine="Dim compressed() As Byte = GZip.compress(str)";
_compressed = _gzip.compress(_str);
RDebugUtils.currentLine=66977797;
 //BA.debugLineNum = 66977797;BA.debugLine="Dim base64 As String = su.EncodeBase64(compressed";
_base64 = _su.EncodeBase64(_compressed);
RDebugUtils.currentLine=66977798;
 //BA.debugLineNum = 66977798;BA.debugLine="Log($\"Comprimido: ${base64.Length}\"$)";
anywheresoftware.b4a.keywords.Common.LogImpl("266977798",("Comprimido: "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_base64.length()))+""),0);
RDebugUtils.currentLine=66977800;
 //BA.debugLineNum = 66977800;BA.debugLine="Return base64";
if (true) return _base64;
RDebugUtils.currentLine=66977801;
 //BA.debugLineNum = 66977801;BA.debugLine="End Sub";
return "";
}
public static String  _copiadb(anywheresoftware.b4a.BA _ba,boolean _result) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "copiadb", false))
	 {return ((String) Debug.delegate(null, "copiadb", new Object[] {_ba,_result}));}
String _p = "";
String _thedir = "";
RDebugUtils.currentLine=69140480;
 //BA.debugLineNum = 69140480;BA.debugLine="Sub copiaDB(result As Boolean) 'ignore";
RDebugUtils.currentLine=69140481;
 //BA.debugLineNum = 69140481;BA.debugLine="If result Then";
if (_result) { 
RDebugUtils.currentLine=69140482;
 //BA.debugLineNum = 69140482;BA.debugLine="Dim p As String";
_p = "";
RDebugUtils.currentLine=69140483;
 //BA.debugLineNum = 69140483;BA.debugLine="If File.ExternalWritable Then";
if (anywheresoftware.b4a.keywords.Common.File.getExternalWritable()) { 
RDebugUtils.currentLine=69140484;
 //BA.debugLineNum = 69140484;BA.debugLine="p = File.DirInternal";
_p = anywheresoftware.b4a.keywords.Common.File.getDirInternal();
 }else {
RDebugUtils.currentLine=69140487;
 //BA.debugLineNum = 69140487;BA.debugLine="p = File.DirInternal";
_p = anywheresoftware.b4a.keywords.Common.File.getDirInternal();
 };
RDebugUtils.currentLine=69140490;
 //BA.debugLineNum = 69140490;BA.debugLine="Dim theDir As String";
_thedir = "";
RDebugUtils.currentLine=69140491;
 //BA.debugLineNum = 69140491;BA.debugLine="Try";
try {RDebugUtils.currentLine=69140492;
 //BA.debugLineNum = 69140492;BA.debugLine="File.MakeDir(File.DirInternal,\"kmts\")";
anywheresoftware.b4a.keywords.Common.File.MakeDir(anywheresoftware.b4a.keywords.Common.File.getDirInternal(),"kmts");
RDebugUtils.currentLine=69140493;
 //BA.debugLineNum = 69140493;BA.debugLine="theDir = \"/kmts\"";
_thedir = "/kmts";
 } 
       catch (Exception e13) {
			(_ba.processBA == null ? _ba : _ba.processBA).setLastException(e13);RDebugUtils.currentLine=69140495;
 //BA.debugLineNum = 69140495;BA.debugLine="theDir = \"\"";
_thedir = "";
 };
RDebugUtils.currentLine=69140497;
 //BA.debugLineNum = 69140497;BA.debugLine="Try";
try {RDebugUtils.currentLine=69140498;
 //BA.debugLineNum = 69140498;BA.debugLine="File.Copy(File.DirInternal,\"kmt.db\",File.DirInt";
anywheresoftware.b4a.keywords.Common.File.Copy(anywheresoftware.b4a.keywords.Common.File.getDirInternal(),"kmt.db",anywheresoftware.b4a.keywords.Common.File.getDirInternal()+_thedir,"guna_rep_kmt.db");
RDebugUtils.currentLine=69140499;
 //BA.debugLineNum = 69140499;BA.debugLine="ToastMessageShow(\"BD copiada!\", False)";
anywheresoftware.b4a.keywords.Common.ToastMessageShow(BA.ObjectToCharSequence("BD copiada!"),anywheresoftware.b4a.keywords.Common.False);
 } 
       catch (Exception e19) {
			(_ba.processBA == null ? _ba : _ba.processBA).setLastException(e19);RDebugUtils.currentLine=69140501;
 //BA.debugLineNum = 69140501;BA.debugLine="ToastMessageShow(\"No se pudo hacer la copia: \"&";
anywheresoftware.b4a.keywords.Common.ToastMessageShow(BA.ObjectToCharSequence("No se pudo hacer la copia: "+BA.ObjectToString(anywheresoftware.b4a.keywords.Common.LastException(_ba))),anywheresoftware.b4a.keywords.Common.True);
 };
RDebugUtils.currentLine=69140503;
 //BA.debugLineNum = 69140503;BA.debugLine="Log(\"rootExternal=\"&p)";
anywheresoftware.b4a.keywords.Common.LogImpl("269140503","rootExternal="+_p,0);
RDebugUtils.currentLine=69140504;
 //BA.debugLineNum = 69140504;BA.debugLine="Log(\"File.DirInternal=\"&File.DirInternal)";
anywheresoftware.b4a.keywords.Common.LogImpl("269140504","File.DirInternal="+anywheresoftware.b4a.keywords.Common.File.getDirInternal(),0);
RDebugUtils.currentLine=69140505;
 //BA.debugLineNum = 69140505;BA.debugLine="Log(\"File.DirInternal=\"&File.DirInternal)";
anywheresoftware.b4a.keywords.Common.LogImpl("269140505","File.DirInternal="+anywheresoftware.b4a.keywords.Common.File.getDirInternal(),0);
 }else {
RDebugUtils.currentLine=69140507;
 //BA.debugLineNum = 69140507;BA.debugLine="ToastMessageShow(\"Sin permisos\", False)";
anywheresoftware.b4a.keywords.Common.ToastMessageShow(BA.ObjectToCharSequence("Sin permisos"),anywheresoftware.b4a.keywords.Common.False);
 };
RDebugUtils.currentLine=69140509;
 //BA.debugLineNum = 69140509;BA.debugLine="End Sub";
return "";
}
public static String  _dameerroresjson(anywheresoftware.b4a.BA _ba,anywheresoftware.b4a.sql.SQL _sql,int _maxerrores,boolean _comprimido) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "dameerroresjson", false))
	 {return ((String) Debug.delegate(null, "dameerroresjson", new Object[] {_ba,_sql,_maxerrores,_comprimido}));}
anywheresoftware.b4a.objects.collections.JSONParser.JSONGenerator _j = null;
String _lim = "";
anywheresoftware.b4a.sql.SQL.ResultSetWrapper _cur = null;
anywheresoftware.b4a.objects.collections.List _l = null;
int _i = 0;
anywheresoftware.b4a.objects.collections.Map _m = null;
anywheresoftware.b4a.objects.collections.Map _m2 = null;
RDebugUtils.currentLine=68943872;
 //BA.debugLineNum = 68943872;BA.debugLine="Sub dameErroresJSON(SQL As SQL, maxErrores As Int,";
RDebugUtils.currentLine=68943873;
 //BA.debugLineNum = 68943873;BA.debugLine="Log(\"dameErroresJSON\")";
anywheresoftware.b4a.keywords.Common.LogImpl("268943873","dameErroresJSON",0);
RDebugUtils.currentLine=68943874;
 //BA.debugLineNum = 68943874;BA.debugLine="Private j As JSONGenerator";
_j = new anywheresoftware.b4a.objects.collections.JSONParser.JSONGenerator();
RDebugUtils.currentLine=68943875;
 //BA.debugLineNum = 68943875;BA.debugLine="Private lim As String";
_lim = "";
RDebugUtils.currentLine=68943876;
 //BA.debugLineNum = 68943876;BA.debugLine="Private cur As ResultSet";
_cur = new anywheresoftware.b4a.sql.SQL.ResultSetWrapper();
RDebugUtils.currentLine=68943877;
 //BA.debugLineNum = 68943877;BA.debugLine="Private l As List";
_l = new anywheresoftware.b4a.objects.collections.List();
RDebugUtils.currentLine=68943878;
 //BA.debugLineNum = 68943878;BA.debugLine="Private i As Int = 0";
_i = (int) (0);
RDebugUtils.currentLine=68943879;
 //BA.debugLineNum = 68943879;BA.debugLine="l.Initialize";
_l.Initialize();
RDebugUtils.currentLine=68943880;
 //BA.debugLineNum = 68943880;BA.debugLine="Dim m, m2 As Map";
_m = new anywheresoftware.b4a.objects.collections.Map();
_m2 = new anywheresoftware.b4a.objects.collections.Map();
RDebugUtils.currentLine=68943881;
 //BA.debugLineNum = 68943881;BA.debugLine="m2.Initialize";
_m2.Initialize();
RDebugUtils.currentLine=68943882;
 //BA.debugLineNum = 68943882;BA.debugLine="If maxErrores = 0 Then lim = \"\" Else lim = \"limit";
if (_maxerrores==0) { 
_lim = "";}
else {
_lim = "limit "+BA.NumberToString(_maxerrores);};
RDebugUtils.currentLine=68943883;
 //BA.debugLineNum = 68943883;BA.debugLine="cur = SQL.ExecQuery(\"select * from errores order";
_cur = (anywheresoftware.b4a.sql.SQL.ResultSetWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.ResultSetWrapper(), (android.database.Cursor)(_sql.ExecQuery("select * from errores order by fecha desc "+_lim)));
RDebugUtils.currentLine=68943884;
 //BA.debugLineNum = 68943884;BA.debugLine="Do While cur.NextRow";
while (_cur.NextRow()) {
RDebugUtils.currentLine=68943885;
 //BA.debugLineNum = 68943885;BA.debugLine="m.Initialize";
_m.Initialize();
RDebugUtils.currentLine=68943886;
 //BA.debugLineNum = 68943886;BA.debugLine="m.Put(\"fecha\", cur.GetString(\"fecha\"))";
_m.Put((Object)("fecha"),(Object)(_cur.GetString("fecha")));
RDebugUtils.currentLine=68943887;
 //BA.debugLineNum = 68943887;BA.debugLine="m.Put(\"error\", cur.GetString(\"error\"))";
_m.Put((Object)("error"),(Object)(_cur.GetString("error")));
RDebugUtils.currentLine=68943888;
 //BA.debugLineNum = 68943888;BA.debugLine="m2.Put(i,m)";
_m2.Put((Object)(_i),(Object)(_m.getObject()));
RDebugUtils.currentLine=68943889;
 //BA.debugLineNum = 68943889;BA.debugLine="i = i + 1";
_i = (int) (_i+1);
 }
;
RDebugUtils.currentLine=68943891;
 //BA.debugLineNum = 68943891;BA.debugLine="cur.Close";
_cur.Close();
RDebugUtils.currentLine=68943892;
 //BA.debugLineNum = 68943892;BA.debugLine="j.Initialize(m2)";
_j.Initialize(_m2);
RDebugUtils.currentLine=68943893;
 //BA.debugLineNum = 68943893;BA.debugLine="Log(j.ToString)";
anywheresoftware.b4a.keywords.Common.LogImpl("268943893",_j.ToString(),0);
RDebugUtils.currentLine=68943894;
 //BA.debugLineNum = 68943894;BA.debugLine="If comprimido Then";
if (_comprimido) { 
RDebugUtils.currentLine=68943895;
 //BA.debugLineNum = 68943895;BA.debugLine="Return compress(j.ToString)";
if (true) return _compress(_ba,_j.ToString());
 }else {
RDebugUtils.currentLine=68943897;
 //BA.debugLineNum = 68943897;BA.debugLine="Return j.ToString";
if (true) return _j.ToString();
 };
RDebugUtils.currentLine=68943899;
 //BA.debugLineNum = 68943899;BA.debugLine="End Sub";
return "";
}
public static String  _dameruta(anywheresoftware.b4a.BA _ba,String _inicioruta,String _origenruta) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "dameruta", false))
	 {return ((String) Debug.delegate(null, "dameruta", new Object[] {_ba,_inicioruta,_origenruta}));}
String _fechainicio = "";
anywheresoftware.b4a.sql.SQL.CursorWrapper _c = null;
String _ruta2 = "";
int _i = 0;
RDebugUtils.currentLine=67502080;
 //BA.debugLineNum = 67502080;BA.debugLine="Sub dameRuta(inicioRuta As String, origenRuta As S";
RDebugUtils.currentLine=67502082;
 //BA.debugLineNum = 67502082;BA.debugLine="Dim fechaInicio As String";
_fechainicio = "";
RDebugUtils.currentLine=67502083;
 //BA.debugLineNum = 67502083;BA.debugLine="Try 'incioRuta es numero";
try {RDebugUtils.currentLine=67502084;
 //BA.debugLineNum = 67502084;BA.debugLine="inicioRuta = inicioRuta * 1";
_inicioruta = BA.NumberToString((double)(Double.parseDouble(_inicioruta))*1);
RDebugUtils.currentLine=67502086;
 //BA.debugLineNum = 67502086;BA.debugLine="fechaInicio = fechaKMT(DateTime.Now - (DateTime.";
_fechainicio = _fechakmt(_ba,BA.NumberToString(anywheresoftware.b4a.keywords.Common.DateTime.getNow()-(anywheresoftware.b4a.keywords.Common.DateTime.TicksPerHour*(double)(Double.parseDouble(_inicioruta)))));
 } 
       catch (Exception e6) {
			(_ba.processBA == null ? _ba : _ba.processBA).setLastException(e6);RDebugUtils.currentLine=67502088;
 //BA.debugLineNum = 67502088;BA.debugLine="fechaInicio = fechaInicioHoy";
_fechainicio = _fechainiciohoy(_ba);
 };
RDebugUtils.currentLine=67502091;
 //BA.debugLineNum = 67502091;BA.debugLine="If B4XPages.MainPage.logger Then Log(\"fechaInicio";
if (mostCurrent._b4xpages._mainpage /*reparto_intmex.keymon.lat.b4xmainpage*/ (_ba)._logger /*boolean*/ ) { 
anywheresoftware.b4a.keywords.Common.LogImpl("267502091","fechaInicio: "+_fechainicio+" | rutaHrsAtras="+BA.NumberToString(_rutahrsatras),0);};
RDebugUtils.currentLine=67502092;
 //BA.debugLineNum = 67502092;BA.debugLine="Dim c As Cursor";
_c = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
RDebugUtils.currentLine=67502093;
 //BA.debugLineNum = 67502093;BA.debugLine="If kmt.IsInitialized = False Then kmt.Initialize(";
if (_kmt.IsInitialized()==anywheresoftware.b4a.keywords.Common.False) { 
_kmt.Initialize(mostCurrent._starter._ruta /*String*/ ,"kmt.db",anywheresoftware.b4a.keywords.Common.True);};
RDebugUtils.currentLine=67502094;
 //BA.debugLineNum = 67502094;BA.debugLine="If B4XPages.MainPage.logger Then Log(\"select FECH";
if (mostCurrent._b4xpages._mainpage /*reparto_intmex.keymon.lat.b4xmainpage*/ (_ba)._logger /*boolean*/ ) { 
anywheresoftware.b4a.keywords.Common.LogImpl("267502094","select FECHA, LAT, LON from "+_origenruta+" where FECHA > "+_fechainicio+" order by FECHA desc limit "+BA.NumberToString(_rutamaxpoints),0);};
RDebugUtils.currentLine=67502095;
 //BA.debugLineNum = 67502095;BA.debugLine="c = kmt.ExecQuery(\"select FECHA, LAT, LON from \"&";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_kmt.ExecQuery("select FECHA, LAT, LON from "+_origenruta+" where FECHA > "+_fechainicio+" order by FECHA desc limit "+BA.NumberToString(_rutamaxpoints))));
RDebugUtils.currentLine=67502096;
 //BA.debugLineNum = 67502096;BA.debugLine="c.Position = 0";
_c.setPosition((int) (0));
RDebugUtils.currentLine=67502097;
 //BA.debugLineNum = 67502097;BA.debugLine="Dim ruta2 As String = \"\"";
_ruta2 = "";
RDebugUtils.currentLine=67502098;
 //BA.debugLineNum = 67502098;BA.debugLine="If c.RowCount>0 Then";
if (_c.getRowCount()>0) { 
RDebugUtils.currentLine=67502099;
 //BA.debugLineNum = 67502099;BA.debugLine="For i=0 To c.RowCount -1";
{
final int step16 = 1;
final int limit16 = (int) (_c.getRowCount()-1);
_i = (int) (0) ;
for (;_i <= limit16 ;_i = _i + step16 ) {
RDebugUtils.currentLine=67502100;
 //BA.debugLineNum = 67502100;BA.debugLine="c.Position=i";
_c.setPosition(_i);
RDebugUtils.currentLine=67502101;
 //BA.debugLineNum = 67502101;BA.debugLine="ruta2=ruta2&CRLF&c.GetString(\"LAT\")&\",\"&c.GetSt";
_ruta2 = _ruta2+anywheresoftware.b4a.keywords.Common.CRLF+_c.GetString("LAT")+","+_c.GetString("LON")+","+_c.GetString("FECHA");
RDebugUtils.currentLine=67502102;
 //BA.debugLineNum = 67502102;BA.debugLine="B4XPages.MainPage.fechaRuta = c.GetString(\"FECH";
mostCurrent._b4xpages._mainpage /*reparto_intmex.keymon.lat.b4xmainpage*/ (_ba)._fecharuta /*String*/  = _c.GetString("FECHA");
 }
};
 };
RDebugUtils.currentLine=67502105;
 //BA.debugLineNum = 67502105;BA.debugLine="c.Close";
_c.Close();
RDebugUtils.currentLine=67502106;
 //BA.debugLineNum = 67502106;BA.debugLine="Return compress(ruta2)";
if (true) return _compress(_ba,_ruta2);
RDebugUtils.currentLine=67502107;
 //BA.debugLineNum = 67502107;BA.debugLine="End Sub";
return "";
}
public static String  _fechainiciohoy(anywheresoftware.b4a.BA _ba) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "fechainiciohoy", false))
	 {return ((String) Debug.delegate(null, "fechainiciohoy", new Object[] {_ba}));}
String _origformat = "";
String _h = "";
RDebugUtils.currentLine=68157440;
 //BA.debugLineNum = 68157440;BA.debugLine="Sub fechaInicioHoy As String 'ignore";
RDebugUtils.currentLine=68157441;
 //BA.debugLineNum = 68157441;BA.debugLine="Dim OrigFormat As String = DateTime.DateFormat";
_origformat = anywheresoftware.b4a.keywords.Common.DateTime.getDateFormat();
RDebugUtils.currentLine=68157442;
 //BA.debugLineNum = 68157442;BA.debugLine="DateTime.DateFormat=\"yyMMdd\"";
anywheresoftware.b4a.keywords.Common.DateTime.setDateFormat("yyMMdd");
RDebugUtils.currentLine=68157443;
 //BA.debugLineNum = 68157443;BA.debugLine="Private h As String = DateTime.Date(DateTime.Now";
_h = anywheresoftware.b4a.keywords.Common.DateTime.Date(anywheresoftware.b4a.keywords.Common.DateTime.getNow())+"000000";
RDebugUtils.currentLine=68157444;
 //BA.debugLineNum = 68157444;BA.debugLine="DateTime.DateFormat=OrigFormat  'return to orig";
anywheresoftware.b4a.keywords.Common.DateTime.setDateFormat(_origformat);
RDebugUtils.currentLine=68157445;
 //BA.debugLineNum = 68157445;BA.debugLine="Log(\"Hoy=\"&h)";
anywheresoftware.b4a.keywords.Common.LogImpl("268157445","Hoy="+_h,0);
RDebugUtils.currentLine=68157446;
 //BA.debugLineNum = 68157446;BA.debugLine="Return h";
if (true) return _h;
RDebugUtils.currentLine=68157447;
 //BA.debugLineNum = 68157447;BA.debugLine="End Sub";
return "";
}
public static String  _decompress(anywheresoftware.b4a.BA _ba,String _base64) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "decompress", false))
	 {return ((String) Debug.delegate(null, "decompress", new Object[] {_ba,_base64}));}
byte[] _decompressedbytes = null;
anywheresoftware.b4a.agraham.byteconverter.ByteConverter _bc = null;
String _uncompressed = "";
RDebugUtils.currentLine=67043328;
 //BA.debugLineNum = 67043328;BA.debugLine="Sub decompress(base64 As String) As String 'ignore";
RDebugUtils.currentLine=67043329;
 //BA.debugLineNum = 67043329;BA.debugLine="Dim decompressedbytes() As Byte = su.DecodeBase64";
_decompressedbytes = _su.DecodeBase64(_base64);
RDebugUtils.currentLine=67043331;
 //BA.debugLineNum = 67043331;BA.debugLine="Dim bc As ByteConverter";
_bc = new anywheresoftware.b4a.agraham.byteconverter.ByteConverter();
RDebugUtils.currentLine=67043332;
 //BA.debugLineNum = 67043332;BA.debugLine="Dim uncompressed As String = bc.StringFromBytes(d";
_uncompressed = _bc.StringFromBytes(_decompressedbytes,"UTF8");
RDebugUtils.currentLine=67043333;
 //BA.debugLineNum = 67043333;BA.debugLine="Log($\"Descomprimido: ${uncompressed.Length}\"$)";
anywheresoftware.b4a.keywords.Common.LogImpl("267043333",("Descomprimido: "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_uncompressed.length()))+""),0);
RDebugUtils.currentLine=67043335;
 //BA.debugLineNum = 67043335;BA.debugLine="Return uncompressed";
if (true) return _uncompressed;
RDebugUtils.currentLine=67043336;
 //BA.debugLineNum = 67043336;BA.debugLine="End Sub";
return "";
}
public static String  _deleteerrorlog_db(anywheresoftware.b4a.BA _ba) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "deleteerrorlog_db", false))
	 {return ((String) Debug.delegate(null, "deleteerrorlog_db", new Object[] {_ba}));}
RDebugUtils.currentLine=67633152;
 //BA.debugLineNum = 67633152;BA.debugLine="Sub deleteErrorLog_DB 'ignore";
RDebugUtils.currentLine=67633153;
 //BA.debugLineNum = 67633153;BA.debugLine="If Not(errorLog.IsInitialized) Then revisaBD";
if (anywheresoftware.b4a.keywords.Common.Not(_errorlog.IsInitialized())) { 
_revisabd(_ba);};
RDebugUtils.currentLine=67633154;
 //BA.debugLineNum = 67633154;BA.debugLine="errorLog.ExecNonQuery(\"delete from errores\")";
_errorlog.ExecNonQuery("delete from errores");
RDebugUtils.currentLine=67633155;
 //BA.debugLineNum = 67633155;BA.debugLine="errorLog.ExecNonQuery(\"vacuum;\")";
_errorlog.ExecNonQuery("vacuum;");
RDebugUtils.currentLine=67633156;
 //BA.debugLineNum = 67633156;BA.debugLine="ToastMessageShow(\"Borrada\", False)";
anywheresoftware.b4a.keywords.Common.ToastMessageShow(BA.ObjectToCharSequence("Borrada"),anywheresoftware.b4a.keywords.Common.False);
RDebugUtils.currentLine=67633157;
 //BA.debugLineNum = 67633157;BA.debugLine="End Sub";
return "";
}
public static String  _deletegps_db(anywheresoftware.b4a.BA _ba) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "deletegps_db", false))
	 {return ((String) Debug.delegate(null, "deletegps_db", new Object[] {_ba}));}
RDebugUtils.currentLine=67567616;
 //BA.debugLineNum = 67567616;BA.debugLine="Sub deleteGPS_DB 'ignore";
RDebugUtils.currentLine=67567617;
 //BA.debugLineNum = 67567617;BA.debugLine="kmt.ExecNonQuery(\"delete from RUTA_GPS\")";
_kmt.ExecNonQuery("delete from RUTA_GPS");
RDebugUtils.currentLine=67567618;
 //BA.debugLineNum = 67567618;BA.debugLine="kmt.ExecNonQuery(\"vacuum;\")";
_kmt.ExecNonQuery("vacuum;");
RDebugUtils.currentLine=67567619;
 //BA.debugLineNum = 67567619;BA.debugLine="End Sub";
return "";
}
public static long  _fechakmt2ticks(anywheresoftware.b4a.BA _ba,String _fkmt) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "fechakmt2ticks", false))
	 {return ((Long) Debug.delegate(null, "fechakmt2ticks", new Object[] {_ba,_fkmt}));}
String _partefecha = "";
String _partehora = "";
String _origformat = "";
long _ticks = 0L;
RDebugUtils.currentLine=69009408;
 //BA.debugLineNum = 69009408;BA.debugLine="Sub fechaKMT2Ticks(fKMT As String) As Long 'ignore";
RDebugUtils.currentLine=69009409;
 //BA.debugLineNum = 69009409;BA.debugLine="Try";
try {RDebugUtils.currentLine=69009410;
 //BA.debugLineNum = 69009410;BA.debugLine="If fKMT.Length = 12 Then";
if (_fkmt.length()==12) { 
RDebugUtils.currentLine=69009411;
 //BA.debugLineNum = 69009411;BA.debugLine="Private parteFecha As String = fKMT.SubString2(";
_partefecha = _fkmt.substring((int) (0),(int) (6));
RDebugUtils.currentLine=69009412;
 //BA.debugLineNum = 69009412;BA.debugLine="Private parteHora As String = fKMT.SubString(6)";
_partehora = _fkmt.substring((int) (6));
RDebugUtils.currentLine=69009413;
 //BA.debugLineNum = 69009413;BA.debugLine="Private OrigFormat As String = DateTime.DateFor";
_origformat = anywheresoftware.b4a.keywords.Common.DateTime.getDateFormat();
RDebugUtils.currentLine=69009414;
 //BA.debugLineNum = 69009414;BA.debugLine="DateTime.DateFormat=\"yyMMdd\"";
anywheresoftware.b4a.keywords.Common.DateTime.setDateFormat("yyMMdd");
RDebugUtils.currentLine=69009415;
 //BA.debugLineNum = 69009415;BA.debugLine="DateTime.TimeFormat=\"HHmmss\"";
anywheresoftware.b4a.keywords.Common.DateTime.setTimeFormat("HHmmss");
RDebugUtils.currentLine=69009416;
 //BA.debugLineNum = 69009416;BA.debugLine="Private ticks As Long = DateTime.DateTimeParse(";
_ticks = anywheresoftware.b4a.keywords.Common.DateTime.DateTimeParse(_partefecha,_partehora);
RDebugUtils.currentLine=69009418;
 //BA.debugLineNum = 69009418;BA.debugLine="DateTime.DateFormat=OrigFormat  'return to orig";
anywheresoftware.b4a.keywords.Common.DateTime.setDateFormat(_origformat);
RDebugUtils.currentLine=69009419;
 //BA.debugLineNum = 69009419;BA.debugLine="Return ticks";
if (true) return _ticks;
 }else {
RDebugUtils.currentLine=69009421;
 //BA.debugLineNum = 69009421;BA.debugLine="Log(\"Formato de fecha incorrecto, debe de ser '";
anywheresoftware.b4a.keywords.Common.LogImpl("269009421","Formato de fecha incorrecto, debe de ser 'YYMMDDHHMMSS', no '"+_fkmt+"' largo="+BA.NumberToString(_fkmt.length()),0);
RDebugUtils.currentLine=69009422;
 //BA.debugLineNum = 69009422;BA.debugLine="Return 0";
if (true) return (long) (0);
 };
 } 
       catch (Exception e16) {
			(_ba.processBA == null ? _ba : _ba.processBA).setLastException(e16);RDebugUtils.currentLine=69009425;
 //BA.debugLineNum = 69009425;BA.debugLine="Log(LastException)";
anywheresoftware.b4a.keywords.Common.LogImpl("269009425",BA.ObjectToString(anywheresoftware.b4a.keywords.Common.LastException(_ba)),0);
RDebugUtils.currentLine=69009426;
 //BA.debugLineNum = 69009426;BA.debugLine="LogColor($\"Fecha dada: ${fKMT}, Parte Fecha: ${p";
anywheresoftware.b4a.keywords.Common.LogImpl("269009426",("Fecha dada: "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_fkmt))+", Parte Fecha: "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_partefecha))+", Parte Hora: "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_partehora))+""),anywheresoftware.b4a.keywords.Common.Colors.Red);
RDebugUtils.currentLine=69009427;
 //BA.debugLineNum = 69009427;BA.debugLine="Return 0";
if (true) return (long) (0);
 };
RDebugUtils.currentLine=69009429;
 //BA.debugLineNum = 69009429;BA.debugLine="End Sub";
return 0L;
}
public static String  _getphnid(anywheresoftware.b4a.BA _ba) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "getphnid", false))
	 {return ((String) Debug.delegate(null, "getphnid", new Object[] {_ba}));}
String _t = "";
String _s = "";
RDebugUtils.currentLine=66912256;
 //BA.debugLineNum = 66912256;BA.debugLine="Sub getPhnId As String 'ignore";
RDebugUtils.currentLine=66912258;
 //BA.debugLineNum = 66912258;BA.debugLine="devModel = phn.Model";
_devmodel = _phn.getModel();
RDebugUtils.currentLine=66912259;
 //BA.debugLineNum = 66912259;BA.debugLine="If devModel.Length <= 3 Then 'Si phn.Model esta e";
if (_devmodel.length()<=3) { 
RDebugUtils.currentLine=66912260;
 //BA.debugLineNum = 66912260;BA.debugLine="Dim t As String = phn.GetSettings(\"android_id\")";
_t = _phn.GetSettings("android_id");
RDebugUtils.currentLine=66912261;
 //BA.debugLineNum = 66912261;BA.debugLine="devModel = t";
_devmodel = _t;
 };
RDebugUtils.currentLine=66912263;
 //BA.debugLineNum = 66912263;BA.debugLine="If devModel.Length >= 3 Then 'Si tenemos valor pa";
if (_devmodel.length()>=3) { 
RDebugUtils.currentLine=66912264;
 //BA.debugLineNum = 66912264;BA.debugLine="File.WriteString(File.DirInternal, \"phnId.txt\",";
anywheresoftware.b4a.keywords.Common.File.WriteString(anywheresoftware.b4a.keywords.Common.File.getDirInternal(),"phnId.txt",_devmodel);
 }else 
{RDebugUtils.currentLine=66912266;
 //BA.debugLineNum = 66912266;BA.debugLine="Else If devModel.Length < 3 Then ' Si no tenemos";
if (_devmodel.length()<3) { 
RDebugUtils.currentLine=66912267;
 //BA.debugLineNum = 66912267;BA.debugLine="Dim s As String = File.ReadString(File.DirIntern";
_s = anywheresoftware.b4a.keywords.Common.File.ReadString(anywheresoftware.b4a.keywords.Common.File.getDirInternal(),"phnId.txt");
RDebugUtils.currentLine=66912268;
 //BA.debugLineNum = 66912268;BA.debugLine="devModel = s";
_devmodel = _s;
 }}
;
RDebugUtils.currentLine=66912272;
 //BA.debugLineNum = 66912272;BA.debugLine="Return devModel";
if (true) return _devmodel;
RDebugUtils.currentLine=66912273;
 //BA.debugLineNum = 66912273;BA.debugLine="End Sub";
return "";
}
public static String  _getssid(anywheresoftware.b4a.BA _ba) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "getssid", false))
	 {return ((String) Debug.delegate(null, "getssid", new Object[] {_ba}));}
RDebugUtils.currentLine=67829760;
 //BA.debugLineNum = 67829760;BA.debugLine="Sub getSSID  'ignore";
RDebugUtils.currentLine=67829765;
 //BA.debugLineNum = 67829765;BA.debugLine="End Sub";
return "";
}
public static String  _guardainfoenarchivo(anywheresoftware.b4a.BA _ba,String _coords) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "guardainfoenarchivo", false))
	 {return ((String) Debug.delegate(null, "guardainfoenarchivo", new Object[] {_ba,_coords}));}
String _origformat = "";
String _lastupdate = "";
String _ubic = "";
anywheresoftware.b4a.objects.streams.File.OutputStreamWrapper _out = null;
String _s = "";
byte[] _t = null;
RDebugUtils.currentLine=67371008;
 //BA.debugLineNum = 67371008;BA.debugLine="Sub guardaInfoEnArchivo(coords As String) 'ignore";
RDebugUtils.currentLine=67371010;
 //BA.debugLineNum = 67371010;BA.debugLine="Dim OrigFormat As String=DateTime.DateFormat  'sa";
_origformat = anywheresoftware.b4a.keywords.Common.DateTime.getDateFormat();
RDebugUtils.currentLine=67371011;
 //BA.debugLineNum = 67371011;BA.debugLine="DateTime.DateFormat=\"MMM-dd HH:mm:ss\"";
anywheresoftware.b4a.keywords.Common.DateTime.setDateFormat("MMM-dd HH:mm:ss");
RDebugUtils.currentLine=67371012;
 //BA.debugLineNum = 67371012;BA.debugLine="Dim lastUpdate As String=DateTime.Date(DateTime.N";
_lastupdate = anywheresoftware.b4a.keywords.Common.DateTime.Date(anywheresoftware.b4a.keywords.Common.DateTime.getNow());
RDebugUtils.currentLine=67371013;
 //BA.debugLineNum = 67371013;BA.debugLine="DateTime.DateFormat=OrigFormat  'return to orig d";
anywheresoftware.b4a.keywords.Common.DateTime.setDateFormat(_origformat);
RDebugUtils.currentLine=67371015;
 //BA.debugLineNum = 67371015;BA.debugLine="Dim ubic As String = coords&\",\"&lastUpdate";
_ubic = _coords+","+_lastupdate;
RDebugUtils.currentLine=67371016;
 //BA.debugLineNum = 67371016;BA.debugLine="Dim out As OutputStream = File.OpenOutput(File.Di";
_out = new anywheresoftware.b4a.objects.streams.File.OutputStreamWrapper();
_out = anywheresoftware.b4a.keywords.Common.File.OpenOutput(anywheresoftware.b4a.keywords.Common.File.getDirInternal(),"gps.txt",anywheresoftware.b4a.keywords.Common.True);
RDebugUtils.currentLine=67371017;
 //BA.debugLineNum = 67371017;BA.debugLine="Dim s As String = ubic & CRLF";
_s = _ubic+anywheresoftware.b4a.keywords.Common.CRLF;
RDebugUtils.currentLine=67371018;
 //BA.debugLineNum = 67371018;BA.debugLine="Dim t() As Byte = s.GetBytes(\"UTF-8\")";
_t = _s.getBytes("UTF-8");
RDebugUtils.currentLine=67371019;
 //BA.debugLineNum = 67371019;BA.debugLine="out.WriteBytes(t, 0, t.Length)";
_out.WriteBytes(_t,(int) (0),_t.length);
RDebugUtils.currentLine=67371020;
 //BA.debugLineNum = 67371020;BA.debugLine="out.Close";
_out.Close();
RDebugUtils.currentLine=67371021;
 //BA.debugLineNum = 67371021;BA.debugLine="End Sub";
return "";
}
public static String  _guardainfoenbd(anywheresoftware.b4a.BA _ba,String _coords) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "guardainfoenbd", false))
	 {return ((String) Debug.delegate(null, "guardainfoenbd", new Object[] {_ba,_coords}));}
String[] _latlon = null;
RDebugUtils.currentLine=67436544;
 //BA.debugLineNum = 67436544;BA.debugLine="Sub guardaInfoEnBD(coords As String) 'ignore";
RDebugUtils.currentLine=67436545;
 //BA.debugLineNum = 67436545;BA.debugLine="If B4XPages.MainPage.logger Then Log(\"Guardamos u";
if (mostCurrent._b4xpages._mainpage /*reparto_intmex.keymon.lat.b4xmainpage*/ (_ba)._logger /*boolean*/ ) { 
anywheresoftware.b4a.keywords.Common.LogImpl("267436545","Guardamos ubicacion en BD - "+_coords,0);};
RDebugUtils.currentLine=67436546;
 //BA.debugLineNum = 67436546;BA.debugLine="Try";
try {RDebugUtils.currentLine=67436547;
 //BA.debugLineNum = 67436547;BA.debugLine="Dim latlon() As String = Regex.Split(\"\\|\", coord";
_latlon = anywheresoftware.b4a.keywords.Common.Regex.Split("\\|",_coords);
RDebugUtils.currentLine=67436548;
 //BA.debugLineNum = 67436548;BA.debugLine="If latlon.Length < 2 Then latlon = Regex.Split(\"";
if (_latlon.length<2) { 
_latlon = anywheresoftware.b4a.keywords.Common.Regex.Split(",",_coords);};
RDebugUtils.currentLine=67436550;
 //BA.debugLineNum = 67436550;BA.debugLine="If Not(kmt.IsInitialized) Then revisaBD";
if (anywheresoftware.b4a.keywords.Common.Not(_kmt.IsInitialized())) { 
_revisabd(_ba);};
RDebugUtils.currentLine=67436551;
 //BA.debugLineNum = 67436551;BA.debugLine="kmt.ExecNonQuery2(\"INSERT INTO RUTA_GPS(fecha, l";
_kmt.ExecNonQuery2("INSERT INTO RUTA_GPS(fecha, lat, lon) VALUES (?,?,?)",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(_latlon[(int) (2)]),(Object)(_latlon[(int) (0)]),(Object)(_latlon[(int) (1)])}));
 } 
       catch (Exception e8) {
			(_ba.processBA == null ? _ba : _ba.processBA).setLastException(e8);RDebugUtils.currentLine=67436553;
 //BA.debugLineNum = 67436553;BA.debugLine="Log(LastException)";
anywheresoftware.b4a.keywords.Common.LogImpl("267436553",BA.ObjectToString(anywheresoftware.b4a.keywords.Common.LastException(_ba)),0);
 };
RDebugUtils.currentLine=67436555;
 //BA.debugLineNum = 67436555;BA.debugLine="End Sub";
return "";
}
public static String  _hmskmt(anywheresoftware.b4a.BA _ba) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "hmskmt", false))
	 {return ((String) Debug.delegate(null, "hmskmt", new Object[] {_ba}));}
String _origformat = "";
String _nuevahora = "";
RDebugUtils.currentLine=67174400;
 //BA.debugLineNum = 67174400;BA.debugLine="Sub hmsKMT As String 'ignore";
RDebugUtils.currentLine=67174402;
 //BA.debugLineNum = 67174402;BA.debugLine="Dim OrigFormat As String = DateTime.DateFormat  '";
_origformat = anywheresoftware.b4a.keywords.Common.DateTime.getDateFormat();
RDebugUtils.currentLine=67174403;
 //BA.debugLineNum = 67174403;BA.debugLine="DateTime.DateFormat=\"HHmmss\"";
anywheresoftware.b4a.keywords.Common.DateTime.setDateFormat("HHmmss");
RDebugUtils.currentLine=67174404;
 //BA.debugLineNum = 67174404;BA.debugLine="Private nuevaHora As String=DateTime.Date(DateTim";
_nuevahora = anywheresoftware.b4a.keywords.Common.DateTime.Date(anywheresoftware.b4a.keywords.Common.DateTime.getNow());
RDebugUtils.currentLine=67174405;
 //BA.debugLineNum = 67174405;BA.debugLine="DateTime.DateFormat=OrigFormat  'return to orig d";
anywheresoftware.b4a.keywords.Common.DateTime.setDateFormat(_origformat);
RDebugUtils.currentLine=67174407;
 //BA.debugLineNum = 67174407;BA.debugLine="Return nuevaHora";
if (true) return _nuevahora;
RDebugUtils.currentLine=67174408;
 //BA.debugLineNum = 67174408;BA.debugLine="End Sub";
return "";
}
public static String  _insertaenerrores(anywheresoftware.b4a.BA _ba,String _error) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "insertaenerrores", false))
	 {return ((String) Debug.delegate(null, "insertaenerrores", new Object[] {_ba,_error}));}
RDebugUtils.currentLine=69271552;
 //BA.debugLineNum = 69271552;BA.debugLine="Sub insertaEnErrores(error As String)  'ignore";
RDebugUtils.currentLine=69271553;
 //BA.debugLineNum = 69271553;BA.debugLine="If Not(errorLog.IsInitialized) Then revisaBD";
if (anywheresoftware.b4a.keywords.Common.Not(_errorlog.IsInitialized())) { 
_revisabd(_ba);};
RDebugUtils.currentLine=69271554;
 //BA.debugLineNum = 69271554;BA.debugLine="errorLog.ExecNonQuery2(\"INSERT INTO errores(fecha";
_errorlog.ExecNonQuery2("INSERT INTO errores(fecha, error) VALUES (?,?)",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(_fechakmt(_ba,BA.NumberToString(anywheresoftware.b4a.keywords.Common.DateTime.getNow()))),(Object)(_error)}));
RDebugUtils.currentLine=69271555;
 //BA.debugLineNum = 69271555;BA.debugLine="End Sub";
return "";
}
public static String  _insertarenglonespruebaenerrorlog(anywheresoftware.b4a.BA _ba) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "insertarenglonespruebaenerrorlog", false))
	 {return ((String) Debug.delegate(null, "insertarenglonespruebaenerrorlog", new Object[] {_ba}));}
int _x = 0;
RDebugUtils.currentLine=68878336;
 //BA.debugLineNum = 68878336;BA.debugLine="Sub insertaRenglonesPruebaEnErrorLog 'ignore";
RDebugUtils.currentLine=68878337;
 //BA.debugLineNum = 68878337;BA.debugLine="If Not(errorLog.IsInitialized) Then revisaBD";
if (anywheresoftware.b4a.keywords.Common.Not(_errorlog.IsInitialized())) { 
_revisabd(_ba);};
RDebugUtils.currentLine=68878338;
 //BA.debugLineNum = 68878338;BA.debugLine="Log(\"insertamos 50 renglones a errorLog\")";
anywheresoftware.b4a.keywords.Common.LogImpl("268878338","insertamos 50 renglones a errorLog",0);
RDebugUtils.currentLine=68878339;
 //BA.debugLineNum = 68878339;BA.debugLine="For x = 1 To 50";
{
final int step3 = 1;
final int limit3 = (int) (50);
_x = (int) (1) ;
for (;_x <= limit3 ;_x = _x + step3 ) {
RDebugUtils.currentLine=68878340;
 //BA.debugLineNum = 68878340;BA.debugLine="errorLog.ExecNonQuery2(\"INSERT INTO errores(fech";
_errorlog.ExecNonQuery2("INSERT INTO errores(fecha, error) VALUES (?,?)",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(_fechakmt(_ba,BA.NumberToString(anywheresoftware.b4a.keywords.Common.DateTime.getNow()))),(Object)("abc")}));
RDebugUtils.currentLine=68878341;
 //BA.debugLineNum = 68878341;BA.debugLine="Log(x)";
anywheresoftware.b4a.keywords.Common.LogImpl("268878341",BA.NumberToString(_x),0);
 }
};
RDebugUtils.currentLine=68878343;
 //BA.debugLineNum = 68878343;BA.debugLine="End Sub";
return "";
}
public static String  _installapk(anywheresoftware.b4a.BA _ba,String _dir,String _apk) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "installapk", false))
	 {return ((String) Debug.delegate(null, "installapk", new Object[] {_ba,_dir,_apk}));}
anywheresoftware.b4a.objects.IntentWrapper _i = null;
RDebugUtils.currentLine=69074944;
 //BA.debugLineNum = 69074944;BA.debugLine="Sub InstallAPK(dir As String, apk As String) 'igno";
RDebugUtils.currentLine=69074945;
 //BA.debugLineNum = 69074945;BA.debugLine="If File.Exists(dir, apk) Then";
if (anywheresoftware.b4a.keywords.Common.File.Exists(_dir,_apk)) { 
RDebugUtils.currentLine=69074946;
 //BA.debugLineNum = 69074946;BA.debugLine="Dim i As Intent";
_i = new anywheresoftware.b4a.objects.IntentWrapper();
RDebugUtils.currentLine=69074947;
 //BA.debugLineNum = 69074947;BA.debugLine="i.Initialize(i.ACTION_VIEW, \"file://\" & File.Com";
_i.Initialize(_i.ACTION_VIEW,"file://"+anywheresoftware.b4a.keywords.Common.File.Combine(_dir,_apk));
RDebugUtils.currentLine=69074948;
 //BA.debugLineNum = 69074948;BA.debugLine="i.SetType(\"application/vnd.android.package-archi";
_i.SetType("application/vnd.android.package-archive");
RDebugUtils.currentLine=69074949;
 //BA.debugLineNum = 69074949;BA.debugLine="StartActivity(i)";
anywheresoftware.b4a.keywords.Common.StartActivity((_ba.processBA == null ? _ba : _ba.processBA),(Object)(_i.getObject()));
 };
RDebugUtils.currentLine=69074951;
 //BA.debugLineNum = 69074951;BA.debugLine="End Sub";
return "";
}
public static anywheresoftware.b4a.objects.collections.Map  _json2map(anywheresoftware.b4a.BA _ba,String _thejson) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "json2map", false))
	 {return ((anywheresoftware.b4a.objects.collections.Map) Debug.delegate(null, "json2map", new Object[] {_ba,_thejson}));}
anywheresoftware.b4a.objects.collections.JSONParser _json = null;
anywheresoftware.b4a.objects.collections.Map _m = null;
RDebugUtils.currentLine=67895296;
 //BA.debugLineNum = 67895296;BA.debugLine="Sub JSON2Map(theJson As String) As Map 'ignore";
RDebugUtils.currentLine=67895298;
 //BA.debugLineNum = 67895298;BA.debugLine="Try";
try {RDebugUtils.currentLine=67895299;
 //BA.debugLineNum = 67895299;BA.debugLine="Private json As JSONParser";
_json = new anywheresoftware.b4a.objects.collections.JSONParser();
RDebugUtils.currentLine=67895300;
 //BA.debugLineNum = 67895300;BA.debugLine="json.Initialize(theJson)";
_json.Initialize(_thejson);
RDebugUtils.currentLine=67895301;
 //BA.debugLineNum = 67895301;BA.debugLine="Return json.NextObject";
if (true) return _json.NextObject();
 } 
       catch (Exception e6) {
			(_ba.processBA == null ? _ba : _ba.processBA).setLastException(e6);RDebugUtils.currentLine=67895303;
 //BA.debugLineNum = 67895303;BA.debugLine="Log(LastException)";
anywheresoftware.b4a.keywords.Common.LogImpl("267895303",BA.ObjectToString(anywheresoftware.b4a.keywords.Common.LastException(_ba)),0);
RDebugUtils.currentLine=67895304;
 //BA.debugLineNum = 67895304;BA.debugLine="log2DB(\"JSON2Map: \"&LastException)";
_log2db(_ba,"JSON2Map: "+BA.ObjectToString(anywheresoftware.b4a.keywords.Common.LastException(_ba)));
RDebugUtils.currentLine=67895305;
 //BA.debugLineNum = 67895305;BA.debugLine="Private m As Map = CreateMap(\"title\":\"Error gene";
_m = new anywheresoftware.b4a.objects.collections.Map();
_m = anywheresoftware.b4a.keywords.Common.createMap(new Object[] {(Object)("title"),(Object)("Error generating JSON"),(Object)("t"),(Object)("Error"),(Object)("Message"),(Object)(anywheresoftware.b4a.keywords.Common.LastException(_ba).getObject()),(Object)("text"),(Object)(anywheresoftware.b4a.keywords.Common.LastException(_ba).getObject())});
RDebugUtils.currentLine=67895306;
 //BA.debugLineNum = 67895306;BA.debugLine="Return m";
if (true) return _m;
 };
RDebugUtils.currentLine=67895308;
 //BA.debugLineNum = 67895308;BA.debugLine="End Sub";
return null;
}
public static String  _log2db(anywheresoftware.b4a.BA _ba,String _texto) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "log2db", false))
	 {return ((String) Debug.delegate(null, "log2db", new Object[] {_ba,_texto}));}
RDebugUtils.currentLine=68222976;
 //BA.debugLineNum = 68222976;BA.debugLine="Sub log2DB(texto As String) 'ignore";
RDebugUtils.currentLine=68222977;
 //BA.debugLineNum = 68222977;BA.debugLine="LogColor(fechaKMT(DateTime.Now)&\" - log2BD: '\"&te";
anywheresoftware.b4a.keywords.Common.LogImpl("268222977",_fechakmt(_ba,BA.NumberToString(anywheresoftware.b4a.keywords.Common.DateTime.getNow()))+" - log2BD: '"+_texto+"'",anywheresoftware.b4a.keywords.Common.Colors.Magenta);
RDebugUtils.currentLine=68222978;
 //BA.debugLineNum = 68222978;BA.debugLine="If kmt.IsInitialized Then kmt.ExecNonQuery2(\"INSE";
if (_kmt.IsInitialized()) { 
_kmt.ExecNonQuery2("INSERT INTO bitacora(fecha, texto) VALUES (?,?)",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(_fechakmt(_ba,BA.NumberToString(anywheresoftware.b4a.keywords.Common.DateTime.getNow()))),(Object)(_texto)}));};
RDebugUtils.currentLine=68222979;
 //BA.debugLineNum = 68222979;BA.debugLine="End Sub";
return "";
}
public static String  _mandamosloc(anywheresoftware.b4a.BA _ba,String _coords) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "mandamosloc", false))
	 {return ((String) Debug.delegate(null, "mandamosloc", new Object[] {_ba,_coords}));}
RDebugUtils.currentLine=68091904;
 //BA.debugLineNum = 68091904;BA.debugLine="Sub mandamosLoc(coords As String) 'ignore";
RDebugUtils.currentLine=68091920;
 //BA.debugLineNum = 68091920;BA.debugLine="End Sub";
return "";
}
public static String  _map2json(anywheresoftware.b4a.BA _ba,anywheresoftware.b4a.objects.collections.Map _m) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "map2json", false))
	 {return ((String) Debug.delegate(null, "map2json", new Object[] {_ba,_m}));}
anywheresoftware.b4a.objects.collections.JSONParser.JSONGenerator _jg = null;
String _t = "";
RDebugUtils.currentLine=67960832;
 //BA.debugLineNum = 67960832;BA.debugLine="Sub map2JSON(m As Map) As String 'ignore";
RDebugUtils.currentLine=67960835;
 //BA.debugLineNum = 67960835;BA.debugLine="Dim jg As JSONGenerator";
_jg = new anywheresoftware.b4a.objects.collections.JSONParser.JSONGenerator();
RDebugUtils.currentLine=67960836;
 //BA.debugLineNum = 67960836;BA.debugLine="jg.Initialize(m)";
_jg.Initialize(_m);
RDebugUtils.currentLine=67960837;
 //BA.debugLineNum = 67960837;BA.debugLine="Dim t As String = jg.ToString";
_t = _jg.ToString();
RDebugUtils.currentLine=67960838;
 //BA.debugLineNum = 67960838;BA.debugLine="Return t";
if (true) return _t;
RDebugUtils.currentLine=67960839;
 //BA.debugLineNum = 67960839;BA.debugLine="End Sub";
return "";
}
public static boolean  _masdexxmins(anywheresoftware.b4a.BA _ba,int _hora,int _mins) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "masdexxmins", false))
	 {return ((Boolean) Debug.delegate(null, "masdexxmins", new Object[] {_ba,_hora,_mins}));}
RDebugUtils.currentLine=68288512;
 //BA.debugLineNum = 68288512;BA.debugLine="Sub masDeXXMins(hora As Int, mins As Int) As Boole";
RDebugUtils.currentLine=68288513;
 //BA.debugLineNum = 68288513;BA.debugLine="If (hora + mins * DateTime.TicksPerMinute) < Date";
if ((_hora+_mins*anywheresoftware.b4a.keywords.Common.DateTime.TicksPerMinute)<anywheresoftware.b4a.keywords.Common.DateTime.getNow()) { 
RDebugUtils.currentLine=68288514;
 //BA.debugLineNum = 68288514;BA.debugLine="Return True";
if (true) return anywheresoftware.b4a.keywords.Common.True;
 }else {
RDebugUtils.currentLine=68288516;
 //BA.debugLineNum = 68288516;BA.debugLine="Return False";
if (true) return anywheresoftware.b4a.keywords.Common.False;
 };
RDebugUtils.currentLine=68288518;
 //BA.debugLineNum = 68288518;BA.debugLine="End Sub";
return false;
}
public static boolean  _masdexxminskmt(anywheresoftware.b4a.BA _ba,String _hora,int _mins) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "masdexxminskmt", false))
	 {return ((Boolean) Debug.delegate(null, "masdexxminskmt", new Object[] {_ba,_hora,_mins}));}
RDebugUtils.currentLine=68354048;
 //BA.debugLineNum = 68354048;BA.debugLine="Sub masDeXXMinsKMT(hora As String, mins As Int) As";
RDebugUtils.currentLine=68354049;
 //BA.debugLineNum = 68354049;BA.debugLine="Try";
try {RDebugUtils.currentLine=68354051;
 //BA.debugLineNum = 68354051;BA.debugLine="If fechaKMT2Ticks(hora) + mins * DateTime.TicksP";
if (_fechakmt2ticks(_ba,_hora)+_mins*anywheresoftware.b4a.keywords.Common.DateTime.TicksPerMinute<anywheresoftware.b4a.keywords.Common.DateTime.getNow()) { 
RDebugUtils.currentLine=68354053;
 //BA.debugLineNum = 68354053;BA.debugLine="Return True";
if (true) return anywheresoftware.b4a.keywords.Common.True;
 }else {
RDebugUtils.currentLine=68354056;
 //BA.debugLineNum = 68354056;BA.debugLine="Return False";
if (true) return anywheresoftware.b4a.keywords.Common.False;
 };
 } 
       catch (Exception e8) {
			(_ba.processBA == null ? _ba : _ba.processBA).setLastException(e8);RDebugUtils.currentLine=68354059;
 //BA.debugLineNum = 68354059;BA.debugLine="Log(LastException)";
anywheresoftware.b4a.keywords.Common.LogImpl("268354059",BA.ObjectToString(anywheresoftware.b4a.keywords.Common.LastException(_ba)),0);
 };
RDebugUtils.currentLine=68354061;
 //BA.debugLineNum = 68354061;BA.debugLine="End Sub";
return false;
}
public static String  _monitor(anywheresoftware.b4a.BA _ba) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "monitor", false))
	 {return ((String) Debug.delegate(null, "monitor", new Object[] {_ba}));}
RDebugUtils.currentLine=68485120;
 //BA.debugLineNum = 68485120;BA.debugLine="Sub Monitor 'ignore";
RDebugUtils.currentLine=68485138;
 //BA.debugLineNum = 68485138;BA.debugLine="End Sub";
return "";
}
public static String  _notihigh(anywheresoftware.b4a.BA _ba,String _title,String _body,Object _activity) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "notihigh", false))
	 {return ((String) Debug.delegate(null, "notihigh", new Object[] {_ba,_title,_body,_activity}));}
anywheresoftware.b4a.objects.NotificationWrapper _notif = null;
RDebugUtils.currentLine=67239936;
 //BA.debugLineNum = 67239936;BA.debugLine="Sub notiHigh(title As String, body As String, acti";
RDebugUtils.currentLine=67239937;
 //BA.debugLineNum = 67239937;BA.debugLine="Private notif As Notification";
_notif = new anywheresoftware.b4a.objects.NotificationWrapper();
RDebugUtils.currentLine=67239938;
 //BA.debugLineNum = 67239938;BA.debugLine="notif.Initialize2(notif.IMPORTANCE_HIGH)";
_notif.Initialize2(_notif.IMPORTANCE_HIGH);
RDebugUtils.currentLine=67239939;
 //BA.debugLineNum = 67239939;BA.debugLine="notif.Icon = \"icon\"";
_notif.setIcon("icon");
RDebugUtils.currentLine=67239940;
 //BA.debugLineNum = 67239940;BA.debugLine="notif.Vibrate = False";
_notif.setVibrate(anywheresoftware.b4a.keywords.Common.False);
RDebugUtils.currentLine=67239941;
 //BA.debugLineNum = 67239941;BA.debugLine="notif.Sound = False";
_notif.setSound(anywheresoftware.b4a.keywords.Common.False);
RDebugUtils.currentLine=67239942;
 //BA.debugLineNum = 67239942;BA.debugLine="notif.AutoCancel = True";
_notif.setAutoCancel(anywheresoftware.b4a.keywords.Common.True);
RDebugUtils.currentLine=67239943;
 //BA.debugLineNum = 67239943;BA.debugLine="Log(\"notiHigh: \"&title)";
anywheresoftware.b4a.keywords.Common.LogImpl("267239943","notiHigh: "+_title,0);
RDebugUtils.currentLine=67239944;
 //BA.debugLineNum = 67239944;BA.debugLine="notif.SetInfo(title, body, activity)";
_notif.SetInfoNew((_ba.processBA == null ? _ba : _ba.processBA),BA.ObjectToCharSequence(_title),BA.ObjectToCharSequence(_body),_activity);
RDebugUtils.currentLine=67239946;
 //BA.debugLineNum = 67239946;BA.debugLine="notif.Notify(777)";
_notif.Notify((int) (777));
RDebugUtils.currentLine=67239947;
 //BA.debugLineNum = 67239947;BA.debugLine="End Sub";
return "";
}
public static anywheresoftware.b4a.objects.NotificationWrapper  _notilowreturn(anywheresoftware.b4a.BA _ba,String _title,String _body,int _id) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "notilowreturn", false))
	 {return ((anywheresoftware.b4a.objects.NotificationWrapper) Debug.delegate(null, "notilowreturn", new Object[] {_ba,_title,_body,_id}));}
anywheresoftware.b4a.objects.NotificationWrapper _notification = null;
RDebugUtils.currentLine=67305472;
 //BA.debugLineNum = 67305472;BA.debugLine="Sub notiLowReturn(title As String, Body As String,";
RDebugUtils.currentLine=67305473;
 //BA.debugLineNum = 67305473;BA.debugLine="Private notification As Notification";
_notification = new anywheresoftware.b4a.objects.NotificationWrapper();
RDebugUtils.currentLine=67305474;
 //BA.debugLineNum = 67305474;BA.debugLine="notification.Initialize2(notification.IMPORTANCE_";
_notification.Initialize2(_notification.IMPORTANCE_LOW);
RDebugUtils.currentLine=67305475;
 //BA.debugLineNum = 67305475;BA.debugLine="Log(\"notiLowReturn: \"&title)";
anywheresoftware.b4a.keywords.Common.LogImpl("267305475","notiLowReturn: "+_title,0);
RDebugUtils.currentLine=67305476;
 //BA.debugLineNum = 67305476;BA.debugLine="notification.Icon = \"icon\"";
_notification.setIcon("icon");
RDebugUtils.currentLine=67305477;
 //BA.debugLineNum = 67305477;BA.debugLine="notification.Sound = False";
_notification.setSound(anywheresoftware.b4a.keywords.Common.False);
RDebugUtils.currentLine=67305478;
 //BA.debugLineNum = 67305478;BA.debugLine="notification.Vibrate = False";
_notification.setVibrate(anywheresoftware.b4a.keywords.Common.False);
RDebugUtils.currentLine=67305479;
 //BA.debugLineNum = 67305479;BA.debugLine="notification.SetInfo(title, Body, Main)";
_notification.SetInfoNew((_ba.processBA == null ? _ba : _ba.processBA),BA.ObjectToCharSequence(_title),BA.ObjectToCharSequence(_body),(Object)(mostCurrent._main.getObject()));
RDebugUtils.currentLine=67305480;
 //BA.debugLineNum = 67305480;BA.debugLine="notification.Notify(id)";
_notification.Notify(_id);
RDebugUtils.currentLine=67305482;
 //BA.debugLineNum = 67305482;BA.debugLine="Return notification";
if (true) return _notification;
RDebugUtils.currentLine=67305483;
 //BA.debugLineNum = 67305483;BA.debugLine="End Sub";
return null;
}
public static String  _revisaflp(anywheresoftware.b4a.BA _ba) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "revisaflp", false))
	 {return ((String) Debug.delegate(null, "revisaflp", new Object[] {_ba}));}
boolean _todobienflp = false;
RDebugUtils.currentLine=68616192;
 //BA.debugLineNum = 68616192;BA.debugLine="Sub revisaFLP 'ignore";
RDebugUtils.currentLine=68616193;
 //BA.debugLineNum = 68616193;BA.debugLine="LogColor($\"**** **** Revisamos FLP - ${fechaKMT(D";
anywheresoftware.b4a.keywords.Common.LogImpl("268616193",("**** **** Revisamos FLP - "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_fechakmt(_ba,BA.NumberToString(anywheresoftware.b4a.keywords.Common.DateTime.getNow()))))+"**** ****"),anywheresoftware.b4a.keywords.Common.Colors.RGB((int) (78),(int) (0),(int) (227)));
RDebugUtils.currentLine=68616194;
 //BA.debugLineNum = 68616194;BA.debugLine="Private todoBienFLP As Boolean = True";
_todobienflp = anywheresoftware.b4a.keywords.Common.True;
RDebugUtils.currentLine=68616195;
 //BA.debugLineNum = 68616195;BA.debugLine="If Not(Tracker.FLP.IsInitialized) Then";
if (anywheresoftware.b4a.keywords.Common.Not(mostCurrent._tracker._flp /*uk.co.martinpearman.b4a.fusedlocationprovider.FusedLocationProviderWrapper*/ .IsInitialized())) { 
RDebugUtils.currentLine=68616196;
 //BA.debugLineNum = 68616196;BA.debugLine="log2DB(\"revisaFLP: No esta inicializado ... 'Rei";
_log2db(_ba,"revisaFLP: No esta inicializado ... 'Reinicializando FLP'");
RDebugUtils.currentLine=68616197;
 //BA.debugLineNum = 68616197;BA.debugLine="Tracker.FLP.Initialize(\"flp\")";
mostCurrent._tracker._flp /*uk.co.martinpearman.b4a.fusedlocationprovider.FusedLocationProviderWrapper*/ .Initialize((_ba.processBA == null ? _ba : _ba.processBA),"flp");
RDebugUtils.currentLine=68616198;
 //BA.debugLineNum = 68616198;BA.debugLine="todoBienFLP = False";
_todobienflp = anywheresoftware.b4a.keywords.Common.False;
 };
RDebugUtils.currentLine=68616200;
 //BA.debugLineNum = 68616200;BA.debugLine="If Tracker.FLP.IsInitialized Then";
if (mostCurrent._tracker._flp /*uk.co.martinpearman.b4a.fusedlocationprovider.FusedLocationProviderWrapper*/ .IsInitialized()) { 
RDebugUtils.currentLine=68616201;
 //BA.debugLineNum = 68616201;BA.debugLine="If Not(Tracker.FLP.IsConnected) Then";
if (anywheresoftware.b4a.keywords.Common.Not(mostCurrent._tracker._flp /*uk.co.martinpearman.b4a.fusedlocationprovider.FusedLocationProviderWrapper*/ .IsConnected())) { 
RDebugUtils.currentLine=68616202;
 //BA.debugLineNum = 68616202;BA.debugLine="log2DB(\"revisaFLP: No esta conectado ... 'Recon";
_log2db(_ba,"revisaFLP: No esta conectado ... 'Reconectando FLP'");
RDebugUtils.currentLine=68616204;
 //BA.debugLineNum = 68616204;BA.debugLine="CallSubDelayed(Tracker,\"StartFLP\")";
anywheresoftware.b4a.keywords.Common.CallSubDelayed((_ba.processBA == null ? _ba : _ba.processBA),(Object)(mostCurrent._tracker.getObject()),"StartFLP");
RDebugUtils.currentLine=68616205;
 //BA.debugLineNum = 68616205;BA.debugLine="todoBienFLP = False";
_todobienflp = anywheresoftware.b4a.keywords.Common.False;
 };
RDebugUtils.currentLine=68616207;
 //BA.debugLineNum = 68616207;BA.debugLine="If	Tracker.FLP.IsConnected And _ 			Tracker.FLP.";
if (mostCurrent._tracker._flp /*uk.co.martinpearman.b4a.fusedlocationprovider.FusedLocationProviderWrapper*/ .IsConnected() && mostCurrent._tracker._flp /*uk.co.martinpearman.b4a.fusedlocationprovider.FusedLocationProviderWrapper*/ .GetLastKnownLocation().IsInitialized() && mostCurrent._tracker._flp /*uk.co.martinpearman.b4a.fusedlocationprovider.FusedLocationProviderWrapper*/ .GetLastKnownLocation().DistanceTo((android.location.Location)(mostCurrent._tracker._uugcoords /*anywheresoftware.b4a.gps.LocationWrapper*/ .getObject()))>500) { 
RDebugUtils.currentLine=68616210;
 //BA.debugLineNum = 68616210;BA.debugLine="log2DB(\"revisaFLP: 'No se esta actualizando, lo";
_log2db(_ba,"revisaFLP: 'No se esta actualizando, lo reiniciamos ...'");
RDebugUtils.currentLine=68616211;
 //BA.debugLineNum = 68616211;BA.debugLine="StartService(Tracker)";
anywheresoftware.b4a.keywords.Common.StartService((_ba.processBA == null ? _ba : _ba.processBA),(Object)(mostCurrent._tracker.getObject()));
RDebugUtils.currentLine=68616212;
 //BA.debugLineNum = 68616212;BA.debugLine="todoBienFLP = False";
_todobienflp = anywheresoftware.b4a.keywords.Common.False;
 };
 };
RDebugUtils.currentLine=68616215;
 //BA.debugLineNum = 68616215;BA.debugLine="If todoBienFLP Then LogColor(\" +++ +++ Sin errore";
if (_todobienflp) { 
anywheresoftware.b4a.keywords.Common.LogImpl("268616215"," +++ +++ Sin errores en FLP",anywheresoftware.b4a.keywords.Common.Colors.Green);};
RDebugUtils.currentLine=68616217;
 //BA.debugLineNum = 68616217;BA.debugLine="End Sub";
return "";
}
public static String  _revisapushservice(anywheresoftware.b4a.BA _ba) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "revisapushservice", false))
	 {return ((String) Debug.delegate(null, "revisapushservice", new Object[] {_ba}));}
RDebugUtils.currentLine=68681728;
 //BA.debugLineNum = 68681728;BA.debugLine="Sub revisaPushService 'ignore";
RDebugUtils.currentLine=68681766;
 //BA.debugLineNum = 68681766;BA.debugLine="End Sub";
return "";
}
public static String  _revisauug(anywheresoftware.b4a.BA _ba) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "revisauug", false))
	 {return ((String) Debug.delegate(null, "revisauug", new Object[] {_ba}));}
int _daa = 0;
RDebugUtils.currentLine=68550656;
 //BA.debugLineNum = 68550656;BA.debugLine="Sub revisaUUG 'ignore";
RDebugUtils.currentLine=68550657;
 //BA.debugLineNum = 68550657;BA.debugLine="revisaFLP";
_revisaflp(_ba);
RDebugUtils.currentLine=68550658;
 //BA.debugLineNum = 68550658;BA.debugLine="If Tracker.FLP.GetLastKnownLocation.IsInitialized";
if (mostCurrent._tracker._flp /*uk.co.martinpearman.b4a.fusedlocationprovider.FusedLocationProviderWrapper*/ .GetLastKnownLocation().IsInitialized()) { 
RDebugUtils.currentLine=68550659;
 //BA.debugLineNum = 68550659;BA.debugLine="Dim daa As Int = Tracker.UUGCoords.DistanceTo(Tr";
_daa = (int) (mostCurrent._tracker._uugcoords /*anywheresoftware.b4a.gps.LocationWrapper*/ .DistanceTo((android.location.Location)(mostCurrent._tracker._flp /*uk.co.martinpearman.b4a.fusedlocationprovider.FusedLocationProviderWrapper*/ .GetLastKnownLocation().getObject())));
RDebugUtils.currentLine=68550660;
 //BA.debugLineNum = 68550660;BA.debugLine="If B4XPages.MainPage.Logger Then LogColor($\"****";
if (mostCurrent._b4xpages._mainpage /*reparto_intmex.keymon.lat.b4xmainpage*/ (_ba)._logger /*boolean*/ ) { 
anywheresoftware.b4a.keywords.Common.LogImpl("268550660",("**** UUC \""+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_fechakmt(_ba,BA.NumberToString(mostCurrent._tracker._flp /*uk.co.martinpearman.b4a.fusedlocationprovider.FusedLocationProviderWrapper*/ .GetLastKnownLocation().getTime()))))+"|"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("0.2",(Object)(mostCurrent._tracker._flp /*uk.co.martinpearman.b4a.fusedlocationprovider.FusedLocationProviderWrapper*/ .GetLastKnownLocation().getAccuracy()))+"|"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("0.8",(Object)(mostCurrent._tracker._flp /*uk.co.martinpearman.b4a.fusedlocationprovider.FusedLocationProviderWrapper*/ .GetLastKnownLocation().getLatitude()))+"|"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("0.8",(Object)(mostCurrent._tracker._flp /*uk.co.martinpearman.b4a.fusedlocationprovider.FusedLocationProviderWrapper*/ .GetLastKnownLocation().getLongitude()))+"|"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("0.2",(Object)(mostCurrent._tracker._flp /*uk.co.martinpearman.b4a.fusedlocationprovider.FusedLocationProviderWrapper*/ .GetLastKnownLocation().getSpeed()))+"|"),anywheresoftware.b4a.keywords.Common.Colors.RGB((int) (255),(int) (112),(int) (35)));};
RDebugUtils.currentLine=68550661;
 //BA.debugLineNum = 68550661;BA.debugLine="If daa > 40 And Tracker.FLP.GetLastKnownLocation";
if (_daa>40 && mostCurrent._tracker._flp /*uk.co.martinpearman.b4a.fusedlocationprovider.FusedLocationProviderWrapper*/ .GetLastKnownLocation().getAccuracy()<35) { 
RDebugUtils.currentLine=68550662;
 //BA.debugLineNum = 68550662;BA.debugLine="kmt.ExecNonQuery2(\"INSERT INTO RUTA_GPS(fecha,";
_kmt.ExecNonQuery2("INSERT INTO RUTA_GPS(fecha, lat, lon) VALUES (?,?,?)",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(_fechakmt(_ba,BA.NumberToString(mostCurrent._tracker._flp /*uk.co.martinpearman.b4a.fusedlocationprovider.FusedLocationProviderWrapper*/ .GetLastKnownLocation().getTime()))),(Object)(mostCurrent._tracker._flp /*uk.co.martinpearman.b4a.fusedlocationprovider.FusedLocationProviderWrapper*/ .GetLastKnownLocation().getLatitude()),(Object)(mostCurrent._tracker._flp /*uk.co.martinpearman.b4a.fusedlocationprovider.FusedLocationProviderWrapper*/ .GetLastKnownLocation().getLongitude())}));
RDebugUtils.currentLine=68550663;
 //BA.debugLineNum = 68550663;BA.debugLine="If B4XPages.MainPage.Logger Then Log(\"++++ Dist";
if (mostCurrent._b4xpages._mainpage /*reparto_intmex.keymon.lat.b4xmainpage*/ (_ba)._logger /*boolean*/ ) { 
anywheresoftware.b4a.keywords.Common.LogImpl("268550663","++++ Distancia a anterior="+BA.NumberToString(_daa)+"|"+"Precision="+BA.NumberToString(mostCurrent._tracker._flp /*uk.co.martinpearman.b4a.fusedlocationprovider.FusedLocationProviderWrapper*/ .GetLastKnownLocation().getAccuracy()),0);};
 };
RDebugUtils.currentLine=68550665;
 //BA.debugLineNum = 68550665;BA.debugLine="Tracker.UUGCoords = Tracker.FLP.GetLastKnownLoca";
mostCurrent._tracker._uugcoords /*anywheresoftware.b4a.gps.LocationWrapper*/  = mostCurrent._tracker._flp /*uk.co.martinpearman.b4a.fusedlocationprovider.FusedLocationProviderWrapper*/ .GetLastKnownLocation();
 };
RDebugUtils.currentLine=68550667;
 //BA.debugLineNum = 68550667;BA.debugLine="End Sub";
return "";
}
}