package keymon.lat.medicomed;


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

public class c_noventa 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_noventa");
            if (htSubs == null) {
                ba.loadHtSubs(this.getClass());
                htSubs = ba.htSubs;
            }
            
        }
        if (BA.isShellModeRuntimeCheck(ba)) 
			   this.getClass().getMethod("_class_globals", keymon.lat.medicomed.c_noventa.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.sql.SQL.CursorWrapper _c = null;
public anywheresoftware.b4a.objects.ButtonWrapper _cancela = null;
public anywheresoftware.b4a.objects.ButtonWrapper _guarda = null;
public anywheresoftware.b4a.objects.CompoundButtonWrapper.RadioButtonWrapper _r_1 = null;
public anywheresoftware.b4a.objects.CompoundButtonWrapper.RadioButtonWrapper _r_2 = null;
public anywheresoftware.b4a.objects.CompoundButtonWrapper.RadioButtonWrapper _r_3 = null;
public anywheresoftware.b4a.objects.EditTextWrapper _e_comm = null;
public String _motivo = "";
public String _cuenta = "";
public String _usuario = "";
public String _sdate = "";
public String _stime = "";
public com.rootsoft.togglelibrary.ToggleLibrary _tgl = null;
public anywheresoftware.b4a.objects.CompoundButtonWrapper.RadioButtonWrapper _r_4 = null;
public String _stay_hh = "";
public String _stay_mi = "";
public String _stay_ss = "";
public keymon.lat.medicomed.dbrequestmanager _reqmanager = 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_noventa __ref,anywheresoftware.b4a.BA _ba) throws Exception{
__ref = this;
innerInitialize(_ba);
RDebugUtils.currentModule="c_noventa";
if (Debug.shouldDelegate(ba, "initialize", false))
	 {return ((Object) Debug.delegate(ba, "initialize", new Object[] {_ba}));}
RDebugUtils.currentLine=10092544;
 //BA.debugLineNum = 10092544;BA.debugLine="Public Sub Initialize As Object";
RDebugUtils.currentLine=10092545;
 //BA.debugLineNum = 10092545;BA.debugLine="Return Me";
if (true) return this;
RDebugUtils.currentLine=10092546;
 //BA.debugLineNum = 10092546;BA.debugLine="End Sub";
return null;
}
public String  _b4xpage_appear(keymon.lat.medicomed.c_noventa __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_noventa";
if (Debug.shouldDelegate(ba, "b4xpage_appear", false))
	 {return ((String) Debug.delegate(ba, "b4xpage_appear", null));}
RDebugUtils.currentLine=10223616;
 //BA.debugLineNum = 10223616;BA.debugLine="Sub B4XPage_Appear";
RDebugUtils.currentLine=10223617;
 //BA.debugLineNum = 10223617;BA.debugLine="e_comm.Text=\"\"";
__ref._e_comm /*anywheresoftware.b4a.objects.EditTextWrapper*/ .setText(BA.ObjectToCharSequence(""));
RDebugUtils.currentLine=10223618;
 //BA.debugLineNum = 10223618;BA.debugLine="tgl.Initialize";
__ref._tgl /*com.rootsoft.togglelibrary.ToggleLibrary*/ .Initialize(ba);
RDebugUtils.currentLine=10223619;
 //BA.debugLineNum = 10223619;BA.debugLine="If Not(Starter.gps.GPSEnabled) Then";
if (__c.Not(_starter._gps /*anywheresoftware.b4a.gps.GPS*/ .getGPSEnabled())) { 
RDebugUtils.currentLine=10223620;
 //BA.debugLineNum = 10223620;BA.debugLine="ToastMessageShow(\"Es necesario tener el GPS ence";
__c.ToastMessageShow(BA.ObjectToCharSequence("Es necesario tener el GPS encendido"),__c.True);
RDebugUtils.currentLine=10223621;
 //BA.debugLineNum = 10223621;BA.debugLine="StartActivity(Starter.gps.LocationSettingsIntent";
__c.StartActivity(ba,(Object)(_starter._gps /*anywheresoftware.b4a.gps.GPS*/ .getLocationSettingsIntent()));
 };
RDebugUtils.currentLine=10223623;
 //BA.debugLineNum = 10223623;BA.debugLine="End Sub";
return "";
}
public String  _b4xpage_created(keymon.lat.medicomed.c_noventa __ref,anywheresoftware.b4a.objects.B4XViewWrapper _root1) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_noventa";
if (Debug.shouldDelegate(ba, "b4xpage_created", false))
	 {return ((String) Debug.delegate(ba, "b4xpage_created", new Object[] {_root1}));}
RDebugUtils.currentLine=10158080;
 //BA.debugLineNum = 10158080;BA.debugLine="Private Sub B4XPage_Created (Root1 As B4XView)";
RDebugUtils.currentLine=10158081;
 //BA.debugLineNum = 10158081;BA.debugLine="Root = Root1";
__ref._root /*anywheresoftware.b4a.objects.B4XViewWrapper*/  = _root1;
RDebugUtils.currentLine=10158083;
 //BA.debugLineNum = 10158083;BA.debugLine="Root.LoadLayout(\"noventa\")";
__ref._root /*anywheresoftware.b4a.objects.B4XViewWrapper*/ .LoadLayout("noventa",ba);
RDebugUtils.currentLine=10158084;
 //BA.debugLineNum = 10158084;BA.debugLine="ruta = File.DirInternal";
__ref._ruta /*String*/  = __c.File.getDirInternal();
RDebugUtils.currentLine=10158086;
 //BA.debugLineNum = 10158086;BA.debugLine="If File.Exists(ruta, \"kmt.db\") = False Then";
if (__c.File.Exists(__ref._ruta /*String*/ ,"kmt.db")==__c.False) { 
RDebugUtils.currentLine=10158087;
 //BA.debugLineNum = 10158087;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=10158090;
 //BA.debugLineNum = 10158090;BA.debugLine="reqManager.Initialize(Me, B4XPages.MainPage.SERVE";
__ref._reqmanager /*keymon.lat.medicomed.dbrequestmanager*/ ._initialize /*String*/ (null,ba,this,_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._server /*String*/ );
RDebugUtils.currentLine=10158091;
 //BA.debugLineNum = 10158091;BA.debugLine="End Sub";
return "";
}
public String  _cancela_click(keymon.lat.medicomed.c_noventa __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_noventa";
if (Debug.shouldDelegate(ba, "cancela_click", false))
	 {return ((String) Debug.delegate(ba, "cancela_click", null));}
RDebugUtils.currentLine=10354688;
 //BA.debugLineNum = 10354688;BA.debugLine="Sub CANCELA_Click";
RDebugUtils.currentLine=10354689;
 //BA.debugLineNum = 10354689;BA.debugLine="B4XPages.ShowPage(\"Cliente\")";
_b4xpages._showpage /*String*/ (ba,"Cliente");
RDebugUtils.currentLine=10354690;
 //BA.debugLineNum = 10354690;BA.debugLine="End Sub";
return "";
}
public String  _class_globals(keymon.lat.medicomed.c_noventa __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_noventa";
RDebugUtils.currentLine=10027008;
 //BA.debugLineNum = 10027008;BA.debugLine="Sub Class_Globals";
RDebugUtils.currentLine=10027009;
 //BA.debugLineNum = 10027009;BA.debugLine="Private Root As B4XView 'ignore";
_root = new anywheresoftware.b4a.objects.B4XViewWrapper();
RDebugUtils.currentLine=10027010;
 //BA.debugLineNum = 10027010;BA.debugLine="Private xui As XUI 'ignore";
_xui = new anywheresoftware.b4a.objects.B4XViewWrapper.XUI();
RDebugUtils.currentLine=10027012;
 //BA.debugLineNum = 10027012;BA.debugLine="Dim g As GPS";
_g = new anywheresoftware.b4a.gps.GPS();
RDebugUtils.currentLine=10027013;
 //BA.debugLineNum = 10027013;BA.debugLine="Dim ruta As String";
_ruta = "";
RDebugUtils.currentLine=10027014;
 //BA.debugLineNum = 10027014;BA.debugLine="Dim skmt As SQL";
_skmt = new anywheresoftware.b4a.sql.SQL();
RDebugUtils.currentLine=10027015;
 //BA.debugLineNum = 10027015;BA.debugLine="Dim c As Cursor";
_c = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
RDebugUtils.currentLine=10027017;
 //BA.debugLineNum = 10027017;BA.debugLine="Dim CANCELA As Button";
_cancela = new anywheresoftware.b4a.objects.ButtonWrapper();
RDebugUtils.currentLine=10027018;
 //BA.debugLineNum = 10027018;BA.debugLine="Dim GUARDA As Button";
_guarda = new anywheresoftware.b4a.objects.ButtonWrapper();
RDebugUtils.currentLine=10027019;
 //BA.debugLineNum = 10027019;BA.debugLine="Dim r_1 As RadioButton";
_r_1 = new anywheresoftware.b4a.objects.CompoundButtonWrapper.RadioButtonWrapper();
RDebugUtils.currentLine=10027020;
 //BA.debugLineNum = 10027020;BA.debugLine="Dim r_2 As RadioButton";
_r_2 = new anywheresoftware.b4a.objects.CompoundButtonWrapper.RadioButtonWrapper();
RDebugUtils.currentLine=10027021;
 //BA.debugLineNum = 10027021;BA.debugLine="Dim r_3 As RadioButton";
_r_3 = new anywheresoftware.b4a.objects.CompoundButtonWrapper.RadioButtonWrapper();
RDebugUtils.currentLine=10027022;
 //BA.debugLineNum = 10027022;BA.debugLine="Dim e_comm As EditText";
_e_comm = new anywheresoftware.b4a.objects.EditTextWrapper();
RDebugUtils.currentLine=10027023;
 //BA.debugLineNum = 10027023;BA.debugLine="Dim motivo As String";
_motivo = "";
RDebugUtils.currentLine=10027024;
 //BA.debugLineNum = 10027024;BA.debugLine="Dim cuenta As String";
_cuenta = "";
RDebugUtils.currentLine=10027025;
 //BA.debugLineNum = 10027025;BA.debugLine="Dim usuario As String";
_usuario = "";
RDebugUtils.currentLine=10027026;
 //BA.debugLineNum = 10027026;BA.debugLine="Dim sDate,sTime As String";
_sdate = "";
_stime = "";
RDebugUtils.currentLine=10027028;
 //BA.debugLineNum = 10027028;BA.debugLine="Dim tgl As Toggle";
_tgl = new com.rootsoft.togglelibrary.ToggleLibrary();
RDebugUtils.currentLine=10027029;
 //BA.debugLineNum = 10027029;BA.debugLine="Dim r_4 As RadioButton";
_r_4 = new anywheresoftware.b4a.objects.CompoundButtonWrapper.RadioButtonWrapper();
RDebugUtils.currentLine=10027031;
 //BA.debugLineNum = 10027031;BA.debugLine="Private stay_hh As String";
_stay_hh = "";
RDebugUtils.currentLine=10027032;
 //BA.debugLineNum = 10027032;BA.debugLine="Private stay_mi As String";
_stay_mi = "";
RDebugUtils.currentLine=10027033;
 //BA.debugLineNum = 10027033;BA.debugLine="Private stay_ss As String";
_stay_ss = "";
RDebugUtils.currentLine=10027034;
 //BA.debugLineNum = 10027034;BA.debugLine="Dim reqManager As DBRequestManager";
_reqmanager = new keymon.lat.medicomed.dbrequestmanager();
RDebugUtils.currentLine=10027035;
 //BA.debugLineNum = 10027035;BA.debugLine="End Sub";
return "";
}
public String  _gps_locationchanged(keymon.lat.medicomed.c_noventa __ref,anywheresoftware.b4a.gps.LocationWrapper _location1) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_noventa";
if (Debug.shouldDelegate(ba, "gps_locationchanged", false))
	 {return ((String) Debug.delegate(ba, "gps_locationchanged", new Object[] {_location1}));}
RDebugUtils.currentLine=10289152;
 //BA.debugLineNum = 10289152;BA.debugLine="Sub GPS_LocationChanged (Location1 As Location)";
RDebugUtils.currentLine=10289155;
 //BA.debugLineNum = 10289155;BA.debugLine="End Sub";
return "";
}
public String  _guarda_click(keymon.lat.medicomed.c_noventa __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_noventa";
if (Debug.shouldDelegate(ba, "guarda_click", false))
	 {return ((String) Debug.delegate(ba, "guarda_click", null));}
int _i = 0;
RDebugUtils.currentLine=10420224;
 //BA.debugLineNum = 10420224;BA.debugLine="Sub GUARDA_Click";
RDebugUtils.currentLine=10420225;
 //BA.debugLineNum = 10420225;BA.debugLine="If r_1.Checked Then";
if (__ref._r_1 /*anywheresoftware.b4a.objects.CompoundButtonWrapper.RadioButtonWrapper*/ .getChecked()) { 
RDebugUtils.currentLine=10420226;
 //BA.debugLineNum = 10420226;BA.debugLine="motivo = \"CERRADO\"";
__ref._motivo /*String*/  = "CERRADO";
 }else 
{RDebugUtils.currentLine=10420227;
 //BA.debugLineNum = 10420227;BA.debugLine="Else If r_2.Checked Then";
if (__ref._r_2 /*anywheresoftware.b4a.objects.CompoundButtonWrapper.RadioButtonWrapper*/ .getChecked()) { 
RDebugUtils.currentLine=10420228;
 //BA.debugLineNum = 10420228;BA.debugLine="motivo = \"NO COMPRA\"";
__ref._motivo /*String*/  = "NO COMPRA";
 }else 
{RDebugUtils.currentLine=10420229;
 //BA.debugLineNum = 10420229;BA.debugLine="Else If r_3.Checked Then";
if (__ref._r_3 /*anywheresoftware.b4a.objects.CompoundButtonWrapper.RadioButtonWrapper*/ .getChecked()) { 
RDebugUtils.currentLine=10420230;
 //BA.debugLineNum = 10420230;BA.debugLine="motivo = \"CON PRODUCTO\"";
__ref._motivo /*String*/  = "CON PRODUCTO";
 }else 
{RDebugUtils.currentLine=10420231;
 //BA.debugLineNum = 10420231;BA.debugLine="Else If r_4.Checked Then";
if (__ref._r_4 /*anywheresoftware.b4a.objects.CompoundButtonWrapper.RadioButtonWrapper*/ .getChecked()) { 
RDebugUtils.currentLine=10420232;
 //BA.debugLineNum = 10420232;BA.debugLine="motivo = \"NO ESTA EL ENCARGADO\"";
__ref._motivo /*String*/  = "NO ESTA EL ENCARGADO";
 }else {
RDebugUtils.currentLine=10420234;
 //BA.debugLineNum = 10420234;BA.debugLine="motivo = \"Cerrado permanente.\"";
__ref._motivo /*String*/  = "Cerrado permanente.";
 }}}}
;
RDebugUtils.currentLine=10420237;
 //BA.debugLineNum = 10420237;BA.debugLine="DateTime.DateFormat = \"MM/dd/yyyy\"";
__c.DateTime.setDateFormat("MM/dd/yyyy");
RDebugUtils.currentLine=10420238;
 //BA.debugLineNum = 10420238;BA.debugLine="sDate=DateTime.Date(DateTime.Now)";
__ref._sdate /*String*/  = __c.DateTime.Date(__c.DateTime.getNow());
RDebugUtils.currentLine=10420239;
 //BA.debugLineNum = 10420239;BA.debugLine="sTime=DateTime.Time(DateTime.Now)";
__ref._stime /*String*/  = __c.DateTime.Time(__c.DateTime.getNow());
RDebugUtils.currentLine=10420240;
 //BA.debugLineNum = 10420240;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"select CUENTA";
__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=10420241;
 //BA.debugLineNum = 10420241;BA.debugLine="c.Position = 0";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition((int) (0));
RDebugUtils.currentLine=10420242;
 //BA.debugLineNum = 10420242;BA.debugLine="cuenta = c.GetString(\"CUENTA\")";
__ref._cuenta /*String*/  = __ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CUENTA");
RDebugUtils.currentLine=10420243;
 //BA.debugLineNum = 10420243;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"select usuari";
__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=10420244;
 //BA.debugLineNum = 10420244;BA.debugLine="c.Position = 0";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition((int) (0));
RDebugUtils.currentLine=10420245;
 //BA.debugLineNum = 10420245;BA.debugLine="usuario = c.GetString(\"USUARIO\")";
__ref._usuario /*String*/  = __ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("USUARIO");
RDebugUtils.currentLine=10420246;
 //BA.debugLineNum = 10420246;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_PROID,PE_CANT FROM PEDIDO where pe_cliente in (Select CUENTA from cuentaa) ")));
RDebugUtils.currentLine=10420247;
 //BA.debugLineNum = 10420247;BA.debugLine="If c.RowCount>0 Then";
if (__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .getRowCount()>0) { 
RDebugUtils.currentLine=10420248;
 //BA.debugLineNum = 10420248;BA.debugLine="For i=0 To c.RowCount -1";
{
final int step23 = 1;
final int limit23 = (int) (__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .getRowCount()-1);
_i = (int) (0) ;
for (;_i <= limit23 ;_i = _i + step23 ) {
RDebugUtils.currentLine=10420249;
 //BA.debugLineNum = 10420249;BA.debugLine="c.Position=i";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition(_i);
RDebugUtils.currentLine=10420250;
 //BA.debugLineNum = 10420250;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"update ca";
_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=10420254;
 //BA.debugLineNum = 10420254;BA.debugLine="If B4XPages.MainPage.cliente.IsInitialized Then";
if (_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._cliente /*keymon.lat.medicomed.c_cliente*/ .IsInitialized /*boolean*/ ()) { 
RDebugUtils.currentLine=10420255;
 //BA.debugLineNum = 10420255;BA.debugLine="B4XPages.MainPage.cliente.motivoNoVenta = motivo";
_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._cliente /*keymon.lat.medicomed.c_cliente*/ ._motivonoventa /*String*/  = __ref._motivo /*String*/ ;
RDebugUtils.currentLine=10420256;
 //BA.debugLineNum = 10420256;BA.debugLine="Subs.bitacora(Subs.fechanormal(DateTime.Now), us";
_subs._bitacora /*String*/ (ba,_subs._fechanormal /*String*/ (ba,BA.NumberToString(__c.DateTime.getNow())),__ref._usuario /*String*/ ,_subs._traealmacen /*String*/ (ba),_subs._traeruta /*String*/ (ba),"No Venta",_subs._traecliente /*String*/ (ba),"",_subs._fechanormal /*String*/ (ba,BA.NumberToString(__c.DateTime.getNow())),_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._lat_gps /*String*/ ,_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._lon_gps /*String*/ ,BA.NumberToString(_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._cliente /*keymon.lat.medicomed.c_cliente*/ ._precision /*int*/ ),__ref._motivo /*String*/ ,__ref._e_comm /*anywheresoftware.b4a.objects.EditTextWrapper*/ .getText());
RDebugUtils.currentLine=10420257;
 //BA.debugLineNum = 10420257;BA.debugLine="Starter.enVenta = False";
_starter._enventa /*boolean*/  = __c.False;
 };
RDebugUtils.currentLine=10420260;
 //BA.debugLineNum = 10420260;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=10420261;
 //BA.debugLineNum = 10420261;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"delete from";
_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=10420263;
 //BA.debugLineNum = 10420263;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"INSERT INTO";
_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("INSERT INTO  NOVENTA (NV_CLIENTE,NV_FECHA,NV_USER,NV_MOTIVO,NV_COMM,NV_LAT,NV_LON,NV_ENVIO) VALUES(?,?,?,?,?,?,?,0) ",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(__ref._cuenta /*String*/ ),(Object)(__ref._sdate /*String*/ +__ref._stime /*String*/ ),(Object)(__ref._usuario /*String*/ ),(Object)(__ref._motivo /*String*/ ),(Object)(__ref._e_comm /*anywheresoftware.b4a.objects.EditTextWrapper*/ .getText()),(Object)(_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._lat_gps /*String*/ ),(Object)(_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._lon_gps /*String*/ )}));
RDebugUtils.currentLine=10420264;
 //BA.debugLineNum = 10420264;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"UPDATE kmt_i";
_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("UPDATE kmt_info set gestion = 3  where CAT_CL_CODIGO In (select cuenta from cuentaa)");
RDebugUtils.currentLine=10420265;
 //BA.debugLineNum = 10420265;BA.debugLine="DateTime.TimeFormat = \"HHmmss\"";
__c.DateTime.setTimeFormat("HHmmss");
RDebugUtils.currentLine=10420266;
 //BA.debugLineNum = 10420266;BA.debugLine="sTime=DateTime.Time(DateTime.Now)";
__ref._stime /*String*/  = __c.DateTime.Time(__c.DateTime.getNow());
RDebugUtils.currentLine=10420267;
 //BA.debugLineNum = 10420267;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"UPDATE HIST";
_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("UPDATE HIST_STAY_STORE set HSS_OUT = ?  where HSS_CODIGO In (select cuenta from cuentaa)",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(__ref._stime /*String*/ )}));
RDebugUtils.currentLine=10420270;
 //BA.debugLineNum = 10420270;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\" Select (subs";
__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 (substr(HSS_OUT,1,2) - substr(HSS_IN,1,2)) - Case when  (substr(HSS_OUT,3,2) - substr(HSS_IN,3,2)) < 0 Then 1 Else 0 end HORAS_TOTALES, "+"Case when  (substr(HSS_OUT,3,2) - substr(HSS_IN,3,2)) < 0 Then (substr(HSS_OUT,3,2) + 60 - substr(HSS_IN,3,2)) "+"	Else (substr(HSS_OUT,3,2) - substr(HSS_IN,3,2)) End - Case when  (substr(HSS_OUT,5,2) - substr(HSS_IN,5,2)) < 0 Then 1 Else 0 end  MINUTOS_TOTALES, "+"Case when  (substr(HSS_OUT,5,2) - substr(HSS_IN,5,2)) < 0 Then (substr(HSS_OUT,5,2) + 60 - substr(HSS_IN,5,2)) "+"	Else (substr(HSS_OUT,5,2) - substr(HSS_IN,5,2)) end SEGUNDOS_TOTALES "+"	from HIST_STAY_STORE where HSS_CODIGO In (Select cuenta from cuentaa) ")));
RDebugUtils.currentLine=10420276;
 //BA.debugLineNum = 10420276;BA.debugLine="c.Position = 0";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition((int) (0));
RDebugUtils.currentLine=10420277;
 //BA.debugLineNum = 10420277;BA.debugLine="stay_hh = c.GetString(\"HORAS_TOTALES\") * 60 * 60";
__ref._stay_hh /*String*/  = BA.NumberToString((double)(Double.parseDouble(__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("HORAS_TOTALES")))*60*60);
RDebugUtils.currentLine=10420278;
 //BA.debugLineNum = 10420278;BA.debugLine="stay_mi = c.GetString(\"MINUTOS_TOTALES\") * 60";
__ref._stay_mi /*String*/  = BA.NumberToString((double)(Double.parseDouble(__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("MINUTOS_TOTALES")))*60);
RDebugUtils.currentLine=10420279;
 //BA.debugLineNum = 10420279;BA.debugLine="stay_ss = c.GetString(\"SEGUNDOS_TOTALES\")";
__ref._stay_ss /*String*/  = __ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("SEGUNDOS_TOTALES");
RDebugUtils.currentLine=10420281;
 //BA.debugLineNum = 10420281;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"UPDATE HIST";
_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("UPDATE HIST_STAY_STORE set HSS_TOT = ?  where HSS_CODIGO In (select cuenta from cuentaa)",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)((double)(Double.parseDouble(__ref._stay_hh /*String*/ ))+(double)(Double.parseDouble(__ref._stay_mi /*String*/ ))+(double)(Double.parseDouble(__ref._stay_ss /*String*/ )))}));
RDebugUtils.currentLine=10420282;
 //BA.debugLineNum = 10420282;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"UPDATE HIST";
_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("UPDATE HIST_STAY_OUT set HSO_FIN = ?  ",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(__ref._stime /*String*/ )}));
RDebugUtils.currentLine=10420283;
 //BA.debugLineNum = 10420283;BA.debugLine="DateTime.TimeFormat = \"HH:mm:ss\"";
__c.DateTime.setTimeFormat("HH:mm:ss");
RDebugUtils.currentLine=10420285;
 //BA.debugLineNum = 10420285;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"update PEDI";
_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("update PEDIDO_INICIO_FINAL set PIF_HORA_FINAL = ? where PIF_CLIENTE = ? and PIF_HORA_FINAL = 0",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(__c.DateTime.getNow()),(Object)(__ref._cuenta /*String*/ )}));
RDebugUtils.currentLine=10420286;
 //BA.debugLineNum = 10420286;BA.debugLine="LogColor($\"actualizamos \"${cuenta},  hora_final=$";
__c.LogImpl("310420286",("actualizamos \""+__c.SmartStringFormatter("",(Object)(__ref._cuenta /*String*/ ))+",  hora_final="+__c.SmartStringFormatter("",(Object)(__c.DateTime.getNow()))+""),__c.Colors.Red);
RDebugUtils.currentLine=10420288;
 //BA.debugLineNum = 10420288;BA.debugLine="Subs.bitacora(Subs.fechanormal(DateTime.Now), usu";
_subs._bitacora /*String*/ (ba,_subs._fechanormal /*String*/ (ba,BA.NumberToString(__c.DateTime.getNow())),__ref._usuario /*String*/ ,_subs._traealmacen /*String*/ (ba),_subs._traeruta /*String*/ (ba),"NO VENTA",_subs._traecliente /*String*/ (ba),_subs._fechanormal /*String*/ (ba,BA.NumberToString(__c.DateTime.getNow())),_subs._fechanormal /*String*/ (ba,BA.NumberToString(__c.DateTime.getNow())),_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._lat_gps /*String*/ ,_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._lon_gps /*String*/ ,BA.NumberToString(2),"",BA.ObjectToString(__ref._r_1 /*anywheresoftware.b4a.objects.CompoundButtonWrapper.RadioButtonWrapper*/ .getChecked()));
RDebugUtils.currentLine=10420290;
 //BA.debugLineNum = 10420290;BA.debugLine="mandaPendientesnoventa";
__ref._mandapendientesnoventa /*String*/ (null);
RDebugUtils.currentLine=10420291;
 //BA.debugLineNum = 10420291;BA.debugLine="B4XPages.ShowPage(\"Principal\")";
_b4xpages._showpage /*String*/ (ba,"Principal");
RDebugUtils.currentLine=10420292;
 //BA.debugLineNum = 10420292;BA.debugLine="End Sub";
return "";
}
public String  _mandapendientesnoventa(keymon.lat.medicomed.c_noventa __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_noventa";
if (Debug.shouldDelegate(ba, "mandapendientesnoventa", false))
	 {return ((String) Debug.delegate(ba, "mandapendientesnoventa", null));}
int _i = 0;
keymon.lat.medicomed.dbrequestmanager._dbcommand _cmd = null;
RDebugUtils.currentLine=10485760;
 //BA.debugLineNum = 10485760;BA.debugLine="Sub mandaPendientesnoventa";
RDebugUtils.currentLine=10485761;
 //BA.debugLineNum = 10485761;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"SELECT  NV_CL";
__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  NV_CLIENTE,NV_FECHA,NV_USER,NV_MOTIVO,NV_COMM,NV_LAT,NV_LON, NV_NOMBRE, NV_DIRECCION FROM NOVENTA where NV_ENVIO <> 1")));
RDebugUtils.currentLine=10485762;
 //BA.debugLineNum = 10485762;BA.debugLine="Log($\"NOVENYA_Cliente PENDIENTE: ${c.RowCount}\"$)";
__c.LogImpl("310485762",("NOVENYA_Cliente PENDIENTE: "+__c.SmartStringFormatter("",(Object)(__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .getRowCount()))+""),0);
RDebugUtils.currentLine=10485763;
 //BA.debugLineNum = 10485763;BA.debugLine="If c.RowCount>0 Then";
if (__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .getRowCount()>0) { 
RDebugUtils.currentLine=10485764;
 //BA.debugLineNum = 10485764;BA.debugLine="For i=0 To c.RowCount -1";
{
final int step4 = 1;
final int limit4 = (int) (__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .getRowCount()-1);
_i = (int) (0) ;
for (;_i <= limit4 ;_i = _i + step4 ) {
RDebugUtils.currentLine=10485765;
 //BA.debugLineNum = 10485765;BA.debugLine="c.Position=i";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition(_i);
RDebugUtils.currentLine=10485766;
 //BA.debugLineNum = 10485766;BA.debugLine="Log(c.GetString(\"NV_MOTIVO\"))";
__c.LogImpl("310485766",__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("NV_MOTIVO"),0);
RDebugUtils.currentLine=10485767;
 //BA.debugLineNum = 10485767;BA.debugLine="If c.GetString(\"NV_MOTIVO\") = \"Cerrado permanen";
if ((__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("NV_MOTIVO")).equals("Cerrado permanente.")) { 
RDebugUtils.currentLine=10485768;
 //BA.debugLineNum = 10485768;BA.debugLine="Dim cmd As DBCommand";
_cmd = new keymon.lat.medicomed.dbrequestmanager._dbcommand();
RDebugUtils.currentLine=10485769;
 //BA.debugLineNum = 10485769;BA.debugLine="cmd.Initialize";
_cmd.Initialize();
RDebugUtils.currentLine=10485770;
 //BA.debugLineNum = 10485770;BA.debugLine="cmd.Name = \"insert_clientescerrados_MEDI\"";
_cmd.Name /*String*/  = "insert_clientescerrados_MEDI";
RDebugUtils.currentLine=10485771;
 //BA.debugLineNum = 10485771;BA.debugLine="cmd.Parameters = Array As Object(c.GetString(\"";
_cmd.Parameters /*Object[]*/  = new Object[]{(Object)(__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("NV_CLIENTE")),(Object)(__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("NV_FECHA")),(Object)(__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("NV_USER")),(Object)("CERRADO PERMANENTE"),(Object)(__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("NV_LAT")),(Object)(__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("NV_LON")),(Object)(__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("NV_NOMBRE")),(Object)(__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("NV_DIRECCION")),(Object)(_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._principal /*keymon.lat.medicomed.c_principal*/ ._almacen /*String*/ ),(Object)(_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._principal /*keymon.lat.medicomed.c_principal*/ ._l_ruta /*anywheresoftware.b4a.objects.LabelWrapper*/ .getText())};
RDebugUtils.currentLine=10485772;
 //BA.debugLineNum = 10485772;BA.debugLine="reqManager.ExecuteCommand(cmd , $\"ins_NOVENTAc";
__ref._reqmanager /*keymon.lat.medicomed.dbrequestmanager*/ ._executecommand /*String*/ (null,_cmd,(Object)(("ins_NOVENTAcerradoper_head_"+__c.SmartStringFormatter("",(Object)(__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("NV_CLIENTE")))+"")));
RDebugUtils.currentLine=10485774;
 //BA.debugLineNum = 10485774;BA.debugLine="Dim cmd As DBCommand";
_cmd = new keymon.lat.medicomed.dbrequestmanager._dbcommand();
RDebugUtils.currentLine=10485775;
 //BA.debugLineNum = 10485775;BA.debugLine="cmd.Initialize";
_cmd.Initialize();
RDebugUtils.currentLine=10485776;
 //BA.debugLineNum = 10485776;BA.debugLine="cmd.Name = \"insert_noventa_MEDI\"";
_cmd.Name /*String*/  = "insert_noventa_MEDI";
RDebugUtils.currentLine=10485777;
 //BA.debugLineNum = 10485777;BA.debugLine="cmd.Parameters = Array As Object(c.GetString(\"";
_cmd.Parameters /*Object[]*/  = new Object[]{(Object)(__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("NV_CLIENTE")),(Object)(__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("NV_FECHA")),(Object)(__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("NV_USER")),(Object)(__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("NV_MOTIVO")),(Object)(__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("NV_COMM")),(Object)(__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("NV_LAT")),(Object)(__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("NV_LON")),(Object)(_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._principal /*keymon.lat.medicomed.c_principal*/ ._almacen /*String*/ ),(Object)(_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._principal /*keymon.lat.medicomed.c_principal*/ ._l_ruta /*anywheresoftware.b4a.objects.LabelWrapper*/ .getText()),(Object)(__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("NV_NOMBRE")),(Object)(__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("NV_DIRECCION"))};
RDebugUtils.currentLine=10485778;
 //BA.debugLineNum = 10485778;BA.debugLine="reqManager.ExecuteCommand(cmd , $\"ins_NOVENTAP";
__ref._reqmanager /*keymon.lat.medicomed.dbrequestmanager*/ ._executecommand /*String*/ (null,_cmd,(Object)(("ins_NOVENTAPendientes_head_"+__c.SmartStringFormatter("",(Object)(__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("NV_CLIENTE")))+"")));
 }else {
RDebugUtils.currentLine=10485780;
 //BA.debugLineNum = 10485780;BA.debugLine="Dim cmd As DBCommand";
_cmd = new keymon.lat.medicomed.dbrequestmanager._dbcommand();
RDebugUtils.currentLine=10485781;
 //BA.debugLineNum = 10485781;BA.debugLine="cmd.Initialize";
_cmd.Initialize();
RDebugUtils.currentLine=10485782;
 //BA.debugLineNum = 10485782;BA.debugLine="cmd.Name = \"insert_noventa_MEDI\"";
_cmd.Name /*String*/  = "insert_noventa_MEDI";
RDebugUtils.currentLine=10485783;
 //BA.debugLineNum = 10485783;BA.debugLine="cmd.Parameters = Array As Object(c.GetString(\"";
_cmd.Parameters /*Object[]*/  = new Object[]{(Object)(__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("NV_CLIENTE")),(Object)(__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("NV_FECHA")),(Object)(__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("NV_USER")),(Object)(__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("NV_MOTIVO")),(Object)(__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("NV_COMM")),(Object)(__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("NV_LAT")),(Object)(__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("NV_LON")),(Object)(_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._principal /*keymon.lat.medicomed.c_principal*/ ._almacen /*String*/ ),(Object)(_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._principal /*keymon.lat.medicomed.c_principal*/ ._l_ruta /*anywheresoftware.b4a.objects.LabelWrapper*/ .getText()),(Object)(__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("NV_NOMBRE")),(Object)(__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("NV_DIRECCION"))};
RDebugUtils.currentLine=10485784;
 //BA.debugLineNum = 10485784;BA.debugLine="reqManager.ExecuteCommand(cmd , $\"ins_NOVENTAP";
__ref._reqmanager /*keymon.lat.medicomed.dbrequestmanager*/ ._executecommand /*String*/ (null,_cmd,(Object)(("ins_NOVENTAPendientes_head_"+__c.SmartStringFormatter("",(Object)(__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("NV_CLIENTE")))+"")));
 };
 }
};
 };
RDebugUtils.currentLine=10485788;
 //BA.debugLineNum = 10485788;BA.debugLine="c.Close";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .Close();
RDebugUtils.currentLine=10485789;
 //BA.debugLineNum = 10485789;BA.debugLine="End Sub";
return "";
}
public String  _jobdone(keymon.lat.medicomed.c_noventa __ref,keymon.lat.medicomed.httpjob _job) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_noventa";
if (Debug.shouldDelegate(ba, "jobdone", false))
	 {return ((String) Debug.delegate(ba, "jobdone", new Object[] {_job}));}
keymon.lat.medicomed.dbrequestmanager._dbresult _resultado = null;
String _cliente = "";
Object[] _records = null;
String _k = "";
RDebugUtils.currentLine=10551296;
 //BA.debugLineNum = 10551296;BA.debugLine="Sub JobDone(Job As HttpJob)";
RDebugUtils.currentLine=10551297;
 //BA.debugLineNum = 10551297;BA.debugLine="Log(Job.Success)";
__c.LogImpl("310551297",BA.ObjectToString(_job._success /*boolean*/ ),0);
RDebugUtils.currentLine=10551298;
 //BA.debugLineNum = 10551298;BA.debugLine="If Job.Success = False Then";
if (_job._success /*boolean*/ ==__c.False) { 
 }else {
RDebugUtils.currentLine=10551301;
 //BA.debugLineNum = 10551301;BA.debugLine="LogColor(\"JobDone: '\" & reqManager.HandleJob(Job";
__c.LogImpl("310551301","JobDone: '"+BA.ObjectToString(__ref._reqmanager /*keymon.lat.medicomed.dbrequestmanager*/ ._handlejob /*keymon.lat.medicomed.dbrequestmanager._dbresult*/ (null,_job).Tag /*Object*/ )+"' - Registros: "+BA.NumberToString(__ref._reqmanager /*keymon.lat.medicomed.dbrequestmanager*/ ._handlejob /*keymon.lat.medicomed.dbrequestmanager._dbresult*/ (null,_job).Rows /*anywheresoftware.b4a.objects.collections.List*/ .getSize()),__c.Colors.Green);
RDebugUtils.currentLine=10551302;
 //BA.debugLineNum = 10551302;BA.debugLine="If Job.JobName = \"DBRequest\" Then";
if ((_job._jobname /*String*/ ).equals("DBRequest")) { 
RDebugUtils.currentLine=10551303;
 //BA.debugLineNum = 10551303;BA.debugLine="Dim resultado As DBResult = reqManager.HandleJo";
_resultado = __ref._reqmanager /*keymon.lat.medicomed.dbrequestmanager*/ ._handlejob /*keymon.lat.medicomed.dbrequestmanager._dbresult*/ (null,_job);
RDebugUtils.currentLine=10551304;
 //BA.debugLineNum = 10551304;BA.debugLine="If resultado.Tag.As(String).IndexOf(\"ins_NOVENT";
if ((BA.ObjectToString(_resultado.Tag /*Object*/ )).indexOf("ins_NOVENTAPendientes_head_")>-1) { 
RDebugUtils.currentLine=10551305;
 //BA.debugLineNum = 10551305;BA.debugLine="Private cliente As String= resultado.Tag";
_cliente = BA.ObjectToString(_resultado.Tag /*Object*/ );
RDebugUtils.currentLine=10551306;
 //BA.debugLineNum = 10551306;BA.debugLine="cliente = cliente.SubString(cliente.IndexOf(\"_";
_cliente = _cliente.substring((int) (_cliente.indexOf("_")+24));
RDebugUtils.currentLine=10551307;
 //BA.debugLineNum = 10551307;BA.debugLine="Log($\"Cliente1:${cliente}\"$)";
__c.LogImpl("310551307",("Cliente1:"+__c.SmartStringFormatter("",(Object)(_cliente))+""),0);
RDebugUtils.currentLine=10551308;
 //BA.debugLineNum = 10551308;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"update N";
_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("update NOVENTA SET NV_ENVIO = ? WHERE NV_CLIENTE = ? AND NV_ENVIO <> 1",anywheresoftware.b4a.keywords.Common.ArrayToList(new String[]{"1",_cliente}));
RDebugUtils.currentLine=10551309;
 //BA.debugLineNum = 10551309;BA.debugLine="For Each records() As Object In resultado.Rows";
{
final anywheresoftware.b4a.BA.IterableList group12 = _resultado.Rows /*anywheresoftware.b4a.objects.collections.List*/ ;
final int groupLen12 = group12.getSize()
;int index12 = 0;
;
for (; index12 < groupLen12;index12++){
_records = (Object[])(group12.Get(index12));
RDebugUtils.currentLine=10551310;
 //BA.debugLineNum = 10551310;BA.debugLine="For Each k As String In resultado.Columns.Key";
{
final anywheresoftware.b4a.BA.IterableList group13 = _resultado.Columns /*anywheresoftware.b4a.objects.collections.Map*/ .Keys();
final int groupLen13 = group13.getSize()
;int index13 = 0;
;
for (; index13 < groupLen13;index13++){
_k = BA.ObjectToString(group13.Get(index13));
RDebugUtils.currentLine=10551311;
 //BA.debugLineNum = 10551311;BA.debugLine="Log(resultado.Tag & \": \" & k & \": \" & record";
__c.LogImpl("310551311",BA.ObjectToString(_resultado.Tag /*Object*/ )+": "+_k+": "+BA.ObjectToString(_records[(int)(BA.ObjectToNumber(_resultado.Columns /*anywheresoftware.b4a.objects.collections.Map*/ .Get((Object)(_k))))]),0);
 }
};
 }
};
 };
 };
RDebugUtils.currentLine=10551319;
 //BA.debugLineNum = 10551319;BA.debugLine="If Job.JobName = \"DBRequest\" Then";
if ((_job._jobname /*String*/ ).equals("DBRequest")) { 
RDebugUtils.currentLine=10551320;
 //BA.debugLineNum = 10551320;BA.debugLine="Dim resultado As DBResult = reqManager.HandleJo";
_resultado = __ref._reqmanager /*keymon.lat.medicomed.dbrequestmanager*/ ._handlejob /*keymon.lat.medicomed.dbrequestmanager._dbresult*/ (null,_job);
RDebugUtils.currentLine=10551321;
 //BA.debugLineNum = 10551321;BA.debugLine="If resultado.Tag.As(String).IndexOf(\"ins_NOVENT";
if ((BA.ObjectToString(_resultado.Tag /*Object*/ )).indexOf("ins_NOVENTAcerradoper_head_")>-1) { 
RDebugUtils.currentLine=10551322;
 //BA.debugLineNum = 10551322;BA.debugLine="Private cliente As String= resultado.Tag";
_cliente = BA.ObjectToString(_resultado.Tag /*Object*/ );
RDebugUtils.currentLine=10551323;
 //BA.debugLineNum = 10551323;BA.debugLine="cliente = cliente.SubString(cliente.IndexOf(\"_";
_cliente = _cliente.substring((int) (_cliente.indexOf("_")+24));
RDebugUtils.currentLine=10551324;
 //BA.debugLineNum = 10551324;BA.debugLine="Log($\"Cliente1:${cliente}\"$)";
__c.LogImpl("310551324",("Cliente1:"+__c.SmartStringFormatter("",(Object)(_cliente))+""),0);
RDebugUtils.currentLine=10551325;
 //BA.debugLineNum = 10551325;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"update N";
_b4xpages._mainpage /*keymon.lat.medicomed.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("update NOVENTA SET NV_ENVIO = ? WHERE NV_CLIENTE = ? AND NV_ENVIO <> 1",anywheresoftware.b4a.keywords.Common.ArrayToList(new String[]{"1",_cliente}));
RDebugUtils.currentLine=10551326;
 //BA.debugLineNum = 10551326;BA.debugLine="For Each records() As Object In resultado.Rows";
{
final anywheresoftware.b4a.BA.IterableList group26 = _resultado.Rows /*anywheresoftware.b4a.objects.collections.List*/ ;
final int groupLen26 = group26.getSize()
;int index26 = 0;
;
for (; index26 < groupLen26;index26++){
_records = (Object[])(group26.Get(index26));
RDebugUtils.currentLine=10551327;
 //BA.debugLineNum = 10551327;BA.debugLine="For Each k As String In resultado.Columns.Key";
{
final anywheresoftware.b4a.BA.IterableList group27 = _resultado.Columns /*anywheresoftware.b4a.objects.collections.Map*/ .Keys();
final int groupLen27 = group27.getSize()
;int index27 = 0;
;
for (; index27 < groupLen27;index27++){
_k = BA.ObjectToString(group27.Get(index27));
RDebugUtils.currentLine=10551328;
 //BA.debugLineNum = 10551328;BA.debugLine="Log(resultado.Tag & \": \" & k & \": \" & record";
__c.LogImpl("310551328",BA.ObjectToString(_resultado.Tag /*Object*/ )+": "+_k+": "+BA.ObjectToString(_records[(int)(BA.ObjectToNumber(_resultado.Columns /*anywheresoftware.b4a.objects.collections.Map*/ .Get((Object)(_k))))]),0);
 }
};
 }
};
 };
 };
RDebugUtils.currentLine=10551333;
 //BA.debugLineNum = 10551333;BA.debugLine="Job.Release";
_job._release /*String*/ (null);
 };
RDebugUtils.currentLine=10551336;
 //BA.debugLineNum = 10551336;BA.debugLine="End Sub";
return "";
}
}