package gunav2.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, "gunav2.keymon.com.mx.c_productos");
            if (htSubs == null) {
                ba.loadHtSubs(this.getClass());
                htSubs = ba.htSubs;
            }
            
        }
        if (BA.isShellModeRuntimeCheck(ba)) 
			   this.getClass().getMethod("_class_globals", gunav2.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 String _tipo_venta = "";
public b4a.example3.customlistview _clv_prods_ll = null;
public gunav2.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_calatolos = null;
public anywheresoftware.b4a.objects.PanelWrapper _panel2 = null;
public anywheresoftware.b4a.objects.PanelWrapper _p_botmasmenc = null;
public anywheresoftware.b4a.objects.PanelWrapper _p_promodesc = null;
public anywheresoftware.b4a.objects.LabelWrapper _l_promodesc = null;
public anywheresoftware.b4a.objects.ButtonWrapper _b_okpromodesc = null;
public anywheresoftware.b4a.objects.PanelWrapper _p_devo = null;
public anywheresoftware.b4a.objects.LabelWrapper _l_proddev = null;
public anywheresoftware.b4a.objects.ButtonWrapper _b_devmas = null;
public anywheresoftware.b4a.objects.LabelWrapper _l_cantdev = null;
public anywheresoftware.b4a.objects.ButtonWrapper _b_devmenos = null;
public anywheresoftware.b4a.objects.ButtonWrapper _b_acep_dev = null;
public double _preciodev = 0;
public String _nombredev = "";
public anywheresoftware.b4a.objects.CompoundButtonWrapper.CheckBoxWrapper _cb_descuento = null;
public b4a.example.dateutils _dateutils = null;
public gunav2.keymon.com.mx.main _main = null;
public gunav2.keymon.com.mx.starter _starter = null;
public gunav2.keymon.com.mx.subs _subs = null;
public gunav2.keymon.com.mx.mapa_rutas _mapa_rutas = null;
public gunav2.keymon.com.mx.appupdater _appupdater = null;
public gunav2.keymon.com.mx.firebasemessaging _firebasemessaging = null;
public gunav2.keymon.com.mx.tracker _tracker = null;
public gunav2.keymon.com.mx.newinst2 _newinst2 = null;
public gunav2.keymon.com.mx.b4xpages _b4xpages = null;
public gunav2.keymon.com.mx.b4xcollections _b4xcollections = null;
public gunav2.keymon.com.mx.httputils2service _httputils2service = null;
public gunav2.keymon.com.mx.xuiviewsutils _xuiviewsutils = null;
public String  _b_acep_dev_click() throws Exception{
 //BA.debugLineNum = 2448;BA.debugLine="Private Sub b_acep_dev_Click";
 //BA.debugLineNum = 2449;BA.debugLine="p_devo.Visible = False";
_p_devo.setVisible(__c.False);
 //BA.debugLineNum = 2450;BA.debugLine="End Sub";
return "";
}
public String  _b_aceptar_click() throws Exception{
 //BA.debugLineNum = 1383;BA.debugLine="Private Sub b_aceptar_Click";
 //BA.debugLineNum = 1384;BA.debugLine="p_vistaPreviaTrans.Visible=False";
_p_vistapreviatrans.setVisible(__c.False);
 //BA.debugLineNum = 1385;BA.debugLine="B4XPages.ShowPage(\"Cliente\")";
_b4xpages._showpage /*String*/ (ba,"Cliente");
 //BA.debugLineNum = 1386;BA.debugLine="End Sub";
return "";
}
public String  _b_continuar_click() throws Exception{
anywheresoftware.b4a.objects.collections.Map _m = null;
 //BA.debugLineNum = 1273;BA.debugLine="Private Sub b_continuar_Click";
 //BA.debugLineNum = 1274;BA.debugLine="Log(\"b_continuar_Click\")";
__c.LogImpl("441025537","b_continuar_Click",0);
 //BA.debugLineNum = 1275;BA.debugLine="cuentaProds";
_cuentaprods();
 //BA.debugLineNum = 1277;BA.debugLine="Log($\"prodsMap=${prodsMap}\"$)";
__c.LogImpl("441025540",("prodsMap="+__c.SmartStringFormatter("",(Object)(_prodsmap.getObject()))+""),0);
 //BA.debugLineNum = 1285;BA.debugLine="Log(\"promos-inv, prods-inv, cat-vis\")";
__c.LogImpl("441025548","promos-inv, prods-inv, cat-vis",0);
 //BA.debugLineNum = 1286;BA.debugLine="lv_promos.Visible = False";
_lv_promos.setVisible(__c.False);
 //BA.debugLineNum = 1287;BA.debugLine="clv_prods_ll.AsView.Visible = False";
_clv_prods_ll._asview().setVisible(__c.False);
 //BA.debugLineNum = 1288;BA.debugLine="lv_subtipo.Visible = False";
_lv_subtipo.setVisible(__c.False);
 //BA.debugLineNum = 1289;BA.debugLine="lv_tipo.Visible = False";
_lv_tipo.setVisible(__c.False);
 //BA.debugLineNum = 1290;BA.debugLine="lv_catalogos.Visible = True";
_lv_catalogos.setVisible(__c.True);
 //BA.debugLineNum = 1291;BA.debugLine="Log(\"Continuar\")";
__c.LogImpl("441025554","Continuar",0);
 //BA.debugLineNum = 1292;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 = 1293;BA.debugLine="prodsPedidoActual = m.Get(\"productos\")";
_prodspedidoactual = BA.ObjectToString(_m.Get((Object)("productos")));
 //BA.debugLineNum = 1294;BA.debugLine="montoPedidoActual = m.Get(\"monto\")";
_montopedidoactual = BA.ObjectToString(_m.Get((Object)("monto")));
 //BA.debugLineNum = 1295;BA.debugLine="End Sub";
return "";
}
public String  _b_devmas_click() throws Exception{
anywheresoftware.b4a.sql.SQL.CursorWrapper _c6 = null;
anywheresoftware.b4a.sql.SQL.CursorWrapper _dev2 = null;
 //BA.debugLineNum = 2469;BA.debugLine="Private Sub b_devmas_Click";
 //BA.debugLineNum = 2471;BA.debugLine="Dim c6 As Cursor = B4XPages.MainPage.skmt.ExecQue";
_c6 = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_c6 = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select IFNULL(sum(PE_CANT),0) as PC_NOART, IFNULL(sum (PE_COSTO_TOT),0) 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 ) and PE_CEDIS <> 'DUR' ")));
 //BA.debugLineNum = 2472;BA.debugLine="If c6.RowCount > 0 Then";
if (_c6.getRowCount()>0) { 
 //BA.debugLineNum = 2473;BA.debugLine="c6.Position = 0";
_c6.setPosition((int) (0));
 //BA.debugLineNum = 2477;BA.debugLine="Log(((l_cantdev.Text + 1)* preciodev))";
__c.LogImpl("442401800",BA.NumberToString((((double)(Double.parseDouble(_l_cantdev.getText()))+1)*_preciodev)),0);
 //BA.debugLineNum = 2478;BA.debugLine="If c6.GetString(\"PC_MONTO\")- ((l_cantdev.Text +";
if ((double)(Double.parseDouble(_c6.GetString("PC_MONTO")))-(((double)(Double.parseDouble(_l_cantdev.getText()))+1)*_preciodev)>=0) { 
 //BA.debugLineNum = 2479;BA.debugLine="Dim dev2 As Cursor = B4XPages.MainPage.skmt.Exe";
_dev2 = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_dev2 = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery(("select CAT_GP_ID from CAT_GUNAPROD where CAT_GP_NOMBRE  = '"+__c.SmartStringFormatter("",(Object)(_nombredev))+"'"))));
 //BA.debugLineNum = 2480;BA.debugLine="dev2.Position = 0";
_dev2.setPosition((int) (0));
 //BA.debugLineNum = 2481;BA.debugLine="l_cantdev.Text = NumberFormat2((l_cantdev.Text";
_l_cantdev.setText(BA.ObjectToCharSequence(__c.NumberFormat2(((double)(Double.parseDouble(_l_cantdev.getText()))+1),(int) (0),(int) (0),(int) (0),__c.False)));
 //BA.debugLineNum = 2483;BA.debugLine="If B4XPages.MainPage.tipo_venta = \"PREVENTA_FUT";
if ((_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._tipo_venta /*String*/ ).equals("PREVENTA_FUTURA")) { 
 //BA.debugLineNum = 2485;BA.debugLine="Subs.actualizaProducto( \"DUR\", (preciodev * -1";
_subs._actualizaproducto /*String*/ (ba,"DUR",BA.NumberToString((_preciodev*-1)),_l_cantdev.getText(),_nombredev,_dev2.GetString("CAT_GP_ID"),_clienteid,_subs._traefecha /*String*/ (ba),_subs._traeusuariodebd /*String*/ (ba),_rutausuario,BA.NumberToString(0),_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._tipo_venta /*String*/ ,BA.NumberToString(1),BA.NumberToString(1),BA.NumberToString(1));
 }else {
 //BA.debugLineNum = 2487;BA.debugLine="Subs.actualizaProducto( \"DUR\", (preciodev * -1";
_subs._actualizaproducto /*String*/ (ba,"DUR",BA.NumberToString((_preciodev*-1)),_l_cantdev.getText(),_nombredev,_dev2.GetString("CAT_GP_ID"),_clienteid,_subs._traefecha /*String*/ (ba),_subs._traeusuariodebd /*String*/ (ba),_rutausuario,BA.NumberToString(0),_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._tipo_venta /*String*/ ,BA.NumberToString(1),BA.NumberToString(0),BA.NumberToString(1));
 };
 }else {
 //BA.debugLineNum = 2493;BA.debugLine="MsgboxAsync(\"El monto de venta es menor al prec";
__c.MsgboxAsync(BA.ObjectToCharSequence("El monto de venta es menor al precio de este producto"),BA.ObjectToCharSequence("Atención"),ba);
 };
 };
 //BA.debugLineNum = 2504;BA.debugLine="End Sub";
return "";
}
public String  _b_devmenos_click() throws Exception{
anywheresoftware.b4a.sql.SQL.CursorWrapper _dev2 = null;
 //BA.debugLineNum = 2452;BA.debugLine="Private Sub b_devmenos_Click";
 //BA.debugLineNum = 2453;BA.debugLine="If NumberFormat2((l_cantdev.Text - 1),0,0,0, Fals";
if ((double)(Double.parseDouble(__c.NumberFormat2(((double)(Double.parseDouble(_l_cantdev.getText()))-1),(int) (0),(int) (0),(int) (0),__c.False)))>=0) { 
 //BA.debugLineNum = 2455;BA.debugLine="Dim dev2 As Cursor = B4XPages.MainPage.skmt.Exec";
_dev2 = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_dev2 = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery(("select CAT_GP_ID from CAT_GUNAPROD where CAT_GP_NOMBRE  = '"+__c.SmartStringFormatter("",(Object)(_nombredev))+"'"))));
 //BA.debugLineNum = 2456;BA.debugLine="dev2.Position = 0";
_dev2.setPosition((int) (0));
 //BA.debugLineNum = 2457;BA.debugLine="l_cantdev.Text = NumberFormat2((l_cantdev.Text -";
_l_cantdev.setText(BA.ObjectToCharSequence(__c.NumberFormat2(((double)(Double.parseDouble(_l_cantdev.getText()))-1),(int) (0),(int) (0),(int) (0),__c.False)));
 //BA.debugLineNum = 2458;BA.debugLine="If B4XPages.MainPage.tipo_venta = \"PREVENTA_FUTU";
if ((_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._tipo_venta /*String*/ ).equals("PREVENTA_FUTURA")) { 
 //BA.debugLineNum = 2460;BA.debugLine="Subs.actualizaProducto( \"DUR\", (preciodev * -1)";
_subs._actualizaproducto /*String*/ (ba,"DUR",BA.NumberToString((_preciodev*-1)),_l_cantdev.getText(),_nombredev,_dev2.GetString("CAT_GP_ID"),_clienteid,_subs._traefecha /*String*/ (ba),_subs._traeusuariodebd /*String*/ (ba),_rutausuario,BA.NumberToString(0),_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._tipo_venta /*String*/ ,BA.NumberToString(1),BA.NumberToString(1),BA.NumberToString(1));
 }else {
 //BA.debugLineNum = 2462;BA.debugLine="Subs.actualizaProducto( \"DUR\", (preciodev * -1)";
_subs._actualizaproducto /*String*/ (ba,"DUR",BA.NumberToString((_preciodev*-1)),_l_cantdev.getText(),_nombredev,_dev2.GetString("CAT_GP_ID"),_clienteid,_subs._traefecha /*String*/ (ba),_subs._traeusuariodebd /*String*/ (ba),_rutausuario,BA.NumberToString(0),_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._tipo_venta /*String*/ ,BA.NumberToString(1),BA.NumberToString(0),BA.NumberToString(1));
 };
 };
 //BA.debugLineNum = 2467;BA.debugLine="End Sub";
return "";
}
public String  _b_okpromodesc_click() throws Exception{
 //BA.debugLineNum = 2361;BA.debugLine="Private Sub b_okpromodesc_Click";
 //BA.debugLineNum = 2362;BA.debugLine="p_promodesc.Visible = False";
_p_promodesc.setVisible(__c.False);
 //BA.debugLineNum = 2363;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 _panelpiezas = null;
anywheresoftware.b4a.objects.B4XViewWrapper _lprodx = null;
anywheresoftware.b4a.objects.CompoundButtonWrapper.CheckBoxWrapper _cb_des = null;
String _aplicades = "";
String _precio = "";
String _inv = "";
String _existencias = "";
String _id = "";
String _nombrex = "";
anywheresoftware.b4a.objects.CSBuilder _cs = null;
anywheresoftware.b4a.sql.SQL.CursorWrapper _o = null;
String _invactualizado = "";
 //BA.debugLineNum = 891;BA.debugLine="Sub b_prodMas_Click";
 //BA.debugLineNum = 892;BA.debugLine="totalcajasmaspiezas = 0";
_totalcajasmaspiezas = (int) (0);
 //BA.debugLineNum = 893;BA.debugLine="etCantHasFocus = False";
_etcanthasfocus = __c.False;
 //BA.debugLineNum = 894;BA.debugLine="Root.RequestFocus";
_root.RequestFocus();
 //BA.debugLineNum = 897;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 = 898;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 = 899;BA.debugLine="Dim pnl As B4XView = pnl0.GetView(0)";
_pnl = new anywheresoftware.b4a.objects.B4XViewWrapper();
_pnl = _pnl0.GetView((int) (0));
 //BA.debugLineNum = 900;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 = 902;BA.debugLine="Dim panelpiezas As B4XView = pnl.GetView(2)";
_panelpiezas = new anywheresoftware.b4a.objects.B4XViewWrapper();
_panelpiezas = _pnl.GetView((int) (2));
 //BA.debugLineNum = 904;BA.debugLine="Dim lProdX As B4XView = pnl.GetView(1)";
_lprodx = new anywheresoftware.b4a.objects.B4XViewWrapper();
_lprodx = _pnl.GetView((int) (1));
 //BA.debugLineNum = 905;BA.debugLine="Dim cb_des As CheckBox = pnl.GetView(4)";
_cb_des = new anywheresoftware.b4a.objects.CompoundButtonWrapper.CheckBoxWrapper();
_cb_des = (anywheresoftware.b4a.objects.CompoundButtonWrapper.CheckBoxWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.CompoundButtonWrapper.CheckBoxWrapper(), (android.widget.CheckBox)(_pnl.GetView((int) (4)).getObject()));
 //BA.debugLineNum = 906;BA.debugLine="Dim aplicades As String";
_aplicades = "";
 //BA.debugLineNum = 908;BA.debugLine="Private precio As String=clv_prods_ll.GetValue(in";
_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 = 909;BA.debugLine="Private inv As String=clv_prods_ll.GetValue(index";
_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 = 910;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 = 911;BA.debugLine="Log($\"Existencias: ${existencias}\"$)";
__c.LogImpl("440697876",("Existencias: "+__c.SmartStringFormatter("",(Object)(_existencias))+""),0);
 //BA.debugLineNum = 912;BA.debugLine="If laCant.Text = \"\" Then laCant.Text = 0";
if ((_lacant.getText()).equals("")) { 
_lacant.setText(BA.ObjectToCharSequence(0));};
 //BA.debugLineNum = 913;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 = 930;BA.debugLine="LogColor(laCant.Text,Colors.Red)";
__c.LogImpl("440697895",_lacant.getText(),__c.Colors.Red);
 //BA.debugLineNum = 932;BA.debugLine="If Subs.traeinventario(id) > 0 And (laCant.Text <";
if ((double)(Double.parseDouble(_subs._traeinventario /*String*/ (ba,_id)))>0 && ((double)(Double.parseDouble(_lacant.getText()))<=((double)(Double.parseDouble(_lacant.getText()))+(double)(Double.parseDouble(_subs._traeinventario /*String*/ (ba,_id)))))) { 
 //BA.debugLineNum = 934;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))-1)));
 //BA.debugLineNum = 935;BA.debugLine="inv = inv - 1";
_inv = BA.NumberToString((double)(Double.parseDouble(_inv))-1);
 //BA.debugLineNum = 937;BA.debugLine="laCant.Text = NumberFormat2((laCant.Text + 1), 1";
_lacant.setText(BA.ObjectToCharSequence(__c.NumberFormat2(((double)(Double.parseDouble(_lacant.getText()))+1),(int) (1),(int) (0),(int) (0),__c.False)));
 };
 //BA.debugLineNum = 940;BA.debugLine="Private nombreX As String = Subs.traeProdNombre(i";
_nombrex = _subs._traeprodnombre /*String*/ (ba,_id);
 //BA.debugLineNum = 949;BA.debugLine="If cb_des.Checked Then";
if (_cb_des.getChecked()) { 
 //BA.debugLineNum = 950;BA.debugLine="Log(\" descuento igual a True\")";
__c.LogImpl("440697915"," descuento igual a True",0);
 //BA.debugLineNum = 951;BA.debugLine="aplicades = \"1\"";
_aplicades = "1";
 }else {
 //BA.debugLineNum = 953;BA.debugLine="Log(\"descuento igual a false\")";
__c.LogImpl("440697918","descuento igual a false",0);
 //BA.debugLineNum = 954;BA.debugLine="aplicades = \"0\"";
_aplicades = "0";
 };
 //BA.debugLineNum = 957;BA.debugLine="LogColor(laCant.Text,Colors.Red)";
__c.LogImpl("440697922",_lacant.getText(),__c.Colors.Red);
 //BA.debugLineNum = 963;BA.debugLine="Log(B4XPages.MainPage.tipo_venta)";
__c.LogImpl("440697928",_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._tipo_venta /*String*/ ,0);
 //BA.debugLineNum = 964;BA.debugLine="If B4XPages.MainPage.tipo_venta = \"PREVENTA_FUTUR";
if ((_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._tipo_venta /*String*/ ).equals("PREVENTA_FUTURA")) { 
 //BA.debugLineNum = 966;BA.debugLine="Subs.actualizaProducto(Subs.traeAlmacen, precio,";
_subs._actualizaproducto /*String*/ (ba,_subs._traealmacen /*String*/ (ba),_precio,_lacant.getText(),_subs._traeprodnombre /*String*/ (ba,_id),_id,_clienteid,_subs._traefecha /*String*/ (ba),_subs._traeusuariodebd /*String*/ (ba),_rutausuario,BA.NumberToString(0),_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._tipo_venta /*String*/ ,BA.NumberToString(0),BA.NumberToString(1),_aplicades);
 }else {
 //BA.debugLineNum = 968;BA.debugLine="Subs.actualizaProducto(Subs.traeAlmacen, precio,";
_subs._actualizaproducto /*String*/ (ba,_subs._traealmacen /*String*/ (ba),_precio,_lacant.getText(),_subs._traeprodnombre /*String*/ (ba,_id),_id,_clienteid,_subs._traefecha /*String*/ (ba),_subs._traeusuariodebd /*String*/ (ba),_rutausuario,BA.NumberToString(0),_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._tipo_venta /*String*/ ,BA.NumberToString(0),BA.NumberToString(0),_aplicades);
 };
 //BA.debugLineNum = 971;BA.debugLine="cuentaProds";
_cuentaprods();
 //BA.debugLineNum = 974;BA.debugLine="Private cs As CSBuilder";
_cs = new anywheresoftware.b4a.objects.CSBuilder();
 //BA.debugLineNum = 975;BA.debugLine="cs.Initialize";
_cs.Initialize();
 //BA.debugLineNum = 976;BA.debugLine="Private o As Cursor = Starter.skmt.ExecQuery($\"se";
_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)(_subs._traetablaprods /*String*/ (ba,_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._tipo_venta /*String*/ )))+" where CAT_GP_ID = '"+__c.SmartStringFormatter("",(Object)(_id))+"'"))));
 //BA.debugLineNum = 977;BA.debugLine="Private invActualizado As String = \"0\"";
_invactualizado = "0";
 //BA.debugLineNum = 978;BA.debugLine="If o.RowCount > 0 Then";
if (_o.getRowCount()>0) { 
 //BA.debugLineNum = 979;BA.debugLine="o.Position = 0";
_o.setPosition((int) (0));
 //BA.debugLineNum = 980;BA.debugLine="invActualizado = o.GetString(\"CAT_GP_ALMACEN\")";
_invactualizado = _o.GetString("CAT_GP_ALMACEN");
 };
 //BA.debugLineNum = 989;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)))+""))).PopAll().getObject()));};
 //BA.debugLineNum = 992;BA.debugLine="invTotal = totalcajasmaspiezas + Subs.traeinventa";
_invtotal = (int) (_totalcajasmaspiezas+(double)(Double.parseDouble(_subs._traeinventario /*String*/ (ba,_id))));
 //BA.debugLineNum = 994;BA.debugLine="c = B4XPages.MainPage.skmt.ExecQuery(\"select IFNU";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select IFNULL(sum(PE_CANT),0) as PC_NOART, IFNULL(sum (PE_COSTO_TOT),0) 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 = 995;BA.debugLine="If c.RowCount > 0 Then";
if (_c.getRowCount()>0) { 
 //BA.debugLineNum = 996;BA.debugLine="C.Position = 0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 997;BA.debugLine="Log($\"registros: ${c.RowCount}, arts: ${c.GetStr";
__c.LogImpl("440697962",("registros: "+__c.SmartStringFormatter("",(Object)(_c.getRowCount()))+", arts: "+__c.SmartStringFormatter("",(Object)(_c.GetString("PC_NOART")))+", monto:"+__c.SmartStringFormatter("",(Object)(_c.GetString("PC_MONTO")))+""),0);
 //BA.debugLineNum = 998;BA.debugLine="l_totProds.Text = \"Prods: \" & c.GetString(\"PC_NO";
_l_totprods.setText(BA.ObjectToCharSequence("Prods: "+_c.GetString("PC_NOART")));
 //BA.debugLineNum = 999;BA.debugLine="l_total.Text = \"Total: $\" & c.GetString(\"PC_MONT";
_l_total.setText(BA.ObjectToCharSequence("Total: $"+_c.GetString("PC_MONTO")));
 //BA.debugLineNum = 1000;BA.debugLine="If l_total.Text = Null Or l_total.Text = \"null\"";
if (_l_total.getText()== null || (_l_total.getText()).equals("null") || (_l_total.getText()).equals("") || (_l_total.getText()).equals("Total: $null")) { 
_l_total.setText(BA.ObjectToCharSequence("Total: $0.0"));};
 //BA.debugLineNum = 1001;BA.debugLine="If l_totProds.Text = Null Or l_totProds.Text = \"";
if (_l_totprods.getText()== null || (_l_totprods.getText()).equals("null") || (_l_totprods.getText()).equals("") || (_l_totprods.getText()).equals("Prods: null")) { 
_l_totprods.setText(BA.ObjectToCharSequence("Prods: 0"));};
 };
 //BA.debugLineNum = 1004;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 _panelbotonesc = null;
anywheresoftware.b4a.objects.B4XViewWrapper _lprodx = null;
anywheresoftware.b4a.objects.B4XViewWrapper _panelpiezas = null;
anywheresoftware.b4a.objects.CompoundButtonWrapper.CheckBoxWrapper _cb_des = null;
String _aplicades = "";
anywheresoftware.b4a.objects.collections.Map _tmpmap1 = null;
String _precio = "";
String _id = "";
anywheresoftware.b4a.objects.collections.Map _tmpmap = null;
String _nombrex = "";
anywheresoftware.b4a.objects.CSBuilder _cs = null;
anywheresoftware.b4a.sql.SQL.CursorWrapper _o = null;
String _invactualizado = "";
anywheresoftware.b4a.sql.SQL.CursorWrapper _c7 = null;
double _totaldev = 0;
anywheresoftware.b4a.sql.SQL.CursorWrapper _c6 = null;
double _totalprod = 0;
 //BA.debugLineNum = 736;BA.debugLine="Sub b_prodMenos_Click";
 //BA.debugLineNum = 737;BA.debugLine="totalcajasmaspiezas = 0";
_totalcajasmaspiezas = (int) (0);
 //BA.debugLineNum = 738;BA.debugLine="etCantHasFocus = False";
_etcanthasfocus = __c.False;
 //BA.debugLineNum = 739;BA.debugLine="Root.RequestFocus";
_root.RequestFocus();
 //BA.debugLineNum = 741;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 = 742;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 = 743;BA.debugLine="Dim pnl As B4XView = pnl0.GetView(0)";
_pnl = new anywheresoftware.b4a.objects.B4XViewWrapper();
_pnl = _pnl0.GetView((int) (0));
 //BA.debugLineNum = 744;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 = 746;BA.debugLine="Dim panelbotonesc As B4XView = pnl.GetView(3)";
_panelbotonesc = new anywheresoftware.b4a.objects.B4XViewWrapper();
_panelbotonesc = _pnl.GetView((int) (3));
 //BA.debugLineNum = 747;BA.debugLine="Dim lProdX As B4XView = pnl.GetView(1)";
_lprodx = new anywheresoftware.b4a.objects.B4XViewWrapper();
_lprodx = _pnl.GetView((int) (1));
 //BA.debugLineNum = 749;BA.debugLine="Dim panelpiezas As B4XView = pnl.GetView(2)";
_panelpiezas = new anywheresoftware.b4a.objects.B4XViewWrapper();
_panelpiezas = _pnl.GetView((int) (2));
 //BA.debugLineNum = 750;BA.debugLine="Dim cb_des As CheckBox = pnl.GetView(4)";
_cb_des = new anywheresoftware.b4a.objects.CompoundButtonWrapper.CheckBoxWrapper();
_cb_des = (anywheresoftware.b4a.objects.CompoundButtonWrapper.CheckBoxWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.CompoundButtonWrapper.CheckBoxWrapper(), (android.widget.CheckBox)(_pnl.GetView((int) (4)).getObject()));
 //BA.debugLineNum = 751;BA.debugLine="Dim aplicades As String";
_aplicades = "";
 //BA.debugLineNum = 753;BA.debugLine="If laCant.Text = \"\" Then laCant.Text = 0";
if ((_lacant.getText()).equals("")) { 
_lacant.setText(BA.ObjectToCharSequence(0));};
 //BA.debugLineNum = 755;BA.debugLine="laCant.Text = $\"${NumberFormat2(laCant.Text-1,0,0";
_lacant.setText(BA.ObjectToCharSequence((""+__c.SmartStringFormatter("",(Object)(__c.NumberFormat2((double)(Double.parseDouble(_lacant.getText()))-1,(int) (0),(int) (0),(int) (0),__c.False)))+"")));
 //BA.debugLineNum = 756;BA.debugLine="If laCant.Text < 0 Then laCant.Text = 0";
if ((double)(Double.parseDouble(_lacant.getText()))<0) { 
_lacant.setText(BA.ObjectToCharSequence(0));};
 //BA.debugLineNum = 757;BA.debugLine="Private tmpMap1 As Map = clv_prods_ll.GetValue(in";
_tmpmap1 = new anywheresoftware.b4a.objects.collections.Map();
_tmpmap1 = ((anywheresoftware.b4a.objects.collections.Map) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.collections.Map(), (java.util.Map)(_clv_prods_ll._getvalue(_index))));
 //BA.debugLineNum = 758;BA.debugLine="Private precio As String=clv_prods_ll.GetValue(in";
_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 = 759;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 = 760;BA.debugLine="Private tmpMap As Map = CreateMap(\"precio\":precio";
_tmpmap = new anywheresoftware.b4a.objects.collections.Map();
_tmpmap = __c.createMap(new Object[] {(Object)("precio"),(Object)(_precio),(Object)("cant"),(Object)(_lacant.getText()),(Object)("almacen"),(Object)(_subs._traealmacen /*String*/ (ba))});
 //BA.debugLineNum = 761;BA.debugLine="Private nombreX As String = Subs.traeProdNombre(i";
_nombrex = _subs._traeprodnombre /*String*/ (ba,_id);
 //BA.debugLineNum = 762;BA.debugLine="LogColor(tmpMap1,Colors.Magenta)";
__c.LogImpl("440632346",BA.ObjectToString(_tmpmap1),__c.Colors.Magenta);
 //BA.debugLineNum = 763;BA.debugLine="prodsMap.Put(id, tmpMap)";
_prodsmap.Put((Object)(_id),(Object)(_tmpmap.getObject()));
 //BA.debugLineNum = 764;BA.debugLine="If laCant.Text = 0 Then prodsMap.Remove(id)";
if ((_lacant.getText()).equals(BA.NumberToString(0))) { 
_prodsmap.Remove((Object)(_id));};
 //BA.debugLineNum = 777;BA.debugLine="If cb_des.Checked Then";
if (_cb_des.getChecked()) { 
 //BA.debugLineNum = 778;BA.debugLine="Log(\" descuento igual a True\")";
__c.LogImpl("440632362"," descuento igual a True",0);
 //BA.debugLineNum = 779;BA.debugLine="aplicades = \"1\"";
_aplicades = "1";
 }else {
 //BA.debugLineNum = 781;BA.debugLine="Log(\"descuento igual a false\")";
__c.LogImpl("440632365","descuento igual a false",0);
 //BA.debugLineNum = 782;BA.debugLine="aplicades = \"0\"";
_aplicades = "0";
 };
 //BA.debugLineNum = 785;BA.debugLine="LogColor(\"prodsMap=\"&prodsMap, Colors.blue)";
__c.LogImpl("440632369","prodsMap="+BA.ObjectToString(_prodsmap),__c.Colors.Blue);
 //BA.debugLineNum = 787;BA.debugLine="Log($\"${Subs.traeAlmacen}, ${precio}, ${laCant.te";
__c.LogImpl("440632371",(""+__c.SmartStringFormatter("",(Object)(_subs._traealmacen /*String*/ (ba)))+", "+__c.SmartStringFormatter("",(Object)(_precio))+", "+__c.SmartStringFormatter("",(Object)(_lacant.getText()))+", "+__c.SmartStringFormatter("",(Object)(_subs._traeprodnombre /*String*/ (ba,_id)))+", "+__c.SmartStringFormatter("",(Object)(_id))+", "+__c.SmartStringFormatter("",(Object)(_clienteid))+""),0);
 //BA.debugLineNum = 788;BA.debugLine="If B4XPages.MainPage.tipo_venta = \"PREVENTA_FUTUR";
if ((_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._tipo_venta /*String*/ ).equals("PREVENTA_FUTURA")) { 
 //BA.debugLineNum = 789;BA.debugLine="Subs.actualizaProducto(Subs.traeAlmacen, precio,";
_subs._actualizaproducto /*String*/ (ba,_subs._traealmacen /*String*/ (ba),_precio,_lacant.getText(),_subs._traeprodnombre /*String*/ (ba,_id),_id,_clienteid,_subs._traefecha /*String*/ (ba),_subs._traeusuariodebd /*String*/ (ba),_rutausuario,BA.NumberToString(0),_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._tipo_venta /*String*/ ,BA.NumberToString(0),BA.NumberToString(1),_aplicades);
 }else {
 //BA.debugLineNum = 791;BA.debugLine="Subs.actualizaProducto(Subs.traeAlmacen, precio,";
_subs._actualizaproducto /*String*/ (ba,_subs._traealmacen /*String*/ (ba),_precio,_lacant.getText(),_subs._traeprodnombre /*String*/ (ba,_id),_id,_clienteid,_subs._traefecha /*String*/ (ba),_subs._traeusuariodebd /*String*/ (ba),_rutausuario,BA.NumberToString(0),_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._tipo_venta /*String*/ ,BA.NumberToString(0),BA.NumberToString(0),_aplicades);
 };
 //BA.debugLineNum = 793;BA.debugLine="cuentaProds";
_cuentaprods();
 //BA.debugLineNum = 794;BA.debugLine="LogColor(\"prodsMap=\"&prodsMap, Colors.blue)";
__c.LogImpl("440632378","prodsMap="+BA.ObjectToString(_prodsmap),__c.Colors.Blue);
 //BA.debugLineNum = 795;BA.debugLine="Log($\"Total Prods: ${totalProds}, Total Compra: $";
__c.LogImpl("440632379",("Total Prods: "+__c.SmartStringFormatter("",(Object)(_totalprods))+", Total Compra: $"+__c.SmartStringFormatter("1.2",(Object)(_totalcompra))+""),0);
 //BA.debugLineNum = 796;BA.debugLine="If 1 = 1 Then";
if (1==1) { 
 //BA.debugLineNum = 797;BA.debugLine="Private cs As CSBuilder";
_cs = new anywheresoftware.b4a.objects.CSBuilder();
 //BA.debugLineNum = 798;BA.debugLine="cs.Initialize";
_cs.Initialize();
 //BA.debugLineNum = 799;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)(_subs._traetablaprods /*String*/ (ba,_tipo_venta)))+" where CAT_GP_ID = '"+__c.SmartStringFormatter("",(Object)(_id))+"'"))));
 //BA.debugLineNum = 800;BA.debugLine="Private invActualizado As String = \"0\"";
_invactualizado = "0";
 //BA.debugLineNum = 801;BA.debugLine="If o.RowCount > 0 Then";
if (_o.getRowCount()>0) { 
 //BA.debugLineNum = 802;BA.debugLine="o.Position = 0";
_o.setPosition((int) (0));
 //BA.debugLineNum = 803;BA.debugLine="invActualizado = o.GetString(\"CAT_GP_ALMACEN\")";
_invactualizado = _o.GetString("CAT_GP_ALMACEN");
 };
 //BA.debugLineNum = 813;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)))+""))).PopAll().getObject()));};
 };
 //BA.debugLineNum = 827;BA.debugLine="If Subs.totalPedido < 1 Then laCant.Text = \"0\"";
if ((double)(Double.parseDouble(_subs._totalpedido /*String*/ (ba)))<1) { 
_lacant.setText(BA.ObjectToCharSequence("0"));};
 //BA.debugLineNum = 828;BA.debugLine="invTotal = totalcajasmaspiezas + Subs.traeinventa";
_invtotal = (int) (_totalcajasmaspiezas+(double)(Double.parseDouble(_subs._traeinventario /*String*/ (ba,_id))));
 //BA.debugLineNum = 847;BA.debugLine="c = B4XPages.MainPage.skmt.ExecQuery(\"select IFNU";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select IFNULL(sum(PE_CANT),0) as PC_NOART, IFNULL(sum (PE_COSTO_TOT),0) 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 = 850;BA.debugLine="If c.RowCount > 0 Then";
if (_c.getRowCount()>0) { 
 //BA.debugLineNum = 851;BA.debugLine="C.Position = 0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 852;BA.debugLine="Log($\"registros: ${c.RowCount}, arts: ${c.GetStr";
__c.LogImpl("440632436",("registros: "+__c.SmartStringFormatter("",(Object)(_c.getRowCount()))+", arts: "+__c.SmartStringFormatter("",(Object)(_c.GetString("PC_NOART")))+", monto:"+__c.SmartStringFormatter("",(Object)(_c.GetString("PC_MONTO")))+""),0);
 //BA.debugLineNum = 853;BA.debugLine="l_totProds.Text = \"Prods: \" & c.GetString(\"PC_NO";
_l_totprods.setText(BA.ObjectToCharSequence("Prods: "+_c.GetString("PC_NOART")));
 //BA.debugLineNum = 854;BA.debugLine="l_total.Text = \"Total: $\" & c.GetString(\"PC_MONT";
_l_total.setText(BA.ObjectToCharSequence("Total: $"+_c.GetString("PC_MONTO")));
 //BA.debugLineNum = 855;BA.debugLine="If l_total.Text = Null Or l_total.Text = \"null\"";
if (_l_total.getText()== null || (_l_total.getText()).equals("null") || (_l_total.getText()).equals("")) { 
_l_total.setText(BA.ObjectToCharSequence("Total: $0.0"));};
 //BA.debugLineNum = 856;BA.debugLine="If l_totProds.Text = Null Or l_totProds.Text = \"";
if (_l_totprods.getText()== null || (_l_totprods.getText()).equals("null") || (_l_totprods.getText()).equals("")) { 
_l_totprods.setText(BA.ObjectToCharSequence("Prods: 0"));};
 };
 //BA.debugLineNum = 862;BA.debugLine="Dim c7 As Cursor = B4XPages.MainPage.skmt.ExecQue";
_c7 = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_c7 = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select IFNULL(sum(PE_CANT),0) as PC_NOART, IFNULL(sum (PE_COSTO_TOT),0) 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 ) and PE_CEDIS = 'DUR'")));
 //BA.debugLineNum = 863;BA.debugLine="If c7.RowCount > 0 Then";
if (_c7.getRowCount()>0) { 
 //BA.debugLineNum = 864;BA.debugLine="c7.Position = 0";
_c7.setPosition((int) (0));
 //BA.debugLineNum = 866;BA.debugLine="Dim totaldev As Double = c7.GetString(\"PC_MONTO\"";
_totaldev = (double)(Double.parseDouble(_c7.GetString("PC_MONTO")));
 };
 //BA.debugLineNum = 870;BA.debugLine="Dim c6 As Cursor = B4XPages.MainPage.skmt.ExecQue";
_c6 = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_c6 = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select IFNULL(sum(PE_CANT),0) as PC_NOART, IFNULL(sum (PE_COSTO_TOT),0) 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 ) and PE_CEDIS <> 'DUR' ")));
 //BA.debugLineNum = 871;BA.debugLine="If c6.RowCount > 0 Then";
if (_c6.getRowCount()>0) { 
 //BA.debugLineNum = 872;BA.debugLine="c6.Position = 0";
_c6.setPosition((int) (0));
 //BA.debugLineNum = 874;BA.debugLine="Dim totalprod As Double = c6.GetString(\"PC_MONTO";
_totalprod = (double)(Double.parseDouble(_c6.GetString("PC_MONTO")));
 };
 //BA.debugLineNum = 878;BA.debugLine="Log(totaldev &\"       \" & totalprod)";
__c.LogImpl("440632462",BA.NumberToString(_totaldev)+"       "+BA.NumberToString(_totalprod),0);
 //BA.debugLineNum = 879;BA.debugLine="If totalprod = 0 Then";
if (_totalprod==0) { 
 //BA.debugLineNum = 880;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"delete from";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("delete from pedido where PE_CLIENTE In (select cuenta from cuentaa) AND PE_CEDIS = 'DUR'");
 //BA.debugLineNum = 881;BA.debugLine="MsgboxAsync(\"Las devloluciones se elimanron por";
__c.MsgboxAsync(BA.ObjectToCharSequence("Las devloluciones se elimanron por que no hay venta."),BA.ObjectToCharSequence("Atención"),ba);
 }else if(_totalprod<(_totaldev*-1)) { 
 //BA.debugLineNum = 883;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"delete from";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("delete from pedido where PE_CLIENTE In (select cuenta from cuentaa) AND PE_CEDIS = 'DUR'");
 //BA.debugLineNum = 884;BA.debugLine="MsgboxAsync(\"Las devloluciones se elimanron por";
__c.MsgboxAsync(BA.ObjectToCharSequence("Las devloluciones se elimanron por que el monto de la devolucion es mayor al monto de la venta."),BA.ObjectToCharSequence("Atención"),ba);
 };
 //BA.debugLineNum = 889;BA.debugLine="End Sub";
return "";
}
public String  _b_qr_click() throws Exception{
 //BA.debugLineNum = 692;BA.debugLine="Sub b_QR_Click";
 //BA.debugLineNum = 693;BA.debugLine="If ciclo = 1 Then";
if ((_ciclo).equals(BA.NumberToString(1))) { 
 //BA.debugLineNum = 694;BA.debugLine="ciclo = 2";
_ciclo = BA.NumberToString(2);
 //BA.debugLineNum = 695;BA.debugLine="ya_entro  = \"0\"";
_ya_entro = "0";
 //BA.debugLineNum = 696;BA.debugLine="B4XPage_Appear";
_b4xpage_appear();
 }else if((_ciclo).equals(BA.NumberToString(2))) { 
 //BA.debugLineNum = 698;BA.debugLine="ciclo = 3";
_ciclo = BA.NumberToString(3);
 //BA.debugLineNum = 699;BA.debugLine="ya_entro  = \"0\"";
_ya_entro = "0";
 //BA.debugLineNum = 700;BA.debugLine="B4XPage_Appear";
_b4xpage_appear();
 }else if((_ciclo).equals(BA.NumberToString(3))) { 
 //BA.debugLineNum = 702;BA.debugLine="ciclo = 4";
_ciclo = BA.NumberToString(4);
 //BA.debugLineNum = 703;BA.debugLine="ya_entro  = \"0\"";
_ya_entro = "0";
 //BA.debugLineNum = 704;BA.debugLine="B4XPage_Appear";
_b4xpage_appear();
 }else if((_ciclo).equals(BA.NumberToString(4))) { 
 //BA.debugLineNum = 706;BA.debugLine="ciclo = 5";
_ciclo = BA.NumberToString(5);
 //BA.debugLineNum = 707;BA.debugLine="ya_entro  = \"0\"";
_ya_entro = "0";
 //BA.debugLineNum = 708;BA.debugLine="B4XPage_Appear";
_b4xpage_appear();
 }else if((_ciclo).equals(BA.NumberToString(5))) { 
 //BA.debugLineNum = 710;BA.debugLine="ciclo = 1";
_ciclo = BA.NumberToString(1);
 //BA.debugLineNum = 711;BA.debugLine="ya_entro  = \"0\"";
_ya_entro = "0";
 //BA.debugLineNum = 712;BA.debugLine="B4XPage_Appear";
_b4xpage_appear();
 };
 //BA.debugLineNum = 714;BA.debugLine="End Sub";
return "";
}
public String  _b_rechazar_click() throws Exception{
 //BA.debugLineNum = 1360;BA.debugLine="Private Sub b_rechazar_Click";
 //BA.debugLineNum = 1362;BA.debugLine="result =  Msgbox2($\"Seguro que desea borrar el pe";
_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 = 1363;BA.debugLine="If result = DialogResponse.POSITIVE Then";
if ((_result).equals(BA.NumberToString(__c.DialogResponse.POSITIVE))) { 
 //BA.debugLineNum = 1364;BA.debugLine="Subs.borraPedidoClienteActual";
_subs._borrapedidoclienteactual /*String*/ (ba);
 //BA.debugLineNum = 1365;BA.debugLine="prodsMap.Initialize";
_prodsmap.Initialize();
 //BA.debugLineNum = 1369;BA.debugLine="clv_prods_ll.Clear";
_clv_prods_ll._clear();
 //BA.debugLineNum = 1370;BA.debugLine="Log(\"Positivo\")";
__c.LogImpl("441418762","Positivo",0);
 //BA.debugLineNum = 1371;BA.debugLine="B4XPages.ShowPage(\"Cliente\")";
_b4xpages._showpage /*String*/ (ba,"Cliente");
 }else {
 //BA.debugLineNum = 1373;BA.debugLine="Log(\"NO Positivo\")";
__c.LogImpl("441418765","NO Positivo",0);
 //BA.debugLineNum = 1374;BA.debugLine="p_vistaPreviaTrans.Visible = False";
_p_vistapreviatrans.setVisible(__c.False);
 };
 //BA.debugLineNum = 1379;BA.debugLine="p_vistaPreviaTrans.Visible=False";
_p_vistapreviatrans.setVisible(__c.False);
 //BA.debugLineNum = 1380;BA.debugLine="B4XPages.ShowPage(\"Cliente\")";
_b4xpages._showpage /*String*/ (ba,"Cliente");
 //BA.debugLineNum = 1381;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 = 1201;BA.debugLine="Sub b_terminar1_Click";
 //BA.debugLineNum = 1204;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"delete from";
_b4xpages._mainpage /*gunav2.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 = 1206;BA.debugLine="lv_promos.Visible = False";
_lv_promos.setVisible(__c.False);
 //BA.debugLineNum = 1207;BA.debugLine="clv_prods_ll.AsView.Visible = False";
_clv_prods_ll._asview().setVisible(__c.False);
 //BA.debugLineNum = 1208;BA.debugLine="lv_catalogos.Visible = True";
_lv_catalogos.setVisible(__c.True);
 //BA.debugLineNum = 1209;BA.debugLine="lv_prodsPedido.Clear";
_lv_prodspedido.Clear();
 //BA.debugLineNum = 1210;BA.debugLine="lv_prodsPedido.TwoLinesLayout.Label.Height = 35di";
_lv_prodspedido.getTwoLinesLayout().Label.setHeight(__c.DipToCurrent((int) (35)));
 //BA.debugLineNum = 1211;BA.debugLine="lv_prodsPedido.TwoLinesLayout.SecondLabel.Height";
_lv_prodspedido.getTwoLinesLayout().SecondLabel.setHeight(__c.DipToCurrent((int) (25)));
 //BA.debugLineNum = 1212;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 /*gunav2.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 = 1213;BA.debugLine="If c_prods.RowCount > 0 Then";
if (_c_prods.getRowCount()>0) { 
 //BA.debugLineNum = 1214;BA.debugLine="Private cs As CSBuilder";
_cs = new anywheresoftware.b4a.objects.CSBuilder();
 //BA.debugLineNum = 1216;BA.debugLine="vamoaver.Initialize";
_vamoaver.Initialize();
 //BA.debugLineNum = 1217;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 = 1218;BA.debugLine="cs.Initialize";
_cs.Initialize();
 //BA.debugLineNum = 1219;BA.debugLine="c_prods.Position=i";
_c_prods.setPosition(_i);
 //BA.debugLineNum = 1220;BA.debugLine="Dim label1 As Label";
_label1 = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 1221;BA.debugLine="label1 = lv_prodsPedido.TwoLinesLayout.Label";
_label1 = _lv_prodspedido.getTwoLinesLayout().Label;
 //BA.debugLineNum = 1222;BA.debugLine="label1.TextSize = 15";
_label1.setTextSize((float) (15));
 //BA.debugLineNum = 1223;BA.debugLine="label1.TextColor = Colors.Black";
_label1.setTextColor(__c.Colors.Black);
 //BA.debugLineNum = 1224;BA.debugLine="label1.color = Colors.White";
_label1.setColor(__c.Colors.White);
 //BA.debugLineNum = 1225;BA.debugLine="Private textColor As Int = Colors.black";
_textcolor = __c.Colors.Black;
 //BA.debugLineNum = 1227;BA.debugLine="If c_prods.GetString(\"PE_FOLIO\") = \"VENTA\" Then";
if ((_c_prods.GetString("PE_FOLIO")).equals("VENTA")) { 
 //BA.debugLineNum = 1228;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 = 1230;BA.debugLine="textColor = Colors.RGB(166,0,0)";
_textcolor = __c.Colors.RGB((int) (166),(int) (0),(int) (0));
 };
 //BA.debugLineNum = 1232;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("VENTA")) { 
 //BA.debugLineNum = 1233;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 = 1235;BA.debugLine="textColor = Colors.RGB(255,111,111) 'Si es pro";
_textcolor = __c.Colors.RGB((int) (255),(int) (111),(int) (111));
 };
 //BA.debugLineNum = 1237;BA.debugLine="Dim label2 As Label";
_label2 = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 1238;BA.debugLine="label2 = lv_prodsPedido.TwoLinesLayout.SecondLa";
_label2 = _lv_prodspedido.getTwoLinesLayout().SecondLabel;
 //BA.debugLineNum = 1239;BA.debugLine="label2.TextSize = 10";
_label2.setTextSize((float) (10));
 //BA.debugLineNum = 1240;BA.debugLine="label2.TextColor = Colors.Blue";
_label2.setTextColor(__c.Colors.Blue);
 //BA.debugLineNum = 1243;BA.debugLine="lv_prodsPedido.AddSingleLine(cs.Color(textColor";
_lv_prodspedido.AddSingleLine(BA.ObjectToCharSequence(_cs.Color(_textcolor).Size((int) (15)).Append(BA.ObjectToCharSequence(_c_prods.GetString("PE_PRONOMBRE")+" ")).Pop().Append(BA.ObjectToCharSequence(__c.CRLF)).Size((int) (10)).Color(__c.Colors.Black).Append(BA.ObjectToCharSequence("Cantidad #"+_c_prods.GetString("PE_CANT"))).Append(BA.ObjectToCharSequence(" SubTotal $"+_c_prods.GetString("PE_COSTO_TOT"))).Append(BA.ObjectToCharSequence(" "+_c_prods.GetString("PE_FOLIO")+" "+_c_prods.GetString("PE_CEDIS"))).PopAll().getObject()));
 //BA.debugLineNum = 1244;BA.debugLine="label1.Height = 120dip";
_label1.setHeight(__c.DipToCurrent((int) (120)));
 //BA.debugLineNum = 1245;BA.debugLine="lv_prodsPedido.SingleLineLayout.ItemHeight = 90";
_lv_prodspedido.getSingleLineLayout().setItemHeight(__c.DipToCurrent((int) (90)));
 //BA.debugLineNum = 1246;BA.debugLine="vamoaver.Add(c_prods.GetString(\"PE_FOLIO\"))";
_vamoaver.Add((Object)(_c_prods.GetString("PE_FOLIO")));
 //BA.debugLineNum = 1247;BA.debugLine="folio = c_prods.GetString(\"PE_FOLIO\")";
_folio = _c_prods.GetString("PE_FOLIO");
 }
};
 //BA.debugLineNum = 1253;BA.debugLine="c = B4XPages.MainPage.skmt.ExecQuery(\"select sum";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select sum(PE_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 = 1254;BA.debugLine="c.Position=0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 1255;BA.debugLine="l_cant.Text = c.GetString(\"PC_NOART\")";
_l_cant.setText(BA.ObjectToCharSequence(_c.GetString("PC_NOART")));
 //BA.debugLineNum = 1256;BA.debugLine="l_total2.Text = c.GetString(\"PC_MONTO\")";
_l_total2.setText(BA.ObjectToCharSequence(_c.GetString("PC_MONTO")));
 //BA.debugLineNum = 1257;BA.debugLine="c.Close";
_c.Close();
 };
 //BA.debugLineNum = 1260;BA.debugLine="c_prods.Close";
_c_prods.Close();
 //BA.debugLineNum = 1262;BA.debugLine="l_total2.Text = Subs.calculaTotalConPromoXRango(S";
_l_total2.setText(BA.ObjectToCharSequence(_subs._calculatotalconpromoxrango /*String*/ (ba,_subs._traecliente /*String*/ (ba))));
 //BA.debugLineNum = 1265;BA.debugLine="p_vistaPreviaTrans.Width = Root.Width";
_p_vistapreviatrans.setWidth(_root.getWidth());
 //BA.debugLineNum = 1266;BA.debugLine="p_vistaPreviaTrans.Height = Root.Height";
_p_vistapreviatrans.setHeight(_root.getHeight());
 //BA.debugLineNum = 1267;BA.debugLine="Subs.centraPanel(p_vistaPrevia, Root.Width)";
_subs._centrapanel /*String*/ (ba,_p_vistaprevia,_root.getWidth());
 //BA.debugLineNum = 1269;BA.debugLine="p_vistaPrevia.Visible=True";
_p_vistaprevia.setVisible(__c.True);
 //BA.debugLineNum = 1270;BA.debugLine="p_vistaPreviaTrans.Visible=True";
_p_vistapreviatrans.setVisible(__c.True);
 //BA.debugLineNum = 1271;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(gunav2.keymon.com.mx.c_productos parent) {
this.parent = parent;
}
gunav2.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 step59;
int limit59;

@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 = 157;BA.debugLine="tipo_venta = Subs.traeTipoVentaDeBD";
parent._tipo_venta = parent._subs._traetipoventadebd /*String*/ (ba);
 //BA.debugLineNum = 158;BA.debugLine="If B4XPages.MainPage.tipo_venta = \"PREVENTA\" Or B";
if (true) break;

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

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

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

case 7:
//C
this.state = 8;
 //BA.debugLineNum = 163;BA.debugLine="Starter.tabla = \"CAT_GUNAPROD3\"";
parent._starter._tabla /*String*/  = "CAT_GUNAPROD3";
 if (true) break;

case 8:
//C
this.state = 9;
;
 //BA.debugLineNum = 165;BA.debugLine="Log(Starter.tabla)";
parent.__c.LogImpl("440042505",parent._starter._tabla /*String*/ ,0);
 //BA.debugLineNum = 166;BA.debugLine="clienteId = Subs.traeCliente";
parent._clienteid = parent._subs._traecliente /*String*/ (ba);
 //BA.debugLineNum = 167;BA.debugLine="rutaUsuario = Subs.traeRuta";
parent._rutausuario = parent._subs._traeruta /*String*/ (ba);
 //BA.debugLineNum = 168;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"UPDATE CAT_";
parent._b4xpages._mainpage /*gunav2.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 = 169;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"UPDATE CAT_";
parent._b4xpages._mainpage /*gunav2.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 = 170;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"UPDATE CAT_";
parent._b4xpages._mainpage /*gunav2.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 = 171;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"UPDATE CAT_";
parent._b4xpages._mainpage /*gunav2.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 = 172;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"UPDATE CAT_";
parent._b4xpages._mainpage /*gunav2.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 = 173;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 = 174;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 = 175;BA.debugLine="If B4XPages.MainPage.bTerminarClicked Then";
if (true) break;

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

case 11:
//C
this.state = 12;
 //BA.debugLineNum = 176;BA.debugLine="lv_catalogos.Visible = True";
parent._lv_catalogos.setVisible(parent.__c.True);
 //BA.debugLineNum = 177;BA.debugLine="lv_promos.Visible = False";
parent._lv_promos.setVisible(parent.__c.False);
 //BA.debugLineNum = 178;BA.debugLine="lv_tipo.Visible = False";
parent._lv_tipo.setVisible(parent.__c.False);
 //BA.debugLineNum = 179;BA.debugLine="lv_subtipo.Visible = False";
parent._lv_subtipo.setVisible(parent.__c.False);
 //BA.debugLineNum = 180;BA.debugLine="clv_prods_ll.AsView.Visible = False";
parent._clv_prods_ll._asview().setVisible(parent.__c.False);
 //BA.debugLineNum = 181;BA.debugLine="B4XPages.MainPage.bTerminarClicked = False";
parent._b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._bterminarclicked /*boolean*/  = parent.__c.False;
 if (true) break;
;
 //BA.debugLineNum = 183;BA.debugLine="If ya_entro <> \"1\" Then";

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

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

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

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

case 20:
//C
this.state = 21;
;
 //BA.debugLineNum = 185;BA.debugLine="entro =\"3\"";
parent._entro = "3";
 //BA.debugLineNum = 186;BA.debugLine="lv_catalogos.Clear";
parent._lv_catalogos.Clear();
 //BA.debugLineNum = 187;BA.debugLine="Sleep(100)";
parent.__c.Sleep(ba,this,(int) (100));
this.state = 56;
return;
case 56:
//C
this.state = 21;
;
 //BA.debugLineNum = 188;BA.debugLine="lfila.Text = \"PORTAFOLIO\"";
parent._lfila.setText(BA.ObjectToCharSequence("PORTAFOLIO"));
 //BA.debugLineNum = 189;BA.debugLine="p_productos.Height = Root.Height";
parent._p_productos.setHeight(parent._root.getHeight());
 //BA.debugLineNum = 190;BA.debugLine="clv_prods_ll.AsView.Visible = False";
parent._clv_prods_ll._asview().setVisible(parent.__c.False);
 //BA.debugLineNum = 191;BA.debugLine="lv_catalogos.Visible = True";
parent._lv_catalogos.setVisible(parent.__c.True);
 //BA.debugLineNum = 192;BA.debugLine="p_botonesVenta.Visible = False";
parent._p_botonesventa.setVisible(parent.__c.False);
 //BA.debugLineNum = 193;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 = 194;BA.debugLine="lv_promos.Visible = False";
parent._lv_promos.setVisible(parent.__c.False);
 if (true) break;

case 21:
//C
this.state = 22;
;
 //BA.debugLineNum = 196;BA.debugLine="Dim label1 As Label";
_label1 = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 197;BA.debugLine="label1 = lv_catalogos.SingleLineLayout.Label";
_label1 = parent._lv_catalogos.getSingleLineLayout().Label;
 //BA.debugLineNum = 198;BA.debugLine="label1.TextSize = 20";
_label1.setTextSize((float) (20));
 //BA.debugLineNum = 199;BA.debugLine="label1.TextColor = Colors.White";
_label1.setTextColor(parent.__c.Colors.White);
 //BA.debugLineNum = 200;BA.debugLine="label1.Color = Colors.ARGB(58,255,255,255)";
_label1.setColor(parent.__c.Colors.ARGB((int) (58),(int) (255),(int) (255),(int) (255)));
 //BA.debugLineNum = 201;BA.debugLine="label1.Typeface = Typeface.CreateNew(Typeface.DEF";
_label1.setTypeface(parent.__c.Typeface.CreateNew(parent.__c.Typeface.DEFAULT_BOLD,parent.__c.Typeface.STYLE_BOLD));
 //BA.debugLineNum = 202;BA.debugLine="lv_catalogos.Width = Root.Width * 0.99";
parent._lv_catalogos.setWidth((int) (parent._root.getWidth()*0.99));
 //BA.debugLineNum = 203;BA.debugLine="lv_catalogos.Clear";
parent._lv_catalogos.Clear();
 //BA.debugLineNum = 204;BA.debugLine="lv_catalogos.AddSingleLine(\"PORTAFOLIO\")";
parent._lv_catalogos.AddSingleLine(BA.ObjectToCharSequence("PORTAFOLIO"));
 //BA.debugLineNum = 206;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 /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery(("select count(*) as hayPromos from "+parent.__c.SmartStringFormatter("",(Object)(parent._subs._traetablaprods /*String*/ (ba,parent._tipo_venta)))+" where CAT_GP_TIPO = 'PROMOS'"))));
 //BA.debugLineNum = 207;BA.debugLine="c.Position = 0";
parent._c.setPosition((int) (0));
 //BA.debugLineNum = 209;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 /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery(("SELECT CUENTA FROM CUENTAA"))));
 //BA.debugLineNum = 210;BA.debugLine="c.Position = 0";
parent._c.setPosition((int) (0));
 //BA.debugLineNum = 211;BA.debugLine="If c.GetString(\"CUENTA\") <> \"0\" And c.GetString(\"";
if (true) break;

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

case 24:
//C
this.state = 25;
 //BA.debugLineNum = 212;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 /*gunav2.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._subs._traetablaprods /*String*/ (ba,parent._tipo_venta)))+" 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 = 213;BA.debugLine="LogColor($\"select CAT_GP_ID, CAT_GP_NOMBRE, CAT_";
parent.__c.LogImpl("440042553",("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._subs._traetablaprods /*String*/ (ba,parent._tipo_venta)))+" 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 = 215;BA.debugLine="Private hayPromos As Boolean = False";
_haypromos = parent.__c.False;
 //BA.debugLineNum = 216;BA.debugLine="If c2.RowCount > 0 Then";
if (true) break;

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

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

case 28:
//for
this.state = 35;
step59 = 1;
limit59 = (int) (parent._c2.getRowCount()-1);
_i = (int) (0) ;
this.state = 57;
if (true) break;

case 57:
//C
this.state = 35;
if ((step59 > 0 && _i <= limit59) || (step59 < 0 && _i >= limit59)) this.state = 30;
if (true) break;

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

case 30:
//C
this.state = 31;
 //BA.debugLineNum = 219;BA.debugLine="c2.Position = i";
parent._c2.setPosition(_i);
 //BA.debugLineNum = 220;BA.debugLine="Log(\"Esto es i----->\"& i)'Isaac";
parent.__c.LogImpl("440042560","Esto es i----->"+BA.NumberToString(_i),0);
 //BA.debugLineNum = 221;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 = 222;BA.debugLine="If tm.Get(\"status\") = \"ok\" Then 'Solo muestral";
if (true) break;

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

case 33:
//C
this.state = 34;
 //BA.debugLineNum = 223;BA.debugLine="hayPromos = True";
_haypromos = parent.__c.True;
 if (true) break;

case 34:
//C
this.state = 58;
;
 if (true) break;
if (true) break;
;
 //BA.debugLineNum = 226;BA.debugLine="If hayPromos Then lv_catalogos.AddSingleLine(\"P";

case 35:
//if
this.state = 40;
if (_haypromos) { 
this.state = 37;
;}if (true) break;

case 37:
//C
this.state = 40;
parent._lv_catalogos.AddSingleLine(BA.ObjectToCharSequence("PROMOCIONES"));
if (true) break;

case 40:
//C
this.state = 43;
;
 if (true) break;

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

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

case 44:
//C
this.state = 45;
;
 //BA.debugLineNum = 233;BA.debugLine="Sleep(100)";
parent.__c.Sleep(ba,this,(int) (100));
this.state = 59;
return;
case 59:
//C
this.state = 45;
;
 //BA.debugLineNum = 234;BA.debugLine="l_total.Visible =False";
parent._l_total.setVisible(parent.__c.False);
 //BA.debugLineNum = 235;BA.debugLine="l_totProds.Visible = False";
parent._l_totprods.setVisible(parent.__c.False);
 //BA.debugLineNum = 236;BA.debugLine="l_total.Left = 5dip";
parent._l_total.setLeft(parent.__c.DipToCurrent((int) (5)));
 //BA.debugLineNum = 237;BA.debugLine="l_totProds.Width = Root.Width * 0.19";
parent._l_totprods.setWidth((int) (parent._root.getWidth()*0.19));
 //BA.debugLineNum = 238;BA.debugLine="l_total.Left = l_totProds.Width + 20";
parent._l_total.setLeft((int) (parent._l_totprods.getWidth()+20));
 //BA.debugLineNum = 239;BA.debugLine="l_total.Width = Root.Width * 0.25";
parent._l_total.setWidth((int) (parent._root.getWidth()*0.25));
 //BA.debugLineNum = 241;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 = 242;BA.debugLine="prodsPedidoActual = m.Get(\"productos\")";
parent._prodspedidoactual = BA.ObjectToString(_m.Get((Object)("productos")));
 //BA.debugLineNum = 243;BA.debugLine="montoPedidoActual = m.Get(\"monto\")";
parent._montopedidoactual = BA.ObjectToString(_m.Get((Object)("monto")));
 //BA.debugLineNum = 244;BA.debugLine="hayPedido = Subs.hayPedido";
parent._haypedido = parent._subs._haypedido /*boolean*/ (ba);
 //BA.debugLineNum = 246;BA.debugLine="B4XPages.MainPage.productos.clv_prods_ll.Clear";
parent._b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._productos /*gunav2.keymon.com.mx.c_productos*/ ._clv_prods_ll /*b4a.example3.customlistview*/ ._clear();
 //BA.debugLineNum = 247;BA.debugLine="If reiniciarlistaProds Then";
if (true) break;

case 45:
//if
this.state = 50;
if (parent._reiniciarlistaprods) { 
this.state = 47;
}else if(parent._haypedido) { 
this.state = 49;
}if (true) break;

case 47:
//C
this.state = 50;
 //BA.debugLineNum = 250;BA.debugLine="clv_prods_ll.Clear";
parent._clv_prods_ll._clear();
 if (true) break;

case 49:
//C
this.state = 50;
 //BA.debugLineNum = 255;BA.debugLine="clv_prods_ll.Clear";
parent._clv_prods_ll._clear();
 if (true) break;
;
 //BA.debugLineNum = 257;BA.debugLine="If clv_prods_ll.Size = 0 Then LlenaProdsLL(Null)";

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

case 52:
//C
this.state = 55;
parent._llenaprodsll((anywheresoftware.b4a.sql.SQL.ResultSetWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.ResultSetWrapper(), (android.database.Cursor)(parent.__c.Null)));
if (true) break;

case 55:
//C
this.state = -1;
;
 //BA.debugLineNum = 258;BA.debugLine="clv_prods_ll.JumpToItem(0) 'Vamos al primer artíc";
parent._clv_prods_ll._jumptoitem((int) (0));
 //BA.debugLineNum = 259;BA.debugLine="PCLV.lblHint.SetTextSizeAnimated(0,13)";
parent._pclv._lblhint /*anywheresoftware.b4a.objects.B4XViewWrapper*/ .SetTextSizeAnimated((int) (0),(float) (13));
 //BA.debugLineNum = 260;BA.debugLine="PCLV.B4XSeekBar1.Color1=Colors.DarkGray";
parent._pclv._b4xseekbar1 /*gunav2.keymon.com.mx.b4xseekbar*/ ._color1 /*int*/  = parent.__c.Colors.DarkGray;
 //BA.debugLineNum = 261;BA.debugLine="PCLV.B4XSeekBar1.Color2=Colors.DarkGray";
parent._pclv._b4xseekbar1 /*gunav2.keymon.com.mx.b4xseekbar*/ ._color2 /*int*/  = parent.__c.Colors.DarkGray;
 //BA.debugLineNum = 262;BA.debugLine="PCLV.B4XSeekBar1.ThumbColor=Colors.red";
parent._pclv._b4xseekbar1 /*gunav2.keymon.com.mx.b4xseekbar*/ ._thumbcolor /*int*/  = parent.__c.Colors.Red;
 //BA.debugLineNum = 263;BA.debugLine="PCLV.B4XSeekBar1.mBase.Left=Root.Width *0.91";
parent._pclv._b4xseekbar1 /*gunav2.keymon.com.mx.b4xseekbar*/ ._mbase /*anywheresoftware.b4a.objects.B4XViewWrapper*/ .setLeft((int) (parent._root.getWidth()*0.91));
 //BA.debugLineNum = 265;BA.debugLine="PCLV.B4XSeekBar1.mBase.Height=clv_prods_ll.AsView";
parent._pclv._b4xseekbar1 /*gunav2.keymon.com.mx.b4xseekbar*/ ._mbase /*anywheresoftware.b4a.objects.B4XViewWrapper*/ .setHeight(parent._clv_prods_ll._asview().getHeight());
 //BA.debugLineNum = 266;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 = 267;BA.debugLine="PCLV.B4XSeekBar1.Update";
parent._pclv._b4xseekbar1 /*gunav2.keymon.com.mx.b4xseekbar*/ ._update /*String*/ ();
 //BA.debugLineNum = 271;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(gunav2.keymon.com.mx.c_productos parent) {
this.parent = parent;
}
gunav2.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 = 637;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 = 638;BA.debugLine="l_info.Visible = False";
parent._l_info.setVisible(parent.__c.False);
 //BA.debugLineNum = 639;BA.debugLine="Log(\"AQUI\")";
parent.__c.LogImpl("440435717","AQUI",0);
 //BA.debugLineNum = 640;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 = 642;BA.debugLine="p_vistaPreviaTrans.Visible = False";
parent._p_vistapreviatrans.setVisible(parent.__c.False);
 //BA.debugLineNum = 643;BA.debugLine="Log(\"AQUI\")";
parent.__c.LogImpl("440435721","AQUI",0);
 //BA.debugLineNum = 644;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 = 646;BA.debugLine="lv_promos.Visible = False";
parent._lv_promos.setVisible(parent.__c.False);
 //BA.debugLineNum = 647;BA.debugLine="lv_catalogos.Visible = True";
parent._lv_catalogos.setVisible(parent.__c.True);
 //BA.debugLineNum = 648;BA.debugLine="p_botonesVenta.Visible = False";
parent._p_botonesventa.setVisible(parent.__c.False);
 //BA.debugLineNum = 649;BA.debugLine="l_total.Visible = False";
parent._l_total.setVisible(parent.__c.False);
 //BA.debugLineNum = 650;BA.debugLine="l_totProds.Visible = False";
parent._l_totprods.setVisible(parent.__c.False);
 //BA.debugLineNum = 651;BA.debugLine="Log(\"AQUI\")";
parent.__c.LogImpl("440435729","AQUI",0);
 //BA.debugLineNum = 652;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 = 654;BA.debugLine="lfila.text = \"PORTAFOLIO\"";
parent._lfila.setText(BA.ObjectToCharSequence("PORTAFOLIO"));
 //BA.debugLineNum = 655;BA.debugLine="clv_prods_ll.AsView.Visible = False";
parent._clv_prods_ll._asview().setVisible(parent.__c.False);
 //BA.debugLineNum = 656;BA.debugLine="lv_subtipo.Visible = False";
parent._lv_subtipo.setVisible(parent.__c.False);
 //BA.debugLineNum = 657;BA.debugLine="p_botonesVenta.Visible = False";
parent._p_botonesventa.setVisible(parent.__c.False);
 //BA.debugLineNum = 658;BA.debugLine="l_total.Visible = False";
parent._l_total.setVisible(parent.__c.False);
 //BA.debugLineNum = 659;BA.debugLine="l_totProds.Visible = False";
parent._l_totprods.setVisible(parent.__c.False);
 //BA.debugLineNum = 660;BA.debugLine="lv_catalogos.Visible = True";
parent._lv_catalogos.setVisible(parent.__c.True);
 //BA.debugLineNum = 661;BA.debugLine="Log(\"AQUI\")";
parent.__c.LogImpl("440435739","AQUI",0);
 //BA.debugLineNum = 662;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 = 675;BA.debugLine="Log(\"AQUI\")";
parent.__c.LogImpl("440435753","AQUI",0);
 //BA.debugLineNum = 677;BA.debugLine="B4XPages.ShowPage(\"Cliente\")";
parent._b4xpages._showpage /*String*/ (ba,"Cliente");
 //BA.debugLineNum = 678;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 = 680;BA.debugLine="B4XPages.ShowPage(\"Cliente\")";
parent._b4xpages._showpage /*String*/ (ba,"Cliente");
 //BA.debugLineNum = 681;BA.debugLine="Log(\"AQUI\")";
parent.__c.LogImpl("440435759","AQUI",0);
 //BA.debugLineNum = 682;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 = 684;BA.debugLine="B4XPages.ShowPage(\"Cliente\")";
parent._b4xpages._showpage /*String*/ (ba,"Cliente");
 //BA.debugLineNum = 685;BA.debugLine="Log(\"AQUI\")";
parent.__c.LogImpl("440435763","AQUI",0);
 //BA.debugLineNum = 686;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 = 688;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 = 115;BA.debugLine="Private Sub B4XPage_Created (Root1 As B4XView)";
 //BA.debugLineNum = 116;BA.debugLine="Root = Root1";
_root = _root1;
 //BA.debugLineNum = 119;BA.debugLine="Root.LoadLayout(\"productos\")";
_root.LoadLayout("productos",ba);
 //BA.debugLineNum = 120;BA.debugLine="ruta = File.DirInternal";
_ruta = __c.File.getDirInternal();
 //BA.debugLineNum = 121;BA.debugLine="If File.Exists(ruta, \"kmt.db\") = False Then";
if (__c.File.Exists(_ruta,"kmt.db")==__c.False) { 
 //BA.debugLineNum = 122;BA.debugLine="File.Copy(File.DirAssets, \"kmt.db\", ruta, \"kmt.d";
__c.File.Copy(__c.File.getDirAssets(),"kmt.db",_ruta,"kmt.db");
 };
 //BA.debugLineNum = 124;BA.debugLine="PCLV.Initialize(Me, \"PCLV\", clv_prods_ll)";
_pclv._initialize /*String*/ (ba,this,"PCLV",_clv_prods_ll);
 //BA.debugLineNum = 125;BA.debugLine="ciclo = 1";
_ciclo = BA.NumberToString(1);
 //BA.debugLineNum = 126;BA.debugLine="l_info.Width = Root.Width * 0.8";
_l_info.setWidth((int) (_root.getWidth()*0.8));
 //BA.debugLineNum = 127;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 = 128;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 /*gunav2.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 = 129;BA.debugLine="If c.RowCount > 0 Then";
if (_c.getRowCount()>0) { 
 //BA.debugLineNum = 130;BA.debugLine="Dim label1 As Label";
_label1 = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 131;BA.debugLine="label1 = lv_tipo.SingleLineLayout.Label";
_label1 = _lv_tipo.getSingleLineLayout().Label;
 //BA.debugLineNum = 132;BA.debugLine="label1.TextSize = 17";
_label1.setTextSize((float) (17));
 //BA.debugLineNum = 133;BA.debugLine="label1.TextColor = Colors.Black";
_label1.setTextColor(__c.Colors.Black);
 //BA.debugLineNum = 134;BA.debugLine="lv_tipo.Clear";
_lv_tipo.Clear();
 //BA.debugLineNum = 135;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 = 136;BA.debugLine="c.Position=i";
_c.setPosition(_i);
 //BA.debugLineNum = 137;BA.debugLine="Log(\"ENTRE AQUI EN PROMOS create\")";
__c.LogImpl("439976982","ENTRE AQUI EN PROMOS create",0);
 //BA.debugLineNum = 138;BA.debugLine="lv_tipo.AddSingleLine(c.GetString(\"CAT_GP_TIPO\"";
_lv_tipo.AddSingleLine(BA.ObjectToCharSequence(_c.GetString("CAT_GP_TIPO")));
 }
};
 };
 //BA.debugLineNum = 141;BA.debugLine="c.Close";
_c.Close();
 //BA.debugLineNum = 144;BA.debugLine="listaTiempos.Initialize";
_listatiempos.Initialize();
 //BA.debugLineNum = 145;BA.debugLine="listaProds.Initialize";
_listaprods.Initialize();
 //BA.debugLineNum = 146;BA.debugLine="pedidoMap.Initialize";
_pedidomap.Initialize();
 //BA.debugLineNum = 147;BA.debugLine="listaHints.Initialize";
_listahints.Initialize();
 //BA.debugLineNum = 150;BA.debugLine="clv_prods_ll.Clear";
_clv_prods_ll._clear();
 //BA.debugLineNum = 151;BA.debugLine="prodsMap.Initialize";
_prodsmap.Initialize();
 //BA.debugLineNum = 152;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(gunav2.keymon.com.mx.c_productos parent,String _old,String _new) {
this.parent = parent;
this._old = _old;
this._new = _new;
}
gunav2.keymon.com.mx.c_productos parent;
String _old;
String _new;
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 = 1808;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 = 1809;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 = -1;
;
 //BA.debugLineNum = 1810;BA.debugLine="forzarBusqueda = False";
parent._forzarbusqueda = parent.__c.False;
 //BA.debugLineNum = 1811;BA.debugLine="clv_prods_ll.Clear";
parent._clv_prods_ll._clear();
 //BA.debugLineNum = 1812;BA.debugLine="listaProds.Initialize";
parent._listaprods.Initialize();
 //BA.debugLineNum = 1813;BA.debugLine="listaHints.Initialize";
parent._listahints.Initialize();
 //BA.debugLineNum = 1814;BA.debugLine="Sleep(0)";
parent.__c.Sleep(ba,this,(int) (0));
this.state = 13;
return;
case 13:
//C
this.state = -1;
;
 //BA.debugLineNum = 1819;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)(parent._b4xpages._mainpage /*gunav2.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_LISTAPRECIO 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_TIPO <> 'PROMOCION' union all select DISTINCT CAT_GP_ID, CAT_GP_NOMBRE, CAT_GP_ALMACEN, CAT_GP_PRECIO, CAT_GP_TIPOPROD, CAT_LISTAPRECIO 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_id in (select pe_proid from pedido where pe_cliente in (select cuenta from cuentaa)) order by 2"))));
 //BA.debugLineNum = 1821;BA.debugLine="Log(\"Llamamos LlenaProdsLL\")";
parent.__c.LogImpl("441811983","Llamamos LlenaProdsLL",0);
 //BA.debugLineNum = 1822;BA.debugLine="LlenaProdsLL(p)";
parent._llenaprodsll(_p);
 //BA.debugLineNum = 1841;BA.debugLine="End Sub";
if (true) break;

            }
        }
    }
}
public String  _cb_descuento_checkedchange(boolean _checked) throws Exception{
 //BA.debugLineNum = 2510;BA.debugLine="Private Sub cb_descuento_CheckedChange(Checked As";
 //BA.debugLineNum = 2511;BA.debugLine="Log(Sender.As(CheckBox).Tag)";
__c.LogImpl("442532865",BA.ObjectToString(((anywheresoftware.b4a.objects.CompoundButtonWrapper.CheckBoxWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.CompoundButtonWrapper.CheckBoxWrapper(), (android.widget.CheckBox)(__c.Sender(ba)))).getTag()),0);
 //BA.debugLineNum = 2512;BA.debugLine="If Sender.As(CheckBox).Checked Then";
if (((anywheresoftware.b4a.objects.CompoundButtonWrapper.CheckBoxWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.CompoundButtonWrapper.CheckBoxWrapper(), (android.widget.CheckBox)(__c.Sender(ba)))).getChecked()) { 
 //BA.debugLineNum = 2513;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery($\"UPDATE ped";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("UPDATE pedido SET PE_DESC = 1 WHERE PE_CLIENTE In (select cuenta from cuentaa) AND PE_PROID = '"+__c.SmartStringFormatter("",((anywheresoftware.b4a.objects.CompoundButtonWrapper.CheckBoxWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.CompoundButtonWrapper.CheckBoxWrapper(), (android.widget.CheckBox)(__c.Sender(ba)))).getTag())+"' AND PE_CEDIS = '"+__c.SmartStringFormatter("",(Object)(_subs._traealmacen /*String*/ (ba)))+"'"));
 }else {
 //BA.debugLineNum = 2515;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery($\"UPDATE ped";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("UPDATE pedido SET PE_DESC = 0 WHERE PE_CLIENTE In (select cuenta from cuentaa) AND PE_PROID = '"+__c.SmartStringFormatter("",((anywheresoftware.b4a.objects.CompoundButtonWrapper.CheckBoxWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.CompoundButtonWrapper.CheckBoxWrapper(), (android.widget.CheckBox)(__c.Sender(ba)))).getTag())+"' AND PE_CEDIS = '"+__c.SmartStringFormatter("",(Object)(_subs._traealmacen /*String*/ (ba)))+"'"));
 };
 //BA.debugLineNum = 2518;BA.debugLine="End Sub";
return "";
}
public String  _class_globals() throws Exception{
 //BA.debugLineNum = 1;BA.debugLine="Sub Class_Globals";
 //BA.debugLineNum = 2;BA.debugLine="Private Root As B4XView 'ignore";
_root = new anywheresoftware.b4a.objects.B4XViewWrapper();
 //BA.debugLineNum = 3;BA.debugLine="Private xui As XUI 'ignore";
_xui = new anywheresoftware.b4a.objects.B4XViewWrapper.XUI();
 //BA.debugLineNum = 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 = 64;BA.debugLine="Dim tipo_venta As String = Subs.traeTipoVentaDeBD";
_tipo_venta = _subs._traetipoventadebd /*String*/ (ba);
 //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 gunav2.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 = 88;BA.debugLine="Dim P_CALATOLOS As Panel";
_p_calatolos = new anywheresoftware.b4a.objects.PanelWrapper();
 //BA.debugLineNum = 90;BA.debugLine="Dim Panel2 As Panel";
_panel2 = new anywheresoftware.b4a.objects.PanelWrapper();
 //BA.debugLineNum = 91;BA.debugLine="Private p_botMasMenc As Panel";
_p_botmasmenc = new anywheresoftware.b4a.objects.PanelWrapper();
 //BA.debugLineNum = 92;BA.debugLine="Private p_promodesc As Panel";
_p_promodesc = new anywheresoftware.b4a.objects.PanelWrapper();
 //BA.debugLineNum = 93;BA.debugLine="Private l_promodesc As Label";
_l_promodesc = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 94;BA.debugLine="Private b_okpromodesc As Button";
_b_okpromodesc = new anywheresoftware.b4a.objects.ButtonWrapper();
 //BA.debugLineNum = 95;BA.debugLine="Private p_devo As Panel";
_p_devo = new anywheresoftware.b4a.objects.PanelWrapper();
 //BA.debugLineNum = 96;BA.debugLine="Private l_proddev As Label";
_l_proddev = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 97;BA.debugLine="Private b_devmas As Button";
_b_devmas = new anywheresoftware.b4a.objects.ButtonWrapper();
 //BA.debugLineNum = 98;BA.debugLine="Private l_cantdev As Label";
_l_cantdev = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 99;BA.debugLine="Private b_devmenos As Button";
_b_devmenos = new anywheresoftware.b4a.objects.ButtonWrapper();
 //BA.debugLineNum = 100;BA.debugLine="Private b_acep_dev As Button";
_b_acep_dev = new anywheresoftware.b4a.objects.ButtonWrapper();
 //BA.debugLineNum = 103;BA.debugLine="Dim preciodev As Double";
_preciodev = 0;
 //BA.debugLineNum = 104;BA.debugLine="Dim nombredev As String";
_nombredev = "";
 //BA.debugLineNum = 106;BA.debugLine="Private cb_descuento As CheckBox";
_cb_descuento = new anywheresoftware.b4a.objects.CompoundButtonWrapper.CheckBoxWrapper();
 //BA.debugLineNum = 107;BA.debugLine="End Sub";
return "";
}
public String  _clv_prods_ll_itemclick(int _index,Object _value) throws Exception{
 //BA.debugLineNum = 1563;BA.debugLine="Private Sub clv_prods_ll_ItemClick (Index As Int,";
 //BA.debugLineNum = 1565;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;
anywheresoftware.b4a.sql.SQL.CursorWrapper _descped = null;
String _precio = "";
 //BA.debugLineNum = 1613;BA.debugLine="Private Sub clv_prods_ll_VisibleRangeChanged (Firs";
 //BA.debugLineNum = 1657;BA.debugLine="Dim ExtraSize As Int = 15 'List size";
_extrasize = (int) (15);
 //BA.debugLineNum = 1658;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 = 1659;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 = 1660;BA.debugLine="If i > FirstIndex - ExtraSize And i < LastIndex";
if (_i>_firstindex-_extrasize && _i<_lastindex+_extrasize) { 
 //BA.debugLineNum = 1662;BA.debugLine="If Pnl.NumberOfViews = 0 Then 'Add each item/la";
if (_pnl.getNumberOfViews()==0) { 
 //BA.debugLineNum = 1663;BA.debugLine="Pnl.LoadLayout(\"proditem\")";
_pnl.LoadLayout("proditem",ba);
 //BA.debugLineNum = 1665;BA.debugLine="p_prods.Width = Root.Width * 0.92";
_p_prods.setWidth((int) (_root.getWidth()*0.92));
 //BA.debugLineNum = 1666;BA.debugLine="p_botMasMen.Left = p_prods.Width - (p_botMasMe";
_p_botmasmen.setLeft((int) (_p_prods.getWidth()-(_p_botmasmen.getWidth()+5)));
 //BA.debugLineNum = 1667;BA.debugLine="p_botMasMenc.Left = p_prods.Width - (p_botMasM";
_p_botmasmenc.setLeft((int) (_p_prods.getWidth()-(_p_botmasmen.getWidth()+5)));
 //BA.debugLineNum = 1668;BA.debugLine="p_prods.Height = 134dip";
_p_prods.setHeight(__c.DipToCurrent((int) (134)));
 //BA.debugLineNum = 1676;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 = 1677;BA.debugLine="Private cs As CSBuilder";
_cs = new anywheresoftware.b4a.objects.CSBuilder();
 //BA.debugLineNum = 1678;BA.debugLine="cs.Initialize";
_cs.Initialize();
 //BA.debugLineNum = 1679;BA.debugLine="l_prodX.SetTextSizeAnimated(0, 13)";
_l_prodx.SetTextSizeAnimated((int) (0),(float) (13));
 //BA.debugLineNum = 1680;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 = 1681;BA.debugLine="p_prods.Color=0xFFE2EEFF";
_p_prods.setColor(((int)0xffe2eeff));
 //BA.debugLineNum = 1682;BA.debugLine="Log(clv_prods_ll.GetValue(i).As(Map).Get(\"id\"";
__c.LogImpl("441746501",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"))),0);
 //BA.debugLineNum = 1683;BA.debugLine="Log(\"AQUI\")";
__c.LogImpl("441746502","AQUI",0);
 //BA.debugLineNum = 1684;BA.debugLine="Dim descped As Cursor = Starter.skmt.ExecQuer";
_descped = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_descped = (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 IFNULL(PE_DESC,0) AS PE_DESC FROM PEDIDO WHERE PE_CLIENTE IN (SELECT CUENTA FROM CUENTAA) AND PE_PROID = '"+__c.SmartStringFormatter("",((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")))+"' and PE_CEDIS = '"+__c.SmartStringFormatter("",(Object)(_subs._traealmacen /*String*/ (ba)))+"'"))));
 //BA.debugLineNum = 1685;BA.debugLine="Log($\"SELECT IFNULL(PE_DESC,0) AS PE_DESC FRO";
__c.LogImpl("441746504",("SELECT IFNULL(PE_DESC,0) AS PE_DESC FROM PEDIDO WHERE PE_CLIENTE IN (SELECT CUENTA FROM CUENTAA) AND PE_PROID = '"+__c.SmartStringFormatter("",((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")))+"' and PE_CEDIS = '"+__c.SmartStringFormatter("",(Object)(_subs._traealmacen /*String*/ (ba)))+"'"),0);
 //BA.debugLineNum = 1687;BA.debugLine="Log(listaProds.get(i).As(Map).Get(\"id\"))";
__c.LogImpl("441746506",BA.ObjectToString(((anywheresoftware.b4a.objects.collections.Map) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.collections.Map(), (java.util.Map)(_listaprods.Get(_i)))).Get((Object)("id"))),0);
 //BA.debugLineNum = 1688;BA.debugLine="If descped.RowCount > 0 Then";
if (_descped.getRowCount()>0) { 
 //BA.debugLineNum = 1689;BA.debugLine="descped.Position = 0";
_descped.setPosition((int) (0));
 //BA.debugLineNum = 1690;BA.debugLine="If descped.GetString(\"PE_DESC\") = 1 Then";
if ((_descped.GetString("PE_DESC")).equals(BA.NumberToString(1))) { 
 //BA.debugLineNum = 1691;BA.debugLine="cb_descuento.Checked = True";
_cb_descuento.setChecked(__c.True);
 }else {
 //BA.debugLineNum = 1693;BA.debugLine="cb_descuento.Checked = False";
_cb_descuento.setChecked(__c.False);
 };
 //BA.debugLineNum = 1695;BA.debugLine="Log(\"true\")";
__c.LogImpl("441746514","true",0);
 };
 //BA.debugLineNum = 1698;BA.debugLine="cb_descuento.Tag = listaProds.get(i).As(Map).";
_cb_descuento.setTag(((anywheresoftware.b4a.objects.collections.Map) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.collections.Map(), (java.util.Map)(_listaprods.Get(_i)))).Get((Object)("id")));
 //BA.debugLineNum = 1702;BA.debugLine="et_pCant.TextColor=Colors.Red";
_et_pcant.setTextColor(__c.Colors.Red);
 //BA.debugLineNum = 1703;BA.debugLine="et_pCantc.TextColor=Colors.Red";
_et_pcantc.setTextColor(__c.Colors.Red);
 //BA.debugLineNum = 1704;BA.debugLine="If Subs.pedidoGuardado Then";
if (_subs._pedidoguardado /*boolean*/ (ba)) { 
 //BA.debugLineNum = 1706;BA.debugLine="et_pCant.Enabled = False";
_et_pcant.setEnabled(__c.False);
 //BA.debugLineNum = 1708;BA.debugLine="b_prodMenos.Enabled = False";
_b_prodmenos.setEnabled(__c.False);
 };
 }else {
 //BA.debugLineNum = 1712;BA.debugLine="cb_descuento.Visible = False";
_cb_descuento.setVisible(__c.False);
 //BA.debugLineNum = 1713;BA.debugLine="Log(listaProds.get(i).As(Map).Get(\"id\"))";
__c.LogImpl("441746532",BA.ObjectToString(((anywheresoftware.b4a.objects.collections.Map) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.collections.Map(), (java.util.Map)(_listaprods.Get(_i)))).Get((Object)("id"))),0);
 //BA.debugLineNum = 1715;BA.debugLine="If clv_prods_ll.GetValue(i).As(Map).Get(\"prio";
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)("prioridad"))).equals((Object)("PRIORITARIO"))) { 
 //BA.debugLineNum = 1716;BA.debugLine="p_prods.Color = Colors.RGB(255, 212, 163) 'n";
_p_prods.setColor(__c.Colors.RGB((int) (255),(int) (212),(int) (163)));
 //BA.debugLineNum = 1717;BA.debugLine="cb_descuento.Visible = True";
_cb_descuento.setVisible(__c.True);
 //BA.debugLineNum = 1718;BA.debugLine="cb_descuento.Tag = listaProds.get(i).As(Map)";
_cb_descuento.setTag(((anywheresoftware.b4a.objects.collections.Map) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.collections.Map(), (java.util.Map)(_listaprods.Get(_i)))).Get((Object)("id")));
 }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)("prioridad"))).equals((Object)("COMPLEMENTARIO"))) { 
 //BA.debugLineNum = 1723;BA.debugLine="p_prods.Color = Colors.RGB(177, 200, 249)'az";
_p_prods.setColor(__c.Colors.RGB((int) (177),(int) (200),(int) (249)));
 }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)("prioridad"))).equals((Object)("CATALOGO REGULAR"))) { 
 //BA.debugLineNum = 1726;BA.debugLine="p_prods.Color = Colors.White";
_p_prods.setColor(__c.Colors.White);
 }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)("prioridad"))).equals((Object)("ESTRATEGICO"))) { 
 //BA.debugLineNum = 1729;BA.debugLine="p_prods.Color = Colors.RGB(241, 255, 163) 'a";
_p_prods.setColor(__c.Colors.RGB((int) (241),(int) (255),(int) (163)));
 };
 };
 //BA.debugLineNum = 1733;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 = 1744;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) { 
_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 = 1776;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))+""))).PopAll().getObject()));
 };
 }else {
 };
 //BA.debugLineNum = 1801;BA.debugLine="PCLV.B4XSeekBar1.Value = clv_prods_ll.Size - Fir";
_pclv._b4xseekbar1 /*gunav2.keymon.com.mx.b4xseekbar*/ ._setvalue /*int*/ ((int) (_clv_prods_ll._getsize()-_firstindex));
 }
};
 //BA.debugLineNum = 1804;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 = 719;BA.debugLine="Sub CreateListItem(Text As String, precioU As Stri";
 //BA.debugLineNum = 734;BA.debugLine="End Sub";
return null;
}
public String  _cuentaprods() throws Exception{
 //BA.debugLineNum = 1187;BA.debugLine="Sub cuentaProds";
 //BA.debugLineNum = 1189;BA.debugLine="Log(\"===========================\")";
__c.LogImpl("440894466","===========================",0);
 //BA.debugLineNum = 1190;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 /*gunav2.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 = 1193;BA.debugLine="p_botonesVenta.Visible = True";
_p_botonesventa.setVisible(__c.True);
 //BA.debugLineNum = 1194;BA.debugLine="p_botonesVenta.BringToFront";
_p_botonesventa.BringToFront();
 //BA.debugLineNum = 1195;BA.debugLine="c.Position=0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 1197;BA.debugLine="c.Close";
_c.Close();
 //BA.debugLineNum = 1199;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 = 1006;BA.debugLine="Private Sub et_pCant_FocusChanged (HasFocus As Boo";
 //BA.debugLineNum = 1007;BA.debugLine="LogColor($\"focus changed=${HasFocus}\"$, Colors.Ma";
__c.LogImpl("440763393",("focus changed="+__c.SmartStringFormatter("",(Object)(_hasfocus))+""),__c.Colors.Magenta);
 //BA.debugLineNum = 1008;BA.debugLine="If et_pCant.Text = \"\" Then et_pCant.Text = \"0\"";
if ((_et_pcant.getText()).equals("")) { 
_et_pcant.setText(BA.ObjectToCharSequence("0"));};
 //BA.debugLineNum = 1009;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 = 1010;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 = 1011;BA.debugLine="Dim pnl As B4XView = pnl0.GetView(0)";
_pnl = new anywheresoftware.b4a.objects.B4XViewWrapper();
_pnl = _pnl0.GetView((int) (0));
 //BA.debugLineNum = 1012;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 = 1013;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 = 1014;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 = 1015;BA.debugLine="If laCant.Text = \"\" Then laCant.Text = \"0\"";
if ((_lacant.getText()).equals("")) { 
_lacant.setText(BA.ObjectToCharSequence("0"));};
 //BA.debugLineNum = 1016;BA.debugLine="etCantHasFocus = HasFocus";
_etcanthasfocus = _hasfocus;
 //BA.debugLineNum = 1017;BA.debugLine="LogColor(laCant.Text,Colors.Red)";
__c.LogImpl("440763403",_lacant.getText(),__c.Colors.Red);
 //BA.debugLineNum = 1018;BA.debugLine="If laCant2.IsInitialized Then";
if (_lacant2.IsInitialized()) { 
 //BA.debugLineNum = 1019;BA.debugLine="totalcajasmaspiezas = laCant.Text + laCant2.Text";
_totalcajasmaspiezas = (int) ((double)(Double.parseDouble(_lacant.getText()))+(double)(Double.parseDouble(_lacant2.getText())));
 }else {
 //BA.debugLineNum = 1021;BA.debugLine="totalcajasmaspiezas = laCant.Text";
_totalcajasmaspiezas = (int)(Double.parseDouble(_lacant.getText()));
 };
 //BA.debugLineNum = 1023;BA.debugLine="invTotal = totalcajasmaspiezas + Subs.traeinventa";
_invtotal = (int) (_totalcajasmaspiezas+(double)(Double.parseDouble(_subs._traeinventario /*String*/ (ba,_id))));
 //BA.debugLineNum = 1026;BA.debugLine="cuentaProds";
_cuentaprods();
 //BA.debugLineNum = 1027;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 _lprodx = null;
anywheresoftware.b4a.objects.CompoundButtonWrapper.CheckBoxWrapper _cb_des = null;
String _aplicades = "";
String _id = "";
String _precio = "";
String _inv = "";
String _nombrex = "";
anywheresoftware.b4a.objects.B4XViewWrapper _panelpiezas = null;
anywheresoftware.b4a.objects.CSBuilder _cs = null;
anywheresoftware.b4a.sql.SQL.CursorWrapper _o = null;
String _invactualizado = "";
anywheresoftware.b4a.sql.SQL.CursorWrapper _c7 = null;
double _totaldev = 0;
anywheresoftware.b4a.sql.SQL.CursorWrapper _c6 = null;
double _totalprod = 0;
 //BA.debugLineNum = 1029;BA.debugLine="Private Sub et_pCant_TextChanged (Old As String, N";
 //BA.debugLineNum = 1032;BA.debugLine="If etCantHasFocus = True Then";
if (_etcanthasfocus==__c.True) { 
 //BA.debugLineNum = 1033;BA.debugLine="LogColor($\"txt changed: ${Old}|${New}, hasfocus=";
__c.LogImpl("440828932",("txt changed: "+__c.SmartStringFormatter("",(Object)(_old))+"|"+__c.SmartStringFormatter("",(Object)(_new))+", hasfocus="+__c.SmartStringFormatter("",(Object)(_etcanthasfocus))+""),__c.Colors.Magenta);
 //BA.debugLineNum = 1034;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 = 1035;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 = 1036;BA.debugLine="Dim pnl As B4XView = pnl0.GetView(0)";
_pnl = new anywheresoftware.b4a.objects.B4XViewWrapper();
_pnl = _pnl0.GetView((int) (0));
 //BA.debugLineNum = 1037;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 = 1039;BA.debugLine="Dim lProdX As B4XView = pnl.GetView(1)";
_lprodx = new anywheresoftware.b4a.objects.B4XViewWrapper();
_lprodx = _pnl.GetView((int) (1));
 //BA.debugLineNum = 1040;BA.debugLine="Dim cb_des As CheckBox = pnl.GetView(4)";
_cb_des = new anywheresoftware.b4a.objects.CompoundButtonWrapper.CheckBoxWrapper();
_cb_des = (anywheresoftware.b4a.objects.CompoundButtonWrapper.CheckBoxWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.CompoundButtonWrapper.CheckBoxWrapper(), (android.widget.CheckBox)(_pnl.GetView((int) (4)).getObject()));
 //BA.debugLineNum = 1041;BA.debugLine="Dim aplicades As String";
_aplicades = "";
 //BA.debugLineNum = 1042;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 = 1043;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 = 1044;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 = 1045;BA.debugLine="Private inv As String=Subs.traeinventario(id)";
_inv = _subs._traeinventario /*String*/ (ba,_id);
 //BA.debugLineNum = 1046;BA.debugLine="Private nombreX As String = Subs.traeProdNombre(";
_nombrex = _subs._traeprodnombre /*String*/ (ba,_id);
 //BA.debugLineNum = 1048;BA.debugLine="Dim panelpiezas As B4XView = pnl.GetView(2)";
_panelpiezas = new anywheresoftware.b4a.objects.B4XViewWrapper();
_panelpiezas = _pnl.GetView((int) (2));
 //BA.debugLineNum = 1051;BA.debugLine="If(New = \"\" Or New = Null Or New = \"-\") Then New";
if (((_new).equals("") || _new== null || (_new).equals("-"))) { 
_new = BA.NumberToString(0);};
 //BA.debugLineNum = 1053;BA.debugLine="If(New > invTotal) Then";
if (((double)(Double.parseDouble(_new))>_invtotal)) { 
 //BA.debugLineNum = 1054;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 = 1058;BA.debugLine="If New = \"\" Then New = 0";
if ((_new).equals("")) { 
_new = BA.NumberToString(0);};
 //BA.debugLineNum = 1059;BA.debugLine="If laCant.Text = \"\" Then laCant.Text = 0";
if ((_lacant.getText()).equals("")) { 
_lacant.setText(BA.ObjectToCharSequence(0));};
 //BA.debugLineNum = 1060;BA.debugLine="LogColor(laCant.Text,Colors.Red)";
__c.LogImpl("440828959",_lacant.getText(),__c.Colors.Red);
 //BA.debugLineNum = 1069;BA.debugLine="If cb_des.Checked Then";
if (_cb_des.getChecked()) { 
 //BA.debugLineNum = 1070;BA.debugLine="Log(\" descuento igual a True\")";
__c.LogImpl("440828969"," descuento igual a True",0);
 //BA.debugLineNum = 1071;BA.debugLine="aplicades = \"1\"";
_aplicades = "1";
 }else {
 //BA.debugLineNum = 1073;BA.debugLine="Log(\"descuento igual a false\")";
__c.LogImpl("440828972","descuento igual a false",0);
 //BA.debugLineNum = 1074;BA.debugLine="aplicades = \"0\"";
_aplicades = "0";
 };
 //BA.debugLineNum = 1083;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 = 1084;BA.debugLine="Log(\"actualizamos producto\")";
__c.LogImpl("440828983","actualizamos producto",0);
 //BA.debugLineNum = 1085;BA.debugLine="If B4XPages.MainPage.tipo_venta = \"PREVENTA_FUT";
if ((_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._tipo_venta /*String*/ ).equals("PREVENTA_FUTURA")) { 
 //BA.debugLineNum = 1086;BA.debugLine="Subs.actualizaProducto(Subs.traeAlmacen, preci";
_subs._actualizaproducto /*String*/ (ba,_subs._traealmacen /*String*/ (ba),_precio,_lacant.getText(),_subs._traeprodnombre /*String*/ (ba,_id),_id,_clienteid,_subs._traefecha /*String*/ (ba),_subs._traeusuariodebd /*String*/ (ba),_rutausuario,BA.NumberToString(0),_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._tipo_venta /*String*/ ,BA.NumberToString(0),BA.NumberToString(1),_aplicades);
 }else {
 //BA.debugLineNum = 1088;BA.debugLine="Subs.actualizaProducto(Subs.traeAlmacen, preci";
_subs._actualizaproducto /*String*/ (ba,_subs._traealmacen /*String*/ (ba),_precio,_lacant.getText(),_subs._traeprodnombre /*String*/ (ba,_id),_id,_clienteid,_subs._traefecha /*String*/ (ba),_subs._traeusuariodebd /*String*/ (ba),_rutausuario,BA.NumberToString(0),_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._tipo_venta /*String*/ ,BA.NumberToString(0),BA.NumberToString(0),_aplicades);
 };
 //BA.debugLineNum = 1091;BA.debugLine="cuentaProds";
_cuentaprods();
 };
 //BA.debugLineNum = 1104;BA.debugLine="If 1 = 1 Then";
if (1==1) { 
 //BA.debugLineNum = 1105;BA.debugLine="Private cs As CSBuilder";
_cs = new anywheresoftware.b4a.objects.CSBuilder();
 //BA.debugLineNum = 1106;BA.debugLine="cs.Initialize";
_cs.Initialize();
 //BA.debugLineNum = 1107;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 = 1108;BA.debugLine="Private invActualizado As String = \"0\"";
_invactualizado = "0";
 //BA.debugLineNum = 1110;BA.debugLine="o.Position = 0";
_o.setPosition((int) (0));
 //BA.debugLineNum = 1111;BA.debugLine="invActualizado = Subs.traeinventario(id)";
_invactualizado = _subs._traeinventario /*String*/ (ba,_id);
 //BA.debugLineNum = 1112;BA.debugLine="Log(Subs.traeinventario(id))";
__c.LogImpl("440829011",_subs._traeinventario /*String*/ (ba,_id),0);
 //BA.debugLineNum = 1123;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)))+""))).PopAll().getObject()));
 };
 //BA.debugLineNum = 1137;BA.debugLine="c = B4XPages.MainPage.skmt.ExecQuery(\"select IFN";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select IFNULL(sum(PE_CANT),0) as PC_NOART, IFNULL(sum (PE_COSTO_TOT),0) 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 = 1138;BA.debugLine="If c.RowCount > 0 Then";
if (_c.getRowCount()>0) { 
 //BA.debugLineNum = 1139;BA.debugLine="C.Position = 0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 1140;BA.debugLine="Log($\"registros: ${c.RowCount}, arts: ${c.GetSt";
__c.LogImpl("440829039",("registros: "+__c.SmartStringFormatter("",(Object)(_c.getRowCount()))+", arts: "+__c.SmartStringFormatter("",(Object)(_c.GetString("PC_NOART")))+", monto:"+__c.SmartStringFormatter("",(Object)(_c.GetString("PC_MONTO")))+""),0);
 //BA.debugLineNum = 1141;BA.debugLine="l_totProds.Text = \"Prods: \" & c.GetString(\"PC_N";
_l_totprods.setText(BA.ObjectToCharSequence("Prods: "+_c.GetString("PC_NOART")));
 //BA.debugLineNum = 1142;BA.debugLine="l_total.Text = \"Total: $\" & c.GetString(\"PC_MON";
_l_total.setText(BA.ObjectToCharSequence("Total: $"+_c.GetString("PC_MONTO")));
 //BA.debugLineNum = 1143;BA.debugLine="If l_total.Text = Null Or l_total.Text = \"null\"";
if (_l_total.getText()== null || (_l_total.getText()).equals("null") || (_l_total.getText()).equals("")) { 
_l_total.setText(BA.ObjectToCharSequence("Total: $0.0"));};
 //BA.debugLineNum = 1144;BA.debugLine="If l_totProds.Text = Null Or l_totProds.Text =";
if (_l_totprods.getText()== null || (_l_totprods.getText()).equals("null") || (_l_totprods.getText()).equals("")) { 
_l_totprods.setText(BA.ObjectToCharSequence("Prods: 0"));};
 };
 //BA.debugLineNum = 1147;BA.debugLine="c = B4XPages.MainPage.skmt.ExecQuery(\"select IFN";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select IFNULL(sum(PE_CANT),0) as PC_NOART, IFNULL(sum (PE_COSTO_TOT),0) 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 = 1148;BA.debugLine="If c.RowCount > 0 Then";
if (_c.getRowCount()>0) { 
 //BA.debugLineNum = 1149;BA.debugLine="C.Position = 0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 1150;BA.debugLine="Log($\"registros: ${c.RowCount}, arts: ${c.GetSt";
__c.LogImpl("440829049",("registros: "+__c.SmartStringFormatter("",(Object)(_c.getRowCount()))+", arts: "+__c.SmartStringFormatter("",(Object)(_c.GetString("PC_NOART")))+", monto:"+__c.SmartStringFormatter("",(Object)(_c.GetString("PC_MONTO")))+""),0);
 //BA.debugLineNum = 1151;BA.debugLine="l_totProds.Text = \"Prods: \" & c.GetString(\"PC_N";
_l_totprods.setText(BA.ObjectToCharSequence("Prods: "+_c.GetString("PC_NOART")));
 //BA.debugLineNum = 1152;BA.debugLine="l_total.Text = \"Total: $\" & c.GetString(\"PC_MON";
_l_total.setText(BA.ObjectToCharSequence("Total: $"+_c.GetString("PC_MONTO")));
 //BA.debugLineNum = 1153;BA.debugLine="If l_total.Text = Null Or l_total.Text = \"null\"";
if (_l_total.getText()== null || (_l_total.getText()).equals("null") || (_l_total.getText()).equals("")) { 
_l_total.setText(BA.ObjectToCharSequence("Total: $0.0"));};
 //BA.debugLineNum = 1154;BA.debugLine="If l_totProds.Text = Null Or l_totProds.Text =";
if (_l_totprods.getText()== null || (_l_totprods.getText()).equals("null") || (_l_totprods.getText()).equals("")) { 
_l_totprods.setText(BA.ObjectToCharSequence("Prods: 0"));};
 };
 //BA.debugLineNum = 1160;BA.debugLine="Dim c7 As Cursor = B4XPages.MainPage.skmt.ExecQu";
_c7 = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_c7 = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select IFNULL(sum(PE_CANT),0) as PC_NOART, IFNULL(sum (PE_COSTO_TOT),0) 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 ) and PE_CEDIS = 'DUR'")));
 //BA.debugLineNum = 1161;BA.debugLine="If c7.RowCount > 0 Then";
if (_c7.getRowCount()>0) { 
 //BA.debugLineNum = 1162;BA.debugLine="c7.Position = 0";
_c7.setPosition((int) (0));
 //BA.debugLineNum = 1164;BA.debugLine="Dim totaldev As Double = c7.GetString(\"PC_MONTO";
_totaldev = (double)(Double.parseDouble(_c7.GetString("PC_MONTO")));
 };
 //BA.debugLineNum = 1168;BA.debugLine="Dim c6 As Cursor = B4XPages.MainPage.skmt.ExecQu";
_c6 = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_c6 = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select IFNULL(sum(PE_CANT),0) as PC_NOART, IFNULL(sum (PE_COSTO_TOT),0) 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 ) and PE_CEDIS <> 'DUR' ")));
 //BA.debugLineNum = 1169;BA.debugLine="If c6.RowCount > 0 Then";
if (_c6.getRowCount()>0) { 
 //BA.debugLineNum = 1170;BA.debugLine="c6.Position = 0";
_c6.setPosition((int) (0));
 //BA.debugLineNum = 1172;BA.debugLine="Dim totalprod As Double = c6.GetString(\"PC_MONT";
_totalprod = (double)(Double.parseDouble(_c6.GetString("PC_MONTO")));
 };
 //BA.debugLineNum = 1177;BA.debugLine="If totalprod = 0 Then";
if (_totalprod==0) { 
 //BA.debugLineNum = 1178;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"delete fro";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("delete from pedido where PE_CLIENTE In (select cuenta from cuentaa) AND PE_CEDIS = 'DUR'");
 //BA.debugLineNum = 1179;BA.debugLine="MsgboxAsync(\"Las devloluciones se elimanron por";
__c.MsgboxAsync(BA.ObjectToCharSequence("Las devloluciones se elimanron por que no hay venta."),BA.ObjectToCharSequence("Atención"),ba);
 }else if(_totalprod<_totaldev) { 
 //BA.debugLineNum = 1181;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"delete fro";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("delete from pedido where PE_CLIENTE In (select cuenta from cuentaa) AND PE_CEDIS = 'DUR'");
 //BA.debugLineNum = 1182;BA.debugLine="MsgboxAsync(\"Las devloluciones se elimanron por";
__c.MsgboxAsync(BA.ObjectToCharSequence("Las devloluciones se elimanron por que el monto de la devolucion es mayor al monto de la venta."),BA.ObjectToCharSequence("Atención"),ba);
 };
 };
 //BA.debugLineNum = 1185;BA.debugLine="End Sub";
return "";
}
public Object  _initialize(anywheresoftware.b4a.BA _ba) throws Exception{
innerInitialize(_ba);
 //BA.debugLineNum = 110;BA.debugLine="Public Sub Initialize As Object";
 //BA.debugLineNum = 111;BA.debugLine="Return Me";
if (true) return this;
 //BA.debugLineNum = 112;BA.debugLine="End Sub";
return null;
}
public String  _l_info_click() throws Exception{
 //BA.debugLineNum = 1299;BA.debugLine="Private Sub l_info_Click";
 //BA.debugLineNum = 1300;BA.debugLine="l_info.Visible = False";
_l_info.setVisible(__c.False);
 //BA.debugLineNum = 1301;BA.debugLine="End Sub";
return "";
}
public String  _l_prodx_click() throws Exception{
anywheresoftware.b4a.objects.CSBuilder _cs = null;
int _index = 0;
anywheresoftware.b4a.objects.B4XViewWrapper _p0 = null;
anywheresoftware.b4a.objects.B4XViewWrapper _p = null;
anywheresoftware.b4a.objects.B4XViewWrapper _cant1 = null;
anywheresoftware.b4a.objects.B4XViewWrapper _prdox = null;
String[] _prodx1 = null;
String _textprom = "";
anywheresoftware.b4a.sql.SQL.CursorWrapper _descpro = null;
int _hgfd = 0;
anywheresoftware.b4a.sql.SQL.CursorWrapper _preciocat = null;
float _recalculo = 0f;
 //BA.debugLineNum = 1567;BA.debugLine="Sub l_prodx_click";
 //BA.debugLineNum = 1569;BA.debugLine="Dim cs As CSBuilder";
_cs = new anywheresoftware.b4a.objects.CSBuilder();
 //BA.debugLineNum = 1570;BA.debugLine="cs.Initialize";
_cs.Initialize();
 //BA.debugLineNum = 1571;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 = 1572;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 = 1573;BA.debugLine="Private p As B4XView = p0.GetView(0)";
_p = new anywheresoftware.b4a.objects.B4XViewWrapper();
_p = _p0.GetView((int) (0));
 //BA.debugLineNum = 1574;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 = 1575;BA.debugLine="Private PRDOX As B4XView = p.GetView(1)";
_prdox = new anywheresoftware.b4a.objects.B4XViewWrapper();
_prdox = _p.GetView((int) (1));
 //BA.debugLineNum = 1576;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 = 1579;BA.debugLine="Log(cant1.Text)";
__c.LogImpl("441680908",_cant1.getText(),0);
 //BA.debugLineNum = 1580;BA.debugLine="Dim prodx1() As String=Regex.Split(CRLF,PRDOX.Tex";
_prodx1 = __c.Regex.Split(__c.CRLF,_prdox.getText());
 //BA.debugLineNum = 1581;BA.debugLine="Log(prodx1(1))";
__c.LogImpl("441680910",_prodx1[(int) (1)],0);
 //BA.debugLineNum = 1582;BA.debugLine="p_promodesc.Visible = True";
_p_promodesc.setVisible(__c.True);
 //BA.debugLineNum = 1583;BA.debugLine="p_promodesc.Height = Root.Height";
_p_promodesc.setHeight(_root.getHeight());
 //BA.debugLineNum = 1584;BA.debugLine="p_promodesc.Width = Root.Width";
_p_promodesc.setWidth(_root.getWidth());
 //BA.debugLineNum = 1585;BA.debugLine="Dim textprom As String = \"\"";
_textprom = "";
 //BA.debugLineNum = 1586;BA.debugLine="Dim descpro As Cursor = Starter.skmt.ExecQuery($\"";
_descpro = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_descpro = (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_PD_RANGO, CAT_PD_DESCUENTO, CAT_PD_RANGO2 FROM CAT_PROMOS_DESCUENTOS WHERE CAT_PD_PRODUCTO IN (SELECT CAT_GP_ID FROM CAT_GUNAPROD WHERE CAT_GP_NOMBRE = '"+__c.SmartStringFormatter("",(Object)(_prodx1[(int) (0)]))+"') AND INSTR(',' || CAT_PD_TIER || ',' , ',"+__c.SmartStringFormatter("",(Object)(_subs._traetipocliente /*int*/ (ba)))+",') > 0 "))));
 //BA.debugLineNum = 1587;BA.debugLine="Log($\"SELECT CAT_PD_RANGO, CAT_PD_DESCUENTO, CAT_";
__c.LogImpl("441680916",("SELECT CAT_PD_RANGO, CAT_PD_DESCUENTO, CAT_PD_RANGO2 FROM CAT_PROMOS_DESCUENTOS WHERE CAT_PD_PRODUCTO IN (SELECT CAT_GP_ID FROM CAT_GUNAPROD WHERE CAT_GP_NOMBRE = '"+__c.SmartStringFormatter("",(Object)(_prodx1[(int) (0)]))+"') AND INSTR(',' || CAT_DP_TIER || ',' , ',"+__c.SmartStringFormatter("",(Object)(_subs._traetipocliente /*int*/ (ba)))+",') > 0 "),0);
 //BA.debugLineNum = 1588;BA.debugLine="Log(descpro.RowCount)";
__c.LogImpl("441680917",BA.NumberToString(_descpro.getRowCount()),0);
 //BA.debugLineNum = 1589;BA.debugLine="If descpro.RowCount > 0 Then";
if (_descpro.getRowCount()>0) { 
 //BA.debugLineNum = 1590;BA.debugLine="l_promodesc.Text = \"\"";
_l_promodesc.setText(BA.ObjectToCharSequence(""));
 //BA.debugLineNum = 1591;BA.debugLine="For hgfd = 0 To descpro.RowCount -1";
{
final int step21 = 1;
final int limit21 = (int) (_descpro.getRowCount()-1);
_hgfd = (int) (0) ;
for (;_hgfd <= limit21 ;_hgfd = _hgfd + step21 ) {
 //BA.debugLineNum = 1592;BA.debugLine="descpro.Position = hgfd";
_descpro.setPosition(_hgfd);
 //BA.debugLineNum = 1594;BA.debugLine="Dim preciocat As Cursor = Starter.skmt.ExecQuer";
_preciocat = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_preciocat = (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_PRECIO FROM CAT_GUNAPROD WHERE CAT_GP_NOMBRE = '"+__c.SmartStringFormatter("",(Object)(_prodx1[(int) (0)]))+"'"))));
 //BA.debugLineNum = 1595;BA.debugLine="preciocat.Position = 0";
_preciocat.setPosition((int) (0));
 //BA.debugLineNum = 1596;BA.debugLine="textprom = \"\"";
_textprom = "";
 //BA.debugLineNum = 1597;BA.debugLine="Private recalculo As Float = preciocat.GetStrin";
_recalculo = (float) ((double)(Double.parseDouble(_preciocat.GetString("CAT_GP_PRECIO")))-(double)(Double.parseDouble(__c.NumberFormat2((((double)(Double.parseDouble(_preciocat.GetString("CAT_GP_PRECIO")))*(double)(Double.parseDouble(_descpro.GetString("CAT_PD_DESCUENTO"))))/(double)100),(int) (0),(int) (2),(int) (2),__c.False))));
 //BA.debugLineNum = 1599;BA.debugLine="textprom = cs.Color(Colors.Black).Append(\"Descu";
_textprom = BA.ObjectToString(_cs.Color(__c.Colors.Black).Append(BA.ObjectToCharSequence("Descuento "+BA.NumberToString((_hgfd+1))+__c.CRLF+__c.CRLF+"  Min: "+BA.NumberToString(_descpro.GetInt("CAT_PD_RANGO"))+" Max: "+BA.NumberToString(_descpro.GetInt("CAT_PD_RANGO2"))+__c.CRLF+__c.CRLF)).Pop().Color(__c.Colors.Red).Size((int) (18)).Append(BA.ObjectToCharSequence("Descuento: "+BA.NumberToString(_descpro.GetDouble("CAT_PD_DESCUENTO"))+"%"+__c.CRLF+__c.CRLF)).Pop().Color(__c.Colors.Red).Size((int) (18)).Append(BA.ObjectToCharSequence("Precio: "+__c.NumberFormat2(_recalculo,(int) (0),(int) (0),(int) (2),__c.False)+__c.CRLF+__c.CRLF)).PopAll());
 //BA.debugLineNum = 1600;BA.debugLine="l_promodesc.Text = \"\"";
_l_promodesc.setText(BA.ObjectToCharSequence(""));
 //BA.debugLineNum = 1601;BA.debugLine="l_promodesc.Text = textprom";
_l_promodesc.setText(BA.ObjectToCharSequence(_textprom));
 }
};
 }else {
 //BA.debugLineNum = 1607;BA.debugLine="l_promodesc.Text = \"El producto no tiene descuen";
_l_promodesc.setText(BA.ObjectToCharSequence("El producto no tiene descuento o el tipo de cliente no es apto para este descuento."));
 };
 //BA.debugLineNum = 1611;BA.debugLine="End Sub";
return "";
}
public String  _l_prodx_longclick() throws Exception{
anywheresoftware.b4a.objects.CSBuilder _cs = null;
int _index = 0;
anywheresoftware.b4a.objects.B4XViewWrapper _p0 = null;
anywheresoftware.b4a.objects.B4XViewWrapper _p = null;
anywheresoftware.b4a.objects.B4XViewWrapper _cant1 = null;
anywheresoftware.b4a.objects.B4XViewWrapper _prdox = null;
String[] _prodx1 = null;
String[] _prodx3 = null;
anywheresoftware.b4a.sql.SQL.CursorWrapper _dev = null;
anywheresoftware.b4a.sql.SQL.CursorWrapper _devo = null;
 //BA.debugLineNum = 2371;BA.debugLine="Private Sub l_prodX_LongClick";
 //BA.debugLineNum = 2372;BA.debugLine="If tipo_venta <> \"PREVENTA_FUTURA\" Then";
if ((_tipo_venta).equals("PREVENTA_FUTURA") == false) { 
 //BA.debugLineNum = 2375;BA.debugLine="Log(l_total.Text)";
__c.LogImpl("442205188",_l_total.getText(),0);
 //BA.debugLineNum = 2376;BA.debugLine="c = B4XPages.MainPage.skmt.ExecQuery(\"select IFNU";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select IFNULL(sum(PE_CANT),0) as PC_NOART, IFNULL(sum (PE_COSTO_TOT),0) 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 ) AND PE_CEDIS <> 'DUR'")));
 //BA.debugLineNum = 2378;BA.debugLine="If c.RowCount > 0 Then";
if (_c.getRowCount()>0) { 
 //BA.debugLineNum = 2379;BA.debugLine="C.Position = 0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 2381;BA.debugLine="If c.GetString(\"PC_MONTO\") > 0 Then";
if ((double)(Double.parseDouble(_c.GetString("PC_MONTO")))>0) { 
 //BA.debugLineNum = 2384;BA.debugLine="Dim cs As CSBuilder";
_cs = new anywheresoftware.b4a.objects.CSBuilder();
 //BA.debugLineNum = 2385;BA.debugLine="cs.Initialize";
_cs.Initialize();
 //BA.debugLineNum = 2386;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 = 2387;BA.debugLine="Private p0 As B4XView = clv_prods_ll.GetPanel(In";
_p0 = new anywheresoftware.b4a.objects.B4XViewWrapper();
_p0 = _clv_prods_ll._getpanel(_index);
 //BA.debugLineNum = 2388;BA.debugLine="Private p As B4XView = p0.GetView(0)";
_p = new anywheresoftware.b4a.objects.B4XViewWrapper();
_p = _p0.GetView((int) (0));
 //BA.debugLineNum = 2389;BA.debugLine="Private cant1 As B4XView = p.GetView(2).GetView(";
_cant1 = new anywheresoftware.b4a.objects.B4XViewWrapper();
_cant1 = _p.GetView((int) (2)).GetView((int) (2));
 //BA.debugLineNum = 2390;BA.debugLine="Private PRDOX As B4XView = p.GetView(1)";
_prdox = new anywheresoftware.b4a.objects.B4XViewWrapper();
_prdox = _p.GetView((int) (1));
 //BA.debugLineNum = 2391;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 = 2394;BA.debugLine="Log(cant1.Text)";
__c.LogImpl("442205207",_cant1.getText(),0);
 //BA.debugLineNum = 2395;BA.debugLine="Dim prodx1() As String=Regex.Split(CRLF,PRDOX.Te";
_prodx1 = __c.Regex.Split(__c.CRLF,_prdox.getText());
 //BA.debugLineNum = 2396;BA.debugLine="Dim prodx3() As String=Regex.Split(\"\\$\",prodx1(1";
_prodx3 = __c.Regex.Split("\\$",_prodx1[(int) (1)]);
 //BA.debugLineNum = 2397;BA.debugLine="Log(prodx1(1))";
__c.LogImpl("442205210",_prodx1[(int) (1)],0);
 //BA.debugLineNum = 2399;BA.debugLine="preciodev = prodx3(1)";
_preciodev = (double)(Double.parseDouble(_prodx3[(int) (1)]));
 //BA.debugLineNum = 2400;BA.debugLine="nombredev = prodx1(0)";
_nombredev = _prodx1[(int) (0)];
 //BA.debugLineNum = 2402;BA.debugLine="Dim dev As Cursor = B4XPages.MainPage.skmt.ExecQ";
_dev = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_dev = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery(("select IFNULL(CAT_GP_DEV, 0) AS CAT_GP_DEV, CAT_GP_PRECIO from CAT_GUNAPROD where CAT_GP_NOMBRE  = '"+__c.SmartStringFormatter("",(Object)(_prodx1[(int) (0)]))+"'"))));
 //BA.debugLineNum = 2403;BA.debugLine="dev.Position = 0";
_dev.setPosition((int) (0));
 //BA.debugLineNum = 2404;BA.debugLine="If dev.GetInt(\"CAT_GP_DEV\") = 1 Then";
if (_dev.GetInt("CAT_GP_DEV")==1) { 
 //BA.debugLineNum = 2407;BA.debugLine="c.GetString(\"PC_MONTO\")";
_c.GetString("PC_MONTO");
 //BA.debugLineNum = 2410;BA.debugLine="If c.GetString(\"PC_MONTO\") < dev.GetInt(\"CAT_G";
if ((double)(Double.parseDouble(_c.GetString("PC_MONTO")))<_dev.GetInt("CAT_GP_PRECIO")) { 
 //BA.debugLineNum = 2411;BA.debugLine="MsgboxAsync(\"El monto de venta es menor al pr";
__c.MsgboxAsync(BA.ObjectToCharSequence("El monto de venta es menor al precio de este producto"),BA.ObjectToCharSequence("Atención"),ba);
 //BA.debugLineNum = 2412;BA.debugLine="Log(1)";
__c.LogImpl("442205225",BA.NumberToString(1),0);
 }else {
 //BA.debugLineNum = 2414;BA.debugLine="p_devo.Visible = True";
_p_devo.setVisible(__c.True);
 //BA.debugLineNum = 2415;BA.debugLine="p_devo.Height = Root.Height";
_p_devo.setHeight(_root.getHeight());
 //BA.debugLineNum = 2416;BA.debugLine="p_devo.Width = Root.Width";
_p_devo.setWidth(_root.getWidth());
 //BA.debugLineNum = 2417;BA.debugLine="l_proddev.Text = prodx1(0)";
_l_proddev.setText(BA.ObjectToCharSequence(_prodx1[(int) (0)]));
 //BA.debugLineNum = 2420;BA.debugLine="Dim devo As Cursor = B4XPages.MainPage.skmt.E";
_devo = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_devo = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery(("select SUM(IFNULL(PE_CANT,0)) as suma from PEDIDO where PE_PRONOMBRE  = '"+__c.SmartStringFormatter("",(Object)(_prodx1[(int) (0)]))+"' AND PE_CEDIS = 'DUR'"))));
 //BA.debugLineNum = 2421;BA.debugLine="devo.Position = 0";
_devo.setPosition((int) (0));
 //BA.debugLineNum = 2423;BA.debugLine="l_cantdev.Text = devo.GetInt(\"suma\")";
_l_cantdev.setText(BA.ObjectToCharSequence(_devo.GetInt("suma")));
 };
 }else if(_dev.GetInt("CAT_GP_DEV")==0) { 
 //BA.debugLineNum = 2433;BA.debugLine="MsgboxAsync(\"El producto no se puede devolver\",";
__c.MsgboxAsync(BA.ObjectToCharSequence("El producto no se puede devolver"),BA.ObjectToCharSequence("Atención"),ba);
 };
 }else {
 //BA.debugLineNum = 2439;BA.debugLine="MsgboxAsync(\"El Cliente no tiene venta para mete";
__c.MsgboxAsync(BA.ObjectToCharSequence("El Cliente no tiene venta para meter devoluciones"),BA.ObjectToCharSequence("Atención"),ba);
 };
 };
 };
 //BA.debugLineNum = 2445;BA.debugLine="End Sub";
return "";
}
public String  _llenacatalogo(String _subtipo1) throws Exception{
 //BA.debugLineNum = 609;BA.debugLine="Sub llenaCatalogo(subtipo1 As String)";
 //BA.debugLineNum = 632;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;
anywheresoftware.b4a.sql.SQL.CursorWrapper _coloressaldo = null;
anywheresoftware.b4a.sql.SQL.CursorWrapper _coloressaldo2 = 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 = 1843;BA.debugLine="Sub LlenaProdsLL(p As ResultSet)";
 //BA.debugLineNum = 1844;BA.debugLine="Log(\"Iniciamos LlenaProdsLL\")";
__c.LogImpl("441877505","Iniciamos LlenaProdsLL",0);
 //BA.debugLineNum = 1845;BA.debugLine="listaProds.Initialize";
_listaprods.Initialize();
 //BA.debugLineNum = 1846;BA.debugLine="If hayPedido Then 'Si hay pedido obtenemos las ca";
if (_haypedido) { 
 //BA.debugLineNum = 1847;BA.debugLine="Dim cantsMap As Map";
_cantsmap = new anywheresoftware.b4a.objects.collections.Map();
 //BA.debugLineNum = 1848;BA.debugLine="cantsMap.Initialize";
_cantsmap.Initialize();
 //BA.debugLineNum = 1849;BA.debugLine="If B4XPages.MainPage.tipo_venta = \"PREVENTA_FUTU";
if ((_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._tipo_venta /*String*/ ).equals("PREVENTA_FUTURA")) { 
 //BA.debugLineNum = 1850;BA.debugLine="Dim pe As ResultSet = B4XPages.MainPage.skmt.Ex";
_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 /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery(("select PE_PROID, PE_CANT 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 /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._tipo_venta /*String*/ ))+"' AND PE_FUTURO = '1' "))));
 }else {
 //BA.debugLineNum = 1852;BA.debugLine="Dim pe As ResultSet = B4XPages.MainPage.skmt.Ex";
_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 /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery(("select PE_PROID, PE_CANT 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 /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._tipo_venta /*String*/ ))+"' AND PE_FUTURO = '0' "))));
 };
 //BA.debugLineNum = 1855;BA.debugLine="Do While pe.NextRow";
while (_pe.NextRow()) {
 //BA.debugLineNum = 1856;BA.debugLine="Private cant As Int = 0";
_cant = (int) (0);
 //BA.debugLineNum = 1858;BA.debugLine="cantsMap.put(pe.GetString(\"PE_PROID\"), pe.GetS";
_cantsmap.Put((Object)(_pe.GetString("PE_PROID")),(Object)(_pe.GetString("PE_CANT")));
 //BA.debugLineNum = 1862;BA.debugLine="Log(clienteId &\"|||||\"&pe.GetString(\"PE_PROID\")";
__c.LogImpl("441877523",_clienteid+"|||||"+_pe.GetString("PE_PROID")+"|||||"+_pe.GetString("PE_CANT"),0);
 }
;
 //BA.debugLineNum = 1864;BA.debugLine="pe.Close";
_pe.Close();
 };
 //BA.debugLineNum = 1867;BA.debugLine="If p.IsInitialized Then";
if (_p.IsInitialized()) { 
 }else {
 //BA.debugLineNum = 1874;BA.debugLine="LogColor(Starter.tabla,Colors.blue)";
__c.LogImpl("441877535",_starter._tabla /*String*/ ,__c.Colors.Blue);
 //BA.debugLineNum = 1898;BA.debugLine="Dim coloressaldo As Cursor=B4XPages.MainPage.skm";
_coloressaldo = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_coloressaldo = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select IFNULL(CAT_CL_CLASIFICADOR2,0) AS CAT_CL_CLASIFICADOR2 from kmt_info3 where CAT_CL_CODIGO In (Select cuenta from cuentaa)")));
 //BA.debugLineNum = 1899;BA.debugLine="coloressaldo.Position = 0";
_coloressaldo.setPosition((int) (0));
 //BA.debugLineNum = 1901;BA.debugLine="If coloressaldo.GetString(\"CAT_CL_CLASIFICADOR2\"";
if ((_coloressaldo.GetString("CAT_CL_CLASIFICADOR2")).equals("LP222_D")) { 
 //BA.debugLineNum = 1902;BA.debugLine="Dim p As ResultSet = B4XPages.MainPage.skmt.Exe";
_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 /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery(("select distinct CAT_GP_ID, CAT_GP_NOMBRE, CAT_LISTAPRECIO, CAT_LISTAPRECIO, CAT_GP_ALMACEN, CAT_GP_IMG, CAT_GP_TIPOPROD, CAT_GP_INICIATIVA from "+__c.SmartStringFormatter("",(Object)(_subs._traetablaprods /*String*/ (ba,_tipo_venta)))+" where CAT_GP_PRECIO > 0 AND CAT_GP_ALMACEN > 0 and CAT_GP_TIPO <> 'PROMOS' and CAT_GP_TIPO <> 'PROMOCION'\n"+"	order by\n"+"		Case CAT_GP_TIPOPROD when 'PRIORITARIO' THEN 0\n"+"		WHEN 'ESTRATEGICO' THEN 1\n"+"		WHEN 'COMPLEMENTARIO' then 2\n"+"		Else 3\n"+"		End, CAT_GP_NOMBRE"))));
 }else {
 //BA.debugLineNum = 1910;BA.debugLine="Dim p As ResultSet = B4XPages.MainPage.skmt.Exe";
_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 /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery(("select distinct CAT_GP_ID, CAT_GP_NOMBRE, CAT_GP_PRECIO, CAT_LISTAPRECIO, CAT_GP_ALMACEN, CAT_GP_IMG, CAT_GP_TIPOPROD, CAT_GP_INICIATIVA from "+__c.SmartStringFormatter("",(Object)(_subs._traetablaprods /*String*/ (ba,_tipo_venta)))+" where CAT_GP_PRECIO > 0 AND CAT_GP_ALMACEN > 0 and CAT_GP_TIPO <> 'PROMOS' and CAT_GP_TIPO <> 'PROMOCION'\n"+"	order by\n"+"		Case CAT_GP_TIPOPROD when 'PRIORITARIO' THEN 0\n"+"		WHEN 'ESTRATEGICO' THEN 1\n"+"		WHEN 'COMPLEMENTARIO' then 2\n"+"		Else 3\n"+"		End, CAT_GP_NOMBRE"))));
 };
 };
 //BA.debugLineNum = 1940;BA.debugLine="Dim coloressaldo2 As Cursor=B4XPages.MainPage.skm";
_coloressaldo2 = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_coloressaldo2 = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select IFNULL(CAT_CL_CLASIFICADOR2,0) AS CAT_CL_CLASIFICADOR2 from kmt_info3 where CAT_CL_CODIGO In (Select cuenta from cuentaa)")));
 //BA.debugLineNum = 1941;BA.debugLine="coloressaldo2.Position = 0";
_coloressaldo2.setPosition((int) (0));
 //BA.debugLineNum = 1943;BA.debugLine="Do While p.NextRow";
while (_p.NextRow()) {
 //BA.debugLineNum = 1944;BA.debugLine="Private cant As Int = 0";
_cant = (int) (0);
 //BA.debugLineNum = 1945;BA.debugLine="If hayPedido And cantsMap.ContainsKey(p.GetStrin";
if (_haypedido && _cantsmap.ContainsKey((Object)(_p.GetString("CAT_GP_ID")))) { 
 //BA.debugLineNum = 1946;BA.debugLine="Log(p.GetString(\"CAT_GP_ID\"))";
__c.LogImpl("441877607",_p.GetString("CAT_GP_ID"),0);
 //BA.debugLineNum = 1947;BA.debugLine="cant = cantsMap.Get(p.GetString(\"CAT_GP_ID\"))";
_cant = (int)(BA.ObjectToNumber(_cantsmap.Get((Object)(_p.GetString("CAT_GP_ID")))));
 };
 //BA.debugLineNum = 1949;BA.debugLine="If coloressaldo2.GetString(\"CAT_CL_CLASIFICADOR2";
if ((_coloressaldo2.GetString("CAT_CL_CLASIFICADOR2")).equals("LP222_D")) { 
 //BA.debugLineNum = 1950;BA.debugLine="If p.GetString(\"CAT_GP_ID\") <> \"GUN141\" And p.G";
if ((_p.GetString("CAT_GP_ID")).equals("GUN141") == false && (_p.GetString("CAT_GP_ID")).equals("GUN142") == false) { 
 //BA.debugLineNum = 1953;BA.debugLine="Dim tempMap As Map = CreateMap( _";
_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_LISTAPRECIO")),(Object)("prioridad"),(Object)(_p.GetString("CAT_GP_TIPOPROD")),(Object)("almacen"),(Object)(_p.GetString("CAT_GP_ALMACEN")),(Object)("id"),(Object)(_p.GetString("CAT_GP_ID")),(Object)("cant"),(Object)(_cant),(Object)("conversion"),(Object)(1),(Object)("precio_caja"),(Object)(0),(Object)("b_caja"),(Object)(0)});
 //BA.debugLineNum = 1964;BA.debugLine="listaProds.Add(tempMap) ' Agregar el nuevo map";
_listaprods.Add((Object)(_tempmap.getObject()));
 };
 }else {
 //BA.debugLineNum = 1967;BA.debugLine="If p.GetString(\"CAT_GP_ID\") <> \"GUN141\" And p.G";
if ((_p.GetString("CAT_GP_ID")).equals("GUN141") == false && (_p.GetString("CAT_GP_ID")).equals("GUN142") == false) { 
 //BA.debugLineNum = 1970;BA.debugLine="Dim tempMap As Map = CreateMap( _";
_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)("prioridad"),(Object)(_p.GetString("CAT_GP_TIPOPROD")),(Object)("almacen"),(Object)(_p.GetString("CAT_GP_ALMACEN")),(Object)("id"),(Object)(_p.GetString("CAT_GP_ID")),(Object)("cant"),(Object)(_cant),(Object)("conversion"),(Object)(1),(Object)("precio_caja"),(Object)(0),(Object)("b_caja"),(Object)(0)});
 //BA.debugLineNum = 1981;BA.debugLine="listaProds.Add(tempMap) ' Agregar el nuevo map";
_listaprods.Add((Object)(_tempmap.getObject()));
 };
 };
 }
;
 //BA.debugLineNum = 1988;BA.debugLine="PCLV.Commit";
_pclv._commit /*String*/ ();
 //BA.debugLineNum = 1989;BA.debugLine="clv_prods_ll.Clear";
_clv_prods_ll._clear();
 //BA.debugLineNum = 1990;BA.debugLine="Private listaProdsConCant, listaProdsConCantIndex";
_listaprodsconcant = new anywheresoftware.b4a.objects.collections.List();
_listaprodsconcantindex = new anywheresoftware.b4a.objects.collections.List();
 //BA.debugLineNum = 1991;BA.debugLine="listaProdsConCant.Initialize";
_listaprodsconcant.Initialize();
 //BA.debugLineNum = 1992;BA.debugLine="listaProdsConCantIndex.Initialize";
_listaprodsconcantindex.Initialize();
 //BA.debugLineNum = 1993;BA.debugLine="listaHints.Initialize";
_listahints.Initialize();
 //BA.debugLineNum = 1994;BA.debugLine="For q=0 To listaProds.Size-1' quitamos los produc";
{
final int step55 = 1;
final int limit55 = (int) (_listaprods.getSize()-1);
_q = (int) (0) ;
for (;_q <= limit55 ;_q = _q + step55 ) {
 //BA.debugLineNum = 1995;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 = 1997;BA.debugLine="listaProdsConCant.Add(listaProds.Get(q))";
_listaprodsconcant.Add(_listaprods.Get(_q));
 //BA.debugLineNum = 1998;BA.debugLine="listaProdsConCantIndex.Add(q)";
_listaprodsconcantindex.Add((Object)(_q));
 };
 }
};
 //BA.debugLineNum = 2002;BA.debugLine="Private cont As Int = 0";
_cont = (int) (0);
 //BA.debugLineNum = 2003;BA.debugLine="For pr0=0 To listaProdsConCant.Size - 1 'Agregamo";
{
final int step62 = 1;
final int limit62 = (int) (_listaprodsconcant.getSize()-1);
_pr0 = (int) (0) ;
for (;_pr0 <= limit62 ;_pr0 = _pr0 + step62 ) {
 //BA.debugLineNum = 2004;BA.debugLine="Private Pnl As B4XView = xui.CreatePanel(\"\")";
_pnl = new anywheresoftware.b4a.objects.B4XViewWrapper();
_pnl = _xui.CreatePanel(ba,"");
 //BA.debugLineNum = 2006;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) (130)));
 //BA.debugLineNum = 2007;BA.debugLine="clv_prods_ll.Add(Pnl, listaProdsConCant.Get(pr0)";
_clv_prods_ll._add(_pnl,_listaprodsconcant.Get(_pr0));
 //BA.debugLineNum = 2008;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 = 2009;BA.debugLine="cont = cont + 1";
_cont = (int) (_cont+1);
 }
};
 //BA.debugLineNum = 2013;BA.debugLine="For pr=0 To listaProds.Size-1";
{
final int step69 = 1;
final int limit69 = (int) (_listaprods.getSize()-1);
_pr = (int) (0) ;
for (;_pr <= limit69 ;_pr = _pr + step69 ) {
 //BA.debugLineNum = 2014;BA.debugLine="If listaProdsConCantIndex.IndexOf(pr) = -1 Then";
if (_listaprodsconcantindex.IndexOf((Object)(_pr))==-1) { 
 //BA.debugLineNum = 2015;BA.debugLine="Private Pnl As B4XView = xui.CreatePanel(\"\")";
_pnl = new anywheresoftware.b4a.objects.B4XViewWrapper();
_pnl = _xui.CreatePanel(ba,"");
 //BA.debugLineNum = 2016;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) (130)));
 //BA.debugLineNum = 2017;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 = 2018;BA.debugLine="clv_prods_ll.Add(Pnl, listaProds.Get(pr))";
_clv_prods_ll._add(_pnl,_listaprods.Get(_pr));
 //BA.debugLineNum = 2020;BA.debugLine="cont = cont + 1";
_cont = (int) (_cont+1);
 };
 }
};
 //BA.debugLineNum = 2027;BA.debugLine="PCLV.B4XSeekBar1.MaxValue = clv_prods_ll.Size";
_pclv._b4xseekbar1 /*gunav2.keymon.com.mx.b4xseekbar*/ ._maxvalue /*int*/  = _clv_prods_ll._getsize();
 //BA.debugLineNum = 2028;BA.debugLine="PCLV.B4XSeekBar1.MinValue = 0";
_pclv._b4xseekbar1 /*gunav2.keymon.com.mx.b4xseekbar*/ ._minvalue /*int*/  = (int) (0);
 //BA.debugLineNum = 2029;BA.debugLine="PCLV.B4XSeekBar1.Interval = clv_prods_ll.Size/20";
_pclv._b4xseekbar1 /*gunav2.keymon.com.mx.b4xseekbar*/ ._interval /*int*/  = (int) (_clv_prods_ll._getsize()/(double)20);
 //BA.debugLineNum = 2030;BA.debugLine="PCLV.B4XSeekBar1.Value = clv_prods_ll.Size";
_pclv._b4xseekbar1 /*gunav2.keymon.com.mx.b4xseekbar*/ ._setvalue /*int*/ (_clv_prods_ll._getsize());
 //BA.debugLineNum = 2031;BA.debugLine="PCLV.B4XSeekBar1.Update";
_pclv._b4xseekbar1 /*gunav2.keymon.com.mx.b4xseekbar*/ ._update /*String*/ ();
 //BA.debugLineNum = 2033;BA.debugLine="reiniciarlistaProds = False";
_reiniciarlistaprods = __c.False;
 //BA.debugLineNum = 2034;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;
boolean _yacompropro2265 = false;
boolean _yacompropro3054 = false;
boolean _yacompropro3055 = false;
int _tipocliente = 0;
int _i = 0;
boolean _muestrapromo = false;
anywheresoftware.b4a.objects.collections.Map _tm = null;
 //BA.debugLineNum = 277;BA.debugLine="Sub lv_catalogos_ItemClick (Position As Int, Value";
 //BA.debugLineNum = 278;BA.debugLine="If Value = \"PORTAFOLIO\" Then";
if ((_value).equals((Object)("PORTAFOLIO"))) { 
 //BA.debugLineNum = 280;BA.debugLine="lfila.text = \"PRODUCTOS\"";
_lfila.setText(BA.ObjectToCharSequence("PRODUCTOS"));
 //BA.debugLineNum = 281;BA.debugLine="lv_catalogos.Visible = False";
_lv_catalogos.setVisible(__c.False);
 //BA.debugLineNum = 283;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 = 284;BA.debugLine="clv_prods_ll.AsView.Visible = True";
_clv_prods_ll._asview().setVisible(__c.True);
 //BA.debugLineNum = 285;BA.debugLine="If hayPedido Then p_botonesVenta.Visible = True";
if (_haypedido) { 
_p_botonesventa.setVisible(__c.True);};
 //BA.debugLineNum = 288;BA.debugLine="c = B4XPages.MainPage.skmt.ExecQuery(\"select IFN";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select IFNULL(sum(PE_CANT),0) as PC_NOART, IFNULL(sum (PE_COSTO_TOT),0) 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 = 289;BA.debugLine="If c.RowCount > 0 Then";
if (_c.getRowCount()>0) { 
 //BA.debugLineNum = 290;BA.debugLine="C.Position = 0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 291;BA.debugLine="Log($\"registros: ${c.RowCount}, arts: ${c.GetSt";
__c.LogImpl("440173582",("registros: "+__c.SmartStringFormatter("",(Object)(_c.getRowCount()))+", arts: "+__c.SmartStringFormatter("",(Object)(_c.GetString("PC_NOART")))+", monto:"+__c.SmartStringFormatter("",(Object)(_c.GetString("PC_MONTO")))+""),0);
 //BA.debugLineNum = 292;BA.debugLine="l_totProds.Text = \"Prods: \" & c.GetString(\"PC_N";
_l_totprods.setText(BA.ObjectToCharSequence("Prods: "+_c.GetString("PC_NOART")));
 //BA.debugLineNum = 293;BA.debugLine="l_total.Text = \"Total: $\" & c.GetString(\"PC_MON";
_l_total.setText(BA.ObjectToCharSequence("Total: $"+_c.GetString("PC_MONTO")));
 //BA.debugLineNum = 294;BA.debugLine="If l_total.Text = Null Or l_total.Text = \"null\"";
if (_l_total.getText()== null || (_l_total.getText()).equals("null") || (_l_total.getText()).equals("")) { 
_l_total.setText(BA.ObjectToCharSequence("Total: $0.0"));};
 //BA.debugLineNum = 295;BA.debugLine="If l_totProds.Text = Null Or l_totProds.Text =";
if (_l_totprods.getText()== null || (_l_totprods.getText()).equals("null") || (_l_totprods.getText()).equals("")) { 
_l_totprods.setText(BA.ObjectToCharSequence("Prods: 0"));};
 };
 }else {
 //BA.debugLineNum = 298;BA.debugLine="clv_prods_ll.AsView.Visible = False";
_clv_prods_ll._asview().setVisible(__c.False);
 //BA.debugLineNum = 299;BA.debugLine="lv_promos.Visible = True";
_lv_promos.setVisible(__c.True);
 //BA.debugLineNum = 300;BA.debugLine="lfila.text = \"PROMOCIONES\"";
_lfila.setText(BA.ObjectToCharSequence("PROMOCIONES"));
 //BA.debugLineNum = 301;BA.debugLine="lv_catalogos.Visible = False";
_lv_catalogos.setVisible(__c.False);
 //BA.debugLineNum = 321;BA.debugLine="lv_promos.Clear";
_lv_promos.Clear();
 //BA.debugLineNum = 322;BA.debugLine="lv_promos.Height = Root.Height * 0.65";
_lv_promos.setHeight((int) (_root.getHeight()*0.65));
 //BA.debugLineNum = 323;BA.debugLine="lv_promos.Width = Root.Width *0.96";
_lv_promos.setWidth((int) (_root.getWidth()*0.96));
 //BA.debugLineNum = 325;BA.debugLine="Dim label1 As Label";
_label1 = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 326;BA.debugLine="label1 = lv_promos.TwoLinesLayout.Label";
_label1 = _lv_promos.getTwoLinesLayout().Label;
 //BA.debugLineNum = 327;BA.debugLine="label1.TextSize = 20";
_label1.setTextSize((float) (20));
 //BA.debugLineNum = 328;BA.debugLine="label1.TextColor = Colors.White";
_label1.setTextColor(__c.Colors.White);
 //BA.debugLineNum = 329;BA.debugLine="label1.Color = Colors.ARGB(58,255,255,255)";
_label1.setColor(__c.Colors.ARGB((int) (58),(int) (255),(int) (255),(int) (255)));
 //BA.debugLineNum = 330;BA.debugLine="Dim label2 As Label";
_label2 = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 331;BA.debugLine="label2 = lv_promos.TwoLinesLayout.SecondLabel";
_label2 = _lv_promos.getTwoLinesLayout().SecondLabel;
 //BA.debugLineNum = 332;BA.debugLine="label2.TextSize = 20";
_label2.setTextSize((float) (20));
 //BA.debugLineNum = 333;BA.debugLine="label2.TextColor = Colors.White";
_label2.setTextColor(__c.Colors.White);
 //BA.debugLineNum = 334;BA.debugLine="label2.Color = Colors.ARGB(58,255,255,255)";
_label2.setColor(__c.Colors.ARGB((int) (58),(int) (255),(int) (255),(int) (255)));
 //BA.debugLineNum = 335;BA.debugLine="Dim label13 As Label";
_label13 = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 336;BA.debugLine="label13 = lv_promos.TwoLinesAndBitmap.Label";
_label13 = _lv_promos.getTwoLinesAndBitmap().Label;
 //BA.debugLineNum = 337;BA.debugLine="label13.TextSize = 20";
_label13.setTextSize((float) (20));
 //BA.debugLineNum = 338;BA.debugLine="label13.TextColor = Colors.White";
_label13.setTextColor(__c.Colors.White);
 //BA.debugLineNum = 339;BA.debugLine="label13.Color = Colors.ARGB(58,255,255,255)";
_label13.setColor(__c.Colors.ARGB((int) (58),(int) (255),(int) (255),(int) (255)));
 //BA.debugLineNum = 340;BA.debugLine="Dim label14 As Label";
_label14 = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 341;BA.debugLine="label14 = lv_promos.TwoLinesAndBitmap.SecondLabe";
_label14 = _lv_promos.getTwoLinesAndBitmap().SecondLabel;
 //BA.debugLineNum = 342;BA.debugLine="label14.TextSize = 20";
_label14.setTextSize((float) (20));
 //BA.debugLineNum = 343;BA.debugLine="label14.TextColor = Colors.White";
_label14.setTextColor(__c.Colors.White);
 //BA.debugLineNum = 344;BA.debugLine="label14.Color = Colors.ARGB(58,255,255,255)";
_label14.setColor(__c.Colors.ARGB((int) (58),(int) (255),(int) (255),(int) (255)));
 //BA.debugLineNum = 355;BA.debugLine="If B4XPages.MainPage.tipo_venta = \"PREVENTA_FUTU";
if ((_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._tipo_venta /*String*/ ).equals("PREVENTA_FUTURA")) { 
 //BA.debugLineNum = 356;BA.debugLine="c2=B4XPages.MainPage.skmt.ExecQuery2($\"select";
_c2 = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery2(("select  CAT_GP_ID, CAT_GP_NOMBRE, CAT_GP_PRECIO, CAT_GP_ALMACEN, CAT_GP_IMG, CAT_PA_BSEGMENTA, CAT_PA_SEGMENTAV 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) AND PE_FUTURO = '1' )"),new String[]{"PROMOS","PROMOS"})));
 }else {
 //BA.debugLineNum = 358;BA.debugLine="c2=B4XPages.MainPage.skmt.ExecQuery2($\"select";
_c2 = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery2(("select  CAT_GP_ID, CAT_GP_NOMBRE, CAT_GP_PRECIO, CAT_GP_ALMACEN, CAT_GP_IMG, CAT_PA_BSEGMENTA, CAT_PA_SEGMENTAV 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) AND PE_FUTURO = '0' )"),new String[]{"PROMOS","PROMOS"})));
 };
 //BA.debugLineNum = 362;BA.debugLine="Private yaComproPRO2265 As Boolean = Subs.revisa";
_yacompropro2265 = _subs._revisapro2265 /*boolean*/ (ba,_subs._traecliente /*String*/ (ba));
 //BA.debugLineNum = 363;BA.debugLine="Private yaComproPRO3054 As Boolean = Subs.revisa";
_yacompropro3054 = _subs._revisapro3054 /*boolean*/ (ba,_subs._traecliente /*String*/ (ba));
 //BA.debugLineNum = 364;BA.debugLine="Private yaComproPRO3055 As Boolean = Subs.revisa";
_yacompropro3055 = _subs._revisapro3055 /*boolean*/ (ba,_subs._traecliente /*String*/ (ba));
 //BA.debugLineNum = 365;BA.debugLine="Private tipoCliente As Int = Subs.traeTipoClient";
_tipocliente = _subs._traetipocliente /*int*/ (ba);
 //BA.debugLineNum = 366;BA.debugLine="Log(c2.RowCount)";
__c.LogImpl("440173657",BA.NumberToString(_c2.getRowCount()),0);
 //BA.debugLineNum = 367;BA.debugLine="If c2.RowCount > 0 Then";
if (_c2.getRowCount()>0) { 
 //BA.debugLineNum = 385;BA.debugLine="For i=0 To c2.RowCount - 1";
{
final int step55 = 1;
final int limit55 = (int) (_c2.getRowCount()-1);
_i = (int) (0) ;
for (;_i <= limit55 ;_i = _i + step55 ) {
 //BA.debugLineNum = 386;BA.debugLine="c2.Position = i";
_c2.setPosition(_i);
 //BA.debugLineNum = 387;BA.debugLine="Private muestraPromo As Boolean = True";
_muestrapromo = __c.True;
 //BA.debugLineNum = 388;BA.debugLine="Log($\"SEGMENTADA: ${c2.GetString(\"CAT_PA_BSEGM";
__c.LogImpl("440173679",("SEGMENTADA: "+__c.SmartStringFormatter("",(Object)(_c2.GetString("CAT_PA_BSEGMENTA")))+""),0);
 //BA.debugLineNum = 389;BA.debugLine="If c2.GetInt(\"CAT_PA_BSEGMENTA\") = 1 Then";
if (_c2.GetInt("CAT_PA_BSEGMENTA")==1) { 
 //BA.debugLineNum = 390;BA.debugLine="LogColor(\"#######   PROMO SEGMENTADA ####  \"&";
__c.LogImpl("440173681","#######   PROMO SEGMENTADA ####  "+_c2.GetString("CAT_GP_ID"),__c.Colors.Blue);
 //BA.debugLineNum = 391;BA.debugLine="LogColor($\"#######   SEGV: ${c2.GetString(\"CA";
__c.LogImpl("440173682",("#######   SEGV: "+__c.SmartStringFormatter("",(Object)(_c2.GetString("CAT_PA_SEGMENTAV")))+" ####"),__c.Colors.Blue);
 //BA.debugLineNum = 392;BA.debugLine="LogColor($\"#######   TIPOCLIE: ${tipoCliente}";
__c.LogImpl("440173683",("#######   TIPOCLIE: "+__c.SmartStringFormatter("",(Object)(_tipocliente))+" ####"),__c.Colors.Blue);
 //BA.debugLineNum = 393;BA.debugLine="LogColor($\"#######   ¿ENTRA?: ${c2.GetString(";
__c.LogImpl("440173684",("#######   ¿ENTRA?: "+__c.SmartStringFormatter("",(Object)(_c2.GetString("CAT_PA_SEGMENTAV").contains(BA.NumberToString(_tipocliente))))+" ####"),__c.Colors.Blue);
 //BA.debugLineNum = 394;BA.debugLine="If Not(c2.GetString(\"CAT_PA_SEGMENTAV\").Conta";
if (__c.Not(_c2.GetString("CAT_PA_SEGMENTAV").contains(BA.NumberToString(_tipocliente)))) { 
_muestrapromo = __c.False;};
 };
 //BA.debugLineNum = 400;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"),_subs._traecliente /*String*/ (ba));
 //BA.debugLineNum = 401;BA.debugLine="Log($\"TM=${tm}\"$)";
__c.LogImpl("440173692",("TM="+__c.SmartStringFormatter("",(Object)(_tm.getObject()))+""),0);
 //BA.debugLineNum = 402;BA.debugLine="If tm.Get(\"status\") = \"ok\" Then 'Solo muestral";
if ((_tm.Get((Object)("status"))).equals((Object)("ok"))) { 
 //BA.debugLineNum = 403;BA.debugLine="If yaComproPRO2265 And c2.GetString(\"CAT_GP_I";
if (_yacompropro2265 && (_c2.GetString("CAT_GP_ID")).equals("PRO3015")) { 
 //BA.debugLineNum = 404;BA.debugLine="LogColor(\"Ya compro la PRO2265, ya no se mue";
__c.LogImpl("440173695","Ya compro la PRO2265, ya no se muestra la PRO3015",__c.Colors.Red);
 }else {
 //BA.debugLineNum = 406;BA.debugLine="If (yaComproPRO3054 And c2.GetString(\"CAT_GP";
if ((_yacompropro3054 && (_c2.GetString("CAT_GP_ID")).equals("PRO3054")) || (_yacompropro3055 && (_c2.GetString("CAT_GP_ID")).equals("PRO3055"))) { 
 //BA.debugLineNum = 408;BA.debugLine="LogColor(\"Ya compro prods de la PRO3054 o P";
__c.LogImpl("440173699","Ya compro prods de la PRO3054 o PRO3055 o es cliente nuevo, ya no se muestra.",__c.Colors.Red);
 }else {
 //BA.debugLineNum = 410;BA.debugLine="If Subs.traeAlmacen = 88 Then";
if ((_subs._traealmacen /*String*/ (ba)).equals(BA.NumberToString(88))) { 
 //BA.debugLineNum = 411;BA.debugLine="Log(\"SI ENTRE1\")";
__c.LogImpl("440173702","SI ENTRE1",0);
 //BA.debugLineNum = 412;BA.debugLine="Log(c2.GetString(\"CAT_GP_ID\"))";
__c.LogImpl("440173703",_c2.GetString("CAT_GP_ID"),0);
 //BA.debugLineNum = 413;BA.debugLine="If c2.GetString(\"CAT_GP_ID\") = \"MYKONOS_01";
if ((_c2.GetString("CAT_GP_ID")).equals("MYKONOS_01") && _subs._traemontoprod /*boolean*/ (ba)) { 
 //BA.debugLineNum = 414;BA.debugLine="Log(\"SI ENTRE\")";
__c.LogImpl("440173705","SI ENTRE",0);
 //BA.debugLineNum = 415;BA.debugLine="If muestraPromo Then lv_promos.AddTwoLine";
if (_muestrapromo) { 
_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 if((_c2.GetString("CAT_GP_ID")).equals("MYKONOS_01") == false) { 
 //BA.debugLineNum = 417;BA.debugLine="Log(\"SI ENTRE2\")";
__c.LogImpl("440173708","SI ENTRE2",0);
 //BA.debugLineNum = 418;BA.debugLine="If muestraPromo Then lv_promos.AddTwoLine";
if (_muestrapromo) { 
_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 = 421;BA.debugLine="Log(\"SI ENTRE3\")";
__c.LogImpl("440173712","SI ENTRE3",0);
 //BA.debugLineNum = 422;BA.debugLine="If muestraPromo Then lv_promos.AddTwoLines";
if (_muestrapromo) { 
_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")))));};
 };
 //BA.debugLineNum = 424;BA.debugLine="Log($\"################################${CRL";
__c.LogImpl("440173715",("################################"+__c.SmartStringFormatter("",(Object)(__c.CRLF))+"       "+__c.SmartStringFormatter("",(Object)(_muestrapromo))+""+__c.SmartStringFormatter("",(Object)(__c.CRLF))+"################################"),0);
 };
 };
 };
 }
};
 //BA.debugLineNum = 435;BA.debugLine="label1.Height = 50dip";
_label1.setHeight(__c.DipToCurrent((int) (50)));
 //BA.debugLineNum = 436;BA.debugLine="label2.Height = 45dip";
_label2.setHeight(__c.DipToCurrent((int) (45)));
 //BA.debugLineNum = 437;BA.debugLine="label2.Top = label1.Height";
_label2.setTop(_label1.getHeight());
 //BA.debugLineNum = 438;BA.debugLine="lv_promos.TwoLinesLayout.ItemHeight = 95dip";
_lv_promos.getTwoLinesLayout().setItemHeight(__c.DipToCurrent((int) (95)));
 //BA.debugLineNum = 439;BA.debugLine="Subs.SetDivider(lv_promos, Colors.White, 2)";
_subs._setdivider /*String*/ (ba,_lv_promos,__c.Colors.White,(int) (2));
 }else {
 //BA.debugLineNum = 441;BA.debugLine="ToastMessageShow(\"No hay PROMOS disponibles.\",";
__c.ToastMessageShow(BA.ObjectToCharSequence("No hay PROMOS disponibles."),__c.False);
 };
 //BA.debugLineNum = 443;BA.debugLine="c2.Close";
_c2.Close();
 //BA.debugLineNum = 444;BA.debugLine="entro = \"4\"";
_entro = "4";
 };
 //BA.debugLineNum = 446;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(gunav2.keymon.com.mx.c_productos parent,int _position,Object _value) {
this.parent = parent;
this._position = _position;
this._value = _value;
}
gunav2.keymon.com.mx.c_productos parent;
int _position;
Object _value;
gunav2.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 step58;
int limit58;

@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 = 449;BA.debugLine="clv_prods_ll.AsView.Visible = False";
parent._clv_prods_ll._asview().setVisible(parent.__c.False);
 //BA.debugLineNum = 450;BA.debugLine="BUSCA.Text = \"\"";
parent._busca.setText(BA.ObjectToCharSequence(""));
 //BA.debugLineNum = 451;BA.debugLine="Dim cliente As C_Cliente = B4XPages.GetPage(\"Clie";
_cliente = (gunav2.keymon.com.mx.c_cliente)(parent._b4xpages._getpage /*Object*/ (ba,"Cliente"));
 //BA.debugLineNum = 452;BA.debugLine="Log($\"value=${Value}\"$)";
parent.__c.LogImpl("440239108",("value="+parent.__c.SmartStringFormatter("",_value)+""),0);
 //BA.debugLineNum = 453;BA.debugLine="If Value = \"PROMOCIONES\" And cliente.cuenta <> \"N";
if (true) break;

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

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

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

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

case 8:
//C
this.state = 11;
 //BA.debugLineNum = 462;BA.debugLine="LogColor(\"Promos\", Colors.red)";
parent.__c.LogImpl("440239118","Promos",parent.__c.Colors.Red);
 //BA.debugLineNum = 463;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 /*gunav2.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[]{"PROMOS",parent._marca,parent._tipo})));
 if (true) break;

case 10:
//C
this.state = 11;
 //BA.debugLineNum = 465;BA.debugLine="LogColor(\"Catalogo\", Colors.red)";
parent.__c.LogImpl("440239121","Catalogo",parent.__c.Colors.Red);
 //BA.debugLineNum = 466;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 /*gunav2.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 = 488;BA.debugLine="If Value = \"PORTAFOLIO\" Then";

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

case 13:
//C
this.state = 28;
 //BA.debugLineNum = 489;BA.debugLine="lv_catalogos.Visible = False";
parent._lv_catalogos.setVisible(parent.__c.False);
 //BA.debugLineNum = 490;BA.debugLine="lv_promos.Visible = False";
parent._lv_promos.setVisible(parent.__c.False);
 //BA.debugLineNum = 491;BA.debugLine="lfila.text = \"PORTAFOLIO\"";
parent._lfila.setText(BA.ObjectToCharSequence("PORTAFOLIO"));
 //BA.debugLineNum = 492;BA.debugLine="Log(\"PGS\")";
parent.__c.LogImpl("440239148","PGS",0);
 //BA.debugLineNum = 493;BA.debugLine="ProgressDialogShow(\"Cargando catalogo ...\")";
parent.__c.ProgressDialogShow(ba,BA.ObjectToCharSequence("Cargando catalogo ..."));
 //BA.debugLineNum = 494;BA.debugLine="Sleep(100)";
parent.__c.Sleep(ba,this,(int) (100));
this.state = 29;
return;
case 29:
//C
this.state = 28;
;
 //BA.debugLineNum = 495;BA.debugLine="Private inicioContador As String = DateTime.Now";
_iniciocontador = BA.NumberToString(parent.__c.DateTime.getNow());
 //BA.debugLineNum = 496;BA.debugLine="llenaCatalogo(False)";
parent._llenacatalogo(BA.ObjectToString(parent.__c.False));
 //BA.debugLineNum = 497;BA.debugLine="clv_prods_ll.AsView.Visible = True";
parent._clv_prods_ll._asview().setVisible(parent.__c.True);
 //BA.debugLineNum = 498;BA.debugLine="Log(\"PGH\")";
parent.__c.LogImpl("440239154","PGH",0);
 //BA.debugLineNum = 499;BA.debugLine="LogColor(\"TIEMPO DE PROCESO DEL CATALOGO: \" & ((";
parent.__c.LogImpl("440239155","TIEMPO DE PROCESO DEL CATALOGO: "+BA.NumberToString(((parent.__c.DateTime.getNow()-(double)(Double.parseDouble(_iniciocontador)))/(double)1000)),parent.__c.Colors.Red);
 //BA.debugLineNum = 500;BA.debugLine="ProgressDialogHide";
parent.__c.ProgressDialogHide();
 //BA.debugLineNum = 501;BA.debugLine="c2.Close";
parent._c2.Close();
 if (true) break;

case 15:
//C
this.state = 16;
 //BA.debugLineNum = 503;BA.debugLine="Log(\"ENTRAMOS A PROMOS\")";
parent.__c.LogImpl("440239159","ENTRAMOS A PROMOS",0);
 //BA.debugLineNum = 504;BA.debugLine="clv_prods_ll.AsView.Visible = False";
parent._clv_prods_ll._asview().setVisible(parent.__c.False);
 //BA.debugLineNum = 505;BA.debugLine="lv_promos.Visible = True";
parent._lv_promos.setVisible(parent.__c.True);
 //BA.debugLineNum = 506;BA.debugLine="lv_catalogos.Visible = False";
parent._lv_catalogos.setVisible(parent.__c.False);
 //BA.debugLineNum = 507;BA.debugLine="lv_promos.Clear";
parent._lv_promos.Clear();
 //BA.debugLineNum = 508;BA.debugLine="Dim label1 As Label";
_label1 = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 509;BA.debugLine="label1 = lv_promos.TwoLinesLayout.Label";
_label1 = parent._lv_promos.getTwoLinesLayout().Label;
 //BA.debugLineNum = 510;BA.debugLine="label1.TextSize = 15";
_label1.setTextSize((float) (15));
 //BA.debugLineNum = 511;BA.debugLine="label1.TextColor = Colors.Black";
_label1.setTextColor(parent.__c.Colors.Black);
 //BA.debugLineNum = 512;BA.debugLine="Dim label2 As Label";
_label2 = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 513;BA.debugLine="label2 = lv_promos.TwoLinesLayout.SecondLabel";
_label2 = parent._lv_promos.getTwoLinesLayout().SecondLabel;
 //BA.debugLineNum = 514;BA.debugLine="label2.TextSize = 15";
_label2.setTextSize((float) (15));
 //BA.debugLineNum = 515;BA.debugLine="label2.TextColor = Colors.Black";
_label2.setTextColor(parent.__c.Colors.Black);
 //BA.debugLineNum = 516;BA.debugLine="Dim label13 As Label";
_label13 = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 517;BA.debugLine="label13 = lv_promos.TwoLinesAndBitmap.Label";
_label13 = parent._lv_promos.getTwoLinesAndBitmap().Label;
 //BA.debugLineNum = 518;BA.debugLine="label13.TextSize = 15";
_label13.setTextSize((float) (15));
 //BA.debugLineNum = 519;BA.debugLine="label13.TextColor = Colors.Black";
_label13.setTextColor(parent.__c.Colors.Black);
 //BA.debugLineNum = 520;BA.debugLine="Dim label14 As Label";
_label14 = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 521;BA.debugLine="label14 = lv_promos.TwoLinesAndBitmap.SecondLabe";
_label14 = parent._lv_promos.getTwoLinesAndBitmap().SecondLabel;
 //BA.debugLineNum = 522;BA.debugLine="label14.TextSize = 15";
_label14.setTextSize((float) (15));
 //BA.debugLineNum = 523;BA.debugLine="label14.TextColor = Colors.Black";
_label14.setTextColor(parent.__c.Colors.Black);
 //BA.debugLineNum = 524;BA.debugLine="lfila.text = \"PROMOCIONES\"";
parent._lfila.setText(BA.ObjectToCharSequence("PROMOCIONES"));
 //BA.debugLineNum = 525;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 = 526;BA.debugLine="For i=0 To c2.RowCount -1";
if (true) break;

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

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

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

case 21:
//C
this.state = 22;
 //BA.debugLineNum = 527;BA.debugLine="c2.Position=i";
parent._c2.setPosition(_i);
 //BA.debugLineNum = 528;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 = 529;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 = 530;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 = 578;BA.debugLine="c2.Close";
parent._c2.Close();
 if (true) break;

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

            }
        }
    }
}
public String  _lv_prodspedido_itemlongclick(int _position,Object _value) throws Exception{
String[] _x = null;
String _nom = "";
int _i = 0;
String _cedis = "";
String _sdate = "";
String _stime = "";
String _clie_id = "";
String _usuario = "";
int _j = 0;
 //BA.debugLineNum = 1388;BA.debugLine="Private Sub lv_prodsPedido_ItemLongClick (Position";
 //BA.debugLineNum = 1389;BA.debugLine="Log(Value)";
__c.LogImpl("441549825",BA.ObjectToString(_value),0);
 //BA.debugLineNum = 1390;BA.debugLine="Private X() As String = Regex.Split(\" \", Value)";
_x = __c.Regex.Split(" ",BA.ObjectToString(_value));
 //BA.debugLineNum = 1391;BA.debugLine="Log(X.Length)";
__c.LogImpl("441549827",BA.NumberToString(_x.length),0);
 //BA.debugLineNum = 1392;BA.debugLine="Private nom As String = \"\"";
_nom = "";
 //BA.debugLineNum = 1393;BA.debugLine="For i = 0 To X.Length -1";
{
final int step5 = 1;
final int limit5 = (int) (_x.length-1);
_i = (int) (0) ;
for (;_i <= limit5 ;_i = _i + step5 ) {
 //BA.debugLineNum = 1394;BA.debugLine="If X(i).Contains(CRLF) Then";
if (_x[_i].contains(__c.CRLF)) { 
 };
 //BA.debugLineNum = 1396;BA.debugLine="If Not(X(i).Contains(CRLF)) Then";
if (__c.Not(_x[_i].contains(__c.CRLF))) { 
 //BA.debugLineNum = 1397;BA.debugLine="nom = nom & \" \" & X(i)";
_nom = _nom+" "+_x[_i];
 }else {
 //BA.debugLineNum = 1399;BA.debugLine="Exit";
if (true) break;
 };
 }
};
 //BA.debugLineNum = 1402;BA.debugLine="nom = nom.Trim";
_nom = _nom.trim();
 //BA.debugLineNum = 1403;BA.debugLine="Private cedis As String = X(X.Length-1)";
_cedis = _x[(int) (_x.length-1)];
 //BA.debugLineNum = 1404;BA.debugLine="Log(nom)";
__c.LogImpl("441549840",_nom,0);
 //BA.debugLineNum = 1405;BA.debugLine="Log(cedis)";
__c.LogImpl("441549841",_cedis,0);
 //BA.debugLineNum = 1406;BA.debugLine="Private sDate,sTime, clie_id, usuario As String";
_sdate = "";
_stime = "";
_clie_id = "";
_usuario = "";
 //BA.debugLineNum = 1408;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 = 1409;BA.debugLine="If result = DialogResponse.POSITIVE Then";
if ((_result).equals(BA.NumberToString(__c.DialogResponse.POSITIVE))) { 
 //BA.debugLineNum = 1410;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 /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery2("select PE_PROID,PE_CANT, PE_FOLIO FROM PEDIDO where pe_pronombre = ? and pe_cliente in (Select CUENTA from cuentaa) ",new String[]{BA.ObjectToString(_value)})));
 //BA.debugLineNum = 1411;BA.debugLine="c.Position=0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 1412;BA.debugLine="Log(vamoaver.Get(Position))";
__c.LogImpl("441549848",BA.ObjectToString(_vamoaver.Get(_position)),0);
 //BA.debugLineNum = 1413;BA.debugLine="If vamoaver.Get(Position) = \"VENTA\" Then";
if ((_vamoaver.Get(_position)).equals((Object)("VENTA"))) { 
 //BA.debugLineNum = 1414;BA.debugLine="Log(\"CAT_GUNAPROD2\")";
__c.LogImpl("441549850","CAT_GUNAPROD2",0);
 //BA.debugLineNum = 1415;BA.debugLine="Log(Position)";
__c.LogImpl("441549851",BA.NumberToString(_position),0);
 //BA.debugLineNum = 1416;BA.debugLine="Log(Value)";
__c.LogImpl("441549852",BA.ObjectToString(_value),0);
 //BA.debugLineNum = 1417;BA.debugLine="Starter.tabla = \"CAT_GUNAPROD2\"";
_starter._tabla /*String*/  = "CAT_GUNAPROD2";
 }else {
 //BA.debugLineNum = 1419;BA.debugLine="Log(\"CAT_GUNAPROD\")";
__c.LogImpl("441549855","CAT_GUNAPROD",0);
 //BA.debugLineNum = 1420;BA.debugLine="Log(Position)";
__c.LogImpl("441549856",BA.NumberToString(_position),0);
 //BA.debugLineNum = 1421;BA.debugLine="Log(Value)";
__c.LogImpl("441549857",BA.ObjectToString(_value),0);
 //BA.debugLineNum = 1422;BA.debugLine="Starter.tabla = \"CAT_GUNAPROD\"";
_starter._tabla /*String*/  = "CAT_GUNAPROD";
 };
 //BA.debugLineNum = 1481;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery($\"select PE_P";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery(("select PE_PROID,PE_CANT, PE_FOLIO, PE_CEDIS, PE_PRONOMBRE FROM PEDIDO where (pe_pronombre = '"+__c.SmartStringFormatter("",(Object)(_nom))+"' or pe_pronombre = '"+__c.SmartStringFormatter("",(Object)(_nom))+" ') AND PE_CEDIS = '"+__c.SmartStringFormatter("",(Object)(_cedis))+"' and pe_cliente in (Select CUENTA from cuentaa)"))));
 //BA.debugLineNum = 1482;BA.debugLine="Log($\"select PE_PROID,PE_CANT, PE_FOLIO, PE_CEDI";
__c.LogImpl("441549918",("select PE_PROID,PE_CANT, PE_FOLIO, PE_CEDIS FROM PEDIDO where pe_pronombre = '"+__c.SmartStringFormatter("",(Object)(_nom))+"' AND PE_CEDIS = '"+__c.SmartStringFormatter("",(Object)(_cedis))+"' and pe_cliente in (Select CUENTA from cuentaa)"),0);
 //BA.debugLineNum = 1483;BA.debugLine="Log(c.RowCount)";
__c.LogImpl("441549919",BA.NumberToString(_c.getRowCount()),0);
 //BA.debugLineNum = 1484;BA.debugLine="c.Position=0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 1487;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"INSERT INT";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("INSERT INTO INVENT_X_ENVIAR (ALMACEN , PROID , CANTIDAD) VALUES(?,?,?) ",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(_subs._traealmacen /*String*/ (ba)),(Object)(_c.GetString("PE_PROID")),(Object)((double)(Double.parseDouble(_c.GetString("PE_CANT")))*-1)}));
 //BA.debugLineNum = 1494;BA.debugLine="If Not(IsNumber(cedis)) Then";
if (__c.Not(__c.IsNumber(_cedis))) { 
 //BA.debugLineNum = 1495;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 /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery2("SELECT PE_CEDIS, PE_CANT,PE_PROID, PE_PRONOMBRE, PE_FOLIO FROM PEDIDO WHERE PE_CEDIS IN (SELECT PE_CEDIS FROM PEDIDO WHERE PE_CEDIS = ?)",new String[]{_cedis})));
 //BA.debugLineNum = 1497;BA.debugLine="LogColor(j3.RowCount,Colors.Yellow)";
__c.LogImpl("441549933",BA.NumberToString(_j3.getRowCount()),__c.Colors.Yellow);
 //BA.debugLineNum = 1498;BA.debugLine="If j3.RowCount > 0 Then";
if (_j3.getRowCount()>0) { 
 //BA.debugLineNum = 1499;BA.debugLine="Log(\"Soy promo\")";
__c.LogImpl("441549935","Soy promo",0);
 //BA.debugLineNum = 1500;BA.debugLine="For j = 0 To j3.RowCount -1";
{
final int step45 = 1;
final int limit45 = (int) (_j3.getRowCount()-1);
_j = (int) (0) ;
for (;_j <= limit45 ;_j = _j + step45 ) {
 //BA.debugLineNum = 1501;BA.debugLine="Log(\"aqui tronare?\")";
__c.LogImpl("441549937","aqui tronare?",0);
 //BA.debugLineNum = 1502;BA.debugLine="j3.Position = j";
_j3.setPosition(_j);
 //BA.debugLineNum = 1503;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery($\"update";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("update "+__c.SmartStringFormatter("",(Object)(_subs._traetablaprods /*String*/ (ba,_tipo_venta)))+" set cat_gp_almacen = cat_gp_almacen + "+__c.SmartStringFormatter("",(Object)(_j3.GetString("PE_CANT")))+" where cat_gp_id = '"+__c.SmartStringFormatter("",(Object)(_j3.GetString("PE_PROID")))+"'"));
 //BA.debugLineNum = 1504;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery($\"delete";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("delete from pedido where pe_cedis= '"+__c.SmartStringFormatter("",(Object)(_cedis))+"' and pe_cliente in (Select CUENTA from cuentaa) AND PE_FOLIO = '"+__c.SmartStringFormatter("",(Object)(_j3.GetString("PE_FOLIO")))+"' AND PE_PROID = '"+__c.SmartStringFormatter("",(Object)(_j3.GetString("PE_PROID")))+"'"));
 }
};
 //BA.debugLineNum = 1507;BA.debugLine="c = B4XPages.MainPage.skmt.ExecQuery(\"select s";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select sum(PE_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 = 1508;BA.debugLine="c.Position=0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 1509;BA.debugLine="If c.GetString(\"PC_NOART\") = Null Then";
if (_c.GetString("PC_NOART")== null) { 
 //BA.debugLineNum = 1510;BA.debugLine="l_cant.Text = 0";
_l_cant.setText(BA.ObjectToCharSequence(0));
 //BA.debugLineNum = 1511;BA.debugLine="l_total2.Text = 0";
_l_total2.setText(BA.ObjectToCharSequence(0));
 }else {
 //BA.debugLineNum = 1513;BA.debugLine="l_cant.Text = c.GetString(\"PC_NOART\")";
_l_cant.setText(BA.ObjectToCharSequence(_c.GetString("PC_NOART")));
 //BA.debugLineNum = 1514;BA.debugLine="l_total2.Text = c.GetString(\"PC_MONTO\")";
_l_total2.setText(BA.ObjectToCharSequence(_c.GetString("PC_MONTO")));
 };
 //BA.debugLineNum = 1516;BA.debugLine="c.Close";
_c.Close();
 };
 //BA.debugLineNum = 1518;BA.debugLine="j3.Close";
_j3.Close();
 }else {
 //BA.debugLineNum = 1521;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery($\"update ${";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("update "+__c.SmartStringFormatter("",(Object)(_subs._traetablaprods /*String*/ (ba,_tipo_venta)))+" set cat_gp_almacen = cat_gp_almacen + "+__c.SmartStringFormatter("",(Object)(_c.GetString("PE_CANT")))+" where cat_gp_id = '"+__c.SmartStringFormatter("",(Object)(_c.GetString("PE_PROID")))+"'"));
 //BA.debugLineNum = 1522;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"delete fr";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("delete from pedido where pe_pronombre = ? and pe_cedis = ? and pe_cliente in (Select CUENTA from cuentaa) AND PE_FOLIO = ?",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(_nom),(Object)(_cedis),(Object)(_c.GetString("PE_FOLIO"))}));
 //BA.debugLineNum = 1523;BA.debugLine="c = B4XPages.MainPage.skmt.ExecQuery(\"select su";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select sum(PE_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 = 1524;BA.debugLine="c.Position=0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 1525;BA.debugLine="If c.GetString(\"PC_NOART\") = Null Then";
if (_c.GetString("PC_NOART")== null) { 
 //BA.debugLineNum = 1526;BA.debugLine="l_cant.Text = 0";
_l_cant.setText(BA.ObjectToCharSequence(0));
 //BA.debugLineNum = 1527;BA.debugLine="l_total2.Text = 0";
_l_total2.setText(BA.ObjectToCharSequence(0));
 }else {
 //BA.debugLineNum = 1529;BA.debugLine="l_cant.Text = c.GetString(\"PC_NOART\")";
_l_cant.setText(BA.ObjectToCharSequence(_c.GetString("PC_NOART")));
 //BA.debugLineNum = 1530;BA.debugLine="l_total2.Text = c.GetString(\"PC_MONTO\")";
_l_total2.setText(BA.ObjectToCharSequence(_c.GetString("PC_MONTO")));
 };
 //BA.debugLineNum = 1532;BA.debugLine="c.Close";
_c.Close();
 };
 //BA.debugLineNum = 1534;BA.debugLine="c.Close";
_c.Close();
 //BA.debugLineNum = 1536;BA.debugLine="DateTime.DateFormat = \"MM/dd/yyyy\"";
__c.DateTime.setDateFormat("MM/dd/yyyy");
 //BA.debugLineNum = 1537;BA.debugLine="sDate=DateTime.Date(DateTime.Now)";
_sdate = __c.DateTime.Date(__c.DateTime.getNow());
 //BA.debugLineNum = 1538;BA.debugLine="sTime=DateTime.Time(DateTime.Now)";
_stime = __c.DateTime.Time(__c.DateTime.getNow());
 //BA.debugLineNum = 1539;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"Select CUENT";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("Select CUENTA from cuentaa")));
 //BA.debugLineNum = 1540;BA.debugLine="c.Position=0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 1541;BA.debugLine="clie_id = c.GetString(\"CUENTA\")";
_clie_id = _c.GetString("CUENTA");
 //BA.debugLineNum = 1542;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"select USUAR";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select USUARIO from usuarioa")));
 //BA.debugLineNum = 1543;BA.debugLine="c.Position=0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 1544;BA.debugLine="usuario = c.GetString(\"USUARIO\")";
_usuario = _c.GetString("USUARIO");
 //BA.debugLineNum = 1545;BA.debugLine="c=B4XPages.MainPage.skmt.ExecQuery(\"select sum(p";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select sum(pe_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 = 1546;BA.debugLine="c.Position=0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 1547;BA.debugLine="If c.GetString(\"CUANTOS\") > 0 Then";
if ((double)(Double.parseDouble(_c.GetString("CUANTOS")))>0) { 
 //BA.debugLineNum = 1548;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"delete fro";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("delete from pedido_cliente where PC_CLIENTE In (select cuenta from cuentaa)");
 //BA.debugLineNum = 1549;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"insert in";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("insert into pedido_cliente(PC_CLIENTE, PC_FECHA, PC_USER, PC_NOART, PC_MONTO,PC_LON, PC_LAT) VALUES (?,?,?,?,?,?,?)",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(_clie_id),(Object)(_sdate+_stime),(Object)(_usuario),(Object)(_c.GetString("CANT_CLIE")),(Object)(_c.GetString("TOTAL_CLIE")),(Object)(_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._lon_gps /*String*/ ),(Object)(_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._lat_gps /*String*/ )}));
 //BA.debugLineNum = 1550;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"UPDATE kmt";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("UPDATE kmt_info3 set gestion = 2  where CAT_CL_CODIGO In (select cuenta from cuentaa)");
 }else {
 //BA.debugLineNum = 1552;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"delete fro";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("delete from pedido_cliente where PC_CLIENTE In (select cuenta from cuentaa)");
 //BA.debugLineNum = 1553;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"UPDATE kmt";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("UPDATE kmt_info3 set gestion = 0  where CAT_CL_CODIGO In (select cuenta from cuentaa)");
 };
 //BA.debugLineNum = 1556;BA.debugLine="b_terminar1_Click";
_b_terminar1_click();
 };
 //BA.debugLineNum = 1561;BA.debugLine="End Sub";
return "";
}
public String  _lv_promos_itemclick(int _position,Object _value) throws Exception{
gunav2.keymon.com.mx.c_cliente _cliente = null;
gunav2.keymon.com.mx.c_promos _promos = null;
 //BA.debugLineNum = 583;BA.debugLine="Sub lv_promos_ItemClick (Position As Int, Value As";
 //BA.debugLineNum = 584;BA.debugLine="clv_prods_ll.AsView.Visible = False";
_clv_prods_ll._asview().setVisible(__c.False);
 //BA.debugLineNum = 585;BA.debugLine="Dim cliente As C_Cliente = B4XPages.GetPage(\"Clie";
_cliente = (gunav2.keymon.com.mx.c_cliente)(_b4xpages._getpage /*Object*/ (ba,"Cliente"));
 //BA.debugLineNum = 587;BA.debugLine="If Value = \"PROMOCIONES\" And cliente.cuenta <> \"N";
if ((_value).equals((Object)("PROMOCIONES")) && (_cliente._cuenta /*String*/ ).equals("N") == false) { 
 //BA.debugLineNum = 588;BA.debugLine="entro = \"3\"";
_entro = "3";
 //BA.debugLineNum = 589;BA.debugLine="marca = \"PROMOS\"";
_marca = "PROMOS";
 //BA.debugLineNum = 590;BA.debugLine="tipo = \"PROMOS\"";
_tipo = "PROMOS";
 }else if((_value).equals((Object)("PROMOCIONES")) && (_cliente._cuenta /*String*/ ).equals("N")) { 
 //BA.debugLineNum = 592;BA.debugLine="entro = \"5\"";
_entro = "5";
 //BA.debugLineNum = 593;BA.debugLine="B4XPages.ShowPage(\"Cliente\")";
_b4xpages._showpage /*String*/ (ba,"Cliente");
 };
 //BA.debugLineNum = 595;BA.debugLine="If entro = \"3\" Then";
if ((_entro).equals("3")) { 
 }else if((_entro).equals("4")) { 
 //BA.debugLineNum = 599;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery(\"delete from";
_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("delete from PROID");
 //BA.debugLineNum = 600;BA.debugLine="B4XPages.MainPage.skmt.ExecNonQuery2(\"INSERT INT";
_b4xpages._mainpage /*gunav2.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 = 601;BA.debugLine="Dim promos As C_Promos = B4XPages.GetPage(\"Promo";
_promos = (gunav2.keymon.com.mx.c_promos)(_b4xpages._getpage /*Object*/ (ba,"Promos"));
 //BA.debugLineNum = 602;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 = 603;BA.debugLine="promos.elCliente = Subs.traeUsuarioDeBD";
_promos._elcliente /*String*/  = _subs._traeusuariodebd /*String*/ (ba);
 //BA.debugLineNum = 604;BA.debugLine="B4XPages.ShowPage(\"Promos\")";
_b4xpages._showpage /*String*/ (ba,"Promos");
 };
 //BA.debugLineNum = 606;BA.debugLine="End Sub";
return "";
}
public String  _lv_promos_itemlongclick(int _position,Object _value) throws Exception{
String _id = "";
 //BA.debugLineNum = 1303;BA.debugLine="Private Sub lv_promos_ItemLongClick (Position As I";
 //BA.debugLineNum = 1304;BA.debugLine="Log(\"Promo longclic = \"&Value)";
__c.LogImpl("441156609","Promo longclic = "+BA.ObjectToString(_value),0);
 //BA.debugLineNum = 1305;BA.debugLine="Private id As String = \"\"";
_id = "";
 //BA.debugLineNum = 1306;BA.debugLine="Dim c As Cursor = B4XPages.MainPage.skmt.ExecQuer";
_c = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery(("select CAT_GP_ID from "+__c.SmartStringFormatter("",(Object)(_starter._tabla /*String*/ ))+" where CAT_GP_TIPO = 'PROMOS' and CAT_GP_NOMBRE = '"+__c.SmartStringFormatter("",_value)+"'"))));
 //BA.debugLineNum = 1307;BA.debugLine="If c.RowCount > 0 Then";
if (_c.getRowCount()>0) { 
 //BA.debugLineNum = 1308;BA.debugLine="c.Position = 0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 1309;BA.debugLine="id = c.GetString(\"CAT_GP_ID\")";
_id = _c.GetString("CAT_GP_ID");
 };
 //BA.debugLineNum = 1311;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 = 1312;BA.debugLine="l_info.Visible = True";
_l_info.setVisible(__c.True);
 //BA.debugLineNum = 1313;BA.debugLine="End Sub";
return "";
}
public String  _lv_subtipo_itemclick(int _position,Object _value) throws Exception{
 //BA.debugLineNum = 1340;BA.debugLine="Private Sub lv_subtipo_ItemClick (Position As Int,";
 //BA.debugLineNum = 1354;BA.debugLine="End Sub";
return "";
}
public String  _lv_tipo_itemclick(int _position,Object _value) throws Exception{
 //BA.debugLineNum = 1320;BA.debugLine="Private Sub lv_tipo_ItemClick (Position As Int, Va";
 //BA.debugLineNum = 1338;BA.debugLine="End Sub";
return "";
}
public String  _p_devo_click() throws Exception{
 //BA.debugLineNum = 2506;BA.debugLine="Private Sub p_devo_Click";
 //BA.debugLineNum = 2508;BA.debugLine="End Sub";
return "";
}
public String  _p_promodesc_click() throws Exception{
 //BA.debugLineNum = 2365;BA.debugLine="Private Sub p_promodesc_Click";
 //BA.debugLineNum = 2366;BA.debugLine="p_promodesc.Visible = False";
_p_promodesc.setVisible(__c.False);
 //BA.debugLineNum = 2367;BA.debugLine="End Sub";
return "";
}
public String  _p_vistapreviatrans_click() throws Exception{
 //BA.debugLineNum = 1356;BA.debugLine="Private Sub p_vistaPreviaTrans_Click";
 //BA.debugLineNum = 1358;BA.debugLine="End Sub";
return "";
}
public String  _pclv_addprods() throws Exception{
 //BA.debugLineNum = 273;BA.debugLine="Sub PCLV_AddProds";
 //BA.debugLineNum = 275;BA.debugLine="End Sub";
return "";
}
public Object  _pclv_hintrequested(int _index) throws Exception{
String _word = "";
 //BA.debugLineNum = 2037;BA.debugLine="Sub PCLV_HintRequested(Index As Int) As Object";
 //BA.debugLineNum = 2038;BA.debugLine="Dim word As String = listaHints.get(Index)";
_word = BA.ObjectToString(_listahints.Get(_index));
 //BA.debugLineNum = 2039;BA.debugLine="Return word";
if (true) return (Object)(_word);
 //BA.debugLineNum = 2040;BA.debugLine="End Sub";
return null;
}
public String  _terminarpromoesp() throws Exception{
int _i = 0;
String _pn = "";
 //BA.debugLineNum = 2343;BA.debugLine="Sub terminarpromoesp";
 //BA.debugLineNum = 2344;BA.debugLine="c2 = B4XPages.MainPage.skmt.ExecQuery($\"select *";
_c2 = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery(("select * from "+__c.SmartStringFormatter("",(Object)(_subs._traetablaprods /*String*/ (ba,_tipo_venta)))+" WHERE CAT_GP_ID IN (SELECT DISTINCT CAT_PE_IDPROMO FROM CAT_PROMO_ESP)"))));
 //BA.debugLineNum = 2345;BA.debugLine="If c2.RowCount > 0 Then";
if (_c2.getRowCount()>0) { 
 //BA.debugLineNum = 2346;BA.debugLine="c2.Position = 0";
_c2.setPosition((int) (0));
 //BA.debugLineNum = 2347;BA.debugLine="Subs.guardaProducto(c2.GetString(\"CAT_GP_ID\"), \"";
_subs._guardaproducto /*String*/ (ba,_c2.GetString("CAT_GP_ID"),"0",BA.NumberToString(1),_c2.GetString("CAT_GP_NOMBRE"),_c2.GetString("CAT_GP_ID"),_subs._traecliente /*String*/ (ba),_subs._traefecha /*String*/ (ba),_subs._traeusuariodebd /*String*/ (ba),_rutausuario,BA.NumberToString(0),_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._tipo_venta /*String*/ );
 //BA.debugLineNum = 2348;BA.debugLine="c = B4XPages.MainPage.skmt.ExecQuery(\"select * f";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select * from CAT_DETALLES_PAQ WHERE CAT_DP_ID IN (SELECT DISTINCT CAT_PE_IDPROMO FROM CAT_PROMO_ESP)")));
 //BA.debugLineNum = 2349;BA.debugLine="If c.RowCount > 0 Then";
if (_c.getRowCount()>0) { 
 //BA.debugLineNum = 2350;BA.debugLine="For i = 0 To c.RowCount - 1";
{
final int step7 = 1;
final int limit7 = (int) (_c.getRowCount()-1);
_i = (int) (0) ;
for (;_i <= limit7 ;_i = _i + step7 ) {
 //BA.debugLineNum = 2351;BA.debugLine="c.Position = i";
_c.setPosition(_i);
 //BA.debugLineNum = 2352;BA.debugLine="Private pn As String = Subs.traeProdNombre(c.G";
_pn = _subs._traeprodnombre /*String*/ (ba,_c.GetString("CAT_DP_IDPROD"));
 //BA.debugLineNum = 2353;BA.debugLine="Subs.guardaProducto(c2.GetString(\"CAT_GP_ID\"),";
_subs._guardaproducto /*String*/ (ba,_c2.GetString("CAT_GP_ID"),_c.GetString("CAT_DP_PRECIO"),_c.GetString("CAT_DP_PZAS"),_pn,_c.GetString("CAT_DP_IDPROD"),_subs._traecliente /*String*/ (ba),_subs._traefecha /*String*/ (ba),_subs._traeusuariodebd /*String*/ (ba),_rutausuario,BA.NumberToString(0),_b4xpages._mainpage /*gunav2.keymon.com.mx.b4xmainpage*/ (ba)._tipo_venta /*String*/ );
 }
};
 };
 //BA.debugLineNum = 2356;BA.debugLine="c.Close";
_c.Close();
 };
 //BA.debugLineNum = 2358;BA.debugLine="c2.Close";
_c2.Close();
 //BA.debugLineNum = 2359;BA.debugLine="End Sub";
return "";
}
public Object callSub(String sub, Object sender, Object[] args) throws Exception {
BA.senderHolder.set(sender);
if (BA.fastSubCompare(sub, "B4XPAGE_CREATED"))
	return _b4xpage_created((anywheresoftware.b4a.objects.B4XViewWrapper) args[0]);
return BA.SubDelegator.SubNotFound;
}
}
