package reparto_mazapa.keymon.lat;


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

public class c_detalleventa 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_mazapa.keymon.lat.c_detalleventa");
            if (htSubs == null) {
                ba.loadHtSubs(this.getClass());
                htSubs = ba.htSubs;
            }
            
        }
        if (BA.isShellModeRuntimeCheck(ba)) 
			   this.getClass().getMethod("_class_globals", reparto_mazapa.keymon.lat.c_detalleventa.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 anywheresoftware.b4a.objects.ButtonWrapper _b_prodmenosc = null;
public anywheresoftware.b4a.objects.LabelWrapper _l_pcantc = null;
public anywheresoftware.b4a.objects.EditTextWrapper _et_pcantc = null;
public anywheresoftware.b4a.objects.ButtonWrapper _b_prodmasc = null;
public anywheresoftware.b4a.objects.PanelWrapper _p_botmasmenc = null;
public anywheresoftware.b4a.objects.PanelWrapper _p_botmasmen = null;
public anywheresoftware.b4a.objects.LabelWrapper _l_cajas = null;
public anywheresoftware.b4a.objects.LabelWrapper _l_piezas = null;
public b4a.example.dateutils _dateutils = null;
public reparto_mazapa.keymon.lat.main _main = null;
public reparto_mazapa.keymon.lat.appupdater _appupdater = null;
public reparto_mazapa.keymon.lat.tracker _tracker = null;
public reparto_mazapa.keymon.lat.starter _starter = null;
public reparto_mazapa.keymon.lat.subs _subs = null;
public reparto_mazapa.keymon.lat.firebasemessaging _firebasemessaging = null;
public reparto_mazapa.keymon.lat.foto _foto = null;
public reparto_mazapa.keymon.lat.mapa_cliente _mapa_cliente = null;
public reparto_mazapa.keymon.lat.mapa_rutas _mapa_rutas = null;
public reparto_mazapa.keymon.lat.newinst2 _newinst2 = null;
public reparto_mazapa.keymon.lat.b4xpages _b4xpages = null;
public reparto_mazapa.keymon.lat.b4xcollections _b4xcollections = null;
public reparto_mazapa.keymon.lat.httputils2service _httputils2service = null;
public reparto_mazapa.keymon.lat.xuiviewsutils _xuiviewsutils = null;
public String  _b_guardar_click() throws Exception{
 //BA.debugLineNum = 915;BA.debugLine="Private Sub b_guardar_Click";
 //BA.debugLineNum = 917;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 = "";
String _minimoadesc = "";
anywheresoftware.b4a.sql.SQL.CursorWrapper _minimos = null;
anywheresoftware.b4a.sql.SQL.CursorWrapper _c2 = null;
 //BA.debugLineNum = 650;BA.debugLine="Sub b_prodMas_Click";
 //BA.debugLineNum = 651;BA.debugLine="etCantHasFocus = False";
_etcanthasfocus = __c.False;
 //BA.debugLineNum = 653;BA.debugLine="LogColor(\"b_prodMas_Click\", Colors.Magenta)";
__c.LogImpl("322216707","b_prodMas_Click",__c.Colors.Magenta);
 //BA.debugLineNum = 654;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 = 655;BA.debugLine="Dim pnl0 As B4XView = clv_pedido.GetPanel(index)";
_pnl0 = new anywheresoftware.b4a.objects.B4XViewWrapper();
_pnl0 = _clv_pedido._getpanel(_index);
 //BA.debugLineNum = 656;BA.debugLine="Dim pnl As B4XView = pnl0.GetView(0)";
_pnl = new anywheresoftware.b4a.objects.B4XViewWrapper();
_pnl = _pnl0.GetView((int) (0));
 //BA.debugLineNum = 657;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 = 661;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 = 662;BA.debugLine="Log(\"LC_TEXT:\"&laCant.Text&\"|LC_TAG:\"&laCant.Tag&";
__c.LogImpl("322216716","LC_TEXT:"+_lacant.getText()+"|LC_TAG:"+BA.ObjectToString(_lacant.getTag())+"|ET:"+BA.ObjectToString(_estetag),0);
 //BA.debugLineNum = 663;BA.debugLine="If laCant.Text = \"\" Then laCant.Text = 0";
if ((_lacant.getText()).equals("")) { 
_lacant.setText(BA.ObjectToCharSequence(0));};
 //BA.debugLineNum = 665;BA.debugLine="Private maxProds = esteTag.Get(1) + esteTag.Get(4";
_maxprods = BA.NumberToString((double)(BA.ObjectToNumber(_estetag.Get((int) (1))))+(double)(BA.ObjectToNumber(_estetag.Get((int) (4)))));
 //BA.debugLineNum = 667;BA.debugLine="LogColor($\"++++++++++++++++++++++++++   ${esteTag";
__c.LogImpl("322216721",("++++++++++++++++++++++++++   "+__c.SmartStringFormatter("",(Object)(_estetag.getObject()))+""),__c.Colors.Green);
 //BA.debugLineNum = 670;BA.debugLine="Private minimoadesc As String";
_minimoadesc = "";
 //BA.debugLineNum = 671;BA.debugLine="Dim minimos As Cursor = Starter.skmt.ExecQuery2(\"";
_minimos = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_minimos = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery2("SELECT * FROM CAT_GUNAPROD3 WHERE CAT_GP_ID = ?",new String[]{BA.ObjectToString(_estetag.Get((int) (2)))})));
 //BA.debugLineNum = 672;BA.debugLine="If minimos.RowCount > 0 Then";
if (_minimos.getRowCount()>0) { 
 //BA.debugLineNum = 673;BA.debugLine="minimos.Position = 0";
_minimos.setPosition((int) (0));
 //BA.debugLineNum = 674;BA.debugLine="minimoadesc = minimos.GetString(\"CAT_DP_CANT_MIN";
_minimoadesc = _minimos.GetString("CAT_DP_CANT_MIN_VENTA");
 }else {
 //BA.debugLineNum = 676;BA.debugLine="minimoadesc = \"1\"";
_minimoadesc = "1";
 };
 //BA.debugLineNum = 678;BA.debugLine="minimos.Close";
_minimos.Close();
 //BA.debugLineNum = 681;BA.debugLine="If esteTag.Get(7) <> \"1\" Then";
if ((_estetag.Get((int) (7))).equals((Object)("1")) == false) { 
 //BA.debugLineNum = 684;BA.debugLine="If esteTag.Get(5) = esteTag.Get(6) Then";
if ((_estetag.Get((int) (5))).equals(_estetag.Get((int) (6)))) { 
 //BA.debugLineNum = 686;BA.debugLine="If laCant.Text + 1 <= maxProds Then";
if ((double)(Double.parseDouble(_lacant.getText()))+1<=(double)(Double.parseDouble(_maxprods))) { 
 //BA.debugLineNum = 687;BA.debugLine="Log($\"NuevaCant = ${laCant.Text + 1}\"$)";
__c.LogImpl("322216741",("NuevaCant = "+__c.SmartStringFormatter("",(Object)((double)(Double.parseDouble(_lacant.getText()))+1))+""),0);
 //BA.debugLineNum = 688;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 = 689;BA.debugLine="Starter.skmt.ExecNonQuery2(\"update cat_gunapro";
_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 = 692;BA.debugLine="Starter.skmt.ExecNonQuery($\"update HIST_VENTAS";
_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("update HIST_VENTAS set HVD_RECHAZO = 1,  HVD_RECHAZOCANT = HVD_RECHAZOCANT - (1*'"+__c.SmartStringFormatter("",(Object)(_minimoadesc))+"')  WHERE HVD_PROID = '"+__c.SmartStringFormatter("",_estetag.Get((int) (2)))+"' and HVD_cliente in (Select CUENTA from cuentaa)  AND CONSECUTIVO = '"+__c.SmartStringFormatter("",_estetag.Get((int) (8)))+"'"));
 //BA.debugLineNum = 694;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 = 699;BA.debugLine="B4XPage_Appear";
_b4xpage_appear();
 };
 }else {
 //BA.debugLineNum = 703;BA.debugLine="If laCant.Text + 1 <= maxProds Then";
if ((double)(Double.parseDouble(_lacant.getText()))+1<=(double)(Double.parseDouble(_maxprods))) { 
 //BA.debugLineNum = 704;BA.debugLine="Log($\"NuevaCant = ${laCant.Text + 1}\"$)";
__c.LogImpl("322216758",("NuevaCant = "+__c.SmartStringFormatter("",(Object)((double)(Double.parseDouble(_lacant.getText()))+1))+""),0);
 //BA.debugLineNum = 705;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 = 706;BA.debugLine="Starter.skmt.ExecNonQuery2(\"update cat_gunapro";
_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 String[]{BA.ObjectToString(_estetag.Get((int) (2)))}));
 //BA.debugLineNum = 707;BA.debugLine="c = Starter.skmt.ExecQuery2(\"SELECT * FROM PED";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery2("SELECT * FROM PEDIDO WHERE PE_PROID = ? and PE_CLIENTE IN (SELECT CUENTA FROM CUENTAA) AND CONSECUTIVO = ?",new String[]{BA.ObjectToString(_estetag.Get((int) (2))),BA.ObjectToString(_estetag.Get((int) (8)))})));
 //BA.debugLineNum = 708;BA.debugLine="If c.RowCount > 0 Then";
if (_c.getRowCount()>0) { 
 //BA.debugLineNum = 709;BA.debugLine="Private c2 As Cursor = Starter.skmt.ExecQuery";
_c2 = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_c2 = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery2("SELECT * FROM CAT_GUNAPROD WHERE CAT_GP_ID = ?",new String[]{BA.ObjectToString(_estetag.Get((int) (2)))})));
 //BA.debugLineNum = 710;BA.debugLine="If c2.RowCount > 0 Then";
if (_c2.getRowCount()>0) { 
 //BA.debugLineNum = 711;BA.debugLine="c2.Position = 0";
_c2.setPosition((int) (0));
 //BA.debugLineNum = 713;BA.debugLine="Starter.skmt.ExecNonQuery($\"update PEDIDO se";
_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("update PEDIDO set PE_CANT = IFNULL(PE_CANT,0)+(1*'"+__c.SmartStringFormatter("",(Object)(_minimoadesc))+"'), PE_COSTO_TOT= ((IFNULL(PE_CANT,0)+(1*'"+__c.SmartStringFormatter("",(Object)(_minimoadesc))+"'))*'"+__c.SmartStringFormatter("",(Object)(_c2.GetString("CAT_GP_PRECIO")))+"') WHERE PE_PROID = '"+__c.SmartStringFormatter("",_estetag.Get((int) (2)))+"' and PE_CLIENTE in (Select CUENTA from cuentaa)  AND CONSECUTIVO = '"+__c.SmartStringFormatter("",_estetag.Get((int) (8)))+"'"));
 };
 }else {
 //BA.debugLineNum = 716;BA.debugLine="Private c2 As Cursor = Starter.skmt.ExecQuery";
_c2 = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_c2 = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery2("SELECT * FROM CAT_GUNAPROD WHERE CAT_GP_ID = ?",new String[]{BA.ObjectToString(_estetag.Get((int) (2)))})));
 //BA.debugLineNum = 717;BA.debugLine="If c2.RowCount > 0 Then";
if (_c2.getRowCount()>0) { 
 //BA.debugLineNum = 718;BA.debugLine="c2.Position = 0";
_c2.setPosition((int) (0));
 //BA.debugLineNum = 720;BA.debugLine="Starter.skmt.ExecNonQuery2(\"INSERT INTO PEDI";
_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("INSERT INTO PEDIDO(PE_PROID,PE_PRONOMBRE,PE_CANT,PE_CLIENTEOR,PE_CLIENTE,PE_COSTOU,PE_COSTO_TOT,PE_CAJAS,PE_BCAJAS,CONSECUTIVO) VALUES (?,?,?,?,?,?,?,0,0,?)",anywheresoftware.b4a.keywords.Common.ArrayToList(new String[]{BA.ObjectToString(_estetag.Get((int) (2))),_c2.GetString("CAT_GP_NOMBRE"),BA.NumberToString(1*(double)(Double.parseDouble(_minimoadesc))),BA.ObjectToString(_estetag.Get((int) (5))),_subs._traecliente /*String*/ (ba),_c2.GetString("CAT_GP_PRECIO"),_c2.GetString("CAT_GP_PRECIO"),BA.ObjectToString(_estetag.Get((int) (8)))}));
 };
 };
 //BA.debugLineNum = 725;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 = 730;BA.debugLine="B4XPage_Appear";
_b4xpage_appear();
 };
 };
 };
 //BA.debugLineNum = 749;BA.debugLine="End Sub";
return "";
}
public String  _b_prodmasc_click() throws Exception{
int _index = 0;
anywheresoftware.b4a.objects.B4XViewWrapper _pnl0 = null;
anywheresoftware.b4a.objects.B4XViewWrapper _pnl = null;
anywheresoftware.b4a.objects.B4XViewWrapper _lacantc = null;
anywheresoftware.b4a.objects.collections.List _estetag = null;
String _maxprods = "";
 //BA.debugLineNum = 928;BA.debugLine="Private Sub b_prodMasC_Click";
 //BA.debugLineNum = 929;BA.debugLine="etCantHasFocus = False";
_etcanthasfocus = __c.False;
 //BA.debugLineNum = 931;BA.debugLine="LogColor(\"b_prodMas_Click\", Colors.Magenta)";
__c.LogImpl("322544387","b_prodMas_Click",__c.Colors.Magenta);
 //BA.debugLineNum = 932;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 = 933;BA.debugLine="Dim pnl0 As B4XView = clv_pedido.GetPanel(index)";
_pnl0 = new anywheresoftware.b4a.objects.B4XViewWrapper();
_pnl0 = _clv_pedido._getpanel(_index);
 //BA.debugLineNum = 934;BA.debugLine="Dim pnl As B4XView = pnl0.GetView(0)";
_pnl = new anywheresoftware.b4a.objects.B4XViewWrapper();
_pnl = _pnl0.GetView((int) (0));
 //BA.debugLineNum = 935;BA.debugLine="Dim laCantc As B4XView = pnl.GetView(3).GetView(3";
_lacantc = new anywheresoftware.b4a.objects.B4XViewWrapper();
_lacantc = _pnl.GetView((int) (3)).GetView((int) (3));
 //BA.debugLineNum = 939;BA.debugLine="Dim esteTag As List = Regex.Split(\"\\|\", laCantc.T";
_estetag = new anywheresoftware.b4a.objects.collections.List();
_estetag = anywheresoftware.b4a.keywords.Common.ArrayToList(__c.Regex.Split("\\|",BA.ObjectToString(_lacantc.getTag())));
 //BA.debugLineNum = 940;BA.debugLine="Log(\"LC_TEXT:\"&laCantc.Text&\"|LC_TAG:\"&laCantc.Ta";
__c.LogImpl("322544396","LC_TEXT:"+_lacantc.getText()+"|LC_TAG:"+BA.ObjectToString(_lacantc.getTag())+"|ET:"+BA.ObjectToString(_estetag),0);
 //BA.debugLineNum = 941;BA.debugLine="If laCantc.Text = \"\" Then laCantc.Text = 0";
if ((_lacantc.getText()).equals("")) { 
_lacantc.setText(BA.ObjectToCharSequence(0));};
 //BA.debugLineNum = 943;BA.debugLine="Private maxProds As String = (esteTag.Get(1) + es";
_maxprods = BA.NumberToString(((double)(BA.ObjectToNumber(_estetag.Get((int) (1))))+(double)(BA.ObjectToNumber(_estetag.Get((int) (4))))));
 //BA.debugLineNum = 944;BA.debugLine="LogColor(esteTag.Get(1),Colors.Red)";
__c.LogImpl("322544400",BA.ObjectToString(_estetag.Get((int) (1))),__c.Colors.Red);
 //BA.debugLineNum = 945;BA.debugLine="LogColor(esteTag.Get(4),Colors.Red)";
__c.LogImpl("322544401",BA.ObjectToString(_estetag.Get((int) (4))),__c.Colors.Red);
 //BA.debugLineNum = 946;BA.debugLine="LogColor($\"++++++++++++++++++++++++++   ${esteTag";
__c.LogImpl("322544402",("++++++++++++++++++++++++++   "+__c.SmartStringFormatter("",(Object)(_estetag.getObject()))+""),__c.Colors.Green);
 //BA.debugLineNum = 948;BA.debugLine="Log(maxProds)";
__c.LogImpl("322544404",_maxprods,0);
 //BA.debugLineNum = 951;BA.debugLine="If esteTag.Get(7) <> \"1\" Then";
if ((_estetag.Get((int) (7))).equals((Object)("1")) == false) { 
 //BA.debugLineNum = 954;BA.debugLine="If laCantc.Text + 1 <= maxProds Then";
if ((double)(Double.parseDouble(_lacantc.getText()))+1<=(double)(Double.parseDouble(_maxprods))) { 
 //BA.debugLineNum = 955;BA.debugLine="Log($\"NuevaCant = ${laCantc.Text + 1}\"$)";
__c.LogImpl("322544411",("NuevaCant = "+__c.SmartStringFormatter("",(Object)((double)(Double.parseDouble(_lacantc.getText()))+1))+""),0);
 //BA.debugLineNum = 956;BA.debugLine="laCantc.Text = $\"$1.0{laCantc.Text + 1}\"$";
_lacantc.setText(BA.ObjectToCharSequence((""+__c.SmartStringFormatter("1.0",(Object)((double)(Double.parseDouble(_lacantc.getText()))+1))+"")));
 //BA.debugLineNum = 958;BA.debugLine="Log(laCantc.Text)";
__c.LogImpl("322544414",_lacantc.getText(),0);
 //BA.debugLineNum = 959;BA.debugLine="Starter.skmt.ExecNonQuery($\"update HIST_VENTAS";
_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("update HIST_VENTAS set HVD_RECHAZO = 1,  HVD_RECHAZOCANT = IFNULL(HVD_RECHAZOCANT,0) -(1 * "+__c.SmartStringFormatter("",(Object)(_subs._traeconversion /*String*/ (ba,BA.ObjectToString(_estetag.Get((int) (2))))))+")  WHERE HVD_PROID = '"+__c.SmartStringFormatter("",_estetag.Get((int) (2)))+"' and HVD_cliente in (Select CUENTA from cuentaa) AND CONSECUTIVO = '"+__c.SmartStringFormatter("",_estetag.Get((int) (8)))+"'"));
 //BA.debugLineNum = 967;BA.debugLine="B4XPage_Appear";
_b4xpage_appear();
 };
 };
 //BA.debugLineNum = 970;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;
String _minimoadesc = "";
anywheresoftware.b4a.sql.SQL.CursorWrapper _minimos = null;
anywheresoftware.b4a.sql.SQL.CursorWrapper _c3 = null;
anywheresoftware.b4a.sql.SQL.CursorWrapper _c2 = null;
float _preciou = 0f;
 //BA.debugLineNum = 506;BA.debugLine="Sub b_prodMenos_Click";
 //BA.debugLineNum = 507;BA.debugLine="etCantHasFocus = False";
_etcanthasfocus = __c.False;
 //BA.debugLineNum = 508;BA.debugLine="Log(\"etCantHasFocus=\" & etCantHasFocus)";
__c.LogImpl("322151170","etCantHasFocus="+BA.ObjectToString(_etcanthasfocus),0);
 //BA.debugLineNum = 509;BA.debugLine="LogColor(\"b_prodMenos_Click\", Colors.Magenta)";
__c.LogImpl("322151171","b_prodMenos_Click",__c.Colors.Magenta);
 //BA.debugLineNum = 510;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 = 511;BA.debugLine="Dim pnl0 As B4XView = clv_pedido.GetPanel(index)";
_pnl0 = new anywheresoftware.b4a.objects.B4XViewWrapper();
_pnl0 = _clv_pedido._getpanel(_index);
 //BA.debugLineNum = 512;BA.debugLine="Dim pnl As B4XView = pnl0.GetView(0)";
_pnl = new anywheresoftware.b4a.objects.B4XViewWrapper();
_pnl = _pnl0.GetView((int) (0));
 //BA.debugLineNum = 513;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 = 515;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 = 516;BA.debugLine="Log(\"LC_TEXT:\"&laCant.Text&\"|PROMO:\"&esteTag.Get(";
__c.LogImpl("322151178","LC_TEXT:"+_lacant.getText()+"|PROMO:"+BA.ObjectToString(_estetag.Get((int) (3)))+"|LC_TAG:"+BA.ObjectToString(_lacant.getTag())+"|ET:"+BA.ObjectToString(_estetag),0);
 //BA.debugLineNum = 517;BA.debugLine="Private minimoadesc As String";
_minimoadesc = "";
 //BA.debugLineNum = 518;BA.debugLine="Dim minimos As Cursor = Starter.skmt.ExecQuery2(\"";
_minimos = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_minimos = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery2("SELECT * FROM CAT_GUNAPROD3 WHERE CAT_GP_ID = ?",new String[]{BA.ObjectToString(_estetag.Get((int) (2)))})));
 //BA.debugLineNum = 519;BA.debugLine="If minimos.RowCount > 0 Then";
if (_minimos.getRowCount()>0) { 
 //BA.debugLineNum = 520;BA.debugLine="minimos.Position = 0";
_minimos.setPosition((int) (0));
 //BA.debugLineNum = 521;BA.debugLine="minimoadesc = minimos.GetString(\"CAT_DP_CANT_MIN";
_minimoadesc = _minimos.GetString("CAT_DP_CANT_MIN_VENTA");
 }else {
 //BA.debugLineNum = 523;BA.debugLine="minimoadesc = \"1\"";
_minimoadesc = "1";
 };
 //BA.debugLineNum = 525;BA.debugLine="minimos.Close";
_minimos.Close();
 //BA.debugLineNum = 528;BA.debugLine="If esteTag.Get(7) = \"1\" Then";
if ((_estetag.Get((int) (7))).equals((Object)("1"))) { 
 //BA.debugLineNum = 529;BA.debugLine="If laCant.Text = \"\" Then laCant.Text = 0";
if ((_lacant.getText()).equals("")) { 
_lacant.setText(BA.ObjectToCharSequence(0));};
 //BA.debugLineNum = 530;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 = 531;BA.debugLine="If laCant.Text < 0 Then laCant.Text = 0";
if ((double)(Double.parseDouble(_lacant.getText()))<0) { 
_lacant.setText(BA.ObjectToCharSequence(0));};
 //BA.debugLineNum = 532;BA.debugLine="Private c3 As Cursor = Starter.skmt.ExecQuery2(\"";
_c3 = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_c3 = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery2("SELECT PE_CANT FROM PEDIDO WHERE PE_PROID = ? AND PE_CLIENTE IN (SELECT CUENTA FROM CUENTAA) AND CONSECUTIVO = ?",new String[]{BA.ObjectToString(_estetag.Get((int) (2))),BA.ObjectToString(_estetag.Get((int) (8)))})));
 //BA.debugLineNum = 533;BA.debugLine="If c3.RowCount > 0 Then";
if (_c3.getRowCount()>0) { 
 //BA.debugLineNum = 534;BA.debugLine="c3.Position = 0";
_c3.setPosition((int) (0));
 //BA.debugLineNum = 535;BA.debugLine="If c3.GetString(\"PE_CANT\") > minimoadesc Then";
if ((double)(Double.parseDouble(_c3.GetString("PE_CANT")))>(double)(Double.parseDouble(_minimoadesc))) { 
 //BA.debugLineNum = 536;BA.debugLine="Private c2 As Cursor = Starter.skmt.ExecQuery2";
_c2 = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_c2 = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery2("SELECT * FROM CAT_GUNAPROD WHERE CAT_GP_ID = ?",new String[]{BA.ObjectToString(_estetag.Get((int) (2)))})));
 //BA.debugLineNum = 537;BA.debugLine="If c2.RowCount > 0 Then";
if (_c2.getRowCount()>0) { 
 //BA.debugLineNum = 538;BA.debugLine="c2.Position = 0";
_c2.setPosition((int) (0));
 //BA.debugLineNum = 540;BA.debugLine="Starter.skmt.ExecNonQuery($\"update PEDIDO set";
_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("update PEDIDO set PE_CANT = IFNULL(PE_CANT,0)-(1*'"+__c.SmartStringFormatter("",(Object)(_minimoadesc))+"'), PE_COSTO_TOT= ((IFNULL(PE_CANT,0) -(1*'"+__c.SmartStringFormatter("",(Object)(_minimoadesc))+"'))*'"+__c.SmartStringFormatter("",(Object)(_c2.GetString("CAT_GP_PRECIO")))+"') WHERE PE_PROID = '"+__c.SmartStringFormatter("",_estetag.Get((int) (2)))+"' and PE_CLIENTE in (Select CUENTA from cuentaa) and CONSECUTIVO = '"+__c.SmartStringFormatter("",_estetag.Get((int) (8)))+"'"));
 };
 }else if((_c3.GetString("PE_CANT")).equals(_minimoadesc)) { 
 //BA.debugLineNum = 543;BA.debugLine="Private c2 As Cursor = Starter.skmt.ExecQuery2";
_c2 = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_c2 = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery2("SELECT * FROM CAT_GUNAPROD WHERE CAT_GP_ID = ?",new String[]{BA.ObjectToString(_estetag.Get((int) (2)))})));
 //BA.debugLineNum = 544;BA.debugLine="If c2.RowCount > 0 Then";
if (_c2.getRowCount()>0) { 
 //BA.debugLineNum = 545;BA.debugLine="c2.Position = 0";
_c2.setPosition((int) (0));
 //BA.debugLineNum = 548;BA.debugLine="Starter.skmt.ExecNonQuery($\"delete from PEDID";
_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("delete from PEDIDO where PE_PROID = '"+__c.SmartStringFormatter("",_estetag.Get((int) (2)))+"' and PE_CLIENTE in (Select CUENTA from cuentaa) AND CONSECUTIVO = '"+__c.SmartStringFormatter("",_estetag.Get((int) (8)))+"'"));
 };
 };
 };
 //BA.debugLineNum = 555;BA.debugLine="B4XPage_Appear";
_b4xpage_appear();
 }else {
 //BA.debugLineNum = 558;BA.debugLine="If esteTag.Get(5) = esteTag.Get(6) Then";
if ((_estetag.Get((int) (5))).equals(_estetag.Get((int) (6)))) { 
 //BA.debugLineNum = 559;BA.debugLine="If laCant.Text > 0 Then";
if ((double)(Double.parseDouble(_lacant.getText()))>0) { 
 //BA.debugLineNum = 560;BA.debugLine="If esteTag.Get(3) <> Subs.traeAlmacen Then 'Si";
if ((_estetag.Get((int) (3))).equals((Object)(_subs._traealmacen /*String*/ (ba))) == false) { 
 //BA.debugLineNum = 561;BA.debugLine="Private c2 As Cursor =Starter.skmt.ExecQuery(";
_c2 = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_c2 = (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_RECHAZO FROM HIST_VENTAS WHERE HVD_PROID = '"+__c.SmartStringFormatter("",_estetag.Get((int) (2)))+"' AND HVD_CLIENTE IN (Select CUENTA from cuentaa) AND CONSECUTIVO = '"+__c.SmartStringFormatter("",_estetag.Get((int) (8)))+"'"))));
 //BA.debugLineNum = 562;BA.debugLine="c2.Position = 0";
_c2.setPosition((int) (0));
 //BA.debugLineNum = 563;BA.debugLine="If c2.GetString(\"HVD_RECHAZO\") = \"0\" Then";
if ((_c2.GetString("HVD_RECHAZO")).equals("0")) { 
 //BA.debugLineNum = 566;BA.debugLine="Log(\"ES PROMO\")";
__c.LogImpl("322151228","ES PROMO",0);
 //BA.debugLineNum = 567;BA.debugLine="Log(esteTag.Get(3))";
__c.LogImpl("322151229",BA.ObjectToString(_estetag.Get((int) (3))),0);
 //BA.debugLineNum = 568;BA.debugLine="result =  Msgbox2(\"Si se modifica una promoci";
_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 = 569;BA.debugLine="If result = DialogResponse.POSITIVE Then 'Qui";
if ((_result).equals(BA.NumberToString(__c.DialogResponse.POSITIVE))) { 
 //BA.debugLineNum = 570;BA.debugLine="prodsMap.Remove(esteTag.Get(3))";
_prodsmap.Remove(_estetag.Get((int) (3)));
 //BA.debugLineNum = 574;BA.debugLine="LogColor(esteTag.Get(3),Colors.Blue)";
__c.LogImpl("322151236",BA.ObjectToString(_estetag.Get((int) (3))),__c.Colors.Blue);
 //BA.debugLineNum = 577;BA.debugLine="Starter.skmt.ExecNonQuery($\"update HIST_VENT";
_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("update HIST_VENTAS set HVD_RECHAZO = 1,  HVD_RECHAZOCANT = HVD_CANT  WHERE  HVD_CODPROMO = '"+__c.SmartStringFormatter("",_estetag.Get((int) (3)))+"' and HVD_CLIENTE in (Select CUENTA from cuentaa)"));
 //BA.debugLineNum = 578;BA.debugLine="Starter.skmt.ExecNonQuery($\"update HIST_VENT";
_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("update HIST_VENTAS set HVD_RECHAZO = 2,  HVD_RECHAZOCANT = HVD_CANT  WHERE HVD_PROID = '"+__c.SmartStringFormatter("",_estetag.Get((int) (3)))+"' and HVD_CODPROMO = '"+__c.SmartStringFormatter("",_estetag.Get((int) (3)))+"' and HVD_CLIENTE in (Select CUENTA from cuentaa)"));
 //BA.debugLineNum = 581;BA.debugLine="c.Close";
_c.Close();
 //BA.debugLineNum = 582;BA.debugLine="LogColor(prodsMap, Colors.red)";
__c.LogImpl("322151244",BA.ObjectToString(_prodsmap),__c.Colors.Red);
 //BA.debugLineNum = 583;BA.debugLine="reconstruirPedido = True";
_reconstruirpedido = __c.True;
 //BA.debugLineNum = 584;BA.debugLine="promoABorrar = esteTag.Get(3)";
_promoaborrar = BA.ObjectToString(_estetag.Get((int) (3)));
 //BA.debugLineNum = 585;BA.debugLine="B4XPage_Appear";
_b4xpage_appear();
 };
 }else {
 //BA.debugLineNum = 588;BA.debugLine="If laCant.Text = \"\" Then laCant.Text = 0";
if ((_lacant.getText()).equals("")) { 
_lacant.setText(BA.ObjectToCharSequence(0));};
 //BA.debugLineNum = 589;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 = 590;BA.debugLine="If laCant.Text < 0 Then laCant.Text = 0";
if ((double)(Double.parseDouble(_lacant.getText()))<0) { 
_lacant.setText(BA.ObjectToCharSequence(0));};
 //BA.debugLineNum = 591;BA.debugLine="Log(\"NO ES promo\")";
__c.LogImpl("322151253","NO ES promo",0);
 //BA.debugLineNum = 592;BA.debugLine="Starter.skmt.ExecNonQuery($\"update HIST_VENT";
_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("update HIST_VENTAS set HVD_RECHAZO = 1,  HVD_RECHAZOCANT = IFNULL(HVD_RECHAZOCANT,0) + (1*'"+__c.SmartStringFormatter("",(Object)(_minimoadesc))+"')  WHERE HVD_PROID = '"+__c.SmartStringFormatter("",_estetag.Get((int) (2)))+"' and HVD_cliente in (Select CUENTA from cuentaa) AND CONSECUTIVO = '"+__c.SmartStringFormatter("",_estetag.Get((int) (8)))+"'"));
 //BA.debugLineNum = 593;BA.debugLine="Starter.skmt.ExecNonQuery2(\"update cat_gunapr";
_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 = 594;BA.debugLine="B4XPage_Appear";
_b4xpage_appear();
 };
 }else {
 //BA.debugLineNum = 597;BA.debugLine="If laCant.Text = \"\" Then laCant.Text = 0";
if ((_lacant.getText()).equals("")) { 
_lacant.setText(BA.ObjectToCharSequence(0));};
 //BA.debugLineNum = 598;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 = 599;BA.debugLine="If laCant.Text < 0 Then laCant.Text = 0";
if ((double)(Double.parseDouble(_lacant.getText()))<0) { 
_lacant.setText(BA.ObjectToCharSequence(0));};
 //BA.debugLineNum = 600;BA.debugLine="Log(\"NO ES promo\")";
__c.LogImpl("322151262","NO ES promo",0);
 //BA.debugLineNum = 601;BA.debugLine="Starter.skmt.ExecNonQuery($\"update HIST_VENTA";
_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("update HIST_VENTAS set HVD_RECHAZO = 1,  HVD_RECHAZOCANT = IFNULL(HVD_RECHAZOCANT,0) + (1*'"+__c.SmartStringFormatter("",(Object)(_minimoadesc))+"'), BCAJAS = 0, CANTC = 0  WHERE HVD_PROID = '"+__c.SmartStringFormatter("",_estetag.Get((int) (2)))+"' and HVD_cliente in (Select CUENTA from cuentaa) AND CONSECUTIVO = '"+__c.SmartStringFormatter("",_estetag.Get((int) (8)))+"'"));
 //BA.debugLineNum = 602;BA.debugLine="Starter.skmt.ExecNonQuery2(\"update cat_gunapro";
_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 = 603;BA.debugLine="B4XPage_Appear";
_b4xpage_appear();
 };
 };
 }else {
 //BA.debugLineNum = 608;BA.debugLine="If laCant.Text = \"\" Then laCant.Text = 0";
if ((_lacant.getText()).equals("")) { 
_lacant.setText(BA.ObjectToCharSequence(0));};
 //BA.debugLineNum = 609;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 = 610;BA.debugLine="If laCant.Text < 0 Then laCant.Text = 0";
if ((double)(Double.parseDouble(_lacant.getText()))<0) { 
_lacant.setText(BA.ObjectToCharSequence(0));};
 //BA.debugLineNum = 611;BA.debugLine="Log(\"NO ES promo\")";
__c.LogImpl("322151273","NO ES promo",0);
 //BA.debugLineNum = 616;BA.debugLine="Private c3 As Cursor = Starter.skmt.ExecQuery2(\"";
_c3 = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_c3 = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery2("SELECT PE_CANT FROM PEDIDO WHERE PE_PROID = ? AND PE_CLIENTE IN (SELECT CUENTA FROM CUENTAA) AND CONSECUTIVO = ?",new String[]{BA.ObjectToString(_estetag.Get((int) (2))),BA.ObjectToString(_estetag.Get((int) (8)))})));
 //BA.debugLineNum = 617;BA.debugLine="If c3.RowCount > 0 Then";
if (_c3.getRowCount()>0) { 
 //BA.debugLineNum = 618;BA.debugLine="c3.Position = 0";
_c3.setPosition((int) (0));
 //BA.debugLineNum = 619;BA.debugLine="If c3.GetString(\"PE_CANT\") > 1 Then";
if ((double)(Double.parseDouble(_c3.GetString("PE_CANT")))>1) { 
 //BA.debugLineNum = 620;BA.debugLine="Private c2 As Cursor = Starter.skmt.ExecQuery2(";
_c2 = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_c2 = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery2("SELECT * FROM CAT_GUNAPROD WHERE CAT_GP_ID = ?",new String[]{BA.ObjectToString(_estetag.Get((int) (2)))})));
 //BA.debugLineNum = 621;BA.debugLine="If c2.RowCount > 0 Then";
if (_c2.getRowCount()>0) { 
 //BA.debugLineNum = 622;BA.debugLine="c2.Position = 0";
_c2.setPosition((int) (0));
 //BA.debugLineNum = 623;BA.debugLine="Starter.skmt.ExecNonQuery($\"update PEDIDO se";
_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("update PEDIDO set PE_CANT = IFNULL(PE_CANT,0)-(1*'"+__c.SmartStringFormatter("",(Object)(_minimoadesc))+"'), PE_COSTO_TOT= ((IFNULL(PE_CANT,0) -(1*'"+__c.SmartStringFormatter("",(Object)(_minimoadesc))+"'))*'"+__c.SmartStringFormatter("",(Object)(_c2.GetString("CAT_GP_PRECIO")))+"') WHERE PE_PROID = '"+__c.SmartStringFormatter("",_estetag.Get((int) (2)))+"' and PE_CLIENTE in (Select CUENTA from cuentaa) AND CONSECUTIVO = '"+__c.SmartStringFormatter("",_estetag.Get((int) (8)))+"'"));
 };
 }else if((_c3.GetString("PE_CANT")).equals(BA.NumberToString(1))) { 
 //BA.debugLineNum = 626;BA.debugLine="Private c2 As Cursor = Starter.skmt.ExecQuery2(";
_c2 = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_c2 = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery2("SELECT * FROM CAT_GUNAPROD WHERE CAT_GP_ID = ?",new String[]{BA.ObjectToString(_estetag.Get((int) (2)))})));
 //BA.debugLineNum = 627;BA.debugLine="If c2.RowCount > 0 Then";
if (_c2.getRowCount()>0) { 
 //BA.debugLineNum = 628;BA.debugLine="c2.Position = 0";
_c2.setPosition((int) (0));
 //BA.debugLineNum = 629;BA.debugLine="Starter.skmt.ExecNonQuery($\"delete from PEDI";
_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("delete from PEDIDO where PE_PROID = '"+__c.SmartStringFormatter("",_estetag.Get((int) (2)))+"' and PE_CLIENTE in (Select CUENTA from cuentaa) AND CONSECUTIVO = '"+__c.SmartStringFormatter("",_estetag.Get((int) (8)))+"'"));
 };
 };
 };
 //BA.debugLineNum = 633;BA.debugLine="B4XPage_Appear";
_b4xpage_appear();
 };
 };
 //BA.debugLineNum = 636;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 = 637;BA.debugLine="Log(\"PU: \" & preciou)";
__c.LogImpl("322151299","PU: "+BA.NumberToString(_preciou),0);
 //BA.debugLineNum = 648;BA.debugLine="End Sub";
return "";
}
public String  _b_prodmenosc_click() throws Exception{
int _index = 0;
anywheresoftware.b4a.objects.B4XViewWrapper _pnl0 = null;
anywheresoftware.b4a.objects.B4XViewWrapper _pnl = null;
anywheresoftware.b4a.objects.B4XViewWrapper _lacantc = null;
anywheresoftware.b4a.objects.collections.List _estetag = null;
anywheresoftware.b4a.sql.SQL.CursorWrapper _c3 = null;
float _preciou = 0f;
 //BA.debugLineNum = 972;BA.debugLine="Private Sub b_prodMenosC_Click";
 //BA.debugLineNum = 973;BA.debugLine="etCantHasFocus = False";
_etcanthasfocus = __c.False;
 //BA.debugLineNum = 974;BA.debugLine="Log(\"etCantHasFocus=\" & etCantHasFocus)";
__c.LogImpl("322609922","etCantHasFocus="+BA.ObjectToString(_etcanthasfocus),0);
 //BA.debugLineNum = 975;BA.debugLine="LogColor(\"b_prodMenos_Click\", Colors.Magenta)";
__c.LogImpl("322609923","b_prodMenos_Click",__c.Colors.Magenta);
 //BA.debugLineNum = 976;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 = 977;BA.debugLine="Dim pnl0 As B4XView = clv_pedido.GetPanel(index)";
_pnl0 = new anywheresoftware.b4a.objects.B4XViewWrapper();
_pnl0 = _clv_pedido._getpanel(_index);
 //BA.debugLineNum = 978;BA.debugLine="Dim pnl As B4XView = pnl0.GetView(0)";
_pnl = new anywheresoftware.b4a.objects.B4XViewWrapper();
_pnl = _pnl0.GetView((int) (0));
 //BA.debugLineNum = 979;BA.debugLine="Dim laCantc As B4XView = pnl.GetView(3).GetView(3";
_lacantc = new anywheresoftware.b4a.objects.B4XViewWrapper();
_lacantc = _pnl.GetView((int) (3)).GetView((int) (3));
 //BA.debugLineNum = 981;BA.debugLine="Dim esteTag As List = Regex.Split(\"\\|\", laCantc.T";
_estetag = new anywheresoftware.b4a.objects.collections.List();
_estetag = anywheresoftware.b4a.keywords.Common.ArrayToList(__c.Regex.Split("\\|",BA.ObjectToString(_lacantc.getTag())));
 //BA.debugLineNum = 982;BA.debugLine="Log(\"LC_TEXT:\"&laCantc.Text&\"|PROMO:\"&esteTag.Get";
__c.LogImpl("322609930","LC_TEXT:"+_lacantc.getText()+"|PROMO:"+BA.ObjectToString(_estetag.Get((int) (3)))+"|LC_TAG:"+BA.ObjectToString(_lacantc.getTag())+"|ET:"+BA.ObjectToString(_estetag),0);
 //BA.debugLineNum = 983;BA.debugLine="Log(esteTag)";
__c.LogImpl("322609931",BA.ObjectToString(_estetag),0);
 //BA.debugLineNum = 985;BA.debugLine="If esteTag.Get(7) = \"1\" Then";
if ((_estetag.Get((int) (7))).equals((Object)("1"))) { 
 //BA.debugLineNum = 986;BA.debugLine="Private c3 As Cursor = Starter.skmt.ExecQuery2(\"";
_c3 = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_c3 = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery2("SELECT PE_CAJAS, CONSECUTIVO FROM PEDIDO WHERE PE_PROID = ? AND PE_CLIENTE IN (SELECT CUENTA FROM CUENTAA) AND CONSECUTIVO = ? ",new String[]{BA.ObjectToString(_estetag.Get((int) (2))),BA.ObjectToString(_estetag.Get((int) (8)))})));
 //BA.debugLineNum = 987;BA.debugLine="Log(c3.RowCount)";
__c.LogImpl("322609935",BA.NumberToString(_c3.getRowCount()),0);
 //BA.debugLineNum = 988;BA.debugLine="Log(esteTag.Get(8))";
__c.LogImpl("322609936",BA.ObjectToString(_estetag.Get((int) (8))),0);
 //BA.debugLineNum = 989;BA.debugLine="If c3.RowCount > 0 Then";
if (_c3.getRowCount()>0) { 
 //BA.debugLineNum = 990;BA.debugLine="Log(\"AQUI VEMOS SI ACTUALIZAMOS\")";
__c.LogImpl("322609938","AQUI VEMOS SI ACTUALIZAMOS",0);
 //BA.debugLineNum = 991;BA.debugLine="c3.Position = 0";
_c3.setPosition((int) (0));
 //BA.debugLineNum = 992;BA.debugLine="If c3.GetString(\"PE_CAJAS\") > 1 Then";
if ((double)(Double.parseDouble(_c3.GetString("PE_CAJAS")))>1) { 
 //BA.debugLineNum = 993;BA.debugLine="Starter.skmt.ExecNonQuery($\"update PEDIDO set";
_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("update PEDIDO set PE_CANT = (IFNULL(PE_CANT,0)-(1 * '"+__c.SmartStringFormatter("",(Object)(_subs._traeconversion /*String*/ (ba,BA.ObjectToString(_estetag.Get((int) (2))))))+"')), PE_COSTO_TOT= ((IFNULL(PE_CAJAS,0)-1) *'"+__c.SmartStringFormatter("",(Object)(_subs._traeprecioc /*String*/ (ba,BA.ObjectToString(_estetag.Get((int) (2))))))+"'), PE_CAJAS = IFNULL(PE_CAJAS,0) - 1 WHERE PE_PROID = '"+__c.SmartStringFormatter("",_estetag.Get((int) (2)))+"' and PE_CLIENTE in (Select CUENTA from cuentaa) AND CONSECUTIVO = '"+__c.SmartStringFormatter("",(Object)(_c3.GetString("CONSECUTIVO")))+"'"));
 }else if((_c3.GetString("PE_CAJAS")).equals(BA.NumberToString(1))) { 
 //BA.debugLineNum = 995;BA.debugLine="Starter.skmt.ExecNonQuery($\"delete from PEDIDO";
_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("delete from PEDIDO where PE_PROID = '"+__c.SmartStringFormatter("",_estetag.Get((int) (2)))+"' and PE_CLIENTE in (Select CUENTA from cuentaa) AND CONSECUTIVO = '"+__c.SmartStringFormatter("",(Object)(_c3.GetString("CONSECUTIVO")))+"'"));
 };
 };
 //BA.debugLineNum = 998;BA.debugLine="Log(\"entre al if o algo asi \")";
__c.LogImpl("322609946","entre al if o algo asi ",0);
 //BA.debugLineNum = 999;BA.debugLine="If laCantc.Text = \"\" Then laCantc.Text = 0";
if ((_lacantc.getText()).equals("")) { 
_lacantc.setText(BA.ObjectToCharSequence(0));};
 //BA.debugLineNum = 1000;BA.debugLine="laCantc.Text = laCantc.Text - 1";
_lacantc.setText(BA.ObjectToCharSequence((double)(Double.parseDouble(_lacantc.getText()))-1));
 //BA.debugLineNum = 1001;BA.debugLine="If laCantc.Text < 0 Then laCantc.Text = 0";
if ((double)(Double.parseDouble(_lacantc.getText()))<0) { 
_lacantc.setText(BA.ObjectToCharSequence(0));};
 //BA.debugLineNum = 1002;BA.debugLine="B4XPage_Appear";
_b4xpage_appear();
 }else {
 //BA.debugLineNum = 1007;BA.debugLine="If esteTag.Get(5) = esteTag.Get(6) Then";
if ((_estetag.Get((int) (5))).equals(_estetag.Get((int) (6)))) { 
 //BA.debugLineNum = 1009;BA.debugLine="If laCantc.Text > 0 Then";
if ((double)(Double.parseDouble(_lacantc.getText()))>0) { 
 //BA.debugLineNum = 1010;BA.debugLine="Log(\"entre al if o algo asi \")";
__c.LogImpl("322609958","entre al if o algo asi ",0);
 //BA.debugLineNum = 1011;BA.debugLine="If laCantc.Text = \"\" Then laCantc.Text = 0";
if ((_lacantc.getText()).equals("")) { 
_lacantc.setText(BA.ObjectToCharSequence(0));};
 //BA.debugLineNum = 1012;BA.debugLine="laCantc.Text = laCantc.Text - 1";
_lacantc.setText(BA.ObjectToCharSequence((double)(Double.parseDouble(_lacantc.getText()))-1));
 //BA.debugLineNum = 1013;BA.debugLine="If laCantc.Text < 0 Then laCantc.Text = 0";
if ((double)(Double.parseDouble(_lacantc.getText()))<0) { 
_lacantc.setText(BA.ObjectToCharSequence(0));};
 //BA.debugLineNum = 1014;BA.debugLine="Starter.skmt.ExecNonQuery($\"update HIST_VENTAS";
_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("update HIST_VENTAS set HVD_RECHAZO = 1,  HVD_RECHAZOCANT = (IFNULL(HVD_RECHAZOCANT,0) +(1 * "+__c.SmartStringFormatter("",(Object)(_subs._traeconversion /*String*/ (ba,BA.ObjectToString(_estetag.Get((int) (2))))))+"))  WHERE HVD_PROID = '"+__c.SmartStringFormatter("",_estetag.Get((int) (2)))+"' and HVD_cliente in (Select CUENTA from cuentaa) AND CONSECUTIVO = '"+__c.SmartStringFormatter("",_estetag.Get((int) (8)))+"'"));
 //BA.debugLineNum = 1015;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)),(Object)(_subs._traeconversion /*String*/ (ba,BA.ObjectToString(_estetag.Get((int) (2)))))}));
 //BA.debugLineNum = 1016;BA.debugLine="B4XPage_Appear";
_b4xpage_appear();
 }else if((_lacantc.getText()).equals(BA.NumberToString(0))) { 
 };
 }else {
 //BA.debugLineNum = 1023;BA.debugLine="If laCantc.Text > 0 Then";
if ((double)(Double.parseDouble(_lacantc.getText()))>0) { 
 //BA.debugLineNum = 1026;BA.debugLine="Private c3 As Cursor = Starter.skmt.ExecQuery2(";
_c3 = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_c3 = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery2("SELECT PE_CAJAS FROM PEDIDO WHERE PE_PROID = ? AND PE_CLIENTE IN (SELECT CUENTA FROM CUENTAA) and CONSECUTIVO = ? ",new String[]{BA.ObjectToString(_estetag.Get((int) (2))),BA.ObjectToString(_estetag.Get((int) (8)))})));
 //BA.debugLineNum = 1027;BA.debugLine="If c3.RowCount > 0 Then";
if (_c3.getRowCount()>0) { 
 //BA.debugLineNum = 1028;BA.debugLine="Log(\"AQUI VEMOS SI ACTUALIZAMOS\")";
__c.LogImpl("322609976","AQUI VEMOS SI ACTUALIZAMOS",0);
 //BA.debugLineNum = 1029;BA.debugLine="c3.Position = 0";
_c3.setPosition((int) (0));
 //BA.debugLineNum = 1030;BA.debugLine="If c3.GetString(\"PE_CAJAS\") > 1 Then";
if ((double)(Double.parseDouble(_c3.GetString("PE_CAJAS")))>1) { 
 //BA.debugLineNum = 1031;BA.debugLine="Starter.skmt.ExecNonQuery($\"update PEDIDO se";
_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("update PEDIDO set PE_CANT = (IFNULL(PE_CANT,0)-(1 * '"+__c.SmartStringFormatter("",(Object)(_subs._traeconversion /*String*/ (ba,BA.ObjectToString(_estetag.Get((int) (2))))))+"')), PE_COSTO_TOT= ((IFNULL(PE_CAJAS,0)-1) *'"+__c.SmartStringFormatter("",(Object)(_subs._traeprecioc /*String*/ (ba,BA.ObjectToString(_estetag.Get((int) (2))))))+"'), PE_CAJAS = IFNULL(PE_CAJAS,0) - 1 WHERE PE_PROID = '"+__c.SmartStringFormatter("",_estetag.Get((int) (2)))+"' and PE_CLIENTE in (Select CUENTA from cuentaa) AND CONSECUTIVO = '"+__c.SmartStringFormatter("",_estetag.Get((int) (8)))+"'"));
 }else if((_c3.GetString("PE_CAJAS")).equals(BA.NumberToString(1))) { 
 //BA.debugLineNum = 1033;BA.debugLine="Starter.skmt.ExecNonQuery($\"delete from PEDI";
_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("delete from PEDIDO where PE_PROID = '"+__c.SmartStringFormatter("",_estetag.Get((int) (2)))+"' and PE_CLIENTE in (Select CUENTA from cuentaa) AND CONSECUTIVO = '"+__c.SmartStringFormatter("",_estetag.Get((int) (8)))+"'"));
 };
 };
 //BA.debugLineNum = 1036;BA.debugLine="Log(\"entre al if o algo asi \")";
__c.LogImpl("322609984","entre al if o algo asi ",0);
 //BA.debugLineNum = 1037;BA.debugLine="If laCantc.Text = \"\" Then laCantc.Text = 0";
if ((_lacantc.getText()).equals("")) { 
_lacantc.setText(BA.ObjectToCharSequence(0));};
 //BA.debugLineNum = 1038;BA.debugLine="laCantc.Text = laCantc.Text - 1";
_lacantc.setText(BA.ObjectToCharSequence((double)(Double.parseDouble(_lacantc.getText()))-1));
 //BA.debugLineNum = 1039;BA.debugLine="If laCantc.Text < 0 Then laCantc.Text = 0";
if ((double)(Double.parseDouble(_lacantc.getText()))<0) { 
_lacantc.setText(BA.ObjectToCharSequence(0));};
 //BA.debugLineNum = 1040;BA.debugLine="B4XPage_Appear";
_b4xpage_appear();
 }else if((_lacantc.getText()).equals(BA.NumberToString(0))) { 
 };
 };
 };
 //BA.debugLineNum = 1048;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 = 1049;BA.debugLine="Log(\"PU: \" & preciou)";
__c.LogImpl("322609997","PU: "+BA.NumberToString(_preciou),0);
 //BA.debugLineNum = 1050;BA.debugLine="End Sub";
return "";
}
public String  _b_regresar_click() throws Exception{
 //BA.debugLineNum = 317;BA.debugLine="Sub b_regresar_Click";
 //BA.debugLineNum = 318;BA.debugLine="B4XPages.ShowPage(\"Cliente\")";
_b4xpages._showpage /*String*/ (ba,"Cliente");
 //BA.debugLineNum = 319;BA.debugLine="End Sub";
return "";
}
public String  _b_revversar_click() throws Exception{
anywheresoftware.b4a.sql.SQL.CursorWrapper _c3 = null;
 //BA.debugLineNum = 1056;BA.debugLine="Private Sub b_revversar_Click";
 //BA.debugLineNum = 1057;BA.debugLine="Private c3 As Cursor = Starter.skmt.ExecQuery(\"SE";
_c3 = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_c3 = (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 PEDIDO WHERE PE_CLIENTEOR IN (SELECT CUENTA FROM CUENTAA)")));
 //BA.debugLineNum = 1058;BA.debugLine="If c3.RowCount = 0 Then";
if (_c3.getRowCount()==0) { 
 //BA.debugLineNum = 1059;BA.debugLine="Starter.skmt.ExecNonQuery($\"update HIST_VENTAS s";
_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("update HIST_VENTAS set HVD_RECHAZO = 0,  HVD_RECHAZOCANT = 0, BCAJAS = BCAJAS_OR, CANTC = CANTC_OR  WHERE HVD_cliente in (Select CUENTA from cuentaa)"));
 //BA.debugLineNum = 1060;BA.debugLine="B4XPage_Appear";
_b4xpage_appear();
 }else {
 //BA.debugLineNum = 1062;BA.debugLine="MsgboxAsync(\"Hay productos que ya se vendieron,";
__c.MsgboxAsync(BA.ObjectToCharSequence("Hay productos que ya se vendieron, no se puede regresar la venta"),BA.ObjectToCharSequence("Atención"),ba);
 };
 //BA.debugLineNum = 1066;BA.debugLine="End Sub";
return "";
}
public String  _b4xpage_appear() throws Exception{
int _i = 0;
anywheresoftware.b4a.sql.SQL.CursorWrapper _c4 = null;
int _cantres = 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 _c3 = null;
anywheresoftware.b4a.sql.SQL.CursorWrapper _vc = null;
String _cuenta = "";
String _arti = "";
anywheresoftware.b4a.sql.SQL.CursorWrapper _vc2 = null;
String _cuenta1 = "";
String _arti1 = "";
float _preu = 0f;
anywheresoftware.b4a.sql.SQL.CursorWrapper _vc3 = null;
anywheresoftware.b4a.sql.SQL.CursorWrapper _vc4 = null;
String _cuenta2 = "";
String _arti2 = "";
anywheresoftware.b4a.sql.SQL.CursorWrapper _vc5 = null;
String _cuenta3 = "";
String _arti3 = "";
 //BA.debugLineNum = 68;BA.debugLine="Sub B4XPage_Appear";
 //BA.debugLineNum = 69;BA.debugLine="Subs.centraPanel(p_principal, Root.Width)";
_subs._centrapanel /*String*/ (ba,_p_principal,_root.getWidth());
 //BA.debugLineNum = 73;BA.debugLine="L_CANT.Text =\"\"";
_l_cant.setText(BA.ObjectToCharSequence(""));
 //BA.debugLineNum = 74;BA.debugLine="L_TOTAL.Text=\"\"";
_l_total.setText(BA.ObjectToCharSequence(""));
 //BA.debugLineNum = 75;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 = 76;BA.debugLine="C.Position=0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 77;BA.debugLine="Existe = C.GetString(\"EXISTE\")";
_existe = _c.GetString("EXISTE");
 //BA.debugLineNum = 78;BA.debugLine="C.Close";
_c.Close();
 //BA.debugLineNum = 80;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,CONSECUTIVO, HVD_CLIENTE, HVD_PRONOMBRE, HVD_PROID, HVD_CANT, HVD_COSTO_TOT, HVD_CODPROMO, BCAJAS, CANTC, IFNULL(HVD_RECHAZOCANT,0) AS HVD_RECHAZOCANT from HIST_VENTAS WHERE HVD_CLIENTE IN (Select CUENTA from cuentaa) and hvd_rechazo <> 2 and hvd_cant > 0 order by HVD_CODPROMO desc, HVD_PRONOMBRE asc")));
 //BA.debugLineNum = 81;BA.debugLine="ListView1.Clear";
_listview1.Clear();
 //BA.debugLineNum = 82;BA.debugLine="clv_pedido.Clear";
_clv_pedido._clear();
 //BA.debugLineNum = 83;BA.debugLine="Subs.SetDivider(ListView1, Colors.LightGray, 2)";
_subs._setdivider /*String*/ (ba,_listview1,__c.Colors.LightGray,(int) (2));
 //BA.debugLineNum = 84;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 = 85;BA.debugLine="clv_pedido.Base_Resize(clv_pedido.GetBase.Width,";
_clv_pedido._base_resize(_clv_pedido._getbase().getWidth(),_clv_pedido._getbase().getHeight());
 //BA.debugLineNum = 87;BA.debugLine="If c.RowCount>0 Then";
if (_c.getRowCount()>0) { 
 //BA.debugLineNum = 90;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 = 91;BA.debugLine="c.Position=i";
_c.setPosition(_i);
 //BA.debugLineNum = 93;BA.debugLine="Private c4 As Cursor = Starter.skmt.ExecQuery($";
_c4 = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_c4 = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery(("SELECT IFNULL(PE_CANT,0) AS PE_CANT FROM PEDIDO WHERE PE_PROID = '"+__c.SmartStringFormatter("",(Object)(_c.GetString("HVD_PROID")))+"' AND PE_CLIENTEOR IN (SELECT CUENTA FROM CUENTAA) AND CONSECUTIVO = '"+__c.SmartStringFormatter("",(Object)(_c.GetString("CONSECUTIVO")))+"'"))));
 //BA.debugLineNum = 94;BA.debugLine="If c4.RowCount > 0 Then";
if (_c4.getRowCount()>0) { 
 //BA.debugLineNum = 95;BA.debugLine="c4.Position = 0";
_c4.setPosition((int) (0));
 //BA.debugLineNum = 96;BA.debugLine="Private cantres As Int = c4.GetString(\"PE_CANT";
_cantres = (int)(Double.parseDouble(_c4.GetString("PE_CANT")));
 }else {
 //BA.debugLineNum = 98;BA.debugLine="cantres = 0";
_cantres = (int) (0);
 };
 //BA.debugLineNum = 101;BA.debugLine="If c.GetString(\"BCAJAS\") = \"0\" Then";
if ((_c.GetString("BCAJAS")).equals("0")) { 
 //BA.debugLineNum = 102;BA.debugLine="If c.GetString(\"HVD_CANT\") <> c.GetString(\"HVD";
if ((_c.GetString("HVD_CANT")).equals(_c.GetString("HVD_RECHAZOCANT")) == false) { 
 //BA.debugLineNum = 104;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 = 105;BA.debugLine="Private cant2 As Int = 0";
_cant2 = (int) (0);
 //BA.debugLineNum = 106;BA.debugLine="If oc.RowCount > 0 Then";
if (_oc.getRowCount()>0) { 
 //BA.debugLineNum = 107;BA.debugLine="oc.Position = 0";
_oc.setPosition((int) (0));
 //BA.debugLineNum = 108;BA.debugLine="cant2 = oc.GetString(\"HVD_CANT\")";
_cant2 = (int)(Double.parseDouble(_oc.GetString("HVD_CANT")));
 };
 //BA.debugLineNum = 110;BA.debugLine="oc.Close";
_oc.Close();
 //BA.debugLineNum = 111;BA.debugLine="Dim label1 As Label";
_label1 = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 112;BA.debugLine="label1 = ListView1.TwoLinesLayout.Label";
_label1 = _listview1.getTwoLinesLayout().Label;
 //BA.debugLineNum = 113;BA.debugLine="label1.TextSize = 12";
_label1.setTextSize((float) (12));
 //BA.debugLineNum = 114;BA.debugLine="label1.TextColor = Colors.black";
_label1.setTextColor(__c.Colors.Black);
 //BA.debugLineNum = 115;BA.debugLine="Dim label2 As Label";
_label2 = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 116;BA.debugLine="label2 = ListView1.TwoLinesLayout.SecondLabel";
_label2 = _listview1.getTwoLinesLayout().SecondLabel;
 //BA.debugLineNum = 117;BA.debugLine="label2.TextSize = 12";
_label2.setTextSize((float) (12));
 //BA.debugLineNum = 118;BA.debugLine="label2.TextColor = Colors.black";
_label2.setTextColor(__c.Colors.Black);
 //BA.debugLineNum = 119;BA.debugLine="Private bgColor, textColor As Int";
_bgcolor = 0;
_textcolor = 0;
 //BA.debugLineNum = 120;BA.debugLine="bgColor = Colors.RGB(177, 200, 249)'azul";
_bgcolor = __c.Colors.RGB((int) (177),(int) (200),(int) (249));
 //BA.debugLineNum = 121;BA.debugLine="textColor = Colors.black";
_textcolor = __c.Colors.Black;
 //BA.debugLineNum = 122;BA.debugLine="If c.GetString(\"HVD_CODPROMO\") <> Subs.traeAl";
if ((_c.GetString("HVD_CODPROMO")).equals(_subs._traealmacen /*String*/ (ba)) == false) { 
 //BA.debugLineNum = 124;BA.debugLine="bgColor = Colors.White";
_bgcolor = __c.Colors.White;
 };
 //BA.debugLineNum = 128;BA.debugLine="clv_pedido.Add(CreateListItem(c.GetString(\"HV";
_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._traeprecio2 /*String*/ (ba,_c.GetString("HVD_PROID"),_c.GetString("HVD_CODPROMO"),_c.GetString("CONSECUTIVO")),(int) (((double)(Double.parseDouble(_c.GetString("HVD_CANT")))-(double)(Double.parseDouble(_c.GetString("HVD_RECHAZOCANT"))))),(int) ((double)(Double.parseDouble(_c.GetString("HVD_RECHAZOCANT")))-_cantres),_clv_pedido._asview().getWidth(),__c.DipToCurrent((int) (118)),_bmp,_c.GetString("HVD_PROID"),_bgcolor,_textcolor,_c.GetString("HVD_CODPROMO"),_subs._traecliente /*String*/ (ba),_subs._traecliente /*String*/ (ba),BA.NumberToString(0),(int)(Double.parseDouble(_c.GetString("CONSECUTIVO")))).getObject())),(Object)(_i));
 };
 }else if((_c.GetString("BCAJAS")).equals("1")) { 
 //BA.debugLineNum = 132;BA.debugLine="If c.GetString(\"HVD_CANT\") <> c.GetString(\"HVD";
if ((_c.GetString("HVD_CANT")).equals(_c.GetString("HVD_RECHAZOCANT")) == false) { 
 //BA.debugLineNum = 134;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 = 135;BA.debugLine="Private cant2 As Int = 0";
_cant2 = (int) (0);
 //BA.debugLineNum = 136;BA.debugLine="If oc.RowCount > 0 Then";
if (_oc.getRowCount()>0) { 
 //BA.debugLineNum = 137;BA.debugLine="oc.Position = 0";
_oc.setPosition((int) (0));
 //BA.debugLineNum = 138;BA.debugLine="cant2 = oc.GetString(\"HVD_CANT\")";
_cant2 = (int)(Double.parseDouble(_oc.GetString("HVD_CANT")));
 };
 //BA.debugLineNum = 140;BA.debugLine="oc.Close";
_oc.Close();
 //BA.debugLineNum = 141;BA.debugLine="Dim label1 As Label";
_label1 = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 142;BA.debugLine="label1 = ListView1.TwoLinesLayout.Label";
_label1 = _listview1.getTwoLinesLayout().Label;
 //BA.debugLineNum = 143;BA.debugLine="label1.TextSize = 12";
_label1.setTextSize((float) (12));
 //BA.debugLineNum = 144;BA.debugLine="label1.TextColor = Colors.black";
_label1.setTextColor(__c.Colors.Black);
 //BA.debugLineNum = 145;BA.debugLine="Dim label2 As Label";
_label2 = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 146;BA.debugLine="label2 = ListView1.TwoLinesLayout.SecondLabel";
_label2 = _listview1.getTwoLinesLayout().SecondLabel;
 //BA.debugLineNum = 147;BA.debugLine="label2.TextSize = 12";
_label2.setTextSize((float) (12));
 //BA.debugLineNum = 148;BA.debugLine="label2.TextColor = Colors.black";
_label2.setTextColor(__c.Colors.Black);
 //BA.debugLineNum = 149;BA.debugLine="Private bgColor, textColor As Int";
_bgcolor = 0;
_textcolor = 0;
 //BA.debugLineNum = 150;BA.debugLine="bgColor = Colors.RGB(177, 200, 249)'azul";
_bgcolor = __c.Colors.RGB((int) (177),(int) (200),(int) (249));
 //BA.debugLineNum = 151;BA.debugLine="textColor = Colors.black";
_textcolor = __c.Colors.Black;
 //BA.debugLineNum = 152;BA.debugLine="If c.GetString(\"HVD_CODPROMO\") <> Subs.traeAl";
if ((_c.GetString("HVD_CODPROMO")).equals(_subs._traealmacen /*String*/ (ba)) == false) { 
 //BA.debugLineNum = 154;BA.debugLine="bgColor = Colors.White";
_bgcolor = __c.Colors.White;
 };
 //BA.debugLineNum = 158;BA.debugLine="clv_pedido.Add(CreateListItem(c.GetString(\"HV";
_clv_pedido._add((anywheresoftware.b4a.objects.B4XViewWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.B4XViewWrapper(), (java.lang.Object)(_createlistitem(_c.GetString("HVD_PRONOMBRE"),BA.NumberToString(((double)(Double.parseDouble(_c.GetString("HVD_COSTO_TOT")))/(double)(double)(Double.parseDouble(_c.GetString("CANTC"))))),(int) ((((double)(Double.parseDouble(_c.GetString("HVD_CANT")))-(double)(Double.parseDouble(_c.GetString("HVD_RECHAZOCANT")))))),(int)(Double.parseDouble(_c.GetString("HVD_RECHAZOCANT"))),_clv_pedido._asview().getWidth(),__c.DipToCurrent((int) (118)),_bmp,_c.GetString("HVD_PROID"),_bgcolor,_textcolor,_c.GetString("HVD_CODPROMO"),_subs._traecliente /*String*/ (ba),_subs._traecliente /*String*/ (ba),BA.NumberToString(0),(int)(Double.parseDouble(_c.GetString("CONSECUTIVO")))).getObject())),(Object)(_i));
 };
 };
 }
};
 };
 //BA.debugLineNum = 166;BA.debugLine="Private c3 As Cursor=Starter.skmt.ExecQuery(\"Sele";
_c3 = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_c3 = (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 PEDIDO WHERE PE_CLIENTE IN (Select CUENTA from cuentaa)")));
 //BA.debugLineNum = 167;BA.debugLine="If c3.RowCount>0 Then";
if (_c3.getRowCount()>0) { 
 //BA.debugLineNum = 168;BA.debugLine="For i= 0 To c3.RowCount -1";
{
final int step79 = 1;
final int limit79 = (int) (_c3.getRowCount()-1);
_i = (int) (0) ;
for (;_i <= limit79 ;_i = _i + step79 ) {
 //BA.debugLineNum = 169;BA.debugLine="c3.Position = i";
_c3.setPosition(_i);
 //BA.debugLineNum = 170;BA.debugLine="If c3.GetString(\"PE_BCAJAS\") = \"1\" Then";
if ((_c3.GetString("PE_BCAJAS")).equals("1")) { 
 //BA.debugLineNum = 171;BA.debugLine="Private bgColor, textColor As Int";
_bgcolor = 0;
_textcolor = 0;
 //BA.debugLineNum = 172;BA.debugLine="bgColor = Colors.RGB(221, 132, 132)'rosa";
_bgcolor = __c.Colors.RGB((int) (221),(int) (132),(int) (132));
 //BA.debugLineNum = 173;BA.debugLine="textColor = Colors.black";
_textcolor = __c.Colors.Black;
 //BA.debugLineNum = 174;BA.debugLine="clv_pedido.Add(CreateListItem2(c3.GetString(\"P";
_clv_pedido._add((anywheresoftware.b4a.objects.B4XViewWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.B4XViewWrapper(), (java.lang.Object)(_createlistitem2(_c3.GetString("PE_PRONOMBRE"),_c3.GetString("PE_COSTOU"),(int)(Double.parseDouble(_c3.GetString("PE_CANT"))),(int) (0),_clv_pedido._asview().getWidth(),__c.DipToCurrent((int) (118)),_bmp,_c3.GetString("PE_PROID"),_bgcolor,_textcolor,_subs._traealmacen /*String*/ (ba),_subs._traecliente /*String*/ (ba),_c3.GetString("PE_CLIENTEOR"),BA.NumberToString(1),(int)(Double.parseDouble(_c3.GetString("CONSECUTIVO")))).getObject())),(Object)(_i));
 //BA.debugLineNum = 175;BA.debugLine="Log(\"#####################\"&c3.GetString(\"PE_P";
__c.LogImpl("321626987","#####################"+_c3.GetString("PE_PRONOMBRE")+","+_c3.GetString("PE_CANT"),0);
 }else {
 //BA.debugLineNum = 177;BA.debugLine="Private bgColor, textColor As Int";
_bgcolor = 0;
_textcolor = 0;
 //BA.debugLineNum = 178;BA.debugLine="bgColor = Colors.RGB(221, 132, 132)'rosa";
_bgcolor = __c.Colors.RGB((int) (221),(int) (132),(int) (132));
 //BA.debugLineNum = 179;BA.debugLine="textColor = Colors.black";
_textcolor = __c.Colors.Black;
 //BA.debugLineNum = 180;BA.debugLine="Log(\"#####################\"&c3.GetString(\"PE_P";
__c.LogImpl("321626992","#####################"+_c3.GetString("PE_PRONOMBRE")+","+_c3.GetString("PE_CANT"),0);
 //BA.debugLineNum = 181;BA.debugLine="clv_pedido.Add(CreateListItem(c3.GetString(\"PE";
_clv_pedido._add((anywheresoftware.b4a.objects.B4XViewWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.B4XViewWrapper(), (java.lang.Object)(_createlistitem(_c3.GetString("PE_PRONOMBRE"),_c3.GetString("PE_COSTOU"),(int)(Double.parseDouble(_c3.GetString("PE_CANT"))),(int) (0),_clv_pedido._asview().getWidth(),__c.DipToCurrent((int) (118)),_bmp,_c3.GetString("PE_PROID"),_bgcolor,_textcolor,_subs._traealmacen /*String*/ (ba),_subs._traecliente /*String*/ (ba),_c3.GetString("PE_CLIENTEOR"),BA.NumberToString(1),(int)(Double.parseDouble(_c3.GetString("CONSECUTIVO")))).getObject())),(Object)(_i));
 };
 }
};
 };
 //BA.debugLineNum = 187;BA.debugLine="Private vc As Cursor = Starter.skmt.ExecQuery($\"s";
_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 HVD_PROID, HVD_CANT,HVD_COSTO_TOT, IFNULL(HVD_RECHAZOCANT, 0) AS HVD_RECHAZOCANT from HIST_VENTAS where BCAJAS = 0 and HVD_CODPROMO ='"+__c.SmartStringFormatter("",(Object)(_subs._traealmacen /*String*/ (ba)))+"' and HVD_CLIENTE in (select cuenta from cuentaa)"))));
 //BA.debugLineNum = 189;BA.debugLine="Private Cuenta As String = 0";
_cuenta = BA.NumberToString(0);
 //BA.debugLineNum = 190;BA.debugLine="Private arti As String = 0";
_arti = BA.NumberToString(0);
 //BA.debugLineNum = 191;BA.debugLine="If vc.RowCount > 0 Then";
if (_vc.getRowCount()>0) { 
 //BA.debugLineNum = 192;BA.debugLine="For i = 0 To vc.RowCount - 1";
{
final int step100 = 1;
final int limit100 = (int) (_vc.getRowCount()-1);
_i = (int) (0) ;
for (;_i <= limit100 ;_i = _i + step100 ) {
 //BA.debugLineNum = 193;BA.debugLine="vc.Position = i";
_vc.setPosition(_i);
 //BA.debugLineNum = 194;BA.debugLine="Private cantres As Int = 0";
_cantres = (int) (0);
 //BA.debugLineNum = 195;BA.debugLine="Private c4 As Cursor = Starter.skmt.ExecQuery($";
_c4 = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_c4 = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery(("SELECT IFNULL(PE_CANT,0) AS PE_CANT FROM PEDIDO WHERE PE_PROID = '"+__c.SmartStringFormatter("",(Object)(_vc.GetString("HVD_PROID")))+"' AND PE_CLIENTEOR IN (SELECT CUENTA FROM CUENTAA)"))));
 //BA.debugLineNum = 196;BA.debugLine="If c4.RowCount > 0 Then";
if (_c4.getRowCount()>0) { 
 //BA.debugLineNum = 197;BA.debugLine="c4.Position = 0";
_c4.setPosition((int) (0));
 //BA.debugLineNum = 198;BA.debugLine="cantres = c4.GetString(\"PE_CANT\")";
_cantres = (int)(Double.parseDouble(_c4.GetString("PE_CANT")));
 //BA.debugLineNum = 199;BA.debugLine="Log(c4.GetString(\"PE_CANT\"))";
__c.LogImpl("321627011",_c4.GetString("PE_CANT"),0);
 }else {
 //BA.debugLineNum = 201;BA.debugLine="cantres = 0";
_cantres = (int) (0);
 };
 //BA.debugLineNum = 206;BA.debugLine="arti = arti + (vc.GetString(\"HVD_CANT\") - vc.Ge";
_arti = BA.NumberToString((double)(Double.parseDouble(_arti))+((double)(Double.parseDouble(_vc.GetString("HVD_CANT")))-(double)(Double.parseDouble(_vc.GetString("HVD_RECHAZOCANT")))));
 //BA.debugLineNum = 207;BA.debugLine="Cuenta = Cuenta + ((vc.GetString(\"HVD_CANT\") -";
_cuenta = BA.NumberToString((double)(Double.parseDouble(_cuenta))+(((double)(Double.parseDouble(_vc.GetString("HVD_CANT")))-(double)(Double.parseDouble(_vc.GetString("HVD_RECHAZOCANT"))))*((double)(Double.parseDouble(_vc.GetString("HVD_COSTO_TOT")))/(double)(double)(Double.parseDouble(_vc.GetString("HVD_CANT"))))));
 }
};
 };
 //BA.debugLineNum = 214;BA.debugLine="Private vc2 As Cursor = Starter.skmt.ExecQuery(\"s";
_vc2 = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_vc2 = (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_PROID, HVD_CANT, IFNULL(HVD_RECHAZOCANT, 0) AS HVD_RECHAZOCANT, CANTC,HVD_COSTO_TOT from HIST_VENTAS where HVD_CLIENTE in (select cuenta from cuentaa) AND BCAJAS = 1")));
 //BA.debugLineNum = 215;BA.debugLine="Private Cuenta1 As String = 0";
_cuenta1 = BA.NumberToString(0);
 //BA.debugLineNum = 216;BA.debugLine="Private arti1 As String = 0";
_arti1 = BA.NumberToString(0);
 //BA.debugLineNum = 217;BA.debugLine="If vc2.RowCount > 0 Then";
if (_vc2.getRowCount()>0) { 
 //BA.debugLineNum = 218;BA.debugLine="For i = 0 To vc2.RowCount - 1";
{
final int step119 = 1;
final int limit119 = (int) (_vc2.getRowCount()-1);
_i = (int) (0) ;
for (;_i <= limit119 ;_i = _i + step119 ) {
 //BA.debugLineNum = 219;BA.debugLine="vc2.Position = i";
_vc2.setPosition(_i);
 //BA.debugLineNum = 220;BA.debugLine="Dim preu As Float = NumberFormat2(vc2.GetString";
_preu = (float)(Double.parseDouble(__c.NumberFormat2((double)(Double.parseDouble(_vc2.GetString("HVD_COSTO_TOT")))/(double)(double)(Double.parseDouble(_vc2.GetString("CANTC"))),(int) (0),(int) (2),(int) (2),__c.False)));
 //BA.debugLineNum = 221;BA.debugLine="Private vc3 As Cursor = Starter.skmt.ExecQuery(";
_vc3 = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_vc3 = (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 PRECIOCONVER, CONVERSION from CAT_GUNAPROD where CAT_GP_ID = '"+__c.SmartStringFormatter("",(Object)(_vc2.GetString("HVD_PROID")))+"'"))));
 //BA.debugLineNum = 222;BA.debugLine="If vc3.RowCount > 0 Then";
if (_vc3.getRowCount()>0) { 
 //BA.debugLineNum = 223;BA.debugLine="vc3.Position = 0";
_vc3.setPosition((int) (0));
 //BA.debugLineNum = 224;BA.debugLine="Cuenta1 = Cuenta1 + ((vc2.GetString(\"CANTC\")-(";
_cuenta1 = BA.NumberToString((double)(Double.parseDouble(_cuenta1))+(((double)(Double.parseDouble(_vc2.GetString("CANTC")))-((double)(Double.parseDouble(_vc2.GetString("HVD_RECHAZOCANT")))/(double)(double)(Double.parseDouble(_vc3.GetString("CONVERSION")))))*_preu));
 //BA.debugLineNum = 225;BA.debugLine="arti1 = arti1 + (vc2.GetString(\"HVD_CANT\") - v";
_arti1 = BA.NumberToString((double)(Double.parseDouble(_arti1))+((double)(Double.parseDouble(_vc2.GetString("HVD_CANT")))-(double)(Double.parseDouble(_vc2.GetString("HVD_RECHAZOCANT")))));
 };
 }
};
 };
 //BA.debugLineNum = 231;BA.debugLine="Private vc4 As Cursor = Starter.skmt.ExecQuery($\"";
_vc4 = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_vc4 = (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_PROID, HVD_CANT, IFNULL(HVD_RECHAZOCANT, 0) AS HVD_RECHAZOCANT, CANTC,HVD_COSTO_TOT, HVD_RECHAZO, HVD_CODPROMO from HIST_VENTAS where HVD_CLIENTE in (select cuenta from cuentaa) AND BCAJAS = 0 and HVD_CODPROMO <> '"+__c.SmartStringFormatter("",(Object)(_subs._traealmacen /*String*/ (ba)))+"'"))));
 //BA.debugLineNum = 232;BA.debugLine="Private Cuenta2 As String = 0";
_cuenta2 = BA.NumberToString(0);
 //BA.debugLineNum = 233;BA.debugLine="Private arti2 As String = 0";
_arti2 = BA.NumberToString(0);
 //BA.debugLineNum = 234;BA.debugLine="If vc4.RowCount > 0 Then";
if (_vc4.getRowCount()>0) { 
 //BA.debugLineNum = 236;BA.debugLine="For i = 0 To vc4.RowCount - 1";
{
final int step134 = 1;
final int limit134 = (int) (_vc4.getRowCount()-1);
_i = (int) (0) ;
for (;_i <= limit134 ;_i = _i + step134 ) {
 //BA.debugLineNum = 237;BA.debugLine="vc4.Position = i";
_vc4.setPosition(_i);
 //BA.debugLineNum = 238;BA.debugLine="If vc4.GetString(\"HVD_PROID\") <> vc4.GetString(";
if ((_vc4.GetString("HVD_PROID")).equals(_vc4.GetString("HVD_CODPROMO")) == false) { 
 //BA.debugLineNum = 239;BA.debugLine="If vc4.GetString(\"HVD_RECHAZO\") = 0 Then";
if ((_vc4.GetString("HVD_RECHAZO")).equals(BA.NumberToString(0))) { 
 //BA.debugLineNum = 240;BA.debugLine="Cuenta2 = Cuenta2 + vc4.GetString(\"HVD_COSTO_";
_cuenta2 = BA.NumberToString((double)(Double.parseDouble(_cuenta2))+(double)(Double.parseDouble(_vc4.GetString("HVD_COSTO_TOT"))));
 //BA.debugLineNum = 241;BA.debugLine="arti2 = arti2 + vc4.GetString(\"HVD_CANT\")";
_arti2 = BA.NumberToString((double)(Double.parseDouble(_arti2))+(double)(Double.parseDouble(_vc4.GetString("HVD_CANT"))));
 }else {
 //BA.debugLineNum = 243;BA.debugLine="Private vc5 As Cursor = Starter.skmt.ExecQuer";
_vc5 = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_vc5 = (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)(_vc4.GetString("HVD_PROID")))+"'"))));
 //BA.debugLineNum = 244;BA.debugLine="If vc5.RowCount > 0 Then";
if (_vc5.getRowCount()>0) { 
 //BA.debugLineNum = 245;BA.debugLine="vc5.Position= 0";
_vc5.setPosition((int) (0));
 //BA.debugLineNum = 247;BA.debugLine="Cuenta2 = Cuenta2 +((vc4.GetString(\"HVD_CANT";
_cuenta2 = BA.NumberToString((double)(Double.parseDouble(_cuenta2))+(((double)(Double.parseDouble(_vc4.GetString("HVD_CANT")))-(double)(Double.parseDouble(_vc4.GetString("HVD_RECHAZOCANT"))))*(double)(Double.parseDouble(_vc5.GetString("CAT_GP_PRECIO")))));
 //BA.debugLineNum = 248;BA.debugLine="arti2 = arti2 +(vc4.GetString(\"HVD_CANT\")- v";
_arti2 = BA.NumberToString((double)(Double.parseDouble(_arti2))+((double)(Double.parseDouble(_vc4.GetString("HVD_CANT")))-(double)(Double.parseDouble(_vc4.GetString("HVD_RECHAZOCANT")))));
 };
 };
 };
 }
};
 };
 //BA.debugLineNum = 259;BA.debugLine="Private c4 As Cursor = Starter.skmt.ExecQuery($\"S";
_c4 = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_c4 = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery(("SELECT IFNULL(PE_CANT,0) AS PE_CANT, iFNULL(PE_COSTO_TOT,0) AS PE_COSTO_TOT FROM PEDIDO WHERE PE_CLIENTE IN (SELECT CUENTA FROM CUENTAA)"))));
 //BA.debugLineNum = 260;BA.debugLine="Private Cuenta3 As String = 0";
_cuenta3 = BA.NumberToString(0);
 //BA.debugLineNum = 261;BA.debugLine="Private arti3 As String = 0";
_arti3 = BA.NumberToString(0);
 //BA.debugLineNum = 262;BA.debugLine="If c4.RowCount > 0 Then";
if (_c4.getRowCount()>0) { 
 //BA.debugLineNum = 263;BA.debugLine="For i = 0 To c4.RowCount -1";
{
final int step155 = 1;
final int limit155 = (int) (_c4.getRowCount()-1);
_i = (int) (0) ;
for (;_i <= limit155 ;_i = _i + step155 ) {
 //BA.debugLineNum = 264;BA.debugLine="c4.Position = i";
_c4.setPosition(_i);
 //BA.debugLineNum = 265;BA.debugLine="arti3 = arti3 + c4.GetString(\"PE_CANT\")";
_arti3 = BA.NumberToString((double)(Double.parseDouble(_arti3))+(double)(Double.parseDouble(_c4.GetString("PE_CANT"))));
 //BA.debugLineNum = 266;BA.debugLine="Cuenta3 = Cuenta3 + c4.GetString(\"PE_COSTO_TOT\"";
_cuenta3 = BA.NumberToString((double)(Double.parseDouble(_cuenta3))+(double)(Double.parseDouble(_c4.GetString("PE_COSTO_TOT"))));
 }
};
 };
 //BA.debugLineNum = 270;BA.debugLine="If Cuenta < 0 Then";
if ((double)(Double.parseDouble(_cuenta))<0) { 
 //BA.debugLineNum = 271;BA.debugLine="Cuenta = 0";
_cuenta = BA.NumberToString(0);
 };
 //BA.debugLineNum = 273;BA.debugLine="If Cuenta1 < 0 Then";
if ((double)(Double.parseDouble(_cuenta1))<0) { 
 //BA.debugLineNum = 274;BA.debugLine="Cuenta = 0";
_cuenta = BA.NumberToString(0);
 };
 //BA.debugLineNum = 276;BA.debugLine="If Cuenta2 < 0 Then";
if ((double)(Double.parseDouble(_cuenta2))<0) { 
 //BA.debugLineNum = 277;BA.debugLine="Cuenta = 0";
_cuenta = BA.NumberToString(0);
 };
 //BA.debugLineNum = 279;BA.debugLine="If Cuenta3 < 0 Then";
if ((double)(Double.parseDouble(_cuenta3))<0) { 
 //BA.debugLineNum = 280;BA.debugLine="Cuenta = 0";
_cuenta = BA.NumberToString(0);
 };
 //BA.debugLineNum = 283;BA.debugLine="If arti < 0 Then";
if ((double)(Double.parseDouble(_arti))<0) { 
 //BA.debugLineNum = 284;BA.debugLine="arti = 0";
_arti = BA.NumberToString(0);
 };
 //BA.debugLineNum = 286;BA.debugLine="If arti1 < 0 Then";
if ((double)(Double.parseDouble(_arti1))<0) { 
 //BA.debugLineNum = 287;BA.debugLine="arti = 0";
_arti = BA.NumberToString(0);
 };
 //BA.debugLineNum = 289;BA.debugLine="If arti2 < 0 Then";
if ((double)(Double.parseDouble(_arti2))<0) { 
 //BA.debugLineNum = 290;BA.debugLine="arti = 0";
_arti = BA.NumberToString(0);
 };
 //BA.debugLineNum = 292;BA.debugLine="If arti3 < 0 Then";
if ((double)(Double.parseDouble(_arti3))<0) { 
 //BA.debugLineNum = 293;BA.debugLine="arti = 0";
_arti = BA.NumberToString(0);
 };
 //BA.debugLineNum = 296;BA.debugLine="Log(Cuenta&\",\"&Cuenta1&\",\"&Cuenta2&\",\"&Cuenta3)";
__c.LogImpl("321627108",_cuenta+","+_cuenta1+","+_cuenta2+","+_cuenta3,0);
 //BA.debugLineNum = 297;BA.debugLine="Log(arti&\",\"&arti1&\",\"&arti2&\",\"&arti3)";
__c.LogImpl("321627109",_arti+","+_arti1+","+_arti2+","+_arti3,0);
 //BA.debugLineNum = 298;BA.debugLine="If Cuenta + Cuenta1 + Cuenta2 + Cuenta3 < 0 Then";
if ((double)(Double.parseDouble(_cuenta))+(double)(Double.parseDouble(_cuenta1))+(double)(Double.parseDouble(_cuenta2))+(double)(Double.parseDouble(_cuenta3))<0) { 
 //BA.debugLineNum = 299;BA.debugLine="L_TOTAL.Text = 0";
_l_total.setText(BA.ObjectToCharSequence(0));
 }else {
 //BA.debugLineNum = 301;BA.debugLine="L_TOTAL.Text = NumberFormat2((Cuenta + Cuenta1 +";
_l_total.setText(BA.ObjectToCharSequence(__c.NumberFormat2(((double)(Double.parseDouble(_cuenta))+(double)(Double.parseDouble(_cuenta1))+(double)(Double.parseDouble(_cuenta2))+(double)(Double.parseDouble(_cuenta3))),(int) (0),(int) (2),(int) (2),__c.True)));
 };
 //BA.debugLineNum = 303;BA.debugLine="If arti + arti1 +arti2 + arti3 < 0 Then";
if ((double)(Double.parseDouble(_arti))+(double)(Double.parseDouble(_arti1))+(double)(Double.parseDouble(_arti2))+(double)(Double.parseDouble(_arti3))<0) { 
 //BA.debugLineNum = 304;BA.debugLine="L_CANT.Text = 0";
_l_cant.setText(BA.ObjectToCharSequence(0));
 }else {
 //BA.debugLineNum = 306;BA.debugLine="L_CANT.Text = NumberFormat2((arti + arti1 +arti2";
_l_cant.setText(BA.ObjectToCharSequence(__c.NumberFormat2(((double)(Double.parseDouble(_arti))+(double)(Double.parseDouble(_arti1))+(double)(Double.parseDouble(_arti2))+(double)(Double.parseDouble(_arti3))),(int) (0),(int) (0),(int) (0),__c.True)));
 };
 //BA.debugLineNum = 310;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_mazapa.keymon.lat.c_detalleventa parent) {
this.parent = parent;
}
reparto_mazapa.keymon.lat.c_detalleventa 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 = 324;BA.debugLine="B4XPages.ShowPage(\"Cliente\")";
parent._b4xpages._showpage /*String*/ (ba,"Cliente");
 //BA.debugLineNum = 326;BA.debugLine="Return False";
if (true) {
parent.__c.ReturnFromResumableSub(this,(Object)(parent.__c.False));return;};
 //BA.debugLineNum = 327;BA.debugLine="End Sub";
if (true) break;

            }
        }
    }
}
public String  _b4xpage_created(anywheresoftware.b4a.objects.B4XViewWrapper _root1) throws Exception{
 //BA.debugLineNum = 56;BA.debugLine="Private Sub B4XPage_Created (Root1 As B4XView)";
 //BA.debugLineNum = 57;BA.debugLine="Root = Root1";
_root = _root1;
 //BA.debugLineNum = 58;BA.debugLine="B4XPages.SetTitle(Me, \"Detalle de venta\")";
_b4xpages._settitle /*String*/ (ba,this,(Object)("Detalle de venta"));
 //BA.debugLineNum = 60;BA.debugLine="g.Initialize(\"GPS\")";
_g.Initialize("GPS");
 //BA.debugLineNum = 61;BA.debugLine="Root.LoadLayout(\"detalleVenta\")";
_root.LoadLayout("detalleVenta",ba);
 //BA.debugLineNum = 62;BA.debugLine="b_borra.Visible = False";
_b_borra.setVisible(__c.False);
 //BA.debugLineNum = 63;BA.debugLine="Titulo.Text = \"Pedido\"";
_titulo.setText(BA.ObjectToCharSequence("Pedido"));
 //BA.debugLineNum = 64;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="Private b_prodMenosC As Button";
_b_prodmenosc = new anywheresoftware.b4a.objects.ButtonWrapper();
 //BA.debugLineNum = 41;BA.debugLine="Private l_pCantC As Label";
_l_pcantc = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 42;BA.debugLine="Private et_pCantC As EditText";
_et_pcantc = new anywheresoftware.b4a.objects.EditTextWrapper();
 //BA.debugLineNum = 43;BA.debugLine="Private b_prodMasC As Button";
_b_prodmasc = new anywheresoftware.b4a.objects.ButtonWrapper();
 //BA.debugLineNum = 44;BA.debugLine="Private p_botMasMenC As Panel";
_p_botmasmenc = new anywheresoftware.b4a.objects.PanelWrapper();
 //BA.debugLineNum = 45;BA.debugLine="Private p_botMasMen As Panel";
_p_botmasmen = new anywheresoftware.b4a.objects.PanelWrapper();
 //BA.debugLineNum = 46;BA.debugLine="Private l_cajas As Label";
_l_cajas = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 47;BA.debugLine="Private l_piezas As Label";
_l_piezas = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 48;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,String _clienterecha,String _bandera,int _consecutivo) throws Exception{
anywheresoftware.b4a.objects.B4XViewWrapper _p = null;
anywheresoftware.b4a.objects.CSBuilder _cs = null;
 //BA.debugLineNum = 442;BA.debugLine="Sub CreateListItem(Text As String, precioU As Stri";
 //BA.debugLineNum = 443;BA.debugLine="Dim p As B4XView = xui.CreatePanel(\"\")";
_p = new anywheresoftware.b4a.objects.B4XViewWrapper();
_p = _xui.CreatePanel(ba,"");
 //BA.debugLineNum = 444;BA.debugLine="Private cs As CSBuilder";
_cs = new anywheresoftware.b4a.objects.CSBuilder();
 //BA.debugLineNum = 445;BA.debugLine="cs.Initialize";
_cs.Initialize();
 //BA.debugLineNum = 446;BA.debugLine="p.SetLayoutAnimated(0, 0, 0, Width, Height)";
_p.SetLayoutAnimated((int) (0),(int) (0),(int) (0),_width,_height);
 //BA.debugLineNum = 447;BA.debugLine="p.LoadLayout(\"prodItem2\")";
_p.LoadLayout("prodItem2",ba);
 //BA.debugLineNum = 448;BA.debugLine="p_prods.Color = bc";
_p_prods.setColor(_bc);
 //BA.debugLineNum = 449;BA.debugLine="l_prodX.TextColor = tc";
_l_prodx.setTextColor(_tc);
 //BA.debugLineNum = 450;BA.debugLine="precioU = $\"$1.2{precioU}\"$";
_preciou = (""+__c.SmartStringFormatter("1.2",(Object)(_preciou))+"");
 //BA.debugLineNum = 451;BA.debugLine="l_prodX.Text = Text&CRLF&\"Cant: \" & inv2 & \"   $\"";
_l_prodx.setText(BA.ObjectToCharSequence(_text+__c.CRLF+"Cant: "+BA.NumberToString(_inv2)+"   $"+_preciou));
 //BA.debugLineNum = 452;BA.debugLine="If promo <> \"1\" And precioU = 0 Then";
if ((_promo).equals("1") == false && (_preciou).equals(BA.NumberToString(0))) { 
 //BA.debugLineNum = 453;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 = 455;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 = 458;BA.debugLine="l_pCant.Tag = Round2(precioU.Replace(\",\",\"\"),2)&\"";
_l_pcant.setTag((Object)(BA.NumberToString(__c.Round2((double)(Double.parseDouble(_preciou.replace(",",""))),(int) (2)))+"|"+BA.NumberToString(_inv)+"|"+_prodid+"|"+_promo+"|"+BA.NumberToString(_inv2)+"|"+_cliente_original+"|"+_clienterecha+"|"+_bandera+"|"+BA.NumberToString(_consecutivo)));
 //BA.debugLineNum = 459;BA.debugLine="et_pCant.Tag = Round2(precioU.Replace(\",\",\"\"),2)&";
_et_pcant.setTag((Object)(BA.NumberToString(__c.Round2((double)(Double.parseDouble(_preciou.replace(",",""))),(int) (2)))+"|"+BA.NumberToString(_inv)+"|"+_prodid+"|"+_promo+"|"+BA.NumberToString(_inv2)+"|"+_cliente_original+"|"+_clienterecha+"|"+_bandera+"|"+BA.NumberToString(_consecutivo)));
 //BA.debugLineNum = 460;BA.debugLine="p_prods.Tag = l_pCant.tag";
_p_prods.setTag(_l_pcant.getTag());
 //BA.debugLineNum = 462;BA.debugLine="l_pCant.Text = inv";
_l_pcant.setText(BA.ObjectToCharSequence(_inv));
 //BA.debugLineNum = 466;BA.debugLine="l_pCant.BringToFront";
_l_pcant.BringToFront();
 //BA.debugLineNum = 467;BA.debugLine="et_pCant.SendToBack";
_et_pcant.SendToBack();
 //BA.debugLineNum = 468;BA.debugLine="p_botMasMenC.Visible = False";
_p_botmasmenc.setVisible(__c.False);
 //BA.debugLineNum = 469;BA.debugLine="l_cajas.Visible = False";
_l_cajas.setVisible(__c.False);
 //BA.debugLineNum = 471;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 = 472;BA.debugLine="End Sub";
return null;
}
public anywheresoftware.b4a.objects.PanelWrapper  _createlistitem2(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,String _clienterecha,String _bandera,int _consecutivo) throws Exception{
anywheresoftware.b4a.objects.B4XViewWrapper _p = null;
anywheresoftware.b4a.objects.CSBuilder _cs = null;
 //BA.debugLineNum = 474;BA.debugLine="Sub CreateListItem2(Text As String, precioU As Str";
 //BA.debugLineNum = 475;BA.debugLine="Dim p As B4XView = xui.CreatePanel(\"\")";
_p = new anywheresoftware.b4a.objects.B4XViewWrapper();
_p = _xui.CreatePanel(ba,"");
 //BA.debugLineNum = 476;BA.debugLine="Private cs As CSBuilder";
_cs = new anywheresoftware.b4a.objects.CSBuilder();
 //BA.debugLineNum = 477;BA.debugLine="cs.Initialize";
_cs.Initialize();
 //BA.debugLineNum = 478;BA.debugLine="p.SetLayoutAnimated(0, 0, 0, Width, Height)";
_p.SetLayoutAnimated((int) (0),(int) (0),(int) (0),_width,_height);
 //BA.debugLineNum = 479;BA.debugLine="p.LoadLayout(\"prodItem2\")";
_p.LoadLayout("prodItem2",ba);
 //BA.debugLineNum = 480;BA.debugLine="p_prods.Color = bc";
_p_prods.setColor(_bc);
 //BA.debugLineNum = 481;BA.debugLine="l_prodX.TextColor = tc";
_l_prodx.setTextColor(_tc);
 //BA.debugLineNum = 482;BA.debugLine="precioU = $\"$1.2{precioU}\"$";
_preciou = (""+__c.SmartStringFormatter("1.2",(Object)(_preciou))+"");
 //BA.debugLineNum = 483;BA.debugLine="l_prodX.Text = Text&CRLF&\"Cant: \" & inv2 & \"   $\"";
_l_prodx.setText(BA.ObjectToCharSequence(_text+__c.CRLF+"Cant: "+BA.NumberToString(_inv2)+"   $"+_preciou));
 //BA.debugLineNum = 485;BA.debugLine="If promo <> \"1\" And precioU = 0 Then";
if ((_promo).equals("1") == false && (_preciou).equals(BA.NumberToString(0))) { 
 //BA.debugLineNum = 486;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 = 488;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 = 490;BA.debugLine="l_pCantC.Tag = Round2(precioU.Replace(\",\",\"\"),2)&";
_l_pcantc.setTag((Object)(BA.NumberToString(__c.Round2((double)(Double.parseDouble(_preciou.replace(",",""))),(int) (2)))+"|"+BA.NumberToString(_inv)+"|"+_prodid+"|"+_promo+"|"+BA.NumberToString(_inv2)+"|"+_cliente_original+"|"+_clienterecha+"|"+_bandera+"|"+BA.NumberToString(_consecutivo)));
 //BA.debugLineNum = 491;BA.debugLine="et_pCantC.Tag = Round2(precioU.Replace(\",\",\"\"),2)";
_et_pcantc.setTag((Object)(BA.NumberToString(__c.Round2((double)(Double.parseDouble(_preciou.replace(",",""))),(int) (2)))+"|"+BA.NumberToString(_inv)+"|"+_prodid+"|"+_promo+"|"+BA.NumberToString(_inv2)+"|"+_cliente_original+"|"+_clienterecha+"|"+_bandera+"|"+BA.NumberToString(_consecutivo)));
 //BA.debugLineNum = 492;BA.debugLine="p_prods.Tag = l_pCantC.tag";
_p_prods.setTag(_l_pcantc.getTag());
 //BA.debugLineNum = 494;BA.debugLine="l_pCantC.Text = NumberFormat2(inv/Subs.traeConver";
_l_pcantc.setText(BA.ObjectToCharSequence(__c.NumberFormat2(_inv/(double)(double)(Double.parseDouble(_subs._traeconversion /*String*/ (ba,_prodid))),(int) (0),(int) (0),(int) (0),__c.False)));
 //BA.debugLineNum = 498;BA.debugLine="l_pCantC.BringToFront";
_l_pcantc.BringToFront();
 //BA.debugLineNum = 499;BA.debugLine="et_pCantC.SendToBack";
_et_pcantc.SendToBack();
 //BA.debugLineNum = 500;BA.debugLine="p_botMasMen.Visible = False";
_p_botmasmen.setVisible(__c.False);
 //BA.debugLineNum = 501;BA.debugLine="l_piezas.Visible = False";
_l_piezas.setVisible(__c.False);
 //BA.debugLineNum = 503;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 = 504;BA.debugLine="End Sub";
return null;
}
public String  _cuentaprods(String _accion) throws Exception{
 //BA.debugLineNum = 751;BA.debugLine="Sub cuentaProds(accion As String)";
 //BA.debugLineNum = 913;BA.debugLine="End Sub";
return "";
}
public String  _gps_locationchanged(anywheresoftware.b4a.gps.LocationWrapper _location1) throws Exception{
 //BA.debugLineNum = 312;BA.debugLine="Sub GPS_LocationChanged (Location1 As Location)";
 //BA.debugLineNum = 315;BA.debugLine="End Sub";
return "";
}
public Object  _initialize(anywheresoftware.b4a.BA _ba) throws Exception{
innerInitialize(_ba);
 //BA.debugLineNum = 51;BA.debugLine="Public Sub Initialize As Object";
 //BA.debugLineNum = 52;BA.debugLine="Return Me";
if (true) return this;
 //BA.debugLineNum = 53;BA.debugLine="End Sub";
return null;
}
public String  _l_pcant_click() throws Exception{
 //BA.debugLineNum = 920;BA.debugLine="Private Sub l_pCant_Click";
 //BA.debugLineNum = 922;BA.debugLine="End Sub";
return "";
}
public String  _l_pcantc_click() throws Exception{
 //BA.debugLineNum = 1052;BA.debugLine="Private Sub l_pCantC_Click";
 //BA.debugLineNum = 1054;BA.debugLine="End Sub";
return "";
}
public String  _listview1_itemlongclick(int _position,Object _value) throws Exception{
 //BA.debugLineNum = 329;BA.debugLine="Sub ListView1_ItemLongClick (Position As Int, Valu";
 //BA.debugLineNum = 373;BA.debugLine="End Sub";
return "";
}
public String  _lv2_itemclick(int _position,Object _value) throws Exception{
 //BA.debugLineNum = 375;BA.debugLine="Sub lv2_ItemClick (Position As Int, Value As Objec";
 //BA.debugLineNum = 436;BA.debugLine="End Sub";
return "";
}
public String  _p_prods_click() throws Exception{
 //BA.debugLineNum = 924;BA.debugLine="Sub p_prods_Click";
 //BA.debugLineNum = 925;BA.debugLine="Log(Sender.As(Panel).tag)";
__c.LogImpl("322478849",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 = 926;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;
}
}
