package medicomed.keymon.com.mx;


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

public class c_nota 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, "medicomed.keymon.com.mx.c_nota");
            if (htSubs == null) {
                ba.loadHtSubs(this.getClass());
                htSubs = ba.htSubs;
            }
            
        }
        if (BA.isShellModeRuntimeCheck(ba)) 
			   this.getClass().getMethod("_class_globals", medicomed.keymon.com.mx.c_nota.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.sql.SQL _skmt = null;
public anywheresoftware.b4a.gps.GPS _g = null;
public String _clie_id = "";
public String _sdate = "";
public String _stime = "";
public String _usuario = "";
public anywheresoftware.b4a.sql.SQL.CursorWrapper _c = null;
public String _ruta = "";
public anywheresoftware.b4a.objects.ButtonWrapper _regresar = null;
public anywheresoftware.b4a.objects.ListViewWrapper _listview1 = null;
public anywheresoftware.b4a.objects.LabelWrapper _l_cant = null;
public anywheresoftware.b4a.objects.LabelWrapper _l_total = null;
public anywheresoftware.b4a.objects.ButtonWrapper _borra = null;
public String _existe = "";
public String _result = "";
public String _desc = "";
public anywheresoftware.b4a.objects.LabelWrapper _titulo = null;
public anywheresoftware.b4a.objects.ButtonWrapper _b_desc = null;
public String _descuento = "";
public String _folio = "";
public com.rootsoft.togglelibrary.ToggleLibrary _tgl = null;
public String _almacen = "";
public anywheresoftware.b4a.objects.PanelWrapper _p_nota = null;
public anywheresoftware.b4a.objects.collections.List _vamoaver = null;
public anywheresoftware.b4a.sql.SQL.CursorWrapper _c2 = null;
public anywheresoftware.b4a.sql.SQL.CursorWrapper _j3 = null;
public b4a.example.dateutils _dateutils = null;
public medicomed.keymon.com.mx.main _main = null;
public medicomed.keymon.com.mx.starter _starter = null;
public medicomed.keymon.com.mx.appupdater _appupdater = null;
public medicomed.keymon.com.mx.mapa_rutas _mapa_rutas = null;
public medicomed.keymon.com.mx.mapa_cliente _mapa_cliente = null;
public medicomed.keymon.com.mx.subs _subs = null;
public medicomed.keymon.com.mx.notificationservice _notificationservice = null;
public medicomed.keymon.com.mx.pendientes _pendientes = null;
public medicomed.keymon.com.mx.tracker _tracker = null;
public medicomed.keymon.com.mx.newinst2 _newinst2 = null;
public medicomed.keymon.com.mx.b4xpages _b4xpages = null;
public medicomed.keymon.com.mx.b4xcollections _b4xcollections = null;
public medicomed.keymon.com.mx.httputils2service _httputils2service = null;
public medicomed.keymon.com.mx.xuiviewsutils _xuiviewsutils = null;
public String  _activity_pause(boolean _userclosed) throws Exception{
 //BA.debugLineNum = 128;BA.debugLine="Sub Activity_Pause (UserClosed As Boolean)";
 //BA.debugLineNum = 130;BA.debugLine="End Sub";
return "";
}
public String  _b_desc_click() throws Exception{
 //BA.debugLineNum = 250;BA.debugLine="Sub b_desc_Click";
 //BA.debugLineNum = 251;BA.debugLine="If DESCUENTO = \"MENOS\" Then";
if ((_descuento).equals("MENOS")) { 
 //BA.debugLineNum = 252;BA.debugLine="DateTime.DateFormat = \"MM/dd/yyyy\"";
__c.DateTime.setDateFormat("MM/dd/yyyy");
 //BA.debugLineNum = 253;BA.debugLine="sDate=DateTime.Date(DateTime.Now)";
_sdate = __c.DateTime.Date(__c.DateTime.getNow());
 //BA.debugLineNum = 254;BA.debugLine="sTime=DateTime.Time(DateTime.Now)";
_stime = __c.DateTime.Time(__c.DateTime.getNow());
 //BA.debugLineNum = 255;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"Select CUENT";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("Select CUENTA from cuentaa")));
 //BA.debugLineNum = 256;BA.debugLine="c.Position=0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 257;BA.debugLine="clie_id = c.GetString(\"CUENTA\")";
_clie_id = _c.GetString("CUENTA");
 //BA.debugLineNum = 258;BA.debugLine="c.Close";
_c.Close();
 //BA.debugLineNum = 259;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"select USUAR";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select USUARIO from usuarioa")));
 //BA.debugLineNum = 260;BA.debugLine="c.Position=0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 261;BA.debugLine="usuario = c.GetString(\"USUARIO\")";
_usuario = _c.GetString("USUARIO");
 //BA.debugLineNum = 262;BA.debugLine="c.Close";
_c.Close();
 //BA.debugLineNum = 263;BA.debugLine="result =  Msgbox2(\"Seguro que desea dar descuent";
_result = BA.NumberToString(__c.Msgbox2(BA.ObjectToCharSequence("Seguro que desea dar descuento del 5%?"),BA.ObjectToCharSequence("Dar descuento"),"Si","","No",(android.graphics.Bitmap)(__c.LoadBitmap(__c.File.getDirAssets(),"alert2.png").getObject()),ba));
 //BA.debugLineNum = 264;BA.debugLine="If result = DialogResponse.POSITIVE Then";
if ((_result).equals(BA.NumberToString(__c.DialogResponse.POSITIVE))) { 
 //BA.debugLineNum = 265;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"UPDATE ped";
_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("UPDATE pedido SET PE_COSTO_TOT = PE_COSTO_TOT * .95, PE_DESC = 5 WHERE PE_CLIENTE In (select cuenta from cuentaa)");
 //BA.debugLineNum = 266;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"select sum(";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*medicomed.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, count(*) as CUANTOS FROM PEDIDO WHERE PE_CLIENTE IN (Select CUENTA from cuentaa)")));
 //BA.debugLineNum = 267;BA.debugLine="c.Position=0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 268;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"delete fro";
_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("delete from pedido_cliente where PC_CLIENTE In (select cuenta from cuentaa)");
 //BA.debugLineNum = 269;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"insert in";
_b4xpages._mainpage /*medicomed.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) VALUES (?,?,?,?,?,?,?)",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(_clie_id),(Object)(_sdate+_stime),(Object)(_usuario),(Object)(_c.GetString("CANT_CLIE")),(Object)(_c.GetString("TOTAL_CLIE")),(Object)(_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._lon_gps /*String*/ ),(Object)(_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._lat_gps /*String*/ )}));
 //BA.debugLineNum = 270;BA.debugLine="c.Close";
_c.Close();
 //BA.debugLineNum = 271;BA.debugLine="B4XPage_Appear";
_b4xpage_appear();
 };
 }else if((_descuento).equals("MAS")) { 
 //BA.debugLineNum = 274;BA.debugLine="DateTime.DateFormat = \"MM/dd/yyyy\"";
__c.DateTime.setDateFormat("MM/dd/yyyy");
 //BA.debugLineNum = 275;BA.debugLine="sDate=DateTime.Date(DateTime.Now)";
_sdate = __c.DateTime.Date(__c.DateTime.getNow());
 //BA.debugLineNum = 276;BA.debugLine="sTime=DateTime.Time(DateTime.Now)";
_stime = __c.DateTime.Time(__c.DateTime.getNow());
 //BA.debugLineNum = 277;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"Select CUENT";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("Select CUENTA from cuentaa")));
 //BA.debugLineNum = 278;BA.debugLine="c.Position=0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 279;BA.debugLine="clie_id = c.GetString(\"CUENTA\")";
_clie_id = _c.GetString("CUENTA");
 //BA.debugLineNum = 280;BA.debugLine="c.Close";
_c.Close();
 //BA.debugLineNum = 281;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"select USUAR";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select USUARIO from usuarioa")));
 //BA.debugLineNum = 282;BA.debugLine="c.Position=0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 283;BA.debugLine="usuario = c.GetString(\"USUARIO\")";
_usuario = _c.GetString("USUARIO");
 //BA.debugLineNum = 284;BA.debugLine="c.Close";
_c.Close();
 //BA.debugLineNum = 285;BA.debugLine="result =  Msgbox2(\"Seguro que desea CANCELAR el";
_result = BA.NumberToString(__c.Msgbox2(BA.ObjectToCharSequence("Seguro que desea CANCELAR el descuento?"),BA.ObjectToCharSequence("Cancelar descuento"),"Si","","No",(android.graphics.Bitmap)(__c.LoadBitmap(__c.File.getDirAssets(),"alert2.png").getObject()),ba));
 //BA.debugLineNum = 286;BA.debugLine="If result = DialogResponse.POSITIVE Then";
if ((_result).equals(BA.NumberToString(__c.DialogResponse.POSITIVE))) { 
 //BA.debugLineNum = 287;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"UPDATE ped";
_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("UPDATE pedido SET PE_COSTO_TOT = PE_COSTO_TOT / .95, PE_DESC = 0 WHERE PE_CLIENTE In (select cuenta from cuentaa)");
 //BA.debugLineNum = 288;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"select sum(";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*medicomed.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, count(*) as CUANTOS FROM PEDIDO WHERE PE_CLIENTE IN (Select CUENTA from cuentaa)")));
 //BA.debugLineNum = 289;BA.debugLine="c.Position=0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 290;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"delete fro";
_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("delete from pedido_cliente where PC_CLIENTE In (select cuenta from cuentaa)");
 //BA.debugLineNum = 291;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"insert in";
_b4xpages._mainpage /*medicomed.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) VALUES (?,?,?,?,?,?,?)",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(_clie_id),(Object)(_sdate+_stime),(Object)(_usuario),(Object)(_c.GetString("CANT_CLIE")),(Object)(_c.GetString("TOTAL_CLIE")),(Object)(_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._lon_gps /*String*/ ),(Object)(_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._lat_gps /*String*/ )}));
 //BA.debugLineNum = 292;BA.debugLine="c.Close";
_c.Close();
 //BA.debugLineNum = 293;BA.debugLine="B4XPage_Appear";
_b4xpage_appear();
 };
 };
 //BA.debugLineNum = 296;BA.debugLine="End Sub";
return "";
}
public String  _b4xpage_appear() throws Exception{
anywheresoftware.b4a.objects.CSBuilder _cs = null;
int _i = 0;
anywheresoftware.b4a.objects.LabelWrapper _label1 = null;
int _textcolor = 0;
anywheresoftware.b4a.objects.LabelWrapper _label2 = null;
 //BA.debugLineNum = 58;BA.debugLine="Sub B4XPage_Appear";
 //BA.debugLineNum = 59;BA.debugLine="If Not(Starter.gps.GPSEnabled) Then";
if (__c.Not(_starter._gps /*anywheresoftware.b4a.gps.GPS*/ .getGPSEnabled())) { 
 //BA.debugLineNum = 60;BA.debugLine="ToastMessageShow(\"Es necesario tener el GPS ence";
__c.ToastMessageShow(BA.ObjectToCharSequence("Es necesario tener el GPS encendido"),__c.True);
 //BA.debugLineNum = 61;BA.debugLine="StartActivity(Starter.gps.LocationSettingsIntent";
__c.StartActivity(ba,(Object)(_starter._gps /*anywheresoftware.b4a.gps.GPS*/ .getLocationSettingsIntent()));
 };
 //BA.debugLineNum = 63;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)(_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select  ID_ALMACEN from CAT_ALMACEN")));
 //BA.debugLineNum = 64;BA.debugLine="C.Position =0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 65;BA.debugLine="almacen = C.GetString(\"ID_ALMACEN\")";
_almacen = _c.GetString("ID_ALMACEN");
 //BA.debugLineNum = 66;BA.debugLine="C.Close";
_c.Close();
 //BA.debugLineNum = 67;BA.debugLine="L_CANT.Text =\"\"";
_l_cant.setText(BA.ObjectToCharSequence(""));
 //BA.debugLineNum = 68;BA.debugLine="L_TOTAL.Text=\"\"";
_l_total.setText(BA.ObjectToCharSequence(""));
 //BA.debugLineNum = 69;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"select count(";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select count(*) as EXISTE from pedido_cliente WHERE pc_cliente IN (Select CUENTA from cuentaa)")));
 //BA.debugLineNum = 70;BA.debugLine="C.Position=0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 71;BA.debugLine="Existe = C.GetString(\"EXISTE\")";
_existe = _c.GetString("EXISTE");
 //BA.debugLineNum = 72;BA.debugLine="C.Close";
_c.Close();
 //BA.debugLineNum = 73;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"select PE_PRO";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select PE_PRONOMBRE,PE_COSTO_TOT, PE_CANT, PE_FOLIO, PE_CEDIS FROM PEDIDO WHERE PE_CLIENTE IN (Select CUENTA from cuentaa) order by PE_CEDIS, PE_PRONOMBRE")));
 //BA.debugLineNum = 74;BA.debugLine="ListView1.Clear";
_listview1.Clear();
 //BA.debugLineNum = 75;BA.debugLine="vamoaver.Initialize";
_vamoaver.Initialize();
 //BA.debugLineNum = 76;BA.debugLine="Private cs As CSBuilder";
_cs = new anywheresoftware.b4a.objects.CSBuilder();
 //BA.debugLineNum = 77;BA.debugLine="If c.RowCount>0 Then";
if (_c.getRowCount()>0) { 
 //BA.debugLineNum = 78;BA.debugLine="For i=0 To c.RowCount -1";
{
final int step20 = 1;
final int limit20 = (int) (_c.getRowCount()-1);
_i = (int) (0) ;
for (;_i <= limit20 ;_i = _i + step20 ) {
 //BA.debugLineNum = 79;BA.debugLine="cs.Initialize";
_cs.Initialize();
 //BA.debugLineNum = 80;BA.debugLine="c.Position=i";
_c.setPosition(_i);
 //BA.debugLineNum = 81;BA.debugLine="Dim label1 As Label";
_label1 = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 82;BA.debugLine="label1 = ListView1.TwoLinesLayout.Label";
_label1 = _listview1.getTwoLinesLayout().Label;
 //BA.debugLineNum = 83;BA.debugLine="label1.TextSize = 15";
_label1.setTextSize((float) (15));
 //BA.debugLineNum = 84;BA.debugLine="label1.TextColor = Colors.Black";
_label1.setTextColor(__c.Colors.Black);
 //BA.debugLineNum = 85;BA.debugLine="label1.color = Colors.White";
_label1.setColor(__c.Colors.White);
 //BA.debugLineNum = 86;BA.debugLine="Private textColor As Int = Colors.black";
_textcolor = __c.Colors.Black;
 //BA.debugLineNum = 87;BA.debugLine="If c.GetString(\"PE_FOLIO\") = \"PREVENTA_48\" Then";
if ((_c.GetString("PE_FOLIO")).equals("PREVENTA_48")) { 
 //BA.debugLineNum = 88;BA.debugLine="textColor = Colors.RGB(48,3,195)";
_textcolor = __c.Colors.RGB((int) (48),(int) (3),(int) (195));
 }else if((_c.GetString("PE_FOLIO")).equals("PREVENTA") || (_c.GetString("PE_FOLIO")).equals("ABORDO") || (_c.GetString("PE_FOLIO")).equals("RECARGA")) { 
 //BA.debugLineNum = 90;BA.debugLine="textColor = Colors.RGB(166,0,0)";
_textcolor = __c.Colors.RGB((int) (166),(int) (0),(int) (0));
 };
 //BA.debugLineNum = 92;BA.debugLine="If Not(IsNumber(c.GetString(\"PE_CEDIS\"))) And c";
if (__c.Not(__c.IsNumber(_c.GetString("PE_CEDIS"))) && (_c.GetString("PE_FOLIO")).equals("PREVENTA_48")) { 
 //BA.debugLineNum = 93;BA.debugLine="textColor = Colors.RGB(154,131,231) 'Si es pro";
_textcolor = __c.Colors.RGB((int) (154),(int) (131),(int) (231));
 }else if(__c.Not(__c.IsNumber(_c.GetString("PE_CEDIS"))) && (_c.GetString("PE_FOLIO")).equals("PREVENTA")) { 
 //BA.debugLineNum = 95;BA.debugLine="textColor = Colors.RGB(255,111,111) 'Si es pro";
_textcolor = __c.Colors.RGB((int) (255),(int) (111),(int) (111));
 };
 //BA.debugLineNum = 97;BA.debugLine="Dim label2 As Label";
_label2 = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 98;BA.debugLine="label2 = ListView1.TwoLinesLayout.SecondLabel";
_label2 = _listview1.getTwoLinesLayout().SecondLabel;
 //BA.debugLineNum = 99;BA.debugLine="label2.TextSize = 10";
_label2.setTextSize((float) (10));
 //BA.debugLineNum = 100;BA.debugLine="label2.TextColor = Colors.Blue";
_label2.setTextColor(__c.Colors.Blue);
 //BA.debugLineNum = 101;BA.debugLine="ListView1.AddTwoLines(cs.Color(textColor).appen";
_listview1.AddTwoLines(BA.ObjectToCharSequence(_cs.Color(_textcolor).Append(BA.ObjectToCharSequence(_c.GetString("PE_PRONOMBRE"))).Pop().getObject()),BA.ObjectToCharSequence("Cantidad #"+_c.GetString("PE_CANT")+" SubTotal $"+_c.GetString("PE_COSTO_TOT")+" Folio "+_c.GetString("PE_FOLIO")));
 //BA.debugLineNum = 102;BA.debugLine="folio = c.GetString(\"PE_FOLIO\")";
_folio = _c.GetString("PE_FOLIO");
 //BA.debugLineNum = 103;BA.debugLine="vamoaver.Add(c.GetString(\"PE_FOLIO\"))";
_vamoaver.Add((Object)(_c.GetString("PE_FOLIO")));
 }
};
 };
 //BA.debugLineNum = 106;BA.debugLine="Log($\"EXISTE: ${Existe}\"$)";
__c.LogImpl("762128176",("EXISTE: "+__c.SmartStringFormatter("",(Object)(_existe))+""),0);
 //BA.debugLineNum = 109;BA.debugLine="c = B4XPages.MainPage.skmt.ExecQuery(\"select sum(";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select sum(PE_CANT) as PC_NOART, sum (PE_COSTO_TOT) as PC_MONTO from PEDIDO where PE_CLIENTE in (Select CUENTA from cuentaa) AND PE_PROID NOT IN (SELECT CAT_PA_ID FROM PROMOS_COMP ) ")));
 //BA.debugLineNum = 110;BA.debugLine="If c.RowCount > 0 Then";
if (_c.getRowCount()>0) { 
 //BA.debugLineNum = 111;BA.debugLine="C.Position = 0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 112;BA.debugLine="Log($\"registros: ${c.RowCount}, arts: ${c.GetStr";
__c.LogImpl("762128182",("registros: "+__c.SmartStringFormatter("",(Object)(_c.getRowCount()))+", arts: "+__c.SmartStringFormatter("",(Object)(_c.GetString("PC_NOART")))+", monto:"+__c.SmartStringFormatter("",(Object)(_c.GetString("PC_MONTO")))+""),0);
 //BA.debugLineNum = 113;BA.debugLine="L_CANT.Text = c.GetString(\"PC_NOART\")";
_l_cant.setText(BA.ObjectToCharSequence(_c.GetString("PC_NOART")));
 //BA.debugLineNum = 114;BA.debugLine="L_TOTAL.Text = c.GetString(\"PC_MONTO\")";
_l_total.setText(BA.ObjectToCharSequence(_c.GetString("PC_MONTO")));
 //BA.debugLineNum = 115;BA.debugLine="If L_CANT.Text = Null Or L_CANT.Text = \"null\" Or";
if (_l_cant.getText()== null || (_l_cant.getText()).equals("null") || (_l_cant.getText()).equals("")) { 
_l_cant.setText(BA.ObjectToCharSequence("0"));};
 //BA.debugLineNum = 116;BA.debugLine="If L_TOTAL.Text = Null Or L_TOTAL.Text = \"null\"";
if (_l_total.getText()== null || (_l_total.getText()).equals("null") || (_l_total.getText()).equals("")) { 
_l_total.setText(BA.ObjectToCharSequence("0"));};
 //BA.debugLineNum = 117;BA.debugLine="c.Close";
_c.Close();
 //BA.debugLineNum = 118;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"select SUM(I";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select SUM(IFNULL(PE_DESC,0)) AS DESCUENTO FROM PEDIDO WHERE PE_CLIENTE IN (Select CUENTA from cuentaa)")));
 //BA.debugLineNum = 119;BA.debugLine="c.Position=0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 120;BA.debugLine="DESC = c.GetString(\"DESCUENTO\")";
_desc = _c.GetString("DESCUENTO");
 //BA.debugLineNum = 121;BA.debugLine="b_desc.Visible = False";
_b_desc.setVisible(__c.False);
 };
 //BA.debugLineNum = 125;BA.debugLine="If Subs.pedidoGuardado Then borra.Enabled = False";
if (_subs._pedidoguardado /*boolean*/ (ba)) { 
_borra.setEnabled(__c.False);}
else {
_borra.setEnabled(__c.True);};
 //BA.debugLineNum = 126;BA.debugLine="End Sub";
return "";
}
public anywheresoftware.b4a.keywords.Common.ResumableSubWrapper  _b4xpage_closerequest() throws Exception{
ResumableSub_B4XPage_CloseRequest rsub = new ResumableSub_B4XPage_CloseRequest(this);
rsub.resume(ba, null);
return (anywheresoftware.b4a.keywords.Common.ResumableSubWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.keywords.Common.ResumableSubWrapper(), rsub);
}
public static class ResumableSub_B4XPage_CloseRequest extends BA.ResumableSub {
public ResumableSub_B4XPage_CloseRequest(medicomed.keymon.com.mx.c_nota parent) {
this.parent = parent;
}
medicomed.keymon.com.mx.c_nota parent;

@Override
public void resume(BA ba, Object[] result) throws Exception{

    while (true) {
        switch (state) {
            case -1:
{
parent.__c.ReturnFromResumableSub(this,null);return;}
case 0:
//C
this.state = -1;
 //BA.debugLineNum = 144;BA.debugLine="B4XPages.ShowPage(\"Cliente\")";
parent._b4xpages._showpage /*String*/ (ba,"Cliente");
 //BA.debugLineNum = 145;BA.debugLine="Return False";
if (true) {
parent.__c.ReturnFromResumableSub(this,(Object)(parent.__c.False));return;};
 //BA.debugLineNum = 146;BA.debugLine="End Sub";
if (true) break;

            }
        }
    }
}
public String  _b4xpage_created(anywheresoftware.b4a.objects.B4XViewWrapper _root1) throws Exception{
 //BA.debugLineNum = 42;BA.debugLine="Private Sub B4XPage_Created (Root1 As B4XView)";
 //BA.debugLineNum = 43;BA.debugLine="Root = Root1";
_root = _root1;
 //BA.debugLineNum = 44;BA.debugLine="ruta = File.DirInternal";
_ruta = __c.File.getDirInternal();
 //BA.debugLineNum = 45;BA.debugLine="Root.LoadLayout(\"nota\")";
_root.LoadLayout("nota",ba);
 //BA.debugLineNum = 46;BA.debugLine="borra.Visible = True";
_borra.setVisible(__c.True);
 //BA.debugLineNum = 47;BA.debugLine="Titulo.Text = \"Pedido Actual\"";
_titulo.setText(BA.ObjectToCharSequence("Pedido Actual"));
 //BA.debugLineNum = 54;BA.debugLine="End Sub";
return "";
}
public String  _borra_click() throws Exception{
 //BA.debugLineNum = 148;BA.debugLine="Sub borra_Click";
 //BA.debugLineNum = 150;BA.debugLine="result =  Msgbox2(\"Seguro que desea borrar el ped";
_result = BA.NumberToString(__c.Msgbox2(BA.ObjectToCharSequence("Seguro que desea borrar el pedido?"),BA.ObjectToCharSequence("Cancelar pedido"),"Si","","No",(android.graphics.Bitmap)(__c.LoadBitmap(__c.File.getDirAssets(),"alert2.png").getObject()),ba));
 //BA.debugLineNum = 151;BA.debugLine="If result = DialogResponse.POSITIVE Then";
if ((_result).equals(BA.NumberToString(__c.DialogResponse.POSITIVE))) { 
 //BA.debugLineNum = 163;BA.debugLine="Subs.borraPedidoClienteActual";
_subs._borrapedidoclienteactual /*String*/ (ba);
 //BA.debugLineNum = 164;BA.debugLine="If B4XPages.MainPage.productos.clv_prods_ll.IsIn";
if (_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._productos /*medicomed.keymon.com.mx.c_productos*/ ._clv_prods_ll /*b4a.example3.customlistview*/ .IsInitialized()) { 
 //BA.debugLineNum = 165;BA.debugLine="B4XPages.MainPage.productos.clv_prods_ll.Clear";
_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._productos /*medicomed.keymon.com.mx.c_productos*/ ._clv_prods_ll /*b4a.example3.customlistview*/ ._clear();
 };
 //BA.debugLineNum = 167;BA.debugLine="B4XPage_Appear";
_b4xpage_appear();
 };
 //BA.debugLineNum = 172;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 = 5;BA.debugLine="Dim skmt As SQL";
_skmt = new anywheresoftware.b4a.sql.SQL();
 //BA.debugLineNum = 6;BA.debugLine="Dim g As GPS";
_g = new anywheresoftware.b4a.gps.GPS();
 //BA.debugLineNum = 7;BA.debugLine="Dim clie_id As String";
_clie_id = "";
 //BA.debugLineNum = 8;BA.debugLine="Dim sDate,sTime As String";
_sdate = "";
_stime = "";
 //BA.debugLineNum = 9;BA.debugLine="Dim usuario As String";
_usuario = "";
 //BA.debugLineNum = 11;BA.debugLine="Dim c As Cursor";
_c = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
 //BA.debugLineNum = 12;BA.debugLine="Dim ruta As String";
_ruta = "";
 //BA.debugLineNum = 13;BA.debugLine="Dim Regresar As Button";
_regresar = new anywheresoftware.b4a.objects.ButtonWrapper();
 //BA.debugLineNum = 15;BA.debugLine="Dim ListView1 As ListView";
_listview1 = new anywheresoftware.b4a.objects.ListViewWrapper();
 //BA.debugLineNum = 16;BA.debugLine="Dim L_CANT As Label";
_l_cant = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 17;BA.debugLine="Dim L_TOTAL As Label";
_l_total = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 18;BA.debugLine="Dim borra As Button";
_borra = new anywheresoftware.b4a.objects.ButtonWrapper();
 //BA.debugLineNum = 19;BA.debugLine="Dim Existe As String";
_existe = "";
 //BA.debugLineNum = 20;BA.debugLine="Dim result As String";
_result = "";
 //BA.debugLineNum = 22;BA.debugLine="Dim DESC As String";
_desc = "";
 //BA.debugLineNum = 24;BA.debugLine="Private Titulo As Label";
_titulo = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 25;BA.debugLine="Private b_desc As Button";
_b_desc = new anywheresoftware.b4a.objects.ButtonWrapper();
 //BA.debugLineNum = 26;BA.debugLine="Dim DESCUENTO As String";
_descuento = "";
 //BA.debugLineNum = 27;BA.debugLine="Dim folio As String";
_folio = "";
 //BA.debugLineNum = 28;BA.debugLine="Dim tgl As Toggle";
_tgl = new com.rootsoft.togglelibrary.ToggleLibrary();
 //BA.debugLineNum = 29;BA.debugLine="Private almacen As String";
_almacen = "";
 //BA.debugLineNum = 30;BA.debugLine="Private p_nota As Panel";
_p_nota = new anywheresoftware.b4a.objects.PanelWrapper();
 //BA.debugLineNum = 31;BA.debugLine="Dim vamoaver As List";
_vamoaver = new anywheresoftware.b4a.objects.collections.List();
 //BA.debugLineNum = 32;BA.debugLine="Dim c2 As Cursor";
_c2 = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
 //BA.debugLineNum = 33;BA.debugLine="Dim j3 As Cursor";
_j3 = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
 //BA.debugLineNum = 34;BA.debugLine="End Sub";
return "";
}
public String  _gps_locationchanged(anywheresoftware.b4a.gps.LocationWrapper _location1) throws Exception{
 //BA.debugLineNum = 132;BA.debugLine="Sub GPS_LocationChanged (Location1 As Location)";
 //BA.debugLineNum = 135;BA.debugLine="End Sub";
return "";
}
public Object  _initialize(anywheresoftware.b4a.BA _ba) throws Exception{
innerInitialize(_ba);
 //BA.debugLineNum = 37;BA.debugLine="Public Sub Initialize As Object";
 //BA.debugLineNum = 38;BA.debugLine="Return Me";
if (true) return this;
 //BA.debugLineNum = 39;BA.debugLine="End Sub";
return null;
}
public String  _listview1_itemlongclick(int _position,Object _value) throws Exception{
int _i = 0;
 //BA.debugLineNum = 174;BA.debugLine="Sub ListView1_ItemLongClick (Position As Int, Valu";
 //BA.debugLineNum = 175;BA.debugLine="Log(Value)";
__c.LogImpl("762521345",BA.ObjectToString(_value),0);
 //BA.debugLineNum = 176;BA.debugLine="If Not(Subs.pedidoGuardado) Then";
if (__c.Not(_subs._pedidoguardado /*boolean*/ (ba))) { 
 //BA.debugLineNum = 177;BA.debugLine="result =  Msgbox2(\"Seguro que desea borrar este a";
_result = BA.NumberToString(__c.Msgbox2(BA.ObjectToCharSequence("Seguro que desea borrar este articulo?"),BA.ObjectToCharSequence("Borrar Articulo"),"Si","","No",(android.graphics.Bitmap)(__c.LoadBitmap(__c.File.getDirAssets(),"alert2.png").getObject()),ba));
 //BA.debugLineNum = 178;BA.debugLine="If result = DialogResponse.POSITIVE Then";
if ((_result).equals(BA.NumberToString(__c.DialogResponse.POSITIVE))) { 
 //BA.debugLineNum = 179;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery2(\"select PE_P";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery2("select PE_PROID,PE_CANT, PE_FOLIO, PE_PRONOMBRE FROM PEDIDO where pe_pronombre = ? and pe_cliente in (Select CUENTA from cuentaa) ",new String[]{BA.ObjectToString(_value)})));
 //BA.debugLineNum = 180;BA.debugLine="c.Position=0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 181;BA.debugLine="Log(vamoaver.Get(Position))";
__c.LogImpl("762521351",BA.ObjectToString(_vamoaver.Get(_position)),0);
 //BA.debugLineNum = 182;BA.debugLine="If vamoaver.Get(Position) = \"PREVENTA_48\" Then";
if ((_vamoaver.Get(_position)).equals((Object)("PREVENTA_48"))) { 
 //BA.debugLineNum = 183;BA.debugLine="Log(\"CAT_GUNAPROD2\")";
__c.LogImpl("762521353","CAT_GUNAPROD2",0);
 //BA.debugLineNum = 184;BA.debugLine="Log(Position&\",1\")";
__c.LogImpl("762521354",BA.NumberToString(_position)+",1",0);
 //BA.debugLineNum = 185;BA.debugLine="Log(Value&\",1\")";
__c.LogImpl("762521355",BA.ObjectToString(_value)+",1",0);
 //BA.debugLineNum = 186;BA.debugLine="Starter.tabla = \"CAT_GUNAPROD2\"";
_starter._tabla /*String*/  = "CAT_GUNAPROD2";
 }else {
 //BA.debugLineNum = 188;BA.debugLine="Log(\"CAT_GUNAPROD\")";
__c.LogImpl("762521358","CAT_GUNAPROD",0);
 //BA.debugLineNum = 189;BA.debugLine="Log(Position&\",2\")";
__c.LogImpl("762521359",BA.NumberToString(_position)+",2",0);
 //BA.debugLineNum = 190;BA.debugLine="Log(Value&\",2\")";
__c.LogImpl("762521360",BA.ObjectToString(_value)+",2",0);
 //BA.debugLineNum = 191;BA.debugLine="Starter.tabla = \"CAT_GUNAPROD\"";
_starter._tabla /*String*/  = "CAT_GUNAPROD";
 };
 //BA.debugLineNum = 195;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"INSERT INT";
_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("INSERT INTO  INVENT_X_ENVIAR (ALMACEN , PROID , CANTIDAD ) VALUES(?,?,?) ",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(_subs._traealmacen /*String*/ (ba)),(Object)(_c.GetString("PE_PROID")),(Object)((double)(Double.parseDouble(_c.GetString("PE_CANT")))*-1)}));
 //BA.debugLineNum = 196;BA.debugLine="c2=B4XPages.MainPage.skmt.ExecQuery2($\"select co";
_c2 = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery2(("select count(*) AS CUANTOS from "+__c.SmartStringFormatter("",(Object)(_starter._tabla /*String*/ ))+" where  CAT_GP_ID in (select pe_cedis from pedido where pe_pronombre = ? and pe_cliente in (Select CUENTA from cuentaa)) and CAT_GP_CLASIF = 'PROMOS' AND CAT_GP_TIPO = 'PROMOS' AND CAT_GP_SUBTIPO = 'PROMOS'"),new String[]{BA.ObjectToString(_value)})));
 //BA.debugLineNum = 197;BA.debugLine="c2.Position=0";
_c2.setPosition((int) (0));
 //BA.debugLineNum = 198;BA.debugLine="Log(\"aqui entre1\")";
__c.LogImpl("762521368","aqui entre1",0);
 //BA.debugLineNum = 199;BA.debugLine="If c2.GetString(\"CUANTOS\") > 0 Then";
if ((double)(Double.parseDouble(_c2.GetString("CUANTOS")))>0) { 
 //BA.debugLineNum = 200;BA.debugLine="Log(\"aqui entre\")";
__c.LogImpl("762521370","aqui entre",0);
 //BA.debugLineNum = 201;BA.debugLine="j3 = B4XPages.MainPage.skmt.ExecQuery2(\"SELECT";
_j3 = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery2("SELECT PE_CEDIS, PE_CANT,PE_PROID, PE_PRONOMBRE FROM PEDIDO WHERE PE_CEDIS IN (SELECT PE_CEDIS FROM PEDIDO WHERE PE_PRONOMBRE = ? and PE_FOLIO = ?)",new String[]{BA.ObjectToString(_value),BA.ObjectToString(_vamoaver.Get(_position))})));
 //BA.debugLineNum = 202;BA.debugLine="Log(j3.RowCount)";
__c.LogImpl("762521372",BA.NumberToString(_j3.getRowCount()),0);
 //BA.debugLineNum = 204;BA.debugLine="If j3.RowCount > 0 Then";
if (_j3.getRowCount()>0) { 
 //BA.debugLineNum = 205;BA.debugLine="Log(\"estoy aqui\")";
__c.LogImpl("762521375","estoy aqui",0);
 //BA.debugLineNum = 206;BA.debugLine="For i = 0 To j3.RowCount -1";
{
final int step29 = 1;
final int limit29 = (int) (_j3.getRowCount()-1);
_i = (int) (0) ;
for (;_i <= limit29 ;_i = _i + step29 ) {
 //BA.debugLineNum = 207;BA.debugLine="Log(\"aqui tronare?\")";
__c.LogImpl("762521377","aqui tronare?",0);
 //BA.debugLineNum = 208;BA.debugLine="j3.Position = i";
_j3.setPosition(_i);
 //BA.debugLineNum = 209;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery($\"update";
_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("update CAT_GUNAPROD set cat_gp_almacen = cat_gp_almacen + "+__c.SmartStringFormatter("",(Object)(_j3.GetString("PE_CANT")))+" where cat_gp_id = '"+__c.SmartStringFormatter("",(Object)(_j3.GetString("PE_PROID")))+"'"));
 //BA.debugLineNum = 210;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery($\"update";
_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("update CAT_GUNAPROD2 set cat_gp_almacen = cat_gp_almacen + "+__c.SmartStringFormatter("",(Object)(_j3.GetString("PE_CANT")))+" where cat_gp_id = '"+__c.SmartStringFormatter("",(Object)(_j3.GetString("PE_PROID")))+"'"));
 //BA.debugLineNum = 211;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"delete";
_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("delete from pedido where  pe_cedis in (select pe_cedis from pedido where pe_pronombre = ?) and pe_cliente in (Select CUENTA from cuentaa) AND PE_FOLIO = ?",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{_value,_vamoaver.Get(_position)}));
 }
};
 };
 //BA.debugLineNum = 214;BA.debugLine="j3.Close";
_j3.Close();
 }else {
 //BA.debugLineNum = 216;BA.debugLine="Log(\"aqui entre2\")";
__c.LogImpl("762521386","aqui entre2",0);
 //BA.debugLineNum = 218;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery($\"update CA";
_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("update CAT_GUNAPROD set cat_gp_almacen = cat_gp_almacen + "+__c.SmartStringFormatter("",(Object)(_c.GetString("PE_CANT")))+" where cat_gp_id = '"+__c.SmartStringFormatter("",(Object)(_c.GetString("PE_PROID")))+"'"));
 //BA.debugLineNum = 219;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery($\"update CA";
_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("update CAT_GUNAPROD2 set cat_gp_almacen = cat_gp_almacen + "+__c.SmartStringFormatter("",(Object)(_c.GetString("PE_CANT")))+" where cat_gp_id = '"+__c.SmartStringFormatter("",(Object)(_c.GetString("PE_PROID")))+"'"));
 //BA.debugLineNum = 220;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"delete fr";
_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("delete from pedido where  pe_pronombre = ?  and pe_cliente in (Select CUENTA from cuentaa) AND PE_FOLIO = ?",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{_value,_vamoaver.Get(_position)}));
 };
 //BA.debugLineNum = 222;BA.debugLine="c.Close";
_c.Close();
 //BA.debugLineNum = 223;BA.debugLine="c2.Close";
_c2.Close();
 //BA.debugLineNum = 224;BA.debugLine="DateTime.DateFormat = \"MM/dd/yyyy\"";
__c.DateTime.setDateFormat("MM/dd/yyyy");
 //BA.debugLineNum = 225;BA.debugLine="sDate=DateTime.Date(DateTime.Now)";
_sdate = __c.DateTime.Date(__c.DateTime.getNow());
 //BA.debugLineNum = 226;BA.debugLine="sTime=DateTime.Time(DateTime.Now)";
_stime = __c.DateTime.Time(__c.DateTime.getNow());
 //BA.debugLineNum = 227;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"Select CUENT";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("Select CUENTA from cuentaa")));
 //BA.debugLineNum = 228;BA.debugLine="c.Position=0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 229;BA.debugLine="clie_id = c.GetString(\"CUENTA\")";
_clie_id = _c.GetString("CUENTA");
 //BA.debugLineNum = 230;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"select USUAR";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select USUARIO from usuarioa")));
 //BA.debugLineNum = 231;BA.debugLine="c.Position=0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 232;BA.debugLine="usuario = c.GetString(\"USUARIO\")";
_usuario = _c.GetString("USUARIO");
 //BA.debugLineNum = 233;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"select sum(p";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*medicomed.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, count(*) as CUANTOS FROM PEDIDO WHERE PE_CLIENTE IN (Select CUENTA from cuentaa)")));
 //BA.debugLineNum = 234;BA.debugLine="c.Position=0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 235;BA.debugLine="If c.GetString(\"CUANTOS\") > 0 Then";
if ((double)(Double.parseDouble(_c.GetString("CUANTOS")))>0) { 
 //BA.debugLineNum = 236;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"delete fro";
_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("delete from pedido_cliente where PC_CLIENTE In (select cuenta from cuentaa)");
 //BA.debugLineNum = 237;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"insert in";
_b4xpages._mainpage /*medicomed.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) VALUES (?,?,?,?,?,?,?)",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(_clie_id),(Object)(_sdate+_stime),(Object)(_usuario),(Object)(_c.GetString("CANT_CLIE")),(Object)(_c.GetString("TOTAL_CLIE")),(Object)(_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._lon_gps /*String*/ ),(Object)(_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._lat_gps /*String*/ )}));
 //BA.debugLineNum = 238;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"UPDATE kmt";
_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("UPDATE kmt_info set gestion = 0  where CAT_CL_CODIGO In (select cuenta from cuentaa)");
 }else {
 //BA.debugLineNum = 240;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"delete fro";
_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("delete from pedido_cliente where PC_CLIENTE In (select cuenta from cuentaa)");
 //BA.debugLineNum = 241;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"UPDATE kmt";
_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("UPDATE kmt_info set gestion = 0  where CAT_CL_CODIGO In (select cuenta from cuentaa)");
 };
 //BA.debugLineNum = 243;BA.debugLine="B4XPage_Appear";
_b4xpage_appear();
 };
 }else {
 //BA.debugLineNum = 246;BA.debugLine="ToastMessageShow(\"Pedido guardado, NO se puede e";
__c.ToastMessageShow(BA.ObjectToCharSequence("Pedido guardado, NO se puede editar."),__c.False);
 };
 //BA.debugLineNum = 248;BA.debugLine="End Sub";
return "";
}
public String  _p_nota_click() throws Exception{
 //BA.debugLineNum = 298;BA.debugLine="Private Sub p_nota_Click";
 //BA.debugLineNum = 300;BA.debugLine="End Sub";
return "";
}
public String  _regresar_click() throws Exception{
 //BA.debugLineNum = 137;BA.debugLine="Sub Regresar_Click";
 //BA.debugLineNum = 138;BA.debugLine="B4XPages.ShowPage(\"Cliente\")";
_b4xpages._showpage /*String*/ (ba,"Cliente");
 //BA.debugLineNum = 139;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]);
if (BA.fastSubCompare(sub, "GPS_LOCATIONCHANGED"))
	return _gps_locationchanged((anywheresoftware.b4a.gps.LocationWrapper) args[0]);
return BA.SubDelegator.SubNotFound;
}
}
