package gunav2.keymon.com.mx;


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

public class subs {
private static subs mostCurrent = new subs();
public static Object getObject() {
    throw new RuntimeException("Code module does not support this method.");
}
 
public anywheresoftware.b4a.keywords.Common __c = null;
public static de.donmanfred.GZipStringswrapper _gzip = null;
public static anywheresoftware.b4a.objects.StringUtils _su = null;
public static anywheresoftware.b4a.phone.Phone _phn = null;
public static String _devmodel = "";
public static anywheresoftware.b4a.sql.SQL _kmt = null;
public static anywheresoftware.b4a.sql.SQL _errorlog = null;
public static String _ssid = "";
public static int _rutamaxpoints = 0;
public static int _rutahrsatras = 0;
public static boolean _subslogs = false;
public static anywheresoftware.b4a.sql.SQL _skmt = null;
public static anywheresoftware.b4a.objects.IntentWrapper _in = null;
public static boolean _intentusado = false;
public b4a.example.dateutils _dateutils = null;
public gunav2.keymon.com.mx.main _main = null;
public gunav2.keymon.com.mx.starter _starter = null;
public gunav2.keymon.com.mx.appupdater _appupdater = null;
public gunav2.keymon.com.mx.tracker _tracker = null;
public gunav2.keymon.com.mx.firebasemessaging _firebasemessaging = null;
public gunav2.keymon.com.mx.mapa_rutas _mapa_rutas = null;
public gunav2.keymon.com.mx.newinst2 _newinst2 = null;
public gunav2.keymon.com.mx.b4xpages _b4xpages = null;
public gunav2.keymon.com.mx.b4xcollections _b4xcollections = null;
public gunav2.keymon.com.mx.httputils2service _httputils2service = null;
public gunav2.keymon.com.mx.xuiviewsutils _xuiviewsutils = null;
public static String  _revisabd(anywheresoftware.b4a.BA _ba) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "revisabd", false))
	 {return ((String) Debug.delegate(null, "revisabd", new Object[] {_ba}));}
RDebugUtils.currentLine=44040192;
 //BA.debugLineNum = 44040192;BA.debugLine="Sub revisaBD 'ignore";
RDebugUtils.currentLine=44040194;
 //BA.debugLineNum = 44040194;BA.debugLine="If Not(File.Exists(Starter.ruta, \"kmt.db\")) Then";
if (anywheresoftware.b4a.keywords.Common.Not(anywheresoftware.b4a.keywords.Common.File.Exists(mostCurrent._starter._ruta /*String*/ ,"kmt.db"))) { 
anywheresoftware.b4a.keywords.Common.File.Copy(anywheresoftware.b4a.keywords.Common.File.getDirAssets(),"kmt.db",mostCurrent._starter._ruta /*String*/ ,"kmt.db");};
RDebugUtils.currentLine=44040195;
 //BA.debugLineNum = 44040195;BA.debugLine="If Not(kmt.IsInitialized) Then kmt.Initialize(Sta";
if (anywheresoftware.b4a.keywords.Common.Not(_kmt.IsInitialized())) { 
_kmt.Initialize(mostCurrent._starter._ruta /*String*/ ,"kmt.db",anywheresoftware.b4a.keywords.Common.True);};
RDebugUtils.currentLine=44040196;
 //BA.debugLineNum = 44040196;BA.debugLine="kmt.ExecNonQuery(\"CREATE TABLE IF NOT EXISTS RUTA";
_kmt.ExecNonQuery("CREATE TABLE IF NOT EXISTS RUTA_GPS(FECHA INTEGER, LAT TEXT, LON TEXT)");
RDebugUtils.currentLine=44040198;
 //BA.debugLineNum = 44040198;BA.debugLine="kmt.ExecNonQuery(\"CREATE TABLE IF NOT EXISTS bita";
_kmt.ExecNonQuery("CREATE TABLE IF NOT EXISTS bitacora(fecha INTEGER, texto TEXT)");
RDebugUtils.currentLine=44040200;
 //BA.debugLineNum = 44040200;BA.debugLine="If Not(errorLog.IsInitialized) Then errorLog.Init";
if (anywheresoftware.b4a.keywords.Common.Not(_errorlog.IsInitialized())) { 
_errorlog.Initialize(mostCurrent._starter._ruta /*String*/ ,"errorLog.db",anywheresoftware.b4a.keywords.Common.True);};
RDebugUtils.currentLine=44040201;
 //BA.debugLineNum = 44040201;BA.debugLine="errorLog.ExecNonQuery(\"CREATE TABLE IF NOT EXISTS";
_errorlog.ExecNonQuery("CREATE TABLE IF NOT EXISTS errores(fecha INTEGER, error TEXT)");
RDebugUtils.currentLine=44040202;
 //BA.debugLineNum = 44040202;BA.debugLine="End Sub";
return "";
}
public static String  _fechakmt(anywheresoftware.b4a.BA _ba,String _fecha) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "fechakmt", false))
	 {return ((String) Debug.delegate(null, "fechakmt", new Object[] {_ba,_fecha}));}
String _origformat = "";
String _nuevafecha = "";
RDebugUtils.currentLine=43450368;
 //BA.debugLineNum = 43450368;BA.debugLine="Sub fechaKMT(fecha As String) As String 'ignore";
RDebugUtils.currentLine=43450370;
 //BA.debugLineNum = 43450370;BA.debugLine="Dim OrigFormat As String = DateTime.DateFormat  '";
_origformat = anywheresoftware.b4a.keywords.Common.DateTime.getDateFormat();
RDebugUtils.currentLine=43450371;
 //BA.debugLineNum = 43450371;BA.debugLine="DateTime.DateFormat=\"yyMMddHHmmss\"";
anywheresoftware.b4a.keywords.Common.DateTime.setDateFormat("yyMMddHHmmss");
RDebugUtils.currentLine=43450372;
 //BA.debugLineNum = 43450372;BA.debugLine="Dim nuevaFecha As String=DateTime.Date(fecha)";
_nuevafecha = anywheresoftware.b4a.keywords.Common.DateTime.Date((long)(Double.parseDouble(_fecha)));
RDebugUtils.currentLine=43450373;
 //BA.debugLineNum = 43450373;BA.debugLine="DateTime.DateFormat=OrigFormat  'return to orig d";
anywheresoftware.b4a.keywords.Common.DateTime.setDateFormat(_origformat);
RDebugUtils.currentLine=43450375;
 //BA.debugLineNum = 43450375;BA.debugLine="Return nuevaFecha";
if (true) return _nuevafecha;
RDebugUtils.currentLine=43450376;
 //BA.debugLineNum = 43450376;BA.debugLine="End Sub";
return "";
}
public static boolean  _traeusarintentbdwa(anywheresoftware.b4a.BA _ba) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "traeusarintentbdwa", false))
	 {return ((Boolean) Debug.delegate(null, "traeusarintentbdwa", new Object[] {_ba}));}
boolean _bdwa = false;
anywheresoftware.b4a.sql.SQL.CursorWrapper _x = null;
RDebugUtils.currentLine=48627712;
 //BA.debugLineNum = 48627712;BA.debugLine="Sub traeUsarIntentBDWA As Boolean 'ignore";
RDebugUtils.currentLine=48627713;
 //BA.debugLineNum = 48627713;BA.debugLine="Private BDWA As Boolean = False";
_bdwa = anywheresoftware.b4a.keywords.Common.False;
RDebugUtils.currentLine=48627714;
 //BA.debugLineNum = 48627714;BA.debugLine="Private x As Cursor = Starter.skmt.ExecQuery($\"se";
_x = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_x = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(mostCurrent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery(("select CAT_VA_VALOR from CAT_VARIABLES where CAT_VA_DESCRIPCION = 'IMPORTAR_BD_WA'"))));
RDebugUtils.currentLine=48627715;
 //BA.debugLineNum = 48627715;BA.debugLine="If x.RowCount > 0 Then";
if (_x.getRowCount()>0) { 
RDebugUtils.currentLine=48627716;
 //BA.debugLineNum = 48627716;BA.debugLine="x.Position = 0";
_x.setPosition((int) (0));
RDebugUtils.currentLine=48627717;
 //BA.debugLineNum = 48627717;BA.debugLine="If x.GetString(\"CAT_VA_VALOR\") = \"true\" Then BDW";
if ((_x.GetString("CAT_VA_VALOR")).equals("true")) { 
_bdwa = anywheresoftware.b4a.keywords.Common.True;};
 };
RDebugUtils.currentLine=48627720;
 //BA.debugLineNum = 48627720;BA.debugLine="Return BDWA";
if (true) return _bdwa;
RDebugUtils.currentLine=48627721;
 //BA.debugLineNum = 48627721;BA.debugLine="End Sub";
return false;
}
public static String  _guardaappinfo(anywheresoftware.b4a.BA _ba) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "guardaappinfo", false))
	 {return ((String) Debug.delegate(null, "guardaappinfo", new Object[] {_ba}));}
RDebugUtils.currentLine=47579136;
 //BA.debugLineNum = 47579136;BA.debugLine="Sub guardaAppInfo 'ignore";
RDebugUtils.currentLine=47579137;
 //BA.debugLineNum = 47579137;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"delete from";
mostCurrent._b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (_ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("delete from CAT_VARIABLES where CAT_VA_DESCRIPCION = 'EMPRESA' or CAT_VA_DESCRIPCION = 'APP_NAME' or CAT_VA_DESCRIPCION = 'APP_VERSION'");
RDebugUtils.currentLine=47579138;
 //BA.debugLineNum = 47579138;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery($\"insert into";
mostCurrent._b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (_ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("insert into CAT_VARIABLES (CAT_VA_DESCRIPCION, CAT_VA_VALOR) values ('APP_NAME', '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(anywheresoftware.b4a.keywords.Common.Application.getLabelName()))+"')"));
RDebugUtils.currentLine=47579139;
 //BA.debugLineNum = 47579139;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery($\"insert into";
mostCurrent._b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (_ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("insert into CAT_VARIABLES (CAT_VA_DESCRIPCION, CAT_VA_VALOR) values ('APP_VERSION', '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(anywheresoftware.b4a.keywords.Common.Application.getVersionName()))+"')"));
RDebugUtils.currentLine=47579140;
 //BA.debugLineNum = 47579140;BA.debugLine="End Sub";
return "";
}
public static String  _agregacolumna(anywheresoftware.b4a.BA _ba,String _tabla,String _columna,String _tipo) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "agregacolumna", false))
	 {return ((String) Debug.delegate(null, "agregacolumna", new Object[] {_ba,_tabla,_columna,_tipo}));}
anywheresoftware.b4a.sql.SQL.CursorWrapper _c = null;
RDebugUtils.currentLine=47513600;
 //BA.debugLineNum = 47513600;BA.debugLine="Sub agregaColumna(tabla As String, columna As Stri";
RDebugUtils.currentLine=47513601;
 //BA.debugLineNum = 47513601;BA.debugLine="Try 'Intentamos usar \"pragma_table_info\" para rev";
try {RDebugUtils.currentLine=47513602;
 //BA.debugLineNum = 47513602;BA.debugLine="Private c As Cursor = B4XPages.MainPage.skmt.Exe";
_c = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(mostCurrent._b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (_ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery(("SELECT COUNT(*) AS fCol FROM pragma_table_info('"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_tabla))+"') WHERE name='"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_columna))+"'"))));
RDebugUtils.currentLine=47513603;
 //BA.debugLineNum = 47513603;BA.debugLine="c.Position = 0";
_c.setPosition((int) (0));
RDebugUtils.currentLine=47513604;
 //BA.debugLineNum = 47513604;BA.debugLine="If c.GetString(\"fCol\") = 0 Then 'Si no esta la c";
if ((_c.GetString("fCol")).equals(BA.NumberToString(0))) { 
RDebugUtils.currentLine=47513605;
 //BA.debugLineNum = 47513605;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery($\"ALTER TAB";
mostCurrent._b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (_ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("ALTER TABLE "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_tabla))+" ADD COLUMN "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_columna))+" "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_tipo))+""));
RDebugUtils.currentLine=47513606;
 //BA.debugLineNum = 47513606;BA.debugLine="Log($\"Columna \"${columna} ${tipo}\", agregada a";
anywheresoftware.b4a.keywords.Common.LogImpl("047513606",("Columna \""+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_columna))+" "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_tipo))+"\", agregada a \""+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_tabla))+"\"."),0);
 };
 } 
       catch (Exception e9) {
			(_ba.processBA == null ? _ba : _ba.processBA).setLastException(e9);RDebugUtils.currentLine=47513610;
 //BA.debugLineNum = 47513610;BA.debugLine="Try";
try {RDebugUtils.currentLine=47513611;
 //BA.debugLineNum = 47513611;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery($\"ALTER TAB";
mostCurrent._b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (_ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("ALTER TABLE "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_tabla))+" ADD COLUMN "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_columna))+" "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_tipo))+""));
RDebugUtils.currentLine=47513612;
 //BA.debugLineNum = 47513612;BA.debugLine="Log($\"Columna \"${columna} ${tipo}\", agregada a";
anywheresoftware.b4a.keywords.Common.LogImpl("047513612",("Columna \""+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_columna))+" "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_tipo))+"\", agregada a \""+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_tabla))+"\".."),0);
 } 
       catch (Exception e13) {
			(_ba.processBA == null ? _ba : _ba.processBA).setLastException(e13);RDebugUtils.currentLine=47513614;
 //BA.debugLineNum = 47513614;BA.debugLine="Log(LastException)";
anywheresoftware.b4a.keywords.Common.LogImpl("047513614",BA.ObjectToString(anywheresoftware.b4a.keywords.Common.LastException(_ba)),0);
 };
RDebugUtils.currentLine=47513616;
 //BA.debugLineNum = 47513616;BA.debugLine="Log(2)";
anywheresoftware.b4a.keywords.Common.LogImpl("047513616",BA.NumberToString(2),0);
 };
RDebugUtils.currentLine=47513618;
 //BA.debugLineNum = 47513618;BA.debugLine="End Sub";
return "";
}
public static String  _importabddesdewhatsapp(anywheresoftware.b4a.BA _ba) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "importabddesdewhatsapp", false))
	 {return ((String) Debug.delegate(null, "importabddesdewhatsapp", new Object[] {_ba}));}
String _xmldata = "";
anywheresoftware.b4a.objects.streams.File.OutputStreamWrapper _outstr = null;
anywheresoftware.b4a.objects.streams.File.InputStreamWrapper _instr = null;
anywheresoftware.b4a.sql.SQL.CursorWrapper _a = null;
RDebugUtils.currentLine=48562176;
 //BA.debugLineNum = 48562176;BA.debugLine="Sub importaBDDesdeWhatsApp";
RDebugUtils.currentLine=48562178;
 //BA.debugLineNum = 48562178;BA.debugLine="Log(\"Revisamos intent de importar desde whatsapp\"";
anywheresoftware.b4a.keywords.Common.LogImpl("048562178","Revisamos intent de importar desde whatsapp",0);
RDebugUtils.currentLine=48562179;
 //BA.debugLineNum = 48562179;BA.debugLine="Log(B4XPages.MainPage.intentUsado)";
anywheresoftware.b4a.keywords.Common.LogImpl("048562179",BA.ObjectToString(mostCurrent._b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (_ba)._intentusado /*boolean*/ ),0);
RDebugUtils.currentLine=48562180;
 //BA.debugLineNum = 48562180;BA.debugLine="Log(in)";
anywheresoftware.b4a.keywords.Common.LogImpl("048562180",BA.ObjectToString(_in),0);
RDebugUtils.currentLine=48562181;
 //BA.debugLineNum = 48562181;BA.debugLine="If Not(in.IsInitialized) Then in = B4XPages.GetNa";
if (anywheresoftware.b4a.keywords.Common.Not(_in.IsInitialized())) { 
_in = mostCurrent._b4xpages._getnativeparent /*anywheresoftware.b4a.objects.ActivityWrapper*/ (_ba,(Object)(mostCurrent._b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (_ba))).GetStartingIntent();};
RDebugUtils.currentLine=48562182;
 //BA.debugLineNum = 48562182;BA.debugLine="If Not(B4XPages.MainPage.intentUsado) And in <> N";
if (anywheresoftware.b4a.keywords.Common.Not(mostCurrent._b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (_ba)._intentusado /*boolean*/ ) && _in!= null) { 
RDebugUtils.currentLine=48562184;
 //BA.debugLineNum = 48562184;BA.debugLine="LogColor(\"Importamos base de datos desde Whatsap";
anywheresoftware.b4a.keywords.Common.LogImpl("048562184","Importamos base de datos desde Whatsapp.",anywheresoftware.b4a.keywords.Common.Colors.Blue);
RDebugUtils.currentLine=48562185;
 //BA.debugLineNum = 48562185;BA.debugLine="B4XPages.MainPage.intentUsado = True";
mostCurrent._b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (_ba)._intentusado /*boolean*/  = anywheresoftware.b4a.keywords.Common.True;
RDebugUtils.currentLine=48562187;
 //BA.debugLineNum = 48562187;BA.debugLine="If in.GetData <> Null Then";
if (_in.GetData()!= null) { 
RDebugUtils.currentLine=48562188;
 //BA.debugLineNum = 48562188;BA.debugLine="Dim XmlData As String";
_xmldata = "";
RDebugUtils.currentLine=48562189;
 //BA.debugLineNum = 48562189;BA.debugLine="XmlData = in.GetData";
_xmldata = _in.GetData();
RDebugUtils.currentLine=48562190;
 //BA.debugLineNum = 48562190;BA.debugLine="Try";
try {RDebugUtils.currentLine=48562191;
 //BA.debugLineNum = 48562191;BA.debugLine="Dim OutStr As OutputStream = File.OpenOutput(F";
_outstr = new anywheresoftware.b4a.objects.streams.File.OutputStreamWrapper();
_outstr = anywheresoftware.b4a.keywords.Common.File.OpenOutput(anywheresoftware.b4a.keywords.Common.File.getDirInternal(),"kmt.db",anywheresoftware.b4a.keywords.Common.False);
RDebugUtils.currentLine=48562192;
 //BA.debugLineNum = 48562192;BA.debugLine="Dim InStr As InputStream = File.OpenInput(\"Con";
_instr = new anywheresoftware.b4a.objects.streams.File.InputStreamWrapper();
_instr = anywheresoftware.b4a.keywords.Common.File.OpenInput("ContentDir",_xmldata);
RDebugUtils.currentLine=48562193;
 //BA.debugLineNum = 48562193;BA.debugLine="File.Copy2(InStr,OutStr)";
anywheresoftware.b4a.keywords.Common.File.Copy2((java.io.InputStream)(_instr.getObject()),(java.io.OutputStream)(_outstr.getObject()));
RDebugUtils.currentLine=48562194;
 //BA.debugLineNum = 48562194;BA.debugLine="LogColor(\"BD copiada a interna.\", Colors.Blue)";
anywheresoftware.b4a.keywords.Common.LogImpl("048562194","BD copiada a interna.",anywheresoftware.b4a.keywords.Common.Colors.Blue);
RDebugUtils.currentLine=48562195;
 //BA.debugLineNum = 48562195;BA.debugLine="OutStr.Close";
_outstr.Close();
RDebugUtils.currentLine=48562196;
 //BA.debugLineNum = 48562196;BA.debugLine="If in.As(String).Contains(\"whatsapp\") Then Toa";
if ((BA.ObjectToString(_in)).contains("whatsapp")) { 
anywheresoftware.b4a.keywords.Common.ToastMessageShow(BA.ObjectToCharSequence("BD cargada desde Whatsapp"),anywheresoftware.b4a.keywords.Common.False);};
 } 
       catch (Exception e19) {
			(_ba.processBA == null ? _ba : _ba.processBA).setLastException(e19);RDebugUtils.currentLine=48562198;
 //BA.debugLineNum = 48562198;BA.debugLine="Log(LastException)";
anywheresoftware.b4a.keywords.Common.LogImpl("048562198",BA.ObjectToString(anywheresoftware.b4a.keywords.Common.LastException(_ba)),0);
 };
RDebugUtils.currentLine=48562203;
 //BA.debugLineNum = 48562203;BA.debugLine="Private a As Cursor = Starter.skmt.ExecQuery($\"";
_a = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_a = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(mostCurrent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery(("select CAT_VA_VALOR from CAT_VARIABLES where CAT_VA_DESCRIPCION = 'APP_NAME'"))));
RDebugUtils.currentLine=48562204;
 //BA.debugLineNum = 48562204;BA.debugLine="If a.RowCount > 0 Then";
if (_a.getRowCount()>0) { 
RDebugUtils.currentLine=48562205;
 //BA.debugLineNum = 48562205;BA.debugLine="a.Position = 0";
_a.setPosition((int) (0));
RDebugUtils.currentLine=48562206;
 //BA.debugLineNum = 48562206;BA.debugLine="ToastMessageShow($\"BD de \"${a.GetString(\"CAT_V";
anywheresoftware.b4a.keywords.Common.ToastMessageShow(BA.ObjectToCharSequence(("BD de \""+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_a.GetString("CAT_VA_VALOR")))+"\" cargada.")),anywheresoftware.b4a.keywords.Common.True);
 };
RDebugUtils.currentLine=48562208;
 //BA.debugLineNum = 48562208;BA.debugLine="a = Starter.skmt.ExecQuery($\"select * from usua";
_a = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(mostCurrent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery(("select * from usuarioa"))));
RDebugUtils.currentLine=48562209;
 //BA.debugLineNum = 48562209;BA.debugLine="If a.RowCount > 0 Then";
if (_a.getRowCount()>0) { 
RDebugUtils.currentLine=48562210;
 //BA.debugLineNum = 48562210;BA.debugLine="a.Position = 0";
_a.setPosition((int) (0));
RDebugUtils.currentLine=48562211;
 //BA.debugLineNum = 48562211;BA.debugLine="B4XPages.MainPage.user.Text = a.GetString(\"USU";
mostCurrent._b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (_ba)._user /*anywheresoftware.b4a.objects.EditTextWrapper*/ .setText(BA.ObjectToCharSequence(_a.GetString("USUARIO")));
RDebugUtils.currentLine=48562212;
 //BA.debugLineNum = 48562212;BA.debugLine="B4XPages.MainPage.pass.Text = a.GetString(\"PAS";
mostCurrent._b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (_ba)._pass /*anywheresoftware.b4a.objects.EditTextWrapper*/ .setText(BA.ObjectToCharSequence(_a.GetString("PASS")));
 };
 };
 };
RDebugUtils.currentLine=48562216;
 //BA.debugLineNum = 48562216;BA.debugLine="End Sub";
return "";
}
public static String  _panelvisible(anywheresoftware.b4a.BA _ba,anywheresoftware.b4a.objects.PanelWrapper _panel,int _top,int _left) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "panelvisible", false))
	 {return ((String) Debug.delegate(null, "panelvisible", new Object[] {_ba,_panel,_top,_left}));}
RDebugUtils.currentLine=45285376;
 //BA.debugLineNum = 45285376;BA.debugLine="Sub panelVisible(panel As Panel, top As Int, left";
RDebugUtils.currentLine=45285377;
 //BA.debugLineNum = 45285377;BA.debugLine="panel.BringToFront";
_panel.BringToFront();
RDebugUtils.currentLine=45285378;
 //BA.debugLineNum = 45285378;BA.debugLine="panel.Visible = True";
_panel.setVisible(anywheresoftware.b4a.keywords.Common.True);
RDebugUtils.currentLine=45285379;
 //BA.debugLineNum = 45285379;BA.debugLine="panel.Top = top";
_panel.setTop(_top);
RDebugUtils.currentLine=45285380;
 //BA.debugLineNum = 45285380;BA.debugLine="panel.Left = left";
_panel.setLeft(_left);
RDebugUtils.currentLine=45285381;
 //BA.debugLineNum = 45285381;BA.debugLine="End Sub";
return "";
}
public static String  _traetipoventadebd(anywheresoftware.b4a.BA _ba) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "traetipoventadebd", false))
	 {return ((String) Debug.delegate(null, "traetipoventadebd", new Object[] {_ba}));}
String _tipoventa = "";
anywheresoftware.b4a.sql.SQL.ResultSetWrapper _r = null;
RDebugUtils.currentLine=48955392;
 //BA.debugLineNum = 48955392;BA.debugLine="Sub traeTipoVentaDeBD As String";
RDebugUtils.currentLine=48955393;
 //BA.debugLineNum = 48955393;BA.debugLine="Private tipoVenta As String = \"PREVENTA\"";
_tipoventa = "PREVENTA";
RDebugUtils.currentLine=48955394;
 //BA.debugLineNum = 48955394;BA.debugLine="Private r As ResultSet = Starter.skmt.ExecQuery(\"";
_r = new anywheresoftware.b4a.sql.SQL.ResultSetWrapper();
_r = (anywheresoftware.b4a.sql.SQL.ResultSetWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.ResultSetWrapper(), (android.database.Cursor)(mostCurrent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select * from CAT_VARIABLES where CAT_VA_DESCRIPCION = 'TIPO_VENTA'  ")));
RDebugUtils.currentLine=48955395;
 //BA.debugLineNum = 48955395;BA.debugLine="Do While r.NextRow";
while (_r.NextRow()) {
RDebugUtils.currentLine=48955396;
 //BA.debugLineNum = 48955396;BA.debugLine="tipoVenta = r.GetString(\"CAT_VA_VALOR\").As(Strin";
_tipoventa = (_r.GetString("CAT_VA_VALOR")).toUpperCase();
 }
;
RDebugUtils.currentLine=48955398;
 //BA.debugLineNum = 48955398;BA.debugLine="If Starter.idCliente = \"0\" Then";
if ((mostCurrent._starter._idcliente /*String*/ ).equals("0")) { 
RDebugUtils.currentLine=48955399;
 //BA.debugLineNum = 48955399;BA.debugLine="tipoVenta = \"ABORDO\"";
_tipoventa = "ABORDO";
 };
RDebugUtils.currentLine=48955402;
 //BA.debugLineNum = 48955402;BA.debugLine="Return tipoVenta";
if (true) return _tipoventa;
RDebugUtils.currentLine=48955403;
 //BA.debugLineNum = 48955403;BA.debugLine="End Sub";
return "";
}
public static String  _traealmacen(anywheresoftware.b4a.BA _ba) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "traealmacen", false))
	 {return ((String) Debug.delegate(null, "traealmacen", new Object[] {_ba}));}
anywheresoftware.b4a.sql.SQL.CursorWrapper _c = null;
String _a = "";
RDebugUtils.currentLine=45940736;
 //BA.debugLineNum = 45940736;BA.debugLine="Sub traeAlmacen As String 'ignore";
RDebugUtils.currentLine=45940737;
 //BA.debugLineNum = 45940737;BA.debugLine="Private c As Cursor";
_c = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
RDebugUtils.currentLine=45940738;
 //BA.debugLineNum = 45940738;BA.debugLine="Private a As String = \"NA\"";
_a = "NA";
RDebugUtils.currentLine=45940739;
 //BA.debugLineNum = 45940739;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"select  ID_AL";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(mostCurrent._b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (_ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select  ID_ALMACEN from CAT_ALMACEN")));
RDebugUtils.currentLine=45940740;
 //BA.debugLineNum = 45940740;BA.debugLine="If c.RowCount > 0 Then";
if (_c.getRowCount()>0) { 
RDebugUtils.currentLine=45940741;
 //BA.debugLineNum = 45940741;BA.debugLine="c.Position = 0";
_c.setPosition((int) (0));
RDebugUtils.currentLine=45940742;
 //BA.debugLineNum = 45940742;BA.debugLine="a = C.GetString(\"ID_ALMACEN\")";
_a = _c.GetString("ID_ALMACEN");
 };
RDebugUtils.currentLine=45940744;
 //BA.debugLineNum = 45940744;BA.debugLine="c.Close";
_c.Close();
RDebugUtils.currentLine=45940745;
 //BA.debugLineNum = 45940745;BA.debugLine="Return a";
if (true) return _a;
RDebugUtils.currentLine=45940746;
 //BA.debugLineNum = 45940746;BA.debugLine="End Sub";
return "";
}
public static String  _parsehttperror(anywheresoftware.b4a.BA _ba,String _error) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "parsehttperror", false))
	 {return ((String) Debug.delegate(null, "parsehttperror", new Object[] {_ba,_error}));}
String _nuevoerror = "";
int _inicio = 0;
int _final = 0;
RDebugUtils.currentLine=48496640;
 //BA.debugLineNum = 48496640;BA.debugLine="Sub parseHTTPError(error As String) As String";
RDebugUtils.currentLine=48496641;
 //BA.debugLineNum = 48496641;BA.debugLine="Private nuevoError As String = error";
_nuevoerror = _error;
RDebugUtils.currentLine=48496642;
 //BA.debugLineNum = 48496642;BA.debugLine="Private inicio As Int = error.IndexOf(\"<title>\")";
_inicio = _error.indexOf("<title>");
RDebugUtils.currentLine=48496643;
 //BA.debugLineNum = 48496643;BA.debugLine="Private final As Int = error.IndexOf(\"</title>\")";
_final = _error.indexOf("</title>");
RDebugUtils.currentLine=48496644;
 //BA.debugLineNum = 48496644;BA.debugLine="Log(\"|\" & inicio & \"|\" & final & \"|\")";
anywheresoftware.b4a.keywords.Common.LogImpl("048496644","|"+BA.NumberToString(_inicio)+"|"+BA.NumberToString(_final)+"|",0);
RDebugUtils.currentLine=48496645;
 //BA.debugLineNum = 48496645;BA.debugLine="If inicio > 0 And final > 0 Then";
if (_inicio>0 && _final>0) { 
RDebugUtils.currentLine=48496646;
 //BA.debugLineNum = 48496646;BA.debugLine="nuevoError = error.SubString2(inicio + 17, final";
_nuevoerror = _error.substring((int) (_inicio+17),_final);
 };
RDebugUtils.currentLine=48496649;
 //BA.debugLineNum = 48496649;BA.debugLine="Return nuevoError";
if (true) return _nuevoerror;
RDebugUtils.currentLine=48496650;
 //BA.debugLineNum = 48496650;BA.debugLine="End Sub";
return "";
}
public static String  _traeruta(anywheresoftware.b4a.BA _ba) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "traeruta", false))
	 {return ((String) Debug.delegate(null, "traeruta", new Object[] {_ba}));}
anywheresoftware.b4a.sql.SQL.CursorWrapper _c = null;
String _r = "";
String _idcliente = "";
anywheresoftware.b4a.sql.SQL.CursorWrapper _elcc = null;
RDebugUtils.currentLine=46071808;
 //BA.debugLineNum = 46071808;BA.debugLine="Sub traeRuta As String 'ignore";
RDebugUtils.currentLine=46071809;
 //BA.debugLineNum = 46071809;BA.debugLine="Private c As Cursor";
_c = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
RDebugUtils.currentLine=46071810;
 //BA.debugLineNum = 46071810;BA.debugLine="Private r As String = \"0\"";
_r = "0";
RDebugUtils.currentLine=46071811;
 //BA.debugLineNum = 46071811;BA.debugLine="Private idCliente As String = \"\"";
_idcliente = "";
RDebugUtils.currentLine=46071812;
 //BA.debugLineNum = 46071812;BA.debugLine="Try";
try {RDebugUtils.currentLine=46071813;
 //BA.debugLineNum = 46071813;BA.debugLine="Private elCc As Cursor = Starter.skmt.ExecQuery(";
_elcc = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_elcc = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(mostCurrent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery(("select CUENTA from CUENTAA"))));
RDebugUtils.currentLine=46071814;
 //BA.debugLineNum = 46071814;BA.debugLine="If elCc.RowCount > 0 Then";
if (_elcc.getRowCount()>0) { 
RDebugUtils.currentLine=46071815;
 //BA.debugLineNum = 46071815;BA.debugLine="elCc.Position = 0";
_elcc.setPosition((int) (0));
RDebugUtils.currentLine=46071816;
 //BA.debugLineNum = 46071816;BA.debugLine="idCliente = elCc.GetString(\"CUENTA\")";
_idcliente = _elcc.GetString("CUENTA");
RDebugUtils.currentLine=46071817;
 //BA.debugLineNum = 46071817;BA.debugLine="Log(\"|\"&elCc.GetString(\"CUENTA\")&\"|\")";
anywheresoftware.b4a.keywords.Common.LogImpl("046071817","|"+_elcc.GetString("CUENTA")+"|",0);
 };
RDebugUtils.currentLine=46071820;
 //BA.debugLineNum = 46071820;BA.debugLine="If idCliente <> \"\" Then";
if ((_idcliente).equals("") == false) { 
RDebugUtils.currentLine=46071822;
 //BA.debugLineNum = 46071822;BA.debugLine="c = B4XPages.MainPage.skmt.ExecQuery($\"select d";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(mostCurrent._b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (_ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery(("select distinct CAT_CL_RUTA from kmt_info3 where CAT_CL_CODIGO = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_idcliente))+"'"))));
 }else {
RDebugUtils.currentLine=46071825;
 //BA.debugLineNum = 46071825;BA.debugLine="c = B4XPages.MainPage.skmt.ExecQuery(\"select di";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(mostCurrent._b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (_ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select distinct CAT_CL_RUTA from kmt_info3 where CAT_CL_RUTA not in (select * from ruta_suplencia)")));
 };
RDebugUtils.currentLine=46071828;
 //BA.debugLineNum = 46071828;BA.debugLine="If c.RowCount > 0 Then";
if (_c.getRowCount()>0) { 
RDebugUtils.currentLine=46071830;
 //BA.debugLineNum = 46071830;BA.debugLine="c.Position=0";
_c.setPosition((int) (0));
RDebugUtils.currentLine=46071831;
 //BA.debugLineNum = 46071831;BA.debugLine="r = c.GetString(\"CAT_CL_RUTA\")";
_r = _c.GetString("CAT_CL_RUTA");
 };
RDebugUtils.currentLine=46071833;
 //BA.debugLineNum = 46071833;BA.debugLine="c.Close";
_c.Close();
 } 
       catch (Exception e22) {
			(_ba.processBA == null ? _ba : _ba.processBA).setLastException(e22);RDebugUtils.currentLine=46071835;
 //BA.debugLineNum = 46071835;BA.debugLine="Log(LastException)";
anywheresoftware.b4a.keywords.Common.LogImpl("046071835",BA.ObjectToString(anywheresoftware.b4a.keywords.Common.LastException(_ba)),0);
 };
RDebugUtils.currentLine=46071838;
 //BA.debugLineNum = 46071838;BA.debugLine="Return r";
if (true) return _r;
RDebugUtils.currentLine=46071839;
 //BA.debugLineNum = 46071839;BA.debugLine="End Sub";
return "";
}
public static String  _traetablaprods(anywheresoftware.b4a.BA _ba,String _tipoventa) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "traetablaprods", false))
	 {return ((String) Debug.delegate(null, "traetablaprods", new Object[] {_ba,_tipoventa}));}
String _tablaprods = "";
RDebugUtils.currentLine=48824320;
 //BA.debugLineNum = 48824320;BA.debugLine="Sub traeTablaProds(tipoventa As String) As String";
RDebugUtils.currentLine=48824321;
 //BA.debugLineNum = 48824321;BA.debugLine="Log(tipoventa)";
anywheresoftware.b4a.keywords.Common.LogImpl("048824321",_tipoventa,0);
RDebugUtils.currentLine=48824322;
 //BA.debugLineNum = 48824322;BA.debugLine="Private tablaProds As String = \"cat_gunaprod2\"";
_tablaprods = "cat_gunaprod2";
RDebugUtils.currentLine=48824323;
 //BA.debugLineNum = 48824323;BA.debugLine="If tipoventa = \"ABORDO\" Or tipoventa = \"PREVENTA\"";
if ((_tipoventa).equals("ABORDO") || (_tipoventa).equals("PREVENTA") || (_tipoventa).equals("PREVENTA_FUTURA") || (_tipoventa).equals("MAYOREO")) { 
_tablaprods = "cat_gunaprod";};
RDebugUtils.currentLine=48824325;
 //BA.debugLineNum = 48824325;BA.debugLine="Return tablaProds";
if (true) return _tablaprods;
RDebugUtils.currentLine=48824326;
 //BA.debugLineNum = 48824326;BA.debugLine="End Sub";
return "";
}
public static String  _fechanormal(anywheresoftware.b4a.BA _ba,String _fecha) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "fechanormal", false))
	 {return ((String) Debug.delegate(null, "fechanormal", new Object[] {_ba,_fecha}));}
String _origformat = "";
String _nuevafecha = "";
RDebugUtils.currentLine=44105728;
 //BA.debugLineNum = 44105728;BA.debugLine="Sub fechanormal(fecha As String) As String 'ignore";
RDebugUtils.currentLine=44105730;
 //BA.debugLineNum = 44105730;BA.debugLine="Dim OrigFormat As String = DateTime.DateFormat  '";
_origformat = anywheresoftware.b4a.keywords.Common.DateTime.getDateFormat();
RDebugUtils.currentLine=44105731;
 //BA.debugLineNum = 44105731;BA.debugLine="DateTime.DateFormat = \"YYYY/MM/dd HH:mm:ss\"";
anywheresoftware.b4a.keywords.Common.DateTime.setDateFormat("YYYY/MM/dd HH:mm:ss");
RDebugUtils.currentLine=44105732;
 //BA.debugLineNum = 44105732;BA.debugLine="Dim nuevaFecha As String=DateTime.Date(fecha)";
_nuevafecha = anywheresoftware.b4a.keywords.Common.DateTime.Date((long)(Double.parseDouble(_fecha)));
RDebugUtils.currentLine=44105733;
 //BA.debugLineNum = 44105733;BA.debugLine="DateTime.DateFormat = OrigFormat  'return to orig";
anywheresoftware.b4a.keywords.Common.DateTime.setDateFormat(_origformat);
RDebugUtils.currentLine=44105735;
 //BA.debugLineNum = 44105735;BA.debugLine="Return nuevaFecha";
if (true) return _nuevafecha;
RDebugUtils.currentLine=44105736;
 //BA.debugLineNum = 44105736;BA.debugLine="End Sub";
return "";
}
public static String  _validapromoprocterpro3009(anywheresoftware.b4a.BA _ba) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "validapromoprocterpro3009", false))
	 {return ((String) Debug.delegate(null, "validapromoprocterpro3009", new Object[] {_ba}));}
String _idregalo = "";
anywheresoftware.b4a.sql.SQL.ResultSetWrapper _r = null;
String _monto = "";
anywheresoftware.b4a.sql.SQL.ResultSetWrapper _r2 = null;
RDebugUtils.currentLine=48168960;
 //BA.debugLineNum = 48168960;BA.debugLine="Sub validaPromoProcterPRO3009";
RDebugUtils.currentLine=48168961;
 //BA.debugLineNum = 48168961;BA.debugLine="Private idRegalo As String = \"PYG1016\"";
_idregalo = "PYG1016";
RDebugUtils.currentLine=48168962;
 //BA.debugLineNum = 48168962;BA.debugLine="Private r As ResultSet = Starter.skmt.ExecQuery($";
_r = new anywheresoftware.b4a.sql.SQL.ResultSetWrapper();
_r = (anywheresoftware.b4a.sql.SQL.ResultSetWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.ResultSetWrapper(), (android.database.Cursor)(mostCurrent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery(("select pe_cliente from pedido where pe_proid = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_idregalo))+"' and pe_cedis = 'PRO3009'"))));
RDebugUtils.currentLine=48168964;
 //BA.debugLineNum = 48168964;BA.debugLine="Do While r.NextRow";
while (_r.NextRow()) {
RDebugUtils.currentLine=48168965;
 //BA.debugLineNum = 48168965;BA.debugLine="Private monto As String = 0";
_monto = BA.NumberToString(0);
RDebugUtils.currentLine=48168966;
 //BA.debugLineNum = 48168966;BA.debugLine="Private r2 As ResultSet = Starter.skmt.ExecQuery";
_r2 = new anywheresoftware.b4a.sql.SQL.ResultSetWrapper();
_r2 = (anywheresoftware.b4a.sql.SQL.ResultSetWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.ResultSetWrapper(), (android.database.Cursor)(mostCurrent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery(("select ifnull(sum(pe_costo_tot),0) as monto from pedido where pe_cliente = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_r.GetString("PE_CLIENTE")))+"' and PE_PROID in (\"PYG1014\", \"PYG1025\")"))));
RDebugUtils.currentLine=48168967;
 //BA.debugLineNum = 48168967;BA.debugLine="Do While r2.NextRow";
while (_r2.NextRow()) {
RDebugUtils.currentLine=48168968;
 //BA.debugLineNum = 48168968;BA.debugLine="Log($\"Cliente: ${r.GetString(\"PE_CLIENTE\")}, mo";
anywheresoftware.b4a.keywords.Common.LogImpl("048168968",("Cliente: "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_r.GetString("PE_CLIENTE")))+", monto: "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_r2.GetString("monto")))+""),0);
RDebugUtils.currentLine=48168971;
 //BA.debugLineNum = 48168971;BA.debugLine="If r2.GetString(\"monto\") < 150 Then";
if ((double)(Double.parseDouble(_r2.GetString("monto")))<150) { 
RDebugUtils.currentLine=48168972;
 //BA.debugLineNum = 48168972;BA.debugLine="Starter.skmt.ExecNonQuery($\"delete from pedido";
mostCurrent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("delete from pedido where pe_cedis = 'PRO3009' and pe_proid = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_idregalo))+"' and pe_cliente = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_r.GetString("PE_CLIENTE")))+"' and pe_cant = 1 "));
RDebugUtils.currentLine=48168974;
 //BA.debugLineNum = 48168974;BA.debugLine="Msgbox($\"Regalo de la promoción PRO3009 borrad";
anywheresoftware.b4a.keywords.Common.Msgbox(BA.ObjectToCharSequence(("Regalo de la promoción PRO3009 borrado por no cumplir con los requisitos mínimos.")),BA.ObjectToCharSequence("Regalo Borrado"),_ba);
 };
 }
;
RDebugUtils.currentLine=48168978;
 //BA.debugLineNum = 48168978;BA.debugLine="r2 = Starter.skmt.ExecQuery($\"select count(pe_pr";
_r2 = (anywheresoftware.b4a.sql.SQL.ResultSetWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.ResultSetWrapper(), (android.database.Cursor)(mostCurrent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery(("select count(pe_proid) as cuantos from pedido where pe_cliente = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_r.GetString("PE_CLIENTE")))+"'"))));
RDebugUtils.currentLine=48168979;
 //BA.debugLineNum = 48168979;BA.debugLine="Do While r2.NextRow";
while (_r2.NextRow()) {
RDebugUtils.currentLine=48168981;
 //BA.debugLineNum = 48168981;BA.debugLine="If r2.GetString(\"cuantos\") = 0 Then";
if ((_r2.GetString("cuantos")).equals(BA.NumberToString(0))) { 
RDebugUtils.currentLine=48168982;
 //BA.debugLineNum = 48168982;BA.debugLine="Starter.skmt.ExecNonQuery($\"delete from pedido";
mostCurrent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("delete from pedido_cliente where pc_cliente = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_r.GetString("PE_CLIENTE")))+"'"));
RDebugUtils.currentLine=48168983;
 //BA.debugLineNum = 48168983;BA.debugLine="Starter.skmt.ExecNonQuery($\"update kmt_info3 s";
mostCurrent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("update kmt_info3 set gestion = 0 where cat_cl_codigo = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_r.GetString("PE_CLIENTE")))+"'"));
 };
 }
;
 }
;
RDebugUtils.currentLine=48168987;
 //BA.debugLineNum = 48168987;BA.debugLine="End Sub";
return "";
}
public static String  _calculatotalconpromoxrango(anywheresoftware.b4a.BA _ba,String _idcliente) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "calculatotalconpromoxrango", false))
	 {return ((String) Debug.delegate(null, "calculatotalconpromoxrango", new Object[] {_ba,_idcliente}));}
String _totalparcial = "";
String _total = "";
anywheresoftware.b4a.sql.SQL.CursorWrapper _cx = null;
int _i = 0;
RDebugUtils.currentLine=49741824;
 //BA.debugLineNum = 49741824;BA.debugLine="Sub calculaTotalConPromoXRango(idCliente As String";
RDebugUtils.currentLine=49741832;
 //BA.debugLineNum = 49741832;BA.debugLine="Private totalParcial As String = 0";
_totalparcial = BA.NumberToString(0);
RDebugUtils.currentLine=49741833;
 //BA.debugLineNum = 49741833;BA.debugLine="Private total As String = 0";
_total = BA.NumberToString(0);
RDebugUtils.currentLine=49741834;
 //BA.debugLineNum = 49741834;BA.debugLine="Private cx As Cursor = Starter.skmt.ExecQuery($\"s";
_cx = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_cx = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(mostCurrent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery(("select *, ifnull(pe_reccant, 'N') as RECANT from pedido where pe_cliente = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_idcliente))+"'"))));
RDebugUtils.currentLine=49741835;
 //BA.debugLineNum = 49741835;BA.debugLine="If cx.RowCount > 0 Then";
if (_cx.getRowCount()>0) { 
RDebugUtils.currentLine=49741836;
 //BA.debugLineNum = 49741836;BA.debugLine="For i = 0 To cx.RowCount - 1";
{
final int step5 = 1;
final int limit5 = (int) (_cx.getRowCount()-1);
_i = (int) (0) ;
for (;_i <= limit5 ;_i = _i + step5 ) {
RDebugUtils.currentLine=49741838;
 //BA.debugLineNum = 49741838;BA.debugLine="cx.Position = i";
_cx.setPosition(_i);
RDebugUtils.currentLine=49741839;
 //BA.debugLineNum = 49741839;BA.debugLine="Log(\"***************************************\")";
anywheresoftware.b4a.keywords.Common.LogImpl("049741839","***************************************",0);
RDebugUtils.currentLine=49741840;
 //BA.debugLineNum = 49741840;BA.debugLine="If cx.getstring(\"RECANT\") = \"N\" Then ' Sin prod";
if ((_cx.GetString("RECANT")).equals("N")) { 
RDebugUtils.currentLine=49741841;
 //BA.debugLineNum = 49741841;BA.debugLine="totalParcial = cx.getstring(\"PE_COSTO_TOT\")";
_totalparcial = _cx.GetString("PE_COSTO_TOT");
 }else 
{RDebugUtils.currentLine=49741842;
 //BA.debugLineNum = 49741842;BA.debugLine="else if cx.getstring(\"RECANT\") = cx.getstring(\"";
if ((_cx.GetString("RECANT")).equals(_cx.GetString("PE_CANT"))) { 
RDebugUtils.currentLine=49741843;
 //BA.debugLineNum = 49741843;BA.debugLine="totalParcial = cx.getstring(\"PE_RECALCULOTOT\")";
_totalparcial = _cx.GetString("PE_RECALCULOTOT");
 }else {
RDebugUtils.currentLine=49741845;
 //BA.debugLineNum = 49741845;BA.debugLine="totalParcial = ((cx.getstring(\"PE_CANT\") - cx.";
_totalparcial = BA.NumberToString((((double)(Double.parseDouble(_cx.GetString("PE_CANT")))-(double)(Double.parseDouble(_cx.GetString("PE_RECCANT"))))*(double)(Double.parseDouble(_cx.GetString("PE_COSTOU"))))+((double)(Double.parseDouble(_cx.GetString("PE_RECALCULO")))*(double)(Double.parseDouble(_cx.GetString("PE_RECCANT")))));
RDebugUtils.currentLine=49741846;
 //BA.debugLineNum = 49741846;BA.debugLine="Log($\"${((cx.getstring(\"PE_CANT\") - cx.getstri";
anywheresoftware.b4a.keywords.Common.LogImpl("049741846",(""+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)((((double)(Double.parseDouble(_cx.GetString("PE_CANT")))-(double)(Double.parseDouble(_cx.GetString("PE_RECCANT"))))*(double)(Double.parseDouble(_cx.GetString("PE_COSTOU"))))))+" + "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(((double)(Double.parseDouble(_cx.GetString("PE_RECALCULO")))*(double)(Double.parseDouble(_cx.GetString("PE_RECCANT"))))))+" "),0);
 }}
;
RDebugUtils.currentLine=49741848;
 //BA.debugLineNum = 49741848;BA.debugLine="Log($\"Total:${total} + Total Parcial: ${totalPa";
anywheresoftware.b4a.keywords.Common.LogImpl("049741848",("Total:"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_total))+" + Total Parcial: "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_totalparcial))+""),0);
RDebugUtils.currentLine=49741849;
 //BA.debugLineNum = 49741849;BA.debugLine="total = total + totalParcial";
_total = BA.NumberToString((double)(Double.parseDouble(_total))+(double)(Double.parseDouble(_totalparcial)));
 }
};
 };
RDebugUtils.currentLine=49741852;
 //BA.debugLineNum = 49741852;BA.debugLine="cx.Close";
_cx.Close();
RDebugUtils.currentLine=49741853;
 //BA.debugLineNum = 49741853;BA.debugLine="total = NumberFormat2(total, 1, 2, 2, False)";
_total = anywheresoftware.b4a.keywords.Common.NumberFormat2((double)(Double.parseDouble(_total)),(int) (1),(int) (2),(int) (2),anywheresoftware.b4a.keywords.Common.False);
RDebugUtils.currentLine=49741854;
 //BA.debugLineNum = 49741854;BA.debugLine="Log($\"Total con promocXrango = ${total}\"$)";
anywheresoftware.b4a.keywords.Common.LogImpl("049741854",("Total con promocXrango = "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_total))+""),0);
RDebugUtils.currentLine=49741855;
 //BA.debugLineNum = 49741855;BA.debugLine="Return total";
if (true) return _total;
RDebugUtils.currentLine=49741856;
 //BA.debugLineNum = 49741856;BA.debugLine="End Sub";
return "";
}
public static String  _centrapanel(anywheresoftware.b4a.BA _ba,anywheresoftware.b4a.objects.PanelWrapper _elemento,int _anchoelementosuperior) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "centrapanel", false))
	 {return ((String) Debug.delegate(null, "centrapanel", new Object[] {_ba,_elemento,_anchoelementosuperior}));}
RDebugUtils.currentLine=45416448;
 //BA.debugLineNum = 45416448;BA.debugLine="Sub centraPanel(elemento As Panel, anchoElementoSu";
RDebugUtils.currentLine=45416449;
 //BA.debugLineNum = 45416449;BA.debugLine="elemento.Left = Round(anchoElementoSuperior/2)-(e";
_elemento.setLeft((int) (anywheresoftware.b4a.keywords.Common.Round(_anchoelementosuperior/(double)2)-(_elemento.getWidth()/(double)2)));
RDebugUtils.currentLine=45416450;
 //BA.debugLineNum = 45416450;BA.debugLine="End Sub";
return "";
}
public static String  _centrapanelv(anywheresoftware.b4a.BA _ba,anywheresoftware.b4a.objects.PanelWrapper _elemento,int _altoelementosuperior) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "centrapanelv", false))
	 {return ((String) Debug.delegate(null, "centrapanelv", new Object[] {_ba,_elemento,_altoelementosuperior}));}
RDebugUtils.currentLine=45481984;
 //BA.debugLineNum = 45481984;BA.debugLine="Sub centraPanelV(elemento As Panel, altoElementoSu";
RDebugUtils.currentLine=45481985;
 //BA.debugLineNum = 45481985;BA.debugLine="elemento.Top = Round(altoElementoSuperior/2)-(ele";
_elemento.setTop((int) (anywheresoftware.b4a.keywords.Common.Round(_altoelementosuperior/(double)2)-(_elemento.getHeight()/(double)2)));
RDebugUtils.currentLine=45481986;
 //BA.debugLineNum = 45481986;BA.debugLine="End Sub";
return "";
}
public static String  _guardavariable(anywheresoftware.b4a.BA _ba,String _nombre,String _valor) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "guardavariable", false))
	 {return ((String) Debug.delegate(null, "guardavariable", new Object[] {_ba,_nombre,_valor}));}
RDebugUtils.currentLine=49020928;
 //BA.debugLineNum = 49020928;BA.debugLine="Sub guardaVariable(nombre As String, valor As Stri";
RDebugUtils.currentLine=49020929;
 //BA.debugLineNum = 49020929;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery($\"delete from";
mostCurrent._b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (_ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("delete from CAT_VARIABLES where CAT_VA_DESCRIPCION = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_nombre))+"'"));
RDebugUtils.currentLine=49020930;
 //BA.debugLineNum = 49020930;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery($\"insert into";
mostCurrent._b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (_ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("insert into CAT_VARIABLES (CAT_VA_DESCRIPCION, CAT_VA_VALOR) values ('"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_nombre))+"', '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_valor))+"')"));
RDebugUtils.currentLine=49020931;
 //BA.debugLineNum = 49020931;BA.debugLine="End Sub";
return "";
}
public static anywheresoftware.b4a.objects.collections.Map  _revisaforzaractualizacion(anywheresoftware.b4a.BA _ba) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "revisaforzaractualizacion", false))
	 {return ((anywheresoftware.b4a.objects.collections.Map) Debug.delegate(null, "revisaforzaractualizacion", new Object[] {_ba}));}
anywheresoftware.b4a.sql.SQL.ResultSetWrapper _ra = null;
String _nuevaversion = "";
int _forzaractualizacion = 0;
anywheresoftware.b4a.objects.collections.Map _m = null;
RDebugUtils.currentLine=48431104;
 //BA.debugLineNum = 48431104;BA.debugLine="Sub revisaForzarActualizacion As Map";
RDebugUtils.currentLine=48431105;
 //BA.debugLineNum = 48431105;BA.debugLine="Private ra As ResultSet = Starter.skmt.ExecQuery(";
_ra = new anywheresoftware.b4a.sql.SQL.ResultSetWrapper();
_ra = (anywheresoftware.b4a.sql.SQL.ResultSetWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.ResultSetWrapper(), (android.database.Cursor)(mostCurrent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery(("select * from CAT_VARIABLES where CAT_VA_DESCRIPCION = 'VERSION_NUEVA' or CAT_VA_DESCRIPCION = 'FORZAR_ACTUALIZACION'"))));
RDebugUtils.currentLine=48431106;
 //BA.debugLineNum = 48431106;BA.debugLine="Private nuevaVersion As String = \"\"";
_nuevaversion = "";
RDebugUtils.currentLine=48431107;
 //BA.debugLineNum = 48431107;BA.debugLine="Private forzarActualizacion As Int = 2";
_forzaractualizacion = (int) (2);
RDebugUtils.currentLine=48431108;
 //BA.debugLineNum = 48431108;BA.debugLine="Private m As Map";
_m = new anywheresoftware.b4a.objects.collections.Map();
RDebugUtils.currentLine=48431109;
 //BA.debugLineNum = 48431109;BA.debugLine="m.Initialize";
_m.Initialize();
RDebugUtils.currentLine=48431110;
 //BA.debugLineNum = 48431110;BA.debugLine="Do While ra.NextRow";
while (_ra.NextRow()) {
RDebugUtils.currentLine=48431111;
 //BA.debugLineNum = 48431111;BA.debugLine="If ra.GetString(\"CAT_VA_DESCRIPCION\") = \"VERSION";
if ((_ra.GetString("CAT_VA_DESCRIPCION")).equals("VERSION_NUEVA")) { 
_nuevaversion = _ra.GetString("CAT_VA_VALOR");};
RDebugUtils.currentLine=48431112;
 //BA.debugLineNum = 48431112;BA.debugLine="If ra.GetString(\"CAT_VA_DESCRIPCION\") = \"FORZAR_";
if ((_ra.GetString("CAT_VA_DESCRIPCION")).equals("FORZAR_ACTUALIZACION")) { 
_forzaractualizacion = _ra.GetInt("CAT_VA_VALOR");};
 }
;
RDebugUtils.currentLine=48431116;
 //BA.debugLineNum = 48431116;BA.debugLine="If nuevaVersion <> Application.VersionName And fo";
if ((_nuevaversion).equals(anywheresoftware.b4a.keywords.Common.Application.getVersionName()) == false && _forzaractualizacion==1) { 
RDebugUtils.currentLine=48431117;
 //BA.debugLineNum = 48431117;BA.debugLine="m.Put(\"forzar\", 1)";
_m.Put((Object)("forzar"),(Object)(1));
RDebugUtils.currentLine=48431118;
 //BA.debugLineNum = 48431118;BA.debugLine="m.Put(\"nuevaVersion\", nuevaVersion)";
_m.Put((Object)("nuevaVersion"),(Object)(_nuevaversion));
 }else 
{RDebugUtils.currentLine=48431119;
 //BA.debugLineNum = 48431119;BA.debugLine="else if forzarActualizacion = 2 Then 'Si no exist";
if (_forzaractualizacion==2) { 
RDebugUtils.currentLine=48431120;
 //BA.debugLineNum = 48431120;BA.debugLine="m.Put(\"forzar\", 2)";
_m.Put((Object)("forzar"),(Object)(2));
RDebugUtils.currentLine=48431121;
 //BA.debugLineNum = 48431121;BA.debugLine="m.Put(\"nuevaVersion\", \"Recargar\")";
_m.Put((Object)("nuevaVersion"),(Object)("Recargar"));
 }else {
RDebugUtils.currentLine=48431123;
 //BA.debugLineNum = 48431123;BA.debugLine="m.Put(\"forzar\", 0)";
_m.Put((Object)("forzar"),(Object)(0));
RDebugUtils.currentLine=48431124;
 //BA.debugLineNum = 48431124;BA.debugLine="m.Put(\"nuevaVersion\", nuevaVersion)";
_m.Put((Object)("nuevaVersion"),(Object)(_nuevaversion));
 }}
;
RDebugUtils.currentLine=48431126;
 //BA.debugLineNum = 48431126;BA.debugLine="If nuevaVersion = \"\" Or nuevaVersion = Null Or nu";
if ((_nuevaversion).equals("") || _nuevaversion== null || (_nuevaversion).equals("null")) { 
RDebugUtils.currentLine=48431127;
 //BA.debugLineNum = 48431127;BA.debugLine="m.Put(\"forzar\", 0)";
_m.Put((Object)("forzar"),(Object)(0));
RDebugUtils.currentLine=48431128;
 //BA.debugLineNum = 48431128;BA.debugLine="m.Put(\"nuevaVersion\", \"\")";
_m.Put((Object)("nuevaVersion"),(Object)(""));
 };
RDebugUtils.currentLine=48431130;
 //BA.debugLineNum = 48431130;BA.debugLine="Return m";
if (true) return _m;
RDebugUtils.currentLine=48431131;
 //BA.debugLineNum = 48431131;BA.debugLine="End Sub";
return null;
}
public static String  _logjobdoneresultados(anywheresoftware.b4a.BA _ba,gunav2.keymon.com.mx.dbrequestmanager._dbresult _resultado) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "logjobdoneresultados", false))
	 {return ((String) Debug.delegate(null, "logjobdoneresultados", new Object[] {_ba,_resultado}));}
Object[] _records = null;
String _k = "";
RDebugUtils.currentLine=50200576;
 //BA.debugLineNum = 50200576;BA.debugLine="Sub logJobDoneResultados(resultado As DBResult)";
RDebugUtils.currentLine=50200577;
 //BA.debugLineNum = 50200577;BA.debugLine="For Each records() As Object In resultado.Rows";
{
final anywheresoftware.b4a.BA.IterableList group1 = _resultado.Rows /*anywheresoftware.b4a.objects.collections.List*/ ;
final int groupLen1 = group1.getSize()
;int index1 = 0;
;
for (; index1 < groupLen1;index1++){
_records = (Object[])(group1.Get(index1));
RDebugUtils.currentLine=50200578;
 //BA.debugLineNum = 50200578;BA.debugLine="LogColor($\"====== ${resultado.Tag} - REGISTROS =";
anywheresoftware.b4a.keywords.Common.LogImpl("050200578",("====== "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",_resultado.Tag /*Object*/ )+" - REGISTROS = "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_resultado.Rows /*anywheresoftware.b4a.objects.collections.List*/ .getSize()))+""),anywheresoftware.b4a.keywords.Common.Colors.RGB((int) (215),(int) (37),(int) (0)));
RDebugUtils.currentLine=50200579;
 //BA.debugLineNum = 50200579;BA.debugLine="For Each k As String In resultado.Columns.Keys";
{
final anywheresoftware.b4a.BA.IterableList group3 = _resultado.Columns /*anywheresoftware.b4a.objects.collections.Map*/ .Keys();
final int groupLen3 = group3.getSize()
;int index3 = 0;
;
for (; index3 < groupLen3;index3++){
_k = BA.ObjectToString(group3.Get(index3));
RDebugUtils.currentLine=50200580;
 //BA.debugLineNum = 50200580;BA.debugLine="LogColor(k & \" = \" & records(resultado.Columns.";
anywheresoftware.b4a.keywords.Common.LogImpl("050200580",_k+" = "+BA.ObjectToString(_records[(int)(BA.ObjectToNumber(_resultado.Columns /*anywheresoftware.b4a.objects.collections.Map*/ .Get((Object)(_k))))]),anywheresoftware.b4a.keywords.Common.Colors.RGB((int) (215),(int) (37),(int) (0)));
 }
};
 }
};
RDebugUtils.currentLine=50200583;
 //BA.debugLineNum = 50200583;BA.debugLine="End Sub";
return "";
}
public static int  _traetipocliente(anywheresoftware.b4a.BA _ba) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "traetipocliente", false))
	 {return ((Integer) Debug.delegate(null, "traetipocliente", new Object[] {_ba}));}
anywheresoftware.b4a.sql.SQL.CursorWrapper _x = null;
int _tc = 0;
RDebugUtils.currentLine=49348608;
 //BA.debugLineNum = 49348608;BA.debugLine="Sub traeTipoCliente As Int";
RDebugUtils.currentLine=49348609;
 //BA.debugLineNum = 49348609;BA.debugLine="Private x As Cursor";
_x = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
RDebugUtils.currentLine=49348610;
 //BA.debugLineNum = 49348610;BA.debugLine="Private tc As Int = 3";
_tc = (int) (3);
RDebugUtils.currentLine=49348611;
 //BA.debugLineNum = 49348611;BA.debugLine="x = Starter.skmt.ExecQuery($\"select IFNULL(cat_cl";
_x = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(mostCurrent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery(("select IFNULL(cat_cl_tipocliente,3) AS CAT_CL_TIPOCLIENTE from kmt_info3 where cat_cl_codigo in (select cuenta from cuentaa)"))));
RDebugUtils.currentLine=49348612;
 //BA.debugLineNum = 49348612;BA.debugLine="If x.RowCount > 0 Then";
if (_x.getRowCount()>0) { 
RDebugUtils.currentLine=49348613;
 //BA.debugLineNum = 49348613;BA.debugLine="x.Position = 0";
_x.setPosition((int) (0));
RDebugUtils.currentLine=49348615;
 //BA.debugLineNum = 49348615;BA.debugLine="tc = x.GetInt(\"CAT_CL_TIPOCLIENTE\")";
_tc = _x.GetInt("CAT_CL_TIPOCLIENTE");
 };
RDebugUtils.currentLine=49348618;
 //BA.debugLineNum = 49348618;BA.debugLine="Return tc";
if (true) return _tc;
RDebugUtils.currentLine=49348619;
 //BA.debugLineNum = 49348619;BA.debugLine="End Sub";
return 0;
}
public static String  _calculatotalconpromoxrango1(anywheresoftware.b4a.BA _ba,String _idcliente) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "calculatotalconpromoxrango1", false))
	 {return ((String) Debug.delegate(null, "calculatotalconpromoxrango1", new Object[] {_ba,_idcliente}));}
String _totalparcial = "";
String _total = "";
anywheresoftware.b4a.sql.SQL.CursorWrapper _cx = null;
int _i = 0;
RDebugUtils.currentLine=49807360;
 //BA.debugLineNum = 49807360;BA.debugLine="Sub calculaTotalConPromoXRango1(idCliente As Strin";
RDebugUtils.currentLine=49807368;
 //BA.debugLineNum = 49807368;BA.debugLine="Private totalParcial As String = 0";
_totalparcial = BA.NumberToString(0);
RDebugUtils.currentLine=49807369;
 //BA.debugLineNum = 49807369;BA.debugLine="Private total As String = 0";
_total = BA.NumberToString(0);
RDebugUtils.currentLine=49807370;
 //BA.debugLineNum = 49807370;BA.debugLine="Private cx As Cursor = Starter.skmt.ExecQuery($\"s";
_cx = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_cx = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(mostCurrent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery(("select *, ifnull(pe_reccant, 'N') as RECANT from pedido where pe_cliente = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_idcliente))+"' and PE_FUTURO = '1' "))));
RDebugUtils.currentLine=49807371;
 //BA.debugLineNum = 49807371;BA.debugLine="If cx.RowCount > 0 Then";
if (_cx.getRowCount()>0) { 
RDebugUtils.currentLine=49807372;
 //BA.debugLineNum = 49807372;BA.debugLine="For i = 0 To cx.RowCount - 1";
{
final int step5 = 1;
final int limit5 = (int) (_cx.getRowCount()-1);
_i = (int) (0) ;
for (;_i <= limit5 ;_i = _i + step5 ) {
RDebugUtils.currentLine=49807374;
 //BA.debugLineNum = 49807374;BA.debugLine="cx.Position = i";
_cx.setPosition(_i);
RDebugUtils.currentLine=49807376;
 //BA.debugLineNum = 49807376;BA.debugLine="If cx.getstring(\"RECANT\") = \"N\" Then ' Sin prod";
if ((_cx.GetString("RECANT")).equals("N")) { 
RDebugUtils.currentLine=49807377;
 //BA.debugLineNum = 49807377;BA.debugLine="totalParcial = cx.getstring(\"PE_COSTO_TOT\")";
_totalparcial = _cx.GetString("PE_COSTO_TOT");
 }else 
{RDebugUtils.currentLine=49807378;
 //BA.debugLineNum = 49807378;BA.debugLine="else if cx.getstring(\"RECANT\") = cx.getstring(\"";
if ((_cx.GetString("RECANT")).equals(_cx.GetString("PE_CANT"))) { 
RDebugUtils.currentLine=49807379;
 //BA.debugLineNum = 49807379;BA.debugLine="totalParcial = cx.getstring(\"PE_RECALCULOTOT\")";
_totalparcial = _cx.GetString("PE_RECALCULOTOT");
 }else {
RDebugUtils.currentLine=49807381;
 //BA.debugLineNum = 49807381;BA.debugLine="totalParcial = ((cx.getstring(\"PE_CANT\") - cx.";
_totalparcial = BA.NumberToString((((double)(Double.parseDouble(_cx.GetString("PE_CANT")))-(double)(Double.parseDouble(_cx.GetString("PE_RECCANT"))))*(double)(Double.parseDouble(_cx.GetString("PE_COSTOU"))))+((double)(Double.parseDouble(_cx.GetString("PE_RECALCULO")))*(double)(Double.parseDouble(_cx.GetString("PE_RECCANT")))));
RDebugUtils.currentLine=49807382;
 //BA.debugLineNum = 49807382;BA.debugLine="Log($\"${((cx.getstring(\"PE_CANT\") - cx.getstri";
anywheresoftware.b4a.keywords.Common.LogImpl("049807382",(""+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)((((double)(Double.parseDouble(_cx.GetString("PE_CANT")))-(double)(Double.parseDouble(_cx.GetString("PE_RECCANT"))))*(double)(Double.parseDouble(_cx.GetString("PE_COSTOU"))))))+" + "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(((double)(Double.parseDouble(_cx.GetString("PE_RECALCULO")))*(double)(Double.parseDouble(_cx.GetString("PE_RECCANT"))))))+" "),0);
 }}
;
RDebugUtils.currentLine=49807385;
 //BA.debugLineNum = 49807385;BA.debugLine="total = total + totalParcial";
_total = BA.NumberToString((double)(Double.parseDouble(_total))+(double)(Double.parseDouble(_totalparcial)));
 }
};
 };
RDebugUtils.currentLine=49807388;
 //BA.debugLineNum = 49807388;BA.debugLine="cx.Close";
_cx.Close();
RDebugUtils.currentLine=49807389;
 //BA.debugLineNum = 49807389;BA.debugLine="total = NumberFormat2(total, 1, 2, 2, False)";
_total = anywheresoftware.b4a.keywords.Common.NumberFormat2((double)(Double.parseDouble(_total)),(int) (1),(int) (2),(int) (2),anywheresoftware.b4a.keywords.Common.False);
RDebugUtils.currentLine=49807391;
 //BA.debugLineNum = 49807391;BA.debugLine="Return total";
if (true) return _total;
RDebugUtils.currentLine=49807392;
 //BA.debugLineNum = 49807392;BA.debugLine="End Sub";
return "";
}
public static String  _calculatotalconpromoxrango2(anywheresoftware.b4a.BA _ba,String _idcliente) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "calculatotalconpromoxrango2", false))
	 {return ((String) Debug.delegate(null, "calculatotalconpromoxrango2", new Object[] {_ba,_idcliente}));}
String _totalparcial = "";
String _total = "";
anywheresoftware.b4a.sql.SQL.CursorWrapper _cx = null;
int _i = 0;
RDebugUtils.currentLine=49872896;
 //BA.debugLineNum = 49872896;BA.debugLine="Sub calculaTotalConPromoXRango2(idCliente As Strin";
RDebugUtils.currentLine=49872904;
 //BA.debugLineNum = 49872904;BA.debugLine="Private totalParcial As String = 0";
_totalparcial = BA.NumberToString(0);
RDebugUtils.currentLine=49872905;
 //BA.debugLineNum = 49872905;BA.debugLine="Private total As String = 0";
_total = BA.NumberToString(0);
RDebugUtils.currentLine=49872906;
 //BA.debugLineNum = 49872906;BA.debugLine="Private cx As Cursor = Starter.skmt.ExecQuery($\"s";
_cx = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_cx = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(mostCurrent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery(("select *, ifnull(pe_reccant, 'N') as RECANT from pedido where pe_cliente = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_idcliente))+"' and PE_FUTURO = '0'  "))));
RDebugUtils.currentLine=49872907;
 //BA.debugLineNum = 49872907;BA.debugLine="If cx.RowCount > 0 Then";
if (_cx.getRowCount()>0) { 
RDebugUtils.currentLine=49872908;
 //BA.debugLineNum = 49872908;BA.debugLine="For i = 0 To cx.RowCount - 1";
{
final int step5 = 1;
final int limit5 = (int) (_cx.getRowCount()-1);
_i = (int) (0) ;
for (;_i <= limit5 ;_i = _i + step5 ) {
RDebugUtils.currentLine=49872910;
 //BA.debugLineNum = 49872910;BA.debugLine="cx.Position = i";
_cx.setPosition(_i);
RDebugUtils.currentLine=49872911;
 //BA.debugLineNum = 49872911;BA.debugLine="Log(\"***************************************\")";
anywheresoftware.b4a.keywords.Common.LogImpl("049872911","***************************************",0);
RDebugUtils.currentLine=49872912;
 //BA.debugLineNum = 49872912;BA.debugLine="If cx.getstring(\"RECANT\") = \"N\" Then ' Sin prod";
if ((_cx.GetString("RECANT")).equals("N")) { 
RDebugUtils.currentLine=49872913;
 //BA.debugLineNum = 49872913;BA.debugLine="totalParcial = cx.getstring(\"PE_COSTO_TOT\")";
_totalparcial = _cx.GetString("PE_COSTO_TOT");
 }else 
{RDebugUtils.currentLine=49872914;
 //BA.debugLineNum = 49872914;BA.debugLine="else if cx.getstring(\"RECANT\") = cx.getstring(\"";
if ((_cx.GetString("RECANT")).equals(_cx.GetString("PE_CANT"))) { 
RDebugUtils.currentLine=49872915;
 //BA.debugLineNum = 49872915;BA.debugLine="totalParcial = cx.getstring(\"PE_RECALCULOTOT\")";
_totalparcial = _cx.GetString("PE_RECALCULOTOT");
 }else {
RDebugUtils.currentLine=49872917;
 //BA.debugLineNum = 49872917;BA.debugLine="totalParcial = ((cx.getstring(\"PE_CANT\") - cx.";
_totalparcial = BA.NumberToString((((double)(Double.parseDouble(_cx.GetString("PE_CANT")))-(double)(Double.parseDouble(_cx.GetString("PE_RECCANT"))))*(double)(Double.parseDouble(_cx.GetString("PE_COSTOU"))))+((double)(Double.parseDouble(_cx.GetString("PE_RECALCULO")))*(double)(Double.parseDouble(_cx.GetString("PE_RECCANT")))));
RDebugUtils.currentLine=49872918;
 //BA.debugLineNum = 49872918;BA.debugLine="Log($\"${((cx.getstring(\"PE_CANT\") - cx.getstri";
anywheresoftware.b4a.keywords.Common.LogImpl("049872918",(""+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)((((double)(Double.parseDouble(_cx.GetString("PE_CANT")))-(double)(Double.parseDouble(_cx.GetString("PE_RECCANT"))))*(double)(Double.parseDouble(_cx.GetString("PE_COSTOU"))))))+" + "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(((double)(Double.parseDouble(_cx.GetString("PE_RECALCULO")))*(double)(Double.parseDouble(_cx.GetString("PE_RECCANT"))))))+" "),0);
 }}
;
RDebugUtils.currentLine=49872920;
 //BA.debugLineNum = 49872920;BA.debugLine="Log($\"Total:${total} + Total Parcial: ${totalPa";
anywheresoftware.b4a.keywords.Common.LogImpl("049872920",("Total:"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_total))+" + Total Parcial: "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_totalparcial))+""),0);
RDebugUtils.currentLine=49872921;
 //BA.debugLineNum = 49872921;BA.debugLine="total = total + totalParcial";
_total = BA.NumberToString((double)(Double.parseDouble(_total))+(double)(Double.parseDouble(_totalparcial)));
 }
};
 };
RDebugUtils.currentLine=49872924;
 //BA.debugLineNum = 49872924;BA.debugLine="cx.Close";
_cx.Close();
RDebugUtils.currentLine=49872925;
 //BA.debugLineNum = 49872925;BA.debugLine="total = NumberFormat2(total, 1, 2, 2, False)";
_total = anywheresoftware.b4a.keywords.Common.NumberFormat2((double)(Double.parseDouble(_total)),(int) (1),(int) (2),(int) (2),anywheresoftware.b4a.keywords.Common.False);
RDebugUtils.currentLine=49872926;
 //BA.debugLineNum = 49872926;BA.debugLine="Log($\"Total con promocXrango = ${total}\"$)";
anywheresoftware.b4a.keywords.Common.LogImpl("049872926",("Total con promocXrango = "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_total))+""),0);
RDebugUtils.currentLine=49872927;
 //BA.debugLineNum = 49872927;BA.debugLine="Return total";
if (true) return _total;
RDebugUtils.currentLine=49872928;
 //BA.debugLineNum = 49872928;BA.debugLine="End Sub";
return "";
}
public static String  _traecliente(anywheresoftware.b4a.BA _ba) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "traecliente", false))
	 {return ((String) Debug.delegate(null, "traecliente", new Object[] {_ba}));}
anywheresoftware.b4a.sql.SQL.CursorWrapper _c = null;
String _cl = "";
RDebugUtils.currentLine=46530560;
 //BA.debugLineNum = 46530560;BA.debugLine="Sub traeCliente As String 'ignore";
RDebugUtils.currentLine=46530561;
 //BA.debugLineNum = 46530561;BA.debugLine="Private c As Cursor";
_c = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
RDebugUtils.currentLine=46530562;
 //BA.debugLineNum = 46530562;BA.debugLine="Private cl As String";
_cl = "";
RDebugUtils.currentLine=46530563;
 //BA.debugLineNum = 46530563;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"Select CUENTA";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(mostCurrent._b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (_ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("Select CUENTA from cuentaa")));
RDebugUtils.currentLine=46530564;
 //BA.debugLineNum = 46530564;BA.debugLine="If c.RowCount > 0 Then";
if (_c.getRowCount()>0) { 
RDebugUtils.currentLine=46530565;
 //BA.debugLineNum = 46530565;BA.debugLine="c.Position=0";
_c.setPosition((int) (0));
RDebugUtils.currentLine=46530566;
 //BA.debugLineNum = 46530566;BA.debugLine="cl = c.GetString(\"CUENTA\")";
_cl = _c.GetString("CUENTA");
 };
RDebugUtils.currentLine=46530568;
 //BA.debugLineNum = 46530568;BA.debugLine="c.Close";
_c.Close();
RDebugUtils.currentLine=46530570;
 //BA.debugLineNum = 46530570;BA.debugLine="Return cl";
if (true) return _cl;
RDebugUtils.currentLine=46530571;
 //BA.debugLineNum = 46530571;BA.debugLine="End Sub";
return "";
}
public static String  _calculatotalconpromoxrango5(anywheresoftware.b4a.BA _ba,String _idcliente) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "calculatotalconpromoxrango5", false))
	 {return ((String) Debug.delegate(null, "calculatotalconpromoxrango5", new Object[] {_ba,_idcliente}));}
String _totalparcial = "";
String _total = "";
anywheresoftware.b4a.sql.SQL.CursorWrapper _cx = null;
int _i = 0;
RDebugUtils.currentLine=50069504;
 //BA.debugLineNum = 50069504;BA.debugLine="Sub calculaTotalConPromoXRango5(idCliente As Strin";
RDebugUtils.currentLine=50069512;
 //BA.debugLineNum = 50069512;BA.debugLine="Private totalParcial As String = 0";
_totalparcial = BA.NumberToString(0);
RDebugUtils.currentLine=50069513;
 //BA.debugLineNum = 50069513;BA.debugLine="Private total As String = 0";
_total = BA.NumberToString(0);
RDebugUtils.currentLine=50069514;
 //BA.debugLineNum = 50069514;BA.debugLine="Private cx As Cursor = Starter.skmt.ExecQuery($\"s";
_cx = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_cx = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(mostCurrent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery(("select *, ifnull(pe_reccant, 'N') as RECANT from pedido where pe_cliente = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_idcliente))+"' and PE_PROID IN (SELECT CAT_GP_ID FROM CAT_GUNAPROD WHERE CAT_GP_TIPO = 'CIGARRO')"))));
RDebugUtils.currentLine=50069515;
 //BA.debugLineNum = 50069515;BA.debugLine="If cx.RowCount > 0 Then";
if (_cx.getRowCount()>0) { 
RDebugUtils.currentLine=50069516;
 //BA.debugLineNum = 50069516;BA.debugLine="For i = 0 To cx.RowCount - 1";
{
final int step5 = 1;
final int limit5 = (int) (_cx.getRowCount()-1);
_i = (int) (0) ;
for (;_i <= limit5 ;_i = _i + step5 ) {
RDebugUtils.currentLine=50069518;
 //BA.debugLineNum = 50069518;BA.debugLine="cx.Position = i";
_cx.setPosition(_i);
RDebugUtils.currentLine=50069520;
 //BA.debugLineNum = 50069520;BA.debugLine="If cx.getstring(\"RECANT\") = \"N\" Then ' Sin prod";
if ((_cx.GetString("RECANT")).equals("N")) { 
RDebugUtils.currentLine=50069521;
 //BA.debugLineNum = 50069521;BA.debugLine="totalParcial = cx.getstring(\"PE_COSTO_TOT\")";
_totalparcial = _cx.GetString("PE_COSTO_TOT");
 }else 
{RDebugUtils.currentLine=50069522;
 //BA.debugLineNum = 50069522;BA.debugLine="else if cx.getstring(\"RECANT\") = cx.getstring(\"";
if ((_cx.GetString("RECANT")).equals(_cx.GetString("PE_CANT"))) { 
RDebugUtils.currentLine=50069523;
 //BA.debugLineNum = 50069523;BA.debugLine="totalParcial = cx.getstring(\"PE_RECALCULOTOT\")";
_totalparcial = _cx.GetString("PE_RECALCULOTOT");
 }else {
RDebugUtils.currentLine=50069525;
 //BA.debugLineNum = 50069525;BA.debugLine="totalParcial = ((cx.getstring(\"PE_CANT\") - cx.";
_totalparcial = BA.NumberToString((((double)(Double.parseDouble(_cx.GetString("PE_CANT")))-(double)(Double.parseDouble(_cx.GetString("PE_RECCANT"))))*(double)(Double.parseDouble(_cx.GetString("PE_COSTOU"))))+((double)(Double.parseDouble(_cx.GetString("PE_RECALCULO")))*(double)(Double.parseDouble(_cx.GetString("PE_RECCANT")))));
RDebugUtils.currentLine=50069526;
 //BA.debugLineNum = 50069526;BA.debugLine="Log($\"${((cx.getstring(\"PE_CANT\") - cx.getstri";
anywheresoftware.b4a.keywords.Common.LogImpl("050069526",(""+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)((((double)(Double.parseDouble(_cx.GetString("PE_CANT")))-(double)(Double.parseDouble(_cx.GetString("PE_RECCANT"))))*(double)(Double.parseDouble(_cx.GetString("PE_COSTOU"))))))+" + "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(((double)(Double.parseDouble(_cx.GetString("PE_RECALCULO")))*(double)(Double.parseDouble(_cx.GetString("PE_RECCANT"))))))+" "),0);
 }}
;
RDebugUtils.currentLine=50069529;
 //BA.debugLineNum = 50069529;BA.debugLine="total = total + totalParcial";
_total = BA.NumberToString((double)(Double.parseDouble(_total))+(double)(Double.parseDouble(_totalparcial)));
 }
};
 };
RDebugUtils.currentLine=50069532;
 //BA.debugLineNum = 50069532;BA.debugLine="cx.Close";
_cx.Close();
RDebugUtils.currentLine=50069533;
 //BA.debugLineNum = 50069533;BA.debugLine="total = NumberFormat2(total, 1, 2, 2, False)";
_total = anywheresoftware.b4a.keywords.Common.NumberFormat2((double)(Double.parseDouble(_total)),(int) (1),(int) (2),(int) (2),anywheresoftware.b4a.keywords.Common.False);
RDebugUtils.currentLine=50069535;
 //BA.debugLineNum = 50069535;BA.debugLine="Return total";
if (true) return _total;
RDebugUtils.currentLine=50069536;
 //BA.debugLineNum = 50069536;BA.debugLine="End Sub";
return "";
}
public static String  _calculatotalconpromoxrango6(anywheresoftware.b4a.BA _ba,String _idcliente) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "calculatotalconpromoxrango6", false))
	 {return ((String) Debug.delegate(null, "calculatotalconpromoxrango6", new Object[] {_ba,_idcliente}));}
String _totalparcial = "";
String _total = "";
anywheresoftware.b4a.sql.SQL.CursorWrapper _cx = null;
int _i = 0;
RDebugUtils.currentLine=50135040;
 //BA.debugLineNum = 50135040;BA.debugLine="Sub calculaTotalConPromoXRango6(idCliente As Strin";
RDebugUtils.currentLine=50135048;
 //BA.debugLineNum = 50135048;BA.debugLine="Private totalParcial As String = 0";
_totalparcial = BA.NumberToString(0);
RDebugUtils.currentLine=50135049;
 //BA.debugLineNum = 50135049;BA.debugLine="Private total As String = 0";
_total = BA.NumberToString(0);
RDebugUtils.currentLine=50135050;
 //BA.debugLineNum = 50135050;BA.debugLine="Private cx As Cursor = Starter.skmt.ExecQuery($\"s";
_cx = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_cx = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(mostCurrent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery(("select *, ifnull(pe_reccant, 'N') as RECANT from pedido where pe_cliente = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_idcliente))+"' AND PE_PROID IN (SELECT CAT_GP_ID FROM CAT_GUNAPROD WHERE CAT_GP_TIPO = 'PARTNERSHIP') "))));
RDebugUtils.currentLine=50135051;
 //BA.debugLineNum = 50135051;BA.debugLine="If cx.RowCount > 0 Then";
if (_cx.getRowCount()>0) { 
RDebugUtils.currentLine=50135052;
 //BA.debugLineNum = 50135052;BA.debugLine="For i = 0 To cx.RowCount - 1";
{
final int step5 = 1;
final int limit5 = (int) (_cx.getRowCount()-1);
_i = (int) (0) ;
for (;_i <= limit5 ;_i = _i + step5 ) {
RDebugUtils.currentLine=50135054;
 //BA.debugLineNum = 50135054;BA.debugLine="cx.Position = i";
_cx.setPosition(_i);
RDebugUtils.currentLine=50135055;
 //BA.debugLineNum = 50135055;BA.debugLine="Log(\"***************************************\")";
anywheresoftware.b4a.keywords.Common.LogImpl("050135055","***************************************",0);
RDebugUtils.currentLine=50135056;
 //BA.debugLineNum = 50135056;BA.debugLine="If cx.getstring(\"RECANT\") = \"N\" Then ' Sin prod";
if ((_cx.GetString("RECANT")).equals("N")) { 
RDebugUtils.currentLine=50135057;
 //BA.debugLineNum = 50135057;BA.debugLine="totalParcial = cx.getstring(\"PE_COSTO_TOT\")";
_totalparcial = _cx.GetString("PE_COSTO_TOT");
 }else 
{RDebugUtils.currentLine=50135058;
 //BA.debugLineNum = 50135058;BA.debugLine="else if cx.getstring(\"RECANT\") = cx.getstring(\"";
if ((_cx.GetString("RECANT")).equals(_cx.GetString("PE_CANT"))) { 
RDebugUtils.currentLine=50135059;
 //BA.debugLineNum = 50135059;BA.debugLine="totalParcial = cx.getstring(\"PE_RECALCULOTOT\")";
_totalparcial = _cx.GetString("PE_RECALCULOTOT");
 }else {
RDebugUtils.currentLine=50135061;
 //BA.debugLineNum = 50135061;BA.debugLine="totalParcial = ((cx.getstring(\"PE_CANT\") - cx.";
_totalparcial = BA.NumberToString((((double)(Double.parseDouble(_cx.GetString("PE_CANT")))-(double)(Double.parseDouble(_cx.GetString("PE_RECCANT"))))*(double)(Double.parseDouble(_cx.GetString("PE_COSTOU"))))+((double)(Double.parseDouble(_cx.GetString("PE_RECALCULO")))*(double)(Double.parseDouble(_cx.GetString("PE_RECCANT")))));
RDebugUtils.currentLine=50135062;
 //BA.debugLineNum = 50135062;BA.debugLine="Log($\"${((cx.getstring(\"PE_CANT\") - cx.getstri";
anywheresoftware.b4a.keywords.Common.LogImpl("050135062",(""+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)((((double)(Double.parseDouble(_cx.GetString("PE_CANT")))-(double)(Double.parseDouble(_cx.GetString("PE_RECCANT"))))*(double)(Double.parseDouble(_cx.GetString("PE_COSTOU"))))))+" + "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(((double)(Double.parseDouble(_cx.GetString("PE_RECALCULO")))*(double)(Double.parseDouble(_cx.GetString("PE_RECCANT"))))))+" "),0);
 }}
;
RDebugUtils.currentLine=50135064;
 //BA.debugLineNum = 50135064;BA.debugLine="Log($\"Total:${total} + Total Parcial: ${totalPa";
anywheresoftware.b4a.keywords.Common.LogImpl("050135064",("Total:"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_total))+" + Total Parcial: "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_totalparcial))+""),0);
RDebugUtils.currentLine=50135065;
 //BA.debugLineNum = 50135065;BA.debugLine="total = total + totalParcial";
_total = BA.NumberToString((double)(Double.parseDouble(_total))+(double)(Double.parseDouble(_totalparcial)));
 }
};
 };
RDebugUtils.currentLine=50135068;
 //BA.debugLineNum = 50135068;BA.debugLine="cx.Close";
_cx.Close();
RDebugUtils.currentLine=50135069;
 //BA.debugLineNum = 50135069;BA.debugLine="total = NumberFormat2(total, 1, 2, 2, False)";
_total = anywheresoftware.b4a.keywords.Common.NumberFormat2((double)(Double.parseDouble(_total)),(int) (1),(int) (2),(int) (2),anywheresoftware.b4a.keywords.Common.False);
RDebugUtils.currentLine=50135070;
 //BA.debugLineNum = 50135070;BA.debugLine="Log($\"Total con promocXrango = ${total}\"$)";
anywheresoftware.b4a.keywords.Common.LogImpl("050135070",("Total con promocXrango = "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_total))+""),0);
RDebugUtils.currentLine=50135071;
 //BA.debugLineNum = 50135071;BA.debugLine="Return total";
if (true) return _total;
RDebugUtils.currentLine=50135072;
 //BA.debugLineNum = 50135072;BA.debugLine="End Sub";
return "";
}
public static String  _traeruta2(anywheresoftware.b4a.BA _ba,String _cliente) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "traeruta2", false))
	 {return ((String) Debug.delegate(null, "traeruta2", new Object[] {_ba,_cliente}));}
anywheresoftware.b4a.sql.SQL.CursorWrapper _c = null;
String _r = "";
RDebugUtils.currentLine=46333952;
 //BA.debugLineNum = 46333952;BA.debugLine="Sub traeRuta2 (cliente As String) As String 'ignor";
RDebugUtils.currentLine=46333953;
 //BA.debugLineNum = 46333953;BA.debugLine="Private c As Cursor";
_c = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
RDebugUtils.currentLine=46333954;
 //BA.debugLineNum = 46333954;BA.debugLine="Private r As String";
_r = "";
RDebugUtils.currentLine=46333955;
 //BA.debugLineNum = 46333955;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery($\"select CAT_C";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(mostCurrent._b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (_ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery(("select CAT_CL_RUTA from kmt_info3 where CAT_CL_CODIGO = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_cliente))+"'"))));
RDebugUtils.currentLine=46333956;
 //BA.debugLineNum = 46333956;BA.debugLine="r = \"0\"";
_r = "0";
RDebugUtils.currentLine=46333957;
 //BA.debugLineNum = 46333957;BA.debugLine="If c.RowCount > 0 Then";
if (_c.getRowCount()>0) { 
RDebugUtils.currentLine=46333958;
 //BA.debugLineNum = 46333958;BA.debugLine="c.Position=0";
_c.setPosition((int) (0));
RDebugUtils.currentLine=46333959;
 //BA.debugLineNum = 46333959;BA.debugLine="r = c.GetString(\"CAT_CL_RUTA\")";
_r = _c.GetString("CAT_CL_RUTA");
 };
RDebugUtils.currentLine=46333961;
 //BA.debugLineNum = 46333961;BA.debugLine="c.Close";
_c.Close();
RDebugUtils.currentLine=46333962;
 //BA.debugLineNum = 46333962;BA.debugLine="Return r";
if (true) return _r;
RDebugUtils.currentLine=46333963;
 //BA.debugLineNum = 46333963;BA.debugLine="End Sub";
return "";
}
public static String  _traenombrecliente(anywheresoftware.b4a.BA _ba,String _id) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "traenombrecliente", false))
	 {return ((String) Debug.delegate(null, "traenombrecliente", new Object[] {_ba,_id}));}
anywheresoftware.b4a.sql.SQL.ResultSetWrapper _c = null;
String _n = "";
RDebugUtils.currentLine=47972352;
 //BA.debugLineNum = 47972352;BA.debugLine="Sub traeNombreCliente(id As String) As String";
RDebugUtils.currentLine=47972353;
 //BA.debugLineNum = 47972353;BA.debugLine="Private c As ResultSet = B4XPages.MainPage.skmt.E";
_c = new anywheresoftware.b4a.sql.SQL.ResultSetWrapper();
_c = (anywheresoftware.b4a.sql.SQL.ResultSetWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.ResultSetWrapper(), (android.database.Cursor)(mostCurrent._b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (_ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery(("select CAT_CL_NOMBRE from kmt_info3 where CAT_CL_CODIGO = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_id))+"'"))));
RDebugUtils.currentLine=47972354;
 //BA.debugLineNum = 47972354;BA.debugLine="Private n As String = \"N/A\"";
_n = "N/A";
RDebugUtils.currentLine=47972355;
 //BA.debugLineNum = 47972355;BA.debugLine="Do While c.NextRow";
while (_c.NextRow()) {
RDebugUtils.currentLine=47972356;
 //BA.debugLineNum = 47972356;BA.debugLine="n = c.GetString(\"CAT_CL_NOMBRE\")";
_n = _c.GetString("CAT_CL_NOMBRE");
 }
;
RDebugUtils.currentLine=47972358;
 //BA.debugLineNum = 47972358;BA.debugLine="Return n";
if (true) return _n;
RDebugUtils.currentLine=47972359;
 //BA.debugLineNum = 47972359;BA.debugLine="End Sub";
return "";
}
public static String  _traerutassup(anywheresoftware.b4a.BA _ba) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "traerutassup", false))
	 {return ((String) Debug.delegate(null, "traerutassup", new Object[] {_ba}));}
anywheresoftware.b4a.sql.SQL.CursorWrapper _c = null;
String _rutas = "";
int _i = 0;
RDebugUtils.currentLine=46465024;
 //BA.debugLineNum = 46465024;BA.debugLine="Sub traeRutasSup As String";
RDebugUtils.currentLine=46465025;
 //BA.debugLineNum = 46465025;BA.debugLine="Dim c As Cursor";
_c = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
RDebugUtils.currentLine=46465026;
 //BA.debugLineNum = 46465026;BA.debugLine="Dim rutas As String";
_rutas = "";
RDebugUtils.currentLine=46465027;
 //BA.debugLineNum = 46465027;BA.debugLine="rutas = \"\"";
_rutas = "";
RDebugUtils.currentLine=46465029;
 //BA.debugLineNum = 46465029;BA.debugLine="c = B4XPages.MainPage.skmt.ExecQuery(\"SELECT CAT_";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(mostCurrent._b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (_ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("SELECT CAT_CL_RUTA FROM kmt_info3")));
RDebugUtils.currentLine=46465031;
 //BA.debugLineNum = 46465031;BA.debugLine="If c.RowCount > 0 Then";
if (_c.getRowCount()>0) { 
RDebugUtils.currentLine=46465032;
 //BA.debugLineNum = 46465032;BA.debugLine="For i = 0 To c.RowCount - 1";
{
final int step6 = 1;
final int limit6 = (int) (_c.getRowCount()-1);
_i = (int) (0) ;
for (;_i <= limit6 ;_i = _i + step6 ) {
RDebugUtils.currentLine=46465033;
 //BA.debugLineNum = 46465033;BA.debugLine="c.Position = i";
_c.setPosition(_i);
RDebugUtils.currentLine=46465034;
 //BA.debugLineNum = 46465034;BA.debugLine="rutas = rutas & c.GetString(\"CAT_CL_RUTA\") & \",";
_rutas = _rutas+_c.GetString("CAT_CL_RUTA")+", ";
 }
};
RDebugUtils.currentLine=46465036;
 //BA.debugLineNum = 46465036;BA.debugLine="If rutas.Length > 0 Then rutas = rutas.SubString";
if (_rutas.length()>0) { 
_rutas = _rutas.substring((int) (0),(int) (_rutas.length()-2));};
 };
RDebugUtils.currentLine=46465039;
 //BA.debugLineNum = 46465039;BA.debugLine="c.Close";
_c.Close();
RDebugUtils.currentLine=46465040;
 //BA.debugLineNum = 46465040;BA.debugLine="Return rutas";
if (true) return _rutas;
RDebugUtils.currentLine=46465041;
 //BA.debugLineNum = 46465041;BA.debugLine="End Sub";
return "";
}
public static String  _deletefolder(anywheresoftware.b4a.BA _ba,String _folder) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "deletefolder", false))
	 {return ((String) Debug.delegate(null, "deletefolder", new Object[] {_ba,_folder}));}
String _f = "";
RDebugUtils.currentLine=49217536;
 //BA.debugLineNum = 49217536;BA.debugLine="Sub deleteFolder(folder As String)";
RDebugUtils.currentLine=49217537;
 //BA.debugLineNum = 49217537;BA.debugLine="Log(\"Borrando \" & folder)";
anywheresoftware.b4a.keywords.Common.LogImpl("049217537","Borrando "+_folder,0);
RDebugUtils.currentLine=49217538;
 //BA.debugLineNum = 49217538;BA.debugLine="For Each f As String In File.ListFiles(folder)";
{
final anywheresoftware.b4a.BA.IterableList group2 = anywheresoftware.b4a.keywords.Common.File.ListFiles(_folder);
final int groupLen2 = group2.getSize()
;int index2 = 0;
;
for (; index2 < groupLen2;index2++){
_f = BA.ObjectToString(group2.Get(index2));
RDebugUtils.currentLine=49217539;
 //BA.debugLineNum = 49217539;BA.debugLine="Log(f)";
anywheresoftware.b4a.keywords.Common.LogImpl("049217539",_f,0);
RDebugUtils.currentLine=49217540;
 //BA.debugLineNum = 49217540;BA.debugLine="If File.IsDirectory(folder, f) Then";
if (anywheresoftware.b4a.keywords.Common.File.IsDirectory(_folder,_f)) { 
RDebugUtils.currentLine=49217541;
 //BA.debugLineNum = 49217541;BA.debugLine="deleteFolder(File.Combine(folder, f))";
_deletefolder(_ba,anywheresoftware.b4a.keywords.Common.File.Combine(_folder,_f));
RDebugUtils.currentLine=49217542;
 //BA.debugLineNum = 49217542;BA.debugLine="Log($\"Borramos ${File.Combine(folder, f)}\"$)";
anywheresoftware.b4a.keywords.Common.LogImpl("049217542",("Borramos "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(anywheresoftware.b4a.keywords.Common.File.Combine(_folder,_f)))+""),0);
 };
RDebugUtils.currentLine=49217544;
 //BA.debugLineNum = 49217544;BA.debugLine="File.Delete(folder, f)";
anywheresoftware.b4a.keywords.Common.File.Delete(_folder,_f);
 }
};
RDebugUtils.currentLine=49217546;
 //BA.debugLineNum = 49217546;BA.debugLine="End Sub";
return "";
}
public static String  _actualizaproducto(anywheresoftware.b4a.BA _ba,String _cedis,String _costou,String _cant,String _nombre,String _prodid,String _clienteid,String _fecha,String _usuario,String _rutav,String _preciosin,String _tipoventa,String _dev,String _futuro) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "actualizaproducto", false))
	 {return ((String) Debug.delegate(null, "actualizaproducto", new Object[] {_ba,_cedis,_costou,_cant,_nombre,_prodid,_clienteid,_fecha,_usuario,_rutav,_preciosin,_tipoventa,_dev,_futuro}));}
anywheresoftware.b4a.sql.SQL.CursorWrapper _c = null;
int _antcant = 0;
int _difcant = 0;
anywheresoftware.b4a.sql.SQL.CursorWrapper _pe = null;
RDebugUtils.currentLine=48693248;
 //BA.debugLineNum = 48693248;BA.debugLine="Sub actualizaProducto(cedis As String, costoU As S";
RDebugUtils.currentLine=48693249;
 //BA.debugLineNum = 48693249;BA.debugLine="If nombre.Length < 6 Then ToastMessageShow(\"(actu";
if (_nombre.length()<6) { 
anywheresoftware.b4a.keywords.Common.ToastMessageShow(BA.ObjectToCharSequence("(actualizaProducto) El nombre del producto no es valido "+_nombre),anywheresoftware.b4a.keywords.Common.True);};
RDebugUtils.currentLine=48693250;
 //BA.debugLineNum = 48693250;BA.debugLine="precioSin = NumberFormat2(precioSin, 1, 2, 2, Fal";
_preciosin = anywheresoftware.b4a.keywords.Common.NumberFormat2((double)(Double.parseDouble(_preciosin)),(int) (1),(int) (2),(int) (2),anywheresoftware.b4a.keywords.Common.False);
RDebugUtils.currentLine=48693251;
 //BA.debugLineNum = 48693251;BA.debugLine="costoU = NumberFormat2(costoU, 1, 2, 2, False)";
_costou = anywheresoftware.b4a.keywords.Common.NumberFormat2((double)(Double.parseDouble(_costou)),(int) (1),(int) (2),(int) (2),anywheresoftware.b4a.keywords.Common.False);
RDebugUtils.currentLine=48693252;
 //BA.debugLineNum = 48693252;BA.debugLine="LogColor($\"actualizaProducto, c=${clienteId}, p=$";
anywheresoftware.b4a.keywords.Common.LogImpl("048693252",("actualizaProducto, c="+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_clienteid))+", p="+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_prodid))+", nombre="+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_nombre))+", cant="+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_cant))+", cedis="+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_cedis))+", tipo="+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_tipoventa))+""),anywheresoftware.b4a.keywords.Common.Colors.Magenta);
RDebugUtils.currentLine=48693255;
 //BA.debugLineNum = 48693255;BA.debugLine="If dev = 0 Then";
if ((_dev).equals(BA.NumberToString(0))) { 
RDebugUtils.currentLine=48693256;
 //BA.debugLineNum = 48693256;BA.debugLine="Private c As Cursor=Starter.skmt.ExecQuery($\"sel";
_c = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(mostCurrent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery(("select * from pedido where pe_cedis = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_cedis))+"' and pe_proid = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_prodid))+"' and pe_cliente = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_clienteid))+"' and PE_CEDIS <> 'DUR' AND PE_FUTURO = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_futuro))+"'"))));
RDebugUtils.currentLine=48693257;
 //BA.debugLineNum = 48693257;BA.debugLine="If c.RowCount > 0 Then";
if (_c.getRowCount()>0) { 
RDebugUtils.currentLine=48693259;
 //BA.debugLineNum = 48693259;BA.debugLine="c.Position = 0";
_c.setPosition((int) (0));
RDebugUtils.currentLine=48693260;
 //BA.debugLineNum = 48693260;BA.debugLine="Private antCant As Int = 0";
_antcant = (int) (0);
RDebugUtils.currentLine=48693261;
 //BA.debugLineNum = 48693261;BA.debugLine="If IsNumber(c.GetInt(\"PE_CANT\")) Then antCant=c";
if (anywheresoftware.b4a.keywords.Common.IsNumber(BA.NumberToString(_c.GetInt("PE_CANT")))) { 
_antcant = _c.GetInt("PE_CANT");};
RDebugUtils.currentLine=48693262;
 //BA.debugLineNum = 48693262;BA.debugLine="Private difCant As Int = cant - antCant";
_difcant = (int) ((double)(Double.parseDouble(_cant))-_antcant);
RDebugUtils.currentLine=48693263;
 //BA.debugLineNum = 48693263;BA.debugLine="Starter.skmt.ExecNonQuery($\"update pedido set p";
mostCurrent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("update pedido set pe_cant = "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_cant))+", pe_costo_tot = "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(anywheresoftware.b4a.keywords.Common.NumberFormat2(((double)(Double.parseDouble(_cant))*(double)(Double.parseDouble(_c.GetString("PE_COSTOU")))),(int) (1),(int) (2),(int) (2),anywheresoftware.b4a.keywords.Common.False)))+", pe_folio = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_tipoventa))+"' where pe_cedis = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_cedis))+"' and pe_proid = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_prodid))+"' and pe_cliente = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_clienteid))+"' AND PE_FUTURO = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_futuro))+"' "));
RDebugUtils.currentLine=48693264;
 //BA.debugLineNum = 48693264;BA.debugLine="If cedis <> \"DUR\" Then Starter.skmt.ExecNonQuer";
if ((_cedis).equals("DUR") == false) { 
mostCurrent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("update "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_traetablaprods(_ba,_tipoventa)))+" set cat_gp_almacen = cat_gp_almacen - ("+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_difcant))+") where cat_gp_id = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_prodid))+"' "));};
RDebugUtils.currentLine=48693265;
 //BA.debugLineNum = 48693265;BA.debugLine="If cant = 0 Then";
if ((_cant).equals(BA.NumberToString(0))) { 
RDebugUtils.currentLine=48693266;
 //BA.debugLineNum = 48693266;BA.debugLine="LogColor($\"BORRAMOS PRODUCTO - ${prodId}\"$, Co";
anywheresoftware.b4a.keywords.Common.LogImpl("048693266",("BORRAMOS PRODUCTO - "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_prodid))+""),anywheresoftware.b4a.keywords.Common.Colors.Red);
RDebugUtils.currentLine=48693267;
 //BA.debugLineNum = 48693267;BA.debugLine="Starter.skmt.ExecNonQuery($\"delete from pedido";
mostCurrent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("delete from pedido where pe_cedis = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_cedis))+"' and pe_proid = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_prodid))+"' and pe_cliente = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_clienteid))+"' AND PE_FUTURO = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_futuro))+"' "));
RDebugUtils.currentLine=48693268;
 //BA.debugLineNum = 48693268;BA.debugLine="Log($\"Borramos pe_cedis='${cedis}' and pe_proi";
anywheresoftware.b4a.keywords.Common.LogImpl("048693268",("Borramos pe_cedis='"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_cedis))+"' and pe_proid='"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_prodid))+"' and pe_cliente='"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_clienteid))+"'"),0);
RDebugUtils.currentLine=48693269;
 //BA.debugLineNum = 48693269;BA.debugLine="Private pe As Cursor = Starter.skmt.ExecQuery(";
_pe = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_pe = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(mostCurrent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select count(pe_cliente) as cuantosPedidos from pedido where pe_cliente In (select cuenta from cuentaa)")));
RDebugUtils.currentLine=48693270;
 //BA.debugLineNum = 48693270;BA.debugLine="pe.Position=0";
_pe.setPosition((int) (0));
RDebugUtils.currentLine=48693271;
 //BA.debugLineNum = 48693271;BA.debugLine="If pe.GetString(\"cuantosPedidos\") = 0 Then";
if ((_pe.GetString("cuantosPedidos")).equals(BA.NumberToString(0))) { 
RDebugUtils.currentLine=48693272;
 //BA.debugLineNum = 48693272;BA.debugLine="Log(\"######    delete from pedido_cliente - \"";
anywheresoftware.b4a.keywords.Common.LogImpl("048693272","######    delete from pedido_cliente - "+_traecliente(_ba)+"|"+_clienteid,0);
RDebugUtils.currentLine=48693273;
 //BA.debugLineNum = 48693273;BA.debugLine="Log($\"delete from pedido_cliente where PC_CLI";
anywheresoftware.b4a.keywords.Common.LogImpl("048693273",("delete from pedido_cliente where PC_CLIENTE = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_traecliente(_ba)))+"'"),0);
RDebugUtils.currentLine=48693274;
 //BA.debugLineNum = 48693274;BA.debugLine="Starter.skmt.ExecNonQuery($\"delete from pedid";
mostCurrent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("delete from pedido_cliente where PC_CLIENTE = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_traecliente(_ba)))+"'"));
 };
 };
 }else {
RDebugUtils.currentLine=48693280;
 //BA.debugLineNum = 48693280;BA.debugLine="If cant > 0 Then guardaProductoSinGestion(cedis";
if ((double)(Double.parseDouble(_cant))>0) { 
_guardaproductosingestion(_ba,_cedis,_costou,_cant,_nombre,_prodid,_clienteid,_fecha,_usuario,_rutav,_preciosin,_tipoventa,_futuro);};
 };
RDebugUtils.currentLine=48693282;
 //BA.debugLineNum = 48693282;BA.debugLine="c.Close";
_c.Close();
 }else 
{RDebugUtils.currentLine=48693283;
 //BA.debugLineNum = 48693283;BA.debugLine="Else If dev = 1 Then";
if ((_dev).equals(BA.NumberToString(1))) { 
RDebugUtils.currentLine=48693284;
 //BA.debugLineNum = 48693284;BA.debugLine="Private c As Cursor=Starter.skmt.ExecQuery($\"sel";
_c = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(mostCurrent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery(("select * from pedido where pe_cedis = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_cedis))+"' and pe_proid = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_prodid))+"' and pe_cliente = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_clienteid))+"' and PE_CEDIS = 'DUR' AND PE_FUTURO = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_futuro))+"' "))));
RDebugUtils.currentLine=48693285;
 //BA.debugLineNum = 48693285;BA.debugLine="If c.RowCount > 0 Then";
if (_c.getRowCount()>0) { 
RDebugUtils.currentLine=48693287;
 //BA.debugLineNum = 48693287;BA.debugLine="c.Position = 0";
_c.setPosition((int) (0));
RDebugUtils.currentLine=48693288;
 //BA.debugLineNum = 48693288;BA.debugLine="Private antCant As Int = 0";
_antcant = (int) (0);
RDebugUtils.currentLine=48693289;
 //BA.debugLineNum = 48693289;BA.debugLine="If IsNumber(c.GetInt(\"PE_CANT\")) Then antCant=c";
if (anywheresoftware.b4a.keywords.Common.IsNumber(BA.NumberToString(_c.GetInt("PE_CANT")))) { 
_antcant = _c.GetInt("PE_CANT");};
RDebugUtils.currentLine=48693290;
 //BA.debugLineNum = 48693290;BA.debugLine="Private difCant As Int = cant - antCant";
_difcant = (int) ((double)(Double.parseDouble(_cant))-_antcant);
RDebugUtils.currentLine=48693291;
 //BA.debugLineNum = 48693291;BA.debugLine="Starter.skmt.ExecNonQuery($\"update pedido set p";
mostCurrent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("update pedido set pe_cant = "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_cant))+", pe_costo_tot = "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(anywheresoftware.b4a.keywords.Common.NumberFormat2(((double)(Double.parseDouble(_cant))*(double)(Double.parseDouble(_c.GetString("PE_COSTOU")))),(int) (1),(int) (2),(int) (2),anywheresoftware.b4a.keywords.Common.False)))+", pe_folio = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_tipoventa))+"' where pe_cedis = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_cedis))+"' and pe_proid = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_prodid))+"' and pe_cliente = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_clienteid))+"' AND PE_FUTURO = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_futuro))+"' "));
RDebugUtils.currentLine=48693292;
 //BA.debugLineNum = 48693292;BA.debugLine="If cedis <> \"DUR\" Then Starter.skmt.ExecNonQuer";
if ((_cedis).equals("DUR") == false) { 
mostCurrent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("update "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_traetablaprods(_ba,_tipoventa)))+" set cat_gp_almacen = cat_gp_almacen - ("+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_difcant))+") where cat_gp_id = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_prodid))+"' "));};
RDebugUtils.currentLine=48693293;
 //BA.debugLineNum = 48693293;BA.debugLine="If cant = 0 Then";
if ((_cant).equals(BA.NumberToString(0))) { 
RDebugUtils.currentLine=48693294;
 //BA.debugLineNum = 48693294;BA.debugLine="LogColor($\"BORRAMOS PRODUCTO - ${prodId}\"$, Co";
anywheresoftware.b4a.keywords.Common.LogImpl("048693294",("BORRAMOS PRODUCTO - "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_prodid))+""),anywheresoftware.b4a.keywords.Common.Colors.Red);
RDebugUtils.currentLine=48693295;
 //BA.debugLineNum = 48693295;BA.debugLine="Starter.skmt.ExecNonQuery($\"delete from pedido";
mostCurrent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("delete from pedido where pe_cedis = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_cedis))+"' and pe_proid = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_prodid))+"' and pe_cliente = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_clienteid))+"' AND PE_FUTURO = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_futuro))+"' "));
RDebugUtils.currentLine=48693296;
 //BA.debugLineNum = 48693296;BA.debugLine="Log($\"Borramos pe_cedis='${cedis}' and pe_proi";
anywheresoftware.b4a.keywords.Common.LogImpl("048693296",("Borramos pe_cedis='"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_cedis))+"' and pe_proid='"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_prodid))+"' and pe_cliente='"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_clienteid))+"'"),0);
RDebugUtils.currentLine=48693297;
 //BA.debugLineNum = 48693297;BA.debugLine="Private pe As Cursor = Starter.skmt.ExecQuery(";
_pe = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_pe = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(mostCurrent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select count(pe_cliente) as cuantosPedidos from pedido where pe_cliente In (select cuenta from cuentaa)")));
RDebugUtils.currentLine=48693298;
 //BA.debugLineNum = 48693298;BA.debugLine="pe.Position=0";
_pe.setPosition((int) (0));
RDebugUtils.currentLine=48693299;
 //BA.debugLineNum = 48693299;BA.debugLine="If pe.GetString(\"cuantosPedidos\") = 0 Then";
if ((_pe.GetString("cuantosPedidos")).equals(BA.NumberToString(0))) { 
RDebugUtils.currentLine=48693300;
 //BA.debugLineNum = 48693300;BA.debugLine="Log(\"######    delete from pedido_cliente - \"";
anywheresoftware.b4a.keywords.Common.LogImpl("048693300","######    delete from pedido_cliente - "+_traecliente(_ba)+"|"+_clienteid,0);
RDebugUtils.currentLine=48693301;
 //BA.debugLineNum = 48693301;BA.debugLine="Log($\"delete from pedido_cliente where PC_CLI";
anywheresoftware.b4a.keywords.Common.LogImpl("048693301",("delete from pedido_cliente where PC_CLIENTE = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_traecliente(_ba)))+"'"),0);
RDebugUtils.currentLine=48693302;
 //BA.debugLineNum = 48693302;BA.debugLine="Starter.skmt.ExecNonQuery($\"delete from pedid";
mostCurrent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("delete from pedido_cliente where PC_CLIENTE = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_traecliente(_ba)))+"'"));
 };
 };
 }else {
RDebugUtils.currentLine=48693308;
 //BA.debugLineNum = 48693308;BA.debugLine="If cant > 0 Then guardaProductoSinGestion(cedis";
if ((double)(Double.parseDouble(_cant))>0) { 
_guardaproductosingestion(_ba,_cedis,_costou,_cant,_nombre,_prodid,_clienteid,_fecha,_usuario,_rutav,_preciosin,_tipoventa,_futuro);};
 };
RDebugUtils.currentLine=48693310;
 //BA.debugLineNum = 48693310;BA.debugLine="c.Close";
_c.Close();
 }}
;
RDebugUtils.currentLine=48693313;
 //BA.debugLineNum = 48693313;BA.debugLine="End Sub";
return "";
}
public static String  _guardaproductosingestion(anywheresoftware.b4a.BA _ba,String _cedis,String _costou,String _cant,String _nombre,String _prodid,String _clienteid,String _fecha,String _usuario,String _rutav,String _preciosin,String _tipoventa,String _futuro) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "guardaproductosingestion", false))
	 {return ((String) Debug.delegate(null, "guardaproductosingestion", new Object[] {_ba,_cedis,_costou,_cant,_nombre,_prodid,_clienteid,_fecha,_usuario,_rutav,_preciosin,_tipoventa,_futuro}));}
anywheresoftware.b4a.sql.SQL.CursorWrapper _c = null;
RDebugUtils.currentLine=48758784;
 //BA.debugLineNum = 48758784;BA.debugLine="Sub guardaProductoSinGestion(cedis As String, cost";
RDebugUtils.currentLine=48758785;
 //BA.debugLineNum = 48758785;BA.debugLine="If nombre.Length < 6 Then ToastMessageShow(\"(guar";
if (_nombre.length()<6) { 
anywheresoftware.b4a.keywords.Common.ToastMessageShow(BA.ObjectToCharSequence("(guardaProductoSinGestion) El nombre del producto no es valido "+_nombre),anywheresoftware.b4a.keywords.Common.True);};
RDebugUtils.currentLine=48758786;
 //BA.debugLineNum = 48758786;BA.debugLine="precioSin = NumberFormat2(precioSin, 1, 2, 2, Fal";
_preciosin = anywheresoftware.b4a.keywords.Common.NumberFormat2((double)(Double.parseDouble(_preciosin)),(int) (1),(int) (2),(int) (2),anywheresoftware.b4a.keywords.Common.False);
RDebugUtils.currentLine=48758787;
 //BA.debugLineNum = 48758787;BA.debugLine="costoU = NumberFormat2(costoU, 1, 2, 2, False)";
_costou = anywheresoftware.b4a.keywords.Common.NumberFormat2((double)(Double.parseDouble(_costou)),(int) (1),(int) (2),(int) (2),anywheresoftware.b4a.keywords.Common.False);
RDebugUtils.currentLine=48758789;
 //BA.debugLineNum = 48758789;BA.debugLine="Private c As Cursor";
_c = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
RDebugUtils.currentLine=48758792;
 //BA.debugLineNum = 48758792;BA.debugLine="Starter.skmt.ExecNonQuery2(\"INSERT INTO PEDIDO (P";
mostCurrent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("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,PE_FUTURO) VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?) ",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(_cedis),(Object)(((double)(Double.parseDouble(_cant))*(double)(Double.parseDouble(_costou)))),(Object)(_costou),(Object)(_cant),(Object)(_nombre),(Object)(_prodid),(Object)(_clienteid),(Object)(_fecha),(Object)(_usuario),(Object)(_rutav),(Object)(_preciosin),(Object)(_tipoventa),(Object)(_futuro)}));
RDebugUtils.currentLine=48758794;
 //BA.debugLineNum = 48758794;BA.debugLine="If cedis <> \"DUR\" Then Starter.skmt.ExecNonQuery2";
if ((_cedis).equals("DUR") == false) { 
mostCurrent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2(("update "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_traetablaprods(_ba,_tipoventa)))+" set cat_gp_almacen = cat_gp_almacen - ? where cat_gp_id = ? "),anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(_cant),(Object)(_prodid)}));};
RDebugUtils.currentLine=48758795;
 //BA.debugLineNum = 48758795;BA.debugLine="c=Starter.skmt.ExecQuery(\"select sum(pe_costo_tot";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(mostCurrent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select 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)")));
RDebugUtils.currentLine=48758796;
 //BA.debugLineNum = 48758796;BA.debugLine="c.Position=0";
_c.setPosition((int) (0));
RDebugUtils.currentLine=48758799;
 //BA.debugLineNum = 48758799;BA.debugLine="Starter.skmt.ExecNonQuery($\"delete from pedido_cl";
mostCurrent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("delete from pedido_cliente where PC_CLIENTE = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_traecliente(_ba)))+"'"));
RDebugUtils.currentLine=48758800;
 //BA.debugLineNum = 48758800;BA.debugLine="Starter.skmt.ExecNonQuery2(\"insert into pedido_cl";
mostCurrent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("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 (?,?,?,?,?,?,?,?,?,?)",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(_clienteid),(Object)(_fecha),(Object)(_usuario),(Object)(_c.GetString("CANT_CLIE")),(Object)(_c.GetString("TOTAL_CLIE")),(Object)(mostCurrent._b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (_ba)._lon_gps /*String*/ ),(Object)(mostCurrent._b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (_ba)._lat_gps /*String*/ ),(Object)(_cedis),(Object)(_rutav),(Object)(_c.GetString("TOTAL_CLIE_SIN"))}));
RDebugUtils.currentLine=48758801;
 //BA.debugLineNum = 48758801;BA.debugLine="End Sub";
return "";
}
public static boolean  _alcanzanlosvariablesparapromo(anywheresoftware.b4a.BA _ba,anywheresoftware.b4a.objects.collections.Map _promomap,anywheresoftware.b4a.objects.collections.Map _inventariosinfijos) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "alcanzanlosvariablesparapromo", false))
	 {return ((Boolean) Debug.delegate(null, "alcanzanlosvariablesparapromo", new Object[] {_ba,_promomap,_inventariosinfijos}));}
boolean _thislog = false;
int _totalprodsvariables = 0;
int _totalprodsvariables2 = 0;
anywheresoftware.b4a.objects.collections.List _prodsvariables = null;
anywheresoftware.b4a.objects.collections.List _prodsvariables2 = null;
int _p = 0;
String _t = "";
String _p2 = "";
boolean _res = false;
boolean _res1 = false;
boolean _res2 = false;
RDebugUtils.currentLine=49676288;
 //BA.debugLineNum = 49676288;BA.debugLine="Sub alcanzanLosVariablesParaPromo(promoMap As Map,";
RDebugUtils.currentLine=49676289;
 //BA.debugLineNum = 49676289;BA.debugLine="Private thisLog As Boolean = False 'Si es verdade";
_thislog = anywheresoftware.b4a.keywords.Common.False;
RDebugUtils.currentLine=49676290;
 //BA.debugLineNum = 49676290;BA.debugLine="If thisLog Then LogColor(\"Inventario inicial: \"&i";
if (_thislog) { 
anywheresoftware.b4a.keywords.Common.LogImpl("049676290","Inventario inicial: "+BA.ObjectToString(_inventariosinfijos),anywheresoftware.b4a.keywords.Common.Colors.Gray);};
RDebugUtils.currentLine=49676291;
 //BA.debugLineNum = 49676291;BA.debugLine="Private totalProdsVariables As Int = 0";
_totalprodsvariables = (int) (0);
RDebugUtils.currentLine=49676292;
 //BA.debugLineNum = 49676292;BA.debugLine="Private totalProdsVariables2 As Int = 0";
_totalprodsvariables2 = (int) (0);
RDebugUtils.currentLine=49676294;
 //BA.debugLineNum = 49676294;BA.debugLine="Private prodsVariables As List = promoMap.get(\"pr";
_prodsvariables = new anywheresoftware.b4a.objects.collections.List();
_prodsvariables = (anywheresoftware.b4a.objects.collections.List) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.collections.List(), (java.util.List)(_promomap.Get((Object)("prodsVariables"))));
RDebugUtils.currentLine=49676295;
 //BA.debugLineNum = 49676295;BA.debugLine="Private prodsVariables2 As List = promoMap.get(\"p";
_prodsvariables2 = new anywheresoftware.b4a.objects.collections.List();
_prodsvariables2 = (anywheresoftware.b4a.objects.collections.List) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.collections.List(), (java.util.List)(_promomap.Get((Object)("prodsVariables2"))));
RDebugUtils.currentLine=49676296;
 //BA.debugLineNum = 49676296;BA.debugLine="For p = 0 To prodsVariables.Size - 1";
{
final int step7 = 1;
final int limit7 = (int) (_prodsvariables.getSize()-1);
_p = (int) (0) ;
for (;_p <= limit7 ;_p = _p + step7 ) {
RDebugUtils.currentLine=49676297;
 //BA.debugLineNum = 49676297;BA.debugLine="Private t As String = prodsVariables.Get(p) 'Obt";
_t = BA.ObjectToString(_prodsvariables.Get(_p));
RDebugUtils.currentLine=49676299;
 //BA.debugLineNum = 49676299;BA.debugLine="If inventarioSinFijos.ContainsKey(t) Then 'Si ex";
if (_inventariosinfijos.ContainsKey((Object)(_t))) { 
RDebugUtils.currentLine=49676300;
 //BA.debugLineNum = 49676300;BA.debugLine="Private p2 As String = inventarioSinFijos.Get(t";
_p2 = BA.ObjectToString(_inventariosinfijos.Get((Object)(_t)));
RDebugUtils.currentLine=49676302;
 //BA.debugLineNum = 49676302;BA.debugLine="totalProdsVariables = totalProdsVariables + p2";
_totalprodsvariables = (int) (_totalprodsvariables+(double)(Double.parseDouble(_p2)));
RDebugUtils.currentLine=49676304;
 //BA.debugLineNum = 49676304;BA.debugLine="If thisLog Then Log($\"prod ${t}, hay: ${p2}\"$)";
if (_thislog) { 
anywheresoftware.b4a.keywords.Common.LogImpl("049676304",("prod "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_t))+", hay: "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_p2))+""),0);};
 };
 }
};
RDebugUtils.currentLine=49676307;
 //BA.debugLineNum = 49676307;BA.debugLine="For p = 0 To prodsVariables2.Size - 1";
{
final int step15 = 1;
final int limit15 = (int) (_prodsvariables2.getSize()-1);
_p = (int) (0) ;
for (;_p <= limit15 ;_p = _p + step15 ) {
RDebugUtils.currentLine=49676308;
 //BA.debugLineNum = 49676308;BA.debugLine="Private t As String = prodsVariables2.Get(p) 'Ob";
_t = BA.ObjectToString(_prodsvariables2.Get(_p));
RDebugUtils.currentLine=49676309;
 //BA.debugLineNum = 49676309;BA.debugLine="If inventarioSinFijos.ContainsKey(t) Then 'Si ex";
if (_inventariosinfijos.ContainsKey((Object)(_t))) { 
RDebugUtils.currentLine=49676310;
 //BA.debugLineNum = 49676310;BA.debugLine="Private p2 As String = inventarioSinFijos.Get(t";
_p2 = BA.ObjectToString(_inventariosinfijos.Get((Object)(_t)));
RDebugUtils.currentLine=49676311;
 //BA.debugLineNum = 49676311;BA.debugLine="totalProdsVariables2 = totalProdsVariables2 + p";
_totalprodsvariables2 = (int) (_totalprodsvariables2+(double)(Double.parseDouble(_p2)));
RDebugUtils.currentLine=49676312;
 //BA.debugLineNum = 49676312;BA.debugLine="If thisLog Then Log($\"prod ${t}, hay: ${p2}\"$)";
if (_thislog) { 
anywheresoftware.b4a.keywords.Common.LogImpl("049676312",("prod "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_t))+", hay: "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_p2))+""),0);};
 };
 }
};
RDebugUtils.currentLine=49676315;
 //BA.debugLineNum = 49676315;BA.debugLine="If thisLog Then Log(\"Total prods variables=\" & to";
if (_thislog) { 
anywheresoftware.b4a.keywords.Common.LogImpl("049676315","Total prods variables="+BA.NumberToString(_totalprodsvariables)+", requeridos="+BA.ObjectToString(_promomap.Get((Object)("prodsVariablesRequeridos"))),0);};
RDebugUtils.currentLine=49676316;
 //BA.debugLineNum = 49676316;BA.debugLine="If thisLog Then Log(\"Total prods variables2=\" & t";
if (_thislog) { 
anywheresoftware.b4a.keywords.Common.LogImpl("049676316","Total prods variables2="+BA.NumberToString(_totalprodsvariables2)+", requeridos2="+BA.ObjectToString(_promomap.Get((Object)("prodsVariables2Requeridos"))),0);};
RDebugUtils.currentLine=49676317;
 //BA.debugLineNum = 49676317;BA.debugLine="Private res As Boolean = False";
_res = anywheresoftware.b4a.keywords.Common.False;
RDebugUtils.currentLine=49676318;
 //BA.debugLineNum = 49676318;BA.debugLine="Private res1 As Boolean = False";
_res1 = anywheresoftware.b4a.keywords.Common.False;
RDebugUtils.currentLine=49676319;
 //BA.debugLineNum = 49676319;BA.debugLine="Private res2 As Boolean = False";
_res2 = anywheresoftware.b4a.keywords.Common.False;
RDebugUtils.currentLine=49676324;
 //BA.debugLineNum = 49676324;BA.debugLine="If totalProdsVariables > 0 And totalProdsVariable";
if (_totalprodsvariables>0 && _totalprodsvariables>=(double)(BA.ObjectToNumber(_promomap.Get((Object)("prodsVariablesRequeridos"))))) { 
RDebugUtils.currentLine=49676325;
 //BA.debugLineNum = 49676325;BA.debugLine="res1 = True 'Si el total de inventario de produc";
_res1 = anywheresoftware.b4a.keywords.Common.True;
 };
RDebugUtils.currentLine=49676327;
 //BA.debugLineNum = 49676327;BA.debugLine="If promoMap.Get(\"prodsVariablesRequeridos\").As (I";
if (((int)(BA.ObjectToNumber(_promomap.Get((Object)("prodsVariablesRequeridos")))))==0) { 
_res1 = anywheresoftware.b4a.keywords.Common.True;};
RDebugUtils.currentLine=49676328;
 //BA.debugLineNum = 49676328;BA.debugLine="If totalProdsVariables2 > 0 And totalProdsVariabl";
if (_totalprodsvariables2>0 && _totalprodsvariables2>=(double)(BA.ObjectToNumber(_promomap.Get((Object)("prodsVariables2Requeridos"))))) { 
RDebugUtils.currentLine=49676329;
 //BA.debugLineNum = 49676329;BA.debugLine="res2 = True 'Si el total de inventario de produc";
_res2 = anywheresoftware.b4a.keywords.Common.True;
 };
RDebugUtils.currentLine=49676331;
 //BA.debugLineNum = 49676331;BA.debugLine="If promoMap.Get(\"prodsVariables2Requeridos\").As(I";
if (((int)(BA.ObjectToNumber(_promomap.Get((Object)("prodsVariables2Requeridos")))))==0) { 
_res2 = anywheresoftware.b4a.keywords.Common.True;};
RDebugUtils.currentLine=49676332;
 //BA.debugLineNum = 49676332;BA.debugLine="If res1 And res2 Then 'Solo si son verdadero los";
if (_res1 && _res2) { 
RDebugUtils.currentLine=49676333;
 //BA.debugLineNum = 49676333;BA.debugLine="res = True";
_res = anywheresoftware.b4a.keywords.Common.True;
 }else {
RDebugUtils.currentLine=49676335;
 //BA.debugLineNum = 49676335;BA.debugLine="res = False";
_res = anywheresoftware.b4a.keywords.Common.False;
 };
RDebugUtils.currentLine=49676338;
 //BA.debugLineNum = 49676338;BA.debugLine="Return res";
if (true) return _res;
RDebugUtils.currentLine=49676339;
 //BA.debugLineNum = 49676339;BA.debugLine="End Sub";
return false;
}
public static String  _bitacora(anywheresoftware.b4a.BA _ba,String _fechab,String _usuariob,String _almacenb,String _rutab,String _eventob,String _clienteb,String _iniciob,String _finb,String _latitudb,String _longitudb,String _precision,String _motivonoventa,String _motivonovisita,String _ban_geob) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "bitacora", false))
	 {return ((String) Debug.delegate(null, "bitacora", new Object[] {_ba,_fechab,_usuariob,_almacenb,_rutab,_eventob,_clienteb,_iniciob,_finb,_latitudb,_longitudb,_precision,_motivonoventa,_motivonovisita,_ban_geob}));}
RDebugUtils.currentLine=47906816;
 //BA.debugLineNum = 47906816;BA.debugLine="Sub bitacora(fechab As String, usuariob As String,";
RDebugUtils.currentLine=47906858;
 //BA.debugLineNum = 47906858;BA.debugLine="End Sub";
return "";
}
public static String  _borraarribade100errores(anywheresoftware.b4a.BA _ba) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "borraarribade100errores", false))
	 {return ((String) Debug.delegate(null, "borraarribade100errores", new Object[] {_ba}));}
RDebugUtils.currentLine=44826624;
 //BA.debugLineNum = 44826624;BA.debugLine="Sub borraArribaDe100Errores 'ignore";
RDebugUtils.currentLine=44826625;
 //BA.debugLineNum = 44826625;BA.debugLine="revisaBD";
_revisabd(_ba);
RDebugUtils.currentLine=44826626;
 //BA.debugLineNum = 44826626;BA.debugLine="LogColor(\"Borramos BD de log\", Colors.Magenta)";
anywheresoftware.b4a.keywords.Common.LogImpl("044826626","Borramos BD de log",anywheresoftware.b4a.keywords.Common.Colors.Magenta);
RDebugUtils.currentLine=44826627;
 //BA.debugLineNum = 44826627;BA.debugLine="errorLog.ExecNonQuery(\"DELETE FROM errores WHERE";
_errorlog.ExecNonQuery("DELETE FROM errores WHERE fecha NOT in (SELECT fecha FROM errores ORDER BY fecha desc LIMIT 99 )");
RDebugUtils.currentLine=44826628;
 //BA.debugLineNum = 44826628;BA.debugLine="errorLog.ExecNonQuery(\"vacuum;\")";
_errorlog.ExecNonQuery("vacuum;");
RDebugUtils.currentLine=44826629;
 //BA.debugLineNum = 44826629;BA.debugLine="Log(\"Borramos mas de 100 de errorLog\")";
anywheresoftware.b4a.keywords.Common.LogImpl("044826629","Borramos mas de 100 de errorLog",0);
RDebugUtils.currentLine=44826630;
 //BA.debugLineNum = 44826630;BA.debugLine="End Sub";
return "";
}
public static String  _borraarribade600renglonesbitacora(anywheresoftware.b4a.BA _ba) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "borraarribade600renglonesbitacora", false))
	 {return ((String) Debug.delegate(null, "borraarribade600renglonesbitacora", new Object[] {_ba}));}
anywheresoftware.b4a.sql.SQL.CursorWrapper _c = null;
RDebugUtils.currentLine=44892160;
 //BA.debugLineNum = 44892160;BA.debugLine="Sub borraArribaDe600RenglonesBitacora 'ignore";
RDebugUtils.currentLine=44892161;
 //BA.debugLineNum = 44892161;BA.debugLine="revisaBD";
_revisabd(_ba);
RDebugUtils.currentLine=44892162;
 //BA.debugLineNum = 44892162;BA.debugLine="If Starter.logger Then LogColor(\"Recortamos la ta";
if (mostCurrent._starter._logger /*boolean*/ ) { 
anywheresoftware.b4a.keywords.Common.LogImpl("044892162","Recortamos la tabla de la Bitacora, limite de 600",anywheresoftware.b4a.keywords.Common.Colors.Magenta);};
RDebugUtils.currentLine=44892163;
 //BA.debugLineNum = 44892163;BA.debugLine="Private c As Cursor";
_c = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
RDebugUtils.currentLine=44892164;
 //BA.debugLineNum = 44892164;BA.debugLine="c = B4XPages.MainPage.skmt.ExecQuery(\"select fech";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(mostCurrent._b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (_ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select fecha from bitacora")));
RDebugUtils.currentLine=44892165;
 //BA.debugLineNum = 44892165;BA.debugLine="c.Position = 0";
_c.setPosition((int) (0));
RDebugUtils.currentLine=44892166;
 //BA.debugLineNum = 44892166;BA.debugLine="If c.RowCount > 650 Then";
if (_c.getRowCount()>650) { 
RDebugUtils.currentLine=44892167;
 //BA.debugLineNum = 44892167;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"DELETE FROM";
mostCurrent._b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (_ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("DELETE FROM bitacora WHERE fecha NOT in (SELECT fecha FROM bitacora ORDER BY fecha desc LIMIT 599 )");
RDebugUtils.currentLine=44892168;
 //BA.debugLineNum = 44892168;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"vacuum;\")";
mostCurrent._b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (_ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("vacuum;");
 };
RDebugUtils.currentLine=44892171;
 //BA.debugLineNum = 44892171;BA.debugLine="c.Close";
_c.Close();
RDebugUtils.currentLine=44892172;
 //BA.debugLineNum = 44892172;BA.debugLine="End Sub";
return "";
}
public static String  _borralogdb(anywheresoftware.b4a.BA _ba) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "borralogdb", false))
	 {return ((String) Debug.delegate(null, "borralogdb", new Object[] {_ba}));}
RDebugUtils.currentLine=44630016;
 //BA.debugLineNum = 44630016;BA.debugLine="Sub borraLogDB 'ignore";
RDebugUtils.currentLine=44630017;
 //BA.debugLineNum = 44630017;BA.debugLine="LogColor(\"Borramos BD de log\", Colors.Magenta)";
anywheresoftware.b4a.keywords.Common.LogImpl("044630017","Borramos BD de log",anywheresoftware.b4a.keywords.Common.Colors.Magenta);
RDebugUtils.currentLine=44630018;
 //BA.debugLineNum = 44630018;BA.debugLine="kmt.ExecNonQuery(\"delete from bitacora\")";
_kmt.ExecNonQuery("delete from bitacora");
RDebugUtils.currentLine=44630019;
 //BA.debugLineNum = 44630019;BA.debugLine="kmt.ExecNonQuery(\"vacuum;\")";
_kmt.ExecNonQuery("vacuum;");
RDebugUtils.currentLine=44630020;
 //BA.debugLineNum = 44630020;BA.debugLine="End Sub";
return "";
}
public static String  _borramosarchivogps(anywheresoftware.b4a.BA _ba) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "borramosarchivogps", false))
	 {return ((String) Debug.delegate(null, "borramosarchivogps", new Object[] {_ba}));}
anywheresoftware.b4a.objects.streams.File.OutputStreamWrapper _out = null;
String _s = "";
byte[] _t = null;
RDebugUtils.currentLine=43974656;
 //BA.debugLineNum = 43974656;BA.debugLine="Sub borramosArchivoGPS 'ignore";
RDebugUtils.currentLine=43974657;
 //BA.debugLineNum = 43974657;BA.debugLine="Dim out As OutputStream = File.OpenOutput(File.Di";
_out = new anywheresoftware.b4a.objects.streams.File.OutputStreamWrapper();
_out = anywheresoftware.b4a.keywords.Common.File.OpenOutput(anywheresoftware.b4a.keywords.Common.File.getDirRootExternal(),"gps.txt",anywheresoftware.b4a.keywords.Common.False);
RDebugUtils.currentLine=43974658;
 //BA.debugLineNum = 43974658;BA.debugLine="Dim s As String = \"\"";
_s = "";
RDebugUtils.currentLine=43974659;
 //BA.debugLineNum = 43974659;BA.debugLine="Dim t() As Byte = s.GetBytes(\"UTF-8\")";
_t = _s.getBytes("UTF-8");
RDebugUtils.currentLine=43974660;
 //BA.debugLineNum = 43974660;BA.debugLine="out.WriteBytes(t, 0, t.Length)";
_out.WriteBytes(_t,(int) (0),_t.length);
RDebugUtils.currentLine=43974661;
 //BA.debugLineNum = 43974661;BA.debugLine="out.Close";
_out.Close();
RDebugUtils.currentLine=43974662;
 //BA.debugLineNum = 43974662;BA.debugLine="End Sub";
return "";
}
public static String  _borrapedidoclienteactual(anywheresoftware.b4a.BA _ba) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "borrapedidoclienteactual", false))
	 {return ((String) Debug.delegate(null, "borrapedidoclienteactual", new Object[] {_ba}));}
anywheresoftware.b4a.sql.SQL.CursorWrapper _thisc = null;
int _i = 0;
RDebugUtils.currentLine=46202880;
 //BA.debugLineNum = 46202880;BA.debugLine="Sub borraPedidoClienteActual As String";
RDebugUtils.currentLine=46202894;
 //BA.debugLineNum = 46202894;BA.debugLine="Private thisC As Cursor";
_thisc = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
RDebugUtils.currentLine=46202896;
 //BA.debugLineNum = 46202896;BA.debugLine="thisC=Starter.skmt.ExecQuery(\"select PE_PROID, PE";
_thisc = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(mostCurrent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select PE_PROID, PE_CANT, PE_FOLIO FROM PEDIDO where pe_cliente in (Select CUENTA from cuentaa) AND PE_CEDIS <> 'DUR'")));
RDebugUtils.currentLine=46202897;
 //BA.debugLineNum = 46202897;BA.debugLine="If thisC.RowCount>0 Then";
if (_thisc.getRowCount()>0) { 
RDebugUtils.currentLine=46202898;
 //BA.debugLineNum = 46202898;BA.debugLine="For i=0 To thisC.RowCount -1";
{
final int step4 = 1;
final int limit4 = (int) (_thisc.getRowCount()-1);
_i = (int) (0) ;
for (;_i <= limit4 ;_i = _i + step4 ) {
RDebugUtils.currentLine=46202899;
 //BA.debugLineNum = 46202899;BA.debugLine="thisC.Position = i";
_thisc.setPosition(_i);
RDebugUtils.currentLine=46202901;
 //BA.debugLineNum = 46202901;BA.debugLine="Starter.skmt.ExecNonQuery($\"update ${traeTablaP";
mostCurrent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("update "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_traetablaprods(_ba,_thisc.GetString("PE_FOLIO"))))+" set cat_gp_almacen = cat_gp_almacen + "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_thisc.GetString("PE_CANT")))+" where cat_gp_id = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_thisc.GetString("PE_PROID")))+"'"));
RDebugUtils.currentLine=46202902;
 //BA.debugLineNum = 46202902;BA.debugLine="LogColor($\"update ${traeTablaProds(thisC.GetStr";
anywheresoftware.b4a.keywords.Common.LogImpl("046202902",("update "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_traetablaprods(_ba,_thisc.GetString("PE_FOLIO"))))+" set cat_gp_almacen = cat_gp_almacen + "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_thisc.GetString("PE_CANT")))+" where cat_gp_id = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_thisc.GetString("PE_PROID")))+"'"),anywheresoftware.b4a.keywords.Common.Colors.Red);
 }
};
 };
RDebugUtils.currentLine=46202906;
 //BA.debugLineNum = 46202906;BA.debugLine="Starter.skmt.ExecNonQuery(\"delete from pedido_cli";
mostCurrent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("delete from pedido_cliente where pc_cliente in (Select CUENTA from cuentaa)");
RDebugUtils.currentLine=46202907;
 //BA.debugLineNum = 46202907;BA.debugLine="Starter.skmt.ExecNonQuery(\"delete from pedido whe";
mostCurrent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("delete from pedido where pe_cliente in (Select CUENTA from cuentaa)");
RDebugUtils.currentLine=46202908;
 //BA.debugLineNum = 46202908;BA.debugLine="Starter.skmt.ExecNonQuery(\"UPDATE kmt_info set ge";
mostCurrent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("UPDATE kmt_info set gestion = 0  where CAT_CL_CODIGO In (select cuenta from cuentaa)");
RDebugUtils.currentLine=46202909;
 //BA.debugLineNum = 46202909;BA.debugLine="Return 1";
if (true) return BA.NumberToString(1);
RDebugUtils.currentLine=46202910;
 //BA.debugLineNum = 46202910;BA.debugLine="End Sub";
return "";
}
public static String  _buscadbusuario(anywheresoftware.b4a.BA _ba) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "buscadbusuario", false))
	 {return ((String) Debug.delegate(null, "buscadbusuario", new Object[] {_ba}));}
anywheresoftware.b4a.sql.SQL.CursorWrapper _c = null;
String _usuario = "";
RDebugUtils.currentLine=45678592;
 //BA.debugLineNum = 45678592;BA.debugLine="Sub buscaDBUsuario As String 'ignore";
RDebugUtils.currentLine=45678593;
 //BA.debugLineNum = 45678593;BA.debugLine="Private c As Cursor";
_c = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
RDebugUtils.currentLine=45678594;
 //BA.debugLineNum = 45678594;BA.debugLine="Private usuario As String = \"SinUsuario\"";
_usuario = "SinUsuario";
RDebugUtils.currentLine=45678595;
 //BA.debugLineNum = 45678595;BA.debugLine="c=kmt.ExecQuery(\"select USUARIO from usuarioa\")";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_kmt.ExecQuery("select USUARIO from usuarioa")));
RDebugUtils.currentLine=45678596;
 //BA.debugLineNum = 45678596;BA.debugLine="c.Position=0";
_c.setPosition((int) (0));
RDebugUtils.currentLine=45678597;
 //BA.debugLineNum = 45678597;BA.debugLine="If c.RowCount > 0 Then usuario = c.GetString(\"USU";
if (_c.getRowCount()>0) { 
_usuario = _c.GetString("USUARIO");};
RDebugUtils.currentLine=45678598;
 //BA.debugLineNum = 45678598;BA.debugLine="Return usuario";
if (true) return _usuario;
RDebugUtils.currentLine=45678599;
 //BA.debugLineNum = 45678599;BA.debugLine="End Sub";
return "";
}
public static String  _calculatotalconpromoxrango3(anywheresoftware.b4a.BA _ba,String _idcliente) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "calculatotalconpromoxrango3", false))
	 {return ((String) Debug.delegate(null, "calculatotalconpromoxrango3", new Object[] {_ba,_idcliente}));}
String _total = "";
anywheresoftware.b4a.sql.SQL.CursorWrapper _cx = null;
int _i = 0;
anywheresoftware.b4a.sql.SQL.CursorWrapper _precioprom = null;
RDebugUtils.currentLine=49938432;
 //BA.debugLineNum = 49938432;BA.debugLine="Sub calculaTotalConPromoXRango3(idCliente As Strin";
RDebugUtils.currentLine=49938441;
 //BA.debugLineNum = 49938441;BA.debugLine="Private total As String = 0";
_total = BA.NumberToString(0);
RDebugUtils.currentLine=49938442;
 //BA.debugLineNum = 49938442;BA.debugLine="Private cx As Cursor = Starter.skmt.ExecQuery($\"s";
_cx = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_cx = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(mostCurrent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery(("select * from pedido where pe_cliente = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_idcliente))+"' and PE_FUTURO = '0' AND PE_PROID <> PE_CEDIS "))));
RDebugUtils.currentLine=49938443;
 //BA.debugLineNum = 49938443;BA.debugLine="If cx.RowCount > 0 Then";
if (_cx.getRowCount()>0) { 
RDebugUtils.currentLine=49938444;
 //BA.debugLineNum = 49938444;BA.debugLine="For i = 0 To cx.RowCount - 1";
{
final int step4 = 1;
final int limit4 = (int) (_cx.getRowCount()-1);
_i = (int) (0) ;
for (;_i <= limit4 ;_i = _i + step4 ) {
RDebugUtils.currentLine=49938446;
 //BA.debugLineNum = 49938446;BA.debugLine="cx.Position = i";
_cx.setPosition(_i);
RDebugUtils.currentLine=49938447;
 //BA.debugLineNum = 49938447;BA.debugLine="Log(\"***************************************\")";
anywheresoftware.b4a.keywords.Common.LogImpl("049938447","***************************************",0);
RDebugUtils.currentLine=49938449;
 //BA.debugLineNum = 49938449;BA.debugLine="Dim precioprom As Cursor = Starter.skmt.ExecQue";
_precioprom = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_precioprom = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(mostCurrent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery(("SELECT CAT_GP_PRECIO FROM CAT_GUNAPROD WHERE CAT_GP_NOMBRE = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_cx.GetString("PE_PRONOMBRE")))+"' "))));
RDebugUtils.currentLine=49938450;
 //BA.debugLineNum = 49938450;BA.debugLine="If precioprom.RowCount > 0 Then";
if (_precioprom.getRowCount()>0) { 
RDebugUtils.currentLine=49938451;
 //BA.debugLineNum = 49938451;BA.debugLine="precioprom.Position = 0";
_precioprom.setPosition((int) (0));
RDebugUtils.currentLine=49938452;
 //BA.debugLineNum = 49938452;BA.debugLine="Log (precioprom.GETSTRING(\"CAT_GP_PRECIO\"))";
anywheresoftware.b4a.keywords.Common.LogImpl("049938452",_precioprom.GetString("CAT_GP_PRECIO"),0);
RDebugUtils.currentLine=49938453;
 //BA.debugLineNum = 49938453;BA.debugLine="Log (cx.GETSTRING(\"PE_CANT\"))";
anywheresoftware.b4a.keywords.Common.LogImpl("049938453",_cx.GetString("PE_CANT"),0);
RDebugUtils.currentLine=49938454;
 //BA.debugLineNum = 49938454;BA.debugLine="Log (cx.GETSTRING(\"PE_PRONOMBRE\"))";
anywheresoftware.b4a.keywords.Common.LogImpl("049938454",_cx.GetString("PE_PRONOMBRE"),0);
RDebugUtils.currentLine=49938456;
 //BA.debugLineNum = 49938456;BA.debugLine="total = total + ((cx.GETSTRING(\"PE_CANT\")*prec";
_total = BA.NumberToString((double)(Double.parseDouble(_total))+(((double)(Double.parseDouble(_cx.GetString("PE_CANT")))*(double)(Double.parseDouble(_precioprom.GetString("CAT_GP_PRECIO"))))));
 };
RDebugUtils.currentLine=49938460;
 //BA.debugLineNum = 49938460;BA.debugLine="Log($\"Total:${total} \"$)";
anywheresoftware.b4a.keywords.Common.LogImpl("049938460",("Total:"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_total))+" "),0);
 }
};
 };
RDebugUtils.currentLine=49938464;
 //BA.debugLineNum = 49938464;BA.debugLine="cx.Close";
_cx.Close();
RDebugUtils.currentLine=49938465;
 //BA.debugLineNum = 49938465;BA.debugLine="total = NumberFormat2(total, 1, 2, 2, False)";
_total = anywheresoftware.b4a.keywords.Common.NumberFormat2((double)(Double.parseDouble(_total)),(int) (1),(int) (2),(int) (2),anywheresoftware.b4a.keywords.Common.False);
RDebugUtils.currentLine=49938466;
 //BA.debugLineNum = 49938466;BA.debugLine="Log($\"Total con promocXrango = ${total}\"$)";
anywheresoftware.b4a.keywords.Common.LogImpl("049938466",("Total con promocXrango = "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_total))+""),0);
RDebugUtils.currentLine=49938467;
 //BA.debugLineNum = 49938467;BA.debugLine="Return total";
if (true) return _total;
RDebugUtils.currentLine=49938468;
 //BA.debugLineNum = 49938468;BA.debugLine="End Sub";
return "";
}
public static String  _calculatotalconpromoxrango4(anywheresoftware.b4a.BA _ba,String _idcliente) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "calculatotalconpromoxrango4", false))
	 {return ((String) Debug.delegate(null, "calculatotalconpromoxrango4", new Object[] {_ba,_idcliente}));}
String _total = "";
anywheresoftware.b4a.sql.SQL.CursorWrapper _cx = null;
int _i = 0;
anywheresoftware.b4a.sql.SQL.CursorWrapper _precioprom = null;
RDebugUtils.currentLine=50003968;
 //BA.debugLineNum = 50003968;BA.debugLine="Sub calculaTotalConPromoXRango4(idCliente As Strin";
RDebugUtils.currentLine=50003977;
 //BA.debugLineNum = 50003977;BA.debugLine="Private total As String = 0";
_total = BA.NumberToString(0);
RDebugUtils.currentLine=50003978;
 //BA.debugLineNum = 50003978;BA.debugLine="Private cx As Cursor = Starter.skmt.ExecQuery($\"s";
_cx = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_cx = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(mostCurrent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery(("select * from pedido where pe_cliente = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_idcliente))+"' and PE_FUTURO = '1' AND PE_PROID <> PE_CEDIS "))));
RDebugUtils.currentLine=50003979;
 //BA.debugLineNum = 50003979;BA.debugLine="If cx.RowCount > 0 Then";
if (_cx.getRowCount()>0) { 
RDebugUtils.currentLine=50003980;
 //BA.debugLineNum = 50003980;BA.debugLine="For i = 0 To cx.RowCount - 1";
{
final int step4 = 1;
final int limit4 = (int) (_cx.getRowCount()-1);
_i = (int) (0) ;
for (;_i <= limit4 ;_i = _i + step4 ) {
RDebugUtils.currentLine=50003982;
 //BA.debugLineNum = 50003982;BA.debugLine="cx.Position = i";
_cx.setPosition(_i);
RDebugUtils.currentLine=50003985;
 //BA.debugLineNum = 50003985;BA.debugLine="Dim precioprom As Cursor = Starter.skmt.ExecQue";
_precioprom = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_precioprom = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(mostCurrent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery(("SELECT CAT_GP_PRECIO FROM CAT_GUNAPROD WHERE CAT_GP_NOMBRE = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_cx.GetString("PE_PRONOMBRE")))+"' "))));
RDebugUtils.currentLine=50003986;
 //BA.debugLineNum = 50003986;BA.debugLine="If precioprom.RowCount > 0 Then";
if (_precioprom.getRowCount()>0) { 
RDebugUtils.currentLine=50003987;
 //BA.debugLineNum = 50003987;BA.debugLine="precioprom.Position = 0";
_precioprom.setPosition((int) (0));
RDebugUtils.currentLine=50003993;
 //BA.debugLineNum = 50003993;BA.debugLine="total = total + ((cx.GETSTRING(\"PE_CANT\")*prec";
_total = BA.NumberToString((double)(Double.parseDouble(_total))+(((double)(Double.parseDouble(_cx.GetString("PE_CANT")))*(double)(Double.parseDouble(_precioprom.GetString("CAT_GP_PRECIO"))))));
 };
 }
};
 };
RDebugUtils.currentLine=50004001;
 //BA.debugLineNum = 50004001;BA.debugLine="cx.Close";
_cx.Close();
RDebugUtils.currentLine=50004002;
 //BA.debugLineNum = 50004002;BA.debugLine="total = NumberFormat2(total, 1, 2, 2, False)";
_total = anywheresoftware.b4a.keywords.Common.NumberFormat2((double)(Double.parseDouble(_total)),(int) (1),(int) (2),(int) (2),anywheresoftware.b4a.keywords.Common.False);
RDebugUtils.currentLine=50004004;
 //BA.debugLineNum = 50004004;BA.debugLine="Return total";
if (true) return _total;
RDebugUtils.currentLine=50004005;
 //BA.debugLineNum = 50004005;BA.debugLine="End Sub";
return "";
}
public static String  _centraedittext(anywheresoftware.b4a.BA _ba,anywheresoftware.b4a.objects.EditTextWrapper _elemento,int _anchoelementosuperior) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "centraedittext", false))
	 {return ((String) Debug.delegate(null, "centraedittext", new Object[] {_ba,_elemento,_anchoelementosuperior}));}
RDebugUtils.currentLine=45613056;
 //BA.debugLineNum = 45613056;BA.debugLine="Sub centraEditText(elemento As EditText, anchoElem";
RDebugUtils.currentLine=45613057;
 //BA.debugLineNum = 45613057;BA.debugLine="elemento.Left = Round(anchoElementoSuperior/2)-(e";
_elemento.setLeft((int) (anywheresoftware.b4a.keywords.Common.Round(_anchoelementosuperior/(double)2)-(_elemento.getWidth()/(double)2)));
RDebugUtils.currentLine=45613058;
 //BA.debugLineNum = 45613058;BA.debugLine="End Sub";
return "";
}
public static String  _centraetiqueta(anywheresoftware.b4a.BA _ba,anywheresoftware.b4a.objects.LabelWrapper _elemento,int _anchoelementosuperior) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "centraetiqueta", false))
	 {return ((String) Debug.delegate(null, "centraetiqueta", new Object[] {_ba,_elemento,_anchoelementosuperior}));}
RDebugUtils.currentLine=45350912;
 //BA.debugLineNum = 45350912;BA.debugLine="Sub centraEtiqueta(elemento As Label, anchoElement";
RDebugUtils.currentLine=45350913;
 //BA.debugLineNum = 45350913;BA.debugLine="elemento.Left = Round(anchoElementoSuperior/2)-(e";
_elemento.setLeft((int) (anywheresoftware.b4a.keywords.Common.Round(_anchoelementosuperior/(double)2)-(_elemento.getWidth()/(double)2)));
RDebugUtils.currentLine=45350914;
 //BA.debugLineNum = 45350914;BA.debugLine="End Sub";
return "";
}
public static String  _centralistview(anywheresoftware.b4a.BA _ba,anywheresoftware.b4a.objects.ListViewWrapper _elemento,int _anchoelementosuperior) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "centralistview", false))
	 {return ((String) Debug.delegate(null, "centralistview", new Object[] {_ba,_elemento,_anchoelementosuperior}));}
RDebugUtils.currentLine=43253760;
 //BA.debugLineNum = 43253760;BA.debugLine="Sub centraListView(elemento As ListView, anchoElem";
RDebugUtils.currentLine=43253761;
 //BA.debugLineNum = 43253761;BA.debugLine="elemento.Left = Round(anchoElementoSuperior/2)-(e";
_elemento.setLeft((int) (anywheresoftware.b4a.keywords.Common.Round(_anchoelementosuperior/(double)2)-(_elemento.getWidth()/(double)2)));
RDebugUtils.currentLine=43253762;
 //BA.debugLineNum = 43253762;BA.debugLine="End Sub";
return "";
}
public static String  _centraprogressbar(anywheresoftware.b4a.BA _ba,anywheresoftware.b4a.objects.ProgressBarWrapper _elemento,int _anchoelementosuperior) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "centraprogressbar", false))
	 {return ((String) Debug.delegate(null, "centraprogressbar", new Object[] {_ba,_elemento,_anchoelementosuperior}));}
RDebugUtils.currentLine=45547520;
 //BA.debugLineNum = 45547520;BA.debugLine="Sub centraProgressBar(elemento As ProgressBar, anc";
RDebugUtils.currentLine=45547521;
 //BA.debugLineNum = 45547521;BA.debugLine="elemento.Left = Round(anchoElementoSuperior/2)-(e";
_elemento.setLeft((int) (anywheresoftware.b4a.keywords.Common.Round(_anchoelementosuperior/(double)2)-(_elemento.getWidth()/(double)2)));
RDebugUtils.currentLine=45547522;
 //BA.debugLineNum = 45547522;BA.debugLine="End Sub";
return "";
}
public static String  _compress(anywheresoftware.b4a.BA _ba,String _str) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "compress", false))
	 {return ((String) Debug.delegate(null, "compress", new Object[] {_ba,_str}));}
byte[] _compressed = null;
String _base64 = "";
RDebugUtils.currentLine=43319296;
 //BA.debugLineNum = 43319296;BA.debugLine="Sub compress(str As String) As String 'ignore";
RDebugUtils.currentLine=43319298;
 //BA.debugLineNum = 43319298;BA.debugLine="Dim compressed() As Byte = GZip.compress(str)";
_compressed = _gzip.compress(_str);
RDebugUtils.currentLine=43319301;
 //BA.debugLineNum = 43319301;BA.debugLine="Dim base64 As String = su.EncodeBase64(compressed";
_base64 = _su.EncodeBase64(_compressed);
RDebugUtils.currentLine=43319302;
 //BA.debugLineNum = 43319302;BA.debugLine="Log($\"Comprimido: ${base64.Length}\"$)";
anywheresoftware.b4a.keywords.Common.LogImpl("043319302",("Comprimido: "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_base64.length()))+""),0);
RDebugUtils.currentLine=43319304;
 //BA.debugLineNum = 43319304;BA.debugLine="Return base64";
if (true) return _base64;
RDebugUtils.currentLine=43319305;
 //BA.debugLineNum = 43319305;BA.debugLine="End Sub";
return "";
}
public static String  _copiadb(anywheresoftware.b4a.BA _ba,boolean _result) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "copiadb", false))
	 {return ((String) Debug.delegate(null, "copiadb", new Object[] {_ba,_result}));}
String _p = "";
String _thedir = "";
RDebugUtils.currentLine=45219840;
 //BA.debugLineNum = 45219840;BA.debugLine="Sub copiaDB(result As Boolean) 'ignore";
RDebugUtils.currentLine=45219841;
 //BA.debugLineNum = 45219841;BA.debugLine="ToastMessageShow(\"copiaDB\", False)";
anywheresoftware.b4a.keywords.Common.ToastMessageShow(BA.ObjectToCharSequence("copiaDB"),anywheresoftware.b4a.keywords.Common.False);
RDebugUtils.currentLine=45219842;
 //BA.debugLineNum = 45219842;BA.debugLine="If result Then";
if (_result) { 
RDebugUtils.currentLine=45219843;
 //BA.debugLineNum = 45219843;BA.debugLine="Dim p As String";
_p = "";
RDebugUtils.currentLine=45219844;
 //BA.debugLineNum = 45219844;BA.debugLine="If File.ExternalWritable Then";
if (anywheresoftware.b4a.keywords.Common.File.getExternalWritable()) { 
RDebugUtils.currentLine=45219845;
 //BA.debugLineNum = 45219845;BA.debugLine="p = File.DirRootExternal";
_p = anywheresoftware.b4a.keywords.Common.File.getDirRootExternal();
 }else {
RDebugUtils.currentLine=45219848;
 //BA.debugLineNum = 45219848;BA.debugLine="p = File.DirInternal";
_p = anywheresoftware.b4a.keywords.Common.File.getDirInternal();
 };
RDebugUtils.currentLine=45219851;
 //BA.debugLineNum = 45219851;BA.debugLine="Dim theDir As String";
_thedir = "";
RDebugUtils.currentLine=45219852;
 //BA.debugLineNum = 45219852;BA.debugLine="Try";
try {RDebugUtils.currentLine=45219853;
 //BA.debugLineNum = 45219853;BA.debugLine="File.MakeDir(File.DirRootExternal,\"kmts\")";
anywheresoftware.b4a.keywords.Common.File.MakeDir(anywheresoftware.b4a.keywords.Common.File.getDirRootExternal(),"kmts");
RDebugUtils.currentLine=45219854;
 //BA.debugLineNum = 45219854;BA.debugLine="theDir = \"/kmts\"";
_thedir = "/kmts";
 } 
       catch (Exception e14) {
			(_ba.processBA == null ? _ba : _ba.processBA).setLastException(e14);RDebugUtils.currentLine=45219856;
 //BA.debugLineNum = 45219856;BA.debugLine="theDir = \"\"";
_thedir = "";
 };
RDebugUtils.currentLine=45219858;
 //BA.debugLineNum = 45219858;BA.debugLine="Try";
try {RDebugUtils.currentLine=45219859;
 //BA.debugLineNum = 45219859;BA.debugLine="File.Copy(File.DirInternal,\"kmt.db\",File.DirRoo";
anywheresoftware.b4a.keywords.Common.File.Copy(anywheresoftware.b4a.keywords.Common.File.getDirInternal(),"kmt.db",anywheresoftware.b4a.keywords.Common.File.getDirRootExternal()+_thedir,"cedex_kmt.db");
RDebugUtils.currentLine=45219860;
 //BA.debugLineNum = 45219860;BA.debugLine="File.Copy(File.DirInternal,\"errorLog.db\",File.D";
anywheresoftware.b4a.keywords.Common.File.Copy(anywheresoftware.b4a.keywords.Common.File.getDirInternal(),"errorLog.db",anywheresoftware.b4a.keywords.Common.File.getDirRootExternal()+_thedir,"cedex_errorLog.db");
RDebugUtils.currentLine=45219861;
 //BA.debugLineNum = 45219861;BA.debugLine="ToastMessageShow(\"BD copiada!\", False)";
anywheresoftware.b4a.keywords.Common.ToastMessageShow(BA.ObjectToCharSequence("BD copiada!"),anywheresoftware.b4a.keywords.Common.False);
 } 
       catch (Exception e21) {
			(_ba.processBA == null ? _ba : _ba.processBA).setLastException(e21);RDebugUtils.currentLine=45219863;
 //BA.debugLineNum = 45219863;BA.debugLine="ToastMessageShow(\"No se pudo hacer la copia: \"&";
anywheresoftware.b4a.keywords.Common.ToastMessageShow(BA.ObjectToCharSequence("No se pudo hacer la copia: "+BA.ObjectToString(anywheresoftware.b4a.keywords.Common.LastException(_ba))),anywheresoftware.b4a.keywords.Common.True);
 };
RDebugUtils.currentLine=45219865;
 //BA.debugLineNum = 45219865;BA.debugLine="Log(\"rootExternal=\"&p)";
anywheresoftware.b4a.keywords.Common.LogImpl("045219865","rootExternal="+_p,0);
RDebugUtils.currentLine=45219866;
 //BA.debugLineNum = 45219866;BA.debugLine="Log(\"File.DirInternal=\"&File.DirInternal)";
anywheresoftware.b4a.keywords.Common.LogImpl("045219866","File.DirInternal="+anywheresoftware.b4a.keywords.Common.File.getDirInternal(),0);
RDebugUtils.currentLine=45219867;
 //BA.debugLineNum = 45219867;BA.debugLine="Log(\"File.DirRootExternal=\"&File.DirRootExternal";
anywheresoftware.b4a.keywords.Common.LogImpl("045219867","File.DirRootExternal="+anywheresoftware.b4a.keywords.Common.File.getDirRootExternal(),0);
 }else {
RDebugUtils.currentLine=45219869;
 //BA.debugLineNum = 45219869;BA.debugLine="ToastMessageShow(\"Sin permisos\", False)";
anywheresoftware.b4a.keywords.Common.ToastMessageShow(BA.ObjectToCharSequence("Sin permisos"),anywheresoftware.b4a.keywords.Common.False);
 };
RDebugUtils.currentLine=45219871;
 //BA.debugLineNum = 45219871;BA.debugLine="End Sub";
return "";
}
public static String  _cuantosvariablestengobd(anywheresoftware.b4a.BA _ba,String _promo) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "cuantosvariablestengobd", false))
	 {return ((String) Debug.delegate(null, "cuantosvariablestengobd", new Object[] {_ba,_promo}));}
RDebugUtils.currentLine=47316992;
 //BA.debugLineNum = 47316992;BA.debugLine="Sub cuantosVariablesTengoBD(promo As String) As St";
RDebugUtils.currentLine=47317003;
 //BA.debugLineNum = 47317003;BA.debugLine="End Sub";
return "";
}
public static String  _dameerroresjson(anywheresoftware.b4a.BA _ba,anywheresoftware.b4a.sql.SQL _sql,int _maxerrores,boolean _comprimido) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "dameerroresjson", false))
	 {return ((String) Debug.delegate(null, "dameerroresjson", new Object[] {_ba,_sql,_maxerrores,_comprimido}));}
anywheresoftware.b4a.objects.collections.JSONParser.JSONGenerator _j = null;
String _lim = "";
anywheresoftware.b4a.sql.SQL.ResultSetWrapper _cur = null;
anywheresoftware.b4a.objects.collections.List _l = null;
int _i = 0;
anywheresoftware.b4a.objects.collections.Map _m = null;
anywheresoftware.b4a.objects.collections.Map _m2 = null;
RDebugUtils.currentLine=45023232;
 //BA.debugLineNum = 45023232;BA.debugLine="Sub dameErroresJSON(SQL As SQL, maxErrores As Int,";
RDebugUtils.currentLine=45023233;
 //BA.debugLineNum = 45023233;BA.debugLine="Log(\"dameErroresJSON\")";
anywheresoftware.b4a.keywords.Common.LogImpl("045023233","dameErroresJSON",0);
RDebugUtils.currentLine=45023234;
 //BA.debugLineNum = 45023234;BA.debugLine="Private j As JSONGenerator";
_j = new anywheresoftware.b4a.objects.collections.JSONParser.JSONGenerator();
RDebugUtils.currentLine=45023235;
 //BA.debugLineNum = 45023235;BA.debugLine="Private lim As String";
_lim = "";
RDebugUtils.currentLine=45023236;
 //BA.debugLineNum = 45023236;BA.debugLine="Private cur As ResultSet";
_cur = new anywheresoftware.b4a.sql.SQL.ResultSetWrapper();
RDebugUtils.currentLine=45023237;
 //BA.debugLineNum = 45023237;BA.debugLine="Private l As List";
_l = new anywheresoftware.b4a.objects.collections.List();
RDebugUtils.currentLine=45023238;
 //BA.debugLineNum = 45023238;BA.debugLine="Private i As Int = 0";
_i = (int) (0);
RDebugUtils.currentLine=45023239;
 //BA.debugLineNum = 45023239;BA.debugLine="l.Initialize";
_l.Initialize();
RDebugUtils.currentLine=45023240;
 //BA.debugLineNum = 45023240;BA.debugLine="Dim m, m2 As Map";
_m = new anywheresoftware.b4a.objects.collections.Map();
_m2 = new anywheresoftware.b4a.objects.collections.Map();
RDebugUtils.currentLine=45023241;
 //BA.debugLineNum = 45023241;BA.debugLine="m2.Initialize";
_m2.Initialize();
RDebugUtils.currentLine=45023242;
 //BA.debugLineNum = 45023242;BA.debugLine="If maxErrores = 0 Then lim = \"\" Else lim = \"limit";
if (_maxerrores==0) { 
_lim = "";}
else {
_lim = "limit "+BA.NumberToString(_maxerrores);};
RDebugUtils.currentLine=45023243;
 //BA.debugLineNum = 45023243;BA.debugLine="cur = SQL.ExecQuery(\"select * from errores order";
_cur = (anywheresoftware.b4a.sql.SQL.ResultSetWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.ResultSetWrapper(), (android.database.Cursor)(_sql.ExecQuery("select * from errores order by fecha desc "+_lim)));
RDebugUtils.currentLine=45023244;
 //BA.debugLineNum = 45023244;BA.debugLine="Do While cur.NextRow";
while (_cur.NextRow()) {
RDebugUtils.currentLine=45023245;
 //BA.debugLineNum = 45023245;BA.debugLine="m.Initialize";
_m.Initialize();
RDebugUtils.currentLine=45023246;
 //BA.debugLineNum = 45023246;BA.debugLine="m.Put(\"fecha\", cur.GetString(\"fecha\"))";
_m.Put((Object)("fecha"),(Object)(_cur.GetString("fecha")));
RDebugUtils.currentLine=45023247;
 //BA.debugLineNum = 45023247;BA.debugLine="m.Put(\"error\", cur.GetString(\"error\"))";
_m.Put((Object)("error"),(Object)(_cur.GetString("error")));
RDebugUtils.currentLine=45023248;
 //BA.debugLineNum = 45023248;BA.debugLine="m2.Put(i,m)";
_m2.Put((Object)(_i),(Object)(_m.getObject()));
RDebugUtils.currentLine=45023249;
 //BA.debugLineNum = 45023249;BA.debugLine="i = i + 1";
_i = (int) (_i+1);
 }
;
RDebugUtils.currentLine=45023251;
 //BA.debugLineNum = 45023251;BA.debugLine="cur.Close";
_cur.Close();
RDebugUtils.currentLine=45023252;
 //BA.debugLineNum = 45023252;BA.debugLine="j.Initialize(m2)";
_j.Initialize(_m2);
RDebugUtils.currentLine=45023253;
 //BA.debugLineNum = 45023253;BA.debugLine="Log(j.ToString)";
anywheresoftware.b4a.keywords.Common.LogImpl("045023253",_j.ToString(),0);
RDebugUtils.currentLine=45023254;
 //BA.debugLineNum = 45023254;BA.debugLine="If comprimido Then";
if (_comprimido) { 
RDebugUtils.currentLine=45023255;
 //BA.debugLineNum = 45023255;BA.debugLine="Return compress(j.ToString)";
if (true) return _compress(_ba,_j.ToString());
 }else {
RDebugUtils.currentLine=45023257;
 //BA.debugLineNum = 45023257;BA.debugLine="Return j.ToString";
if (true) return _j.ToString();
 };
RDebugUtils.currentLine=45023259;
 //BA.debugLineNum = 45023259;BA.debugLine="End Sub";
return "";
}
public static String  _dameruta(anywheresoftware.b4a.BA _ba,String _inicioruta,String _origenruta) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "dameruta", false))
	 {return ((String) Debug.delegate(null, "dameruta", new Object[] {_ba,_inicioruta,_origenruta}));}
String _fechainicio = "";
anywheresoftware.b4a.sql.SQL.CursorWrapper _c = null;
String _ruta2 = "";
int _i = 0;
RDebugUtils.currentLine=43778048;
 //BA.debugLineNum = 43778048;BA.debugLine="Sub dameRuta(inicioRuta As String, origenRuta As S";
RDebugUtils.currentLine=43778050;
 //BA.debugLineNum = 43778050;BA.debugLine="Dim fechaInicio As String";
_fechainicio = "";
RDebugUtils.currentLine=43778051;
 //BA.debugLineNum = 43778051;BA.debugLine="Try 'incioRuta es numero";
try {RDebugUtils.currentLine=43778052;
 //BA.debugLineNum = 43778052;BA.debugLine="inicioRuta = inicioRuta * 1";
_inicioruta = BA.NumberToString((double)(Double.parseDouble(_inicioruta))*1);
RDebugUtils.currentLine=43778054;
 //BA.debugLineNum = 43778054;BA.debugLine="fechaInicio = fechaKMT(DateTime.Now - (DateTime.";
_fechainicio = _fechakmt(_ba,BA.NumberToString(anywheresoftware.b4a.keywords.Common.DateTime.getNow()-(anywheresoftware.b4a.keywords.Common.DateTime.TicksPerHour*(double)(Double.parseDouble(_inicioruta)))));
 } 
       catch (Exception e6) {
			(_ba.processBA == null ? _ba : _ba.processBA).setLastException(e6);RDebugUtils.currentLine=43778056;
 //BA.debugLineNum = 43778056;BA.debugLine="fechaInicio = fechaInicioHoy";
_fechainicio = _fechainiciohoy(_ba);
 };
RDebugUtils.currentLine=43778059;
 //BA.debugLineNum = 43778059;BA.debugLine="If subsLogs Then Log(\"fechaInicio: \"&fechaInicio&";
if (_subslogs) { 
anywheresoftware.b4a.keywords.Common.LogImpl("043778059","fechaInicio: "+_fechainicio+" | rutaHrsAtras="+BA.NumberToString(_rutahrsatras),0);};
RDebugUtils.currentLine=43778060;
 //BA.debugLineNum = 43778060;BA.debugLine="Dim c As Cursor";
_c = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
RDebugUtils.currentLine=43778061;
 //BA.debugLineNum = 43778061;BA.debugLine="If kmt.IsInitialized = False Then kmt.Initialize(";
if (_kmt.IsInitialized()==anywheresoftware.b4a.keywords.Common.False) { 
_kmt.Initialize(mostCurrent._starter._ruta /*String*/ ,"kmt.db",anywheresoftware.b4a.keywords.Common.True);};
RDebugUtils.currentLine=43778062;
 //BA.debugLineNum = 43778062;BA.debugLine="If subsLogs Then Log(\"select FECHA, LAT, LON from";
if (_subslogs) { 
anywheresoftware.b4a.keywords.Common.LogImpl("043778062","select FECHA, LAT, LON from "+_origenruta+" where FECHA > "+_fechainicio+" order by FECHA desc limit "+BA.NumberToString(_rutamaxpoints),0);};
RDebugUtils.currentLine=43778063;
 //BA.debugLineNum = 43778063;BA.debugLine="c = kmt.ExecQuery(\"select FECHA, LAT, LON from \"&";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_kmt.ExecQuery("select FECHA, LAT, LON from "+_origenruta+" where FECHA > "+_fechainicio+" order by FECHA desc limit "+BA.NumberToString(_rutamaxpoints))));
RDebugUtils.currentLine=43778064;
 //BA.debugLineNum = 43778064;BA.debugLine="c.Position = 0";
_c.setPosition((int) (0));
RDebugUtils.currentLine=43778065;
 //BA.debugLineNum = 43778065;BA.debugLine="Dim ruta2 As String = \"\"";
_ruta2 = "";
RDebugUtils.currentLine=43778066;
 //BA.debugLineNum = 43778066;BA.debugLine="If c.RowCount>0 Then";
if (_c.getRowCount()>0) { 
RDebugUtils.currentLine=43778067;
 //BA.debugLineNum = 43778067;BA.debugLine="For i=0 To c.RowCount -1";
{
final int step16 = 1;
final int limit16 = (int) (_c.getRowCount()-1);
_i = (int) (0) ;
for (;_i <= limit16 ;_i = _i + step16 ) {
RDebugUtils.currentLine=43778068;
 //BA.debugLineNum = 43778068;BA.debugLine="c.Position=i";
_c.setPosition(_i);
RDebugUtils.currentLine=43778069;
 //BA.debugLineNum = 43778069;BA.debugLine="ruta2=ruta2&CRLF&c.GetString(\"LAT\")&\",\"&c.GetSt";
_ruta2 = _ruta2+anywheresoftware.b4a.keywords.Common.CRLF+_c.GetString("LAT")+","+_c.GetString("LON")+","+_c.GetString("FECHA");
RDebugUtils.currentLine=43778070;
 //BA.debugLineNum = 43778070;BA.debugLine="B4XPages.MainPage.fechaRuta = c.GetString(\"FECH";
mostCurrent._b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (_ba)._fecharuta /*String*/  = _c.GetString("FECHA");
 }
};
 };
RDebugUtils.currentLine=43778073;
 //BA.debugLineNum = 43778073;BA.debugLine="c.Close";
_c.Close();
RDebugUtils.currentLine=43778074;
 //BA.debugLineNum = 43778074;BA.debugLine="Return compress(ruta2)";
if (true) return _compress(_ba,_ruta2);
RDebugUtils.currentLine=43778075;
 //BA.debugLineNum = 43778075;BA.debugLine="End Sub";
return "";
}
public static String  _fechainiciohoy(anywheresoftware.b4a.BA _ba) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "fechainiciohoy", false))
	 {return ((String) Debug.delegate(null, "fechainiciohoy", new Object[] {_ba}));}
String _origformat = "";
String _h = "";
RDebugUtils.currentLine=44367872;
 //BA.debugLineNum = 44367872;BA.debugLine="Sub fechaInicioHoy As String 'ignore";
RDebugUtils.currentLine=44367873;
 //BA.debugLineNum = 44367873;BA.debugLine="Dim OrigFormat As String = DateTime.DateFormat";
_origformat = anywheresoftware.b4a.keywords.Common.DateTime.getDateFormat();
RDebugUtils.currentLine=44367874;
 //BA.debugLineNum = 44367874;BA.debugLine="DateTime.DateFormat=\"yyMMdd\"";
anywheresoftware.b4a.keywords.Common.DateTime.setDateFormat("yyMMdd");
RDebugUtils.currentLine=44367875;
 //BA.debugLineNum = 44367875;BA.debugLine="Private h As String = DateTime.Date(DateTime.Now";
_h = anywheresoftware.b4a.keywords.Common.DateTime.Date(anywheresoftware.b4a.keywords.Common.DateTime.getNow())+"000000";
RDebugUtils.currentLine=44367876;
 //BA.debugLineNum = 44367876;BA.debugLine="DateTime.DateFormat=OrigFormat  'return to orig";
anywheresoftware.b4a.keywords.Common.DateTime.setDateFormat(_origformat);
RDebugUtils.currentLine=44367877;
 //BA.debugLineNum = 44367877;BA.debugLine="Log(\"Hoy=\"&h)";
anywheresoftware.b4a.keywords.Common.LogImpl("044367877","Hoy="+_h,0);
RDebugUtils.currentLine=44367878;
 //BA.debugLineNum = 44367878;BA.debugLine="Return h";
if (true) return _h;
RDebugUtils.currentLine=44367879;
 //BA.debugLineNum = 44367879;BA.debugLine="End Sub";
return "";
}
public static String  _dameusuariodedb(anywheresoftware.b4a.BA _ba) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "dameusuariodedb", false))
	 {return ((String) Debug.delegate(null, "dameusuariodedb", new Object[] {_ba}));}
anywheresoftware.b4a.sql.SQL.CursorWrapper _c = null;
String _u = "";
RDebugUtils.currentLine=45744128;
 //BA.debugLineNum = 45744128;BA.debugLine="Sub dameUsuarioDeDB As String 'ignore";
RDebugUtils.currentLine=45744129;
 //BA.debugLineNum = 45744129;BA.debugLine="Private c As Cursor";
_c = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
RDebugUtils.currentLine=45744130;
 //BA.debugLineNum = 45744130;BA.debugLine="Private u As String = \"SinUsuario\"";
_u = "SinUsuario";
RDebugUtils.currentLine=45744131;
 //BA.debugLineNum = 45744131;BA.debugLine="If Not(kmt.IsInitialized) Then revisaBD";
if (anywheresoftware.b4a.keywords.Common.Not(_kmt.IsInitialized())) { 
_revisabd(_ba);};
RDebugUtils.currentLine=45744132;
 //BA.debugLineNum = 45744132;BA.debugLine="c=kmt.ExecQuery(\"select USUARIO from usuarioa\")";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_kmt.ExecQuery("select USUARIO from usuarioa")));
RDebugUtils.currentLine=45744133;
 //BA.debugLineNum = 45744133;BA.debugLine="c.Position=0";
_c.setPosition((int) (0));
RDebugUtils.currentLine=45744134;
 //BA.debugLineNum = 45744134;BA.debugLine="If c.RowCount > 0 Then u = c.GetString(\"USUARIO\")";
if (_c.getRowCount()>0) { 
_u = _c.GetString("USUARIO");};
RDebugUtils.currentLine=45744135;
 //BA.debugLineNum = 45744135;BA.debugLine="c.Close";
_c.Close();
RDebugUtils.currentLine=45744136;
 //BA.debugLineNum = 45744136;BA.debugLine="Return u";
if (true) return _u;
RDebugUtils.currentLine=45744137;
 //BA.debugLineNum = 45744137;BA.debugLine="End Sub";
return "";
}
public static String  _decompress(anywheresoftware.b4a.BA _ba,String _base64) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "decompress", false))
	 {return ((String) Debug.delegate(null, "decompress", new Object[] {_ba,_base64}));}
byte[] _decompressedbytes = null;
anywheresoftware.b4a.agraham.byteconverter.ByteConverter _bc = null;
String _uncompressed = "";
RDebugUtils.currentLine=43384832;
 //BA.debugLineNum = 43384832;BA.debugLine="Sub decompress(base64 As String) As String 'ignore";
RDebugUtils.currentLine=43384833;
 //BA.debugLineNum = 43384833;BA.debugLine="Dim decompressedbytes() As Byte = su.DecodeBase64";
_decompressedbytes = _su.DecodeBase64(_base64);
RDebugUtils.currentLine=43384835;
 //BA.debugLineNum = 43384835;BA.debugLine="Dim bc As ByteConverter";
_bc = new anywheresoftware.b4a.agraham.byteconverter.ByteConverter();
RDebugUtils.currentLine=43384836;
 //BA.debugLineNum = 43384836;BA.debugLine="Dim uncompressed As String = bc.StringFromBytes(d";
_uncompressed = _bc.StringFromBytes(_decompressedbytes,"UTF8");
RDebugUtils.currentLine=43384837;
 //BA.debugLineNum = 43384837;BA.debugLine="Log($\"Descomprimido: ${uncompressed.Length}\"$)";
anywheresoftware.b4a.keywords.Common.LogImpl("043384837",("Descomprimido: "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_uncompressed.length()))+""),0);
RDebugUtils.currentLine=43384839;
 //BA.debugLineNum = 43384839;BA.debugLine="Return uncompressed";
if (true) return _uncompressed;
RDebugUtils.currentLine=43384840;
 //BA.debugLineNum = 43384840;BA.debugLine="End Sub";
return "";
}
public static String  _deleteerrorlog_db(anywheresoftware.b4a.BA _ba) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "deleteerrorlog_db", false))
	 {return ((String) Debug.delegate(null, "deleteerrorlog_db", new Object[] {_ba}));}
RDebugUtils.currentLine=43909120;
 //BA.debugLineNum = 43909120;BA.debugLine="Sub deleteErrorLog_DB 'ignore";
RDebugUtils.currentLine=43909121;
 //BA.debugLineNum = 43909121;BA.debugLine="errorLog.ExecNonQuery(\"delete from errores\")";
_errorlog.ExecNonQuery("delete from errores");
RDebugUtils.currentLine=43909122;
 //BA.debugLineNum = 43909122;BA.debugLine="errorLog.ExecNonQuery(\"vacuum;\")";
_errorlog.ExecNonQuery("vacuum;");
RDebugUtils.currentLine=43909123;
 //BA.debugLineNum = 43909123;BA.debugLine="ToastMessageShow(\"BD Errores Borrada\", False)";
anywheresoftware.b4a.keywords.Common.ToastMessageShow(BA.ObjectToCharSequence("BD Errores Borrada"),anywheresoftware.b4a.keywords.Common.False);
RDebugUtils.currentLine=43909124;
 //BA.debugLineNum = 43909124;BA.debugLine="End Sub";
return "";
}
public static String  _deletegps_db(anywheresoftware.b4a.BA _ba) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "deletegps_db", false))
	 {return ((String) Debug.delegate(null, "deletegps_db", new Object[] {_ba}));}
RDebugUtils.currentLine=43843584;
 //BA.debugLineNum = 43843584;BA.debugLine="Sub deleteGPS_DB 'ignore";
RDebugUtils.currentLine=43843585;
 //BA.debugLineNum = 43843585;BA.debugLine="kmt.ExecNonQuery(\"delete from RUTA_GPS\")";
_kmt.ExecNonQuery("delete from RUTA_GPS");
RDebugUtils.currentLine=43843586;
 //BA.debugLineNum = 43843586;BA.debugLine="kmt.ExecNonQuery(\"vacuum;\")";
_kmt.ExecNonQuery("vacuum;");
RDebugUtils.currentLine=43843587;
 //BA.debugLineNum = 43843587;BA.debugLine="ToastMessageShow(\"Borramos BD Coords GPS\", False)";
anywheresoftware.b4a.keywords.Common.ToastMessageShow(BA.ObjectToCharSequence("Borramos BD Coords GPS"),anywheresoftware.b4a.keywords.Common.False);
RDebugUtils.currentLine=43843588;
 //BA.debugLineNum = 43843588;BA.debugLine="End Sub";
return "";
}
public static String  _enviawhatsappmsg(anywheresoftware.b4a.BA _ba) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "enviawhatsappmsg", false))
	 {return ((String) Debug.delegate(null, "enviawhatsappmsg", new Object[] {_ba}));}
RDebugUtils.currentLine=49283072;
 //BA.debugLineNum = 49283072;BA.debugLine="Sub enviaWhatsappMsg()";
RDebugUtils.currentLine=49283107;
 //BA.debugLineNum = 49283107;BA.debugLine="End Sub";
return "";
}
public static long  _fechakmt2ticks(anywheresoftware.b4a.BA _ba,String _fkmt) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "fechakmt2ticks", false))
	 {return ((Long) Debug.delegate(null, "fechakmt2ticks", new Object[] {_ba,_fkmt}));}
String _partefecha = "";
String _partehora = "";
String _origformat = "";
long _ticks = 0L;
RDebugUtils.currentLine=45088768;
 //BA.debugLineNum = 45088768;BA.debugLine="Sub fechaKMT2Ticks(fKMT As String) As Long 'ignore";
RDebugUtils.currentLine=45088769;
 //BA.debugLineNum = 45088769;BA.debugLine="Try";
try {RDebugUtils.currentLine=45088770;
 //BA.debugLineNum = 45088770;BA.debugLine="If fKMT.Length = 12 Then";
if (_fkmt.length()==12) { 
RDebugUtils.currentLine=45088771;
 //BA.debugLineNum = 45088771;BA.debugLine="Private parteFecha As String = fKMT.SubString2(";
_partefecha = _fkmt.substring((int) (0),(int) (6));
RDebugUtils.currentLine=45088772;
 //BA.debugLineNum = 45088772;BA.debugLine="Private parteHora As String = fKMT.SubString(6)";
_partehora = _fkmt.substring((int) (6));
RDebugUtils.currentLine=45088773;
 //BA.debugLineNum = 45088773;BA.debugLine="Private OrigFormat As String = DateTime.DateFor";
_origformat = anywheresoftware.b4a.keywords.Common.DateTime.getDateFormat();
RDebugUtils.currentLine=45088774;
 //BA.debugLineNum = 45088774;BA.debugLine="DateTime.DateFormat=\"yymmdd\"";
anywheresoftware.b4a.keywords.Common.DateTime.setDateFormat("yymmdd");
RDebugUtils.currentLine=45088775;
 //BA.debugLineNum = 45088775;BA.debugLine="DateTime.TimeFormat=\"HHmmss\"";
anywheresoftware.b4a.keywords.Common.DateTime.setTimeFormat("HHmmss");
RDebugUtils.currentLine=45088776;
 //BA.debugLineNum = 45088776;BA.debugLine="Private ticks As Long = DateTime.DateTimeParse(";
_ticks = anywheresoftware.b4a.keywords.Common.DateTime.DateTimeParse(_partefecha,_partehora);
RDebugUtils.currentLine=45088777;
 //BA.debugLineNum = 45088777;BA.debugLine="DateTime.DateFormat=OrigFormat  'return to orig";
anywheresoftware.b4a.keywords.Common.DateTime.setDateFormat(_origformat);
RDebugUtils.currentLine=45088778;
 //BA.debugLineNum = 45088778;BA.debugLine="Return ticks";
if (true) return _ticks;
 }else {
RDebugUtils.currentLine=45088780;
 //BA.debugLineNum = 45088780;BA.debugLine="Log(\"Formato de fecha incorrecto, debe de ser '";
anywheresoftware.b4a.keywords.Common.LogImpl("045088780","Formato de fecha incorrecto, debe de ser 'YYMMDDHHMMSS', no '"+_fkmt+"' largo="+BA.NumberToString(_fkmt.length()),0);
RDebugUtils.currentLine=45088781;
 //BA.debugLineNum = 45088781;BA.debugLine="Return 0";
if (true) return (long) (0);
 };
 } 
       catch (Exception e16) {
			(_ba.processBA == null ? _ba : _ba.processBA).setLastException(e16);RDebugUtils.currentLine=45088784;
 //BA.debugLineNum = 45088784;BA.debugLine="Log(LastException)";
anywheresoftware.b4a.keywords.Common.LogImpl("045088784",BA.ObjectToString(anywheresoftware.b4a.keywords.Common.LastException(_ba)),0);
RDebugUtils.currentLine=45088785;
 //BA.debugLineNum = 45088785;BA.debugLine="LogColor($\"Fecha dada: ${fKMT}, Parte Fecha: ${p";
anywheresoftware.b4a.keywords.Common.LogImpl("045088785",("Fecha dada: "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_fkmt))+", Parte Fecha: "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_partefecha))+", Parte Hora: "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_partehora))+""),anywheresoftware.b4a.keywords.Common.Colors.Red);
RDebugUtils.currentLine=45088786;
 //BA.debugLineNum = 45088786;BA.debugLine="Return 0";
if (true) return (long) (0);
 };
RDebugUtils.currentLine=45088788;
 //BA.debugLineNum = 45088788;BA.debugLine="End Sub";
return 0L;
}
public static String  _getphnid(anywheresoftware.b4a.BA _ba) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "getphnid", false))
	 {return ((String) Debug.delegate(null, "getphnid", new Object[] {_ba}));}
String _t = "";
String _s = "";
RDebugUtils.currentLine=43122688;
 //BA.debugLineNum = 43122688;BA.debugLine="Sub getPhnId As String 'ignore";
RDebugUtils.currentLine=43122690;
 //BA.debugLineNum = 43122690;BA.debugLine="devModel = phn.Model";
_devmodel = _phn.getModel();
RDebugUtils.currentLine=43122691;
 //BA.debugLineNum = 43122691;BA.debugLine="If devModel.Length <= 3 Then 'Si phn.Model esta e";
if (_devmodel.length()<=3) { 
RDebugUtils.currentLine=43122692;
 //BA.debugLineNum = 43122692;BA.debugLine="Dim t As String = phn.GetSettings(\"android_id\")";
_t = _phn.GetSettings("android_id");
RDebugUtils.currentLine=43122693;
 //BA.debugLineNum = 43122693;BA.debugLine="devModel = t";
_devmodel = _t;
 };
RDebugUtils.currentLine=43122695;
 //BA.debugLineNum = 43122695;BA.debugLine="If devModel.Length >= 3 Then 'Si tenemos valor pa";
if (_devmodel.length()>=3) { 
RDebugUtils.currentLine=43122696;
 //BA.debugLineNum = 43122696;BA.debugLine="File.WriteString(File.DirInternal, \"phnId.txt\",";
anywheresoftware.b4a.keywords.Common.File.WriteString(anywheresoftware.b4a.keywords.Common.File.getDirInternal(),"phnId.txt",_devmodel);
 }else 
{RDebugUtils.currentLine=43122698;
 //BA.debugLineNum = 43122698;BA.debugLine="Else If devModel.Length < 3 Then ' Si no tenemos";
if (_devmodel.length()<3) { 
RDebugUtils.currentLine=43122699;
 //BA.debugLineNum = 43122699;BA.debugLine="Dim s As String = File.ReadString(File.DirIntern";
_s = anywheresoftware.b4a.keywords.Common.File.ReadString(anywheresoftware.b4a.keywords.Common.File.getDirInternal(),"phnId.txt");
RDebugUtils.currentLine=43122700;
 //BA.debugLineNum = 43122700;BA.debugLine="devModel = s";
_devmodel = _s;
 }}
;
RDebugUtils.currentLine=43122704;
 //BA.debugLineNum = 43122704;BA.debugLine="Return devModel";
if (true) return _devmodel;
RDebugUtils.currentLine=43122705;
 //BA.debugLineNum = 43122705;BA.debugLine="End Sub";
return "";
}
public static String  _getssid(anywheresoftware.b4a.BA _ba) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "getssid", false))
	 {return ((String) Debug.delegate(null, "getssid", new Object[] {_ba}));}
RDebugUtils.currentLine=44171264;
 //BA.debugLineNum = 44171264;BA.debugLine="Sub getSSID  'ignore";
RDebugUtils.currentLine=44171269;
 //BA.debugLineNum = 44171269;BA.debugLine="End Sub";
return "";
}
public static String  _guardainfoenarchivo(anywheresoftware.b4a.BA _ba,String _coords) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "guardainfoenarchivo", false))
	 {return ((String) Debug.delegate(null, "guardainfoenarchivo", new Object[] {_ba,_coords}));}
String _origformat = "";
String _lastupdate = "";
String _ubic = "";
anywheresoftware.b4a.objects.streams.File.OutputStreamWrapper _out = null;
String _s = "";
byte[] _t = null;
RDebugUtils.currentLine=43646976;
 //BA.debugLineNum = 43646976;BA.debugLine="Sub guardaInfoEnArchivo(coords As String) 'ignore";
RDebugUtils.currentLine=43646978;
 //BA.debugLineNum = 43646978;BA.debugLine="Dim OrigFormat As String=DateTime.DateFormat  'sa";
_origformat = anywheresoftware.b4a.keywords.Common.DateTime.getDateFormat();
RDebugUtils.currentLine=43646979;
 //BA.debugLineNum = 43646979;BA.debugLine="DateTime.DateFormat=\"MMM-dd HH:mm:ss\"";
anywheresoftware.b4a.keywords.Common.DateTime.setDateFormat("MMM-dd HH:mm:ss");
RDebugUtils.currentLine=43646980;
 //BA.debugLineNum = 43646980;BA.debugLine="Dim lastUpdate As String=DateTime.Date(DateTime.N";
_lastupdate = anywheresoftware.b4a.keywords.Common.DateTime.Date(anywheresoftware.b4a.keywords.Common.DateTime.getNow());
RDebugUtils.currentLine=43646981;
 //BA.debugLineNum = 43646981;BA.debugLine="DateTime.DateFormat=OrigFormat  'return to orig d";
anywheresoftware.b4a.keywords.Common.DateTime.setDateFormat(_origformat);
RDebugUtils.currentLine=43646983;
 //BA.debugLineNum = 43646983;BA.debugLine="Dim ubic As String = coords&\",\"&lastUpdate";
_ubic = _coords+","+_lastupdate;
RDebugUtils.currentLine=43646984;
 //BA.debugLineNum = 43646984;BA.debugLine="Dim out As OutputStream = File.OpenOutput(File.Di";
_out = new anywheresoftware.b4a.objects.streams.File.OutputStreamWrapper();
_out = anywheresoftware.b4a.keywords.Common.File.OpenOutput(anywheresoftware.b4a.keywords.Common.File.getDirRootExternal(),"gps.txt",anywheresoftware.b4a.keywords.Common.True);
RDebugUtils.currentLine=43646985;
 //BA.debugLineNum = 43646985;BA.debugLine="Dim s As String = ubic & CRLF";
_s = _ubic+anywheresoftware.b4a.keywords.Common.CRLF;
RDebugUtils.currentLine=43646986;
 //BA.debugLineNum = 43646986;BA.debugLine="Dim t() As Byte = s.GetBytes(\"UTF-8\")";
_t = _s.getBytes("UTF-8");
RDebugUtils.currentLine=43646987;
 //BA.debugLineNum = 43646987;BA.debugLine="out.WriteBytes(t, 0, t.Length)";
_out.WriteBytes(_t,(int) (0),_t.length);
RDebugUtils.currentLine=43646988;
 //BA.debugLineNum = 43646988;BA.debugLine="out.Close";
_out.Close();
RDebugUtils.currentLine=43646989;
 //BA.debugLineNum = 43646989;BA.debugLine="End Sub";
return "";
}
public static String  _guardainfoenbd(anywheresoftware.b4a.BA _ba,String _coords) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "guardainfoenbd", false))
	 {return ((String) Debug.delegate(null, "guardainfoenbd", new Object[] {_ba,_coords}));}
String[] _latlon = null;
RDebugUtils.currentLine=43712512;
 //BA.debugLineNum = 43712512;BA.debugLine="Sub guardaInfoEnBD(coords As String) 'ignore";
RDebugUtils.currentLine=43712513;
 //BA.debugLineNum = 43712513;BA.debugLine="Log(\"Guardamos ubicacion en BD - \"&coords)";
anywheresoftware.b4a.keywords.Common.LogImpl("043712513","Guardamos ubicacion en BD - "+_coords,0);
RDebugUtils.currentLine=43712514;
 //BA.debugLineNum = 43712514;BA.debugLine="Try";
try {RDebugUtils.currentLine=43712515;
 //BA.debugLineNum = 43712515;BA.debugLine="Dim latlon() As String = Regex.Split(\"\\|\", coord";
_latlon = anywheresoftware.b4a.keywords.Common.Regex.Split("\\|",_coords);
RDebugUtils.currentLine=43712516;
 //BA.debugLineNum = 43712516;BA.debugLine="If latlon.Length < 2 Then latlon = Regex.Split(\"";
if (_latlon.length<2) { 
_latlon = anywheresoftware.b4a.keywords.Common.Regex.Split(",",_coords);};
RDebugUtils.currentLine=43712517;
 //BA.debugLineNum = 43712517;BA.debugLine="If subsLogs Then Log(\"LatLon=\"&latlon)";
if (_subslogs) { 
anywheresoftware.b4a.keywords.Common.LogImpl("043712517","LatLon="+BA.ObjectToString(_latlon),0);};
RDebugUtils.currentLine=43712518;
 //BA.debugLineNum = 43712518;BA.debugLine="kmt.ExecNonQuery2(\"INSERT INTO RUTA_GPS(FECHA, L";
_kmt.ExecNonQuery2("INSERT INTO RUTA_GPS(FECHA, LAT, LON) VALUES (?,?,?)",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(_latlon[(int) (2)]),(Object)(_latlon[(int) (0)]),(Object)(_latlon[(int) (1)])}));
 } 
       catch (Exception e8) {
			(_ba.processBA == null ? _ba : _ba.processBA).setLastException(e8);RDebugUtils.currentLine=43712520;
 //BA.debugLineNum = 43712520;BA.debugLine="LogColor(LastException, Colors.red)";
anywheresoftware.b4a.keywords.Common.LogImpl("043712520",BA.ObjectToString(anywheresoftware.b4a.keywords.Common.LastException(_ba)),anywheresoftware.b4a.keywords.Common.Colors.Red);
 };
RDebugUtils.currentLine=43712522;
 //BA.debugLineNum = 43712522;BA.debugLine="End Sub";
return "";
}
public static String  _guardaproducto(anywheresoftware.b4a.BA _ba,String _cedis,String _costou,String _cant,String _nombre,String _prodid,String _clienteid,String _fecha,String _usuario,String _rutav,String _preciosin,String _tipoventa) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "guardaproducto", false))
	 {return ((String) Debug.delegate(null, "guardaproducto", new Object[] {_ba,_cedis,_costou,_cant,_nombre,_prodid,_clienteid,_fecha,_usuario,_rutav,_preciosin,_tipoventa}));}
anywheresoftware.b4a.sql.SQL.CursorWrapper _c = null;
RDebugUtils.currentLine=46792704;
 //BA.debugLineNum = 46792704;BA.debugLine="Sub guardaProducto(cedis As String, costoU As Stri";
RDebugUtils.currentLine=46792705;
 //BA.debugLineNum = 46792705;BA.debugLine="LogColor(\"guardaProducto: \"&prodId&\", cant=\"&cant";
anywheresoftware.b4a.keywords.Common.LogImpl("046792705","guardaProducto: "+_prodid+", cant="+_cant+" - TV:"+_tipoventa,anywheresoftware.b4a.keywords.Common.Colors.Magenta);
RDebugUtils.currentLine=46792706;
 //BA.debugLineNum = 46792706;BA.debugLine="Private c As Cursor";
_c = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
RDebugUtils.currentLine=46792707;
 //BA.debugLineNum = 46792707;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"INSERT INTO";
mostCurrent._b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (_ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("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(?,?,?,?,?,?,?,?,?,?,?,?) ",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(_cedis),(Object)(((double)(Double.parseDouble(_cant))*(double)(Double.parseDouble(_costou)))),(Object)(_costou),(Object)(_cant),(Object)(_nombre),(Object)(_prodid),(Object)(_clienteid),(Object)(_fecha),(Object)(_usuario),(Object)(_traerutabitacora(_ba)),(Object)(_preciosin),(Object)(_tipoventa)}));
RDebugUtils.currentLine=46792708;
 //BA.debugLineNum = 46792708;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2($\"update ${t";
mostCurrent._b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (_ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2(("update "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_traetablaprods(_ba,_traetipoventadebd(_ba))))+" set cat_gp_almacen = cat_gp_almacen - ? where cat_gp_id = ? "),anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(_cant),(Object)(_prodid)}));
RDebugUtils.currentLine=46792709;
 //BA.debugLineNum = 46792709;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"select sum(pe";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(mostCurrent._b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (_ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("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)")));
RDebugUtils.currentLine=46792710;
 //BA.debugLineNum = 46792710;BA.debugLine="c.Position=0";
_c.setPosition((int) (0));
RDebugUtils.currentLine=46792711;
 //BA.debugLineNum = 46792711;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"delete from";
mostCurrent._b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (_ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("delete from pedido_cliente where PC_CLIENTE In (select cuenta from cuentaa)");
RDebugUtils.currentLine=46792712;
 //BA.debugLineNum = 46792712;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"insert into";
mostCurrent._b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (_ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("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 (?,?,?,?,?,?,?,?,?,?)",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(_clienteid),(Object)(_fecha),(Object)(_usuario),(Object)(_c.GetString("CANT_CLIE")),(Object)(_c.GetString("TOTAL_CLIE")),(Object)(mostCurrent._b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (_ba)._lon_gps /*String*/ ),(Object)(mostCurrent._b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (_ba)._lat_gps /*String*/ ),(Object)(_cedis),(Object)(_c.GetString("TOTAL_CLIE_SIN"))}));
RDebugUtils.currentLine=46792713;
 //BA.debugLineNum = 46792713;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"UPDATE kmt_i";
mostCurrent._b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (_ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("UPDATE kmt_info3 set gestion = 2  where CAT_CL_CODIGO In (select cuenta from cuentaa)");
RDebugUtils.currentLine=46792714;
 //BA.debugLineNum = 46792714;BA.debugLine="End Sub";
return "";
}
public static String  _traerutabitacora(anywheresoftware.b4a.BA _ba) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "traerutabitacora", false))
	 {return ((String) Debug.delegate(null, "traerutabitacora", new Object[] {_ba}));}
anywheresoftware.b4a.sql.SQL.CursorWrapper _c = null;
String _r = "";
RDebugUtils.currentLine=46399488;
 //BA.debugLineNum = 46399488;BA.debugLine="Sub traeRutaBitacora As String 'ignore";
RDebugUtils.currentLine=46399489;
 //BA.debugLineNum = 46399489;BA.debugLine="Private c As Cursor";
_c = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
RDebugUtils.currentLine=46399490;
 //BA.debugLineNum = 46399490;BA.debugLine="Private r As String";
_r = "";
RDebugUtils.currentLine=46399491;
 //BA.debugLineNum = 46399491;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"select CAT_CL";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(mostCurrent._b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (_ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select CAT_CL_RUTA from kmt_info3 WHERE CAT_CL_CODIGO IN (SELECT CUENTA FROM CUENTAA)")));
RDebugUtils.currentLine=46399492;
 //BA.debugLineNum = 46399492;BA.debugLine="r = \"0\"";
_r = "0";
RDebugUtils.currentLine=46399493;
 //BA.debugLineNum = 46399493;BA.debugLine="If c.RowCount > 0 Then";
if (_c.getRowCount()>0) { 
RDebugUtils.currentLine=46399494;
 //BA.debugLineNum = 46399494;BA.debugLine="c.Position=0";
_c.setPosition((int) (0));
RDebugUtils.currentLine=46399495;
 //BA.debugLineNum = 46399495;BA.debugLine="r = c.GetString(\"CAT_CL_RUTA\")";
_r = _c.GetString("CAT_CL_RUTA");
 };
RDebugUtils.currentLine=46399497;
 //BA.debugLineNum = 46399497;BA.debugLine="c.Close";
_c.Close();
RDebugUtils.currentLine=46399498;
 //BA.debugLineNum = 46399498;BA.debugLine="Return r";
if (true) return _r;
RDebugUtils.currentLine=46399499;
 //BA.debugLineNum = 46399499;BA.debugLine="End Sub";
return "";
}
public static String  _guardaproductosin(anywheresoftware.b4a.BA _ba,String _cedis,String _costotot,String _costou,String _cant,String _nombre,String _prodid,String _clienteid,String _fecha,String _usuario,String _rutav,String _preciosin,String _tipov,String _precio2,String _query) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "guardaproductosin", false))
	 {return ((String) Debug.delegate(null, "guardaproductosin", new Object[] {_ba,_cedis,_costotot,_costou,_cant,_nombre,_prodid,_clienteid,_fecha,_usuario,_rutav,_preciosin,_tipov,_precio2,_query}));}
RDebugUtils.currentLine=45875200;
 //BA.debugLineNum = 45875200;BA.debugLine="Sub guardaProductoSin(cedis As String, costoTot As";
RDebugUtils.currentLine=45875213;
 //BA.debugLineNum = 45875213;BA.debugLine="ToastMessageShow(\"guardaProdSin\", False)";
anywheresoftware.b4a.keywords.Common.ToastMessageShow(BA.ObjectToCharSequence("guardaProdSin"),anywheresoftware.b4a.keywords.Common.False);
RDebugUtils.currentLine=45875214;
 //BA.debugLineNum = 45875214;BA.debugLine="End Sub";
return "";
}
public static String  _guardaproductox(anywheresoftware.b4a.BA _ba,String _cedis,String _costotot,String _costou,String _cant,String _nombre,String _prodid,String _clienteid,String _fecha,String _usuario,String _tipov,String _precio2,String _query) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "guardaproductox", false))
	 {return ((String) Debug.delegate(null, "guardaproductox", new Object[] {_ba,_cedis,_costotot,_costou,_cant,_nombre,_prodid,_clienteid,_fecha,_usuario,_tipov,_precio2,_query}));}
RDebugUtils.currentLine=45809664;
 //BA.debugLineNum = 45809664;BA.debugLine="Sub guardaProductoX(cedis As String, costoTot As S";
RDebugUtils.currentLine=45809670;
 //BA.debugLineNum = 45809670;BA.debugLine="End Sub";
return "";
}
public static boolean  _haypedido(anywheresoftware.b4a.BA _ba) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "haypedido", false))
	 {return ((Boolean) Debug.delegate(null, "haypedido", new Object[] {_ba}));}
anywheresoftware.b4a.sql.SQL.CursorWrapper _thisc = null;
boolean _hay = false;
RDebugUtils.currentLine=46727168;
 //BA.debugLineNum = 46727168;BA.debugLine="Sub hayPedido As Boolean";
RDebugUtils.currentLine=46727169;
 //BA.debugLineNum = 46727169;BA.debugLine="Private thisC As Cursor=B4XPages.MainPage.skmt.Ex";
_thisc = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_thisc = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(mostCurrent._b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (_ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery(("select count(PE_CLIENTE) as hayPedido from PEDIDO where PE_CLIENTE = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_traecliente(_ba)))+"'"))));
RDebugUtils.currentLine=46727170;
 //BA.debugLineNum = 46727170;BA.debugLine="thisC.Position=0";
_thisc.setPosition((int) (0));
RDebugUtils.currentLine=46727171;
 //BA.debugLineNum = 46727171;BA.debugLine="Private hay As Boolean = False";
_hay = anywheresoftware.b4a.keywords.Common.False;
RDebugUtils.currentLine=46727172;
 //BA.debugLineNum = 46727172;BA.debugLine="If thisC.GetInt(\"hayPedido\") > 0 Then hay = True";
if (_thisc.GetInt("hayPedido")>0) { 
_hay = anywheresoftware.b4a.keywords.Common.True;};
RDebugUtils.currentLine=46727174;
 //BA.debugLineNum = 46727174;BA.debugLine="Return hay";
if (true) return _hay;
RDebugUtils.currentLine=46727175;
 //BA.debugLineNum = 46727175;BA.debugLine="End Sub";
return false;
}
public static String  _iniciaactividad(anywheresoftware.b4a.BA _ba,String _ia) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "iniciaactividad", false))
	 {return ((String) Debug.delegate(null, "iniciaactividad", new Object[] {_ba,_ia}));}
RDebugUtils.currentLine=48037888;
 //BA.debugLineNum = 48037888;BA.debugLine="Sub iniciaActividad(ia As String)";
RDebugUtils.currentLine=48037889;
 //BA.debugLineNum = 48037889;BA.debugLine="If ia <> \"\" And ia <> Null Then";
if ((_ia).equals("") == false && _ia!= null) { 
RDebugUtils.currentLine=48037891;
 //BA.debugLineNum = 48037891;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"delete fro";
mostCurrent._b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (_ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("delete from CAT_VARIABLES where CAT_VA_DESCRIPCION = ?",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)("ULTIMOMODULO")}));
RDebugUtils.currentLine=48037892;
 //BA.debugLineNum = 48037892;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"INSERT INT";
mostCurrent._b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (_ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("INSERT INTO CAT_VARIABLES(CAT_VA_DESCRIPCION, CAT_VA_VALOR) VALUES (?,?)",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)("ULTIMOMODULO"),(Object)(_ia)}));
RDebugUtils.currentLine=48037893;
 //BA.debugLineNum = 48037893;BA.debugLine="B4XPages.ShowPage(ia)";
mostCurrent._b4xpages._showpage /*String*/ (_ba,_ia);
 };
RDebugUtils.currentLine=48037896;
 //BA.debugLineNum = 48037896;BA.debugLine="End Sub";
return "";
}
public static String  _insertarenglonespruebaenerrorlog(anywheresoftware.b4a.BA _ba) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "insertarenglonespruebaenerrorlog", false))
	 {return ((String) Debug.delegate(null, "insertarenglonespruebaenerrorlog", new Object[] {_ba}));}
int _x = 0;
RDebugUtils.currentLine=44957696;
 //BA.debugLineNum = 44957696;BA.debugLine="Sub insertaRenglonesPruebaEnErrorLog 'ignore";
RDebugUtils.currentLine=44957697;
 //BA.debugLineNum = 44957697;BA.debugLine="revisaBD";
_revisabd(_ba);
RDebugUtils.currentLine=44957698;
 //BA.debugLineNum = 44957698;BA.debugLine="Log(\"insertamos 50 renglones a errorLog\")";
anywheresoftware.b4a.keywords.Common.LogImpl("044957698","insertamos 50 renglones a errorLog",0);
RDebugUtils.currentLine=44957699;
 //BA.debugLineNum = 44957699;BA.debugLine="For x = 1 To 50";
{
final int step3 = 1;
final int limit3 = (int) (50);
_x = (int) (1) ;
for (;_x <= limit3 ;_x = _x + step3 ) {
RDebugUtils.currentLine=44957700;
 //BA.debugLineNum = 44957700;BA.debugLine="errorLog.ExecNonQuery2(\"INSERT INTO errores(fech";
_errorlog.ExecNonQuery2("INSERT INTO errores(fecha, error) VALUES (?,?)",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(_fechakmt(_ba,BA.NumberToString(anywheresoftware.b4a.keywords.Common.DateTime.getNow()))),(Object)("abc")}));
RDebugUtils.currentLine=44957701;
 //BA.debugLineNum = 44957701;BA.debugLine="Log(x)";
anywheresoftware.b4a.keywords.Common.LogImpl("044957701",BA.NumberToString(_x),0);
 }
};
RDebugUtils.currentLine=44957703;
 //BA.debugLineNum = 44957703;BA.debugLine="End Sub";
return "";
}
public static String  _installapk(anywheresoftware.b4a.BA _ba,String _dir,String _apk) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "installapk", false))
	 {return ((String) Debug.delegate(null, "installapk", new Object[] {_ba,_dir,_apk}));}
anywheresoftware.b4a.objects.IntentWrapper _i = null;
RDebugUtils.currentLine=45154304;
 //BA.debugLineNum = 45154304;BA.debugLine="Sub InstallAPK(dir As String, apk As String) 'igno";
RDebugUtils.currentLine=45154305;
 //BA.debugLineNum = 45154305;BA.debugLine="If File.Exists(dir, apk) Then";
if (anywheresoftware.b4a.keywords.Common.File.Exists(_dir,_apk)) { 
RDebugUtils.currentLine=45154306;
 //BA.debugLineNum = 45154306;BA.debugLine="Dim i As Intent";
_i = new anywheresoftware.b4a.objects.IntentWrapper();
RDebugUtils.currentLine=45154307;
 //BA.debugLineNum = 45154307;BA.debugLine="i.Initialize(i.ACTION_VIEW, \"file://\" & File.Com";
_i.Initialize(_i.ACTION_VIEW,"file://"+anywheresoftware.b4a.keywords.Common.File.Combine(_dir,_apk));
RDebugUtils.currentLine=45154308;
 //BA.debugLineNum = 45154308;BA.debugLine="i.SetType(\"application/vnd.android.package-archi";
_i.SetType("application/vnd.android.package-archive");
RDebugUtils.currentLine=45154309;
 //BA.debugLineNum = 45154309;BA.debugLine="StartActivity(i)";
anywheresoftware.b4a.keywords.Common.StartActivity((_ba.processBA == null ? _ba : _ba.processBA),(Object)(_i.getObject()));
 };
RDebugUtils.currentLine=45154311;
 //BA.debugLineNum = 45154311;BA.debugLine="End Sub";
return "";
}
public static boolean  _invsuficientepromoesp(anywheresoftware.b4a.BA _ba) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "invsuficientepromoesp", false))
	 {return ((Boolean) Debug.delegate(null, "invsuficientepromoesp", new Object[] {_ba}));}
boolean _y = false;
anywheresoftware.b4a.sql.SQL.CursorWrapper _c = null;
int _i = 0;
RDebugUtils.currentLine=47775744;
 //BA.debugLineNum = 47775744;BA.debugLine="Sub InvSuficientePromoEsp As Boolean";
RDebugUtils.currentLine=47775745;
 //BA.debugLineNum = 47775745;BA.debugLine="Private y As Boolean = False";
_y = anywheresoftware.b4a.keywords.Common.False;
RDebugUtils.currentLine=47775746;
 //BA.debugLineNum = 47775746;BA.debugLine="Private c As Cursor = B4XPages.MainPage.skmt.Exec";
_c = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(mostCurrent._b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (_ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery(("select CAT_DP_IDPROD, CAT_DP_PZAS, ifnull(CAT_GP_ALMACEN, 0) As CAT_GP_ALMACEN from CAT_DETALLES_PAQ left JOIN "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_traetablaprods(_ba,_traetipoventadebd(_ba))))+" ON CAT_DP_IDPROD = CAT_GP_ID WHERE CAT_DP_ID IN (SELECT DISTINCT CAT_PE_IDPROMO FROM CAT_PROMO_ESP)"))));
RDebugUtils.currentLine=47775747;
 //BA.debugLineNum = 47775747;BA.debugLine="If c.RowCount > 0 Then";
if (_c.getRowCount()>0) { 
RDebugUtils.currentLine=47775748;
 //BA.debugLineNum = 47775748;BA.debugLine="For i = 0 To c.RowCount - 1";
{
final int step4 = 1;
final int limit4 = (int) (_c.getRowCount()-1);
_i = (int) (0) ;
for (;_i <= limit4 ;_i = _i + step4 ) {
RDebugUtils.currentLine=47775749;
 //BA.debugLineNum = 47775749;BA.debugLine="c.Position = i";
_c.setPosition(_i);
RDebugUtils.currentLine=47775750;
 //BA.debugLineNum = 47775750;BA.debugLine="If c.GetString(\"CAT_GP_ALMACEN\") >= c.GetString";
if ((double)(Double.parseDouble(_c.GetString("CAT_GP_ALMACEN")))>=(double)(Double.parseDouble(_c.GetString("CAT_DP_PZAS")))) { 
RDebugUtils.currentLine=47775751;
 //BA.debugLineNum = 47775751;BA.debugLine="y = True";
_y = anywheresoftware.b4a.keywords.Common.True;
 }else {
RDebugUtils.currentLine=47775755;
 //BA.debugLineNum = 47775755;BA.debugLine="y = False";
_y = anywheresoftware.b4a.keywords.Common.False;
RDebugUtils.currentLine=47775758;
 //BA.debugLineNum = 47775758;BA.debugLine="Exit";
if (true) break;
 };
 }
};
 };
RDebugUtils.currentLine=47775762;
 //BA.debugLineNum = 47775762;BA.debugLine="c.Close";
_c.Close();
RDebugUtils.currentLine=47775763;
 //BA.debugLineNum = 47775763;BA.debugLine="Return y";
if (true) return _y;
RDebugUtils.currentLine=47775764;
 //BA.debugLineNum = 47775764;BA.debugLine="End Sub";
return false;
}
public static anywheresoftware.b4a.objects.collections.Map  _json2map(anywheresoftware.b4a.BA _ba,String _thejson) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "json2map", false))
	 {return ((anywheresoftware.b4a.objects.collections.Map) Debug.delegate(null, "json2map", new Object[] {_ba,_thejson}));}
anywheresoftware.b4a.objects.collections.JSONParser _json = null;
anywheresoftware.b4a.objects.collections.Map _m = null;
RDebugUtils.currentLine=44236800;
 //BA.debugLineNum = 44236800;BA.debugLine="Sub JSON2Map(theJson As String) As Map 'ignore";
RDebugUtils.currentLine=44236802;
 //BA.debugLineNum = 44236802;BA.debugLine="Try";
try {RDebugUtils.currentLine=44236803;
 //BA.debugLineNum = 44236803;BA.debugLine="Private json As JSONParser";
_json = new anywheresoftware.b4a.objects.collections.JSONParser();
RDebugUtils.currentLine=44236804;
 //BA.debugLineNum = 44236804;BA.debugLine="json.Initialize(theJson)";
_json.Initialize(_thejson);
RDebugUtils.currentLine=44236805;
 //BA.debugLineNum = 44236805;BA.debugLine="Return json.NextObject";
if (true) return _json.NextObject();
 } 
       catch (Exception e6) {
			(_ba.processBA == null ? _ba : _ba.processBA).setLastException(e6);RDebugUtils.currentLine=44236807;
 //BA.debugLineNum = 44236807;BA.debugLine="Log(LastException)";
anywheresoftware.b4a.keywords.Common.LogImpl("044236807",BA.ObjectToString(anywheresoftware.b4a.keywords.Common.LastException(_ba)),0);
RDebugUtils.currentLine=44236808;
 //BA.debugLineNum = 44236808;BA.debugLine="log2DB(\"JSON2Map: \"&LastException)";
_log2db(_ba,"JSON2Map: "+BA.ObjectToString(anywheresoftware.b4a.keywords.Common.LastException(_ba)));
RDebugUtils.currentLine=44236809;
 //BA.debugLineNum = 44236809;BA.debugLine="Private m As Map = CreateMap(\"title\":\"Error gene";
_m = new anywheresoftware.b4a.objects.collections.Map();
_m = anywheresoftware.b4a.keywords.Common.createMap(new Object[] {(Object)("title"),(Object)("Error generating JSON"),(Object)("t"),(Object)("Error"),(Object)("Message"),(Object)(anywheresoftware.b4a.keywords.Common.LastException(_ba).getObject()),(Object)("text"),(Object)(anywheresoftware.b4a.keywords.Common.LastException(_ba).getObject())});
RDebugUtils.currentLine=44236810;
 //BA.debugLineNum = 44236810;BA.debugLine="Return m";
if (true) return _m;
 };
RDebugUtils.currentLine=44236812;
 //BA.debugLineNum = 44236812;BA.debugLine="End Sub";
return null;
}
public static String  _log2db(anywheresoftware.b4a.BA _ba,String _texto) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "log2db", false))
	 {return ((String) Debug.delegate(null, "log2db", new Object[] {_ba,_texto}));}
RDebugUtils.currentLine=44433408;
 //BA.debugLineNum = 44433408;BA.debugLine="Sub log2DB(texto As String) 'ignore";
RDebugUtils.currentLine=44433409;
 //BA.debugLineNum = 44433409;BA.debugLine="LogColor(fechaKMT(DateTime.Now)&\" - log2BD: '\"&te";
anywheresoftware.b4a.keywords.Common.LogImpl("044433409",_fechakmt(_ba,BA.NumberToString(anywheresoftware.b4a.keywords.Common.DateTime.getNow()))+" - log2BD: '"+_texto+"'",anywheresoftware.b4a.keywords.Common.Colors.LightGray);
RDebugUtils.currentLine=44433410;
 //BA.debugLineNum = 44433410;BA.debugLine="kmt.ExecNonQuery2(\"INSERT INTO bitacora(fecha, te";
_kmt.ExecNonQuery2("INSERT INTO bitacora(fecha, texto) VALUES (?,?)",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(_fechakmt(_ba,BA.NumberToString(anywheresoftware.b4a.keywords.Common.DateTime.getNow()))),(Object)(_texto)}));
RDebugUtils.currentLine=44433411;
 //BA.debugLineNum = 44433411;BA.debugLine="End Sub";
return "";
}
public static String  _map2json(anywheresoftware.b4a.BA _ba,anywheresoftware.b4a.objects.collections.Map _m) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "map2json", false))
	 {return ((String) Debug.delegate(null, "map2json", new Object[] {_ba,_m}));}
anywheresoftware.b4a.objects.collections.JSONParser.JSONGenerator _jg = null;
String _t = "";
RDebugUtils.currentLine=44302336;
 //BA.debugLineNum = 44302336;BA.debugLine="Sub map2JSON(m As Map) As String 'ignore";
RDebugUtils.currentLine=44302339;
 //BA.debugLineNum = 44302339;BA.debugLine="Dim jg As JSONGenerator";
_jg = new anywheresoftware.b4a.objects.collections.JSONParser.JSONGenerator();
RDebugUtils.currentLine=44302340;
 //BA.debugLineNum = 44302340;BA.debugLine="jg.Initialize(m)";
_jg.Initialize(_m);
RDebugUtils.currentLine=44302341;
 //BA.debugLineNum = 44302341;BA.debugLine="Dim t As String = jg.ToString";
_t = _jg.ToString();
RDebugUtils.currentLine=44302342;
 //BA.debugLineNum = 44302342;BA.debugLine="Return t";
if (true) return _t;
RDebugUtils.currentLine=44302343;
 //BA.debugLineNum = 44302343;BA.debugLine="End Sub";
return "";
}
public static boolean  _masdexxmins(anywheresoftware.b4a.BA _ba,int _hora,int _mins) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "masdexxmins", false))
	 {return ((Boolean) Debug.delegate(null, "masdexxmins", new Object[] {_ba,_hora,_mins}));}
RDebugUtils.currentLine=44498944;
 //BA.debugLineNum = 44498944;BA.debugLine="Sub masDeXXMins(hora As Int, mins As Int) As Boole";
RDebugUtils.currentLine=44498945;
 //BA.debugLineNum = 44498945;BA.debugLine="If (hora + mins * DateTime.TicksPerMinute) < Date";
if ((_hora+_mins*anywheresoftware.b4a.keywords.Common.DateTime.TicksPerMinute)<anywheresoftware.b4a.keywords.Common.DateTime.getNow()) { 
RDebugUtils.currentLine=44498946;
 //BA.debugLineNum = 44498946;BA.debugLine="Return True";
if (true) return anywheresoftware.b4a.keywords.Common.True;
 }else {
RDebugUtils.currentLine=44498948;
 //BA.debugLineNum = 44498948;BA.debugLine="Return False";
if (true) return anywheresoftware.b4a.keywords.Common.False;
 };
RDebugUtils.currentLine=44498950;
 //BA.debugLineNum = 44498950;BA.debugLine="End Sub";
return false;
}
public static boolean  _masdexxminskmt(anywheresoftware.b4a.BA _ba,String _hora,int _mins) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "masdexxminskmt", false))
	 {return ((Boolean) Debug.delegate(null, "masdexxminskmt", new Object[] {_ba,_hora,_mins}));}
RDebugUtils.currentLine=44564480;
 //BA.debugLineNum = 44564480;BA.debugLine="Sub masDeXXMinsKMT(hora As String, mins As Int) As";
RDebugUtils.currentLine=44564481;
 //BA.debugLineNum = 44564481;BA.debugLine="Try";
try {RDebugUtils.currentLine=44564483;
 //BA.debugLineNum = 44564483;BA.debugLine="If fechaKMT2Ticks(hora) + mins * DateTime.TicksP";
if (_fechakmt2ticks(_ba,_hora)+_mins*anywheresoftware.b4a.keywords.Common.DateTime.TicksPerMinute<anywheresoftware.b4a.keywords.Common.DateTime.getNow()) { 
RDebugUtils.currentLine=44564485;
 //BA.debugLineNum = 44564485;BA.debugLine="Return True";
if (true) return anywheresoftware.b4a.keywords.Common.True;
 }else {
RDebugUtils.currentLine=44564488;
 //BA.debugLineNum = 44564488;BA.debugLine="Return False";
if (true) return anywheresoftware.b4a.keywords.Common.False;
 };
 } 
       catch (Exception e8) {
			(_ba.processBA == null ? _ba : _ba.processBA).setLastException(e8);RDebugUtils.currentLine=44564491;
 //BA.debugLineNum = 44564491;BA.debugLine="Log(LastException)";
anywheresoftware.b4a.keywords.Common.LogImpl("044564491",BA.ObjectToString(anywheresoftware.b4a.keywords.Common.LastException(_ba)),0);
 };
RDebugUtils.currentLine=44564493;
 //BA.debugLineNum = 44564493;BA.debugLine="End Sub";
return false;
}
public static String  _notihigh(anywheresoftware.b4a.BA _ba,String _title,String _body,Object _activity) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "notihigh", false))
	 {return ((String) Debug.delegate(null, "notihigh", new Object[] {_ba,_title,_body,_activity}));}
anywheresoftware.b4a.objects.NotificationWrapper _notif = null;
RDebugUtils.currentLine=43515904;
 //BA.debugLineNum = 43515904;BA.debugLine="Sub notiHigh(title As String, body As String, acti";
RDebugUtils.currentLine=43515905;
 //BA.debugLineNum = 43515905;BA.debugLine="Private notif As Notification";
_notif = new anywheresoftware.b4a.objects.NotificationWrapper();
RDebugUtils.currentLine=43515906;
 //BA.debugLineNum = 43515906;BA.debugLine="notif.Initialize2(notif.IMPORTANCE_HIGH)";
_notif.Initialize2(_notif.IMPORTANCE_HIGH);
RDebugUtils.currentLine=43515907;
 //BA.debugLineNum = 43515907;BA.debugLine="notif.Icon = \"icon\"";
_notif.setIcon("icon");
RDebugUtils.currentLine=43515908;
 //BA.debugLineNum = 43515908;BA.debugLine="notif.Vibrate = False";
_notif.setVibrate(anywheresoftware.b4a.keywords.Common.False);
RDebugUtils.currentLine=43515909;
 //BA.debugLineNum = 43515909;BA.debugLine="notif.Sound = False";
_notif.setSound(anywheresoftware.b4a.keywords.Common.False);
RDebugUtils.currentLine=43515910;
 //BA.debugLineNum = 43515910;BA.debugLine="notif.AutoCancel = True";
_notif.setAutoCancel(anywheresoftware.b4a.keywords.Common.True);
RDebugUtils.currentLine=43515911;
 //BA.debugLineNum = 43515911;BA.debugLine="Log(\"notiHigh: \"&title)";
anywheresoftware.b4a.keywords.Common.LogImpl("043515911","notiHigh: "+_title,0);
RDebugUtils.currentLine=43515912;
 //BA.debugLineNum = 43515912;BA.debugLine="notif.SetInfo(title, body, activity)";
_notif.SetInfoNew((_ba.processBA == null ? _ba : _ba.processBA),BA.ObjectToCharSequence(_title),BA.ObjectToCharSequence(_body),_activity);
RDebugUtils.currentLine=43515914;
 //BA.debugLineNum = 43515914;BA.debugLine="notif.Notify(777)";
_notif.Notify((int) (777));
RDebugUtils.currentLine=43515915;
 //BA.debugLineNum = 43515915;BA.debugLine="End Sub";
return "";
}
public static anywheresoftware.b4a.objects.NotificationWrapper  _notilowreturn(anywheresoftware.b4a.BA _ba,String _title,String _body,int _id) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "notilowreturn", false))
	 {return ((anywheresoftware.b4a.objects.NotificationWrapper) Debug.delegate(null, "notilowreturn", new Object[] {_ba,_title,_body,_id}));}
anywheresoftware.b4a.objects.NotificationWrapper _notification = null;
RDebugUtils.currentLine=43581440;
 //BA.debugLineNum = 43581440;BA.debugLine="Sub notiLowReturn(title As String, Body As String,";
RDebugUtils.currentLine=43581441;
 //BA.debugLineNum = 43581441;BA.debugLine="Private notification As Notification";
_notification = new anywheresoftware.b4a.objects.NotificationWrapper();
RDebugUtils.currentLine=43581442;
 //BA.debugLineNum = 43581442;BA.debugLine="notification.Initialize2(notification.IMPORTANCE_";
_notification.Initialize2(_notification.IMPORTANCE_LOW);
RDebugUtils.currentLine=43581443;
 //BA.debugLineNum = 43581443;BA.debugLine="Log(\"notiLowReturn: \"&title)";
anywheresoftware.b4a.keywords.Common.LogImpl("043581443","notiLowReturn: "+_title,0);
RDebugUtils.currentLine=43581444;
 //BA.debugLineNum = 43581444;BA.debugLine="notification.Icon = \"icon\"";
_notification.setIcon("icon");
RDebugUtils.currentLine=43581445;
 //BA.debugLineNum = 43581445;BA.debugLine="notification.Sound = False";
_notification.setSound(anywheresoftware.b4a.keywords.Common.False);
RDebugUtils.currentLine=43581446;
 //BA.debugLineNum = 43581446;BA.debugLine="notification.Vibrate = False";
_notification.setVibrate(anywheresoftware.b4a.keywords.Common.False);
RDebugUtils.currentLine=43581447;
 //BA.debugLineNum = 43581447;BA.debugLine="notification.SetInfo(title, Body, Main)";
_notification.SetInfoNew((_ba.processBA == null ? _ba : _ba.processBA),BA.ObjectToCharSequence(_title),BA.ObjectToCharSequence(_body),(Object)(mostCurrent._main.getObject()));
RDebugUtils.currentLine=43581448;
 //BA.debugLineNum = 43581448;BA.debugLine="notification.Notify(id)";
_notification.Notify(_id);
RDebugUtils.currentLine=43581450;
 //BA.debugLineNum = 43581450;BA.debugLine="Return notification";
if (true) return _notification;
RDebugUtils.currentLine=43581451;
 //BA.debugLineNum = 43581451;BA.debugLine="End Sub";
return null;
}
public static boolean  _pedidoguardado(anywheresoftware.b4a.BA _ba) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "pedidoguardado", false))
	 {return ((Boolean) Debug.delegate(null, "pedidoguardado", new Object[] {_ba}));}
boolean _guardado = false;
anywheresoftware.b4a.sql.SQL.CursorWrapper _g = null;
RDebugUtils.currentLine=46137344;
 //BA.debugLineNum = 46137344;BA.debugLine="Sub pedidoGuardado As Boolean";
RDebugUtils.currentLine=46137345;
 //BA.debugLineNum = 46137345;BA.debugLine="Private guardado As Boolean = False";
_guardado = anywheresoftware.b4a.keywords.Common.False;
RDebugUtils.currentLine=46137346;
 //BA.debugLineNum = 46137346;BA.debugLine="Private g As Cursor = B4XPages.MainPage.skmt.Exec";
_g = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_g = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(mostCurrent._b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (_ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select gestion from kmt_info3 where CAT_CL_CODIGO in (Select CUENTA from cuentaa)")));
RDebugUtils.currentLine=46137347;
 //BA.debugLineNum = 46137347;BA.debugLine="If g.RowCount > 0 Then";
if (_g.getRowCount()>0) { 
RDebugUtils.currentLine=46137348;
 //BA.debugLineNum = 46137348;BA.debugLine="g.Position=0";
_g.setPosition((int) (0));
RDebugUtils.currentLine=46137349;
 //BA.debugLineNum = 46137349;BA.debugLine="If g.GetString(\"gestion\") = \"2\" Or g.GetString(\"";
if ((_g.GetString("gestion")).equals("2") || (_g.GetString("gestion")).equals("3")) { 
_guardado = anywheresoftware.b4a.keywords.Common.True;};
 };
RDebugUtils.currentLine=46137352;
 //BA.debugLineNum = 46137352;BA.debugLine="Return guardado";
if (true) return _guardado;
RDebugUtils.currentLine=46137353;
 //BA.debugLineNum = 46137353;BA.debugLine="End Sub";
return false;
}
public static anywheresoftware.b4a.objects.collections.Map  _procesapromocion(anywheresoftware.b4a.BA _ba,String _idpromo,String _cliente) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "procesapromocion", false))
	 {return ((anywheresoftware.b4a.objects.collections.Map) Debug.delegate(null, "procesapromocion", new Object[] {_ba,_idpromo,_cliente}));}
boolean _thislog = false;
String _iniciocontador = "";
anywheresoftware.b4a.objects.collections.Map _pm = null;
anywheresoftware.b4a.objects.collections.Map _inventariosinfijos = null;
boolean _pv = false;
RDebugUtils.currentLine=47120384;
 //BA.debugLineNum = 47120384;BA.debugLine="Sub procesaPromocion(idPromo As String, cliente As";
RDebugUtils.currentLine=47120385;
 //BA.debugLineNum = 47120385;BA.debugLine="Private thisLog As Boolean = True  'Si es verdade";
_thislog = anywheresoftware.b4a.keywords.Common.True;
RDebugUtils.currentLine=47120386;
 //BA.debugLineNum = 47120386;BA.debugLine="Private inicioContador As String = DateTime.Now";
_iniciocontador = BA.NumberToString(anywheresoftware.b4a.keywords.Common.DateTime.getNow());
RDebugUtils.currentLine=47120387;
 //BA.debugLineNum = 47120387;BA.debugLine="If thisLog Then LogColor($\"********* Iniciamos re";
if (_thislog) { 
anywheresoftware.b4a.keywords.Common.LogImpl("047120387",("********* Iniciamos revision de Promo "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_idpromo))+" *********"),anywheresoftware.b4a.keywords.Common.Colors.Magenta);};
RDebugUtils.currentLine=47120389;
 //BA.debugLineNum = 47120389;BA.debugLine="Private pm As Map = traePromo(idPromo, cliente)";
_pm = new anywheresoftware.b4a.objects.collections.Map();
_pm = _traepromo(_ba,_idpromo,_cliente);
RDebugUtils.currentLine=47120390;
 //BA.debugLineNum = 47120390;BA.debugLine="If thisLog Then LogColor(pm, Colors.Blue)";
if (_thislog) { 
anywheresoftware.b4a.keywords.Common.LogImpl("047120390",BA.ObjectToString(_pm),anywheresoftware.b4a.keywords.Common.Colors.Blue);};
RDebugUtils.currentLine=47120391;
 //BA.debugLineNum = 47120391;BA.debugLine="If pm.Get(\"resultado\") = \"ok\" Then 'Si encontramo";
if ((_pm.Get((Object)("resultado"))).equals((Object)("ok"))) { 
RDebugUtils.currentLine=47120393;
 //BA.debugLineNum = 47120393;BA.debugLine="If thisLog Then LogColor($\"Promociones permitida";
if (_thislog) { 
anywheresoftware.b4a.keywords.Common.LogImpl("047120393",("Promociones permitidas="+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_traemaxpromos(_ba,_pm)))+""),anywheresoftware.b4a.keywords.Common.Colors.Blue);};
RDebugUtils.currentLine=47120394;
 //BA.debugLineNum = 47120394;BA.debugLine="If thisLog Then Log(\"Promos vendidas: \" & traePr";
if (_thislog) { 
anywheresoftware.b4a.keywords.Common.LogImpl("047120394","Promos vendidas: "+BA.NumberToString(_traepromosvendidas(_ba,_idpromo,_cliente)),0);};
RDebugUtils.currentLine=47120395;
 //BA.debugLineNum = 47120395;BA.debugLine="If traePromosVendidas(idPromo, cliente) >= traeM";
if (_traepromosvendidas(_ba,_idpromo,_cliente)>=_traemaxpromos(_ba,_pm)) { 
RDebugUtils.currentLine=47120396;
 //BA.debugLineNum = 47120396;BA.debugLine="If thisLog Then LogColor(\"Ya se vendieron las p";
if (_thislog) { 
anywheresoftware.b4a.keywords.Common.LogImpl("047120396","Ya se vendieron las promos PERMITIDAS para el cliente",anywheresoftware.b4a.keywords.Common.Colors.Red);};
RDebugUtils.currentLine=47120397;
 //BA.debugLineNum = 47120397;BA.debugLine="Return CreateMap(\"status\":\"ko\", \"mp\":pm)";
if (true) return anywheresoftware.b4a.keywords.Common.createMap(new Object[] {(Object)("status"),(Object)("ko"),(Object)("mp"),(Object)(_pm.getObject())});
 };
RDebugUtils.currentLine=47120400;
 //BA.debugLineNum = 47120400;BA.debugLine="Private inventarioSinFijos As Map = restaFijosPr";
_inventariosinfijos = new anywheresoftware.b4a.objects.collections.Map();
_inventariosinfijos = _restafijospromo(_ba,_pm);
RDebugUtils.currentLine=47120401;
 //BA.debugLineNum = 47120401;BA.debugLine="If thisLog Then LogColor(\"inventariosfijos=\"&inv";
if (_thislog) { 
anywheresoftware.b4a.keywords.Common.LogImpl("047120401","inventariosfijos="+BA.ObjectToString(_inventariosinfijos),anywheresoftware.b4a.keywords.Common.Colors.Green);};
RDebugUtils.currentLine=47120403;
 //BA.debugLineNum = 47120403;BA.debugLine="If inventarioSinFijos.Get(\"resultado\") = \"ok\" Th";
if ((_inventariosinfijos.Get((Object)("resultado"))).equals((Object)("ok"))) { 
RDebugUtils.currentLine=47120405;
 //BA.debugLineNum = 47120405;BA.debugLine="Private pv As Boolean =  alcanzanLosVariablesPa";
_pv = _alcanzanlosvariablesparapromo(_ba,_pm,_inventariosinfijos);
RDebugUtils.currentLine=47120406;
 //BA.debugLineNum = 47120406;BA.debugLine="If thisLog Then Log(\"Alcanzan los variables? --";
if (_thislog) { 
anywheresoftware.b4a.keywords.Common.LogImpl("047120406","Alcanzan los variables? --> "+BA.ObjectToString(_pv),0);};
RDebugUtils.currentLine=47120407;
 //BA.debugLineNum = 47120407;BA.debugLine="If pv Then Return CreateMap(\"status\":\"ok\", \"mp\"";
if (_pv) { 
if (true) return anywheresoftware.b4a.keywords.Common.createMap(new Object[] {(Object)("status"),(Object)("ok"),(Object)("mp"),(Object)(_pm.getObject())});}
else {
if (true) return anywheresoftware.b4a.keywords.Common.createMap(new Object[] {(Object)("status"),(Object)("ko"),(Object)("mp"),(Object)(_pm.getObject())});};
 }else {
RDebugUtils.currentLine=47120409;
 //BA.debugLineNum = 47120409;BA.debugLine="If thisLog Then LogColor(\"NO HAY INVENTARIO SUF";
if (_thislog) { 
anywheresoftware.b4a.keywords.Common.LogImpl("047120409","NO HAY INVENTARIO SUFICIENTE "+_idpromo,anywheresoftware.b4a.keywords.Common.Colors.Red);};
RDebugUtils.currentLine=47120410;
 //BA.debugLineNum = 47120410;BA.debugLine="Return CreateMap(\"status\":\"ko\", \"mp\":pm)";
if (true) return anywheresoftware.b4a.keywords.Common.createMap(new Object[] {(Object)("status"),(Object)("ko"),(Object)("mp"),(Object)(_pm.getObject())});
 };
 };
RDebugUtils.currentLine=47120416;
 //BA.debugLineNum = 47120416;BA.debugLine="LogColor(\"TIEMPO DE PROCESO ESTA PROMO: \" & ((Dat";
anywheresoftware.b4a.keywords.Common.LogImpl("047120416","TIEMPO DE PROCESO ESTA PROMO: "+BA.NumberToString(((anywheresoftware.b4a.keywords.Common.DateTime.getNow()-(double)(Double.parseDouble(_iniciocontador)))/(double)1000)),anywheresoftware.b4a.keywords.Common.Colors.Red);
RDebugUtils.currentLine=47120417;
 //BA.debugLineNum = 47120417;BA.debugLine="End Sub";
return null;
}
public static anywheresoftware.b4a.objects.collections.Map  _traepromo(anywheresoftware.b4a.BA _ba,String _promo,String _cliente) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "traepromo", false))
	 {return ((anywheresoftware.b4a.objects.collections.Map) Debug.delegate(null, "traepromo", new Object[] {_ba,_promo,_cliente}));}
String _iniciocontador = "";
anywheresoftware.b4a.sql.SQL.CursorWrapper _c = null;
String _sihistorico = "";
anywheresoftware.b4a.objects.collections.Map _promomap = null;
anywheresoftware.b4a.objects.collections.List _prodsfijos = null;
anywheresoftware.b4a.objects.collections.List _prodsfijosprecios = null;
anywheresoftware.b4a.objects.collections.List _prodsfijospiezas = null;
anywheresoftware.b4a.objects.collections.List _prodsvariables = null;
anywheresoftware.b4a.objects.collections.List _prodsvariables2 = null;
anywheresoftware.b4a.objects.collections.List _prodsvariablesprecios = null;
anywheresoftware.b4a.objects.collections.List _prodsvariablesprecios2 = null;
anywheresoftware.b4a.objects.collections.Map _prods = null;
anywheresoftware.b4a.objects.collections.Map _tipos = null;
int _i = 0;
String _pvr = "";
String _pvr2 = "";
RDebugUtils.currentLine=49545216;
 //BA.debugLineNum = 49545216;BA.debugLine="Sub traePromo(promo As String, cliente As String)";
RDebugUtils.currentLine=49545217;
 //BA.debugLineNum = 49545217;BA.debugLine="Private inicioContador As String = DateTime.Now";
_iniciocontador = BA.NumberToString(anywheresoftware.b4a.keywords.Common.DateTime.getNow());
RDebugUtils.currentLine=49545218;
 //BA.debugLineNum = 49545218;BA.debugLine="Private c As Cursor = B4XPages.MainPage.skmt.Exec";
_c = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(mostCurrent._b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (_ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("Select * from promos_comp where cat_pa_id = '"+_promo+"'")));
RDebugUtils.currentLine=49545219;
 //BA.debugLineNum = 49545219;BA.debugLine="Private siHistorico As String = 0";
_sihistorico = BA.NumberToString(0);
RDebugUtils.currentLine=49545220;
 //BA.debugLineNum = 49545220;BA.debugLine="Private promoMap As Map";
_promomap = new anywheresoftware.b4a.objects.collections.Map();
RDebugUtils.currentLine=49545221;
 //BA.debugLineNum = 49545221;BA.debugLine="Private prodsFijos, prodsFijosPrecios, prodsFijos";
_prodsfijos = new anywheresoftware.b4a.objects.collections.List();
_prodsfijosprecios = new anywheresoftware.b4a.objects.collections.List();
_prodsfijospiezas = new anywheresoftware.b4a.objects.collections.List();
_prodsvariables = new anywheresoftware.b4a.objects.collections.List();
_prodsvariables2 = new anywheresoftware.b4a.objects.collections.List();
_prodsvariablesprecios = new anywheresoftware.b4a.objects.collections.List();
_prodsvariablesprecios2 = new anywheresoftware.b4a.objects.collections.List();
RDebugUtils.currentLine=49545222;
 //BA.debugLineNum = 49545222;BA.debugLine="promoMap.Initialize";
_promomap.Initialize();
RDebugUtils.currentLine=49545223;
 //BA.debugLineNum = 49545223;BA.debugLine="prodsFijos.Initialize";
_prodsfijos.Initialize();
RDebugUtils.currentLine=49545224;
 //BA.debugLineNum = 49545224;BA.debugLine="prodsFijosPrecios.Initialize";
_prodsfijosprecios.Initialize();
RDebugUtils.currentLine=49545225;
 //BA.debugLineNum = 49545225;BA.debugLine="prodsFijosPiezas.Initialize";
_prodsfijospiezas.Initialize();
RDebugUtils.currentLine=49545226;
 //BA.debugLineNum = 49545226;BA.debugLine="prodsVariables.Initialize";
_prodsvariables.Initialize();
RDebugUtils.currentLine=49545227;
 //BA.debugLineNum = 49545227;BA.debugLine="prodsVariables2.Initialize";
_prodsvariables2.Initialize();
RDebugUtils.currentLine=49545228;
 //BA.debugLineNum = 49545228;BA.debugLine="prodsVariablesPrecios.Initialize";
_prodsvariablesprecios.Initialize();
RDebugUtils.currentLine=49545229;
 //BA.debugLineNum = 49545229;BA.debugLine="prodsVariablesPrecios2.Initialize";
_prodsvariablesprecios2.Initialize();
RDebugUtils.currentLine=49545230;
 //BA.debugLineNum = 49545230;BA.debugLine="c.Position = 0";
_c.setPosition((int) (0));
RDebugUtils.currentLine=49545231;
 //BA.debugLineNum = 49545231;BA.debugLine="If c.RowCount > 0 Then promoMap = CreateMap(\"id\":";
if (_c.getRowCount()>0) { 
_promomap = anywheresoftware.b4a.keywords.Common.createMap(new Object[] {(Object)("id"),(Object)(_promo),(Object)("maxXcliente"),(Object)(_c.GetString("CAT_PA_MAXPROMCLIE")),(Object)("maxRecurrente"),(Object)(_c.GetString("CAT_PA_MAXPROMREC")),(Object)("maxPromos"),(Object)(_c.GetString("CAT_PA_MAXPROM"))});};
RDebugUtils.currentLine=49545232;
 //BA.debugLineNum = 49545232;BA.debugLine="c = B4XPages.MainPage.skmt.ExecQuery(\"Select coun";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(mostCurrent._b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (_ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("Select count(*) as hist from HIST_PROMOS where HP_CLIENTE = '"+_cliente+"' and HP_CODIGO_PROMOCION = '"+_promo+"'")));
RDebugUtils.currentLine=49545233;
 //BA.debugLineNum = 49545233;BA.debugLine="c.Position = 0";
_c.setPosition((int) (0));
RDebugUtils.currentLine=49545234;
 //BA.debugLineNum = 49545234;BA.debugLine="If c.GetString(\"hist\") > 0 Then siHistorico = 1";
if ((double)(Double.parseDouble(_c.GetString("hist")))>0) { 
_sihistorico = BA.NumberToString(1);};
RDebugUtils.currentLine=49545235;
 //BA.debugLineNum = 49545235;BA.debugLine="promoMap.Put(\"historico\", siHistorico)";
_promomap.Put((Object)("historico"),(Object)(_sihistorico));
RDebugUtils.currentLine=49545236;
 //BA.debugLineNum = 49545236;BA.debugLine="c = B4XPages.MainPage.skmt.ExecQuery(\"Select * fr";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(mostCurrent._b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (_ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("Select * from CAT_DETALLES_PAQ where CAT_DP_ID = '"+_promo+"'")));
RDebugUtils.currentLine=49545237;
 //BA.debugLineNum = 49545237;BA.debugLine="c.Position = 0";
_c.setPosition((int) (0));
RDebugUtils.currentLine=49545238;
 //BA.debugLineNum = 49545238;BA.debugLine="If c.RowCount > 0 Then";
if (_c.getRowCount()>0) { 
RDebugUtils.currentLine=49545239;
 //BA.debugLineNum = 49545239;BA.debugLine="Private prods, tipos As Map";
_prods = new anywheresoftware.b4a.objects.collections.Map();
_tipos = new anywheresoftware.b4a.objects.collections.Map();
RDebugUtils.currentLine=49545240;
 //BA.debugLineNum = 49545240;BA.debugLine="prods.Initialize";
_prods.Initialize();
RDebugUtils.currentLine=49545241;
 //BA.debugLineNum = 49545241;BA.debugLine="tipos.Initialize";
_tipos.Initialize();
RDebugUtils.currentLine=49545242;
 //BA.debugLineNum = 49545242;BA.debugLine="For i=0 To c.RowCount -1";
{
final int step26 = 1;
final int limit26 = (int) (_c.getRowCount()-1);
_i = (int) (0) ;
for (;_i <= limit26 ;_i = _i + step26 ) {
RDebugUtils.currentLine=49545243;
 //BA.debugLineNum = 49545243;BA.debugLine="c.Position=i";
_c.setPosition(_i);
RDebugUtils.currentLine=49545244;
 //BA.debugLineNum = 49545244;BA.debugLine="prods.Put(c.GetString(\"CAT_DP_IDPROD\"), CreateM";
_prods.Put((Object)(_c.GetString("CAT_DP_IDPROD")),(Object)(anywheresoftware.b4a.keywords.Common.createMap(new Object[] {(Object)("idProducto"),(Object)(_c.GetString("CAT_DP_IDPROD")),(Object)("precioSimptos"),(Object)(_c.GetString("CAT_DP_PRECIO_SIMPTOS")),(Object)("precio"),(Object)(_c.GetString("CAT_DP_PRECIO")),(Object)("almacen"),(Object)(_c.GetString("CAT_DP_ALMACEN")),(Object)("tipo"),(Object)(_c.GetString("CAT_DP_TIPO")),(Object)("piezas"),(Object)(_c.GetString("CAT_DP_PZAS")),(Object)("usuario"),(Object)(_c.GetString("CAT_DP_USUARIO")),(Object)("regalo"),(Object)(_c.GetString("CAT_DP_REGALO")),(Object)("clasif"),(Object)(_c.GetString("CAT_DP_CLASIF"))}).getObject()));
RDebugUtils.currentLine=49545245;
 //BA.debugLineNum = 49545245;BA.debugLine="tipos.Put(c.GetString(\"CAT_DP_IDPROD\"), c.GetSt";
_tipos.Put((Object)(_c.GetString("CAT_DP_IDPROD")),(Object)(_c.GetString("CAT_DP_TIPO")));
RDebugUtils.currentLine=49545246;
 //BA.debugLineNum = 49545246;BA.debugLine="If c.GetString(\"CAT_DP_TIPO\") = \"0\" Then";
if ((_c.GetString("CAT_DP_TIPO")).equals("0")) { 
RDebugUtils.currentLine=49545247;
 //BA.debugLineNum = 49545247;BA.debugLine="prodsFijos.Add(c.GetString(\"CAT_DP_IDPROD\"))";
_prodsfijos.Add((Object)(_c.GetString("CAT_DP_IDPROD")));
RDebugUtils.currentLine=49545248;
 //BA.debugLineNum = 49545248;BA.debugLine="prodsFijosPrecios.Add(c.GetString(\"CAT_DP_PREC";
_prodsfijosprecios.Add((Object)(_c.GetString("CAT_DP_PRECIO")));
RDebugUtils.currentLine=49545249;
 //BA.debugLineNum = 49545249;BA.debugLine="prodsFijosPiezas.Add(c.GetString(\"CAT_DP_PZAS\"";
_prodsfijospiezas.Add((Object)(_c.GetString("CAT_DP_PZAS")));
 };
RDebugUtils.currentLine=49545251;
 //BA.debugLineNum = 49545251;BA.debugLine="If c.GetString(\"CAT_DP_TIPO\") = \"1\" Then";
if ((_c.GetString("CAT_DP_TIPO")).equals("1")) { 
RDebugUtils.currentLine=49545252;
 //BA.debugLineNum = 49545252;BA.debugLine="prodsVariables.Add(c.GetString(\"CAT_DP_IDPROD\"";
_prodsvariables.Add((Object)(_c.GetString("CAT_DP_IDPROD")));
RDebugUtils.currentLine=49545253;
 //BA.debugLineNum = 49545253;BA.debugLine="prodsVariablesPrecios.Add(c.GetString(\"CAT_DP_";
_prodsvariablesprecios.Add((Object)(_c.GetString("CAT_DP_PRECIO")));
 };
RDebugUtils.currentLine=49545255;
 //BA.debugLineNum = 49545255;BA.debugLine="If c.GetString(\"CAT_DP_TIPO\") = \"2\" Then";
if ((_c.GetString("CAT_DP_TIPO")).equals("2")) { 
RDebugUtils.currentLine=49545257;
 //BA.debugLineNum = 49545257;BA.debugLine="prodsVariables2.Add(c.GetString(\"CAT_DP_IDPROD";
_prodsvariables2.Add((Object)(_c.GetString("CAT_DP_IDPROD")));
RDebugUtils.currentLine=49545258;
 //BA.debugLineNum = 49545258;BA.debugLine="prodsVariablesPrecios2.Add(c.GetString(\"CAT_DP";
_prodsvariablesprecios2.Add((Object)(_c.GetString("CAT_DP_PRECIO")));
 };
 }
};
RDebugUtils.currentLine=49545263;
 //BA.debugLineNum = 49545263;BA.debugLine="promoMap.Put(\"productos\", prods) 'Mapa con los p";
_promomap.Put((Object)("productos"),(Object)(_prods.getObject()));
RDebugUtils.currentLine=49545264;
 //BA.debugLineNum = 49545264;BA.debugLine="promoMap.Put(\"tipos\", tipos) 'Mapa con los produ";
_promomap.Put((Object)("tipos"),(Object)(_tipos.getObject()));
RDebugUtils.currentLine=49545265;
 //BA.debugLineNum = 49545265;BA.debugLine="promoMap.Put(\"prodsFijos\", prodsFijos) 'Lista de";
_promomap.Put((Object)("prodsFijos"),(Object)(_prodsfijos.getObject()));
RDebugUtils.currentLine=49545266;
 //BA.debugLineNum = 49545266;BA.debugLine="promoMap.Put(\"prodsVariables\", prodsVariables) '";
_promomap.Put((Object)("prodsVariables"),(Object)(_prodsvariables.getObject()));
RDebugUtils.currentLine=49545267;
 //BA.debugLineNum = 49545267;BA.debugLine="promoMap.Put(\"prodsVariables2\", prodsVariables2)";
_promomap.Put((Object)("prodsVariables2"),(Object)(_prodsvariables2.getObject()));
RDebugUtils.currentLine=49545268;
 //BA.debugLineNum = 49545268;BA.debugLine="promoMap.Put(\"prodsFijosCant\", prodsFijos.Size)";
_promomap.Put((Object)("prodsFijosCant"),(Object)(_prodsfijos.getSize()));
RDebugUtils.currentLine=49545269;
 //BA.debugLineNum = 49545269;BA.debugLine="promoMap.Put(\"prodsFijosPrecios\", prodsFijosPrec";
_promomap.Put((Object)("prodsFijosPrecios"),(Object)(_prodsfijosprecios.getObject()));
RDebugUtils.currentLine=49545270;
 //BA.debugLineNum = 49545270;BA.debugLine="promoMap.Put(\"prodsFijosPiezas\", prodsFijosPieza";
_promomap.Put((Object)("prodsFijosPiezas"),(Object)(_prodsfijospiezas.getObject()));
RDebugUtils.currentLine=49545271;
 //BA.debugLineNum = 49545271;BA.debugLine="promoMap.Put(\"prodsVariablesCant\", prodsVariable";
_promomap.Put((Object)("prodsVariablesCant"),(Object)(_prodsvariables.getSize()));
RDebugUtils.currentLine=49545272;
 //BA.debugLineNum = 49545272;BA.debugLine="promoMap.Put(\"prodsVariables2Cant\", prodsVariabl";
_promomap.Put((Object)("prodsVariables2Cant"),(Object)(_prodsvariables2.getSize()));
RDebugUtils.currentLine=49545273;
 //BA.debugLineNum = 49545273;BA.debugLine="promoMap.Put(\"prodsVariablesPrecios\", prodsVaria";
_promomap.Put((Object)("prodsVariablesPrecios"),(Object)(_prodsvariablesprecios.getObject()));
RDebugUtils.currentLine=49545274;
 //BA.debugLineNum = 49545274;BA.debugLine="promoMap.Put(\"prodsVariablesPrecios2\", prodsVari";
_promomap.Put((Object)("prodsVariablesPrecios2"),(Object)(_prodsvariablesprecios2.getObject()));
RDebugUtils.currentLine=49545275;
 //BA.debugLineNum = 49545275;BA.debugLine="promoMap.Put(\"resultado\", \"ok\")";
_promomap.Put((Object)("resultado"),(Object)("ok"));
 }else {
RDebugUtils.currentLine=49545277;
 //BA.debugLineNum = 49545277;BA.debugLine="promoMap.Put(\"resultado\", \"No hay datos de la pr";
_promomap.Put((Object)("resultado"),(Object)("No hay datos de la promoción."));
 };
RDebugUtils.currentLine=49545279;
 //BA.debugLineNum = 49545279;BA.debugLine="c = B4XPages.MainPage.skmt.ExecQuery2($\"Select CA";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(mostCurrent._b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (_ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery2(("Select CAT_GP_STS, CAT_GP_IMP1, CAT_GP_NOMBRE from "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(mostCurrent._starter._tabla /*String*/ ))+" where CAT_GP_ID = ?"),new String[]{_promo})));
RDebugUtils.currentLine=49545280;
 //BA.debugLineNum = 49545280;BA.debugLine="c.Position = 0";
_c.setPosition((int) (0));
RDebugUtils.currentLine=49545281;
 //BA.debugLineNum = 49545281;BA.debugLine="Private pvr As String = 0";
_pvr = BA.NumberToString(0);
RDebugUtils.currentLine=49545282;
 //BA.debugLineNum = 49545282;BA.debugLine="Private pvr2 As String = 0";
_pvr2 = BA.NumberToString(0);
RDebugUtils.currentLine=49545283;
 //BA.debugLineNum = 49545283;BA.debugLine="If c.RowCount > 0 Then";
if (_c.getRowCount()>0) { 
RDebugUtils.currentLine=49545284;
 //BA.debugLineNum = 49545284;BA.debugLine="c.Position = 0";
_c.setPosition((int) (0));
RDebugUtils.currentLine=49545285;
 //BA.debugLineNum = 49545285;BA.debugLine="pvr = c.GetString(\"CAT_GP_STS\")";
_pvr = _c.GetString("CAT_GP_STS");
RDebugUtils.currentLine=49545286;
 //BA.debugLineNum = 49545286;BA.debugLine="pvr2 = c.GetString(\"CAT_GP_IMP1\")";
_pvr2 = _c.GetString("CAT_GP_IMP1");
RDebugUtils.currentLine=49545287;
 //BA.debugLineNum = 49545287;BA.debugLine="If pvr = Null Or pvr = \"null\" Then pvr = 0";
if (_pvr== null || (_pvr).equals("null")) { 
_pvr = BA.NumberToString(0);};
RDebugUtils.currentLine=49545288;
 //BA.debugLineNum = 49545288;BA.debugLine="If pvr2 = Null Or pvr2 = \"null\" Then pvr2 = 0";
if (_pvr2== null || (_pvr2).equals("null")) { 
_pvr2 = BA.NumberToString(0);};
RDebugUtils.currentLine=49545289;
 //BA.debugLineNum = 49545289;BA.debugLine="promoMap.Put(\"prodsVariablesRequeridos\", pvr) 'C";
_promomap.Put((Object)("prodsVariablesRequeridos"),(Object)(_pvr));
RDebugUtils.currentLine=49545290;
 //BA.debugLineNum = 49545290;BA.debugLine="promoMap.Put(\"prodsVariables2Requeridos\", pvr2)";
_promomap.Put((Object)("prodsVariables2Requeridos"),(Object)(_pvr2));
RDebugUtils.currentLine=49545291;
 //BA.debugLineNum = 49545291;BA.debugLine="promoMap.put(\"descripcion\", c.GetString(\"CAT_GP_";
_promomap.Put((Object)("descripcion"),(Object)(_c.GetString("CAT_GP_NOMBRE")));
 };
RDebugUtils.currentLine=49545293;
 //BA.debugLineNum = 49545293;BA.debugLine="c.Close";
_c.Close();
RDebugUtils.currentLine=49545298;
 //BA.debugLineNum = 49545298;BA.debugLine="Return promoMap";
if (true) return _promomap;
RDebugUtils.currentLine=49545299;
 //BA.debugLineNum = 49545299;BA.debugLine="End Sub";
return null;
}
public static int  _traemaxpromos(anywheresoftware.b4a.BA _ba,anywheresoftware.b4a.objects.collections.Map _pm) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "traemaxpromos", false))
	 {return ((Integer) Debug.delegate(null, "traemaxpromos", new Object[] {_ba,_pm}));}
boolean _thislog = false;
anywheresoftware.b4a.objects.collections.List _maxpromos = null;
int _vendidas = 0;
anywheresoftware.b4a.sql.SQL.CursorWrapper _c = null;
RDebugUtils.currentLine=46989312;
 //BA.debugLineNum = 46989312;BA.debugLine="Sub traeMaxPromos(pm As Map) As Int";
RDebugUtils.currentLine=46989313;
 //BA.debugLineNum = 46989313;BA.debugLine="Private thisLog As Boolean = True 'Si es verdader";
_thislog = anywheresoftware.b4a.keywords.Common.True;
RDebugUtils.currentLine=46989314;
 //BA.debugLineNum = 46989314;BA.debugLine="Private maxPromos As List";
_maxpromos = new anywheresoftware.b4a.objects.collections.List();
RDebugUtils.currentLine=46989315;
 //BA.debugLineNum = 46989315;BA.debugLine="Private vendidas As Int = 0";
_vendidas = (int) (0);
RDebugUtils.currentLine=46989316;
 //BA.debugLineNum = 46989316;BA.debugLine="maxPromos.Initialize";
_maxpromos.Initialize();
RDebugUtils.currentLine=46989318;
 //BA.debugLineNum = 46989318;BA.debugLine="If thisLog Then Log(pm)";
if (_thislog) { 
anywheresoftware.b4a.keywords.Common.LogImpl("046989318",BA.ObjectToString(_pm),0);};
RDebugUtils.currentLine=46989319;
 //BA.debugLineNum = 46989319;BA.debugLine="If pm.Get(\"historico\") = \"1\" Then maxPromos.Add(p";
if ((_pm.Get((Object)("historico"))).equals((Object)("1"))) { 
_maxpromos.Add(_pm.Get((Object)("maxRecurrente")));};
RDebugUtils.currentLine=46989320;
 //BA.debugLineNum = 46989320;BA.debugLine="maxPromos.Add(pm.Get(\"maxPromos\")) 'Agregamos max";
_maxpromos.Add(_pm.Get((Object)("maxPromos")));
RDebugUtils.currentLine=46989321;
 //BA.debugLineNum = 46989321;BA.debugLine="maxPromos.Add(pm.Get(\"maxXcliente\")) 'Agregamos m";
_maxpromos.Add(_pm.Get((Object)("maxXcliente")));
RDebugUtils.currentLine=46989322;
 //BA.debugLineNum = 46989322;BA.debugLine="If thisLog Then Log(maxPromos)";
if (_thislog) { 
anywheresoftware.b4a.keywords.Common.LogImpl("046989322",BA.ObjectToString(_maxpromos),0);};
RDebugUtils.currentLine=46989323;
 //BA.debugLineNum = 46989323;BA.debugLine="maxPromos.Sort(True)";
_maxpromos.Sort(anywheresoftware.b4a.keywords.Common.True);
RDebugUtils.currentLine=46989325;
 //BA.debugLineNum = 46989325;BA.debugLine="If B4XPages.MainPage.tipo_venta = \"PREVENTA_FUTUR";
if ((mostCurrent._b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (_ba)._tipo_venta /*String*/ ).equals("PREVENTA_FUTURA")) { 
RDebugUtils.currentLine=46989326;
 //BA.debugLineNum = 46989326;BA.debugLine="Private c As Cursor = B4XPages.MainPage.skmt.Exe";
_c = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(mostCurrent._b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (_ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery2("select sum(PE_CANT) as vendidas from PEDIDO where PE_PROID = ? and PE_CLIENTE = ? AND PE_FUTURO = '1' ",new String[]{(BA.ObjectToString(_pm.Get((Object)("id")))).trim(),_traecliente(_ba).trim()})));
 }else {
RDebugUtils.currentLine=46989328;
 //BA.debugLineNum = 46989328;BA.debugLine="Private c As Cursor = B4XPages.MainPage.skmt.Exe";
_c = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(mostCurrent._b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (_ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery2("select sum(PE_CANT) as vendidas from PEDIDO where PE_PROID = ? and PE_CLIENTE = ? AND PE_FUTURO = '0'  ",new String[]{(BA.ObjectToString(_pm.Get((Object)("id")))).trim(),_traecliente(_ba).trim()})));
 };
RDebugUtils.currentLine=46989330;
 //BA.debugLineNum = 46989330;BA.debugLine="If c.RowCount > 0 Then";
if (_c.getRowCount()>0) { 
RDebugUtils.currentLine=46989331;
 //BA.debugLineNum = 46989331;BA.debugLine="c.Position = 0";
_c.setPosition((int) (0));
RDebugUtils.currentLine=46989332;
 //BA.debugLineNum = 46989332;BA.debugLine="vendidas = c.GetInt(\"vendidas\")";
_vendidas = _c.GetInt("vendidas");
 };
RDebugUtils.currentLine=46989338;
 //BA.debugLineNum = 46989338;BA.debugLine="Return maxPromos.Get(0) - vendidas 'Regresamos el";
if (true) return (int) ((double)(BA.ObjectToNumber(_maxpromos.Get((int) (0))))-_vendidas);
RDebugUtils.currentLine=46989339;
 //BA.debugLineNum = 46989339;BA.debugLine="End Sub";
return 0;
}
public static int  _traepromosvendidas(anywheresoftware.b4a.BA _ba,String _promo,String _cliente) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "traepromosvendidas", false))
	 {return ((Integer) Debug.delegate(null, "traepromosvendidas", new Object[] {_ba,_promo,_cliente}));}
anywheresoftware.b4a.sql.SQL.CursorWrapper _c = null;
int _pv = 0;
RDebugUtils.currentLine=47054848;
 //BA.debugLineNum = 47054848;BA.debugLine="Sub traePromosVendidas(promo As String, cliente As";
RDebugUtils.currentLine=47054849;
 //BA.debugLineNum = 47054849;BA.debugLine="Private c As Cursor";
_c = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
RDebugUtils.currentLine=47054850;
 //BA.debugLineNum = 47054850;BA.debugLine="Private pv As Int = 0";
_pv = (int) (0);
RDebugUtils.currentLine=47054851;
 //BA.debugLineNum = 47054851;BA.debugLine="If B4XPages.MainPage.tipo_venta = \"PREVENTA_FUTUR";
if ((mostCurrent._b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (_ba)._tipo_venta /*String*/ ).equals("PREVENTA_FUTURA")) { 
RDebugUtils.currentLine=47054852;
 //BA.debugLineNum = 47054852;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery($\"select PE_C";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(mostCurrent._b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (_ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery(("select PE_CANT from PEDIDO where PE_PROID = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_promo))+"' and PE_CLIENTE = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_cliente))+"' AND PE_FUTURO = '1' "))));
 }else {
RDebugUtils.currentLine=47054854;
 //BA.debugLineNum = 47054854;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery($\"select PE_C";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(mostCurrent._b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (_ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery(("select PE_CANT from PEDIDO where PE_PROID = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_promo))+"' and PE_CLIENTE = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_cliente))+"' AND PE_FUTURO = '0' "))));
 };
RDebugUtils.currentLine=47054856;
 //BA.debugLineNum = 47054856;BA.debugLine="If c.RowCount > 0 Then";
if (_c.getRowCount()>0) { 
RDebugUtils.currentLine=47054857;
 //BA.debugLineNum = 47054857;BA.debugLine="c.Position = 0";
_c.setPosition((int) (0));
RDebugUtils.currentLine=47054858;
 //BA.debugLineNum = 47054858;BA.debugLine="pv = c.GetInt(\"PE_CANT\")";
_pv = _c.GetInt("PE_CANT");
 };
RDebugUtils.currentLine=47054860;
 //BA.debugLineNum = 47054860;BA.debugLine="Return pv";
if (true) return _pv;
RDebugUtils.currentLine=47054861;
 //BA.debugLineNum = 47054861;BA.debugLine="End Sub";
return 0;
}
public static anywheresoftware.b4a.objects.collections.Map  _restafijospromo(anywheresoftware.b4a.BA _ba,anywheresoftware.b4a.objects.collections.Map _promomap) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "restafijospromo", false))
	 {return ((anywheresoftware.b4a.objects.collections.Map) Debug.delegate(null, "restafijospromo", new Object[] {_ba,_promomap}));}
boolean _thislog = false;
anywheresoftware.b4a.objects.collections.Map _inventariosdisponiblesparaestapromo = null;
int _i = 0;
anywheresoftware.b4a.objects.collections.Map _prodsmap = null;
anywheresoftware.b4a.objects.collections.List _prodsfijos = null;
int _p = 0;
String _t = "";
anywheresoftware.b4a.objects.collections.Map _p2 = null;
RDebugUtils.currentLine=46923776;
 //BA.debugLineNum = 46923776;BA.debugLine="Sub restaFijosPromo(promoMap As Map) As Map 'ignor";
RDebugUtils.currentLine=46923777;
 //BA.debugLineNum = 46923777;BA.debugLine="Private thisLog As Boolean = False 'Si es verdade";
_thislog = anywheresoftware.b4a.keywords.Common.False;
RDebugUtils.currentLine=46923778;
 //BA.debugLineNum = 46923778;BA.debugLine="Private inventariosDisponiblesParaEstaPromo As Ma";
_inventariosdisponiblesparaestapromo = new anywheresoftware.b4a.objects.collections.Map();
_inventariosdisponiblesparaestapromo = _traemosinventariodisponibleparapromo(_ba,BA.ObjectToString(_promomap.Get((Object)("id"))));
RDebugUtils.currentLine=46923779;
 //BA.debugLineNum = 46923779;BA.debugLine="If thisLog Then LogColor(inventariosDisponiblesPa";
if (_thislog) { 
anywheresoftware.b4a.keywords.Common.LogImpl("046923779",BA.ObjectToString(_inventariosdisponiblesparaestapromo),anywheresoftware.b4a.keywords.Common.Colors.Red);};
RDebugUtils.currentLine=46923780;
 //BA.debugLineNum = 46923780;BA.debugLine="If thisLog Then LogColor(\"Inventario inicial ante";
if (_thislog) { 
anywheresoftware.b4a.keywords.Common.LogImpl("046923780","Inventario inicial antes de FIJOS: "+BA.ObjectToString(_inventariosdisponiblesparaestapromo),anywheresoftware.b4a.keywords.Common.Colors.Gray);};
RDebugUtils.currentLine=46923781;
 //BA.debugLineNum = 46923781;BA.debugLine="Private i As Int";
_i = 0;
RDebugUtils.currentLine=46923782;
 //BA.debugLineNum = 46923782;BA.debugLine="Private prodsmap As Map = promoMap.Get(\"productos";
_prodsmap = new anywheresoftware.b4a.objects.collections.Map();
_prodsmap = (anywheresoftware.b4a.objects.collections.Map) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.collections.Map(), (java.util.Map)(_promomap.Get((Object)("productos"))));
RDebugUtils.currentLine=46923783;
 //BA.debugLineNum = 46923783;BA.debugLine="Private prodsFijos As List = promoMap.get(\"prodsF";
_prodsfijos = new anywheresoftware.b4a.objects.collections.List();
_prodsfijos = (anywheresoftware.b4a.objects.collections.List) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.collections.List(), (java.util.List)(_promomap.Get((Object)("prodsFijos"))));
RDebugUtils.currentLine=46923784;
 //BA.debugLineNum = 46923784;BA.debugLine="For p = 0 To prodsFijos.Size - 1";
{
final int step8 = 1;
final int limit8 = (int) (_prodsfijos.getSize()-1);
_p = (int) (0) ;
for (;_p <= limit8 ;_p = _p + step8 ) {
RDebugUtils.currentLine=46923785;
 //BA.debugLineNum = 46923785;BA.debugLine="Private t As String = prodsFijos.Get(p) 'Obtenem";
_t = BA.ObjectToString(_prodsfijos.Get(_p));
RDebugUtils.currentLine=46923786;
 //BA.debugLineNum = 46923786;BA.debugLine="Private p2 As Map = prodsmap.Get(t) 'Obtenemos u";
_p2 = new anywheresoftware.b4a.objects.collections.Map();
_p2 = (anywheresoftware.b4a.objects.collections.Map) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.collections.Map(), (java.util.Map)(_prodsmap.Get((Object)(_t))));
RDebugUtils.currentLine=46923787;
 //BA.debugLineNum = 46923787;BA.debugLine="If thisLog Then Log($\"T: ${t}, prod ${p2.Get(\"id";
if (_thislog) { 
anywheresoftware.b4a.keywords.Common.LogImpl("046923787",("T: "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_t))+", prod "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",_p2.Get((Object)("idProducto")))+", piezas: "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",_p2.Get((Object)("piezas")))+""),0);};
RDebugUtils.currentLine=46923788;
 //BA.debugLineNum = 46923788;BA.debugLine="If thisLog Then Log(\"inventariosDisponiblesParaE";
if (_thislog) { 
anywheresoftware.b4a.keywords.Common.LogImpl("046923788","inventariosDisponiblesParaEstaPromo="+BA.ObjectToString(_inventariosdisponiblesparaestapromo),0);};
RDebugUtils.currentLine=46923789;
 //BA.debugLineNum = 46923789;BA.debugLine="If inventariosDisponiblesParaEstaPromo.ContainsK";
if (_inventariosdisponiblesparaestapromo.ContainsKey((Object)(_t))) { 
RDebugUtils.currentLine=46923790;
 //BA.debugLineNum = 46923790;BA.debugLine="i = inventariosDisponiblesParaEstaPromo.get(t)";
_i = (int)(BA.ObjectToNumber(_inventariosdisponiblesparaestapromo.Get((Object)(_t))));
RDebugUtils.currentLine=46923791;
 //BA.debugLineNum = 46923791;BA.debugLine="If thisLog Then Log($\"Nuevo inventario de ${t}:";
if (_thislog) { 
anywheresoftware.b4a.keywords.Common.LogImpl("046923791",("Nuevo inventario de "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_t))+": "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_i))+"-"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",((anywheresoftware.b4a.objects.collections.List) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.collections.List(), (java.util.List)(_promomap.Get((Object)("prodsFijosPiezas"))))).Get(_p))+" = "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("1.0",(Object)(_i-(double)(BA.ObjectToNumber(((anywheresoftware.b4a.objects.collections.List) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.collections.List(), (java.util.List)(_promomap.Get((Object)("prodsFijosPiezas"))))).Get(_p)))))+""),0);};
RDebugUtils.currentLine=46923792;
 //BA.debugLineNum = 46923792;BA.debugLine="inventariosDisponiblesParaEstaPromo.Put(t, $\"${";
_inventariosdisponiblesparaestapromo.Put((Object)(_t),(Object)((""+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_i-(double)(BA.ObjectToNumber(((anywheresoftware.b4a.objects.collections.List) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.collections.List(), (java.util.List)(_promomap.Get((Object)("prodsFijosPiezas"))))).Get(_p)))))+"")));
RDebugUtils.currentLine=46923793;
 //BA.debugLineNum = 46923793;BA.debugLine="inventariosDisponiblesParaEstaPromo.Put(\"result";
_inventariosdisponiblesparaestapromo.Put((Object)("resultado"),(Object)("ok"));
 }else {
RDebugUtils.currentLine=46923795;
 //BA.debugLineNum = 46923795;BA.debugLine="inventariosDisponiblesParaEstaPromo.Put(\"result";
_inventariosdisponiblesparaestapromo.Put((Object)("resultado"),(Object)("No hay suficiente producto para la promocion."));
RDebugUtils.currentLine=46923796;
 //BA.debugLineNum = 46923796;BA.debugLine="LogColor(\"Sin suficiente inventario fijo: \" & t";
anywheresoftware.b4a.keywords.Common.LogImpl("046923796","Sin suficiente inventario fijo: "+_t,anywheresoftware.b4a.keywords.Common.Colors.Blue);
RDebugUtils.currentLine=46923797;
 //BA.debugLineNum = 46923797;BA.debugLine="Exit";
if (true) break;
 };
RDebugUtils.currentLine=46923799;
 //BA.debugLineNum = 46923799;BA.debugLine="If i - p2.Get(\"piezas\") < 0 Then";
if (_i-(double)(BA.ObjectToNumber(_p2.Get((Object)("piezas"))))<0) { 
RDebugUtils.currentLine=46923800;
 //BA.debugLineNum = 46923800;BA.debugLine="inventariosDisponiblesParaEstaPromo.Put(\"result";
_inventariosdisponiblesparaestapromo.Put((Object)("resultado"),(Object)("No hay suficiente producto para la promocion."));
RDebugUtils.currentLine=46923801;
 //BA.debugLineNum = 46923801;BA.debugLine="Exit";
if (true) break;
 };
 }
};
RDebugUtils.currentLine=46923804;
 //BA.debugLineNum = 46923804;BA.debugLine="If prodsFijos.Size = 0 Then inventariosDisponible";
if (_prodsfijos.getSize()==0) { 
_inventariosdisponiblesparaestapromo.Put((Object)("resultado"),(Object)("ok"));};
RDebugUtils.currentLine=46923805;
 //BA.debugLineNum = 46923805;BA.debugLine="If thisLog Then LogColor(\"Inventario final depues";
if (_thislog) { 
anywheresoftware.b4a.keywords.Common.LogImpl("046923805","Inventario final depues de FIJOS: "+BA.ObjectToString(_inventariosdisponiblesparaestapromo),anywheresoftware.b4a.keywords.Common.Colors.Blue);};
RDebugUtils.currentLine=46923806;
 //BA.debugLineNum = 46923806;BA.debugLine="Return inventariosDisponiblesParaEstaPromo";
if (true) return _inventariosdisponiblesparaestapromo;
RDebugUtils.currentLine=46923807;
 //BA.debugLineNum = 46923807;BA.debugLine="End Sub";
return null;
}
public static anywheresoftware.b4a.objects.collections.Map  _traemosinventariodisponibleparapromo(anywheresoftware.b4a.BA _ba,String _promo) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "traemosinventariodisponibleparapromo", false))
	 {return ((anywheresoftware.b4a.objects.collections.Map) Debug.delegate(null, "traemosinventariodisponibleparapromo", new Object[] {_ba,_promo}));}
anywheresoftware.b4a.sql.SQL.CursorWrapper _c = null;
anywheresoftware.b4a.objects.collections.Map _prods = null;
int _i = 0;
RDebugUtils.currentLine=46858240;
 //BA.debugLineNum = 46858240;BA.debugLine="Sub traemosInventarioDisponibleParaPromo(promo As";
RDebugUtils.currentLine=46858241;
 //BA.debugLineNum = 46858241;BA.debugLine="Private c As Cursor";
_c = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
RDebugUtils.currentLine=46858242;
 //BA.debugLineNum = 46858242;BA.debugLine="c = B4XPages.MainPage.skmt.ExecQuery2($\"SELECT CA";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(mostCurrent._b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (_ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery2(("SELECT CAT_GP_ID, CAT_GP_ALMACEN FROM "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_traetablaprods(_ba,_traetipoventadebd(_ba))))+" WHERE CAT_GP_ID IN (select CAT_DP_IDPROD FROM CAT_DETALLES_PAQ WHERE CAT_DP_ID = ?)"),new String[]{_promo})));
RDebugUtils.currentLine=46858245;
 //BA.debugLineNum = 46858245;BA.debugLine="Private prods As Map";
_prods = new anywheresoftware.b4a.objects.collections.Map();
RDebugUtils.currentLine=46858246;
 //BA.debugLineNum = 46858246;BA.debugLine="prods.Initialize";
_prods.Initialize();
RDebugUtils.currentLine=46858247;
 //BA.debugLineNum = 46858247;BA.debugLine="If c.RowCount > 0 Then";
if (_c.getRowCount()>0) { 
RDebugUtils.currentLine=46858248;
 //BA.debugLineNum = 46858248;BA.debugLine="For i=0 To c.RowCount -1";
{
final int step6 = 1;
final int limit6 = (int) (_c.getRowCount()-1);
_i = (int) (0) ;
for (;_i <= limit6 ;_i = _i + step6 ) {
RDebugUtils.currentLine=46858249;
 //BA.debugLineNum = 46858249;BA.debugLine="c.Position=i";
_c.setPosition(_i);
RDebugUtils.currentLine=46858250;
 //BA.debugLineNum = 46858250;BA.debugLine="prods.Put(c.GetString(\"CAT_GP_ID\"), c.GetString";
_prods.Put((Object)(_c.GetString("CAT_GP_ID")),(Object)(_c.GetString("CAT_GP_ALMACEN")));
 }
};
 };
RDebugUtils.currentLine=46858255;
 //BA.debugLineNum = 46858255;BA.debugLine="Return prods";
if (true) return _prods;
RDebugUtils.currentLine=46858256;
 //BA.debugLineNum = 46858256;BA.debugLine="End Sub";
return null;
}
public static String  _revisaflp(anywheresoftware.b4a.BA _ba) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "revisaflp", false))
	 {return ((String) Debug.delegate(null, "revisaflp", new Object[] {_ba}));}
boolean _todobienflp = false;
RDebugUtils.currentLine=44761088;
 //BA.debugLineNum = 44761088;BA.debugLine="Sub revisaFLP 'ignore";
RDebugUtils.currentLine=44761089;
 //BA.debugLineNum = 44761089;BA.debugLine="LogColor(\"**** **** Revisamos FLP **** ****\", Col";
anywheresoftware.b4a.keywords.Common.LogImpl("044761089","**** **** Revisamos FLP **** ****",anywheresoftware.b4a.keywords.Common.Colors.RGB((int) (78),(int) (0),(int) (227)));
RDebugUtils.currentLine=44761090;
 //BA.debugLineNum = 44761090;BA.debugLine="Private todoBienFLP As Boolean = True";
_todobienflp = anywheresoftware.b4a.keywords.Common.True;
RDebugUtils.currentLine=44761091;
 //BA.debugLineNum = 44761091;BA.debugLine="Try";
try {RDebugUtils.currentLine=44761092;
 //BA.debugLineNum = 44761092;BA.debugLine="If Not(Tracker.FLP.IsInitialized) Then";
if (anywheresoftware.b4a.keywords.Common.Not(mostCurrent._tracker._flp /*uk.co.martinpearman.b4a.fusedlocationprovider.FusedLocationProviderWrapper*/ .IsInitialized())) { 
RDebugUtils.currentLine=44761093;
 //BA.debugLineNum = 44761093;BA.debugLine="log2DB(\"revisaFLP: No esta inicializado ... 'Re";
_log2db(_ba,"revisaFLP: No esta inicializado ... 'Reinicializando FLP'");
RDebugUtils.currentLine=44761094;
 //BA.debugLineNum = 44761094;BA.debugLine="Tracker.FLP.Initialize(\"flp\")";
mostCurrent._tracker._flp /*uk.co.martinpearman.b4a.fusedlocationprovider.FusedLocationProviderWrapper*/ .Initialize((_ba.processBA == null ? _ba : _ba.processBA),"flp");
RDebugUtils.currentLine=44761095;
 //BA.debugLineNum = 44761095;BA.debugLine="todoBienFLP = False";
_todobienflp = anywheresoftware.b4a.keywords.Common.False;
 };
 } 
       catch (Exception e10) {
			(_ba.processBA == null ? _ba : _ba.processBA).setLastException(e10);RDebugUtils.currentLine=44761098;
 //BA.debugLineNum = 44761098;BA.debugLine="LogColor(\"If Not(Tracker.FLP.IsInitialized) ---";
anywheresoftware.b4a.keywords.Common.LogImpl("044761098","If Not(Tracker.FLP.IsInitialized) --- "+BA.ObjectToString(anywheresoftware.b4a.keywords.Common.LastException(_ba)),anywheresoftware.b4a.keywords.Common.Colors.Red);
 };
RDebugUtils.currentLine=44761100;
 //BA.debugLineNum = 44761100;BA.debugLine="Try";
try {RDebugUtils.currentLine=44761101;
 //BA.debugLineNum = 44761101;BA.debugLine="If Tracker.FLP.IsInitialized Then";
if (mostCurrent._tracker._flp /*uk.co.martinpearman.b4a.fusedlocationprovider.FusedLocationProviderWrapper*/ .IsInitialized()) { 
RDebugUtils.currentLine=44761102;
 //BA.debugLineNum = 44761102;BA.debugLine="Try";
try {RDebugUtils.currentLine=44761103;
 //BA.debugLineNum = 44761103;BA.debugLine="If Not(Tracker.FLP.IsConnected) Then";
if (anywheresoftware.b4a.keywords.Common.Not(mostCurrent._tracker._flp /*uk.co.martinpearman.b4a.fusedlocationprovider.FusedLocationProviderWrapper*/ .IsConnected())) { 
RDebugUtils.currentLine=44761104;
 //BA.debugLineNum = 44761104;BA.debugLine="log2DB(\"revisaFLP: No esta conectado ... 'Rec";
_log2db(_ba,"revisaFLP: No esta conectado ... 'Reconectando FLP'");
RDebugUtils.currentLine=44761106;
 //BA.debugLineNum = 44761106;BA.debugLine="CallSubDelayed(Tracker,\"StartFLP\")";
anywheresoftware.b4a.keywords.Common.CallSubDelayed((_ba.processBA == null ? _ba : _ba.processBA),(Object)(mostCurrent._tracker.getObject()),"StartFLP");
RDebugUtils.currentLine=44761107;
 //BA.debugLineNum = 44761107;BA.debugLine="todoBienFLP = False";
_todobienflp = anywheresoftware.b4a.keywords.Common.False;
 };
 } 
       catch (Exception e21) {
			(_ba.processBA == null ? _ba : _ba.processBA).setLastException(e21);RDebugUtils.currentLine=44761110;
 //BA.debugLineNum = 44761110;BA.debugLine="LogColor(\"If Not(Tracker.FLP.IsConnected) -->";
anywheresoftware.b4a.keywords.Common.LogImpl("044761110","If Not(Tracker.FLP.IsConnected) --> "+BA.ObjectToString(anywheresoftware.b4a.keywords.Common.LastException(_ba)),anywheresoftware.b4a.keywords.Common.Colors.Red);
 };
RDebugUtils.currentLine=44761112;
 //BA.debugLineNum = 44761112;BA.debugLine="Try";
try {RDebugUtils.currentLine=44761113;
 //BA.debugLineNum = 44761113;BA.debugLine="If Tracker.FLP.IsConnected And _ 					Tracker.";
if (mostCurrent._tracker._flp /*uk.co.martinpearman.b4a.fusedlocationprovider.FusedLocationProviderWrapper*/ .IsConnected() && mostCurrent._tracker._flp /*uk.co.martinpearman.b4a.fusedlocationprovider.FusedLocationProviderWrapper*/ .GetLastKnownLocation().IsInitialized() && mostCurrent._tracker._flp /*uk.co.martinpearman.b4a.fusedlocationprovider.FusedLocationProviderWrapper*/ .GetLastKnownLocation().DistanceTo((android.location.Location)(mostCurrent._tracker._uugcoords /*anywheresoftware.b4a.gps.LocationWrapper*/ .getObject()))>500) { 
RDebugUtils.currentLine=44761116;
 //BA.debugLineNum = 44761116;BA.debugLine="log2DB(\"revisaFLP: 'No se esta actualizando,";
_log2db(_ba,"revisaFLP: 'No se esta actualizando, lo reiniciamos ...'");
RDebugUtils.currentLine=44761117;
 //BA.debugLineNum = 44761117;BA.debugLine="StartService(Tracker)";
anywheresoftware.b4a.keywords.Common.StartService((_ba.processBA == null ? _ba : _ba.processBA),(Object)(mostCurrent._tracker.getObject()));
RDebugUtils.currentLine=44761118;
 //BA.debugLineNum = 44761118;BA.debugLine="todoBienFLP = False";
_todobienflp = anywheresoftware.b4a.keywords.Common.False;
 };
 } 
       catch (Exception e30) {
			(_ba.processBA == null ? _ba : _ba.processBA).setLastException(e30);RDebugUtils.currentLine=44761121;
 //BA.debugLineNum = 44761121;BA.debugLine="LogColor(\"If FLP.IsConnectctd and FLP.getLKL.I";
anywheresoftware.b4a.keywords.Common.LogImpl("044761121","If FLP.IsConnectctd and FLP.getLKL.IsInitialized --> "+BA.ObjectToString(anywheresoftware.b4a.keywords.Common.LastException(_ba)),anywheresoftware.b4a.keywords.Common.Colors.Red);
 };
 };
RDebugUtils.currentLine=44761124;
 //BA.debugLineNum = 44761124;BA.debugLine="If todoBienFLP Then LogColor(\" +++ +++ Sin error";
if (_todobienflp) { 
anywheresoftware.b4a.keywords.Common.LogImpl("044761124"," +++ +++ Sin errores en FLP",anywheresoftware.b4a.keywords.Common.Colors.Green);};
 } 
       catch (Exception e35) {
			(_ba.processBA == null ? _ba : _ba.processBA).setLastException(e35);RDebugUtils.currentLine=44761126;
 //BA.debugLineNum = 44761126;BA.debugLine="LogColor(\"If Tracker.FLP.IsInitialized --> \"&Las";
anywheresoftware.b4a.keywords.Common.LogImpl("044761126","If Tracker.FLP.IsInitialized --> "+BA.ObjectToString(anywheresoftware.b4a.keywords.Common.LastException(_ba)),anywheresoftware.b4a.keywords.Common.Colors.Red);
 };
RDebugUtils.currentLine=44761129;
 //BA.debugLineNum = 44761129;BA.debugLine="End Sub";
return "";
}
public static boolean  _revisaimpreso(anywheresoftware.b4a.BA _ba) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "revisaimpreso", false))
	 {return ((Boolean) Debug.delegate(null, "revisaimpreso", new Object[] {_ba}));}
boolean _impreso = false;
anywheresoftware.b4a.sql.SQL.CursorWrapper _c = null;
RDebugUtils.currentLine=49152000;
 //BA.debugLineNum = 49152000;BA.debugLine="Sub revisaImpreso As Boolean 'ignore";
RDebugUtils.currentLine=49152001;
 //BA.debugLineNum = 49152001;BA.debugLine="Private impreso As Boolean = False";
_impreso = anywheresoftware.b4a.keywords.Common.False;
RDebugUtils.currentLine=49152002;
 //BA.debugLineNum = 49152002;BA.debugLine="Private c As Cursor = Starter.skmt.ExecQuery(\"sel";
_c = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(mostCurrent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select idCliente from ticket_impreso where idCliente in (select cuenta from cuentaa)")));
RDebugUtils.currentLine=49152003;
 //BA.debugLineNum = 49152003;BA.debugLine="If c.RowCount > 0 Then impreso = True";
if (_c.getRowCount()>0) { 
_impreso = anywheresoftware.b4a.keywords.Common.True;};
RDebugUtils.currentLine=49152004;
 //BA.debugLineNum = 49152004;BA.debugLine="Return impreso";
if (true) return _impreso;
RDebugUtils.currentLine=49152005;
 //BA.debugLineNum = 49152005;BA.debugLine="End Sub";
return false;
}
public static int  _revisamaxpromosprodsfijosporinventario(anywheresoftware.b4a.BA _ba,anywheresoftware.b4a.objects.collections.Map _pm) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "revisamaxpromosprodsfijosporinventario", false))
	 {return ((Integer) Debug.delegate(null, "revisamaxpromosprodsfijosporinventario", new Object[] {_ba,_pm}));}
boolean _thislog = false;
anywheresoftware.b4a.objects.collections.Map _invfijoxpromo = null;
anywheresoftware.b4a.objects.collections.List _t = null;
anywheresoftware.b4a.objects.collections.Map _invdispparapromo = null;
anywheresoftware.b4a.objects.collections.List _prodsfijospiezas = null;
anywheresoftware.b4a.objects.collections.List _idprodsfijos = null;
int _p = 0;
String[] _x = null;
RDebugUtils.currentLine=47251456;
 //BA.debugLineNum = 47251456;BA.debugLine="Sub revisaMaxPromosProdsFijosPorInventario(pm As M";
RDebugUtils.currentLine=47251457;
 //BA.debugLineNum = 47251457;BA.debugLine="Private thisLog As Boolean = False";
_thislog = anywheresoftware.b4a.keywords.Common.False;
RDebugUtils.currentLine=47251458;
 //BA.debugLineNum = 47251458;BA.debugLine="Private invFijoXpromo As Map";
_invfijoxpromo = new anywheresoftware.b4a.objects.collections.Map();
RDebugUtils.currentLine=47251459;
 //BA.debugLineNum = 47251459;BA.debugLine="Private t As List";
_t = new anywheresoftware.b4a.objects.collections.List();
RDebugUtils.currentLine=47251460;
 //BA.debugLineNum = 47251460;BA.debugLine="t.Initialize";
_t.Initialize();
RDebugUtils.currentLine=47251461;
 //BA.debugLineNum = 47251461;BA.debugLine="t.Add(traeMaxPromos(pm)) ' Agregamos a la lista l";
_t.Add((Object)(_traemaxpromos(_ba,_pm)));
RDebugUtils.currentLine=47251462;
 //BA.debugLineNum = 47251462;BA.debugLine="invFijoXpromo.Initialize";
_invfijoxpromo.Initialize();
RDebugUtils.currentLine=47251463;
 //BA.debugLineNum = 47251463;BA.debugLine="If thisLog Then LogColor($\"pm=${pm}\"$, Colors.Blu";
if (_thislog) { 
anywheresoftware.b4a.keywords.Common.LogImpl("047251463",("pm="+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_pm.getObject()))+""),anywheresoftware.b4a.keywords.Common.Colors.Blue);};
RDebugUtils.currentLine=47251464;
 //BA.debugLineNum = 47251464;BA.debugLine="Private invDispParaPromo As Map = traemosInventar";
_invdispparapromo = new anywheresoftware.b4a.objects.collections.Map();
_invdispparapromo = _traemosinventariodisponibleparapromo(_ba,BA.ObjectToString(_pm.Get((Object)("id"))));
RDebugUtils.currentLine=47251465;
 //BA.debugLineNum = 47251465;BA.debugLine="If thisLog Then Log($\"invDispParaPromo=${invDispP";
if (_thislog) { 
anywheresoftware.b4a.keywords.Common.LogImpl("047251465",("invDispParaPromo="+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_invdispparapromo.getObject()))+""),0);};
RDebugUtils.currentLine=47251466;
 //BA.debugLineNum = 47251466;BA.debugLine="Private prodsFijosPiezas As List = pm.Get(\"prodsF";
_prodsfijospiezas = new anywheresoftware.b4a.objects.collections.List();
_prodsfijospiezas = (anywheresoftware.b4a.objects.collections.List) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.collections.List(), (java.util.List)(_pm.Get((Object)("prodsFijosPiezas"))));
RDebugUtils.currentLine=47251467;
 //BA.debugLineNum = 47251467;BA.debugLine="Private idProdsFijos As List = pm.Get(\"prodsFijos";
_idprodsfijos = new anywheresoftware.b4a.objects.collections.List();
_idprodsfijos = (anywheresoftware.b4a.objects.collections.List) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.collections.List(), (java.util.List)(_pm.Get((Object)("prodsFijos"))));
RDebugUtils.currentLine=47251468;
 //BA.debugLineNum = 47251468;BA.debugLine="For p = 0 To idProdsFijos.Size -1 'Generamos una";
{
final int step12 = 1;
final int limit12 = (int) (_idprodsfijos.getSize()-1);
_p = (int) (0) ;
for (;_p <= limit12 ;_p = _p + step12 ) {
RDebugUtils.currentLine=47251469;
 //BA.debugLineNum = 47251469;BA.debugLine="If thisLog Then Log($\"id=${idProdsFijos.Get(p)},";
if (_thislog) { 
anywheresoftware.b4a.keywords.Common.LogImpl("047251469",("id="+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",_idprodsfijos.Get(_p))+", inv="+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",_invdispparapromo.Get(_idprodsfijos.Get(_p)))+", pzas="+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",_prodsfijospiezas.Get(_p))+""),0);};
RDebugUtils.currentLine=47251470;
 //BA.debugLineNum = 47251470;BA.debugLine="If thisLog Then Log($\"${(invDispParaPromo.Get(id";
if (_thislog) { 
anywheresoftware.b4a.keywords.Common.LogImpl("047251470",(""+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(((double)(BA.ObjectToNumber(_invdispparapromo.Get(_idprodsfijos.Get(_p))))/(double)(double)(BA.ObjectToNumber(_prodsfijospiezas.Get(_p))))))+""),0);};
RDebugUtils.currentLine=47251471;
 //BA.debugLineNum = 47251471;BA.debugLine="Private x() As String = Regex.Split(\"\\.\", $\"${(i";
_x = anywheresoftware.b4a.keywords.Common.Regex.Split("\\.",(""+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(((double)(BA.ObjectToNumber(_invdispparapromo.Get(_idprodsfijos.Get(_p))))/(double)(double)(BA.ObjectToNumber(_prodsfijospiezas.Get(_p))))))+""));
RDebugUtils.currentLine=47251472;
 //BA.debugLineNum = 47251472;BA.debugLine="If thisLog Then Log(x(0))";
if (_thislog) { 
anywheresoftware.b4a.keywords.Common.LogImpl("047251472",_x[(int) (0)],0);};
RDebugUtils.currentLine=47251473;
 //BA.debugLineNum = 47251473;BA.debugLine="t.Add(x(0).As(Int)) 'Solo guardamos la parte del";
_t.Add((Object)(((int)(Double.parseDouble(_x[(int) (0)])))));
 }
};
RDebugUtils.currentLine=47251475;
 //BA.debugLineNum = 47251475;BA.debugLine="t.Sort(True) 'Ordenamos la lista para que en el l";
_t.Sort(anywheresoftware.b4a.keywords.Common.True);
RDebugUtils.currentLine=47251476;
 //BA.debugLineNum = 47251476;BA.debugLine="If thisLog Then LogColor($\"prodsFijos=${idProdsFi";
if (_thislog) { 
anywheresoftware.b4a.keywords.Common.LogImpl("047251476",("prodsFijos="+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_idprodsfijos.getObject()))+""),anywheresoftware.b4a.keywords.Common.Colors.Blue);};
RDebugUtils.currentLine=47251477;
 //BA.debugLineNum = 47251477;BA.debugLine="If thisLog Then LogColor($\"prodsFijosPiezasReq=${";
if (_thislog) { 
anywheresoftware.b4a.keywords.Common.LogImpl("047251477",("prodsFijosPiezasReq="+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_prodsfijospiezas.getObject()))+""),anywheresoftware.b4a.keywords.Common.Colors.Blue);};
RDebugUtils.currentLine=47251478;
 //BA.debugLineNum = 47251478;BA.debugLine="If thisLog Then LogColor($\"invFijoXpromo=${invFij";
if (_thislog) { 
anywheresoftware.b4a.keywords.Common.LogImpl("047251478",("invFijoXpromo="+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_invfijoxpromo.getObject()))+""),anywheresoftware.b4a.keywords.Common.Colors.Blue);};
RDebugUtils.currentLine=47251479;
 //BA.debugLineNum = 47251479;BA.debugLine="LogColor(\"Max promos de prodsFijos POR inventario";
anywheresoftware.b4a.keywords.Common.LogImpl("047251479","Max promos de prodsFijos POR inventario = "+BA.ObjectToString(_t.Get((int) (0))),anywheresoftware.b4a.keywords.Common.Colors.Red);
RDebugUtils.currentLine=47251480;
 //BA.debugLineNum = 47251480;BA.debugLine="Return t.Get(0) 'Regresamos el resultado mas pequ";
if (true) return (int)(BA.ObjectToNumber(_t.Get((int) (0))));
RDebugUtils.currentLine=47251481;
 //BA.debugLineNum = 47251481;BA.debugLine="End Sub";
return 0;
}
public static int  _revisamaxpromosprodsfijosporinventario2(anywheresoftware.b4a.BA _ba,anywheresoftware.b4a.objects.collections.Map _pm) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "revisamaxpromosprodsfijosporinventario2", false))
	 {return ((Integer) Debug.delegate(null, "revisamaxpromosprodsfijosporinventario2", new Object[] {_ba,_pm}));}
boolean _thislog = false;
anywheresoftware.b4a.objects.collections.Map _invdispparapromo = null;
String _maxpromos = "";
int _maxpromosfijosxinv = 0;
int _fpf2 = 0;
int _pdp2 = 0;
boolean _salir = false;
anywheresoftware.b4a.objects.collections.List _pf = null;
anywheresoftware.b4a.objects.collections.List _pfp = null;
anywheresoftware.b4a.objects.collections.Map _invfijoxpromo = null;
int _p = 0;
int _i = 0;
int _q = 0;
String _q2 = "";
RDebugUtils.currentLine=47185920;
 //BA.debugLineNum = 47185920;BA.debugLine="Sub revisaMaxPromosProdsFijosPorInventario2(pm As";
RDebugUtils.currentLine=47185921;
 //BA.debugLineNum = 47185921;BA.debugLine="Private thisLog As Boolean = False";
_thislog = anywheresoftware.b4a.keywords.Common.False;
RDebugUtils.currentLine=47185922;
 //BA.debugLineNum = 47185922;BA.debugLine="If thisLog Then Log($\"pm=${pm}\"$)";
if (_thislog) { 
anywheresoftware.b4a.keywords.Common.LogImpl("047185922",("pm="+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_pm.getObject()))+""),0);};
RDebugUtils.currentLine=47185924;
 //BA.debugLineNum = 47185924;BA.debugLine="Private invDispParaPromo As Map = traemosInventar";
_invdispparapromo = new anywheresoftware.b4a.objects.collections.Map();
_invdispparapromo = _traemosinventariodisponibleparapromo(_ba,BA.ObjectToString(_pm.Get((Object)("id"))));
RDebugUtils.currentLine=47185925;
 //BA.debugLineNum = 47185925;BA.debugLine="If thisLog Then Log($\"invDispParaPromo=${invDispP";
if (_thislog) { 
anywheresoftware.b4a.keywords.Common.LogImpl("047185925",("invDispParaPromo="+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_invdispparapromo.getObject()))+""),0);};
RDebugUtils.currentLine=47185926;
 //BA.debugLineNum = 47185926;BA.debugLine="Private maxPromos As String = traeMaxPromos(pm)";
_maxpromos = BA.NumberToString(_traemaxpromos(_ba,_pm));
RDebugUtils.currentLine=47185927;
 //BA.debugLineNum = 47185927;BA.debugLine="Private maxPromosFijosXinv As Int = 1";
_maxpromosfijosxinv = (int) (1);
RDebugUtils.currentLine=47185928;
 //BA.debugLineNum = 47185928;BA.debugLine="Private fpf2, pdp2 As Int";
_fpf2 = 0;
_pdp2 = 0;
RDebugUtils.currentLine=47185929;
 //BA.debugLineNum = 47185929;BA.debugLine="Private salir As Boolean = False";
_salir = anywheresoftware.b4a.keywords.Common.False;
RDebugUtils.currentLine=47185930;
 //BA.debugLineNum = 47185930;BA.debugLine="Private pf As List = pm.Get(\"prodsFijos\")";
_pf = new anywheresoftware.b4a.objects.collections.List();
_pf = (anywheresoftware.b4a.objects.collections.List) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.collections.List(), (java.util.List)(_pm.Get((Object)("prodsFijos"))));
RDebugUtils.currentLine=47185931;
 //BA.debugLineNum = 47185931;BA.debugLine="Private pfp As List = pm.Get(\"prodsFijosPiezas\")";
_pfp = new anywheresoftware.b4a.objects.collections.List();
_pfp = (anywheresoftware.b4a.objects.collections.List) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.collections.List(), (java.util.List)(_pm.Get((Object)("prodsFijosPiezas"))));
RDebugUtils.currentLine=47185932;
 //BA.debugLineNum = 47185932;BA.debugLine="If thisLog Then Log($\"maxPromos=${maxPromos}, pro";
if (_thislog) { 
anywheresoftware.b4a.keywords.Common.LogImpl("047185932",("maxPromos="+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_maxpromos))+", prodsFijos="+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_pf.getObject()))+", piezas="+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_pfp.getObject()))+""),0);};
RDebugUtils.currentLine=47185933;
 //BA.debugLineNum = 47185933;BA.debugLine="If thisLog Then LogColor($\"InvFijo disponible=${i";
if (_thislog) { 
anywheresoftware.b4a.keywords.Common.LogImpl("047185933",("InvFijo disponible="+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_invdispparapromo.getObject()))+""),anywheresoftware.b4a.keywords.Common.Colors.Blue);};
RDebugUtils.currentLine=47185934;
 //BA.debugLineNum = 47185934;BA.debugLine="Private invFijoXpromo As Map";
_invfijoxpromo = new anywheresoftware.b4a.objects.collections.Map();
RDebugUtils.currentLine=47185935;
 //BA.debugLineNum = 47185935;BA.debugLine="invFijoXpromo.Initialize";
_invfijoxpromo.Initialize();
RDebugUtils.currentLine=47185936;
 //BA.debugLineNum = 47185936;BA.debugLine="For p = 0 To pf.Size -1 'Generamos mapa con los p";
{
final int step15 = 1;
final int limit15 = (int) (_pf.getSize()-1);
_p = (int) (0) ;
for (;_p <= limit15 ;_p = _p + step15 ) {
RDebugUtils.currentLine=47185937;
 //BA.debugLineNum = 47185937;BA.debugLine="invFijoXpromo.Put(pf.Get(p), pfp.Get(p))";
_invfijoxpromo.Put(_pf.Get(_p),_pfp.Get(_p));
 }
};
RDebugUtils.currentLine=47185939;
 //BA.debugLineNum = 47185939;BA.debugLine="If thisLog Then LogColor(\"Inv req. de prods fijos";
if (_thislog) { 
anywheresoftware.b4a.keywords.Common.LogImpl("047185939","Inv req. de prods fijos x promo"+BA.ObjectToString(_invfijoxpromo),anywheresoftware.b4a.keywords.Common.Colors.Green);};
RDebugUtils.currentLine=47185940;
 //BA.debugLineNum = 47185940;BA.debugLine="For i = 1 To maxPromos 'Revisamos cuantas promoci";
{
final int step19 = 1;
final int limit19 = (int)(Double.parseDouble(_maxpromos));
_i = (int) (1) ;
for (;_i <= limit19 ;_i = _i + step19 ) {
RDebugUtils.currentLine=47185941;
 //BA.debugLineNum = 47185941;BA.debugLine="If thisLog Then LogColor(\"Prods para promo \" & (";
if (_thislog) { 
anywheresoftware.b4a.keywords.Common.LogImpl("047185941","Prods para promo "+BA.NumberToString((_i+1)),anywheresoftware.b4a.keywords.Common.Colors.Magenta);};
RDebugUtils.currentLine=47185942;
 //BA.debugLineNum = 47185942;BA.debugLine="For q = 0 To pf.Size - 1";
{
final int step21 = 1;
final int limit21 = (int) (_pf.getSize()-1);
_q = (int) (0) ;
for (;_q <= limit21 ;_q = _q + step21 ) {
RDebugUtils.currentLine=47185943;
 //BA.debugLineNum = 47185943;BA.debugLine="Private q2 As String = pf.Get(q)";
_q2 = BA.ObjectToString(_pf.Get(_q));
RDebugUtils.currentLine=47185944;
 //BA.debugLineNum = 47185944;BA.debugLine="If thisLog Then Log(\"q=\"&q2)";
if (_thislog) { 
anywheresoftware.b4a.keywords.Common.LogImpl("047185944","q="+_q2,0);};
RDebugUtils.currentLine=47185946;
 //BA.debugLineNum = 47185946;BA.debugLine="fpf2 = pfp.Get(q) * i 'Multiplicamos las piezas";
_fpf2 = (int) ((double)(BA.ObjectToNumber(_pfp.Get(_q)))*_i);
RDebugUtils.currentLine=47185947;
 //BA.debugLineNum = 47185947;BA.debugLine="pdp2 = invDispParaPromo.Get(q2)";
_pdp2 = (int)(BA.ObjectToNumber(_invdispparapromo.Get((Object)(_q2))));
RDebugUtils.currentLine=47185948;
 //BA.debugLineNum = 47185948;BA.debugLine="If thisLog Then Log($\"pf=${q2}, Actual=${(i)},";
if (_thislog) { 
anywheresoftware.b4a.keywords.Common.LogImpl("047185948",("pf="+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_q2))+", Actual="+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)((_i)))+", max promos: "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_pdp2))+"-"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_fpf2))+"="+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_pdp2-_fpf2))+""),0);};
RDebugUtils.currentLine=47185949;
 //BA.debugLineNum = 47185949;BA.debugLine="If pdp2 - fpf2 < 0 Then 'Si el inventario es ne";
if (_pdp2-_fpf2<0) { 
RDebugUtils.currentLine=47185950;
 //BA.debugLineNum = 47185950;BA.debugLine="salir=True";
_salir = anywheresoftware.b4a.keywords.Common.True;
RDebugUtils.currentLine=47185951;
 //BA.debugLineNum = 47185951;BA.debugLine="Exit";
if (true) break;
 };
 }
};
RDebugUtils.currentLine=47185954;
 //BA.debugLineNum = 47185954;BA.debugLine="If salir Then Exit";
if (_salir) { 
if (true) break;};
RDebugUtils.currentLine=47185955;
 //BA.debugLineNum = 47185955;BA.debugLine="maxPromosFijosXinv = i";
_maxpromosfijosxinv = _i;
 }
};
RDebugUtils.currentLine=47185957;
 //BA.debugLineNum = 47185957;BA.debugLine="If thisLog Then LogColor(\"InvFijo requerido x pro";
if (_thislog) { 
anywheresoftware.b4a.keywords.Common.LogImpl("047185957","InvFijo requerido x promo="+BA.ObjectToString(_invfijoxpromo),anywheresoftware.b4a.keywords.Common.Colors.Blue);};
RDebugUtils.currentLine=47185958;
 //BA.debugLineNum = 47185958;BA.debugLine="LogColor(\"Maximo de promociones de prodsFijos POR";
anywheresoftware.b4a.keywords.Common.LogImpl("047185958","Maximo de promociones de prodsFijos POR inventario = "+BA.NumberToString(_maxpromosfijosxinv),anywheresoftware.b4a.keywords.Common.Colors.Red);
RDebugUtils.currentLine=47185959;
 //BA.debugLineNum = 47185959;BA.debugLine="Return maxPromosFijosXinv";
if (true) return _maxpromosfijosxinv;
RDebugUtils.currentLine=47185960;
 //BA.debugLineNum = 47185960;BA.debugLine="End Sub";
return 0;
}
public static int  _revisamaxpromosprodsvariablesporinventario(anywheresoftware.b4a.BA _ba,anywheresoftware.b4a.objects.collections.Map _pm) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "revisamaxpromosprodsvariablesporinventario", false))
	 {return ((Integer) Debug.delegate(null, "revisamaxpromosprodsvariablesporinventario", new Object[] {_ba,_pm}));}
boolean _thislog = false;
anywheresoftware.b4a.objects.collections.Map _invfijoxpromo = null;
int _totalprodsvariablesdisponibles = 0;
int _totalprodsvariables2disponibles = 0;
anywheresoftware.b4a.objects.collections.Map _invdispparapromo = null;
String _maxpromos = "";
int _maxpromosxfijos = 0;
anywheresoftware.b4a.objects.collections.List _idprodsvariables = null;
anywheresoftware.b4a.objects.collections.List _idprodsvariables2 = null;
int _prodsvariablesrequeridos = 0;
int _prodsvariables2requeridos = 0;
anywheresoftware.b4a.objects.collections.List _prodsfijospiezas = null;
anywheresoftware.b4a.objects.collections.List _idprodsfijos = null;
int _p = 0;
String _idesteprod = "";
int _investeprod = 0;
int _pzasreqesteprod = 0;
int _maxpromosxvariables = 0;
int _maxpromosxvariables2 = 0;
int _x = 0;
int _i = 0;
RDebugUtils.currentLine=49610752;
 //BA.debugLineNum = 49610752;BA.debugLine="Sub revisaMaxPromosProdsVariablesPorInventario(pm";
RDebugUtils.currentLine=49610753;
 //BA.debugLineNum = 49610753;BA.debugLine="Private thisLog As Boolean = False";
_thislog = anywheresoftware.b4a.keywords.Common.False;
RDebugUtils.currentLine=49610754;
 //BA.debugLineNum = 49610754;BA.debugLine="If thisLog Then Log(\"============================";
if (_thislog) { 
anywheresoftware.b4a.keywords.Common.LogImpl("049610754","======================================================",0);};
RDebugUtils.currentLine=49610755;
 //BA.debugLineNum = 49610755;BA.debugLine="If thisLog Then Log(\"============================";
if (_thislog) { 
anywheresoftware.b4a.keywords.Common.LogImpl("049610755","======================================================",0);};
RDebugUtils.currentLine=49610756;
 //BA.debugLineNum = 49610756;BA.debugLine="Private invFijoXpromo As Map";
_invfijoxpromo = new anywheresoftware.b4a.objects.collections.Map();
RDebugUtils.currentLine=49610757;
 //BA.debugLineNum = 49610757;BA.debugLine="invFijoXpromo.Initialize";
_invfijoxpromo.Initialize();
RDebugUtils.currentLine=49610758;
 //BA.debugLineNum = 49610758;BA.debugLine="Private totalProdsVariablesDisponibles As Int = 0";
_totalprodsvariablesdisponibles = (int) (0);
RDebugUtils.currentLine=49610759;
 //BA.debugLineNum = 49610759;BA.debugLine="Private totalProdsVariables2Disponibles As Int =";
_totalprodsvariables2disponibles = (int) (0);
RDebugUtils.currentLine=49610760;
 //BA.debugLineNum = 49610760;BA.debugLine="If thisLog Then LogColor($\"pm=${pm}\"$, Colors.Blu";
if (_thislog) { 
anywheresoftware.b4a.keywords.Common.LogImpl("049610760",("pm="+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_pm.getObject()))+""),anywheresoftware.b4a.keywords.Common.Colors.Blue);};
RDebugUtils.currentLine=49610761;
 //BA.debugLineNum = 49610761;BA.debugLine="Private invDispParaPromo As Map = traemosInventar";
_invdispparapromo = new anywheresoftware.b4a.objects.collections.Map();
_invdispparapromo = _traemosinventariodisponibleparapromo(_ba,BA.ObjectToString(_pm.Get((Object)("id"))));
RDebugUtils.currentLine=49610762;
 //BA.debugLineNum = 49610762;BA.debugLine="If thisLog Then Log($\"invDispParaPromo=${invDispP";
if (_thislog) { 
anywheresoftware.b4a.keywords.Common.LogImpl("049610762",("invDispParaPromo="+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_invdispparapromo.getObject()))+""),0);};
RDebugUtils.currentLine=49610763;
 //BA.debugLineNum = 49610763;BA.debugLine="Private maxPromos As String = traeMaxPromos(pm)";
_maxpromos = BA.NumberToString(_traemaxpromos(_ba,_pm));
RDebugUtils.currentLine=49610764;
 //BA.debugLineNum = 49610764;BA.debugLine="Private maxPromosXFijos As Int = revisaMaxPromosP";
_maxpromosxfijos = _revisamaxpromosprodsfijosporinventario(_ba,_pm);
RDebugUtils.currentLine=49610765;
 //BA.debugLineNum = 49610765;BA.debugLine="Private idProdsVariables As List = pm.Get(\"prodsV";
_idprodsvariables = new anywheresoftware.b4a.objects.collections.List();
_idprodsvariables = (anywheresoftware.b4a.objects.collections.List) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.collections.List(), (java.util.List)(_pm.Get((Object)("prodsVariables"))));
RDebugUtils.currentLine=49610766;
 //BA.debugLineNum = 49610766;BA.debugLine="Private idProdsVariables2 As List = pm.Get(\"prods";
_idprodsvariables2 = new anywheresoftware.b4a.objects.collections.List();
_idprodsvariables2 = (anywheresoftware.b4a.objects.collections.List) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.collections.List(), (java.util.List)(_pm.Get((Object)("prodsVariables2"))));
RDebugUtils.currentLine=49610767;
 //BA.debugLineNum = 49610767;BA.debugLine="Private prodsVariablesRequeridos As Int = pm.Get(";
_prodsvariablesrequeridos = (int)(BA.ObjectToNumber(_pm.Get((Object)("prodsVariablesRequeridos"))));
RDebugUtils.currentLine=49610768;
 //BA.debugLineNum = 49610768;BA.debugLine="Private prodsVariables2Requeridos As Int = pm.Get";
_prodsvariables2requeridos = (int)(BA.ObjectToNumber(_pm.Get((Object)("prodsVariables2Requeridos"))));
RDebugUtils.currentLine=49610769;
 //BA.debugLineNum = 49610769;BA.debugLine="Private prodsFijosPiezas As List = pm.Get(\"prodsF";
_prodsfijospiezas = new anywheresoftware.b4a.objects.collections.List();
_prodsfijospiezas = (anywheresoftware.b4a.objects.collections.List) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.collections.List(), (java.util.List)(_pm.Get((Object)("prodsFijosPiezas"))));
RDebugUtils.currentLine=49610770;
 //BA.debugLineNum = 49610770;BA.debugLine="Private idProdsFijos As List = pm.Get(\"prodsFijos";
_idprodsfijos = new anywheresoftware.b4a.objects.collections.List();
_idprodsfijos = (anywheresoftware.b4a.objects.collections.List) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.collections.List(), (java.util.List)(_pm.Get((Object)("prodsFijos"))));
RDebugUtils.currentLine=49610771;
 //BA.debugLineNum = 49610771;BA.debugLine="For p = 0 To idProdsFijos.Size -1 'Generamos mapa";
{
final int step19 = 1;
final int limit19 = (int) (_idprodsfijos.getSize()-1);
_p = (int) (0) ;
for (;_p <= limit19 ;_p = _p + step19 ) {
RDebugUtils.currentLine=49610772;
 //BA.debugLineNum = 49610772;BA.debugLine="invFijoXpromo.Put(idProdsFijos.Get(p), prodsFijo";
_invfijoxpromo.Put(_idprodsfijos.Get(_p),_prodsfijospiezas.Get(_p));
RDebugUtils.currentLine=49610773;
 //BA.debugLineNum = 49610773;BA.debugLine="Private idEsteProd As String = idProdsFijos.Get(";
_idesteprod = BA.ObjectToString(_idprodsfijos.Get(_p));
RDebugUtils.currentLine=49610774;
 //BA.debugLineNum = 49610774;BA.debugLine="Private invEsteProd As Int = invDispParaPromo.Ge";
_investeprod = (int)(BA.ObjectToNumber(_invdispparapromo.Get((Object)(_idesteprod))));
RDebugUtils.currentLine=49610775;
 //BA.debugLineNum = 49610775;BA.debugLine="Private pzasReqEsteProd As Int = prodsFijosPieza";
_pzasreqesteprod = (int)(BA.ObjectToNumber(_prodsfijospiezas.Get(_p)));
RDebugUtils.currentLine=49610776;
 //BA.debugLineNum = 49610776;BA.debugLine="If thisLog Then Log($\"id=${idEsteProd}, inv=${in";
if (_thislog) { 
anywheresoftware.b4a.keywords.Common.LogImpl("049610776",("id="+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_idesteprod))+", inv="+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_investeprod))+", pzas="+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_pzasreqesteprod))+""),0);};
 }
};
RDebugUtils.currentLine=49610779;
 //BA.debugLineNum = 49610779;BA.debugLine="If thisLog Then LogColor($\"MaxPromos=${maxPromos}";
if (_thislog) { 
anywheresoftware.b4a.keywords.Common.LogImpl("049610779",("MaxPromos="+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_maxpromos))+", promosXFijos="+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_maxpromosxfijos))+""),anywheresoftware.b4a.keywords.Common.Colors.Blue);};
RDebugUtils.currentLine=49610780;
 //BA.debugLineNum = 49610780;BA.debugLine="If thisLog Then LogColor($\"prodsFijos=${idProdsFi";
if (_thislog) { 
anywheresoftware.b4a.keywords.Common.LogImpl("049610780",("prodsFijos="+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_idprodsfijos.getObject()))+""),anywheresoftware.b4a.keywords.Common.Colors.Blue);};
RDebugUtils.currentLine=49610781;
 //BA.debugLineNum = 49610781;BA.debugLine="If thisLog Then LogColor($\"prodsFijosPiezasReq=${";
if (_thislog) { 
anywheresoftware.b4a.keywords.Common.LogImpl("049610781",("prodsFijosPiezasReq="+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_prodsfijospiezas.getObject()))+""),anywheresoftware.b4a.keywords.Common.Colors.Blue);};
RDebugUtils.currentLine=49610782;
 //BA.debugLineNum = 49610782;BA.debugLine="If thisLog Then LogColor($\"prodsVariables=${idPro";
if (_thislog) { 
anywheresoftware.b4a.keywords.Common.LogImpl("049610782",("prodsVariables="+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_idprodsvariables.getObject()))+""+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(anywheresoftware.b4a.keywords.Common.CRLF))+"Variables Req="+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_prodsvariablesrequeridos))+" "),anywheresoftware.b4a.keywords.Common.Colors.Blue);};
RDebugUtils.currentLine=49610783;
 //BA.debugLineNum = 49610783;BA.debugLine="If thisLog Then LogColor($\"prodsVariables2=${idPr";
if (_thislog) { 
anywheresoftware.b4a.keywords.Common.LogImpl("049610783",("prodsVariables2="+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_idprodsvariables2.getObject()))+""+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(anywheresoftware.b4a.keywords.Common.CRLF))+"Variables2 Req="+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_prodsvariables2requeridos))+" "),anywheresoftware.b4a.keywords.Common.Colors.Blue);};
RDebugUtils.currentLine=49610784;
 //BA.debugLineNum = 49610784;BA.debugLine="If thisLog Then LogColor($\"invFijoXpromo=${invFij";
if (_thislog) { 
anywheresoftware.b4a.keywords.Common.LogImpl("049610784",("invFijoXpromo="+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_invfijoxpromo.getObject()))+""),anywheresoftware.b4a.keywords.Common.Colors.Blue);};
RDebugUtils.currentLine=49610785;
 //BA.debugLineNum = 49610785;BA.debugLine="If thisLog Then Log($\"Prods variables disponibles";
if (_thislog) { 
anywheresoftware.b4a.keywords.Common.LogImpl("049610785",("Prods variables disponibles = "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_totalprodsvariablesdisponibles))+""),0);};
RDebugUtils.currentLine=49610786;
 //BA.debugLineNum = 49610786;BA.debugLine="If thisLog Then Log($\"Prods variables2 disponible";
if (_thislog) { 
anywheresoftware.b4a.keywords.Common.LogImpl("049610786",("Prods variables2 disponibles = "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_totalprodsvariables2disponibles))+""),0);};
RDebugUtils.currentLine=49610787;
 //BA.debugLineNum = 49610787;BA.debugLine="Private maxPromosXVariables As Int = 0";
_maxpromosxvariables = (int) (0);
RDebugUtils.currentLine=49610788;
 //BA.debugLineNum = 49610788;BA.debugLine="Private maxPromosXVariables2 As Int = 0";
_maxpromosxvariables2 = (int) (0);
RDebugUtils.currentLine=49610789;
 //BA.debugLineNum = 49610789;BA.debugLine="For x = 1 To maxPromosXFijos";
{
final int step36 = 1;
final int limit36 = _maxpromosxfijos;
_x = (int) (1) ;
for (;_x <= limit36 ;_x = _x + step36 ) {
RDebugUtils.currentLine=49610790;
 //BA.debugLineNum = 49610790;BA.debugLine="If thisLog Then Log(\"===========================";
if (_thislog) { 
anywheresoftware.b4a.keywords.Common.LogImpl("049610790","=====================================================",0);};
RDebugUtils.currentLine=49610791;
 //BA.debugLineNum = 49610791;BA.debugLine="If thisLog Then Log(\"===========================";
if (_thislog) { 
anywheresoftware.b4a.keywords.Common.LogImpl("049610791","=====================================================",0);};
RDebugUtils.currentLine=49610792;
 //BA.debugLineNum = 49610792;BA.debugLine="For i = 0 To idProdsFijos.Size - 1";
{
final int step39 = 1;
final int limit39 = (int) (_idprodsfijos.getSize()-1);
_i = (int) (0) ;
for (;_i <= limit39 ;_i = _i + step39 ) {
RDebugUtils.currentLine=49610793;
 //BA.debugLineNum = 49610793;BA.debugLine="If thisLog Then Log($\"FIJO - ${idProdsFijos.Get";
if (_thislog) { 
anywheresoftware.b4a.keywords.Common.LogImpl("049610793",("FIJO - "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",_idprodsfijos.Get(_i))+", "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",_invdispparapromo.Get(_idprodsfijos.Get(_i)))+" - "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(((int)(BA.ObjectToNumber(_prodsfijospiezas.Get(_i))))*(_i+1)))+""),0);};
RDebugUtils.currentLine=49610794;
 //BA.debugLineNum = 49610794;BA.debugLine="invDispParaPromo.Put(idProdsFijos.Get(i), invDi";
_invdispparapromo.Put(_idprodsfijos.Get(_i),(Object)(((int)(BA.ObjectToNumber(_invdispparapromo.Get(_idprodsfijos.Get(_i)))))-((int)(BA.ObjectToNumber(_prodsfijospiezas.Get(_i))))*(_i+1)));
 }
};
RDebugUtils.currentLine=49610796;
 //BA.debugLineNum = 49610796;BA.debugLine="If thisLog Then LogColor(\"Inv disponible despues";
if (_thislog) { 
anywheresoftware.b4a.keywords.Common.LogImpl("049610796","Inv disponible despues de restar fijos = "+BA.ObjectToString(_invdispparapromo),anywheresoftware.b4a.keywords.Common.Colors.Blue);};
RDebugUtils.currentLine=49610798;
 //BA.debugLineNum = 49610798;BA.debugLine="totalProdsVariablesDisponibles = 0";
_totalprodsvariablesdisponibles = (int) (0);
RDebugUtils.currentLine=49610799;
 //BA.debugLineNum = 49610799;BA.debugLine="totalProdsVariables2Disponibles = 0";
_totalprodsvariables2disponibles = (int) (0);
RDebugUtils.currentLine=49610800;
 //BA.debugLineNum = 49610800;BA.debugLine="For i = 0 To idProdsVariables.Size - 1 'Obtenemo";
{
final int step46 = 1;
final int limit46 = (int) (_idprodsvariables.getSize()-1);
_i = (int) (0) ;
for (;_i <= limit46 ;_i = _i + step46 ) {
RDebugUtils.currentLine=49610801;
 //BA.debugLineNum = 49610801;BA.debugLine="If invDispParaPromo.ContainsKey(idProdsVariable";
if (_invdispparapromo.ContainsKey(_idprodsvariables.Get(_i))) { 
RDebugUtils.currentLine=49610802;
 //BA.debugLineNum = 49610802;BA.debugLine="totalProdsVariablesDisponibles = totalProdsVar";
_totalprodsvariablesdisponibles = (int) (_totalprodsvariablesdisponibles+(double)(BA.ObjectToNumber(_invdispparapromo.Get(_idprodsvariables.Get(_i)))));
 };
 }
};
RDebugUtils.currentLine=49610805;
 //BA.debugLineNum = 49610805;BA.debugLine="For i = 0 To idProdsVariables2.Size - 1 'Obtenem";
{
final int step51 = 1;
final int limit51 = (int) (_idprodsvariables2.getSize()-1);
_i = (int) (0) ;
for (;_i <= limit51 ;_i = _i + step51 ) {
RDebugUtils.currentLine=49610806;
 //BA.debugLineNum = 49610806;BA.debugLine="If invDispParaPromo.ContainsKey(idProdsVariable";
if (_invdispparapromo.ContainsKey(_idprodsvariables2.Get(_i))) { 
RDebugUtils.currentLine=49610807;
 //BA.debugLineNum = 49610807;BA.debugLine="totalProdsVariables2Disponibles = totalProdsVa";
_totalprodsvariables2disponibles = (int) (_totalprodsvariables2disponibles+(double)(BA.ObjectToNumber(_invdispparapromo.Get(_idprodsvariables2.Get(_i)))));
 };
 }
};
RDebugUtils.currentLine=49610811;
 //BA.debugLineNum = 49610811;BA.debugLine="If thisLog Then Log($\"Var disponibles -  var req";
if (_thislog) { 
anywheresoftware.b4a.keywords.Common.LogImpl("049610811",("Var disponibles -  var requeridos : "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_totalprodsvariablesdisponibles))+" - "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_prodsvariablesrequeridos*_x))+""),0);};
RDebugUtils.currentLine=49610812;
 //BA.debugLineNum = 49610812;BA.debugLine="totalProdsVariablesDisponibles = totalProdsVaria";
_totalprodsvariablesdisponibles = (int) (_totalprodsvariablesdisponibles-(_prodsvariablesrequeridos*_x));
RDebugUtils.currentLine=49610813;
 //BA.debugLineNum = 49610813;BA.debugLine="totalProdsVariables2Disponibles = totalProdsVari";
_totalprodsvariables2disponibles = (int) (_totalprodsvariables2disponibles-(_prodsvariables2requeridos*_x));
RDebugUtils.currentLine=49610814;
 //BA.debugLineNum = 49610814;BA.debugLine="If thisLog Then Log(\"prodsVariables disponibles";
if (_thislog) { 
anywheresoftware.b4a.keywords.Common.LogImpl("049610814","prodsVariables disponibles despues de promo = "+BA.NumberToString(_totalprodsvariablesdisponibles),0);};
RDebugUtils.currentLine=49610815;
 //BA.debugLineNum = 49610815;BA.debugLine="If thisLog Then Log(\"prodsVariables2 disponibles";
if (_thislog) { 
anywheresoftware.b4a.keywords.Common.LogImpl("049610815","prodsVariables2 disponibles despues de promo = "+BA.NumberToString(_totalprodsvariables2disponibles),0);};
RDebugUtils.currentLine=49610816;
 //BA.debugLineNum = 49610816;BA.debugLine="If totalProdsVariablesDisponibles < 0 Then Exit";
if (_totalprodsvariablesdisponibles<0) { 
if (true) break;};
RDebugUtils.currentLine=49610817;
 //BA.debugLineNum = 49610817;BA.debugLine="If totalProdsVariables2Disponibles < 0 Then Exit";
if (_totalprodsvariables2disponibles<0) { 
if (true) break;};
RDebugUtils.currentLine=49610818;
 //BA.debugLineNum = 49610818;BA.debugLine="maxPromosXVariables = x";
_maxpromosxvariables = _x;
 }
};
RDebugUtils.currentLine=49610821;
 //BA.debugLineNum = 49610821;BA.debugLine="If thisLog Then LogColor(\"Max promos de prodsVari";
if (_thislog) { 
anywheresoftware.b4a.keywords.Common.LogImpl("049610821","Max promos de prodsVariables POR inventario = "+BA.NumberToString(_maxpromosxvariables),anywheresoftware.b4a.keywords.Common.Colors.Red);};
RDebugUtils.currentLine=49610822;
 //BA.debugLineNum = 49610822;BA.debugLine="Return maxPromosXVariables";
if (true) return _maxpromosxvariables;
RDebugUtils.currentLine=49610823;
 //BA.debugLineNum = 49610823;BA.debugLine="End Sub";
return 0;
}
public static boolean  _revisapro2265(anywheresoftware.b4a.BA _ba,String _idcliente) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "revisapro2265", false))
	 {return ((Boolean) Debug.delegate(null, "revisapro2265", new Object[] {_ba,_idcliente}));}
anywheresoftware.b4a.sql.SQL.ResultSetWrapper _r = null;
boolean _x = false;
RDebugUtils.currentLine=48234496;
 //BA.debugLineNum = 48234496;BA.debugLine="Sub revisaPRO2265(idCliente As String) As Boolean";
RDebugUtils.currentLine=48234497;
 //BA.debugLineNum = 48234497;BA.debugLine="Private r As ResultSet = Starter.skmt.ExecQuery($";
_r = new anywheresoftware.b4a.sql.SQL.ResultSetWrapper();
_r = (anywheresoftware.b4a.sql.SQL.ResultSetWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.ResultSetWrapper(), (android.database.Cursor)(mostCurrent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery(("select * from HIST_PRO2265 where H_IDCLIENTE = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_idcliente))+"'"))));
RDebugUtils.currentLine=48234498;
 //BA.debugLineNum = 48234498;BA.debugLine="Private x As Boolean = False";
_x = anywheresoftware.b4a.keywords.Common.False;
RDebugUtils.currentLine=48234499;
 //BA.debugLineNum = 48234499;BA.debugLine="Do While r.NextRow";
while (_r.NextRow()) {
RDebugUtils.currentLine=48234500;
 //BA.debugLineNum = 48234500;BA.debugLine="x = True";
_x = anywheresoftware.b4a.keywords.Common.True;
 }
;
RDebugUtils.currentLine=48234502;
 //BA.debugLineNum = 48234502;BA.debugLine="Log($\">>>>  revisaPRO2265 ${idCliente} = ${x}\"$)";
anywheresoftware.b4a.keywords.Common.LogImpl("048234502",(">>>>  revisaPRO2265 "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_idcliente))+" = "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_x))+""),0);
RDebugUtils.currentLine=48234503;
 //BA.debugLineNum = 48234503;BA.debugLine="Return x";
if (true) return _x;
RDebugUtils.currentLine=48234504;
 //BA.debugLineNum = 48234504;BA.debugLine="End Sub";
return false;
}
public static boolean  _revisapro3054(anywheresoftware.b4a.BA _ba,String _idcliente) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "revisapro3054", false))
	 {return ((Boolean) Debug.delegate(null, "revisapro3054", new Object[] {_ba,_idcliente}));}
anywheresoftware.b4a.sql.SQL.ResultSetWrapper _r = null;
boolean _x = false;
RDebugUtils.currentLine=48300032;
 //BA.debugLineNum = 48300032;BA.debugLine="Sub revisaPRO3054(idCliente As String) As Boolean";
RDebugUtils.currentLine=48300033;
 //BA.debugLineNum = 48300033;BA.debugLine="Private r As ResultSet = Starter.skmt.ExecQuery($";
_r = new anywheresoftware.b4a.sql.SQL.ResultSetWrapper();
_r = (anywheresoftware.b4a.sql.SQL.ResultSetWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.ResultSetWrapper(), (android.database.Cursor)(mostCurrent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery(("select * from HIST_PRO3054 where H_IDCLIENTE = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_idcliente))+"'"))));
RDebugUtils.currentLine=48300034;
 //BA.debugLineNum = 48300034;BA.debugLine="Private x As Boolean = False";
_x = anywheresoftware.b4a.keywords.Common.False;
RDebugUtils.currentLine=48300035;
 //BA.debugLineNum = 48300035;BA.debugLine="Do While r.NextRow";
while (_r.NextRow()) {
RDebugUtils.currentLine=48300036;
 //BA.debugLineNum = 48300036;BA.debugLine="x = True";
_x = anywheresoftware.b4a.keywords.Common.True;
 }
;
RDebugUtils.currentLine=48300038;
 //BA.debugLineNum = 48300038;BA.debugLine="Log($\">>>>  revisaPRO3054 ${idCliente} = ${x}\"$)";
anywheresoftware.b4a.keywords.Common.LogImpl("048300038",(">>>>  revisaPRO3054 "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_idcliente))+" = "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_x))+""),0);
RDebugUtils.currentLine=48300039;
 //BA.debugLineNum = 48300039;BA.debugLine="Return x";
if (true) return _x;
RDebugUtils.currentLine=48300040;
 //BA.debugLineNum = 48300040;BA.debugLine="End Sub";
return false;
}
public static boolean  _revisapro3055(anywheresoftware.b4a.BA _ba,String _idcliente) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "revisapro3055", false))
	 {return ((Boolean) Debug.delegate(null, "revisapro3055", new Object[] {_ba,_idcliente}));}
anywheresoftware.b4a.sql.SQL.ResultSetWrapper _r = null;
boolean _x = false;
RDebugUtils.currentLine=48365568;
 //BA.debugLineNum = 48365568;BA.debugLine="Sub revisaPRO3055(idCliente As String) As Boolean";
RDebugUtils.currentLine=48365569;
 //BA.debugLineNum = 48365569;BA.debugLine="Private r As ResultSet = Starter.skmt.ExecQuery($";
_r = new anywheresoftware.b4a.sql.SQL.ResultSetWrapper();
_r = (anywheresoftware.b4a.sql.SQL.ResultSetWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.ResultSetWrapper(), (android.database.Cursor)(mostCurrent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery(("select * from HIST_PRO3055 where H_IDCLIENTE = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_idcliente))+"'"))));
RDebugUtils.currentLine=48365570;
 //BA.debugLineNum = 48365570;BA.debugLine="Private x As Boolean = False";
_x = anywheresoftware.b4a.keywords.Common.False;
RDebugUtils.currentLine=48365571;
 //BA.debugLineNum = 48365571;BA.debugLine="Do While r.NextRow";
while (_r.NextRow()) {
RDebugUtils.currentLine=48365572;
 //BA.debugLineNum = 48365572;BA.debugLine="x = True";
_x = anywheresoftware.b4a.keywords.Common.True;
 }
;
RDebugUtils.currentLine=48365574;
 //BA.debugLineNum = 48365574;BA.debugLine="Log($\">>>>  revisaPRO3055 ${idCliente} = ${x}\"$)";
anywheresoftware.b4a.keywords.Common.LogImpl("048365574",(">>>>  revisaPRO3055 "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_idcliente))+" = "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_x))+""),0);
RDebugUtils.currentLine=48365575;
 //BA.debugLineNum = 48365575;BA.debugLine="Return x";
if (true) return _x;
RDebugUtils.currentLine=48365576;
 //BA.debugLineNum = 48365576;BA.debugLine="End Sub";
return false;
}
public static boolean  _revisaprodfueradepromo(anywheresoftware.b4a.BA _ba,String _prodid) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "revisaprodfueradepromo", false))
	 {return ((Boolean) Debug.delegate(null, "revisaprodfueradepromo", new Object[] {_ba,_prodid}));}
boolean _fueradepromo = false;
anywheresoftware.b4a.sql.SQL.CursorWrapper _p = null;
RDebugUtils.currentLine=48889856;
 //BA.debugLineNum = 48889856;BA.debugLine="Sub revisaProdFueraDePromo(prodId As String) As Bo";
RDebugUtils.currentLine=48889857;
 //BA.debugLineNum = 48889857;BA.debugLine="Private fueraDePromo As Boolean = False";
_fueradepromo = anywheresoftware.b4a.keywords.Common.False;
RDebugUtils.currentLine=48889858;
 //BA.debugLineNum = 48889858;BA.debugLine="Private p As Cursor = Starter.skmt.ExecQuery($\"se";
_p = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_p = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(mostCurrent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery(("select PE_CEDIS from PEDIDO where PE_PROID = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_prodid))+"' and PE_CEDIS in (select id_almacen from CAT_ALMACEN) and PE_CLIENTE = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(mostCurrent._b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (_ba)._cliente /*gunav2.keymon.com.mx.c_cliente*/ ._la_cuenta /*anywheresoftware.b4a.objects.LabelWrapper*/ .getText()))+"'"))));
RDebugUtils.currentLine=48889859;
 //BA.debugLineNum = 48889859;BA.debugLine="Log(\"rowcount: \" & p.RowCount)";
anywheresoftware.b4a.keywords.Common.LogImpl("048889859","rowcount: "+BA.NumberToString(_p.getRowCount()),0);
RDebugUtils.currentLine=48889860;
 //BA.debugLineNum = 48889860;BA.debugLine="If p.RowCount > 0 Then";
if (_p.getRowCount()>0) { 
RDebugUtils.currentLine=48889861;
 //BA.debugLineNum = 48889861;BA.debugLine="p.Position = 0";
_p.setPosition((int) (0));
RDebugUtils.currentLine=48889862;
 //BA.debugLineNum = 48889862;BA.debugLine="Log($\"|${p.GetString(\"PE_CEDIS\")}|${prodId}|\"$)";
anywheresoftware.b4a.keywords.Common.LogImpl("048889862",("|"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_p.GetString("PE_CEDIS")))+"|"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_prodid))+"|"),0);
RDebugUtils.currentLine=48889863;
 //BA.debugLineNum = 48889863;BA.debugLine="fueraDePromo = True";
_fueradepromo = anywheresoftware.b4a.keywords.Common.True;
 };
RDebugUtils.currentLine=48889865;
 //BA.debugLineNum = 48889865;BA.debugLine="Return fueraDePromo";
if (true) return _fueradepromo;
RDebugUtils.currentLine=48889866;
 //BA.debugLineNum = 48889866;BA.debugLine="End Sub";
return false;
}
public static String  _revisapromoprocterpro3009(anywheresoftware.b4a.BA _ba,anywheresoftware.b4a.objects.collections.Map _prodsmap1) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "revisapromoprocterpro3009", false))
	 {return ((String) Debug.delegate(null, "revisapromoprocterpro3009", new Object[] {_ba,_prodsmap1}));}
anywheresoftware.b4a.objects.collections.List _almacenes = null;
String _idregalo = "";
anywheresoftware.b4a.objects.collections.Map _newprodsmap = null;
String _monto = "";
int _invregalo = 0;
int _totalregalos = 0;
anywheresoftware.b4a.sql.SQL.ResultSetWrapper _r = null;
anywheresoftware.b4a.objects.collections.Map _m1 = null;
anywheresoftware.b4a.objects.collections.Map _m2 = null;
anywheresoftware.b4a.sql.SQL.ResultSetWrapper _r2 = null;
anywheresoftware.b4a.objects.CSBuilder _cs = null;
anywheresoftware.b4a.sql.SQL.CursorWrapper _pe = null;
RDebugUtils.currentLine=48103424;
 //BA.debugLineNum = 48103424;BA.debugLine="Sub revisaPromoProcterPRO3009(prodsMap1 As Map)";
RDebugUtils.currentLine=48103425;
 //BA.debugLineNum = 48103425;BA.debugLine="Log(\"entramos a promo Procter\")";
anywheresoftware.b4a.keywords.Common.LogImpl("048103425","entramos a promo Procter",0);
RDebugUtils.currentLine=48103426;
 //BA.debugLineNum = 48103426;BA.debugLine="Dim almacenes As List";
_almacenes = new anywheresoftware.b4a.objects.collections.List();
RDebugUtils.currentLine=48103427;
 //BA.debugLineNum = 48103427;BA.debugLine="almacenes.Initialize2(Array As String(\"3\", \"17\",";
_almacenes.Initialize2(anywheresoftware.b4a.keywords.Common.ArrayToList(new String[]{"3","17","37","31","68","71","33","80"}));
RDebugUtils.currentLine=48103428;
 //BA.debugLineNum = 48103428;BA.debugLine="Log(\"Posicion de almacen: \" & almacenes.IndexOf(t";
anywheresoftware.b4a.keywords.Common.LogImpl("048103428","Posicion de almacen: "+BA.NumberToString(_almacenes.IndexOf((Object)(_traealmacen(_ba)))),0);
RDebugUtils.currentLine=48103430;
 //BA.debugLineNum = 48103430;BA.debugLine="If almacenes.IndexOf(traeAlmacen) >= 0 Then ' Si";
if (_almacenes.IndexOf((Object)(_traealmacen(_ba)))>=0) { 
RDebugUtils.currentLine=48103431;
 //BA.debugLineNum = 48103431;BA.debugLine="Private idRegalo As String = \"PYG1016\"";
_idregalo = "PYG1016";
RDebugUtils.currentLine=48103432;
 //BA.debugLineNum = 48103432;BA.debugLine="Private newProdsMap As Map = prodsMap1";
_newprodsmap = new anywheresoftware.b4a.objects.collections.Map();
_newprodsmap = _prodsmap1;
RDebugUtils.currentLine=48103433;
 //BA.debugLineNum = 48103433;BA.debugLine="Private monto As String = 0";
_monto = BA.NumberToString(0);
RDebugUtils.currentLine=48103434;
 //BA.debugLineNum = 48103434;BA.debugLine="Private invRegalo As Int = 0";
_invregalo = (int) (0);
RDebugUtils.currentLine=48103435;
 //BA.debugLineNum = 48103435;BA.debugLine="Private totalRegalos As Int = 0";
_totalregalos = (int) (0);
RDebugUtils.currentLine=48103436;
 //BA.debugLineNum = 48103436;BA.debugLine="Private r As ResultSet = Starter.skmt.ExecQuery(";
_r = new anywheresoftware.b4a.sql.SQL.ResultSetWrapper();
_r = (anywheresoftware.b4a.sql.SQL.ResultSetWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.ResultSetWrapper(), (android.database.Cursor)(mostCurrent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery(("select ifnull(cat_gp_almacen, 0) as CAT_GP_ALMACEN from "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_traetablaprods(_ba,_traetipoventadebd(_ba))))+" where cat_gp_id = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_idregalo))+"'"))));
RDebugUtils.currentLine=48103437;
 //BA.debugLineNum = 48103437;BA.debugLine="Do While r.NextRow";
while (_r.NextRow()) {
RDebugUtils.currentLine=48103438;
 //BA.debugLineNum = 48103438;BA.debugLine="Log(r.GetString(\"CAT_GP_ALMACEN\"))";
anywheresoftware.b4a.keywords.Common.LogImpl("048103438",_r.GetString("CAT_GP_ALMACEN"),0);
RDebugUtils.currentLine=48103439;
 //BA.debugLineNum = 48103439;BA.debugLine="If r.GetString(\"CAT_GP_ALMACEN\") > 0 Then invRe";
if ((double)(Double.parseDouble(_r.GetString("CAT_GP_ALMACEN")))>0) { 
_invregalo = (int)(Double.parseDouble(_r.GetString("CAT_GP_ALMACEN")));};
 }
;
RDebugUtils.currentLine=48103441;
 //BA.debugLineNum = 48103441;BA.debugLine="Log(\"INV REGALO: \" & invRegalo)";
anywheresoftware.b4a.keywords.Common.LogImpl("048103441","INV REGALO: "+BA.NumberToString(_invregalo),0);
RDebugUtils.currentLine=48103442;
 //BA.debugLineNum = 48103442;BA.debugLine="r = Starter.skmt.ExecQuery($\"select pe_proid fro";
_r = (anywheresoftware.b4a.sql.SQL.ResultSetWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.ResultSetWrapper(), (android.database.Cursor)(mostCurrent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery(("select pe_proid from pedido where pe_proid = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_idregalo))+"' and pe_cedis = 'PRO3009' and pe_cant = 1 and pe_cliente = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_traecliente(_ba)))+"' "))));
RDebugUtils.currentLine=48103443;
 //BA.debugLineNum = 48103443;BA.debugLine="If r.RowCount > 0 Then totalRegalos = r.RowCount";
if (_r.getRowCount()>0) { 
_totalregalos = _r.getRowCount();};
RDebugUtils.currentLine=48103444;
 //BA.debugLineNum = 48103444;BA.debugLine="Log($\"TOTAL REGALOS: ${totalRegalos}\"$)";
anywheresoftware.b4a.keywords.Common.LogImpl("048103444",("TOTAL REGALOS: "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_totalregalos))+""),0);
RDebugUtils.currentLine=48103445;
 //BA.debugLineNum = 48103445;BA.debugLine="If prodsMap1.ContainsKey(\"PYG1014\") Then ' Calcu";
if (_prodsmap1.ContainsKey((Object)("PYG1014"))) { 
RDebugUtils.currentLine=48103446;
 //BA.debugLineNum = 48103446;BA.debugLine="Private m1 As Map = prodsMap1.Get(\"PYG1014\")";
_m1 = new anywheresoftware.b4a.objects.collections.Map();
_m1 = (anywheresoftware.b4a.objects.collections.Map) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.collections.Map(), (java.util.Map)(_prodsmap1.Get((Object)("PYG1014"))));
RDebugUtils.currentLine=48103447;
 //BA.debugLineNum = 48103447;BA.debugLine="monto = monto + m1.Get(\"cant\") * m1.Get(\"precio";
_monto = BA.NumberToString((double)(Double.parseDouble(_monto))+(double)(BA.ObjectToNumber(_m1.Get((Object)("cant"))))*(double)(BA.ObjectToNumber(_m1.Get((Object)("precio")))));
 };
RDebugUtils.currentLine=48103449;
 //BA.debugLineNum = 48103449;BA.debugLine="If prodsMap1.ContainsKey(\"PYG1025\") Then  ' Calc";
if (_prodsmap1.ContainsKey((Object)("PYG1025"))) { 
RDebugUtils.currentLine=48103450;
 //BA.debugLineNum = 48103450;BA.debugLine="Private m2 As Map = prodsMap1.Get(\"PYG1025\")";
_m2 = new anywheresoftware.b4a.objects.collections.Map();
_m2 = (anywheresoftware.b4a.objects.collections.Map) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.collections.Map(), (java.util.Map)(_prodsmap1.Get((Object)("PYG1025"))));
RDebugUtils.currentLine=48103451;
 //BA.debugLineNum = 48103451;BA.debugLine="monto = monto + m2.Get(\"cant\") * m2.Get(\"precio";
_monto = BA.NumberToString((double)(Double.parseDouble(_monto))+(double)(BA.ObjectToNumber(_m2.Get((Object)("cant"))))*(double)(BA.ObjectToNumber(_m2.Get((Object)("precio")))));
 };
RDebugUtils.currentLine=48103453;
 //BA.debugLineNum = 48103453;BA.debugLine="Private r2 As ResultSet = Starter.skmt.ExecQuery";
_r2 = new anywheresoftware.b4a.sql.SQL.ResultSetWrapper();
_r2 = (anywheresoftware.b4a.sql.SQL.ResultSetWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.ResultSetWrapper(), (android.database.Cursor)(mostCurrent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery(("select ifnull(sum(pe_costo_tot),0) as monto from pedido where pe_cliente = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_traecliente(_ba)))+"' and PE_PROID in (\"PYG1014\", \"PYG1025\")"))));
RDebugUtils.currentLine=48103454;
 //BA.debugLineNum = 48103454;BA.debugLine="Do While r2.NextRow";
while (_r2.NextRow()) {
RDebugUtils.currentLine=48103455;
 //BA.debugLineNum = 48103455;BA.debugLine="monto = monto + r2.GetString(\"monto\")";
_monto = BA.NumberToString((double)(Double.parseDouble(_monto))+(double)(Double.parseDouble(_r2.GetString("monto"))));
 }
;
RDebugUtils.currentLine=48103457;
 //BA.debugLineNum = 48103457;BA.debugLine="Log($\"Monto: ${monto}\"$)";
anywheresoftware.b4a.keywords.Common.LogImpl("048103457",("Monto: "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_monto))+""),0);
RDebugUtils.currentLine=48103459;
 //BA.debugLineNum = 48103459;BA.debugLine="Log(\"prodsMap.Size: \" & prodsMap1.Size)";
anywheresoftware.b4a.keywords.Common.LogImpl("048103459","prodsMap.Size: "+BA.NumberToString(_prodsmap1.getSize()),0);
RDebugUtils.currentLine=48103460;
 //BA.debugLineNum = 48103460;BA.debugLine="If prodsMap1.Size > 0 Then";
if (_prodsmap1.getSize()>0) { 
RDebugUtils.currentLine=48103461;
 //BA.debugLineNum = 48103461;BA.debugLine="If monto > 149 Then";
if ((double)(Double.parseDouble(_monto))>149) { 
RDebugUtils.currentLine=48103462;
 //BA.debugLineNum = 48103462;BA.debugLine="Log(\"Mas de 149\")";
anywheresoftware.b4a.keywords.Common.LogImpl("048103462","Mas de 149",0);
RDebugUtils.currentLine=48103463;
 //BA.debugLineNum = 48103463;BA.debugLine="If invRegalo > 0 Then";
if (_invregalo>0) { 
RDebugUtils.currentLine=48103464;
 //BA.debugLineNum = 48103464;BA.debugLine="Log(\"Hay inventario para regalo\")";
anywheresoftware.b4a.keywords.Common.LogImpl("048103464","Hay inventario para regalo",0);
RDebugUtils.currentLine=48103465;
 //BA.debugLineNum = 48103465;BA.debugLine="If totalRegalos = 0 Then";
if (_totalregalos==0) { 
RDebugUtils.currentLine=48103466;
 //BA.debugLineNum = 48103466;BA.debugLine="guardaProducto(\"PRO3009\", 1, 1, traeProdNomb";
_guardaproducto(_ba,"PRO3009",BA.NumberToString(1),BA.NumberToString(1),_traeprodnombre(_ba,_idregalo),_idregalo,_traecliente(_ba),_traefecha(_ba),_traeusuariodebd(_ba),_traeruta(_ba),BA.NumberToString(0),mostCurrent._b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (_ba)._tipo_venta /*String*/ );
RDebugUtils.currentLine=48103468;
 //BA.debugLineNum = 48103468;BA.debugLine="Private cs As CSBuilder";
_cs = new anywheresoftware.b4a.objects.CSBuilder();
RDebugUtils.currentLine=48103469;
 //BA.debugLineNum = 48103469;BA.debugLine="cs.Initialize";
_cs.Initialize();
RDebugUtils.currentLine=48103470;
 //BA.debugLineNum = 48103470;BA.debugLine="Msgbox(cs.Color(Colors.red).append(\"PRO3009:";
anywheresoftware.b4a.keywords.Common.Msgbox(BA.ObjectToCharSequence(_cs.Color(anywheresoftware.b4a.keywords.Common.Colors.Red).Append(BA.ObjectToCharSequence("PRO3009:")).Pop().Append(BA.ObjectToCharSequence(" En la compra de $150 de la linea Oral B Procter & Gamble se agrega 1 Salvo Multiusuos 500 ml.")).Color(anywheresoftware.b4a.keywords.Common.Colors.Red).Append(BA.ObjectToCharSequence(" con precio de $1.00")).PopAll().getObject()),BA.ObjectToCharSequence("Producto de regalo agregado"),_ba);
 };
 }else {
RDebugUtils.currentLine=48103473;
 //BA.debugLineNum = 48103473;BA.debugLine="LogColor(\"NO hay inventario para regalo PRO30";
anywheresoftware.b4a.keywords.Common.LogImpl("048103473","NO hay inventario para regalo PRO3009 Procter & Gamble.",anywheresoftware.b4a.keywords.Common.Colors.Red);
 };
 }else {
RDebugUtils.currentLine=48103476;
 //BA.debugLineNum = 48103476;BA.debugLine="Log(\"Menos de 149\")";
anywheresoftware.b4a.keywords.Common.LogImpl("048103476","Menos de 149",0);
RDebugUtils.currentLine=48103477;
 //BA.debugLineNum = 48103477;BA.debugLine="If totalRegalos > 0 Then";
if (_totalregalos>0) { 
RDebugUtils.currentLine=48103478;
 //BA.debugLineNum = 48103478;BA.debugLine="Log(\"Quitamos regalo\")";
anywheresoftware.b4a.keywords.Common.LogImpl("048103478","Quitamos regalo",0);
RDebugUtils.currentLine=48103479;
 //BA.debugLineNum = 48103479;BA.debugLine="Starter.skmt.ExecNonQuery($\"delete from pedid";
mostCurrent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("delete from pedido where pe_cedis = 'PRO3009' and pe_proid = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_idregalo))+"' and pe_cliente = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_traecliente(_ba)))+"' and pe_cant = 1 "));
RDebugUtils.currentLine=48103480;
 //BA.debugLineNum = 48103480;BA.debugLine="Log($\"Borramos pe_cedis='PRO3009' and pe_proi";
anywheresoftware.b4a.keywords.Common.LogImpl("048103480",("Borramos pe_cedis='PRO3009' and pe_proid='"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_idregalo))+"' and pe_cliente='"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_traecliente(_ba)))+"'"),0);
RDebugUtils.currentLine=48103481;
 //BA.debugLineNum = 48103481;BA.debugLine="Private pe As Cursor = Starter.skmt.ExecQuery";
_pe = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_pe = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(mostCurrent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select count(pe_cliente) as cuantosPedidos from pedido where pe_cliente In (select cuenta from cuentaa)")));
RDebugUtils.currentLine=48103482;
 //BA.debugLineNum = 48103482;BA.debugLine="pe.Position=0";
_pe.setPosition((int) (0));
RDebugUtils.currentLine=48103483;
 //BA.debugLineNum = 48103483;BA.debugLine="If pe.GetString(\"cuantosPedidos\") = 0 Then";
if ((_pe.GetString("cuantosPedidos")).equals(BA.NumberToString(0))) { 
RDebugUtils.currentLine=48103484;
 //BA.debugLineNum = 48103484;BA.debugLine="Log(\"######    delete from pedido_cliente -";
anywheresoftware.b4a.keywords.Common.LogImpl("048103484","######    delete from pedido_cliente - "+_traecliente(_ba)+"|"+_traecliente(_ba),0);
RDebugUtils.currentLine=48103485;
 //BA.debugLineNum = 48103485;BA.debugLine="Log($\"delete from pedido_cliente where PC_CL";
anywheresoftware.b4a.keywords.Common.LogImpl("048103485",("delete from pedido_cliente where PC_CLIENTE = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_traecliente(_ba)))+"'"),0);
RDebugUtils.currentLine=48103486;
 //BA.debugLineNum = 48103486;BA.debugLine="Starter.skmt.ExecNonQuery($\"delete from pedi";
mostCurrent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("delete from pedido_cliente where PC_CLIENTE = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_traecliente(_ba)))+"'"));
 };
RDebugUtils.currentLine=48103488;
 //BA.debugLineNum = 48103488;BA.debugLine="ToastMessageShow(\"Quitamos regalo PRO3009\", F";
anywheresoftware.b4a.keywords.Common.ToastMessageShow(BA.ObjectToCharSequence("Quitamos regalo PRO3009"),anywheresoftware.b4a.keywords.Common.False);
 };
 };
 };
 }else {
RDebugUtils.currentLine=48103493;
 //BA.debugLineNum = 48103493;BA.debugLine="LogColor(\"El almacen actual NO esta en la lista";
anywheresoftware.b4a.keywords.Common.LogImpl("048103493","El almacen actual NO esta en la lista para la promo de Procter & Gamble.",anywheresoftware.b4a.keywords.Common.Colors.Magenta);
 };
RDebugUtils.currentLine=48103496;
 //BA.debugLineNum = 48103496;BA.debugLine="End Sub";
return "";
}
public static String  _traeprodnombre(anywheresoftware.b4a.BA _ba,String _id) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "traeprodnombre", false))
	 {return ((String) Debug.delegate(null, "traeprodnombre", new Object[] {_ba,_id}));}
anywheresoftware.b4a.sql.SQL.CursorWrapper _h = null;
String _n = "";
RDebugUtils.currentLine=46006272;
 //BA.debugLineNum = 46006272;BA.debugLine="Sub traeProdNombre(id As String) As String";
RDebugUtils.currentLine=46006273;
 //BA.debugLineNum = 46006273;BA.debugLine="Private h As Cursor";
_h = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
RDebugUtils.currentLine=46006274;
 //BA.debugLineNum = 46006274;BA.debugLine="Private n As String";
_n = "";
RDebugUtils.currentLine=46006275;
 //BA.debugLineNum = 46006275;BA.debugLine="h=B4XPages.MainPage.skmt.ExecQuery2($\"select CAT_";
_h = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(mostCurrent._b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (_ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery2(("select CAT_GP_NOMBRE from "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_traetablaprods(_ba,_traetipoventadebd(_ba))))+" where CAT_GP_ID = ? "),new String[]{_id.trim()})));
RDebugUtils.currentLine=46006276;
 //BA.debugLineNum = 46006276;BA.debugLine="If h.RowCount > 0 Then";
if (_h.getRowCount()>0) { 
RDebugUtils.currentLine=46006277;
 //BA.debugLineNum = 46006277;BA.debugLine="h.Position = 0";
_h.setPosition((int) (0));
RDebugUtils.currentLine=46006278;
 //BA.debugLineNum = 46006278;BA.debugLine="n = h.GetString(\"CAT_GP_NOMBRE\")";
_n = _h.GetString("CAT_GP_NOMBRE");
 };
RDebugUtils.currentLine=46006281;
 //BA.debugLineNum = 46006281;BA.debugLine="h.Close";
_h.Close();
RDebugUtils.currentLine=46006282;
 //BA.debugLineNum = 46006282;BA.debugLine="If n = Null Or n=\"\" Then n = \"N/A\"";
if (_n== null || (_n).equals("")) { 
_n = "N/A";};
RDebugUtils.currentLine=46006284;
 //BA.debugLineNum = 46006284;BA.debugLine="Return n";
if (true) return _n;
RDebugUtils.currentLine=46006285;
 //BA.debugLineNum = 46006285;BA.debugLine="End Sub";
return "";
}
public static String  _traefecha(anywheresoftware.b4a.BA _ba) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "traefecha", false))
	 {return ((String) Debug.delegate(null, "traefecha", new Object[] {_ba}));}
String _sdate = "";
String _stime = "";
RDebugUtils.currentLine=46596096;
 //BA.debugLineNum = 46596096;BA.debugLine="Sub traeFecha As String 'ignore";
RDebugUtils.currentLine=46596097;
 //BA.debugLineNum = 46596097;BA.debugLine="DateTime.DateFormat = \"MM/dd/yyyy\"";
anywheresoftware.b4a.keywords.Common.DateTime.setDateFormat("MM/dd/yyyy");
RDebugUtils.currentLine=46596098;
 //BA.debugLineNum = 46596098;BA.debugLine="Private sDate As String =DateTime.Date(DateTime.N";
_sdate = anywheresoftware.b4a.keywords.Common.DateTime.Date(anywheresoftware.b4a.keywords.Common.DateTime.getNow());
RDebugUtils.currentLine=46596099;
 //BA.debugLineNum = 46596099;BA.debugLine="Private sTime As String =DateTime.Time(DateTime.N";
_stime = anywheresoftware.b4a.keywords.Common.DateTime.Time(anywheresoftware.b4a.keywords.Common.DateTime.getNow());
RDebugUtils.currentLine=46596100;
 //BA.debugLineNum = 46596100;BA.debugLine="Return sDate & sTime";
if (true) return _sdate+_stime;
RDebugUtils.currentLine=46596101;
 //BA.debugLineNum = 46596101;BA.debugLine="End Sub";
return "";
}
public static String  _traeusuariodebd(anywheresoftware.b4a.BA _ba) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "traeusuariodebd", false))
	 {return ((String) Debug.delegate(null, "traeusuariodebd", new Object[] {_ba}));}
anywheresoftware.b4a.sql.SQL.CursorWrapper _c = null;
String _u = "";
RDebugUtils.currentLine=46661632;
 //BA.debugLineNum = 46661632;BA.debugLine="Sub traeUsuarioDeBD As String 'ignore";
RDebugUtils.currentLine=46661633;
 //BA.debugLineNum = 46661633;BA.debugLine="Private c As Cursor";
_c = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
RDebugUtils.currentLine=46661634;
 //BA.debugLineNum = 46661634;BA.debugLine="Private u As String = \"SinUsuario\"";
_u = "SinUsuario";
RDebugUtils.currentLine=46661635;
 //BA.debugLineNum = 46661635;BA.debugLine="If Not(kmt.IsInitialized) Then revisaBD";
if (anywheresoftware.b4a.keywords.Common.Not(_kmt.IsInitialized())) { 
_revisabd(_ba);};
RDebugUtils.currentLine=46661636;
 //BA.debugLineNum = 46661636;BA.debugLine="c=kmt.ExecQuery(\"select USUARIO from usuarioa\")";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_kmt.ExecQuery("select USUARIO from usuarioa")));
RDebugUtils.currentLine=46661637;
 //BA.debugLineNum = 46661637;BA.debugLine="c.Position=0";
_c.setPosition((int) (0));
RDebugUtils.currentLine=46661638;
 //BA.debugLineNum = 46661638;BA.debugLine="If c.RowCount > 0 Then u = c.GetString(\"USUARIO\")";
if (_c.getRowCount()>0) { 
_u = _c.GetString("USUARIO");};
RDebugUtils.currentLine=46661639;
 //BA.debugLineNum = 46661639;BA.debugLine="c.Close";
_c.Close();
RDebugUtils.currentLine=46661640;
 //BA.debugLineNum = 46661640;BA.debugLine="Return u";
if (true) return _u;
RDebugUtils.currentLine=46661641;
 //BA.debugLineNum = 46661641;BA.debugLine="End Sub";
return "";
}
public static String  _revisauug(anywheresoftware.b4a.BA _ba) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "revisauug", false))
	 {return ((String) Debug.delegate(null, "revisauug", new Object[] {_ba}));}
int _daa = 0;
RDebugUtils.currentLine=44695552;
 //BA.debugLineNum = 44695552;BA.debugLine="Sub revisaUUG 'ignore";
RDebugUtils.currentLine=44695553;
 //BA.debugLineNum = 44695553;BA.debugLine="Try";
try {RDebugUtils.currentLine=44695555;
 //BA.debugLineNum = 44695555;BA.debugLine="If Tracker.FLP.GetLastKnownLocation.IsInitialize";
if (mostCurrent._tracker._flp /*uk.co.martinpearman.b4a.fusedlocationprovider.FusedLocationProviderWrapper*/ .GetLastKnownLocation().IsInitialized()) { 
RDebugUtils.currentLine=44695556;
 //BA.debugLineNum = 44695556;BA.debugLine="Dim daa As Int = Tracker.UUGCoords.DistanceTo(T";
_daa = (int) (mostCurrent._tracker._uugcoords /*anywheresoftware.b4a.gps.LocationWrapper*/ .DistanceTo((android.location.Location)(mostCurrent._tracker._flp /*uk.co.martinpearman.b4a.fusedlocationprovider.FusedLocationProviderWrapper*/ .GetLastKnownLocation().getObject())));
RDebugUtils.currentLine=44695557;
 //BA.debugLineNum = 44695557;BA.debugLine="If Starter.Logger Then LogColor($\"**** UUC \"${f";
if (mostCurrent._starter._logger /*boolean*/ ) { 
anywheresoftware.b4a.keywords.Common.LogImpl("044695557",("**** UUC \""+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_fechakmt(_ba,BA.NumberToString(mostCurrent._tracker._flp /*uk.co.martinpearman.b4a.fusedlocationprovider.FusedLocationProviderWrapper*/ .GetLastKnownLocation().getTime()))))+"|"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("0.2",(Object)(mostCurrent._tracker._flp /*uk.co.martinpearman.b4a.fusedlocationprovider.FusedLocationProviderWrapper*/ .GetLastKnownLocation().getAccuracy()))+"|"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("0.8",(Object)(mostCurrent._tracker._flp /*uk.co.martinpearman.b4a.fusedlocationprovider.FusedLocationProviderWrapper*/ .GetLastKnownLocation().getLatitude()))+"|"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("0.8",(Object)(mostCurrent._tracker._flp /*uk.co.martinpearman.b4a.fusedlocationprovider.FusedLocationProviderWrapper*/ .GetLastKnownLocation().getLongitude()))+"|"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("0.2",(Object)(mostCurrent._tracker._flp /*uk.co.martinpearman.b4a.fusedlocationprovider.FusedLocationProviderWrapper*/ .GetLastKnownLocation().getSpeed()))+"|"),anywheresoftware.b4a.keywords.Common.Colors.RGB((int) (255),(int) (112),(int) (35)));};
RDebugUtils.currentLine=44695558;
 //BA.debugLineNum = 44695558;BA.debugLine="If daa > 40 And Tracker.FLP.GetLastKnownLocatio";
if (_daa>40 && mostCurrent._tracker._flp /*uk.co.martinpearman.b4a.fusedlocationprovider.FusedLocationProviderWrapper*/ .GetLastKnownLocation().getAccuracy()<35) { 
RDebugUtils.currentLine=44695559;
 //BA.debugLineNum = 44695559;BA.debugLine="kmt.ExecNonQuery2(\"INSERT INTO RUTA_GPS(fecha,";
_kmt.ExecNonQuery2("INSERT INTO RUTA_GPS(fecha, lat, lon) VALUES (?,?,?)",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(_fechakmt(_ba,BA.NumberToString(mostCurrent._tracker._flp /*uk.co.martinpearman.b4a.fusedlocationprovider.FusedLocationProviderWrapper*/ .GetLastKnownLocation().getTime()))),(Object)(mostCurrent._tracker._flp /*uk.co.martinpearman.b4a.fusedlocationprovider.FusedLocationProviderWrapper*/ .GetLastKnownLocation().getLatitude()),(Object)(mostCurrent._tracker._flp /*uk.co.martinpearman.b4a.fusedlocationprovider.FusedLocationProviderWrapper*/ .GetLastKnownLocation().getLongitude())}));
RDebugUtils.currentLine=44695560;
 //BA.debugLineNum = 44695560;BA.debugLine="If Starter.Logger Then Log(\"++++ Distancia a a";
if (mostCurrent._starter._logger /*boolean*/ ) { 
anywheresoftware.b4a.keywords.Common.LogImpl("044695560","++++ Distancia a anterior="+BA.NumberToString(_daa)+"|"+"Precision="+BA.NumberToString(mostCurrent._tracker._flp /*uk.co.martinpearman.b4a.fusedlocationprovider.FusedLocationProviderWrapper*/ .GetLastKnownLocation().getAccuracy()),0);};
 };
RDebugUtils.currentLine=44695562;
 //BA.debugLineNum = 44695562;BA.debugLine="Tracker.UUGCoords = Tracker.FLP.GetLastKnownLoc";
mostCurrent._tracker._uugcoords /*anywheresoftware.b4a.gps.LocationWrapper*/  = mostCurrent._tracker._flp /*uk.co.martinpearman.b4a.fusedlocationprovider.FusedLocationProviderWrapper*/ .GetLastKnownLocation();
 };
 } 
       catch (Exception e12) {
			(_ba.processBA == null ? _ba : _ba.processBA).setLastException(e12);RDebugUtils.currentLine=44695565;
 //BA.debugLineNum = 44695565;BA.debugLine="LogColor(\"If Tracker.FLP.GetLastKnownLocation.Is";
anywheresoftware.b4a.keywords.Common.LogImpl("044695565","If Tracker.FLP.GetLastKnownLocation.IsInitialized --> "+BA.ObjectToString(anywheresoftware.b4a.keywords.Common.LastException(_ba)),anywheresoftware.b4a.keywords.Common.Colors.Red);
 };
RDebugUtils.currentLine=44695567;
 //BA.debugLineNum = 44695567;BA.debugLine="End Sub";
return "";
}
public static String  _setdivider(anywheresoftware.b4a.BA _ba,anywheresoftware.b4a.objects.ListViewWrapper _lv,int _color,int _height) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "setdivider", false))
	 {return ((String) Debug.delegate(null, "setdivider", new Object[] {_ba,_lv,_color,_height}));}
anywheresoftware.b4a.agraham.reflection.Reflection _r = null;
anywheresoftware.b4a.objects.drawable.ColorDrawable _cd = null;
RDebugUtils.currentLine=43188224;
 //BA.debugLineNum = 43188224;BA.debugLine="Sub SetDivider(lv As ListView, Color As Int, Heigh";
RDebugUtils.currentLine=43188225;
 //BA.debugLineNum = 43188225;BA.debugLine="Dim r As Reflector";
_r = new anywheresoftware.b4a.agraham.reflection.Reflection();
RDebugUtils.currentLine=43188226;
 //BA.debugLineNum = 43188226;BA.debugLine="r.Target = lv";
_r.Target = (Object)(_lv.getObject());
RDebugUtils.currentLine=43188227;
 //BA.debugLineNum = 43188227;BA.debugLine="Dim CD As ColorDrawable";
_cd = new anywheresoftware.b4a.objects.drawable.ColorDrawable();
RDebugUtils.currentLine=43188228;
 //BA.debugLineNum = 43188228;BA.debugLine="CD.Initialize(Color, 0)";
_cd.Initialize(_color,(int) (0));
RDebugUtils.currentLine=43188229;
 //BA.debugLineNum = 43188229;BA.debugLine="r.RunMethod4(\"setDivider\", Array As Object(CD), A";
_r.RunMethod4("setDivider",new Object[]{(Object)(_cd.getObject())},new String[]{"android.graphics.drawable.Drawable"});
RDebugUtils.currentLine=43188230;
 //BA.debugLineNum = 43188230;BA.debugLine="r.RunMethod2(\"setDividerHeight\", Height, \"java.la";
_r.RunMethod2("setDividerHeight",BA.NumberToString(_height),"java.lang.int");
RDebugUtils.currentLine=43188231;
 //BA.debugLineNum = 43188231;BA.debugLine="End Sub";
return "";
}
public static String  _totalpedido(anywheresoftware.b4a.BA _ba) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "totalpedido", false))
	 {return ((String) Debug.delegate(null, "totalpedido", new Object[] {_ba}));}
anywheresoftware.b4a.sql.SQL.CursorWrapper _ct = null;
String _ptotal = "";
String _tempt = "";
RDebugUtils.currentLine=46268416;
 //BA.debugLineNum = 46268416;BA.debugLine="Sub totalPedido As String";
RDebugUtils.currentLine=46268417;
 //BA.debugLineNum = 46268417;BA.debugLine="Private cT As Cursor = Starter.skmt.ExecQuery($\"s";
_ct = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_ct = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(mostCurrent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery(("select sum(PE_COSTO_TOT) as total from PEDIDO where PE_CLIENTE = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_traecliente(_ba)))+"' AND PE_CEDIS <> 'DUR'"))));
RDebugUtils.currentLine=46268418;
 //BA.debugLineNum = 46268418;BA.debugLine="Private pTotal As String = \"0\"";
_ptotal = "0";
RDebugUtils.currentLine=46268419;
 //BA.debugLineNum = 46268419;BA.debugLine="If cT.RowCount > 0 Then";
if (_ct.getRowCount()>0) { 
RDebugUtils.currentLine=46268420;
 //BA.debugLineNum = 46268420;BA.debugLine="cT.Position = 0";
_ct.setPosition((int) (0));
RDebugUtils.currentLine=46268422;
 //BA.debugLineNum = 46268422;BA.debugLine="Private tempT As String = cT.GetLong(\"total\")";
_tempt = BA.NumberToString(_ct.GetLong("total"));
RDebugUtils.currentLine=46268423;
 //BA.debugLineNum = 46268423;BA.debugLine="If tempT <> \"null\" And tempT <> Null Then";
if ((_tempt).equals("null") == false && _tempt!= null) { 
RDebugUtils.currentLine=46268425;
 //BA.debugLineNum = 46268425;BA.debugLine="pTotal = tempT";
_ptotal = _tempt;
 };
 };
RDebugUtils.currentLine=46268429;
 //BA.debugLineNum = 46268429;BA.debugLine="cT.Close";
_ct.Close();
RDebugUtils.currentLine=46268430;
 //BA.debugLineNum = 46268430;BA.debugLine="Return pTotal";
if (true) return _ptotal;
RDebugUtils.currentLine=46268431;
 //BA.debugLineNum = 46268431;BA.debugLine="End Sub";
return "";
}
public static String  _traeinventario(anywheresoftware.b4a.BA _ba,String _id) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "traeinventario", false))
	 {return ((String) Debug.delegate(null, "traeinventario", new Object[] {_ba,_id}));}
anywheresoftware.b4a.sql.SQL.CursorWrapper _c = null;
String _inventario = "";
RDebugUtils.currentLine=49414144;
 //BA.debugLineNum = 49414144;BA.debugLine="Sub traeinventario(id As String) As String";
RDebugUtils.currentLine=49414145;
 //BA.debugLineNum = 49414145;BA.debugLine="Dim c As Cursor";
_c = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
RDebugUtils.currentLine=49414146;
 //BA.debugLineNum = 49414146;BA.debugLine="Dim inventario As String = \"0\"";
_inventario = "0";
RDebugUtils.currentLine=49414147;
 //BA.debugLineNum = 49414147;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery($\"select CAT_G";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(mostCurrent._b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (_ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery(("select CAT_GP_ALMACEN from "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_traetablaprods(_ba,mostCurrent._b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (_ba)._tipo_venta /*String*/ )))+" where CAT_GP_ID = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_id))+"'"))));
RDebugUtils.currentLine=49414149;
 //BA.debugLineNum = 49414149;BA.debugLine="If c.RowCount > 0 Then";
if (_c.getRowCount()>0) { 
RDebugUtils.currentLine=49414150;
 //BA.debugLineNum = 49414150;BA.debugLine="c.Position = 0";
_c.setPosition((int) (0));
RDebugUtils.currentLine=49414151;
 //BA.debugLineNum = 49414151;BA.debugLine="inventario = c.GetString(\"CAT_GP_ALMACEN\")";
_inventario = _c.GetString("CAT_GP_ALMACEN");
 };
RDebugUtils.currentLine=49414153;
 //BA.debugLineNum = 49414153;BA.debugLine="c.Close";
_c.Close();
RDebugUtils.currentLine=49414154;
 //BA.debugLineNum = 49414154;BA.debugLine="Return inventario";
if (true) return _inventario;
RDebugUtils.currentLine=49414155;
 //BA.debugLineNum = 49414155;BA.debugLine="End Sub";
return "";
}
public static boolean  _traemontoprod(anywheresoftware.b4a.BA _ba) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "traemontoprod", false))
	 {return ((Boolean) Debug.delegate(null, "traemontoprod", new Object[] {_ba}));}
boolean _x = false;
anywheresoftware.b4a.sql.SQL.CursorWrapper _c = null;
anywheresoftware.b4a.sql.SQL.CursorWrapper _c2 = null;
RDebugUtils.currentLine=47644672;
 //BA.debugLineNum = 47644672;BA.debugLine="Sub TraeMontoProd As Boolean";
RDebugUtils.currentLine=47644673;
 //BA.debugLineNum = 47644673;BA.debugLine="Private x As Boolean = False";
_x = anywheresoftware.b4a.keywords.Common.False;
RDebugUtils.currentLine=47644674;
 //BA.debugLineNum = 47644674;BA.debugLine="Private c As Cursor = B4XPages.MainPage.skmt.Exec";
_c = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(mostCurrent._b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (_ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("SELECT ifnull( SUM (PE_COSTO_TOT),0) As suma FROM PEDIDO JOIN CAT_PROMO_ESP ON CAT_PE_ID = PE_PROID WHERE PE_CLIENTE IN (Select CUENTA FROM CUENTAA)")));
RDebugUtils.currentLine=47644675;
 //BA.debugLineNum = 47644675;BA.debugLine="If c.RowCount > 0 Then";
if (_c.getRowCount()>0) { 
RDebugUtils.currentLine=47644676;
 //BA.debugLineNum = 47644676;BA.debugLine="c.Position = 0";
_c.setPosition((int) (0));
RDebugUtils.currentLine=47644677;
 //BA.debugLineNum = 47644677;BA.debugLine="Private c2 As Cursor = B4XPages.MainPage.skmt.Ex";
_c2 = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_c2 = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(mostCurrent._b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (_ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("SELECT DISTINCT CAT_PE_MONTO FROM CAT_PROMO_ESP")));
RDebugUtils.currentLine=47644678;
 //BA.debugLineNum = 47644678;BA.debugLine="If c2.RowCount > 0 Then";
if (_c2.getRowCount()>0) { 
RDebugUtils.currentLine=47644679;
 //BA.debugLineNum = 47644679;BA.debugLine="c2.Position = 0";
_c2.setPosition((int) (0));
RDebugUtils.currentLine=47644680;
 //BA.debugLineNum = 47644680;BA.debugLine="If c.GetString(\"suma\") >= c2.GetString(\"CAT_PE";
if ((double)(Double.parseDouble(_c.GetString("suma")))>=(double)(Double.parseDouble(_c2.GetString("CAT_PE_MONTO")))) { 
RDebugUtils.currentLine=47644681;
 //BA.debugLineNum = 47644681;BA.debugLine="x = True";
_x = anywheresoftware.b4a.keywords.Common.True;
 }else {
RDebugUtils.currentLine=47644684;
 //BA.debugLineNum = 47644684;BA.debugLine="x = False";
_x = anywheresoftware.b4a.keywords.Common.False;
 };
 };
 };
RDebugUtils.currentLine=47644689;
 //BA.debugLineNum = 47644689;BA.debugLine="Return x";
if (true) return _x;
RDebugUtils.currentLine=47644690;
 //BA.debugLineNum = 47644690;BA.debugLine="End Sub";
return false;
}
public static boolean  _traemontoprod2(anywheresoftware.b4a.BA _ba) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "traemontoprod2", false))
	 {return ((Boolean) Debug.delegate(null, "traemontoprod2", new Object[] {_ba}));}
boolean _x = false;
anywheresoftware.b4a.sql.SQL.CursorWrapper _c = null;
anywheresoftware.b4a.sql.SQL.CursorWrapper _c2 = null;
RDebugUtils.currentLine=47710208;
 //BA.debugLineNum = 47710208;BA.debugLine="Sub TraeMontoProd2 As Boolean";
RDebugUtils.currentLine=47710210;
 //BA.debugLineNum = 47710210;BA.debugLine="Private x As Boolean = False";
_x = anywheresoftware.b4a.keywords.Common.False;
RDebugUtils.currentLine=47710212;
 //BA.debugLineNum = 47710212;BA.debugLine="Private c As Cursor = B4XPages.MainPage.skmt.Exec";
_c = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(mostCurrent._b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (_ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("SELECT ifnull( SUM (PE_COSTO_TOT),0) As suma FROM PEDIDO JOIN CAT_PROMO_ESP ON CAT_PE_ID = PE_PROID WHERE PE_CLIENTE IN (Select CUENTA FROM CUENTAA)")));
RDebugUtils.currentLine=47710214;
 //BA.debugLineNum = 47710214;BA.debugLine="If c.RowCount > 0 Then";
if (_c.getRowCount()>0) { 
RDebugUtils.currentLine=47710216;
 //BA.debugLineNum = 47710216;BA.debugLine="c.Position = 0";
_c.setPosition((int) (0));
RDebugUtils.currentLine=47710218;
 //BA.debugLineNum = 47710218;BA.debugLine="Private c2 As Cursor = B4XPages.MainPage.skmt.Ex";
_c2 = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_c2 = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(mostCurrent._b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (_ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("SELECT DISTINCT CAT_PE_MONTO FROM CAT_PROMO_ESP")));
RDebugUtils.currentLine=47710220;
 //BA.debugLineNum = 47710220;BA.debugLine="If c2.RowCount > 0 Then";
if (_c2.getRowCount()>0) { 
RDebugUtils.currentLine=47710222;
 //BA.debugLineNum = 47710222;BA.debugLine="c2.Position = 0";
_c2.setPosition((int) (0));
RDebugUtils.currentLine=47710224;
 //BA.debugLineNum = 47710224;BA.debugLine="If c.GetString(\"suma\") >= 350 And c.GetString(\"";
if ((double)(Double.parseDouble(_c.GetString("suma")))>=350 && (double)(Double.parseDouble(_c.GetString("suma")))<=499.99) { 
RDebugUtils.currentLine=47710226;
 //BA.debugLineNum = 47710226;BA.debugLine="x = True";
_x = anywheresoftware.b4a.keywords.Common.True;
 }else {
RDebugUtils.currentLine=47710229;
 //BA.debugLineNum = 47710229;BA.debugLine="x = False";
_x = anywheresoftware.b4a.keywords.Common.False;
 };
 };
 };
RDebugUtils.currentLine=47710235;
 //BA.debugLineNum = 47710235;BA.debugLine="Return x";
if (true) return _x;
RDebugUtils.currentLine=47710237;
 //BA.debugLineNum = 47710237;BA.debugLine="End Sub";
return false;
}
public static anywheresoftware.b4a.objects.collections.Map  _traeprodiddebd(anywheresoftware.b4a.BA _ba) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "traeprodiddebd", false))
	 {return ((anywheresoftware.b4a.objects.collections.Map) Debug.delegate(null, "traeprodiddebd", new Object[] {_ba}));}
anywheresoftware.b4a.sql.SQL.CursorWrapper _c = null;
anywheresoftware.b4a.objects.collections.Map _m = null;
RDebugUtils.currentLine=47382528;
 //BA.debugLineNum = 47382528;BA.debugLine="Sub traeProdIdDeBD As Map 'ignore";
RDebugUtils.currentLine=47382529;
 //BA.debugLineNum = 47382529;BA.debugLine="Private c As Cursor";
_c = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
RDebugUtils.currentLine=47382530;
 //BA.debugLineNum = 47382530;BA.debugLine="Private m As Map";
_m = new anywheresoftware.b4a.objects.collections.Map();
RDebugUtils.currentLine=47382531;
 //BA.debugLineNum = 47382531;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery($\"select CAT_G";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(mostCurrent._b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (_ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery(("select CAT_GP_ID, CAT_GP_NOMBRE, CAT_GP_TIPO, CAT_GP_SUBTIPO from "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_traetablaprods(_ba,_traetipoventadebd(_ba))))+" where CAT_GP_NOMBRE In (Select PDESC from PROID)"))));
RDebugUtils.currentLine=47382532;
 //BA.debugLineNum = 47382532;BA.debugLine="If c.RowCount > 0 Then";
if (_c.getRowCount()>0) { 
RDebugUtils.currentLine=47382533;
 //BA.debugLineNum = 47382533;BA.debugLine="c.Position = 0";
_c.setPosition((int) (0));
RDebugUtils.currentLine=47382534;
 //BA.debugLineNum = 47382534;BA.debugLine="m = CreateMap(\"id\":c.GetString(\"CAT_GP_ID\"), \"no";
_m = anywheresoftware.b4a.keywords.Common.createMap(new Object[] {(Object)("id"),(Object)(_c.GetString("CAT_GP_ID")),(Object)("nombre"),(Object)(_c.GetString("CAT_GP_NOMBRE")),(Object)("tipo"),(Object)(_c.GetString("CAT_GP_TIPO")),(Object)("subtipo"),(Object)(_c.GetString("CAT_GP_SUBTIPO"))});
 }else {
RDebugUtils.currentLine=47382536;
 //BA.debugLineNum = 47382536;BA.debugLine="m = CreateMap(\"id\":\"N/A\", \"nombre\":\"N/A\", \"tipo\"";
_m = anywheresoftware.b4a.keywords.Common.createMap(new Object[] {(Object)("id"),(Object)("N/A"),(Object)("nombre"),(Object)("N/A"),(Object)("tipo"),(Object)("N/A"),(Object)("subtipo"),(Object)("N/A")});
 };
RDebugUtils.currentLine=47382538;
 //BA.debugLineNum = 47382538;BA.debugLine="c.Close";
_c.Close();
RDebugUtils.currentLine=47382539;
 //BA.debugLineNum = 47382539;BA.debugLine="Return m";
if (true) return _m;
RDebugUtils.currentLine=47382540;
 //BA.debugLineNum = 47382540;BA.debugLine="End Sub";
return null;
}
public static anywheresoftware.b4a.objects.collections.Map  _traepromoiddebd(anywheresoftware.b4a.BA _ba) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "traepromoiddebd", false))
	 {return ((anywheresoftware.b4a.objects.collections.Map) Debug.delegate(null, "traepromoiddebd", new Object[] {_ba}));}
anywheresoftware.b4a.sql.SQL.CursorWrapper _c = null;
anywheresoftware.b4a.objects.collections.Map _m = null;
RDebugUtils.currentLine=47448064;
 //BA.debugLineNum = 47448064;BA.debugLine="Sub traePromoIdDeBD As Map 'ignore";
RDebugUtils.currentLine=47448065;
 //BA.debugLineNum = 47448065;BA.debugLine="Private c As Cursor";
_c = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
RDebugUtils.currentLine=47448066;
 //BA.debugLineNum = 47448066;BA.debugLine="Private m As Map";
_m = new anywheresoftware.b4a.objects.collections.Map();
RDebugUtils.currentLine=47448068;
 //BA.debugLineNum = 47448068;BA.debugLine="Log(\"ENTRE\")";
anywheresoftware.b4a.keywords.Common.LogImpl("047448068","ENTRE",0);
RDebugUtils.currentLine=47448069;
 //BA.debugLineNum = 47448069;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery($\"select CAT_G";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(mostCurrent._b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (_ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery(("select CAT_GP_ID, CAT_GP_NOMBRE, CAT_GP_TIPO, CAT_GP_SUBTIPO from "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_traetablaprods(_ba,_traetipoventadebd(_ba))))+" where CAT_GP_NOMBRE In (Select PDESC from PROID) and CAT_GP_TIPO = 'PROMOS'"))));
RDebugUtils.currentLine=47448070;
 //BA.debugLineNum = 47448070;BA.debugLine="If c.RowCount > 0 Then";
if (_c.getRowCount()>0) { 
RDebugUtils.currentLine=47448071;
 //BA.debugLineNum = 47448071;BA.debugLine="c.Position = 0";
_c.setPosition((int) (0));
RDebugUtils.currentLine=47448072;
 //BA.debugLineNum = 47448072;BA.debugLine="m = CreateMap(\"id\":c.GetString(\"CAT_GP_ID\"), \"no";
_m = anywheresoftware.b4a.keywords.Common.createMap(new Object[] {(Object)("id"),(Object)(_c.GetString("CAT_GP_ID")),(Object)("nombre"),(Object)(_c.GetString("CAT_GP_NOMBRE")),(Object)("tipo"),(Object)(_c.GetString("CAT_GP_TIPO")),(Object)("subtipo"),(Object)(_c.GetString("CAT_GP_SUBTIPO"))});
 }else {
RDebugUtils.currentLine=47448074;
 //BA.debugLineNum = 47448074;BA.debugLine="m = CreateMap(\"id\":\"N/A\", \"nombre\":\"N/A\", \"tipo\"";
_m = anywheresoftware.b4a.keywords.Common.createMap(new Object[] {(Object)("id"),(Object)("N/A"),(Object)("nombre"),(Object)("N/A"),(Object)("tipo"),(Object)("N/A"),(Object)("subtipo"),(Object)("N/A")});
 };
RDebugUtils.currentLine=47448076;
 //BA.debugLineNum = 47448076;BA.debugLine="c.Close";
_c.Close();
RDebugUtils.currentLine=47448078;
 //BA.debugLineNum = 47448078;BA.debugLine="Return m";
if (true) return _m;
RDebugUtils.currentLine=47448079;
 //BA.debugLineNum = 47448079;BA.debugLine="End Sub";
return null;
}
public static anywheresoftware.b4a.objects.collections.Map  _traetotalesclienteactual(anywheresoftware.b4a.BA _ba) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "traetotalesclienteactual", false))
	 {return ((anywheresoftware.b4a.objects.collections.Map) Debug.delegate(null, "traetotalesclienteactual", new Object[] {_ba}));}
anywheresoftware.b4a.objects.collections.Map _m = null;
anywheresoftware.b4a.sql.SQL.CursorWrapper _c_prodsx = null;
RDebugUtils.currentLine=49479680;
 //BA.debugLineNum = 49479680;BA.debugLine="Sub traeTotalesClienteActual As Map";
RDebugUtils.currentLine=49479681;
 //BA.debugLineNum = 49479681;BA.debugLine="Private m As Map";
_m = new anywheresoftware.b4a.objects.collections.Map();
RDebugUtils.currentLine=49479682;
 //BA.debugLineNum = 49479682;BA.debugLine="m.Initialize";
_m.Initialize();
RDebugUtils.currentLine=49479683;
 //BA.debugLineNum = 49479683;BA.debugLine="Private c_prodsX As Cursor=B4XPages.MainPage.skmt";
_c_prodsx = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_c_prodsx = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(mostCurrent._b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (_ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("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")));
RDebugUtils.currentLine=49479684;
 //BA.debugLineNum = 49479684;BA.debugLine="c_prodsX.Position=0";
_c_prodsx.setPosition((int) (0));
RDebugUtils.currentLine=49479686;
 //BA.debugLineNum = 49479686;BA.debugLine="m = CreateMap(\"productos\": c_prodsX.GetString(\"ca";
_m = anywheresoftware.b4a.keywords.Common.createMap(new Object[] {(Object)("productos"),(Object)(_c_prodsx.GetString("cantProds")),(Object)("monto"),(Object)(_c_prodsx.GetString("costoTotal"))});
RDebugUtils.currentLine=49479687;
 //BA.debugLineNum = 49479687;BA.debugLine="Return m";
if (true) return _m;
RDebugUtils.currentLine=49479688;
 //BA.debugLineNum = 49479688;BA.debugLine="End Sub";
return null;
}
public static String  _traevariable(anywheresoftware.b4a.BA _ba,String _nombre) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "traevariable", false))
	 {return ((String) Debug.delegate(null, "traevariable", new Object[] {_ba,_nombre}));}
String _valor = "";
anywheresoftware.b4a.sql.SQL.CursorWrapper _lavc = null;
RDebugUtils.currentLine=49086464;
 //BA.debugLineNum = 49086464;BA.debugLine="Sub traeVariable(nombre As String) As String";
RDebugUtils.currentLine=49086465;
 //BA.debugLineNum = 49086465;BA.debugLine="Private valor As String = \"\"";
_valor = "";
RDebugUtils.currentLine=49086466;
 //BA.debugLineNum = 49086466;BA.debugLine="Private laVc As Cursor = Starter.skmt.ExecQuery($";
_lavc = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_lavc = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(mostCurrent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery(("select CAT_VA_VALOR from CAT_VARIABLES where CAT_VA_DESCRIPCION = '"+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_nombre))+"'"))));
RDebugUtils.currentLine=49086467;
 //BA.debugLineNum = 49086467;BA.debugLine="If laVc.RowCount > 0 Then";
if (_lavc.getRowCount()>0) { 
RDebugUtils.currentLine=49086468;
 //BA.debugLineNum = 49086468;BA.debugLine="laVc.Position = 0";
_lavc.setPosition((int) (0));
RDebugUtils.currentLine=49086469;
 //BA.debugLineNum = 49086469;BA.debugLine="valor = laVc.GetString(\"CAT_VA_VALOR\")";
_valor = _lavc.GetString("CAT_VA_VALOR");
 };
RDebugUtils.currentLine=49086471;
 //BA.debugLineNum = 49086471;BA.debugLine="Return valor";
if (true) return _valor;
RDebugUtils.currentLine=49086472;
 //BA.debugLineNum = 49086472;BA.debugLine="End Sub";
return "";
}
public static boolean  _vendidopromoesp(anywheresoftware.b4a.BA _ba) throws Exception{
RDebugUtils.currentModule="subs";
if (Debug.shouldDelegate(null, "vendidopromoesp", false))
	 {return ((Boolean) Debug.delegate(null, "vendidopromoesp", new Object[] {_ba}));}
boolean _w = false;
anywheresoftware.b4a.sql.SQL.CursorWrapper _c = null;
RDebugUtils.currentLine=47841280;
 //BA.debugLineNum = 47841280;BA.debugLine="Sub vendidoPromoEsp As Boolean";
RDebugUtils.currentLine=47841281;
 //BA.debugLineNum = 47841281;BA.debugLine="Private w As Boolean = False";
_w = anywheresoftware.b4a.keywords.Common.False;
RDebugUtils.currentLine=47841282;
 //BA.debugLineNum = 47841282;BA.debugLine="Private c As Cursor = B4XPages.MainPage.skmt.Exec";
_c = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(mostCurrent._b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (_ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select HP_CLIENTE, HP_CODIGO_PROMOCION from HIST_PROMOS WHERE HP_CODIGO_PROMOCION IN (SELECT DISTINCT CAT_PE_IDPROMO FROM CAT_PROMO_ESP) AND HP_CLIENTE IN (SELECT CUENTA FROM CUENTAA)")));
RDebugUtils.currentLine=47841283;
 //BA.debugLineNum = 47841283;BA.debugLine="If c.RowCount > 0 Then";
if (_c.getRowCount()>0) { 
RDebugUtils.currentLine=47841284;
 //BA.debugLineNum = 47841284;BA.debugLine="w = True";
_w = anywheresoftware.b4a.keywords.Common.True;
 };
RDebugUtils.currentLine=47841286;
 //BA.debugLineNum = 47841286;BA.debugLine="Log(w)";
anywheresoftware.b4a.keywords.Common.LogImpl("047841286",BA.ObjectToString(_w),0);
RDebugUtils.currentLine=47841287;
 //BA.debugLineNum = 47841287;BA.debugLine="c.Close";
_c.Close();
RDebugUtils.currentLine=47841288;
 //BA.debugLineNum = 47841288;BA.debugLine="Private c As Cursor = B4XPages.MainPage.skmt.Exec";
_c = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(mostCurrent._b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (_ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select PE_PROID from PEDIDO WHERE PE_PROID IN (SELECT DISTINCT CAT_PE_IDPROMO FROM CAT_PROMO_ESP) AND PE_CLIENTE IN (SELECT CUENTA FROM CUENTAA)")));
RDebugUtils.currentLine=47841289;
 //BA.debugLineNum = 47841289;BA.debugLine="If c.RowCount > 0 Then";
if (_c.getRowCount()>0) { 
RDebugUtils.currentLine=47841290;
 //BA.debugLineNum = 47841290;BA.debugLine="w = True";
_w = anywheresoftware.b4a.keywords.Common.True;
 };
RDebugUtils.currentLine=47841292;
 //BA.debugLineNum = 47841292;BA.debugLine="c.Close";
_c.Close();
RDebugUtils.currentLine=47841293;
 //BA.debugLineNum = 47841293;BA.debugLine="Log(w)";
anywheresoftware.b4a.keywords.Common.LogImpl("047841293",BA.ObjectToString(_w),0);
RDebugUtils.currentLine=47841294;
 //BA.debugLineNum = 47841294;BA.debugLine="Return w";
if (true) return _w;
RDebugUtils.currentLine=47841295;
 //BA.debugLineNum = 47841295;BA.debugLine="End Sub";
return false;
}
}