package keymon.lat.medicomed;


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

public class c_nota extends B4AClass.ImplB4AClass implements BA.SubDelegator{
    private static java.util.HashMap<String, java.lang.reflect.Method> htSubs;
    private void innerInitialize(BA _ba) throws Exception {
        if (ba == null) {
            ba = new anywheresoftware.b4a.ShellBA(_ba, this, htSubs, "keymon.lat.medicomed.c_nota");
            if (htSubs == null) {
                ba.loadHtSubs(this.getClass());
                htSubs = ba.htSubs;
            }
            
        }
        if (BA.isShellModeRuntimeCheck(ba)) 
			   this.getClass().getMethod("_class_globals", keymon.lat.medicomed.c_nota.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.sql.SQL _skmt = null;
public anywheresoftware.b4a.gps.GPS _g = null;
public String _clie_id = "";
public String _sdate = "";
public String _stime = "";
public String _usuario = "";
public anywheresoftware.b4a.sql.SQL.CursorWrapper _c = null;
public String _ruta = "";
public anywheresoftware.b4a.objects.ButtonWrapper _regresar = null;
public anywheresoftware.b4a.objects.ListViewWrapper _listview1 = null;
public anywheresoftware.b4a.objects.LabelWrapper _l_cant = null;
public anywheresoftware.b4a.objects.LabelWrapper _l_total = null;
public anywheresoftware.b4a.objects.ButtonWrapper _borra = null;
public String _existe = "";
public String _result = "";
public String _desc = "";
public anywheresoftware.b4a.objects.LabelWrapper _titulo = null;
public anywheresoftware.b4a.objects.ButtonWrapper _b_desc = null;
public String _descuento = "";
public String _folio = "";
public com.rootsoft.togglelibrary.ToggleLibrary _tgl = null;
public String _almacen = "";
public anywheresoftware.b4a.objects.PanelWrapper _p_nota = null;
public 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_nota __ref,anywheresoftware.b4a.BA _ba) throws Exception{
__ref = this;
innerInitialize(_ba);
RDebugUtils.currentModule="c_nota";
if (Debug.shouldDelegate(ba, "initialize", false))
	 {return ((Object) Debug.delegate(ba, "initialize", new Object[] {_ba}));}
RDebugUtils.currentLine=9306112;
 //BA.debugLineNum = 9306112;BA.debugLine="Public Sub Initialize As Object";
RDebugUtils.currentLine=9306113;
 //BA.debugLineNum = 9306113;BA.debugLine="Return Me";
if (true) return this;
RDebugUtils.currentLine=9306114;
 //BA.debugLineNum = 9306114;BA.debugLine="End Sub";
return null;
}
public String  _activity_pause(keymon.lat.medicomed.c_nota __ref,boolean _userclosed) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_nota";
RDebugUtils.currentLine=9502720;
 //BA.debugLineNum = 9502720;BA.debugLine="Sub Activity_Pause (UserClosed As Boolean)";
RDebugUtils.currentLine=9502722;
 //BA.debugLineNum = 9502722;BA.debugLine="End Sub";
return "";
}
public String  _b_desc_click(keymon.lat.medicomed.c_nota __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_nota";
if (Debug.shouldDelegate(ba, "b_desc_click", false))
	 {return ((String) Debug.delegate(ba, "b_desc_click", null));}
RDebugUtils.currentLine=9895936;
 //BA.debugLineNum = 9895936;BA.debugLine="Sub b_desc_Click";
RDebugUtils.currentLine=9895937;
 //BA.debugLineNum = 9895937;BA.debugLine="If DESCUENTO = \"MENOS\" Then";
if ((__ref._descuento /*String*/ ).equals("MENOS")) { 
RDebugUtils.currentLine=9895938;
 //BA.debugLineNum = 9895938;BA.debugLine="DateTime.DateFormat = \"MM/dd/yyyy\"";
__c.DateTime.setDateFormat("MM/dd/yyyy");
RDebugUtils.currentLine=9895939;
 //BA.debugLineNum = 9895939;BA.debugLine="sDate=DateTime.Date(DateTime.Now)";
__ref._sdate /*String*/  = __c.DateTime.Date(__c.DateTime.getNow());
RDebugUtils.currentLine=9895940;
 //BA.debugLineNum = 9895940;BA.debugLine="sTime=DateTime.Time(DateTime.Now)";
__ref._stime /*String*/  = __c.DateTime.Time(__c.DateTime.getNow());
RDebugUtils.currentLine=9895941;
 //BA.debugLineNum = 9895941;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=9895942;
 //BA.debugLineNum = 9895942;BA.debugLine="c.Position=0";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition((int) (0));
RDebugUtils.currentLine=9895943;
 //BA.debugLineNum = 9895943;BA.debugLine="clie_id = c.GetString(\"CUENTA\")";
__ref._clie_id /*String*/  = __ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CUENTA");
RDebugUtils.currentLine=9895944;
 //BA.debugLineNum = 9895944;BA.debugLine="c.Close";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .Close();
RDebugUtils.currentLine=9895945;
 //BA.debugLineNum = 9895945;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=9895946;
 //BA.debugLineNum = 9895946;BA.debugLine="c.Position=0";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition((int) (0));
RDebugUtils.currentLine=9895947;
 //BA.debugLineNum = 9895947;BA.debugLine="usuario = c.GetString(\"USUARIO\")";
__ref._usuario /*String*/  = __ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("USUARIO");
RDebugUtils.currentLine=9895948;
 //BA.debugLineNum = 9895948;BA.debugLine="c.Close";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .Close();
RDebugUtils.currentLine=9895949;
 //BA.debugLineNum = 9895949;BA.debugLine="result =  Msgbox2(\"Seguro que desea dar descuent";
__ref._result /*String*/  = BA.NumberToString(__c.Msgbox2(BA.ObjectToCharSequence("Seguro que desea dar descuento del 5%?"),BA.ObjectToCharSequence("Dar descuento"),"Si","","No",(android.graphics.Bitmap)(__c.LoadBitmap(__c.File.getDirAssets(),"alert2.png").getObject()),ba));
RDebugUtils.currentLine=9895950;
 //BA.debugLineNum = 9895950;BA.debugLine="If result = DialogResponse.POSITIVE Then";
if ((__ref._result /*String*/ ).equals(BA.NumberToString(__c.DialogResponse.POSITIVE))) { 
RDebugUtils.currentLine=9895951;
 //BA.debugLineNum = 9895951;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"UPDATE ped";
_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("UPDATE pedido SET PE_COSTO_TOT = PE_COSTO_TOT * .95, PE_DESC = 5 WHERE PE_CLIENTE In (select cuenta from cuentaa)");
RDebugUtils.currentLine=9895952;
 //BA.debugLineNum = 9895952;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_costo_tot) as TOTAL_CLIE, SUM(PE_CANT) AS CANT_CLIE, count(*) as CUANTOS FROM PEDIDO WHERE PE_CLIENTE IN (Select CUENTA from cuentaa)")));
RDebugUtils.currentLine=9895953;
 //BA.debugLineNum = 9895953;BA.debugLine="c.Position=0";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition((int) (0));
RDebugUtils.currentLine=9895954;
 //BA.debugLineNum = 9895954;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"delete fro";
_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=9895955;
 //BA.debugLineNum = 9895955;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"insert in";
_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) 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*/ )}));
RDebugUtils.currentLine=9895956;
 //BA.debugLineNum = 9895956;BA.debugLine="c.Close";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .Close();
RDebugUtils.currentLine=9895957;
 //BA.debugLineNum = 9895957;BA.debugLine="B4XPage_Appear";
__ref._b4xpage_appear /*String*/ (null);
 };
 }else 
{RDebugUtils.currentLine=9895959;
 //BA.debugLineNum = 9895959;BA.debugLine="ELSE IF DESCUENTO = \"MAS\" Then";
if ((__ref._descuento /*String*/ ).equals("MAS")) { 
RDebugUtils.currentLine=9895960;
 //BA.debugLineNum = 9895960;BA.debugLine="DateTime.DateFormat = \"MM/dd/yyyy\"";
__c.DateTime.setDateFormat("MM/dd/yyyy");
RDebugUtils.currentLine=9895961;
 //BA.debugLineNum = 9895961;BA.debugLine="sDate=DateTime.Date(DateTime.Now)";
__ref._sdate /*String*/  = __c.DateTime.Date(__c.DateTime.getNow());
RDebugUtils.currentLine=9895962;
 //BA.debugLineNum = 9895962;BA.debugLine="sTime=DateTime.Time(DateTime.Now)";
__ref._stime /*String*/  = __c.DateTime.Time(__c.DateTime.getNow());
RDebugUtils.currentLine=9895963;
 //BA.debugLineNum = 9895963;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=9895964;
 //BA.debugLineNum = 9895964;BA.debugLine="c.Position=0";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition((int) (0));
RDebugUtils.currentLine=9895965;
 //BA.debugLineNum = 9895965;BA.debugLine="clie_id = c.GetString(\"CUENTA\")";
__ref._clie_id /*String*/  = __ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CUENTA");
RDebugUtils.currentLine=9895966;
 //BA.debugLineNum = 9895966;BA.debugLine="c.Close";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .Close();
RDebugUtils.currentLine=9895967;
 //BA.debugLineNum = 9895967;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=9895968;
 //BA.debugLineNum = 9895968;BA.debugLine="c.Position=0";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition((int) (0));
RDebugUtils.currentLine=9895969;
 //BA.debugLineNum = 9895969;BA.debugLine="usuario = c.GetString(\"USUARIO\")";
__ref._usuario /*String*/  = __ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("USUARIO");
RDebugUtils.currentLine=9895970;
 //BA.debugLineNum = 9895970;BA.debugLine="c.Close";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .Close();
RDebugUtils.currentLine=9895971;
 //BA.debugLineNum = 9895971;BA.debugLine="result =  Msgbox2(\"Seguro que desea CANCELAR el";
__ref._result /*String*/  = BA.NumberToString(__c.Msgbox2(BA.ObjectToCharSequence("Seguro que desea CANCELAR el descuento?"),BA.ObjectToCharSequence("Cancelar descuento"),"Si","","No",(android.graphics.Bitmap)(__c.LoadBitmap(__c.File.getDirAssets(),"alert2.png").getObject()),ba));
RDebugUtils.currentLine=9895972;
 //BA.debugLineNum = 9895972;BA.debugLine="If result = DialogResponse.POSITIVE Then";
if ((__ref._result /*String*/ ).equals(BA.NumberToString(__c.DialogResponse.POSITIVE))) { 
RDebugUtils.currentLine=9895973;
 //BA.debugLineNum = 9895973;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"UPDATE ped";
_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("UPDATE pedido SET PE_COSTO_TOT = PE_COSTO_TOT / .95, PE_DESC = 0 WHERE PE_CLIENTE In (select cuenta from cuentaa)");
RDebugUtils.currentLine=9895974;
 //BA.debugLineNum = 9895974;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_costo_tot) as TOTAL_CLIE, SUM(PE_CANT) AS CANT_CLIE, count(*) as CUANTOS FROM PEDIDO WHERE PE_CLIENTE IN (Select CUENTA from cuentaa)")));
RDebugUtils.currentLine=9895975;
 //BA.debugLineNum = 9895975;BA.debugLine="c.Position=0";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition((int) (0));
RDebugUtils.currentLine=9895976;
 //BA.debugLineNum = 9895976;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"delete fro";
_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=9895977;
 //BA.debugLineNum = 9895977;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"insert in";
_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) 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*/ )}));
RDebugUtils.currentLine=9895978;
 //BA.debugLineNum = 9895978;BA.debugLine="c.Close";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .Close();
RDebugUtils.currentLine=9895979;
 //BA.debugLineNum = 9895979;BA.debugLine="B4XPage_Appear";
__ref._b4xpage_appear /*String*/ (null);
 };
 }}
;
RDebugUtils.currentLine=9895982;
 //BA.debugLineNum = 9895982;BA.debugLine="End Sub";
return "";
}
public String  _b4xpage_appear(keymon.lat.medicomed.c_nota __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_nota";
if (Debug.shouldDelegate(ba, "b4xpage_appear", false))
	 {return ((String) Debug.delegate(ba, "b4xpage_appear", null));}
anywheresoftware.b4a.objects.CSBuilder _cs = null;
int _i = 0;
anywheresoftware.b4a.objects.LabelWrapper _label1 = null;
int _textcolor = 0;
anywheresoftware.b4a.objects.LabelWrapper _label2 = null;
RDebugUtils.currentLine=9437184;
 //BA.debugLineNum = 9437184;BA.debugLine="Sub B4XPage_Appear";
RDebugUtils.currentLine=9437185;
 //BA.debugLineNum = 9437185;BA.debugLine="If Not(Starter.gps.GPSEnabled) Then";
if (__c.Not(_starter._gps /*anywheresoftware.b4a.gps.GPS*/ .getGPSEnabled())) { 
RDebugUtils.currentLine=9437186;
 //BA.debugLineNum = 9437186;BA.debugLine="ToastMessageShow(\"Es necesario tener el GPS ence";
__c.ToastMessageShow(BA.ObjectToCharSequence("Es necesario tener el GPS encendido"),__c.True);
RDebugUtils.currentLine=9437187;
 //BA.debugLineNum = 9437187;BA.debugLine="StartActivity(Starter.gps.LocationSettingsIntent";
__c.StartActivity(ba,(Object)(_starter._gps /*anywheresoftware.b4a.gps.GPS*/ .getLocationSettingsIntent()));
 };
RDebugUtils.currentLine=9437189;
 //BA.debugLineNum = 9437189;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=9437190;
 //BA.debugLineNum = 9437190;BA.debugLine="C.Position =0";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition((int) (0));
RDebugUtils.currentLine=9437191;
 //BA.debugLineNum = 9437191;BA.debugLine="almacen = C.GetString(\"ID_ALMACEN\")";
__ref._almacen /*String*/  = __ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("ID_ALMACEN");
RDebugUtils.currentLine=9437192;
 //BA.debugLineNum = 9437192;BA.debugLine="C.Close";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .Close();
RDebugUtils.currentLine=9437193;
 //BA.debugLineNum = 9437193;BA.debugLine="L_CANT.Text =\"\"";
__ref._l_cant /*anywheresoftware.b4a.objects.LabelWrapper*/ .setText(BA.ObjectToCharSequence(""));
RDebugUtils.currentLine=9437194;
 //BA.debugLineNum = 9437194;BA.debugLine="L_TOTAL.Text=\"\"";
__ref._l_total /*anywheresoftware.b4a.objects.LabelWrapper*/ .setText(BA.ObjectToCharSequence(""));
RDebugUtils.currentLine=9437195;
 //BA.debugLineNum = 9437195;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 EXISTE from pedido_cliente WHERE pc_cliente IN (Select CUENTA from cuentaa)")));
RDebugUtils.currentLine=9437196;
 //BA.debugLineNum = 9437196;BA.debugLine="C.Position=0";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition((int) (0));
RDebugUtils.currentLine=9437197;
 //BA.debugLineNum = 9437197;BA.debugLine="Existe = C.GetString(\"EXISTE\")";
__ref._existe /*String*/  = __ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("EXISTE");
RDebugUtils.currentLine=9437198;
 //BA.debugLineNum = 9437198;BA.debugLine="C.Close";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .Close();
RDebugUtils.currentLine=9437199;
 //BA.debugLineNum = 9437199;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"select PE_PRO";
__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 PE_PRONOMBRE,PE_COSTO_TOT, PE_CANT, PE_FOLIO, PE_CEDIS FROM PEDIDO WHERE PE_CLIENTE IN (Select CUENTA from cuentaa) order by PE_CEDIS, PE_PRONOMBRE")));
RDebugUtils.currentLine=9437200;
 //BA.debugLineNum = 9437200;BA.debugLine="ListView1.Clear";
__ref._listview1 /*anywheresoftware.b4a.objects.ListViewWrapper*/ .Clear();
RDebugUtils.currentLine=9437201;
 //BA.debugLineNum = 9437201;BA.debugLine="Private cs As CSBuilder";
_cs = new anywheresoftware.b4a.objects.CSBuilder();
RDebugUtils.currentLine=9437202;
 //BA.debugLineNum = 9437202;BA.debugLine="If c.RowCount>0 Then";
if (__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .getRowCount()>0) { 
RDebugUtils.currentLine=9437203;
 //BA.debugLineNum = 9437203;BA.debugLine="For i=0 To c.RowCount -1";
{
final int step19 = 1;
final int limit19 = (int) (__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .getRowCount()-1);
_i = (int) (0) ;
for (;_i <= limit19 ;_i = _i + step19 ) {
RDebugUtils.currentLine=9437204;
 //BA.debugLineNum = 9437204;BA.debugLine="cs.Initialize";
_cs.Initialize();
RDebugUtils.currentLine=9437205;
 //BA.debugLineNum = 9437205;BA.debugLine="c.Position=i";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition(_i);
RDebugUtils.currentLine=9437206;
 //BA.debugLineNum = 9437206;BA.debugLine="Dim label1 As Label";
_label1 = new anywheresoftware.b4a.objects.LabelWrapper();
RDebugUtils.currentLine=9437207;
 //BA.debugLineNum = 9437207;BA.debugLine="label1 = ListView1.TwoLinesLayout.Label";
_label1 = __ref._listview1 /*anywheresoftware.b4a.objects.ListViewWrapper*/ .getTwoLinesLayout().Label;
RDebugUtils.currentLine=9437208;
 //BA.debugLineNum = 9437208;BA.debugLine="label1.TextSize = 15";
_label1.setTextSize((float) (15));
RDebugUtils.currentLine=9437209;
 //BA.debugLineNum = 9437209;BA.debugLine="label1.TextColor = Colors.Black";
_label1.setTextColor(__c.Colors.Black);
RDebugUtils.currentLine=9437210;
 //BA.debugLineNum = 9437210;BA.debugLine="label1.color = Colors.White";
_label1.setColor(__c.Colors.White);
RDebugUtils.currentLine=9437211;
 //BA.debugLineNum = 9437211;BA.debugLine="Private textColor As Int = Colors.black";
_textcolor = __c.Colors.Black;
RDebugUtils.currentLine=9437213;
 //BA.debugLineNum = 9437213;BA.debugLine="If Not(IsNumber(c.GetString(\"PE_CEDIS\"))) Then";
if (__c.Not(__c.IsNumber(__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("PE_CEDIS")))) { 
_textcolor = __c.Colors.RGB((int) (210),(int) (105),(int) (30));};
RDebugUtils.currentLine=9437214;
 //BA.debugLineNum = 9437214;BA.debugLine="Dim label2 As Label";
_label2 = new anywheresoftware.b4a.objects.LabelWrapper();
RDebugUtils.currentLine=9437215;
 //BA.debugLineNum = 9437215;BA.debugLine="label2 = ListView1.TwoLinesLayout.SecondLabel";
_label2 = __ref._listview1 /*anywheresoftware.b4a.objects.ListViewWrapper*/ .getTwoLinesLayout().SecondLabel;
RDebugUtils.currentLine=9437216;
 //BA.debugLineNum = 9437216;BA.debugLine="label2.TextSize = 10";
_label2.setTextSize((float) (10));
RDebugUtils.currentLine=9437217;
 //BA.debugLineNum = 9437217;BA.debugLine="label2.TextColor = Colors.Blue";
_label2.setTextColor(__c.Colors.Blue);
RDebugUtils.currentLine=9437218;
 //BA.debugLineNum = 9437218;BA.debugLine="ListView1.AddTwoLines(cs.Color(textColor).appen";
__ref._listview1 /*anywheresoftware.b4a.objects.ListViewWrapper*/ .AddTwoLines(BA.ObjectToCharSequence(_cs.Color(_textcolor).Append(BA.ObjectToCharSequence(__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("PE_PRONOMBRE"))).Pop().getObject()),BA.ObjectToCharSequence("Cantidad #"+__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("PE_CANT")+" SubTotal $"+__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("PE_COSTO_TOT")+" Folio "+__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("PE_FOLIO")));
RDebugUtils.currentLine=9437219;
 //BA.debugLineNum = 9437219;BA.debugLine="folio = c.GetString(\"PE_FOLIO\")";
__ref._folio /*String*/  = __ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("PE_FOLIO");
 }
};
 };
RDebugUtils.currentLine=9437222;
 //BA.debugLineNum = 9437222;BA.debugLine="If Existe <> 0 Then";
if ((__ref._existe /*String*/ ).equals(BA.NumberToString(0)) == false) { 
RDebugUtils.currentLine=9437223;
 //BA.debugLineNum = 9437223;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 PC_NOART, sum (PE_COSTO_TOT) as PC_MONTO from PEDIDO where PE_CLIENTE in (Select CUENTA from cuentaa) AND PE_PROID NOT IN (SELECT CAT_PA_ID FROM PROMOS_COMP ) ")));
RDebugUtils.currentLine=9437225;
 //BA.debugLineNum = 9437225;BA.debugLine="C.Position=0";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition((int) (0));
RDebugUtils.currentLine=9437226;
 //BA.debugLineNum = 9437226;BA.debugLine="L_CANT.Text = c.GetString(\"PC_NOART\")";
__ref._l_cant /*anywheresoftware.b4a.objects.LabelWrapper*/ .setText(BA.ObjectToCharSequence(__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("PC_NOART")));
RDebugUtils.currentLine=9437227;
 //BA.debugLineNum = 9437227;BA.debugLine="L_TOTAL.Text = c.GetString(\"PC_MONTO\")";
__ref._l_total /*anywheresoftware.b4a.objects.LabelWrapper*/ .setText(BA.ObjectToCharSequence(__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("PC_MONTO")));
RDebugUtils.currentLine=9437228;
 //BA.debugLineNum = 9437228;BA.debugLine="c.Close";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .Close();
RDebugUtils.currentLine=9437229;
 //BA.debugLineNum = 9437229;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"select SUM(I";
__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(IFNULL(PE_DESC,0)) AS DESCUENTO FROM PEDIDO WHERE PE_CLIENTE IN (Select CUENTA from cuentaa)")));
RDebugUtils.currentLine=9437230;
 //BA.debugLineNum = 9437230;BA.debugLine="c.Position=0";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition((int) (0));
RDebugUtils.currentLine=9437231;
 //BA.debugLineNum = 9437231;BA.debugLine="DESC = c.GetString(\"DESCUENTO\")";
__ref._desc /*String*/  = __ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("DESCUENTO");
RDebugUtils.currentLine=9437232;
 //BA.debugLineNum = 9437232;BA.debugLine="b_desc.Visible = False";
__ref._b_desc /*anywheresoftware.b4a.objects.ButtonWrapper*/ .setVisible(__c.False);
 };
RDebugUtils.currentLine=9437234;
 //BA.debugLineNum = 9437234;BA.debugLine="If Subs.pedidoGuardado Then borra.Enabled = False";
if (_subs._pedidoguardado /*boolean*/ (ba)) { 
__ref._borra /*anywheresoftware.b4a.objects.ButtonWrapper*/ .setEnabled(__c.False);}
else {
__ref._borra /*anywheresoftware.b4a.objects.ButtonWrapper*/ .setEnabled(__c.True);};
RDebugUtils.currentLine=9437235;
 //BA.debugLineNum = 9437235;BA.debugLine="End Sub";
return "";
}
public anywheresoftware.b4a.keywords.Common.ResumableSubWrapper  _b4xpage_closerequest(keymon.lat.medicomed.c_nota __ref) throws Exception{
RDebugUtils.currentModule="c_nota";
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_nota parent,keymon.lat.medicomed.c_nota __ref) {
this.parent = parent;
this.__ref = __ref;
this.__ref = parent;
}
keymon.lat.medicomed.c_nota __ref;
keymon.lat.medicomed.c_nota parent;

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

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

            }
        }
    }
}
public String  _b4xpage_created(keymon.lat.medicomed.c_nota __ref,anywheresoftware.b4a.objects.B4XViewWrapper _root1) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_nota";
if (Debug.shouldDelegate(ba, "b4xpage_created", false))
	 {return ((String) Debug.delegate(ba, "b4xpage_created", new Object[] {_root1}));}
RDebugUtils.currentLine=9371648;
 //BA.debugLineNum = 9371648;BA.debugLine="Private Sub B4XPage_Created (Root1 As B4XView)";
RDebugUtils.currentLine=9371649;
 //BA.debugLineNum = 9371649;BA.debugLine="Root = Root1";
__ref._root /*anywheresoftware.b4a.objects.B4XViewWrapper*/  = _root1;
RDebugUtils.currentLine=9371650;
 //BA.debugLineNum = 9371650;BA.debugLine="ruta = File.DirInternal";
__ref._ruta /*String*/  = __c.File.getDirInternal();
RDebugUtils.currentLine=9371651;
 //BA.debugLineNum = 9371651;BA.debugLine="Root.LoadLayout(\"nota\")";
__ref._root /*anywheresoftware.b4a.objects.B4XViewWrapper*/ .LoadLayout("nota",ba);
RDebugUtils.currentLine=9371652;
 //BA.debugLineNum = 9371652;BA.debugLine="borra.Visible = True";
__ref._borra /*anywheresoftware.b4a.objects.ButtonWrapper*/ .setVisible(__c.True);
RDebugUtils.currentLine=9371653;
 //BA.debugLineNum = 9371653;BA.debugLine="Titulo.Text = \"Pedido Actual\"";
__ref._titulo /*anywheresoftware.b4a.objects.LabelWrapper*/ .setText(BA.ObjectToCharSequence("Pedido Actual"));
RDebugUtils.currentLine=9371660;
 //BA.debugLineNum = 9371660;BA.debugLine="End Sub";
return "";
}
public String  _borra_click(keymon.lat.medicomed.c_nota __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_nota";
if (Debug.shouldDelegate(ba, "borra_click", false))
	 {return ((String) Debug.delegate(ba, "borra_click", null));}
int _i = 0;
RDebugUtils.currentLine=9764864;
 //BA.debugLineNum = 9764864;BA.debugLine="Sub borra_Click";
RDebugUtils.currentLine=9764865;
 //BA.debugLineNum = 9764865;BA.debugLine="If folio <> \"\" Then";
if ((__ref._folio /*String*/ ).equals("") == false) { 
RDebugUtils.currentLine=9764866;
 //BA.debugLineNum = 9764866;BA.debugLine="result =  Msgbox2(\"Seguro que desea borrar el pe";
__ref._result /*String*/  = BA.NumberToString(__c.Msgbox2(BA.ObjectToCharSequence("Seguro que desea borrar el pedido?"),BA.ObjectToCharSequence("Cancelar pedido"),"Si","","No",(android.graphics.Bitmap)(__c.LoadBitmap(__c.File.getDirAssets(),"alert2.png").getObject()),ba));
RDebugUtils.currentLine=9764867;
 //BA.debugLineNum = 9764867;BA.debugLine="If result = DialogResponse.POSITIVE Then";
if ((__ref._result /*String*/ ).equals(BA.NumberToString(__c.DialogResponse.POSITIVE))) { 
RDebugUtils.currentLine=9764868;
 //BA.debugLineNum = 9764868;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"select PE_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 PE_PROID,PE_CANT FROM PEDIDO where pe_cliente in (Select CUENTA from cuentaa) ")));
RDebugUtils.currentLine=9764869;
 //BA.debugLineNum = 9764869;BA.debugLine="If c.RowCount>0 Then";
if (__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .getRowCount()>0) { 
RDebugUtils.currentLine=9764870;
 //BA.debugLineNum = 9764870;BA.debugLine="For i=0 To c.RowCount -1";
{
final int step6 = 1;
final int limit6 = (int) (__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .getRowCount()-1);
_i = (int) (0) ;
for (;_i <= limit6 ;_i = _i + step6 ) {
RDebugUtils.currentLine=9764871;
 //BA.debugLineNum = 9764871;BA.debugLine="c.Position=i";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition(_i);
RDebugUtils.currentLine=9764872;
 //BA.debugLineNum = 9764872;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"update";
_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._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("PE_CANT")),(Object)(__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("PE_PROID"))}));
RDebugUtils.currentLine=9764873;
 //BA.debugLineNum = 9764873;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"INSERT";
_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._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("PE_PROID")),(Object)((double)(Double.parseDouble(__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("PE_CANT")))*-1)}));
 }
};
 };
RDebugUtils.currentLine=9764876;
 //BA.debugLineNum = 9764876;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"delete fro";
_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=9764877;
 //BA.debugLineNum = 9764877;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"delete fro";
_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("delete from pedido where pe_cliente in (Select CUENTA from cuentaa)");
RDebugUtils.currentLine=9764878;
 //BA.debugLineNum = 9764878;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 = 0  where CAT_CL_CODIGO In (select cuenta from cuentaa)");
RDebugUtils.currentLine=9764879;
 //BA.debugLineNum = 9764879;BA.debugLine="B4XPage_Appear";
__ref._b4xpage_appear /*String*/ (null);
 };
 }else {
RDebugUtils.currentLine=9764882;
 //BA.debugLineNum = 9764882;BA.debugLine="Msgbox(\"CLIENTE YA SE TRANSMITIO, FAVOR DE LLAMA";
__c.Msgbox(BA.ObjectToCharSequence("CLIENTE YA SE TRANSMITIO, FAVOR DE LLAMAR A SOPORTE PARA ASISTENCIA"),BA.ObjectToCharSequence("AVISO"),ba);
 };
RDebugUtils.currentLine=9764884;
 //BA.debugLineNum = 9764884;BA.debugLine="End Sub";
return "";
}
public String  _class_globals(keymon.lat.medicomed.c_nota __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_nota";
RDebugUtils.currentLine=9240576;
 //BA.debugLineNum = 9240576;BA.debugLine="Sub Class_Globals";
RDebugUtils.currentLine=9240577;
 //BA.debugLineNum = 9240577;BA.debugLine="Private Root As B4XView 'ignore";
_root = new anywheresoftware.b4a.objects.B4XViewWrapper();
RDebugUtils.currentLine=9240578;
 //BA.debugLineNum = 9240578;BA.debugLine="Private xui As XUI 'ignore";
_xui = new anywheresoftware.b4a.objects.B4XViewWrapper.XUI();
RDebugUtils.currentLine=9240580;
 //BA.debugLineNum = 9240580;BA.debugLine="Dim skmt As SQL";
_skmt = new anywheresoftware.b4a.sql.SQL();
RDebugUtils.currentLine=9240581;
 //BA.debugLineNum = 9240581;BA.debugLine="Dim g As GPS";
_g = new anywheresoftware.b4a.gps.GPS();
RDebugUtils.currentLine=9240582;
 //BA.debugLineNum = 9240582;BA.debugLine="Dim clie_id As String";
_clie_id = "";
RDebugUtils.currentLine=9240583;
 //BA.debugLineNum = 9240583;BA.debugLine="Dim sDate,sTime As String";
_sdate = "";
_stime = "";
RDebugUtils.currentLine=9240584;
 //BA.debugLineNum = 9240584;BA.debugLine="Dim usuario As String";
_usuario = "";
RDebugUtils.currentLine=9240586;
 //BA.debugLineNum = 9240586;BA.debugLine="Dim c As Cursor";
_c = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
RDebugUtils.currentLine=9240587;
 //BA.debugLineNum = 9240587;BA.debugLine="Dim ruta As String";
_ruta = "";
RDebugUtils.currentLine=9240588;
 //BA.debugLineNum = 9240588;BA.debugLine="Dim Regresar As Button";
_regresar = new anywheresoftware.b4a.objects.ButtonWrapper();
RDebugUtils.currentLine=9240590;
 //BA.debugLineNum = 9240590;BA.debugLine="Dim ListView1 As ListView";
_listview1 = new anywheresoftware.b4a.objects.ListViewWrapper();
RDebugUtils.currentLine=9240591;
 //BA.debugLineNum = 9240591;BA.debugLine="Dim L_CANT As Label";
_l_cant = new anywheresoftware.b4a.objects.LabelWrapper();
RDebugUtils.currentLine=9240592;
 //BA.debugLineNum = 9240592;BA.debugLine="Dim L_TOTAL As Label";
_l_total = new anywheresoftware.b4a.objects.LabelWrapper();
RDebugUtils.currentLine=9240593;
 //BA.debugLineNum = 9240593;BA.debugLine="Dim borra As Button";
_borra = new anywheresoftware.b4a.objects.ButtonWrapper();
RDebugUtils.currentLine=9240594;
 //BA.debugLineNum = 9240594;BA.debugLine="Dim Existe As String";
_existe = "";
RDebugUtils.currentLine=9240595;
 //BA.debugLineNum = 9240595;BA.debugLine="Dim result As String";
_result = "";
RDebugUtils.currentLine=9240597;
 //BA.debugLineNum = 9240597;BA.debugLine="Dim DESC As String";
_desc = "";
RDebugUtils.currentLine=9240599;
 //BA.debugLineNum = 9240599;BA.debugLine="Private Titulo As Label";
_titulo = new anywheresoftware.b4a.objects.LabelWrapper();
RDebugUtils.currentLine=9240600;
 //BA.debugLineNum = 9240600;BA.debugLine="Private b_desc As Button";
_b_desc = new anywheresoftware.b4a.objects.ButtonWrapper();
RDebugUtils.currentLine=9240601;
 //BA.debugLineNum = 9240601;BA.debugLine="Dim DESCUENTO As String";
_descuento = "";
RDebugUtils.currentLine=9240602;
 //BA.debugLineNum = 9240602;BA.debugLine="Dim folio As String";
_folio = "";
RDebugUtils.currentLine=9240603;
 //BA.debugLineNum = 9240603;BA.debugLine="Dim tgl As Toggle";
_tgl = new com.rootsoft.togglelibrary.ToggleLibrary();
RDebugUtils.currentLine=9240604;
 //BA.debugLineNum = 9240604;BA.debugLine="Private almacen As String";
_almacen = "";
RDebugUtils.currentLine=9240605;
 //BA.debugLineNum = 9240605;BA.debugLine="Private p_nota As Panel";
_p_nota = new anywheresoftware.b4a.objects.PanelWrapper();
RDebugUtils.currentLine=9240606;
 //BA.debugLineNum = 9240606;BA.debugLine="End Sub";
return "";
}
public String  _gps_locationchanged(keymon.lat.medicomed.c_nota __ref,anywheresoftware.b4a.gps.LocationWrapper _location1) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_nota";
if (Debug.shouldDelegate(ba, "gps_locationchanged", false))
	 {return ((String) Debug.delegate(ba, "gps_locationchanged", new Object[] {_location1}));}
RDebugUtils.currentLine=9568256;
 //BA.debugLineNum = 9568256;BA.debugLine="Sub GPS_LocationChanged (Location1 As Location)";
RDebugUtils.currentLine=9568259;
 //BA.debugLineNum = 9568259;BA.debugLine="End Sub";
return "";
}
public String  _listview1_itemlongclick(keymon.lat.medicomed.c_nota __ref,int _position,Object _value) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_nota";
if (Debug.shouldDelegate(ba, "listview1_itemlongclick", false))
	 {return ((String) Debug.delegate(ba, "listview1_itemlongclick", new Object[] {_position,_value}));}
RDebugUtils.currentLine=9830400;
 //BA.debugLineNum = 9830400;BA.debugLine="Sub ListView1_ItemLongClick (Position As Int, Valu";
RDebugUtils.currentLine=9830401;
 //BA.debugLineNum = 9830401;BA.debugLine="result =  Msgbox2(\"Seguro que desea borrar este a";
__ref._result /*String*/  = BA.NumberToString(__c.Msgbox2(BA.ObjectToCharSequence("Seguro que desea borrar este articulo?"),BA.ObjectToCharSequence("Borrar Articulo"),"Si","","No",(android.graphics.Bitmap)(__c.LoadBitmap(__c.File.getDirAssets(),"alert2.png").getObject()),ba));
RDebugUtils.currentLine=9830402;
 //BA.debugLineNum = 9830402;BA.debugLine="If result = DialogResponse.POSITIVE Then";
if ((__ref._result /*String*/ ).equals(BA.NumberToString(__c.DialogResponse.POSITIVE))) { 
RDebugUtils.currentLine=9830403;
 //BA.debugLineNum = 9830403;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery2(\"select PE_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*/ .ExecQuery2("select PE_PROID,PE_CANT FROM PEDIDO where pe_pronombre = ? and pe_cliente in (Select CUENTA from cuentaa) ",new String[]{BA.ObjectToString(_value)})));
RDebugUtils.currentLine=9830404;
 //BA.debugLineNum = 9830404;BA.debugLine="c.Position=0";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition((int) (0));
RDebugUtils.currentLine=9830405;
 //BA.debugLineNum = 9830405;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._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("PE_CANT")),(Object)(__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("PE_PROID"))}));
RDebugUtils.currentLine=9830406;
 //BA.debugLineNum = 9830406;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._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("PE_PROID")),(Object)((double)(Double.parseDouble(__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("PE_CANT")))*-1)}));
RDebugUtils.currentLine=9830407;
 //BA.debugLineNum = 9830407;BA.debugLine="c.Close";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .Close();
RDebugUtils.currentLine=9830408;
 //BA.debugLineNum = 9830408;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery2(\"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*/ .ExecQuery2("select count(*) AS CUANTOS from cat_gunaprod where  CAT_GP_ID in (select pe_cedis from pedido where pe_pronombre = ? and pe_cliente in (Select CUENTA from cuentaa)) and CAT_GP_CLASIF = 'PROMOS' AND CAT_GP_TIPO = 'PROMOS' AND CAT_GP_SUBTIPO = 'PROMOS'",new String[]{BA.ObjectToString(_value)})));
RDebugUtils.currentLine=9830409;
 //BA.debugLineNum = 9830409;BA.debugLine="c.Position=0";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition((int) (0));
RDebugUtils.currentLine=9830410;
 //BA.debugLineNum = 9830410;BA.debugLine="If c.GetString(\"CUANTOS\") > 0 Then";
if ((double)(Double.parseDouble(__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CUANTOS")))>0) { 
RDebugUtils.currentLine=9830411;
 //BA.debugLineNum = 9830411;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"delete fr";
_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("delete from pedido where  pe_cedis in (select pe_cedis from pedido where pe_pronombre = ?) and pe_cliente in (Select CUENTA from cuentaa)",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{_value}));
 }else {
RDebugUtils.currentLine=9830413;
 //BA.debugLineNum = 9830413;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"delete fr";
_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("delete from pedido where  pe_pronombre = ?  and pe_cliente in (Select CUENTA from cuentaa)",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{_value}));
 };
RDebugUtils.currentLine=9830415;
 //BA.debugLineNum = 9830415;BA.debugLine="DateTime.DateFormat = \"MM/dd/yyyy\"";
__c.DateTime.setDateFormat("MM/dd/yyyy");
RDebugUtils.currentLine=9830416;
 //BA.debugLineNum = 9830416;BA.debugLine="sDate=DateTime.Date(DateTime.Now)";
__ref._sdate /*String*/  = __c.DateTime.Date(__c.DateTime.getNow());
RDebugUtils.currentLine=9830417;
 //BA.debugLineNum = 9830417;BA.debugLine="sTime=DateTime.Time(DateTime.Now)";
__ref._stime /*String*/  = __c.DateTime.Time(__c.DateTime.getNow());
RDebugUtils.currentLine=9830418;
 //BA.debugLineNum = 9830418;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=9830419;
 //BA.debugLineNum = 9830419;BA.debugLine="c.Position=0";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition((int) (0));
RDebugUtils.currentLine=9830420;
 //BA.debugLineNum = 9830420;BA.debugLine="clie_id = c.GetString(\"CUENTA\")";
__ref._clie_id /*String*/  = __ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CUENTA");
RDebugUtils.currentLine=9830421;
 //BA.debugLineNum = 9830421;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=9830422;
 //BA.debugLineNum = 9830422;BA.debugLine="c.Position=0";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition((int) (0));
RDebugUtils.currentLine=9830423;
 //BA.debugLineNum = 9830423;BA.debugLine="usuario = c.GetString(\"USUARIO\")";
__ref._usuario /*String*/  = __ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("USUARIO");
RDebugUtils.currentLine=9830424;
 //BA.debugLineNum = 9830424;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, count(*) as CUANTOS FROM PEDIDO WHERE PE_CLIENTE IN (Select CUENTA from cuentaa)")));
RDebugUtils.currentLine=9830425;
 //BA.debugLineNum = 9830425;BA.debugLine="c.Position=0";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition((int) (0));
RDebugUtils.currentLine=9830426;
 //BA.debugLineNum = 9830426;BA.debugLine="If c.GetString(\"CUANTOS\") > 0 Then";
if ((double)(Double.parseDouble(__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CUANTOS")))>0) { 
RDebugUtils.currentLine=9830427;
 //BA.debugLineNum = 9830427;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"delete fro";
_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=9830428;
 //BA.debugLineNum = 9830428;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"insert in";
_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) 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*/ )}));
RDebugUtils.currentLine=9830429;
 //BA.debugLineNum = 9830429;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 = 0  where CAT_CL_CODIGO In (select cuenta from cuentaa)");
 }else {
RDebugUtils.currentLine=9830431;
 //BA.debugLineNum = 9830431;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"delete fro";
_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=9830432;
 //BA.debugLineNum = 9830432;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 = 0  where CAT_CL_CODIGO In (select cuenta from cuentaa)");
 };
RDebugUtils.currentLine=9830434;
 //BA.debugLineNum = 9830434;BA.debugLine="B4XPage_Appear";
__ref._b4xpage_appear /*String*/ (null);
 };
RDebugUtils.currentLine=9830436;
 //BA.debugLineNum = 9830436;BA.debugLine="End Sub";
return "";
}
public String  _p_nota_click(keymon.lat.medicomed.c_nota __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_nota";
if (Debug.shouldDelegate(ba, "p_nota_click", false))
	 {return ((String) Debug.delegate(ba, "p_nota_click", null));}
RDebugUtils.currentLine=9961472;
 //BA.debugLineNum = 9961472;BA.debugLine="Private Sub p_nota_Click";
RDebugUtils.currentLine=9961474;
 //BA.debugLineNum = 9961474;BA.debugLine="End Sub";
return "";
}
public String  _regresar_click(keymon.lat.medicomed.c_nota __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_nota";
if (Debug.shouldDelegate(ba, "regresar_click", false))
	 {return ((String) Debug.delegate(ba, "regresar_click", null));}
RDebugUtils.currentLine=9633792;
 //BA.debugLineNum = 9633792;BA.debugLine="Sub Regresar_Click";
RDebugUtils.currentLine=9633793;
 //BA.debugLineNum = 9633793;BA.debugLine="B4XPages.ShowPage(\"Cliente\")";
_b4xpages._showpage /*String*/ (ba,"Cliente");
RDebugUtils.currentLine=9633794;
 //BA.debugLineNum = 9633794;BA.debugLine="End Sub";
return "";
}
}