package keymon.lat.medicomed;

import anywheresoftware.b4a.BA;
import anywheresoftware.b4a.pc.*;

public class subs_subs_0 {


public static RemoteObject  _actualizaproducto(RemoteObject _ba,RemoteObject _cedis,RemoteObject _costou,RemoteObject _cant,RemoteObject _nombre,RemoteObject _prodid,RemoteObject _clienteid,RemoteObject _fecha,RemoteObject _usuario,RemoteObject _rutav,RemoteObject _preciosin,RemoteObject _tipoventa) throws Exception{
try {
		Debug.PushSubsStack("actualizaProducto (subs) ","subs",9,_ba,subs.mostCurrent,791);
if (RapidSub.canDelegate("actualizaproducto")) { return keymon.lat.medicomed.subs.remoteMe.runUserSub(false, "subs","actualizaproducto", _ba, _cedis, _costou, _cant, _nombre, _prodid, _clienteid, _fecha, _usuario, _rutav, _preciosin, _tipoventa);}
RemoteObject _c = RemoteObject.declareNull("anywheresoftware.b4a.sql.SQL.CursorWrapper");
RemoteObject _antcant = RemoteObject.createImmutable(0);
RemoteObject _difcant = RemoteObject.createImmutable(0);
RemoteObject _pe = RemoteObject.declareNull("anywheresoftware.b4a.sql.SQL.CursorWrapper");
;
Debug.locals.put("cedis", _cedis);
Debug.locals.put("costoU", _costou);
Debug.locals.put("cant", _cant);
Debug.locals.put("nombre", _nombre);
Debug.locals.put("prodId", _prodid);
Debug.locals.put("clienteId", _clienteid);
Debug.locals.put("fecha", _fecha);
Debug.locals.put("usuario", _usuario);
Debug.locals.put("rutaV", _rutav);
Debug.locals.put("precioSin", _preciosin);
Debug.locals.put("tipoVenta", _tipoventa);
 BA.debugLineNum = 791;BA.debugLine="Sub actualizaProducto(cedis As String, costoU As S";
Debug.ShouldStop(4194304);
 BA.debugLineNum = 792;BA.debugLine="Private c As Cursor=B4XPages.MainPage.skmt.ExecQu";
Debug.ShouldStop(8388608);
_c = RemoteObject.createNew ("anywheresoftware.b4a.sql.SQL.CursorWrapper");
_c = RemoteObject.declareNull("anywheresoftware.b4a.AbsObjectWrapper").runMethod(false, "ConvertToWrapper", RemoteObject.createNew("anywheresoftware.b4a.sql.SQL.CursorWrapper"), subs.mostCurrent._b4xpages.runMethod(false,"_mainpage" /*RemoteObject*/ ,_ba).getField(false,"_skmt" /*RemoteObject*/ ).runMethod(false,"ExecQuery",(Object)((RemoteObject.concat(RemoteObject.createImmutable("select * from pedido where pe_cedis = '"),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_cedis))),RemoteObject.createImmutable("' and pe_proid = '"),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_prodid))),RemoteObject.createImmutable("' and pe_cliente = '"),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_clienteid))),RemoteObject.createImmutable("'"))))));Debug.locals.put("c", _c);Debug.locals.put("c", _c);
 BA.debugLineNum = 793;BA.debugLine="If c.RowCount > 0 Then";
Debug.ShouldStop(16777216);
if (RemoteObject.solveBoolean(">",_c.runMethod(true,"getRowCount"),BA.numberCast(double.class, 0))) { 
 BA.debugLineNum = 794;BA.debugLine="c.Position=0";
Debug.ShouldStop(33554432);
_c.runMethod(true,"setPosition",BA.numberCast(int.class, 0));
 BA.debugLineNum = 795;BA.debugLine="Private antCant As Int = 0";
Debug.ShouldStop(67108864);
_antcant = BA.numberCast(int.class, 0);Debug.locals.put("antCant", _antcant);Debug.locals.put("antCant", _antcant);
 BA.debugLineNum = 796;BA.debugLine="If IsNumber(c.GetInt(\"PE_CANT\")) Then antCant=c.";
Debug.ShouldStop(134217728);
if (subs.mostCurrent.__c.runMethod(true,"IsNumber",(Object)(BA.NumberToString(_c.runMethod(true,"GetInt",(Object)(RemoteObject.createImmutable("PE_CANT")))))).<Boolean>get().booleanValue()) { 
_antcant = _c.runMethod(true,"GetInt",(Object)(RemoteObject.createImmutable("PE_CANT")));Debug.locals.put("antCant", _antcant);};
 BA.debugLineNum = 797;BA.debugLine="Private difCant As Int = cant - antCant";
Debug.ShouldStop(268435456);
_difcant = BA.numberCast(int.class, RemoteObject.solve(new RemoteObject[] {BA.numberCast(double.class, _cant),_antcant}, "-",1, 0));Debug.locals.put("difCant", _difcant);Debug.locals.put("difCant", _difcant);
 BA.debugLineNum = 798;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery($\"update ped";
Debug.ShouldStop(536870912);
subs.mostCurrent._b4xpages.runMethod(false,"_mainpage" /*RemoteObject*/ ,_ba).getField(false,"_skmt" /*RemoteObject*/ ).runVoidMethod ("ExecNonQuery",(Object)((RemoteObject.concat(RemoteObject.createImmutable("update pedido set pe_cant = "),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_cant))),RemoteObject.createImmutable(", pe_costo_tot = "),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)(((RemoteObject.solve(new RemoteObject[] {BA.numberCast(double.class, _cant),BA.numberCast(double.class, _c.runMethod(true,"GetString",(Object)(RemoteObject.createImmutable("PE_COSTOU"))))}, "*",0, 0))))),RemoteObject.createImmutable(" where pe_cedis = '"),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_cedis))),RemoteObject.createImmutable("' and pe_proid = '"),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_prodid))),RemoteObject.createImmutable("' and pe_cliente = '"),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_clienteid))),RemoteObject.createImmutable("' ")))));
 BA.debugLineNum = 799;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery($\"update cat";
Debug.ShouldStop(1073741824);
subs.mostCurrent._b4xpages.runMethod(false,"_mainpage" /*RemoteObject*/ ,_ba).getField(false,"_skmt" /*RemoteObject*/ ).runVoidMethod ("ExecNonQuery",(Object)((RemoteObject.concat(RemoteObject.createImmutable("update cat_gunaprod set cat_gp_almacen = cat_gp_almacen - ("),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_difcant))),RemoteObject.createImmutable(") where cat_gp_id = '"),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_prodid))),RemoteObject.createImmutable("' ")))));
 BA.debugLineNum = 800;BA.debugLine="If cant = 0 Then";
Debug.ShouldStop(-2147483648);
if (RemoteObject.solveBoolean("=",_cant,BA.NumberToString(0))) { 
 BA.debugLineNum = 802;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery($\"delete fr";
Debug.ShouldStop(2);
subs.mostCurrent._b4xpages.runMethod(false,"_mainpage" /*RemoteObject*/ ,_ba).getField(false,"_skmt" /*RemoteObject*/ ).runVoidMethod ("ExecNonQuery",(Object)((RemoteObject.concat(RemoteObject.createImmutable("delete from pedido where pe_cedis = '"),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_cedis))),RemoteObject.createImmutable("' and pe_proid = '"),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_prodid))),RemoteObject.createImmutable("' and pe_cliente = '"),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_clienteid))),RemoteObject.createImmutable("' ")))));
 BA.debugLineNum = 803;BA.debugLine="Private pe As Cursor = B4XPages.MainPage.skmt.E";
Debug.ShouldStop(4);
_pe = RemoteObject.createNew ("anywheresoftware.b4a.sql.SQL.CursorWrapper");
_pe = RemoteObject.declareNull("anywheresoftware.b4a.AbsObjectWrapper").runMethod(false, "ConvertToWrapper", RemoteObject.createNew("anywheresoftware.b4a.sql.SQL.CursorWrapper"), subs.mostCurrent._b4xpages.runMethod(false,"_mainpage" /*RemoteObject*/ ,_ba).getField(false,"_skmt" /*RemoteObject*/ ).runMethod(false,"ExecQuery",(Object)(RemoteObject.createImmutable("select count(pe_cliente) as cuantosPedidos from pedido where pe_cliente In (select cuenta from cuentaa)"))));Debug.locals.put("pe", _pe);Debug.locals.put("pe", _pe);
 BA.debugLineNum = 804;BA.debugLine="pe.Position=0";
Debug.ShouldStop(8);
_pe.runMethod(true,"setPosition",BA.numberCast(int.class, 0));
 BA.debugLineNum = 805;BA.debugLine="If pe.GetString(\"cuantosPedidos\") = 0 Then B4XP";
Debug.ShouldStop(16);
if (RemoteObject.solveBoolean("=",_pe.runMethod(true,"GetString",(Object)(RemoteObject.createImmutable("cuantosPedidos"))),BA.NumberToString(0))) { 
subs.mostCurrent._b4xpages.runMethod(false,"_mainpage" /*RemoteObject*/ ,_ba).getField(false,"_skmt" /*RemoteObject*/ ).runVoidMethod ("ExecNonQuery",(Object)(RemoteObject.createImmutable("delete from pedido_cliente where PC_CLIENTE In (select cuenta from cuentaa)")));};
 };
 }else {
 BA.debugLineNum = 809;BA.debugLine="guardaProductoSinGestion(cedis, costoU, cant, no";
Debug.ShouldStop(256);
_guardaproductosingestion(_ba,_cedis,_costou,_cant,_nombre,_prodid,_clienteid,_fecha,_usuario,_rutav,_preciosin,_tipoventa);
 };
 BA.debugLineNum = 811;BA.debugLine="c.Close";
Debug.ShouldStop(1024);
_c.runVoidMethod ("Close");
 BA.debugLineNum = 812;BA.debugLine="End Sub";
Debug.ShouldStop(2048);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _actualizatet(RemoteObject _ba,RemoteObject _cliente) throws Exception{
try {
		Debug.PushSubsStack("actualizaTET (subs) ","subs",9,_ba,subs.mostCurrent,1208);
if (RapidSub.canDelegate("actualizatet")) { return keymon.lat.medicomed.subs.remoteMe.runUserSub(false, "subs","actualizatet", _ba, _cliente);}
RemoteObject _c = RemoteObject.declareNull("anywheresoftware.b4a.sql.SQL.CursorWrapper");
RemoteObject _total = RemoteObject.createImmutable(0L);
int _i = 0;
RemoteObject _subtotal = RemoteObject.createImmutable(0L);
;
Debug.locals.put("cliente", _cliente);
 BA.debugLineNum = 1208;BA.debugLine="Sub actualizaTET(cliente As String)";
Debug.ShouldStop(8388608);
 BA.debugLineNum = 1209;BA.debugLine="Dim c As Cursor = B4XPages.MainPage.skmt.Execquer";
Debug.ShouldStop(16777216);
_c = RemoteObject.createNew ("anywheresoftware.b4a.sql.SQL.CursorWrapper");
_c = RemoteObject.declareNull("anywheresoftware.b4a.AbsObjectWrapper").runMethod(false, "ConvertToWrapper", RemoteObject.createNew("anywheresoftware.b4a.sql.SQL.CursorWrapper"), subs.mostCurrent._b4xpages.runMethod(false,"_mainpage" /*RemoteObject*/ ,_ba).getField(false,"_skmt" /*RemoteObject*/ ).runMethod(false,"ExecQuery2",(Object)(BA.ObjectToString("select * from PEDIDO_INICIO_FINAL where PIF_CLIENTE = ?")),(Object)(RemoteObject.createNewArray("String",new int[] {1},new Object[] {_cliente}))));Debug.locals.put("c", _c);Debug.locals.put("c", _c);
 BA.debugLineNum = 1210;BA.debugLine="Dim total As Long = 0";
Debug.ShouldStop(33554432);
_total = BA.numberCast(long.class, 0);Debug.locals.put("total", _total);Debug.locals.put("total", _total);
 BA.debugLineNum = 1211;BA.debugLine="If c.RowCount > 0 Then";
Debug.ShouldStop(67108864);
if (RemoteObject.solveBoolean(">",_c.runMethod(true,"getRowCount"),BA.numberCast(double.class, 0))) { 
 BA.debugLineNum = 1212;BA.debugLine="c.Position=0";
Debug.ShouldStop(134217728);
_c.runMethod(true,"setPosition",BA.numberCast(int.class, 0));
 BA.debugLineNum = 1213;BA.debugLine="For i = 0 To c.RowCount-1";
Debug.ShouldStop(268435456);
{
final int step5 = 1;
final int limit5 = RemoteObject.solve(new RemoteObject[] {_c.runMethod(true,"getRowCount"),RemoteObject.createImmutable(1)}, "-",1, 1).<Integer>get().intValue();
_i = 0 ;
for (;(step5 > 0 && _i <= limit5) || (step5 < 0 && _i >= limit5) ;_i = ((int)(0 + _i + step5))  ) {
Debug.locals.put("i", _i);
 BA.debugLineNum = 1214;BA.debugLine="c.Position=i";
Debug.ShouldStop(536870912);
_c.runMethod(true,"setPosition",BA.numberCast(int.class, _i));
 BA.debugLineNum = 1216;BA.debugLine="Dim subtotal As Long = c.GetString(\"PIF_HORA_FI";
Debug.ShouldStop(-2147483648);
_subtotal = BA.numberCast(long.class, RemoteObject.solve(new RemoteObject[] {BA.numberCast(double.class, _c.runMethod(true,"GetString",(Object)(RemoteObject.createImmutable("PIF_HORA_FINAL")))),BA.numberCast(double.class, _c.runMethod(true,"GetString",(Object)(RemoteObject.createImmutable("PIF_HORA_INICIO"))))}, "-",1, 0));Debug.locals.put("subtotal", _subtotal);Debug.locals.put("subtotal", _subtotal);
 BA.debugLineNum = 1217;BA.debugLine="total = total + subtotal";
Debug.ShouldStop(1);
_total = RemoteObject.solve(new RemoteObject[] {_total,_subtotal}, "+",1, 2);Debug.locals.put("total", _total);
 }
}Debug.locals.put("i", _i);
;
 BA.debugLineNum = 1221;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"update PED";
Debug.ShouldStop(16);
subs.mostCurrent._b4xpages.runMethod(false,"_mainpage" /*RemoteObject*/ ,_ba).getField(false,"_skmt" /*RemoteObject*/ ).runVoidMethod ("ExecNonQuery2",(Object)(BA.ObjectToString("update PEDIDO_CLIENTE set PC_TIEMPO_TIENDA = ? where PC_CLIENTE = ?")),(Object)(subs.mostCurrent.__c.runMethod(false, "ArrayToList", (Object)(RemoteObject.createNewArray("String",new int[] {2},new Object[] {BA.NumberToString((RemoteObject.solve(new RemoteObject[] {(RemoteObject.solve(new RemoteObject[] {_total,RemoteObject.createImmutable(1000)}, "/",0, 0)),RemoteObject.createImmutable(60)}, "/",0, 0))),_cliente})))));
 };
 BA.debugLineNum = 1223;BA.debugLine="End Sub";
Debug.ShouldStop(64);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _agregacolumna(RemoteObject _ba,RemoteObject _tabla,RemoteObject _columna,RemoteObject _tipo) throws Exception{
try {
		Debug.PushSubsStack("agregaColumna (subs) ","subs",9,_ba,subs.mostCurrent,1422);
if (RapidSub.canDelegate("agregacolumna")) { return keymon.lat.medicomed.subs.remoteMe.runUserSub(false, "subs","agregacolumna", _ba, _tabla, _columna, _tipo);}
RemoteObject _c = RemoteObject.declareNull("anywheresoftware.b4a.sql.SQL.CursorWrapper");
;
Debug.locals.put("tabla", _tabla);
Debug.locals.put("columna", _columna);
Debug.locals.put("tipo", _tipo);
 BA.debugLineNum = 1422;BA.debugLine="Sub agregaColumna(tabla As String, columna As Stri";
Debug.ShouldStop(8192);
 BA.debugLineNum = 1423;BA.debugLine="Try 'Intentamos usar \"pragma_table_info\" para rev";
Debug.ShouldStop(16384);
try { BA.debugLineNum = 1424;BA.debugLine="Private c As Cursor = B4XPages.MainPage.skmt.Exe";
Debug.ShouldStop(32768);
_c = RemoteObject.createNew ("anywheresoftware.b4a.sql.SQL.CursorWrapper");
_c = RemoteObject.declareNull("anywheresoftware.b4a.AbsObjectWrapper").runMethod(false, "ConvertToWrapper", RemoteObject.createNew("anywheresoftware.b4a.sql.SQL.CursorWrapper"), subs.mostCurrent._b4xpages.runMethod(false,"_mainpage" /*RemoteObject*/ ,_ba).getField(false,"_skmt" /*RemoteObject*/ ).runMethod(false,"ExecQuery",(Object)((RemoteObject.concat(RemoteObject.createImmutable("SELECT COUNT(*) AS fCol FROM pragma_table_info('"),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_tabla))),RemoteObject.createImmutable("') WHERE name='"),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_columna))),RemoteObject.createImmutable("'"))))));Debug.locals.put("c", _c);Debug.locals.put("c", _c);
 BA.debugLineNum = 1425;BA.debugLine="c.Position = 0";
Debug.ShouldStop(65536);
_c.runMethod(true,"setPosition",BA.numberCast(int.class, 0));
 BA.debugLineNum = 1426;BA.debugLine="If c.GetString(\"fCol\") = 0 Then 'Si no esta la c";
Debug.ShouldStop(131072);
if (RemoteObject.solveBoolean("=",_c.runMethod(true,"GetString",(Object)(RemoteObject.createImmutable("fCol"))),BA.NumberToString(0))) { 
 BA.debugLineNum = 1427;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery($\"ALTER TAB";
Debug.ShouldStop(262144);
subs.mostCurrent._b4xpages.runMethod(false,"_mainpage" /*RemoteObject*/ ,_ba).getField(false,"_skmt" /*RemoteObject*/ ).runVoidMethod ("ExecNonQuery",(Object)((RemoteObject.concat(RemoteObject.createImmutable("ALTER TABLE "),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_tabla))),RemoteObject.createImmutable(" ADD COLUMN "),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_columna))),RemoteObject.createImmutable(" "),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_tipo))),RemoteObject.createImmutable("")))));
 BA.debugLineNum = 1428;BA.debugLine="Log($\"Columna \"${columna} ${tipo}\", agregada a";
Debug.ShouldStop(524288);
subs.mostCurrent.__c.runVoidMethod ("LogImpl","315269894",(RemoteObject.concat(RemoteObject.createImmutable("Columna \""),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_columna))),RemoteObject.createImmutable(" "),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_tipo))),RemoteObject.createImmutable("\", agregada a \""),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_tabla))),RemoteObject.createImmutable("\"."))),0);
 };
 BA.debugLineNum = 1430;BA.debugLine="Log(1)";
Debug.ShouldStop(2097152);
subs.mostCurrent.__c.runVoidMethod ("LogImpl","315269896",BA.NumberToString(1),0);
 Debug.CheckDeviceExceptions();
} 
       catch (Exception e10) {
			BA.rdebugUtils.runVoidMethod("setLastException",BA.rdebugUtils.runMethod(false, "processBAFromBA", _ba), e10.toString()); BA.debugLineNum = 1432;BA.debugLine="Try";
Debug.ShouldStop(8388608);
try { BA.debugLineNum = 1433;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery($\"ALTER TAB";
Debug.ShouldStop(16777216);
subs.mostCurrent._b4xpages.runMethod(false,"_mainpage" /*RemoteObject*/ ,_ba).getField(false,"_skmt" /*RemoteObject*/ ).runVoidMethod ("ExecNonQuery",(Object)((RemoteObject.concat(RemoteObject.createImmutable("ALTER TABLE "),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_tabla))),RemoteObject.createImmutable(" ADD COLUMN "),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_columna))),RemoteObject.createImmutable(" "),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_tipo))),RemoteObject.createImmutable("")))));
 BA.debugLineNum = 1434;BA.debugLine="Log($\"Columna \"${columna} ${tipo}\", agregada a";
Debug.ShouldStop(33554432);
subs.mostCurrent.__c.runVoidMethod ("LogImpl","315269900",(RemoteObject.concat(RemoteObject.createImmutable("Columna \""),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_columna))),RemoteObject.createImmutable(" "),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_tipo))),RemoteObject.createImmutable("\", agregada a \""),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_tabla))),RemoteObject.createImmutable("\".."))),0);
 Debug.CheckDeviceExceptions();
} 
       catch (Exception e14) {
			BA.rdebugUtils.runVoidMethod("setLastException",BA.rdebugUtils.runMethod(false, "processBAFromBA", _ba), e14.toString()); BA.debugLineNum = 1436;BA.debugLine="Log(LastException)";
Debug.ShouldStop(134217728);
subs.mostCurrent.__c.runVoidMethod ("LogImpl","315269902",BA.ObjectToString(subs.mostCurrent.__c.runMethod(false,"LastException",_ba)),0);
 };
 BA.debugLineNum = 1438;BA.debugLine="Log(2)";
Debug.ShouldStop(536870912);
subs.mostCurrent.__c.runVoidMethod ("LogImpl","315269904",BA.NumberToString(2),0);
 };
 BA.debugLineNum = 1440;BA.debugLine="End Sub";
Debug.ShouldStop(-2147483648);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _alcanzanlosvariablesparapromo(RemoteObject _ba,RemoteObject _promomap,RemoteObject _inventariosinfijos) throws Exception{
try {
		Debug.PushSubsStack("alcanzanLosVariablesParaPromo (subs) ","subs",9,_ba,subs.mostCurrent,943);
if (RapidSub.canDelegate("alcanzanlosvariablesparapromo")) { return keymon.lat.medicomed.subs.remoteMe.runUserSub(false, "subs","alcanzanlosvariablesparapromo", _ba, _promomap, _inventariosinfijos);}
RemoteObject _thislog = RemoteObject.createImmutable(false);
RemoteObject _totalprodsvariables = RemoteObject.createImmutable(0);
RemoteObject _prodsvariables = RemoteObject.declareNull("anywheresoftware.b4a.objects.collections.List");
int _p = 0;
RemoteObject _t = RemoteObject.createImmutable("");
RemoteObject _p2 = RemoteObject.createImmutable("");
RemoteObject _res = RemoteObject.createImmutable(false);
;
Debug.locals.put("promoMap", _promomap);
Debug.locals.put("inventarioSinFijos", _inventariosinfijos);
 BA.debugLineNum = 943;BA.debugLine="Sub alcanzanLosVariablesParaPromo(promoMap As Map,";
Debug.ShouldStop(16384);
 BA.debugLineNum = 944;BA.debugLine="Private thisLog As Boolean = False 'Si es verdade";
Debug.ShouldStop(32768);
_thislog = subs.mostCurrent.__c.getField(true,"False");Debug.locals.put("thisLog", _thislog);Debug.locals.put("thisLog", _thislog);
 BA.debugLineNum = 945;BA.debugLine="If thisLog Then LogColor(\"Inventario inicial: \"&i";
Debug.ShouldStop(65536);
if (_thislog.<Boolean>get().booleanValue()) { 
subs.mostCurrent.__c.runVoidMethod ("LogImpl","313893634",RemoteObject.concat(RemoteObject.createImmutable("Inventario inicial: "),_inventariosinfijos),subs.mostCurrent.__c.getField(false,"Colors").getField(true,"Gray"));};
 BA.debugLineNum = 946;BA.debugLine="Private totalProdsVariables As Int = 0";
Debug.ShouldStop(131072);
_totalprodsvariables = BA.numberCast(int.class, 0);Debug.locals.put("totalProdsVariables", _totalprodsvariables);Debug.locals.put("totalProdsVariables", _totalprodsvariables);
 BA.debugLineNum = 948;BA.debugLine="Private prodsVariables As List = promoMap.get(\"pr";
Debug.ShouldStop(524288);
_prodsvariables = RemoteObject.createNew ("anywheresoftware.b4a.objects.collections.List");
_prodsvariables = RemoteObject.declareNull("anywheresoftware.b4a.AbsObjectWrapper").runMethod(false, "ConvertToWrapper", RemoteObject.createNew("anywheresoftware.b4a.objects.collections.List"), _promomap.runMethod(false,"Get",(Object)((RemoteObject.createImmutable("prodsVariables")))));Debug.locals.put("prodsVariables", _prodsvariables);Debug.locals.put("prodsVariables", _prodsvariables);
 BA.debugLineNum = 949;BA.debugLine="For p = 0 To prodsVariables.Size - 1";
Debug.ShouldStop(1048576);
{
final int step5 = 1;
final int limit5 = RemoteObject.solve(new RemoteObject[] {_prodsvariables.runMethod(true,"getSize"),RemoteObject.createImmutable(1)}, "-",1, 1).<Integer>get().intValue();
_p = 0 ;
for (;(step5 > 0 && _p <= limit5) || (step5 < 0 && _p >= limit5) ;_p = ((int)(0 + _p + step5))  ) {
Debug.locals.put("p", _p);
 BA.debugLineNum = 950;BA.debugLine="Private t As String = prodsVariables.Get(p) 'Obt";
Debug.ShouldStop(2097152);
_t = BA.ObjectToString(_prodsvariables.runMethod(false,"Get",(Object)(BA.numberCast(int.class, _p))));Debug.locals.put("t", _t);Debug.locals.put("t", _t);
 BA.debugLineNum = 951;BA.debugLine="If inventarioSinFijos.ContainsKey(t) Then 'Si ex";
Debug.ShouldStop(4194304);
if (_inventariosinfijos.runMethod(true,"ContainsKey",(Object)((_t))).<Boolean>get().booleanValue()) { 
 BA.debugLineNum = 952;BA.debugLine="Private p2 As String = inventarioSinFijos.Get(t";
Debug.ShouldStop(8388608);
_p2 = BA.ObjectToString(_inventariosinfijos.runMethod(false,"Get",(Object)((_t))));Debug.locals.put("p2", _p2);Debug.locals.put("p2", _p2);
 BA.debugLineNum = 953;BA.debugLine="totalProdsVariables = totalProdsVariables + p2";
Debug.ShouldStop(16777216);
_totalprodsvariables = BA.numberCast(int.class, RemoteObject.solve(new RemoteObject[] {_totalprodsvariables,BA.numberCast(double.class, _p2)}, "+",1, 0));Debug.locals.put("totalProdsVariables", _totalprodsvariables);
 BA.debugLineNum = 954;BA.debugLine="If thisLog Then Log($\"prod ${t}, hay: ${p2}\"$)";
Debug.ShouldStop(33554432);
if (_thislog.<Boolean>get().booleanValue()) { 
subs.mostCurrent.__c.runVoidMethod ("LogImpl","313893643",(RemoteObject.concat(RemoteObject.createImmutable("prod "),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_t))),RemoteObject.createImmutable(", hay: "),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_p2))),RemoteObject.createImmutable(""))),0);};
 };
 }
}Debug.locals.put("p", _p);
;
 BA.debugLineNum = 957;BA.debugLine="If thisLog Then Log(\"Total prods variables=\" & to";
Debug.ShouldStop(268435456);
if (_thislog.<Boolean>get().booleanValue()) { 
subs.mostCurrent.__c.runVoidMethod ("LogImpl","313893646",RemoteObject.concat(RemoteObject.createImmutable("Total prods variables="),_totalprodsvariables,RemoteObject.createImmutable(", requeridos="),_promomap.runMethod(false,"Get",(Object)((RemoteObject.createImmutable("prodsVariablesRequeridos"))))),0);};
 BA.debugLineNum = 958;BA.debugLine="Private res As Boolean = False";
Debug.ShouldStop(536870912);
_res = subs.mostCurrent.__c.getField(true,"False");Debug.locals.put("res", _res);Debug.locals.put("res", _res);
 BA.debugLineNum = 959;BA.debugLine="If totalProdsVariables >= promoMap.Get(\"prodsVari";
Debug.ShouldStop(1073741824);
if (RemoteObject.solveBoolean("g",_totalprodsvariables,BA.numberCast(double.class, _promomap.runMethod(false,"Get",(Object)((RemoteObject.createImmutable("prodsVariablesRequeridos"))))))) { 
_res = subs.mostCurrent.__c.getField(true,"True");Debug.locals.put("res", _res);};
 BA.debugLineNum = 960;BA.debugLine="Return res";
Debug.ShouldStop(-2147483648);
if (true) return _res;
 BA.debugLineNum = 961;BA.debugLine="End Sub";
Debug.ShouldStop(1);
return RemoteObject.createImmutable(false);
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _bitacora(RemoteObject _ba,RemoteObject _fechab,RemoteObject _usuariob,RemoteObject _almacenb,RemoteObject _rutab,RemoteObject _eventob,RemoteObject _clienteb,RemoteObject _iniciob,RemoteObject _finb,RemoteObject _latitudb,RemoteObject _longitudb,RemoteObject _precision,RemoteObject _motivonoventa,RemoteObject _motivonovisita) throws Exception{
try {
		Debug.PushSubsStack("bitacora (subs) ","subs",9,_ba,subs.mostCurrent,1280);
if (RapidSub.canDelegate("bitacora")) { return keymon.lat.medicomed.subs.remoteMe.runUserSub(false, "subs","bitacora", _ba, _fechab, _usuariob, _almacenb, _rutab, _eventob, _clienteb, _iniciob, _finb, _latitudb, _longitudb, _precision, _motivonoventa, _motivonovisita);}
RemoteObject _cmd = RemoteObject.declareNull("keymon.lat.medicomed.dbrequestmanager._dbcommand");
RemoteObject _nombrecliente = RemoteObject.createImmutable("");
RemoteObject _e = RemoteObject.declareNull("anywheresoftware.b4a.sql.SQL.CursorWrapper");
RemoteObject _c = RemoteObject.declareNull("anywheresoftware.b4a.sql.SQL.CursorWrapper");
;
Debug.locals.put("fechab", _fechab);
Debug.locals.put("usuariob", _usuariob);
Debug.locals.put("almacenb", _almacenb);
Debug.locals.put("rutab", _rutab);
Debug.locals.put("eventob", _eventob);
Debug.locals.put("clienteb", _clienteb);
Debug.locals.put("iniciob", _iniciob);
Debug.locals.put("finb", _finb);
Debug.locals.put("latitudb", _latitudb);
Debug.locals.put("longitudb", _longitudb);
Debug.locals.put("precision", _precision);
Debug.locals.put("motivonoventa", _motivonoventa);
Debug.locals.put("motivonovisita", _motivonovisita);
 BA.debugLineNum = 1280;BA.debugLine="Sub bitacora(fechab As String, usuariob As String,";
Debug.ShouldStop(-2147483648);
 BA.debugLineNum = 1281;BA.debugLine="Log(motivonovisita)";
Debug.ShouldStop(1);
subs.mostCurrent.__c.runVoidMethod ("LogImpl","314876673",_motivonovisita,0);
 BA.debugLineNum = 1282;BA.debugLine="Log(\"bitacora\")";
Debug.ShouldStop(2);
subs.mostCurrent.__c.runVoidMethod ("LogImpl","314876674",RemoteObject.createImmutable("bitacora"),0);
 BA.debugLineNum = 1283;BA.debugLine="Log(eventob)";
Debug.ShouldStop(4);
subs.mostCurrent.__c.runVoidMethod ("LogImpl","314876675",_eventob,0);
 BA.debugLineNum = 1284;BA.debugLine="Private cmd As DBCommand";
Debug.ShouldStop(8);
_cmd = RemoteObject.createNew ("keymon.lat.medicomed.dbrequestmanager._dbcommand");Debug.locals.put("cmd", _cmd);
 BA.debugLineNum = 1285;BA.debugLine="cmd.Initialize";
Debug.ShouldStop(16);
_cmd.runVoidMethod ("Initialize");
 BA.debugLineNum = 1286;BA.debugLine="cmd.Name = \"mandaBitacora_MEDICOMED\"";
Debug.ShouldStop(32);
_cmd.setField ("Name" /*RemoteObject*/ ,BA.ObjectToString("mandaBitacora_MEDICOMED"));
 BA.debugLineNum = 1287;BA.debugLine="Log(\"BITACORA3\")";
Debug.ShouldStop(64);
subs.mostCurrent.__c.runVoidMethod ("LogImpl","314876679",RemoteObject.createImmutable("BITACORA3"),0);
 BA.debugLineNum = 1288;BA.debugLine="Private nombreCliente As String = traeNombreClien";
Debug.ShouldStop(128);
_nombrecliente = _traenombrecliente(_ba,_clienteb);Debug.locals.put("nombreCliente", _nombrecliente);Debug.locals.put("nombreCliente", _nombrecliente);
 BA.debugLineNum = 1289;BA.debugLine="If eventob = \"Llega a almacen\" Then";
Debug.ShouldStop(256);
if (RemoteObject.solveBoolean("=",_eventob,BA.ObjectToString("Llega a almacen"))) { 
 BA.debugLineNum = 1290;BA.debugLine="nombreCliente = \"BOLETA\"";
Debug.ShouldStop(512);
_nombrecliente = BA.ObjectToString("BOLETA");Debug.locals.put("nombreCliente", _nombrecliente);
 BA.debugLineNum = 1291;BA.debugLine="clienteb = \"\"";
Debug.ShouldStop(1024);
_clienteb = BA.ObjectToString("");Debug.locals.put("clienteb", _clienteb);
 BA.debugLineNum = 1292;BA.debugLine="finb = iniciob";
Debug.ShouldStop(2048);
_finb = _iniciob;Debug.locals.put("finb", _finb);
 };
 BA.debugLineNum = 1294;BA.debugLine="If eventob = \"Salida almacen\" Then nombreCliente";
Debug.ShouldStop(8192);
if (RemoteObject.solveBoolean("=",_eventob,BA.ObjectToString("Salida almacen"))) { 
_nombrecliente = BA.ObjectToString("CHECKLIST");Debug.locals.put("nombreCliente", _nombrecliente);};
 BA.debugLineNum = 1295;BA.debugLine="If eventob = \"Fin Día\" Then nombreCliente = \"FIN";
Debug.ShouldStop(16384);
if (RemoteObject.solveBoolean("=",_eventob,BA.ObjectToString("Fin Día"))) { 
_nombrecliente = BA.ObjectToString("FIN DIA");Debug.locals.put("nombreCliente", _nombrecliente);};
 BA.debugLineNum = 1296;BA.debugLine="If eventob = \"Carga día\" Then nombreCliente = \"CA";
Debug.ShouldStop(32768);
if (RemoteObject.solveBoolean("=",_eventob,BA.ObjectToString("Carga día"))) { 
_nombrecliente = BA.ObjectToString("CARGA DIA");Debug.locals.put("nombreCliente", _nombrecliente);};
 BA.debugLineNum = 1297;BA.debugLine="If eventob <> \"Termina Venta\" And eventob <> \"No";
Debug.ShouldStop(65536);
if (RemoteObject.solveBoolean("!",_eventob,BA.ObjectToString("Termina Venta")) && RemoteObject.solveBoolean("!",_eventob,BA.ObjectToString("No Venta"))) { 
 BA.debugLineNum = 1298;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery($\"INSERT INT";
Debug.ShouldStop(131072);
subs.mostCurrent._b4xpages.runMethod(false,"_mainpage" /*RemoteObject*/ ,_ba).getField(false,"_skmt" /*RemoteObject*/ ).runVoidMethod ("ExecNonQuery",(Object)((RemoteObject.concat(RemoteObject.createImmutable("INSERT INTO BITACORAGPS (fechab, usuariob , almacenb , rutab , eventob , clienteb , iniciob , finb , latitudb, longitudb , precision , motivonoventa , motivonovisita) VALUES ('"),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_fechab))),RemoteObject.createImmutable("' ,'"),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_usuariob))),RemoteObject.createImmutable("' , '"),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_almacenb))),RemoteObject.createImmutable("' , '"),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_rutab))),RemoteObject.createImmutable("' , '"),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_eventob))),RemoteObject.createImmutable("' , '"),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_clienteb))),RemoteObject.createImmutable("' , '"),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_iniciob))),RemoteObject.createImmutable("' , '"),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_finb))),RemoteObject.createImmutable("' , '"),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_latitudb))),RemoteObject.createImmutable("' , '"),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_longitudb))),RemoteObject.createImmutable("' , '"),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_precision))),RemoteObject.createImmutable("' , '"),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_motivonoventa))),RemoteObject.createImmutable("' , '"),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_motivonovisita))),RemoteObject.createImmutable("')")))));
 BA.debugLineNum = 1299;BA.debugLine="Log($\"'${almacenb}', '${usuariob}', '${rutab}',";
Debug.ShouldStop(262144);
subs.mostCurrent.__c.runVoidMethod ("LogImpl","314876691",(RemoteObject.concat(RemoteObject.createImmutable("'"),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_almacenb))),RemoteObject.createImmutable("', '"),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_usuariob))),RemoteObject.createImmutable("', '"),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_rutab))),RemoteObject.createImmutable("', '"),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_eventob))),RemoteObject.createImmutable("', '"),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_clienteb))),RemoteObject.createImmutable("', '"),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_nombrecliente))),RemoteObject.createImmutable("','"),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_iniciob))),RemoteObject.createImmutable("', '"),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_finb))),RemoteObject.createImmutable("','"),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_latitudb))),RemoteObject.createImmutable("','"),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_longitudb))),RemoteObject.createImmutable("', '"),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_precision))),RemoteObject.createImmutable("', '"),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_motivonoventa))),RemoteObject.createImmutable("', '"),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_motivonovisita))),RemoteObject.createImmutable("', '"),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_fechab))),RemoteObject.createImmutable("'"))),0);
 }else {
 BA.debugLineNum = 1304;BA.debugLine="Private e As Cursor = B4XPages.MainPage.skmt.Exe";
Debug.ShouldStop(8388608);
_e = RemoteObject.createNew ("anywheresoftware.b4a.sql.SQL.CursorWrapper");
_e = RemoteObject.declareNull("anywheresoftware.b4a.AbsObjectWrapper").runMethod(false, "ConvertToWrapper", RemoteObject.createNew("anywheresoftware.b4a.sql.SQL.CursorWrapper"), subs.mostCurrent._b4xpages.runMethod(false,"_mainpage" /*RemoteObject*/ ,_ba).getField(false,"_skmt" /*RemoteObject*/ ).runMethod(false,"ExecQuery",(Object)((RemoteObject.concat(RemoteObject.createImmutable("select fechab from BITACORAGPS where usuariob = '"),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_usuariob))),RemoteObject.createImmutable("' and almacenb = '"),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_almacenb))),RemoteObject.createImmutable("' and rutab = '"),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_rutab))),RemoteObject.createImmutable("' and clienteb = '"),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_clienteb))),RemoteObject.createImmutable("' and eventob = 'Inicia Venta' order by fechab desc"))))));Debug.locals.put("e", _e);Debug.locals.put("e", _e);
 BA.debugLineNum = 1306;BA.debugLine="If e.RowCount > 0 Then";
Debug.ShouldStop(33554432);
if (RemoteObject.solveBoolean(">",_e.runMethod(true,"getRowCount"),BA.numberCast(double.class, 0))) { 
 BA.debugLineNum = 1307;BA.debugLine="e.Position = 0";
Debug.ShouldStop(67108864);
_e.runMethod(true,"setPosition",BA.numberCast(int.class, 0));
 BA.debugLineNum = 1308;BA.debugLine="Log(\"ACTUALIZA BITACORA\")";
Debug.ShouldStop(134217728);
subs.mostCurrent.__c.runVoidMethod ("LogImpl","314876700",RemoteObject.createImmutable("ACTUALIZA BITACORA"),0);
 BA.debugLineNum = 1309;BA.debugLine="If eventob = \"Termina Venta\" Then";
Debug.ShouldStop(268435456);
if (RemoteObject.solveBoolean("=",_eventob,BA.ObjectToString("Termina Venta"))) { 
 BA.debugLineNum = 1310;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery($\"update B";
Debug.ShouldStop(536870912);
subs.mostCurrent._b4xpages.runMethod(false,"_mainpage" /*RemoteObject*/ ,_ba).getField(false,"_skmt" /*RemoteObject*/ ).runVoidMethod ("ExecNonQuery",(Object)((RemoteObject.concat(RemoteObject.createImmutable("update BITACORAGPS set finb = '"),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_finb))),RemoteObject.createImmutable("' where rutab = '"),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_rutab))),RemoteObject.createImmutable("' and almacenb = '"),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_almacenb))),RemoteObject.createImmutable("' and usuariob = '"),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_usuariob))),RemoteObject.createImmutable("' and clienteb = '"),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_clienteb))),RemoteObject.createImmutable("' and fechab = '"),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_e.runMethod(true,"GetString",(Object)(RemoteObject.createImmutable("fechab")))))),RemoteObject.createImmutable("' ")))));
 BA.debugLineNum = 1313;BA.debugLine="cmd.Parameters = Array As Object(finb, rutab,";
Debug.ShouldStop(1);
_cmd.setField ("Parameters" /*RemoteObject*/ ,RemoteObject.createNewArray("Object",new int[] {7},new Object[] {(_finb),(_rutab),(_almacenb),(_usuariob),(_clienteb),RemoteObject.createImmutable(("Inicia Venta")),(_e.runMethod(true,"GetString",(Object)(RemoteObject.createImmutable("fechab"))))}));
 }else 
{ BA.debugLineNum = 1316;BA.debugLine="else if  eventob = \"No Venta\" Then";
Debug.ShouldStop(8);
if (RemoteObject.solveBoolean("=",_eventob,BA.ObjectToString("No Venta"))) { 
 BA.debugLineNum = 1317;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery($\"update B";
Debug.ShouldStop(16);
subs.mostCurrent._b4xpages.runMethod(false,"_mainpage" /*RemoteObject*/ ,_ba).getField(false,"_skmt" /*RemoteObject*/ ).runVoidMethod ("ExecNonQuery",(Object)((RemoteObject.concat(RemoteObject.createImmutable("update BITACORAGPS set finb = '"),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_finb))),RemoteObject.createImmutable("', motivonoventa = '"),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_motivonoventa))),RemoteObject.createImmutable("', motivonovisita = '"),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_motivonovisita))),RemoteObject.createImmutable("' where rutab = '"),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_rutab))),RemoteObject.createImmutable("' and almacenb = '"),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_almacenb))),RemoteObject.createImmutable("' and usuariob = '"),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_usuariob))),RemoteObject.createImmutable("' and clienteb = '"),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_clienteb))),RemoteObject.createImmutable("' and fechab = '"),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_e.runMethod(true,"GetString",(Object)(RemoteObject.createImmutable("fechab")))))),RemoteObject.createImmutable("' ")))));
 BA.debugLineNum = 1320;BA.debugLine="cmd.Parameters = Array As Object(finb, motivon";
Debug.ShouldStop(128);
_cmd.setField ("Parameters" /*RemoteObject*/ ,RemoteObject.createNewArray("Object",new int[] {9},new Object[] {(_finb),(_motivonoventa),(_motivonovisita),(_rutab),(_almacenb),(_usuariob),(_clienteb),RemoteObject.createImmutable(("Inicia Venta")),(_e.runMethod(true,"GetString",(Object)(RemoteObject.createImmutable("fechab"))))}));
 }}
;
 };
 };
 BA.debugLineNum = 1326;BA.debugLine="If eventob <> \"Inicia Venta\" Then";
Debug.ShouldStop(8192);
if (RemoteObject.solveBoolean("!",_eventob,BA.ObjectToString("Inicia Venta"))) { 
 BA.debugLineNum = 1327;BA.debugLine="Private c As Cursor = B4XPages.MainPage.skmt.Exe";
Debug.ShouldStop(16384);
_c = RemoteObject.createNew ("anywheresoftware.b4a.sql.SQL.CursorWrapper");
_c = RemoteObject.declareNull("anywheresoftware.b4a.AbsObjectWrapper").runMethod(false, "ConvertToWrapper", RemoteObject.createNew("anywheresoftware.b4a.sql.SQL.CursorWrapper"), subs.mostCurrent._b4xpages.runMethod(false,"_mainpage" /*RemoteObject*/ ,_ba).getField(false,"_skmt" /*RemoteObject*/ ).runMethod(false,"ExecQuery",(Object)((RemoteObject.concat(RemoteObject.createImmutable("select * from BITACORAGPS where usuariob = '"),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_usuariob))),RemoteObject.createImmutable("' and almacenb = '"),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_almacenb))),RemoteObject.createImmutable("' and rutab = '"),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_rutab))),RemoteObject.createImmutable("' and clienteb = '"),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_clienteb))),RemoteObject.createImmutable("' order by fechab desc"))))));Debug.locals.put("c", _c);Debug.locals.put("c", _c);
 BA.debugLineNum = 1328;BA.debugLine="If c.RowCount > 0 Then";
Debug.ShouldStop(32768);
if (RemoteObject.solveBoolean(">",_c.runMethod(true,"getRowCount"),BA.numberCast(double.class, 0))) { 
 BA.debugLineNum = 1329;BA.debugLine="Log(c.RowCount)";
Debug.ShouldStop(65536);
subs.mostCurrent.__c.runVoidMethod ("LogImpl","314876721",BA.NumberToString(_c.runMethod(true,"getRowCount")),0);
 BA.debugLineNum = 1330;BA.debugLine="c.Position = 0";
Debug.ShouldStop(131072);
_c.runMethod(true,"setPosition",BA.numberCast(int.class, 0));
 BA.debugLineNum = 1331;BA.debugLine="cmd.Parameters = Array As Object(c.GetString(\"a";
Debug.ShouldStop(262144);
_cmd.setField ("Parameters" /*RemoteObject*/ ,RemoteObject.createNewArray("Object",new int[] {14},new Object[] {(_c.runMethod(true,"GetString",(Object)(RemoteObject.createImmutable("almacenb")))),(_c.runMethod(true,"GetString",(Object)(RemoteObject.createImmutable("usuariob")))),(_c.runMethod(true,"GetString",(Object)(RemoteObject.createImmutable("rutab")))),(_c.runMethod(true,"GetString",(Object)(RemoteObject.createImmutable("eventob")))),(_c.runMethod(true,"GetString",(Object)(RemoteObject.createImmutable("clienteb")))),(_nombrecliente),(_c.runMethod(true,"GetString",(Object)(RemoteObject.createImmutable("iniciob")))),(_c.runMethod(true,"GetString",(Object)(RemoteObject.createImmutable("finb")))),(_c.runMethod(true,"GetString",(Object)(RemoteObject.createImmutable("latitudb")))),(_c.runMethod(true,"GetString",(Object)(RemoteObject.createImmutable("longitudb")))),(_c.runMethod(true,"GetString",(Object)(RemoteObject.createImmutable("precision")))),(_c.runMethod(true,"GetString",(Object)(RemoteObject.createImmutable("motivonoventa")))),(_c.runMethod(true,"GetString",(Object)(RemoteObject.createImmutable("motivonovisita")))),(_c.runMethod(true,"GetString",(Object)(RemoteObject.createImmutable("fechab"))))}));
 BA.debugLineNum = 1332;BA.debugLine="B4XPages.MainPage.reqManager.ExecuteCommand(cmd";
Debug.ShouldStop(524288);
subs.mostCurrent._b4xpages.runMethod(false,"_mainpage" /*RemoteObject*/ ,_ba).getField(false,"_reqmanager" /*RemoteObject*/ ).runClassMethod (keymon.lat.medicomed.dbrequestmanager.class, "_executecommand" /*RemoteObject*/ ,(Object)(_cmd),(Object)((RemoteObject.createImmutable("mandaBitacora"))));
 };
 };
 BA.debugLineNum = 1335;BA.debugLine="Log(\"Mandamos bitacora\")";
Debug.ShouldStop(4194304);
subs.mostCurrent.__c.runVoidMethod ("LogImpl","314876727",RemoteObject.createImmutable("Mandamos bitacora"),0);
 BA.debugLineNum = 1336;BA.debugLine="End Sub";
Debug.ShouldStop(8388608);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _borraarribade100errores(RemoteObject _ba) throws Exception{
try {
		Debug.PushSubsStack("borraArribaDe100Errores (subs) ","subs",9,_ba,subs.mostCurrent,495);
if (RapidSub.canDelegate("borraarribade100errores")) { return keymon.lat.medicomed.subs.remoteMe.runUserSub(false, "subs","borraarribade100errores", _ba);}
;
 BA.debugLineNum = 495;BA.debugLine="Sub borraArribaDe100Errores 'ignore";
Debug.ShouldStop(16384);
 BA.debugLineNum = 496;BA.debugLine="revisaBD";
Debug.ShouldStop(32768);
_revisabd(_ba);
 BA.debugLineNum = 497;BA.debugLine="LogColor(\"Borramos BD de log\", Colors.Magenta)";
Debug.ShouldStop(65536);
subs.mostCurrent.__c.runVoidMethod ("LogImpl","312189698",BA.ObjectToString("Borramos BD de log"),subs.mostCurrent.__c.getField(false,"Colors").getField(true,"Magenta"));
 BA.debugLineNum = 498;BA.debugLine="errorLog.ExecNonQuery(\"DELETE FROM errores WHERE";
Debug.ShouldStop(131072);
subs._errorlog.runVoidMethod ("ExecNonQuery",(Object)(RemoteObject.createImmutable("DELETE FROM errores WHERE fecha NOT in (SELECT fecha FROM errores ORDER BY fecha desc LIMIT 99 )")));
 BA.debugLineNum = 499;BA.debugLine="errorLog.ExecNonQuery(\"vacuum;\")";
Debug.ShouldStop(262144);
subs._errorlog.runVoidMethod ("ExecNonQuery",(Object)(RemoteObject.createImmutable("vacuum;")));
 BA.debugLineNum = 500;BA.debugLine="Log(\"Borramos mas de 100 de errorLog\")";
Debug.ShouldStop(524288);
subs.mostCurrent.__c.runVoidMethod ("LogImpl","312189701",RemoteObject.createImmutable("Borramos mas de 100 de errorLog"),0);
 BA.debugLineNum = 501;BA.debugLine="End Sub";
Debug.ShouldStop(1048576);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _borraarribade600renglonesbitacora(RemoteObject _ba) throws Exception{
try {
		Debug.PushSubsStack("borraArribaDe600RenglonesBitacora (subs) ","subs",9,_ba,subs.mostCurrent,504);
if (RapidSub.canDelegate("borraarribade600renglonesbitacora")) { return keymon.lat.medicomed.subs.remoteMe.runUserSub(false, "subs","borraarribade600renglonesbitacora", _ba);}
;
 BA.debugLineNum = 504;BA.debugLine="Sub borraArribaDe600RenglonesBitacora 'ignore";
Debug.ShouldStop(8388608);
 BA.debugLineNum = 505;BA.debugLine="revisaBD";
Debug.ShouldStop(16777216);
_revisabd(_ba);
 BA.debugLineNum = 506;BA.debugLine="LogColor(\"Borramos BD de log\", Colors.Magenta)";
Debug.ShouldStop(33554432);
subs.mostCurrent.__c.runVoidMethod ("LogImpl","312255234",BA.ObjectToString("Borramos BD de log"),subs.mostCurrent.__c.getField(false,"Colors").getField(true,"Magenta"));
 BA.debugLineNum = 507;BA.debugLine="kmt.ExecNonQuery(\"DELETE FROM bitacora WHERE fech";
Debug.ShouldStop(67108864);
subs._kmt.runVoidMethod ("ExecNonQuery",(Object)(RemoteObject.createImmutable("DELETE FROM bitacora WHERE fecha NOT in (SELECT fecha FROM bitacora ORDER BY fecha desc LIMIT 599 )")));
 BA.debugLineNum = 508;BA.debugLine="kmt.ExecNonQuery(\"vacuum;\")";
Debug.ShouldStop(134217728);
subs._kmt.runVoidMethod ("ExecNonQuery",(Object)(RemoteObject.createImmutable("vacuum;")));
 BA.debugLineNum = 509;BA.debugLine="Log(\"Borramos mas de 600 de bitacora\")";
Debug.ShouldStop(268435456);
subs.mostCurrent.__c.runVoidMethod ("LogImpl","312255237",RemoteObject.createImmutable("Borramos mas de 600 de bitacora"),0);
 BA.debugLineNum = 510;BA.debugLine="End Sub";
Debug.ShouldStop(536870912);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _borralogdb(RemoteObject _ba) throws Exception{
try {
		Debug.PushSubsStack("borraLogDB (subs) ","subs",9,_ba,subs.mostCurrent,379);
if (RapidSub.canDelegate("borralogdb")) { return keymon.lat.medicomed.subs.remoteMe.runUserSub(false, "subs","borralogdb", _ba);}
;
 BA.debugLineNum = 379;BA.debugLine="Sub borraLogDB 'ignore";
Debug.ShouldStop(67108864);
 BA.debugLineNum = 380;BA.debugLine="LogColor(\"Borramos BD de log\", Colors.Magenta)";
Debug.ShouldStop(134217728);
subs.mostCurrent.__c.runVoidMethod ("LogImpl","311993089",BA.ObjectToString("Borramos BD de log"),subs.mostCurrent.__c.getField(false,"Colors").getField(true,"Magenta"));
 BA.debugLineNum = 381;BA.debugLine="kmt.ExecNonQuery(\"delete from bitacora\")";
Debug.ShouldStop(268435456);
subs._kmt.runVoidMethod ("ExecNonQuery",(Object)(RemoteObject.createImmutable("delete from bitacora")));
 BA.debugLineNum = 382;BA.debugLine="kmt.ExecNonQuery(\"vacuum;\")";
Debug.ShouldStop(536870912);
subs._kmt.runVoidMethod ("ExecNonQuery",(Object)(RemoteObject.createImmutable("vacuum;")));
 BA.debugLineNum = 383;BA.debugLine="End Sub";
Debug.ShouldStop(1073741824);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _borramosarchivogps(RemoteObject _ba) throws Exception{
try {
		Debug.PushSubsStack("borramosArchivoGPS (subs) ","subs",9,_ba,subs.mostCurrent,175);
if (RapidSub.canDelegate("borramosarchivogps")) { return keymon.lat.medicomed.subs.remoteMe.runUserSub(false, "subs","borramosarchivogps", _ba);}
RemoteObject _out = RemoteObject.declareNull("anywheresoftware.b4a.objects.streams.File.OutputStreamWrapper");
RemoteObject _s = RemoteObject.createImmutable("");
RemoteObject _t = null;
;
 BA.debugLineNum = 175;BA.debugLine="Sub borramosArchivoGPS 'ignore";
Debug.ShouldStop(16384);
 BA.debugLineNum = 176;BA.debugLine="Dim out As OutputStream = File.OpenOutput(File.Di";
Debug.ShouldStop(32768);
_out = RemoteObject.createNew ("anywheresoftware.b4a.objects.streams.File.OutputStreamWrapper");
_out = subs.mostCurrent.__c.getField(false,"File").runMethod(false,"OpenOutput",(Object)(subs.mostCurrent.__c.getField(false,"File").runMethod(true,"getDirRootExternal")),(Object)(BA.ObjectToString("gps.txt")),(Object)(subs.mostCurrent.__c.getField(true,"False")));Debug.locals.put("out", _out);Debug.locals.put("out", _out);
 BA.debugLineNum = 177;BA.debugLine="Dim s As String = \"\"";
Debug.ShouldStop(65536);
_s = BA.ObjectToString("");Debug.locals.put("s", _s);Debug.locals.put("s", _s);
 BA.debugLineNum = 178;BA.debugLine="Dim t() As Byte = s.GetBytes(\"UTF-8\")";
Debug.ShouldStop(131072);
_t = _s.runMethod(false,"getBytes",(Object)(RemoteObject.createImmutable("UTF-8")));Debug.locals.put("t", _t);Debug.locals.put("t", _t);
 BA.debugLineNum = 179;BA.debugLine="out.WriteBytes(t, 0, t.Length)";
Debug.ShouldStop(262144);
_out.runVoidMethod ("WriteBytes",(Object)(_t),(Object)(BA.numberCast(int.class, 0)),(Object)(_t.getField(true,"length")));
 BA.debugLineNum = 180;BA.debugLine="out.Close";
Debug.ShouldStop(524288);
_out.runVoidMethod ("Close");
 BA.debugLineNum = 181;BA.debugLine="End Sub";
Debug.ShouldStop(1048576);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _borrapedidoclienteactual(RemoteObject _ba) throws Exception{
try {
		Debug.PushSubsStack("borraPedidoClienteActual (subs) ","subs",9,_ba,subs.mostCurrent,1239);
if (RapidSub.canDelegate("borrapedidoclienteactual")) { return keymon.lat.medicomed.subs.remoteMe.runUserSub(false, "subs","borrapedidoclienteactual", _ba);}
RemoteObject _thisc = RemoteObject.declareNull("anywheresoftware.b4a.sql.SQL.CursorWrapper");
int _i = 0;
;
 BA.debugLineNum = 1239;BA.debugLine="Sub borraPedidoClienteActual As String";
Debug.ShouldStop(4194304);
 BA.debugLineNum = 1240;BA.debugLine="Private thisC As Cursor";
Debug.ShouldStop(8388608);
_thisc = RemoteObject.createNew ("anywheresoftware.b4a.sql.SQL.CursorWrapper");Debug.locals.put("thisC", _thisc);
 BA.debugLineNum = 1241;BA.debugLine="thisC=B4XPages.MainPage.skmt.ExecQuery(\"select PE";
Debug.ShouldStop(16777216);
_thisc = RemoteObject.declareNull("anywheresoftware.b4a.AbsObjectWrapper").runMethod(false, "ConvertToWrapper", RemoteObject.createNew("anywheresoftware.b4a.sql.SQL.CursorWrapper"), subs.mostCurrent._b4xpages.runMethod(false,"_mainpage" /*RemoteObject*/ ,_ba).getField(false,"_skmt" /*RemoteObject*/ ).runMethod(false,"ExecQuery",(Object)(RemoteObject.createImmutable("select PE_PROID,PE_CANT FROM PEDIDO where pe_cliente in (Select CUENTA from cuentaa) "))));Debug.locals.put("thisC", _thisc);
 BA.debugLineNum = 1242;BA.debugLine="If thisC.RowCount>0 Then";
Debug.ShouldStop(33554432);
if (RemoteObject.solveBoolean(">",_thisc.runMethod(true,"getRowCount"),BA.numberCast(double.class, 0))) { 
 BA.debugLineNum = 1243;BA.debugLine="For i=0 To thisC.RowCount -1";
Debug.ShouldStop(67108864);
{
final int step4 = 1;
final int limit4 = RemoteObject.solve(new RemoteObject[] {_thisc.runMethod(true,"getRowCount"),RemoteObject.createImmutable(1)}, "-",1, 1).<Integer>get().intValue();
_i = 0 ;
for (;(step4 > 0 && _i <= limit4) || (step4 < 0 && _i >= limit4) ;_i = ((int)(0 + _i + step4))  ) {
Debug.locals.put("i", _i);
 BA.debugLineNum = 1244;BA.debugLine="thisC.Position=i";
Debug.ShouldStop(134217728);
_thisc.runMethod(true,"setPosition",BA.numberCast(int.class, _i));
 BA.debugLineNum = 1245;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"update ca";
Debug.ShouldStop(268435456);
subs.mostCurrent._b4xpages.runMethod(false,"_mainpage" /*RemoteObject*/ ,_ba).getField(false,"_skmt" /*RemoteObject*/ ).runVoidMethod ("ExecNonQuery2",(Object)(BA.ObjectToString("update cat_gunaprod set cat_gp_almacen = cat_gp_almacen + ? where cat_gp_id = ?")),(Object)(subs.mostCurrent.__c.runMethod(false, "ArrayToList", (Object)(RemoteObject.createNewArray("Object",new int[] {2},new Object[] {(_thisc.runMethod(true,"GetString",(Object)(RemoteObject.createImmutable("PE_CANT")))),(_thisc.runMethod(true,"GetString",(Object)(RemoteObject.createImmutable("PE_PROID"))))})))));
 BA.debugLineNum = 1246;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"INSERT IN";
Debug.ShouldStop(536870912);
subs.mostCurrent._b4xpages.runMethod(false,"_mainpage" /*RemoteObject*/ ,_ba).getField(false,"_skmt" /*RemoteObject*/ ).runVoidMethod ("ExecNonQuery2",(Object)(BA.ObjectToString("INSERT INTO INVENT_X_ENVIAR (ALMACEN , PROID , CANTIDAD ) VALUES(?,?,?) ")),(Object)(subs.mostCurrent.__c.runMethod(false, "ArrayToList", (Object)(RemoteObject.createNewArray("Object",new int[] {3},new Object[] {(_traealmacen(_ba)),(_thisc.runMethod(true,"GetString",(Object)(RemoteObject.createImmutable("PE_PROID")))),RemoteObject.createImmutable(((double)(Double.parseDouble(_thisc.runMethod(true,"GetString",(Object)(RemoteObject.createImmutable("PE_CANT"))).<String>get()))*-(double) (0 + 1)))})))));
 }
}Debug.locals.put("i", _i);
;
 };
 BA.debugLineNum = 1249;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"delete from";
Debug.ShouldStop(1);
subs.mostCurrent._b4xpages.runMethod(false,"_mainpage" /*RemoteObject*/ ,_ba).getField(false,"_skmt" /*RemoteObject*/ ).runVoidMethod ("ExecNonQuery",(Object)(RemoteObject.createImmutable("delete from pedido_cliente where pc_cliente in (Select CUENTA from cuentaa)")));
 BA.debugLineNum = 1250;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"delete from";
Debug.ShouldStop(2);
subs.mostCurrent._b4xpages.runMethod(false,"_mainpage" /*RemoteObject*/ ,_ba).getField(false,"_skmt" /*RemoteObject*/ ).runVoidMethod ("ExecNonQuery",(Object)(RemoteObject.createImmutable("delete from pedido where pe_cliente in (Select CUENTA from cuentaa)")));
 BA.debugLineNum = 1251;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"UPDATE kmt_i";
Debug.ShouldStop(4);
subs.mostCurrent._b4xpages.runMethod(false,"_mainpage" /*RemoteObject*/ ,_ba).getField(false,"_skmt" /*RemoteObject*/ ).runVoidMethod ("ExecNonQuery",(Object)(RemoteObject.createImmutable("UPDATE kmt_info set gestion = 0  where CAT_CL_CODIGO In (select cuenta from cuentaa)")));
 BA.debugLineNum = 1252;BA.debugLine="Return 1";
Debug.ShouldStop(8);
if (true) return BA.NumberToString(1);
 BA.debugLineNum = 1253;BA.debugLine="End Sub";
Debug.ShouldStop(16);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _buscadbusuario(RemoteObject _ba) throws Exception{
try {
		Debug.PushSubsStack("buscaDBUsuario (subs) ","subs",9,_ba,subs.mostCurrent,647);
if (RapidSub.canDelegate("buscadbusuario")) { return keymon.lat.medicomed.subs.remoteMe.runUserSub(false, "subs","buscadbusuario", _ba);}
RemoteObject _c = RemoteObject.declareNull("anywheresoftware.b4a.sql.SQL.CursorWrapper");
RemoteObject _usuario = RemoteObject.createImmutable("");
;
 BA.debugLineNum = 647;BA.debugLine="Sub buscaDBUsuario As String 'ignore";
Debug.ShouldStop(64);
 BA.debugLineNum = 648;BA.debugLine="Private c As Cursor";
Debug.ShouldStop(128);
_c = RemoteObject.createNew ("anywheresoftware.b4a.sql.SQL.CursorWrapper");Debug.locals.put("c", _c);
 BA.debugLineNum = 649;BA.debugLine="Private usuario As String = \"SinUsuario\"";
Debug.ShouldStop(256);
_usuario = BA.ObjectToString("SinUsuario");Debug.locals.put("usuario", _usuario);Debug.locals.put("usuario", _usuario);
 BA.debugLineNum = 650;BA.debugLine="c=kmt.ExecQuery(\"select USUARIO from usuarioa\")";
Debug.ShouldStop(512);
_c = RemoteObject.declareNull("anywheresoftware.b4a.AbsObjectWrapper").runMethod(false, "ConvertToWrapper", RemoteObject.createNew("anywheresoftware.b4a.sql.SQL.CursorWrapper"), subs._kmt.runMethod(false,"ExecQuery",(Object)(RemoteObject.createImmutable("select USUARIO from usuarioa"))));Debug.locals.put("c", _c);
 BA.debugLineNum = 651;BA.debugLine="c.Position=0";
Debug.ShouldStop(1024);
_c.runMethod(true,"setPosition",BA.numberCast(int.class, 0));
 BA.debugLineNum = 652;BA.debugLine="If c.RowCount > 0 Then usuario = c.GetString(\"USU";
Debug.ShouldStop(2048);
if (RemoteObject.solveBoolean(">",_c.runMethod(true,"getRowCount"),BA.numberCast(double.class, 0))) { 
_usuario = _c.runMethod(true,"GetString",(Object)(RemoteObject.createImmutable("USUARIO")));Debug.locals.put("usuario", _usuario);};
 BA.debugLineNum = 653;BA.debugLine="Return usuario";
Debug.ShouldStop(4096);
if (true) return _usuario;
 BA.debugLineNum = 654;BA.debugLine="End Sub";
Debug.ShouldStop(8192);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _centraetiqueta(RemoteObject _ba,RemoteObject _elemento,RemoteObject _anchoelementosuperior) throws Exception{
try {
		Debug.PushSubsStack("centraEtiqueta (subs) ","subs",9,_ba,subs.mostCurrent,627);
if (RapidSub.canDelegate("centraetiqueta")) { return keymon.lat.medicomed.subs.remoteMe.runUserSub(false, "subs","centraetiqueta", _ba, _elemento, _anchoelementosuperior);}
;
Debug.locals.put("elemento", _elemento);
Debug.locals.put("anchoElementoSuperior", _anchoelementosuperior);
 BA.debugLineNum = 627;BA.debugLine="Sub centraEtiqueta(elemento As Label, anchoElement";
Debug.ShouldStop(262144);
 BA.debugLineNum = 628;BA.debugLine="elemento.Left = Round(anchoElementoSuperior/2)-(e";
Debug.ShouldStop(524288);
_elemento.runMethod(true,"setLeft",BA.numberCast(int.class, RemoteObject.solve(new RemoteObject[] {subs.mostCurrent.__c.runMethod(true,"Round",(Object)(RemoteObject.solve(new RemoteObject[] {_anchoelementosuperior,RemoteObject.createImmutable(2)}, "/",0, 0))),(RemoteObject.solve(new RemoteObject[] {_elemento.runMethod(true,"getWidth"),RemoteObject.createImmutable(2)}, "/",0, 0))}, "-",1, 0)));
 BA.debugLineNum = 629;BA.debugLine="End Sub";
Debug.ShouldStop(1048576);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _centrapanel(RemoteObject _ba,RemoteObject _elemento,RemoteObject _anchoelementosuperior) throws Exception{
try {
		Debug.PushSubsStack("centraPanel (subs) ","subs",9,_ba,subs.mostCurrent,632);
if (RapidSub.canDelegate("centrapanel")) { return keymon.lat.medicomed.subs.remoteMe.runUserSub(false, "subs","centrapanel", _ba, _elemento, _anchoelementosuperior);}
;
Debug.locals.put("elemento", _elemento);
Debug.locals.put("anchoElementoSuperior", _anchoelementosuperior);
 BA.debugLineNum = 632;BA.debugLine="Sub centraPanel(elemento As Panel, anchoElementoSu";
Debug.ShouldStop(8388608);
 BA.debugLineNum = 633;BA.debugLine="elemento.Left = Round(anchoElementoSuperior/2)-(e";
Debug.ShouldStop(16777216);
_elemento.runMethod(true,"setLeft",BA.numberCast(int.class, RemoteObject.solve(new RemoteObject[] {subs.mostCurrent.__c.runMethod(true,"Round",(Object)(RemoteObject.solve(new RemoteObject[] {_anchoelementosuperior,RemoteObject.createImmutable(2)}, "/",0, 0))),(RemoteObject.solve(new RemoteObject[] {_elemento.runMethod(true,"getWidth"),RemoteObject.createImmutable(2)}, "/",0, 0))}, "-",1, 0)));
 BA.debugLineNum = 634;BA.debugLine="End Sub";
Debug.ShouldStop(33554432);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _centrapanelv(RemoteObject _ba,RemoteObject _elemento,RemoteObject _altoelementosuperior) throws Exception{
try {
		Debug.PushSubsStack("centraPanelV (subs) ","subs",9,_ba,subs.mostCurrent,637);
if (RapidSub.canDelegate("centrapanelv")) { return keymon.lat.medicomed.subs.remoteMe.runUserSub(false, "subs","centrapanelv", _ba, _elemento, _altoelementosuperior);}
;
Debug.locals.put("elemento", _elemento);
Debug.locals.put("altoElementoSuperior", _altoelementosuperior);
 BA.debugLineNum = 637;BA.debugLine="Sub centraPanelV(elemento As Panel, altoElementoSu";
Debug.ShouldStop(268435456);
 BA.debugLineNum = 638;BA.debugLine="elemento.Top = Round(altoElementoSuperior/2)-(ele";
Debug.ShouldStop(536870912);
_elemento.runMethod(true,"setTop",BA.numberCast(int.class, RemoteObject.solve(new RemoteObject[] {subs.mostCurrent.__c.runMethod(true,"Round",(Object)(RemoteObject.solve(new RemoteObject[] {_altoelementosuperior,RemoteObject.createImmutable(2)}, "/",0, 0))),(RemoteObject.solve(new RemoteObject[] {_elemento.runMethod(true,"getHeight"),RemoteObject.createImmutable(2)}, "/",0, 0))}, "-",1, 0)));
 BA.debugLineNum = 639;BA.debugLine="End Sub";
Debug.ShouldStop(1073741824);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _centraprogressbar(RemoteObject _ba,RemoteObject _elemento,RemoteObject _anchoelementosuperior) throws Exception{
try {
		Debug.PushSubsStack("centraProgressBar (subs) ","subs",9,_ba,subs.mostCurrent,642);
if (RapidSub.canDelegate("centraprogressbar")) { return keymon.lat.medicomed.subs.remoteMe.runUserSub(false, "subs","centraprogressbar", _ba, _elemento, _anchoelementosuperior);}
;
Debug.locals.put("elemento", _elemento);
Debug.locals.put("anchoElementoSuperior", _anchoelementosuperior);
 BA.debugLineNum = 642;BA.debugLine="Sub centraProgressBar(elemento As ProgressBar, anc";
Debug.ShouldStop(2);
 BA.debugLineNum = 643;BA.debugLine="elemento.Left = Round(anchoElementoSuperior/2)-(e";
Debug.ShouldStop(4);
_elemento.runMethod(true,"setLeft",BA.numberCast(int.class, RemoteObject.solve(new RemoteObject[] {subs.mostCurrent.__c.runMethod(true,"Round",(Object)(RemoteObject.solve(new RemoteObject[] {_anchoelementosuperior,RemoteObject.createImmutable(2)}, "/",0, 0))),(RemoteObject.solve(new RemoteObject[] {_elemento.runMethod(true,"getWidth"),RemoteObject.createImmutable(2)}, "/",0, 0))}, "-",1, 0)));
 BA.debugLineNum = 644;BA.debugLine="End Sub";
Debug.ShouldStop(8);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _compress(RemoteObject _ba,RemoteObject _str) throws Exception{
try {
		Debug.PushSubsStack("compress (subs) ","subs",9,_ba,subs.mostCurrent,40);
if (RapidSub.canDelegate("compress")) { return keymon.lat.medicomed.subs.remoteMe.runUserSub(false, "subs","compress", _ba, _str);}
RemoteObject _compressed = null;
RemoteObject _base64 = RemoteObject.createImmutable("");
;
Debug.locals.put("str", _str);
 BA.debugLineNum = 40;BA.debugLine="Sub compress(str As String) As String 'ignore";
Debug.ShouldStop(128);
 BA.debugLineNum = 42;BA.debugLine="Dim compressed() As Byte = GZip.compress(str)";
Debug.ShouldStop(512);
_compressed = subs._gzip.runMethod(false,"compress",(Object)(_str));Debug.locals.put("compressed", _compressed);Debug.locals.put("compressed", _compressed);
 BA.debugLineNum = 45;BA.debugLine="Dim base64 As String = su.EncodeBase64(compressed";
Debug.ShouldStop(4096);
_base64 = subs._su.runMethod(true,"EncodeBase64",(Object)(_compressed));Debug.locals.put("base64", _base64);Debug.locals.put("base64", _base64);
 BA.debugLineNum = 46;BA.debugLine="Log($\"Comprimido: ${base64.Length}\"$)";
Debug.ShouldStop(8192);
subs.mostCurrent.__c.runVoidMethod ("LogImpl","310747910",(RemoteObject.concat(RemoteObject.createImmutable("Comprimido: "),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_base64.runMethod(true,"length")))),RemoteObject.createImmutable(""))),0);
 BA.debugLineNum = 48;BA.debugLine="Return base64";
Debug.ShouldStop(32768);
if (true) return _base64;
 BA.debugLineNum = 49;BA.debugLine="End Sub";
Debug.ShouldStop(65536);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _copiadb(RemoteObject _ba,RemoteObject _result) throws Exception{
try {
		Debug.PushSubsStack("copiaDB (subs) ","subs",9,_ba,subs.mostCurrent,585);
if (RapidSub.canDelegate("copiadb")) { return keymon.lat.medicomed.subs.remoteMe.runUserSub(false, "subs","copiadb", _ba, _result);}
RemoteObject _p = RemoteObject.createImmutable("");
RemoteObject _thedir = RemoteObject.createImmutable("");
;
Debug.locals.put("result", _result);
 BA.debugLineNum = 585;BA.debugLine="Sub copiaDB(result As Boolean) 'ignore";
Debug.ShouldStop(256);
 BA.debugLineNum = 586;BA.debugLine="ToastMessageShow(\"copiaDB\", False)";
Debug.ShouldStop(512);
subs.mostCurrent.__c.runVoidMethod ("ToastMessageShow",(Object)(BA.ObjectToCharSequence("copiaDB")),(Object)(subs.mostCurrent.__c.getField(true,"False")));
 BA.debugLineNum = 587;BA.debugLine="If result Then";
Debug.ShouldStop(1024);
if (_result.<Boolean>get().booleanValue()) { 
 BA.debugLineNum = 588;BA.debugLine="Dim p As String";
Debug.ShouldStop(2048);
_p = RemoteObject.createImmutable("");Debug.locals.put("p", _p);
 BA.debugLineNum = 589;BA.debugLine="If File.ExternalWritable Then";
Debug.ShouldStop(4096);
if (subs.mostCurrent.__c.getField(false,"File").runMethod(true,"getExternalWritable").<Boolean>get().booleanValue()) { 
 BA.debugLineNum = 590;BA.debugLine="p = File.DirRootExternal";
Debug.ShouldStop(8192);
_p = subs.mostCurrent.__c.getField(false,"File").runMethod(true,"getDirRootExternal");Debug.locals.put("p", _p);
 }else {
 BA.debugLineNum = 593;BA.debugLine="p = File.DirInternal";
Debug.ShouldStop(65536);
_p = subs.mostCurrent.__c.getField(false,"File").runMethod(true,"getDirInternal");Debug.locals.put("p", _p);
 };
 BA.debugLineNum = 596;BA.debugLine="Dim theDir As String";
Debug.ShouldStop(524288);
_thedir = RemoteObject.createImmutable("");Debug.locals.put("theDir", _thedir);
 BA.debugLineNum = 597;BA.debugLine="Try";
Debug.ShouldStop(1048576);
try { BA.debugLineNum = 598;BA.debugLine="File.MakeDir(File.DirRootExternal,\"kmts\")";
Debug.ShouldStop(2097152);
subs.mostCurrent.__c.getField(false,"File").runVoidMethod ("MakeDir",(Object)(subs.mostCurrent.__c.getField(false,"File").runMethod(true,"getDirRootExternal")),(Object)(RemoteObject.createImmutable("kmts")));
 BA.debugLineNum = 599;BA.debugLine="theDir = \"/kmts\"";
Debug.ShouldStop(4194304);
_thedir = BA.ObjectToString("/kmts");Debug.locals.put("theDir", _thedir);
 Debug.CheckDeviceExceptions();
} 
       catch (Exception e14) {
			BA.rdebugUtils.runVoidMethod("setLastException",BA.rdebugUtils.runMethod(false, "processBAFromBA", _ba), e14.toString()); BA.debugLineNum = 601;BA.debugLine="theDir = \"\"";
Debug.ShouldStop(16777216);
_thedir = BA.ObjectToString("");Debug.locals.put("theDir", _thedir);
 };
 BA.debugLineNum = 603;BA.debugLine="Try";
Debug.ShouldStop(67108864);
try { BA.debugLineNum = 604;BA.debugLine="File.Copy(File.DirInternal,\"kmt.db\",File.DirRoo";
Debug.ShouldStop(134217728);
subs.mostCurrent.__c.getField(false,"File").runVoidMethod ("Copy",(Object)(subs.mostCurrent.__c.getField(false,"File").runMethod(true,"getDirInternal")),(Object)(BA.ObjectToString("kmt.db")),(Object)(RemoteObject.concat(subs.mostCurrent.__c.getField(false,"File").runMethod(true,"getDirRootExternal"),_thedir)),(Object)(RemoteObject.createImmutable("cedex_kmt.db")));
 BA.debugLineNum = 605;BA.debugLine="File.Copy(File.DirInternal,\"errorLog.db\",File.D";
Debug.ShouldStop(268435456);
subs.mostCurrent.__c.getField(false,"File").runVoidMethod ("Copy",(Object)(subs.mostCurrent.__c.getField(false,"File").runMethod(true,"getDirInternal")),(Object)(BA.ObjectToString("errorLog.db")),(Object)(RemoteObject.concat(subs.mostCurrent.__c.getField(false,"File").runMethod(true,"getDirRootExternal"),_thedir)),(Object)(RemoteObject.createImmutable("cedex_errorLog.db")));
 BA.debugLineNum = 606;BA.debugLine="ToastMessageShow(\"BD copiada!\", False)";
Debug.ShouldStop(536870912);
subs.mostCurrent.__c.runVoidMethod ("ToastMessageShow",(Object)(BA.ObjectToCharSequence("BD copiada!")),(Object)(subs.mostCurrent.__c.getField(true,"False")));
 Debug.CheckDeviceExceptions();
} 
       catch (Exception e21) {
			BA.rdebugUtils.runVoidMethod("setLastException",BA.rdebugUtils.runMethod(false, "processBAFromBA", _ba), e21.toString()); BA.debugLineNum = 608;BA.debugLine="ToastMessageShow(\"No se pudo hacer la copia: \"&";
Debug.ShouldStop(-2147483648);
subs.mostCurrent.__c.runVoidMethod ("ToastMessageShow",(Object)(BA.ObjectToCharSequence(RemoteObject.concat(RemoteObject.createImmutable("No se pudo hacer la copia: "),subs.mostCurrent.__c.runMethod(false,"LastException",_ba)))),(Object)(subs.mostCurrent.__c.getField(true,"True")));
 };
 BA.debugLineNum = 610;BA.debugLine="Log(\"rootExternal=\"&p)";
Debug.ShouldStop(2);
subs.mostCurrent.__c.runVoidMethod ("LogImpl","312582937",RemoteObject.concat(RemoteObject.createImmutable("rootExternal="),_p),0);
 BA.debugLineNum = 611;BA.debugLine="Log(\"File.DirInternal=\"&File.DirInternal)";
Debug.ShouldStop(4);
subs.mostCurrent.__c.runVoidMethod ("LogImpl","312582938",RemoteObject.concat(RemoteObject.createImmutable("File.DirInternal="),subs.mostCurrent.__c.getField(false,"File").runMethod(true,"getDirInternal")),0);
 BA.debugLineNum = 612;BA.debugLine="Log(\"File.DirRootExternal=\"&File.DirRootExternal";
Debug.ShouldStop(8);
subs.mostCurrent.__c.runVoidMethod ("LogImpl","312582939",RemoteObject.concat(RemoteObject.createImmutable("File.DirRootExternal="),subs.mostCurrent.__c.getField(false,"File").runMethod(true,"getDirRootExternal")),0);
 }else {
 BA.debugLineNum = 614;BA.debugLine="ToastMessageShow(\"Sin permisos\", False)";
Debug.ShouldStop(32);
subs.mostCurrent.__c.runVoidMethod ("ToastMessageShow",(Object)(BA.ObjectToCharSequence("Sin permisos")),(Object)(subs.mostCurrent.__c.getField(true,"False")));
 };
 BA.debugLineNum = 616;BA.debugLine="End Sub";
Debug.ShouldStop(128);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _cuantosvariablestengobd(RemoteObject _ba,RemoteObject _promo) throws Exception{
try {
		Debug.PushSubsStack("cuantosVariablesTengoBD (subs) ","subs",9,_ba,subs.mostCurrent,1172);
if (RapidSub.canDelegate("cuantosvariablestengobd")) { return keymon.lat.medicomed.subs.remoteMe.runUserSub(false, "subs","cuantosvariablestengobd", _ba, _promo);}
;
Debug.locals.put("promo", _promo);
 BA.debugLineNum = 1172;BA.debugLine="Sub cuantosVariablesTengoBD(promo As String) As St";
Debug.ShouldStop(524288);
 BA.debugLineNum = 1183;BA.debugLine="End Sub";
Debug.ShouldStop(1073741824);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _dameerroresjson(RemoteObject _ba,RemoteObject _sql,RemoteObject _maxerrores,RemoteObject _comprimido) throws Exception{
try {
		Debug.PushSubsStack("dameErroresJSON (subs) ","subs",9,_ba,subs.mostCurrent,523);
if (RapidSub.canDelegate("dameerroresjson")) { return keymon.lat.medicomed.subs.remoteMe.runUserSub(false, "subs","dameerroresjson", _ba, _sql, _maxerrores, _comprimido);}
RemoteObject _j = RemoteObject.declareNull("anywheresoftware.b4a.objects.collections.JSONParser.JSONGenerator");
RemoteObject _lim = RemoteObject.createImmutable("");
RemoteObject _cur = RemoteObject.declareNull("anywheresoftware.b4a.sql.SQL.ResultSetWrapper");
RemoteObject _l = RemoteObject.declareNull("anywheresoftware.b4a.objects.collections.List");
RemoteObject _i = RemoteObject.createImmutable(0);
RemoteObject _m = RemoteObject.declareNull("anywheresoftware.b4a.objects.collections.Map");
RemoteObject _m2 = RemoteObject.declareNull("anywheresoftware.b4a.objects.collections.Map");
;
Debug.locals.put("SQL", _sql);
Debug.locals.put("maxErrores", _maxerrores);
Debug.locals.put("comprimido", _comprimido);
 BA.debugLineNum = 523;BA.debugLine="Sub dameErroresJSON(SQL As SQL, maxErrores As Int,";
Debug.ShouldStop(1024);
 BA.debugLineNum = 524;BA.debugLine="Log(\"dameErroresJSON\")";
Debug.ShouldStop(2048);
subs.mostCurrent.__c.runVoidMethod ("LogImpl","312386305",RemoteObject.createImmutable("dameErroresJSON"),0);
 BA.debugLineNum = 525;BA.debugLine="Private j As JSONGenerator";
Debug.ShouldStop(4096);
_j = RemoteObject.createNew ("anywheresoftware.b4a.objects.collections.JSONParser.JSONGenerator");Debug.locals.put("j", _j);
 BA.debugLineNum = 526;BA.debugLine="Private lim As String";
Debug.ShouldStop(8192);
_lim = RemoteObject.createImmutable("");Debug.locals.put("lim", _lim);
 BA.debugLineNum = 527;BA.debugLine="Private cur As ResultSet";
Debug.ShouldStop(16384);
_cur = RemoteObject.createNew ("anywheresoftware.b4a.sql.SQL.ResultSetWrapper");Debug.locals.put("cur", _cur);
 BA.debugLineNum = 528;BA.debugLine="Private l As List";
Debug.ShouldStop(32768);
_l = RemoteObject.createNew ("anywheresoftware.b4a.objects.collections.List");Debug.locals.put("l", _l);
 BA.debugLineNum = 529;BA.debugLine="Private i As Int = 0";
Debug.ShouldStop(65536);
_i = BA.numberCast(int.class, 0);Debug.locals.put("i", _i);Debug.locals.put("i", _i);
 BA.debugLineNum = 530;BA.debugLine="l.Initialize";
Debug.ShouldStop(131072);
_l.runVoidMethod ("Initialize");
 BA.debugLineNum = 531;BA.debugLine="Dim m, m2 As Map";
Debug.ShouldStop(262144);
_m = RemoteObject.createNew ("anywheresoftware.b4a.objects.collections.Map");Debug.locals.put("m", _m);
_m2 = RemoteObject.createNew ("anywheresoftware.b4a.objects.collections.Map");Debug.locals.put("m2", _m2);
 BA.debugLineNum = 532;BA.debugLine="m2.Initialize";
Debug.ShouldStop(524288);
_m2.runVoidMethod ("Initialize");
 BA.debugLineNum = 533;BA.debugLine="If maxErrores = 0 Then lim = \"\" Else lim = \"limit";
Debug.ShouldStop(1048576);
if (RemoteObject.solveBoolean("=",_maxerrores,BA.numberCast(double.class, 0))) { 
_lim = BA.ObjectToString("");Debug.locals.put("lim", _lim);}
else {
_lim = RemoteObject.concat(RemoteObject.createImmutable("limit "),_maxerrores);Debug.locals.put("lim", _lim);};
 BA.debugLineNum = 534;BA.debugLine="cur = SQL.ExecQuery(\"select * from errores order";
Debug.ShouldStop(2097152);
_cur = RemoteObject.declareNull("anywheresoftware.b4a.AbsObjectWrapper").runMethod(false, "ConvertToWrapper", RemoteObject.createNew("anywheresoftware.b4a.sql.SQL.ResultSetWrapper"), _sql.runMethod(false,"ExecQuery",(Object)(RemoteObject.concat(RemoteObject.createImmutable("select * from errores order by fecha desc "),_lim))));Debug.locals.put("cur", _cur);
 BA.debugLineNum = 535;BA.debugLine="Do While cur.NextRow";
Debug.ShouldStop(4194304);
while (_cur.runMethod(true,"NextRow").<Boolean>get().booleanValue()) {
 BA.debugLineNum = 536;BA.debugLine="m.Initialize";
Debug.ShouldStop(8388608);
_m.runVoidMethod ("Initialize");
 BA.debugLineNum = 537;BA.debugLine="m.Put(\"fecha\", cur.GetString(\"fecha\"))";
Debug.ShouldStop(16777216);
_m.runVoidMethod ("Put",(Object)(RemoteObject.createImmutable(("fecha"))),(Object)((_cur.runMethod(true,"GetString",(Object)(RemoteObject.createImmutable("fecha"))))));
 BA.debugLineNum = 538;BA.debugLine="m.Put(\"error\", cur.GetString(\"error\"))";
Debug.ShouldStop(33554432);
_m.runVoidMethod ("Put",(Object)(RemoteObject.createImmutable(("error"))),(Object)((_cur.runMethod(true,"GetString",(Object)(RemoteObject.createImmutable("error"))))));
 BA.debugLineNum = 539;BA.debugLine="m2.Put(i,m)";
Debug.ShouldStop(67108864);
_m2.runVoidMethod ("Put",(Object)((_i)),(Object)((_m.getObject())));
 BA.debugLineNum = 540;BA.debugLine="i = i + 1";
Debug.ShouldStop(134217728);
_i = RemoteObject.solve(new RemoteObject[] {_i,RemoteObject.createImmutable(1)}, "+",1, 1);Debug.locals.put("i", _i);
 }
;
 BA.debugLineNum = 542;BA.debugLine="cur.Close";
Debug.ShouldStop(536870912);
_cur.runVoidMethod ("Close");
 BA.debugLineNum = 543;BA.debugLine="j.Initialize(m2)";
Debug.ShouldStop(1073741824);
_j.runVoidMethod ("Initialize",(Object)(_m2));
 BA.debugLineNum = 544;BA.debugLine="Log(j.ToString)";
Debug.ShouldStop(-2147483648);
subs.mostCurrent.__c.runVoidMethod ("LogImpl","312386325",_j.runMethod(true,"ToString"),0);
 BA.debugLineNum = 545;BA.debugLine="If comprimido Then";
Debug.ShouldStop(1);
if (_comprimido.<Boolean>get().booleanValue()) { 
 BA.debugLineNum = 546;BA.debugLine="Return compress(j.ToString)";
Debug.ShouldStop(2);
if (true) return _compress(_ba,_j.runMethod(true,"ToString"));
 }else {
 BA.debugLineNum = 548;BA.debugLine="Return j.ToString";
Debug.ShouldStop(8);
if (true) return _j.runMethod(true,"ToString");
 };
 BA.debugLineNum = 550;BA.debugLine="End Sub";
Debug.ShouldStop(32);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _dameruta(RemoteObject _ba,RemoteObject _inicioruta,RemoteObject _origenruta) throws Exception{
try {
		Debug.PushSubsStack("dameRuta (subs) ","subs",9,_ba,subs.mostCurrent,131);
if (RapidSub.canDelegate("dameruta")) { return keymon.lat.medicomed.subs.remoteMe.runUserSub(false, "subs","dameruta", _ba, _inicioruta, _origenruta);}
RemoteObject _fechainicio = RemoteObject.createImmutable("");
RemoteObject _c = RemoteObject.declareNull("anywheresoftware.b4a.sql.SQL.CursorWrapper");
RemoteObject _ruta2 = RemoteObject.createImmutable("");
int _i = 0;
;
Debug.locals.put("inicioRuta", _inicioruta);
Debug.locals.put("origenRuta", _origenruta);
 BA.debugLineNum = 131;BA.debugLine="Sub dameRuta(inicioRuta As String, origenRuta As S";
Debug.ShouldStop(4);
 BA.debugLineNum = 133;BA.debugLine="Dim fechaInicio As String";
Debug.ShouldStop(16);
_fechainicio = RemoteObject.createImmutable("");Debug.locals.put("fechaInicio", _fechainicio);
 BA.debugLineNum = 134;BA.debugLine="Try 'incioRuta es numero";
Debug.ShouldStop(32);
try { BA.debugLineNum = 135;BA.debugLine="inicioRuta = inicioRuta * 1";
Debug.ShouldStop(64);
_inicioruta = BA.NumberToString(RemoteObject.solve(new RemoteObject[] {BA.numberCast(double.class, _inicioruta),RemoteObject.createImmutable(1)}, "*",0, 0));Debug.locals.put("inicioRuta", _inicioruta);
 BA.debugLineNum = 137;BA.debugLine="fechaInicio = fechaKMT(DateTime.Now - (DateTime.";
Debug.ShouldStop(256);
_fechainicio = _fechakmt(_ba,BA.NumberToString(RemoteObject.solve(new RemoteObject[] {subs.mostCurrent.__c.getField(false,"DateTime").runMethod(true,"getNow"),(RemoteObject.solve(new RemoteObject[] {subs.mostCurrent.__c.getField(false,"DateTime").getField(true,"TicksPerHour"),BA.numberCast(double.class, _inicioruta)}, "*",0, 0))}, "-",1, 0)));Debug.locals.put("fechaInicio", _fechainicio);
 Debug.CheckDeviceExceptions();
} 
       catch (Exception e6) {
			BA.rdebugUtils.runVoidMethod("setLastException",BA.rdebugUtils.runMethod(false, "processBAFromBA", _ba), e6.toString()); BA.debugLineNum = 139;BA.debugLine="fechaInicio = fechaInicioHoy";
Debug.ShouldStop(1024);
_fechainicio = _fechainiciohoy(_ba);Debug.locals.put("fechaInicio", _fechainicio);
 };
 BA.debugLineNum = 142;BA.debugLine="If subsLogs Then Log(\"fechaInicio: \"&fechaInicio&";
Debug.ShouldStop(8192);
if (subs._subslogs.<Boolean>get().booleanValue()) { 
subs.mostCurrent.__c.runVoidMethod ("LogImpl","311206667",RemoteObject.concat(RemoteObject.createImmutable("fechaInicio: "),_fechainicio,RemoteObject.createImmutable(" | rutaHrsAtras="),subs._rutahrsatras),0);};
 BA.debugLineNum = 143;BA.debugLine="Dim c As Cursor";
Debug.ShouldStop(16384);
_c = RemoteObject.createNew ("anywheresoftware.b4a.sql.SQL.CursorWrapper");Debug.locals.put("c", _c);
 BA.debugLineNum = 144;BA.debugLine="If kmt.IsInitialized = False Then kmt.Initialize(";
Debug.ShouldStop(32768);
if (RemoteObject.solveBoolean("=",subs._kmt.runMethod(true,"IsInitialized"),subs.mostCurrent.__c.getField(true,"False"))) { 
subs._kmt.runVoidMethod ("Initialize",(Object)(subs.mostCurrent._starter._ruta /*RemoteObject*/ ),(Object)(BA.ObjectToString("kmt.db")),(Object)(subs.mostCurrent.__c.getField(true,"True")));};
 BA.debugLineNum = 145;BA.debugLine="If subsLogs Then Log(\"select FECHA, LAT, LON from";
Debug.ShouldStop(65536);
if (subs._subslogs.<Boolean>get().booleanValue()) { 
subs.mostCurrent.__c.runVoidMethod ("LogImpl","311206670",RemoteObject.concat(RemoteObject.createImmutable("select FECHA, LAT, LON from "),_origenruta,RemoteObject.createImmutable(" where FECHA > "),_fechainicio,RemoteObject.createImmutable(" order by FECHA desc limit "),subs._rutamaxpoints),0);};
 BA.debugLineNum = 146;BA.debugLine="c = kmt.ExecQuery(\"select FECHA, LAT, LON from \"&";
Debug.ShouldStop(131072);
_c = RemoteObject.declareNull("anywheresoftware.b4a.AbsObjectWrapper").runMethod(false, "ConvertToWrapper", RemoteObject.createNew("anywheresoftware.b4a.sql.SQL.CursorWrapper"), subs._kmt.runMethod(false,"ExecQuery",(Object)(RemoteObject.concat(RemoteObject.createImmutable("select FECHA, LAT, LON from "),_origenruta,RemoteObject.createImmutable(" where FECHA > "),_fechainicio,RemoteObject.createImmutable(" order by FECHA desc limit "),subs._rutamaxpoints))));Debug.locals.put("c", _c);
 BA.debugLineNum = 147;BA.debugLine="c.Position = 0";
Debug.ShouldStop(262144);
_c.runMethod(true,"setPosition",BA.numberCast(int.class, 0));
 BA.debugLineNum = 148;BA.debugLine="Dim ruta2 As String = \"\"";
Debug.ShouldStop(524288);
_ruta2 = BA.ObjectToString("");Debug.locals.put("ruta2", _ruta2);Debug.locals.put("ruta2", _ruta2);
 BA.debugLineNum = 149;BA.debugLine="If c.RowCount>0 Then";
Debug.ShouldStop(1048576);
if (RemoteObject.solveBoolean(">",_c.runMethod(true,"getRowCount"),BA.numberCast(double.class, 0))) { 
 BA.debugLineNum = 150;BA.debugLine="For i=0 To c.RowCount -1";
Debug.ShouldStop(2097152);
{
final int step16 = 1;
final int limit16 = RemoteObject.solve(new RemoteObject[] {_c.runMethod(true,"getRowCount"),RemoteObject.createImmutable(1)}, "-",1, 1).<Integer>get().intValue();
_i = 0 ;
for (;(step16 > 0 && _i <= limit16) || (step16 < 0 && _i >= limit16) ;_i = ((int)(0 + _i + step16))  ) {
Debug.locals.put("i", _i);
 BA.debugLineNum = 151;BA.debugLine="c.Position=i";
Debug.ShouldStop(4194304);
_c.runMethod(true,"setPosition",BA.numberCast(int.class, _i));
 BA.debugLineNum = 152;BA.debugLine="ruta2=ruta2&CRLF&c.GetString(\"LAT\")&\",\"&c.GetSt";
Debug.ShouldStop(8388608);
_ruta2 = RemoteObject.concat(_ruta2,subs.mostCurrent.__c.getField(true,"CRLF"),_c.runMethod(true,"GetString",(Object)(RemoteObject.createImmutable("LAT"))),RemoteObject.createImmutable(","),_c.runMethod(true,"GetString",(Object)(RemoteObject.createImmutable("LON"))),RemoteObject.createImmutable(","),_c.runMethod(true,"GetString",(Object)(RemoteObject.createImmutable("FECHA"))));Debug.locals.put("ruta2", _ruta2);
 BA.debugLineNum = 153;BA.debugLine="B4XPages.MainPage.fechaRuta = c.GetString(\"FECH";
Debug.ShouldStop(16777216);
subs.mostCurrent._b4xpages.runMethod(false,"_mainpage" /*RemoteObject*/ ,_ba).setField ("_fecharuta" /*RemoteObject*/ ,_c.runMethod(true,"GetString",(Object)(RemoteObject.createImmutable("FECHA"))));
 }
}Debug.locals.put("i", _i);
;
 };
 BA.debugLineNum = 156;BA.debugLine="c.Close";
Debug.ShouldStop(134217728);
_c.runVoidMethod ("Close");
 BA.debugLineNum = 157;BA.debugLine="Return compress(ruta2)";
Debug.ShouldStop(268435456);
if (true) return _compress(_ba,_ruta2);
 BA.debugLineNum = 158;BA.debugLine="End Sub";
Debug.ShouldStop(536870912);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _dameusuariodedb(RemoteObject _ba) throws Exception{
try {
		Debug.PushSubsStack("dameUsuarioDeDB (subs) ","subs",9,_ba,subs.mostCurrent,657);
if (RapidSub.canDelegate("dameusuariodedb")) { return keymon.lat.medicomed.subs.remoteMe.runUserSub(false, "subs","dameusuariodedb", _ba);}
RemoteObject _c = RemoteObject.declareNull("anywheresoftware.b4a.sql.SQL.CursorWrapper");
RemoteObject _u = RemoteObject.createImmutable("");
;
 BA.debugLineNum = 657;BA.debugLine="Sub dameUsuarioDeDB As String 'ignore";
Debug.ShouldStop(65536);
 BA.debugLineNum = 658;BA.debugLine="Private c As Cursor";
Debug.ShouldStop(131072);
_c = RemoteObject.createNew ("anywheresoftware.b4a.sql.SQL.CursorWrapper");Debug.locals.put("c", _c);
 BA.debugLineNum = 659;BA.debugLine="Private u As String = \"SinUsuario\"";
Debug.ShouldStop(262144);
_u = BA.ObjectToString("SinUsuario");Debug.locals.put("u", _u);Debug.locals.put("u", _u);
 BA.debugLineNum = 660;BA.debugLine="If Not(kmt.IsInitialized) Then revisaBD";
Debug.ShouldStop(524288);
if (subs.mostCurrent.__c.runMethod(true,"Not",(Object)(subs._kmt.runMethod(true,"IsInitialized"))).<Boolean>get().booleanValue()) { 
_revisabd(_ba);};
 BA.debugLineNum = 661;BA.debugLine="c=kmt.ExecQuery(\"select USUARIO from usuarioa\")";
Debug.ShouldStop(1048576);
_c = RemoteObject.declareNull("anywheresoftware.b4a.AbsObjectWrapper").runMethod(false, "ConvertToWrapper", RemoteObject.createNew("anywheresoftware.b4a.sql.SQL.CursorWrapper"), subs._kmt.runMethod(false,"ExecQuery",(Object)(RemoteObject.createImmutable("select USUARIO from usuarioa"))));Debug.locals.put("c", _c);
 BA.debugLineNum = 662;BA.debugLine="c.Position=0";
Debug.ShouldStop(2097152);
_c.runMethod(true,"setPosition",BA.numberCast(int.class, 0));
 BA.debugLineNum = 663;BA.debugLine="If c.RowCount > 0 Then u = c.GetString(\"USUARIO\")";
Debug.ShouldStop(4194304);
if (RemoteObject.solveBoolean(">",_c.runMethod(true,"getRowCount"),BA.numberCast(double.class, 0))) { 
_u = _c.runMethod(true,"GetString",(Object)(RemoteObject.createImmutable("USUARIO")));Debug.locals.put("u", _u);};
 BA.debugLineNum = 664;BA.debugLine="c.Close";
Debug.ShouldStop(8388608);
_c.runVoidMethod ("Close");
 BA.debugLineNum = 665;BA.debugLine="Return u";
Debug.ShouldStop(16777216);
if (true) return _u;
 BA.debugLineNum = 666;BA.debugLine="End Sub";
Debug.ShouldStop(33554432);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _decompress(RemoteObject _ba,RemoteObject _base64) throws Exception{
try {
		Debug.PushSubsStack("decompress (subs) ","subs",9,_ba,subs.mostCurrent,52);
if (RapidSub.canDelegate("decompress")) { return keymon.lat.medicomed.subs.remoteMe.runUserSub(false, "subs","decompress", _ba, _base64);}
RemoteObject _decompressedbytes = null;
RemoteObject _bc = RemoteObject.declareNull("anywheresoftware.b4a.agraham.byteconverter.ByteConverter");
RemoteObject _uncompressed = RemoteObject.createImmutable("");
;
Debug.locals.put("base64", _base64);
 BA.debugLineNum = 52;BA.debugLine="Sub decompress(base64 As String) As String 'ignore";
Debug.ShouldStop(524288);
 BA.debugLineNum = 53;BA.debugLine="Dim decompressedbytes() As Byte = su.DecodeBase64";
Debug.ShouldStop(1048576);
_decompressedbytes = subs._su.runMethod(false,"DecodeBase64",(Object)(_base64));Debug.locals.put("decompressedbytes", _decompressedbytes);Debug.locals.put("decompressedbytes", _decompressedbytes);
 BA.debugLineNum = 55;BA.debugLine="Dim bc As ByteConverter";
Debug.ShouldStop(4194304);
_bc = RemoteObject.createNew ("anywheresoftware.b4a.agraham.byteconverter.ByteConverter");Debug.locals.put("bc", _bc);
 BA.debugLineNum = 56;BA.debugLine="Dim uncompressed As String = bc.StringFromBytes(d";
Debug.ShouldStop(8388608);
_uncompressed = _bc.runMethod(true,"StringFromBytes",(Object)(_decompressedbytes),(Object)(RemoteObject.createImmutable("UTF8")));Debug.locals.put("uncompressed", _uncompressed);Debug.locals.put("uncompressed", _uncompressed);
 BA.debugLineNum = 57;BA.debugLine="Log($\"Descomprimido: ${uncompressed.Length}\"$)";
Debug.ShouldStop(16777216);
subs.mostCurrent.__c.runVoidMethod ("LogImpl","310813445",(RemoteObject.concat(RemoteObject.createImmutable("Descomprimido: "),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_uncompressed.runMethod(true,"length")))),RemoteObject.createImmutable(""))),0);
 BA.debugLineNum = 59;BA.debugLine="Return uncompressed";
Debug.ShouldStop(67108864);
if (true) return _uncompressed;
 BA.debugLineNum = 60;BA.debugLine="End Sub";
Debug.ShouldStop(134217728);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _deleteerrorlog_db(RemoteObject _ba) throws Exception{
try {
		Debug.PushSubsStack("deleteErrorLog_DB (subs) ","subs",9,_ba,subs.mostCurrent,168);
if (RapidSub.canDelegate("deleteerrorlog_db")) { return keymon.lat.medicomed.subs.remoteMe.runUserSub(false, "subs","deleteerrorlog_db", _ba);}
;
 BA.debugLineNum = 168;BA.debugLine="Sub deleteErrorLog_DB 'ignore";
Debug.ShouldStop(128);
 BA.debugLineNum = 169;BA.debugLine="errorLog.ExecNonQuery(\"delete from errores\")";
Debug.ShouldStop(256);
subs._errorlog.runVoidMethod ("ExecNonQuery",(Object)(RemoteObject.createImmutable("delete from errores")));
 BA.debugLineNum = 170;BA.debugLine="errorLog.ExecNonQuery(\"vacuum;\")";
Debug.ShouldStop(512);
subs._errorlog.runVoidMethod ("ExecNonQuery",(Object)(RemoteObject.createImmutable("vacuum;")));
 BA.debugLineNum = 171;BA.debugLine="ToastMessageShow(\"BD Errores Borrada\", False)";
Debug.ShouldStop(1024);
subs.mostCurrent.__c.runVoidMethod ("ToastMessageShow",(Object)(BA.ObjectToCharSequence("BD Errores Borrada")),(Object)(subs.mostCurrent.__c.getField(true,"False")));
 BA.debugLineNum = 172;BA.debugLine="End Sub";
Debug.ShouldStop(2048);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _deletegps_db(RemoteObject _ba) throws Exception{
try {
		Debug.PushSubsStack("deleteGPS_DB (subs) ","subs",9,_ba,subs.mostCurrent,161);
if (RapidSub.canDelegate("deletegps_db")) { return keymon.lat.medicomed.subs.remoteMe.runUserSub(false, "subs","deletegps_db", _ba);}
;
 BA.debugLineNum = 161;BA.debugLine="Sub deleteGPS_DB 'ignore";
Debug.ShouldStop(1);
 BA.debugLineNum = 162;BA.debugLine="kmt.ExecNonQuery(\"delete from RUTA_GPS\")";
Debug.ShouldStop(2);
subs._kmt.runVoidMethod ("ExecNonQuery",(Object)(RemoteObject.createImmutable("delete from RUTA_GPS")));
 BA.debugLineNum = 163;BA.debugLine="kmt.ExecNonQuery(\"vacuum;\")";
Debug.ShouldStop(4);
subs._kmt.runVoidMethod ("ExecNonQuery",(Object)(RemoteObject.createImmutable("vacuum;")));
 BA.debugLineNum = 164;BA.debugLine="ToastMessageShow(\"Borramos BD Coords GPS\", False)";
Debug.ShouldStop(8);
subs.mostCurrent.__c.runVoidMethod ("ToastMessageShow",(Object)(BA.ObjectToCharSequence("Borramos BD Coords GPS")),(Object)(subs.mostCurrent.__c.getField(true,"False")));
 BA.debugLineNum = 165;BA.debugLine="End Sub";
Debug.ShouldStop(16);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _fechainiciohoy(RemoteObject _ba) throws Exception{
try {
		Debug.PushSubsStack("fechaInicioHoy (subs) ","subs",9,_ba,subs.mostCurrent,338);
if (RapidSub.canDelegate("fechainiciohoy")) { return keymon.lat.medicomed.subs.remoteMe.runUserSub(false, "subs","fechainiciohoy", _ba);}
RemoteObject _origformat = RemoteObject.createImmutable("");
RemoteObject _h = RemoteObject.createImmutable("");
;
 BA.debugLineNum = 338;BA.debugLine="Sub fechaInicioHoy As String 'ignore";
Debug.ShouldStop(131072);
 BA.debugLineNum = 339;BA.debugLine="Dim OrigFormat As String = DateTime.DateFormat";
Debug.ShouldStop(262144);
_origformat = subs.mostCurrent.__c.getField(false,"DateTime").runMethod(true,"getDateFormat");Debug.locals.put("OrigFormat", _origformat);Debug.locals.put("OrigFormat", _origformat);
 BA.debugLineNum = 340;BA.debugLine="DateTime.DateFormat=\"yyMMdd\"";
Debug.ShouldStop(524288);
subs.mostCurrent.__c.getField(false,"DateTime").runMethod(true,"setDateFormat",BA.ObjectToString("yyMMdd"));
 BA.debugLineNum = 341;BA.debugLine="Private h As String = DateTime.Date(DateTime.Now";
Debug.ShouldStop(1048576);
_h = RemoteObject.concat(subs.mostCurrent.__c.getField(false,"DateTime").runMethod(true,"Date",(Object)(subs.mostCurrent.__c.getField(false,"DateTime").runMethod(true,"getNow"))),RemoteObject.createImmutable("000000"));Debug.locals.put("h", _h);Debug.locals.put("h", _h);
 BA.debugLineNum = 342;BA.debugLine="DateTime.DateFormat=OrigFormat  'return to orig";
Debug.ShouldStop(2097152);
subs.mostCurrent.__c.getField(false,"DateTime").runMethod(true,"setDateFormat",_origformat);
 BA.debugLineNum = 343;BA.debugLine="Log(\"Hoy=\"&h)";
Debug.ShouldStop(4194304);
subs.mostCurrent.__c.runVoidMethod ("LogImpl","311730949",RemoteObject.concat(RemoteObject.createImmutable("Hoy="),_h),0);
 BA.debugLineNum = 344;BA.debugLine="Return h";
Debug.ShouldStop(8388608);
if (true) return _h;
 BA.debugLineNum = 345;BA.debugLine="End Sub";
Debug.ShouldStop(16777216);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _fechakmt(RemoteObject _ba,RemoteObject _fecha) throws Exception{
try {
		Debug.PushSubsStack("fechaKMT (subs) ","subs",9,_ba,subs.mostCurrent,63);
if (RapidSub.canDelegate("fechakmt")) { return keymon.lat.medicomed.subs.remoteMe.runUserSub(false, "subs","fechakmt", _ba, _fecha);}
RemoteObject _origformat = RemoteObject.createImmutable("");
RemoteObject _nuevafecha = RemoteObject.createImmutable("");
;
Debug.locals.put("fecha", _fecha);
 BA.debugLineNum = 63;BA.debugLine="Sub fechaKMT(fecha As String) As String 'ignore";
Debug.ShouldStop(1073741824);
 BA.debugLineNum = 65;BA.debugLine="Dim OrigFormat As String = DateTime.DateFormat  '";
Debug.ShouldStop(1);
_origformat = subs.mostCurrent.__c.getField(false,"DateTime").runMethod(true,"getDateFormat");Debug.locals.put("OrigFormat", _origformat);Debug.locals.put("OrigFormat", _origformat);
 BA.debugLineNum = 66;BA.debugLine="DateTime.DateFormat=\"yyMMddHHmmss\"";
Debug.ShouldStop(2);
subs.mostCurrent.__c.getField(false,"DateTime").runMethod(true,"setDateFormat",BA.ObjectToString("yyMMddHHmmss"));
 BA.debugLineNum = 67;BA.debugLine="Dim nuevaFecha As String=DateTime.Date(fecha)";
Debug.ShouldStop(4);
_nuevafecha = subs.mostCurrent.__c.getField(false,"DateTime").runMethod(true,"Date",(Object)(BA.numberCast(long.class, _fecha)));Debug.locals.put("nuevaFecha", _nuevafecha);Debug.locals.put("nuevaFecha", _nuevafecha);
 BA.debugLineNum = 68;BA.debugLine="DateTime.DateFormat=OrigFormat  'return to orig d";
Debug.ShouldStop(8);
subs.mostCurrent.__c.getField(false,"DateTime").runMethod(true,"setDateFormat",_origformat);
 BA.debugLineNum = 70;BA.debugLine="Return nuevaFecha";
Debug.ShouldStop(32);
if (true) return _nuevafecha;
 BA.debugLineNum = 71;BA.debugLine="End Sub";
Debug.ShouldStop(64);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _fechakmt2ticks(RemoteObject _ba,RemoteObject _fkmt) throws Exception{
try {
		Debug.PushSubsStack("fechaKMT2Ticks (subs) ","subs",9,_ba,subs.mostCurrent,553);
if (RapidSub.canDelegate("fechakmt2ticks")) { return keymon.lat.medicomed.subs.remoteMe.runUserSub(false, "subs","fechakmt2ticks", _ba, _fkmt);}
RemoteObject _partefecha = RemoteObject.createImmutable("");
RemoteObject _partehora = RemoteObject.createImmutable("");
RemoteObject _origformat = RemoteObject.createImmutable("");
RemoteObject _ticks = RemoteObject.createImmutable(0L);
;
Debug.locals.put("fKMT", _fkmt);
 BA.debugLineNum = 553;BA.debugLine="Sub fechaKMT2Ticks(fKMT As String) As Long 'ignore";
Debug.ShouldStop(256);
 BA.debugLineNum = 554;BA.debugLine="Try";
Debug.ShouldStop(512);
try { BA.debugLineNum = 555;BA.debugLine="If fKMT.Length = 12 Then";
Debug.ShouldStop(1024);
if (RemoteObject.solveBoolean("=",_fkmt.runMethod(true,"length"),BA.numberCast(double.class, 12))) { 
 BA.debugLineNum = 556;BA.debugLine="Private parteFecha As String = fKMT.SubString2(";
Debug.ShouldStop(2048);
_partefecha = _fkmt.runMethod(true,"substring",(Object)(BA.numberCast(int.class, 0)),(Object)(BA.numberCast(int.class, 6)));Debug.locals.put("parteFecha", _partefecha);Debug.locals.put("parteFecha", _partefecha);
 BA.debugLineNum = 557;BA.debugLine="Private parteHora As String = fKMT.SubString(6)";
Debug.ShouldStop(4096);
_partehora = _fkmt.runMethod(true,"substring",(Object)(BA.numberCast(int.class, 6)));Debug.locals.put("parteHora", _partehora);Debug.locals.put("parteHora", _partehora);
 BA.debugLineNum = 558;BA.debugLine="Private OrigFormat As String = DateTime.DateFor";
Debug.ShouldStop(8192);
_origformat = subs.mostCurrent.__c.getField(false,"DateTime").runMethod(true,"getDateFormat");Debug.locals.put("OrigFormat", _origformat);Debug.locals.put("OrigFormat", _origformat);
 BA.debugLineNum = 559;BA.debugLine="DateTime.DateFormat=\"yymmdd\"";
Debug.ShouldStop(16384);
subs.mostCurrent.__c.getField(false,"DateTime").runMethod(true,"setDateFormat",BA.ObjectToString("yymmdd"));
 BA.debugLineNum = 560;BA.debugLine="DateTime.TimeFormat=\"HHmmss\"";
Debug.ShouldStop(32768);
subs.mostCurrent.__c.getField(false,"DateTime").runMethod(true,"setTimeFormat",BA.ObjectToString("HHmmss"));
 BA.debugLineNum = 561;BA.debugLine="Private ticks As Long = DateTime.DateTimeParse(";
Debug.ShouldStop(65536);
_ticks = subs.mostCurrent.__c.getField(false,"DateTime").runMethod(true,"DateTimeParse",(Object)(_partefecha),(Object)(_partehora));Debug.locals.put("ticks", _ticks);Debug.locals.put("ticks", _ticks);
 BA.debugLineNum = 562;BA.debugLine="DateTime.DateFormat=OrigFormat  'return to orig";
Debug.ShouldStop(131072);
subs.mostCurrent.__c.getField(false,"DateTime").runMethod(true,"setDateFormat",_origformat);
 BA.debugLineNum = 563;BA.debugLine="Return ticks";
Debug.ShouldStop(262144);
Debug.CheckDeviceExceptions();if (true) return _ticks;
 }else {
 BA.debugLineNum = 565;BA.debugLine="Log(\"Formato de fecha incorrecto, debe de ser '";
Debug.ShouldStop(1048576);
subs.mostCurrent.__c.runVoidMethod ("LogImpl","312451852",RemoteObject.concat(RemoteObject.createImmutable("Formato de fecha incorrecto, debe de ser 'YYMMDDHHMMSS', no '"),_fkmt,RemoteObject.createImmutable("' largo="),_fkmt.runMethod(true,"length")),0);
 BA.debugLineNum = 566;BA.debugLine="Return 0";
Debug.ShouldStop(2097152);
Debug.CheckDeviceExceptions();if (true) return BA.numberCast(long.class, 0);
 };
 Debug.CheckDeviceExceptions();
} 
       catch (Exception e16) {
			BA.rdebugUtils.runVoidMethod("setLastException",BA.rdebugUtils.runMethod(false, "processBAFromBA", _ba), e16.toString()); BA.debugLineNum = 569;BA.debugLine="Log(LastException)";
Debug.ShouldStop(16777216);
subs.mostCurrent.__c.runVoidMethod ("LogImpl","312451856",BA.ObjectToString(subs.mostCurrent.__c.runMethod(false,"LastException",_ba)),0);
 BA.debugLineNum = 570;BA.debugLine="LogColor($\"Fecha dada: ${fKMT}, Parte Fecha: ${p";
Debug.ShouldStop(33554432);
subs.mostCurrent.__c.runVoidMethod ("LogImpl","312451857",(RemoteObject.concat(RemoteObject.createImmutable("Fecha dada: "),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_fkmt))),RemoteObject.createImmutable(", Parte Fecha: "),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_partefecha))),RemoteObject.createImmutable(", Parte Hora: "),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_partehora))),RemoteObject.createImmutable(""))),subs.mostCurrent.__c.getField(false,"Colors").getField(true,"Red"));
 BA.debugLineNum = 571;BA.debugLine="Return 0";
Debug.ShouldStop(67108864);
if (true) return BA.numberCast(long.class, 0);
 };
 BA.debugLineNum = 573;BA.debugLine="End Sub";
Debug.ShouldStop(268435456);
return RemoteObject.createImmutable(0L);
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _fechanormal(RemoteObject _ba,RemoteObject _fecha) throws Exception{
try {
		Debug.PushSubsStack("fechanormal (subs) ","subs",9,_ba,subs.mostCurrent,1348);
if (RapidSub.canDelegate("fechanormal")) { return keymon.lat.medicomed.subs.remoteMe.runUserSub(false, "subs","fechanormal", _ba, _fecha);}
RemoteObject _origformat = RemoteObject.createImmutable("");
RemoteObject _nuevafecha = RemoteObject.createImmutable("");
;
Debug.locals.put("fecha", _fecha);
 BA.debugLineNum = 1348;BA.debugLine="Sub fechanormal(fecha As String) As String 'ignore";
Debug.ShouldStop(8);
 BA.debugLineNum = 1350;BA.debugLine="Dim OrigFormat As String = DateTime.DateFormat  '";
Debug.ShouldStop(32);
_origformat = subs.mostCurrent.__c.getField(false,"DateTime").runMethod(true,"getDateFormat");Debug.locals.put("OrigFormat", _origformat);Debug.locals.put("OrigFormat", _origformat);
 BA.debugLineNum = 1351;BA.debugLine="DateTime.DateFormat = \"YYYY/MM/dd HH:mm:ss\"";
Debug.ShouldStop(64);
subs.mostCurrent.__c.getField(false,"DateTime").runMethod(true,"setDateFormat",BA.ObjectToString("YYYY/MM/dd HH:mm:ss"));
 BA.debugLineNum = 1352;BA.debugLine="Dim nuevaFecha As String=DateTime.Date(fecha)";
Debug.ShouldStop(128);
_nuevafecha = subs.mostCurrent.__c.getField(false,"DateTime").runMethod(true,"Date",(Object)(BA.numberCast(long.class, _fecha)));Debug.locals.put("nuevaFecha", _nuevafecha);Debug.locals.put("nuevaFecha", _nuevafecha);
 BA.debugLineNum = 1353;BA.debugLine="DateTime.DateFormat = OrigFormat  'return to orig";
Debug.ShouldStop(256);
subs.mostCurrent.__c.getField(false,"DateTime").runMethod(true,"setDateFormat",_origformat);
 BA.debugLineNum = 1355;BA.debugLine="Return nuevaFecha";
Debug.ShouldStop(1024);
if (true) return _nuevafecha;
 BA.debugLineNum = 1356;BA.debugLine="End Sub";
Debug.ShouldStop(2048);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _getphnid(RemoteObject _ba) throws Exception{
try {
		Debug.PushSubsStack("getPhnId (subs) ","subs",9,_ba,subs.mostCurrent,20);
if (RapidSub.canDelegate("getphnid")) { return keymon.lat.medicomed.subs.remoteMe.runUserSub(false, "subs","getphnid", _ba);}
RemoteObject _t = RemoteObject.createImmutable("");
RemoteObject _s = RemoteObject.createImmutable("");
;
 BA.debugLineNum = 20;BA.debugLine="Sub getPhnId As String 'ignore";
Debug.ShouldStop(524288);
 BA.debugLineNum = 22;BA.debugLine="devModel = phn.Model";
Debug.ShouldStop(2097152);
subs._devmodel = subs._phn.runMethod(true,"getModel");
 BA.debugLineNum = 23;BA.debugLine="If devModel.Length <= 3 Then 'Si phn.Model esta e";
Debug.ShouldStop(4194304);
if (RemoteObject.solveBoolean("k",subs._devmodel.runMethod(true,"length"),BA.numberCast(double.class, 3))) { 
 BA.debugLineNum = 24;BA.debugLine="Dim t As String = phn.GetSettings(\"android_id\")";
Debug.ShouldStop(8388608);
_t = subs._phn.runMethod(true,"GetSettings",(Object)(RemoteObject.createImmutable("android_id")));Debug.locals.put("t", _t);Debug.locals.put("t", _t);
 BA.debugLineNum = 25;BA.debugLine="devModel = t";
Debug.ShouldStop(16777216);
subs._devmodel = _t;
 };
 BA.debugLineNum = 27;BA.debugLine="If devModel.Length >= 3 Then 'Si tenemos valor pa";
Debug.ShouldStop(67108864);
if (RemoteObject.solveBoolean("g",subs._devmodel.runMethod(true,"length"),BA.numberCast(double.class, 3))) { 
 BA.debugLineNum = 28;BA.debugLine="File.WriteString(File.DirInternal, \"phnId.txt\",";
Debug.ShouldStop(134217728);
subs.mostCurrent.__c.getField(false,"File").runVoidMethod ("WriteString",(Object)(subs.mostCurrent.__c.getField(false,"File").runMethod(true,"getDirInternal")),(Object)(BA.ObjectToString("phnId.txt")),(Object)(subs._devmodel));
 }else 
{ BA.debugLineNum = 30;BA.debugLine="Else If devModel.Length < 3 Then ' Si no tenemos";
Debug.ShouldStop(536870912);
if (RemoteObject.solveBoolean("<",subs._devmodel.runMethod(true,"length"),BA.numberCast(double.class, 3))) { 
 BA.debugLineNum = 31;BA.debugLine="Dim s As String = File.ReadString(File.DirIntern";
Debug.ShouldStop(1073741824);
_s = subs.mostCurrent.__c.getField(false,"File").runMethod(true,"ReadString",(Object)(subs.mostCurrent.__c.getField(false,"File").runMethod(true,"getDirInternal")),(Object)(RemoteObject.createImmutable("phnId.txt")));Debug.locals.put("s", _s);Debug.locals.put("s", _s);
 BA.debugLineNum = 32;BA.debugLine="devModel = s";
Debug.ShouldStop(-2147483648);
subs._devmodel = _s;
 }}
;
 BA.debugLineNum = 36;BA.debugLine="Return devModel";
Debug.ShouldStop(8);
if (true) return subs._devmodel;
 BA.debugLineNum = 37;BA.debugLine="End Sub";
Debug.ShouldStop(16);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _getssid(RemoteObject _ba) throws Exception{
try {
		Debug.PushSubsStack("getSSID (subs) ","subs",9,_ba,subs.mostCurrent,286);
if (RapidSub.canDelegate("getssid")) { return keymon.lat.medicomed.subs.remoteMe.runUserSub(false, "subs","getssid", _ba);}
;
 BA.debugLineNum = 286;BA.debugLine="Sub getSSID  'ignore";
Debug.ShouldStop(536870912);
 BA.debugLineNum = 291;BA.debugLine="End Sub";
Debug.ShouldStop(4);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _guardaclientehorainicio(RemoteObject _ba,RemoteObject _cliente) throws Exception{
try {
		Debug.PushSubsStack("guardaClienteHoraInicio (subs) ","subs",9,_ba,subs.mostCurrent,1202);
if (RapidSub.canDelegate("guardaclientehorainicio")) { return keymon.lat.medicomed.subs.remoteMe.runUserSub(false, "subs","guardaclientehorainicio", _ba, _cliente);}
;
Debug.locals.put("cliente", _cliente);
 BA.debugLineNum = 1202;BA.debugLine="Sub guardaClienteHoraInicio(cliente As String)";
Debug.ShouldStop(131072);
 BA.debugLineNum = 1203;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"insert into";
Debug.ShouldStop(262144);
subs.mostCurrent._b4xpages.runMethod(false,"_mainpage" /*RemoteObject*/ ,_ba).getField(false,"_skmt" /*RemoteObject*/ ).runVoidMethod ("ExecNonQuery2",(Object)(BA.ObjectToString("insert into PEDIDO_INICIO_FINAL(PIF_CLIENTE, PIF_HORA_INICIO, PIF_HORA_FINAL) VALUES(?,?,?) ")),(Object)(subs.mostCurrent.__c.runMethod(false, "ArrayToList", (Object)(RemoteObject.createNewArray("Object",new int[] {3},new Object[] {(_cliente),(subs.mostCurrent.__c.getField(false,"DateTime").runMethod(true,"getNow")),RemoteObject.createImmutable((0))})))));
 BA.debugLineNum = 1205;BA.debugLine="End Sub";
Debug.ShouldStop(1048576);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _guardainfoenarchivo(RemoteObject _ba,RemoteObject _coords) throws Exception{
try {
		Debug.PushSubsStack("guardaInfoEnArchivo (subs) ","subs",9,_ba,subs.mostCurrent,102);
if (RapidSub.canDelegate("guardainfoenarchivo")) { return keymon.lat.medicomed.subs.remoteMe.runUserSub(false, "subs","guardainfoenarchivo", _ba, _coords);}
RemoteObject _origformat = RemoteObject.createImmutable("");
RemoteObject _lastupdate = RemoteObject.createImmutable("");
RemoteObject _ubic = RemoteObject.createImmutable("");
RemoteObject _out = RemoteObject.declareNull("anywheresoftware.b4a.objects.streams.File.OutputStreamWrapper");
RemoteObject _s = RemoteObject.createImmutable("");
RemoteObject _t = null;
;
Debug.locals.put("coords", _coords);
 BA.debugLineNum = 102;BA.debugLine="Sub guardaInfoEnArchivo(coords As String) 'ignore";
Debug.ShouldStop(32);
 BA.debugLineNum = 104;BA.debugLine="Dim OrigFormat As String=DateTime.DateFormat  'sa";
Debug.ShouldStop(128);
_origformat = subs.mostCurrent.__c.getField(false,"DateTime").runMethod(true,"getDateFormat");Debug.locals.put("OrigFormat", _origformat);Debug.locals.put("OrigFormat", _origformat);
 BA.debugLineNum = 105;BA.debugLine="DateTime.DateFormat=\"MMM-dd HH:mm:ss\"";
Debug.ShouldStop(256);
subs.mostCurrent.__c.getField(false,"DateTime").runMethod(true,"setDateFormat",BA.ObjectToString("MMM-dd HH:mm:ss"));
 BA.debugLineNum = 106;BA.debugLine="Dim lastUpdate As String=DateTime.Date(DateTime.N";
Debug.ShouldStop(512);
_lastupdate = subs.mostCurrent.__c.getField(false,"DateTime").runMethod(true,"Date",(Object)(subs.mostCurrent.__c.getField(false,"DateTime").runMethod(true,"getNow")));Debug.locals.put("lastUpdate", _lastupdate);Debug.locals.put("lastUpdate", _lastupdate);
 BA.debugLineNum = 107;BA.debugLine="DateTime.DateFormat=OrigFormat  'return to orig d";
Debug.ShouldStop(1024);
subs.mostCurrent.__c.getField(false,"DateTime").runMethod(true,"setDateFormat",_origformat);
 BA.debugLineNum = 109;BA.debugLine="Dim ubic As String = coords&\",\"&lastUpdate";
Debug.ShouldStop(4096);
_ubic = RemoteObject.concat(_coords,RemoteObject.createImmutable(","),_lastupdate);Debug.locals.put("ubic", _ubic);Debug.locals.put("ubic", _ubic);
 BA.debugLineNum = 110;BA.debugLine="Dim out As OutputStream = File.OpenOutput(File.Di";
Debug.ShouldStop(8192);
_out = RemoteObject.createNew ("anywheresoftware.b4a.objects.streams.File.OutputStreamWrapper");
_out = subs.mostCurrent.__c.getField(false,"File").runMethod(false,"OpenOutput",(Object)(subs.mostCurrent.__c.getField(false,"File").runMethod(true,"getDirRootExternal")),(Object)(BA.ObjectToString("gps.txt")),(Object)(subs.mostCurrent.__c.getField(true,"True")));Debug.locals.put("out", _out);Debug.locals.put("out", _out);
 BA.debugLineNum = 111;BA.debugLine="Dim s As String = ubic & CRLF";
Debug.ShouldStop(16384);
_s = RemoteObject.concat(_ubic,subs.mostCurrent.__c.getField(true,"CRLF"));Debug.locals.put("s", _s);Debug.locals.put("s", _s);
 BA.debugLineNum = 112;BA.debugLine="Dim t() As Byte = s.GetBytes(\"UTF-8\")";
Debug.ShouldStop(32768);
_t = _s.runMethod(false,"getBytes",(Object)(RemoteObject.createImmutable("UTF-8")));Debug.locals.put("t", _t);Debug.locals.put("t", _t);
 BA.debugLineNum = 113;BA.debugLine="out.WriteBytes(t, 0, t.Length)";
Debug.ShouldStop(65536);
_out.runVoidMethod ("WriteBytes",(Object)(_t),(Object)(BA.numberCast(int.class, 0)),(Object)(_t.getField(true,"length")));
 BA.debugLineNum = 114;BA.debugLine="out.Close";
Debug.ShouldStop(131072);
_out.runVoidMethod ("Close");
 BA.debugLineNum = 115;BA.debugLine="End Sub";
Debug.ShouldStop(262144);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _guardainfoenbd(RemoteObject _ba,RemoteObject _coords) throws Exception{
try {
		Debug.PushSubsStack("guardaInfoEnBD (subs) ","subs",9,_ba,subs.mostCurrent,118);
if (RapidSub.canDelegate("guardainfoenbd")) { return keymon.lat.medicomed.subs.remoteMe.runUserSub(false, "subs","guardainfoenbd", _ba, _coords);}
RemoteObject _latlon = null;
;
Debug.locals.put("coords", _coords);
 BA.debugLineNum = 118;BA.debugLine="Sub guardaInfoEnBD(coords As String) 'ignore";
Debug.ShouldStop(2097152);
 BA.debugLineNum = 119;BA.debugLine="Log(\"Guardamos ubicacion en BD - \"&coords)";
Debug.ShouldStop(4194304);
subs.mostCurrent.__c.runVoidMethod ("LogImpl","311141121",RemoteObject.concat(RemoteObject.createImmutable("Guardamos ubicacion en BD - "),_coords),0);
 BA.debugLineNum = 120;BA.debugLine="Try";
Debug.ShouldStop(8388608);
try { BA.debugLineNum = 121;BA.debugLine="Dim latlon() As String = Regex.Split(\"\\|\", coord";
Debug.ShouldStop(16777216);
_latlon = subs.mostCurrent.__c.getField(false,"Regex").runMethod(false,"Split",(Object)(BA.ObjectToString("\\|")),(Object)(_coords));Debug.locals.put("latlon", _latlon);Debug.locals.put("latlon", _latlon);
 BA.debugLineNum = 122;BA.debugLine="If latlon.Length < 2 Then latlon = Regex.Split(\"";
Debug.ShouldStop(33554432);
if (RemoteObject.solveBoolean("<",_latlon.getField(true,"length"),BA.numberCast(double.class, 2))) { 
_latlon = subs.mostCurrent.__c.getField(false,"Regex").runMethod(false,"Split",(Object)(BA.ObjectToString(",")),(Object)(_coords));Debug.locals.put("latlon", _latlon);};
 BA.debugLineNum = 123;BA.debugLine="If subsLogs Then Log(\"LatLon=\"&latlon)";
Debug.ShouldStop(67108864);
if (subs._subslogs.<Boolean>get().booleanValue()) { 
subs.mostCurrent.__c.runVoidMethod ("LogImpl","311141125",RemoteObject.concat(RemoteObject.createImmutable("LatLon="),_latlon),0);};
 BA.debugLineNum = 124;BA.debugLine="kmt.ExecNonQuery2(\"INSERT INTO RUTA_GPS(FECHA, L";
Debug.ShouldStop(134217728);
subs._kmt.runVoidMethod ("ExecNonQuery2",(Object)(BA.ObjectToString("INSERT INTO RUTA_GPS(FECHA, LAT, LON) VALUES (?,?,?)")),(Object)(subs.mostCurrent.__c.runMethod(false, "ArrayToList", (Object)(RemoteObject.createNewArray("Object",new int[] {3},new Object[] {(_latlon.getArrayElement(true,BA.numberCast(int.class, 2))),(_latlon.getArrayElement(true,BA.numberCast(int.class, 0))),(_latlon.getArrayElement(true,BA.numberCast(int.class, 1)))})))));
 Debug.CheckDeviceExceptions();
} 
       catch (Exception e8) {
			BA.rdebugUtils.runVoidMethod("setLastException",BA.rdebugUtils.runMethod(false, "processBAFromBA", _ba), e8.toString()); BA.debugLineNum = 126;BA.debugLine="LogColor(LastException, Colors.red)";
Debug.ShouldStop(536870912);
subs.mostCurrent.__c.runVoidMethod ("LogImpl","311141128",BA.ObjectToString(subs.mostCurrent.__c.runMethod(false,"LastException",_ba)),subs.mostCurrent.__c.getField(false,"Colors").getField(true,"Red"));
 };
 BA.debugLineNum = 128;BA.debugLine="End Sub";
Debug.ShouldStop(-2147483648);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _guardaproducto(RemoteObject _ba,RemoteObject _cedis,RemoteObject _costou,RemoteObject _cant,RemoteObject _nombre,RemoteObject _prodid,RemoteObject _clienteid,RemoteObject _fecha,RemoteObject _usuario,RemoteObject _rutav,RemoteObject _preciosin,RemoteObject _tipoventa) throws Exception{
try {
		Debug.PushSubsStack("guardaProducto (subs) ","subs",9,_ba,subs.mostCurrent,765);
if (RapidSub.canDelegate("guardaproducto")) { return keymon.lat.medicomed.subs.remoteMe.runUserSub(false, "subs","guardaproducto", _ba, _cedis, _costou, _cant, _nombre, _prodid, _clienteid, _fecha, _usuario, _rutav, _preciosin, _tipoventa);}
RemoteObject _c = RemoteObject.declareNull("anywheresoftware.b4a.sql.SQL.CursorWrapper");
;
Debug.locals.put("cedis", _cedis);
Debug.locals.put("costoU", _costou);
Debug.locals.put("cant", _cant);
Debug.locals.put("nombre", _nombre);
Debug.locals.put("prodId", _prodid);
Debug.locals.put("clienteId", _clienteid);
Debug.locals.put("fecha", _fecha);
Debug.locals.put("usuario", _usuario);
Debug.locals.put("rutaV", _rutav);
Debug.locals.put("precioSin", _preciosin);
Debug.locals.put("tipoVenta", _tipoventa);
 BA.debugLineNum = 765;BA.debugLine="Sub guardaProducto(cedis As String, costoU As Stri";
Debug.ShouldStop(268435456);
 BA.debugLineNum = 766;BA.debugLine="LogColor(\"guardaProducto: \"&prodId&\", cant=\"&cant";
Debug.ShouldStop(536870912);
subs.mostCurrent.__c.runVoidMethod ("LogImpl","313500417",RemoteObject.concat(RemoteObject.createImmutable("guardaProducto: "),_prodid,RemoteObject.createImmutable(", cant="),_cant),subs.mostCurrent.__c.getField(false,"Colors").getField(true,"Magenta"));
 BA.debugLineNum = 767;BA.debugLine="Private c As Cursor";
Debug.ShouldStop(1073741824);
_c = RemoteObject.createNew ("anywheresoftware.b4a.sql.SQL.CursorWrapper");Debug.locals.put("c", _c);
 BA.debugLineNum = 768;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"INSERT INTO";
Debug.ShouldStop(-2147483648);
subs.mostCurrent._b4xpages.runMethod(false,"_mainpage" /*RemoteObject*/ ,_ba).getField(false,"_skmt" /*RemoteObject*/ ).runVoidMethod ("ExecNonQuery2",(Object)(BA.ObjectToString("INSERT INTO  PEDIDO (PE_CEDIS,PE_COSTO_TOT,PE_COSTOU,PE_CANT,PE_PRONOMBRE,PE_PROID,PE_CLIENTE,PE_FECHA,PE_USUARIO,PE_RUTA,PE_COSTO_SIN,PE_FOLIO) VALUES(?,?,?,?,?,?,?,?,?,?,?,?) ")),(Object)(subs.mostCurrent.__c.runMethod(false, "ArrayToList", (Object)(RemoteObject.createNewArray("Object",new int[] {12},new Object[] {(_cedis),((RemoteObject.solve(new RemoteObject[] {BA.numberCast(double.class, _cant),BA.numberCast(double.class, _costou)}, "*",0, 0))),(_costou),(_cant),(_nombre),(_prodid),(_clienteid),(_fecha),(_usuario),(_rutav),(_preciosin),(_tipoventa)})))));
 BA.debugLineNum = 769;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"update cat_";
Debug.ShouldStop(1);
subs.mostCurrent._b4xpages.runMethod(false,"_mainpage" /*RemoteObject*/ ,_ba).getField(false,"_skmt" /*RemoteObject*/ ).runVoidMethod ("ExecNonQuery2",(Object)(BA.ObjectToString("update cat_gunaprod set cat_gp_almacen = cat_gp_almacen - ? where cat_gp_id = ? ")),(Object)(subs.mostCurrent.__c.runMethod(false, "ArrayToList", (Object)(RemoteObject.createNewArray("Object",new int[] {2},new Object[] {(_cant),(_prodid)})))));
 BA.debugLineNum = 770;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"select sum(pe";
Debug.ShouldStop(2);
_c = RemoteObject.declareNull("anywheresoftware.b4a.AbsObjectWrapper").runMethod(false, "ConvertToWrapper", RemoteObject.createNew("anywheresoftware.b4a.sql.SQL.CursorWrapper"), subs.mostCurrent._b4xpages.runMethod(false,"_mainpage" /*RemoteObject*/ ,_ba).getField(false,"_skmt" /*RemoteObject*/ ).runMethod(false,"ExecQuery",(Object)(RemoteObject.createImmutable("select sum(pe_costo_tot) as TOTAL_CLIE, SUM(PE_CANT) AS CANT_CLIE, SUM(PE_COSTO_SIN) AS TOTAL_CLIE_SIN FROM PEDIDO WHERE PE_CLIENTE IN (Select CUENTA from cuentaa)"))));Debug.locals.put("c", _c);
 BA.debugLineNum = 771;BA.debugLine="c.Position=0";
Debug.ShouldStop(4);
_c.runMethod(true,"setPosition",BA.numberCast(int.class, 0));
 BA.debugLineNum = 772;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"delete from";
Debug.ShouldStop(8);
subs.mostCurrent._b4xpages.runMethod(false,"_mainpage" /*RemoteObject*/ ,_ba).getField(false,"_skmt" /*RemoteObject*/ ).runVoidMethod ("ExecNonQuery",(Object)(RemoteObject.createImmutable("delete from pedido_cliente where PC_CLIENTE In (select cuenta from cuentaa)")));
 BA.debugLineNum = 773;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"insert into";
Debug.ShouldStop(16);
subs.mostCurrent._b4xpages.runMethod(false,"_mainpage" /*RemoteObject*/ ,_ba).getField(false,"_skmt" /*RemoteObject*/ ).runVoidMethod ("ExecNonQuery2",(Object)(BA.ObjectToString("insert into pedido_cliente(PC_CLIENTE, PC_FECHA, PC_USER, PC_NOART, PC_MONTO,PC_LON, PC_LAT,PC_ALMACEN,PC_RUTA,PC_COSTO_SIN) VALUES (?,?,?,?,?,?,?,?,?,?)")),(Object)(subs.mostCurrent.__c.runMethod(false, "ArrayToList", (Object)(RemoteObject.createNewArray("Object",new int[] {9},new Object[] {(_clienteid),(_fecha),(_usuario),(_c.runMethod(true,"GetString",(Object)(RemoteObject.createImmutable("CANT_CLIE")))),(_c.runMethod(true,"GetString",(Object)(RemoteObject.createImmutable("TOTAL_CLIE")))),(subs.mostCurrent._b4xpages.runMethod(false,"_mainpage" /*RemoteObject*/ ,_ba).getField(true,"_lon_gps" /*RemoteObject*/ )),(subs.mostCurrent._b4xpages.runMethod(false,"_mainpage" /*RemoteObject*/ ,_ba).getField(true,"_lat_gps" /*RemoteObject*/ )),(_cedis),(_c.runMethod(true,"GetString",(Object)(RemoteObject.createImmutable("TOTAL_CLIE_SIN"))))})))));
 BA.debugLineNum = 774;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"UPDATE kmt_i";
Debug.ShouldStop(32);
subs.mostCurrent._b4xpages.runMethod(false,"_mainpage" /*RemoteObject*/ ,_ba).getField(false,"_skmt" /*RemoteObject*/ ).runVoidMethod ("ExecNonQuery",(Object)(RemoteObject.createImmutable("UPDATE kmt_info set gestion = 2  where CAT_CL_CODIGO In (select cuenta from cuentaa)")));
 BA.debugLineNum = 775;BA.debugLine="End Sub";
Debug.ShouldStop(64);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _guardaproductosingestion(RemoteObject _ba,RemoteObject _cedis,RemoteObject _costou,RemoteObject _cant,RemoteObject _nombre,RemoteObject _prodid,RemoteObject _clienteid,RemoteObject _fecha,RemoteObject _usuario,RemoteObject _rutav,RemoteObject _preciosin,RemoteObject _tipoventa) throws Exception{
try {
		Debug.PushSubsStack("guardaProductoSinGestion (subs) ","subs",9,_ba,subs.mostCurrent,780);
if (RapidSub.canDelegate("guardaproductosingestion")) { return keymon.lat.medicomed.subs.remoteMe.runUserSub(false, "subs","guardaproductosingestion", _ba, _cedis, _costou, _cant, _nombre, _prodid, _clienteid, _fecha, _usuario, _rutav, _preciosin, _tipoventa);}
RemoteObject _c = RemoteObject.declareNull("anywheresoftware.b4a.sql.SQL.CursorWrapper");
;
Debug.locals.put("cedis", _cedis);
Debug.locals.put("costoU", _costou);
Debug.locals.put("cant", _cant);
Debug.locals.put("nombre", _nombre);
Debug.locals.put("prodId", _prodid);
Debug.locals.put("clienteId", _clienteid);
Debug.locals.put("fecha", _fecha);
Debug.locals.put("usuario", _usuario);
Debug.locals.put("rutaV", _rutav);
Debug.locals.put("precioSin", _preciosin);
Debug.locals.put("tipoVenta", _tipoventa);
 BA.debugLineNum = 780;BA.debugLine="Sub guardaProductoSinGestion(cedis As String, cost";
Debug.ShouldStop(2048);
 BA.debugLineNum = 781;BA.debugLine="LogColor(\"guardaProductoSinGestion: \"&prodId&\", c";
Debug.ShouldStop(4096);
subs.mostCurrent.__c.runVoidMethod ("LogImpl","313565953",RemoteObject.concat(RemoteObject.createImmutable("guardaProductoSinGestion: "),_prodid,RemoteObject.createImmutable(", cant="),_cant),subs.mostCurrent.__c.getField(false,"Colors").getField(true,"Magenta"));
 BA.debugLineNum = 782;BA.debugLine="Private c As Cursor";
Debug.ShouldStop(8192);
_c = RemoteObject.createNew ("anywheresoftware.b4a.sql.SQL.CursorWrapper");Debug.locals.put("c", _c);
 BA.debugLineNum = 783;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"INSERT INTO";
Debug.ShouldStop(16384);
subs.mostCurrent._b4xpages.runMethod(false,"_mainpage" /*RemoteObject*/ ,_ba).getField(false,"_skmt" /*RemoteObject*/ ).runVoidMethod ("ExecNonQuery2",(Object)(BA.ObjectToString("INSERT INTO PEDIDO (PE_CEDIS,PE_COSTO_TOT,PE_COSTOU,PE_CANT,PE_PRONOMBRE,PE_PROID,PE_CLIENTE,PE_FECHA,PE_USUARIO,PE_RUTA,PE_COSTO_SIN,PE_FOLIO) VALUES(?,?,?,?,?,?,?,?,?,?,?,?) ")),(Object)(subs.mostCurrent.__c.runMethod(false, "ArrayToList", (Object)(RemoteObject.createNewArray("Object",new int[] {12},new Object[] {(_cedis),((RemoteObject.solve(new RemoteObject[] {BA.numberCast(double.class, _cant),BA.numberCast(double.class, _costou)}, "*",0, 0))),(_costou),(_cant),(_nombre),(_prodid),(_clienteid),(_fecha),(_usuario),(_rutav),(_preciosin),(_tipoventa)})))));
 BA.debugLineNum = 784;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"update cat_";
Debug.ShouldStop(32768);
subs.mostCurrent._b4xpages.runMethod(false,"_mainpage" /*RemoteObject*/ ,_ba).getField(false,"_skmt" /*RemoteObject*/ ).runVoidMethod ("ExecNonQuery2",(Object)(BA.ObjectToString("update cat_gunaprod set cat_gp_almacen = cat_gp_almacen - ? where cat_gp_id = ? ")),(Object)(subs.mostCurrent.__c.runMethod(false, "ArrayToList", (Object)(RemoteObject.createNewArray("Object",new int[] {2},new Object[] {(_cant),(_prodid)})))));
 BA.debugLineNum = 785;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"select sum(pe";
Debug.ShouldStop(65536);
_c = RemoteObject.declareNull("anywheresoftware.b4a.AbsObjectWrapper").runMethod(false, "ConvertToWrapper", RemoteObject.createNew("anywheresoftware.b4a.sql.SQL.CursorWrapper"), subs.mostCurrent._b4xpages.runMethod(false,"_mainpage" /*RemoteObject*/ ,_ba).getField(false,"_skmt" /*RemoteObject*/ ).runMethod(false,"ExecQuery",(Object)(RemoteObject.createImmutable("select sum(pe_costo_tot) as TOTAL_CLIE, SUM(PE_CANT) AS CANT_CLIE, SUM(PE_COSTO_SIN) AS TOTAL_CLIE_SIN FROM PEDIDO WHERE PE_CLIENTE IN (Select CUENTA from cuentaa)"))));Debug.locals.put("c", _c);
 BA.debugLineNum = 786;BA.debugLine="c.Position=0";
Debug.ShouldStop(131072);
_c.runMethod(true,"setPosition",BA.numberCast(int.class, 0));
 BA.debugLineNum = 787;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"delete from";
Debug.ShouldStop(262144);
subs.mostCurrent._b4xpages.runMethod(false,"_mainpage" /*RemoteObject*/ ,_ba).getField(false,"_skmt" /*RemoteObject*/ ).runVoidMethod ("ExecNonQuery",(Object)(RemoteObject.createImmutable("delete from pedido_cliente where PC_CLIENTE In (select cuenta from cuentaa)")));
 BA.debugLineNum = 788;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"insert into";
Debug.ShouldStop(524288);
subs.mostCurrent._b4xpages.runMethod(false,"_mainpage" /*RemoteObject*/ ,_ba).getField(false,"_skmt" /*RemoteObject*/ ).runVoidMethod ("ExecNonQuery2",(Object)(BA.ObjectToString("insert into pedido_cliente(PC_CLIENTE, PC_FECHA, PC_USER, PC_NOART, PC_MONTO,PC_LON, PC_LAT,PC_ALMACEN,PC_RUTA,PC_COSTO_SIN) VALUES (?,?,?,?,?,?,?,?,?,?)")),(Object)(subs.mostCurrent.__c.runMethod(false, "ArrayToList", (Object)(RemoteObject.createNewArray("Object",new int[] {9},new Object[] {(_clienteid),(_fecha),(_usuario),(_c.runMethod(true,"GetString",(Object)(RemoteObject.createImmutable("CANT_CLIE")))),(_c.runMethod(true,"GetString",(Object)(RemoteObject.createImmutable("TOTAL_CLIE")))),(subs.mostCurrent._b4xpages.runMethod(false,"_mainpage" /*RemoteObject*/ ,_ba).getField(true,"_lon_gps" /*RemoteObject*/ )),(subs.mostCurrent._b4xpages.runMethod(false,"_mainpage" /*RemoteObject*/ ,_ba).getField(true,"_lat_gps" /*RemoteObject*/ )),(_cedis),(_c.runMethod(true,"GetString",(Object)(RemoteObject.createImmutable("TOTAL_CLIE_SIN"))))})))));
 BA.debugLineNum = 789;BA.debugLine="End Sub";
Debug.ShouldStop(1048576);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _haypedido(RemoteObject _ba) throws Exception{
try {
		Debug.PushSubsStack("hayPedido (subs) ","subs",9,_ba,subs.mostCurrent,1269);
if (RapidSub.canDelegate("haypedido")) { return keymon.lat.medicomed.subs.remoteMe.runUserSub(false, "subs","haypedido", _ba);}
RemoteObject _thisc = RemoteObject.declareNull("anywheresoftware.b4a.sql.SQL.CursorWrapper");
RemoteObject _hay = RemoteObject.createImmutable(false);
;
 BA.debugLineNum = 1269;BA.debugLine="Sub hayPedido As Boolean";
Debug.ShouldStop(1048576);
 BA.debugLineNum = 1270;BA.debugLine="Private thisC As Cursor=B4XPages.MainPage.skmt.Ex";
Debug.ShouldStop(2097152);
_thisc = RemoteObject.createNew ("anywheresoftware.b4a.sql.SQL.CursorWrapper");
_thisc = RemoteObject.declareNull("anywheresoftware.b4a.AbsObjectWrapper").runMethod(false, "ConvertToWrapper", RemoteObject.createNew("anywheresoftware.b4a.sql.SQL.CursorWrapper"), subs.mostCurrent._b4xpages.runMethod(false,"_mainpage" /*RemoteObject*/ ,_ba).getField(false,"_skmt" /*RemoteObject*/ ).runMethod(false,"ExecQuery",(Object)((RemoteObject.concat(RemoteObject.createImmutable("select count(PE_CLIENTE) as hayPedido from PEDIDO where PE_CLIENTE = '"),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_traecliente(_ba)))),RemoteObject.createImmutable("'"))))));Debug.locals.put("thisC", _thisc);Debug.locals.put("thisC", _thisc);
 BA.debugLineNum = 1271;BA.debugLine="thisC.Position=0";
Debug.ShouldStop(4194304);
_thisc.runMethod(true,"setPosition",BA.numberCast(int.class, 0));
 BA.debugLineNum = 1272;BA.debugLine="Private hay As Boolean = False";
Debug.ShouldStop(8388608);
_hay = subs.mostCurrent.__c.getField(true,"False");Debug.locals.put("hay", _hay);Debug.locals.put("hay", _hay);
 BA.debugLineNum = 1273;BA.debugLine="If thisC.GetInt(\"hayPedido\") > 0 Then hay = True";
Debug.ShouldStop(16777216);
if (RemoteObject.solveBoolean(">",_thisc.runMethod(true,"GetInt",(Object)(RemoteObject.createImmutable("hayPedido"))),BA.numberCast(double.class, 0))) { 
_hay = subs.mostCurrent.__c.getField(true,"True");Debug.locals.put("hay", _hay);};
 BA.debugLineNum = 1275;BA.debugLine="Return hay";
Debug.ShouldStop(67108864);
if (true) return _hay;
 BA.debugLineNum = 1276;BA.debugLine="End Sub";
Debug.ShouldStop(134217728);
return RemoteObject.createImmutable(false);
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _iniciaactividad(RemoteObject _ba,RemoteObject _ia) throws Exception{
try {
		Debug.PushSubsStack("iniciaActividad (subs) ","subs",9,_ba,subs.mostCurrent,1359);
if (RapidSub.canDelegate("iniciaactividad")) { return keymon.lat.medicomed.subs.remoteMe.runUserSub(false, "subs","iniciaactividad", _ba, _ia);}
;
Debug.locals.put("ia", _ia);
 BA.debugLineNum = 1359;BA.debugLine="Sub iniciaActividad(ia As String)";
Debug.ShouldStop(16384);
 BA.debugLineNum = 1360;BA.debugLine="If ia <> \"\" And ia <> Null Then";
Debug.ShouldStop(32768);
if (RemoteObject.solveBoolean("!",_ia,BA.ObjectToString("")) && RemoteObject.solveBoolean("N",_ia)) { 
 BA.debugLineNum = 1362;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"delete fro";
Debug.ShouldStop(131072);
subs.mostCurrent._b4xpages.runMethod(false,"_mainpage" /*RemoteObject*/ ,_ba).getField(false,"_skmt" /*RemoteObject*/ ).runVoidMethod ("ExecNonQuery2",(Object)(BA.ObjectToString("delete from CAT_VARIABLES where CAT_VA_DESCRIPCION = ?")),(Object)(subs.mostCurrent.__c.runMethod(false, "ArrayToList", (Object)(RemoteObject.createNewArray("Object",new int[] {1},new Object[] {(RemoteObject.createImmutable("ULTIMOMODULO"))})))));
 BA.debugLineNum = 1363;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"INSERT INT";
Debug.ShouldStop(262144);
subs.mostCurrent._b4xpages.runMethod(false,"_mainpage" /*RemoteObject*/ ,_ba).getField(false,"_skmt" /*RemoteObject*/ ).runVoidMethod ("ExecNonQuery2",(Object)(BA.ObjectToString("INSERT INTO CAT_VARIABLES(CAT_VA_DESCRIPCION, CAT_VA_VALOR) VALUES (?,?)")),(Object)(subs.mostCurrent.__c.runMethod(false, "ArrayToList", (Object)(RemoteObject.createNewArray("Object",new int[] {2},new Object[] {RemoteObject.createImmutable(("ULTIMOMODULO")),(_ia)})))));
 BA.debugLineNum = 1364;BA.debugLine="B4XPages.ShowPage(ia)";
Debug.ShouldStop(524288);
subs.mostCurrent._b4xpages.runVoidMethod ("_showpage" /*RemoteObject*/ ,_ba,(Object)(_ia));
 };
 BA.debugLineNum = 1367;BA.debugLine="End Sub";
Debug.ShouldStop(4194304);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _insertarenglonespruebaenerrorlog(RemoteObject _ba) throws Exception{
try {
		Debug.PushSubsStack("insertaRenglonesPruebaEnErrorLog (subs) ","subs",9,_ba,subs.mostCurrent,513);
if (RapidSub.canDelegate("insertarenglonespruebaenerrorlog")) { return keymon.lat.medicomed.subs.remoteMe.runUserSub(false, "subs","insertarenglonespruebaenerrorlog", _ba);}
int _x = 0;
;
 BA.debugLineNum = 513;BA.debugLine="Sub insertaRenglonesPruebaEnErrorLog 'ignore";
Debug.ShouldStop(1);
 BA.debugLineNum = 514;BA.debugLine="revisaBD";
Debug.ShouldStop(2);
_revisabd(_ba);
 BA.debugLineNum = 515;BA.debugLine="Log(\"insertamos 50 renglones a errorLog\")";
Debug.ShouldStop(4);
subs.mostCurrent.__c.runVoidMethod ("LogImpl","312320770",RemoteObject.createImmutable("insertamos 50 renglones a errorLog"),0);
 BA.debugLineNum = 516;BA.debugLine="For x = 1 To 50";
Debug.ShouldStop(8);
{
final int step3 = 1;
final int limit3 = 50;
_x = 1 ;
for (;(step3 > 0 && _x <= limit3) || (step3 < 0 && _x >= limit3) ;_x = ((int)(0 + _x + step3))  ) {
Debug.locals.put("x", _x);
 BA.debugLineNum = 517;BA.debugLine="errorLog.ExecNonQuery2(\"INSERT INTO errores(fech";
Debug.ShouldStop(16);
subs._errorlog.runVoidMethod ("ExecNonQuery2",(Object)(BA.ObjectToString("INSERT INTO errores(fecha, error) VALUES (?,?)")),(Object)(subs.mostCurrent.__c.runMethod(false, "ArrayToList", (Object)(RemoteObject.createNewArray("Object",new int[] {2},new Object[] {(_fechakmt(_ba,BA.NumberToString(subs.mostCurrent.__c.getField(false,"DateTime").runMethod(true,"getNow")))),(RemoteObject.createImmutable("abc"))})))));
 BA.debugLineNum = 518;BA.debugLine="Log(x)";
Debug.ShouldStop(32);
subs.mostCurrent.__c.runVoidMethod ("LogImpl","312320773",BA.NumberToString(_x),0);
 }
}Debug.locals.put("x", _x);
;
 BA.debugLineNum = 520;BA.debugLine="End Sub";
Debug.ShouldStop(128);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _installapk(RemoteObject _ba,RemoteObject _dir,RemoteObject _apk) throws Exception{
try {
		Debug.PushSubsStack("InstallAPK (subs) ","subs",9,_ba,subs.mostCurrent,575);
if (RapidSub.canDelegate("installapk")) { return keymon.lat.medicomed.subs.remoteMe.runUserSub(false, "subs","installapk", _ba, _dir, _apk);}
RemoteObject _i = RemoteObject.declareNull("anywheresoftware.b4a.objects.IntentWrapper");
;
Debug.locals.put("dir", _dir);
Debug.locals.put("apk", _apk);
 BA.debugLineNum = 575;BA.debugLine="Sub InstallAPK(dir As String, apk As String) 'igno";
Debug.ShouldStop(1073741824);
 BA.debugLineNum = 576;BA.debugLine="If File.Exists(dir, apk) Then";
Debug.ShouldStop(-2147483648);
if (subs.mostCurrent.__c.getField(false,"File").runMethod(true,"Exists",(Object)(_dir),(Object)(_apk)).<Boolean>get().booleanValue()) { 
 BA.debugLineNum = 577;BA.debugLine="Dim i As Intent";
Debug.ShouldStop(1);
_i = RemoteObject.createNew ("anywheresoftware.b4a.objects.IntentWrapper");Debug.locals.put("i", _i);
 BA.debugLineNum = 578;BA.debugLine="i.Initialize(i.ACTION_VIEW, \"file://\" & File.Com";
Debug.ShouldStop(2);
_i.runVoidMethod ("Initialize",(Object)(_i.getField(true,"ACTION_VIEW")),(Object)(RemoteObject.concat(RemoteObject.createImmutable("file://"),subs.mostCurrent.__c.getField(false,"File").runMethod(true,"Combine",(Object)(_dir),(Object)(_apk)))));
 BA.debugLineNum = 579;BA.debugLine="i.SetType(\"application/vnd.android.package-archi";
Debug.ShouldStop(4);
_i.runVoidMethod ("SetType",(Object)(RemoteObject.createImmutable("application/vnd.android.package-archive")));
 BA.debugLineNum = 580;BA.debugLine="StartActivity(i)";
Debug.ShouldStop(8);
subs.mostCurrent.__c.runVoidMethod ("StartActivity",BA.rdebugUtils.runMethod(false, "processBAFromBA", _ba),(Object)((_i.getObject())));
 };
 BA.debugLineNum = 582;BA.debugLine="End Sub";
Debug.ShouldStop(32);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _json2map(RemoteObject _ba,RemoteObject _thejson) throws Exception{
try {
		Debug.PushSubsStack("JSON2Map (subs) ","subs",9,_ba,subs.mostCurrent,294);
if (RapidSub.canDelegate("json2map")) { return keymon.lat.medicomed.subs.remoteMe.runUserSub(false, "subs","json2map", _ba, _thejson);}
RemoteObject _json = RemoteObject.declareNull("anywheresoftware.b4a.objects.collections.JSONParser");
RemoteObject _m = RemoteObject.declareNull("anywheresoftware.b4a.objects.collections.Map");
;
Debug.locals.put("theJson", _thejson);
 BA.debugLineNum = 294;BA.debugLine="Sub JSON2Map(theJson As String) As Map 'ignore";
Debug.ShouldStop(32);
 BA.debugLineNum = 296;BA.debugLine="Try";
Debug.ShouldStop(128);
try { BA.debugLineNum = 297;BA.debugLine="Private json As JSONParser";
Debug.ShouldStop(256);
_json = RemoteObject.createNew ("anywheresoftware.b4a.objects.collections.JSONParser");Debug.locals.put("json", _json);
 BA.debugLineNum = 298;BA.debugLine="json.Initialize(theJson)";
Debug.ShouldStop(512);
_json.runVoidMethod ("Initialize",(Object)(_thejson));
 BA.debugLineNum = 299;BA.debugLine="Return json.NextObject";
Debug.ShouldStop(1024);
Debug.CheckDeviceExceptions();if (true) return _json.runMethod(false,"NextObject");
 Debug.CheckDeviceExceptions();
} 
       catch (Exception e6) {
			BA.rdebugUtils.runVoidMethod("setLastException",BA.rdebugUtils.runMethod(false, "processBAFromBA", _ba), e6.toString()); BA.debugLineNum = 301;BA.debugLine="Log(LastException)";
Debug.ShouldStop(4096);
subs.mostCurrent.__c.runVoidMethod ("LogImpl","311599879",BA.ObjectToString(subs.mostCurrent.__c.runMethod(false,"LastException",_ba)),0);
 BA.debugLineNum = 302;BA.debugLine="log2DB(\"JSON2Map: \"&LastException)";
Debug.ShouldStop(8192);
_log2db(_ba,RemoteObject.concat(RemoteObject.createImmutable("JSON2Map: "),subs.mostCurrent.__c.runMethod(false,"LastException",_ba)));
 BA.debugLineNum = 303;BA.debugLine="Private m As Map = CreateMap(\"title\":\"Error gene";
Debug.ShouldStop(16384);
_m = RemoteObject.createNew ("anywheresoftware.b4a.objects.collections.Map");
_m = subs.mostCurrent.__c.runMethod(false, "createMap", (Object)(new RemoteObject[] {RemoteObject.createImmutable(("title")),RemoteObject.createImmutable(("Error generating JSON")),RemoteObject.createImmutable(("t")),RemoteObject.createImmutable(("Error")),RemoteObject.createImmutable(("Message")),(subs.mostCurrent.__c.runMethod(false,"LastException",_ba).getObject()),RemoteObject.createImmutable(("text")),(subs.mostCurrent.__c.runMethod(false,"LastException",_ba).getObject())}));Debug.locals.put("m", _m);Debug.locals.put("m", _m);
 BA.debugLineNum = 304;BA.debugLine="Return m";
Debug.ShouldStop(32768);
if (true) return _m;
 };
 BA.debugLineNum = 306;BA.debugLine="End Sub";
Debug.ShouldStop(131072);
return RemoteObject.createImmutable(null);
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _log2db(RemoteObject _ba,RemoteObject _texto) throws Exception{
try {
		Debug.PushSubsStack("log2DB (subs) ","subs",9,_ba,subs.mostCurrent,348);
if (RapidSub.canDelegate("log2db")) { return keymon.lat.medicomed.subs.remoteMe.runUserSub(false, "subs","log2db", _ba, _texto);}
;
Debug.locals.put("texto", _texto);
 BA.debugLineNum = 348;BA.debugLine="Sub log2DB(texto As String) 'ignore";
Debug.ShouldStop(134217728);
 BA.debugLineNum = 349;BA.debugLine="LogColor(fechaKMT(DateTime.Now)&\" - log2BD: '\"&te";
Debug.ShouldStop(268435456);
subs.mostCurrent.__c.runVoidMethod ("LogImpl","311796481",RemoteObject.concat(_fechakmt(_ba,BA.NumberToString(subs.mostCurrent.__c.getField(false,"DateTime").runMethod(true,"getNow"))),RemoteObject.createImmutable(" - log2BD: '"),_texto,RemoteObject.createImmutable("'")),subs.mostCurrent.__c.getField(false,"Colors").getField(true,"LightGray"));
 BA.debugLineNum = 350;BA.debugLine="kmt.ExecNonQuery2(\"INSERT INTO bitacora(fecha, te";
Debug.ShouldStop(536870912);
subs._kmt.runVoidMethod ("ExecNonQuery2",(Object)(BA.ObjectToString("INSERT INTO bitacora(fecha, texto) VALUES (?,?)")),(Object)(subs.mostCurrent.__c.runMethod(false, "ArrayToList", (Object)(RemoteObject.createNewArray("Object",new int[] {2},new Object[] {(_fechakmt(_ba,BA.NumberToString(subs.mostCurrent.__c.getField(false,"DateTime").runMethod(true,"getNow")))),(_texto)})))));
 BA.debugLineNum = 351;BA.debugLine="End Sub";
Debug.ShouldStop(1073741824);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _map2json(RemoteObject _ba,RemoteObject _m) throws Exception{
try {
		Debug.PushSubsStack("map2JSON (subs) ","subs",9,_ba,subs.mostCurrent,309);
if (RapidSub.canDelegate("map2json")) { return keymon.lat.medicomed.subs.remoteMe.runUserSub(false, "subs","map2json", _ba, _m);}
RemoteObject _jg = RemoteObject.declareNull("anywheresoftware.b4a.objects.collections.JSONParser.JSONGenerator");
RemoteObject _t = RemoteObject.createImmutable("");
;
Debug.locals.put("m", _m);
 BA.debugLineNum = 309;BA.debugLine="Sub map2JSON(m As Map) As String 'ignore";
Debug.ShouldStop(1048576);
 BA.debugLineNum = 312;BA.debugLine="Dim jg As JSONGenerator";
Debug.ShouldStop(8388608);
_jg = RemoteObject.createNew ("anywheresoftware.b4a.objects.collections.JSONParser.JSONGenerator");Debug.locals.put("jg", _jg);
 BA.debugLineNum = 313;BA.debugLine="jg.Initialize(m)";
Debug.ShouldStop(16777216);
_jg.runVoidMethod ("Initialize",(Object)(_m));
 BA.debugLineNum = 314;BA.debugLine="Dim t As String = jg.ToString";
Debug.ShouldStop(33554432);
_t = _jg.runMethod(true,"ToString");Debug.locals.put("t", _t);Debug.locals.put("t", _t);
 BA.debugLineNum = 315;BA.debugLine="Return t";
Debug.ShouldStop(67108864);
if (true) return _t;
 BA.debugLineNum = 316;BA.debugLine="End Sub";
Debug.ShouldStop(134217728);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _masdexxmins(RemoteObject _ba,RemoteObject _hora,RemoteObject _mins) throws Exception{
try {
		Debug.PushSubsStack("masDeXXMins (subs) ","subs",9,_ba,subs.mostCurrent,354);
if (RapidSub.canDelegate("masdexxmins")) { return keymon.lat.medicomed.subs.remoteMe.runUserSub(false, "subs","masdexxmins", _ba, _hora, _mins);}
;
Debug.locals.put("hora", _hora);
Debug.locals.put("mins", _mins);
 BA.debugLineNum = 354;BA.debugLine="Sub masDeXXMins(hora As Int, mins As Int) As Boole";
Debug.ShouldStop(2);
 BA.debugLineNum = 355;BA.debugLine="If (hora + mins * DateTime.TicksPerMinute) < Date";
Debug.ShouldStop(4);
if (RemoteObject.solveBoolean("<",(RemoteObject.solve(new RemoteObject[] {_hora,_mins,subs.mostCurrent.__c.getField(false,"DateTime").getField(true,"TicksPerMinute")}, "+*",1, 2)),subs.mostCurrent.__c.getField(false,"DateTime").runMethod(true,"getNow"))) { 
 BA.debugLineNum = 356;BA.debugLine="Return True";
Debug.ShouldStop(8);
if (true) return subs.mostCurrent.__c.getField(true,"True");
 }else {
 BA.debugLineNum = 358;BA.debugLine="Return False";
Debug.ShouldStop(32);
if (true) return subs.mostCurrent.__c.getField(true,"False");
 };
 BA.debugLineNum = 360;BA.debugLine="End Sub";
Debug.ShouldStop(128);
return RemoteObject.createImmutable(false);
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _masdexxminskmt(RemoteObject _ba,RemoteObject _hora,RemoteObject _mins) throws Exception{
try {
		Debug.PushSubsStack("masDeXXMinsKMT (subs) ","subs",9,_ba,subs.mostCurrent,363);
if (RapidSub.canDelegate("masdexxminskmt")) { return keymon.lat.medicomed.subs.remoteMe.runUserSub(false, "subs","masdexxminskmt", _ba, _hora, _mins);}
;
Debug.locals.put("hora", _hora);
Debug.locals.put("mins", _mins);
 BA.debugLineNum = 363;BA.debugLine="Sub masDeXXMinsKMT(hora As String, mins As Int) As";
Debug.ShouldStop(1024);
 BA.debugLineNum = 364;BA.debugLine="Try";
Debug.ShouldStop(2048);
try { BA.debugLineNum = 366;BA.debugLine="If fechaKMT2Ticks(hora) + mins * DateTime.TicksP";
Debug.ShouldStop(8192);
if (RemoteObject.solveBoolean("<",RemoteObject.solve(new RemoteObject[] {_fechakmt2ticks(_ba,_hora),_mins,subs.mostCurrent.__c.getField(false,"DateTime").getField(true,"TicksPerMinute")}, "+*",1, 2),subs.mostCurrent.__c.getField(false,"DateTime").runMethod(true,"getNow"))) { 
 BA.debugLineNum = 368;BA.debugLine="Return True";
Debug.ShouldStop(32768);
Debug.CheckDeviceExceptions();if (true) return subs.mostCurrent.__c.getField(true,"True");
 }else {
 BA.debugLineNum = 371;BA.debugLine="Return False";
Debug.ShouldStop(262144);
Debug.CheckDeviceExceptions();if (true) return subs.mostCurrent.__c.getField(true,"False");
 };
 Debug.CheckDeviceExceptions();
} 
       catch (Exception e8) {
			BA.rdebugUtils.runVoidMethod("setLastException",BA.rdebugUtils.runMethod(false, "processBAFromBA", _ba), e8.toString()); BA.debugLineNum = 374;BA.debugLine="Log(LastException)";
Debug.ShouldStop(2097152);
subs.mostCurrent.__c.runVoidMethod ("LogImpl","311927563",BA.ObjectToString(subs.mostCurrent.__c.runMethod(false,"LastException",_ba)),0);
 };
 BA.debugLineNum = 376;BA.debugLine="End Sub";
Debug.ShouldStop(8388608);
return RemoteObject.createImmutable(false);
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _notihigh(RemoteObject _ba,RemoteObject _title,RemoteObject _body,RemoteObject _activity) throws Exception{
try {
		Debug.PushSubsStack("notiHigh (subs) ","subs",9,_ba,subs.mostCurrent,74);
if (RapidSub.canDelegate("notihigh")) { return keymon.lat.medicomed.subs.remoteMe.runUserSub(false, "subs","notihigh", _ba, _title, _body, _activity);}
RemoteObject _notif = RemoteObject.declareNull("anywheresoftware.b4a.objects.NotificationWrapper");
;
Debug.locals.put("title", _title);
Debug.locals.put("body", _body);
Debug.locals.put("activity", _activity);
 BA.debugLineNum = 74;BA.debugLine="Sub notiHigh(title As String, body As String, acti";
Debug.ShouldStop(512);
 BA.debugLineNum = 75;BA.debugLine="Private notif As Notification";
Debug.ShouldStop(1024);
_notif = RemoteObject.createNew ("anywheresoftware.b4a.objects.NotificationWrapper");Debug.locals.put("notif", _notif);
 BA.debugLineNum = 76;BA.debugLine="notif.Initialize2(notif.IMPORTANCE_HIGH)";
Debug.ShouldStop(2048);
_notif.runVoidMethod ("Initialize2",(Object)(_notif.getField(true,"IMPORTANCE_HIGH")));
 BA.debugLineNum = 77;BA.debugLine="notif.Icon = \"icon\"";
Debug.ShouldStop(4096);
_notif.runVoidMethod ("setIcon",BA.ObjectToString("icon"));
 BA.debugLineNum = 78;BA.debugLine="notif.Vibrate = False";
Debug.ShouldStop(8192);
_notif.runVoidMethod ("setVibrate",subs.mostCurrent.__c.getField(true,"False"));
 BA.debugLineNum = 79;BA.debugLine="notif.Sound = False";
Debug.ShouldStop(16384);
_notif.runVoidMethod ("setSound",subs.mostCurrent.__c.getField(true,"False"));
 BA.debugLineNum = 80;BA.debugLine="notif.AutoCancel = True";
Debug.ShouldStop(32768);
_notif.runVoidMethod ("setAutoCancel",subs.mostCurrent.__c.getField(true,"True"));
 BA.debugLineNum = 81;BA.debugLine="Log(\"notiHigh: \"&title)";
Debug.ShouldStop(65536);
subs.mostCurrent.__c.runVoidMethod ("LogImpl","310944519",RemoteObject.concat(RemoteObject.createImmutable("notiHigh: "),_title),0);
 BA.debugLineNum = 82;BA.debugLine="notif.SetInfo(title, body, activity)";
Debug.ShouldStop(131072);
_notif.runVoidMethod ("SetInfoNew",BA.rdebugUtils.runMethod(false, "processBAFromBA", _ba),(Object)(BA.ObjectToCharSequence(_title)),(Object)(BA.ObjectToCharSequence(_body)),(Object)(_activity));
 BA.debugLineNum = 84;BA.debugLine="notif.Notify(777)";
Debug.ShouldStop(524288);
_notif.runVoidMethod ("Notify",(Object)(BA.numberCast(int.class, 777)));
 BA.debugLineNum = 85;BA.debugLine="End Sub";
Debug.ShouldStop(1048576);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _notilowreturn(RemoteObject _ba,RemoteObject _title,RemoteObject _body,RemoteObject _id) throws Exception{
try {
		Debug.PushSubsStack("notiLowReturn (subs) ","subs",9,_ba,subs.mostCurrent,88);
if (RapidSub.canDelegate("notilowreturn")) { return keymon.lat.medicomed.subs.remoteMe.runUserSub(false, "subs","notilowreturn", _ba, _title, _body, _id);}
RemoteObject _notification = RemoteObject.declareNull("anywheresoftware.b4a.objects.NotificationWrapper");
;
Debug.locals.put("title", _title);
Debug.locals.put("Body", _body);
Debug.locals.put("id", _id);
 BA.debugLineNum = 88;BA.debugLine="Sub notiLowReturn(title As String, Body As String,";
Debug.ShouldStop(8388608);
 BA.debugLineNum = 89;BA.debugLine="Private notification As Notification";
Debug.ShouldStop(16777216);
_notification = RemoteObject.createNew ("anywheresoftware.b4a.objects.NotificationWrapper");Debug.locals.put("notification", _notification);
 BA.debugLineNum = 90;BA.debugLine="notification.Initialize2(notification.IMPORTANCE_";
Debug.ShouldStop(33554432);
_notification.runVoidMethod ("Initialize2",(Object)(_notification.getField(true,"IMPORTANCE_LOW")));
 BA.debugLineNum = 91;BA.debugLine="Log(\"notiLowReturn: \"&title)";
Debug.ShouldStop(67108864);
subs.mostCurrent.__c.runVoidMethod ("LogImpl","311010051",RemoteObject.concat(RemoteObject.createImmutable("notiLowReturn: "),_title),0);
 BA.debugLineNum = 92;BA.debugLine="notification.Icon = \"icon\"";
Debug.ShouldStop(134217728);
_notification.runVoidMethod ("setIcon",BA.ObjectToString("icon"));
 BA.debugLineNum = 93;BA.debugLine="notification.Sound = False";
Debug.ShouldStop(268435456);
_notification.runVoidMethod ("setSound",subs.mostCurrent.__c.getField(true,"False"));
 BA.debugLineNum = 94;BA.debugLine="notification.Vibrate = False";
Debug.ShouldStop(536870912);
_notification.runVoidMethod ("setVibrate",subs.mostCurrent.__c.getField(true,"False"));
 BA.debugLineNum = 95;BA.debugLine="notification.SetInfo(title, Body, Main)";
Debug.ShouldStop(1073741824);
_notification.runVoidMethod ("SetInfoNew",BA.rdebugUtils.runMethod(false, "processBAFromBA", _ba),(Object)(BA.ObjectToCharSequence(_title)),(Object)(BA.ObjectToCharSequence(_body)),(Object)((subs.mostCurrent._main.getObject())));
 BA.debugLineNum = 96;BA.debugLine="notification.Notify(id)";
Debug.ShouldStop(-2147483648);
_notification.runVoidMethod ("Notify",(Object)(_id));
 BA.debugLineNum = 98;BA.debugLine="Return notification";
Debug.ShouldStop(2);
if (true) return _notification;
 BA.debugLineNum = 99;BA.debugLine="End Sub";
Debug.ShouldStop(4);
return RemoteObject.createImmutable(null);
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _panelvisible(RemoteObject _ba,RemoteObject _panel,RemoteObject _top,RemoteObject _left) throws Exception{
try {
		Debug.PushSubsStack("panelVisible (subs) ","subs",9,_ba,subs.mostCurrent,619);
if (RapidSub.canDelegate("panelvisible")) { return keymon.lat.medicomed.subs.remoteMe.runUserSub(false, "subs","panelvisible", _ba, _panel, _top, _left);}
;
Debug.locals.put("panel", _panel);
Debug.locals.put("top", _top);
Debug.locals.put("left", _left);
 BA.debugLineNum = 619;BA.debugLine="Sub panelVisible(panel As Panel, top As Int, left";
Debug.ShouldStop(1024);
 BA.debugLineNum = 620;BA.debugLine="panel.BringToFront";
Debug.ShouldStop(2048);
_panel.runVoidMethod ("BringToFront");
 BA.debugLineNum = 621;BA.debugLine="panel.Visible = True";
Debug.ShouldStop(4096);
_panel.runMethod(true,"setVisible",subs.mostCurrent.__c.getField(true,"True"));
 BA.debugLineNum = 622;BA.debugLine="panel.Top = top";
Debug.ShouldStop(8192);
_panel.runMethod(true,"setTop",_top);
 BA.debugLineNum = 623;BA.debugLine="panel.Left = left";
Debug.ShouldStop(16384);
_panel.runMethod(true,"setLeft",_left);
 BA.debugLineNum = 624;BA.debugLine="End Sub";
Debug.ShouldStop(32768);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _pedidoguardado(RemoteObject _ba) throws Exception{
try {
		Debug.PushSubsStack("pedidoGuardado (subs) ","subs",9,_ba,subs.mostCurrent,1257);
if (RapidSub.canDelegate("pedidoguardado")) { return keymon.lat.medicomed.subs.remoteMe.runUserSub(false, "subs","pedidoguardado", _ba);}
RemoteObject _guardado = RemoteObject.createImmutable(false);
RemoteObject _g = RemoteObject.declareNull("anywheresoftware.b4a.sql.SQL.CursorWrapper");
;
 BA.debugLineNum = 1257;BA.debugLine="Sub pedidoGuardado As Boolean";
Debug.ShouldStop(256);
 BA.debugLineNum = 1258;BA.debugLine="Private guardado As Boolean = False";
Debug.ShouldStop(512);
_guardado = subs.mostCurrent.__c.getField(true,"False");Debug.locals.put("guardado", _guardado);Debug.locals.put("guardado", _guardado);
 BA.debugLineNum = 1259;BA.debugLine="Private g As Cursor = B4XPages.MainPage.skmt.Exec";
Debug.ShouldStop(1024);
_g = RemoteObject.createNew ("anywheresoftware.b4a.sql.SQL.CursorWrapper");
_g = RemoteObject.declareNull("anywheresoftware.b4a.AbsObjectWrapper").runMethod(false, "ConvertToWrapper", RemoteObject.createNew("anywheresoftware.b4a.sql.SQL.CursorWrapper"), subs.mostCurrent._b4xpages.runMethod(false,"_mainpage" /*RemoteObject*/ ,_ba).getField(false,"_skmt" /*RemoteObject*/ ).runMethod(false,"ExecQuery",(Object)(RemoteObject.createImmutable("select gestion from kmt_info where CAT_CL_CODIGO in (Select CUENTA from cuentaa)"))));Debug.locals.put("g", _g);Debug.locals.put("g", _g);
 BA.debugLineNum = 1260;BA.debugLine="If g.RowCount > 0 Then";
Debug.ShouldStop(2048);
if (RemoteObject.solveBoolean(">",_g.runMethod(true,"getRowCount"),BA.numberCast(double.class, 0))) { 
 BA.debugLineNum = 1261;BA.debugLine="g.Position=0";
Debug.ShouldStop(4096);
_g.runMethod(true,"setPosition",BA.numberCast(int.class, 0));
 BA.debugLineNum = 1262;BA.debugLine="If g.GetString(\"gestion\") = \"2\" Then guardado =";
Debug.ShouldStop(8192);
if (RemoteObject.solveBoolean("=",_g.runMethod(true,"GetString",(Object)(RemoteObject.createImmutable("gestion"))),BA.ObjectToString("2"))) { 
_guardado = subs.mostCurrent.__c.getField(true,"True");Debug.locals.put("guardado", _guardado);};
 };
 BA.debugLineNum = 1264;BA.debugLine="Log($\"Guardado=${guardado}\"$)";
Debug.ShouldStop(32768);
subs.mostCurrent.__c.runVoidMethod ("LogImpl","314745607",(RemoteObject.concat(RemoteObject.createImmutable("Guardado="),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_guardado))),RemoteObject.createImmutable(""))),0);
 BA.debugLineNum = 1265;BA.debugLine="Return guardado";
Debug.ShouldStop(65536);
if (true) return _guardado;
 BA.debugLineNum = 1266;BA.debugLine="End Sub";
Debug.ShouldStop(131072);
return RemoteObject.createImmutable(false);
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _procesapromocion(RemoteObject _ba,RemoteObject _idpromo,RemoteObject _cliente) throws Exception{
try {
		Debug.PushSubsStack("procesaPromocion (subs) ","subs",9,_ba,subs.mostCurrent,1002);
if (RapidSub.canDelegate("procesapromocion")) { return keymon.lat.medicomed.subs.remoteMe.runUserSub(false, "subs","procesapromocion", _ba, _idpromo, _cliente);}
RemoteObject _thislog = RemoteObject.createImmutable(false);
RemoteObject _iniciocontador = RemoteObject.createImmutable("");
RemoteObject _pm = RemoteObject.declareNull("anywheresoftware.b4a.objects.collections.Map");
RemoteObject _inventariosinfijos = RemoteObject.declareNull("anywheresoftware.b4a.objects.collections.Map");
RemoteObject _pv = RemoteObject.createImmutable(false);
;
Debug.locals.put("idPromo", _idpromo);
Debug.locals.put("cliente", _cliente);
 BA.debugLineNum = 1002;BA.debugLine="Sub procesaPromocion(idPromo As String, cliente As";
Debug.ShouldStop(512);
 BA.debugLineNum = 1003;BA.debugLine="Private thisLog As Boolean = False  'Si es verdad";
Debug.ShouldStop(1024);
_thislog = subs.mostCurrent.__c.getField(true,"False");Debug.locals.put("thisLog", _thislog);Debug.locals.put("thisLog", _thislog);
 BA.debugLineNum = 1004;BA.debugLine="Private inicioContador As String = DateTime.Now";
Debug.ShouldStop(2048);
_iniciocontador = BA.NumberToString(subs.mostCurrent.__c.getField(false,"DateTime").runMethod(true,"getNow"));Debug.locals.put("inicioContador", _iniciocontador);Debug.locals.put("inicioContador", _iniciocontador);
 BA.debugLineNum = 1005;BA.debugLine="If thisLog Then LogColor($\"********* Iniciamos re";
Debug.ShouldStop(4096);
if (_thislog.<Boolean>get().booleanValue()) { 
subs.mostCurrent.__c.runVoidMethod ("LogImpl","314090243",(RemoteObject.concat(RemoteObject.createImmutable("********* Iniciamos revision de Promo "),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_idpromo))),RemoteObject.createImmutable(" *********"))),subs.mostCurrent.__c.getField(false,"Colors").getField(true,"Magenta"));};
 BA.debugLineNum = 1007;BA.debugLine="Private pm As Map = traePromo(idPromo, cliente)";
Debug.ShouldStop(16384);
_pm = RemoteObject.createNew ("anywheresoftware.b4a.objects.collections.Map");
_pm = _traepromo(_ba,_idpromo,_cliente);Debug.locals.put("pm", _pm);Debug.locals.put("pm", _pm);
 BA.debugLineNum = 1008;BA.debugLine="If thisLog Then LogColor(pm, Colors.Blue)";
Debug.ShouldStop(32768);
if (_thislog.<Boolean>get().booleanValue()) { 
subs.mostCurrent.__c.runVoidMethod ("LogImpl","314090246",BA.ObjectToString(_pm),subs.mostCurrent.__c.getField(false,"Colors").getField(true,"Blue"));};
 BA.debugLineNum = 1009;BA.debugLine="If pm.Get(\"resultado\") = \"ok\" Then 'Si encontramo";
Debug.ShouldStop(65536);
if (RemoteObject.solveBoolean("=",_pm.runMethod(false,"Get",(Object)((RemoteObject.createImmutable("resultado")))),RemoteObject.createImmutable(("ok")))) { 
 BA.debugLineNum = 1011;BA.debugLine="If thisLog Then LogColor($\"Promociones permitida";
Debug.ShouldStop(262144);
if (_thislog.<Boolean>get().booleanValue()) { 
subs.mostCurrent.__c.runVoidMethod ("LogImpl","314090249",(RemoteObject.concat(RemoteObject.createImmutable("Promociones permitidas="),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_traemaxpromos(_ba,_pm)))),RemoteObject.createImmutable(""))),subs.mostCurrent.__c.getField(false,"Colors").getField(true,"Blue"));};
 BA.debugLineNum = 1012;BA.debugLine="If thisLog Then Log(\"Promos vendidas: \" & traePr";
Debug.ShouldStop(524288);
if (_thislog.<Boolean>get().booleanValue()) { 
subs.mostCurrent.__c.runVoidMethod ("LogImpl","314090250",RemoteObject.concat(RemoteObject.createImmutable("Promos vendidas: "),_traepromosvendidas(_ba,_idpromo,_cliente)),0);};
 BA.debugLineNum = 1013;BA.debugLine="If traePromosVendidas(idPromo, cliente) >= traeM";
Debug.ShouldStop(1048576);
if (RemoteObject.solveBoolean("g",_traepromosvendidas(_ba,_idpromo,_cliente),BA.numberCast(double.class, _traemaxpromos(_ba,_pm)))) { 
 BA.debugLineNum = 1014;BA.debugLine="If thisLog Then LogColor(\"Ya se vendieron las p";
Debug.ShouldStop(2097152);
if (_thislog.<Boolean>get().booleanValue()) { 
subs.mostCurrent.__c.runVoidMethod ("LogImpl","314090252",BA.ObjectToString("Ya se vendieron las promos PERMITIDAS para el cliente"),subs.mostCurrent.__c.getField(false,"Colors").getField(true,"Red"));};
 BA.debugLineNum = 1015;BA.debugLine="Return CreateMap(\"status\":\"ko\", \"mp\":pm)";
Debug.ShouldStop(4194304);
if (true) return subs.mostCurrent.__c.runMethod(false, "createMap", (Object)(new RemoteObject[] {RemoteObject.createImmutable(("status")),RemoteObject.createImmutable(("ko")),RemoteObject.createImmutable(("mp")),(_pm.getObject())}));
 };
 BA.debugLineNum = 1018;BA.debugLine="Private inventarioSinFijos As Map = restaFijosPr";
Debug.ShouldStop(33554432);
_inventariosinfijos = RemoteObject.createNew ("anywheresoftware.b4a.objects.collections.Map");
_inventariosinfijos = _restafijospromo(_ba,_pm);Debug.locals.put("inventarioSinFijos", _inventariosinfijos);Debug.locals.put("inventarioSinFijos", _inventariosinfijos);
 BA.debugLineNum = 1019;BA.debugLine="If thisLog Then LogColor(\"inventariosfijos=\"&inv";
Debug.ShouldStop(67108864);
if (_thislog.<Boolean>get().booleanValue()) { 
subs.mostCurrent.__c.runVoidMethod ("LogImpl","314090257",RemoteObject.concat(RemoteObject.createImmutable("inventariosfijos="),_inventariosinfijos),subs.mostCurrent.__c.getField(false,"Colors").getField(true,"Green"));};
 BA.debugLineNum = 1021;BA.debugLine="If inventarioSinFijos.Get(\"resultado\") = \"ok\" Th";
Debug.ShouldStop(268435456);
if (RemoteObject.solveBoolean("=",_inventariosinfijos.runMethod(false,"Get",(Object)((RemoteObject.createImmutable("resultado")))),RemoteObject.createImmutable(("ok")))) { 
 BA.debugLineNum = 1023;BA.debugLine="Private pv As Boolean =  alcanzanLosVariablesPa";
Debug.ShouldStop(1073741824);
_pv = _alcanzanlosvariablesparapromo(_ba,_pm,_inventariosinfijos);Debug.locals.put("pv", _pv);Debug.locals.put("pv", _pv);
 BA.debugLineNum = 1024;BA.debugLine="If thisLog Then Log(\"Alcanzan los variables? --";
Debug.ShouldStop(-2147483648);
if (_thislog.<Boolean>get().booleanValue()) { 
subs.mostCurrent.__c.runVoidMethod ("LogImpl","314090262",RemoteObject.concat(RemoteObject.createImmutable("Alcanzan los variables? --> "),_pv),0);};
 BA.debugLineNum = 1025;BA.debugLine="If pv Then Return CreateMap(\"status\":\"ok\", \"mp\"";
Debug.ShouldStop(1);
if (_pv.<Boolean>get().booleanValue()) { 
if (true) return subs.mostCurrent.__c.runMethod(false, "createMap", (Object)(new RemoteObject[] {RemoteObject.createImmutable(("status")),RemoteObject.createImmutable(("ok")),RemoteObject.createImmutable(("mp")),(_pm.getObject())}));}
else {
if (true) return subs.mostCurrent.__c.runMethod(false, "createMap", (Object)(new RemoteObject[] {RemoteObject.createImmutable(("status")),RemoteObject.createImmutable(("ko")),RemoteObject.createImmutable(("mp")),(_pm.getObject())}));};
 }else {
 BA.debugLineNum = 1027;BA.debugLine="If thisLog Then LogColor(\"NO HAY INVENTARIO SUF";
Debug.ShouldStop(4);
if (_thislog.<Boolean>get().booleanValue()) { 
subs.mostCurrent.__c.runVoidMethod ("LogImpl","314090265",RemoteObject.concat(RemoteObject.createImmutable("NO HAY INVENTARIO SUFICIENTE "),_idpromo),subs.mostCurrent.__c.getField(false,"Colors").getField(true,"Red"));};
 BA.debugLineNum = 1028;BA.debugLine="Return CreateMap(\"status\":\"ko\", \"mp\":pm)";
Debug.ShouldStop(8);
if (true) return subs.mostCurrent.__c.runMethod(false, "createMap", (Object)(new RemoteObject[] {RemoteObject.createImmutable(("status")),RemoteObject.createImmutable(("ko")),RemoteObject.createImmutable(("mp")),(_pm.getObject())}));
 };
 };
 BA.debugLineNum = 1034;BA.debugLine="LogColor(\"TIEMPO DE PROCESO ESTA PROMO: \" & ((Dat";
Debug.ShouldStop(512);
subs.mostCurrent.__c.runVoidMethod ("LogImpl","314090272",RemoteObject.concat(RemoteObject.createImmutable("TIEMPO DE PROCESO ESTA PROMO: "),(RemoteObject.solve(new RemoteObject[] {(RemoteObject.solve(new RemoteObject[] {subs.mostCurrent.__c.getField(false,"DateTime").runMethod(true,"getNow"),BA.numberCast(double.class, _iniciocontador)}, "-",1, 0)),RemoteObject.createImmutable(1000)}, "/",0, 0))),subs.mostCurrent.__c.getField(false,"Colors").getField(true,"Red"));
 BA.debugLineNum = 1035;BA.debugLine="End Sub";
Debug.ShouldStop(1024);
return RemoteObject.createImmutable(null);
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _process_globals() throws Exception{
 //BA.debugLineNum = 3;BA.debugLine="Sub Process_Globals";
 //BA.debugLineNum = 6;BA.debugLine="Public GZip As GZipStrings 		'Usa la libreria Com";
subs._gzip = RemoteObject.createNew ("de.donmanfred.GZipStringswrapper");
 //BA.debugLineNum = 7;BA.debugLine="Private su As StringUtils 		'Usa la libreria Stri";
subs._su = RemoteObject.createNew ("anywheresoftware.b4a.objects.StringUtils");
 //BA.debugLineNum = 8;BA.debugLine="Dim phn As Phone";
subs._phn = RemoteObject.createNew ("anywheresoftware.b4a.phone.Phone");
 //BA.debugLineNum = 9;BA.debugLine="Dim devModel As String";
subs._devmodel = RemoteObject.createImmutable("");
 //BA.debugLineNum = 10;BA.debugLine="Dim kmt, errorLog As SQL 'Requiere la libreria \"S";
subs._kmt = RemoteObject.createNew ("anywheresoftware.b4a.sql.SQL");
subs._errorlog = RemoteObject.createNew ("anywheresoftware.b4a.sql.SQL");
 //BA.debugLineNum = 12;BA.debugLine="Dim ssid As String  'ignore";
subs._ssid = RemoteObject.createImmutable("");
 //BA.debugLineNum = 13;BA.debugLine="Dim rutaMaxPoints As Int = 3000";
subs._rutamaxpoints = BA.numberCast(int.class, 3000);
 //BA.debugLineNum = 14;BA.debugLine="Dim rutaHrsAtras As Int = 48";
subs._rutahrsatras = BA.numberCast(int.class, 48);
 //BA.debugLineNum = 16;BA.debugLine="Private subsLogs As Boolean = False";
subs._subslogs = subs.mostCurrent.__c.getField(true,"False");
 //BA.debugLineNum = 17;BA.debugLine="End Sub";
return RemoteObject.createImmutable("");
}
public static RemoteObject  _restafijospromo(RemoteObject _ba,RemoteObject _promomap) throws Exception{
try {
		Debug.PushSubsStack("restaFijosPromo (subs) ","subs",9,_ba,subs.mostCurrent,908);
if (RapidSub.canDelegate("restafijospromo")) { return keymon.lat.medicomed.subs.remoteMe.runUserSub(false, "subs","restafijospromo", _ba, _promomap);}
RemoteObject _thislog = RemoteObject.createImmutable(false);
RemoteObject _inventariosdisponiblesparaestapromo = RemoteObject.declareNull("anywheresoftware.b4a.objects.collections.Map");
RemoteObject _i = RemoteObject.createImmutable(0);
RemoteObject _prodsmap = RemoteObject.declareNull("anywheresoftware.b4a.objects.collections.Map");
RemoteObject _prodsfijos = RemoteObject.declareNull("anywheresoftware.b4a.objects.collections.List");
int _p = 0;
RemoteObject _t = RemoteObject.createImmutable("");
RemoteObject _p2 = RemoteObject.declareNull("anywheresoftware.b4a.objects.collections.Map");
;
Debug.locals.put("promoMap", _promomap);
 BA.debugLineNum = 908;BA.debugLine="Sub restaFijosPromo(promoMap As Map) As Map 'ignor";
Debug.ShouldStop(2048);
 BA.debugLineNum = 909;BA.debugLine="Private thisLog As Boolean = False 'Si es verdade";
Debug.ShouldStop(4096);
_thislog = subs.mostCurrent.__c.getField(true,"False");Debug.locals.put("thisLog", _thislog);Debug.locals.put("thisLog", _thislog);
 BA.debugLineNum = 910;BA.debugLine="Private inventariosDisponiblesParaEstaPromo As Ma";
Debug.ShouldStop(8192);
_inventariosdisponiblesparaestapromo = RemoteObject.createNew ("anywheresoftware.b4a.objects.collections.Map");
_inventariosdisponiblesparaestapromo = _traemosinventariodisponibleparapromo(_ba,BA.ObjectToString(_promomap.runMethod(false,"Get",(Object)((RemoteObject.createImmutable("id"))))));Debug.locals.put("inventariosDisponiblesParaEstaPromo", _inventariosdisponiblesparaestapromo);Debug.locals.put("inventariosDisponiblesParaEstaPromo", _inventariosdisponiblesparaestapromo);
 BA.debugLineNum = 911;BA.debugLine="If thisLog Then LogColor(inventariosDisponiblesPa";
Debug.ShouldStop(16384);
if (_thislog.<Boolean>get().booleanValue()) { 
subs.mostCurrent.__c.runVoidMethod ("LogImpl","313828099",BA.ObjectToString(_inventariosdisponiblesparaestapromo),subs.mostCurrent.__c.getField(false,"Colors").getField(true,"Red"));};
 BA.debugLineNum = 912;BA.debugLine="If thisLog Then LogColor(\"Inventario inicial ante";
Debug.ShouldStop(32768);
if (_thislog.<Boolean>get().booleanValue()) { 
subs.mostCurrent.__c.runVoidMethod ("LogImpl","313828100",RemoteObject.concat(RemoteObject.createImmutable("Inventario inicial antes de FIJOS: "),_inventariosdisponiblesparaestapromo),subs.mostCurrent.__c.getField(false,"Colors").getField(true,"Gray"));};
 BA.debugLineNum = 913;BA.debugLine="Private i As Int";
Debug.ShouldStop(65536);
_i = RemoteObject.createImmutable(0);Debug.locals.put("i", _i);
 BA.debugLineNum = 914;BA.debugLine="Private prodsmap As Map = promoMap.Get(\"productos";
Debug.ShouldStop(131072);
_prodsmap = RemoteObject.createNew ("anywheresoftware.b4a.objects.collections.Map");
_prodsmap = RemoteObject.declareNull("anywheresoftware.b4a.AbsObjectWrapper").runMethod(false, "ConvertToWrapper", RemoteObject.createNew("anywheresoftware.b4a.objects.collections.Map"), _promomap.runMethod(false,"Get",(Object)((RemoteObject.createImmutable("productos")))));Debug.locals.put("prodsmap", _prodsmap);Debug.locals.put("prodsmap", _prodsmap);
 BA.debugLineNum = 915;BA.debugLine="Private prodsFijos As List = promoMap.get(\"prodsF";
Debug.ShouldStop(262144);
_prodsfijos = RemoteObject.createNew ("anywheresoftware.b4a.objects.collections.List");
_prodsfijos = RemoteObject.declareNull("anywheresoftware.b4a.AbsObjectWrapper").runMethod(false, "ConvertToWrapper", RemoteObject.createNew("anywheresoftware.b4a.objects.collections.List"), _promomap.runMethod(false,"Get",(Object)((RemoteObject.createImmutable("prodsFijos")))));Debug.locals.put("prodsFijos", _prodsfijos);Debug.locals.put("prodsFijos", _prodsfijos);
 BA.debugLineNum = 916;BA.debugLine="For p = 0 To prodsFijos.Size - 1";
Debug.ShouldStop(524288);
{
final int step8 = 1;
final int limit8 = RemoteObject.solve(new RemoteObject[] {_prodsfijos.runMethod(true,"getSize"),RemoteObject.createImmutable(1)}, "-",1, 1).<Integer>get().intValue();
_p = 0 ;
for (;(step8 > 0 && _p <= limit8) || (step8 < 0 && _p >= limit8) ;_p = ((int)(0 + _p + step8))  ) {
Debug.locals.put("p", _p);
 BA.debugLineNum = 917;BA.debugLine="Private t As String = prodsFijos.Get(p) 'Obtenem";
Debug.ShouldStop(1048576);
_t = BA.ObjectToString(_prodsfijos.runMethod(false,"Get",(Object)(BA.numberCast(int.class, _p))));Debug.locals.put("t", _t);Debug.locals.put("t", _t);
 BA.debugLineNum = 918;BA.debugLine="Private p2 As Map = prodsmap.Get(t) 'Obtenemos u";
Debug.ShouldStop(2097152);
_p2 = RemoteObject.createNew ("anywheresoftware.b4a.objects.collections.Map");
_p2 = RemoteObject.declareNull("anywheresoftware.b4a.AbsObjectWrapper").runMethod(false, "ConvertToWrapper", RemoteObject.createNew("anywheresoftware.b4a.objects.collections.Map"), _prodsmap.runMethod(false,"Get",(Object)((_t))));Debug.locals.put("p2", _p2);Debug.locals.put("p2", _p2);
 BA.debugLineNum = 919;BA.debugLine="If thisLog Then Log($\"T: ${t}, prod ${p2.Get(\"id";
Debug.ShouldStop(4194304);
if (_thislog.<Boolean>get().booleanValue()) { 
subs.mostCurrent.__c.runVoidMethod ("LogImpl","313828107",(RemoteObject.concat(RemoteObject.createImmutable("T: "),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_t))),RemoteObject.createImmutable(", prod "),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)(_p2.runMethod(false,"Get",(Object)((RemoteObject.createImmutable("idProducto")))))),RemoteObject.createImmutable(", piezas: "),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)(_p2.runMethod(false,"Get",(Object)((RemoteObject.createImmutable("piezas")))))),RemoteObject.createImmutable(""))),0);};
 BA.debugLineNum = 920;BA.debugLine="If thisLog Then Log(\"inventariosDisponiblesParaE";
Debug.ShouldStop(8388608);
if (_thislog.<Boolean>get().booleanValue()) { 
subs.mostCurrent.__c.runVoidMethod ("LogImpl","313828108",RemoteObject.concat(RemoteObject.createImmutable("inventariosDisponiblesParaEstaPromo="),_inventariosdisponiblesparaestapromo),0);};
 BA.debugLineNum = 921;BA.debugLine="If inventariosDisponiblesParaEstaPromo.ContainsK";
Debug.ShouldStop(16777216);
if (_inventariosdisponiblesparaestapromo.runMethod(true,"ContainsKey",(Object)((_t))).<Boolean>get().booleanValue()) { 
 BA.debugLineNum = 922;BA.debugLine="i = inventariosDisponiblesParaEstaPromo.get(t)";
Debug.ShouldStop(33554432);
_i = BA.numberCast(int.class, _inventariosdisponiblesparaestapromo.runMethod(false,"Get",(Object)((_t))));Debug.locals.put("i", _i);
 BA.debugLineNum = 923;BA.debugLine="If thisLog Then Log($\"Nuevo inventario de ${t}:";
Debug.ShouldStop(67108864);
if (_thislog.<Boolean>get().booleanValue()) { 
subs.mostCurrent.__c.runVoidMethod ("LogImpl","313828111",(RemoteObject.concat(RemoteObject.createImmutable("Nuevo inventario de "),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_t))),RemoteObject.createImmutable(": "),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_i))),RemoteObject.createImmutable("-"),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((RemoteObject.declareNull("anywheresoftware.b4a.AbsObjectWrapper").runMethod(false, "ConvertToWrapper", RemoteObject.createNew("anywheresoftware.b4a.objects.collections.List"), _promomap.runMethod(false,"Get",(Object)((RemoteObject.createImmutable("prodsFijosPiezas")))))).runMethod(false,"Get",(Object)(BA.numberCast(int.class, _p))))),RemoteObject.createImmutable(" = "),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("1.0")),(Object)((RemoteObject.solve(new RemoteObject[] {_i,BA.numberCast(double.class, (RemoteObject.declareNull("anywheresoftware.b4a.AbsObjectWrapper").runMethod(false, "ConvertToWrapper", RemoteObject.createNew("anywheresoftware.b4a.objects.collections.List"), _promomap.runMethod(false,"Get",(Object)((RemoteObject.createImmutable("prodsFijosPiezas")))))).runMethod(false,"Get",(Object)(BA.numberCast(int.class, _p))))}, "-",1, 0)))),RemoteObject.createImmutable(""))),0);};
 BA.debugLineNum = 924;BA.debugLine="inventariosDisponiblesParaEstaPromo.Put(t, $\"${";
Debug.ShouldStop(134217728);
_inventariosdisponiblesparaestapromo.runVoidMethod ("Put",(Object)((_t)),(Object)(((RemoteObject.concat(RemoteObject.createImmutable(""),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((RemoteObject.solve(new RemoteObject[] {_i,BA.numberCast(double.class, (RemoteObject.declareNull("anywheresoftware.b4a.AbsObjectWrapper").runMethod(false, "ConvertToWrapper", RemoteObject.createNew("anywheresoftware.b4a.objects.collections.List"), _promomap.runMethod(false,"Get",(Object)((RemoteObject.createImmutable("prodsFijosPiezas")))))).runMethod(false,"Get",(Object)(BA.numberCast(int.class, _p))))}, "-",1, 0)))),RemoteObject.createImmutable(""))))));
 BA.debugLineNum = 925;BA.debugLine="inventariosDisponiblesParaEstaPromo.Put(\"result";
Debug.ShouldStop(268435456);
_inventariosdisponiblesparaestapromo.runVoidMethod ("Put",(Object)(RemoteObject.createImmutable(("resultado"))),(Object)((RemoteObject.createImmutable("ok"))));
 }else {
 BA.debugLineNum = 927;BA.debugLine="inventariosDisponiblesParaEstaPromo.Put(\"result";
Debug.ShouldStop(1073741824);
_inventariosdisponiblesparaestapromo.runVoidMethod ("Put",(Object)(RemoteObject.createImmutable(("resultado"))),(Object)((RemoteObject.createImmutable("No hay suficiente producto para la promocion."))));
 BA.debugLineNum = 928;BA.debugLine="LogColor(\"Sin suficiente inventario fijo: \" & t";
Debug.ShouldStop(-2147483648);
subs.mostCurrent.__c.runVoidMethod ("LogImpl","313828116",RemoteObject.concat(RemoteObject.createImmutable("Sin suficiente inventario fijo: "),_t),subs.mostCurrent.__c.getField(false,"Colors").getField(true,"Blue"));
 BA.debugLineNum = 929;BA.debugLine="Exit";
Debug.ShouldStop(1);
if (true) break;
 };
 BA.debugLineNum = 931;BA.debugLine="If i - p2.Get(\"piezas\") < 0 Then";
Debug.ShouldStop(4);
if (RemoteObject.solveBoolean("<",RemoteObject.solve(new RemoteObject[] {_i,BA.numberCast(double.class, _p2.runMethod(false,"Get",(Object)((RemoteObject.createImmutable("piezas")))))}, "-",1, 0),BA.numberCast(double.class, 0))) { 
 BA.debugLineNum = 932;BA.debugLine="inventariosDisponiblesParaEstaPromo.Put(\"result";
Debug.ShouldStop(8);
_inventariosdisponiblesparaestapromo.runVoidMethod ("Put",(Object)(RemoteObject.createImmutable(("resultado"))),(Object)((RemoteObject.createImmutable("No hay suficiente producto para la promocion."))));
 BA.debugLineNum = 933;BA.debugLine="Exit";
Debug.ShouldStop(16);
if (true) break;
 };
 }
}Debug.locals.put("p", _p);
;
 BA.debugLineNum = 936;BA.debugLine="If prodsFijos.Size = 0 Then inventariosDisponible";
Debug.ShouldStop(128);
if (RemoteObject.solveBoolean("=",_prodsfijos.runMethod(true,"getSize"),BA.numberCast(double.class, 0))) { 
_inventariosdisponiblesparaestapromo.runVoidMethod ("Put",(Object)(RemoteObject.createImmutable(("resultado"))),(Object)((RemoteObject.createImmutable("ok"))));};
 BA.debugLineNum = 937;BA.debugLine="If thisLog Then LogColor(\"Inventario final depues";
Debug.ShouldStop(256);
if (_thislog.<Boolean>get().booleanValue()) { 
subs.mostCurrent.__c.runVoidMethod ("LogImpl","313828125",RemoteObject.concat(RemoteObject.createImmutable("Inventario final depues de FIJOS: "),_inventariosdisponiblesparaestapromo),subs.mostCurrent.__c.getField(false,"Colors").getField(true,"Blue"));};
 BA.debugLineNum = 938;BA.debugLine="Return inventariosDisponiblesParaEstaPromo";
Debug.ShouldStop(512);
if (true) return _inventariosdisponiblesparaestapromo;
 BA.debugLineNum = 939;BA.debugLine="End Sub";
Debug.ShouldStop(1024);
return RemoteObject.createImmutable(null);
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _revisabd(RemoteObject _ba) throws Exception{
try {
		Debug.PushSubsStack("revisaBD (subs) ","subs",9,_ba,subs.mostCurrent,184);
if (RapidSub.canDelegate("revisabd")) { return keymon.lat.medicomed.subs.remoteMe.runUserSub(false, "subs","revisabd", _ba);}
;
 BA.debugLineNum = 184;BA.debugLine="Sub revisaBD 'ignore";
Debug.ShouldStop(8388608);
 BA.debugLineNum = 188;BA.debugLine="If Not(File.Exists(Starter.ruta, \"kmt.db\")) Then";
Debug.ShouldStop(134217728);
if (subs.mostCurrent.__c.runMethod(true,"Not",(Object)(subs.mostCurrent.__c.getField(false,"File").runMethod(true,"Exists",(Object)(subs.mostCurrent._starter._ruta /*RemoteObject*/ ),(Object)(RemoteObject.createImmutable("kmt.db"))))).<Boolean>get().booleanValue()) { 
 BA.debugLineNum = 189;BA.debugLine="File.Copy(File.DirAssets, \"kmt.db\", Starter.ruta";
Debug.ShouldStop(268435456);
subs.mostCurrent.__c.getField(false,"File").runVoidMethod ("Copy",(Object)(subs.mostCurrent.__c.getField(false,"File").runMethod(true,"getDirAssets")),(Object)(BA.ObjectToString("kmt.db")),(Object)(subs.mostCurrent._starter._ruta /*RemoteObject*/ ),(Object)(RemoteObject.createImmutable("kmt.db")));
 BA.debugLineNum = 190;BA.debugLine="LogColor(\"copiamos kmt.db de \"&File.DirAssets &";
Debug.ShouldStop(536870912);
subs.mostCurrent.__c.runVoidMethod ("LogImpl","311468806",RemoteObject.concat(RemoteObject.createImmutable("copiamos kmt.db de "),subs.mostCurrent.__c.getField(false,"File").runMethod(true,"getDirAssets"),RemoteObject.createImmutable(" a "),subs.mostCurrent._starter._ruta /*RemoteObject*/ ),subs.mostCurrent.__c.getField(false,"Colors").getField(true,"Green"));
 };
 BA.debugLineNum = 192;BA.debugLine="If Not(kmt.IsInitialized) Then kmt.Initialize(Sta";
Debug.ShouldStop(-2147483648);
if (subs.mostCurrent.__c.runMethod(true,"Not",(Object)(subs._kmt.runMethod(true,"IsInitialized"))).<Boolean>get().booleanValue()) { 
subs._kmt.runVoidMethod ("Initialize",(Object)(subs.mostCurrent._starter._ruta /*RemoteObject*/ ),(Object)(BA.ObjectToString("kmt.db")),(Object)(subs.mostCurrent.__c.getField(true,"True")));};
 BA.debugLineNum = 193;BA.debugLine="kmt.ExecNonQuery(\"CREATE TABLE IF NOT EXISTS RUTA";
Debug.ShouldStop(1);
subs._kmt.runVoidMethod ("ExecNonQuery",(Object)(RemoteObject.createImmutable("CREATE TABLE IF NOT EXISTS RUTA_GPS(FECHA INTEGER, LAT TEXT, LON TEXT)")));
 BA.debugLineNum = 195;BA.debugLine="kmt.ExecNonQuery(\"CREATE TABLE IF NOT EXISTS bita";
Debug.ShouldStop(4);
subs._kmt.runVoidMethod ("ExecNonQuery",(Object)(RemoteObject.createImmutable("CREATE TABLE IF NOT EXISTS bitacora(fecha INTEGER, texto TEXT)")));
 BA.debugLineNum = 196;BA.debugLine="kmt.ExecNonQuery(\"CREATE TABLE IF NOT EXISTS HIST";
Debug.ShouldStop(8);
subs._kmt.runVoidMethod ("ExecNonQuery",(Object)(RemoteObject.createImmutable("CREATE TABLE IF NOT EXISTS HIST_AVANCE(HA_MARCA TEXT, HA_AVANCE TEXT, HA_OBJETIVO TEXT, HA_PORCENTAJE TEXT)")));
 BA.debugLineNum = 197;BA.debugLine="kmt.ExecNonQuery(\"CREATE TABLE IF NOT EXISTS HIST";
Debug.ShouldStop(16);
subs._kmt.runVoidMethod ("ExecNonQuery",(Object)(RemoteObject.createImmutable("CREATE TABLE IF NOT EXISTS HIST_FOTO_CLIENTE(CODIGO TEXT, ALMACEN TEXT, RUTA TEXT, NOM_FOTO TEXT)")));
 BA.debugLineNum = 199;BA.debugLine="kmt.ExecNonQuery(\"CREATE TABLE IF NOT EXISTS CLIE";
Debug.ShouldStop(64);
subs._kmt.runVoidMethod ("ExecNonQuery",(Object)(RemoteObject.createImmutable("CREATE TABLE IF NOT EXISTS CLIENTES_NUEVOS(CN_ID TEXT, CN_FECHA TEXT, CN_USER TEXT, CN_LAT TEXT, CN_LON TEXT, CN_NOMBRE TEXT, CN_DIRECCION TEXT, COLONIA TEXT, CP TEXT, CN_ALMACEN TEXT, CN_RUTA TEXT, CN_ENVIO TEXT)")));
 BA.debugLineNum = 201;BA.debugLine="Try 'Si no existe la columna CN_BANDERA la agrega";
Debug.ShouldStop(256);
try { BA.debugLineNum = 202;BA.debugLine="kmt.ExecQuery(\"select count(CN_BANDERA) from CLI";
Debug.ShouldStop(512);
subs._kmt.runVoidMethod ("ExecQuery",(Object)(RemoteObject.createImmutable("select count(CN_BANDERA) from CLIENTES_NUEVOS")));
 Debug.CheckDeviceExceptions();
} 
       catch (Exception e14) {
			BA.rdebugUtils.runVoidMethod("setLastException",BA.rdebugUtils.runMethod(false, "processBAFromBA", _ba), e14.toString()); BA.debugLineNum = 204;BA.debugLine="Try";
Debug.ShouldStop(2048);
try { BA.debugLineNum = 205;BA.debugLine="kmt.ExecNonQuery(\"ALTER TABLE CLIENTES_NUEVOS A";
Debug.ShouldStop(4096);
subs._kmt.runVoidMethod ("ExecNonQuery",(Object)(RemoteObject.createImmutable("ALTER TABLE CLIENTES_NUEVOS ADD COLUMN CN_BANDERA INTEGER")));
 Debug.CheckDeviceExceptions();
} 
       catch (Exception e17) {
			BA.rdebugUtils.runVoidMethod("setLastException",BA.rdebugUtils.runMethod(false, "processBAFromBA", _ba), e17.toString()); BA.debugLineNum = 207;BA.debugLine="LogColor(\"No pudimos agregar la columna CN_BAND";
Debug.ShouldStop(16384);
subs.mostCurrent.__c.runVoidMethod ("LogImpl","311468823",BA.ObjectToString("No pudimos agregar la columna CN_BANDERA."),subs.mostCurrent.__c.getField(false,"Colors").getField(true,"Red"));
 BA.debugLineNum = 208;BA.debugLine="LogColor(LastException, Colors.Red)";
Debug.ShouldStop(32768);
subs.mostCurrent.__c.runVoidMethod ("LogImpl","311468824",BA.ObjectToString(subs.mostCurrent.__c.runMethod(false,"LastException",_ba)),subs.mostCurrent.__c.getField(false,"Colors").getField(true,"Red"));
 };
 };
 BA.debugLineNum = 212;BA.debugLine="Try 'Si no existe la columna PC_ENVIO_OK la agreg";
Debug.ShouldStop(524288);
try { BA.debugLineNum = 213;BA.debugLine="kmt.ExecQuery(\"select count(PC_ENVIO_OK) from PE";
Debug.ShouldStop(1048576);
subs._kmt.runVoidMethod ("ExecQuery",(Object)(RemoteObject.createImmutable("select count(PC_ENVIO_OK) from PEDIDO_CLIENTE")));
 Debug.CheckDeviceExceptions();
} 
       catch (Exception e24) {
			BA.rdebugUtils.runVoidMethod("setLastException",BA.rdebugUtils.runMethod(false, "processBAFromBA", _ba), e24.toString()); BA.debugLineNum = 215;BA.debugLine="Try";
Debug.ShouldStop(4194304);
try { BA.debugLineNum = 216;BA.debugLine="kmt.ExecNonQuery(\"ALTER TABLE PEDIDO_CLIENTE AD";
Debug.ShouldStop(8388608);
subs._kmt.runVoidMethod ("ExecNonQuery",(Object)(RemoteObject.createImmutable("ALTER TABLE PEDIDO_CLIENTE ADD COLUMN PC_ENVIO_OK INTEGER")));
 Debug.CheckDeviceExceptions();
} 
       catch (Exception e27) {
			BA.rdebugUtils.runVoidMethod("setLastException",BA.rdebugUtils.runMethod(false, "processBAFromBA", _ba), e27.toString()); BA.debugLineNum = 218;BA.debugLine="LogColor(\"No pudimos agregar la columna PC_ENVI";
Debug.ShouldStop(33554432);
subs.mostCurrent.__c.runVoidMethod ("LogImpl","311468834",BA.ObjectToString("No pudimos agregar la columna PC_ENVIO_OK."),subs.mostCurrent.__c.getField(false,"Colors").getField(true,"Red"));
 BA.debugLineNum = 219;BA.debugLine="LogColor(LastException, Colors.Red)";
Debug.ShouldStop(67108864);
subs.mostCurrent.__c.runVoidMethod ("LogImpl","311468835",BA.ObjectToString(subs.mostCurrent.__c.runMethod(false,"LastException",_ba)),subs.mostCurrent.__c.getField(false,"Colors").getField(true,"Red"));
 };
 };
 BA.debugLineNum = 222;BA.debugLine="Try 'Si no existe la columna PC_ENVIO_OK la agreg";
Debug.ShouldStop(536870912);
try { BA.debugLineNum = 223;BA.debugLine="kmt.ExecQuery(\"select count(PC_TIEMPO_TIENDA) fr";
Debug.ShouldStop(1073741824);
subs._kmt.runVoidMethod ("ExecQuery",(Object)(RemoteObject.createImmutable("select count(PC_TIEMPO_TIENDA) from PEDIDO_CLIENTE")));
 Debug.CheckDeviceExceptions();
} 
       catch (Exception e34) {
			BA.rdebugUtils.runVoidMethod("setLastException",BA.rdebugUtils.runMethod(false, "processBAFromBA", _ba), e34.toString()); BA.debugLineNum = 225;BA.debugLine="Try";
Debug.ShouldStop(1);
try { BA.debugLineNum = 226;BA.debugLine="kmt.ExecNonQuery(\"ALTER TABLE PEDIDO_CLIENTE AD";
Debug.ShouldStop(2);
subs._kmt.runVoidMethod ("ExecNonQuery",(Object)(RemoteObject.createImmutable("ALTER TABLE PEDIDO_CLIENTE ADD COLUMN PC_TIEMPO_TIENDA FLOAT")));
 Debug.CheckDeviceExceptions();
} 
       catch (Exception e37) {
			BA.rdebugUtils.runVoidMethod("setLastException",BA.rdebugUtils.runMethod(false, "processBAFromBA", _ba), e37.toString()); BA.debugLineNum = 228;BA.debugLine="LogColor(\"No pudimos agregar la columna PC_TIEM";
Debug.ShouldStop(8);
subs.mostCurrent.__c.runVoidMethod ("LogImpl","311468844",BA.ObjectToString("No pudimos agregar la columna PC_TIEMPO_TIENDA."),subs.mostCurrent.__c.getField(false,"Colors").getField(true,"Red"));
 BA.debugLineNum = 229;BA.debugLine="LogColor(LastException, Colors.Red)";
Debug.ShouldStop(16);
subs.mostCurrent.__c.runVoidMethod ("LogImpl","311468845",BA.ObjectToString(subs.mostCurrent.__c.runMethod(false,"LastException",_ba)),subs.mostCurrent.__c.getField(false,"Colors").getField(true,"Red"));
 };
 };
 BA.debugLineNum = 232;BA.debugLine="Try 'Si no existe la columna PC_FACTURA la agrega";
Debug.ShouldStop(128);
try { BA.debugLineNum = 233;BA.debugLine="kmt.ExecQuery(\"select count(PC_FACTURA) from PED";
Debug.ShouldStop(256);
subs._kmt.runVoidMethod ("ExecQuery",(Object)(RemoteObject.createImmutable("select count(PC_FACTURA) from PEDIDO_CLIENTE")));
 Debug.CheckDeviceExceptions();
} 
       catch (Exception e44) {
			BA.rdebugUtils.runVoidMethod("setLastException",BA.rdebugUtils.runMethod(false, "processBAFromBA", _ba), e44.toString()); BA.debugLineNum = 235;BA.debugLine="Try";
Debug.ShouldStop(1024);
try { BA.debugLineNum = 236;BA.debugLine="kmt.ExecNonQuery(\"ALTER TABLE PEDIDO_CLIENTE AD";
Debug.ShouldStop(2048);
subs._kmt.runVoidMethod ("ExecNonQuery",(Object)(RemoteObject.createImmutable("ALTER TABLE PEDIDO_CLIENTE ADD COLUMN PC_FACTURA INTEGER")));
 Debug.CheckDeviceExceptions();
} 
       catch (Exception e47) {
			BA.rdebugUtils.runVoidMethod("setLastException",BA.rdebugUtils.runMethod(false, "processBAFromBA", _ba), e47.toString()); BA.debugLineNum = 238;BA.debugLine="LogColor(\"No pudimos agregar la columna PC_FACT";
Debug.ShouldStop(8192);
subs.mostCurrent.__c.runVoidMethod ("LogImpl","311468854",BA.ObjectToString("No pudimos agregar la columna PC_FACTURA."),subs.mostCurrent.__c.getField(false,"Colors").getField(true,"Red"));
 BA.debugLineNum = 239;BA.debugLine="LogColor(LastException, Colors.Red)";
Debug.ShouldStop(16384);
subs.mostCurrent.__c.runVoidMethod ("LogImpl","311468855",BA.ObjectToString(subs.mostCurrent.__c.runMethod(false,"LastException",_ba)),subs.mostCurrent.__c.getField(false,"Colors").getField(true,"Red"));
 };
 };
 BA.debugLineNum = 243;BA.debugLine="Try 'Si no existe la columna PC_ENVIO_OK la agreg";
Debug.ShouldStop(262144);
try { BA.debugLineNum = 244;BA.debugLine="kmt.ExecQuery(\"select count(NV_NOMBRE) from NOVE";
Debug.ShouldStop(524288);
subs._kmt.runVoidMethod ("ExecQuery",(Object)(RemoteObject.createImmutable("select count(NV_NOMBRE) from NOVENTA")));
 Debug.CheckDeviceExceptions();
} 
       catch (Exception e54) {
			BA.rdebugUtils.runVoidMethod("setLastException",BA.rdebugUtils.runMethod(false, "processBAFromBA", _ba), e54.toString()); BA.debugLineNum = 246;BA.debugLine="Try";
Debug.ShouldStop(2097152);
try { BA.debugLineNum = 247;BA.debugLine="kmt.ExecNonQuery(\"ALTER TABLE NOVENTA ADD COLUM";
Debug.ShouldStop(4194304);
subs._kmt.runVoidMethod ("ExecNonQuery",(Object)(RemoteObject.createImmutable("ALTER TABLE NOVENTA ADD COLUMN NV_NOMBRE TEXT")));
 Debug.CheckDeviceExceptions();
} 
       catch (Exception e57) {
			BA.rdebugUtils.runVoidMethod("setLastException",BA.rdebugUtils.runMethod(false, "processBAFromBA", _ba), e57.toString()); BA.debugLineNum = 249;BA.debugLine="LogColor(\"No pudimos agregar la columna NV_NOMB";
Debug.ShouldStop(16777216);
subs.mostCurrent.__c.runVoidMethod ("LogImpl","311468865",BA.ObjectToString("No pudimos agregar la columna NV_NOMBRE."),subs.mostCurrent.__c.getField(false,"Colors").getField(true,"Red"));
 BA.debugLineNum = 250;BA.debugLine="LogColor(LastException, Colors.Red)";
Debug.ShouldStop(33554432);
subs.mostCurrent.__c.runVoidMethod ("LogImpl","311468866",BA.ObjectToString(subs.mostCurrent.__c.runMethod(false,"LastException",_ba)),subs.mostCurrent.__c.getField(false,"Colors").getField(true,"Red"));
 };
 };
 BA.debugLineNum = 254;BA.debugLine="Try 'Si no existe la columna PC_ENVIO_OK la agreg";
Debug.ShouldStop(536870912);
try { BA.debugLineNum = 255;BA.debugLine="kmt.ExecQuery(\"select count(NV_DIRECCION) from N";
Debug.ShouldStop(1073741824);
subs._kmt.runVoidMethod ("ExecQuery",(Object)(RemoteObject.createImmutable("select count(NV_DIRECCION) from NOVENTA")));
 Debug.CheckDeviceExceptions();
} 
       catch (Exception e64) {
			BA.rdebugUtils.runVoidMethod("setLastException",BA.rdebugUtils.runMethod(false, "processBAFromBA", _ba), e64.toString()); BA.debugLineNum = 257;BA.debugLine="Try";
Debug.ShouldStop(1);
try { BA.debugLineNum = 258;BA.debugLine="kmt.ExecNonQuery(\"ALTER TABLE NOVENTA ADD COLUM";
Debug.ShouldStop(2);
subs._kmt.runVoidMethod ("ExecNonQuery",(Object)(RemoteObject.createImmutable("ALTER TABLE NOVENTA ADD COLUMN NV_DIRECCION TEXT")));
 Debug.CheckDeviceExceptions();
} 
       catch (Exception e67) {
			BA.rdebugUtils.runVoidMethod("setLastException",BA.rdebugUtils.runMethod(false, "processBAFromBA", _ba), e67.toString()); BA.debugLineNum = 260;BA.debugLine="LogColor(\"No pudimos agregar la columna NV_NOMB";
Debug.ShouldStop(8);
subs.mostCurrent.__c.runVoidMethod ("LogImpl","311468876",BA.ObjectToString("No pudimos agregar la columna NV_NOMBRE."),subs.mostCurrent.__c.getField(false,"Colors").getField(true,"Red"));
 BA.debugLineNum = 261;BA.debugLine="LogColor(LastException, Colors.Red)";
Debug.ShouldStop(16);
subs.mostCurrent.__c.runVoidMethod ("LogImpl","311468877",BA.ObjectToString(subs.mostCurrent.__c.runMethod(false,"LastException",_ba)),subs.mostCurrent.__c.getField(false,"Colors").getField(true,"Red"));
 };
 };
 BA.debugLineNum = 265;BA.debugLine="Try 'Si no existe la columna NV_ENVIO la agregamo";
Debug.ShouldStop(256);
try { BA.debugLineNum = 266;BA.debugLine="kmt.ExecQuery(\"select count(NV_ENVIO) from NOVEN";
Debug.ShouldStop(512);
subs._kmt.runVoidMethod ("ExecQuery",(Object)(RemoteObject.createImmutable("select count(NV_ENVIO) from NOVENTA")));
 Debug.CheckDeviceExceptions();
} 
       catch (Exception e74) {
			BA.rdebugUtils.runVoidMethod("setLastException",BA.rdebugUtils.runMethod(false, "processBAFromBA", _ba), e74.toString()); BA.debugLineNum = 268;BA.debugLine="Try";
Debug.ShouldStop(2048);
try { BA.debugLineNum = 269;BA.debugLine="kmt.ExecNonQuery(\"ALTER TABLE NOVENTA ADD COLUM";
Debug.ShouldStop(4096);
subs._kmt.runVoidMethod ("ExecNonQuery",(Object)(RemoteObject.createImmutable("ALTER TABLE NOVENTA ADD COLUMN NV_ENVIO TEXT")));
 Debug.CheckDeviceExceptions();
} 
       catch (Exception e77) {
			BA.rdebugUtils.runVoidMethod("setLastException",BA.rdebugUtils.runMethod(false, "processBAFromBA", _ba), e77.toString()); BA.debugLineNum = 271;BA.debugLine="LogColor(\"No pudimos agregar la columna NV_ENVI";
Debug.ShouldStop(16384);
subs.mostCurrent.__c.runVoidMethod ("LogImpl","311468887",BA.ObjectToString("No pudimos agregar la columna NV_ENVIO."),subs.mostCurrent.__c.getField(false,"Colors").getField(true,"Red"));
 BA.debugLineNum = 272;BA.debugLine="LogColor(LastException, Colors.Red)";
Debug.ShouldStop(32768);
subs.mostCurrent.__c.runVoidMethod ("LogImpl","311468888",BA.ObjectToString(subs.mostCurrent.__c.runMethod(false,"LastException",_ba)),subs.mostCurrent.__c.getField(false,"Colors").getField(true,"Red"));
 };
 };
 BA.debugLineNum = 276;BA.debugLine="kmt.ExecNonQuery(\"CREATE TABLE IF NOT EXISTS bita";
Debug.ShouldStop(524288);
subs._kmt.runVoidMethod ("ExecNonQuery",(Object)(RemoteObject.createImmutable("CREATE TABLE IF NOT EXISTS bitacora(fecha INTEGER, texto TEXT)")));
 BA.debugLineNum = 278;BA.debugLine="kmt.ExecNonQuery(\"CREATE TABLE IF NOT EXISTS PEDI";
Debug.ShouldStop(2097152);
subs._kmt.runVoidMethod ("ExecNonQuery",(Object)(RemoteObject.createImmutable("CREATE TABLE IF NOT EXISTS PEDIDO_INICIO_FINAL(PIF_CLIENTE TEXT, PIF_HORA_INICIO LONG, PIF_HORA_FINAL LONG)")));
 BA.debugLineNum = 281;BA.debugLine="If Not(errorLog.IsInitialized) Then errorLog.Init";
Debug.ShouldStop(16777216);
if (subs.mostCurrent.__c.runMethod(true,"Not",(Object)(subs._errorlog.runMethod(true,"IsInitialized"))).<Boolean>get().booleanValue()) { 
subs._errorlog.runVoidMethod ("Initialize",(Object)(subs.mostCurrent._starter._ruta /*RemoteObject*/ ),(Object)(BA.ObjectToString("errorLog.db")),(Object)(subs.mostCurrent.__c.getField(true,"True")));};
 BA.debugLineNum = 282;BA.debugLine="errorLog.ExecNonQuery(\"CREATE TABLE IF NOT EXISTS";
Debug.ShouldStop(33554432);
subs._errorlog.runVoidMethod ("ExecNonQuery",(Object)(RemoteObject.createImmutable("CREATE TABLE IF NOT EXISTS errores(fecha INTEGER, error TEXT)")));
 BA.debugLineNum = 283;BA.debugLine="End Sub";
Debug.ShouldStop(67108864);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _revisaflp(RemoteObject _ba) throws Exception{
try {
		Debug.PushSubsStack("revisaFLP (subs) ","subs",9,_ba,subs.mostCurrent,426);
if (RapidSub.canDelegate("revisaflp")) { return keymon.lat.medicomed.subs.remoteMe.runUserSub(false, "subs","revisaflp", _ba);}
RemoteObject _todobienflp = RemoteObject.createImmutable(false);
;
 BA.debugLineNum = 426;BA.debugLine="Sub revisaFLP 'ignore";
Debug.ShouldStop(512);
 BA.debugLineNum = 427;BA.debugLine="LogColor(\"**** **** Revisamos FLP **** ****\", Col";
Debug.ShouldStop(1024);
subs.mostCurrent.__c.runVoidMethod ("LogImpl","312124161",BA.ObjectToString("**** **** Revisamos FLP **** ****"),subs.mostCurrent.__c.getField(false,"Colors").runMethod(true,"RGB",(Object)(BA.numberCast(int.class, 78)),(Object)(BA.numberCast(int.class, 0)),(Object)(BA.numberCast(int.class, 227))));
 BA.debugLineNum = 428;BA.debugLine="Private todoBienFLP As Boolean = True";
Debug.ShouldStop(2048);
_todobienflp = subs.mostCurrent.__c.getField(true,"True");Debug.locals.put("todoBienFLP", _todobienflp);Debug.locals.put("todoBienFLP", _todobienflp);
 BA.debugLineNum = 429;BA.debugLine="Try";
Debug.ShouldStop(4096);
try { BA.debugLineNum = 430;BA.debugLine="If Not(Tracker.FLP.IsInitialized) Then";
Debug.ShouldStop(8192);
if (subs.mostCurrent.__c.runMethod(true,"Not",(Object)(subs.mostCurrent._tracker._flp /*RemoteObject*/ .runMethod(true,"IsInitialized"))).<Boolean>get().booleanValue()) { 
 BA.debugLineNum = 431;BA.debugLine="log2DB(\"revisaFLP: No esta inicializado ... 'Re";
Debug.ShouldStop(16384);
_log2db(_ba,RemoteObject.createImmutable("revisaFLP: No esta inicializado ... 'Reinicializando FLP'"));
 BA.debugLineNum = 432;BA.debugLine="Tracker.FLP.Initialize(\"flp\")";
Debug.ShouldStop(32768);
subs.mostCurrent._tracker._flp /*RemoteObject*/ .runVoidMethod ("Initialize",BA.rdebugUtils.runMethod(false, "processBAFromBA", _ba),(Object)(RemoteObject.createImmutable("flp")));
 BA.debugLineNum = 433;BA.debugLine="todoBienFLP = False";
Debug.ShouldStop(65536);
_todobienflp = subs.mostCurrent.__c.getField(true,"False");Debug.locals.put("todoBienFLP", _todobienflp);
 };
 Debug.CheckDeviceExceptions();
} 
       catch (Exception e10) {
			BA.rdebugUtils.runVoidMethod("setLastException",BA.rdebugUtils.runMethod(false, "processBAFromBA", _ba), e10.toString()); BA.debugLineNum = 436;BA.debugLine="LogColor(\"If Not(Tracker.FLP.IsInitialized) ---";
Debug.ShouldStop(524288);
subs.mostCurrent.__c.runVoidMethod ("LogImpl","312124170",RemoteObject.concat(RemoteObject.createImmutable("If Not(Tracker.FLP.IsInitialized) --- "),subs.mostCurrent.__c.runMethod(false,"LastException",_ba)),subs.mostCurrent.__c.getField(false,"Colors").getField(true,"Red"));
 };
 BA.debugLineNum = 438;BA.debugLine="Try";
Debug.ShouldStop(2097152);
try { BA.debugLineNum = 439;BA.debugLine="If Tracker.FLP.IsInitialized Then";
Debug.ShouldStop(4194304);
if (subs.mostCurrent._tracker._flp /*RemoteObject*/ .runMethod(true,"IsInitialized").<Boolean>get().booleanValue()) { 
 BA.debugLineNum = 440;BA.debugLine="Try";
Debug.ShouldStop(8388608);
try { BA.debugLineNum = 441;BA.debugLine="If Not(Tracker.FLP.IsConnected) Then";
Debug.ShouldStop(16777216);
if (subs.mostCurrent.__c.runMethod(true,"Not",(Object)(subs.mostCurrent._tracker._flp /*RemoteObject*/ .runMethod(true,"IsConnected"))).<Boolean>get().booleanValue()) { 
 BA.debugLineNum = 442;BA.debugLine="log2DB(\"revisaFLP: No esta conectado ... 'Rec";
Debug.ShouldStop(33554432);
_log2db(_ba,RemoteObject.createImmutable("revisaFLP: No esta conectado ... 'Reconectando FLP'"));
 BA.debugLineNum = 444;BA.debugLine="CallSubDelayed(Tracker,\"StartFLP\")";
Debug.ShouldStop(134217728);
subs.mostCurrent.__c.runVoidMethod ("CallSubDelayed",BA.rdebugUtils.runMethod(false, "processBAFromBA", _ba),(Object)((subs.mostCurrent._tracker.getObject())),(Object)(RemoteObject.createImmutable("StartFLP")));
 BA.debugLineNum = 445;BA.debugLine="todoBienFLP = False";
Debug.ShouldStop(268435456);
_todobienflp = subs.mostCurrent.__c.getField(true,"False");Debug.locals.put("todoBienFLP", _todobienflp);
 };
 Debug.CheckDeviceExceptions();
} 
       catch (Exception e21) {
			BA.rdebugUtils.runVoidMethod("setLastException",BA.rdebugUtils.runMethod(false, "processBAFromBA", _ba), e21.toString()); BA.debugLineNum = 448;BA.debugLine="LogColor(\"If Not(Tracker.FLP.IsConnected) -->";
Debug.ShouldStop(-2147483648);
subs.mostCurrent.__c.runVoidMethod ("LogImpl","312124182",RemoteObject.concat(RemoteObject.createImmutable("If Not(Tracker.FLP.IsConnected) --> "),subs.mostCurrent.__c.runMethod(false,"LastException",_ba)),subs.mostCurrent.__c.getField(false,"Colors").getField(true,"Red"));
 };
 BA.debugLineNum = 450;BA.debugLine="Try";
Debug.ShouldStop(2);
try { BA.debugLineNum = 451;BA.debugLine="If Tracker.FLP.IsConnected And _ 					Tracker.";
Debug.ShouldStop(4);
if (RemoteObject.solveBoolean(".",subs.mostCurrent._tracker._flp /*RemoteObject*/ .runMethod(true,"IsConnected")) && RemoteObject.solveBoolean(".",subs.mostCurrent._tracker._flp /*RemoteObject*/ .runMethod(false,"GetLastKnownLocation").runMethod(true,"IsInitialized")) && RemoteObject.solveBoolean(">",subs.mostCurrent._tracker._flp /*RemoteObject*/ .runMethod(false,"GetLastKnownLocation").runMethod(true,"DistanceTo",(Object)((subs.mostCurrent._tracker._uugcoords /*RemoteObject*/ .getObject()))),BA.numberCast(double.class, 500))) { 
 BA.debugLineNum = 454;BA.debugLine="log2DB(\"revisaFLP: 'No se esta actualizando,";
Debug.ShouldStop(32);
_log2db(_ba,RemoteObject.createImmutable("revisaFLP: 'No se esta actualizando, lo reiniciamos ...'"));
 BA.debugLineNum = 455;BA.debugLine="StartService(Tracker)";
Debug.ShouldStop(64);
subs.mostCurrent.__c.runVoidMethod ("StartService",BA.rdebugUtils.runMethod(false, "processBAFromBA", _ba),(Object)((subs.mostCurrent._tracker.getObject())));
 BA.debugLineNum = 456;BA.debugLine="todoBienFLP = False";
Debug.ShouldStop(128);
_todobienflp = subs.mostCurrent.__c.getField(true,"False");Debug.locals.put("todoBienFLP", _todobienflp);
 };
 Debug.CheckDeviceExceptions();
} 
       catch (Exception e30) {
			BA.rdebugUtils.runVoidMethod("setLastException",BA.rdebugUtils.runMethod(false, "processBAFromBA", _ba), e30.toString()); BA.debugLineNum = 459;BA.debugLine="LogColor(\"If FLP.IsConnectctd and FLP.getLKL.I";
Debug.ShouldStop(1024);
subs.mostCurrent.__c.runVoidMethod ("LogImpl","312124193",RemoteObject.concat(RemoteObject.createImmutable("If FLP.IsConnectctd and FLP.getLKL.IsInitialized --> "),subs.mostCurrent.__c.runMethod(false,"LastException",_ba)),subs.mostCurrent.__c.getField(false,"Colors").getField(true,"Red"));
 };
 };
 BA.debugLineNum = 462;BA.debugLine="If todoBienFLP Then LogColor(\" +++ +++ Sin error";
Debug.ShouldStop(8192);
if (_todobienflp.<Boolean>get().booleanValue()) { 
subs.mostCurrent.__c.runVoidMethod ("LogImpl","312124196",BA.ObjectToString(" +++ +++ Sin errores en FLP"),subs.mostCurrent.__c.getField(false,"Colors").getField(true,"Green"));};
 Debug.CheckDeviceExceptions();
} 
       catch (Exception e35) {
			BA.rdebugUtils.runVoidMethod("setLastException",BA.rdebugUtils.runMethod(false, "processBAFromBA", _ba), e35.toString()); BA.debugLineNum = 464;BA.debugLine="LogColor(\"If Tracker.FLP.IsInitialized --> \"&Las";
Debug.ShouldStop(32768);
subs.mostCurrent.__c.runVoidMethod ("LogImpl","312124198",RemoteObject.concat(RemoteObject.createImmutable("If Tracker.FLP.IsInitialized --> "),subs.mostCurrent.__c.runMethod(false,"LastException",_ba)),subs.mostCurrent.__c.getField(false,"Colors").getField(true,"Red"));
 };
 BA.debugLineNum = 467;BA.debugLine="End Sub";
Debug.ShouldStop(262144);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _revisamaxpromosprodsfijosporinventario(RemoteObject _ba,RemoteObject _pm) throws Exception{
try {
		Debug.PushSubsStack("revisaMaxPromosProdsFijosPorInventario (subs) ","subs",9,_ba,subs.mostCurrent,1081);
if (RapidSub.canDelegate("revisamaxpromosprodsfijosporinventario")) { return keymon.lat.medicomed.subs.remoteMe.runUserSub(false, "subs","revisamaxpromosprodsfijosporinventario", _ba, _pm);}
RemoteObject _thislog = RemoteObject.createImmutable(false);
RemoteObject _invfijoxpromo = RemoteObject.declareNull("anywheresoftware.b4a.objects.collections.Map");
RemoteObject _t = RemoteObject.declareNull("anywheresoftware.b4a.objects.collections.List");
RemoteObject _invdispparapromo = RemoteObject.declareNull("anywheresoftware.b4a.objects.collections.Map");
RemoteObject _prodsfijospiezas = RemoteObject.declareNull("anywheresoftware.b4a.objects.collections.List");
RemoteObject _idprodsfijos = RemoteObject.declareNull("anywheresoftware.b4a.objects.collections.List");
int _p = 0;
RemoteObject _x = null;
;
Debug.locals.put("pm", _pm);
 BA.debugLineNum = 1081;BA.debugLine="Sub revisaMaxPromosProdsFijosPorInventario(pm As M";
Debug.ShouldStop(16777216);
 BA.debugLineNum = 1082;BA.debugLine="Private thisLog As Boolean = False";
Debug.ShouldStop(33554432);
_thislog = subs.mostCurrent.__c.getField(true,"False");Debug.locals.put("thisLog", _thislog);Debug.locals.put("thisLog", _thislog);
 BA.debugLineNum = 1083;BA.debugLine="Private invFijoXpromo As Map";
Debug.ShouldStop(67108864);
_invfijoxpromo = RemoteObject.createNew ("anywheresoftware.b4a.objects.collections.Map");Debug.locals.put("invFijoXpromo", _invfijoxpromo);
 BA.debugLineNum = 1084;BA.debugLine="Private t As List";
Debug.ShouldStop(134217728);
_t = RemoteObject.createNew ("anywheresoftware.b4a.objects.collections.List");Debug.locals.put("t", _t);
 BA.debugLineNum = 1085;BA.debugLine="t.Initialize";
Debug.ShouldStop(268435456);
_t.runVoidMethod ("Initialize");
 BA.debugLineNum = 1086;BA.debugLine="t.Add(traeMaxPromos(pm)) ' Agregamos a la lista l";
Debug.ShouldStop(536870912);
_t.runVoidMethod ("Add",(Object)((_traemaxpromos(_ba,_pm))));
 BA.debugLineNum = 1087;BA.debugLine="invFijoXpromo.Initialize";
Debug.ShouldStop(1073741824);
_invfijoxpromo.runVoidMethod ("Initialize");
 BA.debugLineNum = 1088;BA.debugLine="If thisLog Then LogColor($\"pm=${pm}\"$, Colors.Blu";
Debug.ShouldStop(-2147483648);
if (_thislog.<Boolean>get().booleanValue()) { 
subs.mostCurrent.__c.runVoidMethod ("LogImpl","314221319",(RemoteObject.concat(RemoteObject.createImmutable("pm="),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_pm.getObject()))),RemoteObject.createImmutable(""))),subs.mostCurrent.__c.getField(false,"Colors").getField(true,"Blue"));};
 BA.debugLineNum = 1089;BA.debugLine="Private invDispParaPromo As Map = traemosInventar";
Debug.ShouldStop(1);
_invdispparapromo = RemoteObject.createNew ("anywheresoftware.b4a.objects.collections.Map");
_invdispparapromo = _traemosinventariodisponibleparapromo(_ba,BA.ObjectToString(_pm.runMethod(false,"Get",(Object)((RemoteObject.createImmutable("id"))))));Debug.locals.put("invDispParaPromo", _invdispparapromo);Debug.locals.put("invDispParaPromo", _invdispparapromo);
 BA.debugLineNum = 1090;BA.debugLine="If thisLog Then Log($\"invDispParaPromo=${invDispP";
Debug.ShouldStop(2);
if (_thislog.<Boolean>get().booleanValue()) { 
subs.mostCurrent.__c.runVoidMethod ("LogImpl","314221321",(RemoteObject.concat(RemoteObject.createImmutable("invDispParaPromo="),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_invdispparapromo.getObject()))),RemoteObject.createImmutable(""))),0);};
 BA.debugLineNum = 1091;BA.debugLine="Private prodsFijosPiezas As List = pm.Get(\"prodsF";
Debug.ShouldStop(4);
_prodsfijospiezas = RemoteObject.createNew ("anywheresoftware.b4a.objects.collections.List");
_prodsfijospiezas = RemoteObject.declareNull("anywheresoftware.b4a.AbsObjectWrapper").runMethod(false, "ConvertToWrapper", RemoteObject.createNew("anywheresoftware.b4a.objects.collections.List"), _pm.runMethod(false,"Get",(Object)((RemoteObject.createImmutable("prodsFijosPiezas")))));Debug.locals.put("prodsFijosPiezas", _prodsfijospiezas);Debug.locals.put("prodsFijosPiezas", _prodsfijospiezas);
 BA.debugLineNum = 1092;BA.debugLine="Private idProdsFijos As List = pm.Get(\"prodsFijos";
Debug.ShouldStop(8);
_idprodsfijos = RemoteObject.createNew ("anywheresoftware.b4a.objects.collections.List");
_idprodsfijos = RemoteObject.declareNull("anywheresoftware.b4a.AbsObjectWrapper").runMethod(false, "ConvertToWrapper", RemoteObject.createNew("anywheresoftware.b4a.objects.collections.List"), _pm.runMethod(false,"Get",(Object)((RemoteObject.createImmutable("prodsFijos")))));Debug.locals.put("idProdsFijos", _idprodsfijos);Debug.locals.put("idProdsFijos", _idprodsfijos);
 BA.debugLineNum = 1093;BA.debugLine="For p = 0 To idProdsFijos.Size -1 'Generamos una";
Debug.ShouldStop(16);
{
final int step12 = 1;
final int limit12 = RemoteObject.solve(new RemoteObject[] {_idprodsfijos.runMethod(true,"getSize"),RemoteObject.createImmutable(1)}, "-",1, 1).<Integer>get().intValue();
_p = 0 ;
for (;(step12 > 0 && _p <= limit12) || (step12 < 0 && _p >= limit12) ;_p = ((int)(0 + _p + step12))  ) {
Debug.locals.put("p", _p);
 BA.debugLineNum = 1094;BA.debugLine="If thisLog Then Log($\"id=${idProdsFijos.Get(p)},";
Debug.ShouldStop(32);
if (_thislog.<Boolean>get().booleanValue()) { 
subs.mostCurrent.__c.runVoidMethod ("LogImpl","314221325",(RemoteObject.concat(RemoteObject.createImmutable("id="),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)(_idprodsfijos.runMethod(false,"Get",(Object)(BA.numberCast(int.class, _p))))),RemoteObject.createImmutable(", inv="),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)(_invdispparapromo.runMethod(false,"Get",(Object)(_idprodsfijos.runMethod(false,"Get",(Object)(BA.numberCast(int.class, _p))))))),RemoteObject.createImmutable(", pzas="),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)(_prodsfijospiezas.runMethod(false,"Get",(Object)(BA.numberCast(int.class, _p))))),RemoteObject.createImmutable(""))),0);};
 BA.debugLineNum = 1095;BA.debugLine="If thisLog Then Log($\"${(invDispParaPromo.Get(id";
Debug.ShouldStop(64);
if (_thislog.<Boolean>get().booleanValue()) { 
subs.mostCurrent.__c.runVoidMethod ("LogImpl","314221326",(RemoteObject.concat(RemoteObject.createImmutable(""),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)(((RemoteObject.solve(new RemoteObject[] {BA.numberCast(double.class, _invdispparapromo.runMethod(false,"Get",(Object)(_idprodsfijos.runMethod(false,"Get",(Object)(BA.numberCast(int.class, _p)))))),BA.numberCast(double.class, _prodsfijospiezas.runMethod(false,"Get",(Object)(BA.numberCast(int.class, _p))))}, "/",0, 0))))),RemoteObject.createImmutable(""))),0);};
 BA.debugLineNum = 1096;BA.debugLine="Private x() As String = Regex.Split(\"\\.\", $\"${(i";
Debug.ShouldStop(128);
_x = subs.mostCurrent.__c.getField(false,"Regex").runMethod(false,"Split",(Object)(BA.ObjectToString("\\.")),(Object)((RemoteObject.concat(RemoteObject.createImmutable(""),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)(((RemoteObject.solve(new RemoteObject[] {BA.numberCast(double.class, _invdispparapromo.runMethod(false,"Get",(Object)(_idprodsfijos.runMethod(false,"Get",(Object)(BA.numberCast(int.class, _p)))))),BA.numberCast(double.class, _prodsfijospiezas.runMethod(false,"Get",(Object)(BA.numberCast(int.class, _p))))}, "/",0, 0))))),RemoteObject.createImmutable("")))));Debug.locals.put("x", _x);Debug.locals.put("x", _x);
 BA.debugLineNum = 1097;BA.debugLine="If thisLog Then Log(x(0))";
Debug.ShouldStop(256);
if (_thislog.<Boolean>get().booleanValue()) { 
subs.mostCurrent.__c.runVoidMethod ("LogImpl","314221328",_x.getArrayElement(true,BA.numberCast(int.class, 0)),0);};
 BA.debugLineNum = 1098;BA.debugLine="t.Add(x(0).As(Int)) 'Solo guardamos la parte del";
Debug.ShouldStop(512);
_t.runVoidMethod ("Add",(Object)(((BA.numberCast(int.class, _x.getArrayElement(true,BA.numberCast(int.class, 0)))))));
 }
}Debug.locals.put("p", _p);
;
 BA.debugLineNum = 1100;BA.debugLine="t.Sort(True) 'Ordenamos la lista para que en el l";
Debug.ShouldStop(2048);
_t.runVoidMethod ("Sort",(Object)(subs.mostCurrent.__c.getField(true,"True")));
 BA.debugLineNum = 1101;BA.debugLine="If thisLog Then LogColor($\"prodsFijos=${idProdsFi";
Debug.ShouldStop(4096);
if (_thislog.<Boolean>get().booleanValue()) { 
subs.mostCurrent.__c.runVoidMethod ("LogImpl","314221332",(RemoteObject.concat(RemoteObject.createImmutable("prodsFijos="),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_idprodsfijos.getObject()))),RemoteObject.createImmutable(""))),subs.mostCurrent.__c.getField(false,"Colors").getField(true,"Blue"));};
 BA.debugLineNum = 1102;BA.debugLine="If thisLog Then LogColor($\"prodsFijosPiezasReq=${";
Debug.ShouldStop(8192);
if (_thislog.<Boolean>get().booleanValue()) { 
subs.mostCurrent.__c.runVoidMethod ("LogImpl","314221333",(RemoteObject.concat(RemoteObject.createImmutable("prodsFijosPiezasReq="),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_prodsfijospiezas.getObject()))),RemoteObject.createImmutable(""))),subs.mostCurrent.__c.getField(false,"Colors").getField(true,"Blue"));};
 BA.debugLineNum = 1103;BA.debugLine="If thisLog Then LogColor($\"invFijoXpromo=${invFij";
Debug.ShouldStop(16384);
if (_thislog.<Boolean>get().booleanValue()) { 
subs.mostCurrent.__c.runVoidMethod ("LogImpl","314221334",(RemoteObject.concat(RemoteObject.createImmutable("invFijoXpromo="),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_invfijoxpromo.getObject()))),RemoteObject.createImmutable(""))),subs.mostCurrent.__c.getField(false,"Colors").getField(true,"Blue"));};
 BA.debugLineNum = 1104;BA.debugLine="LogColor(\"Max promos de prodsFijos POR inventario";
Debug.ShouldStop(32768);
subs.mostCurrent.__c.runVoidMethod ("LogImpl","314221335",RemoteObject.concat(RemoteObject.createImmutable("Max promos de prodsFijos POR inventario = "),_t.runMethod(false,"Get",(Object)(BA.numberCast(int.class, 0)))),subs.mostCurrent.__c.getField(false,"Colors").getField(true,"Red"));
 BA.debugLineNum = 1105;BA.debugLine="Return t.Get(0) 'Regresamos el resultado mas pequ";
Debug.ShouldStop(65536);
if (true) return BA.numberCast(int.class, _t.runMethod(false,"Get",(Object)(BA.numberCast(int.class, 0))));
 BA.debugLineNum = 1106;BA.debugLine="End Sub";
Debug.ShouldStop(131072);
return RemoteObject.createImmutable(0);
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _revisamaxpromosprodsfijosporinventario2(RemoteObject _ba,RemoteObject _pm) throws Exception{
try {
		Debug.PushSubsStack("revisaMaxPromosProdsFijosPorInventario2 (subs) ","subs",9,_ba,subs.mostCurrent,1038);
if (RapidSub.canDelegate("revisamaxpromosprodsfijosporinventario2")) { return keymon.lat.medicomed.subs.remoteMe.runUserSub(false, "subs","revisamaxpromosprodsfijosporinventario2", _ba, _pm);}
RemoteObject _thislog = RemoteObject.createImmutable(false);
RemoteObject _invdispparapromo = RemoteObject.declareNull("anywheresoftware.b4a.objects.collections.Map");
RemoteObject _maxpromos = RemoteObject.createImmutable("");
RemoteObject _maxpromosfijosxinv = RemoteObject.createImmutable(0);
RemoteObject _fpf2 = RemoteObject.createImmutable(0);
RemoteObject _pdp2 = RemoteObject.createImmutable(0);
RemoteObject _salir = RemoteObject.createImmutable(false);
RemoteObject _pf = RemoteObject.declareNull("anywheresoftware.b4a.objects.collections.List");
RemoteObject _pfp = RemoteObject.declareNull("anywheresoftware.b4a.objects.collections.List");
RemoteObject _invfijoxpromo = RemoteObject.declareNull("anywheresoftware.b4a.objects.collections.Map");
int _p = 0;
int _i = 0;
int _q = 0;
RemoteObject _q2 = RemoteObject.createImmutable("");
;
Debug.locals.put("pm", _pm);
 BA.debugLineNum = 1038;BA.debugLine="Sub revisaMaxPromosProdsFijosPorInventario2(pm As";
Debug.ShouldStop(8192);
 BA.debugLineNum = 1039;BA.debugLine="Private thisLog As Boolean = False";
Debug.ShouldStop(16384);
_thislog = subs.mostCurrent.__c.getField(true,"False");Debug.locals.put("thisLog", _thislog);Debug.locals.put("thisLog", _thislog);
 BA.debugLineNum = 1040;BA.debugLine="If thisLog Then Log($\"pm=${pm}\"$)";
Debug.ShouldStop(32768);
if (_thislog.<Boolean>get().booleanValue()) { 
subs.mostCurrent.__c.runVoidMethod ("LogImpl","314155778",(RemoteObject.concat(RemoteObject.createImmutable("pm="),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_pm.getObject()))),RemoteObject.createImmutable(""))),0);};
 BA.debugLineNum = 1042;BA.debugLine="Private invDispParaPromo As Map = traemosInventar";
Debug.ShouldStop(131072);
_invdispparapromo = RemoteObject.createNew ("anywheresoftware.b4a.objects.collections.Map");
_invdispparapromo = _traemosinventariodisponibleparapromo(_ba,BA.ObjectToString(_pm.runMethod(false,"Get",(Object)((RemoteObject.createImmutable("id"))))));Debug.locals.put("invDispParaPromo", _invdispparapromo);Debug.locals.put("invDispParaPromo", _invdispparapromo);
 BA.debugLineNum = 1043;BA.debugLine="If thisLog Then Log($\"invDispParaPromo=${invDispP";
Debug.ShouldStop(262144);
if (_thislog.<Boolean>get().booleanValue()) { 
subs.mostCurrent.__c.runVoidMethod ("LogImpl","314155781",(RemoteObject.concat(RemoteObject.createImmutable("invDispParaPromo="),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_invdispparapromo.getObject()))),RemoteObject.createImmutable(""))),0);};
 BA.debugLineNum = 1044;BA.debugLine="Private maxPromos As String = traeMaxPromos(pm)";
Debug.ShouldStop(524288);
_maxpromos = BA.NumberToString(_traemaxpromos(_ba,_pm));Debug.locals.put("maxPromos", _maxpromos);Debug.locals.put("maxPromos", _maxpromos);
 BA.debugLineNum = 1045;BA.debugLine="Private maxPromosFijosXinv As Int = 1";
Debug.ShouldStop(1048576);
_maxpromosfijosxinv = BA.numberCast(int.class, 1);Debug.locals.put("maxPromosFijosXinv", _maxpromosfijosxinv);Debug.locals.put("maxPromosFijosXinv", _maxpromosfijosxinv);
 BA.debugLineNum = 1046;BA.debugLine="Private fpf2, pdp2 As Int";
Debug.ShouldStop(2097152);
_fpf2 = RemoteObject.createImmutable(0);Debug.locals.put("fpf2", _fpf2);
_pdp2 = RemoteObject.createImmutable(0);Debug.locals.put("pdp2", _pdp2);
 BA.debugLineNum = 1047;BA.debugLine="Private salir As Boolean = False";
Debug.ShouldStop(4194304);
_salir = subs.mostCurrent.__c.getField(true,"False");Debug.locals.put("salir", _salir);Debug.locals.put("salir", _salir);
 BA.debugLineNum = 1048;BA.debugLine="Private pf As List = pm.Get(\"prodsFijos\")";
Debug.ShouldStop(8388608);
_pf = RemoteObject.createNew ("anywheresoftware.b4a.objects.collections.List");
_pf = RemoteObject.declareNull("anywheresoftware.b4a.AbsObjectWrapper").runMethod(false, "ConvertToWrapper", RemoteObject.createNew("anywheresoftware.b4a.objects.collections.List"), _pm.runMethod(false,"Get",(Object)((RemoteObject.createImmutable("prodsFijos")))));Debug.locals.put("pf", _pf);Debug.locals.put("pf", _pf);
 BA.debugLineNum = 1049;BA.debugLine="Private pfp As List = pm.Get(\"prodsFijosPiezas\")";
Debug.ShouldStop(16777216);
_pfp = RemoteObject.createNew ("anywheresoftware.b4a.objects.collections.List");
_pfp = RemoteObject.declareNull("anywheresoftware.b4a.AbsObjectWrapper").runMethod(false, "ConvertToWrapper", RemoteObject.createNew("anywheresoftware.b4a.objects.collections.List"), _pm.runMethod(false,"Get",(Object)((RemoteObject.createImmutable("prodsFijosPiezas")))));Debug.locals.put("pfp", _pfp);Debug.locals.put("pfp", _pfp);
 BA.debugLineNum = 1050;BA.debugLine="If thisLog Then Log($\"maxPromos=${maxPromos}, pro";
Debug.ShouldStop(33554432);
if (_thislog.<Boolean>get().booleanValue()) { 
subs.mostCurrent.__c.runVoidMethod ("LogImpl","314155788",(RemoteObject.concat(RemoteObject.createImmutable("maxPromos="),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_maxpromos))),RemoteObject.createImmutable(", prodsFijos="),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_pf.getObject()))),RemoteObject.createImmutable(", piezas="),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_pfp.getObject()))),RemoteObject.createImmutable(""))),0);};
 BA.debugLineNum = 1051;BA.debugLine="If thisLog Then LogColor($\"InvFijo disponible=${i";
Debug.ShouldStop(67108864);
if (_thislog.<Boolean>get().booleanValue()) { 
subs.mostCurrent.__c.runVoidMethod ("LogImpl","314155789",(RemoteObject.concat(RemoteObject.createImmutable("InvFijo disponible="),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_invdispparapromo.getObject()))),RemoteObject.createImmutable(""))),subs.mostCurrent.__c.getField(false,"Colors").getField(true,"Blue"));};
 BA.debugLineNum = 1052;BA.debugLine="Private invFijoXpromo As Map";
Debug.ShouldStop(134217728);
_invfijoxpromo = RemoteObject.createNew ("anywheresoftware.b4a.objects.collections.Map");Debug.locals.put("invFijoXpromo", _invfijoxpromo);
 BA.debugLineNum = 1053;BA.debugLine="invFijoXpromo.Initialize";
Debug.ShouldStop(268435456);
_invfijoxpromo.runVoidMethod ("Initialize");
 BA.debugLineNum = 1054;BA.debugLine="For p = 0 To pf.Size -1 'Generamos mapa con los p";
Debug.ShouldStop(536870912);
{
final int step15 = 1;
final int limit15 = RemoteObject.solve(new RemoteObject[] {_pf.runMethod(true,"getSize"),RemoteObject.createImmutable(1)}, "-",1, 1).<Integer>get().intValue();
_p = 0 ;
for (;(step15 > 0 && _p <= limit15) || (step15 < 0 && _p >= limit15) ;_p = ((int)(0 + _p + step15))  ) {
Debug.locals.put("p", _p);
 BA.debugLineNum = 1055;BA.debugLine="invFijoXpromo.Put(pf.Get(p), pfp.Get(p))";
Debug.ShouldStop(1073741824);
_invfijoxpromo.runVoidMethod ("Put",(Object)(_pf.runMethod(false,"Get",(Object)(BA.numberCast(int.class, _p)))),(Object)(_pfp.runMethod(false,"Get",(Object)(BA.numberCast(int.class, _p)))));
 }
}Debug.locals.put("p", _p);
;
 BA.debugLineNum = 1057;BA.debugLine="If thisLog Then LogColor(\"Inv req. de prods fijos";
Debug.ShouldStop(1);
if (_thislog.<Boolean>get().booleanValue()) { 
subs.mostCurrent.__c.runVoidMethod ("LogImpl","314155795",RemoteObject.concat(RemoteObject.createImmutable("Inv req. de prods fijos x promo"),_invfijoxpromo),subs.mostCurrent.__c.getField(false,"Colors").getField(true,"Green"));};
 BA.debugLineNum = 1058;BA.debugLine="For i = 1 To maxPromos 'Revisamos cuantas promoci";
Debug.ShouldStop(2);
{
final int step19 = 1;
final int limit19 = (int)(Double.parseDouble(_maxpromos.<String>get()));
_i = 1 ;
for (;(step19 > 0 && _i <= limit19) || (step19 < 0 && _i >= limit19) ;_i = ((int)(0 + _i + step19))  ) {
Debug.locals.put("i", _i);
 BA.debugLineNum = 1059;BA.debugLine="If thisLog Then LogColor(\"Prods para promo \" & (";
Debug.ShouldStop(4);
if (_thislog.<Boolean>get().booleanValue()) { 
subs.mostCurrent.__c.runVoidMethod ("LogImpl","314155797",RemoteObject.concat(RemoteObject.createImmutable("Prods para promo "),(RemoteObject.solve(new RemoteObject[] {RemoteObject.createImmutable(_i),RemoteObject.createImmutable(1)}, "+",1, 1))),subs.mostCurrent.__c.getField(false,"Colors").getField(true,"Magenta"));};
 BA.debugLineNum = 1060;BA.debugLine="For q = 0 To pf.Size - 1";
Debug.ShouldStop(8);
{
final int step21 = 1;
final int limit21 = RemoteObject.solve(new RemoteObject[] {_pf.runMethod(true,"getSize"),RemoteObject.createImmutable(1)}, "-",1, 1).<Integer>get().intValue();
_q = 0 ;
for (;(step21 > 0 && _q <= limit21) || (step21 < 0 && _q >= limit21) ;_q = ((int)(0 + _q + step21))  ) {
Debug.locals.put("q", _q);
 BA.debugLineNum = 1061;BA.debugLine="Private q2 As String = pf.Get(q)";
Debug.ShouldStop(16);
_q2 = BA.ObjectToString(_pf.runMethod(false,"Get",(Object)(BA.numberCast(int.class, _q))));Debug.locals.put("q2", _q2);Debug.locals.put("q2", _q2);
 BA.debugLineNum = 1062;BA.debugLine="If thisLog Then Log(\"q=\"&q2)";
Debug.ShouldStop(32);
if (_thislog.<Boolean>get().booleanValue()) { 
subs.mostCurrent.__c.runVoidMethod ("LogImpl","314155800",RemoteObject.concat(RemoteObject.createImmutable("q="),_q2),0);};
 BA.debugLineNum = 1064;BA.debugLine="fpf2 = pfp.Get(q) * i 'Multiplicamos las piezas";
Debug.ShouldStop(128);
_fpf2 = BA.numberCast(int.class, RemoteObject.solve(new RemoteObject[] {BA.numberCast(double.class, _pfp.runMethod(false,"Get",(Object)(BA.numberCast(int.class, _q)))),RemoteObject.createImmutable(_i)}, "*",0, 0));Debug.locals.put("fpf2", _fpf2);
 BA.debugLineNum = 1065;BA.debugLine="pdp2 = invDispParaPromo.Get(q2)";
Debug.ShouldStop(256);
_pdp2 = BA.numberCast(int.class, _invdispparapromo.runMethod(false,"Get",(Object)((_q2))));Debug.locals.put("pdp2", _pdp2);
 BA.debugLineNum = 1066;BA.debugLine="If thisLog Then Log($\"pf=${q2}, Actual=${(i)},";
Debug.ShouldStop(512);
if (_thislog.<Boolean>get().booleanValue()) { 
subs.mostCurrent.__c.runVoidMethod ("LogImpl","314155804",(RemoteObject.concat(RemoteObject.createImmutable("pf="),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_q2))),RemoteObject.createImmutable(", Actual="),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)(RemoteObject.createImmutable(((_i))))),RemoteObject.createImmutable(", max promos: "),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_pdp2))),RemoteObject.createImmutable("-"),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_fpf2))),RemoteObject.createImmutable("="),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((RemoteObject.solve(new RemoteObject[] {_pdp2,_fpf2}, "-",1, 1)))),RemoteObject.createImmutable(""))),0);};
 BA.debugLineNum = 1067;BA.debugLine="If pdp2 - fpf2 < 0 Then 'Si el inventario es ne";
Debug.ShouldStop(1024);
if (RemoteObject.solveBoolean("<",RemoteObject.solve(new RemoteObject[] {_pdp2,_fpf2}, "-",1, 1),BA.numberCast(double.class, 0))) { 
 BA.debugLineNum = 1068;BA.debugLine="salir=True";
Debug.ShouldStop(2048);
_salir = subs.mostCurrent.__c.getField(true,"True");Debug.locals.put("salir", _salir);
 BA.debugLineNum = 1069;BA.debugLine="Exit";
Debug.ShouldStop(4096);
if (true) break;
 };
 }
}Debug.locals.put("q", _q);
;
 BA.debugLineNum = 1072;BA.debugLine="If salir Then Exit";
Debug.ShouldStop(32768);
if (_salir.<Boolean>get().booleanValue()) { 
if (true) break;};
 BA.debugLineNum = 1073;BA.debugLine="maxPromosFijosXinv = i";
Debug.ShouldStop(65536);
_maxpromosfijosxinv = BA.numberCast(int.class, _i);Debug.locals.put("maxPromosFijosXinv", _maxpromosfijosxinv);
 }
}Debug.locals.put("i", _i);
;
 BA.debugLineNum = 1075;BA.debugLine="If thisLog Then LogColor(\"InvFijo requerido x pro";
Debug.ShouldStop(262144);
if (_thislog.<Boolean>get().booleanValue()) { 
subs.mostCurrent.__c.runVoidMethod ("LogImpl","314155813",RemoteObject.concat(RemoteObject.createImmutable("InvFijo requerido x promo="),_invfijoxpromo),subs.mostCurrent.__c.getField(false,"Colors").getField(true,"Blue"));};
 BA.debugLineNum = 1076;BA.debugLine="LogColor(\"Maximo de promociones de prodsFijos POR";
Debug.ShouldStop(524288);
subs.mostCurrent.__c.runVoidMethod ("LogImpl","314155814",RemoteObject.concat(RemoteObject.createImmutable("Maximo de promociones de prodsFijos POR inventario = "),_maxpromosfijosxinv),subs.mostCurrent.__c.getField(false,"Colors").getField(true,"Red"));
 BA.debugLineNum = 1077;BA.debugLine="Return maxPromosFijosXinv";
Debug.ShouldStop(1048576);
if (true) return _maxpromosfijosxinv;
 BA.debugLineNum = 1078;BA.debugLine="End Sub";
Debug.ShouldStop(2097152);
return RemoteObject.createImmutable(0);
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _revisamaxpromosprodsvariablesporinventario(RemoteObject _ba,RemoteObject _pm) throws Exception{
try {
		Debug.PushSubsStack("revisaMaxPromosProdsVariablesPorInventario (subs) ","subs",9,_ba,subs.mostCurrent,1113);
if (RapidSub.canDelegate("revisamaxpromosprodsvariablesporinventario")) { return keymon.lat.medicomed.subs.remoteMe.runUserSub(false, "subs","revisamaxpromosprodsvariablesporinventario", _ba, _pm);}
RemoteObject _thislog = RemoteObject.createImmutable(false);
RemoteObject _invfijoxpromo = RemoteObject.declareNull("anywheresoftware.b4a.objects.collections.Map");
RemoteObject _totalprodsvariablesdisponibles = RemoteObject.createImmutable(0);
RemoteObject _invdispparapromo = RemoteObject.declareNull("anywheresoftware.b4a.objects.collections.Map");
RemoteObject _maxpromos = RemoteObject.createImmutable("");
RemoteObject _maxpromosxfijos = RemoteObject.createImmutable(0);
RemoteObject _idprodsvariables = RemoteObject.declareNull("anywheresoftware.b4a.objects.collections.List");
RemoteObject _prodsvariablesrequeridos = RemoteObject.createImmutable(0);
RemoteObject _prodsfijospiezas = RemoteObject.declareNull("anywheresoftware.b4a.objects.collections.List");
RemoteObject _idprodsfijos = RemoteObject.declareNull("anywheresoftware.b4a.objects.collections.List");
int _p = 0;
RemoteObject _idesteprod = RemoteObject.createImmutable("");
RemoteObject _investeprod = RemoteObject.createImmutable(0);
RemoteObject _pzasreqesteprod = RemoteObject.createImmutable(0);
RemoteObject _maxpromosxvariables = RemoteObject.createImmutable(0);
int _x = 0;
int _i = 0;
;
Debug.locals.put("pm", _pm);
 BA.debugLineNum = 1113;BA.debugLine="Sub revisaMaxPromosProdsVariablesPorInventario(pm";
Debug.ShouldStop(16777216);
 BA.debugLineNum = 1114;BA.debugLine="Private thisLog As Boolean = False";
Debug.ShouldStop(33554432);
_thislog = subs.mostCurrent.__c.getField(true,"False");Debug.locals.put("thisLog", _thislog);Debug.locals.put("thisLog", _thislog);
 BA.debugLineNum = 1115;BA.debugLine="If thisLog Then Log(\"============================";
Debug.ShouldStop(67108864);
if (_thislog.<Boolean>get().booleanValue()) { 
subs.mostCurrent.__c.runVoidMethod ("LogImpl","314286850",RemoteObject.createImmutable("======================================================"),0);};
 BA.debugLineNum = 1116;BA.debugLine="If thisLog Then Log(\"============================";
Debug.ShouldStop(134217728);
if (_thislog.<Boolean>get().booleanValue()) { 
subs.mostCurrent.__c.runVoidMethod ("LogImpl","314286851",RemoteObject.createImmutable("======================================================"),0);};
 BA.debugLineNum = 1117;BA.debugLine="Private invFijoXpromo As Map";
Debug.ShouldStop(268435456);
_invfijoxpromo = RemoteObject.createNew ("anywheresoftware.b4a.objects.collections.Map");Debug.locals.put("invFijoXpromo", _invfijoxpromo);
 BA.debugLineNum = 1118;BA.debugLine="invFijoXpromo.Initialize";
Debug.ShouldStop(536870912);
_invfijoxpromo.runVoidMethod ("Initialize");
 BA.debugLineNum = 1119;BA.debugLine="Private totalProdsVariablesDisponibles As Int = 0";
Debug.ShouldStop(1073741824);
_totalprodsvariablesdisponibles = BA.numberCast(int.class, 0);Debug.locals.put("totalProdsVariablesDisponibles", _totalprodsvariablesdisponibles);Debug.locals.put("totalProdsVariablesDisponibles", _totalprodsvariablesdisponibles);
 BA.debugLineNum = 1120;BA.debugLine="If thisLog Then LogColor($\"pm=${pm}\"$, Colors.Blu";
Debug.ShouldStop(-2147483648);
if (_thislog.<Boolean>get().booleanValue()) { 
subs.mostCurrent.__c.runVoidMethod ("LogImpl","314286855",(RemoteObject.concat(RemoteObject.createImmutable("pm="),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_pm.getObject()))),RemoteObject.createImmutable(""))),subs.mostCurrent.__c.getField(false,"Colors").getField(true,"Blue"));};
 BA.debugLineNum = 1121;BA.debugLine="Private invDispParaPromo As Map = traemosInventar";
Debug.ShouldStop(1);
_invdispparapromo = RemoteObject.createNew ("anywheresoftware.b4a.objects.collections.Map");
_invdispparapromo = _traemosinventariodisponibleparapromo(_ba,BA.ObjectToString(_pm.runMethod(false,"Get",(Object)((RemoteObject.createImmutable("id"))))));Debug.locals.put("invDispParaPromo", _invdispparapromo);Debug.locals.put("invDispParaPromo", _invdispparapromo);
 BA.debugLineNum = 1122;BA.debugLine="If thisLog Then Log($\"invDispParaPromo=${invDispP";
Debug.ShouldStop(2);
if (_thislog.<Boolean>get().booleanValue()) { 
subs.mostCurrent.__c.runVoidMethod ("LogImpl","314286857",(RemoteObject.concat(RemoteObject.createImmutable("invDispParaPromo="),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_invdispparapromo.getObject()))),RemoteObject.createImmutable(""))),0);};
 BA.debugLineNum = 1123;BA.debugLine="Private maxPromos As String = traeMaxPromos(pm)";
Debug.ShouldStop(4);
_maxpromos = BA.NumberToString(_traemaxpromos(_ba,_pm));Debug.locals.put("maxPromos", _maxpromos);Debug.locals.put("maxPromos", _maxpromos);
 BA.debugLineNum = 1124;BA.debugLine="Private maxPromosXFijos As Int = revisaMaxPromosP";
Debug.ShouldStop(8);
_maxpromosxfijos = _revisamaxpromosprodsfijosporinventario(_ba,_pm);Debug.locals.put("maxPromosXFijos", _maxpromosxfijos);Debug.locals.put("maxPromosXFijos", _maxpromosxfijos);
 BA.debugLineNum = 1125;BA.debugLine="Private idProdsVariables As List = pm.Get(\"prodsV";
Debug.ShouldStop(16);
_idprodsvariables = RemoteObject.createNew ("anywheresoftware.b4a.objects.collections.List");
_idprodsvariables = RemoteObject.declareNull("anywheresoftware.b4a.AbsObjectWrapper").runMethod(false, "ConvertToWrapper", RemoteObject.createNew("anywheresoftware.b4a.objects.collections.List"), _pm.runMethod(false,"Get",(Object)((RemoteObject.createImmutable("prodsVariables")))));Debug.locals.put("idProdsVariables", _idprodsvariables);Debug.locals.put("idProdsVariables", _idprodsvariables);
 BA.debugLineNum = 1126;BA.debugLine="Private prodsVariablesRequeridos As Int = pm.Get(";
Debug.ShouldStop(32);
_prodsvariablesrequeridos = BA.numberCast(int.class, _pm.runMethod(false,"Get",(Object)((RemoteObject.createImmutable("prodsVariablesRequeridos")))));Debug.locals.put("prodsVariablesRequeridos", _prodsvariablesrequeridos);Debug.locals.put("prodsVariablesRequeridos", _prodsvariablesrequeridos);
 BA.debugLineNum = 1127;BA.debugLine="Private prodsFijosPiezas As List = pm.Get(\"prodsF";
Debug.ShouldStop(64);
_prodsfijospiezas = RemoteObject.createNew ("anywheresoftware.b4a.objects.collections.List");
_prodsfijospiezas = RemoteObject.declareNull("anywheresoftware.b4a.AbsObjectWrapper").runMethod(false, "ConvertToWrapper", RemoteObject.createNew("anywheresoftware.b4a.objects.collections.List"), _pm.runMethod(false,"Get",(Object)((RemoteObject.createImmutable("prodsFijosPiezas")))));Debug.locals.put("prodsFijosPiezas", _prodsfijospiezas);Debug.locals.put("prodsFijosPiezas", _prodsfijospiezas);
 BA.debugLineNum = 1128;BA.debugLine="Private idProdsFijos As List = pm.Get(\"prodsFijos";
Debug.ShouldStop(128);
_idprodsfijos = RemoteObject.createNew ("anywheresoftware.b4a.objects.collections.List");
_idprodsfijos = RemoteObject.declareNull("anywheresoftware.b4a.AbsObjectWrapper").runMethod(false, "ConvertToWrapper", RemoteObject.createNew("anywheresoftware.b4a.objects.collections.List"), _pm.runMethod(false,"Get",(Object)((RemoteObject.createImmutable("prodsFijos")))));Debug.locals.put("idProdsFijos", _idprodsfijos);Debug.locals.put("idProdsFijos", _idprodsfijos);
 BA.debugLineNum = 1129;BA.debugLine="For p = 0 To idProdsFijos.Size -1 'Generamos mapa";
Debug.ShouldStop(256);
{
final int step16 = 1;
final int limit16 = RemoteObject.solve(new RemoteObject[] {_idprodsfijos.runMethod(true,"getSize"),RemoteObject.createImmutable(1)}, "-",1, 1).<Integer>get().intValue();
_p = 0 ;
for (;(step16 > 0 && _p <= limit16) || (step16 < 0 && _p >= limit16) ;_p = ((int)(0 + _p + step16))  ) {
Debug.locals.put("p", _p);
 BA.debugLineNum = 1130;BA.debugLine="invFijoXpromo.Put(idProdsFijos.Get(p), prodsFijo";
Debug.ShouldStop(512);
_invfijoxpromo.runVoidMethod ("Put",(Object)(_idprodsfijos.runMethod(false,"Get",(Object)(BA.numberCast(int.class, _p)))),(Object)(_prodsfijospiezas.runMethod(false,"Get",(Object)(BA.numberCast(int.class, _p)))));
 BA.debugLineNum = 1131;BA.debugLine="Private idEsteProd As String = idProdsFijos.Get(";
Debug.ShouldStop(1024);
_idesteprod = BA.ObjectToString(_idprodsfijos.runMethod(false,"Get",(Object)(BA.numberCast(int.class, _p))));Debug.locals.put("idEsteProd", _idesteprod);Debug.locals.put("idEsteProd", _idesteprod);
 BA.debugLineNum = 1132;BA.debugLine="Private invEsteProd As Int = invDispParaPromo.Ge";
Debug.ShouldStop(2048);
_investeprod = BA.numberCast(int.class, _invdispparapromo.runMethod(false,"Get",(Object)((_idesteprod))));Debug.locals.put("invEsteProd", _investeprod);Debug.locals.put("invEsteProd", _investeprod);
 BA.debugLineNum = 1133;BA.debugLine="Private pzasReqEsteProd As Int = prodsFijosPieza";
Debug.ShouldStop(4096);
_pzasreqesteprod = BA.numberCast(int.class, _prodsfijospiezas.runMethod(false,"Get",(Object)(BA.numberCast(int.class, _p))));Debug.locals.put("pzasReqEsteProd", _pzasreqesteprod);Debug.locals.put("pzasReqEsteProd", _pzasreqesteprod);
 BA.debugLineNum = 1134;BA.debugLine="If thisLog Then Log($\"id=${idEsteProd}, inv=${in";
Debug.ShouldStop(8192);
if (_thislog.<Boolean>get().booleanValue()) { 
subs.mostCurrent.__c.runVoidMethod ("LogImpl","314286869",(RemoteObject.concat(RemoteObject.createImmutable("id="),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_idesteprod))),RemoteObject.createImmutable(", inv="),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_investeprod))),RemoteObject.createImmutable(", pzas="),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_pzasreqesteprod))),RemoteObject.createImmutable(""))),0);};
 }
}Debug.locals.put("p", _p);
;
 BA.debugLineNum = 1137;BA.debugLine="If thisLog Then LogColor($\"MaxPromos=${maxPromos}";
Debug.ShouldStop(65536);
if (_thislog.<Boolean>get().booleanValue()) { 
subs.mostCurrent.__c.runVoidMethod ("LogImpl","314286872",(RemoteObject.concat(RemoteObject.createImmutable("MaxPromos="),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_maxpromos))),RemoteObject.createImmutable(", promosXFijos="),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_maxpromosxfijos))),RemoteObject.createImmutable(""))),subs.mostCurrent.__c.getField(false,"Colors").getField(true,"Blue"));};
 BA.debugLineNum = 1138;BA.debugLine="If thisLog Then LogColor($\"prodsFijos=${idProdsFi";
Debug.ShouldStop(131072);
if (_thislog.<Boolean>get().booleanValue()) { 
subs.mostCurrent.__c.runVoidMethod ("LogImpl","314286873",(RemoteObject.concat(RemoteObject.createImmutable("prodsFijos="),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_idprodsfijos.getObject()))),RemoteObject.createImmutable(""))),subs.mostCurrent.__c.getField(false,"Colors").getField(true,"Blue"));};
 BA.debugLineNum = 1139;BA.debugLine="If thisLog Then LogColor($\"prodsFijosPiezasReq=${";
Debug.ShouldStop(262144);
if (_thislog.<Boolean>get().booleanValue()) { 
subs.mostCurrent.__c.runVoidMethod ("LogImpl","314286874",(RemoteObject.concat(RemoteObject.createImmutable("prodsFijosPiezasReq="),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_prodsfijospiezas.getObject()))),RemoteObject.createImmutable(""))),subs.mostCurrent.__c.getField(false,"Colors").getField(true,"Blue"));};
 BA.debugLineNum = 1140;BA.debugLine="If thisLog Then LogColor($\"prodsVariables=${idPro";
Debug.ShouldStop(524288);
if (_thislog.<Boolean>get().booleanValue()) { 
subs.mostCurrent.__c.runVoidMethod ("LogImpl","314286875",(RemoteObject.concat(RemoteObject.createImmutable("prodsVariables="),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_idprodsvariables.getObject()))),RemoteObject.createImmutable(""),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((subs.mostCurrent.__c.getField(true,"CRLF")))),RemoteObject.createImmutable("Variables Req="),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_prodsvariablesrequeridos))),RemoteObject.createImmutable(" "))),subs.mostCurrent.__c.getField(false,"Colors").getField(true,"Blue"));};
 BA.debugLineNum = 1141;BA.debugLine="If thisLog Then LogColor($\"invFijoXpromo=${invFij";
Debug.ShouldStop(1048576);
if (_thislog.<Boolean>get().booleanValue()) { 
subs.mostCurrent.__c.runVoidMethod ("LogImpl","314286876",(RemoteObject.concat(RemoteObject.createImmutable("invFijoXpromo="),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_invfijoxpromo.getObject()))),RemoteObject.createImmutable(""))),subs.mostCurrent.__c.getField(false,"Colors").getField(true,"Blue"));};
 BA.debugLineNum = 1142;BA.debugLine="If thisLog Then Log($\"Prods variables disponibles";
Debug.ShouldStop(2097152);
if (_thislog.<Boolean>get().booleanValue()) { 
subs.mostCurrent.__c.runVoidMethod ("LogImpl","314286877",(RemoteObject.concat(RemoteObject.createImmutable("Prods variables disponibles = "),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_totalprodsvariablesdisponibles))),RemoteObject.createImmutable(""))),0);};
 BA.debugLineNum = 1143;BA.debugLine="Private maxPromosXVariables As Int = 0";
Debug.ShouldStop(4194304);
_maxpromosxvariables = BA.numberCast(int.class, 0);Debug.locals.put("maxPromosXVariables", _maxpromosxvariables);Debug.locals.put("maxPromosXVariables", _maxpromosxvariables);
 BA.debugLineNum = 1144;BA.debugLine="For x = 1 To maxPromosXFijos";
Debug.ShouldStop(8388608);
{
final int step30 = 1;
final int limit30 = _maxpromosxfijos.<Integer>get().intValue();
_x = 1 ;
for (;(step30 > 0 && _x <= limit30) || (step30 < 0 && _x >= limit30) ;_x = ((int)(0 + _x + step30))  ) {
Debug.locals.put("x", _x);
 BA.debugLineNum = 1145;BA.debugLine="If thisLog Then Log(\"===========================";
Debug.ShouldStop(16777216);
if (_thislog.<Boolean>get().booleanValue()) { 
subs.mostCurrent.__c.runVoidMethod ("LogImpl","314286880",RemoteObject.createImmutable("====================================================="),0);};
 BA.debugLineNum = 1146;BA.debugLine="If thisLog Then Log(\"===========================";
Debug.ShouldStop(33554432);
if (_thislog.<Boolean>get().booleanValue()) { 
subs.mostCurrent.__c.runVoidMethod ("LogImpl","314286881",RemoteObject.createImmutable("====================================================="),0);};
 BA.debugLineNum = 1147;BA.debugLine="For i = 0 To idProdsFijos.Size - 1";
Debug.ShouldStop(67108864);
{
final int step33 = 1;
final int limit33 = RemoteObject.solve(new RemoteObject[] {_idprodsfijos.runMethod(true,"getSize"),RemoteObject.createImmutable(1)}, "-",1, 1).<Integer>get().intValue();
_i = 0 ;
for (;(step33 > 0 && _i <= limit33) || (step33 < 0 && _i >= limit33) ;_i = ((int)(0 + _i + step33))  ) {
Debug.locals.put("i", _i);
 BA.debugLineNum = 1148;BA.debugLine="If thisLog Then Log($\"FIJO - ${idProdsFijos.Get";
Debug.ShouldStop(134217728);
if (_thislog.<Boolean>get().booleanValue()) { 
subs.mostCurrent.__c.runVoidMethod ("LogImpl","314286883",(RemoteObject.concat(RemoteObject.createImmutable("FIJO - "),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)(_idprodsfijos.runMethod(false,"Get",(Object)(BA.numberCast(int.class, _i))))),RemoteObject.createImmutable(", "),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)(_invdispparapromo.runMethod(false,"Get",(Object)(_idprodsfijos.runMethod(false,"Get",(Object)(BA.numberCast(int.class, _i))))))),RemoteObject.createImmutable(" - "),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((RemoteObject.solve(new RemoteObject[] {(BA.numberCast(int.class, _prodsfijospiezas.runMethod(false,"Get",(Object)(BA.numberCast(int.class, _i))))),(RemoteObject.solve(new RemoteObject[] {RemoteObject.createImmutable(_i),RemoteObject.createImmutable(1)}, "+",1, 1))}, "*",0, 1)))),RemoteObject.createImmutable(""))),0);};
 BA.debugLineNum = 1149;BA.debugLine="invDispParaPromo.Put(idProdsFijos.Get(i), invDi";
Debug.ShouldStop(268435456);
_invdispparapromo.runVoidMethod ("Put",(Object)(_idprodsfijos.runMethod(false,"Get",(Object)(BA.numberCast(int.class, _i)))),(Object)((RemoteObject.solve(new RemoteObject[] {(BA.numberCast(int.class, _invdispparapromo.runMethod(false,"Get",(Object)(_idprodsfijos.runMethod(false,"Get",(Object)(BA.numberCast(int.class, _i))))))),(BA.numberCast(int.class, _prodsfijospiezas.runMethod(false,"Get",(Object)(BA.numberCast(int.class, _i))))),(RemoteObject.solve(new RemoteObject[] {RemoteObject.createImmutable(_i),RemoteObject.createImmutable(1)}, "+",1, 1))}, "-*",1, 1))));
 }
}Debug.locals.put("i", _i);
;
 BA.debugLineNum = 1151;BA.debugLine="If thisLog Then LogColor(\"Inv disponible despues";
Debug.ShouldStop(1073741824);
if (_thislog.<Boolean>get().booleanValue()) { 
subs.mostCurrent.__c.runVoidMethod ("LogImpl","314286886",RemoteObject.concat(RemoteObject.createImmutable("Inv disponible despues de restar fijos = "),_invdispparapromo),subs.mostCurrent.__c.getField(false,"Colors").getField(true,"Blue"));};
 BA.debugLineNum = 1153;BA.debugLine="totalProdsVariablesDisponibles = 0";
Debug.ShouldStop(1);
_totalprodsvariablesdisponibles = BA.numberCast(int.class, 0);Debug.locals.put("totalProdsVariablesDisponibles", _totalprodsvariablesdisponibles);
 BA.debugLineNum = 1154;BA.debugLine="For i = 0 To idProdsVariables.Size - 1 'Obtenemo";
Debug.ShouldStop(2);
{
final int step39 = 1;
final int limit39 = RemoteObject.solve(new RemoteObject[] {_idprodsvariables.runMethod(true,"getSize"),RemoteObject.createImmutable(1)}, "-",1, 1).<Integer>get().intValue();
_i = 0 ;
for (;(step39 > 0 && _i <= limit39) || (step39 < 0 && _i >= limit39) ;_i = ((int)(0 + _i + step39))  ) {
Debug.locals.put("i", _i);
 BA.debugLineNum = 1155;BA.debugLine="If invDispParaPromo.ContainsKey(idProdsVariable";
Debug.ShouldStop(4);
if (_invdispparapromo.runMethod(true,"ContainsKey",(Object)(_idprodsvariables.runMethod(false,"Get",(Object)(BA.numberCast(int.class, _i))))).<Boolean>get().booleanValue()) { 
 BA.debugLineNum = 1156;BA.debugLine="totalProdsVariablesDisponibles = totalProdsVar";
Debug.ShouldStop(8);
_totalprodsvariablesdisponibles = BA.numberCast(int.class, RemoteObject.solve(new RemoteObject[] {_totalprodsvariablesdisponibles,BA.numberCast(double.class, _invdispparapromo.runMethod(false,"Get",(Object)(_idprodsvariables.runMethod(false,"Get",(Object)(BA.numberCast(int.class, _i))))))}, "+",1, 0));Debug.locals.put("totalProdsVariablesDisponibles", _totalprodsvariablesdisponibles);
 };
 }
}Debug.locals.put("i", _i);
;
 BA.debugLineNum = 1160;BA.debugLine="If thisLog Then Log($\"Var disponibles -  var req";
Debug.ShouldStop(128);
if (_thislog.<Boolean>get().booleanValue()) { 
subs.mostCurrent.__c.runVoidMethod ("LogImpl","314286895",(RemoteObject.concat(RemoteObject.createImmutable("Var disponibles -  var requeridos : "),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_totalprodsvariablesdisponibles))),RemoteObject.createImmutable(" - "),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((RemoteObject.solve(new RemoteObject[] {_prodsvariablesrequeridos,RemoteObject.createImmutable(_x)}, "*",0, 1)))),RemoteObject.createImmutable(""))),0);};
 BA.debugLineNum = 1161;BA.debugLine="totalProdsVariablesDisponibles = totalProdsVaria";
Debug.ShouldStop(256);
_totalprodsvariablesdisponibles = RemoteObject.solve(new RemoteObject[] {_totalprodsvariablesdisponibles,(RemoteObject.solve(new RemoteObject[] {_prodsvariablesrequeridos,RemoteObject.createImmutable(_x)}, "*",0, 1))}, "-",1, 1);Debug.locals.put("totalProdsVariablesDisponibles", _totalprodsvariablesdisponibles);
 BA.debugLineNum = 1162;BA.debugLine="If thisLog Then Log(\"prodsVariables disponibles";
Debug.ShouldStop(512);
if (_thislog.<Boolean>get().booleanValue()) { 
subs.mostCurrent.__c.runVoidMethod ("LogImpl","314286897",RemoteObject.concat(RemoteObject.createImmutable("prodsVariables disponibles despues de promo = "),_totalprodsvariablesdisponibles),0);};
 BA.debugLineNum = 1163;BA.debugLine="If totalProdsVariablesDisponibles < 0 Then Exit";
Debug.ShouldStop(1024);
if (RemoteObject.solveBoolean("<",_totalprodsvariablesdisponibles,BA.numberCast(double.class, 0))) { 
if (true) break;};
 BA.debugLineNum = 1164;BA.debugLine="maxPromosXVariables = x";
Debug.ShouldStop(2048);
_maxpromosxvariables = BA.numberCast(int.class, _x);Debug.locals.put("maxPromosXVariables", _maxpromosxvariables);
 }
}Debug.locals.put("x", _x);
;
 BA.debugLineNum = 1167;BA.debugLine="If thisLog Then LogColor(\"Max promos de prodsVari";
Debug.ShouldStop(16384);
if (_thislog.<Boolean>get().booleanValue()) { 
subs.mostCurrent.__c.runVoidMethod ("LogImpl","314286902",RemoteObject.concat(RemoteObject.createImmutable("Max promos de prodsVariables POR inventario = "),_maxpromosxvariables),subs.mostCurrent.__c.getField(false,"Colors").getField(true,"Red"));};
 BA.debugLineNum = 1168;BA.debugLine="Return maxPromosXVariables";
Debug.ShouldStop(32768);
if (true) return _maxpromosxvariables;
 BA.debugLineNum = 1169;BA.debugLine="End Sub";
Debug.ShouldStop(65536);
return RemoteObject.createImmutable(0);
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _revisauug(RemoteObject _ba) throws Exception{
try {
		Debug.PushSubsStack("revisaUUG (subs) ","subs",9,_ba,subs.mostCurrent,408);
if (RapidSub.canDelegate("revisauug")) { return keymon.lat.medicomed.subs.remoteMe.runUserSub(false, "subs","revisauug", _ba);}
RemoteObject _daa = RemoteObject.createImmutable(0);
;
 BA.debugLineNum = 408;BA.debugLine="Sub revisaUUG 'ignore";
Debug.ShouldStop(8388608);
 BA.debugLineNum = 409;BA.debugLine="Try";
Debug.ShouldStop(16777216);
try { BA.debugLineNum = 411;BA.debugLine="If Tracker.FLP.GetLastKnownLocation.IsInitialize";
Debug.ShouldStop(67108864);
if (subs.mostCurrent._tracker._flp /*RemoteObject*/ .runMethod(false,"GetLastKnownLocation").runMethod(true,"IsInitialized").<Boolean>get().booleanValue()) { 
 BA.debugLineNum = 412;BA.debugLine="Dim daa As Int = Tracker.UUGCoords.DistanceTo(T";
Debug.ShouldStop(134217728);
_daa = BA.numberCast(int.class, subs.mostCurrent._tracker._uugcoords /*RemoteObject*/ .runMethod(true,"DistanceTo",(Object)((subs.mostCurrent._tracker._flp /*RemoteObject*/ .runMethod(false,"GetLastKnownLocation").getObject()))));Debug.locals.put("daa", _daa);Debug.locals.put("daa", _daa);
 BA.debugLineNum = 413;BA.debugLine="If Starter.Logger Then LogColor($\"**** UUC \"${f";
Debug.ShouldStop(268435456);
if (subs.mostCurrent._starter._logger /*RemoteObject*/ .<Boolean>get().booleanValue()) { 
subs.mostCurrent.__c.runVoidMethod ("LogImpl","312058629",(RemoteObject.concat(RemoteObject.createImmutable("**** UUC \""),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_fechakmt(_ba,BA.NumberToString(subs.mostCurrent._tracker._flp /*RemoteObject*/ .runMethod(false,"GetLastKnownLocation").runMethod(true,"getTime")))))),RemoteObject.createImmutable("|"),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("0.2")),(Object)((subs.mostCurrent._tracker._flp /*RemoteObject*/ .runMethod(false,"GetLastKnownLocation").runMethod(true,"getAccuracy")))),RemoteObject.createImmutable("|"),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("0.8")),(Object)((subs.mostCurrent._tracker._flp /*RemoteObject*/ .runMethod(false,"GetLastKnownLocation").runMethod(true,"getLatitude")))),RemoteObject.createImmutable("|"),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("0.8")),(Object)((subs.mostCurrent._tracker._flp /*RemoteObject*/ .runMethod(false,"GetLastKnownLocation").runMethod(true,"getLongitude")))),RemoteObject.createImmutable("|"),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("0.2")),(Object)((subs.mostCurrent._tracker._flp /*RemoteObject*/ .runMethod(false,"GetLastKnownLocation").runMethod(true,"getSpeed")))),RemoteObject.createImmutable("|"))),subs.mostCurrent.__c.getField(false,"Colors").runMethod(true,"RGB",(Object)(BA.numberCast(int.class, 255)),(Object)(BA.numberCast(int.class, 112)),(Object)(BA.numberCast(int.class, 35))));};
 BA.debugLineNum = 414;BA.debugLine="If daa > 40 And Tracker.FLP.GetLastKnownLocatio";
Debug.ShouldStop(536870912);
if (RemoteObject.solveBoolean(">",_daa,BA.numberCast(double.class, 40)) && RemoteObject.solveBoolean("<",subs.mostCurrent._tracker._flp /*RemoteObject*/ .runMethod(false,"GetLastKnownLocation").runMethod(true,"getAccuracy"),BA.numberCast(double.class, 35))) { 
 BA.debugLineNum = 415;BA.debugLine="kmt.ExecNonQuery2(\"INSERT INTO RUTA_GPS(fecha,";
Debug.ShouldStop(1073741824);
subs._kmt.runVoidMethod ("ExecNonQuery2",(Object)(BA.ObjectToString("INSERT INTO RUTA_GPS(fecha, lat, lon) VALUES (?,?,?)")),(Object)(subs.mostCurrent.__c.runMethod(false, "ArrayToList", (Object)(RemoteObject.createNewArray("Object",new int[] {3},new Object[] {(_fechakmt(_ba,BA.NumberToString(subs.mostCurrent._tracker._flp /*RemoteObject*/ .runMethod(false,"GetLastKnownLocation").runMethod(true,"getTime")))),(subs.mostCurrent._tracker._flp /*RemoteObject*/ .runMethod(false,"GetLastKnownLocation").runMethod(true,"getLatitude")),(subs.mostCurrent._tracker._flp /*RemoteObject*/ .runMethod(false,"GetLastKnownLocation").runMethod(true,"getLongitude"))})))));
 BA.debugLineNum = 416;BA.debugLine="If Starter.Logger Then Log(\"++++ Distancia a a";
Debug.ShouldStop(-2147483648);
if (subs.mostCurrent._starter._logger /*RemoteObject*/ .<Boolean>get().booleanValue()) { 
subs.mostCurrent.__c.runVoidMethod ("LogImpl","312058632",RemoteObject.concat(RemoteObject.createImmutable("++++ Distancia a anterior="),_daa,RemoteObject.createImmutable("|"),RemoteObject.createImmutable("Precision="),subs.mostCurrent._tracker._flp /*RemoteObject*/ .runMethod(false,"GetLastKnownLocation").runMethod(true,"getAccuracy")),0);};
 };
 BA.debugLineNum = 418;BA.debugLine="Tracker.UUGCoords = Tracker.FLP.GetLastKnownLoc";
Debug.ShouldStop(2);
subs.mostCurrent._tracker._uugcoords /*RemoteObject*/  = subs.mostCurrent._tracker._flp /*RemoteObject*/ .runMethod(false,"GetLastKnownLocation");
 };
 Debug.CheckDeviceExceptions();
} 
       catch (Exception e12) {
			BA.rdebugUtils.runVoidMethod("setLastException",BA.rdebugUtils.runMethod(false, "processBAFromBA", _ba), e12.toString()); BA.debugLineNum = 421;BA.debugLine="LogColor(\"If Tracker.FLP.GetLastKnownLocation.Is";
Debug.ShouldStop(16);
subs.mostCurrent.__c.runVoidMethod ("LogImpl","312058637",RemoteObject.concat(RemoteObject.createImmutable("If Tracker.FLP.GetLastKnownLocation.IsInitialized --> "),subs.mostCurrent.__c.runMethod(false,"LastException",_ba)),subs.mostCurrent.__c.getField(false,"Colors").getField(true,"Red"));
 };
 BA.debugLineNum = 423;BA.debugLine="End Sub";
Debug.ShouldStop(64);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _traealmacen(RemoteObject _ba) throws Exception{
try {
		Debug.PushSubsStack("traeAlmacen (subs) ","subs",9,_ba,subs.mostCurrent,694);
if (RapidSub.canDelegate("traealmacen")) { return keymon.lat.medicomed.subs.remoteMe.runUserSub(false, "subs","traealmacen", _ba);}
RemoteObject _c = RemoteObject.declareNull("anywheresoftware.b4a.sql.SQL.CursorWrapper");
RemoteObject _a = RemoteObject.createImmutable("");
;
 BA.debugLineNum = 694;BA.debugLine="Sub traeAlmacen As String 'ignore";
Debug.ShouldStop(2097152);
 BA.debugLineNum = 695;BA.debugLine="Private c As Cursor";
Debug.ShouldStop(4194304);
_c = RemoteObject.createNew ("anywheresoftware.b4a.sql.SQL.CursorWrapper");Debug.locals.put("c", _c);
 BA.debugLineNum = 696;BA.debugLine="Private a As String";
Debug.ShouldStop(8388608);
_a = RemoteObject.createImmutable("");Debug.locals.put("a", _a);
 BA.debugLineNum = 697;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"select  ID_AL";
Debug.ShouldStop(16777216);
_c = RemoteObject.declareNull("anywheresoftware.b4a.AbsObjectWrapper").runMethod(false, "ConvertToWrapper", RemoteObject.createNew("anywheresoftware.b4a.sql.SQL.CursorWrapper"), subs.mostCurrent._b4xpages.runMethod(false,"_mainpage" /*RemoteObject*/ ,_ba).getField(false,"_skmt" /*RemoteObject*/ ).runMethod(false,"ExecQuery",(Object)(RemoteObject.createImmutable("select  ID_ALMACEN from CAT_ALMACEN"))));Debug.locals.put("c", _c);
 BA.debugLineNum = 698;BA.debugLine="c.Position = 0";
Debug.ShouldStop(33554432);
_c.runMethod(true,"setPosition",BA.numberCast(int.class, 0));
 BA.debugLineNum = 699;BA.debugLine="a = C.GetString(\"ID_ALMACEN\")";
Debug.ShouldStop(67108864);
_a = _c.runMethod(true,"GetString",(Object)(RemoteObject.createImmutable("ID_ALMACEN")));Debug.locals.put("a", _a);
 BA.debugLineNum = 700;BA.debugLine="c.Close";
Debug.ShouldStop(134217728);
_c.runVoidMethod ("Close");
 BA.debugLineNum = 701;BA.debugLine="Return a";
Debug.ShouldStop(268435456);
if (true) return _a;
 BA.debugLineNum = 702;BA.debugLine="End Sub";
Debug.ShouldStop(536870912);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _traecliente(RemoteObject _ba) throws Exception{
try {
		Debug.PushSubsStack("traeCliente (subs) ","subs",9,_ba,subs.mostCurrent,734);
if (RapidSub.canDelegate("traecliente")) { return keymon.lat.medicomed.subs.remoteMe.runUserSub(false, "subs","traecliente", _ba);}
RemoteObject _c = RemoteObject.declareNull("anywheresoftware.b4a.sql.SQL.CursorWrapper");
RemoteObject _cl = RemoteObject.createImmutable("");
;
 BA.debugLineNum = 734;BA.debugLine="Sub traeCliente As String 'ignore";
Debug.ShouldStop(536870912);
 BA.debugLineNum = 735;BA.debugLine="Private c As Cursor";
Debug.ShouldStop(1073741824);
_c = RemoteObject.createNew ("anywheresoftware.b4a.sql.SQL.CursorWrapper");Debug.locals.put("c", _c);
 BA.debugLineNum = 736;BA.debugLine="Private cl As String";
Debug.ShouldStop(-2147483648);
_cl = RemoteObject.createImmutable("");Debug.locals.put("cl", _cl);
 BA.debugLineNum = 737;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"Select CUENTA";
Debug.ShouldStop(1);
_c = RemoteObject.declareNull("anywheresoftware.b4a.AbsObjectWrapper").runMethod(false, "ConvertToWrapper", RemoteObject.createNew("anywheresoftware.b4a.sql.SQL.CursorWrapper"), subs.mostCurrent._b4xpages.runMethod(false,"_mainpage" /*RemoteObject*/ ,_ba).getField(false,"_skmt" /*RemoteObject*/ ).runMethod(false,"ExecQuery",(Object)(RemoteObject.createImmutable("Select CUENTA from cuentaa"))));Debug.locals.put("c", _c);
 BA.debugLineNum = 738;BA.debugLine="c.Position=0";
Debug.ShouldStop(2);
_c.runMethod(true,"setPosition",BA.numberCast(int.class, 0));
 BA.debugLineNum = 739;BA.debugLine="cl = c.GetString(\"CUENTA\")";
Debug.ShouldStop(4);
_cl = _c.runMethod(true,"GetString",(Object)(RemoteObject.createImmutable("CUENTA")));Debug.locals.put("cl", _cl);
 BA.debugLineNum = 740;BA.debugLine="c.Close";
Debug.ShouldStop(8);
_c.runVoidMethod ("Close");
 BA.debugLineNum = 741;BA.debugLine="Return cl";
Debug.ShouldStop(16);
if (true) return _cl;
 BA.debugLineNum = 742;BA.debugLine="End Sub";
Debug.ShouldStop(32);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _traefecha(RemoteObject _ba) throws Exception{
try {
		Debug.PushSubsStack("traeFecha (subs) ","subs",9,_ba,subs.mostCurrent,744);
if (RapidSub.canDelegate("traefecha")) { return keymon.lat.medicomed.subs.remoteMe.runUserSub(false, "subs","traefecha", _ba);}
RemoteObject _sdate = RemoteObject.createImmutable("");
RemoteObject _stime = RemoteObject.createImmutable("");
;
 BA.debugLineNum = 744;BA.debugLine="Sub traeFecha As String 'ignore";
Debug.ShouldStop(128);
 BA.debugLineNum = 745;BA.debugLine="DateTime.DateFormat = \"MM/dd/yyyy\"";
Debug.ShouldStop(256);
subs.mostCurrent.__c.getField(false,"DateTime").runMethod(true,"setDateFormat",BA.ObjectToString("MM/dd/yyyy"));
 BA.debugLineNum = 746;BA.debugLine="Private sDate As String =DateTime.Date(DateTime.N";
Debug.ShouldStop(512);
_sdate = subs.mostCurrent.__c.getField(false,"DateTime").runMethod(true,"Date",(Object)(subs.mostCurrent.__c.getField(false,"DateTime").runMethod(true,"getNow")));Debug.locals.put("sDate", _sdate);Debug.locals.put("sDate", _sdate);
 BA.debugLineNum = 747;BA.debugLine="Private sTime As String =DateTime.Time(DateTime.N";
Debug.ShouldStop(1024);
_stime = subs.mostCurrent.__c.getField(false,"DateTime").runMethod(true,"Time",(Object)(subs.mostCurrent.__c.getField(false,"DateTime").runMethod(true,"getNow")));Debug.locals.put("sTime", _stime);Debug.locals.put("sTime", _stime);
 BA.debugLineNum = 748;BA.debugLine="Return sDate & sTime";
Debug.ShouldStop(2048);
if (true) return RemoteObject.concat(_sdate,_stime);
 BA.debugLineNum = 749;BA.debugLine="End Sub";
Debug.ShouldStop(4096);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _traemaxpromos(RemoteObject _ba,RemoteObject _pm) throws Exception{
try {
		Debug.PushSubsStack("traeMaxPromos (subs) ","subs",9,_ba,subs.mostCurrent,964);
if (RapidSub.canDelegate("traemaxpromos")) { return keymon.lat.medicomed.subs.remoteMe.runUserSub(false, "subs","traemaxpromos", _ba, _pm);}
RemoteObject _thislog = RemoteObject.createImmutable(false);
RemoteObject _maxpromos = RemoteObject.declareNull("anywheresoftware.b4a.objects.collections.List");
RemoteObject _vendidas = RemoteObject.createImmutable(0);
RemoteObject _c = RemoteObject.declareNull("anywheresoftware.b4a.sql.SQL.CursorWrapper");
;
Debug.locals.put("pm", _pm);
 BA.debugLineNum = 964;BA.debugLine="Sub traeMaxPromos(pm As Map) As Int";
Debug.ShouldStop(8);
 BA.debugLineNum = 965;BA.debugLine="Private thisLog As Boolean = False 'Si es verdade";
Debug.ShouldStop(16);
_thislog = subs.mostCurrent.__c.getField(true,"False");Debug.locals.put("thisLog", _thislog);Debug.locals.put("thisLog", _thislog);
 BA.debugLineNum = 966;BA.debugLine="Private maxPromos As List";
Debug.ShouldStop(32);
_maxpromos = RemoteObject.createNew ("anywheresoftware.b4a.objects.collections.List");Debug.locals.put("maxPromos", _maxpromos);
 BA.debugLineNum = 967;BA.debugLine="Private vendidas As Int = 0";
Debug.ShouldStop(64);
_vendidas = BA.numberCast(int.class, 0);Debug.locals.put("vendidas", _vendidas);Debug.locals.put("vendidas", _vendidas);
 BA.debugLineNum = 968;BA.debugLine="maxPromos.Initialize";
Debug.ShouldStop(128);
_maxpromos.runVoidMethod ("Initialize");
 BA.debugLineNum = 970;BA.debugLine="If thisLog Then Log(pm)";
Debug.ShouldStop(512);
if (_thislog.<Boolean>get().booleanValue()) { 
subs.mostCurrent.__c.runVoidMethod ("LogImpl","313959174",BA.ObjectToString(_pm),0);};
 BA.debugLineNum = 971;BA.debugLine="If pm.Get(\"historico\") = \"1\" Then maxPromos.Add(p";
Debug.ShouldStop(1024);
if (RemoteObject.solveBoolean("=",_pm.runMethod(false,"Get",(Object)((RemoteObject.createImmutable("historico")))),RemoteObject.createImmutable(("1")))) { 
_maxpromos.runVoidMethod ("Add",(Object)(_pm.runMethod(false,"Get",(Object)((RemoteObject.createImmutable("maxRecurrente"))))));};
 BA.debugLineNum = 972;BA.debugLine="maxPromos.Add(pm.Get(\"maxPromos\")) 'Agregamos max";
Debug.ShouldStop(2048);
_maxpromos.runVoidMethod ("Add",(Object)(_pm.runMethod(false,"Get",(Object)((RemoteObject.createImmutable("maxPromos"))))));
 BA.debugLineNum = 973;BA.debugLine="maxPromos.Add(pm.Get(\"maxXcliente\")) 'Agregamos m";
Debug.ShouldStop(4096);
_maxpromos.runVoidMethod ("Add",(Object)(_pm.runMethod(false,"Get",(Object)((RemoteObject.createImmutable("maxXcliente"))))));
 BA.debugLineNum = 974;BA.debugLine="maxPromos.Sort(True)";
Debug.ShouldStop(8192);
_maxpromos.runVoidMethod ("Sort",(Object)(subs.mostCurrent.__c.getField(true,"True")));
 BA.debugLineNum = 977;BA.debugLine="Private c As Cursor = B4XPages.MainPage.skmt.Exec";
Debug.ShouldStop(65536);
_c = RemoteObject.createNew ("anywheresoftware.b4a.sql.SQL.CursorWrapper");
_c = RemoteObject.declareNull("anywheresoftware.b4a.AbsObjectWrapper").runMethod(false, "ConvertToWrapper", RemoteObject.createNew("anywheresoftware.b4a.sql.SQL.CursorWrapper"), subs.mostCurrent._b4xpages.runMethod(false,"_mainpage" /*RemoteObject*/ ,_ba).getField(false,"_skmt" /*RemoteObject*/ ).runMethod(false,"ExecQuery2",(Object)(BA.ObjectToString("select sum(PE_CANT) as vendidas from PEDIDO where PE_PROID = ? and PE_CLIENTE = ? ")),(Object)(RemoteObject.createNewArray("String",new int[] {2},new Object[] {(BA.ObjectToString(_pm.runMethod(false,"Get",(Object)((RemoteObject.createImmutable("id")))))).runMethod(true,"trim"),_traecliente(_ba).runMethod(true,"trim")}))));Debug.locals.put("c", _c);Debug.locals.put("c", _c);
 BA.debugLineNum = 978;BA.debugLine="If c.RowCount > 0 Then";
Debug.ShouldStop(131072);
if (RemoteObject.solveBoolean(">",_c.runMethod(true,"getRowCount"),BA.numberCast(double.class, 0))) { 
 BA.debugLineNum = 979;BA.debugLine="c.Position = 0";
Debug.ShouldStop(262144);
_c.runMethod(true,"setPosition",BA.numberCast(int.class, 0));
 BA.debugLineNum = 980;BA.debugLine="vendidas = c.GetInt(\"vendidas\")";
Debug.ShouldStop(524288);
_vendidas = _c.runMethod(true,"GetInt",(Object)(RemoteObject.createImmutable("vendidas")));Debug.locals.put("vendidas", _vendidas);
 };
 BA.debugLineNum = 987;BA.debugLine="Return maxPromos.Get(0) - vendidas 'Regresamos el";
Debug.ShouldStop(67108864);
if (true) return BA.numberCast(int.class, RemoteObject.solve(new RemoteObject[] {BA.numberCast(double.class, _maxpromos.runMethod(false,"Get",(Object)(BA.numberCast(int.class, 0)))),_vendidas}, "-",1, 0));
 BA.debugLineNum = 988;BA.debugLine="End Sub";
Debug.ShouldStop(134217728);
return RemoteObject.createImmutable(0);
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _traemosinventariodisponibleparapromo(RemoteObject _ba,RemoteObject _promo) throws Exception{
try {
		Debug.PushSubsStack("traemosInventarioDisponibleParaPromo (subs) ","subs",9,_ba,subs.mostCurrent,887);
if (RapidSub.canDelegate("traemosinventariodisponibleparapromo")) { return keymon.lat.medicomed.subs.remoteMe.runUserSub(false, "subs","traemosinventariodisponibleparapromo", _ba, _promo);}
RemoteObject _c = RemoteObject.declareNull("anywheresoftware.b4a.sql.SQL.CursorWrapper");
RemoteObject _prods = RemoteObject.declareNull("anywheresoftware.b4a.objects.collections.Map");
int _i = 0;
;
Debug.locals.put("promo", _promo);
 BA.debugLineNum = 887;BA.debugLine="Sub traemosInventarioDisponibleParaPromo(promo As";
Debug.ShouldStop(4194304);
 BA.debugLineNum = 888;BA.debugLine="Private c As Cursor";
Debug.ShouldStop(8388608);
_c = RemoteObject.createNew ("anywheresoftware.b4a.sql.SQL.CursorWrapper");Debug.locals.put("c", _c);
 BA.debugLineNum = 889;BA.debugLine="c = B4XPages.MainPage.skmt.ExecQuery2(\"SELECT CAT";
Debug.ShouldStop(16777216);
_c = RemoteObject.declareNull("anywheresoftware.b4a.AbsObjectWrapper").runMethod(false, "ConvertToWrapper", RemoteObject.createNew("anywheresoftware.b4a.sql.SQL.CursorWrapper"), subs.mostCurrent._b4xpages.runMethod(false,"_mainpage" /*RemoteObject*/ ,_ba).getField(false,"_skmt" /*RemoteObject*/ ).runMethod(false,"ExecQuery2",(Object)(BA.ObjectToString("SELECT CAT_GP_ID, CAT_GP_ALMACEN FROM CAT_GUNAPROD WHERE CAT_GP_ID IN (select CAT_DP_IDPROD FROM CAT_DETALLES_PAQ WHERE CAT_DP_ID = ?)")),(Object)(RemoteObject.createNewArray("String",new int[] {1},new Object[] {_promo}))));Debug.locals.put("c", _c);
 BA.debugLineNum = 892;BA.debugLine="Private prods As Map";
Debug.ShouldStop(134217728);
_prods = RemoteObject.createNew ("anywheresoftware.b4a.objects.collections.Map");Debug.locals.put("prods", _prods);
 BA.debugLineNum = 893;BA.debugLine="prods.Initialize";
Debug.ShouldStop(268435456);
_prods.runVoidMethod ("Initialize");
 BA.debugLineNum = 894;BA.debugLine="If c.RowCount > 0 Then";
Debug.ShouldStop(536870912);
if (RemoteObject.solveBoolean(">",_c.runMethod(true,"getRowCount"),BA.numberCast(double.class, 0))) { 
 BA.debugLineNum = 895;BA.debugLine="For i=0 To c.RowCount -1";
Debug.ShouldStop(1073741824);
{
final int step6 = 1;
final int limit6 = RemoteObject.solve(new RemoteObject[] {_c.runMethod(true,"getRowCount"),RemoteObject.createImmutable(1)}, "-",1, 1).<Integer>get().intValue();
_i = 0 ;
for (;(step6 > 0 && _i <= limit6) || (step6 < 0 && _i >= limit6) ;_i = ((int)(0 + _i + step6))  ) {
Debug.locals.put("i", _i);
 BA.debugLineNum = 896;BA.debugLine="c.Position=i";
Debug.ShouldStop(-2147483648);
_c.runMethod(true,"setPosition",BA.numberCast(int.class, _i));
 BA.debugLineNum = 897;BA.debugLine="prods.Put(c.GetString(\"CAT_GP_ID\"), c.GetString";
Debug.ShouldStop(1);
_prods.runVoidMethod ("Put",(Object)((_c.runMethod(true,"GetString",(Object)(RemoteObject.createImmutable("CAT_GP_ID"))))),(Object)((_c.runMethod(true,"GetString",(Object)(RemoteObject.createImmutable("CAT_GP_ALMACEN"))))));
 }
}Debug.locals.put("i", _i);
;
 };
 BA.debugLineNum = 902;BA.debugLine="Return prods";
Debug.ShouldStop(32);
if (true) return _prods;
 BA.debugLineNum = 903;BA.debugLine="End Sub";
Debug.ShouldStop(64);
return RemoteObject.createImmutable(null);
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _traenombrecliente(RemoteObject _ba,RemoteObject _id) throws Exception{
try {
		Debug.PushSubsStack("traeNombreCliente (subs) ","subs",9,_ba,subs.mostCurrent,1339);
if (RapidSub.canDelegate("traenombrecliente")) { return keymon.lat.medicomed.subs.remoteMe.runUserSub(false, "subs","traenombrecliente", _ba, _id);}
RemoteObject _c = RemoteObject.declareNull("anywheresoftware.b4a.sql.SQL.ResultSetWrapper");
RemoteObject _n = RemoteObject.createImmutable("");
;
Debug.locals.put("id", _id);
 BA.debugLineNum = 1339;BA.debugLine="Sub traeNombreCliente(id As String) As String";
Debug.ShouldStop(67108864);
 BA.debugLineNum = 1340;BA.debugLine="Private c As ResultSet = B4XPages.MainPage.skmt.E";
Debug.ShouldStop(134217728);
_c = RemoteObject.createNew ("anywheresoftware.b4a.sql.SQL.ResultSetWrapper");
_c = RemoteObject.declareNull("anywheresoftware.b4a.AbsObjectWrapper").runMethod(false, "ConvertToWrapper", RemoteObject.createNew("anywheresoftware.b4a.sql.SQL.ResultSetWrapper"), subs.mostCurrent._b4xpages.runMethod(false,"_mainpage" /*RemoteObject*/ ,_ba).getField(false,"_skmt" /*RemoteObject*/ ).runMethod(false,"ExecQuery",(Object)((RemoteObject.concat(RemoteObject.createImmutable("select CAT_CL_NOMBRE from kmt_info where CAT_CL_CODIGO = '"),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_id))),RemoteObject.createImmutable("'"))))));Debug.locals.put("c", _c);Debug.locals.put("c", _c);
 BA.debugLineNum = 1341;BA.debugLine="Private n As String = \"N/A\"";
Debug.ShouldStop(268435456);
_n = BA.ObjectToString("N/A");Debug.locals.put("n", _n);Debug.locals.put("n", _n);
 BA.debugLineNum = 1342;BA.debugLine="Do While c.NextRow";
Debug.ShouldStop(536870912);
while (_c.runMethod(true,"NextRow").<Boolean>get().booleanValue()) {
 BA.debugLineNum = 1343;BA.debugLine="n = c.GetString(\"CAT_CL_NOMBRE\")";
Debug.ShouldStop(1073741824);
_n = _c.runMethod(true,"GetString",(Object)(RemoteObject.createImmutable("CAT_CL_NOMBRE")));Debug.locals.put("n", _n);
 }
;
 BA.debugLineNum = 1345;BA.debugLine="Return n";
Debug.ShouldStop(1);
if (true) return _n;
 BA.debugLineNum = 1346;BA.debugLine="End Sub";
Debug.ShouldStop(2);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _traenombreclientev(RemoteObject _ba,RemoteObject _id) throws Exception{
try {
		Debug.PushSubsStack("traeNombreClientev (subs) ","subs",9,_ba,subs.mostCurrent,1413);
if (RapidSub.canDelegate("traenombreclientev")) { return keymon.lat.medicomed.subs.remoteMe.runUserSub(false, "subs","traenombreclientev", _ba, _id);}
RemoteObject _c = RemoteObject.declareNull("anywheresoftware.b4a.sql.SQL.ResultSetWrapper");
RemoteObject _n = RemoteObject.createImmutable("");
;
Debug.locals.put("id", _id);
 BA.debugLineNum = 1413;BA.debugLine="Sub traeNombreClientev(id As String) As String";
Debug.ShouldStop(16);
 BA.debugLineNum = 1414;BA.debugLine="Private c As ResultSet = B4XPages.MainPage.skmt.E";
Debug.ShouldStop(32);
_c = RemoteObject.createNew ("anywheresoftware.b4a.sql.SQL.ResultSetWrapper");
_c = RemoteObject.declareNull("anywheresoftware.b4a.AbsObjectWrapper").runMethod(false, "ConvertToWrapper", RemoteObject.createNew("anywheresoftware.b4a.sql.SQL.ResultSetWrapper"), subs.mostCurrent._b4xpages.runMethod(false,"_mainpage" /*RemoteObject*/ ,_ba).getField(false,"_skmt" /*RemoteObject*/ ).runMethod(false,"ExecQuery",(Object)((RemoteObject.concat(RemoteObject.createImmutable("select CAT_CL_NOMBRE from kmt_info where CAT_CL_CODIGO = '"),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_id))),RemoteObject.createImmutable("'"))))));Debug.locals.put("c", _c);Debug.locals.put("c", _c);
 BA.debugLineNum = 1415;BA.debugLine="Private n As String = \"N/A\"";
Debug.ShouldStop(64);
_n = BA.ObjectToString("N/A");Debug.locals.put("n", _n);Debug.locals.put("n", _n);
 BA.debugLineNum = 1416;BA.debugLine="Do While c.NextRow";
Debug.ShouldStop(128);
while (_c.runMethod(true,"NextRow").<Boolean>get().booleanValue()) {
 BA.debugLineNum = 1417;BA.debugLine="n = c.GetString(\"CAT_CL_NOMBRE\")";
Debug.ShouldStop(256);
_n = _c.runMethod(true,"GetString",(Object)(RemoteObject.createImmutable("CAT_CL_NOMBRE")));Debug.locals.put("n", _n);
 }
;
 BA.debugLineNum = 1419;BA.debugLine="Return n";
Debug.ShouldStop(1024);
if (true) return _n;
 BA.debugLineNum = 1420;BA.debugLine="End Sub";
Debug.ShouldStop(2048);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _traeprodiddebd(RemoteObject _ba) throws Exception{
try {
		Debug.PushSubsStack("traeProdIdDeBD (subs) ","subs",9,_ba,subs.mostCurrent,1187);
if (RapidSub.canDelegate("traeprodiddebd")) { return keymon.lat.medicomed.subs.remoteMe.runUserSub(false, "subs","traeprodiddebd", _ba);}
RemoteObject _c = RemoteObject.declareNull("anywheresoftware.b4a.sql.SQL.CursorWrapper");
RemoteObject _m = RemoteObject.declareNull("anywheresoftware.b4a.objects.collections.Map");
;
 BA.debugLineNum = 1187;BA.debugLine="Sub traeProdIdDeBD As Map 'ignore";
Debug.ShouldStop(4);
 BA.debugLineNum = 1188;BA.debugLine="Private c As Cursor";
Debug.ShouldStop(8);
_c = RemoteObject.createNew ("anywheresoftware.b4a.sql.SQL.CursorWrapper");Debug.locals.put("c", _c);
 BA.debugLineNum = 1189;BA.debugLine="Private m As Map";
Debug.ShouldStop(16);
_m = RemoteObject.createNew ("anywheresoftware.b4a.objects.collections.Map");Debug.locals.put("m", _m);
 BA.debugLineNum = 1190;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"select CAT_GP";
Debug.ShouldStop(32);
_c = RemoteObject.declareNull("anywheresoftware.b4a.AbsObjectWrapper").runMethod(false, "ConvertToWrapper", RemoteObject.createNew("anywheresoftware.b4a.sql.SQL.CursorWrapper"), subs.mostCurrent._b4xpages.runMethod(false,"_mainpage" /*RemoteObject*/ ,_ba).getField(false,"_skmt" /*RemoteObject*/ ).runMethod(false,"ExecQuery",(Object)(RemoteObject.createImmutable("select CAT_GP_ID,CAT_GP_NOMBRE,CAT_GP_TIPO,CAT_GP_SUBTIPO  from CAT_GUNAPROD where CAT_GP_NOMBRE In (Select PDESC from PROID)"))));Debug.locals.put("c", _c);
 BA.debugLineNum = 1191;BA.debugLine="If c.RowCount > 0 Then";
Debug.ShouldStop(64);
if (RemoteObject.solveBoolean(">",_c.runMethod(true,"getRowCount"),BA.numberCast(double.class, 0))) { 
 BA.debugLineNum = 1192;BA.debugLine="c.Position = 0";
Debug.ShouldStop(128);
_c.runMethod(true,"setPosition",BA.numberCast(int.class, 0));
 BA.debugLineNum = 1193;BA.debugLine="m = CreateMap(\"id\":c.GetString(\"CAT_GP_ID\"), \"no";
Debug.ShouldStop(256);
_m = subs.mostCurrent.__c.runMethod(false, "createMap", (Object)(new RemoteObject[] {RemoteObject.createImmutable(("id")),(_c.runMethod(true,"GetString",(Object)(RemoteObject.createImmutable("CAT_GP_ID")))),RemoteObject.createImmutable(("nombre")),(_c.runMethod(true,"GetString",(Object)(RemoteObject.createImmutable("CAT_GP_NOMBRE")))),RemoteObject.createImmutable(("tipo")),(_c.runMethod(true,"GetString",(Object)(RemoteObject.createImmutable("CAT_GP_TIPO")))),RemoteObject.createImmutable(("subtipo")),(_c.runMethod(true,"GetString",(Object)(RemoteObject.createImmutable("CAT_GP_SUBTIPO"))))}));Debug.locals.put("m", _m);
 }else {
 BA.debugLineNum = 1195;BA.debugLine="m = CreateMap(\"id\":\"N/A\", \"nombre\":\"N/A\", \"tipo\"";
Debug.ShouldStop(1024);
_m = subs.mostCurrent.__c.runMethod(false, "createMap", (Object)(new RemoteObject[] {RemoteObject.createImmutable(("id")),RemoteObject.createImmutable(("N/A")),RemoteObject.createImmutable(("nombre")),RemoteObject.createImmutable(("N/A")),RemoteObject.createImmutable(("tipo")),RemoteObject.createImmutable(("N/A")),RemoteObject.createImmutable(("subtipo")),(RemoteObject.createImmutable("N/A"))}));Debug.locals.put("m", _m);
 };
 BA.debugLineNum = 1197;BA.debugLine="c.Close";
Debug.ShouldStop(4096);
_c.runVoidMethod ("Close");
 BA.debugLineNum = 1198;BA.debugLine="Return m";
Debug.ShouldStop(8192);
if (true) return _m;
 BA.debugLineNum = 1199;BA.debugLine="End Sub";
Debug.ShouldStop(16384);
return RemoteObject.createImmutable(null);
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _traeprodnombre(RemoteObject _ba,RemoteObject _id) throws Exception{
try {
		Debug.PushSubsStack("traeProdNombre (subs) ","subs",9,_ba,subs.mostCurrent,705);
if (RapidSub.canDelegate("traeprodnombre")) { return keymon.lat.medicomed.subs.remoteMe.runUserSub(false, "subs","traeprodnombre", _ba, _id);}
RemoteObject _h = RemoteObject.declareNull("anywheresoftware.b4a.sql.SQL.CursorWrapper");
RemoteObject _n = RemoteObject.createImmutable("");
;
Debug.locals.put("id", _id);
 BA.debugLineNum = 705;BA.debugLine="Sub traeProdNombre(id As String) As String";
Debug.ShouldStop(1);
 BA.debugLineNum = 706;BA.debugLine="Private h As Cursor";
Debug.ShouldStop(2);
_h = RemoteObject.createNew ("anywheresoftware.b4a.sql.SQL.CursorWrapper");Debug.locals.put("h", _h);
 BA.debugLineNum = 707;BA.debugLine="Private n As String";
Debug.ShouldStop(4);
_n = RemoteObject.createImmutable("");Debug.locals.put("n", _n);
 BA.debugLineNum = 708;BA.debugLine="h=B4XPages.MainPage.skmt.ExecQuery2(\"select CAT_G";
Debug.ShouldStop(8);
_h = RemoteObject.declareNull("anywheresoftware.b4a.AbsObjectWrapper").runMethod(false, "ConvertToWrapper", RemoteObject.createNew("anywheresoftware.b4a.sql.SQL.CursorWrapper"), subs.mostCurrent._b4xpages.runMethod(false,"_mainpage" /*RemoteObject*/ ,_ba).getField(false,"_skmt" /*RemoteObject*/ ).runMethod(false,"ExecQuery2",(Object)(BA.ObjectToString("select CAT_GP_NOMBRE from CAT_GUNAPROD where CAT_GP_ID = ? ")),(Object)(RemoteObject.createNewArray("String",new int[] {1},new Object[] {_id.runMethod(true,"trim")}))));Debug.locals.put("h", _h);
 BA.debugLineNum = 709;BA.debugLine="If h.RowCount > 0 Then";
Debug.ShouldStop(16);
if (RemoteObject.solveBoolean(">",_h.runMethod(true,"getRowCount"),BA.numberCast(double.class, 0))) { 
 BA.debugLineNum = 710;BA.debugLine="h.Position = 0";
Debug.ShouldStop(32);
_h.runMethod(true,"setPosition",BA.numberCast(int.class, 0));
 BA.debugLineNum = 711;BA.debugLine="n = h.GetString(\"CAT_GP_NOMBRE\")";
Debug.ShouldStop(64);
_n = _h.runMethod(true,"GetString",(Object)(RemoteObject.createImmutable("CAT_GP_NOMBRE")));Debug.locals.put("n", _n);
 };
 BA.debugLineNum = 714;BA.debugLine="h.Close";
Debug.ShouldStop(512);
_h.runVoidMethod ("Close");
 BA.debugLineNum = 715;BA.debugLine="If n = Null Or n=\"\" Then n = \"N/A\"";
Debug.ShouldStop(1024);
if (RemoteObject.solveBoolean("n",_n) || RemoteObject.solveBoolean("=",_n,BA.ObjectToString(""))) { 
_n = BA.ObjectToString("N/A");Debug.locals.put("n", _n);};
 BA.debugLineNum = 717;BA.debugLine="Return n";
Debug.ShouldStop(4096);
if (true) return _n;
 BA.debugLineNum = 718;BA.debugLine="End Sub";
Debug.ShouldStop(8192);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _traepromo(RemoteObject _ba,RemoteObject _promo,RemoteObject _cliente) throws Exception{
try {
		Debug.PushSubsStack("traePromo (subs) ","subs",9,_ba,subs.mostCurrent,822);
if (RapidSub.canDelegate("traepromo")) { return keymon.lat.medicomed.subs.remoteMe.runUserSub(false, "subs","traepromo", _ba, _promo, _cliente);}
RemoteObject _iniciocontador = RemoteObject.createImmutable("");
RemoteObject _c = RemoteObject.declareNull("anywheresoftware.b4a.sql.SQL.CursorWrapper");
RemoteObject _sihistorico = RemoteObject.createImmutable("");
RemoteObject _promomap = RemoteObject.declareNull("anywheresoftware.b4a.objects.collections.Map");
RemoteObject _prodsfijos = RemoteObject.declareNull("anywheresoftware.b4a.objects.collections.List");
RemoteObject _prodsfijosprecios = RemoteObject.declareNull("anywheresoftware.b4a.objects.collections.List");
RemoteObject _prodsfijospiezas = RemoteObject.declareNull("anywheresoftware.b4a.objects.collections.List");
RemoteObject _prodsvariables = RemoteObject.declareNull("anywheresoftware.b4a.objects.collections.List");
RemoteObject _prods = RemoteObject.declareNull("anywheresoftware.b4a.objects.collections.Map");
RemoteObject _tipos = RemoteObject.declareNull("anywheresoftware.b4a.objects.collections.Map");
int _i = 0;
RemoteObject _pvr = RemoteObject.createImmutable("");
;
Debug.locals.put("promo", _promo);
Debug.locals.put("cliente", _cliente);
 BA.debugLineNum = 822;BA.debugLine="Sub traePromo(promo As String, cliente As String)";
Debug.ShouldStop(2097152);
 BA.debugLineNum = 823;BA.debugLine="Private inicioContador As String = DateTime.Now";
Debug.ShouldStop(4194304);
_iniciocontador = BA.NumberToString(subs.mostCurrent.__c.getField(false,"DateTime").runMethod(true,"getNow"));Debug.locals.put("inicioContador", _iniciocontador);Debug.locals.put("inicioContador", _iniciocontador);
 BA.debugLineNum = 824;BA.debugLine="Private c As Cursor = B4XPages.MainPage.skmt.Exec";
Debug.ShouldStop(8388608);
_c = RemoteObject.createNew ("anywheresoftware.b4a.sql.SQL.CursorWrapper");
_c = RemoteObject.declareNull("anywheresoftware.b4a.AbsObjectWrapper").runMethod(false, "ConvertToWrapper", RemoteObject.createNew("anywheresoftware.b4a.sql.SQL.CursorWrapper"), subs.mostCurrent._b4xpages.runMethod(false,"_mainpage" /*RemoteObject*/ ,_ba).getField(false,"_skmt" /*RemoteObject*/ ).runMethod(false,"ExecQuery",(Object)(RemoteObject.concat(RemoteObject.createImmutable("Select * from promos_comp where cat_pa_id = '"),_promo,RemoteObject.createImmutable("'")))));Debug.locals.put("c", _c);Debug.locals.put("c", _c);
 BA.debugLineNum = 825;BA.debugLine="Private siHistorico As String = 0";
Debug.ShouldStop(16777216);
_sihistorico = BA.NumberToString(0);Debug.locals.put("siHistorico", _sihistorico);Debug.locals.put("siHistorico", _sihistorico);
 BA.debugLineNum = 826;BA.debugLine="Private promoMap As Map";
Debug.ShouldStop(33554432);
_promomap = RemoteObject.createNew ("anywheresoftware.b4a.objects.collections.Map");Debug.locals.put("promoMap", _promomap);
 BA.debugLineNum = 827;BA.debugLine="Private prodsFijos, prodsFijosPrecios, prodsFijos";
Debug.ShouldStop(67108864);
_prodsfijos = RemoteObject.createNew ("anywheresoftware.b4a.objects.collections.List");Debug.locals.put("prodsFijos", _prodsfijos);
_prodsfijosprecios = RemoteObject.createNew ("anywheresoftware.b4a.objects.collections.List");Debug.locals.put("prodsFijosPrecios", _prodsfijosprecios);
_prodsfijospiezas = RemoteObject.createNew ("anywheresoftware.b4a.objects.collections.List");Debug.locals.put("prodsFijosPiezas", _prodsfijospiezas);
_prodsvariables = RemoteObject.createNew ("anywheresoftware.b4a.objects.collections.List");Debug.locals.put("prodsVariables", _prodsvariables);
 BA.debugLineNum = 828;BA.debugLine="promoMap.Initialize";
Debug.ShouldStop(134217728);
_promomap.runVoidMethod ("Initialize");
 BA.debugLineNum = 829;BA.debugLine="prodsFijos.Initialize";
Debug.ShouldStop(268435456);
_prodsfijos.runVoidMethod ("Initialize");
 BA.debugLineNum = 830;BA.debugLine="prodsFijosPrecios.Initialize";
Debug.ShouldStop(536870912);
_prodsfijosprecios.runVoidMethod ("Initialize");
 BA.debugLineNum = 831;BA.debugLine="prodsFijosPiezas.Initialize";
Debug.ShouldStop(1073741824);
_prodsfijospiezas.runVoidMethod ("Initialize");
 BA.debugLineNum = 832;BA.debugLine="prodsVariables.Initialize";
Debug.ShouldStop(-2147483648);
_prodsvariables.runVoidMethod ("Initialize");
 BA.debugLineNum = 833;BA.debugLine="c.Position = 0";
Debug.ShouldStop(1);
_c.runMethod(true,"setPosition",BA.numberCast(int.class, 0));
 BA.debugLineNum = 834;BA.debugLine="If c.RowCount > 0 Then promoMap = CreateMap(\"id\":";
Debug.ShouldStop(2);
if (RemoteObject.solveBoolean(">",_c.runMethod(true,"getRowCount"),BA.numberCast(double.class, 0))) { 
_promomap = subs.mostCurrent.__c.runMethod(false, "createMap", (Object)(new RemoteObject[] {RemoteObject.createImmutable(("id")),(_promo),RemoteObject.createImmutable(("maxXcliente")),(_c.runMethod(true,"GetString",(Object)(RemoteObject.createImmutable("CAT_PA_MAXPROMCLIE")))),RemoteObject.createImmutable(("maxRecurrente")),(_c.runMethod(true,"GetString",(Object)(RemoteObject.createImmutable("CAT_PA_MAXPROMREC")))),RemoteObject.createImmutable(("maxPromos")),(_c.runMethod(true,"GetString",(Object)(RemoteObject.createImmutable("CAT_PA_MAXPROM"))))}));Debug.locals.put("promoMap", _promomap);};
 BA.debugLineNum = 835;BA.debugLine="c = B4XPages.MainPage.skmt.ExecQuery(\"Select coun";
Debug.ShouldStop(4);
_c = RemoteObject.declareNull("anywheresoftware.b4a.AbsObjectWrapper").runMethod(false, "ConvertToWrapper", RemoteObject.createNew("anywheresoftware.b4a.sql.SQL.CursorWrapper"), subs.mostCurrent._b4xpages.runMethod(false,"_mainpage" /*RemoteObject*/ ,_ba).getField(false,"_skmt" /*RemoteObject*/ ).runMethod(false,"ExecQuery",(Object)(RemoteObject.concat(RemoteObject.createImmutable("Select count(*) as hist from HIST_PROMOS where HP_CLIENTE = '"),_cliente,RemoteObject.createImmutable("' and HP_CODIGO_PROMOCION = '"),_promo,RemoteObject.createImmutable("'")))));Debug.locals.put("c", _c);
 BA.debugLineNum = 836;BA.debugLine="c.Position = 0";
Debug.ShouldStop(8);
_c.runMethod(true,"setPosition",BA.numberCast(int.class, 0));
 BA.debugLineNum = 837;BA.debugLine="If c.GetString(\"hist\") > 0 Then siHistorico = 1";
Debug.ShouldStop(16);
if (RemoteObject.solveBoolean(">",BA.numberCast(double.class, _c.runMethod(true,"GetString",(Object)(RemoteObject.createImmutable("hist")))),BA.numberCast(double.class, 0))) { 
_sihistorico = BA.NumberToString(1);Debug.locals.put("siHistorico", _sihistorico);};
 BA.debugLineNum = 838;BA.debugLine="promoMap.Put(\"historico\", siHistorico)";
Debug.ShouldStop(32);
_promomap.runVoidMethod ("Put",(Object)(RemoteObject.createImmutable(("historico"))),(Object)((_sihistorico)));
 BA.debugLineNum = 839;BA.debugLine="c = B4XPages.MainPage.skmt.ExecQuery(\"Select * fr";
Debug.ShouldStop(64);
_c = RemoteObject.declareNull("anywheresoftware.b4a.AbsObjectWrapper").runMethod(false, "ConvertToWrapper", RemoteObject.createNew("anywheresoftware.b4a.sql.SQL.CursorWrapper"), subs.mostCurrent._b4xpages.runMethod(false,"_mainpage" /*RemoteObject*/ ,_ba).getField(false,"_skmt" /*RemoteObject*/ ).runMethod(false,"ExecQuery",(Object)(RemoteObject.concat(RemoteObject.createImmutable("Select * from CAT_DETALLES_PAQ where CAT_DP_ID = '"),_promo,RemoteObject.createImmutable("'")))));Debug.locals.put("c", _c);
 BA.debugLineNum = 840;BA.debugLine="c.Position = 0";
Debug.ShouldStop(128);
_c.runMethod(true,"setPosition",BA.numberCast(int.class, 0));
 BA.debugLineNum = 841;BA.debugLine="If c.RowCount > 0 Then";
Debug.ShouldStop(256);
if (RemoteObject.solveBoolean(">",_c.runMethod(true,"getRowCount"),BA.numberCast(double.class, 0))) { 
 BA.debugLineNum = 842;BA.debugLine="Private prods, tipos As Map";
Debug.ShouldStop(512);
_prods = RemoteObject.createNew ("anywheresoftware.b4a.objects.collections.Map");Debug.locals.put("prods", _prods);
_tipos = RemoteObject.createNew ("anywheresoftware.b4a.objects.collections.Map");Debug.locals.put("tipos", _tipos);
 BA.debugLineNum = 843;BA.debugLine="prods.Initialize";
Debug.ShouldStop(1024);
_prods.runVoidMethod ("Initialize");
 BA.debugLineNum = 844;BA.debugLine="tipos.Initialize";
Debug.ShouldStop(2048);
_tipos.runVoidMethod ("Initialize");
 BA.debugLineNum = 845;BA.debugLine="For i=0 To c.RowCount -1";
Debug.ShouldStop(4096);
{
final int step23 = 1;
final int limit23 = RemoteObject.solve(new RemoteObject[] {_c.runMethod(true,"getRowCount"),RemoteObject.createImmutable(1)}, "-",1, 1).<Integer>get().intValue();
_i = 0 ;
for (;(step23 > 0 && _i <= limit23) || (step23 < 0 && _i >= limit23) ;_i = ((int)(0 + _i + step23))  ) {
Debug.locals.put("i", _i);
 BA.debugLineNum = 846;BA.debugLine="c.Position=i";
Debug.ShouldStop(8192);
_c.runMethod(true,"setPosition",BA.numberCast(int.class, _i));
 BA.debugLineNum = 847;BA.debugLine="prods.Put(c.GetString(\"CAT_DP_IDPROD\"), CreateM";
Debug.ShouldStop(16384);
_prods.runVoidMethod ("Put",(Object)((_c.runMethod(true,"GetString",(Object)(RemoteObject.createImmutable("CAT_DP_IDPROD"))))),(Object)((subs.mostCurrent.__c.runMethod(false, "createMap", (Object)(new RemoteObject[] {RemoteObject.createImmutable(("idProducto")),(_c.runMethod(true,"GetString",(Object)(RemoteObject.createImmutable("CAT_DP_IDPROD")))),RemoteObject.createImmutable(("precioSimptos")),(_c.runMethod(true,"GetString",(Object)(RemoteObject.createImmutable("CAT_DP_PRECIO_SIMPTOS")))),RemoteObject.createImmutable(("precio")),(_c.runMethod(true,"GetString",(Object)(RemoteObject.createImmutable("CAT_DP_PRECIO")))),RemoteObject.createImmutable(("almacen")),(_c.runMethod(true,"GetString",(Object)(RemoteObject.createImmutable("CAT_DP_ALMACEN")))),RemoteObject.createImmutable(("tipo")),(_c.runMethod(true,"GetString",(Object)(RemoteObject.createImmutable("CAT_DP_TIPO")))),RemoteObject.createImmutable(("piezas")),(_c.runMethod(true,"GetString",(Object)(RemoteObject.createImmutable("CAT_DP_PZAS")))),RemoteObject.createImmutable(("usuario")),(_c.runMethod(true,"GetString",(Object)(RemoteObject.createImmutable("CAT_DP_USUARIO")))),RemoteObject.createImmutable(("regalo")),(_c.runMethod(true,"GetString",(Object)(RemoteObject.createImmutable("CAT_DP_REGALO")))),RemoteObject.createImmutable(("clasif")),(_c.runMethod(true,"GetString",(Object)(RemoteObject.createImmutable("CAT_DP_CLASIF"))))})).getObject())));
 BA.debugLineNum = 848;BA.debugLine="tipos.Put(c.GetString(\"CAT_DP_IDPROD\"), c.GetSt";
Debug.ShouldStop(32768);
_tipos.runVoidMethod ("Put",(Object)((_c.runMethod(true,"GetString",(Object)(RemoteObject.createImmutable("CAT_DP_IDPROD"))))),(Object)((_c.runMethod(true,"GetString",(Object)(RemoteObject.createImmutable("CAT_DP_TIPO"))))));
 BA.debugLineNum = 849;BA.debugLine="If c.GetString(\"CAT_DP_TIPO\") = \"0\" Then";
Debug.ShouldStop(65536);
if (RemoteObject.solveBoolean("=",_c.runMethod(true,"GetString",(Object)(RemoteObject.createImmutable("CAT_DP_TIPO"))),BA.ObjectToString("0"))) { 
 BA.debugLineNum = 850;BA.debugLine="prodsFijos.Add(c.GetString(\"CAT_DP_IDPROD\"))";
Debug.ShouldStop(131072);
_prodsfijos.runVoidMethod ("Add",(Object)((_c.runMethod(true,"GetString",(Object)(RemoteObject.createImmutable("CAT_DP_IDPROD"))))));
 BA.debugLineNum = 851;BA.debugLine="prodsFijosPrecios.Add(c.GetString(\"CAT_DP_PREC";
Debug.ShouldStop(262144);
_prodsfijosprecios.runVoidMethod ("Add",(Object)((_c.runMethod(true,"GetString",(Object)(RemoteObject.createImmutable("CAT_DP_PRECIO"))))));
 BA.debugLineNum = 852;BA.debugLine="prodsFijosPiezas.Add(c.GetString(\"CAT_DP_PZAS\"";
Debug.ShouldStop(524288);
_prodsfijospiezas.runVoidMethod ("Add",(Object)((_c.runMethod(true,"GetString",(Object)(RemoteObject.createImmutable("CAT_DP_PZAS"))))));
 };
 BA.debugLineNum = 854;BA.debugLine="If c.GetString(\"CAT_DP_TIPO\") = \"1\" Then prodsV";
Debug.ShouldStop(2097152);
if (RemoteObject.solveBoolean("=",_c.runMethod(true,"GetString",(Object)(RemoteObject.createImmutable("CAT_DP_TIPO"))),BA.ObjectToString("1"))) { 
_prodsvariables.runVoidMethod ("Add",(Object)((_c.runMethod(true,"GetString",(Object)(RemoteObject.createImmutable("CAT_DP_IDPROD"))))));};
 }
}Debug.locals.put("i", _i);
;
 BA.debugLineNum = 857;BA.debugLine="promoMap.Put(\"productos\", prods) 'Mapa con los p";
Debug.ShouldStop(16777216);
_promomap.runVoidMethod ("Put",(Object)(RemoteObject.createImmutable(("productos"))),(Object)((_prods.getObject())));
 BA.debugLineNum = 858;BA.debugLine="promoMap.Put(\"tipos\", tipos) 'Mapa con los produ";
Debug.ShouldStop(33554432);
_promomap.runVoidMethod ("Put",(Object)(RemoteObject.createImmutable(("tipos"))),(Object)((_tipos.getObject())));
 BA.debugLineNum = 859;BA.debugLine="promoMap.Put(\"prodsFijos\", prodsFijos) 'Lista de";
Debug.ShouldStop(67108864);
_promomap.runVoidMethod ("Put",(Object)(RemoteObject.createImmutable(("prodsFijos"))),(Object)((_prodsfijos.getObject())));
 BA.debugLineNum = 860;BA.debugLine="promoMap.Put(\"prodsVariables\", prodsVariables) '";
Debug.ShouldStop(134217728);
_promomap.runVoidMethod ("Put",(Object)(RemoteObject.createImmutable(("prodsVariables"))),(Object)((_prodsvariables.getObject())));
 BA.debugLineNum = 861;BA.debugLine="promoMap.Put(\"prodsFijosCant\", prodsFijos.Size)";
Debug.ShouldStop(268435456);
_promomap.runVoidMethod ("Put",(Object)(RemoteObject.createImmutable(("prodsFijosCant"))),(Object)((_prodsfijos.runMethod(true,"getSize"))));
 BA.debugLineNum = 862;BA.debugLine="promoMap.Put(\"prodsFijosPrecios\", prodsFijosPrec";
Debug.ShouldStop(536870912);
_promomap.runVoidMethod ("Put",(Object)(RemoteObject.createImmutable(("prodsFijosPrecios"))),(Object)((_prodsfijosprecios.getObject())));
 BA.debugLineNum = 863;BA.debugLine="promoMap.Put(\"prodsFijosPiezas\", prodsFijosPieza";
Debug.ShouldStop(1073741824);
_promomap.runVoidMethod ("Put",(Object)(RemoteObject.createImmutable(("prodsFijosPiezas"))),(Object)((_prodsfijospiezas.getObject())));
 BA.debugLineNum = 864;BA.debugLine="promoMap.Put(\"prodsVariablesCant\", prodsVariable";
Debug.ShouldStop(-2147483648);
_promomap.runVoidMethod ("Put",(Object)(RemoteObject.createImmutable(("prodsVariablesCant"))),(Object)((_prodsvariables.runMethod(true,"getSize"))));
 BA.debugLineNum = 865;BA.debugLine="promoMap.Put(\"resultado\", \"ok\")";
Debug.ShouldStop(1);
_promomap.runVoidMethod ("Put",(Object)(RemoteObject.createImmutable(("resultado"))),(Object)((RemoteObject.createImmutable("ok"))));
 }else {
 BA.debugLineNum = 867;BA.debugLine="promoMap.Put(\"resultado\", \"No hay datos de la pr";
Debug.ShouldStop(4);
_promomap.runVoidMethod ("Put",(Object)(RemoteObject.createImmutable(("resultado"))),(Object)((RemoteObject.createImmutable("No hay datos de la promoción."))));
 };
 BA.debugLineNum = 869;BA.debugLine="c = B4XPages.MainPage.skmt.ExecQuery(\"Select CAT_";
Debug.ShouldStop(16);
_c = RemoteObject.declareNull("anywheresoftware.b4a.AbsObjectWrapper").runMethod(false, "ConvertToWrapper", RemoteObject.createNew("anywheresoftware.b4a.sql.SQL.CursorWrapper"), subs.mostCurrent._b4xpages.runMethod(false,"_mainpage" /*RemoteObject*/ ,_ba).getField(false,"_skmt" /*RemoteObject*/ ).runMethod(false,"ExecQuery",(Object)(RemoteObject.concat(RemoteObject.createImmutable("Select CAT_GP_STS, CAT_GP_NOMBRE from CAT_GUNAPROD where CAT_GP_ID = '"),_promo,RemoteObject.createImmutable("'")))));Debug.locals.put("c", _c);
 BA.debugLineNum = 870;BA.debugLine="c.Position = 0";
Debug.ShouldStop(32);
_c.runMethod(true,"setPosition",BA.numberCast(int.class, 0));
 BA.debugLineNum = 871;BA.debugLine="Private pvr As String = 0";
Debug.ShouldStop(64);
_pvr = BA.NumberToString(0);Debug.locals.put("pvr", _pvr);Debug.locals.put("pvr", _pvr);
 BA.debugLineNum = 872;BA.debugLine="If c.RowCount > 0 Then";
Debug.ShouldStop(128);
if (RemoteObject.solveBoolean(">",_c.runMethod(true,"getRowCount"),BA.numberCast(double.class, 0))) { 
 BA.debugLineNum = 873;BA.debugLine="c.Position = 0";
Debug.ShouldStop(256);
_c.runMethod(true,"setPosition",BA.numberCast(int.class, 0));
 BA.debugLineNum = 874;BA.debugLine="pvr = c.GetString(\"CAT_GP_STS\")";
Debug.ShouldStop(512);
_pvr = _c.runMethod(true,"GetString",(Object)(RemoteObject.createImmutable("CAT_GP_STS")));Debug.locals.put("pvr", _pvr);
 BA.debugLineNum = 875;BA.debugLine="promoMap.Put(\"prodsVariablesRequeridos\", pvr) 'C";
Debug.ShouldStop(1024);
_promomap.runVoidMethod ("Put",(Object)(RemoteObject.createImmutable(("prodsVariablesRequeridos"))),(Object)((_pvr)));
 BA.debugLineNum = 876;BA.debugLine="promoMap.put(\"descripcion\", c.GetString(\"CAT_GP_";
Debug.ShouldStop(2048);
_promomap.runVoidMethod ("Put",(Object)(RemoteObject.createImmutable(("descripcion"))),(Object)((_c.runMethod(true,"GetString",(Object)(RemoteObject.createImmutable("CAT_GP_NOMBRE"))))));
 };
 BA.debugLineNum = 878;BA.debugLine="c.Close";
Debug.ShouldStop(8192);
_c.runVoidMethod ("Close");
 BA.debugLineNum = 883;BA.debugLine="Return promoMap";
Debug.ShouldStop(262144);
if (true) return _promomap;
 BA.debugLineNum = 884;BA.debugLine="End Sub";
Debug.ShouldStop(524288);
return RemoteObject.createImmutable(null);
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _traepromosvendidas(RemoteObject _ba,RemoteObject _promo,RemoteObject _cliente) throws Exception{
try {
		Debug.PushSubsStack("traePromosVendidas (subs) ","subs",9,_ba,subs.mostCurrent,991);
if (RapidSub.canDelegate("traepromosvendidas")) { return keymon.lat.medicomed.subs.remoteMe.runUserSub(false, "subs","traepromosvendidas", _ba, _promo, _cliente);}
RemoteObject _c = RemoteObject.declareNull("anywheresoftware.b4a.sql.SQL.CursorWrapper");
RemoteObject _pv = RemoteObject.createImmutable(0);
;
Debug.locals.put("promo", _promo);
Debug.locals.put("cliente", _cliente);
 BA.debugLineNum = 991;BA.debugLine="Sub traePromosVendidas(promo As String, cliente As";
Debug.ShouldStop(1073741824);
 BA.debugLineNum = 992;BA.debugLine="Private c As Cursor";
Debug.ShouldStop(-2147483648);
_c = RemoteObject.createNew ("anywheresoftware.b4a.sql.SQL.CursorWrapper");Debug.locals.put("c", _c);
 BA.debugLineNum = 993;BA.debugLine="Private pv As Int = 0";
Debug.ShouldStop(1);
_pv = BA.numberCast(int.class, 0);Debug.locals.put("pv", _pv);Debug.locals.put("pv", _pv);
 BA.debugLineNum = 994;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery($\"select PE_CA";
Debug.ShouldStop(2);
_c = RemoteObject.declareNull("anywheresoftware.b4a.AbsObjectWrapper").runMethod(false, "ConvertToWrapper", RemoteObject.createNew("anywheresoftware.b4a.sql.SQL.CursorWrapper"), subs.mostCurrent._b4xpages.runMethod(false,"_mainpage" /*RemoteObject*/ ,_ba).getField(false,"_skmt" /*RemoteObject*/ ).runMethod(false,"ExecQuery",(Object)((RemoteObject.concat(RemoteObject.createImmutable("select PE_CANT from PEDIDO where PE_PROID = '"),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_promo))),RemoteObject.createImmutable("' and PE_CLIENTE = '"),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_cliente))),RemoteObject.createImmutable("'"))))));Debug.locals.put("c", _c);
 BA.debugLineNum = 995;BA.debugLine="If c.RowCount > 0 Then";
Debug.ShouldStop(4);
if (RemoteObject.solveBoolean(">",_c.runMethod(true,"getRowCount"),BA.numberCast(double.class, 0))) { 
 BA.debugLineNum = 996;BA.debugLine="c.Position = 0";
Debug.ShouldStop(8);
_c.runMethod(true,"setPosition",BA.numberCast(int.class, 0));
 BA.debugLineNum = 997;BA.debugLine="pv = c.GetInt(\"PE_CANT\")";
Debug.ShouldStop(16);
_pv = _c.runMethod(true,"GetInt",(Object)(RemoteObject.createImmutable("PE_CANT")));Debug.locals.put("pv", _pv);
 };
 BA.debugLineNum = 999;BA.debugLine="Return pv";
Debug.ShouldStop(64);
if (true) return _pv;
 BA.debugLineNum = 1000;BA.debugLine="End Sub";
Debug.ShouldStop(128);
return RemoteObject.createImmutable(0);
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _traeruta(RemoteObject _ba) throws Exception{
try {
		Debug.PushSubsStack("traeRuta (subs) ","subs",9,_ba,subs.mostCurrent,721);
if (RapidSub.canDelegate("traeruta")) { return keymon.lat.medicomed.subs.remoteMe.runUserSub(false, "subs","traeruta", _ba);}
RemoteObject _c = RemoteObject.declareNull("anywheresoftware.b4a.sql.SQL.CursorWrapper");
RemoteObject _r = RemoteObject.createImmutable("");
;
 BA.debugLineNum = 721;BA.debugLine="Sub traeRuta As String 'ignore";
Debug.ShouldStop(65536);
 BA.debugLineNum = 722;BA.debugLine="Private c As Cursor";
Debug.ShouldStop(131072);
_c = RemoteObject.createNew ("anywheresoftware.b4a.sql.SQL.CursorWrapper");Debug.locals.put("c", _c);
 BA.debugLineNum = 723;BA.debugLine="Private r As String";
Debug.ShouldStop(262144);
_r = RemoteObject.createImmutable("");Debug.locals.put("r", _r);
 BA.debugLineNum = 724;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"select CAT_CL";
Debug.ShouldStop(524288);
_c = RemoteObject.declareNull("anywheresoftware.b4a.AbsObjectWrapper").runMethod(false, "ConvertToWrapper", RemoteObject.createNew("anywheresoftware.b4a.sql.SQL.CursorWrapper"), subs.mostCurrent._b4xpages.runMethod(false,"_mainpage" /*RemoteObject*/ ,_ba).getField(false,"_skmt" /*RemoteObject*/ ).runMethod(false,"ExecQuery",(Object)(RemoteObject.createImmutable("select CAT_CL_RUTA from kmt_info where CAT_CL_CODIGO In (Select cuenta from cuentaa)"))));Debug.locals.put("c", _c);
 BA.debugLineNum = 725;BA.debugLine="r = \"0\"";
Debug.ShouldStop(1048576);
_r = BA.ObjectToString("0");Debug.locals.put("r", _r);
 BA.debugLineNum = 726;BA.debugLine="If c.RowCount > 0 Then";
Debug.ShouldStop(2097152);
if (RemoteObject.solveBoolean(">",_c.runMethod(true,"getRowCount"),BA.numberCast(double.class, 0))) { 
 BA.debugLineNum = 727;BA.debugLine="c.Position=0";
Debug.ShouldStop(4194304);
_c.runMethod(true,"setPosition",BA.numberCast(int.class, 0));
 BA.debugLineNum = 728;BA.debugLine="r = c.GetString(\"CAT_CL_RUTA\")";
Debug.ShouldStop(8388608);
_r = _c.runMethod(true,"GetString",(Object)(RemoteObject.createImmutable("CAT_CL_RUTA")));Debug.locals.put("r", _r);
 };
 BA.debugLineNum = 730;BA.debugLine="c.Close";
Debug.ShouldStop(33554432);
_c.runVoidMethod ("Close");
 BA.debugLineNum = 731;BA.debugLine="Return r";
Debug.ShouldStop(67108864);
if (true) return _r;
 BA.debugLineNum = 732;BA.debugLine="End Sub";
Debug.ShouldStop(134217728);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _traetotalesclienteactual(RemoteObject _ba) throws Exception{
try {
		Debug.PushSubsStack("traeTotalesClienteActual (subs) ","subs",9,_ba,subs.mostCurrent,1226);
if (RapidSub.canDelegate("traetotalesclienteactual")) { return keymon.lat.medicomed.subs.remoteMe.runUserSub(false, "subs","traetotalesclienteactual", _ba);}
RemoteObject _m = RemoteObject.declareNull("anywheresoftware.b4a.objects.collections.Map");
RemoteObject _c_prodsx = RemoteObject.declareNull("anywheresoftware.b4a.sql.SQL.CursorWrapper");
;
 BA.debugLineNum = 1226;BA.debugLine="Sub traeTotalesClienteActual As Map";
Debug.ShouldStop(512);
 BA.debugLineNum = 1227;BA.debugLine="Private m As Map";
Debug.ShouldStop(1024);
_m = RemoteObject.createNew ("anywheresoftware.b4a.objects.collections.Map");Debug.locals.put("m", _m);
 BA.debugLineNum = 1228;BA.debugLine="m.Initialize";
Debug.ShouldStop(2048);
_m.runVoidMethod ("Initialize");
 BA.debugLineNum = 1229;BA.debugLine="Private c_prodsX As Cursor=B4XPages.MainPage.skmt";
Debug.ShouldStop(4096);
_c_prodsx = RemoteObject.createNew ("anywheresoftware.b4a.sql.SQL.CursorWrapper");
_c_prodsx = RemoteObject.declareNull("anywheresoftware.b4a.AbsObjectWrapper").runMethod(false, "ConvertToWrapper", RemoteObject.createNew("anywheresoftware.b4a.sql.SQL.CursorWrapper"), subs.mostCurrent._b4xpages.runMethod(false,"_mainpage" /*RemoteObject*/ ,_ba).getField(false,"_skmt" /*RemoteObject*/ ).runMethod(false,"ExecQuery",(Object)(RemoteObject.createImmutable("select ifnull(sum(PE_CANT), 0) as cantProds, ifnull(sum(PE_COSTO_TOT), 0) as costoTotal FROM PEDIDO WHERE PE_CLIENTE IN (Select CUENTA from cuentaa) order by PE_PRONOMBRE asc"))));Debug.locals.put("c_prodsX", _c_prodsx);Debug.locals.put("c_prodsX", _c_prodsx);
 BA.debugLineNum = 1230;BA.debugLine="c_prodsX.Position=0";
Debug.ShouldStop(8192);
_c_prodsx.runMethod(true,"setPosition",BA.numberCast(int.class, 0));
 BA.debugLineNum = 1232;BA.debugLine="m = CreateMap(\"productos\": c_prodsX.GetString(\"ca";
Debug.ShouldStop(32768);
_m = subs.mostCurrent.__c.runMethod(false, "createMap", (Object)(new RemoteObject[] {RemoteObject.createImmutable(("productos")),(_c_prodsx.runMethod(true,"GetString",(Object)(RemoteObject.createImmutable("cantProds")))),RemoteObject.createImmutable(("monto")),(_c_prodsx.runMethod(true,"GetString",(Object)(RemoteObject.createImmutable("costoTotal"))))}));Debug.locals.put("m", _m);
 BA.debugLineNum = 1233;BA.debugLine="Return m";
Debug.ShouldStop(65536);
if (true) return _m;
 BA.debugLineNum = 1234;BA.debugLine="End Sub";
Debug.ShouldStop(131072);
return RemoteObject.createImmutable(null);
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _traeusuariodebd(RemoteObject _ba) throws Exception{
try {
		Debug.PushSubsStack("traeUsuarioDeBD (subs) ","subs",9,_ba,subs.mostCurrent,752);
if (RapidSub.canDelegate("traeusuariodebd")) { return keymon.lat.medicomed.subs.remoteMe.runUserSub(false, "subs","traeusuariodebd", _ba);}
RemoteObject _c = RemoteObject.declareNull("anywheresoftware.b4a.sql.SQL.CursorWrapper");
RemoteObject _u = RemoteObject.createImmutable("");
;
 BA.debugLineNum = 752;BA.debugLine="Sub traeUsuarioDeBD As String 'ignore";
Debug.ShouldStop(32768);
 BA.debugLineNum = 753;BA.debugLine="Private c As Cursor";
Debug.ShouldStop(65536);
_c = RemoteObject.createNew ("anywheresoftware.b4a.sql.SQL.CursorWrapper");Debug.locals.put("c", _c);
 BA.debugLineNum = 754;BA.debugLine="Private u As String = \"SinUsuario\"";
Debug.ShouldStop(131072);
_u = BA.ObjectToString("SinUsuario");Debug.locals.put("u", _u);Debug.locals.put("u", _u);
 BA.debugLineNum = 755;BA.debugLine="If Not(kmt.IsInitialized) Then revisaBD";
Debug.ShouldStop(262144);
if (subs.mostCurrent.__c.runMethod(true,"Not",(Object)(subs._kmt.runMethod(true,"IsInitialized"))).<Boolean>get().booleanValue()) { 
_revisabd(_ba);};
 BA.debugLineNum = 756;BA.debugLine="c=kmt.ExecQuery(\"select USUARIO from usuarioa\")";
Debug.ShouldStop(524288);
_c = RemoteObject.declareNull("anywheresoftware.b4a.AbsObjectWrapper").runMethod(false, "ConvertToWrapper", RemoteObject.createNew("anywheresoftware.b4a.sql.SQL.CursorWrapper"), subs._kmt.runMethod(false,"ExecQuery",(Object)(RemoteObject.createImmutable("select USUARIO from usuarioa"))));Debug.locals.put("c", _c);
 BA.debugLineNum = 757;BA.debugLine="c.Position=0";
Debug.ShouldStop(1048576);
_c.runMethod(true,"setPosition",BA.numberCast(int.class, 0));
 BA.debugLineNum = 758;BA.debugLine="If c.RowCount > 0 Then u = c.GetString(\"USUARIO\")";
Debug.ShouldStop(2097152);
if (RemoteObject.solveBoolean(">",_c.runMethod(true,"getRowCount"),BA.numberCast(double.class, 0))) { 
_u = _c.runMethod(true,"GetString",(Object)(RemoteObject.createImmutable("USUARIO")));Debug.locals.put("u", _u);};
 BA.debugLineNum = 759;BA.debugLine="c.Close";
Debug.ShouldStop(4194304);
_c.runVoidMethod ("Close");
 BA.debugLineNum = 760;BA.debugLine="Return u";
Debug.ShouldStop(8388608);
if (true) return _u;
 BA.debugLineNum = 761;BA.debugLine="End Sub";
Debug.ShouldStop(16777216);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _ventanoventa(RemoteObject _ba,RemoteObject _usuariov,RemoteObject _almacenv,RemoteObject _rutav,RemoteObject _eventov,RemoteObject _clientev,RemoteObject _iniciov,RemoteObject _latitudv,RemoteObject _longitudv,RemoteObject _montoventav) throws Exception{
try {
		Debug.PushSubsStack("ventaNoVenta (subs) ","subs",9,_ba,subs.mostCurrent,1369);
if (RapidSub.canDelegate("ventanoventa")) { return keymon.lat.medicomed.subs.remoteMe.runUserSub(false, "subs","ventanoventa", _ba, _usuariov, _almacenv, _rutav, _eventov, _clientev, _iniciov, _latitudv, _longitudv, _montoventav);}
RemoteObject _cmd = RemoteObject.declareNull("keymon.lat.medicomed.dbrequestmanager._dbcommand");
RemoteObject _nombreclientev = RemoteObject.createImmutable("");
RemoteObject _c = RemoteObject.declareNull("anywheresoftware.b4a.sql.SQL.CursorWrapper");
;
Debug.locals.put("usuariov", _usuariov);
Debug.locals.put("almacenv", _almacenv);
Debug.locals.put("rutav", _rutav);
Debug.locals.put("eventov", _eventov);
Debug.locals.put("clientev", _clientev);
Debug.locals.put("iniciov", _iniciov);
Debug.locals.put("latitudv", _latitudv);
Debug.locals.put("longitudv", _longitudv);
Debug.locals.put("montoVentav", _montoventav);
 BA.debugLineNum = 1369;BA.debugLine="Sub ventaNoVenta(usuariov As String, almacenv As S";
Debug.ShouldStop(16777216);
 BA.debugLineNum = 1370;BA.debugLine="Log(\"ventaNoVenta\")";
Debug.ShouldStop(33554432);
subs.mostCurrent.__c.runVoidMethod ("LogImpl","315138817",RemoteObject.createImmutable("ventaNoVenta"),0);
 BA.debugLineNum = 1371;BA.debugLine="Log(eventov)";
Debug.ShouldStop(67108864);
subs.mostCurrent.__c.runVoidMethod ("LogImpl","315138818",_eventov,0);
 BA.debugLineNum = 1373;BA.debugLine="Private cmd As DBCommand";
Debug.ShouldStop(268435456);
_cmd = RemoteObject.createNew ("keymon.lat.medicomed.dbrequestmanager._dbcommand");Debug.locals.put("cmd", _cmd);
 BA.debugLineNum = 1374;BA.debugLine="cmd.Initialize";
Debug.ShouldStop(536870912);
_cmd.runVoidMethod ("Initialize");
 BA.debugLineNum = 1375;BA.debugLine="cmd.Name = \"insert_venta_no_venta_MEDICOMED\"";
Debug.ShouldStop(1073741824);
_cmd.setField ("Name" /*RemoteObject*/ ,BA.ObjectToString("insert_venta_no_venta_MEDICOMED"));
 BA.debugLineNum = 1378;BA.debugLine="Private nombreClientev As String = traeNombreClie";
Debug.ShouldStop(2);
_nombreclientev = _traenombreclientev(_ba,_clientev);Debug.locals.put("nombreClientev", _nombreclientev);Debug.locals.put("nombreClientev", _nombreclientev);
 BA.debugLineNum = 1381;BA.debugLine="If eventov = \"Llega a almacen\" Then";
Debug.ShouldStop(16);
if (RemoteObject.solveBoolean("=",_eventov,BA.ObjectToString("Llega a almacen"))) { 
 BA.debugLineNum = 1382;BA.debugLine="nombreClientev = \"BOLETA\"";
Debug.ShouldStop(32);
_nombreclientev = BA.ObjectToString("BOLETA");Debug.locals.put("nombreClientev", _nombreclientev);
 BA.debugLineNum = 1383;BA.debugLine="clientev = \"\"";
Debug.ShouldStop(64);
_clientev = BA.ObjectToString("");Debug.locals.put("clientev", _clientev);
 }else 
{ BA.debugLineNum = 1384;BA.debugLine="Else If eventov = \"ConVenta\" Then";
Debug.ShouldStop(128);
if (RemoteObject.solveBoolean("=",_eventov,BA.ObjectToString("ConVenta"))) { 
 BA.debugLineNum = 1385;BA.debugLine="nombreClientev = \"VENTA\"";
Debug.ShouldStop(256);
_nombreclientev = BA.ObjectToString("VENTA");Debug.locals.put("nombreClientev", _nombreclientev);
 }else 
{ BA.debugLineNum = 1386;BA.debugLine="Else If eventov = \"SinVenta\" Then";
Debug.ShouldStop(512);
if (RemoteObject.solveBoolean("=",_eventov,BA.ObjectToString("SinVenta"))) { 
 BA.debugLineNum = 1387;BA.debugLine="nombreClientev = \"Sin Venta\"";
Debug.ShouldStop(1024);
_nombreclientev = BA.ObjectToString("Sin Venta");Debug.locals.put("nombreClientev", _nombreclientev);
 }}}
;
 BA.debugLineNum = 1391;BA.debugLine="Private c As Cursor = B4XPages.MainPage.skmt.Exec";
Debug.ShouldStop(16384);
_c = RemoteObject.createNew ("anywheresoftware.b4a.sql.SQL.CursorWrapper");
_c = RemoteObject.declareNull("anywheresoftware.b4a.AbsObjectWrapper").runMethod(false, "ConvertToWrapper", RemoteObject.createNew("anywheresoftware.b4a.sql.SQL.CursorWrapper"), subs.mostCurrent._b4xpages.runMethod(false,"_mainpage" /*RemoteObject*/ ,_ba).getField(false,"_skmt" /*RemoteObject*/ ).runMethod(false,"ExecQuery",(Object)((RemoteObject.concat(RemoteObject.createImmutable("SELECT * FROM VENTA_No_VENTA WHERE usuariov = '"),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_usuariov))),RemoteObject.createImmutable("' AND almacenv = '"),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_almacenv))),RemoteObject.createImmutable("' AND rutav = '"),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_rutav))),RemoteObject.createImmutable("' AND clientev = '"),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_clientev))),RemoteObject.createImmutable("' ORDER BY iniciov DESC"))))));Debug.locals.put("c", _c);Debug.locals.put("c", _c);
 BA.debugLineNum = 1393;BA.debugLine="If c.RowCount > 0 Then";
Debug.ShouldStop(65536);
if (RemoteObject.solveBoolean(">",_c.runMethod(true,"getRowCount"),BA.numberCast(double.class, 0))) { 
 BA.debugLineNum = 1395;BA.debugLine="Log(\"Actualizando registro existente\")";
Debug.ShouldStop(262144);
subs.mostCurrent.__c.runVoidMethod ("LogImpl","315138842",RemoteObject.createImmutable("Actualizando registro existente"),0);
 BA.debugLineNum = 1396;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery($\"UPDATE VEN";
Debug.ShouldStop(524288);
subs.mostCurrent._b4xpages.runMethod(false,"_mainpage" /*RemoteObject*/ ,_ba).getField(false,"_skmt" /*RemoteObject*/ ).runVoidMethod ("ExecNonQuery",(Object)((RemoteObject.concat(RemoteObject.createImmutable("UPDATE VENTA_No_VENTA SET eventov = '"),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_eventov))),RemoteObject.createImmutable("', montoVentav = '"),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_montoventav))),RemoteObject.createImmutable("' WHERE usuariov = '"),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_usuariov))),RemoteObject.createImmutable("' AND almacenv = '"),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_almacenv))),RemoteObject.createImmutable("' AND rutav = '"),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_rutav))),RemoteObject.createImmutable("' AND clientev = '"),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_clientev))),RemoteObject.createImmutable("'")))));
 }else {
 BA.debugLineNum = 1399;BA.debugLine="Log(\"Insertando nuevo registro\")";
Debug.ShouldStop(4194304);
subs.mostCurrent.__c.runVoidMethod ("LogImpl","315138846",RemoteObject.createImmutable("Insertando nuevo registro"),0);
 BA.debugLineNum = 1400;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery($\"INSERT INT";
Debug.ShouldStop(8388608);
subs.mostCurrent._b4xpages.runMethod(false,"_mainpage" /*RemoteObject*/ ,_ba).getField(false,"_skmt" /*RemoteObject*/ ).runVoidMethod ("ExecNonQuery",(Object)((RemoteObject.concat(RemoteObject.createImmutable("INSERT INTO VENTA_No_VENTA (usuariov, almacenv, rutav, eventov, clientev, iniciov, latitudv, longitudv, montoVentav) VALUES ('"),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_usuariov))),RemoteObject.createImmutable("', '"),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_almacenv))),RemoteObject.createImmutable("', '"),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_rutav))),RemoteObject.createImmutable("', '"),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_eventov))),RemoteObject.createImmutable("', '"),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_clientev))),RemoteObject.createImmutable("', '"),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_iniciov))),RemoteObject.createImmutable("', '"),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_latitudv))),RemoteObject.createImmutable("', '"),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_longitudv))),RemoteObject.createImmutable("', '"),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_montoventav))),RemoteObject.createImmutable("')")))));
 };
 BA.debugLineNum = 1404;BA.debugLine="cmd.Parameters = Array As Object(usuariov, almace";
Debug.ShouldStop(134217728);
_cmd.setField ("Parameters" /*RemoteObject*/ ,RemoteObject.createNewArray("Object",new int[] {9},new Object[] {(_usuariov),(_almacenv),(_rutav),(_eventov),(_clientev),(_iniciov),(_latitudv),(_longitudv),(_montoventav)}));
 BA.debugLineNum = 1405;BA.debugLine="B4XPages.MainPage.reqManager.ExecuteCommand(cmd,";
Debug.ShouldStop(268435456);
subs.mostCurrent._b4xpages.runMethod(false,"_mainpage" /*RemoteObject*/ ,_ba).getField(false,"_reqmanager" /*RemoteObject*/ ).runClassMethod (keymon.lat.medicomed.dbrequestmanager.class, "_executecommand" /*RemoteObject*/ ,(Object)(_cmd),(Object)((RemoteObject.createImmutable("ventaNoVenta"))));
 BA.debugLineNum = 1407;BA.debugLine="Log($\"Datos procesados: '${usuariov}', '${almacen";
Debug.ShouldStop(1073741824);
subs.mostCurrent.__c.runVoidMethod ("LogImpl","315138854",(RemoteObject.concat(RemoteObject.createImmutable("Datos procesados: '"),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_usuariov))),RemoteObject.createImmutable("', '"),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_almacenv))),RemoteObject.createImmutable("', '"),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_rutav))),RemoteObject.createImmutable("', '"),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_eventov))),RemoteObject.createImmutable("', '"),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_clientev))),RemoteObject.createImmutable("', '"),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_iniciov))),RemoteObject.createImmutable("', '"),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_latitudv))),RemoteObject.createImmutable("', '"),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_longitudv))),RemoteObject.createImmutable("', '"),subs.mostCurrent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_montoventav))),RemoteObject.createImmutable("'"))),0);
 BA.debugLineNum = 1408;BA.debugLine="Log(\"Mandamos Venta_No_Venta\")";
Debug.ShouldStop(-2147483648);
subs.mostCurrent.__c.runVoidMethod ("LogImpl","315138855",RemoteObject.createImmutable("Mandamos Venta_No_Venta"),0);
 BA.debugLineNum = 1409;BA.debugLine="End Sub";
Debug.ShouldStop(1);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
}