package gunav2.keymon.com.mx;


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

public class c_ticketsdia extends B4AClass.ImplB4AClass implements BA.SubDelegator{
    private static java.util.HashMap<String, java.lang.reflect.Method> htSubs;
    private void innerInitialize(BA _ba) throws Exception {
        if (ba == null) {
            ba = new BA(_ba, this, htSubs, "gunav2.keymon.com.mx.c_ticketsdia");
            if (htSubs == null) {
                ba.loadHtSubs(this.getClass());
                htSubs = ba.htSubs;
            }
            
        }
        if (BA.isShellModeRuntimeCheck(ba)) 
			   this.getClass().getMethod("_class_globals", gunav2.keymon.com.mx.c_ticketsdia.class).invoke(this, new Object[] {null});
        else
            ba.raiseEvent2(null, true, "class_globals", false);
    }

 public anywheresoftware.b4a.keywords.Common __c = null;
public anywheresoftware.b4a.objects.B4XViewWrapper _root = null;
public anywheresoftware.b4a.objects.B4XViewWrapper.XUI _xui = null;
public anywheresoftware.b4a.objects.PanelWrapper _p_ticketsdia = null;
public anywheresoftware.b4a.sql.SQL.CursorWrapper _c = null;
public anywheresoftware.b4a.sql.SQL.CursorWrapper _s = null;
public String _ruta = "";
public anywheresoftware.b4a.objects.ListViewWrapper _listview1 = null;
public anywheresoftware.b4a.objects.ButtonWrapper _b_noventa = null;
public String _nombre_boton = "";
public String _stime = "";
public anywheresoftware.b4a.objects.LabelWrapper _l_ventanoventa = null;
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.subs _subs = null;
public gunav2.keymon.com.mx.mapa_rutas _mapa_rutas = null;
public gunav2.keymon.com.mx.appupdater _appupdater = null;
public gunav2.keymon.com.mx.firebasemessaging _firebasemessaging = null;
public gunav2.keymon.com.mx.tracker _tracker = 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 boolean  _activity_keypress(int _key) throws Exception{
 //BA.debugLineNum = 135;BA.debugLine="Sub Activity_KeyPress (key As Int) As Boolean";
 //BA.debugLineNum = 137;BA.debugLine="If key=KeyCodes.KEYCODE_BACK Then";
if (_key==__c.KeyCodes.KEYCODE_BACK) { 
 //BA.debugLineNum = 139;BA.debugLine="B4XPages.ShowPage(\"principal\")";
_b4xpages._showpage /*String*/ (ba,"principal");
 };
 //BA.debugLineNum = 143;BA.debugLine="Return False";
if (true) return __c.False;
 //BA.debugLineNum = 144;BA.debugLine="End Sub";
return false;
}
public String  _b_noventa_click() throws Exception{
int _i = 0;
anywheresoftware.b4a.objects.LabelWrapper _label1 = null;
anywheresoftware.b4a.objects.LabelWrapper _label2 = null;
anywheresoftware.b4a.sql.SQL.CursorWrapper _s3 = null;
anywheresoftware.b4a.sql.SQL.CursorWrapper _s5 = null;
 //BA.debugLineNum = 162;BA.debugLine="Sub b_noventa_Click";
 //BA.debugLineNum = 163;BA.debugLine="If nombre_boton = \"NOVENTA\" Then";
if ((_nombre_boton).equals("NOVENTA")) { 
 //BA.debugLineNum = 164;BA.debugLine="nombre_boton = \"VENTA\"";
_nombre_boton = "VENTA";
 //BA.debugLineNum = 165;BA.debugLine="b_noventa.Text =\"VENTA\"";
_b_noventa.setText(BA.ObjectToCharSequence("VENTA"));
 //BA.debugLineNum = 166;BA.debugLine="L_ventanoventa.Text = \"Clientes sin venta\"";
_l_ventanoventa.setText(BA.ObjectToCharSequence("Clientes sin venta"));
 //BA.debugLineNum = 167;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"select NV_CL";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select NV_CLIENTE,NV_MOTIVO,NV_COMM, (select CAT_CL_NOMBRE from kmt_info3 where cat_cl_codigo = NV_CLIENTE ) as NOMBRE FROM NOVENTA ORDER BY NV_CLIENTE asc")));
 //BA.debugLineNum = 168;BA.debugLine="ListView1.Clear";
_listview1.Clear();
 //BA.debugLineNum = 169;BA.debugLine="If c.RowCount>0 Then";
if (_c.getRowCount()>0) { 
 //BA.debugLineNum = 170;BA.debugLine="For i=0 To c.RowCount -1";
{
final int step8 = 1;
final int limit8 = (int) (_c.getRowCount()-1);
_i = (int) (0) ;
for (;_i <= limit8 ;_i = _i + step8 ) {
 //BA.debugLineNum = 171;BA.debugLine="c.Position=i";
_c.setPosition(_i);
 //BA.debugLineNum = 172;BA.debugLine="Dim label1 As Label";
_label1 = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 173;BA.debugLine="label1 = ListView1.TwoLinesLayout.Label";
_label1 = _listview1.getTwoLinesLayout().Label;
 //BA.debugLineNum = 174;BA.debugLine="label1.TextSize = 15";
_label1.setTextSize((float) (15));
 //BA.debugLineNum = 175;BA.debugLine="label1.TextColor = Colors.Black";
_label1.setTextColor(__c.Colors.Black);
 //BA.debugLineNum = 176;BA.debugLine="Dim label2 As Label";
_label2 = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 177;BA.debugLine="label2 = ListView1.TwoLinesLayout.SecondLabel";
_label2 = _listview1.getTwoLinesLayout().SecondLabel;
 //BA.debugLineNum = 178;BA.debugLine="label2.TextSize = 10";
_label2.setTextSize((float) (10));
 //BA.debugLineNum = 179;BA.debugLine="label2.TextColor = Colors.Blue";
_label2.setTextColor(__c.Colors.Blue);
 //BA.debugLineNum = 180;BA.debugLine="ListView1.AddTwoLines(c.GetString(\"NV_CLIENTE\"";
_listview1.AddTwoLines(BA.ObjectToCharSequence(_c.GetString("NV_CLIENTE")),BA.ObjectToCharSequence(_c.GetString("NOMBRE")+"  Motivo #"+_c.GetString("NV_MOTIVO")+" Comentario $"+_c.GetString("NV_COMM")));
 }
};
 };
 }else {
 //BA.debugLineNum = 184;BA.debugLine="nombre_boton = \"NOVENTA\"";
_nombre_boton = "NOVENTA";
 //BA.debugLineNum = 185;BA.debugLine="b_noventa.Text =\"NO VENTA\"";
_b_noventa.setText(BA.ObjectToCharSequence("NO VENTA"));
 //BA.debugLineNum = 186;BA.debugLine="L_ventanoventa.Text = \"Clientes con venta\"";
_l_ventanoventa.setText(BA.ObjectToCharSequence("Clientes con venta"));
 //BA.debugLineNum = 187;BA.debugLine="ListView1.Clear";
_listview1.Clear();
 //BA.debugLineNum = 188;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"select PC_CL";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select PC_CLIENTE,PC_MONTO,PC_NOART,(select CAT_CL_NOMBRE from kmt_info3 where cat_cl_codigo = pc_cliente ) as NOMBRE FROM PEDIDO_CLIENTE ORDER BY PC_FECHA asc")));
 //BA.debugLineNum = 191;BA.debugLine="ListView1.Clear";
_listview1.Clear();
 //BA.debugLineNum = 192;BA.debugLine="If c.RowCount>0 Then";
if (_c.getRowCount()>0) { 
 //BA.debugLineNum = 193;BA.debugLine="For i=0 To c.RowCount -1";
{
final int step29 = 1;
final int limit29 = (int) (_c.getRowCount()-1);
_i = (int) (0) ;
for (;_i <= limit29 ;_i = _i + step29 ) {
 //BA.debugLineNum = 194;BA.debugLine="c.Position=i";
_c.setPosition(_i);
 //BA.debugLineNum = 195;BA.debugLine="Log(C.GetString(\"PC_CLIENTE\"))";
__c.LogImpl("444302369",_c.GetString("PC_CLIENTE"),0);
 //BA.debugLineNum = 196;BA.debugLine="Private s3 As Cursor=B4XPages.MainPage.skmt.Ex";
_s3 = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_s3 = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery2("select * FROM PEDIDO WHERE PE_CLIENTE = ? and PE_RECALCULO <> ? OR PE_RECALCULO <> ? OR PE_RECALCULO IS NOT NULL",new String[]{_c.GetString("PC_CLIENTE"),"","null"})));
 //BA.debugLineNum = 197;BA.debugLine="LogColor(s3.RowCount,Colors.Yellow)";
__c.LogImpl("444302371",BA.NumberToString(_s3.getRowCount()),__c.Colors.Yellow);
 //BA.debugLineNum = 198;BA.debugLine="If s3.RowCount > 0 Then";
if (_s3.getRowCount()>0) { 
 //BA.debugLineNum = 199;BA.debugLine="Private s As Cursor=B4XPages.MainPage.skmt.Ex";
_s = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_s = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery2("select iFNULL(sum(pe_costo_tot),0) as TOTAL_CLIE, IFNULL(SUM(PE_CANT),0) AS CANT_CLIE FROM PEDIDO WHERE PE_CLIENTE = ? and (PE_RECALCULO = ? or PE_RECALCULO = ? or PE_RECALCULO IS NULL ) AND PE_PROID NOT IN (SELECT CAT_PA_ID FROM PROMOS_COMP)",new String[]{_c.GetString("PC_CLIENTE"),"","null"})));
 //BA.debugLineNum = 200;BA.debugLine="s.Position=0";
_s.setPosition((int) (0));
 //BA.debugLineNum = 201;BA.debugLine="Private s5 As Cursor = B4XPages.MainPage.skmt";
_s5 = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_s5 = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery2("select iFNULL(sum(PE_RECALCULOTOT),0) as TOTAL_CLIE, IFNULL(SUM(PE_CANT),0) AS CANT_CLIE FROM PEDIDO WHERE PE_CLIENTE = ? and (PE_RECALCULO <> ? or PE_RECALCULO <> ? OR PE_RECALCULO IS NOT NULL) AND PE_PROID NOT IN (SELECT CAT_PA_ID FROM PROMOS_COMP)",new String[]{_c.GetString("PC_CLIENTE"),"","null"})));
 //BA.debugLineNum = 202;BA.debugLine="s5.Position = 0";
_s5.setPosition((int) (0));
 //BA.debugLineNum = 203;BA.debugLine="Dim label1 As Label";
_label1 = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 204;BA.debugLine="label1 = ListView1.TwoLinesLayout.Label";
_label1 = _listview1.getTwoLinesLayout().Label;
 //BA.debugLineNum = 205;BA.debugLine="label1.TextSize = 20";
_label1.setTextSize((float) (20));
 //BA.debugLineNum = 206;BA.debugLine="label1.TextColor = Colors.White";
_label1.setTextColor(__c.Colors.White);
 //BA.debugLineNum = 207;BA.debugLine="Dim label2 As Label";
_label2 = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 208;BA.debugLine="label2 = ListView1.TwoLinesLayout.SecondLabel";
_label2 = _listview1.getTwoLinesLayout().SecondLabel;
 //BA.debugLineNum = 209;BA.debugLine="label2.TextSize = 20";
_label2.setTextSize((float) (20));
 //BA.debugLineNum = 210;BA.debugLine="label2.TextColor = Colors.White";
_label2.setTextColor(__c.Colors.White);
 //BA.debugLineNum = 211;BA.debugLine="label1.Height = 25dip";
_label1.setHeight(__c.DipToCurrent((int) (25)));
 //BA.debugLineNum = 212;BA.debugLine="label2.Height = 60dip";
_label2.setHeight(__c.DipToCurrent((int) (60)));
 //BA.debugLineNum = 214;BA.debugLine="ListView1.TwoLinesLayout.ItemHeight = 95dip";
_listview1.getTwoLinesLayout().setItemHeight(__c.DipToCurrent((int) (95)));
 //BA.debugLineNum = 215;BA.debugLine="label1.Typeface = Typeface.CreateNew(Typeface";
_label1.setTypeface(__c.Typeface.CreateNew(__c.Typeface.DEFAULT_BOLD,__c.Typeface.STYLE_BOLD));
 //BA.debugLineNum = 216;BA.debugLine="label2.Typeface = Typeface.CreateNew(Typeface";
_label2.setTypeface(__c.Typeface.CreateNew(__c.Typeface.DEFAULT_BOLD,__c.Typeface.STYLE_BOLD));
 //BA.debugLineNum = 218;BA.debugLine="ListView1.AddTwoLines(c.GetString(\"PC_CLIENTE";
_listview1.AddTwoLines(BA.ObjectToCharSequence(_c.GetString("PC_CLIENTE")),BA.ObjectToCharSequence(_c.GetString("NOMBRE")+"   Cantidad #"+BA.NumberToString(((double)(Double.parseDouble(_s.GetString("CANT_CLIE")))+(double)(Double.parseDouble(_s5.GetString("CANT_CLIE")))))+" SubTotal $"+_subs._calculatotalconpromoxrango /*String*/ (ba,_c.GetString("PC_CLIENTE"))));
 //BA.debugLineNum = 219;BA.debugLine="s.Close";
_s.Close();
 }else if(_s3.getRowCount()==0) { 
 //BA.debugLineNum = 221;BA.debugLine="Log(s3.RowCount)";
__c.LogImpl("444302395",BA.NumberToString(_s3.getRowCount()),0);
 //BA.debugLineNum = 222;BA.debugLine="Private s As Cursor=B4XPages.MainPage.skmt.Ex";
_s = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_s = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery2("select iFNULL(sum(pe_costo_tot),0) as TOTAL_CLIE, SUM(PE_CANT) AS CANT_CLIE FROM PEDIDO WHERE PE_CLIENTE = ?",new String[]{_c.GetString("PC_CLIENTE")})));
 //BA.debugLineNum = 223;BA.debugLine="s.Position=0";
_s.setPosition((int) (0));
 //BA.debugLineNum = 225;BA.debugLine="Dim label1 As Label";
_label1 = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 226;BA.debugLine="label1 = ListView1.TwoLinesLayout.Label";
_label1 = _listview1.getTwoLinesLayout().Label;
 //BA.debugLineNum = 227;BA.debugLine="label1.TextSize = 20";
_label1.setTextSize((float) (20));
 //BA.debugLineNum = 228;BA.debugLine="label1.TextColor = Colors.White";
_label1.setTextColor(__c.Colors.White);
 //BA.debugLineNum = 229;BA.debugLine="Dim label2 As Label";
_label2 = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 230;BA.debugLine="label2 = ListView1.TwoLinesLayout.SecondLabel";
_label2 = _listview1.getTwoLinesLayout().SecondLabel;
 //BA.debugLineNum = 231;BA.debugLine="label2.TextSize = 20";
_label2.setTextSize((float) (20));
 //BA.debugLineNum = 232;BA.debugLine="label2.TextColor = Colors.White";
_label2.setTextColor(__c.Colors.White);
 //BA.debugLineNum = 233;BA.debugLine="label1.Height = 25dip";
_label1.setHeight(__c.DipToCurrent((int) (25)));
 //BA.debugLineNum = 234;BA.debugLine="label2.Height = 60dip";
_label2.setHeight(__c.DipToCurrent((int) (60)));
 //BA.debugLineNum = 236;BA.debugLine="ListView1.TwoLinesLayout.ItemHeight = 95dip";
_listview1.getTwoLinesLayout().setItemHeight(__c.DipToCurrent((int) (95)));
 //BA.debugLineNum = 237;BA.debugLine="label1.Typeface = Typeface.CreateNew(Typeface";
_label1.setTypeface(__c.Typeface.CreateNew(__c.Typeface.DEFAULT_BOLD,__c.Typeface.STYLE_BOLD));
 //BA.debugLineNum = 238;BA.debugLine="label2.Typeface = Typeface.CreateNew(Typeface";
_label2.setTypeface(__c.Typeface.CreateNew(__c.Typeface.DEFAULT_BOLD,__c.Typeface.STYLE_BOLD));
 //BA.debugLineNum = 239;BA.debugLine="Log(c.GetString(\"PC_CLIENTE\"))";
__c.LogImpl("444302413",_c.GetString("PC_CLIENTE"),0);
 //BA.debugLineNum = 240;BA.debugLine="Log(c.GetString(\"NOMBRE\"))";
__c.LogImpl("444302414",_c.GetString("NOMBRE"),0);
 //BA.debugLineNum = 241;BA.debugLine="Log(s.GetString(\"CANT_CLIE\"))";
__c.LogImpl("444302415",_s.GetString("CANT_CLIE"),0);
 //BA.debugLineNum = 242;BA.debugLine="Log(c.GetString(\"PC_CLIENTE\"))";
__c.LogImpl("444302416",_c.GetString("PC_CLIENTE"),0);
 //BA.debugLineNum = 243;BA.debugLine="ListView1.AddTwoLines(c.GetString(\"PC_CLIENTE";
_listview1.AddTwoLines(BA.ObjectToCharSequence(_c.GetString("PC_CLIENTE")),BA.ObjectToCharSequence(_c.GetString("NOMBRE")+"   Cantidad #"+_s.GetString("CANT_CLIE")+" SubTotal $"+_subs._calculatotalconpromoxrango /*String*/ (ba,_c.GetString("PC_CLIENTE"))));
 //BA.debugLineNum = 244;BA.debugLine="s.Close";
_s.Close();
 };
 }
};
 };
 //BA.debugLineNum = 249;BA.debugLine="c.Close";
_c.Close();
 };
 //BA.debugLineNum = 251;BA.debugLine="End Sub";
return "";
}
public String  _b4xpage_appear() throws Exception{
int _i = 0;
anywheresoftware.b4a.sql.SQL.CursorWrapper _s3 = null;
anywheresoftware.b4a.sql.SQL.CursorWrapper _s5 = null;
anywheresoftware.b4a.objects.LabelWrapper _label1 = null;
anywheresoftware.b4a.objects.LabelWrapper _label2 = null;
 //BA.debugLineNum = 58;BA.debugLine="Sub B4XPage_Appear";
 //BA.debugLineNum = 59;BA.debugLine="nombre_boton = \"NOVENTA\"";
_nombre_boton = "NOVENTA";
 //BA.debugLineNum = 60;BA.debugLine="L_ventanoventa.Text = \"Clientes con venta\"";
_l_ventanoventa.setText(BA.ObjectToCharSequence("Clientes con venta"));
 //BA.debugLineNum = 61;BA.debugLine="ListView1.Clear";
_listview1.Clear();
 //BA.debugLineNum = 62;BA.debugLine="ListView1.Height = Root.Height * 0.70";
_listview1.setHeight((int) (_root.getHeight()*0.70));
 //BA.debugLineNum = 63;BA.debugLine="p_ticketsdia.Height = Root.Height * 0.80";
_p_ticketsdia.setHeight((int) (_root.getHeight()*0.80));
 //BA.debugLineNum = 64;BA.debugLine="p_ticketsdia.Width = Root.Width * 0.90";
_p_ticketsdia.setWidth((int) (_root.getWidth()*0.90));
 //BA.debugLineNum = 66;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"select PC_CLI";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select PC_CLIENTE,PC_MONTO,PC_NOART,(select CAT_CL_NOMBRE from kmt_info3 where cat_cl_codigo = pc_cliente ) as NOMBRE FROM PEDIDO_CLIENTE ORDER BY PC_FECHA asc")));
 //BA.debugLineNum = 69;BA.debugLine="ListView1.Clear";
_listview1.Clear();
 //BA.debugLineNum = 70;BA.debugLine="If c.RowCount>0 Then";
if (_c.getRowCount()>0) { 
 //BA.debugLineNum = 71;BA.debugLine="For i=0 To c.RowCount -1";
{
final int step10 = 1;
final int limit10 = (int) (_c.getRowCount()-1);
_i = (int) (0) ;
for (;_i <= limit10 ;_i = _i + step10 ) {
 //BA.debugLineNum = 72;BA.debugLine="c.Position=i";
_c.setPosition(_i);
 //BA.debugLineNum = 75;BA.debugLine="Private s3 As Cursor=B4XPages.MainPage.skmt.Exe";
_s3 = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_s3 = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery2("select * FROM PEDIDO WHERE PE_CLIENTE = ? and PE_RECALCULO <> ? OR PE_RECALCULO <> ? OR PE_RECALCULO IS NOT NULL",new String[]{_c.GetString("PC_CLIENTE"),"","null"})));
 //BA.debugLineNum = 76;BA.debugLine="LogColor(s3.RowCount,Colors.Yellow)";
__c.LogImpl("444040210",BA.NumberToString(_s3.getRowCount()),__c.Colors.Yellow);
 //BA.debugLineNum = 77;BA.debugLine="If s3.RowCount > 0 Then";
if (_s3.getRowCount()>0) { 
 //BA.debugLineNum = 79;BA.debugLine="Private s As Cursor=B4XPages.MainPage.skmt.Exe";
_s = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_s = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery2("select iFNULL(sum(pe_costo_tot),0) as TOTAL_CLIE, IFNULL(SUM(PE_CANT),0) AS CANT_CLIE FROM PEDIDO WHERE PE_CLIENTE = ? and (PE_RECALCULO = ? or PE_RECALCULO = ? or PE_RECALCULO IS NULL ) AND PE_PROID NOT IN (SELECT CAT_PA_ID FROM PROMOS_COMP)",new String[]{_c.GetString("PC_CLIENTE"),"","null"})));
 //BA.debugLineNum = 80;BA.debugLine="s.Position=0";
_s.setPosition((int) (0));
 //BA.debugLineNum = 81;BA.debugLine="Private s5 As Cursor = B4XPages.MainPage.skmt.";
_s5 = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_s5 = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery2("select iFNULL(sum(PE_RECALCULOTOT),0) as TOTAL_CLIE,  IFNULL(SUM(PE_CANT),0) AS CANT_CLIE FROM PEDIDO WHERE PE_CLIENTE = ? and (PE_RECALCULO <> ? or PE_RECALCULO <> ? OR PE_RECALCULO IS NOT NULL) AND PE_PROID NOT IN (SELECT CAT_PA_ID FROM PROMOS_COMP)",new String[]{_c.GetString("PC_CLIENTE"),"","null"})));
 //BA.debugLineNum = 82;BA.debugLine="s5.Position = 0";
_s5.setPosition((int) (0));
 //BA.debugLineNum = 87;BA.debugLine="Dim label1 As Label";
_label1 = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 88;BA.debugLine="label1 = ListView1.TwoLinesLayout.Label";
_label1 = _listview1.getTwoLinesLayout().Label;
 //BA.debugLineNum = 89;BA.debugLine="label1.TextSize = 20";
_label1.setTextSize((float) (20));
 //BA.debugLineNum = 90;BA.debugLine="label1.TextColor = Colors.White";
_label1.setTextColor(__c.Colors.White);
 //BA.debugLineNum = 91;BA.debugLine="Dim label2 As Label";
_label2 = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 92;BA.debugLine="label2 = ListView1.TwoLinesLayout.SecondLabel";
_label2 = _listview1.getTwoLinesLayout().SecondLabel;
 //BA.debugLineNum = 93;BA.debugLine="label2.TextSize = 20";
_label2.setTextSize((float) (20));
 //BA.debugLineNum = 94;BA.debugLine="label2.TextColor = Colors.White";
_label2.setTextColor(__c.Colors.White);
 //BA.debugLineNum = 95;BA.debugLine="label1.Height = 25dip";
_label1.setHeight(__c.DipToCurrent((int) (25)));
 //BA.debugLineNum = 96;BA.debugLine="label2.Height = 60dip";
_label2.setHeight(__c.DipToCurrent((int) (60)));
 //BA.debugLineNum = 98;BA.debugLine="ListView1.TwoLinesLayout.ItemHeight = 95dip";
_listview1.getTwoLinesLayout().setItemHeight(__c.DipToCurrent((int) (95)));
 //BA.debugLineNum = 99;BA.debugLine="label1.Typeface = Typeface.CreateNew(Typeface.";
_label1.setTypeface(__c.Typeface.CreateNew(__c.Typeface.DEFAULT_BOLD,__c.Typeface.STYLE_BOLD));
 //BA.debugLineNum = 100;BA.debugLine="label2.Typeface = Typeface.CreateNew(Typeface.";
_label2.setTypeface(__c.Typeface.CreateNew(__c.Typeface.DEFAULT_BOLD,__c.Typeface.STYLE_BOLD));
 //BA.debugLineNum = 101;BA.debugLine="Log(1)";
__c.LogImpl("444040235",BA.NumberToString(1),0);
 //BA.debugLineNum = 103;BA.debugLine="ListView1.AddTwoLines(c.GetString(\"PC_CLIENTE\"";
_listview1.AddTwoLines(BA.ObjectToCharSequence(_c.GetString("PC_CLIENTE")),BA.ObjectToCharSequence(_c.GetString("NOMBRE")+"   Cantidad #"+BA.NumberToString(((double)(Double.parseDouble(_s.GetString("CANT_CLIE")))+(double)(Double.parseDouble(_s5.GetString("CANT_CLIE")))))+" SubTotal $"+_subs._calculatotalconpromoxrango /*String*/ (ba,_c.GetString("PC_CLIENTE"))));
 //BA.debugLineNum = 104;BA.debugLine="s.Close";
_s.Close();
 }else if(_s3.getRowCount()==0) { 
 //BA.debugLineNum = 106;BA.debugLine="Private s As Cursor=B4XPages.MainPage.skmt.Exe";
_s = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_s = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery2("select iFNULL(sum(pe_costo_tot),0) as TOTAL_CLIE, SUM(PE_CANT) AS CANT_CLIE FROM PEDIDO WHERE PE_CLIENTE = ?",new String[]{_c.GetString("PC_CLIENTE")})));
 //BA.debugLineNum = 107;BA.debugLine="s.Position=0";
_s.setPosition((int) (0));
 //BA.debugLineNum = 109;BA.debugLine="Dim label1 As Label";
_label1 = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 110;BA.debugLine="label1 = ListView1.TwoLinesLayout.Label";
_label1 = _listview1.getTwoLinesLayout().Label;
 //BA.debugLineNum = 111;BA.debugLine="label1.TextSize = 20";
_label1.setTextSize((float) (20));
 //BA.debugLineNum = 112;BA.debugLine="label1.TextColor = Colors.White";
_label1.setTextColor(__c.Colors.White);
 //BA.debugLineNum = 113;BA.debugLine="Dim label2 As Label";
_label2 = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 114;BA.debugLine="label2 = ListView1.TwoLinesLayout.SecondLabel";
_label2 = _listview1.getTwoLinesLayout().SecondLabel;
 //BA.debugLineNum = 115;BA.debugLine="label2.TextSize = 20";
_label2.setTextSize((float) (20));
 //BA.debugLineNum = 116;BA.debugLine="label2.TextColor = Colors.White";
_label2.setTextColor(__c.Colors.White);
 //BA.debugLineNum = 117;BA.debugLine="label1.Height = 25dip";
_label1.setHeight(__c.DipToCurrent((int) (25)));
 //BA.debugLineNum = 118;BA.debugLine="label2.Height = 60dip";
_label2.setHeight(__c.DipToCurrent((int) (60)));
 //BA.debugLineNum = 120;BA.debugLine="ListView1.TwoLinesLayout.ItemHeight = 95dip";
_listview1.getTwoLinesLayout().setItemHeight(__c.DipToCurrent((int) (95)));
 //BA.debugLineNum = 121;BA.debugLine="label1.Typeface = Typeface.CreateNew(Typeface.";
_label1.setTypeface(__c.Typeface.CreateNew(__c.Typeface.DEFAULT_BOLD,__c.Typeface.STYLE_BOLD));
 //BA.debugLineNum = 122;BA.debugLine="label2.Typeface = Typeface.CreateNew(Typeface.";
_label2.setTypeface(__c.Typeface.CreateNew(__c.Typeface.DEFAULT_BOLD,__c.Typeface.STYLE_BOLD));
 //BA.debugLineNum = 123;BA.debugLine="Log(2)";
__c.LogImpl("444040257",BA.NumberToString(2),0);
 //BA.debugLineNum = 124;BA.debugLine="ListView1.AddTwoLines(c.GetString(\"PC_CLIENTE\"";
_listview1.AddTwoLines(BA.ObjectToCharSequence(_c.GetString("PC_CLIENTE")),BA.ObjectToCharSequence(_c.GetString("NOMBRE")+"   Cantidad #"+_s.GetString("CANT_CLIE")+" SubTotal $"+_subs._calculatotalconpromoxrango /*String*/ (ba,_c.GetString("PC_CLIENTE"))));
 //BA.debugLineNum = 125;BA.debugLine="s.Close";
_s.Close();
 };
 }
};
 };
 //BA.debugLineNum = 129;BA.debugLine="c.Close";
_c.Close();
 //BA.debugLineNum = 130;BA.debugLine="End Sub";
return "";
}
public String  _b4xpage_created(anywheresoftware.b4a.objects.B4XViewWrapper _root1) throws Exception{
int _i = 0;
anywheresoftware.b4a.objects.LabelWrapper _label1 = null;
anywheresoftware.b4a.objects.LabelWrapper _label2 = null;
 //BA.debugLineNum = 23;BA.debugLine="Private Sub B4XPage_Created (Root1 As B4XView)";
 //BA.debugLineNum = 24;BA.debugLine="Root = Root1";
_root = _root1;
 //BA.debugLineNum = 26;BA.debugLine="ruta = File.DirInternal";
_ruta = __c.File.getDirInternal();
 //BA.debugLineNum = 27;BA.debugLine="Root.LoadLayout(\"ticketsdia\")";
_root.LoadLayout("ticketsdia",ba);
 //BA.debugLineNum = 29;BA.debugLine="If File.Exists(ruta, \"kmt.db\") = False Then";
if (__c.File.Exists(_ruta,"kmt.db")==__c.False) { 
 //BA.debugLineNum = 30;BA.debugLine="File.Copy(File.DirAssets, \"kmt.db\", ruta, \"kmt.d";
__c.File.Copy(__c.File.getDirAssets(),"kmt.db",_ruta,"kmt.db");
 };
 //BA.debugLineNum = 32;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"select PC_CLI";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select PC_CLIENTE,PC_MONTO,PC_NOART FROM PEDIDO_CLIENTE ORDER BY PC_FECHA asc")));
 //BA.debugLineNum = 33;BA.debugLine="ListView1.Clear";
_listview1.Clear();
 //BA.debugLineNum = 34;BA.debugLine="If c.RowCount>0 Then";
if (_c.getRowCount()>0) { 
 //BA.debugLineNum = 35;BA.debugLine="For i=0 To c.RowCount -1";
{
final int step10 = 1;
final int limit10 = (int) (_c.getRowCount()-1);
_i = (int) (0) ;
for (;_i <= limit10 ;_i = _i + step10 ) {
 //BA.debugLineNum = 36;BA.debugLine="c.Position=i";
_c.setPosition(_i);
 //BA.debugLineNum = 37;BA.debugLine="Dim Label1 As Label";
_label1 = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 38;BA.debugLine="Label1 = ListView1.TwoLinesLayout.Label";
_label1 = _listview1.getTwoLinesLayout().Label;
 //BA.debugLineNum = 39;BA.debugLine="Label1.TextSize = 20";
_label1.setTextSize((float) (20));
 //BA.debugLineNum = 40;BA.debugLine="Label1.TextColor = Colors.White";
_label1.setTextColor(__c.Colors.White);
 //BA.debugLineNum = 41;BA.debugLine="Dim label2 As Label";
_label2 = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 42;BA.debugLine="label2 = ListView1.TwoLinesLayout.SecondLabel";
_label2 = _listview1.getTwoLinesLayout().SecondLabel;
 //BA.debugLineNum = 43;BA.debugLine="label2.TextSize = 20";
_label2.setTextSize((float) (20));
 //BA.debugLineNum = 44;BA.debugLine="label2.TextColor = Colors.White";
_label2.setTextColor(__c.Colors.White);
 //BA.debugLineNum = 45;BA.debugLine="Label1.Height = 25dip";
_label1.setHeight(__c.DipToCurrent((int) (25)));
 //BA.debugLineNum = 46;BA.debugLine="label2.Height = 60dip";
_label2.setHeight(__c.DipToCurrent((int) (60)));
 //BA.debugLineNum = 48;BA.debugLine="ListView1.TwoLinesLayout.ItemHeight = 95dip";
_listview1.getTwoLinesLayout().setItemHeight(__c.DipToCurrent((int) (95)));
 //BA.debugLineNum = 49;BA.debugLine="Label1.Typeface = Typeface.CreateNew(Typeface.D";
_label1.setTypeface(__c.Typeface.CreateNew(__c.Typeface.DEFAULT_BOLD,__c.Typeface.STYLE_BOLD));
 //BA.debugLineNum = 50;BA.debugLine="label2.Typeface = Typeface.CreateNew(Typeface.D";
_label2.setTypeface(__c.Typeface.CreateNew(__c.Typeface.DEFAULT_BOLD,__c.Typeface.STYLE_BOLD));
 //BA.debugLineNum = 51;BA.debugLine="ListView1.AddTwoLines(c.GetString(\"PC_CLIENTE\")";
_listview1.AddTwoLines(BA.ObjectToCharSequence(_c.GetString("PC_CLIENTE")),BA.ObjectToCharSequence("Cantidad #"+_c.GetString("PC_NOART")+" SubTotal $"+_subs._calculatotalconpromoxrango /*String*/ (ba,_c.GetString("PC_CLIENTE"))));
 }
};
 };
 //BA.debugLineNum = 54;BA.debugLine="End Sub";
return "";
}
public String  _class_globals() throws Exception{
 //BA.debugLineNum = 1;BA.debugLine="Sub Class_Globals";
 //BA.debugLineNum = 2;BA.debugLine="Private Root As B4XView 'ignore";
_root = new anywheresoftware.b4a.objects.B4XViewWrapper();
 //BA.debugLineNum = 3;BA.debugLine="Private xui As XUI 'ignore";
_xui = new anywheresoftware.b4a.objects.B4XViewWrapper.XUI();
 //BA.debugLineNum = 4;BA.debugLine="Private p_ticketsdia As Panel";
_p_ticketsdia = new anywheresoftware.b4a.objects.PanelWrapper();
 //BA.debugLineNum = 6;BA.debugLine="Dim c As Cursor";
_c = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
 //BA.debugLineNum = 7;BA.debugLine="Dim S As Cursor";
_s = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
 //BA.debugLineNum = 8;BA.debugLine="Dim ruta As String";
_ruta = "";
 //BA.debugLineNum = 9;BA.debugLine="Dim ListView1 As ListView";
_listview1 = new anywheresoftware.b4a.objects.ListViewWrapper();
 //BA.debugLineNum = 10;BA.debugLine="Dim b_noventa As Button";
_b_noventa = new anywheresoftware.b4a.objects.ButtonWrapper();
 //BA.debugLineNum = 11;BA.debugLine="Dim nombre_boton As String";
_nombre_boton = "";
 //BA.debugLineNum = 12;BA.debugLine="Dim STIME As String";
_stime = "";
 //BA.debugLineNum = 14;BA.debugLine="Private L_ventanoventa As Label";
_l_ventanoventa = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 15;BA.debugLine="End Sub";
return "";
}
public Object  _initialize(anywheresoftware.b4a.BA _ba) throws Exception{
innerInitialize(_ba);
 //BA.debugLineNum = 18;BA.debugLine="Public Sub Initialize As Object";
 //BA.debugLineNum = 19;BA.debugLine="Return Me";
if (true) return this;
 //BA.debugLineNum = 20;BA.debugLine="End Sub";
return null;
}
public String  _listview1_itemlongclick(int _position,Object _value) throws Exception{
 //BA.debugLineNum = 145;BA.debugLine="Sub ListView1_ItemLongClick (Position As Int, Valu";
 //BA.debugLineNum = 146;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"delete from";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("delete from CUENTAA");
 //BA.debugLineNum = 147;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"INSERT INTO";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("INSERT INTO CUENTAA VALUES (?)",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{_value}));
 //BA.debugLineNum = 148;BA.debugLine="DateTime.TimeFormat = \"HHmmss\"";
__c.DateTime.setTimeFormat("HHmmss");
 //BA.debugLineNum = 149;BA.debugLine="STIME=DateTime.Time(DateTime.Now)";
_stime = __c.DateTime.Time(__c.DateTime.getNow());
 //BA.debugLineNum = 150;BA.debugLine="s=B4XPages.MainPage.skmt.ExecQuery(\"SELECT COUNT(";
_s = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("SELECT COUNT(*) AS CUANTOS FROM HIST_STAY_STORE WHERE HSS_IN = 0 AND HSS_CODIGO In (select cuenta from cuentaa)")));
 //BA.debugLineNum = 151;BA.debugLine="s.Position = 0";
_s.setPosition((int) (0));
 //BA.debugLineNum = 152;BA.debugLine="If s.GetString(\"CUANTOS\") = 1 Then";
if ((_s.GetString("CUANTOS")).equals(BA.NumberToString(1))) { 
 //BA.debugLineNum = 153;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"UPDATE HIS";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("UPDATE HIST_STAY_STORE set HSS_IN = ?  where HSS_IN = 0 AND HSS_CODIGO In (select cuenta from cuentaa)",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(_stime)}));
 }else {
 //BA.debugLineNum = 155;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"INSERT INT";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("INSERT INTO HIST_STAY_STORE(HSS_CODIGO,  HSS_IN , HSS_OUT , HSS_TOT) VALUES (?,0,0,0)",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{_value}));
 //BA.debugLineNum = 156;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"UPDATE HIS";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("UPDATE HIST_STAY_STORE set HSS_IN = ?  where HSS_IN = 0 AND HSS_CODIGO In (select cuenta from cuentaa)",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(_stime)}));
 };
 //BA.debugLineNum = 158;BA.debugLine="DateTime.TimeFormat = \"HH:mm:ss\"";
__c.DateTime.setTimeFormat("HH:mm:ss");
 //BA.debugLineNum = 159;BA.debugLine="B4XPages.ShowPage(\"cliente\")";
_b4xpages._showpage /*String*/ (ba,"cliente");
 //BA.debugLineNum = 160;BA.debugLine="End Sub";
return "";
}
public String  _p_ticketsdia_click() throws Exception{
 //BA.debugLineNum = 253;BA.debugLine="Private Sub p_ticketsdia_Click";
 //BA.debugLineNum = 255;BA.debugLine="End Sub";
return "";
}
public String  _regresar_click() throws Exception{
 //BA.debugLineNum = 132;BA.debugLine="Sub Regresar_Click";
 //BA.debugLineNum = 133;BA.debugLine="B4XPages.ShowPage(\"cliente\")";
_b4xpages._showpage /*String*/ (ba,"cliente");
 //BA.debugLineNum = 134;BA.debugLine="End Sub";
return "";
}
public Object callSub(String sub, Object sender, Object[] args) throws Exception {
BA.senderHolder.set(sender);
if (BA.fastSubCompare(sub, "B4XPAGE_CREATED"))
	return _b4xpage_created((anywheresoftware.b4a.objects.B4XViewWrapper) args[0]);
return BA.SubDelegator.SubNotFound;
}
}
