package reparto_mazapa.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_mazapa.keymon.lat.main _main = null;
public reparto_mazapa.keymon.lat.appupdater _appupdater = null;
public reparto_mazapa.keymon.lat.tracker _tracker = null;
public reparto_mazapa.keymon.lat.starter _starter = null;
public reparto_mazapa.keymon.lat.firebasemessaging _firebasemessaging = null;
public reparto_mazapa.keymon.lat.foto _foto = null;
public reparto_mazapa.keymon.lat.mapa_cliente _mapa_cliente = null;
public reparto_mazapa.keymon.lat.mapa_rutas _mapa_rutas = null;
public reparto_mazapa.keymon.lat.newinst2 _newinst2 = null;
public reparto_mazapa.keymon.lat.b4xpages _b4xpages = null;
public reparto_mazapa.keymon.lat.b4xcollections _b4xcollections = null;
public reparto_mazapa.keymon.lat.httputils2service _httputils2service = null;
public reparto_mazapa.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=12648448;
 //BA.debugLineNum = 12648448;BA.debugLine="Sub panelVisible(panel As Panel, top As Int, left";
RDebugUtils.currentLine=12648449;
 //BA.debugLineNum = 12648449;BA.debugLine="panel.BringToFront";
_panel.BringToFront();
RDebugUtils.currentLine=12648450;
 //BA.debugLineNum = 12648450;BA.debugLine="panel.Visible = True";
_panel.setVisible(anywheresoftware.b4a.keywords.Common.True);
RDebugUtils.currentLine=12648451;
 //BA.debugLineNum = 12648451;BA.debugLine="panel.Top = top";
_panel.setTop(_top);
RDebugUtils.currentLine=12648452;
 //BA.debugLineNum = 12648452;BA.debugLine="panel.Left = left";
_panel.setLeft(_left);
RDebugUtils.currentLine=12648453;
 //BA.debugLineNum = 12648453;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=12976128;
 //BA.debugLineNum = 12976128;BA.debugLine="Sub centraPanel(elemento As Panel, anchoElementoSu";
RDebugUtils.currentLine=12976129;
 //BA.debugLineNum = 12976129;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=12976130;
 //BA.debugLineNum = 12976130;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=14286848;
 //BA.debugLineNum = 14286848;BA.debugLine="Sub agregaColumna(tabla As String, columna As Stri";
RDebugUtils.currentLine=14286849;
 //BA.debugLineNum = 14286849;BA.debugLine="Try 'Intentamos usar \"pragma_table_info\" para rev";
try {RDebugUtils.currentLine=14286850;
 //BA.debugLineNum = 14286850;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=14286851;
 //BA.debugLineNum = 14286851;BA.debugLine="c.Position = 0";
_c.setPosition((int) (0));
RDebugUtils.currentLine=14286852;
 //BA.debugLineNum = 14286852;BA.debugLine="If c.GetString(\"fCol\") = 0 Then 'Si no esta la c";
if ((_c.GetString("fCol")).equals(BA.NumberToString(0))) { 
RDebugUtils.currentLine=14286853;
 //BA.debugLineNum = 14286853;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=14286854;
 //BA.debugLineNum = 14286854;BA.debugLine="Log($\"Columna \"${columna} ${tipo}\", agregada a";
anywheresoftware.b4a.keywords.Common.LogImpl("314286854",("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=14286857;
 //BA.debugLineNum = 14286857;BA.debugLine="Try";
try {RDebugUtils.currentLine=14286858;
 //BA.debugLineNum = 14286858;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=14286859;
 //BA.debugLineNum = 14286859;BA.debugLine="Log($\"Columna \"${columna} ${tipo}\", agregada a";
anywheresoftware.b4a.keywords.Common.LogImpl("314286859",("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=14286861;
 //BA.debugLineNum = 14286861;BA.debugLine="Log(LastException)";
anywheresoftware.b4a.keywords.Common.LogImpl("314286861",BA.ObjectToString(anywheresoftware.b4a.keywords.Common.LastException(_ba)),0);
 };
 };
RDebugUtils.currentLine=14286864;
 //BA.debugLineNum = 14286864;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=13107200;
 //BA.debugLineNum = 13107200;BA.debugLine="Sub centraBoton(elemento As Button, anchoElementoS";
RDebugUtils.currentLine=13107201;
 //BA.debugLineNum = 13107201;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=13107202;
 //BA.debugLineNum = 13107202;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[] _fecha2 = null;
String _fecha3 = "";
String[] _hora = null;
RDebugUtils.currentLine=14548992;
 //BA.debugLineNum = 14548992;BA.debugLine="Sub traefECHAPREV As String 'ignore";
RDebugUtils.currentLine=14548993;
 //BA.debugLineNum = 14548993;BA.debugLine="Private c As Cursor";
_c = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
RDebugUtils.currentLine=14548994;
 //BA.debugLineNum = 14548994;BA.debugLine="Private a As String";
_a = "";
RDebugUtils.currentLine=14548995;
 //BA.debugLineNum = 14548995;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=14548996;
 //BA.debugLineNum = 14548996;BA.debugLine="clienteasing.Position = 0";
_clienteasing.setPosition((int) (0));
RDebugUtils.currentLine=14548997;
 //BA.debugLineNum = 14548997;BA.debugLine="If clienteasing.GetString(\"CUENTA\") <> \"63403\" Th";
if ((_clienteasing.GetString("CUENTA")).equals("63403") == false) { 
RDebugUtils.currentLine=14548998;
 //BA.debugLineNum = 14548998;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=14548999;
 //BA.debugLineNum = 14548999;BA.debugLine="c.Position = 0";
_c.setPosition((int) (0));
RDebugUtils.currentLine=14549000;
 //BA.debugLineNum = 14549000;BA.debugLine="Dim fecha() As String = Regex.Split(\" \", c.GetSt";
_fecha = anywheresoftware.b4a.keywords.Common.Regex.Split(" ",_c.GetString("HVD_FECHA"));
RDebugUtils.currentLine=14549001;
 //BA.debugLineNum = 14549001;BA.debugLine="Dim fecha2() As String = Regex.Split(\"-\", fecha(";
_fecha2 = anywheresoftware.b4a.keywords.Common.Regex.Split("-",_fecha[(int) (0)]);
RDebugUtils.currentLine=14549002;
 //BA.debugLineNum = 14549002;BA.debugLine="Dim fecha3 As String = fecha2(2)&\"/\"&fecha2(1)&\"";
_fecha3 = _fecha2[(int) (2)]+"/"+_fecha2[(int) (1)]+"/"+_fecha2[(int) (0)];
RDebugUtils.currentLine=14549003;
 //BA.debugLineNum = 14549003;BA.debugLine="Log(fecha3)";
anywheresoftware.b4a.keywords.Common.LogImpl("314549003",_fecha3,0);
RDebugUtils.currentLine=14549004;
 //BA.debugLineNum = 14549004;BA.debugLine="Dim hora() As String = Regex.Split(\"\\.\", fecha(1";
_hora = anywheresoftware.b4a.keywords.Common.Regex.Split("\\.",_fecha[(int) (1)]);
RDebugUtils.currentLine=14549005;
 //BA.debugLineNum = 14549005;BA.debugLine="a = fecha3 & \" \" & hora(0)";
_a = _fecha3+" "+_hora[(int) (0)];
RDebugUtils.currentLine=14549006;
 //BA.debugLineNum = 14549006;BA.debugLine="c.Close";
_c.Close();
 }else 
{RDebugUtils.currentLine=14549007;
 //BA.debugLineNum = 14549007;BA.debugLine="Else If clienteasing.GetString(\"CUENTA\") = \"63403";
if ((_clienteasing.GetString("CUENTA")).equals("63403")) { 
RDebugUtils.currentLine=14549008;
 //BA.debugLineNum = 14549008;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=14549009;
 //BA.debugLineNum = 14549009;BA.debugLine="c.Position = 0";
_c.setPosition((int) (0));
RDebugUtils.currentLine=14549010;
 //BA.debugLineNum = 14549010;BA.debugLine="Dim fecha() As String = Regex.Split(\" \", c.GetSt";
_fecha = anywheresoftware.b4a.keywords.Common.Regex.Split(" ",_c.GetString("HVD_FECHA"));
RDebugUtils.currentLine=14549011;
 //BA.debugLineNum = 14549011;BA.debugLine="Dim fecha2() As String = Regex.Split(\"-\", fecha(";
_fecha2 = anywheresoftware.b4a.keywords.Common.Regex.Split("-",_fecha[(int) (0)]);
RDebugUtils.currentLine=14549012;
 //BA.debugLineNum = 14549012;BA.debugLine="Dim fecha3 As String = fecha2(2)&\"/\"&fecha2(1)&\"";
_fecha3 = _fecha2[(int) (2)]+"/"+_fecha2[(int) (1)]+"/"+_fecha2[(int) (0)];
RDebugUtils.currentLine=14549013;
 //BA.debugLineNum = 14549013;BA.debugLine="Log(fecha3)";
anywheresoftware.b4a.keywords.Common.LogImpl("314549013",_fecha3,0);
RDebugUtils.currentLine=14549014;
 //BA.debugLineNum = 14549014;BA.debugLine="Dim hora() As String = Regex.Split(\"\\.\", fecha(1";
_hora = anywheresoftware.b4a.keywords.Common.Regex.Split("\\.",_fecha[(int) (1)]);
RDebugUtils.currentLine=14549015;
 //BA.debugLineNum = 14549015;BA.debugLine="a = fecha3 & \" \" & hora(0)";
_a = _fecha3+" "+_hora[(int) (0)];
RDebugUtils.currentLine=14549016;
 //BA.debugLineNum = 14549016;BA.debugLine="c.Close";
_c.Close();
 }}
;
RDebugUtils.currentLine=14549018;
 //BA.debugLineNum = 14549018;BA.debugLine="Return a";
if (true) return _a;
RDebugUtils.currentLine=14549019;
 //BA.debugLineNum = 14549019;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=14024704;
 //BA.debugLineNum = 14024704;BA.debugLine="Sub traeCantYMonto2(cliente As String) As Map";
RDebugUtils.currentLine=14024706;
 //BA.debugLineNum = 14024706;BA.debugLine="Private cant As Int = 0";
_cant = (int) (0);
RDebugUtils.currentLine=14024707;
 //BA.debugLineNum = 14024707;BA.debugLine="Private monto As Float = 0";
_monto = (float) (0);
RDebugUtils.currentLine=14024708;
 //BA.debugLineNum = 14024708;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=14024709;
 //BA.debugLineNum = 14024709;BA.debugLine="If ccym.RowCount > 0 Then";
if (_ccym.getRowCount()>0) { 
RDebugUtils.currentLine=14024710;
 //BA.debugLineNum = 14024710;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=14024711;
 //BA.debugLineNum = 14024711;BA.debugLine="ccym.Position = i";
_ccym.setPosition(_i);
RDebugUtils.currentLine=14024712;
 //BA.debugLineNum = 14024712;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=14024713;
 //BA.debugLineNum = 14024713;BA.debugLine="cant = cant + ccym.GetString(\"HVD_CANT\")";
_cant = (int) (_cant+(double)(Double.parseDouble(_ccym.GetString("HVD_CANT"))));
RDebugUtils.currentLine=14024715;
 //BA.debugLineNum = 14024715;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=14024721;
 //BA.debugLineNum = 14024721;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=14024722;
 //BA.debugLineNum = 14024722;BA.debugLine="If ccym.RowCount > 0 Then";
if (_ccym.getRowCount()>0) { 
RDebugUtils.currentLine=14024723;
 //BA.debugLineNum = 14024723;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=14024724;
 //BA.debugLineNum = 14024724;BA.debugLine="ccym.Position = i";
_ccym.setPosition(_i);
RDebugUtils.currentLine=14024725;
 //BA.debugLineNum = 14024725;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=14024726;
 //BA.debugLineNum = 14024726;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=14024728;
 //BA.debugLineNum = 14024728;BA.debugLine="Log($\"CANT=${cant}, MONTO=${monto}\"$)";
anywheresoftware.b4a.keywords.Common.LogImpl("314024728",("CANT="+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_cant))+", MONTO="+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_monto))+""),0);
 };
RDebugUtils.currentLine=14024731;
 //BA.debugLineNum = 14024731;BA.debugLine="ccym.Close";
_ccym.Close();
RDebugUtils.currentLine=14024732;
 //BA.debugLineNum = 14024732;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=14024733;
 //BA.debugLineNum = 14024733;BA.debugLine="End Sub";
return null;
}
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=13500416;
 //BA.debugLineNum = 13500416;BA.debugLine="Sub traeCliente As String 'ignore";
RDebugUtils.currentLine=13500417;
 //BA.debugLineNum = 13500417;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=13500418;
 //BA.debugLineNum = 13500418;BA.debugLine="cli.Position = 0";
_cli.setPosition((int) (0));
RDebugUtils.currentLine=13500419;
 //BA.debugLineNum = 13500419;BA.debugLine="Private cl As String = cli.GetString(\"CUENTA\")";
_cl = _cli.GetString("CUENTA");
RDebugUtils.currentLine=13500420;
 //BA.debugLineNum = 13500420;BA.debugLine="cli.Close";
_cli.Close();
RDebugUtils.currentLine=13500421;
 //BA.debugLineNum = 13500421;BA.debugLine="Return cl";
if (true) return _cl;
RDebugUtils.currentLine=13500422;
 //BA.debugLineNum = 13500422;BA.debugLine="End Sub";
return "";
}
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=14417920;
 //BA.debugLineNum = 14417920;BA.debugLine="Sub traeAlmacen As String 'ignore";
RDebugUtils.currentLine=14417921;
 //BA.debugLineNum = 14417921;BA.debugLine="Private c As Cursor";
_c = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
RDebugUtils.currentLine=14417922;
 //BA.debugLineNum = 14417922;BA.debugLine="Private a As String";
_a = "";
RDebugUtils.currentLine=14417923;
 //BA.debugLineNum = 14417923;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=14417924;
 //BA.debugLineNum = 14417924;BA.debugLine="c.Position = 0";
_c.setPosition((int) (0));
RDebugUtils.currentLine=14417925;
 //BA.debugLineNum = 14417925;BA.debugLine="a = C.GetString(\"ID_ALMACEN\")";
_a = _c.GetString("ID_ALMACEN");
RDebugUtils.currentLine=14417926;
 //BA.debugLineNum = 14417926;BA.debugLine="c.Close";
_c.Close();
RDebugUtils.currentLine=14417927;
 //BA.debugLineNum = 14417927;BA.debugLine="Return a";
if (true) return _a;
RDebugUtils.currentLine=14417928;
 //BA.debugLineNum = 14417928;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=12910592;
 //BA.debugLineNum = 12910592;BA.debugLine="Sub centraListView(elemento As ListView, anchoElem";
RDebugUtils.currentLine=12910593;
 //BA.debugLineNum = 12910593;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=12910594;
 //BA.debugLineNum = 12910594;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=12845056;
 //BA.debugLineNum = 12845056;BA.debugLine="Sub SetDivider(lv As ListView, Color As Int, Heigh";
RDebugUtils.currentLine=12845057;
 //BA.debugLineNum = 12845057;BA.debugLine="Dim r As Reflector";
_r = new anywheresoftware.b4a.agraham.reflection.Reflection();
RDebugUtils.currentLine=12845058;
 //BA.debugLineNum = 12845058;BA.debugLine="r.Target = lv";
_r.Target = (Object)(_lv.getObject());
RDebugUtils.currentLine=12845059;
 //BA.debugLineNum = 12845059;BA.debugLine="Dim CD As ColorDrawable";
_cd = new anywheresoftware.b4a.objects.drawable.ColorDrawable();
RDebugUtils.currentLine=12845060;
 //BA.debugLineNum = 12845060;BA.debugLine="CD.Initialize(Color, 0)";
_cd.Initialize(_color,(int) (0));
RDebugUtils.currentLine=12845061;
 //BA.debugLineNum = 12845061;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=12845062;
 //BA.debugLineNum = 12845062;BA.debugLine="r.RunMethod2(\"setDividerHeight\", Height, \"java.la";
_r.RunMethod2("setDividerHeight",BA.NumberToString(_height),"java.lang.int");
RDebugUtils.currentLine=12845063;
 //BA.debugLineNum = 12845063;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=13041664;
 //BA.debugLineNum = 13041664;BA.debugLine="Sub centraEtiqueta(elemento As Label, anchoElement";
RDebugUtils.currentLine=13041665;
 //BA.debugLineNum = 13041665;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=13041666;
 //BA.debugLineNum = 13041666;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=14352384;
 //BA.debugLineNum = 14352384;BA.debugLine="Sub traeRutaReparto As String 'ignore";
RDebugUtils.currentLine=14352385;
 //BA.debugLineNum = 14352385;BA.debugLine="Private c As Cursor";
_c = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
RDebugUtils.currentLine=14352386;
 //BA.debugLineNum = 14352386;BA.debugLine="Private r As String";
_r = "";
RDebugUtils.currentLine=14352387;
 //BA.debugLineNum = 14352387;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=14352388;
 //BA.debugLineNum = 14352388;BA.debugLine="r = \"0\"";
_r = "0";
RDebugUtils.currentLine=14352389;
 //BA.debugLineNum = 14352389;BA.debugLine="If c.RowCount > 0 Then";
if (_c.getRowCount()>0) { 
RDebugUtils.currentLine=14352390;
 //BA.debugLineNum = 14352390;BA.debugLine="c.Position=0";
_c.setPosition((int) (0));
RDebugUtils.currentLine=14352391;
 //BA.debugLineNum = 14352391;BA.debugLine="r = c.GetString(\"RUTAA\")";
_r = _c.GetString("RUTAA");
 };
RDebugUtils.currentLine=14352393;
 //BA.debugLineNum = 14352393;BA.debugLine="c.Close";
_c.Close();
RDebugUtils.currentLine=14352394;
 //BA.debugLineNum = 14352394;BA.debugLine="Return r";
if (true) return _r;
RDebugUtils.currentLine=14352395;
 //BA.debugLineNum = 14352395;BA.debugLine="End Sub";
return "";
}
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=14090240;
 //BA.debugLineNum = 14090240;BA.debugLine="Sub traeEntregados As Map";
RDebugUtils.currentLine=14090241;
 //BA.debugLineNum = 14090241;BA.debugLine="Private m As Map";
_m = new anywheresoftware.b4a.objects.collections.Map();
RDebugUtils.currentLine=14090242;
 //BA.debugLineNum = 14090242;BA.debugLine="Private cant As Int = 0";
_cant = (int) (0);
RDebugUtils.currentLine=14090243;
 //BA.debugLineNum = 14090243;BA.debugLine="Private monto As String = 0";
_monto = BA.NumberToString(0);
RDebugUtils.currentLine=14090244;
 //BA.debugLineNum = 14090244;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=14090245;
 //BA.debugLineNum = 14090245;BA.debugLine="If rc.RowCount > 0 Then";
if (_rc.getRowCount()>0) { 
RDebugUtils.currentLine=14090246;
 //BA.debugLineNum = 14090246;BA.debugLine="rc.Position = 0";
_rc.setPosition((int) (0));
RDebugUtils.currentLine=14090247;
 //BA.debugLineNum = 14090247;BA.debugLine="If rc.GetString(\"CUANTOS\") <> Null Then";
if (_rc.GetString("CUANTOS")!= null) { 
RDebugUtils.currentLine=14090248;
 //BA.debugLineNum = 14090248;BA.debugLine="cant = cant + rc.GetString(\"CUANTOS\")";
_cant = (int) (_cant+(double)(Double.parseDouble(_rc.GetString("CUANTOS"))));
RDebugUtils.currentLine=14090249;
 //BA.debugLineNum = 14090249;BA.debugLine="monto = monto + rc.GetString(\"CUANTO\")";
_monto = BA.NumberToString((double)(Double.parseDouble(_monto))+(double)(Double.parseDouble(_rc.GetString("CUANTO"))));
 };
 };
RDebugUtils.currentLine=14090253;
 //BA.debugLineNum = 14090253;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=14090254;
 //BA.debugLineNum = 14090254;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=14155776;
 //BA.debugLineNum = 14155776;BA.debugLine="Sub traeRechazados As Map";
RDebugUtils.currentLine=14155777;
 //BA.debugLineNum = 14155777;BA.debugLine="Private m As Map";
_m = new anywheresoftware.b4a.objects.collections.Map();
RDebugUtils.currentLine=14155778;
 //BA.debugLineNum = 14155778;BA.debugLine="Private cant As Int = 0";
_cant = (int) (0);
RDebugUtils.currentLine=14155779;
 //BA.debugLineNum = 14155779;BA.debugLine="Private monto As String = 0";
_monto = BA.NumberToString(0);
RDebugUtils.currentLine=14155780;
 //BA.debugLineNum = 14155780;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=14155781;
 //BA.debugLineNum = 14155781;BA.debugLine="If rc.RowCount > 0 Then";
if (_rc.getRowCount()>0) { 
RDebugUtils.currentLine=14155782;
 //BA.debugLineNum = 14155782;BA.debugLine="rc.Position = 0";
_rc.setPosition((int) (0));
RDebugUtils.currentLine=14155783;
 //BA.debugLineNum = 14155783;BA.debugLine="If rc.GetString(\"CUANTOS\") <> Null Then";
if (_rc.GetString("CUANTOS")!= null) { 
RDebugUtils.currentLine=14155784;
 //BA.debugLineNum = 14155784;BA.debugLine="cant = cant + rc.GetString(\"CUANTOS\")";
_cant = (int) (_cant+(double)(Double.parseDouble(_rc.GetString("CUANTOS"))));
RDebugUtils.currentLine=14155785;
 //BA.debugLineNum = 14155785;BA.debugLine="monto = monto + rc.GetString(\"CUANTO\")";
_monto = BA.NumberToString((double)(Double.parseDouble(_monto))+(double)(Double.parseDouble(_rc.GetString("CUANTO"))));
 };
 };
RDebugUtils.currentLine=14155789;
 //BA.debugLineNum = 14155789;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=14155790;
 //BA.debugLineNum = 14155790;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=14221312;
 //BA.debugLineNum = 14221312;BA.debugLine="Sub traeVendidos As Map";
RDebugUtils.currentLine=14221313;
 //BA.debugLineNum = 14221313;BA.debugLine="Private m As Map";
_m = new anywheresoftware.b4a.objects.collections.Map();
RDebugUtils.currentLine=14221314;
 //BA.debugLineNum = 14221314;BA.debugLine="Private cant As Int = 0";
_cant = (int) (0);
RDebugUtils.currentLine=14221315;
 //BA.debugLineNum = 14221315;BA.debugLine="Private monto As String = 0";
_monto = BA.NumberToString(0);
RDebugUtils.currentLine=14221316;
 //BA.debugLineNum = 14221316;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=14221317;
 //BA.debugLineNum = 14221317;BA.debugLine="If rc.RowCount > 0 Then";
if (_rc.getRowCount()>0) { 
RDebugUtils.currentLine=14221318;
 //BA.debugLineNum = 14221318;BA.debugLine="rc.Position = 0";
_rc.setPosition((int) (0));
RDebugUtils.currentLine=14221319;
 //BA.debugLineNum = 14221319;BA.debugLine="If rc.GetString(\"CUANTOS\") <> Null Then";
if (_rc.GetString("CUANTOS")!= null) { 
RDebugUtils.currentLine=14221320;
 //BA.debugLineNum = 14221320;BA.debugLine="cant = cant + rc.GetString(\"CUANTOS\")";
_cant = (int) (_cant+(double)(Double.parseDouble(_rc.GetString("CUANTOS"))));
RDebugUtils.currentLine=14221321;
 //BA.debugLineNum = 14221321;BA.debugLine="monto = monto + rc.GetString(\"CUANTO\")";
_monto = BA.NumberToString((double)(Double.parseDouble(_monto))+(double)(Double.parseDouble(_rc.GetString("CUANTO"))));
 };
 };
RDebugUtils.currentLine=14221325;
 //BA.debugLineNum = 14221325;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=14221326;
 //BA.debugLineNum = 14221326;BA.debugLine="End Sub";
return null;
}
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=13434880;
 //BA.debugLineNum = 13434880;BA.debugLine="Sub traeConversion(id As String) As String";
RDebugUtils.currentLine=13434881;
 //BA.debugLineNum = 13434881;BA.debugLine="Private pu As String = \"0\"";
_pu = "0";
RDebugUtils.currentLine=13434883;
 //BA.debugLineNum = 13434883;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=13434884;
 //BA.debugLineNum = 13434884;BA.debugLine="If idc.RowCount > 0 Then";
if (_idc.getRowCount()>0) { 
RDebugUtils.currentLine=13434885;
 //BA.debugLineNum = 13434885;BA.debugLine="idc.Position=0";
_idc.setPosition((int) (0));
RDebugUtils.currentLine=13434886;
 //BA.debugLineNum = 13434886;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=13434889;
 //BA.debugLineNum = 13434889;BA.debugLine="idc.Close";
_idc.Close();
RDebugUtils.currentLine=13434891;
 //BA.debugLineNum = 13434891;BA.debugLine="Return pu";
if (true) return _pu;
RDebugUtils.currentLine=13434892;
 //BA.debugLineNum = 13434892;BA.debugLine="End Sub";
return "";
}
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=12779520;
 //BA.debugLineNum = 12779520;BA.debugLine="Sub dameUsuarioDeDB As String 'ignore";
RDebugUtils.currentLine=12779521;
 //BA.debugLineNum = 12779521;BA.debugLine="Private c As Cursor";
_c = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
RDebugUtils.currentLine=12779522;
 //BA.debugLineNum = 12779522;BA.debugLine="Private u As String = \"SinUsuario\"";
_u = "SinUsuario";
RDebugUtils.currentLine=12779523;
 //BA.debugLineNum = 12779523;BA.debugLine="If Not(kmt.IsInitialized) Then revisaBD";
if (anywheresoftware.b4a.keywords.Common.Not(_kmt.IsInitialized())) { 
_revisabd(_ba);};
RDebugUtils.currentLine=12779524;
 //BA.debugLineNum = 12779524;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=12779525;
 //BA.debugLineNum = 12779525;BA.debugLine="c.Position=0";
_c.setPosition((int) (0));
RDebugUtils.currentLine=12779526;
 //BA.debugLineNum = 12779526;BA.debugLine="If c.RowCount > 0 Then u = c.GetString(\"USUARIO\")";
if (_c.getRowCount()>0) { 
_u = _c.GetString("USUARIO");};
RDebugUtils.currentLine=12779527;
 //BA.debugLineNum = 12779527;BA.debugLine="c.Close";
_c.Close();
RDebugUtils.currentLine=12779528;
 //BA.debugLineNum = 12779528;BA.debugLine="Return u";
if (true) return _u;
RDebugUtils.currentLine=12779529;
 //BA.debugLineNum = 12779529;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=10682368;
 //BA.debugLineNum = 10682368;BA.debugLine="Sub hmsKMT As String 'ignore";
RDebugUtils.currentLine=10682370;
 //BA.debugLineNum = 10682370;BA.debugLine="Dim OrigFormat As String = DateTime.DateFormat  '";
_origformat = anywheresoftware.b4a.keywords.Common.DateTime.getDateFormat();
RDebugUtils.currentLine=10682371;
 //BA.debugLineNum = 10682371;BA.debugLine="DateTime.DateFormat=\"HHmmss\"";
anywheresoftware.b4a.keywords.Common.DateTime.setDateFormat("HHmmss");
RDebugUtils.currentLine=10682372;
 //BA.debugLineNum = 10682372;BA.debugLine="Private nuevaHora As String=DateTime.Date(DateTim";
_nuevahora = anywheresoftware.b4a.keywords.Common.DateTime.Date(anywheresoftware.b4a.keywords.Common.DateTime.getNow());
RDebugUtils.currentLine=10682373;
 //BA.debugLineNum = 10682373;BA.debugLine="DateTime.DateFormat=OrigFormat  'return to orig d";
anywheresoftware.b4a.keywords.Common.DateTime.setDateFormat(_origformat);
RDebugUtils.currentLine=10682375;
 //BA.debugLineNum = 10682375;BA.debugLine="Return nuevaHora";
if (true) return _nuevahora;
RDebugUtils.currentLine=10682376;
 //BA.debugLineNum = 10682376;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=10616832;
 //BA.debugLineNum = 10616832;BA.debugLine="Sub fechaKMT(fecha As String) As String 'ignore";
RDebugUtils.currentLine=10616834;
 //BA.debugLineNum = 10616834;BA.debugLine="Dim OrigFormat As String = DateTime.DateFormat  '";
_origformat = anywheresoftware.b4a.keywords.Common.DateTime.getDateFormat();
RDebugUtils.currentLine=10616835;
 //BA.debugLineNum = 10616835;BA.debugLine="DateTime.DateFormat=\"yyMMddHHmmss\"";
anywheresoftware.b4a.keywords.Common.DateTime.setDateFormat("yyMMddHHmmss");
RDebugUtils.currentLine=10616836;
 //BA.debugLineNum = 10616836;BA.debugLine="Dim nuevaFecha As String=DateTime.Date(fecha)";
_nuevafecha = anywheresoftware.b4a.keywords.Common.DateTime.Date((long)(Double.parseDouble(_fecha)));
RDebugUtils.currentLine=10616837;
 //BA.debugLineNum = 10616837;BA.debugLine="DateTime.DateFormat=OrigFormat  'return to orig d";
anywheresoftware.b4a.keywords.Common.DateTime.setDateFormat(_origformat);
RDebugUtils.currentLine=10616839;
 //BA.debugLineNum = 10616839;BA.debugLine="Return nuevaFecha";
if (true) return _nuevafecha;
RDebugUtils.currentLine=10616840;
 //BA.debugLineNum = 10616840;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=11534336;
 //BA.debugLineNum = 11534336;BA.debugLine="Sub mandamosLoc(coords As String) 'ignore";
RDebugUtils.currentLine=11534352;
 //BA.debugLineNum = 11534352;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=10944512;
 //BA.debugLineNum = 10944512;BA.debugLine="Sub guardaInfoEnBD(coords As String) 'ignore";
RDebugUtils.currentLine=10944513;
 //BA.debugLineNum = 10944513;BA.debugLine="If B4XPages.MainPage.logger Then Log(\"Guardamos u";
if (mostCurrent._b4xpages._mainpage /*reparto_mazapa.keymon.lat.b4xmainpage*/ (_ba)._logger /*boolean*/ ) { 
anywheresoftware.b4a.keywords.Common.LogImpl("310944513","Guardamos ubicacion en BD - "+_coords,0);};
RDebugUtils.currentLine=10944514;
 //BA.debugLineNum = 10944514;BA.debugLine="Try";
try {RDebugUtils.currentLine=10944515;
 //BA.debugLineNum = 10944515;BA.debugLine="Dim latlon() As String = Regex.Split(\"\\|\", coord";
_latlon = anywheresoftware.b4a.keywords.Common.Regex.Split("\\|",_coords);
RDebugUtils.currentLine=10944516;
 //BA.debugLineNum = 10944516;BA.debugLine="If latlon.Length < 2 Then latlon = Regex.Split(\"";
if (_latlon.length<2) { 
_latlon = anywheresoftware.b4a.keywords.Common.Regex.Split(",",_coords);};
RDebugUtils.currentLine=10944518;
 //BA.debugLineNum = 10944518;BA.debugLine="If Not(kmt.IsInitialized) Then revisaBD";
if (anywheresoftware.b4a.keywords.Common.Not(_kmt.IsInitialized())) { 
_revisabd(_ba);};
RDebugUtils.currentLine=10944519;
 //BA.debugLineNum = 10944519;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=10944521;
 //BA.debugLineNum = 10944521;BA.debugLine="Log(LastException)";
anywheresoftware.b4a.keywords.Common.LogImpl("310944521",BA.ObjectToString(anywheresoftware.b4a.keywords.Common.LastException(_ba)),0);
 };
RDebugUtils.currentLine=10944523;
 //BA.debugLineNum = 10944523;BA.debugLine="End Sub";
return "";
}
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=11927552;
 //BA.debugLineNum = 11927552;BA.debugLine="Sub Monitor 'ignore";
RDebugUtils.currentLine=11927570;
 //BA.debugLineNum = 11927570;BA.debugLine="End Sub";
return "";
}
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=12189696;
 //BA.debugLineNum = 12189696;BA.debugLine="Sub borraArribaDe100Errores 'ignore";
RDebugUtils.currentLine=12189697;
 //BA.debugLineNum = 12189697;BA.debugLine="If Not(errorLog.IsInitialized) Then revisaBD";
if (anywheresoftware.b4a.keywords.Common.Not(_errorlog.IsInitialized())) { 
_revisabd(_ba);};
RDebugUtils.currentLine=12189698;
 //BA.debugLineNum = 12189698;BA.debugLine="LogColor(\"Recortamos la tabla de Errores, limite";
anywheresoftware.b4a.keywords.Common.LogImpl("312189698","Recortamos la tabla de Errores, limite de 100",anywheresoftware.b4a.keywords.Common.Colors.Magenta);
RDebugUtils.currentLine=12189699;
 //BA.debugLineNum = 12189699;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=12189700;
 //BA.debugLineNum = 12189700;BA.debugLine="errorLog.ExecNonQuery(\"vacuum;\")";
_errorlog.ExecNonQuery("vacuum;");
RDebugUtils.currentLine=12189702;
 //BA.debugLineNum = 12189702;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}));}
RDebugUtils.currentLine=11272192;
 //BA.debugLineNum = 11272192;BA.debugLine="Sub revisaBD 'ignore";
RDebugUtils.currentLine=11272193;
 //BA.debugLineNum = 11272193;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=11272194;
 //BA.debugLineNum = 11272194;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=11272195;
 //BA.debugLineNum = 11272195;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=11272197;
 //BA.debugLineNum = 11272197;BA.debugLine="kmt.ExecNonQuery(\"CREATE TABLE IF NOT EXISTS bita";
_kmt.ExecNonQuery("CREATE TABLE IF NOT EXISTS bitacora(fecha INTEGER, texto TEXT)");
RDebugUtils.currentLine=11272199;
 //BA.debugLineNum = 11272199;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=11272201;
 //BA.debugLineNum = 11272201;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=11272202;
 //BA.debugLineNum = 11272202;BA.debugLine="errorLog.ExecNonQuery(\"CREATE TABLE IF NOT EXISTS";
_errorlog.ExecNonQuery("CREATE TABLE IF NOT EXISTS errores(fecha INTEGER, error TEXT)");
RDebugUtils.currentLine=11272203;
 //BA.debugLineNum = 11272203;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=12255232;
 //BA.debugLineNum = 12255232;BA.debugLine="Sub borraArribaDe600RenglonesBitacora 'ignore";
RDebugUtils.currentLine=12255233;
 //BA.debugLineNum = 12255233;BA.debugLine="revisaBD";
_revisabd(_ba);
RDebugUtils.currentLine=12255234;
 //BA.debugLineNum = 12255234;BA.debugLine="LogColor(\"Recortamos la tabla de la Bitacora, lim";
anywheresoftware.b4a.keywords.Common.LogImpl("312255234","Recortamos la tabla de la Bitacora, limite de 600",anywheresoftware.b4a.keywords.Common.Colors.Magenta);
RDebugUtils.currentLine=12255235;
 //BA.debugLineNum = 12255235;BA.debugLine="Private c As Cursor";
_c = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
RDebugUtils.currentLine=12255236;
 //BA.debugLineNum = 12255236;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=12255237;
 //BA.debugLineNum = 12255237;BA.debugLine="c.Position = 0";
_c.setPosition((int) (0));
RDebugUtils.currentLine=12255238;
 //BA.debugLineNum = 12255238;BA.debugLine="If c.RowCount > 650 Then";
if (_c.getRowCount()>650) { 
RDebugUtils.currentLine=12255239;
 //BA.debugLineNum = 12255239;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=12255240;
 //BA.debugLineNum = 12255240;BA.debugLine="kmt.ExecNonQuery(\"vacuum;\")";
_kmt.ExecNonQuery("vacuum;");
 };
RDebugUtils.currentLine=12255243;
 //BA.debugLineNum = 12255243;BA.debugLine="c.Close";
_c.Close();
RDebugUtils.currentLine=12255244;
 //BA.debugLineNum = 12255244;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=11862016;
 //BA.debugLineNum = 11862016;BA.debugLine="Sub borraLogDB 'ignore";
RDebugUtils.currentLine=11862017;
 //BA.debugLineNum = 11862017;BA.debugLine="LogColor(\"Borramos BD de log\", Colors.Magenta)";
anywheresoftware.b4a.keywords.Common.LogImpl("311862017","Borramos BD de log",anywheresoftware.b4a.keywords.Common.Colors.Magenta);
RDebugUtils.currentLine=11862018;
 //BA.debugLineNum = 11862018;BA.debugLine="kmt.ExecNonQuery(\"delete from bitacora\")";
_kmt.ExecNonQuery("delete from bitacora");
RDebugUtils.currentLine=11862019;
 //BA.debugLineNum = 11862019;BA.debugLine="kmt.ExecNonQuery(\"vacuum;\")";
_kmt.ExecNonQuery("vacuum;");
RDebugUtils.currentLine=11862020;
 //BA.debugLineNum = 11862020;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=11206656;
 //BA.debugLineNum = 11206656;BA.debugLine="Sub borramosArchivoGPS 'ignore";
RDebugUtils.currentLine=11206657;
 //BA.debugLineNum = 11206657;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=11206658;
 //BA.debugLineNum = 11206658;BA.debugLine="Dim s As String = \"\"";
_s = "";
RDebugUtils.currentLine=11206659;
 //BA.debugLineNum = 11206659;BA.debugLine="Dim t() As Byte = s.GetBytes(\"UTF-8\")";
_t = _s.getBytes("UTF-8");
RDebugUtils.currentLine=11206660;
 //BA.debugLineNum = 11206660;BA.debugLine="out.WriteBytes(t, 0, t.Length)";
_out.WriteBytes(_t,(int) (0),_t.length);
RDebugUtils.currentLine=11206661;
 //BA.debugLineNum = 11206661;BA.debugLine="out.Close";
_out.Close();
RDebugUtils.currentLine=11206662;
 //BA.debugLineNum = 11206662;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=10485760;
 //BA.debugLineNum = 10485760;BA.debugLine="Sub compress(str As String) As String 'ignore";
RDebugUtils.currentLine=10485762;
 //BA.debugLineNum = 10485762;BA.debugLine="Dim compressed() As Byte = GZip.compress(str)";
_compressed = _gzip.compress(_str);
RDebugUtils.currentLine=10485765;
 //BA.debugLineNum = 10485765;BA.debugLine="Dim base64 As String = su.EncodeBase64(compressed";
_base64 = _su.EncodeBase64(_compressed);
RDebugUtils.currentLine=10485766;
 //BA.debugLineNum = 10485766;BA.debugLine="Log($\"Comprimido: ${base64.Length}\"$)";
anywheresoftware.b4a.keywords.Common.LogImpl("310485766",("Comprimido: "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_base64.length()))+""),0);
RDebugUtils.currentLine=10485768;
 //BA.debugLineNum = 10485768;BA.debugLine="Return base64";
if (true) return _base64;
RDebugUtils.currentLine=10485769;
 //BA.debugLineNum = 10485769;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=12582912;
 //BA.debugLineNum = 12582912;BA.debugLine="Sub copiaDB(result As Boolean) 'ignore";
RDebugUtils.currentLine=12582913;
 //BA.debugLineNum = 12582913;BA.debugLine="If result Then";
if (_result) { 
RDebugUtils.currentLine=12582914;
 //BA.debugLineNum = 12582914;BA.debugLine="Dim p As String";
_p = "";
RDebugUtils.currentLine=12582915;
 //BA.debugLineNum = 12582915;BA.debugLine="If File.ExternalWritable Then";
if (anywheresoftware.b4a.keywords.Common.File.getExternalWritable()) { 
RDebugUtils.currentLine=12582916;
 //BA.debugLineNum = 12582916;BA.debugLine="p = File.DirInternal";
_p = anywheresoftware.b4a.keywords.Common.File.getDirInternal();
 }else {
RDebugUtils.currentLine=12582919;
 //BA.debugLineNum = 12582919;BA.debugLine="p = File.DirInternal";
_p = anywheresoftware.b4a.keywords.Common.File.getDirInternal();
 };
RDebugUtils.currentLine=12582922;
 //BA.debugLineNum = 12582922;BA.debugLine="Dim theDir As String";
_thedir = "";
RDebugUtils.currentLine=12582923;
 //BA.debugLineNum = 12582923;BA.debugLine="Try";
try {RDebugUtils.currentLine=12582924;
 //BA.debugLineNum = 12582924;BA.debugLine="File.MakeDir(File.DirInternal,\"kmts\")";
anywheresoftware.b4a.keywords.Common.File.MakeDir(anywheresoftware.b4a.keywords.Common.File.getDirInternal(),"kmts");
RDebugUtils.currentLine=12582925;
 //BA.debugLineNum = 12582925;BA.debugLine="theDir = \"/kmts\"";
_thedir = "/kmts";
 } 
       catch (Exception e13) {
			(_ba.processBA == null ? _ba : _ba.processBA).setLastException(e13);RDebugUtils.currentLine=12582927;
 //BA.debugLineNum = 12582927;BA.debugLine="theDir = \"\"";
_thedir = "";
 };
RDebugUtils.currentLine=12582929;
 //BA.debugLineNum = 12582929;BA.debugLine="Try";
try {RDebugUtils.currentLine=12582930;
 //BA.debugLineNum = 12582930;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=12582931;
 //BA.debugLineNum = 12582931;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=12582933;
 //BA.debugLineNum = 12582933;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=12582935;
 //BA.debugLineNum = 12582935;BA.debugLine="Log(\"rootExternal=\"&p)";
anywheresoftware.b4a.keywords.Common.LogImpl("312582935","rootExternal="+_p,0);
RDebugUtils.currentLine=12582936;
 //BA.debugLineNum = 12582936;BA.debugLine="Log(\"File.DirInternal=\"&File.DirInternal)";
anywheresoftware.b4a.keywords.Common.LogImpl("312582936","File.DirInternal="+anywheresoftware.b4a.keywords.Common.File.getDirInternal(),0);
RDebugUtils.currentLine=12582937;
 //BA.debugLineNum = 12582937;BA.debugLine="Log(\"File.DirInternal=\"&File.DirInternal)";
anywheresoftware.b4a.keywords.Common.LogImpl("312582937","File.DirInternal="+anywheresoftware.b4a.keywords.Common.File.getDirInternal(),0);
 }else {
RDebugUtils.currentLine=12582939;
 //BA.debugLineNum = 12582939;BA.debugLine="ToastMessageShow(\"Sin permisos\", False)";
anywheresoftware.b4a.keywords.Common.ToastMessageShow(BA.ObjectToCharSequence("Sin permisos"),anywheresoftware.b4a.keywords.Common.False);
 };
RDebugUtils.currentLine=12582941;
 //BA.debugLineNum = 12582941;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=12386304;
 //BA.debugLineNum = 12386304;BA.debugLine="Sub dameErroresJSON(SQL As SQL, maxErrores As Int,";
RDebugUtils.currentLine=12386305;
 //BA.debugLineNum = 12386305;BA.debugLine="Log(\"dameErroresJSON\")";
anywheresoftware.b4a.keywords.Common.LogImpl("312386305","dameErroresJSON",0);
RDebugUtils.currentLine=12386306;
 //BA.debugLineNum = 12386306;BA.debugLine="Private j As JSONGenerator";
_j = new anywheresoftware.b4a.objects.collections.JSONParser.JSONGenerator();
RDebugUtils.currentLine=12386307;
 //BA.debugLineNum = 12386307;BA.debugLine="Private lim As String";
_lim = "";
RDebugUtils.currentLine=12386308;
 //BA.debugLineNum = 12386308;BA.debugLine="Private cur As ResultSet";
_cur = new anywheresoftware.b4a.sql.SQL.ResultSetWrapper();
RDebugUtils.currentLine=12386309;
 //BA.debugLineNum = 12386309;BA.debugLine="Private l As List";
_l = new anywheresoftware.b4a.objects.collections.List();
RDebugUtils.currentLine=12386310;
 //BA.debugLineNum = 12386310;BA.debugLine="Private i As Int = 0";
_i = (int) (0);
RDebugUtils.currentLine=12386311;
 //BA.debugLineNum = 12386311;BA.debugLine="l.Initialize";
_l.Initialize();
RDebugUtils.currentLine=12386312;
 //BA.debugLineNum = 12386312;BA.debugLine="Dim m, m2 As Map";
_m = new anywheresoftware.b4a.objects.collections.Map();
_m2 = new anywheresoftware.b4a.objects.collections.Map();
RDebugUtils.currentLine=12386313;
 //BA.debugLineNum = 12386313;BA.debugLine="m2.Initialize";
_m2.Initialize();
RDebugUtils.currentLine=12386314;
 //BA.debugLineNum = 12386314;BA.debugLine="If maxErrores = 0 Then lim = \"\" Else lim = \"limit";
if (_maxerrores==0) { 
_lim = "";}
else {
_lim = "limit "+BA.NumberToString(_maxerrores);};
RDebugUtils.currentLine=12386315;
 //BA.debugLineNum = 12386315;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=12386316;
 //BA.debugLineNum = 12386316;BA.debugLine="Do While cur.NextRow";
while (_cur.NextRow()) {
RDebugUtils.currentLine=12386317;
 //BA.debugLineNum = 12386317;BA.debugLine="m.Initialize";
_m.Initialize();
RDebugUtils.currentLine=12386318;
 //BA.debugLineNum = 12386318;BA.debugLine="m.Put(\"fecha\", cur.GetString(\"fecha\"))";
_m.Put((Object)("fecha"),(Object)(_cur.GetString("fecha")));
RDebugUtils.currentLine=12386319;
 //BA.debugLineNum = 12386319;BA.debugLine="m.Put(\"error\", cur.GetString(\"error\"))";
_m.Put((Object)("error"),(Object)(_cur.GetString("error")));
RDebugUtils.currentLine=12386320;
 //BA.debugLineNum = 12386320;BA.debugLine="m2.Put(i,m)";
_m2.Put((Object)(_i),(Object)(_m.getObject()));
RDebugUtils.currentLine=12386321;
 //BA.debugLineNum = 12386321;BA.debugLine="i = i + 1";
_i = (int) (_i+1);
 }
;
RDebugUtils.currentLine=12386323;
 //BA.debugLineNum = 12386323;BA.debugLine="cur.Close";
_cur.Close();
RDebugUtils.currentLine=12386324;
 //BA.debugLineNum = 12386324;BA.debugLine="j.Initialize(m2)";
_j.Initialize(_m2);
RDebugUtils.currentLine=12386325;
 //BA.debugLineNum = 12386325;BA.debugLine="Log(j.ToString)";
anywheresoftware.b4a.keywords.Common.LogImpl("312386325",_j.ToString(),0);
RDebugUtils.currentLine=12386326;
 //BA.debugLineNum = 12386326;BA.debugLine="If comprimido Then";
if (_comprimido) { 
RDebugUtils.currentLine=12386327;
 //BA.debugLineNum = 12386327;BA.debugLine="Return compress(j.ToString)";
if (true) return _compress(_ba,_j.ToString());
 }else {
RDebugUtils.currentLine=12386329;
 //BA.debugLineNum = 12386329;BA.debugLine="Return j.ToString";
if (true) return _j.ToString();
 };
RDebugUtils.currentLine=12386331;
 //BA.debugLineNum = 12386331;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=11010048;
 //BA.debugLineNum = 11010048;BA.debugLine="Sub dameRuta(inicioRuta As String, origenRuta As S";
RDebugUtils.currentLine=11010050;
 //BA.debugLineNum = 11010050;BA.debugLine="Dim fechaInicio As String";
_fechainicio = "";
RDebugUtils.currentLine=11010051;
 //BA.debugLineNum = 11010051;BA.debugLine="Try 'incioRuta es numero";
try {RDebugUtils.currentLine=11010052;
 //BA.debugLineNum = 11010052;BA.debugLine="inicioRuta = inicioRuta * 1";
_inicioruta = BA.NumberToString((double)(Double.parseDouble(_inicioruta))*1);
RDebugUtils.currentLine=11010054;
 //BA.debugLineNum = 11010054;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=11010056;
 //BA.debugLineNum = 11010056;BA.debugLine="fechaInicio = fechaInicioHoy";
_fechainicio = _fechainiciohoy(_ba);
 };
RDebugUtils.currentLine=11010059;
 //BA.debugLineNum = 11010059;BA.debugLine="If B4XPages.MainPage.logger Then Log(\"fechaInicio";
if (mostCurrent._b4xpages._mainpage /*reparto_mazapa.keymon.lat.b4xmainpage*/ (_ba)._logger /*boolean*/ ) { 
anywheresoftware.b4a.keywords.Common.LogImpl("311010059","fechaInicio: "+_fechainicio+" | rutaHrsAtras="+BA.NumberToString(_rutahrsatras),0);};
RDebugUtils.currentLine=11010060;
 //BA.debugLineNum = 11010060;BA.debugLine="Dim c As Cursor";
_c = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
RDebugUtils.currentLine=11010061;
 //BA.debugLineNum = 11010061;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=11010062;
 //BA.debugLineNum = 11010062;BA.debugLine="If B4XPages.MainPage.logger Then Log(\"select FECH";
if (mostCurrent._b4xpages._mainpage /*reparto_mazapa.keymon.lat.b4xmainpage*/ (_ba)._logger /*boolean*/ ) { 
anywheresoftware.b4a.keywords.Common.LogImpl("311010062","select FECHA, LAT, LON from "+_origenruta+" where FECHA > "+_fechainicio+" order by FECHA desc limit "+BA.NumberToString(_rutamaxpoints),0);};
RDebugUtils.currentLine=11010063;
 //BA.debugLineNum = 11010063;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=11010064;
 //BA.debugLineNum = 11010064;BA.debugLine="c.Position = 0";
_c.setPosition((int) (0));
RDebugUtils.currentLine=11010065;
 //BA.debugLineNum = 11010065;BA.debugLine="Dim ruta2 As String = \"\"";
_ruta2 = "";
RDebugUtils.currentLine=11010066;
 //BA.debugLineNum = 11010066;BA.debugLine="If c.RowCount>0 Then";
if (_c.getRowCount()>0) { 
RDebugUtils.currentLine=11010067;
 //BA.debugLineNum = 11010067;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=11010068;
 //BA.debugLineNum = 11010068;BA.debugLine="c.Position=i";
_c.setPosition(_i);
RDebugUtils.currentLine=11010069;
 //BA.debugLineNum = 11010069;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=11010070;
 //BA.debugLineNum = 11010070;BA.debugLine="B4XPages.MainPage.fechaRuta = c.GetString(\"FECH";
mostCurrent._b4xpages._mainpage /*reparto_mazapa.keymon.lat.b4xmainpage*/ (_ba)._fecharuta /*String*/  = _c.GetString("FECHA");
 }
};
 };
RDebugUtils.currentLine=11010073;
 //BA.debugLineNum = 11010073;BA.debugLine="c.Close";
_c.Close();
RDebugUtils.currentLine=11010074;
 //BA.debugLineNum = 11010074;BA.debugLine="Return compress(ruta2)";
if (true) return _compress(_ba,_ruta2);
RDebugUtils.currentLine=11010075;
 //BA.debugLineNum = 11010075;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=11599872;
 //BA.debugLineNum = 11599872;BA.debugLine="Sub fechaInicioHoy As String 'ignore";
RDebugUtils.currentLine=11599873;
 //BA.debugLineNum = 11599873;BA.debugLine="Dim OrigFormat As String = DateTime.DateFormat";
_origformat = anywheresoftware.b4a.keywords.Common.DateTime.getDateFormat();
RDebugUtils.currentLine=11599874;
 //BA.debugLineNum = 11599874;BA.debugLine="DateTime.DateFormat=\"yyMMdd\"";
anywheresoftware.b4a.keywords.Common.DateTime.setDateFormat("yyMMdd");
RDebugUtils.currentLine=11599875;
 //BA.debugLineNum = 11599875;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=11599876;
 //BA.debugLineNum = 11599876;BA.debugLine="DateTime.DateFormat=OrigFormat  'return to orig";
anywheresoftware.b4a.keywords.Common.DateTime.setDateFormat(_origformat);
RDebugUtils.currentLine=11599877;
 //BA.debugLineNum = 11599877;BA.debugLine="Log(\"Hoy=\"&h)";
anywheresoftware.b4a.keywords.Common.LogImpl("311599877","Hoy="+_h,0);
RDebugUtils.currentLine=11599878;
 //BA.debugLineNum = 11599878;BA.debugLine="Return h";
if (true) return _h;
RDebugUtils.currentLine=11599879;
 //BA.debugLineNum = 11599879;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=10551296;
 //BA.debugLineNum = 10551296;BA.debugLine="Sub decompress(base64 As String) As String 'ignore";
RDebugUtils.currentLine=10551297;
 //BA.debugLineNum = 10551297;BA.debugLine="Dim decompressedbytes() As Byte = su.DecodeBase64";
_decompressedbytes = _su.DecodeBase64(_base64);
RDebugUtils.currentLine=10551299;
 //BA.debugLineNum = 10551299;BA.debugLine="Dim bc As ByteConverter";
_bc = new anywheresoftware.b4a.agraham.byteconverter.ByteConverter();
RDebugUtils.currentLine=10551300;
 //BA.debugLineNum = 10551300;BA.debugLine="Dim uncompressed As String = bc.StringFromBytes(d";
_uncompressed = _bc.StringFromBytes(_decompressedbytes,"UTF8");
RDebugUtils.currentLine=10551301;
 //BA.debugLineNum = 10551301;BA.debugLine="Log($\"Descomprimido: ${uncompressed.Length}\"$)";
anywheresoftware.b4a.keywords.Common.LogImpl("310551301",("Descomprimido: "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_uncompressed.length()))+""),0);
RDebugUtils.currentLine=10551303;
 //BA.debugLineNum = 10551303;BA.debugLine="Return uncompressed";
if (true) return _uncompressed;
RDebugUtils.currentLine=10551304;
 //BA.debugLineNum = 10551304;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=11141120;
 //BA.debugLineNum = 11141120;BA.debugLine="Sub deleteErrorLog_DB 'ignore";
RDebugUtils.currentLine=11141121;
 //BA.debugLineNum = 11141121;BA.debugLine="If Not(errorLog.IsInitialized) Then revisaBD";
if (anywheresoftware.b4a.keywords.Common.Not(_errorlog.IsInitialized())) { 
_revisabd(_ba);};
RDebugUtils.currentLine=11141122;
 //BA.debugLineNum = 11141122;BA.debugLine="errorLog.ExecNonQuery(\"delete from errores\")";
_errorlog.ExecNonQuery("delete from errores");
RDebugUtils.currentLine=11141123;
 //BA.debugLineNum = 11141123;BA.debugLine="errorLog.ExecNonQuery(\"vacuum;\")";
_errorlog.ExecNonQuery("vacuum;");
RDebugUtils.currentLine=11141124;
 //BA.debugLineNum = 11141124;BA.debugLine="ToastMessageShow(\"Borrada\", False)";
anywheresoftware.b4a.keywords.Common.ToastMessageShow(BA.ObjectToCharSequence("Borrada"),anywheresoftware.b4a.keywords.Common.False);
RDebugUtils.currentLine=11141125;
 //BA.debugLineNum = 11141125;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=11075584;
 //BA.debugLineNum = 11075584;BA.debugLine="Sub deleteGPS_DB 'ignore";
RDebugUtils.currentLine=11075585;
 //BA.debugLineNum = 11075585;BA.debugLine="kmt.ExecNonQuery(\"delete from RUTA_GPS\")";
_kmt.ExecNonQuery("delete from RUTA_GPS");
RDebugUtils.currentLine=11075586;
 //BA.debugLineNum = 11075586;BA.debugLine="kmt.ExecNonQuery(\"vacuum;\")";
_kmt.ExecNonQuery("vacuum;");
RDebugUtils.currentLine=11075587;
 //BA.debugLineNum = 11075587;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=12451840;
 //BA.debugLineNum = 12451840;BA.debugLine="Sub fechaKMT2Ticks(fKMT As String) As Long 'ignore";
RDebugUtils.currentLine=12451841;
 //BA.debugLineNum = 12451841;BA.debugLine="Try";
try {RDebugUtils.currentLine=12451842;
 //BA.debugLineNum = 12451842;BA.debugLine="If fKMT.Length = 12 Then";
if (_fkmt.length()==12) { 
RDebugUtils.currentLine=12451843;
 //BA.debugLineNum = 12451843;BA.debugLine="Private parteFecha As String = fKMT.SubString2(";
_partefecha = _fkmt.substring((int) (0),(int) (6));
RDebugUtils.currentLine=12451844;
 //BA.debugLineNum = 12451844;BA.debugLine="Private parteHora As String = fKMT.SubString(6)";
_partehora = _fkmt.substring((int) (6));
RDebugUtils.currentLine=12451845;
 //BA.debugLineNum = 12451845;BA.debugLine="Private OrigFormat As String = DateTime.DateFor";
_origformat = anywheresoftware.b4a.keywords.Common.DateTime.getDateFormat();
RDebugUtils.currentLine=12451846;
 //BA.debugLineNum = 12451846;BA.debugLine="DateTime.DateFormat=\"yyMMdd\"";
anywheresoftware.b4a.keywords.Common.DateTime.setDateFormat("yyMMdd");
RDebugUtils.currentLine=12451847;
 //BA.debugLineNum = 12451847;BA.debugLine="DateTime.TimeFormat=\"HHmmss\"";
anywheresoftware.b4a.keywords.Common.DateTime.setTimeFormat("HHmmss");
RDebugUtils.currentLine=12451848;
 //BA.debugLineNum = 12451848;BA.debugLine="Private ticks As Long = DateTime.DateTimeParse(";
_ticks = anywheresoftware.b4a.keywords.Common.DateTime.DateTimeParse(_partefecha,_partehora);
RDebugUtils.currentLine=12451850;
 //BA.debugLineNum = 12451850;BA.debugLine="DateTime.DateFormat=OrigFormat  'return to orig";
anywheresoftware.b4a.keywords.Common.DateTime.setDateFormat(_origformat);
RDebugUtils.currentLine=12451851;
 //BA.debugLineNum = 12451851;BA.debugLine="Return ticks";
if (true) return _ticks;
 }else {
RDebugUtils.currentLine=12451853;
 //BA.debugLineNum = 12451853;BA.debugLine="Log(\"Formato de fecha incorrecto, debe de ser '";
anywheresoftware.b4a.keywords.Common.LogImpl("312451853","Formato de fecha incorrecto, debe de ser 'YYMMDDHHMMSS', no '"+_fkmt+"' largo="+BA.NumberToString(_fkmt.length()),0);
RDebugUtils.currentLine=12451854;
 //BA.debugLineNum = 12451854;BA.debugLine="Return 0";
if (true) return (long) (0);
 };
 } 
       catch (Exception e16) {
			(_ba.processBA == null ? _ba : _ba.processBA).setLastException(e16);RDebugUtils.currentLine=12451857;
 //BA.debugLineNum = 12451857;BA.debugLine="Log(LastException)";
anywheresoftware.b4a.keywords.Common.LogImpl("312451857",BA.ObjectToString(anywheresoftware.b4a.keywords.Common.LastException(_ba)),0);
RDebugUtils.currentLine=12451858;
 //BA.debugLineNum = 12451858;BA.debugLine="LogColor($\"Fecha dada: ${fKMT}, Parte Fecha: ${p";
anywheresoftware.b4a.keywords.Common.LogImpl("312451858",("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=12451859;
 //BA.debugLineNum = 12451859;BA.debugLine="Return 0";
if (true) return (long) (0);
 };
RDebugUtils.currentLine=12451861;
 //BA.debugLineNum = 12451861;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=10420224;
 //BA.debugLineNum = 10420224;BA.debugLine="Sub getPhnId As String 'ignore";
RDebugUtils.currentLine=10420226;
 //BA.debugLineNum = 10420226;BA.debugLine="devModel = phn.Model";
_devmodel = _phn.getModel();
RDebugUtils.currentLine=10420227;
 //BA.debugLineNum = 10420227;BA.debugLine="If devModel.Length <= 3 Then 'Si phn.Model esta e";
if (_devmodel.length()<=3) { 
RDebugUtils.currentLine=10420228;
 //BA.debugLineNum = 10420228;BA.debugLine="Dim t As String = phn.GetSettings(\"android_id\")";
_t = _phn.GetSettings("android_id");
RDebugUtils.currentLine=10420229;
 //BA.debugLineNum = 10420229;BA.debugLine="devModel = t";
_devmodel = _t;
 };
RDebugUtils.currentLine=10420231;
 //BA.debugLineNum = 10420231;BA.debugLine="If devModel.Length >= 3 Then 'Si tenemos valor pa";
if (_devmodel.length()>=3) { 
RDebugUtils.currentLine=10420232;
 //BA.debugLineNum = 10420232;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=10420234;
 //BA.debugLineNum = 10420234;BA.debugLine="Else If devModel.Length < 3 Then ' Si no tenemos";
if (_devmodel.length()<3) { 
RDebugUtils.currentLine=10420235;
 //BA.debugLineNum = 10420235;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=10420236;
 //BA.debugLineNum = 10420236;BA.debugLine="devModel = s";
_devmodel = _s;
 }}
;
RDebugUtils.currentLine=10420240;
 //BA.debugLineNum = 10420240;BA.debugLine="Return devModel";
if (true) return _devmodel;
RDebugUtils.currentLine=10420241;
 //BA.debugLineNum = 10420241;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=11337728;
 //BA.debugLineNum = 11337728;BA.debugLine="Sub getSSID  'ignore";
RDebugUtils.currentLine=11337733;
 //BA.debugLineNum = 11337733;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=10878976;
 //BA.debugLineNum = 10878976;BA.debugLine="Sub guardaInfoEnArchivo(coords As String) 'ignore";
RDebugUtils.currentLine=10878978;
 //BA.debugLineNum = 10878978;BA.debugLine="Dim OrigFormat As String=DateTime.DateFormat  'sa";
_origformat = anywheresoftware.b4a.keywords.Common.DateTime.getDateFormat();
RDebugUtils.currentLine=10878979;
 //BA.debugLineNum = 10878979;BA.debugLine="DateTime.DateFormat=\"MMM-dd HH:mm:ss\"";
anywheresoftware.b4a.keywords.Common.DateTime.setDateFormat("MMM-dd HH:mm:ss");
RDebugUtils.currentLine=10878980;
 //BA.debugLineNum = 10878980;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=10878981;
 //BA.debugLineNum = 10878981;BA.debugLine="DateTime.DateFormat=OrigFormat  'return to orig d";
anywheresoftware.b4a.keywords.Common.DateTime.setDateFormat(_origformat);
RDebugUtils.currentLine=10878983;
 //BA.debugLineNum = 10878983;BA.debugLine="Dim ubic As String = coords&\",\"&lastUpdate";
_ubic = _coords+","+_lastupdate;
RDebugUtils.currentLine=10878984;
 //BA.debugLineNum = 10878984;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=10878985;
 //BA.debugLineNum = 10878985;BA.debugLine="Dim s As String = ubic & CRLF";
_s = _ubic+anywheresoftware.b4a.keywords.Common.CRLF;
RDebugUtils.currentLine=10878986;
 //BA.debugLineNum = 10878986;BA.debugLine="Dim t() As Byte = s.GetBytes(\"UTF-8\")";
_t = _s.getBytes("UTF-8");
RDebugUtils.currentLine=10878987;
 //BA.debugLineNum = 10878987;BA.debugLine="out.WriteBytes(t, 0, t.Length)";
_out.WriteBytes(_t,(int) (0),_t.length);
RDebugUtils.currentLine=10878988;
 //BA.debugLineNum = 10878988;BA.debugLine="out.Close";
_out.Close();
RDebugUtils.currentLine=10878989;
 //BA.debugLineNum = 10878989;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=12713984;
 //BA.debugLineNum = 12713984;BA.debugLine="Sub insertaEnErrores(error As String)  'ignore";
RDebugUtils.currentLine=12713985;
 //BA.debugLineNum = 12713985;BA.debugLine="If Not(errorLog.IsInitialized) Then revisaBD";
if (anywheresoftware.b4a.keywords.Common.Not(_errorlog.IsInitialized())) { 
_revisabd(_ba);};
RDebugUtils.currentLine=12713986;
 //BA.debugLineNum = 12713986;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=12713987;
 //BA.debugLineNum = 12713987;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=12320768;
 //BA.debugLineNum = 12320768;BA.debugLine="Sub insertaRenglonesPruebaEnErrorLog 'ignore";
RDebugUtils.currentLine=12320769;
 //BA.debugLineNum = 12320769;BA.debugLine="If Not(errorLog.IsInitialized) Then revisaBD";
if (anywheresoftware.b4a.keywords.Common.Not(_errorlog.IsInitialized())) { 
_revisabd(_ba);};
RDebugUtils.currentLine=12320770;
 //BA.debugLineNum = 12320770;BA.debugLine="Log(\"insertamos 50 renglones a errorLog\")";
anywheresoftware.b4a.keywords.Common.LogImpl("312320770","insertamos 50 renglones a errorLog",0);
RDebugUtils.currentLine=12320771;
 //BA.debugLineNum = 12320771;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=12320772;
 //BA.debugLineNum = 12320772;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=12320773;
 //BA.debugLineNum = 12320773;BA.debugLine="Log(x)";
anywheresoftware.b4a.keywords.Common.LogImpl("312320773",BA.NumberToString(_x),0);
 }
};
RDebugUtils.currentLine=12320775;
 //BA.debugLineNum = 12320775;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=12517376;
 //BA.debugLineNum = 12517376;BA.debugLine="Sub InstallAPK(dir As String, apk As String) 'igno";
RDebugUtils.currentLine=12517377;
 //BA.debugLineNum = 12517377;BA.debugLine="If File.Exists(dir, apk) Then";
if (anywheresoftware.b4a.keywords.Common.File.Exists(_dir,_apk)) { 
RDebugUtils.currentLine=12517378;
 //BA.debugLineNum = 12517378;BA.debugLine="Dim i As Intent";
_i = new anywheresoftware.b4a.objects.IntentWrapper();
RDebugUtils.currentLine=12517379;
 //BA.debugLineNum = 12517379;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=12517380;
 //BA.debugLineNum = 12517380;BA.debugLine="i.SetType(\"application/vnd.android.package-archi";
_i.SetType("application/vnd.android.package-archive");
RDebugUtils.currentLine=12517381;
 //BA.debugLineNum = 12517381;BA.debugLine="StartActivity(i)";
anywheresoftware.b4a.keywords.Common.StartActivity((_ba.processBA == null ? _ba : _ba.processBA),(Object)(_i.getObject()));
 };
RDebugUtils.currentLine=12517383;
 //BA.debugLineNum = 12517383;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=11403264;
 //BA.debugLineNum = 11403264;BA.debugLine="Sub JSON2Map(theJson As String) As Map 'ignore";
RDebugUtils.currentLine=11403266;
 //BA.debugLineNum = 11403266;BA.debugLine="Try";
try {RDebugUtils.currentLine=11403267;
 //BA.debugLineNum = 11403267;BA.debugLine="Private json As JSONParser";
_json = new anywheresoftware.b4a.objects.collections.JSONParser();
RDebugUtils.currentLine=11403268;
 //BA.debugLineNum = 11403268;BA.debugLine="json.Initialize(theJson)";
_json.Initialize(_thejson);
RDebugUtils.currentLine=11403269;
 //BA.debugLineNum = 11403269;BA.debugLine="Return json.NextObject";
if (true) return _json.NextObject();
 } 
       catch (Exception e6) {
			(_ba.processBA == null ? _ba : _ba.processBA).setLastException(e6);RDebugUtils.currentLine=11403271;
 //BA.debugLineNum = 11403271;BA.debugLine="Log(LastException)";
anywheresoftware.b4a.keywords.Common.LogImpl("311403271",BA.ObjectToString(anywheresoftware.b4a.keywords.Common.LastException(_ba)),0);
RDebugUtils.currentLine=11403272;
 //BA.debugLineNum = 11403272;BA.debugLine="log2DB(\"JSON2Map: \"&LastException)";
_log2db(_ba,"JSON2Map: "+BA.ObjectToString(anywheresoftware.b4a.keywords.Common.LastException(_ba)));
RDebugUtils.currentLine=11403273;
 //BA.debugLineNum = 11403273;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=11403274;
 //BA.debugLineNum = 11403274;BA.debugLine="Return m";
if (true) return _m;
 };
RDebugUtils.currentLine=11403276;
 //BA.debugLineNum = 11403276;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=11665408;
 //BA.debugLineNum = 11665408;BA.debugLine="Sub log2DB(texto As String) 'ignore";
RDebugUtils.currentLine=11665409;
 //BA.debugLineNum = 11665409;BA.debugLine="LogColor(fechaKMT(DateTime.Now)&\" - log2BD: '\"&te";
anywheresoftware.b4a.keywords.Common.LogImpl("311665409",_fechakmt(_ba,BA.NumberToString(anywheresoftware.b4a.keywords.Common.DateTime.getNow()))+" - log2BD: '"+_texto+"'",anywheresoftware.b4a.keywords.Common.Colors.Magenta);
RDebugUtils.currentLine=11665410;
 //BA.debugLineNum = 11665410;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=11665411;
 //BA.debugLineNum = 11665411;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=11468800;
 //BA.debugLineNum = 11468800;BA.debugLine="Sub map2JSON(m As Map) As String 'ignore";
RDebugUtils.currentLine=11468803;
 //BA.debugLineNum = 11468803;BA.debugLine="Dim jg As JSONGenerator";
_jg = new anywheresoftware.b4a.objects.collections.JSONParser.JSONGenerator();
RDebugUtils.currentLine=11468804;
 //BA.debugLineNum = 11468804;BA.debugLine="jg.Initialize(m)";
_jg.Initialize(_m);
RDebugUtils.currentLine=11468805;
 //BA.debugLineNum = 11468805;BA.debugLine="Dim t As String = jg.ToString";
_t = _jg.ToString();
RDebugUtils.currentLine=11468806;
 //BA.debugLineNum = 11468806;BA.debugLine="Return t";
if (true) return _t;
RDebugUtils.currentLine=11468807;
 //BA.debugLineNum = 11468807;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=11730944;
 //BA.debugLineNum = 11730944;BA.debugLine="Sub masDeXXMins(hora As Int, mins As Int) As Boole";
RDebugUtils.currentLine=11730945;
 //BA.debugLineNum = 11730945;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=11730946;
 //BA.debugLineNum = 11730946;BA.debugLine="Return True";
if (true) return anywheresoftware.b4a.keywords.Common.True;
 }else {
RDebugUtils.currentLine=11730948;
 //BA.debugLineNum = 11730948;BA.debugLine="Return False";
if (true) return anywheresoftware.b4a.keywords.Common.False;
 };
RDebugUtils.currentLine=11730950;
 //BA.debugLineNum = 11730950;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=11796480;
 //BA.debugLineNum = 11796480;BA.debugLine="Sub masDeXXMinsKMT(hora As String, mins As Int) As";
RDebugUtils.currentLine=11796481;
 //BA.debugLineNum = 11796481;BA.debugLine="Try";
try {RDebugUtils.currentLine=11796483;
 //BA.debugLineNum = 11796483;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=11796485;
 //BA.debugLineNum = 11796485;BA.debugLine="Return True";
if (true) return anywheresoftware.b4a.keywords.Common.True;
 }else {
RDebugUtils.currentLine=11796488;
 //BA.debugLineNum = 11796488;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=11796491;
 //BA.debugLineNum = 11796491;BA.debugLine="Log(LastException)";
anywheresoftware.b4a.keywords.Common.LogImpl("311796491",BA.ObjectToString(anywheresoftware.b4a.keywords.Common.LastException(_ba)),0);
 };
RDebugUtils.currentLine=11796493;
 //BA.debugLineNum = 11796493;BA.debugLine="End Sub";
return false;
}
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=10747904;
 //BA.debugLineNum = 10747904;BA.debugLine="Sub notiHigh(title As String, body As String, acti";
RDebugUtils.currentLine=10747905;
 //BA.debugLineNum = 10747905;BA.debugLine="Private notif As Notification";
_notif = new anywheresoftware.b4a.objects.NotificationWrapper();
RDebugUtils.currentLine=10747906;
 //BA.debugLineNum = 10747906;BA.debugLine="notif.Initialize2(notif.IMPORTANCE_HIGH)";
_notif.Initialize2(_notif.IMPORTANCE_HIGH);
RDebugUtils.currentLine=10747907;
 //BA.debugLineNum = 10747907;BA.debugLine="notif.Icon = \"icon\"";
_notif.setIcon("icon");
RDebugUtils.currentLine=10747908;
 //BA.debugLineNum = 10747908;BA.debugLine="notif.Vibrate = False";
_notif.setVibrate(anywheresoftware.b4a.keywords.Common.False);
RDebugUtils.currentLine=10747909;
 //BA.debugLineNum = 10747909;BA.debugLine="notif.Sound = False";
_notif.setSound(anywheresoftware.b4a.keywords.Common.False);
RDebugUtils.currentLine=10747910;
 //BA.debugLineNum = 10747910;BA.debugLine="notif.AutoCancel = True";
_notif.setAutoCancel(anywheresoftware.b4a.keywords.Common.True);
RDebugUtils.currentLine=10747911;
 //BA.debugLineNum = 10747911;BA.debugLine="Log(\"notiHigh: \"&title)";
anywheresoftware.b4a.keywords.Common.LogImpl("310747911","notiHigh: "+_title,0);
RDebugUtils.currentLine=10747912;
 //BA.debugLineNum = 10747912;BA.debugLine="notif.SetInfo(title, body, activity)";
_notif.SetInfoNew((_ba.processBA == null ? _ba : _ba.processBA),BA.ObjectToCharSequence(_title),BA.ObjectToCharSequence(_body),_activity);
RDebugUtils.currentLine=10747914;
 //BA.debugLineNum = 10747914;BA.debugLine="notif.Notify(777)";
_notif.Notify((int) (777));
RDebugUtils.currentLine=10747915;
 //BA.debugLineNum = 10747915;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=10813440;
 //BA.debugLineNum = 10813440;BA.debugLine="Sub notiLowReturn(title As String, Body As String,";
RDebugUtils.currentLine=10813441;
 //BA.debugLineNum = 10813441;BA.debugLine="Private notification As Notification";
_notification = new anywheresoftware.b4a.objects.NotificationWrapper();
RDebugUtils.currentLine=10813442;
 //BA.debugLineNum = 10813442;BA.debugLine="notification.Initialize2(notification.IMPORTANCE_";
_notification.Initialize2(_notification.IMPORTANCE_LOW);
RDebugUtils.currentLine=10813443;
 //BA.debugLineNum = 10813443;BA.debugLine="Log(\"notiLowReturn: \"&title)";
anywheresoftware.b4a.keywords.Common.LogImpl("310813443","notiLowReturn: "+_title,0);
RDebugUtils.currentLine=10813444;
 //BA.debugLineNum = 10813444;BA.debugLine="notification.Icon = \"icon\"";
_notification.setIcon("icon");
RDebugUtils.currentLine=10813445;
 //BA.debugLineNum = 10813445;BA.debugLine="notification.Sound = False";
_notification.setSound(anywheresoftware.b4a.keywords.Common.False);
RDebugUtils.currentLine=10813446;
 //BA.debugLineNum = 10813446;BA.debugLine="notification.Vibrate = False";
_notification.setVibrate(anywheresoftware.b4a.keywords.Common.False);
RDebugUtils.currentLine=10813447;
 //BA.debugLineNum = 10813447;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=10813448;
 //BA.debugLineNum = 10813448;BA.debugLine="notification.Notify(id)";
_notification.Notify(_id);
RDebugUtils.currentLine=10813450;
 //BA.debugLineNum = 10813450;BA.debugLine="Return notification";
if (true) return _notification;
RDebugUtils.currentLine=10813451;
 //BA.debugLineNum = 10813451;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=13893632;
 //BA.debugLineNum = 13893632;BA.debugLine="Sub prodRechazo(clienteOriginal As String, prodId";
RDebugUtils.currentLine=13893633;
 //BA.debugLineNum = 13893633;BA.debugLine="Log(\"RECHAZO DEVOLUCION\")";
anywheresoftware.b4a.keywords.Common.LogImpl("313893633","RECHAZO DEVOLUCION",0);
RDebugUtils.currentLine=13893634;
 //BA.debugLineNum = 13893634;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=13893635;
 //BA.debugLineNum = 13893635;BA.debugLine="rr.Position = 0";
_rr.setPosition((int) (0));
RDebugUtils.currentLine=13893636;
 //BA.debugLineNum = 13893636;BA.debugLine="If rr.GetString(\"hayRechazo\") = 0 Then";
if ((_rr.GetString("hayRechazo")).equals(BA.NumberToString(0))) { 
RDebugUtils.currentLine=13893637;
 //BA.debugLineNum = 13893637;BA.debugLine="Log(\"INSERTAMOS EN REPARTO\")";
anywheresoftware.b4a.keywords.Common.LogImpl("313893637","INSERTAMOS EN REPARTO",0);
RDebugUtils.currentLine=13893639;
 //BA.debugLineNum = 13893639;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=13893641;
 //BA.debugLineNum = 13893641;BA.debugLine="If chv.RowCount > 0 Then";
if (_chv.getRowCount()>0) { 
RDebugUtils.currentLine=13893642;
 //BA.debugLineNum = 13893642;BA.debugLine="chv.Position = 0";
_chv.setPosition((int) (0));
RDebugUtils.currentLine=13893644;
 //BA.debugLineNum = 13893644;BA.debugLine="Private precio As String = traePrecio(prodId, t";
_precio = _traeprecio(_ba,_prodid,_traealmacen(_ba));
RDebugUtils.currentLine=13893645;
 //BA.debugLineNum = 13893645;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=13893646;
 //BA.debugLineNum = 13893646;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=13893647;
 //BA.debugLineNum = 13893647;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=13893650;
 //BA.debugLineNum = 13893650;BA.debugLine="Log($\"ACTUALIZAMOS REPARTO\"$)";
anywheresoftware.b4a.keywords.Common.LogImpl("313893650",("ACTUALIZAMOS REPARTO"),0);
RDebugUtils.currentLine=13893651;
 //BA.debugLineNum = 13893651;BA.debugLine="Private precio As String = traePrecio(prodId, tr";
_precio = _traeprecio(_ba,_prodid,_traealmacen(_ba));
RDebugUtils.currentLine=13893652;
 //BA.debugLineNum = 13893652;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=13893653;
 //BA.debugLineNum = 13893653;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=13893654;
 //BA.debugLineNum = 13893654;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=13893657;
 //BA.debugLineNum = 13893657;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=13893659;
 //BA.debugLineNum = 13893659;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=13238272;
 //BA.debugLineNum = 13238272;BA.debugLine="Sub traePrecio(id As String, quePromo As String) A";
RDebugUtils.currentLine=13238273;
 //BA.debugLineNum = 13238273;BA.debugLine="Private pu As String = \"0\"";
_pu = "0";
RDebugUtils.currentLine=13238275;
 //BA.debugLineNum = 13238275;BA.debugLine="If quePromo = traeAlmacen Then";
if ((_quepromo).equals(_traealmacen(_ba))) { 
RDebugUtils.currentLine=13238276;
 //BA.debugLineNum = 13238276;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=13238277;
 //BA.debugLineNum = 13238277;BA.debugLine="If idc.RowCount > 0 Then";
if (_idc.getRowCount()>0) { 
RDebugUtils.currentLine=13238278;
 //BA.debugLineNum = 13238278;BA.debugLine="idc.Position=0";
_idc.setPosition((int) (0));
RDebugUtils.currentLine=13238279;
 //BA.debugLineNum = 13238279;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=13238282;
 //BA.debugLineNum = 13238282;BA.debugLine="idc.Close";
_idc.Close();
 }else {
RDebugUtils.currentLine=13238284;
 //BA.debugLineNum = 13238284;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=13238285;
 //BA.debugLineNum = 13238285;BA.debugLine="If pc.RowCount > 0 Then";
if (_pc.getRowCount()>0) { 
RDebugUtils.currentLine=13238286;
 //BA.debugLineNum = 13238286;BA.debugLine="pc.Position = 0";
_pc.setPosition((int) (0));
RDebugUtils.currentLine=13238288;
 //BA.debugLineNum = 13238288;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=13238289;
 //BA.debugLineNum = 13238289;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=13238293;
 //BA.debugLineNum = 13238293;BA.debugLine="pc.Close";
_pc.Close();
 };
RDebugUtils.currentLine=13238296;
 //BA.debugLineNum = 13238296;BA.debugLine="Return pu";
if (true) return _pu;
RDebugUtils.currentLine=13238298;
 //BA.debugLineNum = 13238298;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=13828096;
 //BA.debugLineNum = 13828096;BA.debugLine="Sub prodVenta(clienteOriginal As String, prodId As";
RDebugUtils.currentLine=13828098;
 //BA.debugLineNum = 13828098;BA.debugLine="Private precio As String = traePrecio(prodId, tra";
_precio = _traeprecio(_ba,_prodid,_traealmacen(_ba));
RDebugUtils.currentLine=13828099;
 //BA.debugLineNum = 13828099;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=13828100;
 //BA.debugLineNum = 13828100;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=13828101;
 //BA.debugLineNum = 13828101;BA.debugLine="Log($\"update reparto set REP_CANT = REP_CANT - 1";
anywheresoftware.b4a.keywords.Common.LogImpl("313828101",("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=13828102;
 //BA.debugLineNum = 13828102;BA.debugLine="Log($\"update reparto set REP_CANT = REP_CANT + 1";
anywheresoftware.b4a.keywords.Common.LogImpl("313828102",("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=13828103;
 //BA.debugLineNum = 13828103;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=13828124;
 //BA.debugLineNum = 13828124;BA.debugLine="End Sub";
return "";
}
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=12058624;
 //BA.debugLineNum = 12058624;BA.debugLine="Sub revisaFLP 'ignore";
RDebugUtils.currentLine=12058625;
 //BA.debugLineNum = 12058625;BA.debugLine="LogColor($\"**** **** Revisamos FLP - ${fechaKMT(D";
anywheresoftware.b4a.keywords.Common.LogImpl("312058625",("**** **** 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=12058626;
 //BA.debugLineNum = 12058626;BA.debugLine="Private todoBienFLP As Boolean = True";
_todobienflp = anywheresoftware.b4a.keywords.Common.True;
RDebugUtils.currentLine=12058627;
 //BA.debugLineNum = 12058627;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=12058628;
 //BA.debugLineNum = 12058628;BA.debugLine="log2DB(\"revisaFLP: No esta inicializado ... 'Rei";
_log2db(_ba,"revisaFLP: No esta inicializado ... 'Reinicializando FLP'");
RDebugUtils.currentLine=12058629;
 //BA.debugLineNum = 12058629;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=12058630;
 //BA.debugLineNum = 12058630;BA.debugLine="todoBienFLP = False";
_todobienflp = anywheresoftware.b4a.keywords.Common.False;
 };
RDebugUtils.currentLine=12058632;
 //BA.debugLineNum = 12058632;BA.debugLine="If Tracker.FLP.IsInitialized Then";
if (mostCurrent._tracker._flp /*uk.co.martinpearman.b4a.fusedlocationprovider.FusedLocationProviderWrapper*/ .IsInitialized()) { 
RDebugUtils.currentLine=12058633;
 //BA.debugLineNum = 12058633;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=12058634;
 //BA.debugLineNum = 12058634;BA.debugLine="log2DB(\"revisaFLP: No esta conectado ... 'Recon";
_log2db(_ba,"revisaFLP: No esta conectado ... 'Reconectando FLP'");
RDebugUtils.currentLine=12058636;
 //BA.debugLineNum = 12058636;BA.debugLine="CallSubDelayed(Tracker,\"StartFLP\")";
anywheresoftware.b4a.keywords.Common.CallSubDelayed((_ba.processBA == null ? _ba : _ba.processBA),(Object)(mostCurrent._tracker.getObject()),"StartFLP");
RDebugUtils.currentLine=12058637;
 //BA.debugLineNum = 12058637;BA.debugLine="todoBienFLP = False";
_todobienflp = anywheresoftware.b4a.keywords.Common.False;
 };
RDebugUtils.currentLine=12058639;
 //BA.debugLineNum = 12058639;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=12058642;
 //BA.debugLineNum = 12058642;BA.debugLine="log2DB(\"revisaFLP: 'No se esta actualizando, lo";
_log2db(_ba,"revisaFLP: 'No se esta actualizando, lo reiniciamos ...'");
RDebugUtils.currentLine=12058643;
 //BA.debugLineNum = 12058643;BA.debugLine="StartService(Tracker)";
anywheresoftware.b4a.keywords.Common.StartService((_ba.processBA == null ? _ba : _ba.processBA),(Object)(mostCurrent._tracker.getObject()));
RDebugUtils.currentLine=12058644;
 //BA.debugLineNum = 12058644;BA.debugLine="todoBienFLP = False";
_todobienflp = anywheresoftware.b4a.keywords.Common.False;
 };
 };
RDebugUtils.currentLine=12058647;
 //BA.debugLineNum = 12058647;BA.debugLine="If todoBienFLP Then LogColor(\" +++ +++ Sin errore";
if (_todobienflp) { 
anywheresoftware.b4a.keywords.Common.LogImpl("312058647"," +++ +++ Sin errores en FLP",anywheresoftware.b4a.keywords.Common.Colors.Green);};
RDebugUtils.currentLine=12058649;
 //BA.debugLineNum = 12058649;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=12124160;
 //BA.debugLineNum = 12124160;BA.debugLine="Sub revisaPushService 'ignore";
RDebugUtils.currentLine=12124198;
 //BA.debugLineNum = 12124198;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=11993088;
 //BA.debugLineNum = 11993088;BA.debugLine="Sub revisaUUG 'ignore";
RDebugUtils.currentLine=11993089;
 //BA.debugLineNum = 11993089;BA.debugLine="revisaFLP";
_revisaflp(_ba);
RDebugUtils.currentLine=11993090;
 //BA.debugLineNum = 11993090;BA.debugLine="If Tracker.FLP.GetLastKnownLocation.IsInitialized";
if (mostCurrent._tracker._flp /*uk.co.martinpearman.b4a.fusedlocationprovider.FusedLocationProviderWrapper*/ .GetLastKnownLocation().IsInitialized()) { 
RDebugUtils.currentLine=11993091;
 //BA.debugLineNum = 11993091;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=11993092;
 //BA.debugLineNum = 11993092;BA.debugLine="If B4XPages.MainPage.Logger Then LogColor($\"****";
if (mostCurrent._b4xpages._mainpage /*reparto_mazapa.keymon.lat.b4xmainpage*/ (_ba)._logger /*boolean*/ ) { 
anywheresoftware.b4a.keywords.Common.LogImpl("311993092",("**** 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=11993093;
 //BA.debugLineNum = 11993093;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=11993094;
 //BA.debugLineNum = 11993094;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=11993095;
 //BA.debugLineNum = 11993095;BA.debugLine="If B4XPages.MainPage.Logger Then Log(\"++++ Dist";
if (mostCurrent._b4xpages._mainpage /*reparto_mazapa.keymon.lat.b4xmainpage*/ (_ba)._logger /*boolean*/ ) { 
anywheresoftware.b4a.keywords.Common.LogImpl("311993095","++++ Distancia a anterior="+BA.NumberToString(_daa)+"|"+"Precision="+BA.NumberToString(mostCurrent._tracker._flp /*uk.co.martinpearman.b4a.fusedlocationprovider.FusedLocationProviderWrapper*/ .GetLastKnownLocation().getAccuracy()),0);};
 };
RDebugUtils.currentLine=11993097;
 //BA.debugLineNum = 11993097;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=11993099;
 //BA.debugLineNum = 11993099;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=13631488;
 //BA.debugLineNum = 13631488;BA.debugLine="Sub traeCantidadRechazada(cliente As String, prodI";
RDebugUtils.currentLine=13631489;
 //BA.debugLineNum = 13631489;BA.debugLine="Private cant As Int = 0";
_cant = (int) (0);
RDebugUtils.currentLine=13631490;
 //BA.debugLineNum = 13631490;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=13631491;
 //BA.debugLineNum = 13631491;BA.debugLine="If cr.RowCount > 0 Then";
if (_cr.getRowCount()>0) { 
RDebugUtils.currentLine=13631492;
 //BA.debugLineNum = 13631492;BA.debugLine="cr.Position = 0";
_cr.setPosition((int) (0));
RDebugUtils.currentLine=13631493;
 //BA.debugLineNum = 13631493;BA.debugLine="cant = cr.GetString(\"REP_CANT\")";
_cant = (int)(Double.parseDouble(_cr.GetString("REP_CANT")));
 };
RDebugUtils.currentLine=13631495;
 //BA.debugLineNum = 13631495;BA.debugLine="Log($\"${cliente}, ${prodId}, rowcont:${cr.RowCoun";
anywheresoftware.b4a.keywords.Common.LogImpl("313631495",(""+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=13631496;
 //BA.debugLineNum = 13631496;BA.debugLine="Return cant";
if (true) return _cant;
RDebugUtils.currentLine=13631497;
 //BA.debugLineNum = 13631497;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=13697024;
 //BA.debugLineNum = 13697024;BA.debugLine="Sub traeCantidadVendida(cliente As String, prodId";
RDebugUtils.currentLine=13697025;
 //BA.debugLineNum = 13697025;BA.debugLine="Private cant As Int = 0";
_cant = (int) (0);
RDebugUtils.currentLine=13697026;
 //BA.debugLineNum = 13697026;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=13697028;
 //BA.debugLineNum = 13697028;BA.debugLine="If cr.RowCount > 0 Then";
if (_cr.getRowCount()>0) { 
RDebugUtils.currentLine=13697029;
 //BA.debugLineNum = 13697029;BA.debugLine="cr.Position = 0";
_cr.setPosition((int) (0));
RDebugUtils.currentLine=13697030;
 //BA.debugLineNum = 13697030;BA.debugLine="cant = cr.GetString(\"REP_CANT\")";
_cant = (int)(Double.parseDouble(_cr.GetString("REP_CANT")));
 };
RDebugUtils.currentLine=13697032;
 //BA.debugLineNum = 13697032;BA.debugLine="Return cant";
if (true) return _cant;
RDebugUtils.currentLine=13697033;
 //BA.debugLineNum = 13697033;BA.debugLine="End Sub";
return 0;
}
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=13565952;
 //BA.debugLineNum = 13565952;BA.debugLine="Sub traeFechaReparto As String";
RDebugUtils.currentLine=13565953;
 //BA.debugLineNum = 13565953;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=13565954;
 //BA.debugLineNum = 13565954;BA.debugLine="Private f As String = \"-\"";
_f = "-";
RDebugUtils.currentLine=13565955;
 //BA.debugLineNum = 13565955;BA.debugLine="If fe.RowCount > 0 Then";
if (_fe.getRowCount()>0) { 
RDebugUtils.currentLine=13565956;
 //BA.debugLineNum = 13565956;BA.debugLine="fe.Position = 0";
_fe.setPosition((int) (0));
RDebugUtils.currentLine=13565957;
 //BA.debugLineNum = 13565957;BA.debugLine="f = fe.GetString(\"HVD_FECHA\")";
_f = _fe.GetString("HVD_FECHA");
 };
RDebugUtils.currentLine=13565959;
 //BA.debugLineNum = 13565959;BA.debugLine="fe.Close";
_fe.Close();
RDebugUtils.currentLine=13565960;
 //BA.debugLineNum = 13565960;BA.debugLine="Return f";
if (true) return _f;
RDebugUtils.currentLine=13565961;
 //BA.debugLineNum = 13565961;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=13762560;
 //BA.debugLineNum = 13762560;BA.debugLine="Sub traeMaxCantidad(cliente As String, prodId As S";
RDebugUtils.currentLine=13762561;
 //BA.debugLineNum = 13762561;BA.debugLine="Private cant As Int = 0";
_cant = (int) (0);
RDebugUtils.currentLine=13762562;
 //BA.debugLineNum = 13762562;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=13762564;
 //BA.debugLineNum = 13762564;BA.debugLine="If cr.RowCount > 0 Then";
if (_cr.getRowCount()>0) { 
RDebugUtils.currentLine=13762565;
 //BA.debugLineNum = 13762565;BA.debugLine="cr.Position = 0";
_cr.setPosition((int) (0));
RDebugUtils.currentLine=13762566;
 //BA.debugLineNum = 13762566;BA.debugLine="cant = cr.GetString(\"HVD_CANT\")";
_cant = (int)(Double.parseDouble(_cr.GetString("HVD_CANT")));
 };
RDebugUtils.currentLine=13762568;
 //BA.debugLineNum = 13762568;BA.debugLine="Return cant";
if (true) return _cant;
RDebugUtils.currentLine=13762569;
 //BA.debugLineNum = 13762569;BA.debugLine="End Sub";
return 0;
}
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=13959168;
 //BA.debugLineNum = 13959168;BA.debugLine="Sub traemosCantYMonto(clv As CustomListView) As Ma";
RDebugUtils.currentLine=13959170;
 //BA.debugLineNum = 13959170;BA.debugLine="Private cant As Int = 0";
_cant = (int) (0);
RDebugUtils.currentLine=13959171;
 //BA.debugLineNum = 13959171;BA.debugLine="Private monto As Float = 0";
_monto = (float) (0);
RDebugUtils.currentLine=13959172;
 //BA.debugLineNum = 13959172;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=13959173;
 //BA.debugLineNum = 13959173;BA.debugLine="Private p0 As B4XView = clv.GetPanel(i)";
_p0 = new anywheresoftware.b4a.objects.B4XViewWrapper();
_p0 = _clv._getpanel(_i);
RDebugUtils.currentLine=13959174;
 //BA.debugLineNum = 13959174;BA.debugLine="Private p As B4XView = p0.GetView(0)";
_p = new anywheresoftware.b4a.objects.B4XViewWrapper();
_p = _p0.GetView((int) (0));
RDebugUtils.currentLine=13959175;
 //BA.debugLineNum = 13959175;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=13959176;
 //BA.debugLineNum = 13959176;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=13959178;
 //BA.debugLineNum = 13959178;BA.debugLine="If cant1.text <> \"\" Then";
if ((_cant1.getText()).equals("") == false) { 
RDebugUtils.currentLine=13959179;
 //BA.debugLineNum = 13959179;BA.debugLine="If cant1.Text = \"\" Then cant1.Text = 0";
if ((_cant1.getText()).equals("")) { 
_cant1.setText(BA.ObjectToCharSequence(0));};
RDebugUtils.currentLine=13959180;
 //BA.debugLineNum = 13959180;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=13959182;
 //BA.debugLineNum = 13959182;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=13959183;
 //BA.debugLineNum = 13959183;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=13959185;
 //BA.debugLineNum = 13959185;BA.debugLine="If cant2.Text = \"\" Then cant2.Text = 0";
if ((_cant2.getText()).equals("")) { 
_cant2.setText(BA.ObjectToCharSequence(0));};
RDebugUtils.currentLine=13959186;
 //BA.debugLineNum = 13959186;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=13959188;
 //BA.debugLineNum = 13959188;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=13959189;
 //BA.debugLineNum = 13959189;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=13959193;
 //BA.debugLineNum = 13959193;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=13959194;
 //BA.debugLineNum = 13959194;BA.debugLine="End Sub";
return null;
}
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=13172736;
 //BA.debugLineNum = 13172736;BA.debugLine="Sub traeNombre(id As String) As String";
RDebugUtils.currentLine=13172737;
 //BA.debugLineNum = 13172737;BA.debugLine="Private nombre As String";
_nombre = "";
RDebugUtils.currentLine=13172738;
 //BA.debugLineNum = 13172738;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=13172739;
 //BA.debugLineNum = 13172739;BA.debugLine="idc.Position=0";
_idc.setPosition((int) (0));
RDebugUtils.currentLine=13172740;
 //BA.debugLineNum = 13172740;BA.debugLine="If idc.RowCount > 0 Then nombre = idc.GetString(\"";
if (_idc.getRowCount()>0) { 
_nombre = _idc.GetString("HVD_PRONOMBRE");};
RDebugUtils.currentLine=13172741;
 //BA.debugLineNum = 13172741;BA.debugLine="idc.Close";
_idc.Close();
RDebugUtils.currentLine=13172743;
 //BA.debugLineNum = 13172743;BA.debugLine="Return nombre";
if (true) return _nombre;
RDebugUtils.currentLine=13172744;
 //BA.debugLineNum = 13172744;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=13303808;
 //BA.debugLineNum = 13303808;BA.debugLine="Sub traePrecio2(id As String, quePromo As String,";
RDebugUtils.currentLine=13303809;
 //BA.debugLineNum = 13303809;BA.debugLine="Private pu As String = \"0\"";
_pu = "0";
RDebugUtils.currentLine=13303811;
 //BA.debugLineNum = 13303811;BA.debugLine="If quePromo = traeAlmacen Then";
if ((_quepromo).equals(_traealmacen(_ba))) { 
RDebugUtils.currentLine=13303812;
 //BA.debugLineNum = 13303812;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=13303813;
 //BA.debugLineNum = 13303813;BA.debugLine="If idc.RowCount > 0 Then";
if (_idc.getRowCount()>0) { 
RDebugUtils.currentLine=13303814;
 //BA.debugLineNum = 13303814;BA.debugLine="idc.Position=0";
_idc.setPosition((int) (0));
RDebugUtils.currentLine=13303815;
 //BA.debugLineNum = 13303815;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=13303818;
 //BA.debugLineNum = 13303818;BA.debugLine="idc.Close";
_idc.Close();
 }else {
RDebugUtils.currentLine=13303820;
 //BA.debugLineNum = 13303820;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=13303821;
 //BA.debugLineNum = 13303821;BA.debugLine="If pc.RowCount > 0 Then";
if (_pc.getRowCount()>0) { 
RDebugUtils.currentLine=13303822;
 //BA.debugLineNum = 13303822;BA.debugLine="pc.Position = 0";
_pc.setPosition((int) (0));
RDebugUtils.currentLine=13303824;
 //BA.debugLineNum = 13303824;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=13303825;
 //BA.debugLineNum = 13303825;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=13303829;
 //BA.debugLineNum = 13303829;BA.debugLine="pc.Close";
_pc.Close();
 };
RDebugUtils.currentLine=13303832;
 //BA.debugLineNum = 13303832;BA.debugLine="Return pu";
if (true) return _pu;
RDebugUtils.currentLine=13303834;
 //BA.debugLineNum = 13303834;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=13369344;
 //BA.debugLineNum = 13369344;BA.debugLine="Sub traePrecioC(id As String) As String";
RDebugUtils.currentLine=13369345;
 //BA.debugLineNum = 13369345;BA.debugLine="Private pu As String = \"0\"";
_pu = "0";
RDebugUtils.currentLine=13369346;
 //BA.debugLineNum = 13369346;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=13369347;
 //BA.debugLineNum = 13369347;BA.debugLine="If idc.RowCount > 0 Then";
if (_idc.getRowCount()>0) { 
RDebugUtils.currentLine=13369348;
 //BA.debugLineNum = 13369348;BA.debugLine="idc.Position=0";
_idc.setPosition((int) (0));
RDebugUtils.currentLine=13369349;
 //BA.debugLineNum = 13369349;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=13369352;
 //BA.debugLineNum = 13369352;BA.debugLine="idc.Close";
_idc.Close();
RDebugUtils.currentLine=13369353;
 //BA.debugLineNum = 13369353;BA.debugLine="Return pu";
if (true) return _pu;
RDebugUtils.currentLine=13369354;
 //BA.debugLineNum = 13369354;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=14614528;
 //BA.debugLineNum = 14614528;BA.debugLine="Sub traerUTAPREV As String 'ignore";
RDebugUtils.currentLine=14614529;
 //BA.debugLineNum = 14614529;BA.debugLine="Private c As Cursor";
_c = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
RDebugUtils.currentLine=14614530;
 //BA.debugLineNum = 14614530;BA.debugLine="Private a As String";
_a = "";
RDebugUtils.currentLine=14614531;
 //BA.debugLineNum = 14614531;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=14614532;
 //BA.debugLineNum = 14614532;BA.debugLine="c.Position = 0";
_c.setPosition((int) (0));
RDebugUtils.currentLine=14614533;
 //BA.debugLineNum = 14614533;BA.debugLine="a = C.GetString(\"CAT_CL_RUTA\")";
_a = _c.GetString("CAT_CL_RUTA");
RDebugUtils.currentLine=14614534;
 //BA.debugLineNum = 14614534;BA.debugLine="c.Close";
_c.Close();
RDebugUtils.currentLine=14614535;
 //BA.debugLineNum = 14614535;BA.debugLine="Return a";
if (true) return _a;
RDebugUtils.currentLine=14614536;
 //BA.debugLineNum = 14614536;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=14483456;
 //BA.debugLineNum = 14483456;BA.debugLine="Sub traeUsuario As String 'ignore";
RDebugUtils.currentLine=14483457;
 //BA.debugLineNum = 14483457;BA.debugLine="Private c As Cursor";
_c = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
RDebugUtils.currentLine=14483458;
 //BA.debugLineNum = 14483458;BA.debugLine="Private a As String";
_a = "";
RDebugUtils.currentLine=14483459;
 //BA.debugLineNum = 14483459;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=14483460;
 //BA.debugLineNum = 14483460;BA.debugLine="c.Position = 0";
_c.setPosition((int) (0));
RDebugUtils.currentLine=14483461;
 //BA.debugLineNum = 14483461;BA.debugLine="a = C.GetString(\"USUARIO\")";
_a = _c.GetString("USUARIO");
RDebugUtils.currentLine=14483462;
 //BA.debugLineNum = 14483462;BA.debugLine="c.Close";
_c.Close();
RDebugUtils.currentLine=14483463;
 //BA.debugLineNum = 14483463;BA.debugLine="Return a";
if (true) return _a;
RDebugUtils.currentLine=14483464;
 //BA.debugLineNum = 14483464;BA.debugLine="End Sub";
return "";
}
}