package medicomed.keymon.com.mx;


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

public class c_productos extends B4AClass.ImplB4AClass implements BA.SubDelegator{
    private static java.util.HashMap<String, java.lang.reflect.Method> htSubs;
    private void innerInitialize(BA _ba) throws Exception {
        if (ba == null) {
            ba = new BA(_ba, this, htSubs, "medicomed.keymon.com.mx.c_productos");
            if (htSubs == null) {
                ba.loadHtSubs(this.getClass());
                htSubs = ba.htSubs;
            }
            
        }
        if (BA.isShellModeRuntimeCheck(ba)) 
			   this.getClass().getMethod("_class_globals", medicomed.keymon.com.mx.c_productos.class).invoke(this, new Object[] {null});
        else
            ba.raiseEvent2(null, true, "class_globals", false);
    }

 public anywheresoftware.b4a.keywords.Common __c = null;
public anywheresoftware.b4a.objects.B4XViewWrapper _root = null;
public anywheresoftware.b4a.objects.B4XViewWrapper.XUI _xui = null;
public String _ruta = "";
public String _q_buscar = "";
public boolean _forzarbusqueda = false;
public anywheresoftware.b4a.sql.SQL _skmt = null;
public anywheresoftware.b4a.sql.SQL.CursorWrapper _c = null;
public anywheresoftware.b4a.sql.SQL.CursorWrapper _c2 = null;
public anywheresoftware.b4a.sql.SQL.CursorWrapper _c3 = null;
public anywheresoftware.b4a.sql.SQL.CursorWrapper _s = null;
public anywheresoftware.b4a.objects.ListViewWrapper _lv_catalogos = null;
public anywheresoftware.b4a.objects.ListViewWrapper _lv_promos = null;
public String _entro = "";
public anywheresoftware.b4a.objects.ButtonWrapper _gest = null;
public anywheresoftware.b4a.objects.LabelWrapper _lfila = null;
public String _marca = "";
public String _tipo = "";
public String _subtipo = "";
public anywheresoftware.b4a.objects.EditTextWrapper _busca = null;
public String _ya_entro = "";
public String _tiene_promos = "";
public String _res = "";
public anywheresoftware.b4a.sql.SQL.CursorWrapper _s1 = null;
public anywheresoftware.b4a.objects.drawable.CanvasWrapper.BitmapWrapper _bmp = null;
public String _ciclo = "";
public anywheresoftware.b4a.objects.ButtonWrapper _b_qr = null;
public anywheresoftware.b4a.objects.PanelWrapper _p_productos = null;
public b4a.example3.customlistview _clv_productos = null;
public anywheresoftware.b4a.objects.ImageViewWrapper _imageview1 = null;
public anywheresoftware.b4a.objects.PanelWrapper _panel3 = null;
public anywheresoftware.b4a.objects.PanelWrapper _p_prods = null;
public anywheresoftware.b4a.objects.ImageViewWrapper _i_prod = null;
public anywheresoftware.b4a.objects.LabelWrapper _l_prodx = null;
public anywheresoftware.b4a.objects.ButtonWrapper _b_prodmas = null;
public anywheresoftware.b4a.objects.LabelWrapper _l_pcant = null;
public anywheresoftware.b4a.objects.EditTextWrapper _et_pcant = null;
public anywheresoftware.b4a.objects.ButtonWrapper _b_prodmenos = null;
public anywheresoftware.b4a.objects.ButtonWrapper _b_terminar1 = null;
public anywheresoftware.b4a.objects.ButtonWrapper _b_continuar = null;
public anywheresoftware.b4a.objects.LabelWrapper _l_total = null;
public anywheresoftware.b4a.objects.LabelWrapper _l_totprods = null;
public int _totalprods = 0;
public float _totalcompra = 0f;
public boolean _etcanthasfocus = false;
public anywheresoftware.b4a.objects.collections.Map _prodsmap = null;
public anywheresoftware.b4a.objects.LabelWrapper _l_cargando = null;
public anywheresoftware.b4a.objects.LabelWrapper _l_info = null;
public anywheresoftware.b4a.objects.ButtonWrapper _b_buscar = null;
public anywheresoftware.b4a.objects.PanelWrapper _p_botonesventa = null;
public anywheresoftware.b4a.objects.ListViewWrapper _lv_tipo = null;
public anywheresoftware.b4a.objects.ListViewWrapper _lv_subtipo = null;
public anywheresoftware.b4a.objects.PanelWrapper _p_vistapreviatrans = null;
public anywheresoftware.b4a.objects.ListViewWrapper _lv_prodspedido = null;
public anywheresoftware.b4a.objects.ButtonWrapper _b_rechazar = null;
public anywheresoftware.b4a.objects.ButtonWrapper _b_aceptar = null;
public anywheresoftware.b4a.objects.PanelWrapper _p_vistaprevia = null;
public String _folio = "";
public String _result = "";
public anywheresoftware.b4a.objects.LabelWrapper _l_cant = null;
public anywheresoftware.b4a.objects.LabelWrapper _l_total2 = null;
public String _prodspedidoactual = "";
public String _montopedidoactual = "";
public b4a.example3.customlistview _clv_prods_ll = null;
public medicomed.keymon.com.mx.preoptimizedclv _pclv = null;
public anywheresoftware.b4a.objects.collections.List _listaprods = null;
public anywheresoftware.b4a.objects.collections.Map _pedidomap = null;
public anywheresoftware.b4a.objects.PanelWrapper _p_botmasmen = null;
public boolean _reiniciarlistaprods = false;
public anywheresoftware.b4a.objects.collections.List _listatiempos = null;
public String _clienteid = "";
public String _rutausuario = "";
public boolean _haypedido = false;
public anywheresoftware.b4a.objects.collections.List _listahints = null;
public anywheresoftware.b4a.sql.SQL.CursorWrapper _r = null;
public anywheresoftware.b4a.objects.collections.List _vamoaver = null;
public anywheresoftware.b4a.sql.SQL.CursorWrapper _j3 = null;
public int _invtotal = 0;
public anywheresoftware.b4a.objects.EditTextWrapper _et_pcantc = null;
public anywheresoftware.b4a.objects.ButtonWrapper _b_prodmenosc = null;
public anywheresoftware.b4a.objects.ButtonWrapper _b_prodmasc = null;
public int _totalcajasmaspiezas = 0;
public int _cajas = 0;
public int _piezas = 0;
public anywheresoftware.b4a.objects.PanelWrapper _p_botmasmenc = null;
public b4a.example.dateutils _dateutils = null;
public medicomed.keymon.com.mx.main _main = null;
public medicomed.keymon.com.mx.starter _starter = null;
public medicomed.keymon.com.mx.appupdater _appupdater = null;
public medicomed.keymon.com.mx.mapa_rutas _mapa_rutas = null;
public medicomed.keymon.com.mx.mapa_cliente _mapa_cliente = null;
public medicomed.keymon.com.mx.subs _subs = null;
public medicomed.keymon.com.mx.notificationservice _notificationservice = null;
public medicomed.keymon.com.mx.pendientes _pendientes = null;
public medicomed.keymon.com.mx.tracker _tracker = null;
public medicomed.keymon.com.mx.newinst2 _newinst2 = null;
public medicomed.keymon.com.mx.b4xpages _b4xpages = null;
public medicomed.keymon.com.mx.b4xcollections _b4xcollections = null;
public medicomed.keymon.com.mx.httputils2service _httputils2service = null;
public medicomed.keymon.com.mx.xuiviewsutils _xuiviewsutils = null;
public String  _b_aceptar_click() throws Exception{
 //BA.debugLineNum = 1008;BA.debugLine="Private Sub b_aceptar_Click";
 //BA.debugLineNum = 1009;BA.debugLine="p_vistaPreviaTrans.Visible=False";
_p_vistapreviatrans.setVisible(__c.False);
 //BA.debugLineNum = 1010;BA.debugLine="B4XPages.ShowPage(\"Cliente\")";
_b4xpages._showpage /*String*/ (ba,"Cliente");
 //BA.debugLineNum = 1011;BA.debugLine="End Sub";
return "";
}
public String  _b_continuar_click() throws Exception{
anywheresoftware.b4a.objects.collections.Map _m = null;
 //BA.debugLineNum = 895;BA.debugLine="Private Sub b_continuar_Click";
 //BA.debugLineNum = 896;BA.debugLine="Log(\"b_continuar_Click\")";
__c.LogImpl("749610753","b_continuar_Click",0);
 //BA.debugLineNum = 897;BA.debugLine="cuentaProds";
_cuentaprods();
 //BA.debugLineNum = 899;BA.debugLine="Log($\"prodsMap=${prodsMap}\"$)";
__c.LogImpl("749610756",("prodsMap="+__c.SmartStringFormatter("",(Object)(_prodsmap.getObject()))+""),0);
 //BA.debugLineNum = 906;BA.debugLine="Log(\"promos-inv, prods-inv, cat-vis\")";
__c.LogImpl("749610763","promos-inv, prods-inv, cat-vis",0);
 //BA.debugLineNum = 907;BA.debugLine="lv_promos.Visible = False";
_lv_promos.setVisible(__c.False);
 //BA.debugLineNum = 908;BA.debugLine="clv_prods_ll.AsView.Visible = False";
_clv_prods_ll._asview().setVisible(__c.False);
 //BA.debugLineNum = 909;BA.debugLine="lv_subtipo.Visible = False";
_lv_subtipo.setVisible(__c.False);
 //BA.debugLineNum = 910;BA.debugLine="lv_tipo.Visible = False";
_lv_tipo.setVisible(__c.False);
 //BA.debugLineNum = 911;BA.debugLine="lv_catalogos.Visible = True";
_lv_catalogos.setVisible(__c.True);
 //BA.debugLineNum = 912;BA.debugLine="Log(\"Continuar\")";
__c.LogImpl("749610769","Continuar",0);
 //BA.debugLineNum = 913;BA.debugLine="Dim m As Map = Subs.traeTotalesClienteActual";
_m = new anywheresoftware.b4a.objects.collections.Map();
_m = _subs._traetotalesclienteactual /*anywheresoftware.b4a.objects.collections.Map*/ (ba);
 //BA.debugLineNum = 914;BA.debugLine="prodsPedidoActual = m.Get(\"productos\")";
_prodspedidoactual = BA.ObjectToString(_m.Get((Object)("productos")));
 //BA.debugLineNum = 915;BA.debugLine="montoPedidoActual = m.Get(\"monto\")";
_montopedidoactual = BA.ObjectToString(_m.Get((Object)("monto")));
 //BA.debugLineNum = 916;BA.debugLine="End Sub";
return "";
}
public String  _b_prodmas_click() throws Exception{
int _index = 0;
anywheresoftware.b4a.objects.B4XViewWrapper _pnl0 = null;
anywheresoftware.b4a.objects.B4XViewWrapper _pnl = null;
anywheresoftware.b4a.objects.B4XViewWrapper _lacant = null;
anywheresoftware.b4a.objects.B4XViewWrapper _panelcajas = null;
anywheresoftware.b4a.objects.B4XViewWrapper _panelpiezas = null;
anywheresoftware.b4a.objects.B4XViewWrapper _lacant2 = null;
anywheresoftware.b4a.objects.B4XViewWrapper _lprodx = null;
String _precio = "";
String _inv = "";
String _existencias = "";
String _id = "";
int _sumaminima = 0;
int _inventariodisponible = 0;
String _nombrex = "";
anywheresoftware.b4a.objects.CSBuilder _cs = null;
anywheresoftware.b4a.sql.SQL.CursorWrapper _o = null;
String _invactualizado = "";
int _maxcajas = 0;
 //BA.debugLineNum = 625;BA.debugLine="Sub b_prodMas_Click";
 //BA.debugLineNum = 626;BA.debugLine="totalcajasmaspiezas = 0";
_totalcajasmaspiezas = (int) (0);
 //BA.debugLineNum = 627;BA.debugLine="etCantHasFocus = False";
_etcanthasfocus = __c.False;
 //BA.debugLineNum = 628;BA.debugLine="Root.RequestFocus";
_root.RequestFocus();
 //BA.debugLineNum = 629;BA.debugLine="Dim index As Int = clv_prods_ll.GetItemFromView(S";
_index = _clv_prods_ll._getitemfromview((anywheresoftware.b4a.objects.B4XViewWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.B4XViewWrapper(), (java.lang.Object)(__c.Sender(ba))));
 //BA.debugLineNum = 630;BA.debugLine="Dim pnl0 As B4XView = clv_prods_ll.GetPanel(index";
_pnl0 = new anywheresoftware.b4a.objects.B4XViewWrapper();
_pnl0 = _clv_prods_ll._getpanel(_index);
 //BA.debugLineNum = 631;BA.debugLine="Dim pnl As B4XView = pnl0.GetView(0)";
_pnl = new anywheresoftware.b4a.objects.B4XViewWrapper();
_pnl = _pnl0.GetView((int) (0));
 //BA.debugLineNum = 632;BA.debugLine="Dim laCant As B4XView = pnl.GetView(2).GetView(2)";
_lacant = new anywheresoftware.b4a.objects.B4XViewWrapper();
_lacant = _pnl.GetView((int) (2)).GetView((int) (2));
 //BA.debugLineNum = 633;BA.debugLine="Dim panelcajas As B4XView = pnl.GetView(3)";
_panelcajas = new anywheresoftware.b4a.objects.B4XViewWrapper();
_panelcajas = _pnl.GetView((int) (3));
 //BA.debugLineNum = 634;BA.debugLine="Dim panelpiezas As B4XView = pnl.GetView(2)";
_panelpiezas = new anywheresoftware.b4a.objects.B4XViewWrapper();
_panelpiezas = _pnl.GetView((int) (2));
 //BA.debugLineNum = 635;BA.debugLine="Dim laCant2 As B4XView = pnl.GetView(3).GetView(2";
_lacant2 = new anywheresoftware.b4a.objects.B4XViewWrapper();
_lacant2 = _pnl.GetView((int) (3)).GetView((int) (2));
 //BA.debugLineNum = 636;BA.debugLine="Dim lProdX As B4XView = pnl.GetView(1)";
_lprodx = new anywheresoftware.b4a.objects.B4XViewWrapper();
_lprodx = _pnl.GetView((int) (1));
 //BA.debugLineNum = 638;BA.debugLine="Private precio As String = clv_prods_ll.GetValue(";
_precio = BA.ObjectToString(((anywheresoftware.b4a.objects.collections.Map) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.collections.Map(), (java.util.Map)(_clv_prods_ll._getvalue(_index)))).Get((Object)("precio")));
 //BA.debugLineNum = 639;BA.debugLine="Private inv As String = clv_prods_ll.GetValue(ind";
_inv = BA.ObjectToString(((anywheresoftware.b4a.objects.collections.Map) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.collections.Map(), (java.util.Map)(_clv_prods_ll._getvalue(_index)))).Get((Object)("almacen")));
 //BA.debugLineNum = 640;BA.debugLine="Private existencias As String = clv_prods_ll.GetV";
_existencias = BA.ObjectToString(((anywheresoftware.b4a.objects.collections.Map) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.collections.Map(), (java.util.Map)(_clv_prods_ll._getvalue(_index)))).Get((Object)("almacen")));
 //BA.debugLineNum = 641;BA.debugLine="Log($\"Existencias: ${existencias}\"$)";
__c.LogImpl("749283088",("Existencias: "+__c.SmartStringFormatter("",(Object)(_existencias))+""),0);
 //BA.debugLineNum = 642;BA.debugLine="If laCant.Text = \"\" Then laCant.Text = \"0\" ' Inic";
if ((_lacant.getText()).equals("")) { 
_lacant.setText(BA.ObjectToCharSequence("0"));};
 //BA.debugLineNum = 643;BA.debugLine="Private id As String = clv_prods_ll.GetValue(inde";
_id = BA.ObjectToString(((anywheresoftware.b4a.objects.collections.Map) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.collections.Map(), (java.util.Map)(_clv_prods_ll._getvalue(_index)))).Get((Object)("id")));
 //BA.debugLineNum = 645;BA.debugLine="Dim sumaMinima As Int = Subs.traeMinimo(id)";
_sumaminima = (int)(Double.parseDouble(_subs._traeminimo /*String*/ (ba,_id)));
 //BA.debugLineNum = 646;BA.debugLine="Dim inventarioDisponible As Int = Subs.traeinvent";
_inventariodisponible = (int)(Double.parseDouble(_subs._traeinventario /*String*/ (ba,_id)));
 //BA.debugLineNum = 649;BA.debugLine="If inventarioDisponible > 0 And sumaMinima <= inv";
if (_inventariodisponible>0 && _sumaminima<=_inventariodisponible) { 
 //BA.debugLineNum = 650;BA.debugLine="clv_prods_ll.GetValue(index).As(Map).Put(\"almace";
((anywheresoftware.b4a.objects.collections.Map) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.collections.Map(), (java.util.Map)(_clv_prods_ll._getvalue(_index)))).Put((Object)("almacen"),(Object)(((double)(Double.parseDouble(_inv))-_sumaminima)));
 //BA.debugLineNum = 651;BA.debugLine="inv = inv - sumaMinima";
_inv = BA.NumberToString((double)(Double.parseDouble(_inv))-_sumaminima);
 //BA.debugLineNum = 653;BA.debugLine="laCant.Text = NumberFormat2((laCant.Text.As(Int)";
_lacant.setText(BA.ObjectToCharSequence(__c.NumberFormat2((((int)(Double.parseDouble(_lacant.getText())))+_sumaminima),(int) (1),(int) (0),(int) (0),__c.False)));
 }else {
 //BA.debugLineNum = 655;BA.debugLine="Log(\"No hay inventario suficiente para realizar";
__c.LogImpl("749283102","No hay inventario suficiente para realizar la suma.",0);
 };
 //BA.debugLineNum = 658;BA.debugLine="Private nombreX As String = Subs.traeProdNombre(i";
_nombrex = _subs._traeprodnombre /*String*/ (ba,_id);
 //BA.debugLineNum = 661;BA.debugLine="If laCant.Text.As(Int) > 0 Then";
if (((int)(Double.parseDouble(_lacant.getText())))>0) { 
 //BA.debugLineNum = 662;BA.debugLine="panelcajas.Visible = False";
_panelcajas.setVisible(__c.False);
 }else if(((int)(Double.parseDouble(_lacant.getText())))==0) { 
 //BA.debugLineNum = 664;BA.debugLine="panelcajas.Visible = True";
_panelcajas.setVisible(__c.True);
 };
 //BA.debugLineNum = 668;BA.debugLine="LogColor(laCant.Text, Colors.Red)";
__c.LogImpl("749283115",_lacant.getText(),__c.Colors.Red);
 //BA.debugLineNum = 671;BA.debugLine="Subs.actualizaProducto(Subs.traeAlmacen, precio,";
_subs._actualizaproducto /*String*/ (ba,_subs._traealmacen /*String*/ (ba),_precio,((int)(Double.parseDouble(_lacant.getText()))),_subs._traeprodnombre /*String*/ (ba,_id),_id,_clienteid,_subs._traefecha /*String*/ (ba),_subs._traeusuariodebd /*String*/ (ba),_rutausuario,BA.NumberToString(0),_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._tipo_venta /*String*/ ,BA.NumberToString(0),BA.NumberToString(0));
 //BA.debugLineNum = 672;BA.debugLine="cuentaProds";
_cuentaprods();
 //BA.debugLineNum = 674;BA.debugLine="If 1 = 1 Then";
if (1==1) { 
 //BA.debugLineNum = 675;BA.debugLine="Private cs As CSBuilder";
_cs = new anywheresoftware.b4a.objects.CSBuilder();
 //BA.debugLineNum = 676;BA.debugLine="cs.Initialize";
_cs.Initialize();
 //BA.debugLineNum = 677;BA.debugLine="Private o As Cursor = Starter.skmt.ExecQuery($\"s";
_o = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_o = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery(("select CAT_GP_ALMACEN from "+__c.SmartStringFormatter("",(Object)(_starter._tabla /*String*/ ))+" where CAT_GP_ID = '"+__c.SmartStringFormatter("",(Object)(_id))+"'"))));
 //BA.debugLineNum = 678;BA.debugLine="Private invActualizado As String = \"0\"";
_invactualizado = "0";
 //BA.debugLineNum = 679;BA.debugLine="If o.RowCount > 0 Then";
if (_o.getRowCount()>0) { 
 //BA.debugLineNum = 680;BA.debugLine="o.Position = 0";
_o.setPosition((int) (0));
 //BA.debugLineNum = 681;BA.debugLine="invActualizado = o.GetString(\"CAT_GP_ALMACEN\")";
_invactualizado = _o.GetString("CAT_GP_ALMACEN");
 };
 //BA.debugLineNum = 683;BA.debugLine="If clv_prods_ll.GetValue(index).As(Map).Get(\"pre";
if (((float)(BA.ObjectToNumber(((anywheresoftware.b4a.objects.collections.Map) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.collections.Map(), (java.util.Map)(_clv_prods_ll._getvalue(_index)))).Get((Object)("precio_caja")))))==0 || ((int)(BA.ObjectToNumber(((anywheresoftware.b4a.objects.collections.Map) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.collections.Map(), (java.util.Map)(_clv_prods_ll._getvalue(_index)))).Get((Object)("conversion")))))==1) { 
 //BA.debugLineNum = 684;BA.debugLine="Private maxcajas As Int = 0";
_maxcajas = (int) (0);
 //BA.debugLineNum = 685;BA.debugLine="Log(\"cajas a 0\")";
__c.LogImpl("749283132","cajas a 0",0);
 }else {
 //BA.debugLineNum = 687;BA.debugLine="Private maxcajas As Int = invActualizado / clv_";
_maxcajas = (int) ((double)(Double.parseDouble(_invactualizado))/(double)(double)(BA.ObjectToNumber(((anywheresoftware.b4a.objects.collections.Map) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.collections.Map(), (java.util.Map)(_clv_prods_ll._getvalue(_index)))).Get((Object)("conversion")))));
 //BA.debugLineNum = 688;BA.debugLine="Log(\"cajas no a 0\")";
__c.LogImpl("749283135","cajas no a 0",0);
 };
 //BA.debugLineNum = 691;BA.debugLine="If 2 = 2 Then lProdX.Text = cs.Color(Colors.Red)";
if (2==2) { 
_lprodx.setText(BA.ObjectToCharSequence(_cs.Color(__c.Colors.Red).Append(BA.ObjectToCharSequence(_nombrex)).Pop().Append(BA.ObjectToCharSequence(__c.CRLF)).Append(BA.ObjectToCharSequence("Existencias: "+_invactualizado)).Color(((int)0xff017f01)).Append(BA.ObjectToCharSequence(("   $"+__c.SmartStringFormatter("",(Object)(__c.NumberFormat2((double)(Double.parseDouble(_precio)),(int) (1),(int) (2),(int) (2),__c.False)))+""+__c.SmartStringFormatter("",(Object)(__c.CRLF))+"Max. Cajas: "+__c.SmartStringFormatter("",(Object)(_maxcajas))+""))).PopAll().getObject()));};
 };
 //BA.debugLineNum = 693;BA.debugLine="invTotal = totalcajasmaspiezas + Subs.traeinventa";
_invtotal = (int) (_totalcajasmaspiezas+(double)(Double.parseDouble(_subs._traeinventario /*String*/ (ba,_id))));
 //BA.debugLineNum = 694;BA.debugLine="End Sub";
return "";
}
public String  _b_prodmenos_click() throws Exception{
int _index = 0;
anywheresoftware.b4a.objects.B4XViewWrapper _pnl0 = null;
anywheresoftware.b4a.objects.B4XViewWrapper _pnl = null;
anywheresoftware.b4a.objects.B4XViewWrapper _lacant = null;
anywheresoftware.b4a.objects.B4XViewWrapper _panelcajas = null;
anywheresoftware.b4a.objects.B4XViewWrapper _panelpiezas = null;
anywheresoftware.b4a.objects.B4XViewWrapper _lacant2 = null;
anywheresoftware.b4a.objects.B4XViewWrapper _lprodx = null;
String _precio = "";
String _inv = "";
String _id = "";
int _restaminima = 0;
int _cantidadactual = 0;
String _nombrex = "";
anywheresoftware.b4a.objects.CSBuilder _cs = null;
anywheresoftware.b4a.sql.SQL.CursorWrapper _o = null;
String _invactualizado = "";
int _maxcajas = 0;
 //BA.debugLineNum = 545;BA.debugLine="Sub b_prodMenos_Click";
 //BA.debugLineNum = 546;BA.debugLine="totalcajasmaspiezas = 0";
_totalcajasmaspiezas = (int) (0);
 //BA.debugLineNum = 547;BA.debugLine="etCantHasFocus = False";
_etcanthasfocus = __c.False;
 //BA.debugLineNum = 548;BA.debugLine="Root.RequestFocus";
_root.RequestFocus();
 //BA.debugLineNum = 549;BA.debugLine="Dim index As Int = clv_prods_ll.GetItemFromView(S";
_index = _clv_prods_ll._getitemfromview((anywheresoftware.b4a.objects.B4XViewWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.B4XViewWrapper(), (java.lang.Object)(__c.Sender(ba))));
 //BA.debugLineNum = 550;BA.debugLine="Dim pnl0 As B4XView = clv_prods_ll.GetPanel(index";
_pnl0 = new anywheresoftware.b4a.objects.B4XViewWrapper();
_pnl0 = _clv_prods_ll._getpanel(_index);
 //BA.debugLineNum = 551;BA.debugLine="Dim pnl As B4XView = pnl0.GetView(0)";
_pnl = new anywheresoftware.b4a.objects.B4XViewWrapper();
_pnl = _pnl0.GetView((int) (0));
 //BA.debugLineNum = 552;BA.debugLine="Dim laCant As B4XView = pnl.GetView(2).GetView(2)";
_lacant = new anywheresoftware.b4a.objects.B4XViewWrapper();
_lacant = _pnl.GetView((int) (2)).GetView((int) (2));
 //BA.debugLineNum = 553;BA.debugLine="Dim panelcajas As B4XView = pnl.GetView(3)";
_panelcajas = new anywheresoftware.b4a.objects.B4XViewWrapper();
_panelcajas = _pnl.GetView((int) (3));
 //BA.debugLineNum = 554;BA.debugLine="Dim panelpiezas As B4XView = pnl.GetView(2)";
_panelpiezas = new anywheresoftware.b4a.objects.B4XViewWrapper();
_panelpiezas = _pnl.GetView((int) (2));
 //BA.debugLineNum = 555;BA.debugLine="Dim laCant2 As B4XView = pnl.GetView(3).GetView(2";
_lacant2 = new anywheresoftware.b4a.objects.B4XViewWrapper();
_lacant2 = _pnl.GetView((int) (3)).GetView((int) (2));
 //BA.debugLineNum = 556;BA.debugLine="Dim lProdX As B4XView = pnl.GetView(1)";
_lprodx = new anywheresoftware.b4a.objects.B4XViewWrapper();
_lprodx = _pnl.GetView((int) (1));
 //BA.debugLineNum = 558;BA.debugLine="Private precio As String = clv_prods_ll.GetValue(";
_precio = BA.ObjectToString(((anywheresoftware.b4a.objects.collections.Map) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.collections.Map(), (java.util.Map)(_clv_prods_ll._getvalue(_index)))).Get((Object)("precio")));
 //BA.debugLineNum = 559;BA.debugLine="Private inv As String = clv_prods_ll.GetValue(ind";
_inv = BA.ObjectToString(((anywheresoftware.b4a.objects.collections.Map) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.collections.Map(), (java.util.Map)(_clv_prods_ll._getvalue(_index)))).Get((Object)("almacen")));
 //BA.debugLineNum = 560;BA.debugLine="Log($\"Existencias: ${inv}\"$)";
__c.LogImpl("749217551",("Existencias: "+__c.SmartStringFormatter("",(Object)(_inv))+""),0);
 //BA.debugLineNum = 561;BA.debugLine="If laCant.Text = \"\" Then laCant.Text = \"0\" ' Inic";
if ((_lacant.getText()).equals("")) { 
_lacant.setText(BA.ObjectToCharSequence("0"));};
 //BA.debugLineNum = 562;BA.debugLine="Private id As String = clv_prods_ll.GetValue(inde";
_id = BA.ObjectToString(((anywheresoftware.b4a.objects.collections.Map) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.collections.Map(), (java.util.Map)(_clv_prods_ll._getvalue(_index)))).Get((Object)("id")));
 //BA.debugLineNum = 564;BA.debugLine="Dim restaMinima As Int = Subs.traeMinimo(id)";
_restaminima = (int)(Double.parseDouble(_subs._traeminimo /*String*/ (ba,_id)));
 //BA.debugLineNum = 565;BA.debugLine="Dim cantidadActual As Int = laCant.Text.As(Int)";
_cantidadactual = ((int)(Double.parseDouble(_lacant.getText())));
 //BA.debugLineNum = 568;BA.debugLine="If cantidadActual >= restaMinima Then";
if (_cantidadactual>=_restaminima) { 
 //BA.debugLineNum = 569;BA.debugLine="clv_prods_ll.GetValue(index).As(Map).Put(\"almace";
((anywheresoftware.b4a.objects.collections.Map) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.collections.Map(), (java.util.Map)(_clv_prods_ll._getvalue(_index)))).Put((Object)("almacen"),(Object)(((double)(Double.parseDouble(_inv))+_restaminima)));
 //BA.debugLineNum = 570;BA.debugLine="inv = inv + restaMinima";
_inv = BA.NumberToString((double)(Double.parseDouble(_inv))+_restaminima);
 //BA.debugLineNum = 572;BA.debugLine="laCant.Text = NumberFormat2((cantidadActual - re";
_lacant.setText(BA.ObjectToCharSequence(__c.NumberFormat2((_cantidadactual-_restaminima),(int) (1),(int) (0),(int) (0),__c.False)));
 }else {
 //BA.debugLineNum = 574;BA.debugLine="Log(\"No es posible reducir más, cantidad mínima";
__c.LogImpl("749217565","No es posible reducir más, cantidad mínima alcanzada.",0);
 };
 //BA.debugLineNum = 577;BA.debugLine="Private nombreX As String = Subs.traeProdNombre(i";
_nombrex = _subs._traeprodnombre /*String*/ (ba,_id);
 //BA.debugLineNum = 580;BA.debugLine="If laCant.Text.As(Int) > 0 Then";
if (((int)(Double.parseDouble(_lacant.getText())))>0) { 
 //BA.debugLineNum = 581;BA.debugLine="panelcajas.Visible = False";
_panelcajas.setVisible(__c.False);
 }else if(((int)(Double.parseDouble(_lacant.getText())))==0) { 
 //BA.debugLineNum = 583;BA.debugLine="panelcajas.Visible = True";
_panelcajas.setVisible(__c.True);
 };
 //BA.debugLineNum = 587;BA.debugLine="LogColor(laCant.Text, Colors.Red)";
__c.LogImpl("749217578",_lacant.getText(),__c.Colors.Red);
 //BA.debugLineNum = 589;BA.debugLine="Subs.actualizaProducto(Subs.traeAlmacen, precio,";
_subs._actualizaproducto /*String*/ (ba,_subs._traealmacen /*String*/ (ba),_precio,((int)(Double.parseDouble(_lacant.getText()))),_subs._traeprodnombre /*String*/ (ba,_id),_id,_clienteid,_subs._traefecha /*String*/ (ba),_subs._traeusuariodebd /*String*/ (ba),_rutausuario,BA.NumberToString(0),_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._tipo_venta /*String*/ ,BA.NumberToString(0),BA.NumberToString(0));
 //BA.debugLineNum = 590;BA.debugLine="cuentaProds";
_cuentaprods();
 //BA.debugLineNum = 592;BA.debugLine="If 1 = 1 Then";
if (1==1) { 
 //BA.debugLineNum = 593;BA.debugLine="Private cs As CSBuilder";
_cs = new anywheresoftware.b4a.objects.CSBuilder();
 //BA.debugLineNum = 594;BA.debugLine="cs.Initialize";
_cs.Initialize();
 //BA.debugLineNum = 595;BA.debugLine="Private o As Cursor = Starter.skmt.ExecQuery($\"s";
_o = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_o = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery(("select CAT_GP_ALMACEN from "+__c.SmartStringFormatter("",(Object)(_starter._tabla /*String*/ ))+" where CAT_GP_ID = '"+__c.SmartStringFormatter("",(Object)(_id))+"'"))));
 //BA.debugLineNum = 596;BA.debugLine="Private invActualizado As String = \"0\"";
_invactualizado = "0";
 //BA.debugLineNum = 597;BA.debugLine="If o.RowCount > 0 Then";
if (_o.getRowCount()>0) { 
 //BA.debugLineNum = 598;BA.debugLine="o.Position = 0";
_o.setPosition((int) (0));
 //BA.debugLineNum = 599;BA.debugLine="invActualizado = o.GetString(\"CAT_GP_ALMACEN\")";
_invactualizado = _o.GetString("CAT_GP_ALMACEN");
 };
 //BA.debugLineNum = 601;BA.debugLine="If clv_prods_ll.GetValue(index).As(Map).Get(\"pre";
if (((float)(BA.ObjectToNumber(((anywheresoftware.b4a.objects.collections.Map) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.collections.Map(), (java.util.Map)(_clv_prods_ll._getvalue(_index)))).Get((Object)("precio_caja")))))==0 || ((int)(BA.ObjectToNumber(((anywheresoftware.b4a.objects.collections.Map) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.collections.Map(), (java.util.Map)(_clv_prods_ll._getvalue(_index)))).Get((Object)("conversion")))))==1) { 
 //BA.debugLineNum = 602;BA.debugLine="Private maxcajas As Int = 0";
_maxcajas = (int) (0);
 //BA.debugLineNum = 603;BA.debugLine="Log(\"cajas a 0\")";
__c.LogImpl("749217594","cajas a 0",0);
 }else {
 //BA.debugLineNum = 605;BA.debugLine="Private maxcajas As Int = invActualizado / clv_";
_maxcajas = (int) ((double)(Double.parseDouble(_invactualizado))/(double)(double)(BA.ObjectToNumber(((anywheresoftware.b4a.objects.collections.Map) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.collections.Map(), (java.util.Map)(_clv_prods_ll._getvalue(_index)))).Get((Object)("conversion")))));
 //BA.debugLineNum = 606;BA.debugLine="Log(\"cajas no a 0\")";
__c.LogImpl("749217597","cajas no a 0",0);
 };
 //BA.debugLineNum = 609;BA.debugLine="If 2 = 2 Then lProdX.Text = cs.Color(Colors.Red)";
if (2==2) { 
_lprodx.setText(BA.ObjectToCharSequence(_cs.Color(__c.Colors.Red).Append(BA.ObjectToCharSequence(_nombrex)).Pop().Append(BA.ObjectToCharSequence(__c.CRLF)).Append(BA.ObjectToCharSequence("Existencias: "+_invactualizado)).Color(((int)0xff017f01)).Append(BA.ObjectToCharSequence(("   $"+__c.SmartStringFormatter("",(Object)(__c.NumberFormat2((double)(Double.parseDouble(_precio)),(int) (1),(int) (2),(int) (2),__c.False)))+""+__c.SmartStringFormatter("",(Object)(__c.CRLF))+"Max. Cajas: "+__c.SmartStringFormatter("",(Object)(_maxcajas))+""))).PopAll().getObject()));};
 };
 //BA.debugLineNum = 611;BA.debugLine="If laCant.Text = 0 Then";
if ((_lacant.getText()).equals(BA.NumberToString(0))) { 
 //BA.debugLineNum = 612;BA.debugLine="If maxcajas > 0 Then";
if (_maxcajas>0) { 
 //BA.debugLineNum = 613;BA.debugLine="panelcajas.Visible = True";
_panelcajas.setVisible(__c.True);
 //BA.debugLineNum = 614;BA.debugLine="Log(\"eSTOY AQUI<---------\")";
__c.LogImpl("749217605","eSTOY AQUI<---------",0);
 }else {
 //BA.debugLineNum = 616;BA.debugLine="panelcajas.Visible = False";
_panelcajas.setVisible(__c.False);
 //BA.debugLineNum = 617;BA.debugLine="Log(\"------>eSTOY AQUI2\")";
__c.LogImpl("749217608","------>eSTOY AQUI2",0);
 };
 }else if((double)(Double.parseDouble(_lacant.getText()))>0) { 
 //BA.debugLineNum = 620;BA.debugLine="panelcajas.Visible = False";
_panelcajas.setVisible(__c.False);
 };
 //BA.debugLineNum = 622;BA.debugLine="invTotal = totalcajasmaspiezas + Subs.traeinventa";
_invtotal = (int) (_totalcajasmaspiezas+(double)(Double.parseDouble(_subs._traeinventario /*String*/ (ba,_id))));
 //BA.debugLineNum = 623;BA.debugLine="End Sub";
return "";
}
public String  _b_qr_click() throws Exception{
 //BA.debugLineNum = 501;BA.debugLine="Sub b_QR_Click";
 //BA.debugLineNum = 502;BA.debugLine="If ciclo = 1 Then";
if ((_ciclo).equals(BA.NumberToString(1))) { 
 //BA.debugLineNum = 503;BA.debugLine="ciclo = 2";
_ciclo = BA.NumberToString(2);
 //BA.debugLineNum = 504;BA.debugLine="ya_entro  = \"0\"";
_ya_entro = "0";
 //BA.debugLineNum = 505;BA.debugLine="B4XPage_Appear";
_b4xpage_appear();
 }else if((_ciclo).equals(BA.NumberToString(2))) { 
 //BA.debugLineNum = 507;BA.debugLine="ciclo = 3";
_ciclo = BA.NumberToString(3);
 //BA.debugLineNum = 508;BA.debugLine="ya_entro  = \"0\"";
_ya_entro = "0";
 //BA.debugLineNum = 509;BA.debugLine="B4XPage_Appear";
_b4xpage_appear();
 }else if((_ciclo).equals(BA.NumberToString(3))) { 
 //BA.debugLineNum = 511;BA.debugLine="ciclo = 4";
_ciclo = BA.NumberToString(4);
 //BA.debugLineNum = 512;BA.debugLine="ya_entro  = \"0\"";
_ya_entro = "0";
 //BA.debugLineNum = 513;BA.debugLine="B4XPage_Appear";
_b4xpage_appear();
 }else if((_ciclo).equals(BA.NumberToString(4))) { 
 //BA.debugLineNum = 515;BA.debugLine="ciclo = 5";
_ciclo = BA.NumberToString(5);
 //BA.debugLineNum = 516;BA.debugLine="ya_entro  = \"0\"";
_ya_entro = "0";
 //BA.debugLineNum = 517;BA.debugLine="B4XPage_Appear";
_b4xpage_appear();
 }else if((_ciclo).equals(BA.NumberToString(5))) { 
 //BA.debugLineNum = 519;BA.debugLine="ciclo = 1";
_ciclo = BA.NumberToString(1);
 //BA.debugLineNum = 520;BA.debugLine="ya_entro  = \"0\"";
_ya_entro = "0";
 //BA.debugLineNum = 521;BA.debugLine="B4XPage_Appear";
_b4xpage_appear();
 };
 //BA.debugLineNum = 523;BA.debugLine="End Sub";
return "";
}
public String  _b_rechazar_click() throws Exception{
 //BA.debugLineNum = 985;BA.debugLine="Private Sub b_rechazar_Click";
 //BA.debugLineNum = 987;BA.debugLine="result =  Msgbox2($\"Seguro que desea borrar el p";
_result = BA.NumberToString(__c.Msgbox2(BA.ObjectToCharSequence(("Seguro que desea borrar el pedido completo?"+__c.SmartStringFormatter("",(Object)(__c.CRLF))+"Haciendo clic largo sobre un producto se pueden borrar articulos independientes.")),BA.ObjectToCharSequence("Rechazar Pedido"),"Si","","No",(android.graphics.Bitmap)(__c.LoadBitmap(__c.File.getDirAssets(),"alert2.png").getObject()),ba));
 //BA.debugLineNum = 988;BA.debugLine="If result = DialogResponse.POSITIVE Then";
if ((_result).equals(BA.NumberToString(__c.DialogResponse.POSITIVE))) { 
 //BA.debugLineNum = 989;BA.debugLine="Subs.borraPedidoClienteActual";
_subs._borrapedidoclienteactual /*String*/ (ba);
 //BA.debugLineNum = 990;BA.debugLine="prodsMap.Initialize";
_prodsmap.Initialize();
 //BA.debugLineNum = 991;BA.debugLine="B4XPages.MainPage.promos.promosMap.Initialize";
_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._promos /*medicomed.keymon.com.mx.c_promos*/ ._promosmap /*anywheresoftware.b4a.objects.collections.Map*/ .Initialize();
 //BA.debugLineNum = 994;BA.debugLine="clv_prods_ll.Clear";
_clv_prods_ll._clear();
 //BA.debugLineNum = 995;BA.debugLine="Log(\"Positivo\")";
__c.LogImpl("750069514","Positivo",0);
 //BA.debugLineNum = 996;BA.debugLine="B4XPages.ShowPage(\"Cliente\")";
_b4xpages._showpage /*String*/ (ba,"Cliente");
 }else {
 //BA.debugLineNum = 998;BA.debugLine="Log(\"NO Positivo\")";
__c.LogImpl("750069517","NO Positivo",0);
 //BA.debugLineNum = 999;BA.debugLine="p_vistaPreviaTrans.Visible = False";
_p_vistapreviatrans.setVisible(__c.False);
 };
 //BA.debugLineNum = 1004;BA.debugLine="p_vistaPreviaTrans.Visible=False";
_p_vistapreviatrans.setVisible(__c.False);
 //BA.debugLineNum = 1005;BA.debugLine="B4XPages.ShowPage(\"Cliente\")";
_b4xpages._showpage /*String*/ (ba,"Cliente");
 //BA.debugLineNum = 1006;BA.debugLine="End Sub";
return "";
}
public String  _b_terminar1_click() throws Exception{
anywheresoftware.b4a.sql.SQL.CursorWrapper _c_prods = 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;
 //BA.debugLineNum = 830;BA.debugLine="Sub b_terminar1_Click";
 //BA.debugLineNum = 833;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"delete from";
_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("delete from PEDIDO WHERE PE_PRONOMBRE = ? ",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)("N/A")}));
 //BA.debugLineNum = 835;BA.debugLine="lv_promos.Visible = False";
_lv_promos.setVisible(__c.False);
 //BA.debugLineNum = 836;BA.debugLine="clv_prods_ll.AsView.Visible = False";
_clv_prods_ll._asview().setVisible(__c.False);
 //BA.debugLineNum = 837;BA.debugLine="lv_catalogos.Visible = True";
_lv_catalogos.setVisible(__c.True);
 //BA.debugLineNum = 838;BA.debugLine="lv_prodsPedido.Clear";
_lv_prodspedido.Clear();
 //BA.debugLineNum = 839;BA.debugLine="lv_prodsPedido.TwoLinesLayout.Label.Height = 35di";
_lv_prodspedido.getTwoLinesLayout().Label.setHeight(__c.DipToCurrent((int) (35)));
 //BA.debugLineNum = 840;BA.debugLine="lv_prodsPedido.TwoLinesLayout.SecondLabel.Height";
_lv_prodspedido.getTwoLinesLayout().SecondLabel.setHeight(__c.DipToCurrent((int) (25)));
 //BA.debugLineNum = 841;BA.debugLine="Private c_prods As Cursor=B4XPages.MainPage.skmt.";
_c_prods = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_c_prods = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select PE_PRONOMBRE,PE_COSTO_TOT, PE_CANT, PE_FOLIO, PE_CEDIS FROM PEDIDO WHERE PE_CLIENTE IN (Select CUENTA from cuentaa) order by PE_CEDIS, PE_PRONOMBRE")));
 //BA.debugLineNum = 842;BA.debugLine="If c_prods.RowCount > 0 Then";
if (_c_prods.getRowCount()>0) { 
 //BA.debugLineNum = 843;BA.debugLine="Private cs As CSBuilder";
_cs = new anywheresoftware.b4a.objects.CSBuilder();
 //BA.debugLineNum = 845;BA.debugLine="vamoaver.Initialize";
_vamoaver.Initialize();
 //BA.debugLineNum = 846;BA.debugLine="For i=0 To c_prods.RowCount -1";
{
final int step12 = 1;
final int limit12 = (int) (_c_prods.getRowCount()-1);
_i = (int) (0) ;
for (;_i <= limit12 ;_i = _i + step12 ) {
 //BA.debugLineNum = 847;BA.debugLine="cs.Initialize";
_cs.Initialize();
 //BA.debugLineNum = 848;BA.debugLine="c_prods.Position=i";
_c_prods.setPosition(_i);
 //BA.debugLineNum = 849;BA.debugLine="Dim label1 As Label";
_label1 = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 850;BA.debugLine="label1 = lv_prodsPedido.TwoLinesLayout.Label";
_label1 = _lv_prodspedido.getTwoLinesLayout().Label;
 //BA.debugLineNum = 851;BA.debugLine="label1.TextSize = 15";
_label1.setTextSize((float) (15));
 //BA.debugLineNum = 852;BA.debugLine="label1.TextColor = Colors.Black";
_label1.setTextColor(__c.Colors.Black);
 //BA.debugLineNum = 853;BA.debugLine="label1.color = Colors.White";
_label1.setColor(__c.Colors.White);
 //BA.debugLineNum = 854;BA.debugLine="Private textColor As Int = Colors.black";
_textcolor = __c.Colors.Black;
 //BA.debugLineNum = 856;BA.debugLine="If c_prods.GetString(\"PE_FOLIO\") = \"PREVENTA_48";
if ((_c_prods.GetString("PE_FOLIO")).equals("PREVENTA_48")) { 
 //BA.debugLineNum = 857;BA.debugLine="textColor = Colors.RGB(48,3,195)";
_textcolor = __c.Colors.RGB((int) (48),(int) (3),(int) (195));
 }else if((_c_prods.GetString("PE_FOLIO")).equals("PREVENTA") || (_c_prods.GetString("PE_FOLIO")).equals("ABORDO") || (_c_prods.GetString("PE_FOLIO")).equals("RECARGA")) { 
 //BA.debugLineNum = 859;BA.debugLine="textColor = Colors.RGB(166,0,0)";
_textcolor = __c.Colors.RGB((int) (166),(int) (0),(int) (0));
 };
 //BA.debugLineNum = 861;BA.debugLine="If Not(IsNumber(c_prods.GetString(\"PE_CEDIS\")))";
if (__c.Not(__c.IsNumber(_c_prods.GetString("PE_CEDIS"))) && (_c_prods.GetString("PE_FOLIO")).equals("PREVENTA_48")) { 
 //BA.debugLineNum = 862;BA.debugLine="textColor = Colors.RGB(154,131,231) 'Si es pro";
_textcolor = __c.Colors.RGB((int) (154),(int) (131),(int) (231));
 }else if(__c.Not(__c.IsNumber(_c_prods.GetString("PE_CEDIS"))) && (_c_prods.GetString("PE_FOLIO")).equals("PREVENTA")) { 
 //BA.debugLineNum = 864;BA.debugLine="textColor = Colors.RGB(255,111,111) 'Si es pro";
_textcolor = __c.Colors.RGB((int) (255),(int) (111),(int) (111));
 };
 //BA.debugLineNum = 866;BA.debugLine="Dim label2 As Label";
_label2 = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 867;BA.debugLine="label2 = lv_prodsPedido.TwoLinesLayout.SecondLa";
_label2 = _lv_prodspedido.getTwoLinesLayout().SecondLabel;
 //BA.debugLineNum = 868;BA.debugLine="label2.TextSize = 10";
_label2.setTextSize((float) (10));
 //BA.debugLineNum = 869;BA.debugLine="label2.TextColor = Colors.Blue";
_label2.setTextColor(__c.Colors.Blue);
 //BA.debugLineNum = 871;BA.debugLine="lv_prodsPedido.AddTwoLines(cs.Color(textColor).";
_lv_prodspedido.AddTwoLines(BA.ObjectToCharSequence(_cs.Color(_textcolor).Append(BA.ObjectToCharSequence(_c_prods.GetString("PE_PRONOMBRE"))).Pop().getObject()),BA.ObjectToCharSequence("Cantidad #"+_c_prods.GetString("PE_CANT")+" SubTotal $"+_c_prods.GetString("PE_COSTO_TOT")+" Folio "+_c_prods.GetString("PE_FOLIO")));
 //BA.debugLineNum = 872;BA.debugLine="vamoaver.Add(c_prods.GetString(\"PE_FOLIO\"))";
_vamoaver.Add((Object)(_c_prods.GetString("PE_FOLIO")));
 //BA.debugLineNum = 873;BA.debugLine="folio = c_prods.GetString(\"PE_FOLIO\")";
_folio = _c_prods.GetString("PE_FOLIO");
 }
};
 //BA.debugLineNum = 877;BA.debugLine="c = B4XPages.MainPage.skmt.ExecQuery(\"select sum";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select sum(PE_CANT) as PC_NOART, sum (PE_COSTO_TOT) as PC_MONTO from PEDIDO where PE_CLIENTE in (Select CUENTA from cuentaa) AND PE_PROID NOT IN (SELECT CAT_PA_ID FROM PROMOS_COMP )")));
 //BA.debugLineNum = 879;BA.debugLine="c.Position=0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 881;BA.debugLine="l_cant.Text = c.GetString(\"PC_NOART\")";
_l_cant.setText(BA.ObjectToCharSequence(_c.GetString("PC_NOART")));
 //BA.debugLineNum = 882;BA.debugLine="l_total2.Text = c.GetString(\"PC_MONTO\")";
_l_total2.setText(BA.ObjectToCharSequence(_c.GetString("PC_MONTO")));
 //BA.debugLineNum = 883;BA.debugLine="c.Close";
_c.Close();
 };
 //BA.debugLineNum = 886;BA.debugLine="c_prods.Close";
_c_prods.Close();
 //BA.debugLineNum = 887;BA.debugLine="p_vistaPreviaTrans.Width = Root.Width";
_p_vistapreviatrans.setWidth(_root.getWidth());
 //BA.debugLineNum = 888;BA.debugLine="p_vistaPreviaTrans.Height = Root.Height";
_p_vistapreviatrans.setHeight(_root.getHeight());
 //BA.debugLineNum = 889;BA.debugLine="Subs.centraPanel(p_vistaPrevia, Root.Width)";
_subs._centrapanel /*String*/ (ba,_p_vistaprevia,_root.getWidth());
 //BA.debugLineNum = 890;BA.debugLine="If Subs.pedidoGuardado Then b_rechazar.Enabled =";
if (_subs._pedidoguardado /*boolean*/ (ba)) { 
_b_rechazar.setEnabled(__c.False);}
else {
_b_rechazar.setEnabled(__c.True);};
 //BA.debugLineNum = 891;BA.debugLine="p_vistaPrevia.Visible=True";
_p_vistaprevia.setVisible(__c.True);
 //BA.debugLineNum = 892;BA.debugLine="p_vistaPreviaTrans.Visible=True";
_p_vistapreviatrans.setVisible(__c.True);
 //BA.debugLineNum = 893;BA.debugLine="End Sub";
return "";
}
public void  _b4xpage_appear() throws Exception{
ResumableSub_B4XPage_Appear rsub = new ResumableSub_B4XPage_Appear(this);
rsub.resume(ba, null);
}
public static class ResumableSub_B4XPage_Appear extends BA.ResumableSub {
public ResumableSub_B4XPage_Appear(medicomed.keymon.com.mx.c_productos parent) {
this.parent = parent;
}
medicomed.keymon.com.mx.c_productos parent;
anywheresoftware.b4a.objects.LabelWrapper _label1 = null;
boolean _haypromos = false;
int _i = 0;
anywheresoftware.b4a.objects.collections.Map _tm = null;
anywheresoftware.b4a.objects.collections.Map _m = null;
int step53;
int limit53;

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

    while (true) {
        switch (state) {
            case -1:
return;

case 0:
//C
this.state = 1;
 //BA.debugLineNum = 140;BA.debugLine="If B4XPages.MainPage.tipo_venta = \"PREVENTA\" Or B";
if (true) break;

case 1:
//if
this.state = 6;
if ((parent._b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._tipo_venta /*String*/ ).equals("PREVENTA") || (parent._b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._tipo_venta /*String*/ ).equals("ABORDO") || (parent._b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._tipo_venta /*String*/ ).equals("RECARGA")) { 
this.state = 3;
}else if((parent._b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._tipo_venta /*String*/ ).equals("PREVENTA_48")) { 
this.state = 5;
}if (true) break;

case 3:
//C
this.state = 6;
 //BA.debugLineNum = 141;BA.debugLine="Starter.tabla = \"CAT_GUNAPROD\"";
parent._starter._tabla /*String*/  = "CAT_GUNAPROD";
 if (true) break;

case 5:
//C
this.state = 6;
 //BA.debugLineNum = 143;BA.debugLine="Starter.tabla = \"CAT_GUNAPROD2\"";
parent._starter._tabla /*String*/  = "CAT_GUNAPROD2";
 if (true) break;

case 6:
//C
this.state = 7;
;
 //BA.debugLineNum = 145;BA.debugLine="LogColor(\"------------------------>\"&B4XPages.Mai";
parent.__c.LogImpl("748627718","------------------------>"+parent._b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._tipo_venta /*String*/ ,parent.__c.Colors.Yellow);
 //BA.debugLineNum = 146;BA.debugLine="clienteId = Subs.traeCliente";
parent._clienteid = parent._subs._traecliente /*String*/ (ba);
 //BA.debugLineNum = 147;BA.debugLine="rutaUsuario = Subs.traeRuta(Subs.traeCliente)";
parent._rutausuario = parent._subs._traeruta /*String*/ (ba,parent._subs._traecliente /*String*/ (ba));
 //BA.debugLineNum = 148;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"UPDATE CAT_";
parent._b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("UPDATE CAT_GUNAPROD SET CAT_GP_TIPOPROD = (?) WHERE CAT_GP_TIPOPROD = (?) ",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)("PRIORITARIO"),(Object)("1")}));
 //BA.debugLineNum = 149;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"UPDATE CAT_";
parent._b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("UPDATE CAT_GUNAPROD SET CAT_GP_TIPOPROD = (?) WHERE CAT_GP_TIPOPROD = (?) ",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)("ESTRATEGICO"),(Object)("2")}));
 //BA.debugLineNum = 150;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"UPDATE CAT_";
parent._b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("UPDATE CAT_GUNAPROD SET CAT_GP_TIPOPROD = (?) WHERE CAT_GP_TIPOPROD = (?) ",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)("COMPLEMENTARIO"),(Object)("3")}));
 //BA.debugLineNum = 151;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"UPDATE CAT_";
parent._b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("UPDATE CAT_GUNAPROD SET CAT_GP_TIPOPROD = (?) WHERE CAT_GP_TIPOPROD = (?) ",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)("CATALOGO REGULAR"),(Object)("0")}));
 //BA.debugLineNum = 152;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"UPDATE CAT_";
parent._b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("UPDATE CAT_GUNAPROD SET CAT_GP_TIPOPROD = (?) WHERE CAT_GP_CLASIF = (?) ",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)("PROMOS"),(Object)("PROMOS")}));
 //BA.debugLineNum = 153;BA.debugLine="clv_prods_ll.GetBase.SetLayoutAnimated(0, 5dip, 1";
parent._clv_prods_ll._getbase().SetLayoutAnimated((int) (0),parent.__c.DipToCurrent((int) (5)),parent.__c.DipToCurrent((int) (130)),(int) (parent._root.getWidth()+10),(int) (parent._root.getHeight()*0.74));
 //BA.debugLineNum = 154;BA.debugLine="clv_prods_ll.Base_Resize(clv_prods_ll.GetBase.Wid";
parent._clv_prods_ll._base_resize(parent._clv_prods_ll._getbase().getWidth(),parent._clv_prods_ll._getbase().getHeight());
 //BA.debugLineNum = 155;BA.debugLine="If B4XPages.MainPage.bTerminarClicked Then";
if (true) break;

case 7:
//if
this.state = 10;
if (parent._b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._bterminarclicked /*boolean*/ ) { 
this.state = 9;
}if (true) break;

case 9:
//C
this.state = 10;
 //BA.debugLineNum = 156;BA.debugLine="lv_catalogos.Visible = True";
parent._lv_catalogos.setVisible(parent.__c.True);
 //BA.debugLineNum = 157;BA.debugLine="lv_promos.Visible = False";
parent._lv_promos.setVisible(parent.__c.False);
 //BA.debugLineNum = 158;BA.debugLine="lv_tipo.Visible = False";
parent._lv_tipo.setVisible(parent.__c.False);
 //BA.debugLineNum = 159;BA.debugLine="lv_subtipo.Visible = False";
parent._lv_subtipo.setVisible(parent.__c.False);
 //BA.debugLineNum = 160;BA.debugLine="clv_prods_ll.AsView.Visible = False";
parent._clv_prods_ll._asview().setVisible(parent.__c.False);
 //BA.debugLineNum = 161;BA.debugLine="B4XPages.MainPage.bTerminarClicked = False";
parent._b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._bterminarclicked /*boolean*/  = parent.__c.False;
 if (true) break;
;
 //BA.debugLineNum = 163;BA.debugLine="If ya_entro <> \"1\" Then";

case 10:
//if
this.state = 19;
if ((parent._ya_entro).equals("1") == false) { 
this.state = 12;
}if (true) break;

case 12:
//C
this.state = 13;
 //BA.debugLineNum = 164;BA.debugLine="If BUSCA.Text <> \"\" Then BUSCA.Text =\"\"";
if (true) break;

case 13:
//if
this.state = 18;
if ((parent._busca.getText()).equals("") == false) { 
this.state = 15;
;}if (true) break;

case 15:
//C
this.state = 18;
parent._busca.setText(BA.ObjectToCharSequence(""));
if (true) break;

case 18:
//C
this.state = 19;
;
 //BA.debugLineNum = 165;BA.debugLine="entro =\"3\"";
parent._entro = "3";
 //BA.debugLineNum = 166;BA.debugLine="lv_catalogos.Clear";
parent._lv_catalogos.Clear();
 //BA.debugLineNum = 167;BA.debugLine="Sleep(100)";
parent.__c.Sleep(ba,this,(int) (100));
this.state = 57;
return;
case 57:
//C
this.state = 19;
;
 //BA.debugLineNum = 168;BA.debugLine="lfila.Text = \"CATALOGOS\"";
parent._lfila.setText(BA.ObjectToCharSequence("CATALOGOS"));
 //BA.debugLineNum = 169;BA.debugLine="p_productos.Height = Root.Height";
parent._p_productos.setHeight(parent._root.getHeight());
 //BA.debugLineNum = 170;BA.debugLine="clv_prods_ll.AsView.Visible = False";
parent._clv_prods_ll._asview().setVisible(parent.__c.False);
 //BA.debugLineNum = 171;BA.debugLine="lv_catalogos.Visible = True";
parent._lv_catalogos.setVisible(parent.__c.True);
 //BA.debugLineNum = 172;BA.debugLine="p_botonesVenta.Visible = False";
parent._p_botonesventa.setVisible(parent.__c.False);
 //BA.debugLineNum = 173;BA.debugLine="p_botonesVenta.Top = clv_prods_ll.AsView.top + c";
parent._p_botonesventa.setTop((int) (parent._clv_prods_ll._asview().getTop()+parent._clv_prods_ll._asview().getHeight()-10));
 //BA.debugLineNum = 174;BA.debugLine="lv_promos.Visible = False";
parent._lv_promos.setVisible(parent.__c.False);
 if (true) break;

case 19:
//C
this.state = 20;
;
 //BA.debugLineNum = 176;BA.debugLine="Dim label1 As Label";
_label1 = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 177;BA.debugLine="label1 = lv_catalogos.SingleLineLayout.Label";
_label1 = parent._lv_catalogos.getSingleLineLayout().Label;
 //BA.debugLineNum = 178;BA.debugLine="label1.TextSize = 17";
_label1.setTextSize((float) (17));
 //BA.debugLineNum = 179;BA.debugLine="label1.TextColor = Colors.Black";
_label1.setTextColor(parent.__c.Colors.Black);
 //BA.debugLineNum = 180;BA.debugLine="lv_catalogos.Clear";
parent._lv_catalogos.Clear();
 //BA.debugLineNum = 181;BA.debugLine="lv_catalogos.AddSingleLine(\"CATALOGO\")";
parent._lv_catalogos.AddSingleLine(BA.ObjectToCharSequence("CATALOGO"));
 //BA.debugLineNum = 183;BA.debugLine="c = B4XPages.MainPage.skmt.ExecQuery($\"select cou";
parent._c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(parent._b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery(("select count(*) as hayPromos from "+parent.__c.SmartStringFormatter("",(Object)(parent._starter._tabla /*String*/ ))+" where CAT_GP_TIPO = 'PROMOS'"))));
 //BA.debugLineNum = 184;BA.debugLine="c.Position = 0";
parent._c.setPosition((int) (0));
 //BA.debugLineNum = 186;BA.debugLine="c = B4XPages.MainPage.skmt.ExecQuery($\"SELECT CUE";
parent._c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(parent._b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery(("SELECT CUENTA FROM CUENTAA"))));
 //BA.debugLineNum = 187;BA.debugLine="c.Position = 0";
parent._c.setPosition((int) (0));
 //BA.debugLineNum = 188;BA.debugLine="If c.GetString(\"CUENTA\") <> \"0\" And c.GetString(\"";
if (true) break;

case 20:
//if
this.state = 43;
if ((parent._c.GetString("CUENTA")).equals("0") == false && (parent._c.GetString("CUENTA")).equals("1") == false) { 
this.state = 22;
}if (true) break;

case 22:
//C
this.state = 23;
 //BA.debugLineNum = 189;BA.debugLine="c2=B4XPages.MainPage.skmt.ExecQuery2($\"select CA";
parent._c2 = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(parent._b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery2(("select CAT_GP_ID, CAT_GP_NOMBRE, CAT_GP_PRECIO, CAT_GP_ALMACEN, IFNULL(CAT_GP_IMG,0) AS CAT_GP_IMG from "+parent.__c.SmartStringFormatter("",(Object)(parent._starter._tabla /*String*/ ))+" where CAT_GP_PRECIO > 0 AND  CAT_GP_ALMACEN > 0 AND CAT_GP_TIPO = ? AND CAT_GP_SUBTIPO = ?  AND CAT_GP_ID NOT IN (SELECT PE_PROID FROM PEDIDO WHERE PE_CLIENTE IN (Select cuenta from cuentaa))"),new String[]{"PROMOS","PROMOS"})));
 //BA.debugLineNum = 190;BA.debugLine="LogColor($\"select CAT_GP_ID, CAT_GP_NOMBRE, CAT_";
parent.__c.LogImpl("748627763",("select CAT_GP_ID, CAT_GP_NOMBRE, CAT_GP_PRECIO, CAT_GP_ALMACEN, IFNULL(CAT_GP_IMG,0) AS CAT_GP_IMG from "+parent.__c.SmartStringFormatter("",(Object)(parent._starter._tabla /*String*/ ))+" where CAT_GP_PRECIO > 0 AND  CAT_GP_ALMACEN > 0 AND CAT_GP_TIPO = ? AND CAT_GP_SUBTIPO = ?  AND CAT_GP_ID NOT IN (SELECT PE_PROID FROM PEDIDO WHERE PE_CLIENTE IN (Select cuenta from cuentaa))"),parent.__c.Colors.Cyan);
 //BA.debugLineNum = 192;BA.debugLine="Private hayPromos As Boolean = False";
_haypromos = parent.__c.False;
 //BA.debugLineNum = 193;BA.debugLine="If c2.RowCount > 0 Then";
if (true) break;

case 23:
//if
this.state = 42;
if (parent._c2.getRowCount()>0) { 
this.state = 25;
}else {
this.state = 41;
}if (true) break;

case 25:
//C
this.state = 26;
 //BA.debugLineNum = 194;BA.debugLine="Log(\"Esto es un conteo --->\"&c2.RowCount) 'Isaa";
parent.__c.LogImpl("748627767","Esto es un conteo --->"+BA.NumberToString(parent._c2.getRowCount()),0);
 //BA.debugLineNum = 195;BA.debugLine="For i=0 To c2.RowCount -1";
if (true) break;

case 26:
//for
this.state = 33;
step53 = 1;
limit53 = (int) (parent._c2.getRowCount()-1);
_i = (int) (0) ;
this.state = 58;
if (true) break;

case 58:
//C
this.state = 33;
if ((step53 > 0 && _i <= limit53) || (step53 < 0 && _i >= limit53)) this.state = 28;
if (true) break;

case 59:
//C
this.state = 58;
_i = ((int)(0 + _i + step53)) ;
if (true) break;

case 28:
//C
this.state = 29;
 //BA.debugLineNum = 196;BA.debugLine="c2.Position = i";
parent._c2.setPosition(_i);
 //BA.debugLineNum = 197;BA.debugLine="Log(\"Esto es i----->\"& i)'Isaac";
parent.__c.LogImpl("748627770","Esto es i----->"+BA.NumberToString(_i),0);
 //BA.debugLineNum = 198;BA.debugLine="Private tm As Map = Subs.procesaPromocion(c2.G";
_tm = new anywheresoftware.b4a.objects.collections.Map();
_tm = parent._subs._procesapromocion /*anywheresoftware.b4a.objects.collections.Map*/ (ba,parent._c2.GetString("CAT_GP_ID"),parent._clienteid);
 //BA.debugLineNum = 199;BA.debugLine="If tm.Get(\"status\") = \"ok\" Then 'Solo muestral";
if (true) break;

case 29:
//if
this.state = 32;
if ((_tm.Get((Object)("status"))).equals((Object)("ok"))) { 
this.state = 31;
}if (true) break;

case 31:
//C
this.state = 32;
 //BA.debugLineNum = 200;BA.debugLine="hayPromos = True";
_haypromos = parent.__c.True;
 if (true) break;

case 32:
//C
this.state = 59;
;
 if (true) break;
if (true) break;

case 33:
//C
this.state = 34;
;
 //BA.debugLineNum = 203;BA.debugLine="Log(hayPromos)";
parent.__c.LogImpl("748627776",BA.ObjectToString(_haypromos),0);
 //BA.debugLineNum = 204;BA.debugLine="If hayPromos Then lv_catalogos.AddSingleLine(\"P";
if (true) break;

case 34:
//if
this.state = 39;
if (_haypromos) { 
this.state = 36;
;}if (true) break;

case 36:
//C
this.state = 39;
parent._lv_catalogos.AddSingleLine(BA.ObjectToCharSequence("PROMOS"));
if (true) break;

case 39:
//C
this.state = 42;
;
 if (true) break;

case 41:
//C
this.state = 42;
 //BA.debugLineNum = 206;BA.debugLine="Log(\"NO HAY PROMOS\")";
parent.__c.LogImpl("748627779","NO HAY PROMOS",0);
 if (true) break;

case 42:
//C
this.state = 43;
;
 //BA.debugLineNum = 208;BA.debugLine="c2.Close";
parent._c2.Close();
 if (true) break;

case 43:
//C
this.state = 44;
;
 //BA.debugLineNum = 211;BA.debugLine="Sleep(100)";
parent.__c.Sleep(ba,this,(int) (100));
this.state = 60;
return;
case 60:
//C
this.state = 44;
;
 //BA.debugLineNum = 212;BA.debugLine="l_total.Visible = False";
parent._l_total.setVisible(parent.__c.False);
 //BA.debugLineNum = 213;BA.debugLine="l_totProds.Visible = False";
parent._l_totprods.setVisible(parent.__c.False);
 //BA.debugLineNum = 214;BA.debugLine="l_total.Left = 5dip";
parent._l_total.setLeft(parent.__c.DipToCurrent((int) (5)));
 //BA.debugLineNum = 215;BA.debugLine="l_totProds.Width = Root.Width * 0.19";
parent._l_totprods.setWidth((int) (parent._root.getWidth()*0.19));
 //BA.debugLineNum = 216;BA.debugLine="l_total.Left = l_totProds.Width + 20";
parent._l_total.setLeft((int) (parent._l_totprods.getWidth()+20));
 //BA.debugLineNum = 217;BA.debugLine="l_total.Width = Root.Width * 0.25";
parent._l_total.setWidth((int) (parent._root.getWidth()*0.25));
 //BA.debugLineNum = 219;BA.debugLine="Dim m As Map = Subs.traeTotalesClienteActual";
_m = new anywheresoftware.b4a.objects.collections.Map();
_m = parent._subs._traetotalesclienteactual /*anywheresoftware.b4a.objects.collections.Map*/ (ba);
 //BA.debugLineNum = 220;BA.debugLine="prodsPedidoActual = m.Get(\"productos\")";
parent._prodspedidoactual = BA.ObjectToString(_m.Get((Object)("productos")));
 //BA.debugLineNum = 221;BA.debugLine="montoPedidoActual = m.Get(\"monto\")";
parent._montopedidoactual = BA.ObjectToString(_m.Get((Object)("monto")));
 //BA.debugLineNum = 222;BA.debugLine="hayPedido = Subs.hayPedido";
parent._haypedido = parent._subs._haypedido /*boolean*/ (ba);
 //BA.debugLineNum = 224;BA.debugLine="B4XPages.MainPage.productos.clv_prods_ll.Clear";
parent._b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._productos /*medicomed.keymon.com.mx.c_productos*/ ._clv_prods_ll /*b4a.example3.customlistview*/ ._clear();
 //BA.debugLineNum = 225;BA.debugLine="If reiniciarlistaProds Then";
if (true) break;

case 44:
//if
this.state = 49;
if (parent._reiniciarlistaprods) { 
this.state = 46;
}else if(parent._haypedido) { 
this.state = 48;
}if (true) break;

case 46:
//C
this.state = 49;
 //BA.debugLineNum = 228;BA.debugLine="clv_prods_ll.Clear";
parent._clv_prods_ll._clear();
 if (true) break;

case 48:
//C
this.state = 49;
 //BA.debugLineNum = 233;BA.debugLine="clv_prods_ll.Clear";
parent._clv_prods_ll._clear();
 if (true) break;
;
 //BA.debugLineNum = 236;BA.debugLine="If clv_prods_ll.Size = 0 Then";

case 49:
//if
this.state = 56;
if (parent._clv_prods_ll._getsize()==0) { 
this.state = 51;
}if (true) break;

case 51:
//C
this.state = 52;
 //BA.debugLineNum = 237;BA.debugLine="LlenaProdsLL(Null) 'Llama a la función para llen";
parent._llenaprodsll((anywheresoftware.b4a.sql.SQL.ResultSetWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.ResultSetWrapper(), (android.database.Cursor)(parent.__c.Null)));
 //BA.debugLineNum = 238;BA.debugLine="If clv_prods_ll.Size = 0 Then";
if (true) break;

case 52:
//if
this.state = 55;
if (parent._clv_prods_ll._getsize()==0) { 
this.state = 54;
}if (true) break;

case 54:
//C
this.state = 55;
 //BA.debugLineNum = 239;BA.debugLine="ToastMessageShow(\"No hay datos. Favor de comuni";
parent.__c.ToastMessageShow(BA.ObjectToCharSequence("No hay datos. Favor de comunicarse con soporte."),parent.__c.True);
 //BA.debugLineNum = 240;BA.debugLine="Return 'Termina la ejecución aquí.";
if (true) return ;
 if (true) break;

case 55:
//C
this.state = 56;
;
 if (true) break;

case 56:
//C
this.state = -1;
;
 //BA.debugLineNum = 245;BA.debugLine="clv_prods_ll.JumpToItem(0) 'Vamos al primer artíc";
parent._clv_prods_ll._jumptoitem((int) (0));
 //BA.debugLineNum = 246;BA.debugLine="PCLV.lblHint.SetTextSizeAnimated(0,13)";
parent._pclv._lblhint /*anywheresoftware.b4a.objects.B4XViewWrapper*/ .SetTextSizeAnimated((int) (0),(float) (13));
 //BA.debugLineNum = 247;BA.debugLine="PCLV.B4XSeekBar1.Color1=Colors.DarkGray";
parent._pclv._b4xseekbar1 /*medicomed.keymon.com.mx.b4xseekbar*/ ._color1 /*int*/  = parent.__c.Colors.DarkGray;
 //BA.debugLineNum = 248;BA.debugLine="PCLV.B4XSeekBar1.Color2=Colors.DarkGray";
parent._pclv._b4xseekbar1 /*medicomed.keymon.com.mx.b4xseekbar*/ ._color2 /*int*/  = parent.__c.Colors.DarkGray;
 //BA.debugLineNum = 249;BA.debugLine="PCLV.B4XSeekBar1.ThumbColor=Colors.red";
parent._pclv._b4xseekbar1 /*medicomed.keymon.com.mx.b4xseekbar*/ ._thumbcolor /*int*/  = parent.__c.Colors.Red;
 //BA.debugLineNum = 250;BA.debugLine="PCLV.B4XSeekBar1.mBase.Left=Root.Width *0.91";
parent._pclv._b4xseekbar1 /*medicomed.keymon.com.mx.b4xseekbar*/ ._mbase /*anywheresoftware.b4a.objects.B4XViewWrapper*/ .setLeft((int) (parent._root.getWidth()*0.91));
 //BA.debugLineNum = 251;BA.debugLine="PCLV.B4XSeekBar1.mBase.Height=clv_prods_ll.AsView";
parent._pclv._b4xseekbar1 /*medicomed.keymon.com.mx.b4xseekbar*/ ._mbase /*anywheresoftware.b4a.objects.B4XViewWrapper*/ .setHeight(parent._clv_prods_ll._asview().getHeight());
 //BA.debugLineNum = 252;BA.debugLine="PCLV.pnlOverlay.Height = clv_prods_ll.AsView.Heig";
parent._pclv._pnloverlay /*anywheresoftware.b4a.objects.B4XViewWrapper*/ .setHeight(parent._clv_prods_ll._asview().getHeight());
 //BA.debugLineNum = 253;BA.debugLine="PCLV.B4XSeekBar1.Update";
parent._pclv._b4xseekbar1 /*medicomed.keymon.com.mx.b4xseekbar*/ ._update /*String*/ ();
 //BA.debugLineNum = 270;BA.debugLine="End Sub";
if (true) break;

            }
        }
    }
}
public anywheresoftware.b4a.keywords.Common.ResumableSubWrapper  _b4xpage_closerequest() throws Exception{
ResumableSub_B4XPage_CloseRequest rsub = new ResumableSub_B4XPage_CloseRequest(this);
rsub.resume(ba, null);
return (anywheresoftware.b4a.keywords.Common.ResumableSubWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.keywords.Common.ResumableSubWrapper(), rsub);
}
public static class ResumableSub_B4XPage_CloseRequest extends BA.ResumableSub {
public ResumableSub_B4XPage_CloseRequest(medicomed.keymon.com.mx.c_productos parent) {
this.parent = parent;
}
medicomed.keymon.com.mx.c_productos parent;

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

    while (true) {
        switch (state) {
            case -1:
{
parent.__c.ReturnFromResumableSub(this,null);return;}
case 0:
//C
this.state = 1;
 //BA.debugLineNum = 454;BA.debugLine="If l_info.Visible Then";
if (true) break;

case 1:
//if
this.state = 16;
if (parent._l_info.getVisible()) { 
this.state = 3;
}else if(parent._p_vistapreviatrans.getVisible()) { 
this.state = 5;
}else if(parent._lv_promos.getVisible()) { 
this.state = 7;
}else if(parent._clv_prods_ll._asview().getVisible()) { 
this.state = 9;
}else if((parent._entro).equals("4")) { 
this.state = 11;
}else if((parent._entro).equals("3")) { 
this.state = 13;
}else {
this.state = 15;
}if (true) break;

case 3:
//C
this.state = 16;
 //BA.debugLineNum = 455;BA.debugLine="l_info.Visible = False";
parent._l_info.setVisible(parent.__c.False);
 //BA.debugLineNum = 456;BA.debugLine="Return False";
if (true) {
parent.__c.ReturnFromResumableSub(this,(Object)(parent.__c.False));return;};
 if (true) break;

case 5:
//C
this.state = 16;
 //BA.debugLineNum = 458;BA.debugLine="p_vistaPreviaTrans.Visible = False";
parent._p_vistapreviatrans.setVisible(parent.__c.False);
 //BA.debugLineNum = 459;BA.debugLine="Return False";
if (true) {
parent.__c.ReturnFromResumableSub(this,(Object)(parent.__c.False));return;};
 if (true) break;

case 7:
//C
this.state = 16;
 //BA.debugLineNum = 461;BA.debugLine="lv_promos.Visible = False";
parent._lv_promos.setVisible(parent.__c.False);
 //BA.debugLineNum = 462;BA.debugLine="lv_catalogos.Visible = True";
parent._lv_catalogos.setVisible(parent.__c.True);
 //BA.debugLineNum = 463;BA.debugLine="p_botonesVenta.Visible = False";
parent._p_botonesventa.setVisible(parent.__c.False);
 //BA.debugLineNum = 464;BA.debugLine="l_total.Visible = False";
parent._l_total.setVisible(parent.__c.False);
 //BA.debugLineNum = 465;BA.debugLine="l_totProds.Visible = False";
parent._l_totprods.setVisible(parent.__c.False);
 //BA.debugLineNum = 466;BA.debugLine="Return False";
if (true) {
parent.__c.ReturnFromResumableSub(this,(Object)(parent.__c.False));return;};
 if (true) break;

case 9:
//C
this.state = 16;
 //BA.debugLineNum = 468;BA.debugLine="lfila.text = \"CATALOGO\"";
parent._lfila.setText(BA.ObjectToCharSequence("CATALOGO"));
 //BA.debugLineNum = 469;BA.debugLine="clv_prods_ll.AsView.Visible = False";
parent._clv_prods_ll._asview().setVisible(parent.__c.False);
 //BA.debugLineNum = 470;BA.debugLine="lv_subtipo.Visible = False";
parent._lv_subtipo.setVisible(parent.__c.False);
 //BA.debugLineNum = 471;BA.debugLine="p_botonesVenta.Visible = False";
parent._p_botonesventa.setVisible(parent.__c.False);
 //BA.debugLineNum = 472;BA.debugLine="l_total.Visible = False";
parent._l_total.setVisible(parent.__c.False);
 //BA.debugLineNum = 473;BA.debugLine="l_totProds.Visible = False";
parent._l_totprods.setVisible(parent.__c.False);
 //BA.debugLineNum = 474;BA.debugLine="lv_catalogos.Visible = True";
parent._lv_catalogos.setVisible(parent.__c.True);
 //BA.debugLineNum = 475;BA.debugLine="Return False";
if (true) {
parent.__c.ReturnFromResumableSub(this,(Object)(parent.__c.False));return;};
 if (true) break;

case 11:
//C
this.state = 16;
 //BA.debugLineNum = 487;BA.debugLine="entro = \"3\"";
parent._entro = "3";
 //BA.debugLineNum = 488;BA.debugLine="B4XPage_Appear";
parent._b4xpage_appear();
 //BA.debugLineNum = 489;BA.debugLine="Return True";
if (true) {
parent.__c.ReturnFromResumableSub(this,(Object)(parent.__c.True));return;};
 if (true) break;

case 13:
//C
this.state = 16;
 //BA.debugLineNum = 491;BA.debugLine="B4XPages.ShowPage(\"Cliente\")";
parent._b4xpages._showpage /*String*/ (ba,"Cliente");
 //BA.debugLineNum = 492;BA.debugLine="Return False";
if (true) {
parent.__c.ReturnFromResumableSub(this,(Object)(parent.__c.False));return;};
 if (true) break;

case 15:
//C
this.state = 16;
 //BA.debugLineNum = 494;BA.debugLine="B4XPages.ShowPage(\"Cliente\")";
parent._b4xpages._showpage /*String*/ (ba,"Cliente");
 //BA.debugLineNum = 495;BA.debugLine="Return False";
if (true) {
parent.__c.ReturnFromResumableSub(this,(Object)(parent.__c.False));return;};
 if (true) break;

case 16:
//C
this.state = -1;
;
 //BA.debugLineNum = 497;BA.debugLine="End Sub";
if (true) break;

            }
        }
    }
}
public String  _b4xpage_created(anywheresoftware.b4a.objects.B4XViewWrapper _root1) throws Exception{
anywheresoftware.b4a.objects.LabelWrapper _label1 = null;
int _i = 0;
 //BA.debugLineNum = 98;BA.debugLine="Private Sub B4XPage_Created (Root1 As B4XView)";
 //BA.debugLineNum = 99;BA.debugLine="Root = Root1";
_root = _root1;
 //BA.debugLineNum = 102;BA.debugLine="Root.LoadLayout(\"productos\")";
_root.LoadLayout("productos",ba);
 //BA.debugLineNum = 103;BA.debugLine="ruta = File.DirInternal";
_ruta = __c.File.getDirInternal();
 //BA.debugLineNum = 104;BA.debugLine="If File.Exists(ruta, \"kmt.db\") = False Then";
if (__c.File.Exists(_ruta,"kmt.db")==__c.False) { 
 //BA.debugLineNum = 105;BA.debugLine="File.Copy(File.DirAssets, \"kmt.db\", ruta, \"kmt.d";
__c.File.Copy(__c.File.getDirAssets(),"kmt.db",_ruta,"kmt.db");
 };
 //BA.debugLineNum = 107;BA.debugLine="PCLV.Initialize(Me, \"PCLV\", clv_prods_ll)";
_pclv._initialize /*String*/ (ba,this,"PCLV",_clv_prods_ll);
 //BA.debugLineNum = 108;BA.debugLine="ciclo = 1";
_ciclo = BA.NumberToString(1);
 //BA.debugLineNum = 109;BA.debugLine="l_info.Width = Root.Width * 0.8";
_l_info.setWidth((int) (_root.getWidth()*0.8));
 //BA.debugLineNum = 110;BA.debugLine="l_info.Left = (Root.Width/2) - (l_info.Width/2)";
_l_info.setLeft((int) ((_root.getWidth()/(double)2)-(_l_info.getWidth()/(double)2)));
 //BA.debugLineNum = 111;BA.debugLine="c = B4XPages.MainPage.skmt.ExecQuery(\"select dist";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select distinct CAT_GP_TIPO from cat_gunaprod where CAT_GP_TIPO <> 'PROMOS' order by CAT_GP_TIPO")));
 //BA.debugLineNum = 112;BA.debugLine="If c.RowCount > 0 Then";
if (_c.getRowCount()>0) { 
 //BA.debugLineNum = 113;BA.debugLine="Dim label1 As Label";
_label1 = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 114;BA.debugLine="label1 = lv_tipo.SingleLineLayout.Label";
_label1 = _lv_tipo.getSingleLineLayout().Label;
 //BA.debugLineNum = 115;BA.debugLine="label1.TextSize = 17";
_label1.setTextSize((float) (17));
 //BA.debugLineNum = 116;BA.debugLine="label1.TextColor = Colors.Black";
_label1.setTextColor(__c.Colors.Black);
 //BA.debugLineNum = 117;BA.debugLine="lv_tipo.Clear";
_lv_tipo.Clear();
 //BA.debugLineNum = 118;BA.debugLine="For i=0 To c.RowCount-1";
{
final int step18 = 1;
final int limit18 = (int) (_c.getRowCount()-1);
_i = (int) (0) ;
for (;_i <= limit18 ;_i = _i + step18 ) {
 //BA.debugLineNum = 119;BA.debugLine="c.Position=i";
_c.setPosition(_i);
 //BA.debugLineNum = 120;BA.debugLine="Log(\"ENTRE AQUI EN PROMOS create\")";
__c.LogImpl("748562198","ENTRE AQUI EN PROMOS create",0);
 //BA.debugLineNum = 121;BA.debugLine="lv_tipo.AddSingleLine(c.GetString(\"CAT_GP_TIPO\"";
_lv_tipo.AddSingleLine(BA.ObjectToCharSequence(_c.GetString("CAT_GP_TIPO")));
 }
};
 };
 //BA.debugLineNum = 124;BA.debugLine="c.Close";
_c.Close();
 //BA.debugLineNum = 127;BA.debugLine="listaTiempos.Initialize";
_listatiempos.Initialize();
 //BA.debugLineNum = 128;BA.debugLine="listaProds.Initialize";
_listaprods.Initialize();
 //BA.debugLineNum = 129;BA.debugLine="pedidoMap.Initialize";
_pedidomap.Initialize();
 //BA.debugLineNum = 130;BA.debugLine="listaHints.Initialize";
_listahints.Initialize();
 //BA.debugLineNum = 133;BA.debugLine="clv_prods_ll.Clear";
_clv_prods_ll._clear();
 //BA.debugLineNum = 134;BA.debugLine="prodsMap.Initialize";
_prodsmap.Initialize();
 //BA.debugLineNum = 135;BA.debugLine="End Sub";
return "";
}
public void  _busca_textchanged(String _old,String _new) throws Exception{
ResumableSub_Busca_TextChanged rsub = new ResumableSub_Busca_TextChanged(this,_old,_new);
rsub.resume(ba, null);
}
public static class ResumableSub_Busca_TextChanged extends BA.ResumableSub {
public ResumableSub_Busca_TextChanged(medicomed.keymon.com.mx.c_productos parent,String _old,String _new) {
this.parent = parent;
this._old = _old;
this._new = _new;
}
medicomed.keymon.com.mx.c_productos parent;
String _old;
String _new;
String _marcas = "";
anywheresoftware.b4a.sql.SQL.CursorWrapper _m = null;
anywheresoftware.b4a.sql.SQL.ResultSetWrapper _p = null;

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

    while (true) {
        switch (state) {
            case -1:
return;

case 0:
//C
this.state = 1;
 //BA.debugLineNum = 1242;BA.debugLine="If Not(clv_prods_ll.AsView.Visible) Then clv_prod";
if (true) break;

case 1:
//if
this.state = 6;
if (parent.__c.Not(parent._clv_prods_ll._asview().getVisible())) { 
this.state = 3;
;}if (true) break;

case 3:
//C
this.state = 6;
parent._clv_prods_ll._asview().setVisible(parent.__c.True);
if (true) break;

case 6:
//C
this.state = 7;
;
 //BA.debugLineNum = 1243;BA.debugLine="If (New.Length = 1 Or New.Length = 2) And Not(for";
if (true) break;

case 7:
//if
this.state = 12;
if ((_new.length()==1 || _new.length()==2) && parent.__c.Not(parent._forzarbusqueda)) { 
this.state = 9;
;}if (true) break;

case 9:
//C
this.state = 12;
if (true) return ;
if (true) break;

case 12:
//C
this.state = 13;
;
 //BA.debugLineNum = 1244;BA.debugLine="forzarBusqueda = False";
parent._forzarbusqueda = parent.__c.False;
 //BA.debugLineNum = 1245;BA.debugLine="clv_prods_ll.Clear";
parent._clv_prods_ll._clear();
 //BA.debugLineNum = 1246;BA.debugLine="listaProds.Initialize";
parent._listaprods.Initialize();
 //BA.debugLineNum = 1247;BA.debugLine="listaHints.Initialize";
parent._listahints.Initialize();
 //BA.debugLineNum = 1248;BA.debugLine="Sleep(0)";
parent.__c.Sleep(ba,this,(int) (0));
this.state = 17;
return;
case 17:
//C
this.state = 13;
;
 //BA.debugLineNum = 1250;BA.debugLine="Dim marcas As String = \"\"";
_marcas = "";
 //BA.debugLineNum = 1251;BA.debugLine="Dim m As Cursor = B4XPages.MainPage.skmt.ExecQuer";
_m = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_m = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(parent._b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("SELECT CAT_VA_VALOR FROM CAT_VARIABLES WHERE CAT_VA_DESCRIPCION = 'MARCAS'")));
 //BA.debugLineNum = 1252;BA.debugLine="If m.RowCount > 0 Then";
if (true) break;

case 13:
//if
this.state = 16;
if (_m.getRowCount()>0) { 
this.state = 15;
}if (true) break;

case 15:
//C
this.state = 16;
 //BA.debugLineNum = 1253;BA.debugLine="m.Position = 0";
_m.setPosition((int) (0));
 //BA.debugLineNum = 1254;BA.debugLine="marcas = m.GetString(\"CAT_VA_VALOR\")";
_marcas = _m.GetString("CAT_VA_VALOR");
 if (true) break;

case 16:
//C
this.state = -1;
;
 //BA.debugLineNum = 1260;BA.debugLine="Dim p As ResultSet = B4XPages.MainPage.skmt.ExecQ";
_p = new anywheresoftware.b4a.sql.SQL.ResultSetWrapper();
_p = (anywheresoftware.b4a.sql.SQL.ResultSetWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.ResultSetWrapper(), (android.database.Cursor)(parent._b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery(("select DISTINCT CAT_GP_ID, CAT_GP_NOMBRE, CAT_GP_ALMACEN, CAT_GP_PRECIO, CAT_GP_TIPOPROD, CAT_DP_CONVERSION1, CAT_DP_PRECIO4, PE_BCAJAS, CAT_DP_CANT_MIN_VENTA from "+parent.__c.SmartStringFormatter("",(Object)(parent._starter._tabla /*String*/ ))+" LEFT JOIN PEDIDO ON CAT_GP_ID = PE_PROID where CAT_GP_NOMBRE like '%"+parent.__c.SmartStringFormatter("",(Object)(_new))+"%' AND CAT_GP_PRECIO > 0 And CAT_GP_ALMACEN > 0 And CAT_GP_CLASIF <> 'PROMOS' and CAT_GP_CLASIF IN ("+parent.__c.SmartStringFormatter("",(Object)(_marcas))+") AND CAT_GP_CLASIF <> 'ALEN PROMOCIONES' union all select DISTINCT CAT_GP_ID, CAT_GP_NOMBRE, CAT_GP_ALMACEN, CAT_GP_PRECIO, CAT_GP_TIPOPROD, CAT_DP_CONVERSION1, CAT_DP_PRECIO4 , PE_BCAJAS, CAT_DP_CANT_MIN_VENTA from "+parent.__c.SmartStringFormatter("",(Object)(parent._starter._tabla /*String*/ ))+" LEFT JOIN PEDIDO ON CAT_GP_ID = PE_PROID where CAT_GP_PRECIO > 0 And CAT_GP_ALMACEN = 0 And CAT_GP_CLASIF <> 'PROMOS' and CAT_GP_CLASIF IN ("+parent.__c.SmartStringFormatter("",(Object)(_marcas))+") AND CAT_GP_CLASIF <> 'ALEN PROMOCIONES' and cat_gp_id in (select pe_proid from pedido where pe_cliente in (select cuenta from cuentaa)) order by 2"))));
 //BA.debugLineNum = 1261;BA.debugLine="Log(\"Llamamos LlenaProdsLL\")";
parent.__c.LogImpl("750462741","Llamamos LlenaProdsLL",0);
 //BA.debugLineNum = 1262;BA.debugLine="LlenaProdsLL(p)";
parent._llenaprodsll(_p);
 //BA.debugLineNum = 1281;BA.debugLine="End Sub";
if (true) break;

            }
        }
    }
}
public String  _class_globals() throws Exception{
 //BA.debugLineNum = 1;BA.debugLine="Sub Class_Globals";
 //BA.debugLineNum = 2;BA.debugLine="Private Root As B4XView 'ignore";
_root = new anywheresoftware.b4a.objects.B4XViewWrapper();
 //BA.debugLineNum = 3;BA.debugLine="Private xui As XUI 'ignore";
_xui = new anywheresoftware.b4a.objects.B4XViewWrapper.XUI();
 //BA.debugLineNum = 4;BA.debugLine="Dim ruta As String";
_ruta = "";
 //BA.debugLineNum = 5;BA.debugLine="Dim q_buscar As String";
_q_buscar = "";
 //BA.debugLineNum = 6;BA.debugLine="Dim forzarBusqueda As Boolean = False";
_forzarbusqueda = __c.False;
 //BA.debugLineNum = 7;BA.debugLine="Dim skmt As SQL";
_skmt = new anywheresoftware.b4a.sql.SQL();
 //BA.debugLineNum = 8;BA.debugLine="Dim c As Cursor";
_c = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
 //BA.debugLineNum = 9;BA.debugLine="Dim c2 As Cursor";
_c2 = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
 //BA.debugLineNum = 10;BA.debugLine="Dim C3 As Cursor";
_c3 = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
 //BA.debugLineNum = 11;BA.debugLine="Dim s As Cursor";
_s = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
 //BA.debugLineNum = 12;BA.debugLine="Dim lv_catalogos As ListView";
_lv_catalogos = new anywheresoftware.b4a.objects.ListViewWrapper();
 //BA.debugLineNum = 13;BA.debugLine="Dim lv_promos As ListView";
_lv_promos = new anywheresoftware.b4a.objects.ListViewWrapper();
 //BA.debugLineNum = 14;BA.debugLine="Dim entro As String";
_entro = "";
 //BA.debugLineNum = 15;BA.debugLine="Dim gest As Button";
_gest = new anywheresoftware.b4a.objects.ButtonWrapper();
 //BA.debugLineNum = 16;BA.debugLine="Dim lfila As Label";
_lfila = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 17;BA.debugLine="Dim marca As String";
_marca = "";
 //BA.debugLineNum = 18;BA.debugLine="Dim tipo As String";
_tipo = "";
 //BA.debugLineNum = 19;BA.debugLine="Dim subtipo As String";
_subtipo = "";
 //BA.debugLineNum = 20;BA.debugLine="Private BUSCA As EditText";
_busca = new anywheresoftware.b4a.objects.EditTextWrapper();
 //BA.debugLineNum = 21;BA.debugLine="Dim ya_entro As String";
_ya_entro = "";
 //BA.debugLineNum = 22;BA.debugLine="Dim TIENE_PROMOS As String";
_tiene_promos = "";
 //BA.debugLineNum = 23;BA.debugLine="Dim RES As String";
_res = "";
 //BA.debugLineNum = 24;BA.debugLine="Dim S1 As Cursor";
_s1 = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
 //BA.debugLineNum = 25;BA.debugLine="Dim bmp As Bitmap";
_bmp = new anywheresoftware.b4a.objects.drawable.CanvasWrapper.BitmapWrapper();
 //BA.debugLineNum = 26;BA.debugLine="Dim ciclo As String";
_ciclo = "";
 //BA.debugLineNum = 27;BA.debugLine="Private b_qr As Button";
_b_qr = new anywheresoftware.b4a.objects.ButtonWrapper();
 //BA.debugLineNum = 28;BA.debugLine="Private p_productos As Panel";
_p_productos = new anywheresoftware.b4a.objects.PanelWrapper();
 //BA.debugLineNum = 29;BA.debugLine="Dim clv_productos As CustomListView";
_clv_productos = new b4a.example3.customlistview();
 //BA.debugLineNum = 30;BA.debugLine="Private ImageView1 As ImageView";
_imageview1 = new anywheresoftware.b4a.objects.ImageViewWrapper();
 //BA.debugLineNum = 31;BA.debugLine="Private Panel3 As Panel";
_panel3 = new anywheresoftware.b4a.objects.PanelWrapper();
 //BA.debugLineNum = 32;BA.debugLine="Private p_prods As Panel";
_p_prods = new anywheresoftware.b4a.objects.PanelWrapper();
 //BA.debugLineNum = 33;BA.debugLine="Private i_prod As ImageView";
_i_prod = new anywheresoftware.b4a.objects.ImageViewWrapper();
 //BA.debugLineNum = 34;BA.debugLine="Private l_prodX As Label";
_l_prodx = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 35;BA.debugLine="Private b_prodMas As Button";
_b_prodmas = new anywheresoftware.b4a.objects.ButtonWrapper();
 //BA.debugLineNum = 36;BA.debugLine="Private l_pCant As Label";
_l_pcant = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 37;BA.debugLine="Private et_pCant As EditText";
_et_pcant = new anywheresoftware.b4a.objects.EditTextWrapper();
 //BA.debugLineNum = 38;BA.debugLine="Private b_prodMenos As Button";
_b_prodmenos = new anywheresoftware.b4a.objects.ButtonWrapper();
 //BA.debugLineNum = 39;BA.debugLine="Dim b_terminar1 As Button";
_b_terminar1 = new anywheresoftware.b4a.objects.ButtonWrapper();
 //BA.debugLineNum = 40;BA.debugLine="Dim b_continuar As Button";
_b_continuar = new anywheresoftware.b4a.objects.ButtonWrapper();
 //BA.debugLineNum = 41;BA.debugLine="Private l_total As Label";
_l_total = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 42;BA.debugLine="Private l_totProds As Label";
_l_totprods = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 43;BA.debugLine="Dim totalProds As Int = 0";
_totalprods = (int) (0);
 //BA.debugLineNum = 44;BA.debugLine="Dim totalCompra As Float = 0";
_totalcompra = (float) (0);
 //BA.debugLineNum = 45;BA.debugLine="Dim etCantHasFocus As Boolean = False";
_etcanthasfocus = __c.False;
 //BA.debugLineNum = 46;BA.debugLine="Dim prodsMap As Map";
_prodsmap = new anywheresoftware.b4a.objects.collections.Map();
 //BA.debugLineNum = 47;BA.debugLine="Private l_Cargando As Label";
_l_cargando = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 48;BA.debugLine="Private l_info As Label";
_l_info = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 49;BA.debugLine="Private b_buscar As Button";
_b_buscar = new anywheresoftware.b4a.objects.ButtonWrapper();
 //BA.debugLineNum = 50;BA.debugLine="Private p_botonesVenta As Panel";
_p_botonesventa = new anywheresoftware.b4a.objects.PanelWrapper();
 //BA.debugLineNum = 51;BA.debugLine="Private lv_tipo As ListView";
_lv_tipo = new anywheresoftware.b4a.objects.ListViewWrapper();
 //BA.debugLineNum = 52;BA.debugLine="Private lv_subtipo As ListView";
_lv_subtipo = new anywheresoftware.b4a.objects.ListViewWrapper();
 //BA.debugLineNum = 53;BA.debugLine="Private p_vistaPreviaTrans As Panel";
_p_vistapreviatrans = new anywheresoftware.b4a.objects.PanelWrapper();
 //BA.debugLineNum = 54;BA.debugLine="Private lv_prodsPedido As ListView";
_lv_prodspedido = new anywheresoftware.b4a.objects.ListViewWrapper();
 //BA.debugLineNum = 55;BA.debugLine="Private b_rechazar As Button";
_b_rechazar = new anywheresoftware.b4a.objects.ButtonWrapper();
 //BA.debugLineNum = 56;BA.debugLine="Private b_aceptar As Button";
_b_aceptar = new anywheresoftware.b4a.objects.ButtonWrapper();
 //BA.debugLineNum = 57;BA.debugLine="Private p_vistaPrevia As Panel";
_p_vistaprevia = new anywheresoftware.b4a.objects.PanelWrapper();
 //BA.debugLineNum = 58;BA.debugLine="Dim folio As String";
_folio = "";
 //BA.debugLineNum = 59;BA.debugLine="Dim result As String";
_result = "";
 //BA.debugLineNum = 60;BA.debugLine="Private l_cant As Label";
_l_cant = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 61;BA.debugLine="Private l_total2 As Label";
_l_total2 = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 62;BA.debugLine="Dim prodsPedidoActual As String";
_prodspedidoactual = "";
 //BA.debugLineNum = 63;BA.debugLine="Dim montoPedidoActual As String";
_montopedidoactual = "";
 //BA.debugLineNum = 65;BA.debugLine="Dim clv_prods_ll As CustomListView";
_clv_prods_ll = new b4a.example3.customlistview();
 //BA.debugLineNum = 66;BA.debugLine="Private PCLV As PreoptimizedCLV";
_pclv = new medicomed.keymon.com.mx.preoptimizedclv();
 //BA.debugLineNum = 67;BA.debugLine="Dim listaProds As List";
_listaprods = new anywheresoftware.b4a.objects.collections.List();
 //BA.debugLineNum = 69;BA.debugLine="Dim pedidoMap As Map";
_pedidomap = new anywheresoftware.b4a.objects.collections.Map();
 //BA.debugLineNum = 70;BA.debugLine="Private p_botMasMen As Panel";
_p_botmasmen = new anywheresoftware.b4a.objects.PanelWrapper();
 //BA.debugLineNum = 71;BA.debugLine="Dim reiniciarlistaProds As Boolean= False";
_reiniciarlistaprods = __c.False;
 //BA.debugLineNum = 73;BA.debugLine="Dim listaTiempos As List";
_listatiempos = new anywheresoftware.b4a.objects.collections.List();
 //BA.debugLineNum = 74;BA.debugLine="Dim clienteId As String";
_clienteid = "";
 //BA.debugLineNum = 75;BA.debugLine="Dim rutaUsuario As String";
_rutausuario = "";
 //BA.debugLineNum = 76;BA.debugLine="Dim hayPedido As Boolean";
_haypedido = false;
 //BA.debugLineNum = 77;BA.debugLine="Dim listaHints As List";
_listahints = new anywheresoftware.b4a.objects.collections.List();
 //BA.debugLineNum = 78;BA.debugLine="Dim r As Cursor";
_r = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
 //BA.debugLineNum = 79;BA.debugLine="Dim vamoaver As List";
_vamoaver = new anywheresoftware.b4a.objects.collections.List();
 //BA.debugLineNum = 80;BA.debugLine="Dim j3 As Cursor";
_j3 = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
 //BA.debugLineNum = 81;BA.debugLine="Dim invTotal As Int";
_invtotal = 0;
 //BA.debugLineNum = 82;BA.debugLine="Private et_pCantc As EditText";
_et_pcantc = new anywheresoftware.b4a.objects.EditTextWrapper();
 //BA.debugLineNum = 83;BA.debugLine="Private b_prodMenosc As Button";
_b_prodmenosc = new anywheresoftware.b4a.objects.ButtonWrapper();
 //BA.debugLineNum = 84;BA.debugLine="Private b_prodMasc As Button";
_b_prodmasc = new anywheresoftware.b4a.objects.ButtonWrapper();
 //BA.debugLineNum = 85;BA.debugLine="Dim totalcajasmaspiezas As Int";
_totalcajasmaspiezas = 0;
 //BA.debugLineNum = 86;BA.debugLine="Dim cajas As Int";
_cajas = 0;
 //BA.debugLineNum = 87;BA.debugLine="Dim piezas As Int";
_piezas = 0;
 //BA.debugLineNum = 89;BA.debugLine="Private p_botMasMenc As Panel";
_p_botmasmenc = new anywheresoftware.b4a.objects.PanelWrapper();
 //BA.debugLineNum = 90;BA.debugLine="End Sub";
return "";
}
public String  _clv_prods_ll_itemclick(int _index,Object _value) throws Exception{
 //BA.debugLineNum = 1101;BA.debugLine="Private Sub clv_prods_ll_ItemClick (Index As Int,";
 //BA.debugLineNum = 1103;BA.debugLine="End Sub";
return "";
}
public String  _clv_prods_ll_visiblerangechanged(int _firstindex,int _lastindex) throws Exception{
int _extrasize = 0;
int _i = 0;
anywheresoftware.b4a.objects.B4XViewWrapper _pnl = null;
anywheresoftware.b4a.objects.CSBuilder _cs = null;
String _precio = "";
int _maxcajas = 0;
 //BA.debugLineNum = 1115;BA.debugLine="Private Sub clv_prods_ll_VisibleRangeChanged (Firs";
 //BA.debugLineNum = 1118;BA.debugLine="Dim ExtraSize As Int = 15 'List size";
_extrasize = (int) (15);
 //BA.debugLineNum = 1119;BA.debugLine="For i = Max(0, FirstIndex - ExtraSize) To Min(Las";
{
final int step2 = 1;
final int limit2 = (int) (__c.Min(_lastindex+_extrasize,_clv_prods_ll._getsize()-1));
_i = (int) (__c.Max(0,_firstindex-_extrasize)) ;
for (;_i <= limit2 ;_i = _i + step2 ) {
 //BA.debugLineNum = 1120;BA.debugLine="Dim Pnl As B4XView = clv_prods_ll.GetPanel(i)";
_pnl = new anywheresoftware.b4a.objects.B4XViewWrapper();
_pnl = _clv_prods_ll._getpanel(_i);
 //BA.debugLineNum = 1121;BA.debugLine="If i > FirstIndex - ExtraSize And i < LastIndex";
if (_i>_firstindex-_extrasize && _i<_lastindex+_extrasize) { 
 //BA.debugLineNum = 1123;BA.debugLine="If Pnl.NumberOfViews = 0 Then 'Add each item/la";
if (_pnl.getNumberOfViews()==0) { 
 //BA.debugLineNum = 1124;BA.debugLine="Pnl.LoadLayout(\"proditem\")";
_pnl.LoadLayout("proditem",ba);
 //BA.debugLineNum = 1126;BA.debugLine="p_prods.Width = Root.Width * 0.92";
_p_prods.setWidth((int) (_root.getWidth()*0.92));
 //BA.debugLineNum = 1127;BA.debugLine="p_botMasMen.Left = p_prods.Width - (p_botMasMe";
_p_botmasmen.setLeft((int) (_p_prods.getWidth()-(_p_botmasmen.getWidth()+5)));
 //BA.debugLineNum = 1128;BA.debugLine="p_botMasMenc.Left = p_prods.Width - (p_botMasM";
_p_botmasmenc.setLeft((int) (_p_prods.getWidth()-(_p_botmasmen.getWidth()+5)));
 //BA.debugLineNum = 1129;BA.debugLine="p_prods.Height = 134dip";
_p_prods.setHeight(__c.DipToCurrent((int) (134)));
 //BA.debugLineNum = 1137;BA.debugLine="Pnl.SetLayoutAnimated(0,0,0,Pnl.Width,145dip)";
_pnl.SetLayoutAnimated((int) (0),(int) (0),(int) (0),_pnl.getWidth(),__c.DipToCurrent((int) (145)));
 //BA.debugLineNum = 1138;BA.debugLine="Private cs As CSBuilder";
_cs = new anywheresoftware.b4a.objects.CSBuilder();
 //BA.debugLineNum = 1139;BA.debugLine="cs.Initialize";
_cs.Initialize();
 //BA.debugLineNum = 1140;BA.debugLine="l_prodX.SetTextSizeAnimated(0, 13)";
_l_prodx.SetTextSizeAnimated((int) (0),(float) (13));
 //BA.debugLineNum = 1141;BA.debugLine="If clv_prods_ll.GetValue(i).As(Map).Get(\"cant\"";
if (((anywheresoftware.b4a.objects.collections.Map) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.collections.Map(), (java.util.Map)(_clv_prods_ll._getvalue(_i)))).Get((Object)("cant"))!= null && (double)(BA.ObjectToNumber(((anywheresoftware.b4a.objects.collections.Map) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.collections.Map(), (java.util.Map)(_clv_prods_ll._getvalue(_i)))).Get((Object)("cant"))))>0) { 
 //BA.debugLineNum = 1142;BA.debugLine="p_prods.Color=0xFFE2EEFF";
_p_prods.setColor(((int)0xffe2eeff));
 //BA.debugLineNum = 1143;BA.debugLine="et_pCant.TextColor=Colors.Red";
_et_pcant.setTextColor(__c.Colors.Red);
 //BA.debugLineNum = 1144;BA.debugLine="et_pCantc.TextColor=Colors.Red";
_et_pcantc.setTextColor(__c.Colors.Red);
 //BA.debugLineNum = 1145;BA.debugLine="If Subs.pedidoGuardado Then";
if (_subs._pedidoguardado /*boolean*/ (ba)) { 
 //BA.debugLineNum = 1147;BA.debugLine="et_pCant.Enabled = False";
_et_pcant.setEnabled(__c.False);
 //BA.debugLineNum = 1149;BA.debugLine="b_prodMenos.Enabled = False";
_b_prodmenos.setEnabled(__c.False);
 };
 };
 //BA.debugLineNum = 1154;BA.debugLine="If Subs.pedidoGuardado Then";
if (_subs._pedidoguardado /*boolean*/ (ba)) { 
 //BA.debugLineNum = 1156;BA.debugLine="et_pCant.Enabled = False";
_et_pcant.setEnabled(__c.False);
 //BA.debugLineNum = 1157;BA.debugLine="b_prodMas.Enabled = False";
_b_prodmas.setEnabled(__c.False);
 //BA.debugLineNum = 1158;BA.debugLine="b_prodMenos.Enabled = False";
_b_prodmenos.setEnabled(__c.False);
 //BA.debugLineNum = 1159;BA.debugLine="b_prodMasc.Enabled = False";
_b_prodmasc.setEnabled(__c.False);
 //BA.debugLineNum = 1160;BA.debugLine="b_prodMenosc.Enabled = False";
_b_prodmenosc.setEnabled(__c.False);
 };
 //BA.debugLineNum = 1163;BA.debugLine="Private precio As String=NumberFormat2(clv_pro";
_precio = __c.NumberFormat2(((double)(BA.ObjectToNumber(((anywheresoftware.b4a.objects.collections.Map) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.collections.Map(), (java.util.Map)(_clv_prods_ll._getvalue(_i)))).Get((Object)("precio"))))),(int) (1),(int) (2),(int) (2),__c.False);
 //BA.debugLineNum = 1166;BA.debugLine="c = Starter.skmt.ExecQuery2(\"SELECT PE_BCAJAS";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery2("SELECT PE_BCAJAS FROM PEDIDO WHERE PE_PROID = ? AND PE_CLIENTE IN (SELECT CUENTA FROM CUENTAA) AND PE_FOLIO = ?",new String[]{BA.ObjectToString(((anywheresoftware.b4a.objects.collections.Map) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.collections.Map(), (java.util.Map)(_clv_prods_ll._getvalue(_i)))).Get((Object)("id"))),_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._tipo_venta /*String*/ })));
 //BA.debugLineNum = 1168;BA.debugLine="If c.RowCount = 0 Then";
if (_c.getRowCount()==0) { 
 //BA.debugLineNum = 1169;BA.debugLine="p_botMasMen.Visible = True";
_p_botmasmen.setVisible(__c.True);
 //BA.debugLineNum = 1170;BA.debugLine="p_botMasMenc.Visible = True";
_p_botmasmenc.setVisible(__c.True);
 }else if(_c.getRowCount()>0) { 
 //BA.debugLineNum = 1172;BA.debugLine="c.Position = 0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 1173;BA.debugLine="If c.GetString(\"PE_BCAJAS\") = \"0\" Then";
if ((_c.GetString("PE_BCAJAS")).equals("0")) { 
 //BA.debugLineNum = 1174;BA.debugLine="If clv_prods_ll.GetValue(i).As(Map).Get(\"can";
if (((anywheresoftware.b4a.objects.collections.Map) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.collections.Map(), (java.util.Map)(_clv_prods_ll._getvalue(_i)))).Get((Object)("cant"))!= null) { 
_et_pcant.setText(BA.ObjectToCharSequence(((anywheresoftware.b4a.objects.collections.Map) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.collections.Map(), (java.util.Map)(_clv_prods_ll._getvalue(_i)))).Get((Object)("cant"))));};
 //BA.debugLineNum = 1175;BA.debugLine="p_botMasMen.Visible = True";
_p_botmasmen.setVisible(__c.True);
 //BA.debugLineNum = 1176;BA.debugLine="p_botMasMenc.Visible = False";
_p_botmasmenc.setVisible(__c.False);
 }else if((_c.GetString("PE_BCAJAS")).equals("1")) { 
 //BA.debugLineNum = 1178;BA.debugLine="If clv_prods_ll.GetValue(i).As(Map).Get(\"can";
if (((anywheresoftware.b4a.objects.collections.Map) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.collections.Map(), (java.util.Map)(_clv_prods_ll._getvalue(_i)))).Get((Object)("cant"))!= null) { 
_et_pcantc.setText(BA.ObjectToCharSequence(((anywheresoftware.b4a.objects.collections.Map) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.collections.Map(), (java.util.Map)(_clv_prods_ll._getvalue(_i)))).Get((Object)("cant"))));};
 //BA.debugLineNum = 1179;BA.debugLine="p_botMasMen.Visible = False";
_p_botmasmen.setVisible(__c.False);
 //BA.debugLineNum = 1180;BA.debugLine="p_botMasMenc.Visible = True";
_p_botmasmenc.setVisible(__c.True);
 };
 };
 //BA.debugLineNum = 1198;BA.debugLine="If clv_prods_ll.GetValue(i).As(Map).Get(\"preci";
if (((float)(BA.ObjectToNumber(((anywheresoftware.b4a.objects.collections.Map) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.collections.Map(), (java.util.Map)(_clv_prods_ll._getvalue(_i)))).Get((Object)("precio_caja")))))==0 || ((int)(BA.ObjectToNumber(((anywheresoftware.b4a.objects.collections.Map) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.collections.Map(), (java.util.Map)(_clv_prods_ll._getvalue(_i)))).Get((Object)("conversion")))))==1) { 
 //BA.debugLineNum = 1199;BA.debugLine="Private maxcajas As Int = 0";
_maxcajas = (int) (0);
 //BA.debugLineNum = 1200;BA.debugLine="Log(\"cajas a 0\")";
__c.LogImpl("750397269","cajas a 0",0);
 }else {
 //BA.debugLineNum = 1202;BA.debugLine="Private maxcajas As Int = clv_prods_ll.GetVal";
_maxcajas = (int) ((double)(BA.ObjectToNumber(((anywheresoftware.b4a.objects.collections.Map) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.collections.Map(), (java.util.Map)(_clv_prods_ll._getvalue(_i)))).Get((Object)("almacen"))))/(double)(double)(BA.ObjectToNumber(((anywheresoftware.b4a.objects.collections.Map) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.collections.Map(), (java.util.Map)(_clv_prods_ll._getvalue(_i)))).Get((Object)("conversion")))));
 };
 //BA.debugLineNum = 1206;BA.debugLine="l_prodX.Text = cs.Color(Colors.red).append(clv";
_l_prodx.setText(BA.ObjectToCharSequence(_cs.Color(__c.Colors.Red).Append(BA.ObjectToCharSequence(((anywheresoftware.b4a.objects.collections.Map) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.collections.Map(), (java.util.Map)(_clv_prods_ll._getvalue(_i)))).Get((Object)("prod")))).Pop().Append(BA.ObjectToCharSequence(__c.CRLF)).Append(BA.ObjectToCharSequence("Existencias: "+BA.ObjectToString(((anywheresoftware.b4a.objects.collections.Map) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.collections.Map(), (java.util.Map)(_clv_prods_ll._getvalue(_i)))).Get((Object)("almacen"))))).Color(((int)0xff017f01)).Append(BA.ObjectToCharSequence(("$"+__c.SmartStringFormatter("",(Object)(_precio))+""+__c.SmartStringFormatter("",(Object)(__c.CRLF))+"Max. Cajas: "+__c.SmartStringFormatter("",(Object)(_maxcajas))+""))).PopAll().getObject()));
 //BA.debugLineNum = 1210;BA.debugLine="If (clv_prods_ll.GetValue(i).As(Map).Get(\"conv";
if (((((anywheresoftware.b4a.objects.collections.Map) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.collections.Map(), (java.util.Map)(_clv_prods_ll._getvalue(_i)))).Get((Object)("conversion"))).equals(((anywheresoftware.b4a.objects.collections.Map) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.collections.Map(), (java.util.Map)(_clv_prods_ll._getvalue(_i)))).Get((Object)("minimo")))) && (double)(BA.ObjectToNumber(((anywheresoftware.b4a.objects.collections.Map) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.collections.Map(), (java.util.Map)(_clv_prods_ll._getvalue(_i)))).Get((Object)("conversion"))))>(double)(Double.parseDouble("1")) && (double)(BA.ObjectToNumber(((anywheresoftware.b4a.objects.collections.Map) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.collections.Map(), (java.util.Map)(_clv_prods_ll._getvalue(_i)))).Get((Object)("minimo"))))>(double)(Double.parseDouble("1"))) { 
 //BA.debugLineNum = 1211;BA.debugLine="p_botMasMenc.Visible = True";
_p_botmasmenc.setVisible(__c.True);
 //BA.debugLineNum = 1212;BA.debugLine="p_botMasMen.Visible = False";
_p_botmasmen.setVisible(__c.False);
 }else if((((anywheresoftware.b4a.objects.collections.Map) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.collections.Map(), (java.util.Map)(_clv_prods_ll._getvalue(_i)))).Get((Object)("conversion"))).equals((Object)("1")) || (((anywheresoftware.b4a.objects.collections.Map) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.collections.Map(), (java.util.Map)(_clv_prods_ll._getvalue(_i)))).Get((Object)("precio_caja"))).equals((Object)("0.0"))) { 
 //BA.debugLineNum = 1214;BA.debugLine="p_botMasMenc.Visible = False";
_p_botmasmenc.setVisible(__c.False);
 };
 //BA.debugLineNum = 1217;BA.debugLine="If clv_prods_ll.GetValue(i).As(Map).Get(\"almac";
if ((double)(BA.ObjectToNumber(((anywheresoftware.b4a.objects.collections.Map) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.collections.Map(), (java.util.Map)(_clv_prods_ll._getvalue(_i)))).Get((Object)("almacen"))))<(double)(BA.ObjectToNumber(((anywheresoftware.b4a.objects.collections.Map) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.collections.Map(), (java.util.Map)(_clv_prods_ll._getvalue(_i)))).Get((Object)("conversion"))))) { 
 //BA.debugLineNum = 1218;BA.debugLine="Log(clv_prods_ll.GetValue(i).As(Map).Get(\"can";
__c.LogImpl("750397287",BA.ObjectToString(((anywheresoftware.b4a.objects.collections.Map) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.collections.Map(), (java.util.Map)(_clv_prods_ll._getvalue(_i)))).Get((Object)("cant"))),0);
 //BA.debugLineNum = 1219;BA.debugLine="If clv_prods_ll.GetValue(i).As(Map).Get(\"cant";
if (((int)(BA.ObjectToNumber(((anywheresoftware.b4a.objects.collections.Map) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.collections.Map(), (java.util.Map)(_clv_prods_ll._getvalue(_i)))).Get((Object)("cant")))))==0) { 
 //BA.debugLineNum = 1220;BA.debugLine="Log(\"Aqui debemos ponerlo invisible\")";
__c.LogImpl("750397289","Aqui debemos ponerlo invisible",0);
 //BA.debugLineNum = 1221;BA.debugLine="p_botMasMenc.Visible = False";
_p_botmasmenc.setVisible(__c.False);
 }else {
 };
 };
 };
 }else {
 };
 //BA.debugLineNum = 1235;BA.debugLine="PCLV.B4XSeekBar1.Value = clv_prods_ll.Size - Fir";
_pclv._b4xseekbar1 /*medicomed.keymon.com.mx.b4xseekbar*/ ._setvalue /*int*/ ((int) (_clv_prods_ll._getsize()-_firstindex));
 }
};
 //BA.debugLineNum = 1238;BA.debugLine="End Sub";
return "";
}
public anywheresoftware.b4a.objects.PanelWrapper  _createlistitem(String _text,String _preciou,int _inv,int _width,int _height,anywheresoftware.b4a.objects.drawable.CanvasWrapper.BitmapWrapper _img,String _prodid,int _bc,int _tc) throws Exception{
 //BA.debugLineNum = 528;BA.debugLine="Sub CreateListItem(Text As String, precioU As Stri";
 //BA.debugLineNum = 543;BA.debugLine="End Sub";
return null;
}
public String  _cuentaprods() throws Exception{
 //BA.debugLineNum = 813;BA.debugLine="Sub cuentaProds";
 //BA.debugLineNum = 815;BA.debugLine="Log(\"===========================\")";
__c.LogImpl("749479682","===========================",0);
 //BA.debugLineNum = 816;BA.debugLine="Private c As Cursor = B4XPages.MainPage.skmt.Exec";
_c = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery(("select sum(PE_COSTO_TOT) as total, sum(PE_CANT) as cant from PEDIDO where PE_CLIENTE = '"+__c.SmartStringFormatter("",(Object)(_clienteid))+"'"))));
 //BA.debugLineNum = 819;BA.debugLine="p_botonesVenta.Visible = True";
_p_botonesventa.setVisible(__c.True);
 //BA.debugLineNum = 820;BA.debugLine="p_botonesVenta.BringToFront";
_p_botonesventa.BringToFront();
 //BA.debugLineNum = 821;BA.debugLine="c.Position=0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 823;BA.debugLine="c.Close";
_c.Close();
 //BA.debugLineNum = 825;BA.debugLine="If Subs.hayPedido Then p_botonesVenta.Visible = T";
if (_subs._haypedido /*boolean*/ (ba)) { 
_p_botonesventa.setVisible(__c.True);};
 //BA.debugLineNum = 828;BA.debugLine="End Sub";
return "";
}
public String  _et_pcant_focuschanged(boolean _hasfocus) throws Exception{
int _index = 0;
anywheresoftware.b4a.objects.B4XViewWrapper _pnl0 = null;
anywheresoftware.b4a.objects.B4XViewWrapper _pnl = null;
anywheresoftware.b4a.objects.B4XViewWrapper _lacant = null;
anywheresoftware.b4a.objects.B4XViewWrapper _lacant2 = null;
String _id = "";
 //BA.debugLineNum = 696;BA.debugLine="Private Sub et_pCant_FocusChanged (HasFocus As Boo";
 //BA.debugLineNum = 697;BA.debugLine="LogColor($\"focus changed=${HasFocus}\"$, Colors.Ma";
__c.LogImpl("749348609",("focus changed="+__c.SmartStringFormatter("",(Object)(_hasfocus))+""),__c.Colors.Magenta);
 //BA.debugLineNum = 698;BA.debugLine="If et_pCant.Text = \"\" Then et_pCant.Text = \"0\"";
if ((_et_pcant.getText()).equals("")) { 
_et_pcant.setText(BA.ObjectToCharSequence("0"));};
 //BA.debugLineNum = 699;BA.debugLine="Dim index As Int = clv_prods_ll.GetItemFromView(S";
_index = _clv_prods_ll._getitemfromview((anywheresoftware.b4a.objects.B4XViewWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.B4XViewWrapper(), (java.lang.Object)(__c.Sender(ba))));
 //BA.debugLineNum = 700;BA.debugLine="Dim pnl0 As B4XView = clv_prods_ll.GetPanel(index";
_pnl0 = new anywheresoftware.b4a.objects.B4XViewWrapper();
_pnl0 = _clv_prods_ll._getpanel(_index);
 //BA.debugLineNum = 701;BA.debugLine="Dim pnl As B4XView = pnl0.GetView(0)";
_pnl = new anywheresoftware.b4a.objects.B4XViewWrapper();
_pnl = _pnl0.GetView((int) (0));
 //BA.debugLineNum = 702;BA.debugLine="Dim laCant As B4XView = pnl.GetView(2).GetView(2)";
_lacant = new anywheresoftware.b4a.objects.B4XViewWrapper();
_lacant = _pnl.GetView((int) (2)).GetView((int) (2));
 //BA.debugLineNum = 703;BA.debugLine="Dim laCant2 As B4XView = pnl.GetView(3).GetView(2";
_lacant2 = new anywheresoftware.b4a.objects.B4XViewWrapper();
_lacant2 = _pnl.GetView((int) (3)).GetView((int) (2));
 //BA.debugLineNum = 704;BA.debugLine="Private id As String=clv_prods_ll.GetValue(index)";
_id = BA.ObjectToString(((anywheresoftware.b4a.objects.collections.Map) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.collections.Map(), (java.util.Map)(_clv_prods_ll._getvalue(_index)))).Get((Object)("id")));
 //BA.debugLineNum = 705;BA.debugLine="If laCant.Text = \"\" Then laCant.Text = \"0\"";
if ((_lacant.getText()).equals("")) { 
_lacant.setText(BA.ObjectToCharSequence("0"));};
 //BA.debugLineNum = 706;BA.debugLine="etCantHasFocus = HasFocus";
_etcanthasfocus = _hasfocus;
 //BA.debugLineNum = 707;BA.debugLine="LogColor(laCant.Text,Colors.Red)";
__c.LogImpl("749348619",_lacant.getText(),__c.Colors.Red);
 //BA.debugLineNum = 708;BA.debugLine="If laCant2.IsInitialized Then";
if (_lacant2.IsInitialized()) { 
 //BA.debugLineNum = 709;BA.debugLine="totalcajasmaspiezas = laCant.Text + laCant2.Text";
_totalcajasmaspiezas = (int) ((double)(Double.parseDouble(_lacant.getText()))+(double)(Double.parseDouble(_lacant2.getText())));
 }else {
 //BA.debugLineNum = 711;BA.debugLine="totalcajasmaspiezas = laCant.Text";
_totalcajasmaspiezas = (int)(Double.parseDouble(_lacant.getText()));
 };
 //BA.debugLineNum = 713;BA.debugLine="invTotal = totalcajasmaspiezas + Subs.traeinventa";
_invtotal = (int) (_totalcajasmaspiezas+(double)(Double.parseDouble(_subs._traeinventario /*String*/ (ba,_id))));
 //BA.debugLineNum = 716;BA.debugLine="cuentaProds";
_cuentaprods();
 //BA.debugLineNum = 717;BA.debugLine="End Sub";
return "";
}
public String  _et_pcant_textchanged(String _old,String _new) throws Exception{
int _index = 0;
anywheresoftware.b4a.objects.B4XViewWrapper _pnl0 = null;
anywheresoftware.b4a.objects.B4XViewWrapper _pnl = null;
anywheresoftware.b4a.objects.B4XViewWrapper _lacant = null;
anywheresoftware.b4a.objects.B4XViewWrapper _lacant2 = null;
anywheresoftware.b4a.objects.B4XViewWrapper _lprodx = null;
String _id = "";
String _precio = "";
String _inv = "";
String _nombrex = "";
anywheresoftware.b4a.objects.B4XViewWrapper _panelcajas = null;
anywheresoftware.b4a.objects.B4XViewWrapper _panelpiezas = null;
anywheresoftware.b4a.objects.CSBuilder _cs = null;
anywheresoftware.b4a.sql.SQL.CursorWrapper _o = null;
String _invactualizado = "";
int _maxcajas = 0;
 //BA.debugLineNum = 719;BA.debugLine="Private Sub et_pCant_TextChanged (Old As String, N";
 //BA.debugLineNum = 722;BA.debugLine="If etCantHasFocus = True Then";
if (_etcanthasfocus==__c.True) { 
 //BA.debugLineNum = 723;BA.debugLine="LogColor($\"txt changed: ${Old}|${New}, hasfocus=";
__c.LogImpl("749414148",("txt changed: "+__c.SmartStringFormatter("",(Object)(_old))+"|"+__c.SmartStringFormatter("",(Object)(_new))+", hasfocus="+__c.SmartStringFormatter("",(Object)(_etcanthasfocus))+""),__c.Colors.Magenta);
 //BA.debugLineNum = 724;BA.debugLine="Dim index As Int = clv_prods_ll.GetItemFromView(";
_index = _clv_prods_ll._getitemfromview((anywheresoftware.b4a.objects.B4XViewWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.B4XViewWrapper(), (java.lang.Object)(__c.Sender(ba))));
 //BA.debugLineNum = 725;BA.debugLine="Dim pnl0 As B4XView = clv_prods_ll.GetPanel(inde";
_pnl0 = new anywheresoftware.b4a.objects.B4XViewWrapper();
_pnl0 = _clv_prods_ll._getpanel(_index);
 //BA.debugLineNum = 726;BA.debugLine="Dim pnl As B4XView = pnl0.GetView(0)";
_pnl = new anywheresoftware.b4a.objects.B4XViewWrapper();
_pnl = _pnl0.GetView((int) (0));
 //BA.debugLineNum = 727;BA.debugLine="Dim laCant As B4XView = pnl.GetView(2).GetView(2";
_lacant = new anywheresoftware.b4a.objects.B4XViewWrapper();
_lacant = _pnl.GetView((int) (2)).GetView((int) (2));
 //BA.debugLineNum = 728;BA.debugLine="Dim laCant2 As B4XView = pnl.GetView(3).GetView(";
_lacant2 = new anywheresoftware.b4a.objects.B4XViewWrapper();
_lacant2 = _pnl.GetView((int) (3)).GetView((int) (2));
 //BA.debugLineNum = 729;BA.debugLine="Dim lProdX As B4XView = pnl.GetView(1)";
_lprodx = new anywheresoftware.b4a.objects.B4XViewWrapper();
_lprodx = _pnl.GetView((int) (1));
 //BA.debugLineNum = 730;BA.debugLine="Private id As String=clv_prods_ll.GetValue(index";
_id = BA.ObjectToString(((anywheresoftware.b4a.objects.collections.Map) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.collections.Map(), (java.util.Map)(_clv_prods_ll._getvalue(_index)))).Get((Object)("id")));
 //BA.debugLineNum = 731;BA.debugLine="Private precio As String=clv_prods_ll.GetValue(i";
_precio = BA.ObjectToString(((anywheresoftware.b4a.objects.collections.Map) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.collections.Map(), (java.util.Map)(_clv_prods_ll._getvalue(_index)))).Get((Object)("precio")));
 //BA.debugLineNum = 732;BA.debugLine="Private inv As String=clv_prods_ll.GetValue(inde";
_inv = BA.ObjectToString(((anywheresoftware.b4a.objects.collections.Map) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.collections.Map(), (java.util.Map)(_clv_prods_ll._getvalue(_index)))).Get((Object)("almacen")));
 //BA.debugLineNum = 733;BA.debugLine="Private inv As String=Subs.traeinventario(id)";
_inv = _subs._traeinventario /*String*/ (ba,_id);
 //BA.debugLineNum = 734;BA.debugLine="Private nombreX As String = Subs.traeProdNombre(";
_nombrex = _subs._traeprodnombre /*String*/ (ba,_id);
 //BA.debugLineNum = 735;BA.debugLine="Dim panelcajas As B4XView = pnl.GetView(3)";
_panelcajas = new anywheresoftware.b4a.objects.B4XViewWrapper();
_panelcajas = _pnl.GetView((int) (3));
 //BA.debugLineNum = 736;BA.debugLine="Dim panelpiezas As B4XView = pnl.GetView(2)";
_panelpiezas = new anywheresoftware.b4a.objects.B4XViewWrapper();
_panelpiezas = _pnl.GetView((int) (2));
 //BA.debugLineNum = 739;BA.debugLine="If(New = \"\" Or New = Null Or New = \"-\") Then New";
if (((_new).equals("") || _new== null || (_new).equals("-"))) { 
_new = BA.NumberToString(0);};
 //BA.debugLineNum = 741;BA.debugLine="If(New > invTotal) Then";
if (((double)(Double.parseDouble(_new))>_invtotal)) { 
 //BA.debugLineNum = 742;BA.debugLine="Sender.As(EditText).text = invTotal";
((anywheresoftware.b4a.objects.EditTextWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.EditTextWrapper(), (android.widget.EditText)(__c.Sender(ba)))).setText(BA.ObjectToCharSequence(_invtotal));
 };
 //BA.debugLineNum = 746;BA.debugLine="If New = \"\" Then New = 0";
if ((_new).equals("")) { 
_new = BA.NumberToString(0);};
 //BA.debugLineNum = 747;BA.debugLine="If laCant.Text = \"\" Then laCant.Text = 0";
if ((_lacant.getText()).equals("")) { 
_lacant.setText(BA.ObjectToCharSequence(0));};
 //BA.debugLineNum = 748;BA.debugLine="LogColor(laCant.Text,Colors.Red)";
__c.LogImpl("749414173",_lacant.getText(),__c.Colors.Red);
 //BA.debugLineNum = 750;BA.debugLine="If New > 0 Then";
if ((double)(Double.parseDouble(_new))>0) { 
 //BA.debugLineNum = 751;BA.debugLine="panelcajas.Visible = False";
_panelcajas.setVisible(__c.False);
 }else if((_new).equals(BA.NumberToString(0))) { 
 //BA.debugLineNum = 754;BA.debugLine="panelcajas.Visible = True";
_panelcajas.setVisible(__c.True);
 };
 //BA.debugLineNum = 762;BA.debugLine="If Not(Old = \"0\" And New = \"\") And laCant.Text <";
if (__c.Not((_old).equals("0") && (_new).equals("")) && _lacant.getText()!= null && (_lacant.getText()).equals("") == false && _etcanthasfocus) { 
 //BA.debugLineNum = 763;BA.debugLine="Log(\"actualizamos producto\")";
__c.LogImpl("749414188","actualizamos producto",0);
 //BA.debugLineNum = 764;BA.debugLine="Subs.actualizaProducto(Subs.traeAlmacen, precio";
_subs._actualizaproducto /*String*/ (ba,_subs._traealmacen /*String*/ (ba),_precio,(int)(Double.parseDouble(_lacant.getText())),_subs._traeprodnombre /*String*/ (ba,_id),_id,_clienteid,_subs._traefecha /*String*/ (ba),_subs._traeusuariodebd /*String*/ (ba),_rutausuario,BA.NumberToString(0),_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._tipo_venta /*String*/ ,BA.NumberToString(0),BA.NumberToString(0));
 //BA.debugLineNum = 765;BA.debugLine="cuentaProds";
_cuentaprods();
 };
 //BA.debugLineNum = 778;BA.debugLine="If 1 = 1 Then";
if (1==1) { 
 //BA.debugLineNum = 779;BA.debugLine="Private cs As CSBuilder";
_cs = new anywheresoftware.b4a.objects.CSBuilder();
 //BA.debugLineNum = 780;BA.debugLine="cs.Initialize";
_cs.Initialize();
 //BA.debugLineNum = 781;BA.debugLine="Private o As Cursor = Starter.skmt.ExecQuery($\"";
_o = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_o = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery(("select CAT_GP_ALMACEN from "+__c.SmartStringFormatter("",(Object)(_starter._tabla /*String*/ ))+" where CAT_GP_ID = '"+__c.SmartStringFormatter("",(Object)(_id))+"'"))));
 //BA.debugLineNum = 782;BA.debugLine="Private invActualizado As String = \"0\"";
_invactualizado = "0";
 //BA.debugLineNum = 784;BA.debugLine="o.Position = 0";
_o.setPosition((int) (0));
 //BA.debugLineNum = 785;BA.debugLine="invActualizado = Subs.traeinventario(id)";
_invactualizado = _subs._traeinventario /*String*/ (ba,_id);
 //BA.debugLineNum = 786;BA.debugLine="Log(Subs.traeinventario(id))";
__c.LogImpl("749414211",_subs._traeinventario /*String*/ (ba,_id),0);
 //BA.debugLineNum = 789;BA.debugLine="If New = \"\" Then New = 0";
if ((_new).equals("")) { 
_new = BA.NumberToString(0);};
 //BA.debugLineNum = 790;BA.debugLine="If clv_prods_ll.GetValue(index).As(Map).Get(\"pr";
if (((float)(BA.ObjectToNumber(((anywheresoftware.b4a.objects.collections.Map) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.collections.Map(), (java.util.Map)(_clv_prods_ll._getvalue(_index)))).Get((Object)("precio_caja")))))==0 || ((int)(BA.ObjectToNumber(((anywheresoftware.b4a.objects.collections.Map) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.collections.Map(), (java.util.Map)(_clv_prods_ll._getvalue(_index)))).Get((Object)("conversion")))))==1) { 
 //BA.debugLineNum = 791;BA.debugLine="Private maxcajas As Int = 0";
_maxcajas = (int) (0);
 //BA.debugLineNum = 792;BA.debugLine="Log(\"cajas a 0\")";
__c.LogImpl("749414217","cajas a 0",0);
 }else {
 //BA.debugLineNum = 794;BA.debugLine="Private maxcajas As Int = invActualizado/clv_p";
_maxcajas = (int) ((double)(Double.parseDouble(_invactualizado))/(double)(double)(BA.ObjectToNumber(((anywheresoftware.b4a.objects.collections.Map) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.collections.Map(), (java.util.Map)(_clv_prods_ll._getvalue(_index)))).Get((Object)("conversion")))));
 //BA.debugLineNum = 795;BA.debugLine="Log(\"cajas no a 0\")";
__c.LogImpl("749414220","cajas no a 0",0);
 };
 //BA.debugLineNum = 797;BA.debugLine="lProdX.Text = cs.Color(Colors.red).append(nombr";
_lprodx.setText(BA.ObjectToCharSequence(_cs.Color(__c.Colors.Red).Append(BA.ObjectToCharSequence(_nombrex)).Pop().Append(BA.ObjectToCharSequence(__c.CRLF)).Append(BA.ObjectToCharSequence("Existencias: "+(_subs._traeinventario /*String*/ (ba,_id)))).Color(((int)0xff017f01)).Append(BA.ObjectToCharSequence(("   $"+__c.SmartStringFormatter("",(Object)(__c.NumberFormat2((double)(Double.parseDouble(_precio)),(int) (1),(int) (2),(int) (2),__c.False)))+""+__c.SmartStringFormatter("",(Object)(__c.CRLF))+"Max. Cajas: "+__c.SmartStringFormatter("",(Object)(_maxcajas))+""))).PopAll().getObject()));
 //BA.debugLineNum = 799;BA.debugLine="If New > 0 Then";
if ((double)(Double.parseDouble(_new))>0) { 
 //BA.debugLineNum = 800;BA.debugLine="panelcajas.Visible = False";
_panelcajas.setVisible(__c.False);
 }else if((_new).equals(BA.NumberToString(0))) { 
 //BA.debugLineNum = 802;BA.debugLine="If maxcajas = 0 Then";
if (_maxcajas==0) { 
 //BA.debugLineNum = 803;BA.debugLine="panelcajas.Visible = False";
_panelcajas.setVisible(__c.False);
 }else {
 //BA.debugLineNum = 805;BA.debugLine="panelcajas.Visible = True";
_panelcajas.setVisible(__c.True);
 };
 };
 };
 };
 //BA.debugLineNum = 811;BA.debugLine="End Sub";
return "";
}
public String  _et_pcantc_focuschanged(boolean _hasfocus) throws Exception{
int _index = 0;
anywheresoftware.b4a.objects.B4XViewWrapper _pnl0 = null;
anywheresoftware.b4a.objects.B4XViewWrapper _pnl = null;
anywheresoftware.b4a.objects.B4XViewWrapper _lacant = null;
anywheresoftware.b4a.objects.B4XViewWrapper _lacant2 = null;
String _id = "";
 //BA.debugLineNum = 1562;BA.debugLine="Private Sub et_pCantc_FocusChanged (HasFocus As Bo";
 //BA.debugLineNum = 1563;BA.debugLine="LogColor($\"focus changed=${HasFocus}\"$, Colors.Ma";
__c.LogImpl("750659329",("focus changed="+__c.SmartStringFormatter("",(Object)(_hasfocus))+""),__c.Colors.Magenta);
 //BA.debugLineNum = 1564;BA.debugLine="If et_pCantc.Text = \"\" Then et_pCantc.Text = \"0\"";
if ((_et_pcantc.getText()).equals("")) { 
_et_pcantc.setText(BA.ObjectToCharSequence("0"));};
 //BA.debugLineNum = 1565;BA.debugLine="Dim index As Int = clv_prods_ll.GetItemFromView(S";
_index = _clv_prods_ll._getitemfromview((anywheresoftware.b4a.objects.B4XViewWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.B4XViewWrapper(), (java.lang.Object)(__c.Sender(ba))));
 //BA.debugLineNum = 1566;BA.debugLine="Dim pnl0 As B4XView = clv_prods_ll.GetPanel(index";
_pnl0 = new anywheresoftware.b4a.objects.B4XViewWrapper();
_pnl0 = _clv_prods_ll._getpanel(_index);
 //BA.debugLineNum = 1567;BA.debugLine="Dim pnl As B4XView = pnl0.GetView(0)";
_pnl = new anywheresoftware.b4a.objects.B4XViewWrapper();
_pnl = _pnl0.GetView((int) (0));
 //BA.debugLineNum = 1568;BA.debugLine="Dim laCant As B4XView = pnl.GetView(2).GetView(2)";
_lacant = new anywheresoftware.b4a.objects.B4XViewWrapper();
_lacant = _pnl.GetView((int) (2)).GetView((int) (2));
 //BA.debugLineNum = 1569;BA.debugLine="Dim laCant2 As B4XView = pnl.GetView(3).GetView(2";
_lacant2 = new anywheresoftware.b4a.objects.B4XViewWrapper();
_lacant2 = _pnl.GetView((int) (3)).GetView((int) (2));
 //BA.debugLineNum = 1570;BA.debugLine="Private id As String=clv_prods_ll.GetValue(index)";
_id = BA.ObjectToString(((anywheresoftware.b4a.objects.collections.Map) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.collections.Map(), (java.util.Map)(_clv_prods_ll._getvalue(_index)))).Get((Object)("id")));
 //BA.debugLineNum = 1571;BA.debugLine="If laCant2.Text = \"\" Then laCant2.Text = \"0\"";
if ((_lacant2.getText()).equals("")) { 
_lacant2.setText(BA.ObjectToCharSequence("0"));};
 //BA.debugLineNum = 1572;BA.debugLine="etCantHasFocus = HasFocus";
_etcanthasfocus = _hasfocus;
 //BA.debugLineNum = 1579;BA.debugLine="invTotal = totalcajasmaspiezas + Subs.traeinventa";
_invtotal = (int) (_totalcajasmaspiezas+(double)(Double.parseDouble(_subs._traeinventario /*String*/ (ba,_id))));
 //BA.debugLineNum = 1582;BA.debugLine="cuentaProds";
_cuentaprods();
 //BA.debugLineNum = 1583;BA.debugLine="End Sub";
return "";
}
public String  _et_pcantc_textchanged(String _old,String _new) throws Exception{
int _index = 0;
anywheresoftware.b4a.objects.B4XViewWrapper _pnl0 = null;
anywheresoftware.b4a.objects.B4XViewWrapper _pnl = null;
anywheresoftware.b4a.objects.B4XViewWrapper _lacant = null;
anywheresoftware.b4a.objects.B4XViewWrapper _lacant2 = null;
anywheresoftware.b4a.objects.B4XViewWrapper _lprodx = null;
String _id = "";
String _precio = "";
String _inv = "";
String _nombrex = "";
anywheresoftware.b4a.objects.B4XViewWrapper _panelcajas = null;
anywheresoftware.b4a.objects.B4XViewWrapper _panelpiezas = null;
String _conversion = "";
String _preciocaja = "";
int _totalcajaspermi = 0;
anywheresoftware.b4a.objects.CSBuilder _cs = null;
anywheresoftware.b4a.sql.SQL.CursorWrapper _o = null;
String _invactualizado = "";
int _maxcajas2 = 0;
 //BA.debugLineNum = 1585;BA.debugLine="Private Sub et_pCantc_TextChanged (Old As String,";
 //BA.debugLineNum = 1588;BA.debugLine="If etCantHasFocus = True Then";
if (_etcanthasfocus==__c.True) { 
 //BA.debugLineNum = 1591;BA.debugLine="Dim index As Int = clv_prods_ll.GetItemFromView(";
_index = _clv_prods_ll._getitemfromview((anywheresoftware.b4a.objects.B4XViewWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.B4XViewWrapper(), (java.lang.Object)(__c.Sender(ba))));
 //BA.debugLineNum = 1592;BA.debugLine="Dim pnl0 As B4XView = clv_prods_ll.GetPanel(inde";
_pnl0 = new anywheresoftware.b4a.objects.B4XViewWrapper();
_pnl0 = _clv_prods_ll._getpanel(_index);
 //BA.debugLineNum = 1593;BA.debugLine="Dim pnl As B4XView = pnl0.GetView(0)";
_pnl = new anywheresoftware.b4a.objects.B4XViewWrapper();
_pnl = _pnl0.GetView((int) (0));
 //BA.debugLineNum = 1594;BA.debugLine="Dim laCant As B4XView = pnl.GetView(2).GetView(2";
_lacant = new anywheresoftware.b4a.objects.B4XViewWrapper();
_lacant = _pnl.GetView((int) (2)).GetView((int) (2));
 //BA.debugLineNum = 1595;BA.debugLine="Dim laCant2 As B4XView = pnl.GetView(3).GetView(";
_lacant2 = new anywheresoftware.b4a.objects.B4XViewWrapper();
_lacant2 = _pnl.GetView((int) (3)).GetView((int) (2));
 //BA.debugLineNum = 1596;BA.debugLine="Dim lProdX As B4XView = pnl.GetView(1)";
_lprodx = new anywheresoftware.b4a.objects.B4XViewWrapper();
_lprodx = _pnl.GetView((int) (1));
 //BA.debugLineNum = 1597;BA.debugLine="Private id As String=clv_prods_ll.GetValue(index";
_id = BA.ObjectToString(((anywheresoftware.b4a.objects.collections.Map) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.collections.Map(), (java.util.Map)(_clv_prods_ll._getvalue(_index)))).Get((Object)("id")));
 //BA.debugLineNum = 1598;BA.debugLine="Private precio As String=clv_prods_ll.GetValue(i";
_precio = BA.ObjectToString(((anywheresoftware.b4a.objects.collections.Map) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.collections.Map(), (java.util.Map)(_clv_prods_ll._getvalue(_index)))).Get((Object)("precio")));
 //BA.debugLineNum = 1599;BA.debugLine="Private inv As String=clv_prods_ll.GetValue(inde";
_inv = BA.ObjectToString(((anywheresoftware.b4a.objects.collections.Map) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.collections.Map(), (java.util.Map)(_clv_prods_ll._getvalue(_index)))).Get((Object)("almacen")));
 //BA.debugLineNum = 1600;BA.debugLine="Private inv As String=Subs.traeinventario(id)";
_inv = _subs._traeinventario /*String*/ (ba,_id);
 //BA.debugLineNum = 1601;BA.debugLine="Private nombreX As String = Subs.traeProdNombre(";
_nombrex = _subs._traeprodnombre /*String*/ (ba,_id);
 //BA.debugLineNum = 1602;BA.debugLine="Dim panelcajas As B4XView = pnl.GetView(3)";
_panelcajas = new anywheresoftware.b4a.objects.B4XViewWrapper();
_panelcajas = _pnl.GetView((int) (3));
 //BA.debugLineNum = 1603;BA.debugLine="Dim panelpiezas As B4XView = pnl.GetView(2)";
_panelpiezas = new anywheresoftware.b4a.objects.B4XViewWrapper();
_panelpiezas = _pnl.GetView((int) (2));
 //BA.debugLineNum = 1604;BA.debugLine="Private conversion As String = clv_prods_ll.GetV";
_conversion = BA.ObjectToString(((anywheresoftware.b4a.objects.collections.Map) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.collections.Map(), (java.util.Map)(_clv_prods_ll._getvalue(_index)))).Get((Object)("conversion")));
 //BA.debugLineNum = 1605;BA.debugLine="Private preciocaja As String = clv_prods_ll.GetV";
_preciocaja = BA.ObjectToString(((anywheresoftware.b4a.objects.collections.Map) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.collections.Map(), (java.util.Map)(_clv_prods_ll._getvalue(_index)))).Get((Object)("precio_caja")));
 //BA.debugLineNum = 1607;BA.debugLine="invTotal = Subs.traeinventario(id)";
_invtotal = (int)(Double.parseDouble(_subs._traeinventario /*String*/ (ba,_id)));
 //BA.debugLineNum = 1608;BA.debugLine="Log(\"inventario total \"& invTotal)";
__c.LogImpl("750724887","inventario total "+BA.NumberToString(_invtotal),0);
 //BA.debugLineNum = 1609;BA.debugLine="If(New = \"\" Or New = Null Or New = \"-\") Then New";
if (((_new).equals("") || _new== null || (_new).equals("-"))) { 
_new = BA.NumberToString(0);};
 //BA.debugLineNum = 1611;BA.debugLine="Log(($\"new*conversion  ${New * conversion} > ${i";
__c.LogImpl("750724890",(("new*conversion  "+__c.SmartStringFormatter("",(Object)((double)(Double.parseDouble(_new))*(double)(Double.parseDouble(_conversion))))+" > "+__c.SmartStringFormatter("",(Object)(_invtotal))+" =  "+__c.SmartStringFormatter("",(Object)((((double)(Double.parseDouble(_new))*(double)(Double.parseDouble(_conversion)))>_invtotal)))+"")),0);
 //BA.debugLineNum = 1612;BA.debugLine="If((New * conversion)  > invTotal) Then";
if ((((double)(Double.parseDouble(_new))*(double)(Double.parseDouble(_conversion)))>_invtotal)) { 
 //BA.debugLineNum = 1614;BA.debugLine="Sender.As(EditText).text = 0";
((anywheresoftware.b4a.objects.EditTextWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.EditTextWrapper(), (android.widget.EditText)(__c.Sender(ba)))).setText(BA.ObjectToCharSequence(0));
 //BA.debugLineNum = 1615;BA.debugLine="New = 0";
_new = BA.NumberToString(0);
 //BA.debugLineNum = 1617;BA.debugLine="pnl.GetView(2).Visible = True";
_pnl.GetView((int) (2)).setVisible(__c.True);
 //BA.debugLineNum = 1618;BA.debugLine="Log(\"ponemos en 0\")";
__c.LogImpl("750724897","ponemos en 0",0);
 };
 //BA.debugLineNum = 1622;BA.debugLine="Log(\"inventario total despues de max \"& invTotal";
__c.LogImpl("750724901","inventario total despues de max "+BA.NumberToString(_invtotal),0);
 //BA.debugLineNum = 1624;BA.debugLine="If New = \"\" Then New = 0";
if ((_new).equals("")) { 
_new = BA.NumberToString(0);};
 //BA.debugLineNum = 1625;BA.debugLine="If laCant2.Text = \"\" Then laCant2.Text = 0";
if ((_lacant2.getText()).equals("")) { 
_lacant2.setText(BA.ObjectToCharSequence(0));};
 //BA.debugLineNum = 1628;BA.debugLine="If New > 0 Then";
if ((double)(Double.parseDouble(_new))>0) { 
 //BA.debugLineNum = 1629;BA.debugLine="Log(\"lo ocultamos\")";
__c.LogImpl("750724908","lo ocultamos",0);
 //BA.debugLineNum = 1630;BA.debugLine="panelpiezas.Visible = False";
_panelpiezas.setVisible(__c.False);
 }else if((_new).equals(BA.NumberToString(0))) { 
 //BA.debugLineNum = 1632;BA.debugLine="panelpiezas.Visible = True";
_panelpiezas.setVisible(__c.True);
 };
 //BA.debugLineNum = 1640;BA.debugLine="Log(\"InvTotal: \" & invTotal)";
__c.LogImpl("750724919","InvTotal: "+BA.NumberToString(_invtotal),0);
 //BA.debugLineNum = 1642;BA.debugLine="If Not(Old = \"0\" And New = \"\") And laCant2.Text";
if (__c.Not((_old).equals("0") && (_new).equals("")) && _lacant2.getText()!= null && (_lacant2.getText()).equals("") == false && _etcanthasfocus) { 
 //BA.debugLineNum = 1643;BA.debugLine="If invTotal - (laCant2.Text * conversion) >= 0";
if (_invtotal-((double)(Double.parseDouble(_lacant2.getText()))*(double)(Double.parseDouble(_conversion)))>=0) { 
 //BA.debugLineNum = 1644;BA.debugLine="LogColor(\"validacion inventariio \" & (invTotal";
__c.LogImpl("750724923","validacion inventariio "+BA.NumberToString((_invtotal-((double)(Double.parseDouble(_lacant2.getText()))*(double)(Double.parseDouble(_conversion))))),__c.Colors.Blue);
 //BA.debugLineNum = 1645;BA.debugLine="Log(\"actualizamos producto\")";
__c.LogImpl("750724924","actualizamos producto",0);
 //BA.debugLineNum = 1646;BA.debugLine="Subs.actualizaProducto2(Subs.traeAlmacen,  pre";
_subs._actualizaproducto2 /*String*/ (ba,_subs._traealmacen /*String*/ (ba),_preciocaja,(int) (((double)(Double.parseDouble(_lacant2.getText()))*(double)(Double.parseDouble(_conversion)))),_subs._traeprodnombre /*String*/ (ba,_id),_id,_clienteid,_subs._traefecha /*String*/ (ba),_subs._traeusuariodebd /*String*/ (ba),_rutausuario,BA.NumberToString(0),_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._tipo_venta /*String*/ ,_lacant2.getText(),BA.NumberToString(1));
 //BA.debugLineNum = 1647;BA.debugLine="cuentaProds";
_cuentaprods();
 }else {
 //BA.debugLineNum = 1649;BA.debugLine="Private totalcajaspermi As Int = invTotal / co";
_totalcajaspermi = (int) (_invtotal/(double)(double)(Double.parseDouble(_conversion)));
 //BA.debugLineNum = 1650;BA.debugLine="laCant2.Text = totalcajaspermi";
_lacant2.setText(BA.ObjectToCharSequence(_totalcajaspermi));
 //BA.debugLineNum = 1651;BA.debugLine="Log(\"cajas permitidas total por guerra \"& tota";
__c.LogImpl("750724930","cajas permitidas total por guerra "+BA.NumberToString(_totalcajaspermi),0);
 };
 };
 //BA.debugLineNum = 1654;BA.debugLine="LogColor(\"la cant2 \" & laCant2.Text,Colors.Green";
__c.LogImpl("750724933","la cant2 "+_lacant2.getText(),__c.Colors.Green);
 //BA.debugLineNum = 1667;BA.debugLine="If 1 = 1 Then";
if (1==1) { 
 //BA.debugLineNum = 1668;BA.debugLine="Private cs As CSBuilder";
_cs = new anywheresoftware.b4a.objects.CSBuilder();
 //BA.debugLineNum = 1669;BA.debugLine="cs.Initialize";
_cs.Initialize();
 //BA.debugLineNum = 1670;BA.debugLine="Private o As Cursor = Starter.skmt.ExecQuery($\"";
_o = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_o = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery(("select CAT_GP_ALMACEN from "+__c.SmartStringFormatter("",(Object)(_starter._tabla /*String*/ ))+" where CAT_GP_ID = '"+__c.SmartStringFormatter("",(Object)(_id))+"'"))));
 //BA.debugLineNum = 1671;BA.debugLine="Private invActualizado As String = \"0\"";
_invactualizado = "0";
 //BA.debugLineNum = 1673;BA.debugLine="o.Position = 0";
_o.setPosition((int) (0));
 //BA.debugLineNum = 1674;BA.debugLine="invActualizado = Subs.traeinventario(id)";
_invactualizado = _subs._traeinventario /*String*/ (ba,_id);
 //BA.debugLineNum = 1675;BA.debugLine="Log(Subs.traeinventario(id))";
__c.LogImpl("750724954",_subs._traeinventario /*String*/ (ba,_id),0);
 //BA.debugLineNum = 1678;BA.debugLine="If New = \"\" Then New = 0";
if ((_new).equals("")) { 
_new = BA.NumberToString(0);};
 //BA.debugLineNum = 1679;BA.debugLine="If clv_prods_ll.GetValue(index).As(Map).Get(\"pr";
if (((float)(BA.ObjectToNumber(((anywheresoftware.b4a.objects.collections.Map) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.collections.Map(), (java.util.Map)(_clv_prods_ll._getvalue(_index)))).Get((Object)("precio_caja")))))==0 || ((int)(BA.ObjectToNumber(((anywheresoftware.b4a.objects.collections.Map) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.collections.Map(), (java.util.Map)(_clv_prods_ll._getvalue(_index)))).Get((Object)("conversion")))))==1) { 
 //BA.debugLineNum = 1680;BA.debugLine="Private maxcajas2 As Int = 0";
_maxcajas2 = (int) (0);
 //BA.debugLineNum = 1681;BA.debugLine="Log(\"cajas a 0\")";
__c.LogImpl("750724960","cajas a 0",0);
 }else {
 //BA.debugLineNum = 1683;BA.debugLine="Private maxcajas2 As Int = invActualizado/clv_";
_maxcajas2 = (int) ((double)(Double.parseDouble(_invactualizado))/(double)(double)(BA.ObjectToNumber(((anywheresoftware.b4a.objects.collections.Map) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.collections.Map(), (java.util.Map)(_clv_prods_ll._getvalue(_index)))).Get((Object)("conversion")))));
 //BA.debugLineNum = 1684;BA.debugLine="Log(\"cajas no a 0\")";
__c.LogImpl("750724963","cajas no a 0",0);
 };
 //BA.debugLineNum = 1686;BA.debugLine="lProdX.Text = cs.Color(Colors.red).append(nombr";
_lprodx.setText(BA.ObjectToCharSequence(_cs.Color(__c.Colors.Red).Append(BA.ObjectToCharSequence(_nombrex)).Pop().Append(BA.ObjectToCharSequence(__c.CRLF)).Append(BA.ObjectToCharSequence("Existencias: "+(_subs._traeinventario /*String*/ (ba,_id)))).Color(((int)0xff017f01)).Append(BA.ObjectToCharSequence(("   $"+__c.SmartStringFormatter("",(Object)(__c.NumberFormat2((double)(Double.parseDouble(_precio)),(int) (1),(int) (2),(int) (2),__c.False)))+""+__c.SmartStringFormatter("",(Object)(__c.CRLF))+"Max. Cajas: "+__c.SmartStringFormatter("",(Object)(_maxcajas2))+""))).PopAll().getObject()));
 };
 };
 //BA.debugLineNum = 1689;BA.debugLine="End Sub";
return "";
}
public Object  _initialize(anywheresoftware.b4a.BA _ba) throws Exception{
innerInitialize(_ba);
 //BA.debugLineNum = 93;BA.debugLine="Public Sub Initialize As Object";
 //BA.debugLineNum = 94;BA.debugLine="Return Me";
if (true) return this;
 //BA.debugLineNum = 95;BA.debugLine="End Sub";
return null;
}
public String  _l_info_click() throws Exception{
 //BA.debugLineNum = 924;BA.debugLine="Private Sub l_info_Click";
 //BA.debugLineNum = 925;BA.debugLine="l_info.Visible = False";
_l_info.setVisible(__c.False);
 //BA.debugLineNum = 926;BA.debugLine="End Sub";
return "";
}
public String  _l_prodx_click() throws Exception{
int _index = 0;
anywheresoftware.b4a.objects.B4XViewWrapper _p0 = null;
anywheresoftware.b4a.objects.B4XViewWrapper _p = null;
anywheresoftware.b4a.objects.B4XViewWrapper _cant1 = null;
 //BA.debugLineNum = 1105;BA.debugLine="Sub l_prodx_click";
 //BA.debugLineNum = 1106;BA.debugLine="Dim index As Int = clv_prods_ll.GetItemFromView(S";
_index = _clv_prods_ll._getitemfromview((anywheresoftware.b4a.objects.B4XViewWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.B4XViewWrapper(), (java.lang.Object)(__c.Sender(ba))));
 //BA.debugLineNum = 1107;BA.debugLine="Private p0 As B4XView = clv_prods_ll.GetPanel(ind";
_p0 = new anywheresoftware.b4a.objects.B4XViewWrapper();
_p0 = _clv_prods_ll._getpanel(_index);
 //BA.debugLineNum = 1108;BA.debugLine="Private p As B4XView = p0.GetView(0)";
_p = new anywheresoftware.b4a.objects.B4XViewWrapper();
_p = _p0.GetView((int) (0));
 //BA.debugLineNum = 1109;BA.debugLine="Private cant1 As B4XView = p.GetView(2).GetView(2";
_cant1 = new anywheresoftware.b4a.objects.B4XViewWrapper();
_cant1 = _p.GetView((int) (2)).GetView((int) (2));
 //BA.debugLineNum = 1110;BA.debugLine="Dim index As Int = clv_prods_ll.GetItemFromView(S";
_index = _clv_prods_ll._getitemfromview((anywheresoftware.b4a.objects.B4XViewWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.B4XViewWrapper(), (java.lang.Object)(__c.Sender(ba))));
 //BA.debugLineNum = 1112;BA.debugLine="Log(cant1.Text)";
__c.LogImpl("750331655",_cant1.getText(),0);
 //BA.debugLineNum = 1113;BA.debugLine="End Sub";
return "";
}
public String  _l_prodx_longclick() throws Exception{
 //BA.debugLineNum = 918;BA.debugLine="Private Sub l_prodX_LongClick";
 //BA.debugLineNum = 919;BA.debugLine="Log(\"longclic = \"&Sender.as(Label).tag)";
__c.LogImpl("749676289","longclic = "+BA.ObjectToString(((anywheresoftware.b4a.objects.LabelWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.LabelWrapper(), (android.widget.TextView)(__c.Sender(ba)))).getTag()),0);
 //BA.debugLineNum = 920;BA.debugLine="l_info.Text = Sender.as(Label).tag";
_l_info.setText(BA.ObjectToCharSequence(((anywheresoftware.b4a.objects.LabelWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.LabelWrapper(), (android.widget.TextView)(__c.Sender(ba)))).getTag()));
 //BA.debugLineNum = 921;BA.debugLine="l_info.Visible = True";
_l_info.setVisible(__c.True);
 //BA.debugLineNum = 922;BA.debugLine="End Sub";
return "";
}
public String  _llenacatalogo(String _subtipo1) throws Exception{
 //BA.debugLineNum = 426;BA.debugLine="Sub llenaCatalogo(subtipo1 As String)";
 //BA.debugLineNum = 449;BA.debugLine="End Sub";
return "";
}
public String  _llenaprodsll(anywheresoftware.b4a.sql.SQL.ResultSetWrapper _p) throws Exception{
anywheresoftware.b4a.objects.collections.Map _cantsmap = null;
anywheresoftware.b4a.sql.SQL.ResultSetWrapper _pe = null;
int _cant = 0;
String _marcas = "";
anywheresoftware.b4a.sql.SQL.CursorWrapper _m = null;
anywheresoftware.b4a.objects.collections.Map _tempmap = null;
anywheresoftware.b4a.objects.collections.List _listaprodsconcant = null;
anywheresoftware.b4a.objects.collections.List _listaprodsconcantindex = null;
int _q = 0;
int _cont = 0;
int _pr0 = 0;
anywheresoftware.b4a.objects.B4XViewWrapper _pnl = null;
int _pr = 0;
 //BA.debugLineNum = 1283;BA.debugLine="Sub LlenaProdsLL(p As ResultSet)";
 //BA.debugLineNum = 1284;BA.debugLine="Log(\"Iniciamos LlenaProdsLL\")";
__c.LogImpl("750528257","Iniciamos LlenaProdsLL",0);
 //BA.debugLineNum = 1285;BA.debugLine="listaProds.Initialize";
_listaprods.Initialize();
 //BA.debugLineNum = 1286;BA.debugLine="If hayPedido Then 'Si hay pedido obtenemos las ca";
if (_haypedido) { 
 //BA.debugLineNum = 1287;BA.debugLine="Dim cantsMap As Map";
_cantsmap = new anywheresoftware.b4a.objects.collections.Map();
 //BA.debugLineNum = 1288;BA.debugLine="cantsMap.Initialize";
_cantsmap.Initialize();
 //BA.debugLineNum = 1289;BA.debugLine="Dim pe As ResultSet = B4XPages.MainPage.skmt.Exe";
_pe = new anywheresoftware.b4a.sql.SQL.ResultSetWrapper();
_pe = (anywheresoftware.b4a.sql.SQL.ResultSetWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.ResultSetWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery(("select distinct PE_PROID, PE_CANT, PE_CANTC, PE_BCAJAS from PEDIDO where PE_CLIENTE = '"+__c.SmartStringFormatter("",(Object)(_clienteid))+"' and PE_CEDIS = '"+__c.SmartStringFormatter("",(Object)(_subs._traealmacen /*String*/ (ba)))+"' and PE_FOLIO = '"+__c.SmartStringFormatter("",(Object)(_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._tipo_venta /*String*/ ))+"'"))));
 //BA.debugLineNum = 1291;BA.debugLine="LogColor(\"||||||||||||||||||||||||||>\"&B4XPages.";
__c.LogImpl("750528264","||||||||||||||||||||||||||>"+_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._tipo_venta /*String*/ ,__c.Colors.Yellow);
 //BA.debugLineNum = 1293;BA.debugLine="Do While pe.NextRow";
while (_pe.NextRow()) {
 //BA.debugLineNum = 1294;BA.debugLine="Private cant As Int = 0";
_cant = (int) (0);
 //BA.debugLineNum = 1295;BA.debugLine="If  pe.GetString(\"PE_BCAJAS\") = 0 Then";
if ((_pe.GetString("PE_BCAJAS")).equals(BA.NumberToString(0))) { 
 //BA.debugLineNum = 1296;BA.debugLine="cantsMap.put(pe.GetString(\"PE_PROID\"), pe.GetS";
_cantsmap.Put((Object)(_pe.GetString("PE_PROID")),(Object)(_pe.GetString("PE_CANT")));
 }else if((_pe.GetString("PE_BCAJAS")).equals(BA.NumberToString(1))) { 
 //BA.debugLineNum = 1298;BA.debugLine="cantsMap.put(pe.GetString(\"PE_PROID\"), pe.GetS";
_cantsmap.Put((Object)(_pe.GetString("PE_PROID")),(Object)(_pe.GetString("PE_CANTC")));
 };
 //BA.debugLineNum = 1300;BA.debugLine="Log(clienteId &\"|||||\"&pe.GetString(\"PE_PROID\")";
__c.LogImpl("750528273",_clienteid+"|||||"+_pe.GetString("PE_PROID")+"|||||"+_pe.GetString("PE_CANT"),0);
 }
;
 //BA.debugLineNum = 1302;BA.debugLine="pe.Close";
_pe.Close();
 };
 //BA.debugLineNum = 1305;BA.debugLine="If p.IsInitialized Then";
if (_p.IsInitialized()) { 
 }else {
 //BA.debugLineNum = 1309;BA.debugLine="LogColor(Starter.tabla,Colors.blue)";
__c.LogImpl("750528282",_starter._tabla /*String*/ ,__c.Colors.Blue);
 //BA.debugLineNum = 1312;BA.debugLine="Dim marcas As String = \"\"";
_marcas = "";
 //BA.debugLineNum = 1313;BA.debugLine="Dim m As Cursor = B4XPages.MainPage.skmt.ExecQue";
_m = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_m = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("SELECT CAT_VA_VALOR FROM CAT_VARIABLES WHERE CAT_VA_DESCRIPCION = 'MARCAS'")));
 //BA.debugLineNum = 1314;BA.debugLine="If m.RowCount > 0 Then";
if (_m.getRowCount()>0) { 
 //BA.debugLineNum = 1315;BA.debugLine="m.Position = 0";
_m.setPosition((int) (0));
 //BA.debugLineNum = 1316;BA.debugLine="marcas = m.GetString(\"CAT_VA_VALOR\")";
_marcas = _m.GetString("CAT_VA_VALOR");
 };
 //BA.debugLineNum = 1318;BA.debugLine="Dim p As ResultSet = B4XPages.MainPage.skmt.Exec";
_p = new anywheresoftware.b4a.sql.SQL.ResultSetWrapper();
_p = (anywheresoftware.b4a.sql.SQL.ResultSetWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.ResultSetWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery(("select distinct CAT_GP_ID, CAT_GP_NOMBRE, CAT_GP_ALMACEN, CAT_GP_PRECIO, CAT_GP_TIPOPROD, CAT_DP_CONVERSION1, CAT_DP_PRECIO4, PE_BCAJAS, CAT_DP_CANT_MIN_VENTA from "+__c.SmartStringFormatter("",(Object)(_starter._tabla /*String*/ ))+" LEFT JOIN PEDIDO ON CAT_GP_ID = PE_PROID where CAT_GP_PRECIO > 0 And CAT_GP_ALMACEN > 0 And CAT_GP_CLASIF <> 'PROMOS' AND CAT_GP_CLASIF IN("+__c.SmartStringFormatter("",(Object)(_marcas))+") AND CAT_GP_CLASIF <> 'ALEN PROMOCIONES' union all Select CAT_GP_ID, CAT_GP_NOMBRE, CAT_GP_ALMACEN, CAT_GP_PRECIO, CAT_GP_TIPOPROD, CAT_DP_CONVERSION1, CAT_DP_PRECIO4 , PE_BCAJAS, CAT_DP_CANT_MIN_VENTA from "+__c.SmartStringFormatter("",(Object)(_starter._tabla /*String*/ ))+" LEFT JOIN PEDIDO ON CAT_GP_ID = PE_PROID where CAT_GP_PRECIO > 0 And CAT_GP_ALMACEN = 0 And CAT_GP_CLASIF <> 'PROMOS' AND CAT_GP_CLASIF IN("+__c.SmartStringFormatter("",(Object)(_marcas))+") AND CAT_GP_CLASIF <> 'ALEN PROMOCIONES' and cat_gp_id in (select pe_proid from pedido where pe_cliente in (select cuenta from cuentaa)) order by 2"))));
 };
 //BA.debugLineNum = 1322;BA.debugLine="Do While p.NextRow";
while (_p.NextRow()) {
 //BA.debugLineNum = 1323;BA.debugLine="Private cant As Int = 0";
_cant = (int) (0);
 //BA.debugLineNum = 1324;BA.debugLine="If hayPedido And cantsMap.ContainsKey(p.GetStrin";
if (_haypedido && _cantsmap.ContainsKey((Object)(_p.GetString("CAT_GP_ID")))) { 
 //BA.debugLineNum = 1325;BA.debugLine="Log(p.GetString(\"CAT_GP_ID\"))";
__c.LogImpl("750528298",_p.GetString("CAT_GP_ID"),0);
 //BA.debugLineNum = 1326;BA.debugLine="cant = cantsMap.Get(p.GetString(\"CAT_GP_ID\"))";
_cant = (int)(BA.ObjectToNumber(_cantsmap.Get((Object)(_p.GetString("CAT_GP_ID")))));
 };
 //BA.debugLineNum = 1328;BA.debugLine="Dim tempMap As Map = CreateMap(\"prod\":p.GetStrin";
_tempmap = new anywheresoftware.b4a.objects.collections.Map();
_tempmap = __c.createMap(new Object[] {(Object)("prod"),(Object)(_p.GetString("CAT_GP_NOMBRE")),(Object)("precio"),(Object)(_p.GetString("CAT_GP_PRECIO")),(Object)("almacen"),(Object)(_p.GetString("CAT_GP_ALMACEN")),(Object)("id"),(Object)(_p.GetString("CAT_GP_ID")),(Object)("cant"),(Object)(_cant),(Object)("conversion"),(Object)(_p.GetString("CAT_DP_CONVERSION1")),(Object)("precio_caja"),(Object)(_p.GetString("CAT_DP_PRECIO4")),(Object)("b_caja"),(Object)(_p.GetString("PE_BCAJAS")),(Object)("minimo"),(Object)(_p.GetString("CAT_DP_CANT_MIN_VENTA"))});
 //BA.debugLineNum = 1330;BA.debugLine="listaProds.Add(tempMap)";
_listaprods.Add((Object)(_tempmap.getObject()));
 }
;
 //BA.debugLineNum = 1332;BA.debugLine="p.Close";
_p.Close();
 //BA.debugLineNum = 1334;BA.debugLine="PCLV.Commit";
_pclv._commit /*String*/ ();
 //BA.debugLineNum = 1335;BA.debugLine="clv_prods_ll.Clear";
_clv_prods_ll._clear();
 //BA.debugLineNum = 1336;BA.debugLine="Private listaProdsConCant, listaProdsConCantIndex";
_listaprodsconcant = new anywheresoftware.b4a.objects.collections.List();
_listaprodsconcantindex = new anywheresoftware.b4a.objects.collections.List();
 //BA.debugLineNum = 1337;BA.debugLine="listaProdsConCant.Initialize";
_listaprodsconcant.Initialize();
 //BA.debugLineNum = 1338;BA.debugLine="listaProdsConCantIndex.Initialize";
_listaprodsconcantindex.Initialize();
 //BA.debugLineNum = 1339;BA.debugLine="listaHints.Initialize";
_listahints.Initialize();
 //BA.debugLineNum = 1340;BA.debugLine="For q=0 To listaProds.Size-1' Sacamos los product";
{
final int step46 = 1;
final int limit46 = (int) (_listaprods.getSize()-1);
_q = (int) (0) ;
for (;_q <= limit46 ;_q = _q + step46 ) {
 //BA.debugLineNum = 1341;BA.debugLine="If listaProds.Get(q).As(Map).Get(\"cant\").As(Int)";
if (((int)(BA.ObjectToNumber(((anywheresoftware.b4a.objects.collections.Map) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.collections.Map(), (java.util.Map)(_listaprods.Get(_q)))).Get((Object)("cant")))))!=0) { 
 //BA.debugLineNum = 1343;BA.debugLine="listaProdsConCant.Add(listaProds.Get(q))";
_listaprodsconcant.Add(_listaprods.Get(_q));
 //BA.debugLineNum = 1344;BA.debugLine="listaProdsConCantIndex.Add(q)";
_listaprodsconcantindex.Add((Object)(_q));
 };
 }
};
 //BA.debugLineNum = 1348;BA.debugLine="Private cont As Int = 0";
_cont = (int) (0);
 //BA.debugLineNum = 1349;BA.debugLine="For pr0=0 To listaProdsConCant.Size - 1 'Agregamo";
{
final int step53 = 1;
final int limit53 = (int) (_listaprodsconcant.getSize()-1);
_pr0 = (int) (0) ;
for (;_pr0 <= limit53 ;_pr0 = _pr0 + step53 ) {
 //BA.debugLineNum = 1350;BA.debugLine="Private Pnl As B4XView = xui.CreatePanel(\"\")";
_pnl = new anywheresoftware.b4a.objects.B4XViewWrapper();
_pnl = _xui.CreatePanel(ba,"");
 //BA.debugLineNum = 1352;BA.debugLine="Pnl.SetLayoutAnimated(0, 0, 0, clv_prods_ll.AsVi";
_pnl.SetLayoutAnimated((int) (0),(int) (0),(int) (0),_clv_prods_ll._asview().getWidth(),__c.DipToCurrent((int) (135)));
 //BA.debugLineNum = 1353;BA.debugLine="clv_prods_ll.Add(Pnl, listaProdsConCant.Get(pr0)";
_clv_prods_ll._add(_pnl,_listaprodsconcant.Get(_pr0));
 //BA.debugLineNum = 1354;BA.debugLine="listaHints.Add(listaProdsConCant.get(pr0).As(Map";
_listahints.Add(((anywheresoftware.b4a.objects.collections.Map) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.collections.Map(), (java.util.Map)(_listaprodsconcant.Get(_pr0)))).Get((Object)("prod")));
 //BA.debugLineNum = 1355;BA.debugLine="cont = cont + 1";
_cont = (int) (_cont+1);
 }
};
 //BA.debugLineNum = 1359;BA.debugLine="For pr=0 To listaProds.Size-1";
{
final int step60 = 1;
final int limit60 = (int) (_listaprods.getSize()-1);
_pr = (int) (0) ;
for (;_pr <= limit60 ;_pr = _pr + step60 ) {
 //BA.debugLineNum = 1360;BA.debugLine="If listaProdsConCantIndex.IndexOf(pr) = -1 Then";
if (_listaprodsconcantindex.IndexOf((Object)(_pr))==-1) { 
 //BA.debugLineNum = 1361;BA.debugLine="Private Pnl As B4XView = xui.CreatePanel(\"\")";
_pnl = new anywheresoftware.b4a.objects.B4XViewWrapper();
_pnl = _xui.CreatePanel(ba,"");
 //BA.debugLineNum = 1362;BA.debugLine="Pnl.SetLayoutAnimated(0, 0, 0, clv_prods_ll.AsV";
_pnl.SetLayoutAnimated((int) (0),(int) (0),(int) (0),_clv_prods_ll._asview().getWidth(),__c.DipToCurrent((int) (135)));
 //BA.debugLineNum = 1363;BA.debugLine="clv_prods_ll.Add(Pnl, listaProds.Get(pr))";
_clv_prods_ll._add(_pnl,_listaprods.Get(_pr));
 //BA.debugLineNum = 1364;BA.debugLine="listaHints.Add(listaProds.get(pr).As(Map).Get(\"";
_listahints.Add(((anywheresoftware.b4a.objects.collections.Map) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.collections.Map(), (java.util.Map)(_listaprods.Get(_pr)))).Get((Object)("prod")));
 //BA.debugLineNum = 1365;BA.debugLine="cont = cont + 1";
_cont = (int) (_cont+1);
 };
 }
};
 //BA.debugLineNum = 1372;BA.debugLine="PCLV.B4XSeekBar1.MaxValue = clv_prods_ll.Size";
_pclv._b4xseekbar1 /*medicomed.keymon.com.mx.b4xseekbar*/ ._maxvalue /*int*/  = _clv_prods_ll._getsize();
 //BA.debugLineNum = 1373;BA.debugLine="PCLV.B4XSeekBar1.MinValue = 0";
_pclv._b4xseekbar1 /*medicomed.keymon.com.mx.b4xseekbar*/ ._minvalue /*int*/  = (int) (0);
 //BA.debugLineNum = 1374;BA.debugLine="PCLV.B4XSeekBar1.Interval = clv_prods_ll.Size/20";
_pclv._b4xseekbar1 /*medicomed.keymon.com.mx.b4xseekbar*/ ._interval /*int*/  = (int) (_clv_prods_ll._getsize()/(double)20);
 //BA.debugLineNum = 1375;BA.debugLine="PCLV.B4XSeekBar1.Value = clv_prods_ll.Size";
_pclv._b4xseekbar1 /*medicomed.keymon.com.mx.b4xseekbar*/ ._setvalue /*int*/ (_clv_prods_ll._getsize());
 //BA.debugLineNum = 1376;BA.debugLine="PCLV.B4XSeekBar1.Update";
_pclv._b4xseekbar1 /*medicomed.keymon.com.mx.b4xseekbar*/ ._update /*String*/ ();
 //BA.debugLineNum = 1378;BA.debugLine="reiniciarlistaProds = False";
_reiniciarlistaprods = __c.False;
 //BA.debugLineNum = 1379;BA.debugLine="End Sub";
return "";
}
public String  _lv_catalogos_itemclick(int _position,Object _value) throws Exception{
anywheresoftware.b4a.objects.LabelWrapper _label1 = null;
anywheresoftware.b4a.objects.LabelWrapper _label2 = null;
anywheresoftware.b4a.objects.LabelWrapper _label13 = null;
anywheresoftware.b4a.objects.LabelWrapper _label14 = null;
int _i = 0;
anywheresoftware.b4a.objects.collections.Map _tm = null;
 //BA.debugLineNum = 276;BA.debugLine="Sub lv_catalogos_ItemClick (Position As Int, Value";
 //BA.debugLineNum = 277;BA.debugLine="If Value = \"CATALOGO\" Then";
if ((_value).equals((Object)("CATALOGO"))) { 
 //BA.debugLineNum = 279;BA.debugLine="lfila.text = \"PRODUCTOS\"";
_lfila.setText(BA.ObjectToCharSequence("PRODUCTOS"));
 //BA.debugLineNum = 280;BA.debugLine="lv_catalogos.Visible = False";
_lv_catalogos.setVisible(__c.False);
 //BA.debugLineNum = 282;BA.debugLine="If clv_prods_ll.Size = 0 Then LlenaProdsLL(Null)";
if (_clv_prods_ll._getsize()==0) { 
_llenaprodsll((anywheresoftware.b4a.sql.SQL.ResultSetWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.ResultSetWrapper(), (android.database.Cursor)(__c.Null)));};
 //BA.debugLineNum = 283;BA.debugLine="clv_prods_ll.AsView.Visible = True";
_clv_prods_ll._asview().setVisible(__c.True);
 //BA.debugLineNum = 284;BA.debugLine="If hayPedido Then p_botonesVenta.Visible = True";
if (_haypedido) { 
_p_botonesventa.setVisible(__c.True);};
 }else {
 //BA.debugLineNum = 286;BA.debugLine="clv_prods_ll.AsView.Visible = False";
_clv_prods_ll._asview().setVisible(__c.False);
 //BA.debugLineNum = 287;BA.debugLine="lv_promos.Visible = True";
_lv_promos.setVisible(__c.True);
 //BA.debugLineNum = 288;BA.debugLine="lfila.text = \"PROMOCIONES\"";
_lfila.setText(BA.ObjectToCharSequence("PROMOCIONES"));
 //BA.debugLineNum = 289;BA.debugLine="lv_catalogos.Visible = False";
_lv_catalogos.setVisible(__c.False);
 //BA.debugLineNum = 290;BA.debugLine="lv_promos.Clear";
_lv_promos.Clear();
 //BA.debugLineNum = 291;BA.debugLine="Dim label1 As Label";
_label1 = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 292;BA.debugLine="label1 = lv_promos.TwoLinesLayout.Label";
_label1 = _lv_promos.getTwoLinesLayout().Label;
 //BA.debugLineNum = 293;BA.debugLine="label1.TextSize = 12";
_label1.setTextSize((float) (12));
 //BA.debugLineNum = 294;BA.debugLine="label1.TextColor = Colors.Black";
_label1.setTextColor(__c.Colors.Black);
 //BA.debugLineNum = 295;BA.debugLine="Dim label2 As Label";
_label2 = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 296;BA.debugLine="label2 = lv_promos.TwoLinesLayout.SecondLabel";
_label2 = _lv_promos.getTwoLinesLayout().SecondLabel;
 //BA.debugLineNum = 297;BA.debugLine="label2.TextSize = 12";
_label2.setTextSize((float) (12));
 //BA.debugLineNum = 298;BA.debugLine="label2.TextColor = Colors.Black";
_label2.setTextColor(__c.Colors.Black);
 //BA.debugLineNum = 299;BA.debugLine="Dim label13 As Label";
_label13 = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 300;BA.debugLine="label13 = lv_promos.TwoLinesAndBitmap.Label";
_label13 = _lv_promos.getTwoLinesAndBitmap().Label;
 //BA.debugLineNum = 301;BA.debugLine="label13.TextSize = 12";
_label13.setTextSize((float) (12));
 //BA.debugLineNum = 302;BA.debugLine="label13.TextColor = Colors.Black";
_label13.setTextColor(__c.Colors.Black);
 //BA.debugLineNum = 303;BA.debugLine="Dim label14 As Label";
_label14 = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 304;BA.debugLine="label14 = lv_promos.TwoLinesAndBitmap.SecondLabe";
_label14 = _lv_promos.getTwoLinesAndBitmap().SecondLabel;
 //BA.debugLineNum = 305;BA.debugLine="label14.TextSize = 12";
_label14.setTextSize((float) (12));
 //BA.debugLineNum = 306;BA.debugLine="label14.TextColor = Colors.Black";
_label14.setTextColor(__c.Colors.Black);
 //BA.debugLineNum = 307;BA.debugLine="lfila.text = \"PROMOS\"";
_lfila.setText(BA.ObjectToCharSequence("PROMOS"));
 //BA.debugLineNum = 312;BA.debugLine="c2=B4XPages.MainPage.skmt.ExecQuery2($\"select  C";
_c2 = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery2(("select  CAT_GP_ID, CAT_GP_NOMBRE, CAT_GP_PRECIO, CAT_GP_ALMACEN, CAT_GP_IMG from "+__c.SmartStringFormatter("",(Object)(_starter._tabla /*String*/ ))+" where CAT_GP_PRECIO > 0 AND  CAT_GP_ALMACEN > 0 AND CAT_GP_TIPO = ? AND CAT_GP_SUBTIPO = ?  AND CAT_GP_ID NOT IN (SELECT PE_PROID FROM PEDIDO WHERE PE_CLIENTE IN (Select cuenta from cuentaa) )"),new String[]{BA.ObjectToString(_value),BA.ObjectToString(_value)})));
 //BA.debugLineNum = 314;BA.debugLine="If c2.RowCount > 0 Then";
if (_c2.getRowCount()>0) { 
 //BA.debugLineNum = 315;BA.debugLine="For i=0 To c2.RowCount -1";
{
final int step32 = 1;
final int limit32 = (int) (_c2.getRowCount()-1);
_i = (int) (0) ;
for (;_i <= limit32 ;_i = _i + step32 ) {
 //BA.debugLineNum = 316;BA.debugLine="c2.Position=i";
_c2.setPosition(_i);
 //BA.debugLineNum = 317;BA.debugLine="Private tm As Map = Subs.procesaPromocion(c2.G";
_tm = new anywheresoftware.b4a.objects.collections.Map();
_tm = _subs._procesapromocion /*anywheresoftware.b4a.objects.collections.Map*/ (ba,_c2.GetString("CAT_GP_ID"),_clienteid);
 //BA.debugLineNum = 318;BA.debugLine="If tm.Get(\"status\") = \"ok\" Then 'Solo muestral";
if ((_tm.Get((Object)("status"))).equals((Object)("ok"))) { 
 //BA.debugLineNum = 319;BA.debugLine="lv_promos.AddTwoLines(c2.GetString(\"CAT_GP_NO";
_lv_promos.AddTwoLines(BA.ObjectToCharSequence(_c2.GetString("CAT_GP_NOMBRE")),BA.ObjectToCharSequence("# "+_c2.GetString("CAT_GP_ALMACEN")+" $ "+_c2.GetString("CAT_GP_PRECIO")+" F:"+BA.ObjectToString(((anywheresoftware.b4a.objects.collections.Map) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.collections.Map(), (java.util.Map)(_tm.Get((Object)("mp"))))).Get((Object)("prodsFijosCant")))+" V:"+BA.ObjectToString(((anywheresoftware.b4a.objects.collections.Map) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.collections.Map(), (java.util.Map)(_tm.Get((Object)("mp"))))).Get((Object)("prodsVariablesCant")))));
 };
 }
};
 }else {
 //BA.debugLineNum = 323;BA.debugLine="ToastMessageShow(\"No hay promociones disponible";
__c.ToastMessageShow(BA.ObjectToCharSequence("No hay promociones disponibles."),__c.False);
 };
 //BA.debugLineNum = 325;BA.debugLine="c2.Close";
_c2.Close();
 //BA.debugLineNum = 326;BA.debugLine="entro = \"4\"";
_entro = "4";
 };
 //BA.debugLineNum = 328;BA.debugLine="End Sub";
return "";
}
public void  _lv_catalogos2_itemclick(int _position,Object _value) throws Exception{
ResumableSub_lv_catalogos2_ItemClick rsub = new ResumableSub_lv_catalogos2_ItemClick(this,_position,_value);
rsub.resume(ba, null);
}
public static class ResumableSub_lv_catalogos2_ItemClick extends BA.ResumableSub {
public ResumableSub_lv_catalogos2_ItemClick(medicomed.keymon.com.mx.c_productos parent,int _position,Object _value) {
this.parent = parent;
this._position = _position;
this._value = _value;
}
medicomed.keymon.com.mx.c_productos parent;
int _position;
Object _value;
medicomed.keymon.com.mx.c_cliente _cliente = null;
String _iniciocontador = "";
anywheresoftware.b4a.objects.LabelWrapper _label1 = null;
anywheresoftware.b4a.objects.LabelWrapper _label2 = null;
anywheresoftware.b4a.objects.LabelWrapper _label13 = null;
anywheresoftware.b4a.objects.LabelWrapper _label14 = null;
int _i = 0;
anywheresoftware.b4a.objects.collections.Map _tm = null;
int step57;
int limit57;

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

    while (true) {
        switch (state) {
            case -1:
return;

case 0:
//C
this.state = 1;
 //BA.debugLineNum = 331;BA.debugLine="clv_prods_ll.AsView.Visible = False";
parent._clv_prods_ll._asview().setVisible(parent.__c.False);
 //BA.debugLineNum = 332;BA.debugLine="BUSCA.Text = \"\"";
parent._busca.setText(BA.ObjectToCharSequence(""));
 //BA.debugLineNum = 333;BA.debugLine="Dim cliente As C_Cliente = B4XPages.GetPage(\"Clie";
_cliente = (medicomed.keymon.com.mx.c_cliente)(parent._b4xpages._getpage /*Object*/ (ba,"Cliente"));
 //BA.debugLineNum = 334;BA.debugLine="Log($\"value=${Value}\"$)";
parent.__c.LogImpl("748824324",("value="+parent.__c.SmartStringFormatter("",_value)+""),0);
 //BA.debugLineNum = 335;BA.debugLine="If Value = \"PROMOS\" And cliente.cuenta <> \"N\" The";
if (true) break;

case 1:
//if
this.state = 6;
if ((_value).equals((Object)("PROMOS")) && (_cliente._cuenta /*String*/ ).equals("N") == false) { 
this.state = 3;
}else if((_value).equals((Object)("PROMOS")) && (_cliente._cuenta /*String*/ ).equals("N")) { 
this.state = 5;
}if (true) break;

case 3:
//C
this.state = 6;
 //BA.debugLineNum = 336;BA.debugLine="entro = \"3\"";
parent._entro = "3";
 //BA.debugLineNum = 337;BA.debugLine="marca = \"PROMOS\"";
parent._marca = "PROMOS";
 //BA.debugLineNum = 338;BA.debugLine="tipo = \"PROMOS\"";
parent._tipo = "PROMOS";
 if (true) break;

case 5:
//C
this.state = 6;
 //BA.debugLineNum = 340;BA.debugLine="entro = \"5\"";
parent._entro = "5";
 //BA.debugLineNum = 341;BA.debugLine="B4XPages.ShowPage(\"Cliente\")";
parent._b4xpages._showpage /*String*/ (ba,"Cliente");
 if (true) break;
;
 //BA.debugLineNum = 343;BA.debugLine="If Value = \"PROMOS\" Then";

case 6:
//if
this.state = 11;
if ((_value).equals((Object)("PROMOS"))) { 
this.state = 8;
}else {
this.state = 10;
}if (true) break;

case 8:
//C
this.state = 11;
 //BA.debugLineNum = 344;BA.debugLine="LogColor(\"Promos\", Colors.red)";
parent.__c.LogImpl("748824334","Promos",parent.__c.Colors.Red);
 //BA.debugLineNum = 345;BA.debugLine="c2=B4XPages.MainPage.skmt.ExecQuery2($\"select  C";
parent._c2 = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(parent._b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery2(("select  CAT_GP_ID, CAT_GP_NOMBRE, CAT_GP_PRECIO, CAT_GP_ALMACEN, CAT_GP_IMG from "+parent.__c.SmartStringFormatter("",(Object)(parent._starter._tabla /*String*/ ))+" where CAT_GP_PRECIO > 0 AND  CAT_GP_ALMACEN > 0 and CAT_GP_TIPOPROD = ? AND CAT_GP_TIPO = ? AND CAT_GP_SUBTIPO = ?  AND CAT_GP_ID NOT IN (SELECT PE_PROID FROM PEDIDO WHERE PE_CLIENTE IN (Select cuenta from cuentaa) ) ORDER BY 1"),new String[]{BA.ObjectToString(_value),parent._marca,parent._tipo})));
 if (true) break;

case 10:
//C
this.state = 11;
 //BA.debugLineNum = 347;BA.debugLine="LogColor(\"Catalogo\", Colors.red)";
parent.__c.LogImpl("748824337","Catalogo",parent.__c.Colors.Red);
 //BA.debugLineNum = 348;BA.debugLine="c2=B4XPages.MainPage.skmt.ExecQuery($\"select CAT";
parent._c2 = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(parent._b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery(("select CAT_GP_ID, CAT_GP_NOMBRE, CAT_GP_PRECIO, CAT_GP_ALMACEN, CAT_GP_IMG, CAT_GP_TIPOPROD, CAT_GP_INICIATIVA from "+parent.__c.SmartStringFormatter("",(Object)(parent._starter._tabla /*String*/ ))+" where CAT_GP_PRECIO > 0 AND CAT_GP_ALMACEN > 0 and CAT_GP_TIPOPROD <> 'PROMOS' "))));
 if (true) break;
;
 //BA.debugLineNum = 350;BA.debugLine="If Value = \"CATALOGO\" Then";

case 11:
//if
this.state = 28;
if ((_value).equals((Object)("CATALOGO"))) { 
this.state = 13;
}else {
this.state = 15;
}if (true) break;

case 13:
//C
this.state = 28;
 //BA.debugLineNum = 351;BA.debugLine="lv_catalogos.Visible = False";
parent._lv_catalogos.setVisible(parent.__c.False);
 //BA.debugLineNum = 352;BA.debugLine="lv_promos.Visible = False";
parent._lv_promos.setVisible(parent.__c.False);
 //BA.debugLineNum = 353;BA.debugLine="lfila.text = \"CATALOGO\"";
parent._lfila.setText(BA.ObjectToCharSequence("CATALOGO"));
 //BA.debugLineNum = 354;BA.debugLine="Log(\"PGS\")";
parent.__c.LogImpl("748824344","PGS",0);
 //BA.debugLineNum = 355;BA.debugLine="ProgressDialogShow(\"Cargando catalogo ...\")";
parent.__c.ProgressDialogShow(ba,BA.ObjectToCharSequence("Cargando catalogo ..."));
 //BA.debugLineNum = 356;BA.debugLine="Sleep(100)";
parent.__c.Sleep(ba,this,(int) (100));
this.state = 29;
return;
case 29:
//C
this.state = 28;
;
 //BA.debugLineNum = 357;BA.debugLine="Private inicioContador As String = DateTime.Now";
_iniciocontador = BA.NumberToString(parent.__c.DateTime.getNow());
 //BA.debugLineNum = 358;BA.debugLine="llenaCatalogo(False)";
parent._llenacatalogo(BA.ObjectToString(parent.__c.False));
 //BA.debugLineNum = 359;BA.debugLine="clv_prods_ll.AsView.Visible = True";
parent._clv_prods_ll._asview().setVisible(parent.__c.True);
 //BA.debugLineNum = 360;BA.debugLine="Log(\"PGH\")";
parent.__c.LogImpl("748824350","PGH",0);
 //BA.debugLineNum = 361;BA.debugLine="LogColor(\"TIEMPO DE PROCESO DEL CATALOGO: \" & ((";
parent.__c.LogImpl("748824351","TIEMPO DE PROCESO DEL CATALOGO: "+BA.NumberToString(((parent.__c.DateTime.getNow()-(double)(Double.parseDouble(_iniciocontador)))/(double)1000)),parent.__c.Colors.Red);
 //BA.debugLineNum = 362;BA.debugLine="ProgressDialogHide";
parent.__c.ProgressDialogHide();
 //BA.debugLineNum = 363;BA.debugLine="c2.Close";
parent._c2.Close();
 if (true) break;

case 15:
//C
this.state = 16;
 //BA.debugLineNum = 365;BA.debugLine="clv_prods_ll.AsView.Visible = False";
parent._clv_prods_ll._asview().setVisible(parent.__c.False);
 //BA.debugLineNum = 366;BA.debugLine="lv_promos.Visible = True";
parent._lv_promos.setVisible(parent.__c.True);
 //BA.debugLineNum = 367;BA.debugLine="lv_catalogos.Visible = False";
parent._lv_catalogos.setVisible(parent.__c.False);
 //BA.debugLineNum = 368;BA.debugLine="lv_promos.Clear";
parent._lv_promos.Clear();
 //BA.debugLineNum = 369;BA.debugLine="Dim label1 As Label";
_label1 = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 370;BA.debugLine="label1 = lv_promos.TwoLinesLayout.Label";
_label1 = parent._lv_promos.getTwoLinesLayout().Label;
 //BA.debugLineNum = 371;BA.debugLine="label1.TextSize = 15";
_label1.setTextSize((float) (15));
 //BA.debugLineNum = 372;BA.debugLine="label1.TextColor = Colors.Black";
_label1.setTextColor(parent.__c.Colors.Black);
 //BA.debugLineNum = 373;BA.debugLine="Dim label2 As Label";
_label2 = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 374;BA.debugLine="label2 = lv_promos.TwoLinesLayout.SecondLabel";
_label2 = parent._lv_promos.getTwoLinesLayout().SecondLabel;
 //BA.debugLineNum = 375;BA.debugLine="label2.TextSize = 15";
_label2.setTextSize((float) (15));
 //BA.debugLineNum = 376;BA.debugLine="label2.TextColor = Colors.Black";
_label2.setTextColor(parent.__c.Colors.Black);
 //BA.debugLineNum = 377;BA.debugLine="Dim label13 As Label";
_label13 = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 378;BA.debugLine="label13 = lv_promos.TwoLinesAndBitmap.Label";
_label13 = parent._lv_promos.getTwoLinesAndBitmap().Label;
 //BA.debugLineNum = 379;BA.debugLine="label13.TextSize = 15";
_label13.setTextSize((float) (15));
 //BA.debugLineNum = 380;BA.debugLine="label13.TextColor = Colors.Black";
_label13.setTextColor(parent.__c.Colors.Black);
 //BA.debugLineNum = 381;BA.debugLine="Dim label14 As Label";
_label14 = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 382;BA.debugLine="label14 = lv_promos.TwoLinesAndBitmap.SecondLabe";
_label14 = parent._lv_promos.getTwoLinesAndBitmap().SecondLabel;
 //BA.debugLineNum = 383;BA.debugLine="label14.TextSize = 15";
_label14.setTextSize((float) (15));
 //BA.debugLineNum = 384;BA.debugLine="label14.TextColor = Colors.Black";
_label14.setTextColor(parent.__c.Colors.Black);
 //BA.debugLineNum = 385;BA.debugLine="lfila.text = \"PROMOS\"";
parent._lfila.setText(BA.ObjectToCharSequence("PROMOS"));
 //BA.debugLineNum = 386;BA.debugLine="If c2.RowCount > 0 Then";
if (true) break;

case 16:
//if
this.state = 27;
if (parent._c2.getRowCount()>0) { 
this.state = 18;
}if (true) break;

case 18:
//C
this.state = 19;
 //BA.debugLineNum = 387;BA.debugLine="For i=0 To c2.RowCount -1";
if (true) break;

case 19:
//for
this.state = 26;
step57 = 1;
limit57 = (int) (parent._c2.getRowCount()-1);
_i = (int) (0) ;
this.state = 30;
if (true) break;

case 30:
//C
this.state = 26;
if ((step57 > 0 && _i <= limit57) || (step57 < 0 && _i >= limit57)) this.state = 21;
if (true) break;

case 31:
//C
this.state = 30;
_i = ((int)(0 + _i + step57)) ;
if (true) break;

case 21:
//C
this.state = 22;
 //BA.debugLineNum = 388;BA.debugLine="c2.Position=i";
parent._c2.setPosition(_i);
 //BA.debugLineNum = 389;BA.debugLine="Private tm As Map = Subs.procesaPromocion(c2.G";
_tm = new anywheresoftware.b4a.objects.collections.Map();
_tm = parent._subs._procesapromocion /*anywheresoftware.b4a.objects.collections.Map*/ (ba,parent._c2.GetString("CAT_GP_ID"),parent._clienteid);
 //BA.debugLineNum = 390;BA.debugLine="If tm.Get(\"status\") = \"ok\" Then 'Solo muestral";
if (true) break;

case 22:
//if
this.state = 25;
if ((_tm.Get((Object)("status"))).equals((Object)("ok"))) { 
this.state = 24;
}if (true) break;

case 24:
//C
this.state = 25;
 //BA.debugLineNum = 391;BA.debugLine="lv_promos.AddTwoLines(c2.GetString(\"CAT_GP_NO";
parent._lv_promos.AddTwoLines(BA.ObjectToCharSequence(parent._c2.GetString("CAT_GP_NOMBRE")),BA.ObjectToCharSequence("# "+parent._c2.GetString("CAT_GP_ALMACEN")+" $ "+parent._c2.GetString("CAT_GP_PRECIO")+" F:"+BA.ObjectToString(((anywheresoftware.b4a.objects.collections.Map) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.collections.Map(), (java.util.Map)(_tm.Get((Object)("mp"))))).Get((Object)("prodsFijosCant")))+" V:"+BA.ObjectToString(((anywheresoftware.b4a.objects.collections.Map) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.collections.Map(), (java.util.Map)(_tm.Get((Object)("mp"))))).Get((Object)("prodsVariablesCant")))));
 if (true) break;

case 25:
//C
this.state = 31;
;
 if (true) break;
if (true) break;

case 26:
//C
this.state = 27;
;
 if (true) break;

case 27:
//C
this.state = 28;
;
 //BA.debugLineNum = 395;BA.debugLine="c2.Close";
parent._c2.Close();
 if (true) break;

case 28:
//C
this.state = -1;
;
 //BA.debugLineNum = 397;BA.debugLine="entro = \"4\"";
parent._entro = "4";
 //BA.debugLineNum = 398;BA.debugLine="End Sub";
if (true) break;

            }
        }
    }
}
public String  _lv_prodspedido_itemlongclick(int _position,Object _value) throws Exception{
String _sdate = "";
String _stime = "";
String _clie_id = "";
String _usuario = "";
int _i = 0;
anywheresoftware.b4a.sql.SQL.CursorWrapper _h = null;
 //BA.debugLineNum = 1013;BA.debugLine="Private Sub lv_prodsPedido_ItemLongClick (Position";
 //BA.debugLineNum = 1014;BA.debugLine="Private sDate,sTime, clie_id, usuario As String";
_sdate = "";
_stime = "";
_clie_id = "";
_usuario = "";
 //BA.debugLineNum = 1015;BA.debugLine="If Not(Subs.pedidoGuardado) Then";
if (__c.Not(_subs._pedidoguardado /*boolean*/ (ba))) { 
 //BA.debugLineNum = 1016;BA.debugLine="result =  Msgbox2(\"Seguro que desea borrar este a";
_result = BA.NumberToString(__c.Msgbox2(BA.ObjectToCharSequence("Seguro que desea borrar este articulo?"),BA.ObjectToCharSequence("Borrar Articulo"),"Si","","No",(android.graphics.Bitmap)(__c.LoadBitmap(__c.File.getDirAssets(),"alert2.png").getObject()),ba));
 //BA.debugLineNum = 1017;BA.debugLine="If result = DialogResponse.POSITIVE Then";
if ((_result).equals(BA.NumberToString(__c.DialogResponse.POSITIVE))) { 
 //BA.debugLineNum = 1018;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery2(\"select PE_P";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery2("select PE_PROID,PE_CANT, PE_FOLIO, PE_PRONOMBRE FROM PEDIDO where pe_pronombre = ? and pe_cliente in (Select CUENTA from cuentaa) ",new String[]{BA.ObjectToString(_value)})));
 //BA.debugLineNum = 1019;BA.debugLine="c.Position=0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 1020;BA.debugLine="Log(vamoaver.Get(Position))";
__c.LogImpl("750200583",BA.ObjectToString(_vamoaver.Get(_position)),0);
 //BA.debugLineNum = 1021;BA.debugLine="If vamoaver.Get(Position) = \"PREVENTA_48\" Then";
if ((_vamoaver.Get(_position)).equals((Object)("PREVENTA_48"))) { 
 //BA.debugLineNum = 1022;BA.debugLine="Log(\"CAT_GUNAPROD2\")";
__c.LogImpl("750200585","CAT_GUNAPROD2",0);
 //BA.debugLineNum = 1023;BA.debugLine="Log(Position&\",1\")";
__c.LogImpl("750200586",BA.NumberToString(_position)+",1",0);
 //BA.debugLineNum = 1024;BA.debugLine="Log(Value&\",1\")";
__c.LogImpl("750200587",BA.ObjectToString(_value)+",1",0);
 //BA.debugLineNum = 1025;BA.debugLine="Starter.tabla = \"CAT_GUNAPROD2\"";
_starter._tabla /*String*/  = "CAT_GUNAPROD2";
 }else {
 //BA.debugLineNum = 1027;BA.debugLine="Log(\"CAT_GUNAPROD\")";
__c.LogImpl("750200590","CAT_GUNAPROD",0);
 //BA.debugLineNum = 1028;BA.debugLine="Log(Position&\",2\")";
__c.LogImpl("750200591",BA.NumberToString(_position)+",2",0);
 //BA.debugLineNum = 1029;BA.debugLine="Log(Value&\",2\")";
__c.LogImpl("750200592",BA.ObjectToString(_value)+",2",0);
 //BA.debugLineNum = 1030;BA.debugLine="Starter.tabla = \"CAT_GUNAPROD\"";
_starter._tabla /*String*/  = "CAT_GUNAPROD";
 };
 //BA.debugLineNum = 1034;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"INSERT INT";
_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("INSERT INTO  INVENT_X_ENVIAR (ALMACEN , PROID , CANTIDAD ) VALUES(?,?,?) ",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(_subs._traealmacen /*String*/ (ba)),(Object)(_c.GetString("PE_PROID")),(Object)((double)(Double.parseDouble(_c.GetString("PE_CANT")))*-1)}));
 //BA.debugLineNum = 1035;BA.debugLine="c2=B4XPages.MainPage.skmt.ExecQuery2($\"select co";
_c2 = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery2(("select count(*) AS CUANTOS from "+__c.SmartStringFormatter("",(Object)(_starter._tabla /*String*/ ))+" where CAT_GP_ID in (select pe_cedis from pedido where pe_pronombre = ? and pe_cliente in (Select CUENTA from cuentaa)) and CAT_GP_CLASIF = 'PROMOS' AND CAT_GP_TIPO = 'PROMOS' AND CAT_GP_SUBTIPO = 'PROMOS'"),new String[]{BA.ObjectToString(_value)})));
 //BA.debugLineNum = 1036;BA.debugLine="c2.Position=0";
_c2.setPosition((int) (0));
 //BA.debugLineNum = 1037;BA.debugLine="Log(\"aqui entre1\")";
__c.LogImpl("750200600","aqui entre1",0);
 //BA.debugLineNum = 1038;BA.debugLine="If c2.GetString(\"CUANTOS\") > 0 Then";
if ((double)(Double.parseDouble(_c2.GetString("CUANTOS")))>0) { 
 //BA.debugLineNum = 1039;BA.debugLine="Log(\"aqui entre\")";
__c.LogImpl("750200602","aqui entre",0);
 //BA.debugLineNum = 1040;BA.debugLine="j3 = B4XPages.MainPage.skmt.ExecQuery2(\"SELECT";
_j3 = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery2("SELECT PE_CEDIS, PE_CANT,PE_PROID, PE_PRONOMBRE FROM PEDIDO WHERE PE_CEDIS IN (SELECT PE_CEDIS FROM PEDIDO WHERE PE_PRONOMBRE = ? and PE_FOLIO = ?)",new String[]{BA.ObjectToString(_value),BA.ObjectToString(_vamoaver.Get(_position))})));
 //BA.debugLineNum = 1041;BA.debugLine="Log(j3.RowCount)";
__c.LogImpl("750200604",BA.NumberToString(_j3.getRowCount()),0);
 //BA.debugLineNum = 1043;BA.debugLine="If j3.RowCount > 0 Then";
if (_j3.getRowCount()>0) { 
 //BA.debugLineNum = 1044;BA.debugLine="Log(\"estoy aqui\")";
__c.LogImpl("750200607","estoy aqui",0);
 //BA.debugLineNum = 1045;BA.debugLine="For i = 0 To j3.RowCount -1";
{
final int step29 = 1;
final int limit29 = (int) (_j3.getRowCount()-1);
_i = (int) (0) ;
for (;_i <= limit29 ;_i = _i + step29 ) {
 //BA.debugLineNum = 1046;BA.debugLine="Log(\"aqui tronare?\")";
__c.LogImpl("750200609","aqui tronare?",0);
 //BA.debugLineNum = 1047;BA.debugLine="j3.Position = i";
_j3.setPosition(_i);
 //BA.debugLineNum = 1048;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery($\"update";
_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("update CAT_GUNAPROD set cat_gp_almacen = cat_gp_almacen + "+__c.SmartStringFormatter("",(Object)(_j3.GetString("PE_CANT")))+" where cat_gp_id = '"+__c.SmartStringFormatter("",(Object)(_j3.GetString("PE_PROID")))+"'"));
 //BA.debugLineNum = 1049;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery($\"update";
_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("update CAT_GUNAPROD2 set cat_gp_almacen = cat_gp_almacen + "+__c.SmartStringFormatter("",(Object)(_j3.GetString("PE_CANT")))+" where cat_gp_id = '"+__c.SmartStringFormatter("",(Object)(_j3.GetString("PE_PROID")))+"'"));
 //BA.debugLineNum = 1050;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"delete";
_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("delete from pedido where  pe_cedis in (select pe_cedis from pedido where pe_pronombre = ?) and pe_cliente in (Select CUENTA from cuentaa) AND PE_FOLIO = ?",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{_value,_vamoaver.Get(_position)}));
 }
};
 };
 //BA.debugLineNum = 1053;BA.debugLine="j3.Close";
_j3.Close();
 }else {
 //BA.debugLineNum = 1055;BA.debugLine="Log(\"aqui entre2\")";
__c.LogImpl("750200618","aqui entre2",0);
 //BA.debugLineNum = 1056;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery($\"update CA";
_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("update CAT_GUNAPROD set cat_gp_almacen = cat_gp_almacen + "+__c.SmartStringFormatter("",(Object)(_c.GetString("PE_CANT")))+" where cat_gp_id = '"+__c.SmartStringFormatter("",(Object)(_c.GetString("PE_PROID")))+"'"));
 //BA.debugLineNum = 1057;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery($\"update CA";
_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("update CAT_GUNAPROD2 set cat_gp_almacen = cat_gp_almacen + "+__c.SmartStringFormatter("",(Object)(_c.GetString("PE_CANT")))+" where cat_gp_id = '"+__c.SmartStringFormatter("",(Object)(_c.GetString("PE_PROID")))+"'"));
 //BA.debugLineNum = 1058;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"delete fr";
_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("delete from pedido where  pe_pronombre = ?  and pe_cliente in (Select CUENTA from cuentaa) AND PE_FOLIO = ?",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{_value,_vamoaver.Get(_position)}));
 };
 //BA.debugLineNum = 1060;BA.debugLine="c.Close";
_c.Close();
 //BA.debugLineNum = 1061;BA.debugLine="c2.Close";
_c2.Close();
 //BA.debugLineNum = 1062;BA.debugLine="DateTime.DateFormat = \"MM/dd/yyyy\"";
__c.DateTime.setDateFormat("MM/dd/yyyy");
 //BA.debugLineNum = 1063;BA.debugLine="sDate=DateTime.Date(DateTime.Now)";
_sdate = __c.DateTime.Date(__c.DateTime.getNow());
 //BA.debugLineNum = 1064;BA.debugLine="sTime=DateTime.Time(DateTime.Now)";
_stime = __c.DateTime.Time(__c.DateTime.getNow());
 //BA.debugLineNum = 1065;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"Select CUENT";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("Select CUENTA from cuentaa")));
 //BA.debugLineNum = 1066;BA.debugLine="c.Position=0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 1067;BA.debugLine="clie_id = c.GetString(\"CUENTA\")";
_clie_id = _c.GetString("CUENTA");
 //BA.debugLineNum = 1068;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"select USUAR";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select USUARIO from usuarioa")));
 //BA.debugLineNum = 1069;BA.debugLine="c.Position=0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 1070;BA.debugLine="usuario = c.GetString(\"USUARIO\")";
_usuario = _c.GetString("USUARIO");
 //BA.debugLineNum = 1071;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"select sum(p";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select sum(pe_costo_tot) as TOTAL_CLIE, SUM(PE_CANT) AS CANT_CLIE, count(*) as CUANTOS FROM PEDIDO WHERE PE_CLIENTE IN (Select CUENTA from cuentaa)")));
 //BA.debugLineNum = 1072;BA.debugLine="c.Position=0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 1073;BA.debugLine="If c.GetString(\"CUANTOS\") > 0 Then";
if ((double)(Double.parseDouble(_c.GetString("CUANTOS")))>0) { 
 //BA.debugLineNum = 1074;BA.debugLine="Log(\"aqui5\")";
__c.LogImpl("750200637","aqui5",0);
 //BA.debugLineNum = 1075;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"delete fro";
_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("delete from pedido_cliente where PC_CLIENTE In (select cuenta from cuentaa)");
 //BA.debugLineNum = 1076;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"insert in";
_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("insert into pedido_cliente(PC_CLIENTE, PC_FECHA, PC_USER, PC_NOART, PC_MONTO,PC_LON, PC_LAT) VALUES (?,?,?,?,?,?,?)",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(_clie_id),(Object)(_sdate+_stime),(Object)(_usuario),(Object)(_c.GetString("CANT_CLIE")),(Object)(_c.GetString("TOTAL_CLIE")),(Object)(_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._lon_gps /*String*/ ),(Object)(_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._lat_gps /*String*/ )}));
 //BA.debugLineNum = 1077;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"delete fro";
_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("delete from pedido_cliente where PC_CLIENTE In (select cuenta from cuentaa)");
 //BA.debugLineNum = 1078;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"UPDATE kmt";
_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("UPDATE kmt_info set gestion = 0  where CAT_CL_CODIGO In (select cuenta from cuentaa)");
 //BA.debugLineNum = 1079;BA.debugLine="Private h As Cursor = B4XPages.MainPage.skmt.Ex";
_h = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_h = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select sum(PE_CANT) as PC_NOART, sum (PE_COSTO_TOT) as PC_MONTO from PEDIDO where PE_CLIENTE in (Select CUENTA from cuentaa) AND PE_PROID NOT IN (SELECT CAT_PA_ID FROM PROMOS_COMP )")));
 //BA.debugLineNum = 1080;BA.debugLine="h.Position=0";
_h.setPosition((int) (0));
 //BA.debugLineNum = 1081;BA.debugLine="l_cant.Text = h.GetString(\"PC_NOART\")";
_l_cant.setText(BA.ObjectToCharSequence(_h.GetString("PC_NOART")));
 //BA.debugLineNum = 1082;BA.debugLine="l_total2.Text = h.GetString(\"PC_MONTO\")";
_l_total2.setText(BA.ObjectToCharSequence(_h.GetString("PC_MONTO")));
 //BA.debugLineNum = 1083;BA.debugLine="h.Close";
_h.Close();
 }else {
 //BA.debugLineNum = 1085;BA.debugLine="Log(\"aqui6\")";
__c.LogImpl("750200648","aqui6",0);
 //BA.debugLineNum = 1086;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"delete fro";
_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("delete from pedido_cliente where PC_CLIENTE In (select cuenta from cuentaa)");
 //BA.debugLineNum = 1087;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"UPDATE kmt";
_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("UPDATE kmt_info set gestion = 0  where CAT_CL_CODIGO In (select cuenta from cuentaa)");
 //BA.debugLineNum = 1088;BA.debugLine="Private h As Cursor = B4XPages.MainPage.skmt.Ex";
_h = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_h = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select sum(PE_CANT) as PC_NOART, sum (PE_COSTO_TOT) as PC_MONTO from PEDIDO where PE_CLIENTE in (Select CUENTA from cuentaa) AND PE_PROID NOT IN (SELECT CAT_PA_ID FROM PROMOS_COMP )")));
 //BA.debugLineNum = 1089;BA.debugLine="h.Position=0";
_h.setPosition((int) (0));
 //BA.debugLineNum = 1090;BA.debugLine="l_cant.Text = 0";
_l_cant.setText(BA.ObjectToCharSequence(0));
 //BA.debugLineNum = 1091;BA.debugLine="l_total2.Text = 0";
_l_total2.setText(BA.ObjectToCharSequence(0));
 //BA.debugLineNum = 1092;BA.debugLine="h.Close";
_h.Close();
 };
 //BA.debugLineNum = 1094;BA.debugLine="b_terminar1_Click";
_b_terminar1_click();
 };
 }else {
 //BA.debugLineNum = 1097;BA.debugLine="ToastMessageShow(\"Esta venta ya esta guardada, n";
__c.ToastMessageShow(BA.ObjectToCharSequence("Esta venta ya esta guardada, no se puede editar ni borrar."),__c.False);
 };
 //BA.debugLineNum = 1099;BA.debugLine="End Sub";
return "";
}
public String  _lv_promos_itemclick(int _position,Object _value) throws Exception{
medicomed.keymon.com.mx.c_cliente _cliente = null;
medicomed.keymon.com.mx.c_promos _promos = null;
 //BA.debugLineNum = 400;BA.debugLine="Sub lv_promos_ItemClick (Position As Int, Value As";
 //BA.debugLineNum = 401;BA.debugLine="clv_prods_ll.AsView.Visible = False";
_clv_prods_ll._asview().setVisible(__c.False);
 //BA.debugLineNum = 402;BA.debugLine="Dim cliente As C_Cliente = B4XPages.GetPage(\"Clie";
_cliente = (medicomed.keymon.com.mx.c_cliente)(_b4xpages._getpage /*Object*/ (ba,"Cliente"));
 //BA.debugLineNum = 404;BA.debugLine="If Value = \"PROMOS\" And cliente.cuenta <> \"N\" The";
if ((_value).equals((Object)("PROMOS")) && (_cliente._cuenta /*String*/ ).equals("N") == false) { 
 //BA.debugLineNum = 405;BA.debugLine="entro = \"3\"";
_entro = "3";
 //BA.debugLineNum = 406;BA.debugLine="marca = \"PROMOS\"";
_marca = "PROMOS";
 //BA.debugLineNum = 407;BA.debugLine="tipo = \"PROMOS\"";
_tipo = "PROMOS";
 }else if((_value).equals((Object)("PROMOS")) && (_cliente._cuenta /*String*/ ).equals("N")) { 
 //BA.debugLineNum = 409;BA.debugLine="entro = \"5\"";
_entro = "5";
 //BA.debugLineNum = 410;BA.debugLine="B4XPages.ShowPage(\"Cliente\")";
_b4xpages._showpage /*String*/ (ba,"Cliente");
 };
 //BA.debugLineNum = 412;BA.debugLine="If entro = \"3\" Then";
if ((_entro).equals("3")) { 
 }else if((_entro).equals("4")) { 
 //BA.debugLineNum = 416;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"delete from";
_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("delete from PROID");
 //BA.debugLineNum = 417;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"INSERT INT";
_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("INSERT INTO PROID VALUES (?)",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{_value}));
 //BA.debugLineNum = 418;BA.debugLine="Dim promos As C_Promos = B4XPages.GetPage(\"Promo";
_promos = (medicomed.keymon.com.mx.c_promos)(_b4xpages._getpage /*Object*/ (ba,"Promos"));
 //BA.debugLineNum = 419;BA.debugLine="promos.laPromo = Subs.traeProdIdDeBD.Get(\"id\")";
_promos._lapromo /*String*/  = BA.ObjectToString(_subs._traeprodiddebd /*anywheresoftware.b4a.objects.collections.Map*/ (ba).Get((Object)("id")));
 //BA.debugLineNum = 420;BA.debugLine="promos.elCliente = Subs.traeUsuarioDeBD";
_promos._elcliente /*String*/  = _subs._traeusuariodebd /*String*/ (ba);
 //BA.debugLineNum = 421;BA.debugLine="B4XPages.ShowPage(\"Promos\")";
_b4xpages._showpage /*String*/ (ba,"Promos");
 };
 //BA.debugLineNum = 423;BA.debugLine="End Sub";
return "";
}
public String  _lv_promos_itemlongclick(int _position,Object _value) throws Exception{
String _id = "";
 //BA.debugLineNum = 928;BA.debugLine="Private Sub lv_promos_ItemLongClick (Position As I";
 //BA.debugLineNum = 929;BA.debugLine="Log(\"Promo longclic = \"&Value)";
__c.LogImpl("749807361","Promo longclic = "+BA.ObjectToString(_value),0);
 //BA.debugLineNum = 930;BA.debugLine="Private id As String = \"\"";
_id = "";
 //BA.debugLineNum = 931;BA.debugLine="Dim c As Cursor = B4XPages.MainPage.skmt.ExecQuer";
_c = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*medicomed.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery(("select CAT_GP_ID from "+__c.SmartStringFormatter("",(Object)(_starter._tabla /*String*/ ))+" where CAT_GP_TIPO = 'PROMOS' and CAT_GP_NOMBRE = '"+__c.SmartStringFormatter("",_value)+"'"))));
 //BA.debugLineNum = 932;BA.debugLine="If c.RowCount > 0 Then";
if (_c.getRowCount()>0) { 
 //BA.debugLineNum = 933;BA.debugLine="c.Position = 0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 934;BA.debugLine="id = c.GetString(\"CAT_GP_ID\")";
_id = _c.GetString("CAT_GP_ID");
 };
 //BA.debugLineNum = 936;BA.debugLine="l_info.Text = $\"ID: ${id}${CRLF}${Value}\"$";
_l_info.setText(BA.ObjectToCharSequence(("ID: "+__c.SmartStringFormatter("",(Object)(_id))+""+__c.SmartStringFormatter("",(Object)(__c.CRLF))+""+__c.SmartStringFormatter("",_value)+"")));
 //BA.debugLineNum = 937;BA.debugLine="l_info.Visible = True";
_l_info.setVisible(__c.True);
 //BA.debugLineNum = 938;BA.debugLine="End Sub";
return "";
}
public String  _lv_subtipo_itemclick(int _position,Object _value) throws Exception{
 //BA.debugLineNum = 965;BA.debugLine="Private Sub lv_subtipo_ItemClick (Position As Int,";
 //BA.debugLineNum = 979;BA.debugLine="End Sub";
return "";
}
public String  _lv_tipo_itemclick(int _position,Object _value) throws Exception{
 //BA.debugLineNum = 945;BA.debugLine="Private Sub lv_tipo_ItemClick (Position As Int, Va";
 //BA.debugLineNum = 963;BA.debugLine="End Sub";
return "";
}
public String  _p_vistapreviatrans_click() throws Exception{
 //BA.debugLineNum = 981;BA.debugLine="Private Sub p_vistaPreviaTrans_Click";
 //BA.debugLineNum = 983;BA.debugLine="End Sub";
return "";
}
public String  _pclv_addprods() throws Exception{
 //BA.debugLineNum = 272;BA.debugLine="Sub PCLV_AddProds";
 //BA.debugLineNum = 274;BA.debugLine="End Sub";
return "";
}
public Object  _pclv_hintrequested(int _index) throws Exception{
String _word = "";
 //BA.debugLineNum = 1382;BA.debugLine="Sub PCLV_HintRequested(Index As Int) As Object";
 //BA.debugLineNum = 1383;BA.debugLine="Dim word As String = listaHints.get(Index)";
_word = BA.ObjectToString(_listahints.Get(_index));
 //BA.debugLineNum = 1384;BA.debugLine="Return word";
if (true) return (Object)(_word);
 //BA.debugLineNum = 1385;BA.debugLine="End Sub";
return null;
}
public Object callSub(String sub, Object sender, Object[] args) throws Exception {
BA.senderHolder.set(sender);
if (BA.fastSubCompare(sub, "B4XPAGE_CREATED"))
	return _b4xpage_created((anywheresoftware.b4a.objects.B4XViewWrapper) args[0]);
return BA.SubDelegator.SubNotFound;
}
}
