package reparto_intmex.keymon.lat;


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

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

 
    public void  innerInitializeHelper(anywheresoftware.b4a.BA _ba) throws Exception{
        innerInitialize(_ba);
    }
    public Object callSub(String sub, Object sender, Object[] args) throws Exception {
        return BA.SubDelegator.SubNotFound;
    }
public anywheresoftware.b4a.keywords.Common __c = null;
public anywheresoftware.b4a.objects.B4XViewWrapper _root = null;
public anywheresoftware.b4a.objects.B4XViewWrapper.XUI _xui = null;
public anywheresoftware.b4a.gps.GPS _g = null;
public String _clie_id = "";
public String _sdate = "";
public String _stime = "";
public String _usuario = "";
public anywheresoftware.b4a.sql.SQL.CursorWrapper _c = null;
public anywheresoftware.b4a.objects.ButtonWrapper _b_regresar = null;
public anywheresoftware.b4a.objects.ListViewWrapper _listview1 = null;
public anywheresoftware.b4a.objects.LabelWrapper _l_cant = null;
public anywheresoftware.b4a.objects.LabelWrapper _l_total = null;
public anywheresoftware.b4a.objects.ButtonWrapper _b_borra = null;
public String _existe = "";
public String _result = "";
public String _cuantos = "";
public String _nombre_prod = "";
public String _cuantos_pedido = "";
public anywheresoftware.b4a.objects.LabelWrapper _titulo = null;
public anywheresoftware.b4a.objects.PanelWrapper _p1 = null;
public anywheresoftware.b4a.objects.ListViewWrapper _lv2 = null;
public anywheresoftware.b4a.objects.PanelWrapper _p_principal = null;
public b4a.example3.customlistview _clv_pedido = null;
public anywheresoftware.b4a.objects.PanelWrapper _p_prods = null;
public anywheresoftware.b4a.objects.LabelWrapper _l_prodx = null;
public anywheresoftware.b4a.objects.LabelWrapper _l_pcant = null;
public anywheresoftware.b4a.objects.EditTextWrapper _et_pcant = null;
public anywheresoftware.b4a.objects.drawable.CanvasWrapper.BitmapWrapper _bmp = null;
public boolean _etcanthasfocus = false;
public int _totalprods = 0;
public int _totalcompra = 0;
public anywheresoftware.b4a.objects.collections.Map _prodsmap = null;
public boolean _reconstruirpedido = false;
public String _promoaborrar = "";
public anywheresoftware.b4a.objects.ButtonWrapper _b_guardar = null;
public anywheresoftware.b4a.objects.ButtonWrapper _b_prodmas = null;
public anywheresoftware.b4a.objects.ButtonWrapper _b_prodmenos = null;
public b4a.example.dateutils _dateutils = null;
public reparto_intmex.keymon.lat.main _main = null;
public reparto_intmex.keymon.lat.appupdater _appupdater = null;
public reparto_intmex.keymon.lat.foto _foto = null;
public reparto_intmex.keymon.lat.mapa_cliente _mapa_cliente = null;
public reparto_intmex.keymon.lat.mapa_rutas _mapa_rutas = null;
public reparto_intmex.keymon.lat.starter _starter = null;
public reparto_intmex.keymon.lat.subs _subs = null;
public reparto_intmex.keymon.lat.tracker _tracker = null;
public reparto_intmex.keymon.lat.newinst2 _newinst2 = null;
public reparto_intmex.keymon.lat.b4xpages _b4xpages = null;
public reparto_intmex.keymon.lat.b4xcollections _b4xcollections = null;
public reparto_intmex.keymon.lat.httputils2service _httputils2service = null;
public reparto_intmex.keymon.lat.xuiviewsutils _xuiviewsutils = null;
public String  _b_guardar_click(reparto_intmex.keymon.lat.c_historico __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_historico";
if (Debug.shouldDelegate(ba, "b_guardar_click", false))
	 {return ((String) Debug.delegate(ba, "b_guardar_click", null));}
RDebugUtils.currentLine=50266112;
 //BA.debugLineNum = 50266112;BA.debugLine="Private Sub b_guardar_Click";
RDebugUtils.currentLine=50266114;
 //BA.debugLineNum = 50266114;BA.debugLine="End Sub";
return "";
}
public String  _b_prodmas_click(reparto_intmex.keymon.lat.c_historico __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_historico";
if (Debug.shouldDelegate(ba, "b_prodmas_click", false))
	 {return ((String) Debug.delegate(ba, "b_prodmas_click", null));}
int _index = 0;
anywheresoftware.b4a.objects.B4XViewWrapper _pnl0 = null;
anywheresoftware.b4a.objects.B4XViewWrapper _pnl = null;
anywheresoftware.b4a.objects.B4XViewWrapper _lacant = null;
anywheresoftware.b4a.objects.collections.List _estetag = null;
String _maxprods = "";
anywheresoftware.b4a.objects.collections.Map _cym = null;
RDebugUtils.currentLine=50135040;
 //BA.debugLineNum = 50135040;BA.debugLine="Sub b_prodMas_Click";
RDebugUtils.currentLine=50135041;
 //BA.debugLineNum = 50135041;BA.debugLine="etCantHasFocus = False";
__ref._etcanthasfocus /*boolean*/  = __c.False;
RDebugUtils.currentLine=50135043;
 //BA.debugLineNum = 50135043;BA.debugLine="LogColor(\"b_prodMas_Click\", Colors.Magenta)";
__c.LogImpl("250135043","b_prodMas_Click",__c.Colors.Magenta);
RDebugUtils.currentLine=50135044;
 //BA.debugLineNum = 50135044;BA.debugLine="Dim index As Int = clv_pedido.GetItemFromView(Sen";
_index = __ref._clv_pedido /*b4a.example3.customlistview*/ ._getitemfromview((anywheresoftware.b4a.objects.B4XViewWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.B4XViewWrapper(), (java.lang.Object)(__c.Sender(ba))));
RDebugUtils.currentLine=50135045;
 //BA.debugLineNum = 50135045;BA.debugLine="Dim pnl0 As B4XView = clv_pedido.GetPanel(index)";
_pnl0 = new anywheresoftware.b4a.objects.B4XViewWrapper();
_pnl0 = __ref._clv_pedido /*b4a.example3.customlistview*/ ._getpanel(_index);
RDebugUtils.currentLine=50135046;
 //BA.debugLineNum = 50135046;BA.debugLine="Dim pnl As B4XView = pnl0.GetView(0)";
_pnl = new anywheresoftware.b4a.objects.B4XViewWrapper();
_pnl = _pnl0.GetView((int) (0));
RDebugUtils.currentLine=50135047;
 //BA.debugLineNum = 50135047;BA.debugLine="Dim laCant As B4XView = pnl.GetView(2).GetView(3)";
_lacant = new anywheresoftware.b4a.objects.B4XViewWrapper();
_lacant = _pnl.GetView((int) (2)).GetView((int) (3));
RDebugUtils.currentLine=50135051;
 //BA.debugLineNum = 50135051;BA.debugLine="Dim esteTag As List = Regex.Split(\"\\|\", laCant.Ta";
_estetag = new anywheresoftware.b4a.objects.collections.List();
_estetag = anywheresoftware.b4a.keywords.Common.ArrayToList(__c.Regex.Split("\\|",BA.ObjectToString(_lacant.getTag())));
RDebugUtils.currentLine=50135052;
 //BA.debugLineNum = 50135052;BA.debugLine="Log(\"LC_TEXT:\"&laCant.Text&\"|LC_TAG:\"&laCant.Tag&";
__c.LogImpl("250135052","LC_TEXT:"+_lacant.getText()+"|LC_TAG:"+BA.ObjectToString(_lacant.getTag())+"|ET:"+BA.ObjectToString(_estetag),0);
RDebugUtils.currentLine=50135053;
 //BA.debugLineNum = 50135053;BA.debugLine="If laCant.Text = \"\" Then laCant.Text = 0";
if ((_lacant.getText()).equals("")) { 
_lacant.setText(BA.ObjectToCharSequence(0));};
RDebugUtils.currentLine=50135055;
 //BA.debugLineNum = 50135055;BA.debugLine="Private maxProds as string = esteTag.Get(1) + est";
_maxprods = BA.NumberToString((double)(BA.ObjectToNumber(_estetag.Get((int) (1))))+(double)(BA.ObjectToNumber(_estetag.Get((int) (4)))));
RDebugUtils.currentLine=50135057;
 //BA.debugLineNum = 50135057;BA.debugLine="LogColor($\"++++++++++++++++++++++++++   ${esteTag";
__c.LogImpl("250135057",("++++++++++++++++++++++++++   "+__c.SmartStringFormatter("",(Object)(_estetag.getObject()))+""),__c.Colors.Green);
RDebugUtils.currentLine=50135059;
 //BA.debugLineNum = 50135059;BA.debugLine="If laCant.Text + 1 <= maxProds Then";
if ((double)(Double.parseDouble(_lacant.getText()))+1<=(double)(Double.parseDouble(_maxprods))) { 
RDebugUtils.currentLine=50135060;
 //BA.debugLineNum = 50135060;BA.debugLine="Log($\"NuevaCant = ${laCant.Text + 1}\"$)";
__c.LogImpl("250135060",("NuevaCant = "+__c.SmartStringFormatter("",(Object)((double)(Double.parseDouble(_lacant.getText()))+1))+""),0);
RDebugUtils.currentLine=50135061;
 //BA.debugLineNum = 50135061;BA.debugLine="laCant.Text = $\"$1.0{laCant.Text + 1}\"$";
_lacant.setText(BA.ObjectToCharSequence((""+__c.SmartStringFormatter("1.0",(Object)((double)(Double.parseDouble(_lacant.getText()))+1))+"")));
RDebugUtils.currentLine=50135062;
 //BA.debugLineNum = 50135062;BA.debugLine="Starter.skmt.ExecNonQuery2(\"update cat_gunaprod";
_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("update cat_gunaprod set cat_gp_almacen = cat_gp_almacen - 1 where cat_gp_id = ?",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{_estetag.Get((int) (2))}));
RDebugUtils.currentLine=50135063;
 //BA.debugLineNum = 50135063;BA.debugLine="Subs.prodVenta(esteTag.Get(5), esteTag.Get(2))";
_subs._prodventa /*String*/ (ba,BA.ObjectToString(_estetag.Get((int) (5))),BA.ObjectToString(_estetag.Get((int) (2))));
RDebugUtils.currentLine=50135064;
 //BA.debugLineNum = 50135064;BA.debugLine="Private cym As Map = Subs.traemosCantYMonto(clv_";
_cym = new anywheresoftware.b4a.objects.collections.Map();
_cym = _subs._traemoscantymonto /*anywheresoftware.b4a.objects.collections.Map*/ (ba,__ref._clv_pedido /*b4a.example3.customlistview*/ );
RDebugUtils.currentLine=50135065;
 //BA.debugLineNum = 50135065;BA.debugLine="L_CANT.Text = cym.Get(\"cantidad\")";
__ref._l_cant /*anywheresoftware.b4a.objects.LabelWrapper*/ .setText(BA.ObjectToCharSequence(_cym.Get((Object)("cantidad"))));
RDebugUtils.currentLine=50135066;
 //BA.debugLineNum = 50135066;BA.debugLine="L_TOTAL.Text = Round2(cym.Get(\"monto\"), 2)";
__ref._l_total /*anywheresoftware.b4a.objects.LabelWrapper*/ .setText(BA.ObjectToCharSequence(__c.Round2((double)(BA.ObjectToNumber(_cym.Get((Object)("monto")))),(int) (2))));
 };
RDebugUtils.currentLine=50135083;
 //BA.debugLineNum = 50135083;BA.debugLine="End Sub";
return "";
}
public String  _b_prodmenos_click(reparto_intmex.keymon.lat.c_historico __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_historico";
if (Debug.shouldDelegate(ba, "b_prodmenos_click", false))
	 {return ((String) Debug.delegate(ba, "b_prodmenos_click", null));}
int _index = 0;
anywheresoftware.b4a.objects.B4XViewWrapper _pnl0 = null;
anywheresoftware.b4a.objects.B4XViewWrapper _pnl = null;
anywheresoftware.b4a.objects.B4XViewWrapper _lacant = null;
anywheresoftware.b4a.objects.collections.List _estetag = null;
float _preciou = 0f;
anywheresoftware.b4a.objects.collections.Map _cym = null;
RDebugUtils.currentLine=50069504;
 //BA.debugLineNum = 50069504;BA.debugLine="Sub b_prodMenos_Click";
RDebugUtils.currentLine=50069505;
 //BA.debugLineNum = 50069505;BA.debugLine="etCantHasFocus = False";
__ref._etcanthasfocus /*boolean*/  = __c.False;
RDebugUtils.currentLine=50069506;
 //BA.debugLineNum = 50069506;BA.debugLine="Log(\"etCantHasFocus=\" & etCantHasFocus)";
__c.LogImpl("250069506","etCantHasFocus="+BA.ObjectToString(__ref._etcanthasfocus /*boolean*/ ),0);
RDebugUtils.currentLine=50069507;
 //BA.debugLineNum = 50069507;BA.debugLine="LogColor(\"b_prodMenos_Click\", Colors.Magenta)";
__c.LogImpl("250069507","b_prodMenos_Click",__c.Colors.Magenta);
RDebugUtils.currentLine=50069508;
 //BA.debugLineNum = 50069508;BA.debugLine="Dim index As Int = clv_pedido.GetItemFromView(Sen";
_index = __ref._clv_pedido /*b4a.example3.customlistview*/ ._getitemfromview((anywheresoftware.b4a.objects.B4XViewWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.B4XViewWrapper(), (java.lang.Object)(__c.Sender(ba))));
RDebugUtils.currentLine=50069509;
 //BA.debugLineNum = 50069509;BA.debugLine="Dim pnl0 As B4XView = clv_pedido.GetPanel(index)";
_pnl0 = new anywheresoftware.b4a.objects.B4XViewWrapper();
_pnl0 = __ref._clv_pedido /*b4a.example3.customlistview*/ ._getpanel(_index);
RDebugUtils.currentLine=50069510;
 //BA.debugLineNum = 50069510;BA.debugLine="Dim pnl As B4XView = pnl0.GetView(0)";
_pnl = new anywheresoftware.b4a.objects.B4XViewWrapper();
_pnl = _pnl0.GetView((int) (0));
RDebugUtils.currentLine=50069511;
 //BA.debugLineNum = 50069511;BA.debugLine="Dim laCant As B4XView = pnl.GetView(2).GetView(3)";
_lacant = new anywheresoftware.b4a.objects.B4XViewWrapper();
_lacant = _pnl.GetView((int) (2)).GetView((int) (3));
RDebugUtils.currentLine=50069513;
 //BA.debugLineNum = 50069513;BA.debugLine="Dim esteTag As List = Regex.Split(\"\\|\", laCant.Ta";
_estetag = new anywheresoftware.b4a.objects.collections.List();
_estetag = anywheresoftware.b4a.keywords.Common.ArrayToList(__c.Regex.Split("\\|",BA.ObjectToString(_lacant.getTag())));
RDebugUtils.currentLine=50069514;
 //BA.debugLineNum = 50069514;BA.debugLine="Log(\"LC_TEXT:\"&laCant.Text&\"|PROMO:\"&esteTag.Get(";
__c.LogImpl("250069514","LC_TEXT:"+_lacant.getText()+"|PROMO:"+BA.ObjectToString(_estetag.Get((int) (3)))+"|LC_TAG:"+BA.ObjectToString(_lacant.getTag())+"|ET:"+BA.ObjectToString(_estetag),0);
RDebugUtils.currentLine=50069515;
 //BA.debugLineNum = 50069515;BA.debugLine="If esteTag.Get(3) <> \"1\" Then 'Si es PROMO entonc";
if ((_estetag.Get((int) (3))).equals((Object)("1")) == false) { 
RDebugUtils.currentLine=50069516;
 //BA.debugLineNum = 50069516;BA.debugLine="Log(\"ES PROMO\")";
__c.LogImpl("250069516","ES PROMO",0);
RDebugUtils.currentLine=50069517;
 //BA.debugLineNum = 50069517;BA.debugLine="result =  Msgbox2(\"Si se modifica una promoción,";
__ref._result /*String*/  = BA.NumberToString(__c.Msgbox2(BA.ObjectToCharSequence("Si se modifica una promoción, la promoción se rompe y solo quedarán los productos sueltos, ¿seguro que desea continuar?"),BA.ObjectToCharSequence("Modificar Promoción"),"Si","","No",(android.graphics.Bitmap)(__c.LoadBitmap(__c.File.getDirAssets(),"alert2.png").getObject()),ba));
RDebugUtils.currentLine=50069518;
 //BA.debugLineNum = 50069518;BA.debugLine="If result = DialogResponse.POSITIVE Then 'Quitam";
if ((__ref._result /*String*/ ).equals(BA.NumberToString(__c.DialogResponse.POSITIVE))) { 
RDebugUtils.currentLine=50069519;
 //BA.debugLineNum = 50069519;BA.debugLine="prodsMap.Remove(esteTag.Get(3))";
__ref._prodsmap /*anywheresoftware.b4a.objects.collections.Map*/ .Remove(_estetag.Get((int) (3)));
RDebugUtils.currentLine=50069520;
 //BA.debugLineNum = 50069520;BA.debugLine="Starter.skmt.ExecNonQuery($\"update HIST_VENTAS";
_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("update HIST_VENTAS set HVD_RECHAZO = 1 WHERE HVD_PROID = '"+__c.SmartStringFormatter("",_estetag.Get((int) (3)))+"' and HVD_cliente in (Select CUENTA from cuentaa)"));
RDebugUtils.currentLine=50069521;
 //BA.debugLineNum = 50069521;BA.debugLine="Starter.skmt.ExecNonQuery($\"update HIST_VENTAS";
_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("update HIST_VENTAS set HVD_CODPROMO = '"+__c.SmartStringFormatter("",(Object)(_subs._traealmacen /*String*/ (ba)))+"' WHERE HVD_cliente in (Select CUENTA from cuentaa) AND HVD_CODPROMO = '"+__c.SmartStringFormatter("",_estetag.Get((int) (3)))+"'"));
RDebugUtils.currentLine=50069522;
 //BA.debugLineNum = 50069522;BA.debugLine="LogColor(prodsMap, Colors.red)";
__c.LogImpl("250069522",BA.ObjectToString(__ref._prodsmap /*anywheresoftware.b4a.objects.collections.Map*/ ),__c.Colors.Red);
RDebugUtils.currentLine=50069523;
 //BA.debugLineNum = 50069523;BA.debugLine="reconstruirPedido = True";
__ref._reconstruirpedido /*boolean*/  = __c.True;
RDebugUtils.currentLine=50069524;
 //BA.debugLineNum = 50069524;BA.debugLine="promoABorrar = esteTag.Get(3)";
__ref._promoaborrar /*String*/  = BA.ObjectToString(_estetag.Get((int) (3)));
RDebugUtils.currentLine=50069525;
 //BA.debugLineNum = 50069525;BA.debugLine="B4XPage_Appear";
__ref._b4xpage_appear /*String*/ (null);
 };
 }else {
RDebugUtils.currentLine=50069528;
 //BA.debugLineNum = 50069528;BA.debugLine="If laCant.Text = \"\" Then laCant.Text = 0";
if ((_lacant.getText()).equals("")) { 
_lacant.setText(BA.ObjectToCharSequence(0));};
RDebugUtils.currentLine=50069529;
 //BA.debugLineNum = 50069529;BA.debugLine="laCant.Text = $\"$1.0{laCant.Text-1}\"$";
_lacant.setText(BA.ObjectToCharSequence((""+__c.SmartStringFormatter("1.0",(Object)((double)(Double.parseDouble(_lacant.getText()))-1))+"")));
RDebugUtils.currentLine=50069530;
 //BA.debugLineNum = 50069530;BA.debugLine="If laCant.Text < 0 Then laCant.Text = 0";
if ((double)(Double.parseDouble(_lacant.getText()))<0) { 
_lacant.setText(BA.ObjectToCharSequence(0));};
RDebugUtils.currentLine=50069531;
 //BA.debugLineNum = 50069531;BA.debugLine="Starter.skmt.ExecNonQuery2(\"update cat_gunaprod";
_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("update cat_gunaprod set cat_gp_almacen = cat_gp_almacen + 1 where cat_gp_id = ?",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{_estetag.Get((int) (2))}));
 };
RDebugUtils.currentLine=50069533;
 //BA.debugLineNum = 50069533;BA.debugLine="Dim preciou As Float = esteTag.Get(0)/esteTag.Get";
_preciou = (float) ((double)(BA.ObjectToNumber(_estetag.Get((int) (0))))/(double)(double)(BA.ObjectToNumber(_estetag.Get((int) (1)))));
RDebugUtils.currentLine=50069534;
 //BA.debugLineNum = 50069534;BA.debugLine="Log(\"PU: \" & preciou)";
__c.LogImpl("250069534","PU: "+BA.NumberToString(_preciou),0);
RDebugUtils.currentLine=50069540;
 //BA.debugLineNum = 50069540;BA.debugLine="Subs.prodRechazo(esteTag.Get(5), esteTag.Get(2))";
_subs._prodrechazo /*String*/ (ba,BA.ObjectToString(_estetag.Get((int) (5))),BA.ObjectToString(_estetag.Get((int) (2))));
RDebugUtils.currentLine=50069541;
 //BA.debugLineNum = 50069541;BA.debugLine="Private cym As Map = Subs.traemosCantYMonto(clv_p";
_cym = new anywheresoftware.b4a.objects.collections.Map();
_cym = _subs._traemoscantymonto /*anywheresoftware.b4a.objects.collections.Map*/ (ba,__ref._clv_pedido /*b4a.example3.customlistview*/ );
RDebugUtils.currentLine=50069542;
 //BA.debugLineNum = 50069542;BA.debugLine="L_CANT.Text = cym.Get(\"cantidad\")";
__ref._l_cant /*anywheresoftware.b4a.objects.LabelWrapper*/ .setText(BA.ObjectToCharSequence(_cym.Get((Object)("cantidad"))));
RDebugUtils.currentLine=50069543;
 //BA.debugLineNum = 50069543;BA.debugLine="L_TOTAL.Text = Round2(cym.Get(\"monto\"), 2)";
__ref._l_total /*anywheresoftware.b4a.objects.LabelWrapper*/ .setText(BA.ObjectToCharSequence(__c.Round2((double)(BA.ObjectToNumber(_cym.Get((Object)("monto")))),(int) (2))));
RDebugUtils.currentLine=50069545;
 //BA.debugLineNum = 50069545;BA.debugLine="End Sub";
return "";
}
public String  _b4xpage_appear(reparto_intmex.keymon.lat.c_historico __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_historico";
if (Debug.shouldDelegate(ba, "b4xpage_appear", false))
	 {return ((String) Debug.delegate(ba, "b4xpage_appear", null));}
int _i = 0;
anywheresoftware.b4a.sql.SQL.CursorWrapper _oc = null;
int _cant2 = 0;
anywheresoftware.b4a.objects.LabelWrapper _label1 = null;
anywheresoftware.b4a.objects.LabelWrapper _label2 = null;
int _bgcolor = 0;
int _textcolor = 0;
anywheresoftware.b4a.sql.SQL.CursorWrapper _vc = null;
int _cantco = 0;
anywheresoftware.b4a.sql.SQL.CursorWrapper _cco = null;
anywheresoftware.b4a.objects.collections.Map _cym = null;
RDebugUtils.currentLine=49610752;
 //BA.debugLineNum = 49610752;BA.debugLine="Sub B4XPage_Appear";
RDebugUtils.currentLine=49610753;
 //BA.debugLineNum = 49610753;BA.debugLine="Subs.centraPanel(p_principal, Root.Width)";
_subs._centrapanel /*String*/ (ba,__ref._p_principal /*anywheresoftware.b4a.objects.PanelWrapper*/ ,__ref._root /*anywheresoftware.b4a.objects.B4XViewWrapper*/ .getWidth());
RDebugUtils.currentLine=49610757;
 //BA.debugLineNum = 49610757;BA.debugLine="L_CANT.Text =\"\"";
__ref._l_cant /*anywheresoftware.b4a.objects.LabelWrapper*/ .setText(BA.ObjectToCharSequence(""));
RDebugUtils.currentLine=49610758;
 //BA.debugLineNum = 49610758;BA.debugLine="L_TOTAL.Text=\"\"";
__ref._l_total /*anywheresoftware.b4a.objects.LabelWrapper*/ .setText(BA.ObjectToCharSequence(""));
RDebugUtils.currentLine=49610759;
 //BA.debugLineNum = 49610759;BA.debugLine="c=Starter.skmt.ExecQuery(\"select count(*) as EXIS";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/  = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select count(*) as EXISTE from HIST_VENTAS WHERE HVD_CLIENTE IN (Select CUENTA from cuentaa) and HVD_RECHAZO = 0 ")));
RDebugUtils.currentLine=49610760;
 //BA.debugLineNum = 49610760;BA.debugLine="C.Position=0";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition((int) (0));
RDebugUtils.currentLine=49610761;
 //BA.debugLineNum = 49610761;BA.debugLine="Existe = C.GetString(\"EXISTE\")";
__ref._existe /*String*/  = __ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("EXISTE");
RDebugUtils.currentLine=49610762;
 //BA.debugLineNum = 49610762;BA.debugLine="C.Close";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .Close();
RDebugUtils.currentLine=49610764;
 //BA.debugLineNum = 49610764;BA.debugLine="c=Starter.skmt.ExecQuery(\"select hvd_num_registro";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/  = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select hvd_num_registro, HVD_CLIENTE, HVD_PRONOMBRE, HVD_PROID, HVD_CANT, HVD_COSTO_TOT, HVD_CODPROMO from HIST_VENTAS WHERE HVD_CLIENTE IN (Select CUENTA from cuentaa) and HVD_RECHAZO = 0 and hvd_cant > 0 order by HVD_CODPROMO desc, HVD_PRONOMBRE asc")));
RDebugUtils.currentLine=49610765;
 //BA.debugLineNum = 49610765;BA.debugLine="ListView1.Clear";
__ref._listview1 /*anywheresoftware.b4a.objects.ListViewWrapper*/ .Clear();
RDebugUtils.currentLine=49610766;
 //BA.debugLineNum = 49610766;BA.debugLine="clv_pedido.Clear";
__ref._clv_pedido /*b4a.example3.customlistview*/ ._clear();
RDebugUtils.currentLine=49610767;
 //BA.debugLineNum = 49610767;BA.debugLine="Subs.SetDivider(ListView1, Colors.LightGray, 2)";
_subs._setdivider /*String*/ (ba,__ref._listview1 /*anywheresoftware.b4a.objects.ListViewWrapper*/ ,__c.Colors.LightGray,(int) (2));
RDebugUtils.currentLine=49610768;
 //BA.debugLineNum = 49610768;BA.debugLine="clv_pedido.GetBase.SetLayoutAnimated(100, 0dip, 6";
__ref._clv_pedido /*b4a.example3.customlistview*/ ._getbase().SetLayoutAnimated((int) (100),__c.DipToCurrent((int) (0)),__c.DipToCurrent((int) (60)),(int) (__ref._root /*anywheresoftware.b4a.objects.B4XViewWrapper*/ .getWidth()-50),(int) (__ref._root /*anywheresoftware.b4a.objects.B4XViewWrapper*/ .getHeight()*0.62));
RDebugUtils.currentLine=49610769;
 //BA.debugLineNum = 49610769;BA.debugLine="clv_pedido.Base_Resize(clv_pedido.GetBase.Width,";
__ref._clv_pedido /*b4a.example3.customlistview*/ ._base_resize(__ref._clv_pedido /*b4a.example3.customlistview*/ ._getbase().getWidth(),__ref._clv_pedido /*b4a.example3.customlistview*/ ._getbase().getHeight());
RDebugUtils.currentLine=49610771;
 //BA.debugLineNum = 49610771;BA.debugLine="If c.RowCount>0 Then";
if (__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .getRowCount()>0) { 
RDebugUtils.currentLine=49610773;
 //BA.debugLineNum = 49610773;BA.debugLine="For i=0 To c.RowCount -1";
{
final int step15 = 1;
final int limit15 = (int) (__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .getRowCount()-1);
_i = (int) (0) ;
for (;_i <= limit15 ;_i = _i + step15 ) {
RDebugUtils.currentLine=49610774;
 //BA.debugLineNum = 49610774;BA.debugLine="c.Position=i";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition(_i);
RDebugUtils.currentLine=49610776;
 //BA.debugLineNum = 49610776;BA.debugLine="Private oc As Cursor = Starter.skmt.ExecQuery($";
_oc = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_oc = (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 HVD_CANT from HIST_VENTAS2 WHERE HVD_CLIENTE IN (Select CUENTA from cuentaa) and hvd_proid = '"+__c.SmartStringFormatter("",(Object)(__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("HVD_PROID")))+"' and HVD_NUM_REGISTRO = '"+__c.SmartStringFormatter("",(Object)(__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("HVD_NUM_REGISTRO")))+"'"))));
RDebugUtils.currentLine=49610777;
 //BA.debugLineNum = 49610777;BA.debugLine="Private cant2 As Int = 0";
_cant2 = (int) (0);
RDebugUtils.currentLine=49610778;
 //BA.debugLineNum = 49610778;BA.debugLine="If oc.RowCount > 0 Then";
if (_oc.getRowCount()>0) { 
RDebugUtils.currentLine=49610779;
 //BA.debugLineNum = 49610779;BA.debugLine="oc.Position = 0";
_oc.setPosition((int) (0));
RDebugUtils.currentLine=49610780;
 //BA.debugLineNum = 49610780;BA.debugLine="cant2 = oc.GetString(\"HVD_CANT\")";
_cant2 = (int)(Double.parseDouble(_oc.GetString("HVD_CANT")));
 };
RDebugUtils.currentLine=49610782;
 //BA.debugLineNum = 49610782;BA.debugLine="oc.Close";
_oc.Close();
RDebugUtils.currentLine=49610783;
 //BA.debugLineNum = 49610783;BA.debugLine="Dim label1 As Label";
_label1 = new anywheresoftware.b4a.objects.LabelWrapper();
RDebugUtils.currentLine=49610784;
 //BA.debugLineNum = 49610784;BA.debugLine="label1 = ListView1.TwoLinesLayout.Label";
_label1 = __ref._listview1 /*anywheresoftware.b4a.objects.ListViewWrapper*/ .getTwoLinesLayout().Label;
RDebugUtils.currentLine=49610785;
 //BA.debugLineNum = 49610785;BA.debugLine="label1.TextSize = 12";
_label1.setTextSize((float) (12));
RDebugUtils.currentLine=49610786;
 //BA.debugLineNum = 49610786;BA.debugLine="label1.TextColor = Colors.black";
_label1.setTextColor(__c.Colors.Black);
RDebugUtils.currentLine=49610787;
 //BA.debugLineNum = 49610787;BA.debugLine="Dim label2 As Label";
_label2 = new anywheresoftware.b4a.objects.LabelWrapper();
RDebugUtils.currentLine=49610788;
 //BA.debugLineNum = 49610788;BA.debugLine="label2 = ListView1.TwoLinesLayout.SecondLabel";
_label2 = __ref._listview1 /*anywheresoftware.b4a.objects.ListViewWrapper*/ .getTwoLinesLayout().SecondLabel;
RDebugUtils.currentLine=49610789;
 //BA.debugLineNum = 49610789;BA.debugLine="label2.TextSize = 12";
_label2.setTextSize((float) (12));
RDebugUtils.currentLine=49610790;
 //BA.debugLineNum = 49610790;BA.debugLine="label2.TextColor = Colors.black";
_label2.setTextColor(__c.Colors.Black);
RDebugUtils.currentLine=49610791;
 //BA.debugLineNum = 49610791;BA.debugLine="Private bgColor, textColor As Int";
_bgcolor = 0;
_textcolor = 0;
RDebugUtils.currentLine=49610792;
 //BA.debugLineNum = 49610792;BA.debugLine="bgColor = Colors.RGB(177, 200, 249)'azul";
_bgcolor = __c.Colors.RGB((int) (177),(int) (200),(int) (249));
RDebugUtils.currentLine=49610793;
 //BA.debugLineNum = 49610793;BA.debugLine="textColor = Colors.black";
_textcolor = __c.Colors.Black;
RDebugUtils.currentLine=49610794;
 //BA.debugLineNum = 49610794;BA.debugLine="If c.GetString(\"HVD_CODPROMO\") <> \"1\" Then";
if ((__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("HVD_CODPROMO")).equals("1") == false) { 
RDebugUtils.currentLine=49610796;
 //BA.debugLineNum = 49610796;BA.debugLine="bgColor = Colors.White";
_bgcolor = __c.Colors.White;
 };
RDebugUtils.currentLine=49610800;
 //BA.debugLineNum = 49610800;BA.debugLine="clv_pedido.Add(CreateListItem(c.GetString(\"HVD_";
__ref._clv_pedido /*b4a.example3.customlistview*/ ._add((anywheresoftware.b4a.objects.B4XViewWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.B4XViewWrapper(), (java.lang.Object)(__ref._createlistitem /*anywheresoftware.b4a.objects.PanelWrapper*/ (null,__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("HVD_PRONOMBRE"),_subs._traeprecio /*String*/ (ba,__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("HVD_PROID"),__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("HVD_CODPROMO")),(int)(Double.parseDouble(__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("HVD_CANT"))),(int) (0),__ref._clv_pedido /*b4a.example3.customlistview*/ ._asview().getWidth(),__c.DipToCurrent((int) (50)),__ref._bmp /*anywheresoftware.b4a.objects.drawable.CanvasWrapper.BitmapWrapper*/ ,__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("HVD_PROID"),_bgcolor,_textcolor,__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("HVD_CODPROMO"),_subs._traecliente /*String*/ (ba)).getObject())),(Object)(__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("HVD_PRONOMBRE")));
 }
};
 };
RDebugUtils.currentLine=49610805;
 //BA.debugLineNum = 49610805;BA.debugLine="Private vc As Cursor = Starter.skmt.ExecQuery(\"se";
_vc = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_vc = (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 * from REPARTO where REP_CLIENTE in (select cuenta from cuentaa) and REP_RECHAZO = '0' and REP_CANT > 0 order by REP_PRONOMBRE")));
RDebugUtils.currentLine=49610806;
 //BA.debugLineNum = 49610806;BA.debugLine="Log($\"VENTA: ${vc.RowCount}\"$)";
__c.LogImpl("249610806",("VENTA: "+__c.SmartStringFormatter("",(Object)(_vc.getRowCount()))+""),0);
RDebugUtils.currentLine=49610807;
 //BA.debugLineNum = 49610807;BA.debugLine="If vc.RowCount > 0 Then";
if (_vc.getRowCount()>0) { 
RDebugUtils.currentLine=49610810;
 //BA.debugLineNum = 49610810;BA.debugLine="textColor = Colors.RGB(0,87,142)";
_textcolor = __c.Colors.RGB((int) (0),(int) (87),(int) (142));
RDebugUtils.currentLine=49610811;
 //BA.debugLineNum = 49610811;BA.debugLine="For i=0 To vc.RowCount -1";
{
final int step45 = 1;
final int limit45 = (int) (_vc.getRowCount()-1);
_i = (int) (0) ;
for (;_i <= limit45 ;_i = _i + step45 ) {
RDebugUtils.currentLine=49610812;
 //BA.debugLineNum = 49610812;BA.debugLine="vc.Position = i";
_vc.setPosition(_i);
RDebugUtils.currentLine=49610813;
 //BA.debugLineNum = 49610813;BA.debugLine="Private cantCO As Int = 0";
_cantco = (int) (0);
RDebugUtils.currentLine=49610815;
 //BA.debugLineNum = 49610815;BA.debugLine="Private cco As Cursor = Starter.skmt.ExecQuery(";
_cco = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_cco = (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 * from REPARTO where REP_CLIENTE = '"+__c.SmartStringFormatter("",(Object)(_vc.GetString("REP_CLI_ORIG")))+"' and REP_CLI_ORIG = '"+__c.SmartStringFormatter("",(Object)(_vc.GetString("REP_CLI_ORIG")))+"' and REP_PRODID='"+__c.SmartStringFormatter("",(Object)(_vc.GetString("REP_PRODID")))+"' and REP_RECHAZO = '1' and REP_CANT > 0"))));
RDebugUtils.currentLine=49610817;
 //BA.debugLineNum = 49610817;BA.debugLine="If cco.RowCount > 0 Then";
if (_cco.getRowCount()>0) { 
RDebugUtils.currentLine=49610818;
 //BA.debugLineNum = 49610818;BA.debugLine="cco.Position = 0";
_cco.setPosition((int) (0));
RDebugUtils.currentLine=49610819;
 //BA.debugLineNum = 49610819;BA.debugLine="cantCO = cco.GetString(\"REP_CANT\") + vc.GetStr";
_cantco = (int) ((double)(Double.parseDouble(_cco.GetString("REP_CANT")))+(double)(Double.parseDouble(_vc.GetString("REP_CANT"))));
 };
RDebugUtils.currentLine=49610821;
 //BA.debugLineNum = 49610821;BA.debugLine="cantCO = Subs.traeCantidadRechazada(vc.GetStrin";
_cantco = _subs._traecantidadrechazada /*int*/ (ba,_vc.GetString("REP_CLI_ORIG"),_vc.GetString("REP_PRODID"));
RDebugUtils.currentLine=49610824;
 //BA.debugLineNum = 49610824;BA.debugLine="clv_pedido.Add(CreateListItem(vc.GetString(\"REP";
__ref._clv_pedido /*b4a.example3.customlistview*/ ._add((anywheresoftware.b4a.objects.B4XViewWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.B4XViewWrapper(), (java.lang.Object)(__ref._createlistitem /*anywheresoftware.b4a.objects.PanelWrapper*/ (null,_vc.GetString("REP_PRONOMBRE"),_subs._traeprecio /*String*/ (ba,_vc.GetString("REP_PRODID"),_subs._traealmacen /*String*/ (ba)),(int)(Double.parseDouble(_vc.GetString("REP_CANT"))),_cantco,__ref._clv_pedido /*b4a.example3.customlistview*/ ._asview().getWidth(),__c.DipToCurrent((int) (50)),__ref._bmp /*anywheresoftware.b4a.objects.drawable.CanvasWrapper.BitmapWrapper*/ ,_vc.GetString("REP_PRODID"),_bgcolor,_textcolor,BA.NumberToString(1),_vc.GetString("REP_CLI_ORIG")).getObject())),(Object)(_vc.GetString("REP_PRONOMBRE")));
 }
};
RDebugUtils.currentLine=49610826;
 //BA.debugLineNum = 49610826;BA.debugLine="cco.Close";
_cco.Close();
RDebugUtils.currentLine=49610827;
 //BA.debugLineNum = 49610827;BA.debugLine="vc.Close";
_vc.Close();
 };
RDebugUtils.currentLine=49610830;
 //BA.debugLineNum = 49610830;BA.debugLine="If Existe <> 0 Then";
if ((__ref._existe /*String*/ ).equals(BA.NumberToString(0)) == false) { 
RDebugUtils.currentLine=49610831;
 //BA.debugLineNum = 49610831;BA.debugLine="c = Starter.skmt.ExecQuery(\"select SUM(HVD_CANT)";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/  = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select SUM(HVD_CANT) AS PC_NOART, SUM(HVD_COSTO_TOT) AS PC_MONTO from HIST_VENTAS where HVD_CLIENTE in (Select CUENTA from cuentaa) and HVD_RECHAZO = 0 ")));
RDebugUtils.currentLine=49610832;
 //BA.debugLineNum = 49610832;BA.debugLine="C.Position=0";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition((int) (0));
RDebugUtils.currentLine=49610833;
 //BA.debugLineNum = 49610833;BA.debugLine="L_CANT.Text = c.GetString(\"PC_NOART\")";
__ref._l_cant /*anywheresoftware.b4a.objects.LabelWrapper*/ .setText(BA.ObjectToCharSequence(__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("PC_NOART")));
RDebugUtils.currentLine=49610834;
 //BA.debugLineNum = 49610834;BA.debugLine="L_TOTAL.Text = Round2(c.GetString(\"PC_MONTO\"), 2";
__ref._l_total /*anywheresoftware.b4a.objects.LabelWrapper*/ .setText(BA.ObjectToCharSequence(__c.Round2((double)(Double.parseDouble(__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("PC_MONTO"))),(int) (2))));
 };
RDebugUtils.currentLine=49610836;
 //BA.debugLineNum = 49610836;BA.debugLine="c=Starter.skmt.ExecQuery(\"select count(*) as EXIS";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/  = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select count(*) as EXISTE from PEDIDO  WHERE PE_CLIENTE IN (Select CUENTA from cuentaa)")));
RDebugUtils.currentLine=49610837;
 //BA.debugLineNum = 49610837;BA.debugLine="c.Position=0";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition((int) (0));
RDebugUtils.currentLine=49610838;
 //BA.debugLineNum = 49610838;BA.debugLine="Existe = C.GetString(\"EXISTE\")";
__ref._existe /*String*/  = __ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("EXISTE");
RDebugUtils.currentLine=49610839;
 //BA.debugLineNum = 49610839;BA.debugLine="c.Close";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .Close();
RDebugUtils.currentLine=49610842;
 //BA.debugLineNum = 49610842;BA.debugLine="Subs.SetDivider(ListView1, Colors.LightGray, 2)";
_subs._setdivider /*String*/ (ba,__ref._listview1 /*anywheresoftware.b4a.objects.ListViewWrapper*/ ,__c.Colors.LightGray,(int) (2));
RDebugUtils.currentLine=49610860;
 //BA.debugLineNum = 49610860;BA.debugLine="If Existe <> 0 Then";
if ((__ref._existe /*String*/ ).equals(BA.NumberToString(0)) == false) { 
RDebugUtils.currentLine=49610861;
 //BA.debugLineNum = 49610861;BA.debugLine="c=Starter.skmt.ExecQuery(\"select SUM(PE_CANT) AS";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/  = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select SUM(PE_CANT) AS PE_CANT, SUM(PE_COSTO_TOT) AS PE_COSTO_TOT FROM PEDIDO WHERE PE_CLIENTE IN (Select CUENTA from cuentaa)")));
RDebugUtils.currentLine=49610862;
 //BA.debugLineNum = 49610862;BA.debugLine="C.Position=0";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition((int) (0));
RDebugUtils.currentLine=49610863;
 //BA.debugLineNum = 49610863;BA.debugLine="L_CANT.Text = L_CANT.Text + c.GetString(\"PE_CANT";
__ref._l_cant /*anywheresoftware.b4a.objects.LabelWrapper*/ .setText(BA.ObjectToCharSequence((double)(Double.parseDouble(__ref._l_cant /*anywheresoftware.b4a.objects.LabelWrapper*/ .getText()))+(double)(Double.parseDouble(__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("PE_CANT")))));
RDebugUtils.currentLine=49610864;
 //BA.debugLineNum = 49610864;BA.debugLine="L_TOTAL.Text = Round2(L_TOTAL.Text  + c.GetStrin";
__ref._l_total /*anywheresoftware.b4a.objects.LabelWrapper*/ .setText(BA.ObjectToCharSequence(__c.Round2((double)(Double.parseDouble(__ref._l_total /*anywheresoftware.b4a.objects.LabelWrapper*/ .getText()))+(double)(Double.parseDouble(__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("PE_COSTO_TOT"))),(int) (2))));
 };
RDebugUtils.currentLine=49610868;
 //BA.debugLineNum = 49610868;BA.debugLine="Private cym As Map = Subs.traemosCantYMonto(clv_p";
_cym = new anywheresoftware.b4a.objects.collections.Map();
_cym = _subs._traemoscantymonto /*anywheresoftware.b4a.objects.collections.Map*/ (ba,__ref._clv_pedido /*b4a.example3.customlistview*/ );
RDebugUtils.currentLine=49610869;
 //BA.debugLineNum = 49610869;BA.debugLine="L_CANT.Text = cym.Get(\"cantidad\")";
__ref._l_cant /*anywheresoftware.b4a.objects.LabelWrapper*/ .setText(BA.ObjectToCharSequence(_cym.Get((Object)("cantidad"))));
RDebugUtils.currentLine=49610870;
 //BA.debugLineNum = 49610870;BA.debugLine="L_TOTAL.Text = Round2(cym.Get(\"monto\"), 2)";
__ref._l_total /*anywheresoftware.b4a.objects.LabelWrapper*/ .setText(BA.ObjectToCharSequence(__c.Round2((double)(BA.ObjectToNumber(_cym.Get((Object)("monto")))),(int) (2))));
RDebugUtils.currentLine=49610871;
 //BA.debugLineNum = 49610871;BA.debugLine="End Sub";
return "";
}
public String  _b_regresar_click(reparto_intmex.keymon.lat.c_historico __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_historico";
if (Debug.shouldDelegate(ba, "b_regresar_click", false))
	 {return ((String) Debug.delegate(ba, "b_regresar_click", null));}
RDebugUtils.currentLine=49741824;
 //BA.debugLineNum = 49741824;BA.debugLine="Sub b_regresar_Click";
RDebugUtils.currentLine=49741825;
 //BA.debugLineNum = 49741825;BA.debugLine="B4XPages.ShowPage(\"Cliente\")";
_b4xpages._showpage /*String*/ (ba,"Cliente");
RDebugUtils.currentLine=49741826;
 //BA.debugLineNum = 49741826;BA.debugLine="End Sub";
return "";
}
public anywheresoftware.b4a.objects.PanelWrapper  _createlistitem(reparto_intmex.keymon.lat.c_historico __ref,String _text,String _preciou,int _inv,int _inv2,int _width,int _height,anywheresoftware.b4a.objects.drawable.CanvasWrapper.BitmapWrapper _img,String _prodid,int _bc,int _tc,String _promo,String _cliente_original) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_historico";
if (Debug.shouldDelegate(ba, "createlistitem", false))
	 {return ((anywheresoftware.b4a.objects.PanelWrapper) Debug.delegate(ba, "createlistitem", new Object[] {_text,_preciou,_inv,_inv2,_width,_height,_img,_prodid,_bc,_tc,_promo,_cliente_original}));}
anywheresoftware.b4a.objects.B4XViewWrapper _p = null;
anywheresoftware.b4a.objects.CSBuilder _cs = null;
RDebugUtils.currentLine=50003968;
 //BA.debugLineNum = 50003968;BA.debugLine="Sub CreateListItem(Text As String, precioU As Stri";
RDebugUtils.currentLine=50003969;
 //BA.debugLineNum = 50003969;BA.debugLine="Dim p As B4XView = xui.CreatePanel(\"\")";
_p = new anywheresoftware.b4a.objects.B4XViewWrapper();
_p = __ref._xui /*anywheresoftware.b4a.objects.B4XViewWrapper.XUI*/ .CreatePanel(ba,"");
RDebugUtils.currentLine=50003970;
 //BA.debugLineNum = 50003970;BA.debugLine="Private cs As CSBuilder";
_cs = new anywheresoftware.b4a.objects.CSBuilder();
RDebugUtils.currentLine=50003971;
 //BA.debugLineNum = 50003971;BA.debugLine="cs.Initialize";
_cs.Initialize();
RDebugUtils.currentLine=50003972;
 //BA.debugLineNum = 50003972;BA.debugLine="p.SetLayoutAnimated(0, 0, 0, Width, Height)";
_p.SetLayoutAnimated((int) (0),(int) (0),(int) (0),_width,_height);
RDebugUtils.currentLine=50003973;
 //BA.debugLineNum = 50003973;BA.debugLine="p.LoadLayout(\"prodItem\")";
_p.LoadLayout("prodItem",ba);
RDebugUtils.currentLine=50003974;
 //BA.debugLineNum = 50003974;BA.debugLine="p_prods.Color = bc";
__ref._p_prods /*anywheresoftware.b4a.objects.PanelWrapper*/ .setColor(_bc);
RDebugUtils.currentLine=50003975;
 //BA.debugLineNum = 50003975;BA.debugLine="l_prodX.TextColor = tc";
__ref._l_prodx /*anywheresoftware.b4a.objects.LabelWrapper*/ .setTextColor(_tc);
RDebugUtils.currentLine=50003976;
 //BA.debugLineNum = 50003976;BA.debugLine="precioU = $\"$1.2{precioU}\"$";
_preciou = (""+__c.SmartStringFormatter("1.2",(Object)(_preciou))+"");
RDebugUtils.currentLine=50003977;
 //BA.debugLineNum = 50003977;BA.debugLine="l_prodX.Text = Text&CRLF&\"Cant: \" & inv2 & \"   $\"";
__ref._l_prodx /*anywheresoftware.b4a.objects.LabelWrapper*/ .setText(BA.ObjectToCharSequence(_text+__c.CRLF+"Cant: "+BA.NumberToString(_inv2)+"   $"+_preciou));
RDebugUtils.currentLine=50003978;
 //BA.debugLineNum = 50003978;BA.debugLine="If promo <> \"1\" And precioU = 0 Then";
if ((_promo).equals("1") == false && (_preciou).equals(BA.NumberToString(0))) { 
RDebugUtils.currentLine=50003979;
 //BA.debugLineNum = 50003979;BA.debugLine="l_prodX.Text = cs.Color(Colors.RGB(123,0,0)).app";
__ref._l_prodx /*anywheresoftware.b4a.objects.LabelWrapper*/ .setText(BA.ObjectToCharSequence(_cs.Color(__c.Colors.RGB((int) (123),(int) (0),(int) (0))).Append(BA.ObjectToCharSequence(_text+__c.CRLF+"Cant: "+BA.NumberToString(_inv2)+"   $"+_preciou)).PopAll().getObject()));
 };
RDebugUtils.currentLine=50003981;
 //BA.debugLineNum = 50003981;BA.debugLine="l_prodX.Tag = $\"ID: ${prodId}${CRLF}${Text}${CRLF";
__ref._l_prodx /*anywheresoftware.b4a.objects.LabelWrapper*/ .setTag((Object)(("ID: "+__c.SmartStringFormatter("",(Object)(_prodid))+""+__c.SmartStringFormatter("",(Object)(__c.CRLF))+""+__c.SmartStringFormatter("",(Object)(_text))+""+__c.SmartStringFormatter("",(Object)(__c.CRLF))+"Precio: $"+__c.SmartStringFormatter("1.2",(Object)(_preciou))+""+__c.SmartStringFormatter("",(Object)(__c.CRLF))+"Inv: "+__c.SmartStringFormatter("",(Object)(_inv))+" pzs")));
RDebugUtils.currentLine=50003983;
 //BA.debugLineNum = 50003983;BA.debugLine="l_pCant.Tag = Round2(precioU,2)&\"|\"&inv&\"|\"&prodI";
__ref._l_pcant /*anywheresoftware.b4a.objects.LabelWrapper*/ .setTag((Object)(BA.NumberToString(__c.Round2((double)(Double.parseDouble(_preciou)),(int) (2)))+"|"+BA.NumberToString(_inv)+"|"+_prodid+"|"+_promo+"|"+BA.NumberToString(_inv2)+"|"+_cliente_original));
RDebugUtils.currentLine=50003984;
 //BA.debugLineNum = 50003984;BA.debugLine="et_pCant.Tag = Round2(precioU,2)&\"|\"&inv&\"|\"&prod";
__ref._et_pcant /*anywheresoftware.b4a.objects.EditTextWrapper*/ .setTag((Object)(BA.NumberToString(__c.Round2((double)(Double.parseDouble(_preciou)),(int) (2)))+"|"+BA.NumberToString(_inv)+"|"+_prodid+"|"+_promo+"|"+BA.NumberToString(_inv2)+"|"+_cliente_original));
RDebugUtils.currentLine=50003985;
 //BA.debugLineNum = 50003985;BA.debugLine="p_prods.Tag = l_pCant.tag";
__ref._p_prods /*anywheresoftware.b4a.objects.PanelWrapper*/ .setTag(__ref._l_pcant /*anywheresoftware.b4a.objects.LabelWrapper*/ .getTag());
RDebugUtils.currentLine=50003987;
 //BA.debugLineNum = 50003987;BA.debugLine="l_pCant.Text = inv";
__ref._l_pcant /*anywheresoftware.b4a.objects.LabelWrapper*/ .setText(BA.ObjectToCharSequence(_inv));
RDebugUtils.currentLine=50003991;
 //BA.debugLineNum = 50003991;BA.debugLine="l_pCant.BringToFront";
__ref._l_pcant /*anywheresoftware.b4a.objects.LabelWrapper*/ .BringToFront();
RDebugUtils.currentLine=50003992;
 //BA.debugLineNum = 50003992;BA.debugLine="et_pCant.SendToBack";
__ref._et_pcant /*anywheresoftware.b4a.objects.EditTextWrapper*/ .SendToBack();
RDebugUtils.currentLine=50003995;
 //BA.debugLineNum = 50003995;BA.debugLine="Return p";
if (true) return (anywheresoftware.b4a.objects.PanelWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.PanelWrapper(), (android.view.ViewGroup)(_p.getObject()));
RDebugUtils.currentLine=50003996;
 //BA.debugLineNum = 50003996;BA.debugLine="End Sub";
return null;
}
public anywheresoftware.b4a.keywords.Common.ResumableSubWrapper  _b4xpage_closerequest(reparto_intmex.keymon.lat.c_historico __ref) throws Exception{
RDebugUtils.currentModule="c_historico";
if (Debug.shouldDelegate(ba, "b4xpage_closerequest", false))
	 {return ((anywheresoftware.b4a.keywords.Common.ResumableSubWrapper) Debug.delegate(ba, "b4xpage_closerequest", null));}
ResumableSub_B4XPage_CloseRequest rsub = new ResumableSub_B4XPage_CloseRequest(this,__ref);
rsub.resume(ba, null);
return (anywheresoftware.b4a.keywords.Common.ResumableSubWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.keywords.Common.ResumableSubWrapper(), rsub);
}
public static class ResumableSub_B4XPage_CloseRequest extends BA.ResumableSub {
public ResumableSub_B4XPage_CloseRequest(reparto_intmex.keymon.lat.c_historico parent,reparto_intmex.keymon.lat.c_historico __ref) {
this.parent = parent;
this.__ref = __ref;
this.__ref = parent;
}
reparto_intmex.keymon.lat.c_historico __ref;
reparto_intmex.keymon.lat.c_historico parent;

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

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

            }
        }
    }
}
public String  _b4xpage_created(reparto_intmex.keymon.lat.c_historico __ref,anywheresoftware.b4a.objects.B4XViewWrapper _root1) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_historico";
if (Debug.shouldDelegate(ba, "b4xpage_created", false))
	 {return ((String) Debug.delegate(ba, "b4xpage_created", new Object[] {_root1}));}
RDebugUtils.currentLine=49545216;
 //BA.debugLineNum = 49545216;BA.debugLine="Private Sub B4XPage_Created (Root1 As B4XView)";
RDebugUtils.currentLine=49545217;
 //BA.debugLineNum = 49545217;BA.debugLine="Root = Root1";
__ref._root /*anywheresoftware.b4a.objects.B4XViewWrapper*/  = _root1;
RDebugUtils.currentLine=49545219;
 //BA.debugLineNum = 49545219;BA.debugLine="g.Initialize(\"GPS\")";
__ref._g /*anywheresoftware.b4a.gps.GPS*/ .Initialize("GPS");
RDebugUtils.currentLine=49545220;
 //BA.debugLineNum = 49545220;BA.debugLine="Root.LoadLayout(\"historico\")";
__ref._root /*anywheresoftware.b4a.objects.B4XViewWrapper*/ .LoadLayout("historico",ba);
RDebugUtils.currentLine=49545221;
 //BA.debugLineNum = 49545221;BA.debugLine="b_borra.Visible = False";
__ref._b_borra /*anywheresoftware.b4a.objects.ButtonWrapper*/ .setVisible(__c.False);
RDebugUtils.currentLine=49545222;
 //BA.debugLineNum = 49545222;BA.debugLine="Titulo.Text = \"Pedido\"";
__ref._titulo /*anywheresoftware.b4a.objects.LabelWrapper*/ .setText(BA.ObjectToCharSequence("Pedido"));
RDebugUtils.currentLine=49545223;
 //BA.debugLineNum = 49545223;BA.debugLine="End Sub";
return "";
}
public String  _class_globals(reparto_intmex.keymon.lat.c_historico __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_historico";
RDebugUtils.currentLine=49414144;
 //BA.debugLineNum = 49414144;BA.debugLine="Sub Class_Globals";
RDebugUtils.currentLine=49414145;
 //BA.debugLineNum = 49414145;BA.debugLine="Private Root As B4XView 'ignore";
_root = new anywheresoftware.b4a.objects.B4XViewWrapper();
RDebugUtils.currentLine=49414146;
 //BA.debugLineNum = 49414146;BA.debugLine="Private xui As XUI 'ignore";
_xui = new anywheresoftware.b4a.objects.B4XViewWrapper.XUI();
RDebugUtils.currentLine=49414147;
 //BA.debugLineNum = 49414147;BA.debugLine="Dim g As GPS";
_g = new anywheresoftware.b4a.gps.GPS();
RDebugUtils.currentLine=49414148;
 //BA.debugLineNum = 49414148;BA.debugLine="Dim clie_id As String";
_clie_id = "";
RDebugUtils.currentLine=49414149;
 //BA.debugLineNum = 49414149;BA.debugLine="Dim sDate,sTime As String";
_sdate = "";
_stime = "";
RDebugUtils.currentLine=49414150;
 //BA.debugLineNum = 49414150;BA.debugLine="Dim usuario As String";
_usuario = "";
RDebugUtils.currentLine=49414151;
 //BA.debugLineNum = 49414151;BA.debugLine="Dim c As Cursor";
_c = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
RDebugUtils.currentLine=49414153;
 //BA.debugLineNum = 49414153;BA.debugLine="Dim b_regresar As Button";
_b_regresar = new anywheresoftware.b4a.objects.ButtonWrapper();
RDebugUtils.currentLine=49414154;
 //BA.debugLineNum = 49414154;BA.debugLine="Dim ListView1 As ListView";
_listview1 = new anywheresoftware.b4a.objects.ListViewWrapper();
RDebugUtils.currentLine=49414155;
 //BA.debugLineNum = 49414155;BA.debugLine="Dim L_CANT As Label";
_l_cant = new anywheresoftware.b4a.objects.LabelWrapper();
RDebugUtils.currentLine=49414156;
 //BA.debugLineNum = 49414156;BA.debugLine="Dim L_TOTAL As Label";
_l_total = new anywheresoftware.b4a.objects.LabelWrapper();
RDebugUtils.currentLine=49414157;
 //BA.debugLineNum = 49414157;BA.debugLine="Dim b_borra As Button";
_b_borra = new anywheresoftware.b4a.objects.ButtonWrapper();
RDebugUtils.currentLine=49414158;
 //BA.debugLineNum = 49414158;BA.debugLine="Dim Existe As String";
_existe = "";
RDebugUtils.currentLine=49414159;
 //BA.debugLineNum = 49414159;BA.debugLine="Dim result As String";
_result = "";
RDebugUtils.currentLine=49414161;
 //BA.debugLineNum = 49414161;BA.debugLine="Dim cuantos As String";
_cuantos = "";
RDebugUtils.currentLine=49414162;
 //BA.debugLineNum = 49414162;BA.debugLine="Dim nombre_prod As String";
_nombre_prod = "";
RDebugUtils.currentLine=49414163;
 //BA.debugLineNum = 49414163;BA.debugLine="Dim cuantos_pedido As String";
_cuantos_pedido = "";
RDebugUtils.currentLine=49414164;
 //BA.debugLineNum = 49414164;BA.debugLine="Private Titulo As Label";
_titulo = new anywheresoftware.b4a.objects.LabelWrapper();
RDebugUtils.currentLine=49414165;
 //BA.debugLineNum = 49414165;BA.debugLine="Private P1 As Panel";
_p1 = new anywheresoftware.b4a.objects.PanelWrapper();
RDebugUtils.currentLine=49414166;
 //BA.debugLineNum = 49414166;BA.debugLine="Private lv2 As ListView";
_lv2 = new anywheresoftware.b4a.objects.ListViewWrapper();
RDebugUtils.currentLine=49414167;
 //BA.debugLineNum = 49414167;BA.debugLine="Private p_principal As Panel";
_p_principal = new anywheresoftware.b4a.objects.PanelWrapper();
RDebugUtils.currentLine=49414168;
 //BA.debugLineNum = 49414168;BA.debugLine="Dim clv_pedido As CustomListView";
_clv_pedido = new b4a.example3.customlistview();
RDebugUtils.currentLine=49414169;
 //BA.debugLineNum = 49414169;BA.debugLine="Private p_prods As Panel";
_p_prods = new anywheresoftware.b4a.objects.PanelWrapper();
RDebugUtils.currentLine=49414170;
 //BA.debugLineNum = 49414170;BA.debugLine="Private l_prodX As Label";
_l_prodx = new anywheresoftware.b4a.objects.LabelWrapper();
RDebugUtils.currentLine=49414171;
 //BA.debugLineNum = 49414171;BA.debugLine="Private l_pCant As Label";
_l_pcant = new anywheresoftware.b4a.objects.LabelWrapper();
RDebugUtils.currentLine=49414172;
 //BA.debugLineNum = 49414172;BA.debugLine="Private et_pCant As EditText";
_et_pcant = new anywheresoftware.b4a.objects.EditTextWrapper();
RDebugUtils.currentLine=49414173;
 //BA.debugLineNum = 49414173;BA.debugLine="Dim bmp As Bitmap";
_bmp = new anywheresoftware.b4a.objects.drawable.CanvasWrapper.BitmapWrapper();
RDebugUtils.currentLine=49414174;
 //BA.debugLineNum = 49414174;BA.debugLine="Dim etCantHasFocus As Boolean = False";
_etcanthasfocus = __c.False;
RDebugUtils.currentLine=49414175;
 //BA.debugLineNum = 49414175;BA.debugLine="Dim totalProds As Int = 0";
_totalprods = (int) (0);
RDebugUtils.currentLine=49414176;
 //BA.debugLineNum = 49414176;BA.debugLine="Dim totalCompra As Int = 0";
_totalcompra = (int) (0);
RDebugUtils.currentLine=49414177;
 //BA.debugLineNum = 49414177;BA.debugLine="Dim prodsMap As Map";
_prodsmap = new anywheresoftware.b4a.objects.collections.Map();
RDebugUtils.currentLine=49414178;
 //BA.debugLineNum = 49414178;BA.debugLine="Dim reconstruirPedido As Boolean = False";
_reconstruirpedido = __c.False;
RDebugUtils.currentLine=49414179;
 //BA.debugLineNum = 49414179;BA.debugLine="Dim promoABorrar As String";
_promoaborrar = "";
RDebugUtils.currentLine=49414180;
 //BA.debugLineNum = 49414180;BA.debugLine="Private b_guardar As Button";
_b_guardar = new anywheresoftware.b4a.objects.ButtonWrapper();
RDebugUtils.currentLine=49414181;
 //BA.debugLineNum = 49414181;BA.debugLine="Private b_prodMas As Button";
_b_prodmas = new anywheresoftware.b4a.objects.ButtonWrapper();
RDebugUtils.currentLine=49414182;
 //BA.debugLineNum = 49414182;BA.debugLine="Private b_prodMenos As Button";
_b_prodmenos = new anywheresoftware.b4a.objects.ButtonWrapper();
RDebugUtils.currentLine=49414183;
 //BA.debugLineNum = 49414183;BA.debugLine="End Sub";
return "";
}
public String  _cuentaprods(reparto_intmex.keymon.lat.c_historico __ref,String _accion) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_historico";
if (Debug.shouldDelegate(ba, "cuentaprods", false))
	 {return ((String) Debug.delegate(ba, "cuentaprods", new Object[] {_accion}));}
int _cantrechazada = 0;
int _i = 0;
anywheresoftware.b4a.objects.B4XViewWrapper _p0 = null;
anywheresoftware.b4a.objects.B4XViewWrapper _p = null;
anywheresoftware.b4a.objects.B4XViewWrapper _cant1 = null;
anywheresoftware.b4a.objects.collections.List _estetag = null;
String _esteprod = "";
int _estacant = 0;
int _estacantoriginal = 0;
String _estecliente = "";
String _esteprodnombre = "";
int _esteclienteoriginal = 0;
String _fechareparto = "";
String _maxprods = "";
String _esteprecio = "";
anywheresoftware.b4a.sql.SQL.CursorWrapper _rr = null;
anywheresoftware.b4a.objects.collections.Map _m = null;
int _bgcolor = 0;
int _textcolor = 0;
String _newpromo = "";
String _newprecio = "";
String _pr = "";
anywheresoftware.b4a.objects.collections.Map _pr1 = null;
String _cantidad1 = "";
String _totalfinal = "";
anywheresoftware.b4a.sql.SQL.CursorWrapper _x = null;
String _cantidady = "";
String _preciou = "";
String _costototalhist = "";
anywheresoftware.b4a.sql.SQL.CursorWrapper _z = null;
String _cantidad2 = "";
RDebugUtils.currentLine=50200576;
 //BA.debugLineNum = 50200576;BA.debugLine="Sub cuentaProds(accion As String)";
RDebugUtils.currentLine=50200578;
 //BA.debugLineNum = 50200578;BA.debugLine="Log(\"*********************************************";
__c.LogImpl("250200578","*******************************************************",0);
RDebugUtils.currentLine=50200579;
 //BA.debugLineNum = 50200579;BA.debugLine="Private cantRechazada As Int = 0";
_cantrechazada = (int) (0);
RDebugUtils.currentLine=50200580;
 //BA.debugLineNum = 50200580;BA.debugLine="If Not(reconstruirPedido) Then";
if (__c.Not(__ref._reconstruirpedido /*boolean*/ )) { 
RDebugUtils.currentLine=50200581;
 //BA.debugLineNum = 50200581;BA.debugLine="Log(\"***********  CUENTAPRODS - NO RECONSTRUIR\")";
__c.LogImpl("250200581","***********  CUENTAPRODS - NO RECONSTRUIR",0);
RDebugUtils.currentLine=50200582;
 //BA.debugLineNum = 50200582;BA.debugLine="prodsMap.Initialize";
__ref._prodsmap /*anywheresoftware.b4a.objects.collections.Map*/ .Initialize();
RDebugUtils.currentLine=50200583;
 //BA.debugLineNum = 50200583;BA.debugLine="For i = 0 To clv_pedido.GetSize - 1";
{
final int step6 = 1;
final int limit6 = (int) (__ref._clv_pedido /*b4a.example3.customlistview*/ ._getsize()-1);
_i = (int) (0) ;
for (;_i <= limit6 ;_i = _i + step6 ) {
RDebugUtils.currentLine=50200584;
 //BA.debugLineNum = 50200584;BA.debugLine="Private p0 As B4XView = clv_pedido.GetPanel(i)";
_p0 = new anywheresoftware.b4a.objects.B4XViewWrapper();
_p0 = __ref._clv_pedido /*b4a.example3.customlistview*/ ._getpanel(_i);
RDebugUtils.currentLine=50200585;
 //BA.debugLineNum = 50200585;BA.debugLine="Private p As B4XView = p0.GetView(0)";
_p = new anywheresoftware.b4a.objects.B4XViewWrapper();
_p = _p0.GetView((int) (0));
RDebugUtils.currentLine=50200586;
 //BA.debugLineNum = 50200586;BA.debugLine="Private cant1 As B4XView = p.GetView(2).GetView";
_cant1 = new anywheresoftware.b4a.objects.B4XViewWrapper();
_cant1 = _p.GetView((int) (2)).GetView((int) (3));
RDebugUtils.currentLine=50200587;
 //BA.debugLineNum = 50200587;BA.debugLine="If cant1.Text = \"\" Then cant1.Text = 0";
if ((_cant1.getText()).equals("")) { 
_cant1.setText(BA.ObjectToCharSequence(0));};
RDebugUtils.currentLine=50200589;
 //BA.debugLineNum = 50200589;BA.debugLine="Private esteTag As List = Regex.Split(\"\\|\", can";
_estetag = new anywheresoftware.b4a.objects.collections.List();
_estetag = anywheresoftware.b4a.keywords.Common.ArrayToList(__c.Regex.Split("\\|",BA.ObjectToString(_cant1.getTag())));
RDebugUtils.currentLine=50200590;
 //BA.debugLineNum = 50200590;BA.debugLine="Log(\"-------------------------------------\")";
__c.LogImpl("250200590","-------------------------------------",0);
RDebugUtils.currentLine=50200591;
 //BA.debugLineNum = 50200591;BA.debugLine="Log($\"ET: ${esteTag}\"$)";
__c.LogImpl("250200591",("ET: "+__c.SmartStringFormatter("",(Object)(_estetag.getObject()))+""),0);
RDebugUtils.currentLine=50200592;
 //BA.debugLineNum = 50200592;BA.debugLine="Private esteProd As String = esteTag.Get(2)";
_esteprod = BA.ObjectToString(_estetag.Get((int) (2)));
RDebugUtils.currentLine=50200593;
 //BA.debugLineNum = 50200593;BA.debugLine="Private estaCant As Int = cant1.Text";
_estacant = (int)(Double.parseDouble(_cant1.getText()));
RDebugUtils.currentLine=50200594;
 //BA.debugLineNum = 50200594;BA.debugLine="Private estaCantOriginal As Int = esteTag.Get(1";
_estacantoriginal = (int)(BA.ObjectToNumber(_estetag.Get((int) (1))));
RDebugUtils.currentLine=50200595;
 //BA.debugLineNum = 50200595;BA.debugLine="Private esteCliente = Subs.traeCliente";
_estecliente = _subs._traecliente /*String*/ (ba);
RDebugUtils.currentLine=50200596;
 //BA.debugLineNum = 50200596;BA.debugLine="Private esteProdNombre = Subs.traeNombre(estePr";
_esteprodnombre = _subs._traenombre /*String*/ (ba,_esteprod);
RDebugUtils.currentLine=50200597;
 //BA.debugLineNum = 50200597;BA.debugLine="Private esteClienteOriginal As Int = esteTag.Ge";
_esteclienteoriginal = (int)(BA.ObjectToNumber(_estetag.Get((int) (5))));
RDebugUtils.currentLine=50200598;
 //BA.debugLineNum = 50200598;BA.debugLine="Private fechaReparto As String = Subs.traeFecha";
_fechareparto = _subs._traefechareparto /*String*/ (ba);
RDebugUtils.currentLine=50200599;
 //BA.debugLineNum = 50200599;BA.debugLine="Private maxProds = Subs.traeMaxCantidad(esteTag";
_maxprods = BA.NumberToString(_subs._traemaxcantidad /*int*/ (ba,BA.ObjectToString(_estetag.Get((int) (5))),BA.ObjectToString(_estetag.Get((int) (2)))));
RDebugUtils.currentLine=50200601;
 //BA.debugLineNum = 50200601;BA.debugLine="If cant1.Text > maxProds Then cant1.Text = maxP";
if ((double)(Double.parseDouble(_cant1.getText()))>(double)(Double.parseDouble(_maxprods))) { 
_cant1.setText(BA.ObjectToCharSequence(_maxprods));};
RDebugUtils.currentLine=50200603;
 //BA.debugLineNum = 50200603;BA.debugLine="cantRechazada = esteTag.Get(4) - cant1.Text";
_cantrechazada = (int) ((double)(BA.ObjectToNumber(_estetag.Get((int) (4))))-(double)(Double.parseDouble(_cant1.getText())));
RDebugUtils.currentLine=50200606;
 //BA.debugLineNum = 50200606;BA.debugLine="Log($\"${Subs.traeCantidadRechazada(esteClienteO";
__c.LogImpl("250200606",(""+__c.SmartStringFormatter("",(Object)(_subs._traecantidadrechazada /*int*/ (ba,BA.NumberToString(_esteclienteoriginal),_esteprod)))+", "+__c.SmartStringFormatter("",(Object)(_subs._traecantidadvendida /*int*/ (ba,BA.NumberToString(_esteclienteoriginal),_esteprod)))+""),0);
RDebugUtils.currentLine=50200609;
 //BA.debugLineNum = 50200609;BA.debugLine="LogColor($\"cantRechazada = ${cantRechazada}\"$,";
__c.LogImpl("250200609",("cantRechazada = "+__c.SmartStringFormatter("",(Object)(_cantrechazada))+""),__c.Colors.Magenta);
RDebugUtils.currentLine=50200610;
 //BA.debugLineNum = 50200610;BA.debugLine="Private estePrecio As String = 0";
_esteprecio = BA.NumberToString(0);
RDebugUtils.currentLine=50200611;
 //BA.debugLineNum = 50200611;BA.debugLine="If Subs.traePrecio(esteProd, 1) <> Null Then es";
if (_subs._traeprecio /*String*/ (ba,_esteprod,BA.NumberToString(1))!= null) { 
_esteprecio = BA.NumberToString((double)(Double.parseDouble(_subs._traeprecio /*String*/ (ba,_esteprod,_subs._traealmacen /*String*/ (ba))))*_cantrechazada);};
RDebugUtils.currentLine=50200616;
 //BA.debugLineNum = 50200616;BA.debugLine="Starter.skmt.ExecNonQuery2(\"update HIST_VENTAS";
_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("update HIST_VENTAS set HVD_PARCIAL = 1, HVD_CANT = ? WHERE HVD_PROID = ? and HVD_CLIENTE in (Select CUENTA from cuentaa)",anywheresoftware.b4a.keywords.Common.ArrayToList(new String[]{_cant1.getText(),_esteprod}));
RDebugUtils.currentLine=50200617;
 //BA.debugLineNum = 50200617;BA.debugLine="Private rr As Cursor = Starter.skmt.ExecQuery($";
_rr = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_rr = (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 count(REP_CLIENTE) as hayRechazo from REPARTO where rep_prodid = '"+__c.SmartStringFormatter("",(Object)(_esteprod))+"' and REP_CLIENTE in (Select CUENTA from cuentaa)"))));
RDebugUtils.currentLine=50200618;
 //BA.debugLineNum = 50200618;BA.debugLine="rr.Position = 0";
_rr.setPosition((int) (0));
RDebugUtils.currentLine=50200620;
 //BA.debugLineNum = 50200620;BA.debugLine="If rr.GetString(\"hayRechazo\") = 0 Then";
if ((_rr.GetString("hayRechazo")).equals(BA.NumberToString(0))) { 
RDebugUtils.currentLine=50200621;
 //BA.debugLineNum = 50200621;BA.debugLine="Log(\"INSERTAMOS EN REPARTO\")";
__c.LogImpl("250200621","INSERTAMOS EN REPARTO",0);
RDebugUtils.currentLine=50200622;
 //BA.debugLineNum = 50200622;BA.debugLine="Starter.skmt.ExecNonQuery2(\"insert into repart";
_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("insert into reparto(REP_CLIENTE, REP_PRONOMBRE, REP_CANT, REP_COSTO_TOT, REP_FECHA, REP_RECHAZO, REP_PRODID, REP_PRECIO, REP_CLI_ORIG)  VALUES (?,?,?,?,?,1,?,?,?) ",anywheresoftware.b4a.keywords.Common.ArrayToList(new String[]{_estecliente,_esteprodnombre,BA.NumberToString(0),_esteprecio,_fechareparto,_esteprod,_esteprecio,_estecliente}));
RDebugUtils.currentLine=50200623;
 //BA.debugLineNum = 50200623;BA.debugLine="Starter.skmt.ExecNonQuery2(\"insert into repart";
_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("insert into reparto(REP_CLIENTE, REP_PRONOMBRE, REP_CANT, REP_COSTO_TOT, REP_FECHA, REP_RECHAZO, REP_PRODID, REP_PRECIO, REP_CLI_ORIG)  VALUES (?,?,?,?,?,0,?,?,?) ",anywheresoftware.b4a.keywords.Common.ArrayToList(new String[]{_estecliente,_esteprodnombre,BA.NumberToString(_cantrechazada),BA.NumberToString(0),_fechareparto,_esteprod,_esteprecio,_estecliente}));
 }else 
{RDebugUtils.currentLine=50200624;
 //BA.debugLineNum = 50200624;BA.debugLine="Else if esteClienteOriginal = \"0\" Then 'Actuali";
if (_esteclienteoriginal==(double)(Double.parseDouble("0"))) { 
 }else {
RDebugUtils.currentLine=50200628;
 //BA.debugLineNum = 50200628;BA.debugLine="Log($\"Actualizamos REP_CANT RECHAZO = ${cantRe";
__c.LogImpl("250200628",("Actualizamos REP_CANT RECHAZO = "+__c.SmartStringFormatter("",(Object)(_cantrechazada))+""),0);
 }}
;
RDebugUtils.currentLine=50200633;
 //BA.debugLineNum = 50200633;BA.debugLine="If cant1.Text > 0 Then";
if ((double)(Double.parseDouble(_cant1.getText()))>0) { 
RDebugUtils.currentLine=50200636;
 //BA.debugLineNum = 50200636;BA.debugLine="Private m As Map";
_m = new anywheresoftware.b4a.objects.collections.Map();
RDebugUtils.currentLine=50200637;
 //BA.debugLineNum = 50200637;BA.debugLine="m=CreateMap(\"cant\":cant1.Text, \"cant2\":esteTag";
_m = __c.createMap(new Object[] {(Object)("cant"),(Object)(_cant1.getText()),(Object)("cant2"),_estetag.Get((int) (4)),(Object)("precio"),_estetag.Get((int) (0)),(Object)("promo"),_estetag.Get((int) (3)),(Object)("nombre"),(Object)(_subs._traenombre /*String*/ (ba,BA.ObjectToString(_estetag.Get((int) (2))))),(Object)("cli_orig"),_estetag.Get((int) (5))});
RDebugUtils.currentLine=50200639;
 //BA.debugLineNum = 50200639;BA.debugLine="prodsMap.Put(esteTag.Get(2), m)";
__ref._prodsmap /*anywheresoftware.b4a.objects.collections.Map*/ .Put(_estetag.Get((int) (2)),(Object)(_m.getObject()));
 };
RDebugUtils.currentLine=50200641;
 //BA.debugLineNum = 50200641;BA.debugLine="Log(\"-------------------------------------\")";
__c.LogImpl("250200641","-------------------------------------",0);
 }
};
 };
RDebugUtils.currentLine=50200644;
 //BA.debugLineNum = 50200644;BA.debugLine="Private bgColor, textColor As Int";
_bgcolor = 0;
_textcolor = 0;
RDebugUtils.currentLine=50200646;
 //BA.debugLineNum = 50200646;BA.debugLine="If reconstruirPedido Then";
if (__ref._reconstruirpedido /*boolean*/ ) { 
RDebugUtils.currentLine=50200647;
 //BA.debugLineNum = 50200647;BA.debugLine="Log(\"***********  CUENTAPRODS - SI RECONSTRUIR\")";
__c.LogImpl("250200647","***********  CUENTAPRODS - SI RECONSTRUIR",0);
RDebugUtils.currentLine=50200648;
 //BA.debugLineNum = 50200648;BA.debugLine="Private newPromo, newPrecio As String";
_newpromo = "";
_newprecio = "";
RDebugUtils.currentLine=50200649;
 //BA.debugLineNum = 50200649;BA.debugLine="clv_pedido.Clear";
__ref._clv_pedido /*b4a.example3.customlistview*/ ._clear();
RDebugUtils.currentLine=50200650;
 //BA.debugLineNum = 50200650;BA.debugLine="Log(\"Usamos PRODSMAP\")";
__c.LogImpl("250200650","Usamos PRODSMAP",0);
RDebugUtils.currentLine=50200651;
 //BA.debugLineNum = 50200651;BA.debugLine="For Each pr As String In prodsMap.Keys";
{
final anywheresoftware.b4a.BA.IterableList group53 = __ref._prodsmap /*anywheresoftware.b4a.objects.collections.Map*/ .Keys();
final int groupLen53 = group53.getSize()
;int index53 = 0;
;
for (; index53 < groupLen53;index53++){
_pr = BA.ObjectToString(group53.Get(index53));
RDebugUtils.currentLine=50200652;
 //BA.debugLineNum = 50200652;BA.debugLine="Private pr1 As Map = prodsMap.Get(pr)";
_pr1 = new anywheresoftware.b4a.objects.collections.Map();
_pr1 = (anywheresoftware.b4a.objects.collections.Map) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.collections.Map(), (java.util.Map)(__ref._prodsmap /*anywheresoftware.b4a.objects.collections.Map*/ .Get((Object)(_pr))));
RDebugUtils.currentLine=50200653;
 //BA.debugLineNum = 50200653;BA.debugLine="Log(\"PPP: \" & pr & \"|PromoABorrar=\" & promoABor";
__c.LogImpl("250200653","PPP: "+_pr+"|PromoABorrar="+__ref._promoaborrar /*String*/ +"|"+BA.ObjectToString(_pr1),0);
RDebugUtils.currentLine=50200654;
 //BA.debugLineNum = 50200654;BA.debugLine="bgColor = Colors.RGB(177, 200, 249)'azul";
_bgcolor = __c.Colors.RGB((int) (177),(int) (200),(int) (249));
RDebugUtils.currentLine=50200655;
 //BA.debugLineNum = 50200655;BA.debugLine="textColor = Colors.black";
_textcolor = __c.Colors.Black;
RDebugUtils.currentLine=50200656;
 //BA.debugLineNum = 50200656;BA.debugLine="newPromo = pr1.Get(\"promo\")";
_newpromo = BA.ObjectToString(_pr1.Get((Object)("promo")));
RDebugUtils.currentLine=50200657;
 //BA.debugLineNum = 50200657;BA.debugLine="newPrecio = pr1.Get(\"precio\")";
_newprecio = BA.ObjectToString(_pr1.Get((Object)("precio")));
RDebugUtils.currentLine=50200658;
 //BA.debugLineNum = 50200658;BA.debugLine="Log(\"AAA: \" & newPromo & \"|\" & promoABorrar)";
__c.LogImpl("250200658","AAA: "+_newpromo+"|"+__ref._promoaborrar /*String*/ ,0);
RDebugUtils.currentLine=50200659;
 //BA.debugLineNum = 50200659;BA.debugLine="If newPromo = promoABorrar Then";
if ((_newpromo).equals(__ref._promoaborrar /*String*/ )) { 
RDebugUtils.currentLine=50200660;
 //BA.debugLineNum = 50200660;BA.debugLine="newPromo = 1";
_newpromo = BA.NumberToString(1);
RDebugUtils.currentLine=50200661;
 //BA.debugLineNum = 50200661;BA.debugLine="newPrecio = Subs.traePrecio(pr, False) * pr1.G";
_newprecio = BA.NumberToString((double)(Double.parseDouble(_subs._traeprecio /*String*/ (ba,_pr,BA.ObjectToString(__c.False))))*(double)(BA.ObjectToNumber(_pr1.Get((Object)("cant")))));
RDebugUtils.currentLine=50200663;
 //BA.debugLineNum = 50200663;BA.debugLine="Starter.skmt.ExecNonQuery($\"update HIST_VENTAS";
_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("update HIST_VENTAS set HVD_COSTO_TOT = "+__c.SmartStringFormatter("",(Object)(_newprecio))+", HVD_CODPROMO = '"+__c.SmartStringFormatter("",(Object)(_subs._traealmacen /*String*/ (ba)))+"' WHERE HVD_PRONOMBRE = '"+__c.SmartStringFormatter("",_pr1.Get((Object)("nombre")))+"' and HVD_cliente in (Select CUENTA from cuentaa)"));
RDebugUtils.currentLine=50200664;
 //BA.debugLineNum = 50200664;BA.debugLine="LogColor(\"CAMBIAMOS PROMO: \" & newPromo, Color";
__c.LogImpl("250200664","CAMBIAMOS PROMO: "+_newpromo,__c.Colors.Magenta);
 };
RDebugUtils.currentLine=50200666;
 //BA.debugLineNum = 50200666;BA.debugLine="If newPromo <> \"1\" Then";
if ((_newpromo).equals("1") == false) { 
RDebugUtils.currentLine=50200668;
 //BA.debugLineNum = 50200668;BA.debugLine="bgColor = Colors.White";
_bgcolor = __c.Colors.White;
 };
RDebugUtils.currentLine=50200670;
 //BA.debugLineNum = 50200670;BA.debugLine="Log($\"CLI: ${pr1.Get(\"nombre\")}, ${newPrecio},";
__c.LogImpl("250200670",("CLI: "+__c.SmartStringFormatter("",_pr1.Get((Object)("nombre")))+", "+__c.SmartStringFormatter("",(Object)(_newprecio))+", "+__c.SmartStringFormatter("",_pr1.Get((Object)("cant")))+", "+__c.SmartStringFormatter("",_pr1.Get((Object)("cant2")))+""),0);
RDebugUtils.currentLine=50200671;
 //BA.debugLineNum = 50200671;BA.debugLine="clv_pedido.Add(CreateListItem(pr1.Get(\"nombre\")";
__ref._clv_pedido /*b4a.example3.customlistview*/ ._add((anywheresoftware.b4a.objects.B4XViewWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.B4XViewWrapper(), (java.lang.Object)(__ref._createlistitem /*anywheresoftware.b4a.objects.PanelWrapper*/ (null,BA.ObjectToString(_pr1.Get((Object)("nombre"))),_newprecio,(int)(BA.ObjectToNumber(_pr1.Get((Object)("cant")))),(int)(BA.ObjectToNumber(_pr1.Get((Object)("cant2")))),__ref._clv_pedido /*b4a.example3.customlistview*/ ._asview().getWidth(),__c.DipToCurrent((int) (50)),__ref._bmp /*anywheresoftware.b4a.objects.drawable.CanvasWrapper.BitmapWrapper*/ ,_pr,_bgcolor,_textcolor,_newpromo,BA.ObjectToString(_pr1.Get((Object)("cli_orig")))).getObject())),_pr1.Get((Object)("nombre")));
RDebugUtils.currentLine=50200672;
 //BA.debugLineNum = 50200672;BA.debugLine="reconstruirPedido = False";
__ref._reconstruirpedido /*boolean*/  = __c.False;
 }
};
RDebugUtils.currentLine=50200674;
 //BA.debugLineNum = 50200674;BA.debugLine="promoABorrar = \"\"";
__ref._promoaborrar /*String*/  = "";
 };
RDebugUtils.currentLine=50200676;
 //BA.debugLineNum = 50200676;BA.debugLine="Log($\"Total Prods: ${totalProds}, Total Compra: $";
__c.LogImpl("250200676",("Total Prods: "+__c.SmartStringFormatter("",(Object)(__ref._totalprods /*int*/ ))+", Total Compra: $"+__c.SmartStringFormatter("1.2",(Object)(__ref._totalcompra /*int*/ ))+""),0);
RDebugUtils.currentLine=50200677;
 //BA.debugLineNum = 50200677;BA.debugLine="LogColor(\"prodsMap=\" & prodsMap, Colors.Green)";
__c.LogImpl("250200677","prodsMap="+BA.ObjectToString(__ref._prodsmap /*anywheresoftware.b4a.objects.collections.Map*/ ),__c.Colors.Green);
RDebugUtils.currentLine=50200680;
 //BA.debugLineNum = 50200680;BA.debugLine="LogColor(prodsMap, Colors.Blue)";
__c.LogImpl("250200680",BA.ObjectToString(__ref._prodsmap /*anywheresoftware.b4a.objects.collections.Map*/ ),__c.Colors.Blue);
RDebugUtils.currentLine=50200681;
 //BA.debugLineNum = 50200681;BA.debugLine="c = Starter.skmt.ExecQuery($\"SELECT sum(HVD_CANT)";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/  = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery(("SELECT sum(HVD_CANT) as CANTIDAD FROM HIST_VENTAS WHERE HVD_CLIENTE IN (SELECT CUENTA FROM CUENTAA)"))));
RDebugUtils.currentLine=50200682;
 //BA.debugLineNum = 50200682;BA.debugLine="Dim cantidad1 As String = 0";
_cantidad1 = BA.NumberToString(0);
RDebugUtils.currentLine=50200683;
 //BA.debugLineNum = 50200683;BA.debugLine="If c.RowCount > 0 Then";
if (__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .getRowCount()>0) { 
RDebugUtils.currentLine=50200684;
 //BA.debugLineNum = 50200684;BA.debugLine="c.Position = 0";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition((int) (0));
RDebugUtils.currentLine=50200685;
 //BA.debugLineNum = 50200685;BA.debugLine="cantidad1 = c.GetString(\"CANTIDAD\")";
_cantidad1 = __ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CANTIDAD");
RDebugUtils.currentLine=50200686;
 //BA.debugLineNum = 50200686;BA.debugLine="L_CANT.Text = Round(cantidad1)";
__ref._l_cant /*anywheresoftware.b4a.objects.LabelWrapper*/ .setText(BA.ObjectToCharSequence(__c.Round((double)(Double.parseDouble(_cantidad1)))));
 };
RDebugUtils.currentLine=50200688;
 //BA.debugLineNum = 50200688;BA.debugLine="c.Close";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .Close();
RDebugUtils.currentLine=50200690;
 //BA.debugLineNum = 50200690;BA.debugLine="Dim totalfinal As String = 0";
_totalfinal = BA.NumberToString(0);
RDebugUtils.currentLine=50200691;
 //BA.debugLineNum = 50200691;BA.debugLine="For Each pr As String In prodsMap.Keys";
{
final anywheresoftware.b4a.BA.IterableList group88 = __ref._prodsmap /*anywheresoftware.b4a.objects.collections.Map*/ .Keys();
final int groupLen88 = group88.getSize()
;int index88 = 0;
;
for (; index88 < groupLen88;index88++){
_pr = BA.ObjectToString(group88.Get(index88));
RDebugUtils.currentLine=50200692;
 //BA.debugLineNum = 50200692;BA.debugLine="Private pr1 As Map = prodsMap.Get(pr)";
_pr1 = new anywheresoftware.b4a.objects.collections.Map();
_pr1 = (anywheresoftware.b4a.objects.collections.Map) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.collections.Map(), (java.util.Map)(__ref._prodsmap /*anywheresoftware.b4a.objects.collections.Map*/ .Get((Object)(_pr))));
RDebugUtils.currentLine=50200694;
 //BA.debugLineNum = 50200694;BA.debugLine="Dim x As Cursor = Starter.skmt.ExecQuery($\"SELEC";
_x = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_x = (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_ID = '"+__c.SmartStringFormatter("",(Object)(_pr))+"'"))));
RDebugUtils.currentLine=50200695;
 //BA.debugLineNum = 50200695;BA.debugLine="c = Starter.skmt.ExecQuery($\"SELECT HVD_CANT FRO";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/  = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery(("SELECT HVD_CANT FROM HIST_VENTAS WHERE HVD_CLIENTE IN (SELECT CUENTA FROM CUENTAA) AND HVD_PROID ='"+__c.SmartStringFormatter("",(Object)(_pr))+"' "))));
RDebugUtils.currentLine=50200696;
 //BA.debugLineNum = 50200696;BA.debugLine="Dim cantidady As String = 0";
_cantidady = BA.NumberToString(0);
RDebugUtils.currentLine=50200697;
 //BA.debugLineNum = 50200697;BA.debugLine="If c.RowCount >0 Then";
if (__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .getRowCount()>0) { 
RDebugUtils.currentLine=50200698;
 //BA.debugLineNum = 50200698;BA.debugLine="c.Position = 0";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition((int) (0));
RDebugUtils.currentLine=50200699;
 //BA.debugLineNum = 50200699;BA.debugLine="cantidady = c.GetString(\"HVD_CANT\")";
_cantidady = __ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("HVD_CANT");
 };
RDebugUtils.currentLine=50200702;
 //BA.debugLineNum = 50200702;BA.debugLine="If x.RowCount > 0 Then";
if (_x.getRowCount()>0) { 
RDebugUtils.currentLine=50200703;
 //BA.debugLineNum = 50200703;BA.debugLine="x.Position = 0";
_x.setPosition((int) (0));
RDebugUtils.currentLine=50200705;
 //BA.debugLineNum = 50200705;BA.debugLine="Dim preciou As String = x.GetString(\"CAT_GP_PRE";
_preciou = _x.GetString("CAT_GP_PRECIO");
RDebugUtils.currentLine=50200706;
 //BA.debugLineNum = 50200706;BA.debugLine="Dim costototalhist  As String = preciou * canti";
_costototalhist = BA.NumberToString((double)(Double.parseDouble(_preciou))*(double)(Double.parseDouble(_cantidady)));
 };
RDebugUtils.currentLine=50200709;
 //BA.debugLineNum = 50200709;BA.debugLine="totalfinal = totalfinal + costototalhist";
_totalfinal = BA.NumberToString((double)(Double.parseDouble(_totalfinal))+(double)(Double.parseDouble(_costototalhist)));
RDebugUtils.currentLine=50200710;
 //BA.debugLineNum = 50200710;BA.debugLine="x.Close";
_x.Close();
 }
};
RDebugUtils.currentLine=50200712;
 //BA.debugLineNum = 50200712;BA.debugLine="L_TOTAL.Text = Round2(totalfinal, 2)";
__ref._l_total /*anywheresoftware.b4a.objects.LabelWrapper*/ .setText(BA.ObjectToCharSequence(__c.Round2((double)(Double.parseDouble(_totalfinal)),(int) (2))));
RDebugUtils.currentLine=50200713;
 //BA.debugLineNum = 50200713;BA.debugLine="c.Close";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .Close();
RDebugUtils.currentLine=50200715;
 //BA.debugLineNum = 50200715;BA.debugLine="c = Starter.skmt.ExecQuery(\"select COUNT(*) AS CU";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/  = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select COUNT(*) AS CUANTOS from REPARTO where REP_CLIENTE in (select cuenta from cuentaa) and REP_RECHAZO = '0' and REP_CANT > 0 order by REP_PRONOMBRE")));
RDebugUtils.currentLine=50200716;
 //BA.debugLineNum = 50200716;BA.debugLine="If c.RowCount > 0 Then";
if (__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .getRowCount()>0) { 
RDebugUtils.currentLine=50200717;
 //BA.debugLineNum = 50200717;BA.debugLine="c.Position = 0";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition((int) (0));
RDebugUtils.currentLine=50200718;
 //BA.debugLineNum = 50200718;BA.debugLine="If c.GetString(\"CUANTOS\") > 0 Then";
if ((double)(Double.parseDouble(__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CUANTOS")))>0) { 
RDebugUtils.currentLine=50200720;
 //BA.debugLineNum = 50200720;BA.debugLine="Dim z As Cursor = Starter.skmt.ExecQuery($\"sele";
_z = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_z = (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 SUM(REP_CANT) AS CANTIDAD , SUM(REP_PRECIO) AS PRECIO from REPARTO where REP_CLIENTE in (select cuenta from cuentaa) and REP_RECHAZO = '0' and REP_CANT > 0 order by REP_PRONOMBRE"))));
RDebugUtils.currentLine=50200721;
 //BA.debugLineNum = 50200721;BA.debugLine="Dim cantidad2 As String = 0";
_cantidad2 = BA.NumberToString(0);
RDebugUtils.currentLine=50200723;
 //BA.debugLineNum = 50200723;BA.debugLine="If z.RowCount > 0 Then";
if (_z.getRowCount()>0) { 
RDebugUtils.currentLine=50200724;
 //BA.debugLineNum = 50200724;BA.debugLine="z.Position = 0";
_z.setPosition((int) (0));
RDebugUtils.currentLine=50200725;
 //BA.debugLineNum = 50200725;BA.debugLine="cantidad2= z.GetString(\"CANTIDAD\")";
_cantidad2 = _z.GetString("CANTIDAD");
RDebugUtils.currentLine=50200728;
 //BA.debugLineNum = 50200728;BA.debugLine="L_CANT.Text = Round((cantidad1 + cantidad2))";
__ref._l_cant /*anywheresoftware.b4a.objects.LabelWrapper*/ .setText(BA.ObjectToCharSequence(__c.Round(((double)(Double.parseDouble(_cantidad1))+(double)(Double.parseDouble(_cantidad2))))));
 };
RDebugUtils.currentLine=50200730;
 //BA.debugLineNum = 50200730;BA.debugLine="z.Close";
_z.Close();
 };
 };
RDebugUtils.currentLine=50200738;
 //BA.debugLineNum = 50200738;BA.debugLine="End Sub";
return "";
}
public String  _gps_locationchanged(reparto_intmex.keymon.lat.c_historico __ref,anywheresoftware.b4a.gps.LocationWrapper _location1) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_historico";
if (Debug.shouldDelegate(ba, "gps_locationchanged", false))
	 {return ((String) Debug.delegate(ba, "gps_locationchanged", new Object[] {_location1}));}
RDebugUtils.currentLine=49676288;
 //BA.debugLineNum = 49676288;BA.debugLine="Sub GPS_LocationChanged (Location1 As Location)";
RDebugUtils.currentLine=49676291;
 //BA.debugLineNum = 49676291;BA.debugLine="End Sub";
return "";
}
public Object  _initialize(reparto_intmex.keymon.lat.c_historico __ref,anywheresoftware.b4a.BA _ba) throws Exception{
__ref = this;
innerInitialize(_ba);
RDebugUtils.currentModule="c_historico";
if (Debug.shouldDelegate(ba, "initialize", false))
	 {return ((Object) Debug.delegate(ba, "initialize", new Object[] {_ba}));}
RDebugUtils.currentLine=49479680;
 //BA.debugLineNum = 49479680;BA.debugLine="Public Sub Initialize As Object";
RDebugUtils.currentLine=49479681;
 //BA.debugLineNum = 49479681;BA.debugLine="Return Me";
if (true) return this;
RDebugUtils.currentLine=49479682;
 //BA.debugLineNum = 49479682;BA.debugLine="End Sub";
return null;
}
public String  _l_pcant_click(reparto_intmex.keymon.lat.c_historico __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_historico";
if (Debug.shouldDelegate(ba, "l_pcant_click", false))
	 {return ((String) Debug.delegate(ba, "l_pcant_click", null));}
RDebugUtils.currentLine=50331648;
 //BA.debugLineNum = 50331648;BA.debugLine="Private Sub l_pCant_Click";
RDebugUtils.currentLine=50331650;
 //BA.debugLineNum = 50331650;BA.debugLine="End Sub";
return "";
}
public String  _listview1_itemlongclick(reparto_intmex.keymon.lat.c_historico __ref,int _position,Object _value) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_historico";
if (Debug.shouldDelegate(ba, "listview1_itemlongclick", false))
	 {return ((String) Debug.delegate(ba, "listview1_itemlongclick", new Object[] {_position,_value}));}
RDebugUtils.currentLine=49872896;
 //BA.debugLineNum = 49872896;BA.debugLine="Sub ListView1_ItemLongClick (Position As Int, Valu";
RDebugUtils.currentLine=49872940;
 //BA.debugLineNum = 49872940;BA.debugLine="End Sub";
return "";
}
public String  _lv2_itemclick(reparto_intmex.keymon.lat.c_historico __ref,int _position,Object _value) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_historico";
if (Debug.shouldDelegate(ba, "lv2_itemclick", false))
	 {return ((String) Debug.delegate(ba, "lv2_itemclick", new Object[] {_position,_value}));}
RDebugUtils.currentLine=49938432;
 //BA.debugLineNum = 49938432;BA.debugLine="Sub lv2_ItemClick (Position As Int, Value As Objec";
RDebugUtils.currentLine=49938493;
 //BA.debugLineNum = 49938493;BA.debugLine="End Sub";
return "";
}
public String  _p_prods_click(reparto_intmex.keymon.lat.c_historico __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_historico";
if (Debug.shouldDelegate(ba, "p_prods_click", false))
	 {return ((String) Debug.delegate(ba, "p_prods_click", null));}
RDebugUtils.currentLine=50397184;
 //BA.debugLineNum = 50397184;BA.debugLine="Sub p_prods_Click";
RDebugUtils.currentLine=50397185;
 //BA.debugLineNum = 50397185;BA.debugLine="Log(Sender.As(Panel).tag)";
__c.LogImpl("250397185",BA.ObjectToString(((anywheresoftware.b4a.objects.PanelWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.PanelWrapper(), (android.view.ViewGroup)(__c.Sender(ba)))).getTag()),0);
RDebugUtils.currentLine=50397186;
 //BA.debugLineNum = 50397186;BA.debugLine="End Sub";
return "";
}
}