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 BA(_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 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.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.subs _subs = 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() throws Exception{
 //BA.debugLineNum = 592;BA.debugLine="Private Sub b_guardar_Click";
 //BA.debugLineNum = 594;BA.debugLine="End Sub";
return "";
}
public String  _b_prodmas_click() throws Exception{
int _index = 0;
anywheresoftware.b4a.objects.B4XViewWrapper _pnl0 = null;
anywheresoftware.b4a.objects.B4XViewWrapper _pnl = null;
anywheresoftware.b4a.objects.B4XViewWrapper _lacant = null;
anywheresoftware.b4a.objects.collections.List _estetag = null;
String _maxprods = "";
anywheresoftware.b4a.objects.collections.Map _cym = null;
 //BA.debugLineNum = 383;BA.debugLine="Sub b_prodMas_Click";
 //BA.debugLineNum = 384;BA.debugLine="etCantHasFocus = False";
_etcanthasfocus = __c.False;
 //BA.debugLineNum = 386;BA.debugLine="LogColor(\"b_prodMas_Click\", Colors.Magenta)";
__c.LogImpl("150200579","b_prodMas_Click",__c.Colors.Magenta);
 //BA.debugLineNum = 387;BA.debugLine="Dim index As Int = clv_pedido.GetItemFromView(Sen";
_index = _clv_pedido._getitemfromview((anywheresoftware.b4a.objects.B4XViewWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.B4XViewWrapper(), (java.lang.Object)(__c.Sender(ba))));
 //BA.debugLineNum = 388;BA.debugLine="Dim pnl0 As B4XView = clv_pedido.GetPanel(index)";
_pnl0 = new anywheresoftware.b4a.objects.B4XViewWrapper();
_pnl0 = _clv_pedido._getpanel(_index);
 //BA.debugLineNum = 389;BA.debugLine="Dim pnl As B4XView = pnl0.GetView(0)";
_pnl = new anywheresoftware.b4a.objects.B4XViewWrapper();
_pnl = _pnl0.GetView((int) (0));
 //BA.debugLineNum = 390;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));
 //BA.debugLineNum = 394;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())));
 //BA.debugLineNum = 395;BA.debugLine="Log(\"LC_TEXT:\"&laCant.Text&\"|LC_TAG:\"&laCant.Tag&";
__c.LogImpl("150200588","LC_TEXT:"+_lacant.getText()+"|LC_TAG:"+BA.ObjectToString(_lacant.getTag())+"|ET:"+BA.ObjectToString(_estetag),0);
 //BA.debugLineNum = 396;BA.debugLine="If laCant.Text = \"\" Then laCant.Text = 0";
if ((_lacant.getText()).equals("")) { 
_lacant.setText(BA.ObjectToCharSequence(0));};
 //BA.debugLineNum = 398;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)))));
 //BA.debugLineNum = 400;BA.debugLine="LogColor($\"++++++++++++++++++++++++++   ${esteTag";
__c.LogImpl("150200593",("++++++++++++++++++++++++++   "+__c.SmartStringFormatter("",(Object)(_estetag.getObject()))+""),__c.Colors.Green);
 //BA.debugLineNum = 402;BA.debugLine="If laCant.Text + 1 <= maxProds Then";
if ((double)(Double.parseDouble(_lacant.getText()))+1<=(double)(Double.parseDouble(_maxprods))) { 
 //BA.debugLineNum = 403;BA.debugLine="Log($\"NuevaCant = ${laCant.Text + 1}\"$)";
__c.LogImpl("150200596",("NuevaCant = "+__c.SmartStringFormatter("",(Object)((double)(Double.parseDouble(_lacant.getText()))+1))+""),0);
 //BA.debugLineNum = 404;BA.debugLine="laCant.Text = $\"$1.0{laCant.Text + 1}\"$";
_lacant.setText(BA.ObjectToCharSequence((""+__c.SmartStringFormatter("1.0",(Object)((double)(Double.parseDouble(_lacant.getText()))+1))+"")));
 //BA.debugLineNum = 405;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))}));
 //BA.debugLineNum = 406;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))));
 //BA.debugLineNum = 407;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,_clv_pedido);
 //BA.debugLineNum = 408;BA.debugLine="L_CANT.Text = cym.Get(\"cantidad\")";
_l_cant.setText(BA.ObjectToCharSequence(_cym.Get((Object)("cantidad"))));
 //BA.debugLineNum = 409;BA.debugLine="L_TOTAL.Text = Round2(cym.Get(\"monto\"), 2)";
_l_total.setText(BA.ObjectToCharSequence(__c.Round2((double)(BA.ObjectToNumber(_cym.Get((Object)("monto")))),(int) (2))));
 };
 //BA.debugLineNum = 426;BA.debugLine="End Sub";
return "";
}
public String  _b_prodmenos_click() throws Exception{
int _index = 0;
anywheresoftware.b4a.objects.B4XViewWrapper _pnl0 = null;
anywheresoftware.b4a.objects.B4XViewWrapper _pnl = null;
anywheresoftware.b4a.objects.B4XViewWrapper _lacant = null;
anywheresoftware.b4a.objects.collections.List _estetag = null;
float _preciou = 0f;
anywheresoftware.b4a.objects.collections.Map _cym = null;
 //BA.debugLineNum = 340;BA.debugLine="Sub b_prodMenos_Click";
 //BA.debugLineNum = 341;BA.debugLine="etCantHasFocus = False";
_etcanthasfocus = __c.False;
 //BA.debugLineNum = 342;BA.debugLine="Log(\"etCantHasFocus=\" & etCantHasFocus)";
__c.LogImpl("150135042","etCantHasFocus="+BA.ObjectToString(_etcanthasfocus),0);
 //BA.debugLineNum = 343;BA.debugLine="LogColor(\"b_prodMenos_Click\", Colors.Magenta)";
__c.LogImpl("150135043","b_prodMenos_Click",__c.Colors.Magenta);
 //BA.debugLineNum = 344;BA.debugLine="Dim index As Int = clv_pedido.GetItemFromView(Sen";
_index = _clv_pedido._getitemfromview((anywheresoftware.b4a.objects.B4XViewWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.B4XViewWrapper(), (java.lang.Object)(__c.Sender(ba))));
 //BA.debugLineNum = 345;BA.debugLine="Dim pnl0 As B4XView = clv_pedido.GetPanel(index)";
_pnl0 = new anywheresoftware.b4a.objects.B4XViewWrapper();
_pnl0 = _clv_pedido._getpanel(_index);
 //BA.debugLineNum = 346;BA.debugLine="Dim pnl As B4XView = pnl0.GetView(0)";
_pnl = new anywheresoftware.b4a.objects.B4XViewWrapper();
_pnl = _pnl0.GetView((int) (0));
 //BA.debugLineNum = 347;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));
 //BA.debugLineNum = 349;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())));
 //BA.debugLineNum = 350;BA.debugLine="Log(\"LC_TEXT:\"&laCant.Text&\"|PROMO:\"&esteTag.Get(";
__c.LogImpl("150135050","LC_TEXT:"+_lacant.getText()+"|PROMO:"+BA.ObjectToString(_estetag.Get((int) (3)))+"|LC_TAG:"+BA.ObjectToString(_lacant.getTag())+"|ET:"+BA.ObjectToString(_estetag),0);
 //BA.debugLineNum = 351;BA.debugLine="If esteTag.Get(3) <> \"1\" Then 'Si es PROMO entonc";
if ((_estetag.Get((int) (3))).equals((Object)("1")) == false) { 
 //BA.debugLineNum = 352;BA.debugLine="Log(\"ES PROMO\")";
__c.LogImpl("150135052","ES PROMO",0);
 //BA.debugLineNum = 353;BA.debugLine="result =  Msgbox2(\"Si se modifica una promoción,";
_result = 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));
 //BA.debugLineNum = 354;BA.debugLine="If result = DialogResponse.POSITIVE Then 'Quitam";
if ((_result).equals(BA.NumberToString(__c.DialogResponse.POSITIVE))) { 
 //BA.debugLineNum = 355;BA.debugLine="prodsMap.Remove(esteTag.Get(3))";
_prodsmap.Remove(_estetag.Get((int) (3)));
 //BA.debugLineNum = 356;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)"));
 //BA.debugLineNum = 357;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)))+"'"));
 //BA.debugLineNum = 358;BA.debugLine="LogColor(prodsMap, Colors.red)";
__c.LogImpl("150135058",BA.ObjectToString(_prodsmap),__c.Colors.Red);
 //BA.debugLineNum = 359;BA.debugLine="reconstruirPedido = True";
_reconstruirpedido = __c.True;
 //BA.debugLineNum = 360;BA.debugLine="promoABorrar = esteTag.Get(3)";
_promoaborrar = BA.ObjectToString(_estetag.Get((int) (3)));
 //BA.debugLineNum = 361;BA.debugLine="B4XPage_Appear";
_b4xpage_appear();
 };
 }else {
 //BA.debugLineNum = 364;BA.debugLine="If laCant.Text = \"\" Then laCant.Text = 0";
if ((_lacant.getText()).equals("")) { 
_lacant.setText(BA.ObjectToCharSequence(0));};
 //BA.debugLineNum = 365;BA.debugLine="laCant.Text = $\"$1.0{laCant.Text-1}\"$";
_lacant.setText(BA.ObjectToCharSequence((""+__c.SmartStringFormatter("1.0",(Object)((double)(Double.parseDouble(_lacant.getText()))-1))+"")));
 //BA.debugLineNum = 366;BA.debugLine="If laCant.Text < 0 Then laCant.Text = 0";
if ((double)(Double.parseDouble(_lacant.getText()))<0) { 
_lacant.setText(BA.ObjectToCharSequence(0));};
 //BA.debugLineNum = 367;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))}));
 };
 //BA.debugLineNum = 369;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)))));
 //BA.debugLineNum = 370;BA.debugLine="Log(\"PU: \" & preciou)";
__c.LogImpl("150135070","PU: "+BA.NumberToString(_preciou),0);
 //BA.debugLineNum = 376;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))));
 //BA.debugLineNum = 377;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,_clv_pedido);
 //BA.debugLineNum = 378;BA.debugLine="L_CANT.Text = cym.Get(\"cantidad\")";
_l_cant.setText(BA.ObjectToCharSequence(_cym.Get((Object)("cantidad"))));
 //BA.debugLineNum = 379;BA.debugLine="L_TOTAL.Text = Round2(cym.Get(\"monto\"), 2)";
_l_total.setText(BA.ObjectToCharSequence(__c.Round2((double)(BA.ObjectToNumber(_cym.Get((Object)("monto")))),(int) (2))));
 //BA.debugLineNum = 381;BA.debugLine="End Sub";
return "";
}
public String  _b_regresar_click() throws Exception{
 //BA.debugLineNum = 185;BA.debugLine="Sub b_regresar_Click";
 //BA.debugLineNum = 186;BA.debugLine="B4XPages.ShowPage(\"Cliente\")";
_b4xpages._showpage /*String*/ (ba,"Cliente");
 //BA.debugLineNum = 187;BA.debugLine="End Sub";
return "";
}
public String  _b4xpage_appear() throws Exception{
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;
 //BA.debugLineNum = 59;BA.debugLine="Sub B4XPage_Appear";
 //BA.debugLineNum = 60;BA.debugLine="Subs.centraPanel(p_principal, Root.Width)";
_subs._centrapanel /*String*/ (ba,_p_principal,_root.getWidth());
 //BA.debugLineNum = 64;BA.debugLine="L_CANT.Text =\"\"";
_l_cant.setText(BA.ObjectToCharSequence(""));
 //BA.debugLineNum = 65;BA.debugLine="L_TOTAL.Text=\"\"";
_l_total.setText(BA.ObjectToCharSequence(""));
 //BA.debugLineNum = 66;BA.debugLine="c=Starter.skmt.ExecQuery(\"select count(*) as EXIS";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select count(*) as EXISTE from HIST_VENTAS WHERE HVD_CLIENTE IN (Select CUENTA from cuentaa) and HVD_RECHAZO = 0 ")));
 //BA.debugLineNum = 67;BA.debugLine="C.Position=0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 68;BA.debugLine="Existe = C.GetString(\"EXISTE\")";
_existe = _c.GetString("EXISTE");
 //BA.debugLineNum = 69;BA.debugLine="C.Close";
_c.Close();
 //BA.debugLineNum = 71;BA.debugLine="c=Starter.skmt.ExecQuery(\"select hvd_num_registro";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .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")));
 //BA.debugLineNum = 72;BA.debugLine="ListView1.Clear";
_listview1.Clear();
 //BA.debugLineNum = 73;BA.debugLine="clv_pedido.Clear";
_clv_pedido._clear();
 //BA.debugLineNum = 74;BA.debugLine="Subs.SetDivider(ListView1, Colors.LightGray, 2)";
_subs._setdivider /*String*/ (ba,_listview1,__c.Colors.LightGray,(int) (2));
 //BA.debugLineNum = 75;BA.debugLine="clv_pedido.GetBase.SetLayoutAnimated(100, 0dip, 6";
_clv_pedido._getbase().SetLayoutAnimated((int) (100),__c.DipToCurrent((int) (0)),__c.DipToCurrent((int) (60)),(int) (_root.getWidth()-50),(int) (_root.getHeight()*0.62));
 //BA.debugLineNum = 76;BA.debugLine="clv_pedido.Base_Resize(clv_pedido.GetBase.Width,";
_clv_pedido._base_resize(_clv_pedido._getbase().getWidth(),_clv_pedido._getbase().getHeight());
 //BA.debugLineNum = 78;BA.debugLine="If c.RowCount>0 Then";
if (_c.getRowCount()>0) { 
 //BA.debugLineNum = 80;BA.debugLine="For i=0 To c.RowCount -1";
{
final int step15 = 1;
final int limit15 = (int) (_c.getRowCount()-1);
_i = (int) (0) ;
for (;_i <= limit15 ;_i = _i + step15 ) {
 //BA.debugLineNum = 81;BA.debugLine="c.Position=i";
_c.setPosition(_i);
 //BA.debugLineNum = 83;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)(_c.GetString("HVD_PROID")))+"' and HVD_NUM_REGISTRO = '"+__c.SmartStringFormatter("",(Object)(_c.GetString("HVD_NUM_REGISTRO")))+"'"))));
 //BA.debugLineNum = 84;BA.debugLine="Private cant2 As Int = 0";
_cant2 = (int) (0);
 //BA.debugLineNum = 85;BA.debugLine="If oc.RowCount > 0 Then";
if (_oc.getRowCount()>0) { 
 //BA.debugLineNum = 86;BA.debugLine="oc.Position = 0";
_oc.setPosition((int) (0));
 //BA.debugLineNum = 87;BA.debugLine="cant2 = oc.GetString(\"HVD_CANT\")";
_cant2 = (int)(Double.parseDouble(_oc.GetString("HVD_CANT")));
 };
 //BA.debugLineNum = 89;BA.debugLine="oc.Close";
_oc.Close();
 //BA.debugLineNum = 90;BA.debugLine="Dim label1 As Label";
_label1 = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 91;BA.debugLine="label1 = ListView1.TwoLinesLayout.Label";
_label1 = _listview1.getTwoLinesLayout().Label;
 //BA.debugLineNum = 92;BA.debugLine="label1.TextSize = 12";
_label1.setTextSize((float) (12));
 //BA.debugLineNum = 93;BA.debugLine="label1.TextColor = Colors.black";
_label1.setTextColor(__c.Colors.Black);
 //BA.debugLineNum = 94;BA.debugLine="Dim label2 As Label";
_label2 = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 95;BA.debugLine="label2 = ListView1.TwoLinesLayout.SecondLabel";
_label2 = _listview1.getTwoLinesLayout().SecondLabel;
 //BA.debugLineNum = 96;BA.debugLine="label2.TextSize = 12";
_label2.setTextSize((float) (12));
 //BA.debugLineNum = 97;BA.debugLine="label2.TextColor = Colors.black";
_label2.setTextColor(__c.Colors.Black);
 //BA.debugLineNum = 98;BA.debugLine="Private bgColor, textColor As Int";
_bgcolor = 0;
_textcolor = 0;
 //BA.debugLineNum = 99;BA.debugLine="bgColor = Colors.RGB(177, 200, 249)'azul";
_bgcolor = __c.Colors.RGB((int) (177),(int) (200),(int) (249));
 //BA.debugLineNum = 100;BA.debugLine="textColor = Colors.black";
_textcolor = __c.Colors.Black;
 //BA.debugLineNum = 101;BA.debugLine="If c.GetString(\"HVD_CODPROMO\") <> \"1\" Then";
if ((_c.GetString("HVD_CODPROMO")).equals("1") == false) { 
 //BA.debugLineNum = 103;BA.debugLine="bgColor = Colors.White";
_bgcolor = __c.Colors.White;
 };
 //BA.debugLineNum = 107;BA.debugLine="clv_pedido.Add(CreateListItem(c.GetString(\"HVD_";
_clv_pedido._add((anywheresoftware.b4a.objects.B4XViewWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.B4XViewWrapper(), (java.lang.Object)(_createlistitem(_c.GetString("HVD_PRONOMBRE"),_subs._traeprecio /*String*/ (ba,_c.GetString("HVD_PROID"),_c.GetString("HVD_CODPROMO")),(int)(Double.parseDouble(_c.GetString("HVD_CANT"))),(int) (0),_clv_pedido._asview().getWidth(),__c.DipToCurrent((int) (50)),_bmp,_c.GetString("HVD_PROID"),_bgcolor,_textcolor,_c.GetString("HVD_CODPROMO"),_subs._traecliente /*String*/ (ba)).getObject())),(Object)(_c.GetString("HVD_PRONOMBRE")));
 }
};
 };
 //BA.debugLineNum = 112;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")));
 //BA.debugLineNum = 113;BA.debugLine="Log($\"VENTA: ${vc.RowCount}\"$)";
__c.LogImpl("149676342",("VENTA: "+__c.SmartStringFormatter("",(Object)(_vc.getRowCount()))+""),0);
 //BA.debugLineNum = 114;BA.debugLine="If vc.RowCount > 0 Then";
if (_vc.getRowCount()>0) { 
 //BA.debugLineNum = 117;BA.debugLine="textColor = Colors.RGB(0,87,142)";
_textcolor = __c.Colors.RGB((int) (0),(int) (87),(int) (142));
 //BA.debugLineNum = 118;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 ) {
 //BA.debugLineNum = 119;BA.debugLine="vc.Position = i";
_vc.setPosition(_i);
 //BA.debugLineNum = 120;BA.debugLine="Private cantCO As Int = 0";
_cantco = (int) (0);
 //BA.debugLineNum = 122;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"))));
 //BA.debugLineNum = 124;BA.debugLine="If cco.RowCount > 0 Then";
if (_cco.getRowCount()>0) { 
 //BA.debugLineNum = 125;BA.debugLine="cco.Position = 0";
_cco.setPosition((int) (0));
 //BA.debugLineNum = 126;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"))));
 };
 //BA.debugLineNum = 128;BA.debugLine="cantCO = Subs.traeCantidadRechazada(vc.GetStrin";
_cantco = _subs._traecantidadrechazada /*int*/ (ba,_vc.GetString("REP_CLI_ORIG"),_vc.GetString("REP_PRODID"));
 //BA.debugLineNum = 131;BA.debugLine="clv_pedido.Add(CreateListItem(vc.GetString(\"REP";
_clv_pedido._add((anywheresoftware.b4a.objects.B4XViewWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.B4XViewWrapper(), (java.lang.Object)(_createlistitem(_vc.GetString("REP_PRONOMBRE"),_subs._traeprecio /*String*/ (ba,_vc.GetString("REP_PRODID"),_subs._traealmacen /*String*/ (ba)),(int)(Double.parseDouble(_vc.GetString("REP_CANT"))),_cantco,_clv_pedido._asview().getWidth(),__c.DipToCurrent((int) (50)),_bmp,_vc.GetString("REP_PRODID"),_bgcolor,_textcolor,BA.NumberToString(1),_vc.GetString("REP_CLI_ORIG")).getObject())),(Object)(_vc.GetString("REP_PRONOMBRE")));
 }
};
 //BA.debugLineNum = 133;BA.debugLine="cco.Close";
_cco.Close();
 //BA.debugLineNum = 134;BA.debugLine="vc.Close";
_vc.Close();
 };
 //BA.debugLineNum = 137;BA.debugLine="If Existe <> 0 Then";
if ((_existe).equals(BA.NumberToString(0)) == false) { 
 //BA.debugLineNum = 138;BA.debugLine="c = Starter.skmt.ExecQuery(\"select SUM(HVD_CANT)";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .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 ")));
 //BA.debugLineNum = 139;BA.debugLine="C.Position=0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 140;BA.debugLine="L_CANT.Text = c.GetString(\"PC_NOART\")";
_l_cant.setText(BA.ObjectToCharSequence(_c.GetString("PC_NOART")));
 //BA.debugLineNum = 141;BA.debugLine="L_TOTAL.Text = Round2(c.GetString(\"PC_MONTO\"), 2";
_l_total.setText(BA.ObjectToCharSequence(__c.Round2((double)(Double.parseDouble(_c.GetString("PC_MONTO"))),(int) (2))));
 };
 //BA.debugLineNum = 143;BA.debugLine="c=Starter.skmt.ExecQuery(\"select count(*) as EXIS";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select count(*) as EXISTE from PEDIDO  WHERE PE_CLIENTE IN (Select CUENTA from cuentaa)")));
 //BA.debugLineNum = 144;BA.debugLine="c.Position=0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 145;BA.debugLine="Existe = C.GetString(\"EXISTE\")";
_existe = _c.GetString("EXISTE");
 //BA.debugLineNum = 146;BA.debugLine="c.Close";
_c.Close();
 //BA.debugLineNum = 149;BA.debugLine="Subs.SetDivider(ListView1, Colors.LightGray, 2)";
_subs._setdivider /*String*/ (ba,_listview1,__c.Colors.LightGray,(int) (2));
 //BA.debugLineNum = 167;BA.debugLine="If Existe <> 0 Then";
if ((_existe).equals(BA.NumberToString(0)) == false) { 
 //BA.debugLineNum = 168;BA.debugLine="c=Starter.skmt.ExecQuery(\"select SUM(PE_CANT) AS";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .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)")));
 //BA.debugLineNum = 169;BA.debugLine="C.Position=0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 170;BA.debugLine="L_CANT.Text = L_CANT.Text + c.GetString(\"PE_CANT";
_l_cant.setText(BA.ObjectToCharSequence((double)(Double.parseDouble(_l_cant.getText()))+(double)(Double.parseDouble(_c.GetString("PE_CANT")))));
 //BA.debugLineNum = 171;BA.debugLine="L_TOTAL.Text = Round2(L_TOTAL.Text  + c.GetStrin";
_l_total.setText(BA.ObjectToCharSequence(__c.Round2((double)(Double.parseDouble(_l_total.getText()))+(double)(Double.parseDouble(_c.GetString("PE_COSTO_TOT"))),(int) (2))));
 };
 //BA.debugLineNum = 175;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,_clv_pedido);
 //BA.debugLineNum = 176;BA.debugLine="L_CANT.Text = cym.Get(\"cantidad\")";
_l_cant.setText(BA.ObjectToCharSequence(_cym.Get((Object)("cantidad"))));
 //BA.debugLineNum = 177;BA.debugLine="L_TOTAL.Text = Round2(cym.Get(\"monto\"), 2)";
_l_total.setText(BA.ObjectToCharSequence(__c.Round2((double)(BA.ObjectToNumber(_cym.Get((Object)("monto")))),(int) (2))));
 //BA.debugLineNum = 178;BA.debugLine="End Sub";
return "";
}
public anywheresoftware.b4a.keywords.Common.ResumableSubWrapper  _b4xpage_closerequest() throws Exception{
ResumableSub_B4XPage_CloseRequest rsub = new ResumableSub_B4XPage_CloseRequest(this);
rsub.resume(ba, null);
return (anywheresoftware.b4a.keywords.Common.ResumableSubWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.keywords.Common.ResumableSubWrapper(), rsub);
}
public static class ResumableSub_B4XPage_CloseRequest extends BA.ResumableSub {
public ResumableSub_B4XPage_CloseRequest(reparto_izca.keymon.lat.c_historico parent) {
this.parent = parent;
}
reparto_izca.keymon.lat.c_historico parent;

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

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

            }
        }
    }
}
public String  _b4xpage_created(anywheresoftware.b4a.objects.B4XViewWrapper _root1) throws Exception{
 //BA.debugLineNum = 48;BA.debugLine="Private Sub B4XPage_Created (Root1 As B4XView)";
 //BA.debugLineNum = 49;BA.debugLine="Root = Root1";
_root = _root1;
 //BA.debugLineNum = 51;BA.debugLine="g.Initialize(\"GPS\")";
_g.Initialize("GPS");
 //BA.debugLineNum = 52;BA.debugLine="Root.LoadLayout(\"historico\")";
_root.LoadLayout("historico",ba);
 //BA.debugLineNum = 53;BA.debugLine="b_borra.Visible = False";
_b_borra.setVisible(__c.False);
 //BA.debugLineNum = 54;BA.debugLine="Titulo.Text = \"Pedido\"";
_titulo.setText(BA.ObjectToCharSequence("Pedido"));
 //BA.debugLineNum = 55;BA.debugLine="End Sub";
return "";
}
public String  _class_globals() throws Exception{
 //BA.debugLineNum = 1;BA.debugLine="Sub Class_Globals";
 //BA.debugLineNum = 2;BA.debugLine="Private Root As B4XView 'ignore";
_root = new anywheresoftware.b4a.objects.B4XViewWrapper();
 //BA.debugLineNum = 3;BA.debugLine="Private xui As XUI 'ignore";
_xui = new anywheresoftware.b4a.objects.B4XViewWrapper.XUI();
 //BA.debugLineNum = 4;BA.debugLine="Dim g As GPS";
_g = new anywheresoftware.b4a.gps.GPS();
 //BA.debugLineNum = 5;BA.debugLine="Dim clie_id As String";
_clie_id = "";
 //BA.debugLineNum = 6;BA.debugLine="Dim sDate,sTime As String";
_sdate = "";
_stime = "";
 //BA.debugLineNum = 7;BA.debugLine="Dim usuario As String";
_usuario = "";
 //BA.debugLineNum = 8;BA.debugLine="Dim c As Cursor";
_c = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
 //BA.debugLineNum = 10;BA.debugLine="Dim b_regresar As Button";
_b_regresar = new anywheresoftware.b4a.objects.ButtonWrapper();
 //BA.debugLineNum = 11;BA.debugLine="Dim ListView1 As ListView";
_listview1 = new anywheresoftware.b4a.objects.ListViewWrapper();
 //BA.debugLineNum = 12;BA.debugLine="Dim L_CANT As Label";
_l_cant = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 13;BA.debugLine="Dim L_TOTAL As Label";
_l_total = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 14;BA.debugLine="Dim b_borra As Button";
_b_borra = new anywheresoftware.b4a.objects.ButtonWrapper();
 //BA.debugLineNum = 15;BA.debugLine="Dim Existe As String";
_existe = "";
 //BA.debugLineNum = 16;BA.debugLine="Dim result As String";
_result = "";
 //BA.debugLineNum = 18;BA.debugLine="Dim cuantos As String";
_cuantos = "";
 //BA.debugLineNum = 19;BA.debugLine="Dim nombre_prod As String";
_nombre_prod = "";
 //BA.debugLineNum = 20;BA.debugLine="Dim cuantos_pedido As String";
_cuantos_pedido = "";
 //BA.debugLineNum = 21;BA.debugLine="Private Titulo As Label";
_titulo = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 22;BA.debugLine="Private P1 As Panel";
_p1 = new anywheresoftware.b4a.objects.PanelWrapper();
 //BA.debugLineNum = 23;BA.debugLine="Private lv2 As ListView";
_lv2 = new anywheresoftware.b4a.objects.ListViewWrapper();
 //BA.debugLineNum = 24;BA.debugLine="Private p_principal As Panel";
_p_principal = new anywheresoftware.b4a.objects.PanelWrapper();
 //BA.debugLineNum = 25;BA.debugLine="Dim clv_pedido As CustomListView";
_clv_pedido = new b4a.example3.customlistview();
 //BA.debugLineNum = 26;BA.debugLine="Private p_prods As Panel";
_p_prods = new anywheresoftware.b4a.objects.PanelWrapper();
 //BA.debugLineNum = 27;BA.debugLine="Private l_prodX As Label";
_l_prodx = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 28;BA.debugLine="Private l_pCant As Label";
_l_pcant = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 29;BA.debugLine="Private et_pCant As EditText";
_et_pcant = new anywheresoftware.b4a.objects.EditTextWrapper();
 //BA.debugLineNum = 30;BA.debugLine="Dim bmp As Bitmap";
_bmp = new anywheresoftware.b4a.objects.drawable.CanvasWrapper.BitmapWrapper();
 //BA.debugLineNum = 31;BA.debugLine="Dim etCantHasFocus As Boolean = False";
_etcanthasfocus = __c.False;
 //BA.debugLineNum = 32;BA.debugLine="Dim totalProds As Int = 0";
_totalprods = (int) (0);
 //BA.debugLineNum = 33;BA.debugLine="Dim totalCompra As Int = 0";
_totalcompra = (int) (0);
 //BA.debugLineNum = 34;BA.debugLine="Dim prodsMap As Map";
_prodsmap = new anywheresoftware.b4a.objects.collections.Map();
 //BA.debugLineNum = 35;BA.debugLine="Dim reconstruirPedido As Boolean = False";
_reconstruirpedido = __c.False;
 //BA.debugLineNum = 36;BA.debugLine="Dim promoABorrar As String";
_promoaborrar = "";
 //BA.debugLineNum = 37;BA.debugLine="Private b_guardar As Button";
_b_guardar = new anywheresoftware.b4a.objects.ButtonWrapper();
 //BA.debugLineNum = 38;BA.debugLine="Private b_prodMas As Button";
_b_prodmas = new anywheresoftware.b4a.objects.ButtonWrapper();
 //BA.debugLineNum = 39;BA.debugLine="Private b_prodMenos As Button";
_b_prodmenos = new anywheresoftware.b4a.objects.ButtonWrapper();
 //BA.debugLineNum = 40;BA.debugLine="End Sub";
return "";
}
public anywheresoftware.b4a.objects.PanelWrapper  _createlistitem(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{
anywheresoftware.b4a.objects.B4XViewWrapper _p = null;
anywheresoftware.b4a.objects.CSBuilder _cs = null;
 //BA.debugLineNum = 310;BA.debugLine="Sub CreateListItem(Text As String, precioU As Stri";
 //BA.debugLineNum = 311;BA.debugLine="Dim p As B4XView = xui.CreatePanel(\"\")";
_p = new anywheresoftware.b4a.objects.B4XViewWrapper();
_p = _xui.CreatePanel(ba,"");
 //BA.debugLineNum = 312;BA.debugLine="Private cs As CSBuilder";
_cs = new anywheresoftware.b4a.objects.CSBuilder();
 //BA.debugLineNum = 313;BA.debugLine="cs.Initialize";
_cs.Initialize();
 //BA.debugLineNum = 314;BA.debugLine="p.SetLayoutAnimated(0, 0, 0, Width, Height)";
_p.SetLayoutAnimated((int) (0),(int) (0),(int) (0),_width,_height);
 //BA.debugLineNum = 315;BA.debugLine="p.LoadLayout(\"prodItem\")";
_p.LoadLayout("prodItem",ba);
 //BA.debugLineNum = 316;BA.debugLine="p_prods.Color = bc";
_p_prods.setColor(_bc);
 //BA.debugLineNum = 317;BA.debugLine="l_prodX.TextColor = tc";
_l_prodx.setTextColor(_tc);
 //BA.debugLineNum = 318;BA.debugLine="precioU = $\"$1.2{precioU}\"$";
_preciou = (""+__c.SmartStringFormatter("1.2",(Object)(_preciou))+"");
 //BA.debugLineNum = 319;BA.debugLine="l_prodX.Text = Text&CRLF&\"Cant: \" & inv2 & \"   $\"";
_l_prodx.setText(BA.ObjectToCharSequence(_text+__c.CRLF+"Cant: "+BA.NumberToString(_inv2)+"   $"+_preciou));
 //BA.debugLineNum = 320;BA.debugLine="If promo <> \"1\" And precioU = 0 Then";
if ((_promo).equals("1") == false && (_preciou).equals(BA.NumberToString(0))) { 
 //BA.debugLineNum = 321;BA.debugLine="l_prodX.Text = cs.Color(Colors.RGB(123,0,0)).app";
_l_prodx.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()));
 };
 //BA.debugLineNum = 323;BA.debugLine="l_prodX.Tag = $\"ID: ${prodId}${CRLF}${Text}${CRLF";
_l_prodx.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")));
 //BA.debugLineNum = 325;BA.debugLine="l_pCant.Tag = Round2(precioU,2)&\"|\"&inv&\"|\"&prodI";
_l_pcant.setTag((Object)(BA.NumberToString(__c.Round2((double)(Double.parseDouble(_preciou)),(int) (2)))+"|"+BA.NumberToString(_inv)+"|"+_prodid+"|"+_promo+"|"+BA.NumberToString(_inv2)+"|"+_cliente_original));
 //BA.debugLineNum = 326;BA.debugLine="et_pCant.Tag = Round2(precioU,2)&\"|\"&inv&\"|\"&prod";
_et_pcant.setTag((Object)(BA.NumberToString(__c.Round2((double)(Double.parseDouble(_preciou)),(int) (2)))+"|"+BA.NumberToString(_inv)+"|"+_prodid+"|"+_promo+"|"+BA.NumberToString(_inv2)+"|"+_cliente_original));
 //BA.debugLineNum = 327;BA.debugLine="p_prods.Tag = l_pCant.tag";
_p_prods.setTag(_l_pcant.getTag());
 //BA.debugLineNum = 329;BA.debugLine="l_pCant.Text = inv";
_l_pcant.setText(BA.ObjectToCharSequence(_inv));
 //BA.debugLineNum = 333;BA.debugLine="l_pCant.BringToFront";
_l_pcant.BringToFront();
 //BA.debugLineNum = 334;BA.debugLine="et_pCant.SendToBack";
_et_pcant.SendToBack();
 //BA.debugLineNum = 337;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()));
 //BA.debugLineNum = 338;BA.debugLine="End Sub";
return null;
}
public String  _cuentaprods(String _accion) throws Exception{
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 = "";
 //BA.debugLineNum = 428;BA.debugLine="Sub cuentaProds(accion As String)";
 //BA.debugLineNum = 430;BA.debugLine="Log(\"*********************************************";
__c.LogImpl("150266114","*******************************************************",0);
 //BA.debugLineNum = 431;BA.debugLine="Private cantRechazada As Int = 0";
_cantrechazada = (int) (0);
 //BA.debugLineNum = 432;BA.debugLine="If Not(reconstruirPedido) Then";
if (__c.Not(_reconstruirpedido)) { 
 //BA.debugLineNum = 433;BA.debugLine="Log(\"***********  CUENTAPRODS - NO RECONSTRUIR\")";
__c.LogImpl("150266117","***********  CUENTAPRODS - NO RECONSTRUIR",0);
 //BA.debugLineNum = 434;BA.debugLine="prodsMap.Initialize";
_prodsmap.Initialize();
 //BA.debugLineNum = 435;BA.debugLine="For i = 0 To clv_pedido.GetSize - 1";
{
final int step6 = 1;
final int limit6 = (int) (_clv_pedido._getsize()-1);
_i = (int) (0) ;
for (;_i <= limit6 ;_i = _i + step6 ) {
 //BA.debugLineNum = 436;BA.debugLine="Private p0 As B4XView = clv_pedido.GetPanel(i)";
_p0 = new anywheresoftware.b4a.objects.B4XViewWrapper();
_p0 = _clv_pedido._getpanel(_i);
 //BA.debugLineNum = 437;BA.debugLine="Private p As B4XView = p0.GetView(0)";
_p = new anywheresoftware.b4a.objects.B4XViewWrapper();
_p = _p0.GetView((int) (0));
 //BA.debugLineNum = 438;BA.debugLine="Private cant1 As B4XView = p.GetView(2).GetView";
_cant1 = new anywheresoftware.b4a.objects.B4XViewWrapper();
_cant1 = _p.GetView((int) (2)).GetView((int) (3));
 //BA.debugLineNum = 439;BA.debugLine="If cant1.Text = \"\" Then cant1.Text = 0";
if ((_cant1.getText()).equals("")) { 
_cant1.setText(BA.ObjectToCharSequence(0));};
 //BA.debugLineNum = 441;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())));
 //BA.debugLineNum = 442;BA.debugLine="Log(\"-------------------------------------\")";
__c.LogImpl("150266126","-------------------------------------",0);
 //BA.debugLineNum = 443;BA.debugLine="Log($\"ET: ${esteTag}\"$)";
__c.LogImpl("150266127",("ET: "+__c.SmartStringFormatter("",(Object)(_estetag.getObject()))+""),0);
 //BA.debugLineNum = 444;BA.debugLine="Private esteProd As String = esteTag.Get(2)";
_esteprod = BA.ObjectToString(_estetag.Get((int) (2)));
 //BA.debugLineNum = 445;BA.debugLine="Private estaCant As Int = cant1.Text";
_estacant = (int)(Double.parseDouble(_cant1.getText()));
 //BA.debugLineNum = 446;BA.debugLine="Private estaCantOriginal As Int = esteTag.Get(1";
_estacantoriginal = (int)(BA.ObjectToNumber(_estetag.Get((int) (1))));
 //BA.debugLineNum = 447;BA.debugLine="Private esteCliente = Subs.traeCliente";
_estecliente = _subs._traecliente /*String*/ (ba);
 //BA.debugLineNum = 448;BA.debugLine="Private esteProdNombre = Subs.traeNombre(estePr";
_esteprodnombre = _subs._traenombre /*String*/ (ba,_esteprod);
 //BA.debugLineNum = 449;BA.debugLine="Private esteClienteOriginal As Int = esteTag.Ge";
_esteclienteoriginal = (int)(BA.ObjectToNumber(_estetag.Get((int) (5))));
 //BA.debugLineNum = 450;BA.debugLine="Private fechaReparto As String = Subs.traeFecha";
_fechareparto = _subs._traefechareparto /*String*/ (ba);
 //BA.debugLineNum = 451;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)))));
 //BA.debugLineNum = 453;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));};
 //BA.debugLineNum = 455;BA.debugLine="cantRechazada = esteTag.Get(4) - cant1.Text";
_cantrechazada = (int) ((double)(BA.ObjectToNumber(_estetag.Get((int) (4))))-(double)(Double.parseDouble(_cant1.getText())));
 //BA.debugLineNum = 458;BA.debugLine="Log($\"${Subs.traeCantidadRechazada(esteClienteO";
__c.LogImpl("150266142",(""+__c.SmartStringFormatter("",(Object)(_subs._traecantidadrechazada /*int*/ (ba,BA.NumberToString(_esteclienteoriginal),_esteprod)))+", "+__c.SmartStringFormatter("",(Object)(_subs._traecantidadvendida /*int*/ (ba,BA.NumberToString(_esteclienteoriginal),_esteprod)))+""),0);
 //BA.debugLineNum = 461;BA.debugLine="LogColor($\"cantRechazada = ${cantRechazada}\"$,";
__c.LogImpl("150266145",("cantRechazada = "+__c.SmartStringFormatter("",(Object)(_cantrechazada))+""),__c.Colors.Magenta);
 //BA.debugLineNum = 462;BA.debugLine="Private estePrecio As String = 0";
_esteprecio = BA.NumberToString(0);
 //BA.debugLineNum = 463;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);};
 //BA.debugLineNum = 468;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}));
 //BA.debugLineNum = 469;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)"))));
 //BA.debugLineNum = 470;BA.debugLine="rr.Position = 0";
_rr.setPosition((int) (0));
 //BA.debugLineNum = 472;BA.debugLine="If rr.GetString(\"hayRechazo\") = 0 Then";
if ((_rr.GetString("hayRechazo")).equals(BA.NumberToString(0))) { 
 //BA.debugLineNum = 473;BA.debugLine="Log(\"INSERTAMOS EN REPARTO\")";
__c.LogImpl("150266157","INSERTAMOS EN REPARTO",0);
 //BA.debugLineNum = 474;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}));
 //BA.debugLineNum = 475;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 if(_esteclienteoriginal==(double)(Double.parseDouble("0"))) { 
 }else {
 //BA.debugLineNum = 480;BA.debugLine="Log($\"Actualizamos REP_CANT RECHAZO = ${cantRe";
__c.LogImpl("150266164",("Actualizamos REP_CANT RECHAZO = "+__c.SmartStringFormatter("",(Object)(_cantrechazada))+""),0);
 };
 //BA.debugLineNum = 485;BA.debugLine="If cant1.Text > 0 Then";
if ((double)(Double.parseDouble(_cant1.getText()))>0) { 
 //BA.debugLineNum = 488;BA.debugLine="Private m As Map";
_m = new anywheresoftware.b4a.objects.collections.Map();
 //BA.debugLineNum = 489;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))});
 //BA.debugLineNum = 491;BA.debugLine="prodsMap.Put(esteTag.Get(2), m)";
_prodsmap.Put(_estetag.Get((int) (2)),(Object)(_m.getObject()));
 };
 //BA.debugLineNum = 493;BA.debugLine="Log(\"-------------------------------------\")";
__c.LogImpl("150266177","-------------------------------------",0);
 }
};
 };
 //BA.debugLineNum = 496;BA.debugLine="Private bgColor, textColor As Int";
_bgcolor = 0;
_textcolor = 0;
 //BA.debugLineNum = 498;BA.debugLine="If reconstruirPedido Then";
if (_reconstruirpedido) { 
 //BA.debugLineNum = 499;BA.debugLine="Log(\"***********  CUENTAPRODS - SI RECONSTRUIR\")";
__c.LogImpl("150266183","***********  CUENTAPRODS - SI RECONSTRUIR",0);
 //BA.debugLineNum = 500;BA.debugLine="Private newPromo, newPrecio As String";
_newpromo = "";
_newprecio = "";
 //BA.debugLineNum = 501;BA.debugLine="clv_pedido.Clear";
_clv_pedido._clear();
 //BA.debugLineNum = 502;BA.debugLine="Log(\"Usamos PRODSMAP\")";
__c.LogImpl("150266186","Usamos PRODSMAP",0);
 //BA.debugLineNum = 503;BA.debugLine="For Each pr As String In prodsMap.Keys";
{
final anywheresoftware.b4a.BA.IterableList group53 = _prodsmap.Keys();
final int groupLen53 = group53.getSize()
;int index53 = 0;
;
for (; index53 < groupLen53;index53++){
_pr = BA.ObjectToString(group53.Get(index53));
 //BA.debugLineNum = 504;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)(_prodsmap.Get((Object)(_pr))));
 //BA.debugLineNum = 505;BA.debugLine="Log(\"PPP: \" & pr & \"|PromoABorrar=\" & promoABor";
__c.LogImpl("150266189","PPP: "+_pr+"|PromoABorrar="+_promoaborrar+"|"+BA.ObjectToString(_pr1),0);
 //BA.debugLineNum = 506;BA.debugLine="bgColor = Colors.RGB(177, 200, 249)'azul";
_bgcolor = __c.Colors.RGB((int) (177),(int) (200),(int) (249));
 //BA.debugLineNum = 507;BA.debugLine="textColor = Colors.black";
_textcolor = __c.Colors.Black;
 //BA.debugLineNum = 508;BA.debugLine="newPromo = pr1.Get(\"promo\")";
_newpromo = BA.ObjectToString(_pr1.Get((Object)("promo")));
 //BA.debugLineNum = 509;BA.debugLine="newPrecio = pr1.Get(\"precio\")";
_newprecio = BA.ObjectToString(_pr1.Get((Object)("precio")));
 //BA.debugLineNum = 510;BA.debugLine="Log(\"AAA: \" & newPromo & \"|\" & promoABorrar)";
__c.LogImpl("150266194","AAA: "+_newpromo+"|"+_promoaborrar,0);
 //BA.debugLineNum = 511;BA.debugLine="If newPromo = promoABorrar Then";
if ((_newpromo).equals(_promoaborrar)) { 
 //BA.debugLineNum = 512;BA.debugLine="newPromo = 1";
_newpromo = BA.NumberToString(1);
 //BA.debugLineNum = 513;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")))));
 //BA.debugLineNum = 515;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)"));
 //BA.debugLineNum = 516;BA.debugLine="LogColor(\"CAMBIAMOS PROMO: \" & newPromo, Color";
__c.LogImpl("150266200","CAMBIAMOS PROMO: "+_newpromo,__c.Colors.Magenta);
 };
 //BA.debugLineNum = 518;BA.debugLine="If newPromo <> \"1\" Then";
if ((_newpromo).equals("1") == false) { 
 //BA.debugLineNum = 520;BA.debugLine="bgColor = Colors.White";
_bgcolor = __c.Colors.White;
 };
 //BA.debugLineNum = 522;BA.debugLine="Log($\"CLI: ${pr1.Get(\"nombre\")}, ${newPrecio},";
__c.LogImpl("150266206",("CLI: "+__c.SmartStringFormatter("",_pr1.Get((Object)("nombre")))+", "+__c.SmartStringFormatter("",(Object)(_newprecio))+", "+__c.SmartStringFormatter("",_pr1.Get((Object)("cant")))+", "+__c.SmartStringFormatter("",_pr1.Get((Object)("cant2")))+""),0);
 //BA.debugLineNum = 523;BA.debugLine="clv_pedido.Add(CreateListItem(pr1.Get(\"nombre\")";
_clv_pedido._add((anywheresoftware.b4a.objects.B4XViewWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.B4XViewWrapper(), (java.lang.Object)(_createlistitem(BA.ObjectToString(_pr1.Get((Object)("nombre"))),_newprecio,(int)(BA.ObjectToNumber(_pr1.Get((Object)("cant")))),(int)(BA.ObjectToNumber(_pr1.Get((Object)("cant2")))),_clv_pedido._asview().getWidth(),__c.DipToCurrent((int) (50)),_bmp,_pr,_bgcolor,_textcolor,_newpromo,BA.ObjectToString(_pr1.Get((Object)("cli_orig")))).getObject())),_pr1.Get((Object)("nombre")));
 //BA.debugLineNum = 524;BA.debugLine="reconstruirPedido = False";
_reconstruirpedido = __c.False;
 }
};
 //BA.debugLineNum = 526;BA.debugLine="promoABorrar = \"\"";
_promoaborrar = "";
 };
 //BA.debugLineNum = 528;BA.debugLine="Log($\"Total Prods: ${totalProds}, Total Compra: $";
__c.LogImpl("150266212",("Total Prods: "+__c.SmartStringFormatter("",(Object)(_totalprods))+", Total Compra: $"+__c.SmartStringFormatter("1.2",(Object)(_totalcompra))+""),0);
 //BA.debugLineNum = 529;BA.debugLine="LogColor(\"prodsMap=\" & prodsMap, Colors.Green)";
__c.LogImpl("150266213","prodsMap="+BA.ObjectToString(_prodsmap),__c.Colors.Green);
 //BA.debugLineNum = 532;BA.debugLine="LogColor(prodsMap, Colors.Blue)";
__c.LogImpl("150266216",BA.ObjectToString(_prodsmap),__c.Colors.Blue);
 //BA.debugLineNum = 533;BA.debugLine="c = Starter.skmt.ExecQuery($\"SELECT sum(HVD_CANT)";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery(("SELECT sum(HVD_CANT) as CANTIDAD FROM HIST_VENTAS WHERE HVD_CLIENTE IN (SELECT CUENTA FROM CUENTAA)"))));
 //BA.debugLineNum = 534;BA.debugLine="Dim cantidad1 As String = 0";
_cantidad1 = BA.NumberToString(0);
 //BA.debugLineNum = 535;BA.debugLine="If c.RowCount > 0 Then";
if (_c.getRowCount()>0) { 
 //BA.debugLineNum = 536;BA.debugLine="c.Position = 0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 537;BA.debugLine="cantidad1 = c.GetString(\"CANTIDAD\")";
_cantidad1 = _c.GetString("CANTIDAD");
 //BA.debugLineNum = 538;BA.debugLine="L_CANT.Text = Round(cantidad1)";
_l_cant.setText(BA.ObjectToCharSequence(__c.Round((double)(Double.parseDouble(_cantidad1)))));
 };
 //BA.debugLineNum = 540;BA.debugLine="c.Close";
_c.Close();
 //BA.debugLineNum = 542;BA.debugLine="Dim totalfinal As String = 0";
_totalfinal = BA.NumberToString(0);
 //BA.debugLineNum = 543;BA.debugLine="For Each pr As String In prodsMap.Keys";
{
final anywheresoftware.b4a.BA.IterableList group88 = _prodsmap.Keys();
final int groupLen88 = group88.getSize()
;int index88 = 0;
;
for (; index88 < groupLen88;index88++){
_pr = BA.ObjectToString(group88.Get(index88));
 //BA.debugLineNum = 544;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)(_prodsmap.Get((Object)(_pr))));
 //BA.debugLineNum = 546;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))+"'"))));
 //BA.debugLineNum = 547;BA.debugLine="c = Starter.skmt.ExecQuery($\"SELECT HVD_CANT FRO";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery(("SELECT HVD_CANT FROM HIST_VENTAS WHERE HVD_CLIENTE IN (SELECT CUENTA FROM CUENTAA) AND HVD_PROID ='"+__c.SmartStringFormatter("",(Object)(_pr))+"' "))));
 //BA.debugLineNum = 548;BA.debugLine="Dim cantidady As String = 0";
_cantidady = BA.NumberToString(0);
 //BA.debugLineNum = 549;BA.debugLine="If c.RowCount >0 Then";
if (_c.getRowCount()>0) { 
 //BA.debugLineNum = 550;BA.debugLine="c.Position = 0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 551;BA.debugLine="cantidady = c.GetString(\"HVD_CANT\")";
_cantidady = _c.GetString("HVD_CANT");
 };
 //BA.debugLineNum = 554;BA.debugLine="If x.RowCount > 0 Then";
if (_x.getRowCount()>0) { 
 //BA.debugLineNum = 555;BA.debugLine="x.Position = 0";
_x.setPosition((int) (0));
 //BA.debugLineNum = 557;BA.debugLine="Dim preciou As String = x.GetString(\"CAT_GP_PRE";
_preciou = _x.GetString("CAT_GP_PRECIO");
 //BA.debugLineNum = 558;BA.debugLine="Dim costototalhist  As String = preciou * canti";
_costototalhist = BA.NumberToString((double)(Double.parseDouble(_preciou))*(double)(Double.parseDouble(_cantidady)));
 };
 //BA.debugLineNum = 561;BA.debugLine="totalfinal = totalfinal + costototalhist";
_totalfinal = BA.NumberToString((double)(Double.parseDouble(_totalfinal))+(double)(Double.parseDouble(_costototalhist)));
 //BA.debugLineNum = 562;BA.debugLine="x.Close";
_x.Close();
 }
};
 //BA.debugLineNum = 564;BA.debugLine="L_TOTAL.Text = Round2(totalfinal, 2)";
_l_total.setText(BA.ObjectToCharSequence(__c.Round2((double)(Double.parseDouble(_totalfinal)),(int) (2))));
 //BA.debugLineNum = 565;BA.debugLine="c.Close";
_c.Close();
 //BA.debugLineNum = 567;BA.debugLine="c = Starter.skmt.ExecQuery(\"select COUNT(*) AS CU";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .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")));
 //BA.debugLineNum = 568;BA.debugLine="If c.RowCount > 0 Then";
if (_c.getRowCount()>0) { 
 //BA.debugLineNum = 569;BA.debugLine="c.Position = 0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 570;BA.debugLine="If c.GetString(\"CUANTOS\") > 0 Then";
if ((double)(Double.parseDouble(_c.GetString("CUANTOS")))>0) { 
 //BA.debugLineNum = 572;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"))));
 //BA.debugLineNum = 573;BA.debugLine="Dim cantidad2 As String = 0";
_cantidad2 = BA.NumberToString(0);
 //BA.debugLineNum = 575;BA.debugLine="If z.RowCount > 0 Then";
if (_z.getRowCount()>0) { 
 //BA.debugLineNum = 576;BA.debugLine="z.Position = 0";
_z.setPosition((int) (0));
 //BA.debugLineNum = 577;BA.debugLine="cantidad2= z.GetString(\"CANTIDAD\")";
_cantidad2 = _z.GetString("CANTIDAD");
 //BA.debugLineNum = 580;BA.debugLine="L_CANT.Text = Round((cantidad1 + cantidad2))";
_l_cant.setText(BA.ObjectToCharSequence(__c.Round(((double)(Double.parseDouble(_cantidad1))+(double)(Double.parseDouble(_cantidad2))))));
 };
 //BA.debugLineNum = 582;BA.debugLine="z.Close";
_z.Close();
 };
 };
 //BA.debugLineNum = 590;BA.debugLine="End Sub";
return "";
}
public String  _gps_locationchanged(anywheresoftware.b4a.gps.LocationWrapper _location1) throws Exception{
 //BA.debugLineNum = 180;BA.debugLine="Sub GPS_LocationChanged (Location1 As Location)";
 //BA.debugLineNum = 183;BA.debugLine="End Sub";
return "";
}
public Object  _initialize(anywheresoftware.b4a.BA _ba) throws Exception{
innerInitialize(_ba);
 //BA.debugLineNum = 43;BA.debugLine="Public Sub Initialize As Object";
 //BA.debugLineNum = 44;BA.debugLine="Return Me";
if (true) return this;
 //BA.debugLineNum = 45;BA.debugLine="End Sub";
return null;
}
public String  _l_pcant_click() throws Exception{
 //BA.debugLineNum = 597;BA.debugLine="Private Sub l_pCant_Click";
 //BA.debugLineNum = 599;BA.debugLine="End Sub";
return "";
}
public String  _listview1_itemlongclick(int _position,Object _value) throws Exception{
 //BA.debugLineNum = 197;BA.debugLine="Sub ListView1_ItemLongClick (Position As Int, Valu";
 //BA.debugLineNum = 241;BA.debugLine="End Sub";
return "";
}
public String  _lv2_itemclick(int _position,Object _value) throws Exception{
 //BA.debugLineNum = 243;BA.debugLine="Sub lv2_ItemClick (Position As Int, Value As Objec";
 //BA.debugLineNum = 304;BA.debugLine="End Sub";
return "";
}
public String  _p_prods_click() throws Exception{
 //BA.debugLineNum = 601;BA.debugLine="Sub p_prods_Click";
 //BA.debugLineNum = 602;BA.debugLine="Log(Sender.As(Panel).tag)";
__c.LogImpl("150462721",BA.ObjectToString(((anywheresoftware.b4a.objects.PanelWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.PanelWrapper(), (android.view.ViewGroup)(__c.Sender(ba)))).getTag()),0);
 //BA.debugLineNum = 603;BA.debugLine="End Sub";
return "";
}
public Object callSub(String sub, Object sender, Object[] args) throws Exception {
BA.senderHolder.set(sender);
if (BA.fastSubCompare(sub, "B4XPAGE_CREATED"))
	return _b4xpage_created((anywheresoftware.b4a.objects.B4XViewWrapper) args[0]);
if (BA.fastSubCompare(sub, "GPS_LOCATIONCHANGED"))
	return _gps_locationchanged((anywheresoftware.b4a.gps.LocationWrapper) args[0]);
return BA.SubDelegator.SubNotFound;
}
}
