package gunav2.keymon.com.mx;

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

public class c_historicobat_subs_0 {


public static RemoteObject  _b4xpage_appear(RemoteObject __ref) throws Exception{
try {
		Debug.PushSubsStack("B4XPage_Appear (c_historicobat) ","c_historicobat",19,__ref.getField(false, "ba"),__ref,54);
if (RapidSub.canDelegate("b4xpage_appear")) { return __ref.runUserSub(false, "c_historicobat","b4xpage_appear", __ref);}
int _i = 0;
RemoteObject _label1 = RemoteObject.declareNull("anywheresoftware.b4a.objects.LabelWrapper");
RemoteObject _label2 = RemoteObject.declareNull("anywheresoftware.b4a.objects.LabelWrapper");
RemoteObject _prohit = RemoteObject.declareNull("anywheresoftware.b4a.sql.SQL.CursorWrapper");
int _sfdf = 0;
RemoteObject _nombreproducto = RemoteObject.createImmutable("");
RemoteObject _cant_sem4 = RemoteObject.createImmutable("");
RemoteObject _cant_sem3 = RemoteObject.createImmutable("");
RemoteObject _cant_sem2 = RemoteObject.createImmutable("");
RemoteObject _cant_sem1 = RemoteObject.createImmutable("");
RemoteObject _sql = RemoteObject.createImmutable("");
RemoteObject _prohit2 = RemoteObject.declareNull("anywheresoftware.b4a.sql.SQL.CursorWrapper");
RemoteObject _promx = RemoteObject.createImmutable(0);
RemoteObject _c1 = RemoteObject.createImmutable(0);
RemoteObject _c2 = RemoteObject.createImmutable(0);
RemoteObject _c3 = RemoteObject.createImmutable(0);
RemoteObject _c4 = RemoteObject.createImmutable(0);
 BA.debugLineNum = 54;BA.debugLine="Sub B4XPage_Appear";
Debug.ShouldStop(2097152);
 BA.debugLineNum = 57;BA.debugLine="Panel1.Visible = False";
Debug.ShouldStop(16777216);
__ref.getField(false,"_panel1" /*RemoteObject*/ ).runMethod(true,"setVisible",c_historicobat.__c.getField(true,"False"));
 BA.debugLineNum = 58;BA.debugLine="If Not(Starter.gps.GPSEnabled) Then";
Debug.ShouldStop(33554432);
if (c_historicobat.__c.runMethod(true,"Not",(Object)(c_historicobat._starter._gps /*RemoteObject*/ .runMethod(true,"getGPSEnabled"))).<Boolean>get().booleanValue()) { 
 BA.debugLineNum = 59;BA.debugLine="ToastMessageShow(\"Es necesario tener el GPS ence";
Debug.ShouldStop(67108864);
c_historicobat.__c.runVoidMethod ("ToastMessageShow",(Object)(BA.ObjectToCharSequence("Es necesario tener el GPS encendido")),(Object)(c_historicobat.__c.getField(true,"True")));
 BA.debugLineNum = 60;BA.debugLine="StartActivity(Starter.gps.LocationSettingsIntent";
Debug.ShouldStop(134217728);
c_historicobat.__c.runVoidMethod ("StartActivity",__ref.getField(false, "ba"),(Object)((c_historicobat._starter._gps /*RemoteObject*/ .runMethod(false,"getLocationSettingsIntent"))));
 };
 BA.debugLineNum = 62;BA.debugLine="L_CANT.Text =\"\"";
Debug.ShouldStop(536870912);
__ref.getField(false,"_l_cant" /*RemoteObject*/ ).runMethod(true,"setText",BA.ObjectToCharSequence(""));
 BA.debugLineNum = 63;BA.debugLine="L_TOTAL.Text=\"\"";
Debug.ShouldStop(1073741824);
__ref.getField(false,"_l_total" /*RemoteObject*/ ).runMethod(true,"setText",BA.ObjectToCharSequence(""));
 BA.debugLineNum = 64;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"select count(";
Debug.ShouldStop(-2147483648);
__ref.getField(false,"_c" /*RemoteObject*/ ).setObject (c_historicobat._b4xpages.runMethod(false,"_mainpage" /*RemoteObject*/ ,__ref.getField(false, "ba")).getField(false,"_skmt" /*RemoteObject*/ ).runMethod(false,"ExecQuery",(Object)(RemoteObject.createImmutable("select count(*) as EXISTE from HIST_VENTAS WHERE HVD_CLIENTE IN (Select CUENTA from cuentaa)"))));
 BA.debugLineNum = 65;BA.debugLine="C.Position=0";
Debug.ShouldStop(1);
__ref.getField(false,"_c" /*RemoteObject*/ ).runMethod(true,"setPosition",BA.numberCast(int.class, 0));
 BA.debugLineNum = 66;BA.debugLine="Existe = C.GetString(\"EXISTE\")";
Debug.ShouldStop(2);
__ref.setField ("_existe" /*RemoteObject*/ ,__ref.getField(false,"_c" /*RemoteObject*/ ).runMethod(true,"GetString",(Object)(RemoteObject.createImmutable("EXISTE"))));
 BA.debugLineNum = 67;BA.debugLine="C.Close";
Debug.ShouldStop(4);
__ref.getField(false,"_c" /*RemoteObject*/ ).runVoidMethod ("Close");
 BA.debugLineNum = 68;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"select HVD_CL";
Debug.ShouldStop(8);
__ref.getField(false,"_c" /*RemoteObject*/ ).setObject (c_historicobat._b4xpages.runMethod(false,"_mainpage" /*RemoteObject*/ ,__ref.getField(false, "ba")).getField(false,"_skmt" /*RemoteObject*/ ).runMethod(false,"ExecQuery",(Object)(RemoteObject.createImmutable("select HVD_CLIENTE,HVD_PRONOMBRE,HVD_CANT,HVD_COSTO_TOT, HVD_FECHA from HIST_VENTAS WHERE HVD_CLIENTE IN (Select CUENTA from cuentaa) order by HVD_FECHA asc"))));
 BA.debugLineNum = 69;BA.debugLine="ListView1.Clear";
Debug.ShouldStop(16);
__ref.getField(false,"_listview1" /*RemoteObject*/ ).runVoidMethod ("Clear");
 BA.debugLineNum = 70;BA.debugLine="If c.RowCount>0 Then";
Debug.ShouldStop(32);
if (RemoteObject.solveBoolean(">",__ref.getField(false,"_c" /*RemoteObject*/ ).runMethod(true,"getRowCount"),BA.numberCast(double.class, 0))) { 
 BA.debugLineNum = 71;BA.debugLine="For i=0 To c.RowCount -1";
Debug.ShouldStop(64);
{
final int step15 = 1;
final int limit15 = RemoteObject.solve(new RemoteObject[] {__ref.getField(false,"_c" /*RemoteObject*/ ).runMethod(true,"getRowCount"),RemoteObject.createImmutable(1)}, "-",1, 1).<Integer>get().intValue();
_i = 0 ;
for (;(step15 > 0 && _i <= limit15) || (step15 < 0 && _i >= limit15) ;_i = ((int)(0 + _i + step15))  ) {
Debug.locals.put("i", _i);
 BA.debugLineNum = 72;BA.debugLine="c.Position=i";
Debug.ShouldStop(128);
__ref.getField(false,"_c" /*RemoteObject*/ ).runMethod(true,"setPosition",BA.numberCast(int.class, _i));
 BA.debugLineNum = 73;BA.debugLine="Dim label1 As Label";
Debug.ShouldStop(256);
_label1 = RemoteObject.createNew ("anywheresoftware.b4a.objects.LabelWrapper");Debug.locals.put("label1", _label1);
 BA.debugLineNum = 74;BA.debugLine="label1 = ListView1.TwoLinesLayout.Label";
Debug.ShouldStop(512);
_label1 = __ref.getField(false,"_listview1" /*RemoteObject*/ ).runMethod(false,"getTwoLinesLayout").getField(false,"Label");Debug.locals.put("label1", _label1);
 BA.debugLineNum = 75;BA.debugLine="label1.TextSize = 15";
Debug.ShouldStop(1024);
_label1.runMethod(true,"setTextSize",BA.numberCast(float.class, 15));
 BA.debugLineNum = 76;BA.debugLine="label1.TextColor = Colors.White";
Debug.ShouldStop(2048);
_label1.runMethod(true,"setTextColor",c_historicobat.__c.getField(false,"Colors").getField(true,"White"));
 BA.debugLineNum = 77;BA.debugLine="Dim label2 As Label";
Debug.ShouldStop(4096);
_label2 = RemoteObject.createNew ("anywheresoftware.b4a.objects.LabelWrapper");Debug.locals.put("label2", _label2);
 BA.debugLineNum = 78;BA.debugLine="label2 = ListView1.TwoLinesLayout.SecondLabel";
Debug.ShouldStop(8192);
_label2 = __ref.getField(false,"_listview1" /*RemoteObject*/ ).runMethod(false,"getTwoLinesLayout").getField(false,"SecondLabel");Debug.locals.put("label2", _label2);
 BA.debugLineNum = 79;BA.debugLine="label2.TextSize = 15";
Debug.ShouldStop(16384);
_label2.runMethod(true,"setTextSize",BA.numberCast(float.class, 15));
 BA.debugLineNum = 80;BA.debugLine="label2.TextColor = Colors.White";
Debug.ShouldStop(32768);
_label2.runMethod(true,"setTextColor",c_historicobat.__c.getField(false,"Colors").getField(true,"White"));
 BA.debugLineNum = 81;BA.debugLine="ListView1.AddTwoLines(c.GetString(\"HVD_PRONOMBR";
Debug.ShouldStop(65536);
__ref.getField(false,"_listview1" /*RemoteObject*/ ).runVoidMethod ("AddTwoLines",(Object)(BA.ObjectToCharSequence(__ref.getField(false,"_c" /*RemoteObject*/ ).runMethod(true,"GetString",(Object)(RemoteObject.createImmutable("HVD_PRONOMBRE"))))),(Object)(BA.ObjectToCharSequence(RemoteObject.concat(RemoteObject.createImmutable("Cantidad #"),__ref.getField(false,"_c" /*RemoteObject*/ ).runMethod(true,"GetString",(Object)(RemoteObject.createImmutable("HVD_CANT"))),RemoteObject.createImmutable(" SubTotal $"),__ref.getField(false,"_c" /*RemoteObject*/ ).runMethod(true,"GetString",(Object)(RemoteObject.createImmutable("HVD_COSTO_TOT"))),RemoteObject.createImmutable("      Fecha: "),__ref.getField(false,"_c" /*RemoteObject*/ ).runMethod(true,"GetString",(Object)(RemoteObject.createImmutable("HVD_FECHA")))))));
 }
}Debug.locals.put("i", _i);
;
 };
 BA.debugLineNum = 84;BA.debugLine="If Existe <> 0 Then";
Debug.ShouldStop(524288);
if (RemoteObject.solveBoolean("!",__ref.getField(true,"_existe" /*RemoteObject*/ ),BA.NumberToString(0))) { 
 BA.debugLineNum = 85;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"select SUM(H";
Debug.ShouldStop(1048576);
__ref.getField(false,"_c" /*RemoteObject*/ ).setObject (c_historicobat._b4xpages.runMethod(false,"_mainpage" /*RemoteObject*/ ,__ref.getField(false, "ba")).getField(false,"_skmt" /*RemoteObject*/ ).runMethod(false,"ExecQuery",(Object)(RemoteObject.createImmutable("select SUM(HVD_CANT) AS PC_NOART, SUM(HVD_COSTO_TOT) AS PC_MONTO from HIST_VENTAS where HVD_CLIENTE in (Select CUENTA from cuentaa)"))));
 BA.debugLineNum = 86;BA.debugLine="C.Position=0";
Debug.ShouldStop(2097152);
__ref.getField(false,"_c" /*RemoteObject*/ ).runMethod(true,"setPosition",BA.numberCast(int.class, 0));
 BA.debugLineNum = 87;BA.debugLine="L_CANT.Text = c.GetString(\"PC_NOART\")";
Debug.ShouldStop(4194304);
__ref.getField(false,"_l_cant" /*RemoteObject*/ ).runMethod(true,"setText",BA.ObjectToCharSequence(__ref.getField(false,"_c" /*RemoteObject*/ ).runMethod(true,"GetString",(Object)(RemoteObject.createImmutable("PC_NOART")))));
 BA.debugLineNum = 88;BA.debugLine="L_TOTAL.Text = c.GetString(\"PC_MONTO\")";
Debug.ShouldStop(8388608);
__ref.getField(false,"_l_total" /*RemoteObject*/ ).runMethod(true,"setText",BA.ObjectToCharSequence(__ref.getField(false,"_c" /*RemoteObject*/ ).runMethod(true,"GetString",(Object)(RemoteObject.createImmutable("PC_MONTO")))));
 };
 BA.debugLineNum = 90;BA.debugLine="ListView1.Visible = False";
Debug.ShouldStop(33554432);
__ref.getField(false,"_listview1" /*RemoteObject*/ ).runMethod(true,"setVisible",c_historicobat.__c.getField(true,"False"));
 BA.debugLineNum = 92;BA.debugLine="CustomListView1.AsView.Height = Root.Height * 0.4";
Debug.ShouldStop(134217728);
__ref.getField(false,"_customlistview1" /*RemoteObject*/ ).runMethod(false,"_asview").runMethod(true,"setHeight",BA.numberCast(int.class, RemoteObject.solve(new RemoteObject[] {__ref.getField(false,"_root" /*RemoteObject*/ ).runMethod(true,"getHeight"),RemoteObject.createImmutable(0.45)}, "*",0, 0)));
 BA.debugLineNum = 93;BA.debugLine="CustomListView1.Clear";
Debug.ShouldStop(268435456);
__ref.getField(false,"_customlistview1" /*RemoteObject*/ ).runVoidMethod ("_clear");
 BA.debugLineNum = 94;BA.debugLine="Dim prohit As Cursor = B4XPages.MainPage.skmt.Exe";
Debug.ShouldStop(536870912);
_prohit = RemoteObject.createNew ("anywheresoftware.b4a.sql.SQL.CursorWrapper");
_prohit = RemoteObject.declareNull("anywheresoftware.b4a.AbsObjectWrapper").runMethod(false, "ConvertToWrapper", RemoteObject.createNew("anywheresoftware.b4a.sql.SQL.CursorWrapper"), c_historicobat._b4xpages.runMethod(false,"_mainpage" /*RemoteObject*/ ,__ref.getField(false, "ba")).getField(false,"_skmt" /*RemoteObject*/ ).runMethod(false,"ExecQuery",(Object)(RemoteObject.createImmutable("select distinct HVD_PRONOMBRE from HIST_VENTAS WHERE HVD_CLIENTE IN (Select CUENTA from cuentaa) order by HVD_PRONOMBRE asc"))));Debug.locals.put("prohit", _prohit);Debug.locals.put("prohit", _prohit);
 BA.debugLineNum = 96;BA.debugLine="If prohit.RowCount > 0 Then";
Debug.ShouldStop(-2147483648);
if (RemoteObject.solveBoolean(">",_prohit.runMethod(true,"getRowCount"),BA.numberCast(double.class, 0))) { 
 BA.debugLineNum = 99;BA.debugLine="For sfdf = 0 To prohit.RowCount - 1";
Debug.ShouldStop(4);
{
final int step39 = 1;
final int limit39 = RemoteObject.solve(new RemoteObject[] {_prohit.runMethod(true,"getRowCount"),RemoteObject.createImmutable(1)}, "-",1, 1).<Integer>get().intValue();
_sfdf = 0 ;
for (;(step39 > 0 && _sfdf <= limit39) || (step39 < 0 && _sfdf >= limit39) ;_sfdf = ((int)(0 + _sfdf + step39))  ) {
Debug.locals.put("sfdf", _sfdf);
 BA.debugLineNum = 100;BA.debugLine="prohit.Position = sfdf";
Debug.ShouldStop(8);
_prohit.runMethod(true,"setPosition",BA.numberCast(int.class, _sfdf));
 BA.debugLineNum = 101;BA.debugLine="Dim nombreProducto As String = prohit.GetString";
Debug.ShouldStop(16);
_nombreproducto = _prohit.runMethod(true,"GetString",(Object)(RemoteObject.createImmutable("HVD_PRONOMBRE")));Debug.locals.put("nombreProducto", _nombreproducto);Debug.locals.put("nombreProducto", _nombreproducto);
 BA.debugLineNum = 105;BA.debugLine="Dim cant_sem4 As String = \"0\"";
Debug.ShouldStop(256);
_cant_sem4 = BA.ObjectToString("0");Debug.locals.put("cant_sem4", _cant_sem4);Debug.locals.put("cant_sem4", _cant_sem4);
 BA.debugLineNum = 106;BA.debugLine="Dim cant_sem3 As String = \"0\"";
Debug.ShouldStop(512);
_cant_sem3 = BA.ObjectToString("0");Debug.locals.put("cant_sem3", _cant_sem3);Debug.locals.put("cant_sem3", _cant_sem3);
 BA.debugLineNum = 107;BA.debugLine="Dim cant_sem2 As String = \"0\"";
Debug.ShouldStop(1024);
_cant_sem2 = BA.ObjectToString("0");Debug.locals.put("cant_sem2", _cant_sem2);Debug.locals.put("cant_sem2", _cant_sem2);
 BA.debugLineNum = 108;BA.debugLine="Dim cant_sem1 As String = \"0\"";
Debug.ShouldStop(2048);
_cant_sem1 = BA.ObjectToString("0");Debug.locals.put("cant_sem1", _cant_sem1);Debug.locals.put("cant_sem1", _cant_sem1);
 BA.debugLineNum = 141;BA.debugLine="Dim sql As String = $\"     WITH FechasObjetivo";
Debug.ShouldStop(4096);
_sql = (RemoteObject.concat(RemoteObject.createImmutable("\n"),RemoteObject.createImmutable("    WITH FechasObjetivo (Fecha) AS (\n"),RemoteObject.createImmutable("        SELECT strftime('%d/%m/%Y', date('now', 'localtime', '-28 days'))\n"),RemoteObject.createImmutable("        UNION ALL\n"),RemoteObject.createImmutable("        SELECT strftime('%d/%m/%Y', date('now', 'localtime', '-21 days'))\n"),RemoteObject.createImmutable("        UNION ALL\n"),RemoteObject.createImmutable("        SELECT strftime('%d/%m/%Y', date('now', 'localtime', '-14 days'))\n"),RemoteObject.createImmutable("        UNION ALL\n"),RemoteObject.createImmutable("        SELECT strftime('%d/%m/%Y', date('now', 'localtime', '-7 days'))\n"),RemoteObject.createImmutable("    )\n"),RemoteObject.createImmutable("    SELECT \n"),RemoteObject.createImmutable("        COALESCE(SUM(H.HVD_CANT), 0) AS HVD_CANT_TOTAL,\n"),RemoteObject.createImmutable("        -- Si el mes de la fecha es igual al mes actual, devuelve 1, si no 0\n"),RemoteObject.createImmutable("        CASE WHEN SUBSTR(F.Fecha, 4, 2) = strftime('%m', 'now', 'localtime') THEN 1 ELSE 0 END AS EsMesActual\n"),RemoteObject.createImmutable("    FROM \n"),RemoteObject.createImmutable("        FechasObjetivo AS F\n"),RemoteObject.createImmutable("    LEFT JOIN \n"),RemoteObject.createImmutable("        HIST_VENTAS AS H \n"),RemoteObject.createImmutable("        ON F.Fecha = H.HVD_FECHA\n"),RemoteObject.createImmutable("        AND H.HVD_CLIENTE IN (SELECT CUENTA FROM cuentaa)\n"),RemoteObject.createImmutable("        AND H.HVD_PRONOMBRE = '"),c_historicobat.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_nombreproducto))),RemoteObject.createImmutable("'\n"),RemoteObject.createImmutable("    GROUP BY F.Fecha\n"),RemoteObject.createImmutable("    ORDER BY SUBSTR(F.Fecha, 7, 4), SUBSTR(F.Fecha, 4, 2), SUBSTR(F.Fecha, 1, 2)\n"),RemoteObject.createImmutable("")));Debug.locals.put("sql", _sql);Debug.locals.put("sql", _sql);
 BA.debugLineNum = 169;BA.debugLine="Dim prohit2 As Cursor = B4XPages.MainPage.skmt.";
Debug.ShouldStop(256);
_prohit2 = RemoteObject.createNew ("anywheresoftware.b4a.sql.SQL.CursorWrapper");
_prohit2 = RemoteObject.declareNull("anywheresoftware.b4a.AbsObjectWrapper").runMethod(false, "ConvertToWrapper", RemoteObject.createNew("anywheresoftware.b4a.sql.SQL.CursorWrapper"), c_historicobat._b4xpages.runMethod(false,"_mainpage" /*RemoteObject*/ ,__ref.getField(false, "ba")).getField(false,"_skmt" /*RemoteObject*/ ).runMethod(false,"ExecQuery",(Object)(_sql)));Debug.locals.put("prohit2", _prohit2);Debug.locals.put("prohit2", _prohit2);
 BA.debugLineNum = 193;BA.debugLine="Dim promx As Double = (cant_sem4 +  cant_sem3 +";
Debug.ShouldStop(1);
_promx = RemoteObject.solve(new RemoteObject[] {(RemoteObject.solve(new RemoteObject[] {BA.numberCast(double.class, _cant_sem4),BA.numberCast(double.class, _cant_sem3),BA.numberCast(double.class, _cant_sem2),BA.numberCast(double.class, _cant_sem1)}, "+++",3, 0)),RemoteObject.createImmutable(4)}, "/",0, 0);Debug.locals.put("promx", _promx);Debug.locals.put("promx", _promx);
 BA.debugLineNum = 200;BA.debugLine="Dim c1, c2, c3, c4 As Int";
Debug.ShouldStop(128);
_c1 = RemoteObject.createImmutable(0);Debug.locals.put("c1", _c1);
_c2 = RemoteObject.createImmutable(0);Debug.locals.put("c2", _c2);
_c3 = RemoteObject.createImmutable(0);Debug.locals.put("c3", _c3);
_c4 = RemoteObject.createImmutable(0);Debug.locals.put("c4", _c4);
 BA.debugLineNum = 202;BA.debugLine="If prohit2.RowCount = 4 Then";
Debug.ShouldStop(512);
if (RemoteObject.solveBoolean("=",_prohit2.runMethod(true,"getRowCount"),BA.numberCast(double.class, 4))) { 
 BA.debugLineNum = 203;BA.debugLine="prohit2.Position = 0";
Debug.ShouldStop(1024);
_prohit2.runMethod(true,"setPosition",BA.numberCast(int.class, 0));
 BA.debugLineNum = 204;BA.debugLine="cant_sem4 = prohit2.GetString(\"HVD_CANT_TOTAL\"";
Debug.ShouldStop(2048);
_cant_sem4 = _prohit2.runMethod(true,"GetString",(Object)(RemoteObject.createImmutable("HVD_CANT_TOTAL")));Debug.locals.put("cant_sem4", _cant_sem4);
 BA.debugLineNum = 205;BA.debugLine="c1 = prohit2.GetInt(\"EsMesActual\")";
Debug.ShouldStop(4096);
_c1 = _prohit2.runMethod(true,"GetInt",(Object)(RemoteObject.createImmutable("EsMesActual")));Debug.locals.put("c1", _c1);
 BA.debugLineNum = 207;BA.debugLine="prohit2.Position = 1";
Debug.ShouldStop(16384);
_prohit2.runMethod(true,"setPosition",BA.numberCast(int.class, 1));
 BA.debugLineNum = 208;BA.debugLine="cant_sem3 = prohit2.GetString(\"HVD_CANT_TOTAL\"";
Debug.ShouldStop(32768);
_cant_sem3 = _prohit2.runMethod(true,"GetString",(Object)(RemoteObject.createImmutable("HVD_CANT_TOTAL")));Debug.locals.put("cant_sem3", _cant_sem3);
 BA.debugLineNum = 209;BA.debugLine="c2 = prohit2.GetInt(\"EsMesActual\")";
Debug.ShouldStop(65536);
_c2 = _prohit2.runMethod(true,"GetInt",(Object)(RemoteObject.createImmutable("EsMesActual")));Debug.locals.put("c2", _c2);
 BA.debugLineNum = 211;BA.debugLine="prohit2.Position = 2";
Debug.ShouldStop(262144);
_prohit2.runMethod(true,"setPosition",BA.numberCast(int.class, 2));
 BA.debugLineNum = 212;BA.debugLine="cant_sem2 = prohit2.GetString(\"HVD_CANT_TOTAL\"";
Debug.ShouldStop(524288);
_cant_sem2 = _prohit2.runMethod(true,"GetString",(Object)(RemoteObject.createImmutable("HVD_CANT_TOTAL")));Debug.locals.put("cant_sem2", _cant_sem2);
 BA.debugLineNum = 213;BA.debugLine="c3 = prohit2.GetInt(\"EsMesActual\")";
Debug.ShouldStop(1048576);
_c3 = _prohit2.runMethod(true,"GetInt",(Object)(RemoteObject.createImmutable("EsMesActual")));Debug.locals.put("c3", _c3);
 BA.debugLineNum = 215;BA.debugLine="prohit2.Position = 3";
Debug.ShouldStop(4194304);
_prohit2.runMethod(true,"setPosition",BA.numberCast(int.class, 3));
 BA.debugLineNum = 216;BA.debugLine="cant_sem1 = prohit2.GetString(\"HVD_CANT_TOTAL\"";
Debug.ShouldStop(8388608);
_cant_sem1 = _prohit2.runMethod(true,"GetString",(Object)(RemoteObject.createImmutable("HVD_CANT_TOTAL")));Debug.locals.put("cant_sem1", _cant_sem1);
 BA.debugLineNum = 217;BA.debugLine="c4 = prohit2.GetInt(\"EsMesActual\")";
Debug.ShouldStop(16777216);
_c4 = _prohit2.runMethod(true,"GetInt",(Object)(RemoteObject.createImmutable("EsMesActual")));Debug.locals.put("c4", _c4);
 }else {
 BA.debugLineNum = 219;BA.debugLine="Log(\"Error en filas\")";
Debug.ShouldStop(67108864);
c_historicobat.__c.runVoidMethod ("LogImpl","076152997",RemoteObject.createImmutable("Error en filas"),0);
 };
 BA.debugLineNum = 221;BA.debugLine="prohit2.Close";
Debug.ShouldStop(268435456);
_prohit2.runVoidMethod ("Close");
 BA.debugLineNum = 224;BA.debugLine="CustomListView1.Add(CreateListItem(nombreProduc";
Debug.ShouldStop(-2147483648);
__ref.getField(false,"_customlistview1" /*RemoteObject*/ ).runVoidMethod ("_add",RemoteObject.declareNull("anywheresoftware.b4a.AbsObjectWrapper").runMethod(false, "ConvertToWrapper", RemoteObject.createNew("anywheresoftware.b4a.objects.B4XViewWrapper"), __ref.runClassMethod (gunav2.keymon.com.mx.c_historicobat.class, "_createlistitem" /*RemoteObject*/ ,(Object)(_nombreproducto),(Object)(BA.numberCast(int.class, _cant_sem4)),(Object)(BA.numberCast(int.class, _cant_sem3)),(Object)(BA.numberCast(int.class, _cant_sem2)),(Object)(BA.numberCast(int.class, _cant_sem1)),(Object)(_promx),(Object)(_c1),(Object)(_c2),(Object)(_c3),(Object)(_c4)).getObject()),(Object)(RemoteObject.createImmutable((1))));
 }
}Debug.locals.put("sfdf", _sfdf);
;
 BA.debugLineNum = 228;BA.debugLine="prohit.Close ' Cerramos el cursor externo";
Debug.ShouldStop(8);
_prohit.runVoidMethod ("Close");
 };
 BA.debugLineNum = 235;BA.debugLine="End Sub";
Debug.ShouldStop(1024);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _b4xpage_created(RemoteObject __ref,RemoteObject _root1) throws Exception{
try {
		Debug.PushSubsStack("B4XPage_Created (c_historicobat) ","c_historicobat",19,__ref.getField(false, "ba"),__ref,44);
if (RapidSub.canDelegate("b4xpage_created")) { return __ref.runUserSub(false, "c_historicobat","b4xpage_created", __ref, _root1);}
Debug.locals.put("Root1", _root1);
 BA.debugLineNum = 44;BA.debugLine="Private Sub B4XPage_Created (Root1 As B4XView)";
Debug.ShouldStop(2048);
 BA.debugLineNum = 45;BA.debugLine="Root = Root1";
Debug.ShouldStop(4096);
__ref.setField ("_root" /*RemoteObject*/ ,_root1);
 BA.debugLineNum = 47;BA.debugLine="Root.LoadLayout(\"nota2\")";
Debug.ShouldStop(16384);
__ref.getField(false,"_root" /*RemoteObject*/ ).runVoidMethodAndSync ("LoadLayout",(Object)(RemoteObject.createImmutable("nota2")),__ref.getField(false, "ba"));
 BA.debugLineNum = 48;BA.debugLine="borra.Visible = False";
Debug.ShouldStop(32768);
__ref.getField(false,"_borra" /*RemoteObject*/ ).runMethod(true,"setVisible",c_historicobat.__c.getField(true,"False"));
 BA.debugLineNum = 49;BA.debugLine="Titulo.Text = \"Acumulado\"";
Debug.ShouldStop(65536);
__ref.getField(false,"_titulo" /*RemoteObject*/ ).runMethod(true,"setText",BA.ObjectToCharSequence("Acumulado"));
 BA.debugLineNum = 50;BA.debugLine="b_desc.Visible = False";
Debug.ShouldStop(131072);
__ref.getField(false,"_b_desc" /*RemoteObject*/ ).runMethod(true,"setVisible",c_historicobat.__c.getField(true,"False"));
 BA.debugLineNum = 51;BA.debugLine="End Sub";
Debug.ShouldStop(262144);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _class_globals(RemoteObject __ref) throws Exception{
 //BA.debugLineNum = 1;BA.debugLine="Sub Class_Globals";
 //BA.debugLineNum = 2;BA.debugLine="Private Root As B4XView 'ignore";
c_historicobat._root = RemoteObject.createNew ("anywheresoftware.b4a.objects.B4XViewWrapper");__ref.setField("_root",c_historicobat._root);
 //BA.debugLineNum = 3;BA.debugLine="Private xui As XUI 'ignore";
c_historicobat._xui = RemoteObject.createNew ("anywheresoftware.b4a.objects.B4XViewWrapper.XUI");__ref.setField("_xui",c_historicobat._xui);
 //BA.debugLineNum = 5;BA.debugLine="Dim g As GPS";
c_historicobat._g = RemoteObject.createNew ("anywheresoftware.b4a.gps.GPS");__ref.setField("_g",c_historicobat._g);
 //BA.debugLineNum = 6;BA.debugLine="Dim clie_id As String";
c_historicobat._clie_id = RemoteObject.createImmutable("");__ref.setField("_clie_id",c_historicobat._clie_id);
 //BA.debugLineNum = 7;BA.debugLine="Dim sDate,sTime As String";
c_historicobat._sdate = RemoteObject.createImmutable("");__ref.setField("_sdate",c_historicobat._sdate);
c_historicobat._stime = RemoteObject.createImmutable("");__ref.setField("_stime",c_historicobat._stime);
 //BA.debugLineNum = 8;BA.debugLine="Dim usuario As String";
c_historicobat._usuario = RemoteObject.createImmutable("");__ref.setField("_usuario",c_historicobat._usuario);
 //BA.debugLineNum = 10;BA.debugLine="Dim c As Cursor";
c_historicobat._c = RemoteObject.createNew ("anywheresoftware.b4a.sql.SQL.CursorWrapper");__ref.setField("_c",c_historicobat._c);
 //BA.debugLineNum = 11;BA.debugLine="Dim ruta As String";
c_historicobat._ruta = RemoteObject.createImmutable("");__ref.setField("_ruta",c_historicobat._ruta);
 //BA.debugLineNum = 12;BA.debugLine="Dim Regresar As Button";
c_historicobat._regresar = RemoteObject.createNew ("anywheresoftware.b4a.objects.ButtonWrapper");__ref.setField("_regresar",c_historicobat._regresar);
 //BA.debugLineNum = 15;BA.debugLine="Dim ListView1 As ListView";
c_historicobat._listview1 = RemoteObject.createNew ("anywheresoftware.b4a.objects.ListViewWrapper");__ref.setField("_listview1",c_historicobat._listview1);
 //BA.debugLineNum = 16;BA.debugLine="Dim L_CANT As Label";
c_historicobat._l_cant = RemoteObject.createNew ("anywheresoftware.b4a.objects.LabelWrapper");__ref.setField("_l_cant",c_historicobat._l_cant);
 //BA.debugLineNum = 17;BA.debugLine="Dim L_TOTAL As Label";
c_historicobat._l_total = RemoteObject.createNew ("anywheresoftware.b4a.objects.LabelWrapper");__ref.setField("_l_total",c_historicobat._l_total);
 //BA.debugLineNum = 18;BA.debugLine="Dim borra As Button";
c_historicobat._borra = RemoteObject.createNew ("anywheresoftware.b4a.objects.ButtonWrapper");__ref.setField("_borra",c_historicobat._borra);
 //BA.debugLineNum = 19;BA.debugLine="Dim Existe As String";
c_historicobat._existe = RemoteObject.createImmutable("");__ref.setField("_existe",c_historicobat._existe);
 //BA.debugLineNum = 20;BA.debugLine="Dim result As String";
c_historicobat._result = RemoteObject.createImmutable("");__ref.setField("_result",c_historicobat._result);
 //BA.debugLineNum = 23;BA.debugLine="Private Titulo As Label";
c_historicobat._titulo = RemoteObject.createNew ("anywheresoftware.b4a.objects.LabelWrapper");__ref.setField("_titulo",c_historicobat._titulo);
 //BA.debugLineNum = 24;BA.debugLine="Private b_desc As Button";
c_historicobat._b_desc = RemoteObject.createNew ("anywheresoftware.b4a.objects.ButtonWrapper");__ref.setField("_b_desc",c_historicobat._b_desc);
 //BA.debugLineNum = 25;BA.debugLine="Private ListView2 As ListView";
c_historicobat._listview2 = RemoteObject.createNew ("anywheresoftware.b4a.objects.ListViewWrapper");__ref.setField("_listview2",c_historicobat._listview2);
 //BA.debugLineNum = 26;BA.debugLine="Dim tgl As Toggle";
c_historicobat._tgl = RemoteObject.createNew ("com.rootsoft.togglelibrary.ToggleLibrary");__ref.setField("_tgl",c_historicobat._tgl);
 //BA.debugLineNum = 27;BA.debugLine="Private p_nota As Panel";
c_historicobat._p_nota = RemoteObject.createNew ("anywheresoftware.b4a.objects.PanelWrapper");__ref.setField("_p_nota",c_historicobat._p_nota);
 //BA.debugLineNum = 28;BA.debugLine="Private Panel1 As Panel";
c_historicobat._panel1 = RemoteObject.createNew ("anywheresoftware.b4a.objects.PanelWrapper");__ref.setField("_panel1",c_historicobat._panel1);
 //BA.debugLineNum = 29;BA.debugLine="Private l_productohist As Label";
c_historicobat._l_productohist = RemoteObject.createNew ("anywheresoftware.b4a.objects.LabelWrapper");__ref.setField("_l_productohist",c_historicobat._l_productohist);
 //BA.debugLineNum = 30;BA.debugLine="Private l_s1 As Label";
c_historicobat._l_s1 = RemoteObject.createNew ("anywheresoftware.b4a.objects.LabelWrapper");__ref.setField("_l_s1",c_historicobat._l_s1);
 //BA.debugLineNum = 31;BA.debugLine="Private l_s2 As Label";
c_historicobat._l_s2 = RemoteObject.createNew ("anywheresoftware.b4a.objects.LabelWrapper");__ref.setField("_l_s2",c_historicobat._l_s2);
 //BA.debugLineNum = 32;BA.debugLine="Private l_s3 As Label";
c_historicobat._l_s3 = RemoteObject.createNew ("anywheresoftware.b4a.objects.LabelWrapper");__ref.setField("_l_s3",c_historicobat._l_s3);
 //BA.debugLineNum = 33;BA.debugLine="Private l_s4 As Label";
c_historicobat._l_s4 = RemoteObject.createNew ("anywheresoftware.b4a.objects.LabelWrapper");__ref.setField("_l_s4",c_historicobat._l_s4);
 //BA.debugLineNum = 34;BA.debugLine="Private CustomListView1 As CustomListView";
c_historicobat._customlistview1 = RemoteObject.createNew ("b4a.example3.customlistview");__ref.setField("_customlistview1",c_historicobat._customlistview1);
 //BA.debugLineNum = 35;BA.debugLine="Private L_PROMEDIOHIST As Label";
c_historicobat._l_promediohist = RemoteObject.createNew ("anywheresoftware.b4a.objects.LabelWrapper");__ref.setField("_l_promediohist",c_historicobat._l_promediohist);
 //BA.debugLineNum = 36;BA.debugLine="End Sub";
return RemoteObject.createImmutable("");
}
public static RemoteObject  _createlistitem(RemoteObject __ref,RemoteObject _prodhis,RemoteObject _s1,RemoteObject _s2,RemoteObject _s3,RemoteObject _s4,RemoteObject _prom,RemoteObject _m1,RemoteObject _m2,RemoteObject _m3,RemoteObject _m4) throws Exception{
try {
		Debug.PushSubsStack("CreateListItem (c_historicobat) ","c_historicobat",19,__ref.getField(false, "ba"),__ref,253);
if (RapidSub.canDelegate("createlistitem")) { return __ref.runUserSub(false, "c_historicobat","createlistitem", __ref, _prodhis, _s1, _s2, _s3, _s4, _prom, _m1, _m2, _m3, _m4);}
RemoteObject _p = RemoteObject.declareNull("anywheresoftware.b4a.objects.B4XViewWrapper");
Debug.locals.put("prodhis", _prodhis);
Debug.locals.put("s1", _s1);
Debug.locals.put("s2", _s2);
Debug.locals.put("s3", _s3);
Debug.locals.put("s4", _s4);
Debug.locals.put("prom", _prom);
Debug.locals.put("m1", _m1);
Debug.locals.put("m2", _m2);
Debug.locals.put("m3", _m3);
Debug.locals.put("m4", _m4);
 BA.debugLineNum = 253;BA.debugLine="Sub CreateListItem(prodhis As String, s1 As Int, s";
Debug.ShouldStop(268435456);
 BA.debugLineNum = 254;BA.debugLine="Dim p As B4XView = xui.CreatePanel(\"\")";
Debug.ShouldStop(536870912);
_p = RemoteObject.createNew ("anywheresoftware.b4a.objects.B4XViewWrapper");
_p = __ref.getField(false,"_xui" /*RemoteObject*/ ).runMethod(false,"CreatePanel",__ref.getField(false, "ba"),(Object)(RemoteObject.createImmutable("")));Debug.locals.put("p", _p);Debug.locals.put("p", _p);
 BA.debugLineNum = 256;BA.debugLine="p.SetLayoutAnimated(0, 0, 0, 288dip, 170dip)";
Debug.ShouldStop(-2147483648);
_p.runVoidMethod ("SetLayoutAnimated",(Object)(BA.numberCast(int.class, 0)),(Object)(BA.numberCast(int.class, 0)),(Object)(BA.numberCast(int.class, 0)),(Object)(c_historicobat.__c.runMethod(true,"DipToCurrent",(Object)(BA.numberCast(int.class, 288)))),(Object)(c_historicobat.__c.runMethod(true,"DipToCurrent",(Object)(BA.numberCast(int.class, 170)))));
 BA.debugLineNum = 257;BA.debugLine="p.LoadLayout(\"historicobat\")";
Debug.ShouldStop(1);
_p.runVoidMethodAndSync ("LoadLayout",(Object)(RemoteObject.createImmutable("historicobat")),__ref.getField(false, "ba"));
 BA.debugLineNum = 259;BA.debugLine="l_productohist.Text = prodhis";
Debug.ShouldStop(4);
__ref.getField(false,"_l_productohist" /*RemoteObject*/ ).runMethod(true,"setText",BA.ObjectToCharSequence(_prodhis));
 BA.debugLineNum = 260;BA.debugLine="l_s1.Text = s1";
Debug.ShouldStop(8);
__ref.getField(false,"_l_s1" /*RemoteObject*/ ).runMethod(true,"setText",BA.ObjectToCharSequence(_s1));
 BA.debugLineNum = 261;BA.debugLine="l_s2.Text = s2";
Debug.ShouldStop(16);
__ref.getField(false,"_l_s2" /*RemoteObject*/ ).runMethod(true,"setText",BA.ObjectToCharSequence(_s2));
 BA.debugLineNum = 262;BA.debugLine="l_s3.Text = s3";
Debug.ShouldStop(32);
__ref.getField(false,"_l_s3" /*RemoteObject*/ ).runMethod(true,"setText",BA.ObjectToCharSequence(_s3));
 BA.debugLineNum = 263;BA.debugLine="l_s4.Text = s4";
Debug.ShouldStop(64);
__ref.getField(false,"_l_s4" /*RemoteObject*/ ).runMethod(true,"setText",BA.ObjectToCharSequence(_s4));
 BA.debugLineNum = 267;BA.debugLine="l_s1.Color = IIf(m1 = 1, xui.Color_Blue, xui.Colo";
Debug.ShouldStop(1024);
__ref.getField(false,"_l_s1" /*RemoteObject*/ ).runVoidMethod ("setColor",BA.numberCast(int.class, ((RemoteObject.solveBoolean("=",_m1,BA.numberCast(double.class, 1))) ? ((__ref.getField(false,"_xui" /*RemoteObject*/ ).getField(true,"Color_Blue"))) : ((__ref.getField(false,"_xui" /*RemoteObject*/ ).getField(true,"Color_Yellow"))))));
 BA.debugLineNum = 268;BA.debugLine="l_s2.Color = IIf(m2 = 1, xui.Color_Blue, xui.Colo";
Debug.ShouldStop(2048);
__ref.getField(false,"_l_s2" /*RemoteObject*/ ).runVoidMethod ("setColor",BA.numberCast(int.class, ((RemoteObject.solveBoolean("=",_m2,BA.numberCast(double.class, 1))) ? ((__ref.getField(false,"_xui" /*RemoteObject*/ ).getField(true,"Color_Blue"))) : ((__ref.getField(false,"_xui" /*RemoteObject*/ ).getField(true,"Color_Yellow"))))));
 BA.debugLineNum = 269;BA.debugLine="l_s3.Color = IIf(m3 = 1, xui.Color_Blue, xui.Colo";
Debug.ShouldStop(4096);
__ref.getField(false,"_l_s3" /*RemoteObject*/ ).runVoidMethod ("setColor",BA.numberCast(int.class, ((RemoteObject.solveBoolean("=",_m3,BA.numberCast(double.class, 1))) ? ((__ref.getField(false,"_xui" /*RemoteObject*/ ).getField(true,"Color_Blue"))) : ((__ref.getField(false,"_xui" /*RemoteObject*/ ).getField(true,"Color_Yellow"))))));
 BA.debugLineNum = 270;BA.debugLine="l_s4.Color = IIf(m4 = 1, xui.Color_Blue, xui.Colo";
Debug.ShouldStop(8192);
__ref.getField(false,"_l_s4" /*RemoteObject*/ ).runVoidMethod ("setColor",BA.numberCast(int.class, ((RemoteObject.solveBoolean("=",_m4,BA.numberCast(double.class, 1))) ? ((__ref.getField(false,"_xui" /*RemoteObject*/ ).getField(true,"Color_Blue"))) : ((__ref.getField(false,"_xui" /*RemoteObject*/ ).getField(true,"Color_Yellow"))))));
 BA.debugLineNum = 273;BA.debugLine="l_s1.TextColor = IIf(m1 = 1, xui.Color_White, xui";
Debug.ShouldStop(65536);
__ref.getField(false,"_l_s1" /*RemoteObject*/ ).runMethod(true,"setTextColor",BA.numberCast(int.class, ((RemoteObject.solveBoolean("=",_m1,BA.numberCast(double.class, 1))) ? ((__ref.getField(false,"_xui" /*RemoteObject*/ ).getField(true,"Color_White"))) : ((__ref.getField(false,"_xui" /*RemoteObject*/ ).getField(true,"Color_Black"))))));
 BA.debugLineNum = 274;BA.debugLine="l_s2.TextColor = IIf(m2 = 1, xui.Color_White, xui";
Debug.ShouldStop(131072);
__ref.getField(false,"_l_s2" /*RemoteObject*/ ).runMethod(true,"setTextColor",BA.numberCast(int.class, ((RemoteObject.solveBoolean("=",_m2,BA.numberCast(double.class, 1))) ? ((__ref.getField(false,"_xui" /*RemoteObject*/ ).getField(true,"Color_White"))) : ((__ref.getField(false,"_xui" /*RemoteObject*/ ).getField(true,"Color_Black"))))));
 BA.debugLineNum = 275;BA.debugLine="l_s3.TextColor = IIf(m3 = 1, xui.Color_White, xui";
Debug.ShouldStop(262144);
__ref.getField(false,"_l_s3" /*RemoteObject*/ ).runMethod(true,"setTextColor",BA.numberCast(int.class, ((RemoteObject.solveBoolean("=",_m3,BA.numberCast(double.class, 1))) ? ((__ref.getField(false,"_xui" /*RemoteObject*/ ).getField(true,"Color_White"))) : ((__ref.getField(false,"_xui" /*RemoteObject*/ ).getField(true,"Color_Black"))))));
 BA.debugLineNum = 276;BA.debugLine="l_s4.TextColor = IIf(m4 = 1, xui.Color_White, xui";
Debug.ShouldStop(524288);
__ref.getField(false,"_l_s4" /*RemoteObject*/ ).runMethod(true,"setTextColor",BA.numberCast(int.class, ((RemoteObject.solveBoolean("=",_m4,BA.numberCast(double.class, 1))) ? ((__ref.getField(false,"_xui" /*RemoteObject*/ ).getField(true,"Color_White"))) : ((__ref.getField(false,"_xui" /*RemoteObject*/ ).getField(true,"Color_Black"))))));
 BA.debugLineNum = 278;BA.debugLine="L_PROMEDIOHIST.Text = \"Promedio \" & NumberFormat(";
Debug.ShouldStop(2097152);
__ref.getField(false,"_l_promediohist" /*RemoteObject*/ ).runMethod(true,"setText",BA.ObjectToCharSequence(RemoteObject.concat(RemoteObject.createImmutable("Promedio "),c_historicobat.__c.runMethod(true,"NumberFormat",(Object)(_prom),(Object)(BA.numberCast(int.class, 1)),(Object)(BA.numberCast(int.class, 2))))));
 BA.debugLineNum = 280;BA.debugLine="Return p";
Debug.ShouldStop(8388608);
if (true) return RemoteObject.declareNull("anywheresoftware.b4a.AbsObjectWrapper").runMethod(false, "ConvertToWrapper", RemoteObject.createNew("anywheresoftware.b4a.objects.PanelWrapper"), _p.getObject());
 BA.debugLineNum = 281;BA.debugLine="End Sub";
Debug.ShouldStop(16777216);
return RemoteObject.createImmutable(null);
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _initialize(RemoteObject __ref,RemoteObject _ba) throws Exception{
try {
		Debug.PushSubsStack("Initialize (c_historicobat) ","c_historicobat",19,__ref.getField(false, "ba"),__ref,39);
if (RapidSub.canDelegate("initialize")) { return __ref.runUserSub(false, "c_historicobat","initialize", __ref, _ba);}
__ref.runVoidMethodAndSync("innerInitializeHelper", _ba);
Debug.locals.put("ba", _ba);
 BA.debugLineNum = 39;BA.debugLine="Public Sub Initialize As Object";
Debug.ShouldStop(64);
 BA.debugLineNum = 40;BA.debugLine="Return Me";
Debug.ShouldStop(128);
if (true) return __ref;
 BA.debugLineNum = 41;BA.debugLine="End Sub";
Debug.ShouldStop(256);
return RemoteObject.createImmutable(null);
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
}