package reparto_izca.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_izca.keymon.lat.main _main = null;
public reparto_izca.keymon.lat.appupdater _appupdater = null;
public reparto_izca.keymon.lat.foto _foto = null;
public reparto_izca.keymon.lat.mapa_cliente _mapa_cliente = null;
public reparto_izca.keymon.lat.mapa_rutas _mapa_rutas = null;
public reparto_izca.keymon.lat.starter _starter = null;
public reparto_izca.keymon.lat.tracker _tracker = null;
public reparto_izca.keymon.lat.newinst2 _newinst2 = null;
public reparto_izca.keymon.lat.b4xpages _b4xpages = null;
public reparto_izca.keymon.lat.b4xcollections _b4xcollections = null;
public reparto_izca.keymon.lat.httputils2service _httputils2service = null;
public reparto_izca.keymon.lat.xuiviewsutils _xuiviewsutils = null;
public 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=19333120;
 //BA.debugLineNum = 19333120;BA.debugLine="Sub panelVisible(panel As Panel, top As Int, left";
RDebugUtils.currentLine=19333121;
 //BA.debugLineNum = 19333121;BA.debugLine="panel.BringToFront";
_panel.BringToFront();
RDebugUtils.currentLine=19333122;
 //BA.debugLineNum = 19333122;BA.debugLine="panel.Visible = True";
_panel.setVisible(anywheresoftware.b4a.keywords.Common.True);
RDebugUtils.currentLine=19333123;
 //BA.debugLineNum = 19333123;BA.debugLine="panel.Top = top";
_panel.setTop(_top);
RDebugUtils.currentLine=19333124;
 //BA.debugLineNum = 19333124;BA.debugLine="panel.Left = left";
_panel.setLeft(_left);
RDebugUtils.currentLine=19333125;
 //BA.debugLineNum = 19333125;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=19660800;
 //BA.debugLineNum = 19660800;BA.debugLine="Sub centraPanel(elemento As Panel, anchoElementoSu";
RDebugUtils.currentLine=19660801;
 //BA.debugLineNum = 19660801;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=19660802;
 //BA.debugLineNum = 19660802;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=21037056;
 //BA.debugLineNum = 21037056;BA.debugLine="Sub agregaColumna(tabla As String, columna As Stri";
RDebugUtils.currentLine=21037057;
 //BA.debugLineNum = 21037057;BA.debugLine="Try 'Intentamos usar \"pragma_table_info\" para rev";
try {RDebugUtils.currentLine=21037058;
 //BA.debugLineNum = 21037058;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=21037059;
 //BA.debugLineNum = 21037059;BA.debugLine="c.Position = 0";
_c.setPosition((int) (0));
RDebugUtils.currentLine=21037060;
 //BA.debugLineNum = 21037060;BA.debugLine="If c.GetString(\"fCol\") = 0 Then 'Si no esta la c";
if ((_c.GetString("fCol")).equals(BA.NumberToString(0))) { 
RDebugUtils.currentLine=21037061;
 //BA.debugLineNum = 21037061;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=21037062;
 //BA.debugLineNum = 21037062;BA.debugLine="Log($\"Columna \"${columna} ${tipo}\", agregada a";
anywheresoftware.b4a.keywords.Common.LogImpl("821037062",("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=21037065;
 //BA.debugLineNum = 21037065;BA.debugLine="Try";
try {RDebugUtils.currentLine=21037066;
 //BA.debugLineNum = 21037066;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=21037067;
 //BA.debugLineNum = 21037067;BA.debugLine="Log($\"Columna \"${columna} ${tipo}\", agregada a";
anywheresoftware.b4a.keywords.Common.LogImpl("821037067",("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=21037069;
 //BA.debugLineNum = 21037069;BA.debugLine="Log(LastException)";
anywheresoftware.b4a.keywords.Common.LogImpl("821037069",BA.ObjectToString(anywheresoftware.b4a.keywords.Common.LastException(_ba)),0);
 };
 };
RDebugUtils.currentLine=21037072;
 //BA.debugLineNum = 21037072;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=19791872;
 //BA.debugLineNum = 19791872;BA.debugLine="Sub centraBoton(elemento As Button, anchoElementoS";
RDebugUtils.currentLine=19791873;
 //BA.debugLineNum = 19791873;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=19791874;
 //BA.debugLineNum = 19791874;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=21168128;
 //BA.debugLineNum = 21168128;BA.debugLine="Sub traeAlmacen As String 'ignore";
RDebugUtils.currentLine=21168129;
 //BA.debugLineNum = 21168129;BA.debugLine="Private c As Cursor";
_c = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
RDebugUtils.currentLine=21168130;
 //BA.debugLineNum = 21168130;BA.debugLine="Private a As String";
_a = "";
RDebugUtils.currentLine=21168131;
 //BA.debugLineNum = 21168131;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=21168132;
 //BA.debugLineNum = 21168132;BA.debugLine="c.Position = 0";
_c.setPosition((int) (0));
RDebugUtils.currentLine=21168133;
 //BA.debugLineNum = 21168133;BA.debugLine="a = C.GetString(\"ID_ALMACEN\")";
_a = _c.GetString("ID_ALMACEN");
RDebugUtils.currentLine=21168134;
 //BA.debugLineNum = 21168134;BA.debugLine="c.Close";
_c.Close();
RDebugUtils.currentLine=21168135;
 //BA.debugLineNum = 21168135;BA.debugLine="Return a";
if (true) return _a;
RDebugUtils.currentLine=21168136;
 //BA.debugLineNum = 21168136;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=20774912;
 //BA.debugLineNum = 20774912;BA.debugLine="Sub traeCantYMonto2(cliente As String) As Map";
RDebugUtils.currentLine=20774914;
 //BA.debugLineNum = 20774914;BA.debugLine="Private cant As Int = 0";
_cant = (int) (0);
RDebugUtils.currentLine=20774915;
 //BA.debugLineNum = 20774915;BA.debugLine="Private monto As Float = 0";
_monto = (float) (0);
RDebugUtils.currentLine=20774916;
 //BA.debugLineNum = 20774916;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=20774917;
 //BA.debugLineNum = 20774917;BA.debugLine="If ccym.RowCount > 0 Then";
if (_ccym.getRowCount()>0) { 
RDebugUtils.currentLine=20774918;
 //BA.debugLineNum = 20774918;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=20774919;
 //BA.debugLineNum = 20774919;BA.debugLine="ccym.Position = i";
_ccym.setPosition(_i);
RDebugUtils.currentLine=20774920;
 //BA.debugLineNum = 20774920;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=20774921;
 //BA.debugLineNum = 20774921;BA.debugLine="cant = cant + ccym.GetString(\"HVD_CANT\")";
_cant = (int) (_cant+(double)(Double.parseDouble(_ccym.GetString("HVD_CANT"))));
RDebugUtils.currentLine=20774923;
 //BA.debugLineNum = 20774923;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=20774929;
 //BA.debugLineNum = 20774929;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=20774930;
 //BA.debugLineNum = 20774930;BA.debugLine="If ccym.RowCount > 0 Then";
if (_ccym.getRowCount()>0) { 
RDebugUtils.currentLine=20774931;
 //BA.debugLineNum = 20774931;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=20774932;
 //BA.debugLineNum = 20774932;BA.debugLine="ccym.Position = i";
_ccym.setPosition(_i);
RDebugUtils.currentLine=20774933;
 //BA.debugLineNum = 20774933;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=20774934;
 //BA.debugLineNum = 20774934;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=20774936;
 //BA.debugLineNum = 20774936;BA.debugLine="Log($\"CANT=${cant}, MONTO=${monto}\"$)";
anywheresoftware.b4a.keywords.Common.LogImpl("820774936",("CANT="+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_cant))+", MONTO="+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_monto))+""),0);
 };
RDebugUtils.currentLine=20774939;
 //BA.debugLineNum = 20774939;BA.debugLine="ccym.Close";
_ccym.Close();
RDebugUtils.currentLine=20774940;
 //BA.debugLineNum = 20774940;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=20774941;
 //BA.debugLineNum = 20774941;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=20185088;
 //BA.debugLineNum = 20185088;BA.debugLine="Sub traeCliente As String 'ignore";
RDebugUtils.currentLine=20185089;
 //BA.debugLineNum = 20185089;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=20185090;
 //BA.debugLineNum = 20185090;BA.debugLine="cli.Position = 0";
_cli.setPosition((int) (0));
RDebugUtils.currentLine=20185091;
 //BA.debugLineNum = 20185091;BA.debugLine="Private cl As String = cli.GetString(\"CUENTA\")";
_cl = _cli.GetString("CUENTA");
RDebugUtils.currentLine=20185092;
 //BA.debugLineNum = 20185092;BA.debugLine="cli.Close";
_cli.Close();
RDebugUtils.currentLine=20185093;
 //BA.debugLineNum = 20185093;BA.debugLine="Log(\"Algo paso...\"& cl)";
anywheresoftware.b4a.keywords.Common.LogImpl("820185093","Algo paso..."+_cl,0);
RDebugUtils.currentLine=20185094;
 //BA.debugLineNum = 20185094;BA.debugLine="Return cl";
if (true) return _cl;
RDebugUtils.currentLine=20185095;
 //BA.debugLineNum = 20185095;BA.debugLine="End Sub";
return "";
}
public static String  _traefechaprev(anywheresoftware.b4a.BA _ba) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "traefechaprev", false))
	 {return ((String) Debug.delegate(null, "traefechaprev", new Object[] {_ba}));}
anywheresoftware.b4a.sql.SQL.CursorWrapper _c = null;
String _a = "";
anywheresoftware.b4a.sql.SQL.CursorWrapper _clienteasing = null;
String[] _fecha = null;
String _fecha3 = "";
String[] _hora = null;
RDebugUtils.currentLine=21299200;
 //BA.debugLineNum = 21299200;BA.debugLine="Sub traefECHAPREV As String 'ignore";
RDebugUtils.currentLine=21299201;
 //BA.debugLineNum = 21299201;BA.debugLine="Private c As Cursor";
_c = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
RDebugUtils.currentLine=21299202;
 //BA.debugLineNum = 21299202;BA.debugLine="Private a As String";
_a = "";
RDebugUtils.currentLine=21299203;
 //BA.debugLineNum = 21299203;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=21299204;
 //BA.debugLineNum = 21299204;BA.debugLine="clienteasing.Position = 0";
_clienteasing.setPosition((int) (0));
RDebugUtils.currentLine=21299205;
 //BA.debugLineNum = 21299205;BA.debugLine="If clienteasing.GetString(\"CUENTA\") <> \"63403\" Th";
if ((_clienteasing.GetString("CUENTA")).equals("63403") == false) { 
RDebugUtils.currentLine=21299206;
 //BA.debugLineNum = 21299206;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=21299207;
 //BA.debugLineNum = 21299207;BA.debugLine="c.Position = 0";
_c.setPosition((int) (0));
RDebugUtils.currentLine=21299208;
 //BA.debugLineNum = 21299208;BA.debugLine="Dim fecha() As String = Regex.Split(\" \", c.GetSt";
_fecha = anywheresoftware.b4a.keywords.Common.Regex.Split(" ",_c.GetString("HVD_FECHA"));
RDebugUtils.currentLine=21299209;
 //BA.debugLineNum = 21299209;BA.debugLine="Dim fecha3 As String = fecha(0)";
_fecha3 = _fecha[(int) (0)];
RDebugUtils.currentLine=21299210;
 //BA.debugLineNum = 21299210;BA.debugLine="Log(fecha3)";
anywheresoftware.b4a.keywords.Common.LogImpl("821299210",_fecha3,0);
RDebugUtils.currentLine=21299211;
 //BA.debugLineNum = 21299211;BA.debugLine="Dim hora() As String = Regex.Split(\"\\.\", fecha(1";
_hora = anywheresoftware.b4a.keywords.Common.Regex.Split("\\.",_fecha[(int) (1)]);
RDebugUtils.currentLine=21299212;
 //BA.debugLineNum = 21299212;BA.debugLine="a = fecha3 & \" \" & hora(0)";
_a = _fecha3+" "+_hora[(int) (0)];
RDebugUtils.currentLine=21299213;
 //BA.debugLineNum = 21299213;BA.debugLine="c.Close";
_c.Close();
 }else 
{RDebugUtils.currentLine=21299214;
 //BA.debugLineNum = 21299214;BA.debugLine="Else If clienteasing.GetString(\"CUENTA\") = \"63403";
if ((_clienteasing.GetString("CUENTA")).equals("63403")) { 
RDebugUtils.currentLine=21299215;
 //BA.debugLineNum = 21299215;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=21299216;
 //BA.debugLineNum = 21299216;BA.debugLine="c.Position = 0";
_c.setPosition((int) (0));
RDebugUtils.currentLine=21299217;
 //BA.debugLineNum = 21299217;BA.debugLine="Dim fecha() As String = Regex.Split(\" \", c.GetSt";
_fecha = anywheresoftware.b4a.keywords.Common.Regex.Split(" ",_c.GetString("HVD_FECHA"));
RDebugUtils.currentLine=21299218;
 //BA.debugLineNum = 21299218;BA.debugLine="Dim fecha3 As String = fecha(0)";
_fecha3 = _fecha[(int) (0)];
RDebugUtils.currentLine=21299219;
 //BA.debugLineNum = 21299219;BA.debugLine="Log(fecha3)";
anywheresoftware.b4a.keywords.Common.LogImpl("821299219",_fecha3,0);
RDebugUtils.currentLine=21299220;
 //BA.debugLineNum = 21299220;BA.debugLine="Dim hora() As String = Regex.Split(\"\\.\", fecha(1";
_hora = anywheresoftware.b4a.keywords.Common.Regex.Split("\\.",_fecha[(int) (1)]);
RDebugUtils.currentLine=21299221;
 //BA.debugLineNum = 21299221;BA.debugLine="a = fecha3 & \" \" & hora(0)";
_a = _fecha3+" "+_hora[(int) (0)];
RDebugUtils.currentLine=21299222;
 //BA.debugLineNum = 21299222;BA.debugLine="c.Close";
_c.Close();
 }}
;
RDebugUtils.currentLine=21299224;
 //BA.debugLineNum = 21299224;BA.debugLine="Return a";
if (true) return _a;
RDebugUtils.currentLine=21299225;
 //BA.debugLineNum = 21299225;BA.debugLine="End Sub";
return "";
}
public static String  _traeusuariodebd(anywheresoftware.b4a.BA _ba) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "traeusuariodebd", false))
	 {return ((String) Debug.delegate(null, "traeusuariodebd", new Object[] {_ba}));}
anywheresoftware.b4a.sql.SQL.CursorWrapper _c = null;
String _u = "";
RDebugUtils.currentLine=18153472;
 //BA.debugLineNum = 18153472;BA.debugLine="Sub traeUsuarioDeBD As String 'ignore";
RDebugUtils.currentLine=18153473;
 //BA.debugLineNum = 18153473;BA.debugLine="Private c As Cursor";
_c = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
RDebugUtils.currentLine=18153474;
 //BA.debugLineNum = 18153474;BA.debugLine="Private u As String = \"SinUsuario\"";
_u = "SinUsuario";
RDebugUtils.currentLine=18153475;
 //BA.debugLineNum = 18153475;BA.debugLine="If Not(kmt.IsInitialized) Then revisaBD";
if (anywheresoftware.b4a.keywords.Common.Not(_kmt.IsInitialized())) { 
_revisabd(_ba);};
RDebugUtils.currentLine=18153476;
 //BA.debugLineNum = 18153476;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=18153477;
 //BA.debugLineNum = 18153477;BA.debugLine="c.Position=0";
_c.setPosition((int) (0));
RDebugUtils.currentLine=18153478;
 //BA.debugLineNum = 18153478;BA.debugLine="If c.RowCount > 0 Then u = c.GetString(\"USUARIO\")";
if (_c.getRowCount()>0) { 
_u = _c.GetString("USUARIO");};
RDebugUtils.currentLine=18153479;
 //BA.debugLineNum = 18153479;BA.debugLine="c.Close";
_c.Close();
RDebugUtils.currentLine=18153480;
 //BA.debugLineNum = 18153480;BA.debugLine="Return u";
if (true) return _u;
RDebugUtils.currentLine=18153481;
 //BA.debugLineNum = 18153481;BA.debugLine="End Sub";
return "";
}
public static String  _traeruta(anywheresoftware.b4a.BA _ba,String _cliente) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "traeruta", false))
	 {return ((String) Debug.delegate(null, "traeruta", new Object[] {_ba,_cliente}));}
anywheresoftware.b4a.sql.SQL.CursorWrapper _c = null;
String _r = "";
RDebugUtils.currentLine=20316160;
 //BA.debugLineNum = 20316160;BA.debugLine="Sub traeRuta (cliente As String) As String 'ignore";
RDebugUtils.currentLine=20316161;
 //BA.debugLineNum = 20316161;BA.debugLine="Private c As Cursor";
_c = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
RDebugUtils.currentLine=20316162;
 //BA.debugLineNum = 20316162;BA.debugLine="Private r As String";
_r = "";
RDebugUtils.currentLine=20316163;
 //BA.debugLineNum = 20316163;BA.debugLine="c=Starter.skmt.ExecQuery($\"select CAT_CL_RUTA fro";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(mostCurrent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery(("select CAT_CL_RUTA from kmt_info where CAT_CL_CODIGO = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_cliente))+"'"))));
RDebugUtils.currentLine=20316164;
 //BA.debugLineNum = 20316164;BA.debugLine="r = \"0\"";
_r = "0";
RDebugUtils.currentLine=20316165;
 //BA.debugLineNum = 20316165;BA.debugLine="If c.RowCount > 0 Then";
if (_c.getRowCount()>0) { 
RDebugUtils.currentLine=20316166;
 //BA.debugLineNum = 20316166;BA.debugLine="c.Position=0";
_c.setPosition((int) (0));
RDebugUtils.currentLine=20316167;
 //BA.debugLineNum = 20316167;BA.debugLine="r = c.GetString(\"CAT_CL_RUTA\")";
_r = _c.GetString("CAT_CL_RUTA");
 };
RDebugUtils.currentLine=20316169;
 //BA.debugLineNum = 20316169;BA.debugLine="c.Close";
_c.Close();
RDebugUtils.currentLine=20316170;
 //BA.debugLineNum = 20316170;BA.debugLine="Return r";
if (true) return _r;
RDebugUtils.currentLine=20316171;
 //BA.debugLineNum = 20316171;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=17235968;
 //BA.debugLineNum = 17235968;BA.debugLine="Sub fechaKMT(fecha As String) As String 'ignore";
RDebugUtils.currentLine=17235970;
 //BA.debugLineNum = 17235970;BA.debugLine="Dim OrigFormat As String = DateTime.DateFormat  '";
_origformat = anywheresoftware.b4a.keywords.Common.DateTime.getDateFormat();
RDebugUtils.currentLine=17235971;
 //BA.debugLineNum = 17235971;BA.debugLine="DateTime.DateFormat=\"yyMMddHHmmss\"";
anywheresoftware.b4a.keywords.Common.DateTime.setDateFormat("yyMMddHHmmss");
RDebugUtils.currentLine=17235972;
 //BA.debugLineNum = 17235972;BA.debugLine="Dim nuevaFecha As String=DateTime.Date(fecha)";
_nuevafecha = anywheresoftware.b4a.keywords.Common.DateTime.Date((long)(Double.parseDouble(_fecha)));
RDebugUtils.currentLine=17235973;
 //BA.debugLineNum = 17235973;BA.debugLine="DateTime.DateFormat=OrigFormat  'return to orig d";
anywheresoftware.b4a.keywords.Common.DateTime.setDateFormat(_origformat);
RDebugUtils.currentLine=17235975;
 //BA.debugLineNum = 17235975;BA.debugLine="Return nuevaFecha";
if (true) return _nuevafecha;
RDebugUtils.currentLine=17235976;
 //BA.debugLineNum = 17235976;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=19595264;
 //BA.debugLineNum = 19595264;BA.debugLine="Sub centraListView(elemento As ListView, anchoElem";
RDebugUtils.currentLine=19595265;
 //BA.debugLineNum = 19595265;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=19595266;
 //BA.debugLineNum = 19595266;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=19529728;
 //BA.debugLineNum = 19529728;BA.debugLine="Sub SetDivider(lv As ListView, Color As Int, Heigh";
RDebugUtils.currentLine=19529729;
 //BA.debugLineNum = 19529729;BA.debugLine="Dim r As Reflector";
_r = new anywheresoftware.b4a.agraham.reflection.Reflection();
RDebugUtils.currentLine=19529730;
 //BA.debugLineNum = 19529730;BA.debugLine="r.Target = lv";
_r.Target = (Object)(_lv.getObject());
RDebugUtils.currentLine=19529731;
 //BA.debugLineNum = 19529731;BA.debugLine="Dim CD As ColorDrawable";
_cd = new anywheresoftware.b4a.objects.drawable.ColorDrawable();
RDebugUtils.currentLine=19529732;
 //BA.debugLineNum = 19529732;BA.debugLine="CD.Initialize(Color, 0)";
_cd.Initialize(_color,(int) (0));
RDebugUtils.currentLine=19529733;
 //BA.debugLineNum = 19529733;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=19529734;
 //BA.debugLineNum = 19529734;BA.debugLine="r.RunMethod2(\"setDividerHeight\", Height, \"java.la";
_r.RunMethod2("setDividerHeight",BA.NumberToString(_height),"java.lang.int");
RDebugUtils.currentLine=19529735;
 //BA.debugLineNum = 19529735;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=19726336;
 //BA.debugLineNum = 19726336;BA.debugLine="Sub centraEtiqueta(elemento As Label, anchoElement";
RDebugUtils.currentLine=19726337;
 //BA.debugLineNum = 19726337;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=19726338;
 //BA.debugLineNum = 19726338;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=21102592;
 //BA.debugLineNum = 21102592;BA.debugLine="Sub traeRutaReparto As String 'ignore";
RDebugUtils.currentLine=21102593;
 //BA.debugLineNum = 21102593;BA.debugLine="Private c As Cursor";
_c = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
RDebugUtils.currentLine=21102594;
 //BA.debugLineNum = 21102594;BA.debugLine="Private r As String";
_r = "";
RDebugUtils.currentLine=21102595;
 //BA.debugLineNum = 21102595;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=21102596;
 //BA.debugLineNum = 21102596;BA.debugLine="r = \"0\"";
_r = "0";
RDebugUtils.currentLine=21102597;
 //BA.debugLineNum = 21102597;BA.debugLine="If c.RowCount > 0 Then";
if (_c.getRowCount()>0) { 
RDebugUtils.currentLine=21102598;
 //BA.debugLineNum = 21102598;BA.debugLine="c.Position=0";
_c.setPosition((int) (0));
RDebugUtils.currentLine=21102599;
 //BA.debugLineNum = 21102599;BA.debugLine="r = c.GetString(\"RUTAA\")";
_r = _c.GetString("RUTAA");
 };
RDebugUtils.currentLine=21102601;
 //BA.debugLineNum = 21102601;BA.debugLine="c.Close";
_c.Close();
RDebugUtils.currentLine=21102602;
 //BA.debugLineNum = 21102602;BA.debugLine="Return r";
if (true) return _r;
RDebugUtils.currentLine=21102603;
 //BA.debugLineNum = 21102603;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=20578304;
 //BA.debugLineNum = 20578304;BA.debugLine="Sub prodVenta(clienteOriginal As String, prodId As";
RDebugUtils.currentLine=20578306;
 //BA.debugLineNum = 20578306;BA.debugLine="Private precio As String = traePrecio(prodId, tra";
_precio = _traeprecio(_ba,_prodid,_traealmacen(_ba));
RDebugUtils.currentLine=20578307;
 //BA.debugLineNum = 20578307;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=20578308;
 //BA.debugLineNum = 20578308;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=20578309;
 //BA.debugLineNum = 20578309;BA.debugLine="Log($\"update reparto set REP_CANT = REP_CANT - 1";
anywheresoftware.b4a.keywords.Common.LogImpl("820578309",("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=20578310;
 //BA.debugLineNum = 20578310;BA.debugLine="Log($\"update reparto set REP_CANT = REP_CANT + 1";
anywheresoftware.b4a.keywords.Common.LogImpl("820578310",("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=20578311;
 //BA.debugLineNum = 20578311;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=20578332;
 //BA.debugLineNum = 20578332;BA.debugLine="End Sub";
return "";
}
public static String  _traeconversion(anywheresoftware.b4a.BA _ba,String _id) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "traeconversion", false))
	 {return ((String) Debug.delegate(null, "traeconversion", new Object[] {_ba,_id}));}
String _pu = "";
anywheresoftware.b4a.sql.SQL.CursorWrapper _idc = null;
RDebugUtils.currentLine=20119552;
 //BA.debugLineNum = 20119552;BA.debugLine="Sub traeConversion(id As String) As String";
RDebugUtils.currentLine=20119553;
 //BA.debugLineNum = 20119553;BA.debugLine="Private pu As String = \"0\"";
_pu = "0";
RDebugUtils.currentLine=20119555;
 //BA.debugLineNum = 20119555;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=20119556;
 //BA.debugLineNum = 20119556;BA.debugLine="If idc.RowCount > 0 Then";
if (_idc.getRowCount()>0) { 
RDebugUtils.currentLine=20119557;
 //BA.debugLineNum = 20119557;BA.debugLine="idc.Position=0";
_idc.setPosition((int) (0));
RDebugUtils.currentLine=20119558;
 //BA.debugLineNum = 20119558;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=20119561;
 //BA.debugLineNum = 20119561;BA.debugLine="idc.Close";
_idc.Close();
RDebugUtils.currentLine=20119563;
 //BA.debugLineNum = 20119563;BA.debugLine="Return pu";
if (true) return _pu;
RDebugUtils.currentLine=20119564;
 //BA.debugLineNum = 20119564;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=20054016;
 //BA.debugLineNum = 20054016;BA.debugLine="Sub traePrecioC(id As String) As String";
RDebugUtils.currentLine=20054017;
 //BA.debugLineNum = 20054017;BA.debugLine="Private pu As String = \"0\"";
_pu = "0";
RDebugUtils.currentLine=20054018;
 //BA.debugLineNum = 20054018;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=20054019;
 //BA.debugLineNum = 20054019;BA.debugLine="If idc.RowCount > 0 Then";
if (_idc.getRowCount()>0) { 
RDebugUtils.currentLine=20054020;
 //BA.debugLineNum = 20054020;BA.debugLine="idc.Position=0";
_idc.setPosition((int) (0));
RDebugUtils.currentLine=20054021;
 //BA.debugLineNum = 20054021;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=20054024;
 //BA.debugLineNum = 20054024;BA.debugLine="idc.Close";
_idc.Close();
RDebugUtils.currentLine=20054025;
 //BA.debugLineNum = 20054025;BA.debugLine="Return pu";
if (true) return _pu;
RDebugUtils.currentLine=20054026;
 //BA.debugLineNum = 20054026;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=19988480;
 //BA.debugLineNum = 19988480;BA.debugLine="Sub traePrecio2(id As String, quePromo As String,";
RDebugUtils.currentLine=19988481;
 //BA.debugLineNum = 19988481;BA.debugLine="Private pu As String = \"0\"";
_pu = "0";
RDebugUtils.currentLine=19988483;
 //BA.debugLineNum = 19988483;BA.debugLine="If quePromo = traeAlmacen Then";
if ((_quepromo).equals(_traealmacen(_ba))) { 
RDebugUtils.currentLine=19988484;
 //BA.debugLineNum = 19988484;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=19988485;
 //BA.debugLineNum = 19988485;BA.debugLine="If idc.RowCount > 0 Then";
if (_idc.getRowCount()>0) { 
RDebugUtils.currentLine=19988486;
 //BA.debugLineNum = 19988486;BA.debugLine="idc.Position=0";
_idc.setPosition((int) (0));
RDebugUtils.currentLine=19988487;
 //BA.debugLineNum = 19988487;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=19988490;
 //BA.debugLineNum = 19988490;BA.debugLine="idc.Close";
_idc.Close();
 }else {
RDebugUtils.currentLine=19988492;
 //BA.debugLineNum = 19988492;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=19988493;
 //BA.debugLineNum = 19988493;BA.debugLine="If pc.RowCount > 0 Then";
if (_pc.getRowCount()>0) { 
RDebugUtils.currentLine=19988494;
 //BA.debugLineNum = 19988494;BA.debugLine="pc.Position = 0";
_pc.setPosition((int) (0));
RDebugUtils.currentLine=19988496;
 //BA.debugLineNum = 19988496;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=19988497;
 //BA.debugLineNum = 19988497;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=19988501;
 //BA.debugLineNum = 19988501;BA.debugLine="pc.Close";
_pc.Close();
 };
RDebugUtils.currentLine=19988504;
 //BA.debugLineNum = 19988504;BA.debugLine="Return pu";
if (true) return _pu;
RDebugUtils.currentLine=19988506;
 //BA.debugLineNum = 19988506;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=19464192;
 //BA.debugLineNum = 19464192;BA.debugLine="Sub dameUsuarioDeDB As String 'ignore";
RDebugUtils.currentLine=19464193;
 //BA.debugLineNum = 19464193;BA.debugLine="Private c As Cursor";
_c = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
RDebugUtils.currentLine=19464194;
 //BA.debugLineNum = 19464194;BA.debugLine="Private u As String = \"SinUsuario\"";
_u = "SinUsuario";
RDebugUtils.currentLine=19464195;
 //BA.debugLineNum = 19464195;BA.debugLine="If Not(kmt.IsInitialized) Then revisaBD";
if (anywheresoftware.b4a.keywords.Common.Not(_kmt.IsInitialized())) { 
_revisabd(_ba);};
RDebugUtils.currentLine=19464196;
 //BA.debugLineNum = 19464196;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=19464197;
 //BA.debugLineNum = 19464197;BA.debugLine="c.Position=0";
_c.setPosition((int) (0));
RDebugUtils.currentLine=19464198;
 //BA.debugLineNum = 19464198;BA.debugLine="If c.RowCount > 0 Then u = c.GetString(\"USUARIO\")";
if (_c.getRowCount()>0) { 
_u = _c.GetString("USUARIO");};
RDebugUtils.currentLine=19464199;
 //BA.debugLineNum = 19464199;BA.debugLine="c.Close";
_c.Close();
RDebugUtils.currentLine=19464200;
 //BA.debugLineNum = 19464200;BA.debugLine="Return u";
if (true) return _u;
RDebugUtils.currentLine=19464201;
 //BA.debugLineNum = 19464201;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=21233664;
 //BA.debugLineNum = 21233664;BA.debugLine="Sub traeUsuario As String 'ignore";
RDebugUtils.currentLine=21233665;
 //BA.debugLineNum = 21233665;BA.debugLine="Private c As Cursor";
_c = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
RDebugUtils.currentLine=21233666;
 //BA.debugLineNum = 21233666;BA.debugLine="Private a As String";
_a = "";
RDebugUtils.currentLine=21233667;
 //BA.debugLineNum = 21233667;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=21233668;
 //BA.debugLineNum = 21233668;BA.debugLine="c.Position = 0";
_c.setPosition((int) (0));
RDebugUtils.currentLine=21233669;
 //BA.debugLineNum = 21233669;BA.debugLine="a = C.GetString(\"USUARIO\")";
_a = _c.GetString("USUARIO");
RDebugUtils.currentLine=21233670;
 //BA.debugLineNum = 21233670;BA.debugLine="c.Close";
_c.Close();
RDebugUtils.currentLine=21233671;
 //BA.debugLineNum = 21233671;BA.debugLine="Return a";
if (true) return _a;
RDebugUtils.currentLine=21233672;
 //BA.debugLineNum = 21233672;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=20840448;
 //BA.debugLineNum = 20840448;BA.debugLine="Sub traeEntregados As Map";
RDebugUtils.currentLine=20840449;
 //BA.debugLineNum = 20840449;BA.debugLine="Private m As Map";
_m = new anywheresoftware.b4a.objects.collections.Map();
RDebugUtils.currentLine=20840450;
 //BA.debugLineNum = 20840450;BA.debugLine="Private cant As Int = 0";
_cant = (int) (0);
RDebugUtils.currentLine=20840451;
 //BA.debugLineNum = 20840451;BA.debugLine="Private monto As String = 0";
_monto = BA.NumberToString(0);
RDebugUtils.currentLine=20840452;
 //BA.debugLineNum = 20840452;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=20840453;
 //BA.debugLineNum = 20840453;BA.debugLine="If rc.RowCount > 0 Then";
if (_rc.getRowCount()>0) { 
RDebugUtils.currentLine=20840454;
 //BA.debugLineNum = 20840454;BA.debugLine="rc.Position = 0";
_rc.setPosition((int) (0));
RDebugUtils.currentLine=20840455;
 //BA.debugLineNum = 20840455;BA.debugLine="If rc.GetString(\"CUANTOS\") <> Null Then";
if (_rc.GetString("CUANTOS")!= null) { 
RDebugUtils.currentLine=20840456;
 //BA.debugLineNum = 20840456;BA.debugLine="cant = cant + rc.GetString(\"CUANTOS\")";
_cant = (int) (_cant+(double)(Double.parseDouble(_rc.GetString("CUANTOS"))));
RDebugUtils.currentLine=20840457;
 //BA.debugLineNum = 20840457;BA.debugLine="monto = monto + rc.GetString(\"CUANTO\")";
_monto = BA.NumberToString((double)(Double.parseDouble(_monto))+(double)(Double.parseDouble(_rc.GetString("CUANTO"))));
 };
 };
RDebugUtils.currentLine=20840461;
 //BA.debugLineNum = 20840461;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=20840462;
 //BA.debugLineNum = 20840462;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=20905984;
 //BA.debugLineNum = 20905984;BA.debugLine="Sub traeRechazados As Map";
RDebugUtils.currentLine=20905985;
 //BA.debugLineNum = 20905985;BA.debugLine="Private m As Map";
_m = new anywheresoftware.b4a.objects.collections.Map();
RDebugUtils.currentLine=20905986;
 //BA.debugLineNum = 20905986;BA.debugLine="Private cant As Int = 0";
_cant = (int) (0);
RDebugUtils.currentLine=20905987;
 //BA.debugLineNum = 20905987;BA.debugLine="Private monto As String = 0";
_monto = BA.NumberToString(0);
RDebugUtils.currentLine=20905988;
 //BA.debugLineNum = 20905988;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=20905989;
 //BA.debugLineNum = 20905989;BA.debugLine="If rc.RowCount > 0 Then";
if (_rc.getRowCount()>0) { 
RDebugUtils.currentLine=20905990;
 //BA.debugLineNum = 20905990;BA.debugLine="rc.Position = 0";
_rc.setPosition((int) (0));
RDebugUtils.currentLine=20905991;
 //BA.debugLineNum = 20905991;BA.debugLine="If rc.GetString(\"CUANTOS\") <> Null Then";
if (_rc.GetString("CUANTOS")!= null) { 
RDebugUtils.currentLine=20905992;
 //BA.debugLineNum = 20905992;BA.debugLine="cant = cant + rc.GetString(\"CUANTOS\")";
_cant = (int) (_cant+(double)(Double.parseDouble(_rc.GetString("CUANTOS"))));
RDebugUtils.currentLine=20905993;
 //BA.debugLineNum = 20905993;BA.debugLine="monto = monto + rc.GetString(\"CUANTO\")";
_monto = BA.NumberToString((double)(Double.parseDouble(_monto))+(double)(Double.parseDouble(_rc.GetString("CUANTO"))));
 };
 };
RDebugUtils.currentLine=20905997;
 //BA.debugLineNum = 20905997;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=20905998;
 //BA.debugLineNum = 20905998;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=20971520;
 //BA.debugLineNum = 20971520;BA.debugLine="Sub traeVendidos As Map";
RDebugUtils.currentLine=20971521;
 //BA.debugLineNum = 20971521;BA.debugLine="Private m As Map";
_m = new anywheresoftware.b4a.objects.collections.Map();
RDebugUtils.currentLine=20971522;
 //BA.debugLineNum = 20971522;BA.debugLine="Private cant As Int = 0";
_cant = (int) (0);
RDebugUtils.currentLine=20971523;
 //BA.debugLineNum = 20971523;BA.debugLine="Private monto As String = 0";
_monto = BA.NumberToString(0);
RDebugUtils.currentLine=20971524;
 //BA.debugLineNum = 20971524;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=20971525;
 //BA.debugLineNum = 20971525;BA.debugLine="If rc.RowCount > 0 Then";
if (_rc.getRowCount()>0) { 
RDebugUtils.currentLine=20971526;
 //BA.debugLineNum = 20971526;BA.debugLine="rc.Position = 0";
_rc.setPosition((int) (0));
RDebugUtils.currentLine=20971527;
 //BA.debugLineNum = 20971527;BA.debugLine="If rc.GetString(\"CUANTOS\") <> Null Then";
if (_rc.GetString("CUANTOS")!= null) { 
RDebugUtils.currentLine=20971528;
 //BA.debugLineNum = 20971528;BA.debugLine="cant = cant + rc.GetString(\"CUANTOS\")";
_cant = (int) (_cant+(double)(Double.parseDouble(_rc.GetString("CUANTOS"))));
RDebugUtils.currentLine=20971529;
 //BA.debugLineNum = 20971529;BA.debugLine="monto = monto + rc.GetString(\"CUANTO\")";
_monto = BA.NumberToString((double)(Double.parseDouble(_monto))+(double)(Double.parseDouble(_rc.GetString("CUANTO"))));
 };
 };
RDebugUtils.currentLine=20971533;
 //BA.debugLineNum = 20971533;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=20971534;
 //BA.debugLineNum = 20971534;BA.debugLine="End Sub";
return null;
}
public static String  _borraarribade100errores(anywheresoftware.b4a.BA _ba) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "borraarribade100errores", false))
	 {return ((String) Debug.delegate(null, "borraarribade100errores", new Object[] {_ba}));}
RDebugUtils.currentLine=18874368;
 //BA.debugLineNum = 18874368;BA.debugLine="Sub borraArribaDe100Errores 'ignore";
RDebugUtils.currentLine=18874369;
 //BA.debugLineNum = 18874369;BA.debugLine="If Not(errorLog.IsInitialized) Then revisaBD";
if (anywheresoftware.b4a.keywords.Common.Not(_errorlog.IsInitialized())) { 
_revisabd(_ba);};
RDebugUtils.currentLine=18874370;
 //BA.debugLineNum = 18874370;BA.debugLine="LogColor(\"Recortamos la tabla de Errores, limite";
anywheresoftware.b4a.keywords.Common.LogImpl("818874370","Recortamos la tabla de Errores, limite de 100",anywheresoftware.b4a.keywords.Common.Colors.Magenta);
RDebugUtils.currentLine=18874371;
 //BA.debugLineNum = 18874371;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=18874372;
 //BA.debugLineNum = 18874372;BA.debugLine="errorLog.ExecNonQuery(\"vacuum;\")";
_errorlog.ExecNonQuery("vacuum;");
RDebugUtils.currentLine=18874374;
 //BA.debugLineNum = 18874374;BA.debugLine="End Sub";
return "";
}
public static String  _revisabd(anywheresoftware.b4a.BA _ba) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "revisabd", false))
	 {return ((String) Debug.delegate(null, "revisabd", new Object[] {_ba}));}
anywheresoftware.b4a.sql.SQL.CursorWrapper _c = null;
RDebugUtils.currentLine=17891328;
 //BA.debugLineNum = 17891328;BA.debugLine="Sub revisaBD 'ignore";
RDebugUtils.currentLine=17891329;
 //BA.debugLineNum = 17891329;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=17891330;
 //BA.debugLineNum = 17891330;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=17891331;
 //BA.debugLineNum = 17891331;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=17891333;
 //BA.debugLineNum = 17891333;BA.debugLine="kmt.ExecNonQuery(\"CREATE TABLE IF NOT EXISTS bita";
_kmt.ExecNonQuery("CREATE TABLE IF NOT EXISTS bitacora(fecha INTEGER, texto TEXT)");
RDebugUtils.currentLine=17891335;
 //BA.debugLineNum = 17891335;BA.debugLine="kmt.ExecNonQuery(\"DROP TABLE IF EXISTS CAT_FOLIOS";
_kmt.ExecNonQuery("DROP TABLE IF EXISTS CAT_FOLIOS");
RDebugUtils.currentLine=17891336;
 //BA.debugLineNum = 17891336;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=17891338;
 //BA.debugLineNum = 17891338;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=17891339;
 //BA.debugLineNum = 17891339;BA.debugLine="errorLog.ExecNonQuery(\"CREATE TABLE IF NOT EXISTS";
_errorlog.ExecNonQuery("CREATE TABLE IF NOT EXISTS errores(fecha INTEGER, error TEXT)");
RDebugUtils.currentLine=17891341;
 //BA.debugLineNum = 17891341;BA.debugLine="Try 'Intentamos usar \"pragma_table_info\" para rev";
try {RDebugUtils.currentLine=17891342;
 //BA.debugLineNum = 17891342;BA.debugLine="Dim c As Cursor=kmt.ExecQuery(\"SELECT COUNT(*) A";
_c = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_kmt.ExecQuery("SELECT COUNT(*) AS fCol FROM pragma_table_info('noventa') WHERE name='NV_REPROGRAMAR'")));
RDebugUtils.currentLine=17891343;
 //BA.debugLineNum = 17891343;BA.debugLine="c.Position = 0";
_c.setPosition((int) (0));
RDebugUtils.currentLine=17891344;
 //BA.debugLineNum = 17891344;BA.debugLine="If c.GetString(\"fCol\") = 0 Then 'Si no esta la c";
if ((_c.GetString("fCol")).equals(BA.NumberToString(0))) { 
RDebugUtils.currentLine=17891345;
 //BA.debugLineNum = 17891345;BA.debugLine="kmt.ExecNonQuery(\"ALTER TABLE noventa ADD COLUM";
_kmt.ExecNonQuery("ALTER TABLE noventa ADD COLUMN NV_REPROGRAMAR TEXT");
 };
 } 
       catch (Exception e16) {
			(_ba.processBA == null ? _ba : _ba.processBA).setLastException(e16);RDebugUtils.currentLine=17891348;
 //BA.debugLineNum = 17891348;BA.debugLine="Try";
try {RDebugUtils.currentLine=17891349;
 //BA.debugLineNum = 17891349;BA.debugLine="kmt.ExecNonQuery(\"ALTER TABLE noventa ADD COLUM";
_kmt.ExecNonQuery("ALTER TABLE noventa ADD COLUMN NV_REPROGRAMAR TEXT");
 } 
       catch (Exception e19) {
			(_ba.processBA == null ? _ba : _ba.processBA).setLastException(e19);RDebugUtils.currentLine=17891351;
 //BA.debugLineNum = 17891351;BA.debugLine="Log(LastException)";
anywheresoftware.b4a.keywords.Common.LogImpl("817891351",BA.ObjectToString(anywheresoftware.b4a.keywords.Common.LastException(_ba)),0);
 };
 };
RDebugUtils.currentLine=17891354;
 //BA.debugLineNum = 17891354;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=18939904;
 //BA.debugLineNum = 18939904;BA.debugLine="Sub borraArribaDe600RenglonesBitacora 'ignore";
RDebugUtils.currentLine=18939905;
 //BA.debugLineNum = 18939905;BA.debugLine="revisaBD";
_revisabd(_ba);
RDebugUtils.currentLine=18939906;
 //BA.debugLineNum = 18939906;BA.debugLine="LogColor(\"Recortamos la tabla de la Bitacora, lim";
anywheresoftware.b4a.keywords.Common.LogImpl("818939906","Recortamos la tabla de la Bitacora, limite de 600",anywheresoftware.b4a.keywords.Common.Colors.Magenta);
RDebugUtils.currentLine=18939907;
 //BA.debugLineNum = 18939907;BA.debugLine="Private c As Cursor";
_c = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
RDebugUtils.currentLine=18939908;
 //BA.debugLineNum = 18939908;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=18939909;
 //BA.debugLineNum = 18939909;BA.debugLine="c.Position = 0";
_c.setPosition((int) (0));
RDebugUtils.currentLine=18939910;
 //BA.debugLineNum = 18939910;BA.debugLine="If c.RowCount > 650 Then";
if (_c.getRowCount()>650) { 
RDebugUtils.currentLine=18939911;
 //BA.debugLineNum = 18939911;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=18939912;
 //BA.debugLineNum = 18939912;BA.debugLine="kmt.ExecNonQuery(\"vacuum;\")";
_kmt.ExecNonQuery("vacuum;");
 };
RDebugUtils.currentLine=18939915;
 //BA.debugLineNum = 18939915;BA.debugLine="c.Close";
_c.Close();
RDebugUtils.currentLine=18939916;
 //BA.debugLineNum = 18939916;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=18546688;
 //BA.debugLineNum = 18546688;BA.debugLine="Sub borraLogDB 'ignore";
RDebugUtils.currentLine=18546689;
 //BA.debugLineNum = 18546689;BA.debugLine="LogColor(\"Borramos BD de log\", Colors.Magenta)";
anywheresoftware.b4a.keywords.Common.LogImpl("818546689","Borramos BD de log",anywheresoftware.b4a.keywords.Common.Colors.Magenta);
RDebugUtils.currentLine=18546690;
 //BA.debugLineNum = 18546690;BA.debugLine="kmt.ExecNonQuery(\"delete from bitacora\")";
_kmt.ExecNonQuery("delete from bitacora");
RDebugUtils.currentLine=18546691;
 //BA.debugLineNum = 18546691;BA.debugLine="kmt.ExecNonQuery(\"vacuum;\")";
_kmt.ExecNonQuery("vacuum;");
RDebugUtils.currentLine=18546692;
 //BA.debugLineNum = 18546692;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=17825792;
 //BA.debugLineNum = 17825792;BA.debugLine="Sub borramosArchivoGPS 'ignore";
RDebugUtils.currentLine=17825793;
 //BA.debugLineNum = 17825793;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=17825794;
 //BA.debugLineNum = 17825794;BA.debugLine="Dim s As String = \"\"";
_s = "";
RDebugUtils.currentLine=17825795;
 //BA.debugLineNum = 17825795;BA.debugLine="Dim t() As Byte = s.GetBytes(\"UTF-8\")";
_t = _s.getBytes("UTF-8");
RDebugUtils.currentLine=17825796;
 //BA.debugLineNum = 17825796;BA.debugLine="out.WriteBytes(t, 0, t.Length)";
_out.WriteBytes(_t,(int) (0),_t.length);
RDebugUtils.currentLine=17825797;
 //BA.debugLineNum = 17825797;BA.debugLine="out.Close";
_out.Close();
RDebugUtils.currentLine=17825798;
 //BA.debugLineNum = 17825798;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=17104896;
 //BA.debugLineNum = 17104896;BA.debugLine="Sub compress(str As String) As String 'ignore";
RDebugUtils.currentLine=17104898;
 //BA.debugLineNum = 17104898;BA.debugLine="Dim compressed() As Byte = GZip.compress(str)";
_compressed = _gzip.compress(_str);
RDebugUtils.currentLine=17104901;
 //BA.debugLineNum = 17104901;BA.debugLine="Dim base64 As String = su.EncodeBase64(compressed";
_base64 = _su.EncodeBase64(_compressed);
RDebugUtils.currentLine=17104902;
 //BA.debugLineNum = 17104902;BA.debugLine="Log($\"Comprimido: ${base64.Length}\"$)";
anywheresoftware.b4a.keywords.Common.LogImpl("817104902",("Comprimido: "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_base64.length()))+""),0);
RDebugUtils.currentLine=17104904;
 //BA.debugLineNum = 17104904;BA.debugLine="Return base64";
if (true) return _base64;
RDebugUtils.currentLine=17104905;
 //BA.debugLineNum = 17104905;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=19267584;
 //BA.debugLineNum = 19267584;BA.debugLine="Sub copiaDB(result As Boolean) 'ignore";
RDebugUtils.currentLine=19267585;
 //BA.debugLineNum = 19267585;BA.debugLine="If result Then";
if (_result) { 
RDebugUtils.currentLine=19267586;
 //BA.debugLineNum = 19267586;BA.debugLine="Dim p As String";
_p = "";
RDebugUtils.currentLine=19267587;
 //BA.debugLineNum = 19267587;BA.debugLine="If File.ExternalWritable Then";
if (anywheresoftware.b4a.keywords.Common.File.getExternalWritable()) { 
RDebugUtils.currentLine=19267588;
 //BA.debugLineNum = 19267588;BA.debugLine="p = File.DirInternal";
_p = anywheresoftware.b4a.keywords.Common.File.getDirInternal();
 }else {
RDebugUtils.currentLine=19267591;
 //BA.debugLineNum = 19267591;BA.debugLine="p = File.DirInternal";
_p = anywheresoftware.b4a.keywords.Common.File.getDirInternal();
 };
RDebugUtils.currentLine=19267594;
 //BA.debugLineNum = 19267594;BA.debugLine="Dim theDir As String";
_thedir = "";
RDebugUtils.currentLine=19267595;
 //BA.debugLineNum = 19267595;BA.debugLine="Try";
try {RDebugUtils.currentLine=19267596;
 //BA.debugLineNum = 19267596;BA.debugLine="File.MakeDir(File.DirInternal,\"kmts\")";
anywheresoftware.b4a.keywords.Common.File.MakeDir(anywheresoftware.b4a.keywords.Common.File.getDirInternal(),"kmts");
RDebugUtils.currentLine=19267597;
 //BA.debugLineNum = 19267597;BA.debugLine="theDir = \"/kmts\"";
_thedir = "/kmts";
 } 
       catch (Exception e13) {
			(_ba.processBA == null ? _ba : _ba.processBA).setLastException(e13);RDebugUtils.currentLine=19267599;
 //BA.debugLineNum = 19267599;BA.debugLine="theDir = \"\"";
_thedir = "";
 };
RDebugUtils.currentLine=19267601;
 //BA.debugLineNum = 19267601;BA.debugLine="Try";
try {RDebugUtils.currentLine=19267602;
 //BA.debugLineNum = 19267602;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=19267603;
 //BA.debugLineNum = 19267603;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=19267605;
 //BA.debugLineNum = 19267605;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=19267607;
 //BA.debugLineNum = 19267607;BA.debugLine="Log(\"rootExternal=\"&p)";
anywheresoftware.b4a.keywords.Common.LogImpl("819267607","rootExternal="+_p,0);
RDebugUtils.currentLine=19267608;
 //BA.debugLineNum = 19267608;BA.debugLine="Log(\"File.DirInternal=\"&File.DirInternal)";
anywheresoftware.b4a.keywords.Common.LogImpl("819267608","File.DirInternal="+anywheresoftware.b4a.keywords.Common.File.getDirInternal(),0);
RDebugUtils.currentLine=19267609;
 //BA.debugLineNum = 19267609;BA.debugLine="Log(\"File.DirInternal=\"&File.DirInternal)";
anywheresoftware.b4a.keywords.Common.LogImpl("819267609","File.DirInternal="+anywheresoftware.b4a.keywords.Common.File.getDirInternal(),0);
 }else {
RDebugUtils.currentLine=19267611;
 //BA.debugLineNum = 19267611;BA.debugLine="ToastMessageShow(\"Sin permisos\", False)";
anywheresoftware.b4a.keywords.Common.ToastMessageShow(BA.ObjectToCharSequence("Sin permisos"),anywheresoftware.b4a.keywords.Common.False);
 };
RDebugUtils.currentLine=19267613;
 //BA.debugLineNum = 19267613;BA.debugLine="End Sub";
return "";
}
public static anywheresoftware.b4a.objects.drawable.CanvasWrapper.BitmapWrapper  _createbitmapwithnumber(anywheresoftware.b4a.BA _ba,anywheresoftware.b4a.objects.drawable.CanvasWrapper.BitmapWrapper _originalbitmap,int _number) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "createbitmapwithnumber", false))
	 {return ((anywheresoftware.b4a.objects.drawable.CanvasWrapper.BitmapWrapper) Debug.delegate(null, "createbitmapwithnumber", new Object[] {_ba,_originalbitmap,_number}));}
anywheresoftware.b4a.objects.drawable.CanvasWrapper.BitmapWrapper _newbitmap = null;
anywheresoftware.b4a.objects.drawable.CanvasWrapper _canvas = null;
anywheresoftware.b4a.objects.drawable.CanvasWrapper.RectWrapper _destrect = null;
RDebugUtils.currentLine=21430272;
 //BA.debugLineNum = 21430272;BA.debugLine="Sub CreateBitmapWithNumber(OriginalBitmap As Bitma";
RDebugUtils.currentLine=21430273;
 //BA.debugLineNum = 21430273;BA.debugLine="Dim NewBitmap As Bitmap";
_newbitmap = new anywheresoftware.b4a.objects.drawable.CanvasWrapper.BitmapWrapper();
RDebugUtils.currentLine=21430274;
 //BA.debugLineNum = 21430274;BA.debugLine="NewBitmap.InitializeMutable(OriginalBitmap.Width,";
_newbitmap.InitializeMutable(_originalbitmap.getWidth(),_originalbitmap.getHeight());
RDebugUtils.currentLine=21430276;
 //BA.debugLineNum = 21430276;BA.debugLine="Dim Canvas As Canvas";
_canvas = new anywheresoftware.b4a.objects.drawable.CanvasWrapper();
RDebugUtils.currentLine=21430277;
 //BA.debugLineNum = 21430277;BA.debugLine="Canvas.Initialize2(NewBitmap)";
_canvas.Initialize2((android.graphics.Bitmap)(_newbitmap.getObject()));
RDebugUtils.currentLine=21430280;
 //BA.debugLineNum = 21430280;BA.debugLine="Dim DestRect As Rect";
_destrect = new anywheresoftware.b4a.objects.drawable.CanvasWrapper.RectWrapper();
RDebugUtils.currentLine=21430281;
 //BA.debugLineNum = 21430281;BA.debugLine="DestRect.Initialize(0, 0, OriginalBitmap.Width, O";
_destrect.Initialize((int) (0),(int) (0),_originalbitmap.getWidth(),_originalbitmap.getHeight());
RDebugUtils.currentLine=21430284;
 //BA.debugLineNum = 21430284;BA.debugLine="Canvas.DrawBitmap(OriginalBitmap, Null, DestRect)";
_canvas.DrawBitmap((android.graphics.Bitmap)(_originalbitmap.getObject()),(android.graphics.Rect)(anywheresoftware.b4a.keywords.Common.Null),(android.graphics.Rect)(_destrect.getObject()));
RDebugUtils.currentLine=21430287;
 //BA.debugLineNum = 21430287;BA.debugLine="Canvas.DrawText(Number, (OriginalBitmap.Width / 2";
_canvas.DrawText(_ba,BA.NumberToString(_number),(float) ((_originalbitmap.getWidth()/(double)2)),(float) ((_originalbitmap.getHeight()/(double)2.4)),anywheresoftware.b4a.keywords.Common.Typeface.DEFAULT,(float) (20),anywheresoftware.b4a.keywords.Common.Colors.White,BA.getEnumFromString(android.graphics.Paint.Align.class,"CENTER"));
RDebugUtils.currentLine=21430289;
 //BA.debugLineNum = 21430289;BA.debugLine="Return NewBitmap";
if (true) return _newbitmap;
RDebugUtils.currentLine=21430290;
 //BA.debugLineNum = 21430290;BA.debugLine="End Sub";
return null;
}
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=19070976;
 //BA.debugLineNum = 19070976;BA.debugLine="Sub dameErroresJSON(SQL As SQL, maxErrores As Int,";
RDebugUtils.currentLine=19070977;
 //BA.debugLineNum = 19070977;BA.debugLine="Log(\"dameErroresJSON\")";
anywheresoftware.b4a.keywords.Common.LogImpl("819070977","dameErroresJSON",0);
RDebugUtils.currentLine=19070978;
 //BA.debugLineNum = 19070978;BA.debugLine="Private j As JSONGenerator";
_j = new anywheresoftware.b4a.objects.collections.JSONParser.JSONGenerator();
RDebugUtils.currentLine=19070979;
 //BA.debugLineNum = 19070979;BA.debugLine="Private lim As String";
_lim = "";
RDebugUtils.currentLine=19070980;
 //BA.debugLineNum = 19070980;BA.debugLine="Private cur As ResultSet";
_cur = new anywheresoftware.b4a.sql.SQL.ResultSetWrapper();
RDebugUtils.currentLine=19070981;
 //BA.debugLineNum = 19070981;BA.debugLine="Private l As List";
_l = new anywheresoftware.b4a.objects.collections.List();
RDebugUtils.currentLine=19070982;
 //BA.debugLineNum = 19070982;BA.debugLine="Private i As Int = 0";
_i = (int) (0);
RDebugUtils.currentLine=19070983;
 //BA.debugLineNum = 19070983;BA.debugLine="l.Initialize";
_l.Initialize();
RDebugUtils.currentLine=19070984;
 //BA.debugLineNum = 19070984;BA.debugLine="Dim m, m2 As Map";
_m = new anywheresoftware.b4a.objects.collections.Map();
_m2 = new anywheresoftware.b4a.objects.collections.Map();
RDebugUtils.currentLine=19070985;
 //BA.debugLineNum = 19070985;BA.debugLine="m2.Initialize";
_m2.Initialize();
RDebugUtils.currentLine=19070986;
 //BA.debugLineNum = 19070986;BA.debugLine="If maxErrores = 0 Then lim = \"\" Else lim = \"limit";
if (_maxerrores==0) { 
_lim = "";}
else {
_lim = "limit "+BA.NumberToString(_maxerrores);};
RDebugUtils.currentLine=19070987;
 //BA.debugLineNum = 19070987;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=19070988;
 //BA.debugLineNum = 19070988;BA.debugLine="Do While cur.NextRow";
while (_cur.NextRow()) {
RDebugUtils.currentLine=19070989;
 //BA.debugLineNum = 19070989;BA.debugLine="m.Initialize";
_m.Initialize();
RDebugUtils.currentLine=19070990;
 //BA.debugLineNum = 19070990;BA.debugLine="m.Put(\"fecha\", cur.GetString(\"fecha\"))";
_m.Put((Object)("fecha"),(Object)(_cur.GetString("fecha")));
RDebugUtils.currentLine=19070991;
 //BA.debugLineNum = 19070991;BA.debugLine="m.Put(\"error\", cur.GetString(\"error\"))";
_m.Put((Object)("error"),(Object)(_cur.GetString("error")));
RDebugUtils.currentLine=19070992;
 //BA.debugLineNum = 19070992;BA.debugLine="m2.Put(i,m)";
_m2.Put((Object)(_i),(Object)(_m.getObject()));
RDebugUtils.currentLine=19070993;
 //BA.debugLineNum = 19070993;BA.debugLine="i = i + 1";
_i = (int) (_i+1);
 }
;
RDebugUtils.currentLine=19070995;
 //BA.debugLineNum = 19070995;BA.debugLine="cur.Close";
_cur.Close();
RDebugUtils.currentLine=19070996;
 //BA.debugLineNum = 19070996;BA.debugLine="j.Initialize(m2)";
_j.Initialize(_m2);
RDebugUtils.currentLine=19070997;
 //BA.debugLineNum = 19070997;BA.debugLine="Log(j.ToString)";
anywheresoftware.b4a.keywords.Common.LogImpl("819070997",_j.ToString(),0);
RDebugUtils.currentLine=19070998;
 //BA.debugLineNum = 19070998;BA.debugLine="If comprimido Then";
if (_comprimido) { 
RDebugUtils.currentLine=19070999;
 //BA.debugLineNum = 19070999;BA.debugLine="Return compress(j.ToString)";
if (true) return _compress(_ba,_j.ToString());
 }else {
RDebugUtils.currentLine=19071001;
 //BA.debugLineNum = 19071001;BA.debugLine="Return j.ToString";
if (true) return _j.ToString();
 };
RDebugUtils.currentLine=19071003;
 //BA.debugLineNum = 19071003;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=17629184;
 //BA.debugLineNum = 17629184;BA.debugLine="Sub dameRuta(inicioRuta As String, origenRuta As S";
RDebugUtils.currentLine=17629186;
 //BA.debugLineNum = 17629186;BA.debugLine="Dim fechaInicio As String";
_fechainicio = "";
RDebugUtils.currentLine=17629187;
 //BA.debugLineNum = 17629187;BA.debugLine="Try 'incioRuta es numero";
try {RDebugUtils.currentLine=17629188;
 //BA.debugLineNum = 17629188;BA.debugLine="inicioRuta = inicioRuta * 1";
_inicioruta = BA.NumberToString((double)(Double.parseDouble(_inicioruta))*1);
RDebugUtils.currentLine=17629190;
 //BA.debugLineNum = 17629190;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=17629192;
 //BA.debugLineNum = 17629192;BA.debugLine="fechaInicio = fechaInicioHoy";
_fechainicio = _fechainiciohoy(_ba);
 };
RDebugUtils.currentLine=17629195;
 //BA.debugLineNum = 17629195;BA.debugLine="If B4XPages.MainPage.logger Then Log(\"fechaInicio";
if (mostCurrent._b4xpages._mainpage /*reparto_izca.keymon.lat.b4xmainpage*/ (_ba)._logger /*boolean*/ ) { 
anywheresoftware.b4a.keywords.Common.LogImpl("817629195","fechaInicio: "+_fechainicio+" | rutaHrsAtras="+BA.NumberToString(_rutahrsatras),0);};
RDebugUtils.currentLine=17629196;
 //BA.debugLineNum = 17629196;BA.debugLine="Dim c As Cursor";
_c = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
RDebugUtils.currentLine=17629197;
 //BA.debugLineNum = 17629197;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=17629198;
 //BA.debugLineNum = 17629198;BA.debugLine="If B4XPages.MainPage.logger Then Log(\"select FECH";
if (mostCurrent._b4xpages._mainpage /*reparto_izca.keymon.lat.b4xmainpage*/ (_ba)._logger /*boolean*/ ) { 
anywheresoftware.b4a.keywords.Common.LogImpl("817629198","select FECHA, LAT, LON from "+_origenruta+" where FECHA > "+_fechainicio+" order by FECHA desc limit "+BA.NumberToString(_rutamaxpoints),0);};
RDebugUtils.currentLine=17629199;
 //BA.debugLineNum = 17629199;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=17629200;
 //BA.debugLineNum = 17629200;BA.debugLine="c.Position = 0";
_c.setPosition((int) (0));
RDebugUtils.currentLine=17629201;
 //BA.debugLineNum = 17629201;BA.debugLine="Dim ruta2 As String = \"\"";
_ruta2 = "";
RDebugUtils.currentLine=17629202;
 //BA.debugLineNum = 17629202;BA.debugLine="If c.RowCount>0 Then";
if (_c.getRowCount()>0) { 
RDebugUtils.currentLine=17629203;
 //BA.debugLineNum = 17629203;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=17629204;
 //BA.debugLineNum = 17629204;BA.debugLine="c.Position=i";
_c.setPosition(_i);
RDebugUtils.currentLine=17629205;
 //BA.debugLineNum = 17629205;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=17629206;
 //BA.debugLineNum = 17629206;BA.debugLine="B4XPages.MainPage.fechaRuta = c.GetString(\"FECH";
mostCurrent._b4xpages._mainpage /*reparto_izca.keymon.lat.b4xmainpage*/ (_ba)._fecharuta /*String*/  = _c.GetString("FECHA");
 }
};
 };
RDebugUtils.currentLine=17629209;
 //BA.debugLineNum = 17629209;BA.debugLine="c.Close";
_c.Close();
RDebugUtils.currentLine=17629210;
 //BA.debugLineNum = 17629210;BA.debugLine="Return compress(ruta2)";
if (true) return _compress(_ba,_ruta2);
RDebugUtils.currentLine=17629211;
 //BA.debugLineNum = 17629211;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=18284544;
 //BA.debugLineNum = 18284544;BA.debugLine="Sub fechaInicioHoy As String 'ignore";
RDebugUtils.currentLine=18284545;
 //BA.debugLineNum = 18284545;BA.debugLine="Dim OrigFormat As String = DateTime.DateFormat";
_origformat = anywheresoftware.b4a.keywords.Common.DateTime.getDateFormat();
RDebugUtils.currentLine=18284546;
 //BA.debugLineNum = 18284546;BA.debugLine="DateTime.DateFormat=\"yyMMdd\"";
anywheresoftware.b4a.keywords.Common.DateTime.setDateFormat("yyMMdd");
RDebugUtils.currentLine=18284547;
 //BA.debugLineNum = 18284547;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=18284548;
 //BA.debugLineNum = 18284548;BA.debugLine="DateTime.DateFormat=OrigFormat  'return to orig";
anywheresoftware.b4a.keywords.Common.DateTime.setDateFormat(_origformat);
RDebugUtils.currentLine=18284549;
 //BA.debugLineNum = 18284549;BA.debugLine="Log(\"Hoy=\"&h)";
anywheresoftware.b4a.keywords.Common.LogImpl("818284549","Hoy="+_h,0);
RDebugUtils.currentLine=18284550;
 //BA.debugLineNum = 18284550;BA.debugLine="Return h";
if (true) return _h;
RDebugUtils.currentLine=18284551;
 //BA.debugLineNum = 18284551;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=17170432;
 //BA.debugLineNum = 17170432;BA.debugLine="Sub decompress(base64 As String) As String 'ignore";
RDebugUtils.currentLine=17170433;
 //BA.debugLineNum = 17170433;BA.debugLine="Dim decompressedbytes() As Byte = su.DecodeBase64";
_decompressedbytes = _su.DecodeBase64(_base64);
RDebugUtils.currentLine=17170435;
 //BA.debugLineNum = 17170435;BA.debugLine="Dim bc As ByteConverter";
_bc = new anywheresoftware.b4a.agraham.byteconverter.ByteConverter();
RDebugUtils.currentLine=17170436;
 //BA.debugLineNum = 17170436;BA.debugLine="Dim uncompressed As String = bc.StringFromBytes(d";
_uncompressed = _bc.StringFromBytes(_decompressedbytes,"UTF8");
RDebugUtils.currentLine=17170437;
 //BA.debugLineNum = 17170437;BA.debugLine="Log($\"Descomprimido: ${uncompressed.Length}\"$)";
anywheresoftware.b4a.keywords.Common.LogImpl("817170437",("Descomprimido: "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_uncompressed.length()))+""),0);
RDebugUtils.currentLine=17170439;
 //BA.debugLineNum = 17170439;BA.debugLine="Return uncompressed";
if (true) return _uncompressed;
RDebugUtils.currentLine=17170440;
 //BA.debugLineNum = 17170440;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=17760256;
 //BA.debugLineNum = 17760256;BA.debugLine="Sub deleteErrorLog_DB 'ignore";
RDebugUtils.currentLine=17760257;
 //BA.debugLineNum = 17760257;BA.debugLine="If Not(errorLog.IsInitialized) Then revisaBD";
if (anywheresoftware.b4a.keywords.Common.Not(_errorlog.IsInitialized())) { 
_revisabd(_ba);};
RDebugUtils.currentLine=17760258;
 //BA.debugLineNum = 17760258;BA.debugLine="errorLog.ExecNonQuery(\"delete from errores\")";
_errorlog.ExecNonQuery("delete from errores");
RDebugUtils.currentLine=17760259;
 //BA.debugLineNum = 17760259;BA.debugLine="errorLog.ExecNonQuery(\"vacuum;\")";
_errorlog.ExecNonQuery("vacuum;");
RDebugUtils.currentLine=17760260;
 //BA.debugLineNum = 17760260;BA.debugLine="ToastMessageShow(\"Borrada\", False)";
anywheresoftware.b4a.keywords.Common.ToastMessageShow(BA.ObjectToCharSequence("Borrada"),anywheresoftware.b4a.keywords.Common.False);
RDebugUtils.currentLine=17760261;
 //BA.debugLineNum = 17760261;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=17694720;
 //BA.debugLineNum = 17694720;BA.debugLine="Sub deleteGPS_DB 'ignore";
RDebugUtils.currentLine=17694721;
 //BA.debugLineNum = 17694721;BA.debugLine="kmt.ExecNonQuery(\"delete from RUTA_GPS\")";
_kmt.ExecNonQuery("delete from RUTA_GPS");
RDebugUtils.currentLine=17694722;
 //BA.debugLineNum = 17694722;BA.debugLine="kmt.ExecNonQuery(\"vacuum;\")";
_kmt.ExecNonQuery("vacuum;");
RDebugUtils.currentLine=17694723;
 //BA.debugLineNum = 17694723;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=19136512;
 //BA.debugLineNum = 19136512;BA.debugLine="Sub fechaKMT2Ticks(fKMT As String) As Long 'ignore";
RDebugUtils.currentLine=19136513;
 //BA.debugLineNum = 19136513;BA.debugLine="Try";
try {RDebugUtils.currentLine=19136514;
 //BA.debugLineNum = 19136514;BA.debugLine="If fKMT.Length = 12 Then";
if (_fkmt.length()==12) { 
RDebugUtils.currentLine=19136515;
 //BA.debugLineNum = 19136515;BA.debugLine="Private parteFecha As String = fKMT.SubString2(";
_partefecha = _fkmt.substring((int) (0),(int) (6));
RDebugUtils.currentLine=19136516;
 //BA.debugLineNum = 19136516;BA.debugLine="Private parteHora As String = fKMT.SubString(6)";
_partehora = _fkmt.substring((int) (6));
RDebugUtils.currentLine=19136517;
 //BA.debugLineNum = 19136517;BA.debugLine="Private OrigFormat As String = DateTime.DateFor";
_origformat = anywheresoftware.b4a.keywords.Common.DateTime.getDateFormat();
RDebugUtils.currentLine=19136518;
 //BA.debugLineNum = 19136518;BA.debugLine="DateTime.DateFormat=\"yyMMdd\"";
anywheresoftware.b4a.keywords.Common.DateTime.setDateFormat("yyMMdd");
RDebugUtils.currentLine=19136519;
 //BA.debugLineNum = 19136519;BA.debugLine="DateTime.TimeFormat=\"HHmmss\"";
anywheresoftware.b4a.keywords.Common.DateTime.setTimeFormat("HHmmss");
RDebugUtils.currentLine=19136520;
 //BA.debugLineNum = 19136520;BA.debugLine="Private ticks As Long = DateTime.DateTimeParse(";
_ticks = anywheresoftware.b4a.keywords.Common.DateTime.DateTimeParse(_partefecha,_partehora);
RDebugUtils.currentLine=19136522;
 //BA.debugLineNum = 19136522;BA.debugLine="DateTime.DateFormat=OrigFormat  'return to orig";
anywheresoftware.b4a.keywords.Common.DateTime.setDateFormat(_origformat);
RDebugUtils.currentLine=19136523;
 //BA.debugLineNum = 19136523;BA.debugLine="Return ticks";
if (true) return _ticks;
 }else {
RDebugUtils.currentLine=19136525;
 //BA.debugLineNum = 19136525;BA.debugLine="Log(\"Formato de fecha incorrecto, debe de ser '";
anywheresoftware.b4a.keywords.Common.LogImpl("819136525","Formato de fecha incorrecto, debe de ser 'YYMMDDHHMMSS', no '"+_fkmt+"' largo="+BA.NumberToString(_fkmt.length()),0);
RDebugUtils.currentLine=19136526;
 //BA.debugLineNum = 19136526;BA.debugLine="Return 0";
if (true) return (long) (0);
 };
 } 
       catch (Exception e16) {
			(_ba.processBA == null ? _ba : _ba.processBA).setLastException(e16);RDebugUtils.currentLine=19136529;
 //BA.debugLineNum = 19136529;BA.debugLine="Log(LastException)";
anywheresoftware.b4a.keywords.Common.LogImpl("819136529",BA.ObjectToString(anywheresoftware.b4a.keywords.Common.LastException(_ba)),0);
RDebugUtils.currentLine=19136530;
 //BA.debugLineNum = 19136530;BA.debugLine="LogColor($\"Fecha dada: ${fKMT}, Parte Fecha: ${p";
anywheresoftware.b4a.keywords.Common.LogImpl("819136530",("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=19136531;
 //BA.debugLineNum = 19136531;BA.debugLine="Return 0";
if (true) return (long) (0);
 };
RDebugUtils.currentLine=19136533;
 //BA.debugLineNum = 19136533;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=17039360;
 //BA.debugLineNum = 17039360;BA.debugLine="Sub getPhnId As String 'ignore";
RDebugUtils.currentLine=17039362;
 //BA.debugLineNum = 17039362;BA.debugLine="devModel = phn.Model";
_devmodel = _phn.getModel();
RDebugUtils.currentLine=17039363;
 //BA.debugLineNum = 17039363;BA.debugLine="If devModel.Length <= 3 Then 'Si phn.Model esta e";
if (_devmodel.length()<=3) { 
RDebugUtils.currentLine=17039364;
 //BA.debugLineNum = 17039364;BA.debugLine="Dim t As String = phn.GetSettings(\"android_id\")";
_t = _phn.GetSettings("android_id");
RDebugUtils.currentLine=17039365;
 //BA.debugLineNum = 17039365;BA.debugLine="devModel = t";
_devmodel = _t;
 };
RDebugUtils.currentLine=17039367;
 //BA.debugLineNum = 17039367;BA.debugLine="If devModel.Length >= 3 Then 'Si tenemos valor pa";
if (_devmodel.length()>=3) { 
RDebugUtils.currentLine=17039368;
 //BA.debugLineNum = 17039368;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=17039370;
 //BA.debugLineNum = 17039370;BA.debugLine="Else If devModel.Length < 3 Then ' Si no tenemos";
if (_devmodel.length()<3) { 
RDebugUtils.currentLine=17039371;
 //BA.debugLineNum = 17039371;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=17039372;
 //BA.debugLineNum = 17039372;BA.debugLine="devModel = s";
_devmodel = _s;
 }}
;
RDebugUtils.currentLine=17039376;
 //BA.debugLineNum = 17039376;BA.debugLine="Return devModel";
if (true) return _devmodel;
RDebugUtils.currentLine=17039377;
 //BA.debugLineNum = 17039377;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=17956864;
 //BA.debugLineNum = 17956864;BA.debugLine="Sub getSSID  'ignore";
RDebugUtils.currentLine=17956869;
 //BA.debugLineNum = 17956869;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=17498112;
 //BA.debugLineNum = 17498112;BA.debugLine="Sub guardaInfoEnArchivo(coords As String) 'ignore";
RDebugUtils.currentLine=17498114;
 //BA.debugLineNum = 17498114;BA.debugLine="Dim OrigFormat As String=DateTime.DateFormat  'sa";
_origformat = anywheresoftware.b4a.keywords.Common.DateTime.getDateFormat();
RDebugUtils.currentLine=17498115;
 //BA.debugLineNum = 17498115;BA.debugLine="DateTime.DateFormat=\"MMM-dd HH:mm:ss\"";
anywheresoftware.b4a.keywords.Common.DateTime.setDateFormat("MMM-dd HH:mm:ss");
RDebugUtils.currentLine=17498116;
 //BA.debugLineNum = 17498116;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=17498117;
 //BA.debugLineNum = 17498117;BA.debugLine="DateTime.DateFormat=OrigFormat  'return to orig d";
anywheresoftware.b4a.keywords.Common.DateTime.setDateFormat(_origformat);
RDebugUtils.currentLine=17498119;
 //BA.debugLineNum = 17498119;BA.debugLine="Dim ubic As String = coords&\",\"&lastUpdate";
_ubic = _coords+","+_lastupdate;
RDebugUtils.currentLine=17498120;
 //BA.debugLineNum = 17498120;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=17498121;
 //BA.debugLineNum = 17498121;BA.debugLine="Dim s As String = ubic & CRLF";
_s = _ubic+anywheresoftware.b4a.keywords.Common.CRLF;
RDebugUtils.currentLine=17498122;
 //BA.debugLineNum = 17498122;BA.debugLine="Dim t() As Byte = s.GetBytes(\"UTF-8\")";
_t = _s.getBytes("UTF-8");
RDebugUtils.currentLine=17498123;
 //BA.debugLineNum = 17498123;BA.debugLine="out.WriteBytes(t, 0, t.Length)";
_out.WriteBytes(_t,(int) (0),_t.length);
RDebugUtils.currentLine=17498124;
 //BA.debugLineNum = 17498124;BA.debugLine="out.Close";
_out.Close();
RDebugUtils.currentLine=17498125;
 //BA.debugLineNum = 17498125;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=17563648;
 //BA.debugLineNum = 17563648;BA.debugLine="Sub guardaInfoEnBD(coords As String) 'ignore";
RDebugUtils.currentLine=17563649;
 //BA.debugLineNum = 17563649;BA.debugLine="If B4XPages.MainPage.logger Then Log(\"Guardamos u";
if (mostCurrent._b4xpages._mainpage /*reparto_izca.keymon.lat.b4xmainpage*/ (_ba)._logger /*boolean*/ ) { 
anywheresoftware.b4a.keywords.Common.LogImpl("817563649","Guardamos ubicacion en BD - "+_coords,0);};
RDebugUtils.currentLine=17563650;
 //BA.debugLineNum = 17563650;BA.debugLine="Try";
try {RDebugUtils.currentLine=17563651;
 //BA.debugLineNum = 17563651;BA.debugLine="Dim latlon() As String = Regex.Split(\"\\|\", coord";
_latlon = anywheresoftware.b4a.keywords.Common.Regex.Split("\\|",_coords);
RDebugUtils.currentLine=17563652;
 //BA.debugLineNum = 17563652;BA.debugLine="If latlon.Length < 2 Then latlon = Regex.Split(\"";
if (_latlon.length<2) { 
_latlon = anywheresoftware.b4a.keywords.Common.Regex.Split(",",_coords);};
RDebugUtils.currentLine=17563654;
 //BA.debugLineNum = 17563654;BA.debugLine="If Not(kmt.IsInitialized) Then revisaBD";
if (anywheresoftware.b4a.keywords.Common.Not(_kmt.IsInitialized())) { 
_revisabd(_ba);};
RDebugUtils.currentLine=17563655;
 //BA.debugLineNum = 17563655;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=17563657;
 //BA.debugLineNum = 17563657;BA.debugLine="Log(LastException)";
anywheresoftware.b4a.keywords.Common.LogImpl("817563657",BA.ObjectToString(anywheresoftware.b4a.keywords.Common.LastException(_ba)),0);
 };
RDebugUtils.currentLine=17563659;
 //BA.debugLineNum = 17563659;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=17301504;
 //BA.debugLineNum = 17301504;BA.debugLine="Sub hmsKMT As String 'ignore";
RDebugUtils.currentLine=17301506;
 //BA.debugLineNum = 17301506;BA.debugLine="Dim OrigFormat As String = DateTime.DateFormat  '";
_origformat = anywheresoftware.b4a.keywords.Common.DateTime.getDateFormat();
RDebugUtils.currentLine=17301507;
 //BA.debugLineNum = 17301507;BA.debugLine="DateTime.DateFormat=\"HHmmss\"";
anywheresoftware.b4a.keywords.Common.DateTime.setDateFormat("HHmmss");
RDebugUtils.currentLine=17301508;
 //BA.debugLineNum = 17301508;BA.debugLine="Private nuevaHora As String=DateTime.Date(DateTim";
_nuevahora = anywheresoftware.b4a.keywords.Common.DateTime.Date(anywheresoftware.b4a.keywords.Common.DateTime.getNow());
RDebugUtils.currentLine=17301509;
 //BA.debugLineNum = 17301509;BA.debugLine="DateTime.DateFormat=OrigFormat  'return to orig d";
anywheresoftware.b4a.keywords.Common.DateTime.setDateFormat(_origformat);
RDebugUtils.currentLine=17301511;
 //BA.debugLineNum = 17301511;BA.debugLine="Return nuevaHora";
if (true) return _nuevahora;
RDebugUtils.currentLine=17301512;
 //BA.debugLineNum = 17301512;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=19398656;
 //BA.debugLineNum = 19398656;BA.debugLine="Sub insertaEnErrores(error As String)  'ignore";
RDebugUtils.currentLine=19398657;
 //BA.debugLineNum = 19398657;BA.debugLine="If Not(errorLog.IsInitialized) Then revisaBD";
if (anywheresoftware.b4a.keywords.Common.Not(_errorlog.IsInitialized())) { 
_revisabd(_ba);};
RDebugUtils.currentLine=19398658;
 //BA.debugLineNum = 19398658;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=19398659;
 //BA.debugLineNum = 19398659;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=19005440;
 //BA.debugLineNum = 19005440;BA.debugLine="Sub insertaRenglonesPruebaEnErrorLog 'ignore";
RDebugUtils.currentLine=19005441;
 //BA.debugLineNum = 19005441;BA.debugLine="If Not(errorLog.IsInitialized) Then revisaBD";
if (anywheresoftware.b4a.keywords.Common.Not(_errorlog.IsInitialized())) { 
_revisabd(_ba);};
RDebugUtils.currentLine=19005442;
 //BA.debugLineNum = 19005442;BA.debugLine="Log(\"insertamos 50 renglones a errorLog\")";
anywheresoftware.b4a.keywords.Common.LogImpl("819005442","insertamos 50 renglones a errorLog",0);
RDebugUtils.currentLine=19005443;
 //BA.debugLineNum = 19005443;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=19005444;
 //BA.debugLineNum = 19005444;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=19005445;
 //BA.debugLineNum = 19005445;BA.debugLine="Log(x)";
anywheresoftware.b4a.keywords.Common.LogImpl("819005445",BA.NumberToString(_x),0);
 }
};
RDebugUtils.currentLine=19005447;
 //BA.debugLineNum = 19005447;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=19202048;
 //BA.debugLineNum = 19202048;BA.debugLine="Sub InstallAPK(dir As String, apk As String) 'igno";
RDebugUtils.currentLine=19202049;
 //BA.debugLineNum = 19202049;BA.debugLine="If File.Exists(dir, apk) Then";
if (anywheresoftware.b4a.keywords.Common.File.Exists(_dir,_apk)) { 
RDebugUtils.currentLine=19202050;
 //BA.debugLineNum = 19202050;BA.debugLine="Dim i As Intent";
_i = new anywheresoftware.b4a.objects.IntentWrapper();
RDebugUtils.currentLine=19202051;
 //BA.debugLineNum = 19202051;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=19202052;
 //BA.debugLineNum = 19202052;BA.debugLine="i.SetType(\"application/vnd.android.package-archi";
_i.SetType("application/vnd.android.package-archive");
RDebugUtils.currentLine=19202053;
 //BA.debugLineNum = 19202053;BA.debugLine="StartActivity(i)";
anywheresoftware.b4a.keywords.Common.StartActivity((_ba.processBA == null ? _ba : _ba.processBA),(Object)(_i.getObject()));
 };
RDebugUtils.currentLine=19202055;
 //BA.debugLineNum = 19202055;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=18022400;
 //BA.debugLineNum = 18022400;BA.debugLine="Sub JSON2Map(theJson As String) As Map 'ignore";
RDebugUtils.currentLine=18022402;
 //BA.debugLineNum = 18022402;BA.debugLine="Try";
try {RDebugUtils.currentLine=18022403;
 //BA.debugLineNum = 18022403;BA.debugLine="Private json As JSONParser";
_json = new anywheresoftware.b4a.objects.collections.JSONParser();
RDebugUtils.currentLine=18022404;
 //BA.debugLineNum = 18022404;BA.debugLine="json.Initialize(theJson)";
_json.Initialize(_thejson);
RDebugUtils.currentLine=18022405;
 //BA.debugLineNum = 18022405;BA.debugLine="Return json.NextObject";
if (true) return _json.NextObject();
 } 
       catch (Exception e6) {
			(_ba.processBA == null ? _ba : _ba.processBA).setLastException(e6);RDebugUtils.currentLine=18022407;
 //BA.debugLineNum = 18022407;BA.debugLine="Log(LastException)";
anywheresoftware.b4a.keywords.Common.LogImpl("818022407",BA.ObjectToString(anywheresoftware.b4a.keywords.Common.LastException(_ba)),0);
RDebugUtils.currentLine=18022408;
 //BA.debugLineNum = 18022408;BA.debugLine="log2DB(\"JSON2Map: \"&LastException)";
_log2db(_ba,"JSON2Map: "+BA.ObjectToString(anywheresoftware.b4a.keywords.Common.LastException(_ba)));
RDebugUtils.currentLine=18022409;
 //BA.debugLineNum = 18022409;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=18022410;
 //BA.debugLineNum = 18022410;BA.debugLine="Return m";
if (true) return _m;
 };
RDebugUtils.currentLine=18022412;
 //BA.debugLineNum = 18022412;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=18350080;
 //BA.debugLineNum = 18350080;BA.debugLine="Sub log2DB(texto As String) 'ignore";
RDebugUtils.currentLine=18350081;
 //BA.debugLineNum = 18350081;BA.debugLine="LogColor(fechaKMT(DateTime.Now)&\" - log2BD: '\"&te";
anywheresoftware.b4a.keywords.Common.LogImpl("818350081",_fechakmt(_ba,BA.NumberToString(anywheresoftware.b4a.keywords.Common.DateTime.getNow()))+" - log2BD: '"+_texto+"'",anywheresoftware.b4a.keywords.Common.Colors.Magenta);
RDebugUtils.currentLine=18350082;
 //BA.debugLineNum = 18350082;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=18350083;
 //BA.debugLineNum = 18350083;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=18219008;
 //BA.debugLineNum = 18219008;BA.debugLine="Sub mandamosLoc(coords As String) 'ignore";
RDebugUtils.currentLine=18219024;
 //BA.debugLineNum = 18219024;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=18087936;
 //BA.debugLineNum = 18087936;BA.debugLine="Sub map2JSON(m As Map) As String 'ignore";
RDebugUtils.currentLine=18087939;
 //BA.debugLineNum = 18087939;BA.debugLine="Dim jg As JSONGenerator";
_jg = new anywheresoftware.b4a.objects.collections.JSONParser.JSONGenerator();
RDebugUtils.currentLine=18087940;
 //BA.debugLineNum = 18087940;BA.debugLine="jg.Initialize(m)";
_jg.Initialize(_m);
RDebugUtils.currentLine=18087941;
 //BA.debugLineNum = 18087941;BA.debugLine="Dim t As String = jg.ToString";
_t = _jg.ToString();
RDebugUtils.currentLine=18087942;
 //BA.debugLineNum = 18087942;BA.debugLine="Return t";
if (true) return _t;
RDebugUtils.currentLine=18087943;
 //BA.debugLineNum = 18087943;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=18415616;
 //BA.debugLineNum = 18415616;BA.debugLine="Sub masDeXXMins(hora As Int, mins As Int) As Boole";
RDebugUtils.currentLine=18415617;
 //BA.debugLineNum = 18415617;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=18415618;
 //BA.debugLineNum = 18415618;BA.debugLine="Return True";
if (true) return anywheresoftware.b4a.keywords.Common.True;
 }else {
RDebugUtils.currentLine=18415620;
 //BA.debugLineNum = 18415620;BA.debugLine="Return False";
if (true) return anywheresoftware.b4a.keywords.Common.False;
 };
RDebugUtils.currentLine=18415622;
 //BA.debugLineNum = 18415622;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=18481152;
 //BA.debugLineNum = 18481152;BA.debugLine="Sub masDeXXMinsKMT(hora As String, mins As Int) As";
RDebugUtils.currentLine=18481153;
 //BA.debugLineNum = 18481153;BA.debugLine="Try";
try {RDebugUtils.currentLine=18481155;
 //BA.debugLineNum = 18481155;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=18481157;
 //BA.debugLineNum = 18481157;BA.debugLine="Return True";
if (true) return anywheresoftware.b4a.keywords.Common.True;
 }else {
RDebugUtils.currentLine=18481160;
 //BA.debugLineNum = 18481160;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=18481163;
 //BA.debugLineNum = 18481163;BA.debugLine="Log(LastException)";
anywheresoftware.b4a.keywords.Common.LogImpl("818481163",BA.ObjectToString(anywheresoftware.b4a.keywords.Common.LastException(_ba)),0);
 };
RDebugUtils.currentLine=18481165;
 //BA.debugLineNum = 18481165;BA.debugLine="End Sub";
return false;
}
public static String  _monitor(anywheresoftware.b4a.BA _ba) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "monitor", false))
	 {return ((String) Debug.delegate(null, "monitor", new Object[] {_ba}));}
RDebugUtils.currentLine=18612224;
 //BA.debugLineNum = 18612224;BA.debugLine="Sub Monitor 'ignore";
RDebugUtils.currentLine=18612242;
 //BA.debugLineNum = 18612242;BA.debugLine="End Sub";
return "";
}
public static String  _notihigh(anywheresoftware.b4a.BA _ba,String _title,String _body,Object _activity) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "notihigh", false))
	 {return ((String) Debug.delegate(null, "notihigh", new Object[] {_ba,_title,_body,_activity}));}
anywheresoftware.b4a.objects.NotificationWrapper _notif = null;
RDebugUtils.currentLine=17367040;
 //BA.debugLineNum = 17367040;BA.debugLine="Sub notiHigh(title As String, body As String, acti";
RDebugUtils.currentLine=17367041;
 //BA.debugLineNum = 17367041;BA.debugLine="Private notif As Notification";
_notif = new anywheresoftware.b4a.objects.NotificationWrapper();
RDebugUtils.currentLine=17367042;
 //BA.debugLineNum = 17367042;BA.debugLine="notif.Initialize2(notif.IMPORTANCE_HIGH)";
_notif.Initialize2(_notif.IMPORTANCE_HIGH);
RDebugUtils.currentLine=17367043;
 //BA.debugLineNum = 17367043;BA.debugLine="notif.Icon = \"icon\"";
_notif.setIcon("icon");
RDebugUtils.currentLine=17367044;
 //BA.debugLineNum = 17367044;BA.debugLine="notif.Vibrate = False";
_notif.setVibrate(anywheresoftware.b4a.keywords.Common.False);
RDebugUtils.currentLine=17367045;
 //BA.debugLineNum = 17367045;BA.debugLine="notif.Sound = False";
_notif.setSound(anywheresoftware.b4a.keywords.Common.False);
RDebugUtils.currentLine=17367046;
 //BA.debugLineNum = 17367046;BA.debugLine="notif.AutoCancel = True";
_notif.setAutoCancel(anywheresoftware.b4a.keywords.Common.True);
RDebugUtils.currentLine=17367047;
 //BA.debugLineNum = 17367047;BA.debugLine="Log(\"notiHigh: \"&title)";
anywheresoftware.b4a.keywords.Common.LogImpl("817367047","notiHigh: "+_title,0);
RDebugUtils.currentLine=17367048;
 //BA.debugLineNum = 17367048;BA.debugLine="notif.SetInfo(title, body, activity)";
_notif.SetInfoNew((_ba.processBA == null ? _ba : _ba.processBA),BA.ObjectToCharSequence(_title),BA.ObjectToCharSequence(_body),_activity);
RDebugUtils.currentLine=17367050;
 //BA.debugLineNum = 17367050;BA.debugLine="notif.Notify(777)";
_notif.Notify((int) (777));
RDebugUtils.currentLine=17367051;
 //BA.debugLineNum = 17367051;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=17432576;
 //BA.debugLineNum = 17432576;BA.debugLine="Sub notiLowReturn(title As String, Body As String,";
RDebugUtils.currentLine=17432577;
 //BA.debugLineNum = 17432577;BA.debugLine="Private notification As Notification";
_notification = new anywheresoftware.b4a.objects.NotificationWrapper();
RDebugUtils.currentLine=17432578;
 //BA.debugLineNum = 17432578;BA.debugLine="notification.Initialize2(notification.IMPORTANCE_";
_notification.Initialize2(_notification.IMPORTANCE_LOW);
RDebugUtils.currentLine=17432579;
 //BA.debugLineNum = 17432579;BA.debugLine="Log(\"notiLowReturn: \"&title)";
anywheresoftware.b4a.keywords.Common.LogImpl("817432579","notiLowReturn: "+_title,0);
RDebugUtils.currentLine=17432580;
 //BA.debugLineNum = 17432580;BA.debugLine="notification.Icon = \"icon\"";
_notification.setIcon("icon");
RDebugUtils.currentLine=17432581;
 //BA.debugLineNum = 17432581;BA.debugLine="notification.Sound = False";
_notification.setSound(anywheresoftware.b4a.keywords.Common.False);
RDebugUtils.currentLine=17432582;
 //BA.debugLineNum = 17432582;BA.debugLine="notification.Vibrate = False";
_notification.setVibrate(anywheresoftware.b4a.keywords.Common.False);
RDebugUtils.currentLine=17432583;
 //BA.debugLineNum = 17432583;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=17432584;
 //BA.debugLineNum = 17432584;BA.debugLine="notification.Notify(id)";
_notification.Notify(_id);
RDebugUtils.currentLine=17432586;
 //BA.debugLineNum = 17432586;BA.debugLine="Return notification";
if (true) return _notification;
RDebugUtils.currentLine=17432587;
 //BA.debugLineNum = 17432587;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=20643840;
 //BA.debugLineNum = 20643840;BA.debugLine="Sub prodRechazo(clienteOriginal As String, prodId";
RDebugUtils.currentLine=20643841;
 //BA.debugLineNum = 20643841;BA.debugLine="Log(\"RECHAZO DEVOLUCION\")";
anywheresoftware.b4a.keywords.Common.LogImpl("820643841","RECHAZO DEVOLUCION",0);
RDebugUtils.currentLine=20643842;
 //BA.debugLineNum = 20643842;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=20643843;
 //BA.debugLineNum = 20643843;BA.debugLine="rr.Position = 0";
_rr.setPosition((int) (0));
RDebugUtils.currentLine=20643844;
 //BA.debugLineNum = 20643844;BA.debugLine="If rr.GetString(\"hayRechazo\") = 0 Then";
if ((_rr.GetString("hayRechazo")).equals(BA.NumberToString(0))) { 
RDebugUtils.currentLine=20643845;
 //BA.debugLineNum = 20643845;BA.debugLine="Log(\"INSERTAMOS EN REPARTO\")";
anywheresoftware.b4a.keywords.Common.LogImpl("820643845","INSERTAMOS EN REPARTO",0);
RDebugUtils.currentLine=20643847;
 //BA.debugLineNum = 20643847;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=20643849;
 //BA.debugLineNum = 20643849;BA.debugLine="If chv.RowCount > 0 Then";
if (_chv.getRowCount()>0) { 
RDebugUtils.currentLine=20643850;
 //BA.debugLineNum = 20643850;BA.debugLine="chv.Position = 0";
_chv.setPosition((int) (0));
RDebugUtils.currentLine=20643852;
 //BA.debugLineNum = 20643852;BA.debugLine="Private precio As String = traePrecio(prodId, t";
_precio = _traeprecio(_ba,_prodid,_traealmacen(_ba));
RDebugUtils.currentLine=20643853;
 //BA.debugLineNum = 20643853;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=20643854;
 //BA.debugLineNum = 20643854;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=20643855;
 //BA.debugLineNum = 20643855;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=20643858;
 //BA.debugLineNum = 20643858;BA.debugLine="Log($\"ACTUALIZAMOS REPARTO\"$)";
anywheresoftware.b4a.keywords.Common.LogImpl("820643858",("ACTUALIZAMOS REPARTO"),0);
RDebugUtils.currentLine=20643859;
 //BA.debugLineNum = 20643859;BA.debugLine="Private precio As String = traePrecio(prodId, tr";
_precio = _traeprecio(_ba,_prodid,_traealmacen(_ba));
RDebugUtils.currentLine=20643860;
 //BA.debugLineNum = 20643860;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=20643861;
 //BA.debugLineNum = 20643861;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=20643862;
 //BA.debugLineNum = 20643862;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=20643865;
 //BA.debugLineNum = 20643865;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=20643867;
 //BA.debugLineNum = 20643867;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=19922944;
 //BA.debugLineNum = 19922944;BA.debugLine="Sub traePrecio(id As String, quePromo As String) A";
RDebugUtils.currentLine=19922945;
 //BA.debugLineNum = 19922945;BA.debugLine="Private pu As String = \"0\"";
_pu = "0";
RDebugUtils.currentLine=19922947;
 //BA.debugLineNum = 19922947;BA.debugLine="If quePromo = traeAlmacen Then";
if ((_quepromo).equals(_traealmacen(_ba))) { 
RDebugUtils.currentLine=19922948;
 //BA.debugLineNum = 19922948;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=19922949;
 //BA.debugLineNum = 19922949;BA.debugLine="If idc.RowCount > 0 Then";
if (_idc.getRowCount()>0) { 
RDebugUtils.currentLine=19922950;
 //BA.debugLineNum = 19922950;BA.debugLine="idc.Position=0";
_idc.setPosition((int) (0));
RDebugUtils.currentLine=19922951;
 //BA.debugLineNum = 19922951;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=19922954;
 //BA.debugLineNum = 19922954;BA.debugLine="idc.Close";
_idc.Close();
 }else {
RDebugUtils.currentLine=19922956;
 //BA.debugLineNum = 19922956;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=19922957;
 //BA.debugLineNum = 19922957;BA.debugLine="If pc.RowCount > 0 Then";
if (_pc.getRowCount()>0) { 
RDebugUtils.currentLine=19922958;
 //BA.debugLineNum = 19922958;BA.debugLine="pc.Position = 0";
_pc.setPosition((int) (0));
RDebugUtils.currentLine=19922960;
 //BA.debugLineNum = 19922960;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=19922961;
 //BA.debugLineNum = 19922961;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=19922965;
 //BA.debugLineNum = 19922965;BA.debugLine="pc.Close";
_pc.Close();
 };
RDebugUtils.currentLine=19922968;
 //BA.debugLineNum = 19922968;BA.debugLine="Return pu";
if (true) return _pu;
RDebugUtils.currentLine=19922970;
 //BA.debugLineNum = 19922970;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=18743296;
 //BA.debugLineNum = 18743296;BA.debugLine="Sub revisaFLP 'ignore";
RDebugUtils.currentLine=18743297;
 //BA.debugLineNum = 18743297;BA.debugLine="LogColor($\"**** **** Revisamos FLP - ${fechaKMT(D";
anywheresoftware.b4a.keywords.Common.LogImpl("818743297",("**** **** 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=18743298;
 //BA.debugLineNum = 18743298;BA.debugLine="Private todoBienFLP As Boolean = True";
_todobienflp = anywheresoftware.b4a.keywords.Common.True;
RDebugUtils.currentLine=18743299;
 //BA.debugLineNum = 18743299;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=18743300;
 //BA.debugLineNum = 18743300;BA.debugLine="log2DB(\"revisaFLP: No esta inicializado ... 'Rei";
_log2db(_ba,"revisaFLP: No esta inicializado ... 'Reinicializando FLP'");
RDebugUtils.currentLine=18743301;
 //BA.debugLineNum = 18743301;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=18743302;
 //BA.debugLineNum = 18743302;BA.debugLine="todoBienFLP = False";
_todobienflp = anywheresoftware.b4a.keywords.Common.False;
 };
RDebugUtils.currentLine=18743304;
 //BA.debugLineNum = 18743304;BA.debugLine="If Tracker.FLP.IsInitialized Then";
if (mostCurrent._tracker._flp /*uk.co.martinpearman.b4a.fusedlocationprovider.FusedLocationProviderWrapper*/ .IsInitialized()) { 
RDebugUtils.currentLine=18743305;
 //BA.debugLineNum = 18743305;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=18743306;
 //BA.debugLineNum = 18743306;BA.debugLine="log2DB(\"revisaFLP: No esta conectado ... 'Recon";
_log2db(_ba,"revisaFLP: No esta conectado ... 'Reconectando FLP'");
RDebugUtils.currentLine=18743308;
 //BA.debugLineNum = 18743308;BA.debugLine="CallSubDelayed(Tracker,\"StartFLP\")";
anywheresoftware.b4a.keywords.Common.CallSubDelayed((_ba.processBA == null ? _ba : _ba.processBA),(Object)(mostCurrent._tracker.getObject()),"StartFLP");
RDebugUtils.currentLine=18743309;
 //BA.debugLineNum = 18743309;BA.debugLine="todoBienFLP = False";
_todobienflp = anywheresoftware.b4a.keywords.Common.False;
 };
RDebugUtils.currentLine=18743311;
 //BA.debugLineNum = 18743311;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=18743314;
 //BA.debugLineNum = 18743314;BA.debugLine="log2DB(\"revisaFLP: 'No se esta actualizando, lo";
_log2db(_ba,"revisaFLP: 'No se esta actualizando, lo reiniciamos ...'");
RDebugUtils.currentLine=18743315;
 //BA.debugLineNum = 18743315;BA.debugLine="StartService(Tracker)";
anywheresoftware.b4a.keywords.Common.StartService((_ba.processBA == null ? _ba : _ba.processBA),(Object)(mostCurrent._tracker.getObject()));
RDebugUtils.currentLine=18743316;
 //BA.debugLineNum = 18743316;BA.debugLine="todoBienFLP = False";
_todobienflp = anywheresoftware.b4a.keywords.Common.False;
 };
 };
RDebugUtils.currentLine=18743319;
 //BA.debugLineNum = 18743319;BA.debugLine="If todoBienFLP Then LogColor(\" +++ +++ Sin errore";
if (_todobienflp) { 
anywheresoftware.b4a.keywords.Common.LogImpl("818743319"," +++ +++ Sin errores en FLP",anywheresoftware.b4a.keywords.Common.Colors.Green);};
RDebugUtils.currentLine=18743321;
 //BA.debugLineNum = 18743321;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=18808832;
 //BA.debugLineNum = 18808832;BA.debugLine="Sub revisaPushService 'ignore";
RDebugUtils.currentLine=18808870;
 //BA.debugLineNum = 18808870;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=18677760;
 //BA.debugLineNum = 18677760;BA.debugLine="Sub revisaUUG 'ignore";
RDebugUtils.currentLine=18677761;
 //BA.debugLineNum = 18677761;BA.debugLine="revisaFLP";
_revisaflp(_ba);
RDebugUtils.currentLine=18677762;
 //BA.debugLineNum = 18677762;BA.debugLine="If Tracker.FLP.GetLastKnownLocation.IsInitialized";
if (mostCurrent._tracker._flp /*uk.co.martinpearman.b4a.fusedlocationprovider.FusedLocationProviderWrapper*/ .GetLastKnownLocation().IsInitialized()) { 
RDebugUtils.currentLine=18677763;
 //BA.debugLineNum = 18677763;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=18677764;
 //BA.debugLineNum = 18677764;BA.debugLine="If B4XPages.MainPage.Logger Then LogColor($\"****";
if (mostCurrent._b4xpages._mainpage /*reparto_izca.keymon.lat.b4xmainpage*/ (_ba)._logger /*boolean*/ ) { 
anywheresoftware.b4a.keywords.Common.LogImpl("818677764",("**** 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=18677765;
 //BA.debugLineNum = 18677765;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=18677766;
 //BA.debugLineNum = 18677766;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=18677767;
 //BA.debugLineNum = 18677767;BA.debugLine="If B4XPages.MainPage.Logger Then Log(\"++++ Dist";
if (mostCurrent._b4xpages._mainpage /*reparto_izca.keymon.lat.b4xmainpage*/ (_ba)._logger /*boolean*/ ) { 
anywheresoftware.b4a.keywords.Common.LogImpl("818677767","++++ Distancia a anterior="+BA.NumberToString(_daa)+"|"+"Precision="+BA.NumberToString(mostCurrent._tracker._flp /*uk.co.martinpearman.b4a.fusedlocationprovider.FusedLocationProviderWrapper*/ .GetLastKnownLocation().getAccuracy()),0);};
 };
RDebugUtils.currentLine=18677769;
 //BA.debugLineNum = 18677769;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=18677771;
 //BA.debugLineNum = 18677771;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=20381696;
 //BA.debugLineNum = 20381696;BA.debugLine="Sub traeCantidadRechazada(cliente As String, prodI";
RDebugUtils.currentLine=20381697;
 //BA.debugLineNum = 20381697;BA.debugLine="Private cant As Int = 0";
_cant = (int) (0);
RDebugUtils.currentLine=20381698;
 //BA.debugLineNum = 20381698;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=20381699;
 //BA.debugLineNum = 20381699;BA.debugLine="If cr.RowCount > 0 Then";
if (_cr.getRowCount()>0) { 
RDebugUtils.currentLine=20381700;
 //BA.debugLineNum = 20381700;BA.debugLine="cr.Position = 0";
_cr.setPosition((int) (0));
RDebugUtils.currentLine=20381701;
 //BA.debugLineNum = 20381701;BA.debugLine="cant = cr.GetString(\"REP_CANT\")";
_cant = (int)(Double.parseDouble(_cr.GetString("REP_CANT")));
 };
RDebugUtils.currentLine=20381703;
 //BA.debugLineNum = 20381703;BA.debugLine="Log($\"${cliente}, ${prodId}, rowcont:${cr.RowCoun";
anywheresoftware.b4a.keywords.Common.LogImpl("820381703",(""+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=20381704;
 //BA.debugLineNum = 20381704;BA.debugLine="Return cant";
if (true) return _cant;
RDebugUtils.currentLine=20381705;
 //BA.debugLineNum = 20381705;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=20447232;
 //BA.debugLineNum = 20447232;BA.debugLine="Sub traeCantidadVendida(cliente As String, prodId";
RDebugUtils.currentLine=20447233;
 //BA.debugLineNum = 20447233;BA.debugLine="Private cant As Int = 0";
_cant = (int) (0);
RDebugUtils.currentLine=20447234;
 //BA.debugLineNum = 20447234;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=20447236;
 //BA.debugLineNum = 20447236;BA.debugLine="If cr.RowCount > 0 Then";
if (_cr.getRowCount()>0) { 
RDebugUtils.currentLine=20447237;
 //BA.debugLineNum = 20447237;BA.debugLine="cr.Position = 0";
_cr.setPosition((int) (0));
RDebugUtils.currentLine=20447238;
 //BA.debugLineNum = 20447238;BA.debugLine="cant = cr.GetString(\"REP_CANT\")";
_cant = (int)(Double.parseDouble(_cr.GetString("REP_CANT")));
 };
RDebugUtils.currentLine=20447240;
 //BA.debugLineNum = 20447240;BA.debugLine="Return cant";
if (true) return _cant;
RDebugUtils.currentLine=20447241;
 //BA.debugLineNum = 20447241;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=20250624;
 //BA.debugLineNum = 20250624;BA.debugLine="Sub traeFechaReparto As String";
RDebugUtils.currentLine=20250625;
 //BA.debugLineNum = 20250625;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=20250626;
 //BA.debugLineNum = 20250626;BA.debugLine="Private f As String = \"-\"";
_f = "-";
RDebugUtils.currentLine=20250627;
 //BA.debugLineNum = 20250627;BA.debugLine="If fe.RowCount > 0 Then";
if (_fe.getRowCount()>0) { 
RDebugUtils.currentLine=20250628;
 //BA.debugLineNum = 20250628;BA.debugLine="fe.Position = 0";
_fe.setPosition((int) (0));
RDebugUtils.currentLine=20250629;
 //BA.debugLineNum = 20250629;BA.debugLine="f = fe.GetString(\"HVD_FECHA\")";
_f = _fe.GetString("HVD_FECHA");
 };
RDebugUtils.currentLine=20250631;
 //BA.debugLineNum = 20250631;BA.debugLine="fe.Close";
_fe.Close();
RDebugUtils.currentLine=20250632;
 //BA.debugLineNum = 20250632;BA.debugLine="Return f";
if (true) return _f;
RDebugUtils.currentLine=20250633;
 //BA.debugLineNum = 20250633;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=20512768;
 //BA.debugLineNum = 20512768;BA.debugLine="Sub traeMaxCantidad(cliente As String, prodId As S";
RDebugUtils.currentLine=20512769;
 //BA.debugLineNum = 20512769;BA.debugLine="Private cant As Int = 0";
_cant = (int) (0);
RDebugUtils.currentLine=20512770;
 //BA.debugLineNum = 20512770;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=20512772;
 //BA.debugLineNum = 20512772;BA.debugLine="If cr.RowCount > 0 Then";
if (_cr.getRowCount()>0) { 
RDebugUtils.currentLine=20512773;
 //BA.debugLineNum = 20512773;BA.debugLine="cr.Position = 0";
_cr.setPosition((int) (0));
RDebugUtils.currentLine=20512774;
 //BA.debugLineNum = 20512774;BA.debugLine="cant = cr.GetString(\"HVD_CANT\")";
_cant = (int)(Double.parseDouble(_cr.GetString("HVD_CANT")));
 };
RDebugUtils.currentLine=20512776;
 //BA.debugLineNum = 20512776;BA.debugLine="Return cant";
if (true) return _cant;
RDebugUtils.currentLine=20512777;
 //BA.debugLineNum = 20512777;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=20709376;
 //BA.debugLineNum = 20709376;BA.debugLine="Sub traemosCantYMonto(clv As CustomListView) As Ma";
RDebugUtils.currentLine=20709378;
 //BA.debugLineNum = 20709378;BA.debugLine="Private cant As Int = 0";
_cant = (int) (0);
RDebugUtils.currentLine=20709379;
 //BA.debugLineNum = 20709379;BA.debugLine="Private monto As Float = 0";
_monto = (float) (0);
RDebugUtils.currentLine=20709380;
 //BA.debugLineNum = 20709380;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=20709381;
 //BA.debugLineNum = 20709381;BA.debugLine="Private p0 As B4XView = clv.GetPanel(i)";
_p0 = new anywheresoftware.b4a.objects.B4XViewWrapper();
_p0 = _clv._getpanel(_i);
RDebugUtils.currentLine=20709382;
 //BA.debugLineNum = 20709382;BA.debugLine="Private p As B4XView = p0.GetView(0)";
_p = new anywheresoftware.b4a.objects.B4XViewWrapper();
_p = _p0.GetView((int) (0));
RDebugUtils.currentLine=20709383;
 //BA.debugLineNum = 20709383;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=20709384;
 //BA.debugLineNum = 20709384;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=20709386;
 //BA.debugLineNum = 20709386;BA.debugLine="If cant1.text <> \"\" Then";
if ((_cant1.getText()).equals("") == false) { 
RDebugUtils.currentLine=20709387;
 //BA.debugLineNum = 20709387;BA.debugLine="If cant1.Text = \"\" Then cant1.Text = 0";
if ((_cant1.getText()).equals("")) { 
_cant1.setText(BA.ObjectToCharSequence(0));};
RDebugUtils.currentLine=20709388;
 //BA.debugLineNum = 20709388;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=20709390;
 //BA.debugLineNum = 20709390;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=20709391;
 //BA.debugLineNum = 20709391;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=20709393;
 //BA.debugLineNum = 20709393;BA.debugLine="If cant2.Text = \"\" Then cant2.Text = 0";
if ((_cant2.getText()).equals("")) { 
_cant2.setText(BA.ObjectToCharSequence(0));};
RDebugUtils.currentLine=20709394;
 //BA.debugLineNum = 20709394;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=20709396;
 //BA.debugLineNum = 20709396;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=20709397;
 //BA.debugLineNum = 20709397;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=20709401;
 //BA.debugLineNum = 20709401;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=20709402;
 //BA.debugLineNum = 20709402;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=19857408;
 //BA.debugLineNum = 19857408;BA.debugLine="Sub traeNombre(id As String) As String";
RDebugUtils.currentLine=19857409;
 //BA.debugLineNum = 19857409;BA.debugLine="Private nombre As String";
_nombre = "";
RDebugUtils.currentLine=19857410;
 //BA.debugLineNum = 19857410;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=19857411;
 //BA.debugLineNum = 19857411;BA.debugLine="idc.Position=0";
_idc.setPosition((int) (0));
RDebugUtils.currentLine=19857412;
 //BA.debugLineNum = 19857412;BA.debugLine="If idc.RowCount > 0 Then nombre = idc.GetString(\"";
if (_idc.getRowCount()>0) { 
_nombre = _idc.GetString("HVD_PRONOMBRE");};
RDebugUtils.currentLine=19857413;
 //BA.debugLineNum = 19857413;BA.debugLine="idc.Close";
_idc.Close();
RDebugUtils.currentLine=19857415;
 //BA.debugLineNum = 19857415;BA.debugLine="Return nombre";
if (true) return _nombre;
RDebugUtils.currentLine=19857416;
 //BA.debugLineNum = 19857416;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=21364736;
 //BA.debugLineNum = 21364736;BA.debugLine="Sub traerUTAPREV As String 'ignore";
RDebugUtils.currentLine=21364737;
 //BA.debugLineNum = 21364737;BA.debugLine="Private c As Cursor";
_c = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
RDebugUtils.currentLine=21364738;
 //BA.debugLineNum = 21364738;BA.debugLine="Private a As String";
_a = "";
RDebugUtils.currentLine=21364739;
 //BA.debugLineNum = 21364739;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=21364740;
 //BA.debugLineNum = 21364740;BA.debugLine="c.Position = 0";
_c.setPosition((int) (0));
RDebugUtils.currentLine=21364741;
 //BA.debugLineNum = 21364741;BA.debugLine="a = C.GetString(\"CAT_CL_RUTA\")";
_a = _c.GetString("CAT_CL_RUTA");
RDebugUtils.currentLine=21364742;
 //BA.debugLineNum = 21364742;BA.debugLine="c.Close";
_c.Close();
RDebugUtils.currentLine=21364743;
 //BA.debugLineNum = 21364743;BA.debugLine="Return a";
if (true) return _a;
RDebugUtils.currentLine=21364744;
 //BA.debugLineNum = 21364744;BA.debugLine="End Sub";
return "";
}
}