package keymon.lat.medicomed;


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

public class c_pedidos 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 anywheresoftware.b4a.ShellBA(_ba, this, htSubs, "keymon.lat.medicomed.c_pedidos");
            if (htSubs == null) {
                ba.loadHtSubs(this.getClass());
                htSubs = ba.htSubs;
            }
            
        }
        if (BA.isShellModeRuntimeCheck(ba)) 
			   this.getClass().getMethod("_class_globals", keymon.lat.medicomed.c_pedidos.class).invoke(this, new Object[] {null});
        else
            ba.raiseEvent2(null, true, "class_globals", false);
    }

 
    public void  innerInitializeHelper(anywheresoftware.b4a.BA _ba) throws Exception{
        innerInitialize(_ba);
    }
    public Object callSub(String sub, Object sender, Object[] args) throws Exception {
        return BA.SubDelegator.SubNotFound;
    }
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.gps.GPS _g = null;
public String _ruta = "";
public anywheresoftware.b4a.sql.SQL _skmt = null;
public anywheresoftware.b4a.objects.Timer _t3 = null;
public anywheresoftware.b4a.phone.Phone _p = null;
public anywheresoftware.b4a.keywords.StringBuilderWrapper _sb = null;
public anywheresoftware.b4a.sql.SQL.CursorWrapper _c = null;
public anywheresoftware.b4a.sql.SQL.CursorWrapper _e = null;
public anywheresoftware.b4a.sql.SQL.CursorWrapper _f = null;
public anywheresoftware.b4a.sql.SQL.CursorWrapper _h = null;
public anywheresoftware.b4a.sql.SQL.CursorWrapper _cc = null;
public anywheresoftware.b4a.sql.SQL.CursorWrapper _dd = null;
public anywheresoftware.b4a.objects.LabelWrapper _l_tipo = null;
public anywheresoftware.b4a.objects.LabelWrapper _l_sub = null;
public anywheresoftware.b4a.objects.LabelWrapper _l_marca = null;
public anywheresoftware.b4a.objects.LabelWrapper _l_desc = null;
public anywheresoftware.b4a.objects.LabelWrapper _l_precio = null;
public anywheresoftware.b4a.objects.LabelWrapper _l_bodega = null;
public anywheresoftware.b4a.objects.EditTextWrapper _cantidad = null;
public anywheresoftware.b4a.objects.ButtonWrapper _guardar = null;
public anywheresoftware.b4a.objects.ButtonWrapper _terminar = null;
public anywheresoftware.b4a.objects.ImageViewWrapper _img_prod = null;
public byte[] _img_paso = null;
public anywheresoftware.b4a.objects.LabelWrapper _l_proid = null;
public String _clie_id = "";
public String _sdate = "";
public String _stime = "";
public String _usuario = "";
public anywheresoftware.b4a.objects.LabelWrapper _t_venta = null;
public String _promo_c = "";
public anywheresoftware.b4a.objects.ImageViewWrapper _i_fotol = null;
public anywheresoftware.b4a.objects.ButtonWrapper _desc_promo = null;
public anywheresoftware.b4a.objects.ButtonWrapper _nopromo = null;
public String _tot_art_promo = "";
public String _cambio = "";
public String _costo_tot = "";
public String _almacen = "";
public String _preciosin = "";
public String _cl_ruta = "";
public anywheresoftware.b4a.sql.SQL.CursorWrapper _d = null;
public String _tot_art_promor = "";
public String _promo_cr = "";
public String _total_promo = "";
public String _hccp_cant = "";
public com.rootsoft.togglelibrary.ToggleLibrary _tgl = null;
public String _precio_cero = "";
public String _bonsabor = "";
public String _bonsabor2 = "";
public keymon.lat.medicomed.dbrequestmanager._dbcommand _cmd = null;
public anywheresoftware.b4a.objects.PanelWrapper _p_pedido = null;
public b4a.example.dateutils _dateutils = null;
public keymon.lat.medicomed.main _main = null;
public keymon.lat.medicomed.starter _starter = null;
public keymon.lat.medicomed.subs _subs = null;
public keymon.lat.medicomed.appupdater _appupdater = null;
public keymon.lat.medicomed.mapa_rutas _mapa_rutas = null;
public keymon.lat.medicomed.tracker _tracker = null;
public keymon.lat.medicomed.newinst2 _newinst2 = null;
public keymon.lat.medicomed.b4xpages _b4xpages = null;
public keymon.lat.medicomed.b4xcollections _b4xcollections = null;
public keymon.lat.medicomed.httputils2service _httputils2service = null;
public keymon.lat.medicomed.xuiviewsutils _xuiviewsutils = null;
public Object  _initialize(keymon.lat.medicomed.c_pedidos __ref,anywheresoftware.b4a.BA _ba) throws Exception{
__ref = this;
innerInitialize(_ba);
RDebugUtils.currentModule="c_pedidos";
if (Debug.shouldDelegate(ba, "initialize", false))
	 {return ((Object) Debug.delegate(ba, "initialize", new Object[] {_ba}));}
RDebugUtils.currentLine=22413312;
 //BA.debugLineNum = 22413312;BA.debugLine="Public Sub Initialize As Object";
RDebugUtils.currentLine=22413313;
 //BA.debugLineNum = 22413313;BA.debugLine="Return Me";
if (true) return this;
RDebugUtils.currentLine=22413314;
 //BA.debugLineNum = 22413314;BA.debugLine="End Sub";
return null;
}
public String  _b4xpage_appear(keymon.lat.medicomed.c_pedidos __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_pedidos";
if (Debug.shouldDelegate(ba, "b4xpage_appear", false))
	 {return ((String) Debug.delegate(ba, "b4xpage_appear", null));}
anywheresoftware.b4a.objects.streams.File.OutputStreamWrapper _out = null;
RDebugUtils.currentLine=22544384;
 //BA.debugLineNum = 22544384;BA.debugLine="Sub B4XPage_Appear";
RDebugUtils.currentLine=22544385;
 //BA.debugLineNum = 22544385;BA.debugLine="tgl.Initialize";
__ref._tgl /*com.rootsoft.togglelibrary.ToggleLibrary*/ .Initialize(ba);
RDebugUtils.currentLine=22544386;
 //BA.debugLineNum = 22544386;BA.debugLine="BONSABOR = 0";
__ref._bonsabor /*String*/  = BA.NumberToString(0);
RDebugUtils.currentLine=22544387;
 //BA.debugLineNum = 22544387;BA.debugLine="BONSABOR2 = 0";
__ref._bonsabor2 /*String*/  = BA.NumberToString(0);
RDebugUtils.currentLine=22544388;
 //BA.debugLineNum = 22544388;BA.debugLine="If Not(Starter.gps.GPSEnabled) Then";
if (__c.Not(_starter._gps /*anywheresoftware.b4a.gps.GPS*/ .getGPSEnabled())) { 
RDebugUtils.currentLine=22544389;
 //BA.debugLineNum = 22544389;BA.debugLine="ToastMessageShow(\"Es necesario tener el GPS ence";
__c.ToastMessageShow(BA.ObjectToCharSequence("Es necesario tener el GPS encendido"),__c.True);
RDebugUtils.currentLine=22544390;
 //BA.debugLineNum = 22544390;BA.debugLine="StartActivity(Starter.gps.LocationSettingsIntent";
__c.StartActivity(ba,(Object)(_starter._gps /*anywheresoftware.b4a.gps.GPS*/ .getLocationSettingsIntent()));
 };
RDebugUtils.currentLine=22544392;
 //BA.debugLineNum = 22544392;BA.debugLine="cantidad.Text = \"\"";
__ref._cantidad /*anywheresoftware.b4a.objects.EditTextWrapper*/ .setText(BA.ObjectToCharSequence(""));
RDebugUtils.currentLine=22544393;
 //BA.debugLineNum = 22544393;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"select  ID_AL";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/  = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select  ID_ALMACEN from CAT_ALMACEN")));
RDebugUtils.currentLine=22544394;
 //BA.debugLineNum = 22544394;BA.debugLine="C.Position =0";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition((int) (0));
RDebugUtils.currentLine=22544395;
 //BA.debugLineNum = 22544395;BA.debugLine="ALMACEN = C.GetString(\"ID_ALMACEN\")";
__ref._almacen /*String*/  = __ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("ID_ALMACEN");
RDebugUtils.currentLine=22544396;
 //BA.debugLineNum = 22544396;BA.debugLine="C.Close";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .Close();
RDebugUtils.currentLine=22544397;
 //BA.debugLineNum = 22544397;BA.debugLine="i_fotol.Visible = False";
__ref._i_fotol /*anywheresoftware.b4a.objects.ImageViewWrapper*/ .setVisible(__c.False);
RDebugUtils.currentLine=22544398;
 //BA.debugLineNum = 22544398;BA.debugLine="sb.Initialize";
__ref._sb /*anywheresoftware.b4a.keywords.StringBuilderWrapper*/ .Initialize();
RDebugUtils.currentLine=22544399;
 //BA.debugLineNum = 22544399;BA.debugLine="p.Shell(\"ping -c1 -W1 177.244.63.54\",Null, sb,Nul";
__ref._p /*anywheresoftware.b4a.phone.Phone*/ .Shell("ping -c1 -W1 177.244.63.54",(String[])(__c.Null),(java.lang.StringBuilder)(__ref._sb /*anywheresoftware.b4a.keywords.StringBuilderWrapper*/ .getObject()),(java.lang.StringBuilder)(__c.Null));
RDebugUtils.currentLine=22544400;
 //BA.debugLineNum = 22544400;BA.debugLine="skmt.Initialize(ruta,\"kmt.db\", True)";
__ref._skmt /*anywheresoftware.b4a.sql.SQL*/ .Initialize(__ref._ruta /*String*/ ,"kmt.db",__c.True);
RDebugUtils.currentLine=22544401;
 //BA.debugLineNum = 22544401;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"select CAT_GP";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/  = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select CAT_GP_ID,CAT_GP_NOMBRE,CAT_GP_IMP1,CAT_GP_IMP2,CAT_GP_PRECIO,CAT_GP_CLASIF,CAT_GP_STS,CAT_GP_TIPO,CAT_GP_SUBTIPO,CAT_GP_IMG,CAT_GP_ALMACEN,CAT_GP_DEV  from CAT_GUNAPROD where CAT_GP_NOMBRE In (Select PDESC from PROID)")));
RDebugUtils.currentLine=22544402;
 //BA.debugLineNum = 22544402;BA.debugLine="c.Position=0";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition((int) (0));
RDebugUtils.currentLine=22544403;
 //BA.debugLineNum = 22544403;BA.debugLine="L_PROID.Text = c.GetString(\"CAT_GP_ID\")";
__ref._l_proid /*anywheresoftware.b4a.objects.LabelWrapper*/ .setText(BA.ObjectToCharSequence(__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CAT_GP_ID")));
RDebugUtils.currentLine=22544404;
 //BA.debugLineNum = 22544404;BA.debugLine="l_tipo.Text = c.GetString(\"CAT_GP_TIPO\")";
__ref._l_tipo /*anywheresoftware.b4a.objects.LabelWrapper*/ .setText(BA.ObjectToCharSequence(__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CAT_GP_TIPO")));
RDebugUtils.currentLine=22544405;
 //BA.debugLineNum = 22544405;BA.debugLine="l_sub.Text = c.GetString(\"CAT_GP_SUBTIPO\")";
__ref._l_sub /*anywheresoftware.b4a.objects.LabelWrapper*/ .setText(BA.ObjectToCharSequence(__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CAT_GP_SUBTIPO")));
RDebugUtils.currentLine=22544406;
 //BA.debugLineNum = 22544406;BA.debugLine="l_marca.Text = c.GetString(\"CAT_GP_CLASIF\")";
__ref._l_marca /*anywheresoftware.b4a.objects.LabelWrapper*/ .setText(BA.ObjectToCharSequence(__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CAT_GP_CLASIF")));
RDebugUtils.currentLine=22544407;
 //BA.debugLineNum = 22544407;BA.debugLine="l_desc.Text = c.GetString(\"CAT_GP_NOMBRE\")";
__ref._l_desc /*anywheresoftware.b4a.objects.LabelWrapper*/ .setText(BA.ObjectToCharSequence(__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CAT_GP_NOMBRE")));
RDebugUtils.currentLine=22544408;
 //BA.debugLineNum = 22544408;BA.debugLine="l_precio.Text = c.GetDouble(\"CAT_GP_PRECIO\")";
__ref._l_precio /*anywheresoftware.b4a.objects.LabelWrapper*/ .setText(BA.ObjectToCharSequence(__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetDouble("CAT_GP_PRECIO")));
RDebugUtils.currentLine=22544409;
 //BA.debugLineNum = 22544409;BA.debugLine="l_bodega.Text = c.GetString(\"CAT_GP_ALMACEN\")";
__ref._l_bodega /*anywheresoftware.b4a.objects.LabelWrapper*/ .setText(BA.ObjectToCharSequence(__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CAT_GP_ALMACEN")));
RDebugUtils.currentLine=22544410;
 //BA.debugLineNum = 22544410;BA.debugLine="IMG_PASO = c.GetBlob(\"CAT_GP_IMG\")";
__ref._img_paso /*byte[]*/  = __ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetBlob("CAT_GP_IMG");
RDebugUtils.currentLine=22544411;
 //BA.debugLineNum = 22544411;BA.debugLine="PROMO_C = c.GetString(\"CAT_GP_STS\")";
__ref._promo_c /*String*/  = __ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CAT_GP_STS");
RDebugUtils.currentLine=22544412;
 //BA.debugLineNum = 22544412;BA.debugLine="cambio = c.GetString(\"CAT_GP_DEV\")";
__ref._cambio /*String*/  = __ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CAT_GP_DEV");
RDebugUtils.currentLine=22544413;
 //BA.debugLineNum = 22544413;BA.debugLine="preciosin = c.GetString(\"CAT_GP_IMP2\")";
__ref._preciosin /*String*/  = __ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CAT_GP_IMP2");
RDebugUtils.currentLine=22544414;
 //BA.debugLineNum = 22544414;BA.debugLine="PROMO_CR = c.GetString(\"CAT_GP_IMP1\")";
__ref._promo_cr /*String*/  = __ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CAT_GP_IMP1");
RDebugUtils.currentLine=22544415;
 //BA.debugLineNum = 22544415;BA.debugLine="cambio = \"0\"";
__ref._cambio /*String*/  = "0";
RDebugUtils.currentLine=22544417;
 //BA.debugLineNum = 22544417;BA.debugLine="e=B4XPages.MainPage.skmt.ExecQuery2(\"select count";
__ref._e /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/  = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery2("select count(*) as CUANTOS FROM pedido WHERE PE_CEDIS = ? AND PE_CLIENTE  IN (Select cuenta from cuentaa) ",new String[]{__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CAT_GP_ID")})));
RDebugUtils.currentLine=22544418;
 //BA.debugLineNum = 22544418;BA.debugLine="e.Position =0";
__ref._e /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition((int) (0));
RDebugUtils.currentLine=22544419;
 //BA.debugLineNum = 22544419;BA.debugLine="If e.GetString(\"CUANTOS\") = 0 Then";
if ((__ref._e /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CUANTOS")).equals(BA.NumberToString(0))) { 
RDebugUtils.currentLine=22544420;
 //BA.debugLineNum = 22544420;BA.debugLine="If l_marca.text = \"PROMOS\" And l_tipo.Text =\"PRO";
if ((__ref._l_marca /*anywheresoftware.b4a.objects.LabelWrapper*/ .getText()).equals("PROMOS") && (__ref._l_tipo /*anywheresoftware.b4a.objects.LabelWrapper*/ .getText()).equals("PROMOS")) { 
RDebugUtils.currentLine=22544421;
 //BA.debugLineNum = 22544421;BA.debugLine="DESC_PROMO.Visible = True";
__ref._desc_promo /*anywheresoftware.b4a.objects.ButtonWrapper*/ .setVisible(__c.True);
RDebugUtils.currentLine=22544422;
 //BA.debugLineNum = 22544422;BA.debugLine="CC=B4XPages.MainPage.skmt.ExecQuery2(\"select co";
__ref._cc /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/  = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery2("select count(*) as CUANTOS FROM PROMOS_COMP WHERE CAT_PA_ID = ?",new String[]{__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CAT_GP_ID")})));
RDebugUtils.currentLine=22544423;
 //BA.debugLineNum = 22544423;BA.debugLine="CC.Position =0";
__ref._cc /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition((int) (0));
RDebugUtils.currentLine=22544424;
 //BA.debugLineNum = 22544424;BA.debugLine="If CC.GetString(\"CUANTOS\") = 0 Then";
if ((__ref._cc /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CUANTOS")).equals(BA.NumberToString(0))) { 
RDebugUtils.currentLine=22544425;
 //BA.debugLineNum = 22544425;BA.debugLine="l_bodega.Text = \"0\" ' se modifica a cero para";
__ref._l_bodega /*anywheresoftware.b4a.objects.LabelWrapper*/ .setText(BA.ObjectToCharSequence("0"));
 }else {
RDebugUtils.currentLine=22544427;
 //BA.debugLineNum = 22544427;BA.debugLine="CC.Close";
__ref._cc /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .Close();
RDebugUtils.currentLine=22544428;
 //BA.debugLineNum = 22544428;BA.debugLine="CC=B4XPages.MainPage.skmt.ExecQuery2(\"select C";
__ref._cc /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/  = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery2("select CAT_PA_MAXPROM, CAT_PA_MAXPROMREC, CAT_PA_MAXPROMCLIE FROM PROMOS_COMP WHERE CAT_PA_ID = ?",new String[]{__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CAT_GP_ID")})));
RDebugUtils.currentLine=22544429;
 //BA.debugLineNum = 22544429;BA.debugLine="CC.Position =0";
__ref._cc /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition((int) (0));
RDebugUtils.currentLine=22544431;
 //BA.debugLineNum = 22544431;BA.debugLine="DD=B4XPages.MainPage.skmt.ExecQuery2(\"SELECT C";
__ref._dd /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/  = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery2("SELECT COUNT(*) AS CUANTOS FROM HIST_CLIENTE_CANT_PROMOS WHERE HCCP_CLIENTE IN (Select cuenta from cuentaa) AND HCCP_PROMO =?",new String[]{__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CAT_GP_ID")})));
RDebugUtils.currentLine=22544432;
 //BA.debugLineNum = 22544432;BA.debugLine="DD.Position =0";
__ref._dd /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition((int) (0));
RDebugUtils.currentLine=22544433;
 //BA.debugLineNum = 22544433;BA.debugLine="If DD.GetString(\"CUANTOS\")  = 0 Then";
if ((__ref._dd /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CUANTOS")).equals(BA.NumberToString(0))) { 
RDebugUtils.currentLine=22544434;
 //BA.debugLineNum = 22544434;BA.debugLine="HCCP_CANT = 0";
__ref._hccp_cant /*String*/  = BA.NumberToString(0);
 }else {
RDebugUtils.currentLine=22544436;
 //BA.debugLineNum = 22544436;BA.debugLine="DD.Close";
__ref._dd /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .Close();
RDebugUtils.currentLine=22544437;
 //BA.debugLineNum = 22544437;BA.debugLine="DD=B4XPages.MainPage.skmt.ExecQuery2(\"SELECT";
__ref._dd /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/  = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery2("SELECT HCCP_CANT FROM HIST_CLIENTE_CANT_PROMOS WHERE HCCP_CLIENTE IN (Select cuenta from cuentaa) AND HCCP_PROMO =?",new String[]{__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CAT_GP_ID")})));
RDebugUtils.currentLine=22544438;
 //BA.debugLineNum = 22544438;BA.debugLine="DD.Position =0";
__ref._dd /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition((int) (0));
RDebugUtils.currentLine=22544439;
 //BA.debugLineNum = 22544439;BA.debugLine="HCCP_CANT = DD.GetString(\"HCCP_CANT\")";
__ref._hccp_cant /*String*/  = __ref._dd /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("HCCP_CANT");
RDebugUtils.currentLine=22544440;
 //BA.debugLineNum = 22544440;BA.debugLine="DD.Close";
__ref._dd /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .Close();
 };
RDebugUtils.currentLine=22544442;
 //BA.debugLineNum = 22544442;BA.debugLine="BONSABOR = HCCP_CANT";
__ref._bonsabor /*String*/  = __ref._hccp_cant /*String*/ ;
RDebugUtils.currentLine=22544443;
 //BA.debugLineNum = 22544443;BA.debugLine="DD=B4XPages.MainPage.skmt.ExecQuery2(\"SELECT C";
__ref._dd /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/  = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery2("SELECT COUNT(*) AS CUANTOS FROM HIST_VENTAS WHERE HVD_CLIENTE IN (Select cuenta from cuentaa) AND HVD_PRONOMBRE =?",new String[]{__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CAT_GP_NOMBRE")})));
RDebugUtils.currentLine=22544444;
 //BA.debugLineNum = 22544444;BA.debugLine="DD.Position =0";
__ref._dd /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition((int) (0));
RDebugUtils.currentLine=22544445;
 //BA.debugLineNum = 22544445;BA.debugLine="If DD.GetString(\"CUANTOS\")  = 0 Then";
if ((__ref._dd /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CUANTOS")).equals(BA.NumberToString(0))) { 
RDebugUtils.currentLine=22544446;
 //BA.debugLineNum = 22544446;BA.debugLine="HCCP_CANT = 0";
__ref._hccp_cant /*String*/  = BA.NumberToString(0);
 }else {
RDebugUtils.currentLine=22544448;
 //BA.debugLineNum = 22544448;BA.debugLine="DD.Close";
__ref._dd /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .Close();
RDebugUtils.currentLine=22544449;
 //BA.debugLineNum = 22544449;BA.debugLine="DD=B4XPages.MainPage.skmt.ExecQuery2(\"SELECT";
__ref._dd /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/  = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery2("SELECT SUM(HVD_CANT) AS HCCP_CANT FROM HIST_VENTAS WHERE HVD_CLIENTE IN (Select cuenta from cuentaa) AND HVD_PRONOMBRE =?",new String[]{__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CAT_GP_NOMBRE")})));
RDebugUtils.currentLine=22544450;
 //BA.debugLineNum = 22544450;BA.debugLine="DD.Position =0";
__ref._dd /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition((int) (0));
RDebugUtils.currentLine=22544451;
 //BA.debugLineNum = 22544451;BA.debugLine="HCCP_CANT = DD.GetString(\"HCCP_CANT\")";
__ref._hccp_cant /*String*/  = __ref._dd /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("HCCP_CANT");
RDebugUtils.currentLine=22544452;
 //BA.debugLineNum = 22544452;BA.debugLine="DD.Close";
__ref._dd /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .Close();
 };
RDebugUtils.currentLine=22544454;
 //BA.debugLineNum = 22544454;BA.debugLine="DD=B4XPages.MainPage.skmt.ExecQuery2(\"Select C";
__ref._dd /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/  = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery2("Select COUNT(*) AS CUANTOS FROM PEDIDO WHERE PE_CLIENTE IN  (Select cuenta from cuentaa) AND  PE_PROID IN (select CAT_GP_ID   from CAT_GUNAPROD where CAT_GP_CLASIF = ?) ",new String[]{__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CAT_GP_NOMBRE")})));
RDebugUtils.currentLine=22544455;
 //BA.debugLineNum = 22544455;BA.debugLine="DD.Position =0";
__ref._dd /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition((int) (0));
RDebugUtils.currentLine=22544456;
 //BA.debugLineNum = 22544456;BA.debugLine="BONSABOR2 = DD.GetString(\"CUANTOS\")";
__ref._bonsabor2 /*String*/  = __ref._dd /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CUANTOS");
RDebugUtils.currentLine=22544457;
 //BA.debugLineNum = 22544457;BA.debugLine="DD.Close";
__ref._dd /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .Close();
RDebugUtils.currentLine=22544458;
 //BA.debugLineNum = 22544458;BA.debugLine="TOTAL_PROMO = CC.GetString(\"CAT_PA_MAXPROMCLIE";
__ref._total_promo /*String*/  = BA.NumberToString((double)(Double.parseDouble(__ref._cc /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CAT_PA_MAXPROMCLIE")))-(double)(Double.parseDouble(__ref._hccp_cant /*String*/ )));
RDebugUtils.currentLine=22544459;
 //BA.debugLineNum = 22544459;BA.debugLine="If HCCP_CANT = 0 Then";
if ((__ref._hccp_cant /*String*/ ).equals(BA.NumberToString(0))) { 
RDebugUtils.currentLine=22544460;
 //BA.debugLineNum = 22544460;BA.debugLine="l_bodega.Text = CC.GetString(\"CAT_PA_MAXPROM\"";
__ref._l_bodega /*anywheresoftware.b4a.objects.LabelWrapper*/ .setText(BA.ObjectToCharSequence(__ref._cc /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CAT_PA_MAXPROM")));
 }else 
{RDebugUtils.currentLine=22544461;
 //BA.debugLineNum = 22544461;BA.debugLine="Else IF TOTAL_PROMO > CC.GetString(\"CAT_PA_MAX";
if ((double)(Double.parseDouble(__ref._total_promo /*String*/ ))>(double)(Double.parseDouble(__ref._cc /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CAT_PA_MAXPROMREC")))) { 
RDebugUtils.currentLine=22544462;
 //BA.debugLineNum = 22544462;BA.debugLine="l_bodega.Text = 	CC.GetString(\"CAT_PA_MAXPROM";
__ref._l_bodega /*anywheresoftware.b4a.objects.LabelWrapper*/ .setText(BA.ObjectToCharSequence(__ref._cc /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CAT_PA_MAXPROMREC")));
 }else {
RDebugUtils.currentLine=22544464;
 //BA.debugLineNum = 22544464;BA.debugLine="l_bodega.Text = TOTAL_PROMO";
__ref._l_bodega /*anywheresoftware.b4a.objects.LabelWrapper*/ .setText(BA.ObjectToCharSequence(__ref._total_promo /*String*/ ));
 }}
;
 };
 }else {
RDebugUtils.currentLine=22544468;
 //BA.debugLineNum = 22544468;BA.debugLine="DESC_PROMO.Visible = False";
__ref._desc_promo /*anywheresoftware.b4a.objects.ButtonWrapper*/ .setVisible(__c.False);
 };
RDebugUtils.currentLine=22544470;
 //BA.debugLineNum = 22544470;BA.debugLine="c.Close";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .Close();
RDebugUtils.currentLine=22544471;
 //BA.debugLineNum = 22544471;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"select CASE";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/  = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select CASE WHEN pe_costo_tot is null then 0 else  sum( pe_costo_tot ) end as TOTAL_CLIE FROM PEDIDO WHERE PE_CLIENTE IN (Select CUENTA from cuentaa)")));
RDebugUtils.currentLine=22544472;
 //BA.debugLineNum = 22544472;BA.debugLine="c.Position=0";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition((int) (0));
RDebugUtils.currentLine=22544473;
 //BA.debugLineNum = 22544473;BA.debugLine="t_venta.Text = c.GetString(\"TOTAL_CLIE\")";
__ref._t_venta /*anywheresoftware.b4a.objects.LabelWrapper*/ .setText(BA.ObjectToCharSequence(__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("TOTAL_CLIE")));
RDebugUtils.currentLine=22544474;
 //BA.debugLineNum = 22544474;BA.debugLine="c.Close";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .Close();
RDebugUtils.currentLine=22544475;
 //BA.debugLineNum = 22544475;BA.debugLine="Terminar.Visible = True";
__ref._terminar /*anywheresoftware.b4a.objects.ButtonWrapper*/ .setVisible(__c.True);
RDebugUtils.currentLine=22544476;
 //BA.debugLineNum = 22544476;BA.debugLine="guardar.Visible = True";
__ref._guardar /*anywheresoftware.b4a.objects.ButtonWrapper*/ .setVisible(__c.True);
RDebugUtils.currentLine=22544477;
 //BA.debugLineNum = 22544477;BA.debugLine="cantidad.Visible = True";
__ref._cantidad /*anywheresoftware.b4a.objects.EditTextWrapper*/ .setVisible(__c.True);
RDebugUtils.currentLine=22544478;
 //BA.debugLineNum = 22544478;BA.debugLine="If cambio = \"1\" Then";
if ((__ref._cambio /*String*/ ).equals("1")) { 
RDebugUtils.currentLine=22544479;
 //BA.debugLineNum = 22544479;BA.debugLine="nopromo.Visible = True";
__ref._nopromo /*anywheresoftware.b4a.objects.ButtonWrapper*/ .setVisible(__c.True);
 }else {
RDebugUtils.currentLine=22544481;
 //BA.debugLineNum = 22544481;BA.debugLine="nopromo.Visible = False";
__ref._nopromo /*anywheresoftware.b4a.objects.ButtonWrapper*/ .setVisible(__c.False);
 };
RDebugUtils.currentLine=22544483;
 //BA.debugLineNum = 22544483;BA.debugLine="Dim out As OutputStream";
_out = new anywheresoftware.b4a.objects.streams.File.OutputStreamWrapper();
RDebugUtils.currentLine=22544484;
 //BA.debugLineNum = 22544484;BA.debugLine="out = File.OpenOutput(ruta, \"1.jpg\", False)";
_out = __c.File.OpenOutput(__ref._ruta /*String*/ ,"1.jpg",__c.False);
RDebugUtils.currentLine=22544485;
 //BA.debugLineNum = 22544485;BA.debugLine="out.WriteBytes(IMG_PASO, 0, IMG_PASO.Length)";
_out.WriteBytes(__ref._img_paso /*byte[]*/ ,(int) (0),__ref._img_paso /*byte[]*/ .length);
RDebugUtils.currentLine=22544486;
 //BA.debugLineNum = 22544486;BA.debugLine="out.Close";
_out.Close();
RDebugUtils.currentLine=22544487;
 //BA.debugLineNum = 22544487;BA.debugLine="img_prod.Bitmap = LoadBitmap(ruta,\"1.jpg\")";
__ref._img_prod /*anywheresoftware.b4a.objects.ImageViewWrapper*/ .setBitmap((android.graphics.Bitmap)(__c.LoadBitmap(__ref._ruta /*String*/ ,"1.jpg").getObject()));
RDebugUtils.currentLine=22544488;
 //BA.debugLineNum = 22544488;BA.debugLine="TOT_ART_PROMO = \"0\"";
__ref._tot_art_promo /*String*/  = "0";
RDebugUtils.currentLine=22544489;
 //BA.debugLineNum = 22544489;BA.debugLine="TOT_ART_PROMOR = \"0\"";
__ref._tot_art_promor /*String*/  = "0";
RDebugUtils.currentLine=22544490;
 //BA.debugLineNum = 22544490;BA.debugLine="If l_marca.text = \"PROMOS\" And l_tipo.Text =\"PRO";
if ((__ref._l_marca /*anywheresoftware.b4a.objects.LabelWrapper*/ .getText()).equals("PROMOS") && (__ref._l_tipo /*anywheresoftware.b4a.objects.LabelWrapper*/ .getText()).equals("PROMOS") && (__ref._l_bodega /*anywheresoftware.b4a.objects.LabelWrapper*/ .getText()).equals("0")) { 
RDebugUtils.currentLine=22544491;
 //BA.debugLineNum = 22544491;BA.debugLine="Msgbox(\"ALERTA\",\"EL CLIENTE NO PUEDE TENER ESTA";
__c.Msgbox(BA.ObjectToCharSequence("ALERTA"),BA.ObjectToCharSequence("EL CLIENTE NO PUEDE TENER ESTA PROMOCION"),ba);
RDebugUtils.currentLine=22544492;
 //BA.debugLineNum = 22544492;BA.debugLine="B4XPages.ShowPage(\"Productos\")";
_b4xpages._showpage /*String*/ (ba,"Productos");
 }else 
{RDebugUtils.currentLine=22544493;
 //BA.debugLineNum = 22544493;BA.debugLine="ELSE IF l_marca.text = \"PROMOS\" And l_tipo.Text";
if ((__ref._l_marca /*anywheresoftware.b4a.objects.LabelWrapper*/ .getText()).equals("PROMOS") && (__ref._l_tipo /*anywheresoftware.b4a.objects.LabelWrapper*/ .getText()).equals("PROMOS") && (__ref._l_proid /*anywheresoftware.b4a.objects.LabelWrapper*/ .getText()).equals("PROUNI1") && (__ref._bonsabor /*String*/ ).equals("1") == false && (__ref._bonsabor2 /*String*/ ).equals(BA.NumberToString(0))) { 
RDebugUtils.currentLine=22544494;
 //BA.debugLineNum = 22544494;BA.debugLine="Msgbox(\"ALERTA\",\"EL CLIENTE NO PUEDE TENER ESTA";
__c.Msgbox(BA.ObjectToCharSequence("ALERTA"),BA.ObjectToCharSequence("EL CLIENTE NO PUEDE TENER ESTA PROMOCION"),ba);
RDebugUtils.currentLine=22544495;
 //BA.debugLineNum = 22544495;BA.debugLine="B4XPages.ShowPage(\"Productos\")";
_b4xpages._showpage /*String*/ (ba,"Productos");
 }}
;
 }else {
RDebugUtils.currentLine=22544498;
 //BA.debugLineNum = 22544498;BA.debugLine="Msgbox(\"ALERTA\",\"EL CLIENTE YA COMPRO ESTE PRODU";
__c.Msgbox(BA.ObjectToCharSequence("ALERTA"),BA.ObjectToCharSequence("EL CLIENTE YA COMPRO ESTE PRODUCTO REVISAR NOTA"),ba);
RDebugUtils.currentLine=22544499;
 //BA.debugLineNum = 22544499;BA.debugLine="B4XPages.ShowPage(\"Productos\")";
_b4xpages._showpage /*String*/ (ba,"Productos");
 };
RDebugUtils.currentLine=22544501;
 //BA.debugLineNum = 22544501;BA.debugLine="End Sub";
return "";
}
public anywheresoftware.b4a.keywords.Common.ResumableSubWrapper  _b4xpage_closerequest(keymon.lat.medicomed.c_pedidos __ref) throws Exception{
RDebugUtils.currentModule="c_pedidos";
if (Debug.shouldDelegate(ba, "b4xpage_closerequest", false))
	 {return ((anywheresoftware.b4a.keywords.Common.ResumableSubWrapper) Debug.delegate(ba, "b4xpage_closerequest", null));}
ResumableSub_B4XPage_CloseRequest rsub = new ResumableSub_B4XPage_CloseRequest(this,__ref);
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(keymon.lat.medicomed.c_pedidos parent,keymon.lat.medicomed.c_pedidos __ref) {
this.parent = parent;
this.__ref = __ref;
this.__ref = parent;
}
keymon.lat.medicomed.c_pedidos __ref;
keymon.lat.medicomed.c_pedidos parent;

@Override
public void resume(BA ba, Object[] result) throws Exception{
RDebugUtils.currentModule="c_pedidos";

    while (true) {
        switch (state) {
            case -1:
{
parent.__c.ReturnFromResumableSub(this,null);return;}
case 0:
//C
this.state = -1;
RDebugUtils.currentLine=22806531;
 //BA.debugLineNum = 22806531;BA.debugLine="Msgbox(\"Presione Boton Terminar.\",\"ADVERTENCIA\")";
parent.__c.Msgbox(BA.ObjectToCharSequence("Presione Boton Terminar."),BA.ObjectToCharSequence("ADVERTENCIA"),ba);
RDebugUtils.currentLine=22806532;
 //BA.debugLineNum = 22806532;BA.debugLine="Return False";
if (true) {
parent.__c.ReturnFromResumableSub(this,(Object)(parent.__c.False));return;};
RDebugUtils.currentLine=22806533;
 //BA.debugLineNum = 22806533;BA.debugLine="End Sub";
if (true) break;

            }
        }
    }
}
public String  _b4xpage_created(keymon.lat.medicomed.c_pedidos __ref,anywheresoftware.b4a.objects.B4XViewWrapper _root1) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_pedidos";
if (Debug.shouldDelegate(ba, "b4xpage_created", false))
	 {return ((String) Debug.delegate(ba, "b4xpage_created", new Object[] {_root1}));}
RDebugUtils.currentLine=22478848;
 //BA.debugLineNum = 22478848;BA.debugLine="Private Sub B4XPage_Created (Root1 As B4XView)";
RDebugUtils.currentLine=22478849;
 //BA.debugLineNum = 22478849;BA.debugLine="Root = Root1";
__ref._root /*anywheresoftware.b4a.objects.B4XViewWrapper*/  = _root1;
RDebugUtils.currentLine=22478851;
 //BA.debugLineNum = 22478851;BA.debugLine="Root.LoadLayout(\"pedido\")";
__ref._root /*anywheresoftware.b4a.objects.B4XViewWrapper*/ .LoadLayout("pedido",ba);
RDebugUtils.currentLine=22478852;
 //BA.debugLineNum = 22478852;BA.debugLine="i_fotol.Visible = False";
__ref._i_fotol /*anywheresoftware.b4a.objects.ImageViewWrapper*/ .setVisible(__c.False);
RDebugUtils.currentLine=22478854;
 //BA.debugLineNum = 22478854;BA.debugLine="ruta = File.DirInternal";
__ref._ruta /*String*/  = __c.File.getDirInternal();
RDebugUtils.currentLine=22478855;
 //BA.debugLineNum = 22478855;BA.debugLine="If File.Exists(ruta, \"kmt.db\") = False Then";
if (__c.File.Exists(__ref._ruta /*String*/ ,"kmt.db")==__c.False) { 
RDebugUtils.currentLine=22478856;
 //BA.debugLineNum = 22478856;BA.debugLine="File.Copy(File.DirAssets, \"kmt.db\", ruta, \"kmt.d";
__c.File.Copy(__c.File.getDirAssets(),"kmt.db",__ref._ruta /*String*/ ,"kmt.db");
 };
RDebugUtils.currentLine=22478859;
 //BA.debugLineNum = 22478859;BA.debugLine="End Sub";
return "";
}
public String  _class_globals(keymon.lat.medicomed.c_pedidos __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_pedidos";
RDebugUtils.currentLine=22347776;
 //BA.debugLineNum = 22347776;BA.debugLine="Sub Class_Globals";
RDebugUtils.currentLine=22347777;
 //BA.debugLineNum = 22347777;BA.debugLine="Private Root As B4XView 'ignore";
_root = new anywheresoftware.b4a.objects.B4XViewWrapper();
RDebugUtils.currentLine=22347778;
 //BA.debugLineNum = 22347778;BA.debugLine="Private xui As XUI 'ignore";
_xui = new anywheresoftware.b4a.objects.B4XViewWrapper.XUI();
RDebugUtils.currentLine=22347780;
 //BA.debugLineNum = 22347780;BA.debugLine="Dim g As GPS";
_g = new anywheresoftware.b4a.gps.GPS();
RDebugUtils.currentLine=22347781;
 //BA.debugLineNum = 22347781;BA.debugLine="Dim ruta As String";
_ruta = "";
RDebugUtils.currentLine=22347782;
 //BA.debugLineNum = 22347782;BA.debugLine="Dim skmt As SQL";
_skmt = new anywheresoftware.b4a.sql.SQL();
RDebugUtils.currentLine=22347783;
 //BA.debugLineNum = 22347783;BA.debugLine="Private t3 As Timer";
_t3 = new anywheresoftware.b4a.objects.Timer();
RDebugUtils.currentLine=22347784;
 //BA.debugLineNum = 22347784;BA.debugLine="Dim p As Phone";
_p = new anywheresoftware.b4a.phone.Phone();
RDebugUtils.currentLine=22347785;
 //BA.debugLineNum = 22347785;BA.debugLine="Dim sb As StringBuilder";
_sb = new anywheresoftware.b4a.keywords.StringBuilderWrapper();
RDebugUtils.currentLine=22347787;
 //BA.debugLineNum = 22347787;BA.debugLine="Dim c As Cursor";
_c = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
RDebugUtils.currentLine=22347788;
 //BA.debugLineNum = 22347788;BA.debugLine="Dim e As Cursor";
_e = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
RDebugUtils.currentLine=22347789;
 //BA.debugLineNum = 22347789;BA.debugLine="Dim f As Cursor";
_f = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
RDebugUtils.currentLine=22347790;
 //BA.debugLineNum = 22347790;BA.debugLine="Dim h As Cursor";
_h = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
RDebugUtils.currentLine=22347791;
 //BA.debugLineNum = 22347791;BA.debugLine="Dim CC As Cursor";
_cc = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
RDebugUtils.currentLine=22347792;
 //BA.debugLineNum = 22347792;BA.debugLine="Dim DD As Cursor";
_dd = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
RDebugUtils.currentLine=22347793;
 //BA.debugLineNum = 22347793;BA.debugLine="Dim l_tipo As Label";
_l_tipo = new anywheresoftware.b4a.objects.LabelWrapper();
RDebugUtils.currentLine=22347794;
 //BA.debugLineNum = 22347794;BA.debugLine="Dim l_sub As Label";
_l_sub = new anywheresoftware.b4a.objects.LabelWrapper();
RDebugUtils.currentLine=22347795;
 //BA.debugLineNum = 22347795;BA.debugLine="Dim l_marca As Label";
_l_marca = new anywheresoftware.b4a.objects.LabelWrapper();
RDebugUtils.currentLine=22347796;
 //BA.debugLineNum = 22347796;BA.debugLine="Dim l_desc As Label";
_l_desc = new anywheresoftware.b4a.objects.LabelWrapper();
RDebugUtils.currentLine=22347797;
 //BA.debugLineNum = 22347797;BA.debugLine="Dim l_precio As Label";
_l_precio = new anywheresoftware.b4a.objects.LabelWrapper();
RDebugUtils.currentLine=22347798;
 //BA.debugLineNum = 22347798;BA.debugLine="Dim l_bodega As Label";
_l_bodega = new anywheresoftware.b4a.objects.LabelWrapper();
RDebugUtils.currentLine=22347799;
 //BA.debugLineNum = 22347799;BA.debugLine="Dim cantidad As EditText";
_cantidad = new anywheresoftware.b4a.objects.EditTextWrapper();
RDebugUtils.currentLine=22347800;
 //BA.debugLineNum = 22347800;BA.debugLine="Dim guardar As Button";
_guardar = new anywheresoftware.b4a.objects.ButtonWrapper();
RDebugUtils.currentLine=22347801;
 //BA.debugLineNum = 22347801;BA.debugLine="Dim Terminar As Button";
_terminar = new anywheresoftware.b4a.objects.ButtonWrapper();
RDebugUtils.currentLine=22347802;
 //BA.debugLineNum = 22347802;BA.debugLine="Dim img_prod As ImageView";
_img_prod = new anywheresoftware.b4a.objects.ImageViewWrapper();
RDebugUtils.currentLine=22347803;
 //BA.debugLineNum = 22347803;BA.debugLine="Dim IMG_PASO() As Byte";
_img_paso = new byte[(int) (0)];
;
RDebugUtils.currentLine=22347804;
 //BA.debugLineNum = 22347804;BA.debugLine="Dim L_PROID As Label";
_l_proid = new anywheresoftware.b4a.objects.LabelWrapper();
RDebugUtils.currentLine=22347805;
 //BA.debugLineNum = 22347805;BA.debugLine="Dim clie_id As String";
_clie_id = "";
RDebugUtils.currentLine=22347806;
 //BA.debugLineNum = 22347806;BA.debugLine="Dim sDate,sTime As String";
_sdate = "";
_stime = "";
RDebugUtils.currentLine=22347807;
 //BA.debugLineNum = 22347807;BA.debugLine="Dim usuario As String";
_usuario = "";
RDebugUtils.currentLine=22347809;
 //BA.debugLineNum = 22347809;BA.debugLine="Dim t_venta As Label";
_t_venta = new anywheresoftware.b4a.objects.LabelWrapper();
RDebugUtils.currentLine=22347810;
 //BA.debugLineNum = 22347810;BA.debugLine="Dim PROMO_C As String";
_promo_c = "";
RDebugUtils.currentLine=22347811;
 //BA.debugLineNum = 22347811;BA.debugLine="Dim i_fotol As ImageView";
_i_fotol = new anywheresoftware.b4a.objects.ImageViewWrapper();
RDebugUtils.currentLine=22347812;
 //BA.debugLineNum = 22347812;BA.debugLine="Private DESC_PROMO As Button";
_desc_promo = new anywheresoftware.b4a.objects.ButtonWrapper();
RDebugUtils.currentLine=22347813;
 //BA.debugLineNum = 22347813;BA.debugLine="Private nopromo As Button";
_nopromo = new anywheresoftware.b4a.objects.ButtonWrapper();
RDebugUtils.currentLine=22347814;
 //BA.debugLineNum = 22347814;BA.debugLine="Dim TOT_ART_PROMO As String";
_tot_art_promo = "";
RDebugUtils.currentLine=22347815;
 //BA.debugLineNum = 22347815;BA.debugLine="Dim cambio As String";
_cambio = "";
RDebugUtils.currentLine=22347816;
 //BA.debugLineNum = 22347816;BA.debugLine="Dim COSTO_TOT As String";
_costo_tot = "";
RDebugUtils.currentLine=22347817;
 //BA.debugLineNum = 22347817;BA.debugLine="Dim ALMACEN As String";
_almacen = "";
RDebugUtils.currentLine=22347818;
 //BA.debugLineNum = 22347818;BA.debugLine="Dim preciosin As String";
_preciosin = "";
RDebugUtils.currentLine=22347819;
 //BA.debugLineNum = 22347819;BA.debugLine="Dim cl_ruta As String";
_cl_ruta = "";
RDebugUtils.currentLine=22347820;
 //BA.debugLineNum = 22347820;BA.debugLine="Dim d As Cursor";
_d = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
RDebugUtils.currentLine=22347821;
 //BA.debugLineNum = 22347821;BA.debugLine="Dim TOT_ART_PROMOR As String";
_tot_art_promor = "";
RDebugUtils.currentLine=22347822;
 //BA.debugLineNum = 22347822;BA.debugLine="Dim PROMO_CR As String";
_promo_cr = "";
RDebugUtils.currentLine=22347823;
 //BA.debugLineNum = 22347823;BA.debugLine="Dim TOTAL_PROMO As String";
_total_promo = "";
RDebugUtils.currentLine=22347824;
 //BA.debugLineNum = 22347824;BA.debugLine="Dim HCCP_CANT As String";
_hccp_cant = "";
RDebugUtils.currentLine=22347825;
 //BA.debugLineNum = 22347825;BA.debugLine="Dim tgl As Toggle";
_tgl = new com.rootsoft.togglelibrary.ToggleLibrary();
RDebugUtils.currentLine=22347826;
 //BA.debugLineNum = 22347826;BA.debugLine="Dim precio_Cero As String";
_precio_cero = "";
RDebugUtils.currentLine=22347827;
 //BA.debugLineNum = 22347827;BA.debugLine="Private BONSABOR As String";
_bonsabor = "";
RDebugUtils.currentLine=22347828;
 //BA.debugLineNum = 22347828;BA.debugLine="Private BONSABOR2 As String";
_bonsabor2 = "";
RDebugUtils.currentLine=22347829;
 //BA.debugLineNum = 22347829;BA.debugLine="Dim cmd As DBCommand";
_cmd = new keymon.lat.medicomed.dbrequestmanager._dbcommand();
RDebugUtils.currentLine=22347830;
 //BA.debugLineNum = 22347830;BA.debugLine="Private p_pedido As Panel";
_p_pedido = new anywheresoftware.b4a.objects.PanelWrapper();
RDebugUtils.currentLine=22347831;
 //BA.debugLineNum = 22347831;BA.debugLine="End Sub";
return "";
}
public String  _desc_promo_click(keymon.lat.medicomed.c_pedidos __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_pedidos";
if (Debug.shouldDelegate(ba, "desc_promo_click", false))
	 {return ((String) Debug.delegate(ba, "desc_promo_click", null));}
RDebugUtils.currentLine=23003136;
 //BA.debugLineNum = 23003136;BA.debugLine="Sub DESC_PROMO_Click";
RDebugUtils.currentLine=23003137;
 //BA.debugLineNum = 23003137;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"delete from";
_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("delete from PROIDID");
RDebugUtils.currentLine=23003138;
 //BA.debugLineNum = 23003138;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"INSERT INTO";
_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("INSERT INTO PROIDID VALUES (?)",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(__ref._l_proid /*anywheresoftware.b4a.objects.LabelWrapper*/ .getText())}));
RDebugUtils.currentLine=23003139;
 //BA.debugLineNum = 23003139;BA.debugLine="B4XPages.ShowPage(\"detalle_promo\")";
_b4xpages._showpage /*String*/ (ba,"detalle_promo");
RDebugUtils.currentLine=23003140;
 //BA.debugLineNum = 23003140;BA.debugLine="End Sub";
return "";
}
public String  _gps_locationchanged(keymon.lat.medicomed.c_pedidos __ref,anywheresoftware.b4a.gps.LocationWrapper _location1) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_pedidos";
if (Debug.shouldDelegate(ba, "gps_locationchanged", false))
	 {return ((String) Debug.delegate(ba, "gps_locationchanged", new Object[] {_location1}));}
RDebugUtils.currentLine=22675456;
 //BA.debugLineNum = 22675456;BA.debugLine="Sub GPS_LocationChanged (Location1 As Location)";
RDebugUtils.currentLine=22675459;
 //BA.debugLineNum = 22675459;BA.debugLine="End Sub";
return "";
}
public String  _guardar_click(keymon.lat.medicomed.c_pedidos __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_pedidos";
if (Debug.shouldDelegate(ba, "guardar_click", false))
	 {return ((String) Debug.delegate(ba, "guardar_click", null));}
int _i = 0;
RDebugUtils.currentLine=22609920;
 //BA.debugLineNum = 22609920;BA.debugLine="Sub guardar_Click";
RDebugUtils.currentLine=22609921;
 //BA.debugLineNum = 22609921;BA.debugLine="If cantidad.Text = \"\" Then";
if ((__ref._cantidad /*anywheresoftware.b4a.objects.EditTextWrapper*/ .getText()).equals("")) { 
RDebugUtils.currentLine=22609922;
 //BA.debugLineNum = 22609922;BA.debugLine="B4XPages.ShowPage(\"Productos\")";
_b4xpages._showpage /*String*/ (ba,"Productos");
 }else 
{RDebugUtils.currentLine=22609923;
 //BA.debugLineNum = 22609923;BA.debugLine="ELSE If cantidad.Text > l_bodega.Text Then";
if ((double)(Double.parseDouble(__ref._cantidad /*anywheresoftware.b4a.objects.EditTextWrapper*/ .getText()))>(double)(Double.parseDouble(__ref._l_bodega /*anywheresoftware.b4a.objects.LabelWrapper*/ .getText()))) { 
RDebugUtils.currentLine=22609924;
 //BA.debugLineNum = 22609924;BA.debugLine="Msgbox(\"Exede la existencia\", \"ADVERTENCIA\") 'ig";
__c.Msgbox(BA.ObjectToCharSequence("Exede la existencia"),BA.ObjectToCharSequence("ADVERTENCIA"),ba);
 }else 
{RDebugUtils.currentLine=22609925;
 //BA.debugLineNum = 22609925;BA.debugLine="Else If l_marca.text = \"PROMOS\" And l_tipo.Text =";
if ((__ref._l_marca /*anywheresoftware.b4a.objects.LabelWrapper*/ .getText()).equals("PROMOS") && (__ref._l_tipo /*anywheresoftware.b4a.objects.LabelWrapper*/ .getText()).equals("PROMOS") && (double)(Double.parseDouble(__ref._promo_c /*String*/ ))>0 && (double)(Double.parseDouble(__ref._cantidad /*anywheresoftware.b4a.objects.EditTextWrapper*/ .getText()))>0) { 
RDebugUtils.currentLine=22609926;
 //BA.debugLineNum = 22609926;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"delete from";
_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("delete from PROIDID");
RDebugUtils.currentLine=22609927;
 //BA.debugLineNum = 22609927;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"INSERT INT";
_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("INSERT INTO PROIDID VALUES (?)",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(__ref._l_proid /*anywheresoftware.b4a.objects.LabelWrapper*/ .getText())}));
RDebugUtils.currentLine=22609928;
 //BA.debugLineNum = 22609928;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"Select count";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/  = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("Select count(*) as CUANTOSD from pedido where PE_CLIENTE IN (Select CUENTA from cuentaa)  and pe_proid In (Select cat_dp_idprod from CAT_DETALLES_PAQ WHERE CAT_DP_ID In (Select PROIDID from PROIDID) AND CAT_DP_TIPO = 1)")));
RDebugUtils.currentLine=22609929;
 //BA.debugLineNum = 22609929;BA.debugLine="c.Position =0";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition((int) (0));
RDebugUtils.currentLine=22609930;
 //BA.debugLineNum = 22609930;BA.debugLine="If c.GetString(\"CUANTOSD\") = 0 Then";
if ((__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CUANTOSD")).equals(BA.NumberToString(0))) { 
RDebugUtils.currentLine=22609931;
 //BA.debugLineNum = 22609931;BA.debugLine="Msgbox(\"No tiene venta el cliente para la promo";
__c.Msgbox(BA.ObjectToCharSequence("No tiene venta el cliente para la promo"),BA.ObjectToCharSequence("ADVERTENCIA"),ba);
 }else {
RDebugUtils.currentLine=22609933;
 //BA.debugLineNum = 22609933;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"Select sum(";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/  = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("Select sum(pe_cant) As TOT_ART_PROMO, sum(PE_COSTO_TOT) as COSTO_TOT from pedido where PE_CLIENTE IN (Select CUENTA from cuentaa)  and pe_proid In (Select cat_dp_idprod from CAT_DETALLES_PAQ WHERE CAT_DP_ID In (Select PROIDID from PROIDID) AND CAT_DP_PRECIO > 1)")));
RDebugUtils.currentLine=22609934;
 //BA.debugLineNum = 22609934;BA.debugLine="C.Position =0";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition((int) (0));
RDebugUtils.currentLine=22609935;
 //BA.debugLineNum = 22609935;BA.debugLine="TOT_ART_PROMO = C.GetString(\"TOT_ART_PROMO\")";
__ref._tot_art_promo /*String*/  = __ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("TOT_ART_PROMO");
RDebugUtils.currentLine=22609936;
 //BA.debugLineNum = 22609936;BA.debugLine="COSTO_TOT = C.GetString(\"COSTO_TOT\")";
__ref._costo_tot /*String*/  = __ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("COSTO_TOT");
RDebugUtils.currentLine=22609937;
 //BA.debugLineNum = 22609937;BA.debugLine="C.Close";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .Close();
RDebugUtils.currentLine=22609938;
 //BA.debugLineNum = 22609938;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"Select coun";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/  = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("Select count(*) as CUANTOSD from pedido where PE_CLIENTE IN (Select CUENTA from cuentaa)  and pe_proid In (Select cat_dp_idprod from CAT_DETALLES_PAQ WHERE CAT_DP_ID In (Select PROIDID from PROIDID) AND (CAT_DP_PRECIO = 0.01 or CAT_DP_PRECIO = 1 OR CAT_DP_PRECIO = 0) AND CAT_DP_TIPO = 1)")));
RDebugUtils.currentLine=22609939;
 //BA.debugLineNum = 22609939;BA.debugLine="c.Position =0";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition((int) (0));
RDebugUtils.currentLine=22609940;
 //BA.debugLineNum = 22609940;BA.debugLine="If c.GetString(\"CUANTOSD\") = 0 Then";
if ((__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CUANTOSD")).equals(BA.NumberToString(0))) { 
RDebugUtils.currentLine=22609941;
 //BA.debugLineNum = 22609941;BA.debugLine="TOT_ART_PROMOR = \"0\" 'Msgbox(\"No tiene venta e";
__ref._tot_art_promor /*String*/  = "0";
 }else {
RDebugUtils.currentLine=22609943;
 //BA.debugLineNum = 22609943;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"Select sum";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/  = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("Select sum(pe_cant) As TOT_ART_PROMO, sum(PE_COSTO_TOT) as COSTO_TOT from pedido where PE_CLIENTE IN (Select CUENTA from cuentaa)  and pe_proid In (Select cat_dp_idprod from CAT_DETALLES_PAQ WHERE CAT_DP_ID In (Select PROIDID from PROIDID) AND (CAT_DP_PRECIO = 0.01 or CAT_DP_PRECIO = 1 OR CAT_DP_PRECIO = 0) AND CAT_DP_TIPO = 1)")));
RDebugUtils.currentLine=22609944;
 //BA.debugLineNum = 22609944;BA.debugLine="C.Position =0";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition((int) (0));
RDebugUtils.currentLine=22609945;
 //BA.debugLineNum = 22609945;BA.debugLine="TOT_ART_PROMOR = C.GetString(\"TOT_ART_PROMO\")";
__ref._tot_art_promor /*String*/  = __ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("TOT_ART_PROMO");
 };
RDebugUtils.currentLine=22609947;
 //BA.debugLineNum = 22609947;BA.debugLine="C.Close";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .Close();
RDebugUtils.currentLine=22609948;
 //BA.debugLineNum = 22609948;BA.debugLine="PROMO_C = PROMO_C * cantidad.Text";
__ref._promo_c /*String*/  = BA.NumberToString((double)(Double.parseDouble(__ref._promo_c /*String*/ ))*(double)(Double.parseDouble(__ref._cantidad /*anywheresoftware.b4a.objects.EditTextWrapper*/ .getText())));
RDebugUtils.currentLine=22609949;
 //BA.debugLineNum = 22609949;BA.debugLine="PROMO_CR = PROMO_CR * cantidad.Text";
__ref._promo_cr /*String*/  = BA.NumberToString((double)(Double.parseDouble(__ref._promo_cr /*String*/ ))*(double)(Double.parseDouble(__ref._cantidad /*anywheresoftware.b4a.objects.EditTextWrapper*/ .getText())));
RDebugUtils.currentLine=22609950;
 //BA.debugLineNum = 22609950;BA.debugLine="If  TOT_ART_PROMO = PROMO_C And TOT_ART_PROMOR";
if ((__ref._tot_art_promo /*String*/ ).equals(__ref._promo_c /*String*/ ) && (__ref._tot_art_promor /*String*/ ).equals(__ref._promo_cr /*String*/ )) { 
RDebugUtils.currentLine=22609951;
 //BA.debugLineNum = 22609951;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"UPDATE P";
_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("UPDATE PEDIDO SET PE_CEDIS = (?) WHERE PE_CLIENTE IN (Select CUENTA from cuentaa) and pe_proid In (Select cat_dp_idprod from CAT_DETALLES_PAQ WHERE CAT_DP_ID In (Select PROIDID from PROIDID))",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(__ref._l_proid /*anywheresoftware.b4a.objects.LabelWrapper*/ .getText())}));
RDebugUtils.currentLine=22609952;
 //BA.debugLineNum = 22609952;BA.debugLine="D=B4XPages.MainPage.skmt.ExecQuery(\"select CAT";
__ref._d /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/  = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select CAT_DP_ID, CAT_DP_PRECIO, CAT_DP_PRECIO_SIMPTOS, CAT_DP_IDPROD FROM CAT_DETALLES_PAQ WHERE CAT_DP_ID IN (Select PROIDID from PROIDID) AND CAT_DP_PRECIO > 1")));
RDebugUtils.currentLine=22609953;
 //BA.debugLineNum = 22609953;BA.debugLine="If D.RowCount>0 Then";
if (__ref._d /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .getRowCount()>0) { 
RDebugUtils.currentLine=22609954;
 //BA.debugLineNum = 22609954;BA.debugLine="For i=0 To D.RowCount -1";
{
final int step34 = 1;
final int limit34 = (int) (__ref._d /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .getRowCount()-1);
_i = (int) (0) ;
for (;_i <= limit34 ;_i = _i + step34 ) {
RDebugUtils.currentLine=22609955;
 //BA.debugLineNum = 22609955;BA.debugLine="D.Position=i";
__ref._d /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition(_i);
RDebugUtils.currentLine=22609956;
 //BA.debugLineNum = 22609956;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"UPDATE";
_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("UPDATE PEDIDO SET PE_COSTOU = (?), PE_COSTO_TOT = PE_CANT * (?) , PE_COSTO_SIN = (?) WHERE PE_PROID = (?) And PE_CEDIS In (Select PROIDID from PROIDID) AND  PE_CLIENTE IN (Select CUENTA from cuentaa) ",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(__ref._d /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CAT_DP_PRECIO")),(Object)(__ref._d /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CAT_DP_PRECIO")),(Object)(__ref._d /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CAT_DP_PRECIO_SIMPTOS")),(Object)(__ref._d /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CAT_DP_IDPROD"))}));
 }
};
 };
RDebugUtils.currentLine=22609959;
 //BA.debugLineNum = 22609959;BA.debugLine="D.Close";
__ref._d /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .Close();
RDebugUtils.currentLine=22609960;
 //BA.debugLineNum = 22609960;BA.debugLine="D=B4XPages.MainPage.skmt.ExecQuery(\"select CAT";
__ref._d /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/  = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select CAT_DP_ID, CAT_DP_PRECIO, CAT_DP_PRECIO_SIMPTOS, CAT_DP_IDPROD FROM CAT_DETALLES_PAQ WHERE CAT_DP_ID IN (Select PROIDID from PROIDID) AND (CAT_DP_PRECIO = 0.01 or CAT_DP_PRECIO = 1 OR CAT_DP_PRECIO = 0) AND CAT_DP_TIPO = 1")));
RDebugUtils.currentLine=22609961;
 //BA.debugLineNum = 22609961;BA.debugLine="If D.RowCount>0 Then";
if (__ref._d /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .getRowCount()>0) { 
RDebugUtils.currentLine=22609962;
 //BA.debugLineNum = 22609962;BA.debugLine="For i=0 To D.RowCount -1";
{
final int step42 = 1;
final int limit42 = (int) (__ref._d /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .getRowCount()-1);
_i = (int) (0) ;
for (;_i <= limit42 ;_i = _i + step42 ) {
RDebugUtils.currentLine=22609963;
 //BA.debugLineNum = 22609963;BA.debugLine="D.Position=i";
__ref._d /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition(_i);
RDebugUtils.currentLine=22609964;
 //BA.debugLineNum = 22609964;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"UPDATE";
_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("UPDATE PEDIDO SET PE_COSTOU = (?), PE_COSTO_TOT = PE_CANT * (?) , PE_COSTO_SIN = (?) WHERE PE_PROID = (?) And PE_CEDIS In (Select PROIDID from PROIDID) AND  PE_CLIENTE IN (Select CUENTA from cuentaa) ",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(__ref._d /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CAT_DP_PRECIO")),(Object)(__ref._d /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CAT_DP_PRECIO")),(Object)(__ref._d /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CAT_DP_PRECIO_SIMPTOS")),(Object)(__ref._d /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CAT_DP_IDPROD"))}));
 }
};
 };
RDebugUtils.currentLine=22609967;
 //BA.debugLineNum = 22609967;BA.debugLine="D.Close";
__ref._d /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .Close();
RDebugUtils.currentLine=22609968;
 //BA.debugLineNum = 22609968;BA.debugLine="DateTime.DateFormat = \"MM/dd/yyyy\"";
__c.DateTime.setDateFormat("MM/dd/yyyy");
RDebugUtils.currentLine=22609969;
 //BA.debugLineNum = 22609969;BA.debugLine="sDate=DateTime.Date(DateTime.Now)";
__ref._sdate /*String*/  = __c.DateTime.Date(__c.DateTime.getNow());
RDebugUtils.currentLine=22609970;
 //BA.debugLineNum = 22609970;BA.debugLine="sTime=DateTime.Time(DateTime.Now)";
__ref._stime /*String*/  = __c.DateTime.Time(__c.DateTime.getNow());
RDebugUtils.currentLine=22609971;
 //BA.debugLineNum = 22609971;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"Select CUE";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/  = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("Select CUENTA from cuentaa")));
RDebugUtils.currentLine=22609972;
 //BA.debugLineNum = 22609972;BA.debugLine="c.Position=0";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition((int) (0));
RDebugUtils.currentLine=22609973;
 //BA.debugLineNum = 22609973;BA.debugLine="clie_id = c.GetString(\"CUENTA\")";
__ref._clie_id /*String*/  = __ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CUENTA");
RDebugUtils.currentLine=22609974;
 //BA.debugLineNum = 22609974;BA.debugLine="c.Close";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .Close();
RDebugUtils.currentLine=22609975;
 //BA.debugLineNum = 22609975;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"select CAT";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/  = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select CAT_CL_RUTA from kmt_info where CAT_CL_CODIGO In (Select cuenta from cuentaa)")));
RDebugUtils.currentLine=22609976;
 //BA.debugLineNum = 22609976;BA.debugLine="c.Position=0";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition((int) (0));
RDebugUtils.currentLine=22609977;
 //BA.debugLineNum = 22609977;BA.debugLine="cl_ruta = c.GetString(\"CAT_CL_RUTA\")";
__ref._cl_ruta /*String*/  = __ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CAT_CL_RUTA");
RDebugUtils.currentLine=22609978;
 //BA.debugLineNum = 22609978;BA.debugLine="c.Close";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .Close();
RDebugUtils.currentLine=22609979;
 //BA.debugLineNum = 22609979;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"select USU";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/  = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select USUARIO from usuarioa")));
RDebugUtils.currentLine=22609980;
 //BA.debugLineNum = 22609980;BA.debugLine="c.Position=0";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition((int) (0));
RDebugUtils.currentLine=22609981;
 //BA.debugLineNum = 22609981;BA.debugLine="usuario = c.GetString(\"USUARIO\")";
__ref._usuario /*String*/  = __ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("USUARIO");
RDebugUtils.currentLine=22609982;
 //BA.debugLineNum = 22609982;BA.debugLine="e=B4XPages.MainPage.skmt.ExecQuery(\"select cou";
__ref._e /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/  = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select count(*) as CUANTOS FROM CAT_DETALLES_PAQ WHERE CAT_DP_ID IN (Select PROIDID from PROIDID) and CAT_DP_TIPO = 0 ")));
RDebugUtils.currentLine=22609984;
 //BA.debugLineNum = 22609984;BA.debugLine="e.Position =0";
__ref._e /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition((int) (0));
RDebugUtils.currentLine=22609985;
 //BA.debugLineNum = 22609985;BA.debugLine="If e.GetString(\"CUANTOS\") > 0 Then";
if ((double)(Double.parseDouble(__ref._e /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CUANTOS")))>0) { 
RDebugUtils.currentLine=22609986;
 //BA.debugLineNum = 22609986;BA.debugLine="F=B4XPages.MainPage.skmt.ExecQuery(\"select CA";
__ref._f /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/  = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select CAT_DP_IDPROD, CAT_DP_PZAS,CAT_DP_PRECIO FROM CAT_DETALLES_PAQ WHERE CAT_DP_ID IN (Select PROIDID from PROIDID) and CAT_DP_TIPO = 0 ")));
RDebugUtils.currentLine=22609989;
 //BA.debugLineNum = 22609989;BA.debugLine="If f.RowCount>0 Then";
if (__ref._f /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .getRowCount()>0) { 
RDebugUtils.currentLine=22609990;
 //BA.debugLineNum = 22609990;BA.debugLine="For i=0 To f.RowCount -1";
{
final int step67 = 1;
final int limit67 = (int) (__ref._f /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .getRowCount()-1);
_i = (int) (0) ;
for (;_i <= limit67 ;_i = _i + step67 ) {
RDebugUtils.currentLine=22609991;
 //BA.debugLineNum = 22609991;BA.debugLine="f.Position=i";
__ref._f /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition(_i);
RDebugUtils.currentLine=22609992;
 //BA.debugLineNum = 22609992;BA.debugLine="precio_Cero = f.GetString(\"CAT_DP_PRECIO\")";
__ref._precio_cero /*String*/  = __ref._f /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CAT_DP_PRECIO");
RDebugUtils.currentLine=22609993;
 //BA.debugLineNum = 22609993;BA.debugLine="h=B4XPages.MainPage.skmt.ExecQuery2(\"select";
__ref._h /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/  = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery2("select CAT_GP_NOMBRE from CAT_GUNAPROD where CAT_GP_ID = ? ",new String[]{__ref._f /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CAT_DP_IDPROD")})));
RDebugUtils.currentLine=22609994;
 //BA.debugLineNum = 22609994;BA.debugLine="h.Position=0";
__ref._h /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition((int) (0));
RDebugUtils.currentLine=22609996;
 //BA.debugLineNum = 22609996;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"INSER";
_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("INSERT INTO  PEDIDO (PE_CEDIS,PE_COSTO_TOT,PE_COSTOU,PE_CANT,PE_PRONOMBRE,PE_PROID,PE_CLIENTE,PE_FECHA,PE_USUARIO,PE_RUTA) VALUES(?,?,?,?,?,?,?,?,?,?) ",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(__ref._l_proid /*anywheresoftware.b4a.objects.LabelWrapper*/ .getText()),(Object)((double)(Double.parseDouble(__ref._precio_cero /*String*/ ))*(double)(Double.parseDouble(__ref._f /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CAT_DP_PZAS")))*(double)(Double.parseDouble(__ref._cantidad /*anywheresoftware.b4a.objects.EditTextWrapper*/ .getText()))),(Object)(__ref._precio_cero /*String*/ ),(Object)((double)(Double.parseDouble(__ref._f /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CAT_DP_PZAS")))*(double)(Double.parseDouble(__ref._cantidad /*anywheresoftware.b4a.objects.EditTextWrapper*/ .getText()))),(Object)(__ref._h /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CAT_GP_NOMBRE")),(Object)(__ref._f /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CAT_DP_IDPROD")),(Object)(__ref._clie_id /*String*/ ),(Object)(__ref._sdate /*String*/ +__ref._stime /*String*/ ),(Object)(__ref._usuario /*String*/ ),(Object)(__ref._cl_ruta /*String*/ )}));
RDebugUtils.currentLine=22609997;
 //BA.debugLineNum = 22609997;BA.debugLine="h.Close";
__ref._h /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .Close();
 }
};
 };
RDebugUtils.currentLine=22610000;
 //BA.debugLineNum = 22610000;BA.debugLine="f.Close";
__ref._f /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .Close();
 };
RDebugUtils.currentLine=22610002;
 //BA.debugLineNum = 22610002;BA.debugLine="e.Close";
__ref._e /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .Close();
RDebugUtils.currentLine=22610003;
 //BA.debugLineNum = 22610003;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"INSERT I";
_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("INSERT INTO  PEDIDO (PE_CEDIS,PE_COSTO_TOT,PE_COSTOU,PE_CANT,PE_PRONOMBRE,PE_PROID,PE_CLIENTE,PE_FECHA,PE_USUARIO,PE_RUTA,PE_FOLIO) VALUES(?,?,?,?,?,?,?,?,?,?,?) ",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(__ref._l_proid /*anywheresoftware.b4a.objects.LabelWrapper*/ .getText()),(Object)(0),(Object)(0),(Object)(__ref._cantidad /*anywheresoftware.b4a.objects.EditTextWrapper*/ .getText()),(Object)(__ref._l_desc /*anywheresoftware.b4a.objects.LabelWrapper*/ .getText()),(Object)(__ref._l_proid /*anywheresoftware.b4a.objects.LabelWrapper*/ .getText()),(Object)(__ref._clie_id /*String*/ ),(Object)(__ref._sdate /*String*/ +__ref._stime /*String*/ ),(Object)(__ref._usuario /*String*/ ),(Object)(__ref._cl_ruta /*String*/ ),(Object)(_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._tipo_venta /*String*/ )}));
RDebugUtils.currentLine=22610004;
 //BA.debugLineNum = 22610004;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"update c";
_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("update cat_gunaprod set cat_gp_almacen = cat_gp_almacen - ? where cat_gp_id = ? ",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(__ref._cantidad /*anywheresoftware.b4a.objects.EditTextWrapper*/ .getText()),(Object)(__ref._l_proid /*anywheresoftware.b4a.objects.LabelWrapper*/ .getText())}));
 }else {
RDebugUtils.currentLine=22610006;
 //BA.debugLineNum = 22610006;BA.debugLine="Msgbox(\"Tiene \" & TOT_ART_PROMO & \" \" & TOT_AR";
__c.Msgbox(BA.ObjectToCharSequence("Tiene "+__ref._tot_art_promo /*String*/ +" "+__ref._tot_art_promor /*String*/ +" y necesita "+__ref._promo_c /*String*/ +" "+__ref._promo_cr /*String*/ +" Para la Promo. "),BA.ObjectToCharSequence("ADVERTENCIA"),ba);
 };
 };
RDebugUtils.currentLine=22610009;
 //BA.debugLineNum = 22610009;BA.debugLine="cantidad.Text = \"\"";
__ref._cantidad /*anywheresoftware.b4a.objects.EditTextWrapper*/ .setText(BA.ObjectToCharSequence(""));
RDebugUtils.currentLine=22610010;
 //BA.debugLineNum = 22610010;BA.debugLine="B4XPages.ShowPage(\"Productos\")";
_b4xpages._showpage /*String*/ (ba,"Productos");
 }else 
{RDebugUtils.currentLine=22610011;
 //BA.debugLineNum = 22610011;BA.debugLine="else If l_marca.text = \"PROMOS\" And l_tipo.Text =";
if ((__ref._l_marca /*anywheresoftware.b4a.objects.LabelWrapper*/ .getText()).equals("PROMOS") && (__ref._l_tipo /*anywheresoftware.b4a.objects.LabelWrapper*/ .getText()).equals("PROMOS") && (__ref._promo_c /*String*/ ).equals(BA.NumberToString(0))) { 
RDebugUtils.currentLine=22610012;
 //BA.debugLineNum = 22610012;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"delete from";
_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("delete from PROIDID");
RDebugUtils.currentLine=22610013;
 //BA.debugLineNum = 22610013;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"INSERT INT";
_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("INSERT INTO PROIDID VALUES (?)",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(__ref._l_proid /*anywheresoftware.b4a.objects.LabelWrapper*/ .getText())}));
RDebugUtils.currentLine=22610014;
 //BA.debugLineNum = 22610014;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"Select CUENT";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/  = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("Select CUENTA from cuentaa")));
RDebugUtils.currentLine=22610015;
 //BA.debugLineNum = 22610015;BA.debugLine="c.Position=0";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition((int) (0));
RDebugUtils.currentLine=22610016;
 //BA.debugLineNum = 22610016;BA.debugLine="clie_id = c.GetString(\"CUENTA\")";
__ref._clie_id /*String*/  = __ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CUENTA");
RDebugUtils.currentLine=22610017;
 //BA.debugLineNum = 22610017;BA.debugLine="c.Close";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .Close();
RDebugUtils.currentLine=22610018;
 //BA.debugLineNum = 22610018;BA.debugLine="DateTime.DateFormat = \"MM/dd/yyyy\"";
__c.DateTime.setDateFormat("MM/dd/yyyy");
RDebugUtils.currentLine=22610019;
 //BA.debugLineNum = 22610019;BA.debugLine="sDate=DateTime.Date(DateTime.Now)";
__ref._sdate /*String*/  = __c.DateTime.Date(__c.DateTime.getNow());
RDebugUtils.currentLine=22610020;
 //BA.debugLineNum = 22610020;BA.debugLine="sTime=DateTime.Time(DateTime.Now)";
__ref._stime /*String*/  = __c.DateTime.Time(__c.DateTime.getNow());
RDebugUtils.currentLine=22610021;
 //BA.debugLineNum = 22610021;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"select CAT_C";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/  = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select CAT_CL_RUTA from kmt_info where CAT_CL_CODIGO In (Select cuenta from cuentaa)")));
RDebugUtils.currentLine=22610022;
 //BA.debugLineNum = 22610022;BA.debugLine="c.Position=0";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition((int) (0));
RDebugUtils.currentLine=22610023;
 //BA.debugLineNum = 22610023;BA.debugLine="cl_ruta = c.GetString(\"CAT_CL_RUTA\")";
__ref._cl_ruta /*String*/  = __ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CAT_CL_RUTA");
RDebugUtils.currentLine=22610024;
 //BA.debugLineNum = 22610024;BA.debugLine="c.Close";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .Close();
RDebugUtils.currentLine=22610025;
 //BA.debugLineNum = 22610025;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"select USUAR";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/  = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select USUARIO from usuarioa")));
RDebugUtils.currentLine=22610026;
 //BA.debugLineNum = 22610026;BA.debugLine="c.Position=0";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition((int) (0));
RDebugUtils.currentLine=22610027;
 //BA.debugLineNum = 22610027;BA.debugLine="usuario = c.GetString(\"USUARIO\")";
__ref._usuario /*String*/  = __ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("USUARIO");
RDebugUtils.currentLine=22610030;
 //BA.debugLineNum = 22610030;BA.debugLine="e=B4XPages.MainPage.skmt.ExecQuery(\"select count";
__ref._e /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/  = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select count(*) as CUANTOS FROM CAT_DETALLES_PAQ WHERE CAT_DP_ID IN (Select PROIDID from PROIDID) ")));
RDebugUtils.currentLine=22610031;
 //BA.debugLineNum = 22610031;BA.debugLine="e.Position =0";
__ref._e /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition((int) (0));
RDebugUtils.currentLine=22610032;
 //BA.debugLineNum = 22610032;BA.debugLine="If e.GetString(\"CUANTOS\") > 0 Then";
if ((double)(Double.parseDouble(__ref._e /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CUANTOS")))>0) { 
RDebugUtils.currentLine=22610033;
 //BA.debugLineNum = 22610033;BA.debugLine="F=B4XPages.MainPage.skmt.ExecQuery(\"select CAT_";
__ref._f /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/  = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select CAT_DP_IDPROD, CAT_DP_PZAS, CAT_DP_PRECIO FROM CAT_DETALLES_PAQ WHERE CAT_DP_ID IN (Select PROIDID from PROIDID)")));
RDebugUtils.currentLine=22610034;
 //BA.debugLineNum = 22610034;BA.debugLine="For i =0 To f.RowCount -1";
{
final int step108 = 1;
final int limit108 = (int) (__ref._f /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .getRowCount()-1);
_i = (int) (0) ;
for (;_i <= limit108 ;_i = _i + step108 ) {
RDebugUtils.currentLine=22610035;
 //BA.debugLineNum = 22610035;BA.debugLine="F.Position =i";
__ref._f /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition(_i);
RDebugUtils.currentLine=22610036;
 //BA.debugLineNum = 22610036;BA.debugLine="h=B4XPages.MainPage.skmt.ExecQuery2(\"select CA";
__ref._h /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/  = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery2("select CAT_GP_NOMBRE from CAT_GUNAPROD where CAT_GP_ID = ? ",new String[]{__ref._f /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CAT_DP_IDPROD")})));
RDebugUtils.currentLine=22610037;
 //BA.debugLineNum = 22610037;BA.debugLine="h.Position=0";
__ref._h /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition((int) (0));
RDebugUtils.currentLine=22610038;
 //BA.debugLineNum = 22610038;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"INSERT I";
_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("INSERT INTO  PEDIDO (PE_CEDIS,PE_COSTO_TOT,PE_COSTOU,PE_CANT,PE_PRONOMBRE,PE_PROID,PE_CLIENTE,PE_FECHA,PE_USUARIO,PE_RUTA,PE_FOLIO) VALUES(?,?,?,?,?,?,?,?,?,?,?) ",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(__ref._l_proid /*anywheresoftware.b4a.objects.LabelWrapper*/ .getText()),(Object)((double)(Double.parseDouble(__ref._f /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CAT_DP_PRECIO")))*(double)(Double.parseDouble(__ref._cantidad /*anywheresoftware.b4a.objects.EditTextWrapper*/ .getText()))*(double)(Double.parseDouble(__ref._f /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CAT_DP_PZAS")))),(Object)(__ref._f /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CAT_DP_PRECIO")),(Object)((double)(Double.parseDouble(__ref._f /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CAT_DP_PZAS")))*(double)(Double.parseDouble(__ref._cantidad /*anywheresoftware.b4a.objects.EditTextWrapper*/ .getText()))),(Object)(__ref._h /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CAT_GP_NOMBRE")),(Object)(__ref._f /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CAT_DP_IDPROD")),(Object)(__ref._clie_id /*String*/ ),(Object)(__ref._sdate /*String*/ +__ref._stime /*String*/ ),(Object)(__ref._usuario /*String*/ ),(Object)(__ref._cl_ruta /*String*/ ),(Object)(_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._tipo_venta /*String*/ )}));
RDebugUtils.currentLine=22610039;
 //BA.debugLineNum = 22610039;BA.debugLine="h.Close";
__ref._h /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .Close();
 }
};
RDebugUtils.currentLine=22610041;
 //BA.debugLineNum = 22610041;BA.debugLine="f.Close";
__ref._f /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .Close();
 };
RDebugUtils.currentLine=22610043;
 //BA.debugLineNum = 22610043;BA.debugLine="e.Close";
__ref._e /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .Close();
RDebugUtils.currentLine=22610045;
 //BA.debugLineNum = 22610045;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"INSERT INT";
_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("INSERT INTO  PEDIDO (PE_CEDIS,PE_COSTO_TOT,PE_COSTOU,PE_CANT,PE_PRONOMBRE,PE_PROID,PE_CLIENTE,PE_FECHA,PE_USUARIO,PE_RUTA,PE_FOLIO) VALUES(?,?,?,?,?,?,?,?,?,?,?) ",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(__ref._l_proid /*anywheresoftware.b4a.objects.LabelWrapper*/ .getText()),(Object)(0),(Object)(0),(Object)(__ref._cantidad /*anywheresoftware.b4a.objects.EditTextWrapper*/ .getText()),(Object)(__ref._l_desc /*anywheresoftware.b4a.objects.LabelWrapper*/ .getText()),(Object)(__ref._l_proid /*anywheresoftware.b4a.objects.LabelWrapper*/ .getText()),(Object)(__ref._clie_id /*String*/ ),(Object)(__ref._sdate /*String*/ +__ref._stime /*String*/ ),(Object)(__ref._usuario /*String*/ ),(Object)(__ref._cl_ruta /*String*/ ),(Object)(_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._tipo_venta /*String*/ )}));
RDebugUtils.currentLine=22610046;
 //BA.debugLineNum = 22610046;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"update cat";
_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("update cat_gunaprod set cat_gp_almacen = cat_gp_almacen - ? where cat_gp_id = ? ",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(__ref._cantidad /*anywheresoftware.b4a.objects.EditTextWrapper*/ .getText()),(Object)(__ref._l_proid /*anywheresoftware.b4a.objects.LabelWrapper*/ .getText())}));
RDebugUtils.currentLine=22610047;
 //BA.debugLineNum = 22610047;BA.debugLine="cantidad.Text = \"\"";
__ref._cantidad /*anywheresoftware.b4a.objects.EditTextWrapper*/ .setText(BA.ObjectToCharSequence(""));
RDebugUtils.currentLine=22610048;
 //BA.debugLineNum = 22610048;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"select sum(p";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/  = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select sum(pe_costo_tot) as TOTAL_CLIE, SUM(PE_CANT) AS CANT_CLIE, SUM(PE_COSTO_SIN) AS TOTAL_CLIE_SIN FROM PEDIDO WHERE PE_CLIENTE IN (Select CUENTA from cuentaa)")));
RDebugUtils.currentLine=22610049;
 //BA.debugLineNum = 22610049;BA.debugLine="c.Position=0";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition((int) (0));
RDebugUtils.currentLine=22610050;
 //BA.debugLineNum = 22610050;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"delete from";
_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("delete from pedido_cliente where PC_CLIENTE In (select cuenta from cuentaa)");
RDebugUtils.currentLine=22610051;
 //BA.debugLineNum = 22610051;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"insert int";
_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("insert into pedido_cliente(PC_CLIENTE, PC_FECHA, PC_USER, PC_NOART, PC_MONTO,PC_LON, PC_LAT,PC_ALMACEN,PC_RUTA,PC_COSTO_SIN) VALUES (?,?,?,?,?,?,?,?,?,?)",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(__ref._clie_id /*String*/ ),(Object)(__ref._sdate /*String*/ +__ref._stime /*String*/ ),(Object)(__ref._usuario /*String*/ ),(Object)(__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CANT_CLIE")),(Object)(__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("TOTAL_CLIE")),(Object)(_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._lon_gps /*String*/ ),(Object)(_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._lat_gps /*String*/ ),(Object)(__ref._almacen /*String*/ ),(Object)(__ref._cl_ruta /*String*/ ),(Object)(__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("TOTAL_CLIE_SIN"))}));
RDebugUtils.currentLine=22610052;
 //BA.debugLineNum = 22610052;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"UPDATE kmt_";
_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("UPDATE kmt_info set gestion = 2  where CAT_CL_CODIGO In (select cuenta from cuentaa)");
RDebugUtils.currentLine=22610053;
 //BA.debugLineNum = 22610053;BA.debugLine="B4XPages.ShowPage(\"Productos\")";
_b4xpages._showpage /*String*/ (ba,"Productos");
 }else {
RDebugUtils.currentLine=22610055;
 //BA.debugLineNum = 22610055;BA.debugLine="DateTime.DateFormat = \"MM/dd/yyyy\"";
__c.DateTime.setDateFormat("MM/dd/yyyy");
RDebugUtils.currentLine=22610056;
 //BA.debugLineNum = 22610056;BA.debugLine="sDate=DateTime.Date(DateTime.Now)";
__ref._sdate /*String*/  = __c.DateTime.Date(__c.DateTime.getNow());
RDebugUtils.currentLine=22610057;
 //BA.debugLineNum = 22610057;BA.debugLine="sTime=DateTime.Time(DateTime.Now)";
__ref._stime /*String*/  = __c.DateTime.Time(__c.DateTime.getNow());
RDebugUtils.currentLine=22610058;
 //BA.debugLineNum = 22610058;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"Select CUENT";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/  = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("Select CUENTA from cuentaa")));
RDebugUtils.currentLine=22610059;
 //BA.debugLineNum = 22610059;BA.debugLine="c.Position=0";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition((int) (0));
RDebugUtils.currentLine=22610060;
 //BA.debugLineNum = 22610060;BA.debugLine="clie_id = c.GetString(\"CUENTA\")";
__ref._clie_id /*String*/  = __ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CUENTA");
RDebugUtils.currentLine=22610061;
 //BA.debugLineNum = 22610061;BA.debugLine="c.Close";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .Close();
RDebugUtils.currentLine=22610062;
 //BA.debugLineNum = 22610062;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"select CAT_C";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/  = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select CAT_CL_RUTA from kmt_info where CAT_CL_CODIGO In (Select cuenta from cuentaa)")));
RDebugUtils.currentLine=22610063;
 //BA.debugLineNum = 22610063;BA.debugLine="c.Position=0";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition((int) (0));
RDebugUtils.currentLine=22610064;
 //BA.debugLineNum = 22610064;BA.debugLine="cl_ruta = c.GetString(\"CAT_CL_RUTA\")";
__ref._cl_ruta /*String*/  = __ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CAT_CL_RUTA");
RDebugUtils.currentLine=22610065;
 //BA.debugLineNum = 22610065;BA.debugLine="c.Close";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .Close();
RDebugUtils.currentLine=22610066;
 //BA.debugLineNum = 22610066;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"select USUAR";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/  = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select USUARIO from usuarioa")));
RDebugUtils.currentLine=22610067;
 //BA.debugLineNum = 22610067;BA.debugLine="c.Position=0";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition((int) (0));
RDebugUtils.currentLine=22610068;
 //BA.debugLineNum = 22610068;BA.debugLine="usuario = c.GetString(\"USUARIO\")";
__ref._usuario /*String*/  = __ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("USUARIO");
RDebugUtils.currentLine=22610069;
 //BA.debugLineNum = 22610069;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"INSERT INT";
_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("INSERT INTO  PEDIDO (PE_CEDIS,PE_COSTO_TOT,PE_COSTOU,PE_CANT,PE_PRONOMBRE,PE_PROID,PE_CLIENTE,PE_FECHA,PE_USUARIO,PE_RUTA,PE_COSTO_SIN, PE_FOLIO) VALUES(?,?,?,?,?,?,?,?,?,?,?,?) ",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(__ref._almacen /*String*/ ),(Object)((double)(Double.parseDouble(__ref._cantidad /*anywheresoftware.b4a.objects.EditTextWrapper*/ .getText()))*(double)(Double.parseDouble(__ref._l_precio /*anywheresoftware.b4a.objects.LabelWrapper*/ .getText()))),(Object)(__ref._l_precio /*anywheresoftware.b4a.objects.LabelWrapper*/ .getText()),(Object)(__ref._cantidad /*anywheresoftware.b4a.objects.EditTextWrapper*/ .getText()),(Object)(__ref._l_desc /*anywheresoftware.b4a.objects.LabelWrapper*/ .getText()),(Object)(__ref._l_proid /*anywheresoftware.b4a.objects.LabelWrapper*/ .getText()),(Object)(__ref._clie_id /*String*/ ),(Object)(__ref._sdate /*String*/ +__ref._stime /*String*/ ),(Object)(__ref._usuario /*String*/ ),(Object)(__ref._cl_ruta /*String*/ ),(Object)(__ref._preciosin /*String*/ ),(Object)(_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._tipo_venta /*String*/ )}));
RDebugUtils.currentLine=22610070;
 //BA.debugLineNum = 22610070;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"update cat";
_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("update cat_gunaprod set cat_gp_almacen = cat_gp_almacen - ? where cat_gp_id = ? ",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(__ref._cantidad /*anywheresoftware.b4a.objects.EditTextWrapper*/ .getText()),(Object)(__ref._l_proid /*anywheresoftware.b4a.objects.LabelWrapper*/ .getText())}));
RDebugUtils.currentLine=22610071;
 //BA.debugLineNum = 22610071;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"select sum(p";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/  = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select sum(pe_costo_tot) as TOTAL_CLIE, SUM(PE_CANT) AS CANT_CLIE, SUM(PE_COSTO_SIN) AS TOTAL_CLIE_SIN FROM PEDIDO WHERE PE_CLIENTE IN (Select CUENTA from cuentaa)")));
RDebugUtils.currentLine=22610072;
 //BA.debugLineNum = 22610072;BA.debugLine="c.Position=0";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition((int) (0));
RDebugUtils.currentLine=22610073;
 //BA.debugLineNum = 22610073;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"delete from";
_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("delete from pedido_cliente where PC_CLIENTE In (select cuenta from cuentaa)");
RDebugUtils.currentLine=22610074;
 //BA.debugLineNum = 22610074;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"insert int";
_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("insert into pedido_cliente(PC_CLIENTE, PC_FECHA, PC_USER, PC_NOART, PC_MONTO,PC_LON, PC_LAT,PC_ALMACEN,PC_RUTA,PC_COSTO_SIN) VALUES (?,?,?,?,?,?,?,?,?,?)",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(__ref._clie_id /*String*/ ),(Object)(__ref._sdate /*String*/ +__ref._stime /*String*/ ),(Object)(__ref._usuario /*String*/ ),(Object)(__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CANT_CLIE")),(Object)(__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("TOTAL_CLIE")),(Object)(_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._lon_gps /*String*/ ),(Object)(_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._lat_gps /*String*/ ),(Object)(__ref._almacen /*String*/ ),(Object)(__ref._cl_ruta /*String*/ ),(Object)(__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("TOTAL_CLIE_SIN"))}));
RDebugUtils.currentLine=22610075;
 //BA.debugLineNum = 22610075;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"UPDATE kmt_";
_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("UPDATE kmt_info set gestion = 2  where CAT_CL_CODIGO In (select cuenta from cuentaa)");
RDebugUtils.currentLine=22610076;
 //BA.debugLineNum = 22610076;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"INSERT INT";
_b4xpages._mainpage /*keymon.lat.medicomed.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)(__ref._almacen /*String*/ ),(Object)(__ref._l_proid /*anywheresoftware.b4a.objects.LabelWrapper*/ .getText()),(Object)(__ref._cantidad /*anywheresoftware.b4a.objects.EditTextWrapper*/ .getText())}));
RDebugUtils.currentLine=22610077;
 //BA.debugLineNum = 22610077;BA.debugLine="B4XPages.ShowPage(\"Productos\")";
_b4xpages._showpage /*String*/ (ba,"Productos");
 }}}}
;
RDebugUtils.currentLine=22610079;
 //BA.debugLineNum = 22610079;BA.debugLine="End Sub";
return "";
}
public String  _i_fotol_click(keymon.lat.medicomed.c_pedidos __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_pedidos";
if (Debug.shouldDelegate(ba, "i_fotol_click", false))
	 {return ((String) Debug.delegate(ba, "i_fotol_click", null));}
RDebugUtils.currentLine=22937600;
 //BA.debugLineNum = 22937600;BA.debugLine="Sub i_fotol_Click";
RDebugUtils.currentLine=22937601;
 //BA.debugLineNum = 22937601;BA.debugLine="i_fotol.Visible = False";
__ref._i_fotol /*anywheresoftware.b4a.objects.ImageViewWrapper*/ .setVisible(__c.False);
RDebugUtils.currentLine=22937603;
 //BA.debugLineNum = 22937603;BA.debugLine="End Sub";
return "";
}
public String  _img_prod_click(keymon.lat.medicomed.c_pedidos __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_pedidos";
if (Debug.shouldDelegate(ba, "img_prod_click", false))
	 {return ((String) Debug.delegate(ba, "img_prod_click", null));}
RDebugUtils.currentLine=22872064;
 //BA.debugLineNum = 22872064;BA.debugLine="Sub img_prod_Click";
RDebugUtils.currentLine=22872065;
 //BA.debugLineNum = 22872065;BA.debugLine="i_fotol.Visible = True";
__ref._i_fotol /*anywheresoftware.b4a.objects.ImageViewWrapper*/ .setVisible(__c.True);
RDebugUtils.currentLine=22872066;
 //BA.debugLineNum = 22872066;BA.debugLine="i_fotol.Bitmap = LoadBitmap(ruta,\"1.jpg\")";
__ref._i_fotol /*anywheresoftware.b4a.objects.ImageViewWrapper*/ .setBitmap((android.graphics.Bitmap)(__c.LoadBitmap(__ref._ruta /*String*/ ,"1.jpg").getObject()));
RDebugUtils.currentLine=22872068;
 //BA.debugLineNum = 22872068;BA.debugLine="End Sub";
return "";
}
public String  _nopromo_click(keymon.lat.medicomed.c_pedidos __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_pedidos";
if (Debug.shouldDelegate(ba, "nopromo_click", false))
	 {return ((String) Debug.delegate(ba, "nopromo_click", null));}
RDebugUtils.currentLine=23068672;
 //BA.debugLineNum = 23068672;BA.debugLine="Sub nopromo_Click";
RDebugUtils.currentLine=23068673;
 //BA.debugLineNum = 23068673;BA.debugLine="If cantidad.Text = \"\" Then";
if ((__ref._cantidad /*anywheresoftware.b4a.objects.EditTextWrapper*/ .getText()).equals("")) { 
RDebugUtils.currentLine=23068674;
 //BA.debugLineNum = 23068674;BA.debugLine="Msgbox(\"Cantidad no puede ser 0\",\"Cantidad\") 'ig";
__c.Msgbox(BA.ObjectToCharSequence("Cantidad no puede ser 0"),BA.ObjectToCharSequence("Cantidad"),ba);
 }else 
{RDebugUtils.currentLine=23068675;
 //BA.debugLineNum = 23068675;BA.debugLine="Else If cantidad.Text > l_bodega.Text Then";
if ((double)(Double.parseDouble(__ref._cantidad /*anywheresoftware.b4a.objects.EditTextWrapper*/ .getText()))>(double)(Double.parseDouble(__ref._l_bodega /*anywheresoftware.b4a.objects.LabelWrapper*/ .getText()))) { 
RDebugUtils.currentLine=23068676;
 //BA.debugLineNum = 23068676;BA.debugLine="Msgbox(\"Exede la existencia\", \"ADVERTENCIA\") 'ig";
__c.Msgbox(BA.ObjectToCharSequence("Exede la existencia"),BA.ObjectToCharSequence("ADVERTENCIA"),ba);
 }else {
RDebugUtils.currentLine=23068678;
 //BA.debugLineNum = 23068678;BA.debugLine="DateTime.DateFormat = \"MM/dd/yyyy\"";
__c.DateTime.setDateFormat("MM/dd/yyyy");
RDebugUtils.currentLine=23068679;
 //BA.debugLineNum = 23068679;BA.debugLine="sDate=DateTime.Date(DateTime.Now)";
__ref._sdate /*String*/  = __c.DateTime.Date(__c.DateTime.getNow());
RDebugUtils.currentLine=23068680;
 //BA.debugLineNum = 23068680;BA.debugLine="sTime=DateTime.Time(DateTime.Now)";
__ref._stime /*String*/  = __c.DateTime.Time(__c.DateTime.getNow());
RDebugUtils.currentLine=23068681;
 //BA.debugLineNum = 23068681;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"Select CUENT";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/  = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("Select CUENTA from cuentaa")));
RDebugUtils.currentLine=23068682;
 //BA.debugLineNum = 23068682;BA.debugLine="c.Position=0";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition((int) (0));
RDebugUtils.currentLine=23068683;
 //BA.debugLineNum = 23068683;BA.debugLine="clie_id = c.GetString(\"CUENTA\")";
__ref._clie_id /*String*/  = __ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CUENTA");
RDebugUtils.currentLine=23068684;
 //BA.debugLineNum = 23068684;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"select USUAR";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/  = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select USUARIO from usuarioa")));
RDebugUtils.currentLine=23068685;
 //BA.debugLineNum = 23068685;BA.debugLine="c.Position=0";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition((int) (0));
RDebugUtils.currentLine=23068686;
 //BA.debugLineNum = 23068686;BA.debugLine="usuario = c.GetString(\"USUARIO\")";
__ref._usuario /*String*/  = __ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("USUARIO");
RDebugUtils.currentLine=23068687;
 //BA.debugLineNum = 23068687;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"INSERT INT";
_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("INSERT INTO  PEDIDO (PE_CEDIS,PE_COSTO_TOT,PE_COSTOU,PE_CANT,PE_PRONOMBRE,PE_PROID,PE_CLIENTE,PE_FECHA,PE_USUARIO,PE_FOLIO) VALUES(?,?,?,?,?,?,?,?,?,?) ",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)("COACALCO"),(Object)(0),(Object)(0),(Object)(__ref._cantidad /*anywheresoftware.b4a.objects.EditTextWrapper*/ .getText()),(Object)(__ref._l_desc /*anywheresoftware.b4a.objects.LabelWrapper*/ .getText()),(Object)(__ref._l_proid /*anywheresoftware.b4a.objects.LabelWrapper*/ .getText()),(Object)(__ref._clie_id /*String*/ ),(Object)(__ref._sdate /*String*/ +__ref._stime /*String*/ ),(Object)(__ref._usuario /*String*/ ),(Object)(_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._tipo_venta /*String*/ )}));
RDebugUtils.currentLine=23068688;
 //BA.debugLineNum = 23068688;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"update cat";
_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("update cat_gunaprod set cat_gp_almacen = cat_gp_almacen - ? where cat_gp_id = ? ",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(__ref._cantidad /*anywheresoftware.b4a.objects.EditTextWrapper*/ .getText()),(Object)(__ref._l_proid /*anywheresoftware.b4a.objects.LabelWrapper*/ .getText())}));
RDebugUtils.currentLine=23068689;
 //BA.debugLineNum = 23068689;BA.debugLine="cantidad.Text = \"\"";
__ref._cantidad /*anywheresoftware.b4a.objects.EditTextWrapper*/ .setText(BA.ObjectToCharSequence(""));
RDebugUtils.currentLine=23068690;
 //BA.debugLineNum = 23068690;BA.debugLine="B4XPages.ShowPage(\"Productos\")";
_b4xpages._showpage /*String*/ (ba,"Productos");
 }}
;
RDebugUtils.currentLine=23068692;
 //BA.debugLineNum = 23068692;BA.debugLine="End Sub";
return "";
}
public String  _p_pedido_click(keymon.lat.medicomed.c_pedidos __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_pedidos";
if (Debug.shouldDelegate(ba, "p_pedido_click", false))
	 {return ((String) Debug.delegate(ba, "p_pedido_click", null));}
RDebugUtils.currentLine=23134208;
 //BA.debugLineNum = 23134208;BA.debugLine="Private Sub p_pedido_Click";
RDebugUtils.currentLine=23134210;
 //BA.debugLineNum = 23134210;BA.debugLine="End Sub";
return "";
}
public String  _terminar_click(keymon.lat.medicomed.c_pedidos __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_pedidos";
if (Debug.shouldDelegate(ba, "terminar_click", false))
	 {return ((String) Debug.delegate(ba, "terminar_click", null));}
int _i = 0;
RDebugUtils.currentLine=22740992;
 //BA.debugLineNum = 22740992;BA.debugLine="Sub Terminar_Click";
RDebugUtils.currentLine=22740993;
 //BA.debugLineNum = 22740993;BA.debugLine="If cantidad.Text = \"\" Then";
if ((__ref._cantidad /*anywheresoftware.b4a.objects.EditTextWrapper*/ .getText()).equals("")) { 
RDebugUtils.currentLine=22740994;
 //BA.debugLineNum = 22740994;BA.debugLine="B4XPages.ShowPage(\"Cliente\")";
_b4xpages._showpage /*String*/ (ba,"Cliente");
 }else 
{RDebugUtils.currentLine=22740995;
 //BA.debugLineNum = 22740995;BA.debugLine="ELSE If cantidad.Text > l_bodega.Text Then";
if ((double)(Double.parseDouble(__ref._cantidad /*anywheresoftware.b4a.objects.EditTextWrapper*/ .getText()))>(double)(Double.parseDouble(__ref._l_bodega /*anywheresoftware.b4a.objects.LabelWrapper*/ .getText()))) { 
RDebugUtils.currentLine=22740996;
 //BA.debugLineNum = 22740996;BA.debugLine="Msgbox(\"Exede la existencia\", \"ADVERTENCIA\") 'ig";
__c.Msgbox(BA.ObjectToCharSequence("Exede la existencia"),BA.ObjectToCharSequence("ADVERTENCIA"),ba);
 }else 
{RDebugUtils.currentLine=22740997;
 //BA.debugLineNum = 22740997;BA.debugLine="Else If l_marca.text = \"PROMOS\" And l_tipo.Text =";
if ((__ref._l_marca /*anywheresoftware.b4a.objects.LabelWrapper*/ .getText()).equals("PROMOS") && (__ref._l_tipo /*anywheresoftware.b4a.objects.LabelWrapper*/ .getText()).equals("PROMOS") && (double)(Double.parseDouble(__ref._promo_c /*String*/ ))>0 && (double)(Double.parseDouble(__ref._cantidad /*anywheresoftware.b4a.objects.EditTextWrapper*/ .getText()))>0) { 
RDebugUtils.currentLine=22740998;
 //BA.debugLineNum = 22740998;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"delete from";
_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("delete from PROIDID");
RDebugUtils.currentLine=22740999;
 //BA.debugLineNum = 22740999;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"INSERT INT";
_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("INSERT INTO PROIDID VALUES (?)",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(__ref._l_proid /*anywheresoftware.b4a.objects.LabelWrapper*/ .getText())}));
RDebugUtils.currentLine=22741000;
 //BA.debugLineNum = 22741000;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"Select count";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/  = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("Select count(*) as CUANTOSD from pedido where PE_CLIENTE IN (Select CUENTA from cuentaa)  and pe_proid In (Select cat_dp_idprod from CAT_DETALLES_PAQ WHERE CAT_DP_ID In (Select PROIDID from PROIDID) AND CAT_DP_TIPO = 1)")));
RDebugUtils.currentLine=22741001;
 //BA.debugLineNum = 22741001;BA.debugLine="c.Position =0";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition((int) (0));
RDebugUtils.currentLine=22741002;
 //BA.debugLineNum = 22741002;BA.debugLine="If c.GetString(\"CUANTOSD\") = 0 Then";
if ((__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CUANTOSD")).equals(BA.NumberToString(0))) { 
RDebugUtils.currentLine=22741003;
 //BA.debugLineNum = 22741003;BA.debugLine="Msgbox(\"No tiene venta el cliente para la promo";
__c.Msgbox(BA.ObjectToCharSequence("No tiene venta el cliente para la promo"),BA.ObjectToCharSequence("ADVERTENCIA"),ba);
 }else {
RDebugUtils.currentLine=22741005;
 //BA.debugLineNum = 22741005;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"Select sum(";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/  = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("Select sum(pe_cant) As TOT_ART_PROMO, sum(PE_COSTO_TOT) as COSTO_TOT from pedido where PE_CLIENTE IN (Select CUENTA from cuentaa)  and pe_proid In (Select cat_dp_idprod from CAT_DETALLES_PAQ WHERE CAT_DP_ID In (Select PROIDID from PROIDID) AND CAT_DP_PRECIO > 1)")));
RDebugUtils.currentLine=22741006;
 //BA.debugLineNum = 22741006;BA.debugLine="C.Position =0";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition((int) (0));
RDebugUtils.currentLine=22741007;
 //BA.debugLineNum = 22741007;BA.debugLine="TOT_ART_PROMO = C.GetString(\"TOT_ART_PROMO\")";
__ref._tot_art_promo /*String*/  = __ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("TOT_ART_PROMO");
RDebugUtils.currentLine=22741008;
 //BA.debugLineNum = 22741008;BA.debugLine="COSTO_TOT = C.GetString(\"COSTO_TOT\")";
__ref._costo_tot /*String*/  = __ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("COSTO_TOT");
RDebugUtils.currentLine=22741009;
 //BA.debugLineNum = 22741009;BA.debugLine="C.Close";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .Close();
RDebugUtils.currentLine=22741010;
 //BA.debugLineNum = 22741010;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"Select coun";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/  = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("Select count(*) as CUANTOSD from pedido where PE_CLIENTE IN (Select CUENTA from cuentaa)  and pe_proid In (Select cat_dp_idprod from CAT_DETALLES_PAQ WHERE CAT_DP_ID In (Select PROIDID from PROIDID) AND (CAT_DP_PRECIO = 0.01 or CAT_DP_PRECIO = 1 OR CAT_DP_PRECIO = 0) AND CAT_DP_TIPO = 1)")));
RDebugUtils.currentLine=22741011;
 //BA.debugLineNum = 22741011;BA.debugLine="c.Position =0";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition((int) (0));
RDebugUtils.currentLine=22741012;
 //BA.debugLineNum = 22741012;BA.debugLine="If c.GetString(\"CUANTOSD\") = 0 Then";
if ((__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CUANTOSD")).equals(BA.NumberToString(0))) { 
RDebugUtils.currentLine=22741013;
 //BA.debugLineNum = 22741013;BA.debugLine="TOT_ART_PROMOR = \"0\" 'Msgbox(\"No tiene venta e";
__ref._tot_art_promor /*String*/  = "0";
 }else {
RDebugUtils.currentLine=22741015;
 //BA.debugLineNum = 22741015;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"Select sum";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/  = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("Select sum(pe_cant) As TOT_ART_PROMO, sum(PE_COSTO_TOT) as COSTO_TOT from pedido where PE_CLIENTE IN (Select CUENTA from cuentaa)  and pe_proid In (Select cat_dp_idprod from CAT_DETALLES_PAQ WHERE CAT_DP_ID In (Select PROIDID from PROIDID) AND (CAT_DP_PRECIO = 0.01 or CAT_DP_PRECIO = 1 OR CAT_DP_PRECIO = 0) AND CAT_DP_TIPO = 1)")));
RDebugUtils.currentLine=22741016;
 //BA.debugLineNum = 22741016;BA.debugLine="C.Position =0";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition((int) (0));
RDebugUtils.currentLine=22741017;
 //BA.debugLineNum = 22741017;BA.debugLine="TOT_ART_PROMOR = C.GetString(\"TOT_ART_PROMO\")";
__ref._tot_art_promor /*String*/  = __ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("TOT_ART_PROMO");
 };
RDebugUtils.currentLine=22741019;
 //BA.debugLineNum = 22741019;BA.debugLine="C.Close";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .Close();
RDebugUtils.currentLine=22741020;
 //BA.debugLineNum = 22741020;BA.debugLine="PROMO_C = PROMO_C * cantidad.Text";
__ref._promo_c /*String*/  = BA.NumberToString((double)(Double.parseDouble(__ref._promo_c /*String*/ ))*(double)(Double.parseDouble(__ref._cantidad /*anywheresoftware.b4a.objects.EditTextWrapper*/ .getText())));
RDebugUtils.currentLine=22741021;
 //BA.debugLineNum = 22741021;BA.debugLine="PROMO_CR = PROMO_CR * cantidad.Text";
__ref._promo_cr /*String*/  = BA.NumberToString((double)(Double.parseDouble(__ref._promo_cr /*String*/ ))*(double)(Double.parseDouble(__ref._cantidad /*anywheresoftware.b4a.objects.EditTextWrapper*/ .getText())));
RDebugUtils.currentLine=22741022;
 //BA.debugLineNum = 22741022;BA.debugLine="If  TOT_ART_PROMO = PROMO_C And TOT_ART_PROMOR";
if ((__ref._tot_art_promo /*String*/ ).equals(__ref._promo_c /*String*/ ) && (__ref._tot_art_promor /*String*/ ).equals(__ref._promo_cr /*String*/ )) { 
RDebugUtils.currentLine=22741026;
 //BA.debugLineNum = 22741026;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"UPDATE P";
_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("UPDATE PEDIDO SET PE_CEDIS = (?) WHERE PE_CLIENTE IN (Select CUENTA from cuentaa) and pe_proid In (Select cat_dp_idprod from CAT_DETALLES_PAQ WHERE CAT_DP_ID In (Select PROIDID from PROIDID))",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(__ref._l_proid /*anywheresoftware.b4a.objects.LabelWrapper*/ .getText())}));
RDebugUtils.currentLine=22741027;
 //BA.debugLineNum = 22741027;BA.debugLine="D=B4XPages.MainPage.skmt.ExecQuery(\"select CAT";
__ref._d /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/  = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select CAT_DP_ID, CAT_DP_PRECIO, CAT_DP_PRECIO_SIMPTOS, CAT_DP_IDPROD FROM CAT_DETALLES_PAQ WHERE CAT_DP_ID IN (Select PROIDID from PROIDID) AND CAT_DP_PRECIO > 1")));
RDebugUtils.currentLine=22741028;
 //BA.debugLineNum = 22741028;BA.debugLine="If D.RowCount>0 Then";
if (__ref._d /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .getRowCount()>0) { 
RDebugUtils.currentLine=22741029;
 //BA.debugLineNum = 22741029;BA.debugLine="For i=0 To D.RowCount -1";
{
final int step34 = 1;
final int limit34 = (int) (__ref._d /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .getRowCount()-1);
_i = (int) (0) ;
for (;_i <= limit34 ;_i = _i + step34 ) {
RDebugUtils.currentLine=22741030;
 //BA.debugLineNum = 22741030;BA.debugLine="D.Position=i";
__ref._d /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition(_i);
RDebugUtils.currentLine=22741031;
 //BA.debugLineNum = 22741031;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"UPDATE";
_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("UPDATE PEDIDO SET PE_COSTOU = (?), PE_COSTO_TOT = PE_CANT * (?) , PE_COSTO_SIN = (?) WHERE PE_PROID = (?) And PE_CEDIS In (Select PROIDID from PROIDID) AND  PE_CLIENTE IN (Select CUENTA from cuentaa) ",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(__ref._d /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CAT_DP_PRECIO")),(Object)(__ref._d /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CAT_DP_PRECIO")),(Object)(__ref._d /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CAT_DP_PRECIO_SIMPTOS")),(Object)(__ref._d /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CAT_DP_IDPROD"))}));
 }
};
 };
RDebugUtils.currentLine=22741034;
 //BA.debugLineNum = 22741034;BA.debugLine="D.Close";
__ref._d /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .Close();
RDebugUtils.currentLine=22741035;
 //BA.debugLineNum = 22741035;BA.debugLine="D=B4XPages.MainPage.skmt.ExecQuery(\"select CAT";
__ref._d /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/  = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select CAT_DP_ID, CAT_DP_PRECIO, CAT_DP_PRECIO_SIMPTOS, CAT_DP_IDPROD FROM CAT_DETALLES_PAQ WHERE CAT_DP_ID IN (Select PROIDID from PROIDID) AND (CAT_DP_PRECIO = 0.01 or CAT_DP_PRECIO = 1 OR CAT_DP_PRECIO = 0) AND CAT_DP_TIPO = 1")));
RDebugUtils.currentLine=22741036;
 //BA.debugLineNum = 22741036;BA.debugLine="If D.RowCount>0 Then";
if (__ref._d /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .getRowCount()>0) { 
RDebugUtils.currentLine=22741037;
 //BA.debugLineNum = 22741037;BA.debugLine="For i=0 To D.RowCount -1";
{
final int step42 = 1;
final int limit42 = (int) (__ref._d /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .getRowCount()-1);
_i = (int) (0) ;
for (;_i <= limit42 ;_i = _i + step42 ) {
RDebugUtils.currentLine=22741038;
 //BA.debugLineNum = 22741038;BA.debugLine="D.Position=i";
__ref._d /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition(_i);
RDebugUtils.currentLine=22741039;
 //BA.debugLineNum = 22741039;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"UPDATE";
_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("UPDATE PEDIDO SET PE_COSTOU = (?), PE_COSTO_TOT = PE_CANT * (?) , PE_COSTO_SIN = (?) WHERE PE_PROID = (?) And PE_CEDIS In (Select PROIDID from PROIDID) AND  PE_CLIENTE IN (Select CUENTA from cuentaa) ",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(__ref._d /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CAT_DP_PRECIO")),(Object)(__ref._d /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CAT_DP_PRECIO")),(Object)(__ref._d /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CAT_DP_PRECIO_SIMPTOS")),(Object)(__ref._d /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CAT_DP_IDPROD"))}));
 }
};
 };
RDebugUtils.currentLine=22741042;
 //BA.debugLineNum = 22741042;BA.debugLine="D.Close";
__ref._d /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .Close();
RDebugUtils.currentLine=22741043;
 //BA.debugLineNum = 22741043;BA.debugLine="DateTime.DateFormat = \"MM/dd/yyyy\"";
__c.DateTime.setDateFormat("MM/dd/yyyy");
RDebugUtils.currentLine=22741044;
 //BA.debugLineNum = 22741044;BA.debugLine="sDate=DateTime.Date(DateTime.Now)";
__ref._sdate /*String*/  = __c.DateTime.Date(__c.DateTime.getNow());
RDebugUtils.currentLine=22741045;
 //BA.debugLineNum = 22741045;BA.debugLine="sTime=DateTime.Time(DateTime.Now)";
__ref._stime /*String*/  = __c.DateTime.Time(__c.DateTime.getNow());
RDebugUtils.currentLine=22741046;
 //BA.debugLineNum = 22741046;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"Select CUE";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/  = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("Select CUENTA from cuentaa")));
RDebugUtils.currentLine=22741047;
 //BA.debugLineNum = 22741047;BA.debugLine="c.Position=0";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition((int) (0));
RDebugUtils.currentLine=22741048;
 //BA.debugLineNum = 22741048;BA.debugLine="clie_id = c.GetString(\"CUENTA\")";
__ref._clie_id /*String*/  = __ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CUENTA");
RDebugUtils.currentLine=22741049;
 //BA.debugLineNum = 22741049;BA.debugLine="c.Close";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .Close();
RDebugUtils.currentLine=22741050;
 //BA.debugLineNum = 22741050;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"select CAT";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/  = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select CAT_CL_RUTA from kmt_info where CAT_CL_CODIGO In (Select cuenta from cuentaa)")));
RDebugUtils.currentLine=22741051;
 //BA.debugLineNum = 22741051;BA.debugLine="c.Position=0";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition((int) (0));
RDebugUtils.currentLine=22741052;
 //BA.debugLineNum = 22741052;BA.debugLine="cl_ruta = c.GetString(\"CAT_CL_RUTA\")";
__ref._cl_ruta /*String*/  = __ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CAT_CL_RUTA");
RDebugUtils.currentLine=22741053;
 //BA.debugLineNum = 22741053;BA.debugLine="c.Close";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .Close();
RDebugUtils.currentLine=22741054;
 //BA.debugLineNum = 22741054;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"select USU";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/  = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select USUARIO from usuarioa")));
RDebugUtils.currentLine=22741055;
 //BA.debugLineNum = 22741055;BA.debugLine="c.Position=0";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition((int) (0));
RDebugUtils.currentLine=22741056;
 //BA.debugLineNum = 22741056;BA.debugLine="usuario = c.GetString(\"USUARIO\")";
__ref._usuario /*String*/  = __ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("USUARIO");
RDebugUtils.currentLine=22741058;
 //BA.debugLineNum = 22741058;BA.debugLine="e=B4XPages.MainPage.skmt.ExecQuery(\"select cou";
__ref._e /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/  = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select count(*) as CUANTOS FROM CAT_DETALLES_PAQ WHERE CAT_DP_ID IN (Select PROIDID from PROIDID) and CAT_DP_TIPO = 0 ")));
RDebugUtils.currentLine=22741060;
 //BA.debugLineNum = 22741060;BA.debugLine="e.Position =0";
__ref._e /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition((int) (0));
RDebugUtils.currentLine=22741061;
 //BA.debugLineNum = 22741061;BA.debugLine="If e.GetString(\"CUANTOS\") > 0 Then";
if ((double)(Double.parseDouble(__ref._e /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CUANTOS")))>0) { 
RDebugUtils.currentLine=22741062;
 //BA.debugLineNum = 22741062;BA.debugLine="F=B4XPages.MainPage.skmt.ExecQuery(\"select CA";
__ref._f /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/  = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select CAT_DP_IDPROD, CAT_DP_PZAS,CAT_DP_PRECIO FROM CAT_DETALLES_PAQ WHERE CAT_DP_ID IN (Select PROIDID from PROIDID) and CAT_DP_TIPO = 0 ")));
RDebugUtils.currentLine=22741065;
 //BA.debugLineNum = 22741065;BA.debugLine="If f.RowCount>0 Then";
if (__ref._f /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .getRowCount()>0) { 
RDebugUtils.currentLine=22741066;
 //BA.debugLineNum = 22741066;BA.debugLine="For i=0 To f.RowCount -1";
{
final int step67 = 1;
final int limit67 = (int) (__ref._f /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .getRowCount()-1);
_i = (int) (0) ;
for (;_i <= limit67 ;_i = _i + step67 ) {
RDebugUtils.currentLine=22741067;
 //BA.debugLineNum = 22741067;BA.debugLine="f.Position=i";
__ref._f /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition(_i);
RDebugUtils.currentLine=22741068;
 //BA.debugLineNum = 22741068;BA.debugLine="precio_Cero = f.GetString(\"CAT_DP_PRECIO\")";
__ref._precio_cero /*String*/  = __ref._f /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CAT_DP_PRECIO");
RDebugUtils.currentLine=22741069;
 //BA.debugLineNum = 22741069;BA.debugLine="h=B4XPages.MainPage.skmt.ExecQuery2(\"select";
__ref._h /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/  = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery2("select CAT_GP_NOMBRE from CAT_GUNAPROD where CAT_GP_ID = ? ",new String[]{__ref._f /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CAT_DP_IDPROD")})));
RDebugUtils.currentLine=22741070;
 //BA.debugLineNum = 22741070;BA.debugLine="h.Position=0";
__ref._h /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition((int) (0));
RDebugUtils.currentLine=22741071;
 //BA.debugLineNum = 22741071;BA.debugLine="Log(111)";
__c.LogImpl("322741071",BA.NumberToString(111),0);
RDebugUtils.currentLine=22741072;
 //BA.debugLineNum = 22741072;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"INSER";
_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("INSERT INTO  PEDIDO (PE_CEDIS,PE_COSTO_TOT,PE_COSTOU,PE_CANT,PE_PRONOMBRE,PE_PROID,PE_CLIENTE,PE_FECHA,PE_USUARIO,PE_RUTA,PE_FOLIO) VALUES(?,?,?,?,?,?,?,?,?,?,?) ",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(__ref._l_proid /*anywheresoftware.b4a.objects.LabelWrapper*/ .getText()),(Object)((double)(Double.parseDouble(__ref._precio_cero /*String*/ ))*(double)(Double.parseDouble(__ref._f /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CAT_DP_PZAS")))*(double)(Double.parseDouble(__ref._cantidad /*anywheresoftware.b4a.objects.EditTextWrapper*/ .getText()))),(Object)(__ref._precio_cero /*String*/ ),(Object)((double)(Double.parseDouble(__ref._f /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CAT_DP_PZAS")))*(double)(Double.parseDouble(__ref._cantidad /*anywheresoftware.b4a.objects.EditTextWrapper*/ .getText()))),(Object)(__ref._h /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CAT_GP_NOMBRE")),(Object)(__ref._f /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CAT_DP_IDPROD")),(Object)(__ref._clie_id /*String*/ ),(Object)(__ref._sdate /*String*/ +__ref._stime /*String*/ ),(Object)(__ref._usuario /*String*/ ),(Object)(__ref._cl_ruta /*String*/ ),(Object)(_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._tipo_venta /*String*/ )}));
RDebugUtils.currentLine=22741073;
 //BA.debugLineNum = 22741073;BA.debugLine="h.Close";
__ref._h /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .Close();
 }
};
 };
RDebugUtils.currentLine=22741076;
 //BA.debugLineNum = 22741076;BA.debugLine="f.Close";
__ref._f /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .Close();
 };
RDebugUtils.currentLine=22741078;
 //BA.debugLineNum = 22741078;BA.debugLine="e.Close";
__ref._e /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .Close();
RDebugUtils.currentLine=22741079;
 //BA.debugLineNum = 22741079;BA.debugLine="Log(222)";
__c.LogImpl("322741079",BA.NumberToString(222),0);
RDebugUtils.currentLine=22741080;
 //BA.debugLineNum = 22741080;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"INSERT I";
_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("INSERT INTO  PEDIDO (PE_CEDIS,PE_COSTO_TOT,PE_COSTOU,PE_CANT,PE_PRONOMBRE,PE_PROID,PE_CLIENTE,PE_FECHA,PE_USUARIO,PE_RUTA,PE_FOLIO) VALUES(?,?,?,?,?,?,?,?,?,?,?) ",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(__ref._l_proid /*anywheresoftware.b4a.objects.LabelWrapper*/ .getText()),(Object)(0),(Object)(0),(Object)(__ref._cantidad /*anywheresoftware.b4a.objects.EditTextWrapper*/ .getText()),(Object)(__ref._l_desc /*anywheresoftware.b4a.objects.LabelWrapper*/ .getText()),(Object)(__ref._l_proid /*anywheresoftware.b4a.objects.LabelWrapper*/ .getText()),(Object)(__ref._clie_id /*String*/ ),(Object)(__ref._sdate /*String*/ +__ref._stime /*String*/ ),(Object)(__ref._usuario /*String*/ ),(Object)(__ref._cl_ruta /*String*/ ),(Object)(_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._tipo_venta /*String*/ )}));
RDebugUtils.currentLine=22741081;
 //BA.debugLineNum = 22741081;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"update c";
_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("update cat_gunaprod set cat_gp_almacen = cat_gp_almacen - ? where cat_gp_id = ? ",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(__ref._cantidad /*anywheresoftware.b4a.objects.EditTextWrapper*/ .getText()),(Object)(__ref._l_proid /*anywheresoftware.b4a.objects.LabelWrapper*/ .getText())}));
 }else {
RDebugUtils.currentLine=22741083;
 //BA.debugLineNum = 22741083;BA.debugLine="Msgbox(\"Tiene \" & TOT_ART_PROMO & \" \" & TOT_AR";
__c.Msgbox(BA.ObjectToCharSequence("Tiene "+__ref._tot_art_promo /*String*/ +" "+__ref._tot_art_promor /*String*/ +" y necesita "+__ref._promo_c /*String*/ +" "+__ref._promo_cr /*String*/ +" Para la Promo. "),BA.ObjectToCharSequence("ADVERTENCIA"),ba);
 };
 };
RDebugUtils.currentLine=22741086;
 //BA.debugLineNum = 22741086;BA.debugLine="cantidad.Text = \"\"";
__ref._cantidad /*anywheresoftware.b4a.objects.EditTextWrapper*/ .setText(BA.ObjectToCharSequence(""));
RDebugUtils.currentLine=22741087;
 //BA.debugLineNum = 22741087;BA.debugLine="B4XPages.ShowPage(\"Cliente\")";
_b4xpages._showpage /*String*/ (ba,"Cliente");
 }else 
{RDebugUtils.currentLine=22741088;
 //BA.debugLineNum = 22741088;BA.debugLine="else If l_marca.text = \"PROMOS\" And l_tipo.Text =";
if ((__ref._l_marca /*anywheresoftware.b4a.objects.LabelWrapper*/ .getText()).equals("PROMOS") && (__ref._l_tipo /*anywheresoftware.b4a.objects.LabelWrapper*/ .getText()).equals("PROMOS") && (__ref._promo_c /*String*/ ).equals(BA.NumberToString(0))) { 
RDebugUtils.currentLine=22741089;
 //BA.debugLineNum = 22741089;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"delete from";
_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("delete from PROIDID");
RDebugUtils.currentLine=22741090;
 //BA.debugLineNum = 22741090;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"INSERT INT";
_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("INSERT INTO PROIDID VALUES (?)",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(__ref._l_proid /*anywheresoftware.b4a.objects.LabelWrapper*/ .getText())}));
RDebugUtils.currentLine=22741091;
 //BA.debugLineNum = 22741091;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"Select CUENT";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/  = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("Select CUENTA from cuentaa")));
RDebugUtils.currentLine=22741092;
 //BA.debugLineNum = 22741092;BA.debugLine="c.Position=0";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition((int) (0));
RDebugUtils.currentLine=22741093;
 //BA.debugLineNum = 22741093;BA.debugLine="clie_id = c.GetString(\"CUENTA\")";
__ref._clie_id /*String*/  = __ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CUENTA");
RDebugUtils.currentLine=22741094;
 //BA.debugLineNum = 22741094;BA.debugLine="c.Close";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .Close();
RDebugUtils.currentLine=22741095;
 //BA.debugLineNum = 22741095;BA.debugLine="DateTime.DateFormat = \"MM/dd/yyyy\"";
__c.DateTime.setDateFormat("MM/dd/yyyy");
RDebugUtils.currentLine=22741096;
 //BA.debugLineNum = 22741096;BA.debugLine="sDate=DateTime.Date(DateTime.Now)";
__ref._sdate /*String*/  = __c.DateTime.Date(__c.DateTime.getNow());
RDebugUtils.currentLine=22741097;
 //BA.debugLineNum = 22741097;BA.debugLine="sTime=DateTime.Time(DateTime.Now)";
__ref._stime /*String*/  = __c.DateTime.Time(__c.DateTime.getNow());
RDebugUtils.currentLine=22741098;
 //BA.debugLineNum = 22741098;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"select CAT_C";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/  = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select CAT_CL_RUTA from kmt_info where CAT_CL_CODIGO In (Select cuenta from cuentaa)")));
RDebugUtils.currentLine=22741099;
 //BA.debugLineNum = 22741099;BA.debugLine="c.Position=0";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition((int) (0));
RDebugUtils.currentLine=22741100;
 //BA.debugLineNum = 22741100;BA.debugLine="cl_ruta = c.GetString(\"CAT_CL_RUTA\")";
__ref._cl_ruta /*String*/  = __ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CAT_CL_RUTA");
RDebugUtils.currentLine=22741101;
 //BA.debugLineNum = 22741101;BA.debugLine="c.Close";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .Close();
RDebugUtils.currentLine=22741102;
 //BA.debugLineNum = 22741102;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"select USUAR";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/  = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select USUARIO from usuarioa")));
RDebugUtils.currentLine=22741103;
 //BA.debugLineNum = 22741103;BA.debugLine="c.Position=0";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition((int) (0));
RDebugUtils.currentLine=22741104;
 //BA.debugLineNum = 22741104;BA.debugLine="usuario = c.GetString(\"USUARIO\")";
__ref._usuario /*String*/  = __ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("USUARIO");
RDebugUtils.currentLine=22741106;
 //BA.debugLineNum = 22741106;BA.debugLine="e=B4XPages.MainPage.skmt.ExecQuery(\"select count";
__ref._e /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/  = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select count(*) as CUANTOS FROM CAT_DETALLES_PAQ WHERE CAT_DP_ID IN (Select PROIDID from PROIDID) ")));
RDebugUtils.currentLine=22741107;
 //BA.debugLineNum = 22741107;BA.debugLine="e.Position =0";
__ref._e /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition((int) (0));
RDebugUtils.currentLine=22741108;
 //BA.debugLineNum = 22741108;BA.debugLine="If e.GetString(\"CUANTOS\") > 0 Then";
if ((double)(Double.parseDouble(__ref._e /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CUANTOS")))>0) { 
RDebugUtils.currentLine=22741109;
 //BA.debugLineNum = 22741109;BA.debugLine="F=B4XPages.MainPage.skmt.ExecQuery(\"select CAT_";
__ref._f /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/  = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select CAT_DP_IDPROD, CAT_DP_PZAS, CAT_DP_PRECIO FROM CAT_DETALLES_PAQ WHERE CAT_DP_ID IN (Select PROIDID from PROIDID)")));
RDebugUtils.currentLine=22741110;
 //BA.debugLineNum = 22741110;BA.debugLine="For i =0 To f.RowCount -1";
{
final int step110 = 1;
final int limit110 = (int) (__ref._f /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .getRowCount()-1);
_i = (int) (0) ;
for (;_i <= limit110 ;_i = _i + step110 ) {
RDebugUtils.currentLine=22741111;
 //BA.debugLineNum = 22741111;BA.debugLine="F.Position =i";
__ref._f /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition(_i);
RDebugUtils.currentLine=22741112;
 //BA.debugLineNum = 22741112;BA.debugLine="h=B4XPages.MainPage.skmt.ExecQuery2(\"select CA";
__ref._h /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/  = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery2("select CAT_GP_NOMBRE from CAT_GUNAPROD where CAT_GP_ID = ? ",new String[]{__ref._f /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CAT_DP_IDPROD")})));
RDebugUtils.currentLine=22741113;
 //BA.debugLineNum = 22741113;BA.debugLine="h.Position=0";
__ref._h /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition((int) (0));
RDebugUtils.currentLine=22741114;
 //BA.debugLineNum = 22741114;BA.debugLine="Log(333)";
__c.LogImpl("322741114",BA.NumberToString(333),0);
RDebugUtils.currentLine=22741115;
 //BA.debugLineNum = 22741115;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"INSERT I";
_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("INSERT INTO  PEDIDO (PE_CEDIS,PE_COSTO_TOT,PE_COSTOU,PE_CANT,PE_PRONOMBRE,PE_PROID,PE_CLIENTE,PE_FECHA,PE_USUARIO,PE_RUTA,PE_FOLIO) VALUES(?,?,?,?,?,?,?,?,?,?,?) ",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(__ref._l_proid /*anywheresoftware.b4a.objects.LabelWrapper*/ .getText()),(Object)((double)(Double.parseDouble(__ref._f /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CAT_DP_PRECIO")))*(double)(Double.parseDouble(__ref._cantidad /*anywheresoftware.b4a.objects.EditTextWrapper*/ .getText()))*(double)(Double.parseDouble(__ref._f /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CAT_DP_PZAS")))),(Object)(__ref._f /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CAT_DP_PRECIO")),(Object)((double)(Double.parseDouble(__ref._f /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CAT_DP_PZAS")))*(double)(Double.parseDouble(__ref._cantidad /*anywheresoftware.b4a.objects.EditTextWrapper*/ .getText()))),(Object)(__ref._h /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CAT_GP_NOMBRE")),(Object)(__ref._f /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CAT_DP_IDPROD")),(Object)(__ref._clie_id /*String*/ ),(Object)(__ref._sdate /*String*/ +__ref._stime /*String*/ ),(Object)(__ref._usuario /*String*/ ),(Object)(__ref._cl_ruta /*String*/ ),(Object)(_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._tipo_venta /*String*/ )}));
RDebugUtils.currentLine=22741116;
 //BA.debugLineNum = 22741116;BA.debugLine="h.Close";
__ref._h /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .Close();
 }
};
RDebugUtils.currentLine=22741118;
 //BA.debugLineNum = 22741118;BA.debugLine="f.Close";
__ref._f /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .Close();
 };
RDebugUtils.currentLine=22741120;
 //BA.debugLineNum = 22741120;BA.debugLine="e.Close";
__ref._e /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .Close();
RDebugUtils.currentLine=22741121;
 //BA.debugLineNum = 22741121;BA.debugLine="Log(444)";
__c.LogImpl("322741121",BA.NumberToString(444),0);
RDebugUtils.currentLine=22741122;
 //BA.debugLineNum = 22741122;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"INSERT INT";
_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("INSERT INTO  PEDIDO (PE_CEDIS,PE_COSTO_TOT,PE_COSTOU,PE_CANT,PE_PRONOMBRE,PE_PROID,PE_CLIENTE,PE_FECHA,PE_USUARIO,PE_RUTA,PE_FOLIO) VALUES(?,?,?,?,?,?,?,?,?,?,?) ",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(__ref._l_proid /*anywheresoftware.b4a.objects.LabelWrapper*/ .getText()),(Object)(0),(Object)(0),(Object)(__ref._cantidad /*anywheresoftware.b4a.objects.EditTextWrapper*/ .getText()),(Object)(__ref._l_desc /*anywheresoftware.b4a.objects.LabelWrapper*/ .getText()),(Object)(__ref._l_proid /*anywheresoftware.b4a.objects.LabelWrapper*/ .getText()),(Object)(__ref._clie_id /*String*/ ),(Object)(__ref._sdate /*String*/ +__ref._stime /*String*/ ),(Object)(__ref._usuario /*String*/ ),(Object)(__ref._cl_ruta /*String*/ ),(Object)(_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._tipo_venta /*String*/ )}));
RDebugUtils.currentLine=22741123;
 //BA.debugLineNum = 22741123;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"update cat";
_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("update cat_gunaprod set cat_gp_almacen = cat_gp_almacen - ? where cat_gp_id = ? ",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(__ref._cantidad /*anywheresoftware.b4a.objects.EditTextWrapper*/ .getText()),(Object)(__ref._l_proid /*anywheresoftware.b4a.objects.LabelWrapper*/ .getText())}));
RDebugUtils.currentLine=22741124;
 //BA.debugLineNum = 22741124;BA.debugLine="cantidad.Text = \"\"";
__ref._cantidad /*anywheresoftware.b4a.objects.EditTextWrapper*/ .setText(BA.ObjectToCharSequence(""));
RDebugUtils.currentLine=22741125;
 //BA.debugLineNum = 22741125;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"select sum(p";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/  = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select sum(pe_costo_tot) as TOTAL_CLIE, SUM(PE_CANT) AS CANT_CLIE, SUM(PE_COSTO_SIN) AS TOTAL_CLIE_SIN FROM PEDIDO WHERE PE_CLIENTE IN (Select CUENTA from cuentaa)")));
RDebugUtils.currentLine=22741126;
 //BA.debugLineNum = 22741126;BA.debugLine="c.Position=0";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition((int) (0));
RDebugUtils.currentLine=22741127;
 //BA.debugLineNum = 22741127;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"delete from";
_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("delete from pedido_cliente where PC_CLIENTE In (select cuenta from cuentaa)");
RDebugUtils.currentLine=22741128;
 //BA.debugLineNum = 22741128;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"insert int";
_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("insert into pedido_cliente(PC_CLIENTE, PC_FECHA, PC_USER, PC_NOART, PC_MONTO,PC_LON, PC_LAT,PC_ALMACEN,PC_RUTA,PC_COSTO_SIN) VALUES (?,?,?,?,?,?,?,?,?,?)",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(__ref._clie_id /*String*/ ),(Object)(__ref._sdate /*String*/ +__ref._stime /*String*/ ),(Object)(__ref._usuario /*String*/ ),(Object)(__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CANT_CLIE")),(Object)(__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("TOTAL_CLIE")),(Object)(_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._lon_gps /*String*/ ),(Object)(_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._lat_gps /*String*/ ),(Object)(__ref._almacen /*String*/ ),(Object)(__ref._cl_ruta /*String*/ ),(Object)(__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("TOTAL_CLIE_SIN"))}));
RDebugUtils.currentLine=22741129;
 //BA.debugLineNum = 22741129;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"UPDATE kmt_";
_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("UPDATE kmt_info set gestion = 2  where CAT_CL_CODIGO In (select cuenta from cuentaa)");
RDebugUtils.currentLine=22741130;
 //BA.debugLineNum = 22741130;BA.debugLine="B4XPages.ShowPage(\"Cliente\")";
_b4xpages._showpage /*String*/ (ba,"Cliente");
 }else {
RDebugUtils.currentLine=22741132;
 //BA.debugLineNum = 22741132;BA.debugLine="DateTime.DateFormat = \"MM/dd/yyyy\"";
__c.DateTime.setDateFormat("MM/dd/yyyy");
RDebugUtils.currentLine=22741133;
 //BA.debugLineNum = 22741133;BA.debugLine="sDate=DateTime.Date(DateTime.Now)";
__ref._sdate /*String*/  = __c.DateTime.Date(__c.DateTime.getNow());
RDebugUtils.currentLine=22741134;
 //BA.debugLineNum = 22741134;BA.debugLine="sTime=DateTime.Time(DateTime.Now)";
__ref._stime /*String*/  = __c.DateTime.Time(__c.DateTime.getNow());
RDebugUtils.currentLine=22741135;
 //BA.debugLineNum = 22741135;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"Select CUENT";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/  = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("Select CUENTA from cuentaa")));
RDebugUtils.currentLine=22741136;
 //BA.debugLineNum = 22741136;BA.debugLine="c.Position=0";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition((int) (0));
RDebugUtils.currentLine=22741137;
 //BA.debugLineNum = 22741137;BA.debugLine="clie_id = c.GetString(\"CUENTA\")";
__ref._clie_id /*String*/  = __ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CUENTA");
RDebugUtils.currentLine=22741138;
 //BA.debugLineNum = 22741138;BA.debugLine="c.Close";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .Close();
RDebugUtils.currentLine=22741139;
 //BA.debugLineNum = 22741139;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"select CAT_C";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/  = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select CAT_CL_RUTA from kmt_info where CAT_CL_CODIGO In (Select cuenta from cuentaa)")));
RDebugUtils.currentLine=22741140;
 //BA.debugLineNum = 22741140;BA.debugLine="c.Position=0";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition((int) (0));
RDebugUtils.currentLine=22741141;
 //BA.debugLineNum = 22741141;BA.debugLine="cl_ruta = c.GetString(\"CAT_CL_RUTA\")";
__ref._cl_ruta /*String*/  = __ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CAT_CL_RUTA");
RDebugUtils.currentLine=22741142;
 //BA.debugLineNum = 22741142;BA.debugLine="c.Close";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .Close();
RDebugUtils.currentLine=22741143;
 //BA.debugLineNum = 22741143;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"select USUAR";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/  = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select USUARIO from usuarioa")));
RDebugUtils.currentLine=22741144;
 //BA.debugLineNum = 22741144;BA.debugLine="c.Position=0";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition((int) (0));
RDebugUtils.currentLine=22741145;
 //BA.debugLineNum = 22741145;BA.debugLine="usuario = c.GetString(\"USUARIO\")";
__ref._usuario /*String*/  = __ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("USUARIO");
RDebugUtils.currentLine=22741146;
 //BA.debugLineNum = 22741146;BA.debugLine="Log(555)";
__c.LogImpl("322741146",BA.NumberToString(555),0);
RDebugUtils.currentLine=22741147;
 //BA.debugLineNum = 22741147;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"INSERT INT";
_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("INSERT INTO  PEDIDO (PE_CEDIS,PE_COSTO_TOT,PE_COSTOU,PE_CANT,PE_PRONOMBRE,PE_PROID,PE_CLIENTE,PE_FECHA,PE_USUARIO,PE_RUTA,PE_COSTO_SIN,PE_FOLIO) VALUES(?,?,?,?,?,?,?,?,?,?,?,?) ",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(__ref._almacen /*String*/ ),(Object)((double)(Double.parseDouble(__ref._cantidad /*anywheresoftware.b4a.objects.EditTextWrapper*/ .getText()))*(double)(Double.parseDouble(__ref._l_precio /*anywheresoftware.b4a.objects.LabelWrapper*/ .getText()))),(Object)(__ref._l_precio /*anywheresoftware.b4a.objects.LabelWrapper*/ .getText()),(Object)(__ref._cantidad /*anywheresoftware.b4a.objects.EditTextWrapper*/ .getText()),(Object)(__ref._l_desc /*anywheresoftware.b4a.objects.LabelWrapper*/ .getText()),(Object)(__ref._l_proid /*anywheresoftware.b4a.objects.LabelWrapper*/ .getText()),(Object)(__ref._clie_id /*String*/ ),(Object)(__ref._sdate /*String*/ +__ref._stime /*String*/ ),(Object)(__ref._usuario /*String*/ ),(Object)(__ref._cl_ruta /*String*/ ),(Object)(__ref._preciosin /*String*/ ),(Object)(_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._tipo_venta /*String*/ )}));
RDebugUtils.currentLine=22741148;
 //BA.debugLineNum = 22741148;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"update cat";
_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("update cat_gunaprod set cat_gp_almacen = cat_gp_almacen - ? where cat_gp_id = ? ",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(__ref._cantidad /*anywheresoftware.b4a.objects.EditTextWrapper*/ .getText()),(Object)(__ref._l_proid /*anywheresoftware.b4a.objects.LabelWrapper*/ .getText())}));
RDebugUtils.currentLine=22741149;
 //BA.debugLineNum = 22741149;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"select sum(p";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/  = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select sum(pe_costo_tot) as TOTAL_CLIE, SUM(PE_CANT) AS CANT_CLIE, SUM(PE_COSTO_SIN) AS TOTAL_CLIE_SIN FROM PEDIDO WHERE PE_CLIENTE IN (Select CUENTA from cuentaa)")));
RDebugUtils.currentLine=22741150;
 //BA.debugLineNum = 22741150;BA.debugLine="c.Position=0";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition((int) (0));
RDebugUtils.currentLine=22741151;
 //BA.debugLineNum = 22741151;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"delete from";
_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("delete from pedido_cliente where PC_CLIENTE In (select cuenta from cuentaa)");
RDebugUtils.currentLine=22741152;
 //BA.debugLineNum = 22741152;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"insert int";
_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("insert into pedido_cliente(PC_CLIENTE, PC_FECHA, PC_USER, PC_NOART, PC_MONTO,PC_LON, PC_LAT,PC_ALMACEN,PC_RUTA,PC_COSTO_SIN) VALUES (?,?,?,?,?,?,?,?,?,?)",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(__ref._clie_id /*String*/ ),(Object)(__ref._sdate /*String*/ +__ref._stime /*String*/ ),(Object)(__ref._usuario /*String*/ ),(Object)(__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CANT_CLIE")),(Object)(__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("TOTAL_CLIE")),(Object)(_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._lon_gps /*String*/ ),(Object)(_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._lat_gps /*String*/ ),(Object)(__ref._almacen /*String*/ ),(Object)(__ref._cl_ruta /*String*/ ),(Object)(__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("TOTAL_CLIE_SIN"))}));
RDebugUtils.currentLine=22741153;
 //BA.debugLineNum = 22741153;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"UPDATE kmt_";
_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("UPDATE kmt_info set gestion = 2  where CAT_CL_CODIGO In (select cuenta from cuentaa)");
RDebugUtils.currentLine=22741154;
 //BA.debugLineNum = 22741154;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"INSERT INT";
_b4xpages._mainpage /*keymon.lat.medicomed.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)(__ref._almacen /*String*/ ),(Object)(__ref._l_proid /*anywheresoftware.b4a.objects.LabelWrapper*/ .getText()),(Object)(__ref._cantidad /*anywheresoftware.b4a.objects.EditTextWrapper*/ .getText())}));
RDebugUtils.currentLine=22741155;
 //BA.debugLineNum = 22741155;BA.debugLine="B4XPages.ShowPage(\"Cliente\")";
_b4xpages._showpage /*String*/ (ba,"Cliente");
 }}}}
;
RDebugUtils.currentLine=22741157;
 //BA.debugLineNum = 22741157;BA.debugLine="End Sub";
return "";
}
}