package gunav2.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, "gunav2.keymon.com.mx.c_nota");
            if (htSubs == null) {
                ba.loadHtSubs(this.getClass());
                htSubs = ba.htSubs;
            }
            
        }
        if (BA.isShellModeRuntimeCheck(ba)) 
			   this.getClass().getMethod("_class_globals", gunav2.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.sql.SQL.CursorWrapper _c2 = null;
public anywheresoftware.b4a.sql.SQL.CursorWrapper _j3 = null;
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 String _tipo_venta = "";
public anywheresoftware.b4a.objects.PanelWrapper _panel1 = null;
public anywheresoftware.b4a.objects.PanelWrapper _panel3 = null;
public anywheresoftware.b4a.objects.LabelWrapper _l_futuro = null;
public anywheresoftware.b4a.objects.LabelWrapper _l_preventa = null;
public anywheresoftware.b4a.objects.LabelWrapper _l_descacor = null;
public anywheresoftware.b4a.objects.LabelWrapper _l_descpre = null;
public anywheresoftware.b4a.objects.LabelWrapper _l_ocul = null;
public anywheresoftware.b4a.objects.LabelWrapper _l_desct = 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 String  _activity_pause(boolean _userclosed) throws Exception{
 //BA.debugLineNum = 393;BA.debugLine="Sub Activity_Pause (UserClosed As Boolean)";
 //BA.debugLineNum = 395;BA.debugLine="End Sub";
return "";
}
public String  _b_desc_click() throws Exception{
 //BA.debugLineNum = 1060;BA.debugLine="Sub b_desc_Click";
 //BA.debugLineNum = 1061;BA.debugLine="If DESCUENTO = \"MENOS\" Then";
if ((_descuento).equals("MENOS")) { 
 //BA.debugLineNum = 1062;BA.debugLine="DateTime.DateFormat = \"MM/dd/yyyy\"";
__c.DateTime.setDateFormat("MM/dd/yyyy");
 //BA.debugLineNum = 1063;BA.debugLine="sDate=DateTime.Date(DateTime.Now)";
_sdate = __c.DateTime.Date(__c.DateTime.getNow());
 //BA.debugLineNum = 1064;BA.debugLine="sTime=DateTime.Time(DateTime.Now)";
_stime = __c.DateTime.Time(__c.DateTime.getNow());
 //BA.debugLineNum = 1065;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 /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("Select CUENTA from cuentaa")));
 //BA.debugLineNum = 1066;BA.debugLine="c.Position=0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 1067;BA.debugLine="clie_id = c.GetString(\"CUENTA\")";
_clie_id = _c.GetString("CUENTA");
 //BA.debugLineNum = 1068;BA.debugLine="c.Close";
_c.Close();
 //BA.debugLineNum = 1069;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 /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select USUARIO from usuarioa")));
 //BA.debugLineNum = 1070;BA.debugLine="c.Position=0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 1071;BA.debugLine="usuario = c.GetString(\"USUARIO\")";
_usuario = _c.GetString("USUARIO");
 //BA.debugLineNum = 1072;BA.debugLine="c.Close";
_c.Close();
 //BA.debugLineNum = 1073;BA.debugLine="result =  Msgbox2(\"Seguro que desa dar descuento";
_result = BA.NumberToString(__c.Msgbox2(BA.ObjectToCharSequence("Seguro que desa dar descuento del 5%?"),BA.ObjectToCharSequence("Dar descuento"),"Si","","No",(android.graphics.Bitmap)(__c.LoadBitmap(__c.File.getDirAssets(),"alert2.png").getObject()),ba));
 //BA.debugLineNum = 1074;BA.debugLine="If result = DialogResponse.POSITIVE Then";
if ((_result).equals(BA.NumberToString(__c.DialogResponse.POSITIVE))) { 
 //BA.debugLineNum = 1075;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"UPDATE ped";
_b4xpages._mainpage /*gunav2.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 = 1076;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 /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select sum(pe_costo_tot) as TOTAL_CLIE, SUM(PE_CANT) AS CANT_CLIE, count(*) as CUANTOS FROM PEDIDO WHERE PE_CLIENTE IN (Select CUENTA from cuentaa)")));
 //BA.debugLineNum = 1077;BA.debugLine="c.Position=0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 1078;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"delete fro";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("delete from pedido_cliente where PC_CLIENTE In (select cuenta from cuentaa)");
 //BA.debugLineNum = 1079;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"insert in";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("insert into pedido_cliente(PC_CLIENTE, PC_FECHA, PC_USER, PC_NOART, PC_MONTO,PC_LON, PC_LAT) 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 /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._lon_gps /*String*/ ),(Object)(_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._lat_gps /*String*/ )}));
 //BA.debugLineNum = 1080;BA.debugLine="c.Close";
_c.Close();
 //BA.debugLineNum = 1081;BA.debugLine="B4XPage_Appear";
_b4xpage_appear();
 };
 }else if((_descuento).equals("MAS")) { 
 //BA.debugLineNum = 1084;BA.debugLine="DateTime.DateFormat = \"MM/dd/yyyy\"";
__c.DateTime.setDateFormat("MM/dd/yyyy");
 //BA.debugLineNum = 1085;BA.debugLine="sDate=DateTime.Date(DateTime.Now)";
_sdate = __c.DateTime.Date(__c.DateTime.getNow());
 //BA.debugLineNum = 1086;BA.debugLine="sTime=DateTime.Time(DateTime.Now)";
_stime = __c.DateTime.Time(__c.DateTime.getNow());
 //BA.debugLineNum = 1087;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 /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("Select CUENTA from cuentaa")));
 //BA.debugLineNum = 1088;BA.debugLine="c.Position=0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 1089;BA.debugLine="clie_id = c.GetString(\"CUENTA\")";
_clie_id = _c.GetString("CUENTA");
 //BA.debugLineNum = 1090;BA.debugLine="c.Close";
_c.Close();
 //BA.debugLineNum = 1091;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 /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select USUARIO from usuarioa")));
 //BA.debugLineNum = 1092;BA.debugLine="c.Position=0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 1093;BA.debugLine="usuario = c.GetString(\"USUARIO\")";
_usuario = _c.GetString("USUARIO");
 //BA.debugLineNum = 1094;BA.debugLine="c.Close";
_c.Close();
 //BA.debugLineNum = 1095;BA.debugLine="result =  Msgbox2(\"Seguro que desa CANCELAR el d";
_result = BA.NumberToString(__c.Msgbox2(BA.ObjectToCharSequence("Seguro que desa CANCELAR el descuento?"),BA.ObjectToCharSequence("Cancelar descuento"),"Si","","No",(android.graphics.Bitmap)(__c.LoadBitmap(__c.File.getDirAssets(),"alert2.png").getObject()),ba));
 //BA.debugLineNum = 1096;BA.debugLine="If result = DialogResponse.POSITIVE Then";
if ((_result).equals(BA.NumberToString(__c.DialogResponse.POSITIVE))) { 
 //BA.debugLineNum = 1097;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"UPDATE ped";
_b4xpages._mainpage /*gunav2.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 = 1098;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 /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select sum(pe_costo_tot) as TOTAL_CLIE, SUM(PE_CANT) AS CANT_CLIE, count(*) as CUANTOS FROM PEDIDO WHERE PE_CLIENTE IN (Select CUENTA from cuentaa)")));
 //BA.debugLineNum = 1099;BA.debugLine="c.Position=0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 1100;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"delete fro";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("delete from pedido_cliente where PC_CLIENTE In (select cuenta from cuentaa)");
 //BA.debugLineNum = 1101;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"insert in";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("insert into pedido_cliente(PC_CLIENTE, PC_FECHA, PC_USER, PC_NOART, PC_MONTO,PC_LON, PC_LAT) 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 /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._lon_gps /*String*/ ),(Object)(_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._lat_gps /*String*/ )}));
 //BA.debugLineNum = 1102;BA.debugLine="c.Close";
_c.Close();
 //BA.debugLineNum = 1103;BA.debugLine="B4XPage_Appear";
_b4xpage_appear();
 };
 };
 //BA.debugLineNum = 1106;BA.debugLine="End Sub";
return "";
}
public String  _b4xpage_appear() throws Exception{
anywheresoftware.b4a.objects.drawable.ColorDrawable _cd = null;
int _i = 0;
String _nombre = "";
String _cantidad = "";
String _folioitem = "";
String _cedis = "";
double _precio = 0;
int _colortitulo = 0;
anywheresoftware.b4a.objects.CSBuilder _cs = null;
anywheresoftware.b4a.sql.SQL.CursorWrapper _s3 = null;
anywheresoftware.b4a.sql.SQL.CursorWrapper _s = null;
anywheresoftware.b4a.sql.SQL.CursorWrapper _s5 = null;
anywheresoftware.b4a.sql.SQL.CursorWrapper _future = null;
 //BA.debugLineNum = 250;BA.debugLine="Sub B4XPage_Appear";
 //BA.debugLineNum = 253;BA.debugLine="b_desc.Visible = False";
_b_desc.setVisible(__c.False);
 //BA.debugLineNum = 255;BA.debugLine="If Not(Starter.gps.GPSEnabled) Then";
if (__c.Not(_starter._gps /*anywheresoftware.b4a.gps.GPS*/ .getGPSEnabled())) { 
 //BA.debugLineNum = 256;BA.debugLine="ToastMessageShow(\"Es necesario tener el GPS ence";
__c.ToastMessageShow(BA.ObjectToCharSequence("Es necesario tener el GPS encendido"),__c.True);
 //BA.debugLineNum = 257;BA.debugLine="StartActivity(Starter.gps.LocationSettingsIntent";
__c.StartActivity(ba,(Object)(_starter._gps /*anywheresoftware.b4a.gps.GPS*/ .getLocationSettingsIntent()));
 };
 //BA.debugLineNum = 260;BA.debugLine="p_nota.Height = Root.Height * 0.9";
_p_nota.setHeight((int) (_root.getHeight()*0.9));
 //BA.debugLineNum = 261;BA.debugLine="p_nota.Width = Root.Width * 0.9";
_p_nota.setWidth((int) (_root.getWidth()*0.9));
 //BA.debugLineNum = 262;BA.debugLine="Panel1.Visible = True";
_panel1.setVisible(__c.True);
 //BA.debugLineNum = 266;BA.debugLine="ListView1.Color = Colors.White";
_listview1.setColor(__c.Colors.White);
 //BA.debugLineNum = 269;BA.debugLine="Dim cd As ColorDrawable";
_cd = new anywheresoftware.b4a.objects.drawable.ColorDrawable();
 //BA.debugLineNum = 270;BA.debugLine="cd.Initialize(Colors.White, 0)";
_cd.Initialize(__c.Colors.White,(int) (0));
 //BA.debugLineNum = 271;BA.debugLine="ListView1.SingleLineLayout.Background = cd";
_listview1.getSingleLineLayout().Background = (android.graphics.drawable.Drawable)(_cd.getObject());
 //BA.debugLineNum = 274;BA.debugLine="ListView1.Clear";
_listview1.Clear();
 //BA.debugLineNum = 275;BA.debugLine="ListView1.Height = Root.Height * 0.55";
_listview1.setHeight((int) (_root.getHeight()*0.55));
 //BA.debugLineNum = 276;BA.debugLine="ListView1.SingleLineLayout.ItemHeight = 110dip";
_listview1.getSingleLineLayout().setItemHeight(__c.DipToCurrent((int) (110)));
 //BA.debugLineNum = 277;BA.debugLine="ListView1.SingleLineLayout.Label.Left = 15dip";
_listview1.getSingleLineLayout().Label.setLeft(__c.DipToCurrent((int) (15)));
 //BA.debugLineNum = 278;BA.debugLine="ListView1.SingleLineLayout.Label.Width = ListView";
_listview1.getSingleLineLayout().Label.setWidth((int) (_listview1.getWidth()-__c.DipToCurrent((int) (30))));
 //BA.debugLineNum = 282;BA.debugLine="Dim c As Cursor = B4XPages.MainPage.skmt.ExecQuer";
_c = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("SELECT PE_PRONOMBRE, PE_COSTO_TOT, PE_CANT, PE_FOLIO, PE_CEDIS, IFNULL(PE_RECALCULOTOT,0) AS PE_RECALCULOTOT FROM PEDIDO WHERE PE_CLIENTE IN (Select CUENTA from cuentaa) order by PE_CEDIS desc")));
 //BA.debugLineNum = 284;BA.debugLine="If c.RowCount > 0 Then";
if (_c.getRowCount()>0) { 
 //BA.debugLineNum = 285;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 = 286;BA.debugLine="c.Position = i";
_c.setPosition(_i);
 //BA.debugLineNum = 288;BA.debugLine="Dim Nombre As String = c.GetString(\"PE_PRONOMBR";
_nombre = _c.GetString("PE_PRONOMBRE");
 //BA.debugLineNum = 289;BA.debugLine="Dim Cantidad As String = c.GetString(\"PE_CANT\")";
_cantidad = _c.GetString("PE_CANT");
 //BA.debugLineNum = 290;BA.debugLine="Dim FolioItem As String = c.GetString(\"PE_FOLIO";
_folioitem = _c.GetString("PE_FOLIO");
 //BA.debugLineNum = 291;BA.debugLine="Dim Cedis As String = c.GetString(\"PE_CEDIS\")";
_cedis = _c.GetString("PE_CEDIS");
 //BA.debugLineNum = 293;BA.debugLine="Dim Precio As Double = IIf(c.GetDouble(\"PE_RECA";
_precio = (double)(BA.ObjectToNumber(((_c.GetDouble("PE_RECALCULOTOT")==0) ? ((Object)(_c.GetDouble("PE_COSTO_TOT"))) : ((Object)(_c.GetDouble("PE_RECALCULOTOT"))))));
 //BA.debugLineNum = 296;BA.debugLine="If c.GetString(\"PE_FOLIO\") = \"PREVENTA_FUTURA\"";
if ((_c.GetString("PE_FOLIO")).equals("PREVENTA_FUTURA")) { 
 //BA.debugLineNum = 297;BA.debugLine="Dim ColorTitulo As Int = Colors.Red";
_colortitulo = __c.Colors.Red;
 }else {
 //BA.debugLineNum = 299;BA.debugLine="Dim ColorTitulo As Int = Colors.Black";
_colortitulo = __c.Colors.Black;
 };
 //BA.debugLineNum = 301;BA.debugLine="If Cedis.Contains(\"PRO\") Or Not(IsNumber(Cedis)";
if (_cedis.contains("PRO") || __c.Not(__c.IsNumber(_cedis))) { 
 //BA.debugLineNum = 303;BA.debugLine="If c.GetString(\"PE_FOLIO\") = \"PREVENTA_FUTURA\"";
if ((_c.GetString("PE_FOLIO")).equals("PREVENTA_FUTURA")) { 
 //BA.debugLineNum = 305;BA.debugLine="ColorTitulo = Colors.RGB(166, 0, 0) ' Azul Fu";
_colortitulo = __c.Colors.RGB((int) (166),(int) (0),(int) (0));
 }else {
 //BA.debugLineNum = 307;BA.debugLine="ColorTitulo = Colors.RGB(0, 70, 180) ' Azul F";
_colortitulo = __c.Colors.RGB((int) (0),(int) (70),(int) (180));
 };
 };
 //BA.debugLineNum = 311;BA.debugLine="Dim cs As CSBuilder";
_cs = new anywheresoftware.b4a.objects.CSBuilder();
 //BA.debugLineNum = 312;BA.debugLine="cs.Initialize";
_cs.Initialize();
 //BA.debugLineNum = 314;BA.debugLine="cs.Size(19).Typeface(Typeface.DEFAULT_BOLD).Col";
_cs.Size((int) (19)).Typeface(__c.Typeface.DEFAULT_BOLD).Color(_colortitulo).Append(BA.ObjectToCharSequence(_nombre)).Pop().Pop();
 //BA.debugLineNum = 315;BA.debugLine="cs.Append(CRLF)";
_cs.Append(BA.ObjectToCharSequence(__c.CRLF));
 //BA.debugLineNum = 318;BA.debugLine="cs.Size(15).Color(Colors.RGB(50, 50, 50)).Appen";
_cs.Size((int) (15)).Color(__c.Colors.RGB((int) (50),(int) (50),(int) (50))).Append(BA.ObjectToCharSequence(" Cant: ")).Color(__c.Colors.Black).Append(BA.ObjectToCharSequence(_cantidad)).Append(BA.ObjectToCharSequence("   "));
 //BA.debugLineNum = 319;BA.debugLine="cs.Color(Colors.RGB(50, 50, 50)).Append(\"Total:";
_cs.Color(__c.Colors.RGB((int) (50),(int) (50),(int) (50))).Append(BA.ObjectToCharSequence("Total: ")).Color(__c.Colors.RGB((int) (0),(int) (120),(int) (0))).Typeface(__c.Typeface.DEFAULT_BOLD).Append(BA.ObjectToCharSequence("$"+__c.NumberFormat2(_precio,(int) (1),(int) (2),(int) (2),__c.True))).Pop().Pop().Pop();
 //BA.debugLineNum = 320;BA.debugLine="cs.Append(CRLF)";
_cs.Append(BA.ObjectToCharSequence(__c.CRLF));
 //BA.debugLineNum = 323;BA.debugLine="cs.Size(13).Color(Colors.RGB(100, 100, 100)).Ap";
_cs.Size((int) (13)).Color(__c.Colors.RGB((int) (100),(int) (100),(int) (100))).Append(BA.ObjectToCharSequence(" Folio: "+_folioitem+" | "+_cedis)).PopAll();
 //BA.debugLineNum = 325;BA.debugLine="ListView1.AddSingleLine(cs)";
_listview1.AddSingleLine(BA.ObjectToCharSequence(_cs.getObject()));
 }
};
 };
 //BA.debugLineNum = 328;BA.debugLine="c.Close";
_c.Close();
 //BA.debugLineNum = 330;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 /*gunav2.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 = 331;BA.debugLine="C.Position=0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 332;BA.debugLine="Existe = C.GetString(\"EXISTE\")";
_existe = _c.GetString("EXISTE");
 //BA.debugLineNum = 333;BA.debugLine="L_CANT.Text = 0";
_l_cant.setText(BA.ObjectToCharSequence(0));
 //BA.debugLineNum = 334;BA.debugLine="If Existe <> 0 Then";
if ((_existe).equals(BA.NumberToString(0)) == false) { 
 //BA.debugLineNum = 335;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 /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select SUM(PE_CANT) AS PE_CANT from pedido where pe_cliente in (Select CUENTA from cuentaa) AND PE_PROID NOT IN (SELECT CAT_PA_ID FROM PROMOS_COMP ) ")));
 //BA.debugLineNum = 336;BA.debugLine="C.Position=0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 337;BA.debugLine="L_CANT.Text = c.GetString(\"PE_CANT\")";
_l_cant.setText(BA.ObjectToCharSequence(_c.GetString("PE_CANT")));
 //BA.debugLineNum = 339;BA.debugLine="c.Close";
_c.Close();
 //BA.debugLineNum = 340;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 /*gunav2.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 = 341;BA.debugLine="c.Position=0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 342;BA.debugLine="DESC = c.GetString(\"DESCUENTO\")";
_desc = _c.GetString("DESCUENTO");
 //BA.debugLineNum = 343;BA.debugLine="b_desc.Visible = False";
_b_desc.setVisible(__c.False);
 //BA.debugLineNum = 346;BA.debugLine="Private s3 As Cursor=B4XPages.MainPage.skmt.Exec";
_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 IN (Select CUENTA from cuentaa) and PE_RECALCULO <> ? OR PE_RECALCULO <> ? OR PE_RECALCULO IS NOT NULL",new String[]{"","null"})));
 //BA.debugLineNum = 347;BA.debugLine="LogColor(s3.RowCount,Colors.Yellow)";
__c.LogImpl("437159009",BA.NumberToString(_s3.getRowCount()),__c.Colors.Yellow);
 //BA.debugLineNum = 348;BA.debugLine="If s3.RowCount > 0 Then";
if (_s3.getRowCount()>0) { 
 //BA.debugLineNum = 349;BA.debugLine="Private s As Cursor=B4XPages.MainPage.skmt.Exec";
_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 IN (Select CUENTA from cuentaa) and (PE_RECALCULO = ? or PE_RECALCULO = ? or PE_RECALCULO IS NULL)",new String[]{"","null"})));
 //BA.debugLineNum = 350;BA.debugLine="s.Position=0";
_s.setPosition((int) (0));
 //BA.debugLineNum = 351;BA.debugLine="Private s5 As Cursor = B4XPages.MainPage.skmt.E";
_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 FROM PEDIDO WHERE PE_CLIENTE IN (Select CUENTA from cuentaa) and (PE_RECALCULO <> ? or PE_RECALCULO <> ? OR PE_RECALCULO IS NOT NULL)",new String[]{"","null"})));
 //BA.debugLineNum = 352;BA.debugLine="s5.Position = 0";
_s5.setPosition((int) (0));
 //BA.debugLineNum = 353;BA.debugLine="L_TOTAL.Text =NumberFormat2(s.GetString(\"TOTAL_";
_l_total.setText(BA.ObjectToCharSequence(__c.NumberFormat2((double)(Double.parseDouble(_s.GetString("TOTAL_CLIE")))+(double)(Double.parseDouble(_s5.GetString("TOTAL_CLIE"))),(int) (0),(int) (2),(int) (2),__c.True)));
 //BA.debugLineNum = 354;BA.debugLine="s.Close";
_s.Close();
 }else if(_s3.getRowCount()==0) { 
 //BA.debugLineNum = 356;BA.debugLine="Private s As Cursor=B4XPages.MainPage.skmt.Exec";
_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*/ .ExecQuery("select iFNULL(sum(pe_costo_tot),0) as TOTAL_CLIE, SUM(PE_CANT) AS CANT_CLIE FROM PEDIDO WHERE PE_CLIENTE IN (Select CUENTA from cuentaa)")));
 //BA.debugLineNum = 357;BA.debugLine="s.Position=0";
_s.setPosition((int) (0));
 //BA.debugLineNum = 358;BA.debugLine="L_TOTAL.Text =NumberFormat2(s.GetString(\"TOTAL_";
_l_total.setText(BA.ObjectToCharSequence(__c.NumberFormat2((double)(Double.parseDouble(_s.GetString("TOTAL_CLIE"))),(int) (0),(int) (2),(int) (2),__c.True)));
 //BA.debugLineNum = 359;BA.debugLine="s.Close";
_s.Close();
 };
 //BA.debugLineNum = 362;BA.debugLine="L_TOTAL.text = Subs.calculaTotalConPromoXRango(S";
_l_total.setText(BA.ObjectToCharSequence(_subs._calculatotalconpromoxrango /*String*/ (ba,_subs._traecliente /*String*/ (ba))));
 };
 //BA.debugLineNum = 368;BA.debugLine="L_TOTAL.Text = Subs.calculaTotalConPromoXRango(Su";
_l_total.setText(BA.ObjectToCharSequence(_subs._calculatotalconpromoxrango /*String*/ (ba,_subs._traecliente /*String*/ (ba))));
 //BA.debugLineNum = 370;BA.debugLine="Dim future As Cursor = B4XPages.MainPage.skmt.Exe";
_future = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_future = (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 CAT_VA_VALOR from CAT_VARIABLES WHERE CAT_VA_DESCRIPCION = ?",new String[]{"VENTAFUTURA"})));
 //BA.debugLineNum = 371;BA.debugLine="If future.RowCount > 0 Then";
if (_future.getRowCount()>0) { 
 //BA.debugLineNum = 372;BA.debugLine="future.Position = 0";
_future.setPosition((int) (0));
 //BA.debugLineNum = 373;BA.debugLine="If future.GetInt(\"CAT_VA_VALOR\") = 1 Then";
if (_future.GetInt("CAT_VA_VALOR")==1) { 
 //BA.debugLineNum = 374;BA.debugLine="Panel3.Visible = True";
_panel3.setVisible(__c.True);
 //BA.debugLineNum = 375;BA.debugLine="l_ocul.Visible = False";
_l_ocul.setVisible(__c.False);
 //BA.debugLineNum = 376;BA.debugLine="l_desct.Visible = False";
_l_desct.setVisible(__c.False);
 //BA.debugLineNum = 377;BA.debugLine="l_descacor.Text = NumberFormat2( (Subs.calculaT";
_l_descacor.setText(BA.ObjectToCharSequence(__c.NumberFormat2(((double)(Double.parseDouble(_subs._calculatotalconpromoxrango4 /*String*/ (ba,_subs._traecliente /*String*/ (ba))))-(double)(Double.parseDouble(_subs._calculatotalconpromoxrango1 /*String*/ (ba,_subs._traecliente /*String*/ (ba))))),(int) (0),(int) (2),(int) (2),__c.False)));
 //BA.debugLineNum = 378;BA.debugLine="l_descpre.Text = NumberFormat2( (Subs.calculaTo";
_l_descpre.setText(BA.ObjectToCharSequence(__c.NumberFormat2(((double)(Double.parseDouble(_subs._calculatotalconpromoxrango3 /*String*/ (ba,_subs._traecliente /*String*/ (ba))))-(double)(Double.parseDouble(_subs._calculatotalconpromoxrango2 /*String*/ (ba,_subs._traecliente /*String*/ (ba))))),(int) (0),(int) (2),(int) (2),__c.False)));
 //BA.debugLineNum = 379;BA.debugLine="L_PREVENTA.Text = Subs.calculaTotalConPromoXRan";
_l_preventa.setText(BA.ObjectToCharSequence(_subs._calculatotalconpromoxrango2 /*String*/ (ba,_subs._traecliente /*String*/ (ba))));
 //BA.debugLineNum = 380;BA.debugLine="L_FUTURO.Text = Subs.calculaTotalConPromoXRango";
_l_futuro.setText(BA.ObjectToCharSequence(_subs._calculatotalconpromoxrango1 /*String*/ (ba,_subs._traecliente /*String*/ (ba))));
 }else if(_future.GetInt("CAT_VA_VALOR")==0) { 
 //BA.debugLineNum = 382;BA.debugLine="Panel3.Visible = False";
_panel3.setVisible(__c.False);
 //BA.debugLineNum = 383;BA.debugLine="l_ocul.Visible = True";
_l_ocul.setVisible(__c.True);
 //BA.debugLineNum = 384;BA.debugLine="l_desct.Visible = True";
_l_desct.setVisible(__c.True);
 //BA.debugLineNum = 385;BA.debugLine="l_desct.Text = NumberFormat2( (Subs.calculaTota";
_l_desct.setText(BA.ObjectToCharSequence(__c.NumberFormat2(((double)(Double.parseDouble(_subs._calculatotalconpromoxrango3 /*String*/ (ba,_subs._traecliente /*String*/ (ba))))-(double)(Double.parseDouble(_subs._calculatotalconpromoxrango2 /*String*/ (ba,_subs._traecliente /*String*/ (ba))))),(int) (0),(int) (2),(int) (2),__c.False)));
 //BA.debugLineNum = 386;BA.debugLine="L_PREVENTA.Text = Subs.calculaTotalConPromoXRan";
_l_preventa.setText(BA.ObjectToCharSequence(_subs._calculatotalconpromoxrango2 /*String*/ (ba,_subs._traecliente /*String*/ (ba))));
 //BA.debugLineNum = 387;BA.debugLine="L_FUTURO.Text = Subs.calculaTotalConPromoXRango";
_l_futuro.setText(BA.ObjectToCharSequence(_subs._calculatotalconpromoxrango1 /*String*/ (ba,_subs._traecliente /*String*/ (ba))));
 };
 };
 //BA.debugLineNum = 391;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(gunav2.keymon.com.mx.c_nota parent) {
this.parent = parent;
}
gunav2.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 = 409;BA.debugLine="B4XPages.ShowPage(\"Cliente\")";
parent._b4xpages._showpage /*String*/ (ba,"Cliente");
 //BA.debugLineNum = 410;BA.debugLine="Return False";
if (true) {
parent.__c.ReturnFromResumableSub(this,(Object)(parent.__c.False));return;};
 //BA.debugLineNum = 411;BA.debugLine="End Sub";
if (true) break;

            }
        }
    }
}
public String  _b4xpage_created(anywheresoftware.b4a.objects.B4XViewWrapper _root1) throws Exception{
 //BA.debugLineNum = 48;BA.debugLine="Private Sub B4XPage_Created (Root1 As B4XView)";
 //BA.debugLineNum = 49;BA.debugLine="Root = Root1";
_root = _root1;
 //BA.debugLineNum = 50;BA.debugLine="ruta = File.DirInternal";
_ruta = __c.File.getDirInternal();
 //BA.debugLineNum = 51;BA.debugLine="Root.LoadLayout(\"nota\")";
_root.LoadLayout("nota",ba);
 //BA.debugLineNum = 52;BA.debugLine="borra.Visible = True";
_borra.setVisible(__c.True);
 //BA.debugLineNum = 53;BA.debugLine="Titulo.Text = \"Pedido Actual\"";
_titulo.setText(BA.ObjectToCharSequence("Pedido Actual"));
 //BA.debugLineNum = 60;BA.debugLine="End Sub";
return "";
}
public String  _borra_click() throws Exception{
int _i = 0;
 //BA.debugLineNum = 413;BA.debugLine="Sub borra_Click";
 //BA.debugLineNum = 418;BA.debugLine="If Not(Subs.revisaImpreso) Then";
if (__c.Not(_subs._revisaimpreso /*boolean*/ (ba))) { 
 //BA.debugLineNum = 420;BA.debugLine="result =  Msgbox2(\"Seguro que desa borrar el pe";
_result = BA.NumberToString(__c.Msgbox2(BA.ObjectToCharSequence("Seguro que desa borrar el pedido?"),BA.ObjectToCharSequence("Cancelar pedido"),"Si","","No",(android.graphics.Bitmap)(__c.LoadBitmap(__c.File.getDirAssets(),"alert2.png").getObject()),ba));
 //BA.debugLineNum = 421;BA.debugLine="If result = DialogResponse.POSITIVE Then";
if ((_result).equals(BA.NumberToString(__c.DialogResponse.POSITIVE))) { 
 //BA.debugLineNum = 422;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"select PE_";
_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 PE_PROID,PE_CANT FROM PEDIDO where pe_cliente in (Select CUENTA from cuentaa) AND PE_CEDIS <> 'DUR'")));
 //BA.debugLineNum = 423;BA.debugLine="If c.RowCount>0 Then";
if (_c.getRowCount()>0) { 
 //BA.debugLineNum = 424;BA.debugLine="For i=0 To c.RowCount -1";
{
final int step6 = 1;
final int limit6 = (int) (_c.getRowCount()-1);
_i = (int) (0) ;
for (;_i <= limit6 ;_i = _i + step6 ) {
 //BA.debugLineNum = 425;BA.debugLine="c.Position=i";
_c.setPosition(_i);
 //BA.debugLineNum = 426;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2($\"updat";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2(("update "+__c.SmartStringFormatter("",(Object)(_subs._traetablaprods /*String*/ (ba,_tipo_venta)))+" set cat_gp_almacen = cat_gp_almacen + ? where cat_gp_id = ?"),anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(_c.GetString("PE_CANT")),(Object)(_c.GetString("PE_PROID"))}));
 //BA.debugLineNum = 427;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"INSERT";
_b4xpages._mainpage /*gunav2.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)(_almacen),(Object)(_c.GetString("PE_PROID")),(Object)((double)(Double.parseDouble(_c.GetString("PE_CANT")))*-1)}));
 }
};
 };
 //BA.debugLineNum = 430;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"delete fr";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("delete from pedido_cliente where pc_cliente in (Select CUENTA from cuentaa)");
 //BA.debugLineNum = 431;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"delete fr";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("delete from pedido where pe_cliente in (Select CUENTA from cuentaa)");
 //BA.debugLineNum = 432;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"UPDATE km";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("UPDATE kmt_info3 set gestion = 0  where CAT_CL_CODIGO In (select cuenta from cuentaa)");
 //BA.debugLineNum = 433;BA.debugLine="B4XPage_Appear";
_b4xpage_appear();
 };
 }else {
 //BA.debugLineNum = 439;BA.debugLine="Log(\"Aqui\")";
__c.LogImpl("437486618","Aqui",0);
 //BA.debugLineNum = 440;BA.debugLine="Log(Subs.traeAlmacen)";
__c.LogImpl("437486619",_subs._traealmacen /*String*/ (ba),0);
 //BA.debugLineNum = 441;BA.debugLine="If Subs.traeAlmacen = 94 Then";
if ((_subs._traealmacen /*String*/ (ba)).equals(BA.NumberToString(94))) { 
 //BA.debugLineNum = 442;BA.debugLine="Log(\"Aqui\")";
__c.LogImpl("437486621","Aqui",0);
 //BA.debugLineNum = 444;BA.debugLine="result =  Msgbox2(\"Seguro que desa borrar el p";
_result = BA.NumberToString(__c.Msgbox2(BA.ObjectToCharSequence("Seguro que desa borrar el pedido?"),BA.ObjectToCharSequence("Cancelar pedido"),"Si","","No",(android.graphics.Bitmap)(__c.LoadBitmap(__c.File.getDirAssets(),"alert2.png").getObject()),ba));
 //BA.debugLineNum = 445;BA.debugLine="If result = DialogResponse.POSITIVE Then";
if ((_result).equals(BA.NumberToString(__c.DialogResponse.POSITIVE))) { 
 //BA.debugLineNum = 446;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"select PE";
_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 PE_PROID,PE_CANT FROM PEDIDO where pe_cliente in (Select CUENTA from cuentaa) AND PE_CEDIS <> 'DUR'")));
 //BA.debugLineNum = 447;BA.debugLine="If c.RowCount>0 Then";
if (_c.getRowCount()>0) { 
 //BA.debugLineNum = 448;BA.debugLine="For i=0 To c.RowCount -1";
{
final int step26 = 1;
final int limit26 = (int) (_c.getRowCount()-1);
_i = (int) (0) ;
for (;_i <= limit26 ;_i = _i + step26 ) {
 //BA.debugLineNum = 449;BA.debugLine="c.Position=i";
_c.setPosition(_i);
 //BA.debugLineNum = 450;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2($\"upda";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2(("update "+__c.SmartStringFormatter("",(Object)(_subs._traetablaprods /*String*/ (ba,_tipo_venta)))+" set cat_gp_almacen = cat_gp_almacen + ? where cat_gp_id = ?"),anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(_c.GetString("PE_CANT")),(Object)(_c.GetString("PE_PROID"))}));
 //BA.debugLineNum = 451;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"INSER";
_b4xpages._mainpage /*gunav2.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)(_almacen),(Object)(_c.GetString("PE_PROID")),(Object)((double)(Double.parseDouble(_c.GetString("PE_CANT")))*-1)}));
 }
};
 };
 //BA.debugLineNum = 454;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"delete f";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("delete from pedido_cliente where pc_cliente in (Select CUENTA from cuentaa)");
 //BA.debugLineNum = 455;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"delete f";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("delete from pedido where pe_cliente in (Select CUENTA from cuentaa)");
 //BA.debugLineNum = 456;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"UPDATE k";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("UPDATE kmt_info3 set gestion = 0  where CAT_CL_CODIGO In (select cuenta from cuentaa)");
 //BA.debugLineNum = 457;BA.debugLine="Starter.skmt.ExecNonQuery(\"Update kmt_info3 se";
_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("Update kmt_info3 set CONFIRMADO = 0  WHERE CAT_CL_CODIGO IN (SELECT CUENTA FROM CUENTAA)");
 //BA.debugLineNum = 458;BA.debugLine="Starter.skmt.ExecNonQuery(\"Update CODIGOS_CRED";
_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("Update CODIGOS_CREDITO set BANDERA = 0  WHERE CLIENTE IN (SELECT CUENTA FROM CUENTAA)");
 //BA.debugLineNum = 459;BA.debugLine="B4XPage_Appear";
_b4xpage_appear();
 };
 }else {
 //BA.debugLineNum = 465;BA.debugLine="Log(\"aqui\")";
__c.LogImpl("437486644","aqui",0);
 //BA.debugLineNum = 466;BA.debugLine="ToastMessageShow(\"La venta ya esta impresa, no";
__c.ToastMessageShow(BA.ObjectToCharSequence("La venta ya esta impresa, no se puede modificar!!"),__c.True);
 //BA.debugLineNum = 467;BA.debugLine="B4XPages.MainPage.cliente.p_transparenteTicketI";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._cliente /*gunav2.keymon.com.mx.c_cliente*/ ._p_transparenteticketimpreso /*anywheresoftware.b4a.objects.PanelWrapper*/ .setVisible(__c.True);
 //BA.debugLineNum = 468;BA.debugLine="B4XPages.ShowPage(\"cliente\")";
_b4xpages._showpage /*String*/ (ba,"cliente");
 };
 };
 //BA.debugLineNum = 513;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 = 23;BA.debugLine="Dim c2, j3 As Cursor";
_c2 = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_j3 = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
 //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 tipo_venta As String = Subs.traeTipoVentaDeBD";
_tipo_venta = _subs._traetipoventadebd /*String*/ (ba);
 //BA.debugLineNum = 32;BA.debugLine="Private Panel1 As Panel";
_panel1 = new anywheresoftware.b4a.objects.PanelWrapper();
 //BA.debugLineNum = 33;BA.debugLine="Private Panel3 As Panel";
_panel3 = new anywheresoftware.b4a.objects.PanelWrapper();
 //BA.debugLineNum = 34;BA.debugLine="Private L_FUTURO As Label";
_l_futuro = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 35;BA.debugLine="Private L_PREVENTA As Label";
_l_preventa = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 36;BA.debugLine="Private l_descacor As Label";
_l_descacor = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 37;BA.debugLine="Private l_descpre As Label";
_l_descpre = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 38;BA.debugLine="Private l_ocul As Label";
_l_ocul = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 39;BA.debugLine="Private l_desct As Label";
_l_desct = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 40;BA.debugLine="End Sub";
return "";
}
public String  _gps_locationchanged(anywheresoftware.b4a.gps.LocationWrapper _location1) throws Exception{
 //BA.debugLineNum = 397;BA.debugLine="Sub GPS_LocationChanged (Location1 As Location)";
 //BA.debugLineNum = 400;BA.debugLine="End Sub";
return "";
}
public Object  _initialize(anywheresoftware.b4a.BA _ba) throws Exception{
innerInitialize(_ba);
 //BA.debugLineNum = 43;BA.debugLine="Public Sub Initialize As Object";
 //BA.debugLineNum = 44;BA.debugLine="Return Me";
if (true) return this;
 //BA.debugLineNum = 45;BA.debugLine="End Sub";
return null;
}
public String  _listview1_itemlongclick(int _position,Object _value) throws Exception{
String[] _x = null;
String _nom = "";
int _i = 0;
String _palabrafinal = "";
String _cedis = "";
String _foliu = "";
anywheresoftware.b4a.sql.SQL.CursorWrapper _cx = null;
int _j = 0;
 //BA.debugLineNum = 515;BA.debugLine="Sub ListView1_ItemLongClick (Position As Int, Valu";
 //BA.debugLineNum = 516;BA.debugLine="Log(Subs.traeTablaProds(tipo_venta))";
__c.LogImpl("437552129",_subs._traetablaprods /*String*/ (ba,_tipo_venta),0);
 //BA.debugLineNum = 517;BA.debugLine="Log(Value)";
__c.LogImpl("437552130",BA.ObjectToString(_value),0);
 //BA.debugLineNum = 518;BA.debugLine="Private X() As String = Regex.Split(\" \", Value)";
_x = __c.Regex.Split(" ",BA.ObjectToString(_value));
 //BA.debugLineNum = 519;BA.debugLine="Private nom As String = \"\"";
_nom = "";
 //BA.debugLineNum = 521;BA.debugLine="For i = 0 To X.Length - 1";
{
final int step5 = 1;
final int limit5 = (int) (_x.length-1);
_i = (int) (0) ;
for (;_i <= limit5 ;_i = _i + step5 ) {
 //BA.debugLineNum = 522;BA.debugLine="If Not(X(i).Contains(CRLF)) Then";
if (__c.Not(_x[_i].contains(__c.CRLF))) { 
 //BA.debugLineNum = 524;BA.debugLine="nom = nom & \" \" & X(i)";
_nom = _nom+" "+_x[_i];
 }else {
 //BA.debugLineNum = 528;BA.debugLine="Dim palabraFinal As String = X(i).Replace(CRLF,";
_palabrafinal = _x[_i].replace(__c.CRLF,"");
 //BA.debugLineNum = 531;BA.debugLine="nom = nom & \" \" & palabraFinal";
_nom = _nom+" "+_palabrafinal;
 //BA.debugLineNum = 533;BA.debugLine="Exit";
if (true) break;
 };
 }
};
 //BA.debugLineNum = 536;BA.debugLine="nom = nom.Trim";
_nom = _nom.trim();
 //BA.debugLineNum = 537;BA.debugLine="Private cedis As String = X(X.Length-1)";
_cedis = _x[(int) (_x.length-1)];
 //BA.debugLineNum = 538;BA.debugLine="Private foliu As String = X(X.Length-3)";
_foliu = _x[(int) (_x.length-3)];
 //BA.debugLineNum = 539;BA.debugLine="Log(nom)";
__c.LogImpl("437552152",_nom,0);
 //BA.debugLineNum = 540;BA.debugLine="Log(cedis)";
__c.LogImpl("437552153",_cedis,0);
 //BA.debugLineNum = 541;BA.debugLine="Log(foliu)";
__c.LogImpl("437552154",_foliu,0);
 //BA.debugLineNum = 542;BA.debugLine="Dim cx As Cursor = B4XPages.MainPage.skmt.ExecQue";
_cx = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_cx = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery(("select PE_PROID,PE_CANT, PE_FOLIO, PE_CEDIS, PE_PRONOMBRE, PE_CEDIS/1 AS is_numeric FROM PEDIDO where (pe_pronombre = '"+__c.SmartStringFormatter("",(Object)(_nom))+"' or pe_pronombre = '"+__c.SmartStringFormatter("",(Object)(_nom))+" ') AND PE_CEDIS = '"+__c.SmartStringFormatter("",(Object)(_cedis))+"' and is_numeric > 0 and pe_cliente in (Select CUENTA from cuentaa) and PE_RECALCULO > 0"))));
 //BA.debugLineNum = 543;BA.debugLine="Log(\"Recalculados: \" & cx.RowCount)";
__c.LogImpl("437552156","Recalculados: "+BA.NumberToString(_cx.getRowCount()),0);
 //BA.debugLineNum = 544;BA.debugLine="If cx.RowCount > 0 Then ' Si hay recalculo (produ";
if (_cx.getRowCount()>0) { 
 //BA.debugLineNum = 545;BA.debugLine="result =  Msgbox2(\"Si se borra este producto, se";
_result = BA.NumberToString(__c.Msgbox2(BA.ObjectToCharSequence("Si se borra este producto, se va a borrar el pedido COMPLETO, ¿desea continuar?"),BA.ObjectToCharSequence("Borrar pedido completo"),"Si","","No",(android.graphics.Bitmap)(__c.LoadBitmap(__c.File.getDirAssets(),"alert2.png").getObject()),ba));
 //BA.debugLineNum = 546;BA.debugLine="If result = DialogResponse.NEGATIVE Then";
if ((_result).equals(BA.NumberToString(__c.DialogResponse.NEGATIVE))) { 
 //BA.debugLineNum = 547;BA.debugLine="Return";
if (true) return "";
 }else {
 //BA.debugLineNum = 549;BA.debugLine="Starter.skmt.ExecNonQuery(\"delete from pedido w";
_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("delete from pedido where pe_cliente in (Select CUENTA from cuentaa)");
 //BA.debugLineNum = 550;BA.debugLine="Starter.skmt.ExecNonQuery(\"delete from pedido_c";
_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("delete from pedido_cliente where pc_cliente in (Select CUENTA from cuentaa)");
 //BA.debugLineNum = 551;BA.debugLine="B4XPage_Appear";
_b4xpage_appear();
 //BA.debugLineNum = 552;BA.debugLine="Return";
if (true) return "";
 };
 };
 //BA.debugLineNum = 555;BA.debugLine="c = B4XPages.MainPage.skmt.ExecQuery(\"SELECT HABI";
_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 HABILITADA FROM IMPRESORA")));
 //BA.debugLineNum = 556;BA.debugLine="If c.RowCount >  0 Then";
if (_c.getRowCount()>0) { 
 //BA.debugLineNum = 557;BA.debugLine="c.Position = 0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 558;BA.debugLine="If c.GetString(\"HABILITADA\") = 1 Then";
if ((_c.GetString("HABILITADA")).equals(BA.NumberToString(1))) { 
 //BA.debugLineNum = 559;BA.debugLine="If Not(Subs.revisaImpreso) Then";
if (__c.Not(_subs._revisaimpreso /*boolean*/ (ba))) { 
 //BA.debugLineNum = 560;BA.debugLine="result =  Msgbox2(\"Seguro que desea borrar est";
_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 = 561;BA.debugLine="If result = DialogResponse.POSITIVE Then";
if ((_result).equals(BA.NumberToString(__c.DialogResponse.POSITIVE))) { 
 //BA.debugLineNum = 562;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery($\"select P";
_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 PE_PROID,PE_CANT, PE_FOLIO, PE_CEDIS, PE_PRONOMBRE FROM PEDIDO where (pe_pronombre = '"+__c.SmartStringFormatter("",(Object)(_nom))+"' or pe_pronombre = '"+__c.SmartStringFormatter("",(Object)(_nom))+" ') AND PE_CEDIS = '"+__c.SmartStringFormatter("",(Object)(_cedis))+"' AND PE_FOLIO = '"+__c.SmartStringFormatter("",(Object)(_foliu))+"' and pe_cliente in (Select CUENTA from cuentaa)"))));
 //BA.debugLineNum = 563;BA.debugLine="Log($\"select PE_PROID,PE_CANT, PE_FOLIO, PE_C";
__c.LogImpl("437552176",("select PE_PROID,PE_CANT, PE_FOLIO, PE_CEDIS, PE_PRONOMBRE FROM PEDIDO where (pe_pronombre = '"+__c.SmartStringFormatter("",(Object)(_nom))+"' or pe_pronombre = '"+__c.SmartStringFormatter("",(Object)(_nom))+"') AND PE_CEDIS = '"+__c.SmartStringFormatter("",(Object)(_cedis))+"' AND PE_FOLIO = '"+__c.SmartStringFormatter("",(Object)(_foliu))+"' and pe_cliente in (Select CUENTA from cuentaa)"),0);
 //BA.debugLineNum = 564;BA.debugLine="Log(c.RowCount)";
__c.LogImpl("437552177",BA.NumberToString(_c.getRowCount()),0);
 //BA.debugLineNum = 565;BA.debugLine="Log(\"AQUI ESTOY\")";
__c.LogImpl("437552178","AQUI ESTOY",0);
 //BA.debugLineNum = 566;BA.debugLine="Log(cedis)";
__c.LogImpl("437552179",_cedis,0);
 //BA.debugLineNum = 567;BA.debugLine="Log(foliu)";
__c.LogImpl("437552180",_foliu,0);
 //BA.debugLineNum = 568;BA.debugLine="Log(nom)";
__c.LogImpl("437552181",_nom,0);
 //BA.debugLineNum = 570;BA.debugLine="c.Position=0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 573;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"INSERT";
_b4xpages._mainpage /*gunav2.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)(_almacen),(Object)(_c.GetString("PE_PROID")),(Object)((double)(Double.parseDouble(_c.GetString("PE_CANT")))*-1)}));
 //BA.debugLineNum = 580;BA.debugLine="If Not(IsNumber(cedis)) Then";
if (__c.Not(__c.IsNumber(_cedis))) { 
 //BA.debugLineNum = 581;BA.debugLine="j3 = B4XPages.MainPage.skmt.ExecQuery2(\"SELE";
_j3 = (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 PE_CEDIS, PE_CANT,PE_PROID, PE_PRONOMBRE, PE_FOLIO FROM PEDIDO WHERE PE_CEDIS IN (SELECT PE_CEDIS FROM PEDIDO WHERE PE_CEDIS = ?)",new String[]{_cedis})));
 //BA.debugLineNum = 582;BA.debugLine="Log(j3.RowCount)";
__c.LogImpl("437552195",BA.NumberToString(_j3.getRowCount()),0);
 //BA.debugLineNum = 583;BA.debugLine="If j3.RowCount > 0 Then";
if (_j3.getRowCount()>0) { 
 //BA.debugLineNum = 584;BA.debugLine="Log(\"Soy promo\")";
__c.LogImpl("437552197","Soy promo",0);
 //BA.debugLineNum = 585;BA.debugLine="For j = 0 To j3.RowCount -1";
{
final int step54 = 1;
final int limit54 = (int) (_j3.getRowCount()-1);
_j = (int) (0) ;
for (;_j <= limit54 ;_j = _j + step54 ) {
 //BA.debugLineNum = 586;BA.debugLine="Log(\"aqui tronare?\")";
__c.LogImpl("437552199","aqui tronare?",0);
 //BA.debugLineNum = 587;BA.debugLine="j3.Position = j";
_j3.setPosition(_j);
 //BA.debugLineNum = 589;BA.debugLine="Log(nom)";
__c.LogImpl("437552202",_nom,0);
 //BA.debugLineNum = 590;BA.debugLine="If cedis <> \"DUR\" Then";
if ((_cedis).equals("DUR") == false) { 
 //BA.debugLineNum = 592;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery($\"upd";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("update "+__c.SmartStringFormatter("",(Object)(_subs._traetablaprods /*String*/ (ba,_tipo_venta)))+" 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 = 593;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery($\"del";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("delete from pedido where pe_cedis= '"+__c.SmartStringFormatter("",(Object)(_cedis))+"' and pe_cliente in (Select CUENTA from cuentaa) AND PE_FOLIO = '"+__c.SmartStringFormatter("",(Object)(_foliu))+"' AND PE_PROID = '"+__c.SmartStringFormatter("",(Object)(_j3.GetString("PE_PROID")))+"'"));
 //BA.debugLineNum = 594;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"del";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("delete from pedido where pe_cedis= ? and pe_cliente in (Select CUENTA from cuentaa) AND PE_FOLIO = ?",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(_cedis),(Object)(_foliu)}));
 }else {
 //BA.debugLineNum = 596;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"del";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("delete from pedido where pe_cedis= ? and pe_cliente in (Select CUENTA from cuentaa) AND PE_FOLIO = ?",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(_cedis),(Object)(_foliu)}));
 };
 }
};
 };
 //BA.debugLineNum = 600;BA.debugLine="j3.Close";
_j3.Close();
 }else {
 //BA.debugLineNum = 602;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery($\"update";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("update "+__c.SmartStringFormatter("",(Object)(_subs._traetablaprods /*String*/ (ba,_tipo_venta)))+" 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 = 603;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"delete";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("delete from pedido where pe_pronombre = ? and pe_cedis = ? and pe_cliente in (Select CUENTA from cuentaa) AND PE_FOLIO = ?",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(_nom),(Object)(_cedis),(Object)(_foliu)}));
 };
 //BA.debugLineNum = 605;BA.debugLine="c.Close";
_c.Close();
 //BA.debugLineNum = 607;BA.debugLine="DateTime.DateFormat = \"MM/dd/yyyy\"";
__c.DateTime.setDateFormat("MM/dd/yyyy");
 //BA.debugLineNum = 608;BA.debugLine="sDate=DateTime.Date(DateTime.Now)";
_sdate = __c.DateTime.Date(__c.DateTime.getNow());
 //BA.debugLineNum = 609;BA.debugLine="sTime=DateTime.Time(DateTime.Now)";
_stime = __c.DateTime.Time(__c.DateTime.getNow());
 //BA.debugLineNum = 610;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"Select CU";
_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 CUENTA from cuentaa")));
 //BA.debugLineNum = 611;BA.debugLine="c.Position=0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 612;BA.debugLine="clie_id = c.GetString(\"CUENTA\")";
_clie_id = _c.GetString("CUENTA");
 //BA.debugLineNum = 613;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"select US";
_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 USUARIO from usuarioa")));
 //BA.debugLineNum = 614;BA.debugLine="c.Position=0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 615;BA.debugLine="usuario = c.GetString(\"USUARIO\")";
_usuario = _c.GetString("USUARIO");
 //BA.debugLineNum = 616;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"select su";
_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 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 = 617;BA.debugLine="c.Position=0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 618;BA.debugLine="If c.GetString(\"CUANTOS\") > 0 Then";
if ((double)(Double.parseDouble(_c.GetString("CUANTOS")))>0) { 
 //BA.debugLineNum = 619;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"delete";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("delete from pedido_cliente where PC_CLIENTE In (select cuenta from cuentaa)");
 //BA.debugLineNum = 620;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"insert";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("insert into pedido_cliente(PC_CLIENTE, PC_FECHA, PC_USER, PC_NOART, PC_MONTO,PC_LON, PC_LAT) 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 /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._lon_gps /*String*/ ),(Object)(_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._lat_gps /*String*/ )}));
 //BA.debugLineNum = 621;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"UPDATE";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("UPDATE kmt_info3 set gestion = 2  where CAT_CL_CODIGO In (select cuenta from cuentaa)");
 }else {
 //BA.debugLineNum = 623;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"delete";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("delete from pedido_cliente where PC_CLIENTE In (select cuenta from cuentaa)");
 //BA.debugLineNum = 624;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"UPDATE";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("UPDATE kmt_info3 set gestion = 0  where CAT_CL_CODIGO In (select cuenta from cuentaa)");
 };
 //BA.debugLineNum = 626;BA.debugLine="B4XPage_Appear";
_b4xpage_appear();
 };
 }else {
 //BA.debugLineNum = 630;BA.debugLine="If Subs.traeAlmacen = 94 Then";
if ((_subs._traealmacen /*String*/ (ba)).equals(BA.NumberToString(94))) { 
 //BA.debugLineNum = 631;BA.debugLine="result =  Msgbox2(\"Seguro que desea borrar es";
_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 = 632;BA.debugLine="If result = DialogResponse.POSITIVE Then";
if ((_result).equals(BA.NumberToString(__c.DialogResponse.POSITIVE))) { 
 //BA.debugLineNum = 633;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery($\"select";
_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 PE_PROID,PE_CANT, PE_FOLIO, PE_CEDIS, PE_PRONOMBRE FROM PEDIDO where (pe_pronombre = '"+__c.SmartStringFormatter("",(Object)(_nom))+"' or pe_pronombre = '"+__c.SmartStringFormatter("",(Object)(_nom))+" ') AND PE_CEDIS = '"+__c.SmartStringFormatter("",(Object)(_cedis))+"' AND PE_FOLIO = '"+__c.SmartStringFormatter("",(Object)(_foliu))+"' and pe_cliente in (Select CUENTA from cuentaa)"))));
 //BA.debugLineNum = 634;BA.debugLine="Log($\"select PE_PROID,PE_CANT, PE_FOLIO, PE_";
__c.LogImpl("437552247",("select PE_PROID,PE_CANT, PE_FOLIO, PE_CEDIS, PE_PRONOMBRE FROM PEDIDO where (pe_pronombre = '"+__c.SmartStringFormatter("",(Object)(_nom))+"' or pe_pronombre = '"+__c.SmartStringFormatter("",(Object)(_nom))+"') AND PE_CEDIS = '"+__c.SmartStringFormatter("",(Object)(_cedis))+"' AND PE_FOLIO = '"+__c.SmartStringFormatter("",(Object)(_foliu))+"' and pe_cliente in (Select CUENTA from cuentaa)"),0);
 //BA.debugLineNum = 635;BA.debugLine="Log(c.RowCount)";
__c.LogImpl("437552248",BA.NumberToString(_c.getRowCount()),0);
 //BA.debugLineNum = 636;BA.debugLine="Log(\"AQUI ESTOY\")";
__c.LogImpl("437552249","AQUI ESTOY",0);
 //BA.debugLineNum = 637;BA.debugLine="Log(cedis)";
__c.LogImpl("437552250",_cedis,0);
 //BA.debugLineNum = 638;BA.debugLine="Log(foliu)";
__c.LogImpl("437552251",_foliu,0);
 //BA.debugLineNum = 639;BA.debugLine="Log(nom)";
__c.LogImpl("437552252",_nom,0);
 //BA.debugLineNum = 641;BA.debugLine="c.Position=0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 644;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"INSERT";
_b4xpages._mainpage /*gunav2.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)(_almacen),(Object)(_c.GetString("PE_PROID")),(Object)((double)(Double.parseDouble(_c.GetString("PE_CANT")))*-1)}));
 //BA.debugLineNum = 651;BA.debugLine="If Not(IsNumber(cedis)) Then";
if (__c.Not(__c.IsNumber(_cedis))) { 
 //BA.debugLineNum = 652;BA.debugLine="j3 = B4XPages.MainPage.skmt.ExecQuery2(\"SEL";
_j3 = (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 PE_CEDIS, PE_CANT,PE_PROID, PE_PRONOMBRE, PE_FOLIO FROM PEDIDO WHERE PE_CEDIS IN (SELECT PE_CEDIS FROM PEDIDO WHERE PE_CEDIS = ?)",new String[]{_cedis})));
 //BA.debugLineNum = 653;BA.debugLine="Log(j3.RowCount)";
__c.LogImpl("437552266",BA.NumberToString(_j3.getRowCount()),0);
 //BA.debugLineNum = 654;BA.debugLine="If j3.RowCount > 0 Then";
if (_j3.getRowCount()>0) { 
 //BA.debugLineNum = 655;BA.debugLine="Log(\"Soy promo\")";
__c.LogImpl("437552268","Soy promo",0);
 //BA.debugLineNum = 656;BA.debugLine="For j = 0 To j3.RowCount -1";
{
final int step112 = 1;
final int limit112 = (int) (_j3.getRowCount()-1);
_j = (int) (0) ;
for (;_j <= limit112 ;_j = _j + step112 ) {
 //BA.debugLineNum = 657;BA.debugLine="Log(\"aqui tronare?\")";
__c.LogImpl("437552270","aqui tronare?",0);
 //BA.debugLineNum = 658;BA.debugLine="j3.Position = j";
_j3.setPosition(_j);
 //BA.debugLineNum = 660;BA.debugLine="Log(nom)";
__c.LogImpl("437552273",_nom,0);
 //BA.debugLineNum = 661;BA.debugLine="If cedis <> \"DUR\" Then";
if ((_cedis).equals("DUR") == false) { 
 //BA.debugLineNum = 663;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery($\"up";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("update "+__c.SmartStringFormatter("",(Object)(_subs._traetablaprods /*String*/ (ba,_tipo_venta)))+" 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 = 664;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery($\"de";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("delete from pedido where pe_cedis= '"+__c.SmartStringFormatter("",(Object)(_cedis))+"' and pe_cliente in (Select CUENTA from cuentaa) AND PE_FOLIO = '"+__c.SmartStringFormatter("",(Object)(_foliu))+"' AND PE_PROID = '"+__c.SmartStringFormatter("",(Object)(_j3.GetString("PE_PROID")))+"'"));
 //BA.debugLineNum = 665;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"de";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("delete from pedido where pe_cedis= ? and pe_cliente in (Select CUENTA from cuentaa) AND PE_FOLIO = ?",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(_cedis),(Object)(_foliu)}));
 }else {
 //BA.debugLineNum = 667;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"de";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("delete from pedido where pe_cedis= ? and pe_cliente in (Select CUENTA from cuentaa) AND PE_FOLIO = ?",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(_cedis),(Object)(_foliu)}));
 };
 }
};
 };
 //BA.debugLineNum = 671;BA.debugLine="j3.Close";
_j3.Close();
 }else {
 //BA.debugLineNum = 673;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery($\"updat";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("update "+__c.SmartStringFormatter("",(Object)(_subs._traetablaprods /*String*/ (ba,_tipo_venta)))+" 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 = 674;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"delet";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("delete from pedido where pe_pronombre = ? and pe_cedis = ? and pe_cliente in (Select CUENTA from cuentaa) AND PE_FOLIO = ?",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(_nom),(Object)(_cedis),(Object)(_foliu)}));
 };
 //BA.debugLineNum = 676;BA.debugLine="c.Close";
_c.Close();
 //BA.debugLineNum = 678;BA.debugLine="DateTime.DateFormat = \"MM/dd/yyyy\"";
__c.DateTime.setDateFormat("MM/dd/yyyy");
 //BA.debugLineNum = 679;BA.debugLine="sDate=DateTime.Date(DateTime.Now)";
_sdate = __c.DateTime.Date(__c.DateTime.getNow());
 //BA.debugLineNum = 680;BA.debugLine="sTime=DateTime.Time(DateTime.Now)";
_stime = __c.DateTime.Time(__c.DateTime.getNow());
 //BA.debugLineNum = 681;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"Select C";
_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 CUENTA from cuentaa")));
 //BA.debugLineNum = 682;BA.debugLine="c.Position=0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 683;BA.debugLine="clie_id = c.GetString(\"CUENTA\")";
_clie_id = _c.GetString("CUENTA");
 //BA.debugLineNum = 684;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"select U";
_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 USUARIO from usuarioa")));
 //BA.debugLineNum = 685;BA.debugLine="c.Position=0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 686;BA.debugLine="usuario = c.GetString(\"USUARIO\")";
_usuario = _c.GetString("USUARIO");
 //BA.debugLineNum = 687;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"select s";
_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 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 = 688;BA.debugLine="c.Position=0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 689;BA.debugLine="If c.GetString(\"CUANTOS\") > 0 Then";
if ((double)(Double.parseDouble(_c.GetString("CUANTOS")))>0) { 
 //BA.debugLineNum = 690;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"delete";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("delete from pedido_cliente where PC_CLIENTE In (select cuenta from cuentaa)");
 //BA.debugLineNum = 691;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"inser";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("insert into pedido_cliente(PC_CLIENTE, PC_FECHA, PC_USER, PC_NOART, PC_MONTO,PC_LON, PC_LAT) 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 /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._lon_gps /*String*/ ),(Object)(_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._lat_gps /*String*/ )}));
 //BA.debugLineNum = 692;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"UPDATE";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("UPDATE kmt_info3 set gestion = 2  where CAT_CL_CODIGO In (select cuenta from cuentaa)");
 }else {
 //BA.debugLineNum = 694;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"delete";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("delete from pedido_cliente where PC_CLIENTE In (select cuenta from cuentaa)");
 //BA.debugLineNum = 695;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"UPDATE";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("UPDATE kmt_info3 set gestion = 0  where CAT_CL_CODIGO In (select cuenta from cuentaa)");
 };
 //BA.debugLineNum = 697;BA.debugLine="Starter.skmt.ExecNonQuery(\"Update kmt_info3";
_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("Update kmt_info3 set CONFIRMADO = 0  WHERE CAT_CL_CODIGO IN (SELECT CUENTA FROM CUENTAA)");
 //BA.debugLineNum = 698;BA.debugLine="Starter.skmt.ExecNonQuery(\"Update CODIGOS_CR";
_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("Update CODIGOS_CREDITO set BANDERA = 0  WHERE CLIENTE IN (SELECT CUENTA FROM CUENTAA)");
 //BA.debugLineNum = 699;BA.debugLine="B4XPage_Appear";
_b4xpage_appear();
 };
 }else {
 //BA.debugLineNum = 702;BA.debugLine="Log(\"aqui\")";
__c.LogImpl("437552315","aqui",0);
 //BA.debugLineNum = 703;BA.debugLine="B4XPages.MainPage.cliente.p_transparenteTicke";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._cliente /*gunav2.keymon.com.mx.c_cliente*/ ._p_transparenteticketimpreso /*anywheresoftware.b4a.objects.PanelWrapper*/ .setVisible(__c.True);
 //BA.debugLineNum = 704;BA.debugLine="B4XPages.ShowPage(\"cliente\")";
_b4xpages._showpage /*String*/ (ba,"cliente");
 //BA.debugLineNum = 705;BA.debugLine="ToastMessageShow(\"La venta ya esta impresa, n";
__c.ToastMessageShow(BA.ObjectToCharSequence("La venta ya esta impresa, no se puede modificar!!"),__c.True);
 };
 };
 }else if((_c.GetString("HABILITADA")).equals(BA.NumberToString(0))) { 
 //BA.debugLineNum = 709;BA.debugLine="If Not(Subs.revisaImpreso) Then";
if (__c.Not(_subs._revisaimpreso /*boolean*/ (ba))) { 
 //BA.debugLineNum = 710;BA.debugLine="result =  Msgbox2(\"Seguro que desea borrar est";
_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 = 711;BA.debugLine="If result = DialogResponse.POSITIVE Then";
if ((_result).equals(BA.NumberToString(__c.DialogResponse.POSITIVE))) { 
 //BA.debugLineNum = 712;BA.debugLine="Private X() As String = Regex.Split(\" \", Valu";
_x = __c.Regex.Split(" ",BA.ObjectToString(_value));
 //BA.debugLineNum = 713;BA.debugLine="Log(X)";
__c.LogImpl("437552326",BA.ObjectToString(_x),0);
 //BA.debugLineNum = 714;BA.debugLine="Log(X.Length)";
__c.LogImpl("437552327",BA.NumberToString(_x.length),0);
 //BA.debugLineNum = 715;BA.debugLine="Private nom As String = \"\"";
_nom = "";
 //BA.debugLineNum = 716;BA.debugLine="For i = 0 To X.Length -1";
{
final int step169 = 1;
final int limit169 = (int) (_x.length-1);
_i = (int) (0) ;
for (;_i <= limit169 ;_i = _i + step169 ) {
 //BA.debugLineNum = 718;BA.debugLine="If X(i).Contains(CRLF) Then";
if (_x[_i].contains(__c.CRLF)) { 
 };
 //BA.debugLineNum = 721;BA.debugLine="If Not(X(i).Contains(CRLF)) Then";
if (__c.Not(_x[_i].contains(__c.CRLF))) { 
 //BA.debugLineNum = 722;BA.debugLine="nom = nom & \" \" & X(i)";
_nom = _nom+" "+_x[_i];
 }else {
 //BA.debugLineNum = 724;BA.debugLine="Exit";
if (true) break;
 };
 }
};
 //BA.debugLineNum = 729;BA.debugLine="nom = nom.Trim";
_nom = _nom.trim();
 //BA.debugLineNum = 730;BA.debugLine="If X(X.Length-1) <> \".01\" Then";
if ((_x[(int) (_x.length-1)]).equals(".01") == false) { 
 //BA.debugLineNum = 731;BA.debugLine="Private cedis As String = X(X.Length-1)";
_cedis = _x[(int) (_x.length-1)];
 }else {
 //BA.debugLineNum = 733;BA.debugLine="Private cedis As String = (X(X.Length-2) &\"";
_cedis = (_x[(int) (_x.length-2)]+" "+_x[(int) (_x.length-1)]);
 };
 //BA.debugLineNum = 735;BA.debugLine="Log(nom)";
__c.LogImpl("437552348",_nom,0);
 //BA.debugLineNum = 736;BA.debugLine="Log(cedis)";
__c.LogImpl("437552349",_cedis,0);
 //BA.debugLineNum = 737;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery($\"select P";
_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 PE_PROID,PE_CANT, PE_FOLIO, PE_CEDIS, PE_PRONOMBRE FROM PEDIDO where (pe_pronombre = '"+__c.SmartStringFormatter("",(Object)(_nom))+"' or pe_pronombre = '"+__c.SmartStringFormatter("",(Object)(_nom))+" ') AND PE_CEDIS = '"+__c.SmartStringFormatter("",(Object)(_cedis))+"' and pe_cliente in (Select CUENTA from cuentaa)"))));
 //BA.debugLineNum = 738;BA.debugLine="Log($\"select PE_PROID,PE_CANT, PE_FOLIO, PE_C";
__c.LogImpl("437552351",("select PE_PROID,PE_CANT, PE_FOLIO, PE_CEDIS FROM PEDIDO where (pe_pronombre = '"+__c.SmartStringFormatter("",(Object)(_nom))+"' or pe_pronombre = '"+__c.SmartStringFormatter("",(Object)(_nom))+" ') AND PE_CEDIS = '"+__c.SmartStringFormatter("",(Object)(_cedis))+"' and pe_cliente in (Select CUENTA from cuentaa)"),0);
 //BA.debugLineNum = 739;BA.debugLine="Log(c.RowCount)";
__c.LogImpl("437552352",BA.NumberToString(_c.getRowCount()),0);
 //BA.debugLineNum = 740;BA.debugLine="c.Position=0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 750;BA.debugLine="If Not(IsNumber(cedis)) Then";
if (__c.Not(__c.IsNumber(_cedis))) { 
 //BA.debugLineNum = 751;BA.debugLine="j3 = B4XPages.MainPage.skmt.ExecQuery2(\"SELE";
_j3 = (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 PE_CEDIS, PE_CANT,PE_PROID, PE_PRONOMBRE, PE_FOLIO FROM PEDIDO WHERE PE_CEDIS IN (SELECT PE_CEDIS FROM PEDIDO WHERE PE_CEDIS = ?)",new String[]{_cedis})));
 //BA.debugLineNum = 752;BA.debugLine="Log(j3.RowCount)";
__c.LogImpl("437552365",BA.NumberToString(_j3.getRowCount()),0);
 //BA.debugLineNum = 753;BA.debugLine="If j3.RowCount > 0 Then";
if (_j3.getRowCount()>0) { 
 //BA.debugLineNum = 754;BA.debugLine="Log(\"Soy promo\")";
__c.LogImpl("437552367","Soy promo",0);
 //BA.debugLineNum = 755;BA.debugLine="For j = 0 To j3.RowCount -1";
{
final int step195 = 1;
final int limit195 = (int) (_j3.getRowCount()-1);
_j = (int) (0) ;
for (;_j <= limit195 ;_j = _j + step195 ) {
 //BA.debugLineNum = 756;BA.debugLine="Log(\"aqui tronare?\")";
__c.LogImpl("437552369","aqui tronare?",0);
 //BA.debugLineNum = 757;BA.debugLine="j3.Position = j";
_j3.setPosition(_j);
 //BA.debugLineNum = 759;BA.debugLine="If cedis <> \"DUR\" Then";
if ((_cedis).equals("DUR") == false) { 
 //BA.debugLineNum = 760;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery($\"upd";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("update "+__c.SmartStringFormatter("",(Object)(_subs._traetablaprods /*String*/ (ba,_tipo_venta)))+" 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 = 761;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery($\"del";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("delete from pedido where pe_cedis= '"+__c.SmartStringFormatter("",(Object)(_cedis))+"' and pe_cliente in (Select CUENTA from cuentaa) AND PE_FOLIO = '"+__c.SmartStringFormatter("",(Object)(_foliu))+"' AND PE_PROID = '"+__c.SmartStringFormatter("",(Object)(_j3.GetString("PE_PROID")))+"'"));
 //BA.debugLineNum = 762;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"del";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("delete from pedido where pe_cedis= ? and pe_cliente in (Select CUENTA from cuentaa) AND PE_FOLIO = ?",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(_cedis),(Object)(_foliu)}));
 }else {
 //BA.debugLineNum = 764;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"del";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("delete from pedido where pe_cedis= ? and pe_cliente in (Select CUENTA from cuentaa) AND PE_FOLIO = ?",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(_cedis),(Object)(_foliu)}));
 };
 }
};
 };
 //BA.debugLineNum = 768;BA.debugLine="j3.Close";
_j3.Close();
 }else {
 //BA.debugLineNum = 770;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery($\"update";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("update "+__c.SmartStringFormatter("",(Object)(_subs._traetablaprods /*String*/ (ba,_tipo_venta)))+" 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 = 771;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"delete";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("delete from pedido where pe_pronombre = ? and pe_cedis = ? and pe_cliente in (Select CUENTA from cuentaa) AND PE_FOLIO = ?",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(_nom),(Object)(_cedis),(Object)(_foliu)}));
 };
 //BA.debugLineNum = 773;BA.debugLine="c.Close";
_c.Close();
 //BA.debugLineNum = 775;BA.debugLine="DateTime.DateFormat = \"MM/dd/yyyy\"";
__c.DateTime.setDateFormat("MM/dd/yyyy");
 //BA.debugLineNum = 776;BA.debugLine="sDate=DateTime.Date(DateTime.Now)";
_sdate = __c.DateTime.Date(__c.DateTime.getNow());
 //BA.debugLineNum = 777;BA.debugLine="sTime=DateTime.Time(DateTime.Now)";
_stime = __c.DateTime.Time(__c.DateTime.getNow());
 //BA.debugLineNum = 778;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"Select CU";
_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 CUENTA from cuentaa")));
 //BA.debugLineNum = 779;BA.debugLine="c.Position=0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 780;BA.debugLine="clie_id = c.GetString(\"CUENTA\")";
_clie_id = _c.GetString("CUENTA");
 //BA.debugLineNum = 781;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"select US";
_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 USUARIO from usuarioa")));
 //BA.debugLineNum = 782;BA.debugLine="c.Position=0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 783;BA.debugLine="usuario = c.GetString(\"USUARIO\")";
_usuario = _c.GetString("USUARIO");
 //BA.debugLineNum = 784;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"select su";
_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 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 = 785;BA.debugLine="c.Position=0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 786;BA.debugLine="If c.GetString(\"CUANTOS\") > 0 Then";
if ((double)(Double.parseDouble(_c.GetString("CUANTOS")))>0) { 
 //BA.debugLineNum = 787;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"delete";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("delete from pedido_cliente where PC_CLIENTE In (select cuenta from cuentaa)");
 //BA.debugLineNum = 788;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"insert";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("insert into pedido_cliente(PC_CLIENTE, PC_FECHA, PC_USER, PC_NOART, PC_MONTO,PC_LON, PC_LAT) 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 /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._lon_gps /*String*/ ),(Object)(_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._lat_gps /*String*/ )}));
 //BA.debugLineNum = 789;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"UPDATE";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("UPDATE kmt_info3 set gestion = 2  where CAT_CL_CODIGO In (select cuenta from cuentaa)");
 }else {
 //BA.debugLineNum = 791;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"delete";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("delete from pedido_cliente where PC_CLIENTE In (select cuenta from cuentaa)");
 //BA.debugLineNum = 792;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"UPDATE";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("UPDATE kmt_info3 set gestion = 0  where CAT_CL_CODIGO In (select cuenta from cuentaa)");
 };
 //BA.debugLineNum = 794;BA.debugLine="B4XPage_Appear";
_b4xpage_appear();
 };
 }else {
 //BA.debugLineNum = 797;BA.debugLine="If Subs.traeAlmacen = 94 Then";
if ((_subs._traealmacen /*String*/ (ba)).equals(BA.NumberToString(94))) { 
 //BA.debugLineNum = 798;BA.debugLine="result =  Msgbox2(\"Seguro que desea borrar es";
_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 = 799;BA.debugLine="If result = DialogResponse.POSITIVE Then";
if ((_result).equals(BA.NumberToString(__c.DialogResponse.POSITIVE))) { 
 //BA.debugLineNum = 800;BA.debugLine="Private X() As String = Regex.Split(\" \", Val";
_x = __c.Regex.Split(" ",BA.ObjectToString(_value));
 //BA.debugLineNum = 801;BA.debugLine="Log(X)";
__c.LogImpl("437552414",BA.ObjectToString(_x),0);
 //BA.debugLineNum = 802;BA.debugLine="Log(X.Length)";
__c.LogImpl("437552415",BA.NumberToString(_x.length),0);
 //BA.debugLineNum = 803;BA.debugLine="Private nom As String = \"\"";
_nom = "";
 //BA.debugLineNum = 804;BA.debugLine="For i = 0 To X.Length -1";
{
final int step242 = 1;
final int limit242 = (int) (_x.length-1);
_i = (int) (0) ;
for (;_i <= limit242 ;_i = _i + step242 ) {
 //BA.debugLineNum = 806;BA.debugLine="If X(i).Contains(CRLF) Then";
if (_x[_i].contains(__c.CRLF)) { 
 };
 //BA.debugLineNum = 809;BA.debugLine="If Not(X(i).Contains(CRLF)) Then";
if (__c.Not(_x[_i].contains(__c.CRLF))) { 
 //BA.debugLineNum = 810;BA.debugLine="nom = nom & \" \" & X(i)";
_nom = _nom+" "+_x[_i];
 }else {
 //BA.debugLineNum = 812;BA.debugLine="Exit";
if (true) break;
 };
 }
};
 //BA.debugLineNum = 817;BA.debugLine="nom = nom.Trim";
_nom = _nom.trim();
 //BA.debugLineNum = 818;BA.debugLine="If X(X.Length-1) <> \".01\" Then";
if ((_x[(int) (_x.length-1)]).equals(".01") == false) { 
 //BA.debugLineNum = 819;BA.debugLine="Private cedis As String = X(X.Length-1)";
_cedis = _x[(int) (_x.length-1)];
 }else {
 //BA.debugLineNum = 821;BA.debugLine="Private cedis As String = (X(X.Length-2) &\"";
_cedis = (_x[(int) (_x.length-2)]+" "+_x[(int) (_x.length-1)]);
 };
 //BA.debugLineNum = 823;BA.debugLine="Log(nom)";
__c.LogImpl("437552436",_nom,0);
 //BA.debugLineNum = 824;BA.debugLine="Log(cedis)";
__c.LogImpl("437552437",_cedis,0);
 //BA.debugLineNum = 825;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery($\"select";
_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 PE_PROID,PE_CANT, PE_FOLIO, PE_CEDIS, PE_PRONOMBRE FROM PEDIDO where (pe_pronombre = '"+__c.SmartStringFormatter("",(Object)(_nom))+"' or pe_pronombre = '"+__c.SmartStringFormatter("",(Object)(_nom))+" ') AND PE_CEDIS = '"+__c.SmartStringFormatter("",(Object)(_cedis))+"' and pe_cliente in (Select CUENTA from cuentaa)"))));
 //BA.debugLineNum = 826;BA.debugLine="Log($\"select PE_PROID,PE_CANT, PE_FOLIO, PE_";
__c.LogImpl("437552439",("select PE_PROID,PE_CANT, PE_FOLIO, PE_CEDIS FROM PEDIDO where (pe_pronombre = '"+__c.SmartStringFormatter("",(Object)(_nom))+"' or pe_pronombre = '"+__c.SmartStringFormatter("",(Object)(_nom))+" ') AND PE_CEDIS = '"+__c.SmartStringFormatter("",(Object)(_cedis))+"' and pe_cliente in (Select CUENTA from cuentaa)"),0);
 //BA.debugLineNum = 827;BA.debugLine="Log(c.RowCount)";
__c.LogImpl("437552440",BA.NumberToString(_c.getRowCount()),0);
 //BA.debugLineNum = 828;BA.debugLine="c.Position=0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 838;BA.debugLine="If Not(IsNumber(cedis)) Then";
if (__c.Not(__c.IsNumber(_cedis))) { 
 //BA.debugLineNum = 839;BA.debugLine="j3 = B4XPages.MainPage.skmt.ExecQuery2(\"SEL";
_j3 = (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 PE_CEDIS, PE_CANT,PE_PROID, PE_PRONOMBRE, PE_FOLIO FROM PEDIDO WHERE PE_CEDIS IN (SELECT PE_CEDIS FROM PEDIDO WHERE PE_CEDIS = ?)",new String[]{_cedis})));
 //BA.debugLineNum = 840;BA.debugLine="Log(j3.RowCount)";
__c.LogImpl("437552453",BA.NumberToString(_j3.getRowCount()),0);
 //BA.debugLineNum = 841;BA.debugLine="If j3.RowCount > 0 Then";
if (_j3.getRowCount()>0) { 
 //BA.debugLineNum = 842;BA.debugLine="Log(\"Soy promo\")";
__c.LogImpl("437552455","Soy promo",0);
 //BA.debugLineNum = 843;BA.debugLine="For j = 0 To j3.RowCount -1";
{
final int step268 = 1;
final int limit268 = (int) (_j3.getRowCount()-1);
_j = (int) (0) ;
for (;_j <= limit268 ;_j = _j + step268 ) {
 //BA.debugLineNum = 844;BA.debugLine="Log(\"aqui tronare?\")";
__c.LogImpl("437552457","aqui tronare?",0);
 //BA.debugLineNum = 845;BA.debugLine="j3.Position = j";
_j3.setPosition(_j);
 //BA.debugLineNum = 847;BA.debugLine="If cedis <> \"DUR\" Then";
if ((_cedis).equals("DUR") == false) { 
 //BA.debugLineNum = 848;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery($\"up";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("update "+__c.SmartStringFormatter("",(Object)(_subs._traetablaprods /*String*/ (ba,_tipo_venta)))+" 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 = 849;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery($\"de";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("delete from pedido where pe_cedis= '"+__c.SmartStringFormatter("",(Object)(_cedis))+"' and pe_cliente in (Select CUENTA from cuentaa) AND PE_FOLIO = '"+__c.SmartStringFormatter("",(Object)(_foliu))+"' AND PE_PROID = '"+__c.SmartStringFormatter("",(Object)(_j3.GetString("PE_PROID")))+"'"));
 //BA.debugLineNum = 850;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"de";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("delete from pedido where pe_cedis= ? and pe_cliente in (Select CUENTA from cuentaa) AND PE_FOLIO = ?",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(_cedis),(Object)(_foliu)}));
 }else {
 //BA.debugLineNum = 852;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"de";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("delete from pedido where pe_cedis= ? and pe_cliente in (Select CUENTA from cuentaa) AND PE_FOLIO = ?",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(_cedis),(Object)(_foliu)}));
 };
 }
};
 };
 //BA.debugLineNum = 856;BA.debugLine="j3.Close";
_j3.Close();
 }else {
 //BA.debugLineNum = 858;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery($\"updat";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("update "+__c.SmartStringFormatter("",(Object)(_subs._traetablaprods /*String*/ (ba,_tipo_venta)))+" 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 = 859;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"delet";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("delete from pedido where pe_pronombre = ? and pe_cedis = ? and pe_cliente in (Select CUENTA from cuentaa) AND PE_FOLIO = ?",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(_nom),(Object)(_cedis),(Object)(_foliu)}));
 };
 //BA.debugLineNum = 861;BA.debugLine="c.Close";
_c.Close();
 //BA.debugLineNum = 863;BA.debugLine="DateTime.DateFormat = \"MM/dd/yyyy\"";
__c.DateTime.setDateFormat("MM/dd/yyyy");
 //BA.debugLineNum = 864;BA.debugLine="sDate=DateTime.Date(DateTime.Now)";
_sdate = __c.DateTime.Date(__c.DateTime.getNow());
 //BA.debugLineNum = 865;BA.debugLine="sTime=DateTime.Time(DateTime.Now)";
_stime = __c.DateTime.Time(__c.DateTime.getNow());
 //BA.debugLineNum = 866;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"Select C";
_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 CUENTA from cuentaa")));
 //BA.debugLineNum = 867;BA.debugLine="c.Position=0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 868;BA.debugLine="clie_id = c.GetString(\"CUENTA\")";
_clie_id = _c.GetString("CUENTA");
 //BA.debugLineNum = 869;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"select U";
_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 USUARIO from usuarioa")));
 //BA.debugLineNum = 870;BA.debugLine="c.Position=0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 871;BA.debugLine="usuario = c.GetString(\"USUARIO\")";
_usuario = _c.GetString("USUARIO");
 //BA.debugLineNum = 872;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"select s";
_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 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 = 873;BA.debugLine="c.Position=0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 874;BA.debugLine="If c.GetString(\"CUANTOS\") > 0 Then";
if ((double)(Double.parseDouble(_c.GetString("CUANTOS")))>0) { 
 //BA.debugLineNum = 875;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"delete";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("delete from pedido_cliente where PC_CLIENTE In (select cuenta from cuentaa)");
 //BA.debugLineNum = 876;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"inser";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("insert into pedido_cliente(PC_CLIENTE, PC_FECHA, PC_USER, PC_NOART, PC_MONTO,PC_LON, PC_LAT) 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 /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._lon_gps /*String*/ ),(Object)(_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._lat_gps /*String*/ )}));
 //BA.debugLineNum = 877;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"UPDATE";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("UPDATE kmt_info3 set gestion = 2  where CAT_CL_CODIGO In (select cuenta from cuentaa)");
 }else {
 //BA.debugLineNum = 879;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"delete";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("delete from pedido_cliente where PC_CLIENTE In (select cuenta from cuentaa)");
 //BA.debugLineNum = 880;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"UPDATE";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("UPDATE kmt_info3 set gestion = 0  where CAT_CL_CODIGO In (select cuenta from cuentaa)");
 };
 //BA.debugLineNum = 882;BA.debugLine="Starter.skmt.ExecNonQuery(\"Update kmt_info3";
_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("Update kmt_info3 set CONFIRMADO = 0  WHERE CAT_CL_CODIGO IN (SELECT CUENTA FROM CUENTAA)");
 //BA.debugLineNum = 883;BA.debugLine="Starter.skmt.ExecNonQuery(\"Update CODIGOS_CR";
_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("Update CODIGOS_CREDITO set BANDERA = 0  WHERE CLIENTE IN (SELECT CUENTA FROM CUENTAA)");
 //BA.debugLineNum = 884;BA.debugLine="B4XPage_Appear";
_b4xpage_appear();
 };
 }else {
 //BA.debugLineNum = 887;BA.debugLine="Log(\"aqui\")";
__c.LogImpl("437552500","aqui",0);
 //BA.debugLineNum = 888;BA.debugLine="B4XPages.MainPage.cliente.p_transparenteTicke";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._cliente /*gunav2.keymon.com.mx.c_cliente*/ ._p_transparenteticketimpreso /*anywheresoftware.b4a.objects.PanelWrapper*/ .setVisible(__c.True);
 //BA.debugLineNum = 889;BA.debugLine="B4XPages.ShowPage(\"cliente\")";
_b4xpages._showpage /*String*/ (ba,"cliente");
 //BA.debugLineNum = 890;BA.debugLine="ToastMessageShow(\"La venta ya esta impresa, n";
__c.ToastMessageShow(BA.ObjectToCharSequence("La venta ya esta impresa, no se puede modificar!!"),__c.True);
 };
 };
 };
 }else if(_c.getRowCount()==0) { 
 //BA.debugLineNum = 895;BA.debugLine="If Not(Subs.revisaImpreso) Then";
if (__c.Not(_subs._revisaimpreso /*boolean*/ (ba))) { 
 //BA.debugLineNum = 896;BA.debugLine="result =  Msgbox2(\"Seguro que desea borrar este";
_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 = 897;BA.debugLine="If result = DialogResponse.POSITIVE Then";
if ((_result).equals(BA.NumberToString(__c.DialogResponse.POSITIVE))) { 
 //BA.debugLineNum = 898;BA.debugLine="Private X() As String = Regex.Split(\" \", Value";
_x = __c.Regex.Split(" ",BA.ObjectToString(_value));
 //BA.debugLineNum = 899;BA.debugLine="Log(X)";
__c.LogImpl("437552512",BA.ObjectToString(_x),0);
 //BA.debugLineNum = 900;BA.debugLine="Log(X.Length)";
__c.LogImpl("437552513",BA.NumberToString(_x.length),0);
 //BA.debugLineNum = 901;BA.debugLine="Private nom As String = \"\"";
_nom = "";
 //BA.debugLineNum = 902;BA.debugLine="For i = 0 To X.Length -1";
{
final int step325 = 1;
final int limit325 = (int) (_x.length-1);
_i = (int) (0) ;
for (;_i <= limit325 ;_i = _i + step325 ) {
 //BA.debugLineNum = 904;BA.debugLine="If X(i).Contains(CRLF) Then";
if (_x[_i].contains(__c.CRLF)) { 
 };
 //BA.debugLineNum = 907;BA.debugLine="If Not(X(i).Contains(CRLF)) Then";
if (__c.Not(_x[_i].contains(__c.CRLF))) { 
 //BA.debugLineNum = 908;BA.debugLine="nom = nom & \" \" & X(i)";
_nom = _nom+" "+_x[_i];
 }else {
 //BA.debugLineNum = 910;BA.debugLine="Exit";
if (true) break;
 };
 }
};
 //BA.debugLineNum = 915;BA.debugLine="nom = nom.Trim";
_nom = _nom.trim();
 //BA.debugLineNum = 916;BA.debugLine="Private cedis As String = X(X.Length-1)";
_cedis = _x[(int) (_x.length-1)];
 //BA.debugLineNum = 917;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery($\"select PE";
_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 PE_PROID,PE_CANT, PE_FOLIO, PE_CEDIS, PE_PRONOMBRE FROM PEDIDO where (pe_pronombre = '"+__c.SmartStringFormatter("",(Object)(_nom))+"' or pe_pronombre = '"+__c.SmartStringFormatter("",(Object)(_nom))+" ') AND PE_CEDIS = '"+__c.SmartStringFormatter("",(Object)(_cedis))+"' and pe_cliente in (Select CUENTA from cuentaa)"))));
 //BA.debugLineNum = 918;BA.debugLine="Log($\"select PE_PROID,PE_CANT, PE_FOLIO, PE_CE";
__c.LogImpl("437552531",("select PE_PROID,PE_CANT, PE_FOLIO, PE_CEDIS FROM PEDIDO where pe_pronombre = '"+__c.SmartStringFormatter("",(Object)(_nom))+"' AND PE_CEDIS = '"+__c.SmartStringFormatter("",(Object)(_cedis))+"' and pe_cliente in (Select CUENTA from cuentaa)"),0);
 //BA.debugLineNum = 919;BA.debugLine="Log(c.RowCount)";
__c.LogImpl("437552532",BA.NumberToString(_c.getRowCount()),0);
 //BA.debugLineNum = 920;BA.debugLine="c.Position=0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 923;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"INSERT I";
_b4xpages._mainpage /*gunav2.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)(_almacen),(Object)(_c.GetString("PE_PROID")),(Object)((double)(Double.parseDouble(_c.GetString("PE_CANT")))*-1)}));
 //BA.debugLineNum = 930;BA.debugLine="If Not(IsNumber(cedis)) Then";
if (__c.Not(__c.IsNumber(_cedis))) { 
 //BA.debugLineNum = 931;BA.debugLine="j3 = B4XPages.MainPage.skmt.ExecQuery2(\"SELEC";
_j3 = (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 PE_CEDIS, PE_CANT,PE_PROID, PE_PRONOMBRE, PE_FOLIO FROM PEDIDO WHERE PE_CEDIS IN (SELECT PE_CEDIS FROM PEDIDO WHERE PE_CEDIS = ?)",new String[]{_cedis})));
 //BA.debugLineNum = 932;BA.debugLine="Log(j3.RowCount)";
__c.LogImpl("437552545",BA.NumberToString(_j3.getRowCount()),0);
 //BA.debugLineNum = 933;BA.debugLine="If j3.RowCount > 0 Then";
if (_j3.getRowCount()>0) { 
 //BA.debugLineNum = 934;BA.debugLine="Log(\"Soy promo\")";
__c.LogImpl("437552547","Soy promo",0);
 //BA.debugLineNum = 935;BA.debugLine="For j = 0 To j3.RowCount -1";
{
final int step346 = 1;
final int limit346 = (int) (_j3.getRowCount()-1);
_j = (int) (0) ;
for (;_j <= limit346 ;_j = _j + step346 ) {
 //BA.debugLineNum = 936;BA.debugLine="Log(\"aqui tronare?\")";
__c.LogImpl("437552549","aqui tronare?",0);
 //BA.debugLineNum = 937;BA.debugLine="j3.Position = j";
_j3.setPosition(_j);
 //BA.debugLineNum = 938;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery($\"updat";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("update "+__c.SmartStringFormatter("",(Object)(_subs._traetablaprods /*String*/ (ba,_tipo_venta)))+" 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 = 939;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery($\"delet";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("delete from pedido where pe_cedis= '"+__c.SmartStringFormatter("",(Object)(_cedis))+"' and pe_cliente in (Select CUENTA from cuentaa) AND PE_FOLIO = '"+__c.SmartStringFormatter("",(Object)(_foliu))+"' AND PE_PROID = '"+__c.SmartStringFormatter("",(Object)(_j3.GetString("PE_PROID")))+"'"));
 }
};
 };
 //BA.debugLineNum = 943;BA.debugLine="j3.Close";
_j3.Close();
 }else {
 //BA.debugLineNum = 945;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery($\"update";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("update "+__c.SmartStringFormatter("",(Object)(_subs._traetablaprods /*String*/ (ba,_tipo_venta)))+" 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 = 946;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"delete";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("delete from pedido where pe_pronombre = ? and pe_cedis = ? and pe_cliente in (Select CUENTA from cuentaa) AND PE_FOLIO = ?",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(_nom),(Object)(_cedis),(Object)(_foliu)}));
 };
 //BA.debugLineNum = 948;BA.debugLine="c.Close";
_c.Close();
 //BA.debugLineNum = 950;BA.debugLine="DateTime.DateFormat = \"MM/dd/yyyy\"";
__c.DateTime.setDateFormat("MM/dd/yyyy");
 //BA.debugLineNum = 951;BA.debugLine="sDate=DateTime.Date(DateTime.Now)";
_sdate = __c.DateTime.Date(__c.DateTime.getNow());
 //BA.debugLineNum = 952;BA.debugLine="sTime=DateTime.Time(DateTime.Now)";
_stime = __c.DateTime.Time(__c.DateTime.getNow());
 //BA.debugLineNum = 953;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"Select CUE";
_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 CUENTA from cuentaa")));
 //BA.debugLineNum = 954;BA.debugLine="c.Position=0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 955;BA.debugLine="clie_id = c.GetString(\"CUENTA\")";
_clie_id = _c.GetString("CUENTA");
 //BA.debugLineNum = 956;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"select USU";
_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 USUARIO from usuarioa")));
 //BA.debugLineNum = 957;BA.debugLine="c.Position=0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 958;BA.debugLine="usuario = c.GetString(\"USUARIO\")";
_usuario = _c.GetString("USUARIO");
 //BA.debugLineNum = 959;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 /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select sum(pe_costo_tot) as TOTAL_CLIE, SUM(PE_CANT) AS CANT_CLIE, count(*) as CUANTOS FROM PEDIDO WHERE PE_CLIENTE IN (Select CUENTA from cuentaa)")));
 //BA.debugLineNum = 960;BA.debugLine="c.Position=0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 961;BA.debugLine="If c.GetString(\"CUANTOS\") > 0 Then";
if ((double)(Double.parseDouble(_c.GetString("CUANTOS")))>0) { 
 //BA.debugLineNum = 962;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"delete f";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("delete from pedido_cliente where PC_CLIENTE In (select cuenta from cuentaa)");
 //BA.debugLineNum = 963;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"insert";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("insert into pedido_cliente(PC_CLIENTE, PC_FECHA, PC_USER, PC_NOART, PC_MONTO,PC_LON, PC_LAT) 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 /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._lon_gps /*String*/ ),(Object)(_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._lat_gps /*String*/ )}));
 //BA.debugLineNum = 964;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"UPDATE k";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("UPDATE kmt_info3 set gestion = 2  where CAT_CL_CODIGO In (select cuenta from cuentaa)");
 }else {
 //BA.debugLineNum = 966;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"delete f";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("delete from pedido_cliente where PC_CLIENTE In (select cuenta from cuentaa)");
 //BA.debugLineNum = 967;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"UPDATE k";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("UPDATE kmt_info3 set gestion = 0  where CAT_CL_CODIGO In (select cuenta from cuentaa)");
 };
 //BA.debugLineNum = 969;BA.debugLine="B4XPage_Appear";
_b4xpage_appear();
 };
 }else {
 //BA.debugLineNum = 972;BA.debugLine="If Subs.traeAlmacen = 94 Then";
if ((_subs._traealmacen /*String*/ (ba)).equals(BA.NumberToString(94))) { 
 //BA.debugLineNum = 973;BA.debugLine="result =  Msgbox2(\"Seguro que desea borrar est";
_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 = 974;BA.debugLine="If result = DialogResponse.POSITIVE Then";
if ((_result).equals(BA.NumberToString(__c.DialogResponse.POSITIVE))) { 
 //BA.debugLineNum = 975;BA.debugLine="Private X() As String = Regex.Split(\" \", Valu";
_x = __c.Regex.Split(" ",BA.ObjectToString(_value));
 //BA.debugLineNum = 976;BA.debugLine="Log(X)";
__c.LogImpl("437552589",BA.ObjectToString(_x),0);
 //BA.debugLineNum = 977;BA.debugLine="Log(X.Length)";
__c.LogImpl("437552590",BA.NumberToString(_x.length),0);
 //BA.debugLineNum = 978;BA.debugLine="Private nom As String = \"\"";
_nom = "";
 //BA.debugLineNum = 979;BA.debugLine="For i = 0 To X.Length -1";
{
final int step388 = 1;
final int limit388 = (int) (_x.length-1);
_i = (int) (0) ;
for (;_i <= limit388 ;_i = _i + step388 ) {
 //BA.debugLineNum = 981;BA.debugLine="If X(i).Contains(CRLF) Then";
if (_x[_i].contains(__c.CRLF)) { 
 };
 //BA.debugLineNum = 984;BA.debugLine="If Not(X(i).Contains(CRLF)) Then";
if (__c.Not(_x[_i].contains(__c.CRLF))) { 
 //BA.debugLineNum = 985;BA.debugLine="nom = nom & \" \" & X(i)";
_nom = _nom+" "+_x[_i];
 }else {
 //BA.debugLineNum = 987;BA.debugLine="Exit";
if (true) break;
 };
 }
};
 //BA.debugLineNum = 992;BA.debugLine="nom = nom.Trim";
_nom = _nom.trim();
 //BA.debugLineNum = 993;BA.debugLine="Private cedis As String = X(X.Length-1)";
_cedis = _x[(int) (_x.length-1)];
 //BA.debugLineNum = 994;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery($\"select P";
_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 PE_PROID,PE_CANT, PE_FOLIO, PE_CEDIS, PE_PRONOMBRE FROM PEDIDO where (pe_pronombre = '"+__c.SmartStringFormatter("",(Object)(_nom))+"' or pe_pronombre = '"+__c.SmartStringFormatter("",(Object)(_nom))+" ') AND PE_CEDIS = '"+__c.SmartStringFormatter("",(Object)(_cedis))+"' and pe_cliente in (Select CUENTA from cuentaa)"))));
 //BA.debugLineNum = 995;BA.debugLine="Log($\"select PE_PROID,PE_CANT, PE_FOLIO, PE_C";
__c.LogImpl("437552608",("select PE_PROID,PE_CANT, PE_FOLIO, PE_CEDIS FROM PEDIDO where pe_pronombre = '"+__c.SmartStringFormatter("",(Object)(_nom))+"' AND PE_CEDIS = '"+__c.SmartStringFormatter("",(Object)(_cedis))+"' and pe_cliente in (Select CUENTA from cuentaa)"),0);
 //BA.debugLineNum = 996;BA.debugLine="Log(c.RowCount)";
__c.LogImpl("437552609",BA.NumberToString(_c.getRowCount()),0);
 //BA.debugLineNum = 997;BA.debugLine="c.Position=0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 1000;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"INSERT";
_b4xpages._mainpage /*gunav2.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)(_almacen),(Object)(_c.GetString("PE_PROID")),(Object)((double)(Double.parseDouble(_c.GetString("PE_CANT")))*-1)}));
 //BA.debugLineNum = 1007;BA.debugLine="If Not(IsNumber(cedis)) Then";
if (__c.Not(__c.IsNumber(_cedis))) { 
 //BA.debugLineNum = 1008;BA.debugLine="j3 = B4XPages.MainPage.skmt.ExecQuery2(\"SELE";
_j3 = (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 PE_CEDIS, PE_CANT,PE_PROID, PE_PRONOMBRE, PE_FOLIO FROM PEDIDO WHERE PE_CEDIS IN (SELECT PE_CEDIS FROM PEDIDO WHERE PE_CEDIS = ?)",new String[]{_cedis})));
 //BA.debugLineNum = 1009;BA.debugLine="Log(j3.RowCount)";
__c.LogImpl("437552622",BA.NumberToString(_j3.getRowCount()),0);
 //BA.debugLineNum = 1010;BA.debugLine="If j3.RowCount > 0 Then";
if (_j3.getRowCount()>0) { 
 //BA.debugLineNum = 1011;BA.debugLine="Log(\"Soy promo\")";
__c.LogImpl("437552624","Soy promo",0);
 //BA.debugLineNum = 1012;BA.debugLine="For j = 0 To j3.RowCount -1";
{
final int step409 = 1;
final int limit409 = (int) (_j3.getRowCount()-1);
_j = (int) (0) ;
for (;_j <= limit409 ;_j = _j + step409 ) {
 //BA.debugLineNum = 1013;BA.debugLine="Log(\"aqui tronare?\")";
__c.LogImpl("437552626","aqui tronare?",0);
 //BA.debugLineNum = 1014;BA.debugLine="j3.Position = j";
_j3.setPosition(_j);
 //BA.debugLineNum = 1015;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery($\"upda";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("update "+__c.SmartStringFormatter("",(Object)(_subs._traetablaprods /*String*/ (ba,_tipo_venta)))+" 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 = 1016;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery($\"dele";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("delete from pedido where pe_cedis= '"+__c.SmartStringFormatter("",(Object)(_cedis))+"' and pe_cliente in (Select CUENTA from cuentaa) AND PE_FOLIO = '"+__c.SmartStringFormatter("",(Object)(_foliu))+"' AND PE_PROID = '"+__c.SmartStringFormatter("",(Object)(_j3.GetString("PE_PROID")))+"'"));
 }
};
 };
 //BA.debugLineNum = 1020;BA.debugLine="j3.Close";
_j3.Close();
 }else {
 //BA.debugLineNum = 1022;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery($\"update";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("update "+__c.SmartStringFormatter("",(Object)(_subs._traetablaprods /*String*/ (ba,_tipo_venta)))+" 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 = 1023;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"delete";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("delete from pedido where pe_pronombre = ? and pe_cedis = ? and pe_cliente in (Select CUENTA from cuentaa) AND PE_FOLIO = ?",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(_nom),(Object)(_cedis),(Object)(_foliu)}));
 };
 //BA.debugLineNum = 1025;BA.debugLine="c.Close";
_c.Close();
 //BA.debugLineNum = 1027;BA.debugLine="DateTime.DateFormat = \"MM/dd/yyyy\"";
__c.DateTime.setDateFormat("MM/dd/yyyy");
 //BA.debugLineNum = 1028;BA.debugLine="sDate=DateTime.Date(DateTime.Now)";
_sdate = __c.DateTime.Date(__c.DateTime.getNow());
 //BA.debugLineNum = 1029;BA.debugLine="sTime=DateTime.Time(DateTime.Now)";
_stime = __c.DateTime.Time(__c.DateTime.getNow());
 //BA.debugLineNum = 1030;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"Select CU";
_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 CUENTA from cuentaa")));
 //BA.debugLineNum = 1031;BA.debugLine="c.Position=0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 1032;BA.debugLine="clie_id = c.GetString(\"CUENTA\")";
_clie_id = _c.GetString("CUENTA");
 //BA.debugLineNum = 1033;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"select US";
_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 USUARIO from usuarioa")));
 //BA.debugLineNum = 1034;BA.debugLine="c.Position=0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 1035;BA.debugLine="usuario = c.GetString(\"USUARIO\")";
_usuario = _c.GetString("USUARIO");
 //BA.debugLineNum = 1036;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"select su";
_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 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 = 1037;BA.debugLine="c.Position=0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 1038;BA.debugLine="If c.GetString(\"CUANTOS\") > 0 Then";
if ((double)(Double.parseDouble(_c.GetString("CUANTOS")))>0) { 
 //BA.debugLineNum = 1039;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"delete";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("delete from pedido_cliente where PC_CLIENTE In (select cuenta from cuentaa)");
 //BA.debugLineNum = 1040;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"insert";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("insert into pedido_cliente(PC_CLIENTE, PC_FECHA, PC_USER, PC_NOART, PC_MONTO,PC_LON, PC_LAT) 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 /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._lon_gps /*String*/ ),(Object)(_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._lat_gps /*String*/ )}));
 //BA.debugLineNum = 1041;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"UPDATE";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("UPDATE kmt_info3 set gestion = 2  where CAT_CL_CODIGO In (select cuenta from cuentaa)");
 }else {
 //BA.debugLineNum = 1043;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"delete";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("delete from pedido_cliente where PC_CLIENTE In (select cuenta from cuentaa)");
 //BA.debugLineNum = 1044;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"UPDATE";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("UPDATE kmt_info3 set gestion = 0  where CAT_CL_CODIGO In (select cuenta from cuentaa)");
 };
 //BA.debugLineNum = 1046;BA.debugLine="Starter.skmt.ExecNonQuery(\"Update kmt_info3 s";
_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("Update kmt_info3 set CONFIRMADO = 0  WHERE CAT_CL_CODIGO IN (SELECT CUENTA FROM CUENTAA)");
 //BA.debugLineNum = 1047;BA.debugLine="Starter.skmt.ExecNonQuery(\"Update CODIGOS_CRE";
_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("Update CODIGOS_CREDITO set BANDERA = 0  WHERE CLIENTE IN (SELECT CUENTA FROM CUENTAA)");
 //BA.debugLineNum = 1048;BA.debugLine="B4XPage_Appear";
_b4xpage_appear();
 };
 }else {
 //BA.debugLineNum = 1051;BA.debugLine="Log(\"aqui\")";
__c.LogImpl("437552664","aqui",0);
 //BA.debugLineNum = 1052;BA.debugLine="B4XPages.MainPage.cliente.p_transparenteTicket";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._cliente /*gunav2.keymon.com.mx.c_cliente*/ ._p_transparenteticketimpreso /*anywheresoftware.b4a.objects.PanelWrapper*/ .setVisible(__c.True);
 //BA.debugLineNum = 1053;BA.debugLine="B4XPages.ShowPage(\"cliente\")";
_b4xpages._showpage /*String*/ (ba,"cliente");
 //BA.debugLineNum = 1054;BA.debugLine="ToastMessageShow(\"La venta ya esta impresa, no";
__c.ToastMessageShow(BA.ObjectToCharSequence("La venta ya esta impresa, no se puede modificar!!"),__c.True);
 };
 };
 };
 //BA.debugLineNum = 1058;BA.debugLine="End Sub";
return "";
}
public String  _p_nota_click() throws Exception{
 //BA.debugLineNum = 1108;BA.debugLine="Private Sub p_nota_Click";
 //BA.debugLineNum = 1110;BA.debugLine="End Sub";
return "";
}
public String  _regresar_click() throws Exception{
 //BA.debugLineNum = 402;BA.debugLine="Sub Regresar_Click";
 //BA.debugLineNum = 403;BA.debugLine="B4XPages.ShowPage(\"Cliente\")";
_b4xpages._showpage /*String*/ (ba,"Cliente");
 //BA.debugLineNum = 404;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;
}
}
