package reparto_izca.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_izca.keymon.lat.c_historico");
            if (htSubs == null) {
                ba.loadHtSubs(this.getClass());
                htSubs = ba.htSubs;
            }
            
        }
        if (BA.isShellModeRuntimeCheck(ba)) 
			   this.getClass().getMethod("_class_globals", reparto_izca.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_izca.keymon.lat.main _main = null;
public reparto_izca.keymon.lat.appupdater _appupdater = null;
public reparto_izca.keymon.lat.subs _subs = null;
public reparto_izca.keymon.lat.foto _foto = null;
public reparto_izca.keymon.lat.mapa_cliente _mapa_cliente = null;
public reparto_izca.keymon.lat.mapa_rutas _mapa_rutas = null;
public reparto_izca.keymon.lat.starter _starter = null;
public reparto_izca.keymon.lat.tracker _tracker = null;
public reparto_izca.keymon.lat.newinst2 _newinst2 = null;
public reparto_izca.keymon.lat.b4xpages _b4xpages = null;
public reparto_izca.keymon.lat.b4xcollections _b4xcollections = null;
public reparto_izca.keymon.lat.httputils2service _httputils2service = null;
public reparto_izca.keymon.lat.xuiviewsutils _xuiviewsutils = null;
public String  _b_guardar_click(reparto_izca.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=22347776;
 //BA.debugLineNum = 22347776;BA.debugLine="Private Sub b_guardar_Click";
RDebugUtils.currentLine=22347778;
 //BA.debugLineNum = 22347778;BA.debugLine="End Sub";
return "";
}
public String  _b_prodmas_click(reparto_izca.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=22216704;
 //BA.debugLineNum = 22216704;BA.debugLine="Sub b_prodMas_Click";
RDebugUtils.currentLine=22216705;
 //BA.debugLineNum = 22216705;BA.debugLine="etCantHasFocus = False";
__ref._etcanthasfocus /*boolean*/  = __c.False;
RDebugUtils.currentLine=22216707;
 //BA.debugLineNum = 22216707;BA.debugLine="LogColor(\"b_prodMas_Click\", Colors.Magenta)";
__c.LogImpl("822216707","b_prodMas_Click",__c.Colors.Magenta);
RDebugUtils.currentLine=22216708;
 //BA.debugLineNum = 22216708;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=22216709;
 //BA.debugLineNum = 22216709;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=22216710;
 //BA.debugLineNum = 22216710;BA.debugLine="Dim pnl As B4XView = pnl0.GetView(0)";
_pnl = new anywheresoftware.b4a.objects.B4XViewWrapper();
_pnl = _pnl0.GetView((int) (0));
RDebugUtils.currentLine=22216711;
 //BA.debugLineNum = 22216711;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=22216715;
 //BA.debugLineNum = 22216715;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=22216716;
 //BA.debugLineNum = 22216716;BA.debugLine="Log(\"LC_TEXT:\"&laCant.Text&\"|LC_TAG:\"&laCant.Tag&";
__c.LogImpl("822216716","LC_TEXT:"+_lacant.getText()+"|LC_TAG:"+BA.ObjectToString(_lacant.getTag())+"|ET:"+BA.ObjectToString(_estetag),0);
RDebugUtils.currentLine=22216717;
 //BA.debugLineNum = 22216717;BA.debugLine="If laCant.Text = \"\" Then laCant.Text = 0";
if ((_lacant.getText()).equals("")) { 
_lacant.setText(BA.ObjectToCharSequence(0));};
RDebugUtils.currentLine=22216719;
 //BA.debugLineNum = 22216719;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=22216721;
 //BA.debugLineNum = 22216721;BA.debugLine="LogColor($\"++++++++++++++++++++++++++   ${esteTag";
__c.LogImpl("822216721",("++++++++++++++++++++++++++   "+__c.SmartStringFormatter("",(Object)(_estetag.getObject()))+""),__c.Colors.Green);
RDebugUtils.currentLine=22216723;
 //BA.debugLineNum = 22216723;BA.debugLine="If laCant.Text + 1 <= maxProds Then";
if ((double)(Double.parseDouble(_lacant.getText()))+1<=(double)(Double.parseDouble(_maxprods))) { 
RDebugUtils.currentLine=22216724;
 //BA.debugLineNum = 22216724;BA.debugLine="Log($\"NuevaCant = ${laCant.Text + 1}\"$)";
__c.LogImpl("822216724",("NuevaCant = "+__c.SmartStringFormatter("",(Object)((double)(Double.parseDouble(_lacant.getText()))+1))+""),0);
RDebugUtils.currentLine=22216725;
 //BA.debugLineNum = 22216725;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=22216726;
 //BA.debugLineNum = 22216726;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=22216727;
 //BA.debugLineNum = 22216727;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=22216728;
 //BA.debugLineNum = 22216728;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=22216729;
 //BA.debugLineNum = 22216729;BA.debugLine="L_CANT.Text = cym.Get(\"cantidad\")";
__ref._l_cant /*anywheresoftware.b4a.objects.LabelWrapper*/ .setText(BA.ObjectToCharSequence(_cym.Get((Object)("cantidad"))));
RDebugUtils.currentLine=22216730;
 //BA.debugLineNum = 22216730;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=22216747;
 //BA.debugLineNum = 22216747;BA.debugLine="End Sub";
return "";
}
public String  _b_prodmenos_click(reparto_izca.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=22151168;
 //BA.debugLineNum = 22151168;BA.debugLine="Sub b_prodMenos_Click";
RDebugUtils.currentLine=22151169;
 //BA.debugLineNum = 22151169;BA.debugLine="etCantHasFocus = False";
__ref._etcanthasfocus /*boolean*/  = __c.False;
RDebugUtils.currentLine=22151170;
 //BA.debugLineNum = 22151170;BA.debugLine="Log(\"etCantHasFocus=\" & etCantHasFocus)";
__c.LogImpl("822151170","etCantHasFocus="+BA.ObjectToString(__ref._etcanthasfocus /*boolean*/ ),0);
RDebugUtils.currentLine=22151171;
 //BA.debugLineNum = 22151171;BA.debugLine="LogColor(\"b_prodMenos_Click\", Colors.Magenta)";
__c.LogImpl("822151171","b_prodMenos_Click",__c.Colors.Magenta);
RDebugUtils.currentLine=22151172;
 //BA.debugLineNum = 22151172;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=22151173;
 //BA.debugLineNum = 22151173;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=22151174;
 //BA.debugLineNum = 22151174;BA.debugLine="Dim pnl As B4XView = pnl0.GetView(0)";
_pnl = new anywheresoftware.b4a.objects.B4XViewWrapper();
_pnl = _pnl0.GetView((int) (0));
RDebugUtils.currentLine=22151175;
 //BA.debugLineNum = 22151175;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=22151177;
 //BA.debugLineNum = 22151177;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=22151178;
 //BA.debugLineNum = 22151178;BA.debugLine="Log(\"LC_TEXT:\"&laCant.Text&\"|PROMO:\"&esteTag.Get(";
__c.LogImpl("822151178","LC_TEXT:"+_lacant.getText()+"|PROMO:"+BA.ObjectToString(_estetag.Get((int) (3)))+"|LC_TAG:"+BA.ObjectToString(_lacant.getTag())+"|ET:"+BA.ObjectToString(_estetag),0);
RDebugUtils.currentLine=22151179;
 //BA.debugLineNum = 22151179;BA.debugLine="If esteTag.Get(3) <> \"1\" Then 'Si es PROMO entonc";
if ((_estetag.Get((int) (3))).equals((Object)("1")) == false) { 
RDebugUtils.currentLine=22151180;
 //BA.debugLineNum = 22151180;BA.debugLine="Log(\"ES PROMO\")";
__c.LogImpl("822151180","ES PROMO",0);
RDebugUtils.currentLine=22151181;
 //BA.debugLineNum = 22151181;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=22151182;
 //BA.debugLineNum = 22151182;BA.debugLine="If result = DialogResponse.POSITIVE Then 'Quitam";
if ((__ref._result /*String*/ ).equals(BA.NumberToString(__c.DialogResponse.POSITIVE))) { 
RDebugUtils.currentLine=22151183;
 //BA.debugLineNum = 22151183;BA.debugLine="prodsMap.Remove(esteTag.Get(3))";
__ref._prodsmap /*anywheresoftware.b4a.objects.collections.Map*/ .Remove(_estetag.Get((int) (3)));
RDebugUtils.currentLine=22151184;
 //BA.debugLineNum = 22151184;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=22151185;
 //BA.debugLineNum = 22151185;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=22151186;
 //BA.debugLineNum = 22151186;BA.debugLine="LogColor(prodsMap, Colors.red)";
__c.LogImpl("822151186",BA.ObjectToString(__ref._prodsmap /*anywheresoftware.b4a.objects.collections.Map*/ ),__c.Colors.Red);
RDebugUtils.currentLine=22151187;
 //BA.debugLineNum = 22151187;BA.debugLine="reconstruirPedido = True";
__ref._reconstruirpedido /*boolean*/  = __c.True;
RDebugUtils.currentLine=22151188;
 //BA.debugLineNum = 22151188;BA.debugLine="promoABorrar = esteTag.Get(3)";
__ref._promoaborrar /*String*/  = BA.ObjectToString(_estetag.Get((int) (3)));
RDebugUtils.currentLine=22151189;
 //BA.debugLineNum = 22151189;BA.debugLine="B4XPage_Appear";
__ref._b4xpage_appear /*String*/ (null);
 };
 }else {
RDebugUtils.currentLine=22151192;
 //BA.debugLineNum = 22151192;BA.debugLine="If laCant.Text = \"\" Then laCant.Text = 0";
if ((_lacant.getText()).equals("")) { 
_lacant.setText(BA.ObjectToCharSequence(0));};
RDebugUtils.currentLine=22151193;
 //BA.debugLineNum = 22151193;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=22151194;
 //BA.debugLineNum = 22151194;BA.debugLine="If laCant.Text < 0 Then laCant.Text = 0";
if ((double)(Double.parseDouble(_lacant.getText()))<0) { 
_lacant.setText(BA.ObjectToCharSequence(0));};
RDebugUtils.currentLine=22151195;
 //BA.debugLineNum = 22151195;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=22151197;
 //BA.debugLineNum = 22151197;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=22151198;
 //BA.debugLineNum = 22151198;BA.debugLine="Log(\"PU: \" & preciou)";
__c.LogImpl("822151198","PU: "+BA.NumberToString(_preciou),0);
RDebugUtils.currentLine=22151204;
 //BA.debugLineNum = 22151204;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=22151205;
 //BA.debugLineNum = 22151205;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=22151206;
 //BA.debugLineNum = 22151206;BA.debugLine="L_CANT.Text = cym.Get(\"cantidad\")";
__ref._l_cant /*anywheresoftware.b4a.objects.LabelWrapper*/ .setText(BA.ObjectToCharSequence(_cym.Get((Object)("cantidad"))));
RDebugUtils.currentLine=22151207;
 //BA.debugLineNum = 22151207;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=22151209;
 //BA.debugLineNum = 22151209;BA.debugLine="End Sub";
return "";
}
public String  _b4xpage_appear(reparto_izca.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=21692416;
 //BA.debugLineNum = 21692416;BA.debugLine="Sub B4XPage_Appear";
RDebugUtils.currentLine=21692417;
 //BA.debugLineNum = 21692417;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=21692421;
 //BA.debugLineNum = 21692421;BA.debugLine="L_CANT.Text =\"\"";
__ref._l_cant /*anywheresoftware.b4a.objects.LabelWrapper*/ .setText(BA.ObjectToCharSequence(""));
RDebugUtils.currentLine=21692422;
 //BA.debugLineNum = 21692422;BA.debugLine="L_TOTAL.Text=\"\"";
__ref._l_total /*anywheresoftware.b4a.objects.LabelWrapper*/ .setText(BA.ObjectToCharSequence(""));
RDebugUtils.currentLine=21692423;
 //BA.debugLineNum = 21692423;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=21692424;
 //BA.debugLineNum = 21692424;BA.debugLine="C.Position=0";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition((int) (0));
RDebugUtils.currentLine=21692425;
 //BA.debugLineNum = 21692425;BA.debugLine="Existe = C.GetString(\"EXISTE\")";
__ref._existe /*String*/  = __ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("EXISTE");
RDebugUtils.currentLine=21692426;
 //BA.debugLineNum = 21692426;BA.debugLine="C.Close";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .Close();
RDebugUtils.currentLine=21692428;
 //BA.debugLineNum = 21692428;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=21692429;
 //BA.debugLineNum = 21692429;BA.debugLine="ListView1.Clear";
__ref._listview1 /*anywheresoftware.b4a.objects.ListViewWrapper*/ .Clear();
RDebugUtils.currentLine=21692430;
 //BA.debugLineNum = 21692430;BA.debugLine="clv_pedido.Clear";
__ref._clv_pedido /*b4a.example3.customlistview*/ ._clear();
RDebugUtils.currentLine=21692431;
 //BA.debugLineNum = 21692431;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=21692432;
 //BA.debugLineNum = 21692432;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=21692433;
 //BA.debugLineNum = 21692433;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=21692435;
 //BA.debugLineNum = 21692435;BA.debugLine="If c.RowCount>0 Then";
if (__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .getRowCount()>0) { 
RDebugUtils.currentLine=21692437;
 //BA.debugLineNum = 21692437;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=21692438;
 //BA.debugLineNum = 21692438;BA.debugLine="c.Position=i";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition(_i);
RDebugUtils.currentLine=21692440;
 //BA.debugLineNum = 21692440;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=21692441;
 //BA.debugLineNum = 21692441;BA.debugLine="Private cant2 As Int = 0";
_cant2 = (int) (0);
RDebugUtils.currentLine=21692442;
 //BA.debugLineNum = 21692442;BA.debugLine="If oc.RowCount > 0 Then";
if (_oc.getRowCount()>0) { 
RDebugUtils.currentLine=21692443;
 //BA.debugLineNum = 21692443;BA.debugLine="oc.Position = 0";
_oc.setPosition((int) (0));
RDebugUtils.currentLine=21692444;
 //BA.debugLineNum = 21692444;BA.debugLine="cant2 = oc.GetString(\"HVD_CANT\")";
_cant2 = (int)(Double.parseDouble(_oc.GetString("HVD_CANT")));
 };
RDebugUtils.currentLine=21692446;
 //BA.debugLineNum = 21692446;BA.debugLine="oc.Close";
_oc.Close();
RDebugUtils.currentLine=21692447;
 //BA.debugLineNum = 21692447;BA.debugLine="Dim label1 As Label";
_label1 = new anywheresoftware.b4a.objects.LabelWrapper();
RDebugUtils.currentLine=21692448;
 //BA.debugLineNum = 21692448;BA.debugLine="label1 = ListView1.TwoLinesLayout.Label";
_label1 = __ref._listview1 /*anywheresoftware.b4a.objects.ListViewWrapper*/ .getTwoLinesLayout().Label;
RDebugUtils.currentLine=21692449;
 //BA.debugLineNum = 21692449;BA.debugLine="label1.TextSize = 12";
_label1.setTextSize((float) (12));
RDebugUtils.currentLine=21692450;
 //BA.debugLineNum = 21692450;BA.debugLine="label1.TextColor = Colors.black";
_label1.setTextColor(__c.Colors.Black);
RDebugUtils.currentLine=21692451;
 //BA.debugLineNum = 21692451;BA.debugLine="Dim label2 As Label";
_label2 = new anywheresoftware.b4a.objects.LabelWrapper();
RDebugUtils.currentLine=21692452;
 //BA.debugLineNum = 21692452;BA.debugLine="label2 = ListView1.TwoLinesLayout.SecondLabel";
_label2 = __ref._listview1 /*anywheresoftware.b4a.objects.ListViewWrapper*/ .getTwoLinesLayout().SecondLabel;
RDebugUtils.currentLine=21692453;
 //BA.debugLineNum = 21692453;BA.debugLine="label2.TextSize = 12";
_label2.setTextSize((float) (12));
RDebugUtils.currentLine=21692454;
 //BA.debugLineNum = 21692454;BA.debugLine="label2.TextColor = Colors.black";
_label2.setTextColor(__c.Colors.Black);
RDebugUtils.currentLine=21692455;
 //BA.debugLineNum = 21692455;BA.debugLine="Private bgColor, textColor As Int";
_bgcolor = 0;
_textcolor = 0;
RDebugUtils.currentLine=21692456;
 //BA.debugLineNum = 21692456;BA.debugLine="bgColor = Colors.RGB(177, 200, 249)'azul";
_bgcolor = __c.Colors.RGB((int) (177),(int) (200),(int) (249));
RDebugUtils.currentLine=21692457;
 //BA.debugLineNum = 21692457;BA.debugLine="textColor = Colors.black";
_textcolor = __c.Colors.Black;
RDebugUtils.currentLine=21692458;
 //BA.debugLineNum = 21692458;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=21692460;
 //BA.debugLineNum = 21692460;BA.debugLine="bgColor = Colors.White";
_bgcolor = __c.Colors.White;
 };
RDebugUtils.currentLine=21692464;
 //BA.debugLineNum = 21692464;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=21692469;
 //BA.debugLineNum = 21692469;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=21692470;
 //BA.debugLineNum = 21692470;BA.debugLine="Log($\"VENTA: ${vc.RowCount}\"$)";
__c.LogImpl("821692470",("VENTA: "+__c.SmartStringFormatter("",(Object)(_vc.getRowCount()))+""),0);
RDebugUtils.currentLine=21692471;
 //BA.debugLineNum = 21692471;BA.debugLine="If vc.RowCount > 0 Then";
if (_vc.getRowCount()>0) { 
RDebugUtils.currentLine=21692474;
 //BA.debugLineNum = 21692474;BA.debugLine="textColor = Colors.RGB(0,87,142)";
_textcolor = __c.Colors.RGB((int) (0),(int) (87),(int) (142));
RDebugUtils.currentLine=21692475;
 //BA.debugLineNum = 21692475;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=21692476;
 //BA.debugLineNum = 21692476;BA.debugLine="vc.Position = i";
_vc.setPosition(_i);
RDebugUtils.currentLine=21692477;
 //BA.debugLineNum = 21692477;BA.debugLine="Private cantCO As Int = 0";
_cantco = (int) (0);
RDebugUtils.currentLine=21692479;
 //BA.debugLineNum = 21692479;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=21692481;
 //BA.debugLineNum = 21692481;BA.debugLine="If cco.RowCount > 0 Then";
if (_cco.getRowCount()>0) { 
RDebugUtils.currentLine=21692482;
 //BA.debugLineNum = 21692482;BA.debugLine="cco.Position = 0";
_cco.setPosition((int) (0));
RDebugUtils.currentLine=21692483;
 //BA.debugLineNum = 21692483;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=21692485;
 //BA.debugLineNum = 21692485;BA.debugLine="cantCO = Subs.traeCantidadRechazada(vc.GetStrin";
_cantco = _subs._traecantidadrechazada /*int*/ (ba,_vc.GetString("REP_CLI_ORIG"),_vc.GetString("REP_PRODID"));
RDebugUtils.currentLine=21692488;
 //BA.debugLineNum = 21692488;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=21692490;
 //BA.debugLineNum = 21692490;BA.debugLine="cco.Close";
_cco.Close();
RDebugUtils.currentLine=21692491;
 //BA.debugLineNum = 21692491;BA.debugLine="vc.Close";
_vc.Close();
 };
RDebugUtils.currentLine=21692494;
 //BA.debugLineNum = 21692494;BA.debugLine="If Existe <> 0 Then";
if ((__ref._existe /*String*/ ).equals(BA.NumberToString(0)) == false) { 
RDebugUtils.currentLine=21692495;
 //BA.debugLineNum = 21692495;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=21692496;
 //BA.debugLineNum = 21692496;BA.debugLine="C.Position=0";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition((int) (0));
RDebugUtils.currentLine=21692497;
 //BA.debugLineNum = 21692497;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=21692498;
 //BA.debugLineNum = 21692498;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=21692500;
 //BA.debugLineNum = 21692500;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=21692501;
 //BA.debugLineNum = 21692501;BA.debugLine="c.Position=0";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition((int) (0));
RDebugUtils.currentLine=21692502;
 //BA.debugLineNum = 21692502;BA.debugLine="Existe = C.GetString(\"EXISTE\")";
__ref._existe /*String*/  = __ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("EXISTE");
RDebugUtils.currentLine=21692503;
 //BA.debugLineNum = 21692503;BA.debugLine="c.Close";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .Close();
RDebugUtils.currentLine=21692506;
 //BA.debugLineNum = 21692506;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=21692524;
 //BA.debugLineNum = 21692524;BA.debugLine="If Existe <> 0 Then";
if ((__ref._existe /*String*/ ).equals(BA.NumberToString(0)) == false) { 
RDebugUtils.currentLine=21692525;
 //BA.debugLineNum = 21692525;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=21692526;
 //BA.debugLineNum = 21692526;BA.debugLine="C.Position=0";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition((int) (0));
RDebugUtils.currentLine=21692527;
 //BA.debugLineNum = 21692527;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=21692528;
 //BA.debugLineNum = 21692528;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=21692532;
 //BA.debugLineNum = 21692532;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=21692533;
 //BA.debugLineNum = 21692533;BA.debugLine="L_CANT.Text = cym.Get(\"cantidad\")";
__ref._l_cant /*anywheresoftware.b4a.objects.LabelWrapper*/ .setText(BA.ObjectToCharSequence(_cym.Get((Object)("cantidad"))));
RDebugUtils.currentLine=21692534;
 //BA.debugLineNum = 21692534;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=21692535;
 //BA.debugLineNum = 21692535;BA.debugLine="End Sub";
return "";
}
public String  _b_regresar_click(reparto_izca.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=21823488;
 //BA.debugLineNum = 21823488;BA.debugLine="Sub b_regresar_Click";
RDebugUtils.currentLine=21823489;
 //BA.debugLineNum = 21823489;BA.debugLine="B4XPages.ShowPage(\"Cliente\")";
_b4xpages._showpage /*String*/ (ba,"Cliente");
RDebugUtils.currentLine=21823490;
 //BA.debugLineNum = 21823490;BA.debugLine="End Sub";
return "";
}
public anywheresoftware.b4a.objects.PanelWrapper  _createlistitem(reparto_izca.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=22085632;
 //BA.debugLineNum = 22085632;BA.debugLine="Sub CreateListItem(Text As String, precioU As Stri";
RDebugUtils.currentLine=22085633;
 //BA.debugLineNum = 22085633;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=22085634;
 //BA.debugLineNum = 22085634;BA.debugLine="Private cs As CSBuilder";
_cs = new anywheresoftware.b4a.objects.CSBuilder();
RDebugUtils.currentLine=22085635;
 //BA.debugLineNum = 22085635;BA.debugLine="cs.Initialize";
_cs.Initialize();
RDebugUtils.currentLine=22085636;
 //BA.debugLineNum = 22085636;BA.debugLine="p.SetLayoutAnimated(0, 0, 0, Width, Height)";
_p.SetLayoutAnimated((int) (0),(int) (0),(int) (0),_width,_height);
RDebugUtils.currentLine=22085637;
 //BA.debugLineNum = 22085637;BA.debugLine="p.LoadLayout(\"prodItem\")";
_p.LoadLayout("prodItem",ba);
RDebugUtils.currentLine=22085638;
 //BA.debugLineNum = 22085638;BA.debugLine="p_prods.Color = bc";
__ref._p_prods /*anywheresoftware.b4a.objects.PanelWrapper*/ .setColor(_bc);
RDebugUtils.currentLine=22085639;
 //BA.debugLineNum = 22085639;BA.debugLine="l_prodX.TextColor = tc";
__ref._l_prodx /*anywheresoftware.b4a.objects.LabelWrapper*/ .setTextColor(_tc);
RDebugUtils.currentLine=22085640;
 //BA.debugLineNum = 22085640;BA.debugLine="precioU = $\"$1.2{precioU}\"$";
_preciou = (""+__c.SmartStringFormatter("1.2",(Object)(_preciou))+"");
RDebugUtils.currentLine=22085641;
 //BA.debugLineNum = 22085641;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=22085642;
 //BA.debugLineNum = 22085642;BA.debugLine="If promo <> \"1\" And precioU = 0 Then";
if ((_promo).equals("1") == false && (_preciou).equals(BA.NumberToString(0))) { 
RDebugUtils.currentLine=22085643;
 //BA.debugLineNum = 22085643;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=22085645;
 //BA.debugLineNum = 22085645;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=22085647;
 //BA.debugLineNum = 22085647;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=22085648;
 //BA.debugLineNum = 22085648;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=22085649;
 //BA.debugLineNum = 22085649;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=22085651;
 //BA.debugLineNum = 22085651;BA.debugLine="l_pCant.Text = inv";
__ref._l_pcant /*anywheresoftware.b4a.objects.LabelWrapper*/ .setText(BA.ObjectToCharSequence(_inv));
RDebugUtils.currentLine=22085655;
 //BA.debugLineNum = 22085655;BA.debugLine="l_pCant.BringToFront";
__ref._l_pcant /*anywheresoftware.b4a.objects.LabelWrapper*/ .BringToFront();
RDebugUtils.currentLine=22085656;
 //BA.debugLineNum = 22085656;BA.debugLine="et_pCant.SendToBack";
__ref._et_pcant /*anywheresoftware.b4a.objects.EditTextWrapper*/ .SendToBack();
RDebugUtils.currentLine=22085659;
 //BA.debugLineNum = 22085659;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=22085660;
 //BA.debugLineNum = 22085660;BA.debugLine="End Sub";
return null;
}
public anywheresoftware.b4a.keywords.Common.ResumableSubWrapper  _b4xpage_closerequest(reparto_izca.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_izca.keymon.lat.c_historico parent,reparto_izca.keymon.lat.c_historico __ref) {
this.parent = parent;
this.__ref = __ref;
this.__ref = parent;
}
reparto_izca.keymon.lat.c_historico __ref;
reparto_izca.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=21889027;
 //BA.debugLineNum = 21889027;BA.debugLine="B4XPages.ShowPage(\"Cliente\")";
parent._b4xpages._showpage /*String*/ (ba,"Cliente");
RDebugUtils.currentLine=21889029;
 //BA.debugLineNum = 21889029;BA.debugLine="Return False";
if (true) {
parent.__c.ReturnFromResumableSub(this,(Object)(parent.__c.False));return;};
RDebugUtils.currentLine=21889030;
 //BA.debugLineNum = 21889030;BA.debugLine="End Sub";
if (true) break;

            }
        }
    }
}
public String  _b4xpage_created(reparto_izca.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=21626880;
 //BA.debugLineNum = 21626880;BA.debugLine="Private Sub B4XPage_Created (Root1 As B4XView)";
RDebugUtils.currentLine=21626881;
 //BA.debugLineNum = 21626881;BA.debugLine="Root = Root1";
__ref._root /*anywheresoftware.b4a.objects.B4XViewWrapper*/  = _root1;
RDebugUtils.currentLine=21626883;
 //BA.debugLineNum = 21626883;BA.debugLine="g.Initialize(\"GPS\")";
__ref._g /*anywheresoftware.b4a.gps.GPS*/ .Initialize("GPS");
RDebugUtils.currentLine=21626884;
 //BA.debugLineNum = 21626884;BA.debugLine="Root.LoadLayout(\"historico\")";
__ref._root /*anywheresoftware.b4a.objects.B4XViewWrapper*/ .LoadLayout("historico",ba);
RDebugUtils.currentLine=21626885;
 //BA.debugLineNum = 21626885;BA.debugLine="b_borra.Visible = False";
__ref._b_borra /*anywheresoftware.b4a.objects.ButtonWrapper*/ .setVisible(__c.False);
RDebugUtils.currentLine=21626886;
 //BA.debugLineNum = 21626886;BA.debugLine="Titulo.Text = \"Pedido\"";
__ref._titulo /*anywheresoftware.b4a.objects.LabelWrapper*/ .setText(BA.ObjectToCharSequence("Pedido"));
RDebugUtils.currentLine=21626887;
 //BA.debugLineNum = 21626887;BA.debugLine="End Sub";
return "";
}
public String  _class_globals(reparto_izca.keymon.lat.c_historico __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_historico";
RDebugUtils.currentLine=21495808;
 //BA.debugLineNum = 21495808;BA.debugLine="Sub Class_Globals";
RDebugUtils.currentLine=21495809;
 //BA.debugLineNum = 21495809;BA.debugLine="Private Root As B4XView 'ignore";
_root = new anywheresoftware.b4a.objects.B4XViewWrapper();
RDebugUtils.currentLine=21495810;
 //BA.debugLineNum = 21495810;BA.debugLine="Private xui As XUI 'ignore";
_xui = new anywheresoftware.b4a.objects.B4XViewWrapper.XUI();
RDebugUtils.currentLine=21495811;
 //BA.debugLineNum = 21495811;BA.debugLine="Dim g As GPS";
_g = new anywheresoftware.b4a.gps.GPS();
RDebugUtils.currentLine=21495812;
 //BA.debugLineNum = 21495812;BA.debugLine="Dim clie_id As String";
_clie_id = "";
RDebugUtils.currentLine=21495813;
 //BA.debugLineNum = 21495813;BA.debugLine="Dim sDate,sTime As String";
_sdate = "";
_stime = "";
RDebugUtils.currentLine=21495814;
 //BA.debugLineNum = 21495814;BA.debugLine="Dim usuario As String";
_usuario = "";
RDebugUtils.currentLine=21495815;
 //BA.debugLineNum = 21495815;BA.debugLine="Dim c As Cursor";
_c = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
RDebugUtils.currentLine=21495817;
 //BA.debugLineNum = 21495817;BA.debugLine="Dim b_regresar As Button";
_b_regresar = new anywheresoftware.b4a.objects.ButtonWrapper();
RDebugUtils.currentLine=21495818;
 //BA.debugLineNum = 21495818;BA.debugLine="Dim ListView1 As ListView";
_listview1 = new anywheresoftware.b4a.objects.ListViewWrapper();
RDebugUtils.currentLine=21495819;
 //BA.debugLineNum = 21495819;BA.debugLine="Dim L_CANT As Label";
_l_cant = new anywheresoftware.b4a.objects.LabelWrapper();
RDebugUtils.currentLine=21495820;
 //BA.debugLineNum = 21495820;BA.debugLine="Dim L_TOTAL As Label";
_l_total = new anywheresoftware.b4a.objects.LabelWrapper();
RDebugUtils.currentLine=21495821;
 //BA.debugLineNum = 21495821;BA.debugLine="Dim b_borra As Button";
_b_borra = new anywheresoftware.b4a.objects.ButtonWrapper();
RDebugUtils.currentLine=21495822;
 //BA.debugLineNum = 21495822;BA.debugLine="Dim Existe As String";
_existe = "";
RDebugUtils.currentLine=21495823;
 //BA.debugLineNum = 21495823;BA.debugLine="Dim result As String";
_result = "";
RDebugUtils.currentLine=21495825;
 //BA.debugLineNum = 21495825;BA.debugLine="Dim cuantos As String";
_cuantos = "";
RDebugUtils.currentLine=21495826;
 //BA.debugLineNum = 21495826;BA.debugLine="Dim nombre_prod As String";
_nombre_prod = "";
RDebugUtils.currentLine=21495827;
 //BA.debugLineNum = 21495827;BA.debugLine="Dim cuantos_pedido As String";
_cuantos_pedido = "";
RDebugUtils.currentLine=21495828;
 //BA.debugLineNum = 21495828;BA.debugLine="Private Titulo As Label";
_titulo = new anywheresoftware.b4a.objects.LabelWrapper();
RDebugUtils.currentLine=21495829;
 //BA.debugLineNum = 21495829;BA.debugLine="Private P1 As Panel";
_p1 = new anywheresoftware.b4a.objects.PanelWrapper();
RDebugUtils.currentLine=21495830;
 //BA.debugLineNum = 21495830;BA.debugLine="Private lv2 As ListView";
_lv2 = new anywheresoftware.b4a.objects.ListViewWrapper();
RDebugUtils.currentLine=21495831;
 //BA.debugLineNum = 21495831;BA.debugLine="Private p_principal As Panel";
_p_principal = new anywheresoftware.b4a.objects.PanelWrapper();
RDebugUtils.currentLine=21495832;
 //BA.debugLineNum = 21495832;BA.debugLine="Dim clv_pedido As CustomListView";
_clv_pedido = new b4a.example3.customlistview();
RDebugUtils.currentLine=21495833;
 //BA.debugLineNum = 21495833;BA.debugLine="Private p_prods As Panel";
_p_prods = new anywheresoftware.b4a.objects.PanelWrapper();
RDebugUtils.currentLine=21495834;
 //BA.debugLineNum = 21495834;BA.debugLine="Private l_prodX As Label";
_l_prodx = new anywheresoftware.b4a.objects.LabelWrapper();
RDebugUtils.currentLine=21495835;
 //BA.debugLineNum = 21495835;BA.debugLine="Private l_pCant As Label";
_l_pcant = new anywheresoftware.b4a.objects.LabelWrapper();
RDebugUtils.currentLine=21495836;
 //BA.debugLineNum = 21495836;BA.debugLine="Private et_pCant As EditText";
_et_pcant = new anywheresoftware.b4a.objects.EditTextWrapper();
RDebugUtils.currentLine=21495837;
 //BA.debugLineNum = 21495837;BA.debugLine="Dim bmp As Bitmap";
_bmp = new anywheresoftware.b4a.objects.drawable.CanvasWrapper.BitmapWrapper();
RDebugUtils.currentLine=21495838;
 //BA.debugLineNum = 21495838;BA.debugLine="Dim etCantHasFocus As Boolean = False";
_etcanthasfocus = __c.False;
RDebugUtils.currentLine=21495839;
 //BA.debugLineNum = 21495839;BA.debugLine="Dim totalProds As Int = 0";
_totalprods = (int) (0);
RDebugUtils.currentLine=21495840;
 //BA.debugLineNum = 21495840;BA.debugLine="Dim totalCompra As Int = 0";
_totalcompra = (int) (0);
RDebugUtils.currentLine=21495841;
 //BA.debugLineNum = 21495841;BA.debugLine="Dim prodsMap As Map";
_prodsmap = new anywheresoftware.b4a.objects.collections.Map();
RDebugUtils.currentLine=21495842;
 //BA.debugLineNum = 21495842;BA.debugLine="Dim reconstruirPedido As Boolean = False";
_reconstruirpedido = __c.False;
RDebugUtils.currentLine=21495843;
 //BA.debugLineNum = 21495843;BA.debugLine="Dim promoABorrar As String";
_promoaborrar = "";
RDebugUtils.currentLine=21495844;
 //BA.debugLineNum = 21495844;BA.debugLine="Private b_guardar As Button";
_b_guardar = new anywheresoftware.b4a.objects.ButtonWrapper();
RDebugUtils.currentLine=21495845;
 //BA.debugLineNum = 21495845;BA.debugLine="Private b_prodMas As Button";
_b_prodmas = new anywheresoftware.b4a.objects.ButtonWrapper();
RDebugUtils.currentLine=21495846;
 //BA.debugLineNum = 21495846;BA.debugLine="Private b_prodMenos As Button";
_b_prodmenos = new anywheresoftware.b4a.objects.ButtonWrapper();
RDebugUtils.currentLine=21495847;
 //BA.debugLineNum = 21495847;BA.debugLine="End Sub";
return "";
}
public String  _cuentaprods(reparto_izca.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=22282240;
 //BA.debugLineNum = 22282240;BA.debugLine="Sub cuentaProds(accion As String)";
RDebugUtils.currentLine=22282242;
 //BA.debugLineNum = 22282242;BA.debugLine="Log(\"*********************************************";
__c.LogImpl("822282242","*******************************************************",0);
RDebugUtils.currentLine=22282243;
 //BA.debugLineNum = 22282243;BA.debugLine="Private cantRechazada As Int = 0";
_cantrechazada = (int) (0);
RDebugUtils.currentLine=22282244;
 //BA.debugLineNum = 22282244;BA.debugLine="If Not(reconstruirPedido) Then";
if (__c.Not(__ref._reconstruirpedido /*boolean*/ )) { 
RDebugUtils.currentLine=22282245;
 //BA.debugLineNum = 22282245;BA.debugLine="Log(\"***********  CUENTAPRODS - NO RECONSTRUIR\")";
__c.LogImpl("822282245","***********  CUENTAPRODS - NO RECONSTRUIR",0);
RDebugUtils.currentLine=22282246;
 //BA.debugLineNum = 22282246;BA.debugLine="prodsMap.Initialize";
__ref._prodsmap /*anywheresoftware.b4a.objects.collections.Map*/ .Initialize();
RDebugUtils.currentLine=22282247;
 //BA.debugLineNum = 22282247;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=22282248;
 //BA.debugLineNum = 22282248;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=22282249;
 //BA.debugLineNum = 22282249;BA.debugLine="Private p As B4XView = p0.GetView(0)";
_p = new anywheresoftware.b4a.objects.B4XViewWrapper();
_p = _p0.GetView((int) (0));
RDebugUtils.currentLine=22282250;
 //BA.debugLineNum = 22282250;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=22282251;
 //BA.debugLineNum = 22282251;BA.debugLine="If cant1.Text = \"\" Then cant1.Text = 0";
if ((_cant1.getText()).equals("")) { 
_cant1.setText(BA.ObjectToCharSequence(0));};
RDebugUtils.currentLine=22282253;
 //BA.debugLineNum = 22282253;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=22282254;
 //BA.debugLineNum = 22282254;BA.debugLine="Log(\"-------------------------------------\")";
__c.LogImpl("822282254","-------------------------------------",0);
RDebugUtils.currentLine=22282255;
 //BA.debugLineNum = 22282255;BA.debugLine="Log($\"ET: ${esteTag}\"$)";
__c.LogImpl("822282255",("ET: "+__c.SmartStringFormatter("",(Object)(_estetag.getObject()))+""),0);
RDebugUtils.currentLine=22282256;
 //BA.debugLineNum = 22282256;BA.debugLine="Private esteProd As String = esteTag.Get(2)";
_esteprod = BA.ObjectToString(_estetag.Get((int) (2)));
RDebugUtils.currentLine=22282257;
 //BA.debugLineNum = 22282257;BA.debugLine="Private estaCant As Int = cant1.Text";
_estacant = (int)(Double.parseDouble(_cant1.getText()));
RDebugUtils.currentLine=22282258;
 //BA.debugLineNum = 22282258;BA.debugLine="Private estaCantOriginal As Int = esteTag.Get(1";
_estacantoriginal = (int)(BA.ObjectToNumber(_estetag.Get((int) (1))));
RDebugUtils.currentLine=22282259;
 //BA.debugLineNum = 22282259;BA.debugLine="Private esteCliente = Subs.traeCliente";
_estecliente = _subs._traecliente /*String*/ (ba);
RDebugUtils.currentLine=22282260;
 //BA.debugLineNum = 22282260;BA.debugLine="Private esteProdNombre = Subs.traeNombre(estePr";
_esteprodnombre = _subs._traenombre /*String*/ (ba,_esteprod);
RDebugUtils.currentLine=22282261;
 //BA.debugLineNum = 22282261;BA.debugLine="Private esteClienteOriginal As Int = esteTag.Ge";
_esteclienteoriginal = (int)(BA.ObjectToNumber(_estetag.Get((int) (5))));
RDebugUtils.currentLine=22282262;
 //BA.debugLineNum = 22282262;BA.debugLine="Private fechaReparto As String = Subs.traeFecha";
_fechareparto = _subs._traefechareparto /*String*/ (ba);
RDebugUtils.currentLine=22282263;
 //BA.debugLineNum = 22282263;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=22282265;
 //BA.debugLineNum = 22282265;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=22282267;
 //BA.debugLineNum = 22282267;BA.debugLine="cantRechazada = esteTag.Get(4) - cant1.Text";
_cantrechazada = (int) ((double)(BA.ObjectToNumber(_estetag.Get((int) (4))))-(double)(Double.parseDouble(_cant1.getText())));
RDebugUtils.currentLine=22282270;
 //BA.debugLineNum = 22282270;BA.debugLine="Log($\"${Subs.traeCantidadRechazada(esteClienteO";
__c.LogImpl("822282270",(""+__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=22282273;
 //BA.debugLineNum = 22282273;BA.debugLine="LogColor($\"cantRechazada = ${cantRechazada}\"$,";
__c.LogImpl("822282273",("cantRechazada = "+__c.SmartStringFormatter("",(Object)(_cantrechazada))+""),__c.Colors.Magenta);
RDebugUtils.currentLine=22282274;
 //BA.debugLineNum = 22282274;BA.debugLine="Private estePrecio As String = 0";
_esteprecio = BA.NumberToString(0);
RDebugUtils.currentLine=22282275;
 //BA.debugLineNum = 22282275;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=22282280;
 //BA.debugLineNum = 22282280;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=22282281;
 //BA.debugLineNum = 22282281;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=22282282;
 //BA.debugLineNum = 22282282;BA.debugLine="rr.Position = 0";
_rr.setPosition((int) (0));
RDebugUtils.currentLine=22282284;
 //BA.debugLineNum = 22282284;BA.debugLine="If rr.GetString(\"hayRechazo\") = 0 Then";
if ((_rr.GetString("hayRechazo")).equals(BA.NumberToString(0))) { 
RDebugUtils.currentLine=22282285;
 //BA.debugLineNum = 22282285;BA.debugLine="Log(\"INSERTAMOS EN REPARTO\")";
__c.LogImpl("822282285","INSERTAMOS EN REPARTO",0);
RDebugUtils.currentLine=22282286;
 //BA.debugLineNum = 22282286;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=22282287;
 //BA.debugLineNum = 22282287;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=22282288;
 //BA.debugLineNum = 22282288;BA.debugLine="Else if esteClienteOriginal = \"0\" Then 'Actuali";
if (_esteclienteoriginal==(double)(Double.parseDouble("0"))) { 
 }else {
RDebugUtils.currentLine=22282292;
 //BA.debugLineNum = 22282292;BA.debugLine="Log($\"Actualizamos REP_CANT RECHAZO = ${cantRe";
__c.LogImpl("822282292",("Actualizamos REP_CANT RECHAZO = "+__c.SmartStringFormatter("",(Object)(_cantrechazada))+""),0);
 }}
;
RDebugUtils.currentLine=22282297;
 //BA.debugLineNum = 22282297;BA.debugLine="If cant1.Text > 0 Then";
if ((double)(Double.parseDouble(_cant1.getText()))>0) { 
RDebugUtils.currentLine=22282300;
 //BA.debugLineNum = 22282300;BA.debugLine="Private m As Map";
_m = new anywheresoftware.b4a.objects.collections.Map();
RDebugUtils.currentLine=22282301;
 //BA.debugLineNum = 22282301;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=22282303;
 //BA.debugLineNum = 22282303;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=22282305;
 //BA.debugLineNum = 22282305;BA.debugLine="Log(\"-------------------------------------\")";
__c.LogImpl("822282305","-------------------------------------",0);
 }
};
 };
RDebugUtils.currentLine=22282308;
 //BA.debugLineNum = 22282308;BA.debugLine="Private bgColor, textColor As Int";
_bgcolor = 0;
_textcolor = 0;
RDebugUtils.currentLine=22282310;
 //BA.debugLineNum = 22282310;BA.debugLine="If reconstruirPedido Then";
if (__ref._reconstruirpedido /*boolean*/ ) { 
RDebugUtils.currentLine=22282311;
 //BA.debugLineNum = 22282311;BA.debugLine="Log(\"***********  CUENTAPRODS - SI RECONSTRUIR\")";
__c.LogImpl("822282311","***********  CUENTAPRODS - SI RECONSTRUIR",0);
RDebugUtils.currentLine=22282312;
 //BA.debugLineNum = 22282312;BA.debugLine="Private newPromo, newPrecio As String";
_newpromo = "";
_newprecio = "";
RDebugUtils.currentLine=22282313;
 //BA.debugLineNum = 22282313;BA.debugLine="clv_pedido.Clear";
__ref._clv_pedido /*b4a.example3.customlistview*/ ._clear();
RDebugUtils.currentLine=22282314;
 //BA.debugLineNum = 22282314;BA.debugLine="Log(\"Usamos PRODSMAP\")";
__c.LogImpl("822282314","Usamos PRODSMAP",0);
RDebugUtils.currentLine=22282315;
 //BA.debugLineNum = 22282315;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=22282316;
 //BA.debugLineNum = 22282316;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=22282317;
 //BA.debugLineNum = 22282317;BA.debugLine="Log(\"PPP: \" & pr & \"|PromoABorrar=\" & promoABor";
__c.LogImpl("822282317","PPP: "+_pr+"|PromoABorrar="+__ref._promoaborrar /*String*/ +"|"+BA.ObjectToString(_pr1),0);
RDebugUtils.currentLine=22282318;
 //BA.debugLineNum = 22282318;BA.debugLine="bgColor = Colors.RGB(177, 200, 249)'azul";
_bgcolor = __c.Colors.RGB((int) (177),(int) (200),(int) (249));
RDebugUtils.currentLine=22282319;
 //BA.debugLineNum = 22282319;BA.debugLine="textColor = Colors.black";
_textcolor = __c.Colors.Black;
RDebugUtils.currentLine=22282320;
 //BA.debugLineNum = 22282320;BA.debugLine="newPromo = pr1.Get(\"promo\")";
_newpromo = BA.ObjectToString(_pr1.Get((Object)("promo")));
RDebugUtils.currentLine=22282321;
 //BA.debugLineNum = 22282321;BA.debugLine="newPrecio = pr1.Get(\"precio\")";
_newprecio = BA.ObjectToString(_pr1.Get((Object)("precio")));
RDebugUtils.currentLine=22282322;
 //BA.debugLineNum = 22282322;BA.debugLine="Log(\"AAA: \" & newPromo & \"|\" & promoABorrar)";
__c.LogImpl("822282322","AAA: "+_newpromo+"|"+__ref._promoaborrar /*String*/ ,0);
RDebugUtils.currentLine=22282323;
 //BA.debugLineNum = 22282323;BA.debugLine="If newPromo = promoABorrar Then";
if ((_newpromo).equals(__ref._promoaborrar /*String*/ )) { 
RDebugUtils.currentLine=22282324;
 //BA.debugLineNum = 22282324;BA.debugLine="newPromo = 1";
_newpromo = BA.NumberToString(1);
RDebugUtils.currentLine=22282325;
 //BA.debugLineNum = 22282325;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=22282327;
 //BA.debugLineNum = 22282327;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=22282328;
 //BA.debugLineNum = 22282328;BA.debugLine="LogColor(\"CAMBIAMOS PROMO: \" & newPromo, Color";
__c.LogImpl("822282328","CAMBIAMOS PROMO: "+_newpromo,__c.Colors.Magenta);
 };
RDebugUtils.currentLine=22282330;
 //BA.debugLineNum = 22282330;BA.debugLine="If newPromo <> \"1\" Then";
if ((_newpromo).equals("1") == false) { 
RDebugUtils.currentLine=22282332;
 //BA.debugLineNum = 22282332;BA.debugLine="bgColor = Colors.White";
_bgcolor = __c.Colors.White;
 };
RDebugUtils.currentLine=22282334;
 //BA.debugLineNum = 22282334;BA.debugLine="Log($\"CLI: ${pr1.Get(\"nombre\")}, ${newPrecio},";
__c.LogImpl("822282334",("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=22282335;
 //BA.debugLineNum = 22282335;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=22282336;
 //BA.debugLineNum = 22282336;BA.debugLine="reconstruirPedido = False";
__ref._reconstruirpedido /*boolean*/  = __c.False;
 }
};
RDebugUtils.currentLine=22282338;
 //BA.debugLineNum = 22282338;BA.debugLine="promoABorrar = \"\"";
__ref._promoaborrar /*String*/  = "";
 };
RDebugUtils.currentLine=22282340;
 //BA.debugLineNum = 22282340;BA.debugLine="Log($\"Total Prods: ${totalProds}, Total Compra: $";
__c.LogImpl("822282340",("Total Prods: "+__c.SmartStringFormatter("",(Object)(__ref._totalprods /*int*/ ))+", Total Compra: $"+__c.SmartStringFormatter("1.2",(Object)(__ref._totalcompra /*int*/ ))+""),0);
RDebugUtils.currentLine=22282341;
 //BA.debugLineNum = 22282341;BA.debugLine="LogColor(\"prodsMap=\" & prodsMap, Colors.Green)";
__c.LogImpl("822282341","prodsMap="+BA.ObjectToString(__ref._prodsmap /*anywheresoftware.b4a.objects.collections.Map*/ ),__c.Colors.Green);
RDebugUtils.currentLine=22282344;
 //BA.debugLineNum = 22282344;BA.debugLine="LogColor(prodsMap, Colors.Blue)";
__c.LogImpl("822282344",BA.ObjectToString(__ref._prodsmap /*anywheresoftware.b4a.objects.collections.Map*/ ),__c.Colors.Blue);
RDebugUtils.currentLine=22282345;
 //BA.debugLineNum = 22282345;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=22282346;
 //BA.debugLineNum = 22282346;BA.debugLine="Dim cantidad1 As String = 0";
_cantidad1 = BA.NumberToString(0);
RDebugUtils.currentLine=22282347;
 //BA.debugLineNum = 22282347;BA.debugLine="If c.RowCount > 0 Then";
if (__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .getRowCount()>0) { 
RDebugUtils.currentLine=22282348;
 //BA.debugLineNum = 22282348;BA.debugLine="c.Position = 0";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition((int) (0));
RDebugUtils.currentLine=22282349;
 //BA.debugLineNum = 22282349;BA.debugLine="cantidad1 = c.GetString(\"CANTIDAD\")";
_cantidad1 = __ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CANTIDAD");
RDebugUtils.currentLine=22282350;
 //BA.debugLineNum = 22282350;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=22282352;
 //BA.debugLineNum = 22282352;BA.debugLine="c.Close";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .Close();
RDebugUtils.currentLine=22282354;
 //BA.debugLineNum = 22282354;BA.debugLine="Dim totalfinal As String = 0";
_totalfinal = BA.NumberToString(0);
RDebugUtils.currentLine=22282355;
 //BA.debugLineNum = 22282355;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=22282356;
 //BA.debugLineNum = 22282356;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=22282358;
 //BA.debugLineNum = 22282358;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=22282359;
 //BA.debugLineNum = 22282359;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=22282360;
 //BA.debugLineNum = 22282360;BA.debugLine="Dim cantidady As String = 0";
_cantidady = BA.NumberToString(0);
RDebugUtils.currentLine=22282361;
 //BA.debugLineNum = 22282361;BA.debugLine="If c.RowCount >0 Then";
if (__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .getRowCount()>0) { 
RDebugUtils.currentLine=22282362;
 //BA.debugLineNum = 22282362;BA.debugLine="c.Position = 0";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition((int) (0));
RDebugUtils.currentLine=22282363;
 //BA.debugLineNum = 22282363;BA.debugLine="cantidady = c.GetString(\"HVD_CANT\")";
_cantidady = __ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("HVD_CANT");
 };
RDebugUtils.currentLine=22282366;
 //BA.debugLineNum = 22282366;BA.debugLine="If x.RowCount > 0 Then";
if (_x.getRowCount()>0) { 
RDebugUtils.currentLine=22282367;
 //BA.debugLineNum = 22282367;BA.debugLine="x.Position = 0";
_x.setPosition((int) (0));
RDebugUtils.currentLine=22282369;
 //BA.debugLineNum = 22282369;BA.debugLine="Dim preciou As String = x.GetString(\"CAT_GP_PRE";
_preciou = _x.GetString("CAT_GP_PRECIO");
RDebugUtils.currentLine=22282370;
 //BA.debugLineNum = 22282370;BA.debugLine="Dim costototalhist  As String = preciou * canti";
_costototalhist = BA.NumberToString((double)(Double.parseDouble(_preciou))*(double)(Double.parseDouble(_cantidady)));
 };
RDebugUtils.currentLine=22282373;
 //BA.debugLineNum = 22282373;BA.debugLine="totalfinal = totalfinal + costototalhist";
_totalfinal = BA.NumberToString((double)(Double.parseDouble(_totalfinal))+(double)(Double.parseDouble(_costototalhist)));
RDebugUtils.currentLine=22282374;
 //BA.debugLineNum = 22282374;BA.debugLine="x.Close";
_x.Close();
 }
};
RDebugUtils.currentLine=22282376;
 //BA.debugLineNum = 22282376;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=22282377;
 //BA.debugLineNum = 22282377;BA.debugLine="c.Close";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .Close();
RDebugUtils.currentLine=22282379;
 //BA.debugLineNum = 22282379;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=22282380;
 //BA.debugLineNum = 22282380;BA.debugLine="If c.RowCount > 0 Then";
if (__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .getRowCount()>0) { 
RDebugUtils.currentLine=22282381;
 //BA.debugLineNum = 22282381;BA.debugLine="c.Position = 0";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition((int) (0));
RDebugUtils.currentLine=22282382;
 //BA.debugLineNum = 22282382;BA.debugLine="If c.GetString(\"CUANTOS\") > 0 Then";
if ((double)(Double.parseDouble(__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CUANTOS")))>0) { 
RDebugUtils.currentLine=22282384;
 //BA.debugLineNum = 22282384;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=22282385;
 //BA.debugLineNum = 22282385;BA.debugLine="Dim cantidad2 As String = 0";
_cantidad2 = BA.NumberToString(0);
RDebugUtils.currentLine=22282387;
 //BA.debugLineNum = 22282387;BA.debugLine="If z.RowCount > 0 Then";
if (_z.getRowCount()>0) { 
RDebugUtils.currentLine=22282388;
 //BA.debugLineNum = 22282388;BA.debugLine="z.Position = 0";
_z.setPosition((int) (0));
RDebugUtils.currentLine=22282389;
 //BA.debugLineNum = 22282389;BA.debugLine="cantidad2= z.GetString(\"CANTIDAD\")";
_cantidad2 = _z.GetString("CANTIDAD");
RDebugUtils.currentLine=22282392;
 //BA.debugLineNum = 22282392;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=22282394;
 //BA.debugLineNum = 22282394;BA.debugLine="z.Close";
_z.Close();
 };
 };
RDebugUtils.currentLine=22282402;
 //BA.debugLineNum = 22282402;BA.debugLine="End Sub";
return "";
}
public String  _gps_locationchanged(reparto_izca.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=21757952;
 //BA.debugLineNum = 21757952;BA.debugLine="Sub GPS_LocationChanged (Location1 As Location)";
RDebugUtils.currentLine=21757955;
 //BA.debugLineNum = 21757955;BA.debugLine="End Sub";
return "";
}
public Object  _initialize(reparto_izca.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=21561344;
 //BA.debugLineNum = 21561344;BA.debugLine="Public Sub Initialize As Object";
RDebugUtils.currentLine=21561345;
 //BA.debugLineNum = 21561345;BA.debugLine="Return Me";
if (true) return this;
RDebugUtils.currentLine=21561346;
 //BA.debugLineNum = 21561346;BA.debugLine="End Sub";
return null;
}
public String  _l_pcant_click(reparto_izca.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=22413312;
 //BA.debugLineNum = 22413312;BA.debugLine="Private Sub l_pCant_Click";
RDebugUtils.currentLine=22413314;
 //BA.debugLineNum = 22413314;BA.debugLine="End Sub";
return "";
}
public String  _listview1_itemlongclick(reparto_izca.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=21954560;
 //BA.debugLineNum = 21954560;BA.debugLine="Sub ListView1_ItemLongClick (Position As Int, Valu";
RDebugUtils.currentLine=21954604;
 //BA.debugLineNum = 21954604;BA.debugLine="End Sub";
return "";
}
public String  _lv2_itemclick(reparto_izca.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=22020096;
 //BA.debugLineNum = 22020096;BA.debugLine="Sub lv2_ItemClick (Position As Int, Value As Objec";
RDebugUtils.currentLine=22020157;
 //BA.debugLineNum = 22020157;BA.debugLine="End Sub";
return "";
}
public String  _p_prods_click(reparto_izca.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=22478848;
 //BA.debugLineNum = 22478848;BA.debugLine="Sub p_prods_Click";
RDebugUtils.currentLine=22478849;
 //BA.debugLineNum = 22478849;BA.debugLine="Log(Sender.As(Panel).tag)";
__c.LogImpl("822478849",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=22478850;
 //BA.debugLineNum = 22478850;BA.debugLine="End Sub";
return "";
}
}