package reparto_intmex.keymon.lat;


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

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

 public anywheresoftware.b4a.keywords.Common __c = null;
public anywheresoftware.b4a.objects.B4XViewWrapper _root = null;
public anywheresoftware.b4a.objects.B4XViewWrapper.XUI _xui = null;
public 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.ButtonWrapper _b_revversar = null;
public anywheresoftware.b4a.objects.LabelWrapper _label2 = null;
public anywheresoftware.b4a.objects.LabelWrapper _label3 = null;
public anywheresoftware.b4a.objects.LabelWrapper _l_piezas = null;
public anywheresoftware.b4a.objects.LabelWrapper _l_cajas = null;
public b4a.example.dateutils _dateutils = null;
public reparto_intmex.keymon.lat.main _main = null;
public reparto_intmex.keymon.lat.appupdater _appupdater = null;
public reparto_intmex.keymon.lat.starter _starter = null;
public reparto_intmex.keymon.lat.foto _foto = null;
public reparto_intmex.keymon.lat.mapa_cliente _mapa_cliente = null;
public reparto_intmex.keymon.lat.mapa_rutas _mapa_rutas = null;
public reparto_intmex.keymon.lat.subs _subs = null;
public reparto_intmex.keymon.lat.tracker _tracker = null;
public reparto_intmex.keymon.lat.newinst2 _newinst2 = null;
public reparto_intmex.keymon.lat.b4xpages _b4xpages = null;
public reparto_intmex.keymon.lat.b4xcollections _b4xcollections = null;
public reparto_intmex.keymon.lat.httputils2service _httputils2service = null;
public reparto_intmex.keymon.lat.xuiviewsutils _xuiviewsutils = null;
public String  _b_guardar_click() throws Exception{
 //BA.debugLineNum = 1091;BA.debugLine="Private Sub b_guardar_Click";
 //BA.debugLineNum = 1093;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;
anywheresoftware.b4a.sql.SQL.CursorWrapper _preciocat = null;
String _preciofull = "";
String _pup = "";
anywheresoftware.b4a.sql.SQL.CursorWrapper _precioreg = null;
String _precioregalo = "";
String _esregalo = "";
 //BA.debugLineNum = 664;BA.debugLine="Sub b_prodMas_Click";
 //BA.debugLineNum = 665;BA.debugLine="etCantHasFocus = False";
_etcanthasfocus = __c.False;
 //BA.debugLineNum = 666;BA.debugLine="Dim sDate, sTime As String";
_sdate = "";
_stime = "";
 //BA.debugLineNum = 667;BA.debugLine="DateTime.DateFormat = \"dd/MM/yyyy\"";
__c.DateTime.setDateFormat("dd/MM/yyyy");
 //BA.debugLineNum = 668;BA.debugLine="DateTime.TimeFormat = \"HH:mm:ss\"";
__c.DateTime.setTimeFormat("HH:mm:ss");
 //BA.debugLineNum = 669;BA.debugLine="sDate = DateTime.Date(DateTime.Now)";
_sdate = __c.DateTime.Date(__c.DateTime.getNow());
 //BA.debugLineNum = 670;BA.debugLine="sTime = DateTime.Time(DateTime.Now)";
_stime = __c.DateTime.Time(__c.DateTime.getNow());
 //BA.debugLineNum = 672;BA.debugLine="LogColor(\"b_prodMas_Click\", Colors.Magenta)";
__c.LogImpl("819464200","b_prodMas_Click",__c.Colors.Magenta);
 //BA.debugLineNum = 673;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 = 674;BA.debugLine="Dim pnl0 As B4XView = clv_pedido.GetPanel(index)";
_pnl0 = new anywheresoftware.b4a.objects.B4XViewWrapper();
_pnl0 = _clv_pedido._getpanel(_index);
 //BA.debugLineNum = 675;BA.debugLine="Dim pnl As B4XView = pnl0.GetView(0)";
_pnl = new anywheresoftware.b4a.objects.B4XViewWrapper();
_pnl = _pnl0.GetView((int) (0));
 //BA.debugLineNum = 676;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 = 680;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 = 681;BA.debugLine="Log(\"LC_TEXT:\"&laCant.Text&\"|LC_TAG:\"&laCant.Tag&";
__c.LogImpl("819464209","LC_TEXT:"+_lacant.getText()+"|LC_TAG:"+BA.ObjectToString(_lacant.getTag())+"|ET:"+BA.ObjectToString(_estetag),0);
 //BA.debugLineNum = 682;BA.debugLine="If laCant.Text = \"\" Then laCant.Text = 0";
if ((_lacant.getText()).equals("")) { 
_lacant.setText(BA.ObjectToCharSequence(0));};
 //BA.debugLineNum = 684;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 = 686;BA.debugLine="Private minimoadesc As String";
_minimoadesc = "";
 //BA.debugLineNum = 687;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 = 688;BA.debugLine="If minimos.RowCount > 0 Then";
if (_minimos.getRowCount()>0) { 
 //BA.debugLineNum = 689;BA.debugLine="minimos.Position = 0";
_minimos.setPosition((int) (0));
 //BA.debugLineNum = 690;BA.debugLine="minimoadesc = minimos.GetString(\"CAT_DP_CANT_MIN";
_minimoadesc = _minimos.GetString("CAT_DP_CANT_MIN_VENTA");
 }else {
 //BA.debugLineNum = 692;BA.debugLine="minimoadesc = \"1\"";
_minimoadesc = "1";
 };
 //BA.debugLineNum = 694;BA.debugLine="minimos.Close";
_minimos.Close();
 //BA.debugLineNum = 695;BA.debugLine="minimoadesc = \"1\"";
_minimoadesc = "1";
 //BA.debugLineNum = 698;BA.debugLine="LogColor($\"++++++++++++++++++++++++++   ${esteTag";
__c.LogImpl("819464226",("++++++++++++++++++++++++++   "+__c.SmartStringFormatter("",(Object)(_estetag.getObject()))+""),__c.Colors.Green);
 //BA.debugLineNum = 699;BA.debugLine="Log(esteTag.get(4))";
__c.LogImpl("819464227",BA.ObjectToString(_estetag.Get((int) (4))),0);
 //BA.debugLineNum = 700;BA.debugLine="If esteTag.Get(4) = \"0\" Then";
if ((_estetag.Get((int) (4))).equals((Object)("0"))) { 
 }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("819464232",("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_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 String[]{BA.ObjectToString(_estetag.Get((int) (2)))}));
 //BA.debugLineNum = 707;BA.debugLine="c = Starter.skmt.ExecQuery2(\"SELECT * FROM PEDI";
_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) (6)))})));
 //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.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 HIST_VENTAS WHERE HVD_PROID = ? AND CONSECUTIVO = ? ",new String[]{BA.ObjectToString(_estetag.Get((int) (2))),BA.ObjectToString(_estetag.Get((int) (6)))})));
 //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="Dim preciocat As Cursor = Starter.skmt.ExecQu";
_preciocat = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_preciocat = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery(("select IFNULL(CAT_GP_PRECIO,0) AS CAT_GP_PRECIO from CAT_GUNAPROD WHERE CAT_GP_ID = '"+__c.SmartStringFormatter("",(Object)(_c2.GetString("HVD_PROID")))+"'"))));
 //BA.debugLineNum = 714;BA.debugLine="If preciocat.RowCount > 0 Then";
if (_preciocat.getRowCount()>0) { 
 //BA.debugLineNum = 715;BA.debugLine="preciocat.Position = 0";
_preciocat.setPosition((int) (0));
 //BA.debugLineNum = 716;BA.debugLine="Dim preciofull As String = preciocat.GetStri";
_preciofull = _preciocat.GetString("CAT_GP_PRECIO");
 };
 //BA.debugLineNum = 718;BA.debugLine="preciocat.Close";
_preciocat.Close();
 //BA.debugLineNum = 720;BA.debugLine="If c2.GetString(\"HVD_CODPROMO\") = Subs.traeAl";
if ((_c2.GetString("HVD_CODPROMO")).equals(_subs._traealmacen /*String*/ (ba))) { 
 //BA.debugLineNum = 721;BA.debugLine="Private pup As String = c2.GetString(\"HVD_CO";
_pup = BA.NumberToString((double)(Double.parseDouble(_c2.GetString("HVD_COSTO_TOT")))/(double)(double)(Double.parseDouble(_c2.GetString("HVD_CANT"))));
 //BA.debugLineNum = 723;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)(_pup))+"') WHERE PE_PROID = '"+__c.SmartStringFormatter("",_estetag.Get((int) (2)))+"' and PE_CLIENTE in (Select CUENTA from cuentaa) AND CONSECUTIVO = '"+__c.SmartStringFormatter("",_estetag.Get((int) (6)))+"'"));
 }else {
 //BA.debugLineNum = 725;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)(_preciofull))+"') WHERE PE_PROID = '"+__c.SmartStringFormatter("",_estetag.Get((int) (2)))+"' and PE_CLIENTE in (Select CUENTA from cuentaa) AND CONSECUTIVO = '"+__c.SmartStringFormatter("",_estetag.Get((int) (6)))+"'"));
 };
 };
 }else {
 //BA.debugLineNum = 730;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 HIST_VENTAS WHERE HVD_PROID = ? AND CONSECUTIVO = ? ",new String[]{BA.ObjectToString(_estetag.Get((int) (2))),BA.ObjectToString(_estetag.Get((int) (6)))})));
 //BA.debugLineNum = 731;BA.debugLine="If c2.RowCount > 0 Then";
if (_c2.getRowCount()>0) { 
 //BA.debugLineNum = 732;BA.debugLine="c2.Position = 0";
_c2.setPosition((int) (0));
 //BA.debugLineNum = 734;BA.debugLine="Dim preciocat As Cursor = Starter.skmt.ExecQu";
_preciocat = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_preciocat = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery(("select IFNULL(CAT_GP_PRECIO,0) AS CAT_GP_PRECIO from CAT_GUNAPROD WHERE CAT_GP_ID = '"+__c.SmartStringFormatter("",(Object)(_c2.GetString("HVD_PROID")))+"'"))));
 //BA.debugLineNum = 735;BA.debugLine="If preciocat.RowCount > 0 Then";
if (_preciocat.getRowCount()>0) { 
 //BA.debugLineNum = 736;BA.debugLine="preciocat.Position = 0";
_preciocat.setPosition((int) (0));
 //BA.debugLineNum = 737;BA.debugLine="Dim preciofull As String = preciocat.GetStri";
_preciofull = _preciocat.GetString("CAT_GP_PRECIO");
 };
 //BA.debugLineNum = 739;BA.debugLine="preciocat.Close";
_preciocat.Close();
 //BA.debugLineNum = 741;BA.debugLine="Dim precioreg As Cursor = Starter.skmt.ExecQu";
_precioreg = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_precioreg = (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(HVD_COSTO_TOT,0) AS HVD_COSTO_TOT, HVD_CANT from HIST_VENTAS WHERE HVD_PROID = '"+__c.SmartStringFormatter("",(Object)(_c2.GetString("HVD_PROID")))+"' AND CONSECUTIVO = '"+__c.SmartStringFormatter("",_estetag.Get((int) (6)))+"'"))));
 //BA.debugLineNum = 742;BA.debugLine="If precioreg.RowCount > 0 Then";
if (_precioreg.getRowCount()>0) { 
 //BA.debugLineNum = 743;BA.debugLine="precioreg.Position = 0";
_precioreg.setPosition((int) (0));
 //BA.debugLineNum = 744;BA.debugLine="Dim precioregalo As String = precioreg.GetSt";
_precioregalo = BA.NumberToString((double)(Double.parseDouble(_precioreg.GetString("HVD_COSTO_TOT")))/(double)(double)(Double.parseDouble(_precioreg.GetString("HVD_CANT"))));
 //BA.debugLineNum = 745;BA.debugLine="If precioregalo < 1 Then";
if ((double)(Double.parseDouble(_precioregalo))<1) { 
 //BA.debugLineNum = 746;BA.debugLine="Dim esregalo As String = 1";
_esregalo = BA.NumberToString(1);
 }else {
 //BA.debugLineNum = 748;BA.debugLine="Dim esregalo As String = 0";
_esregalo = BA.NumberToString(0);
 };
 };
 //BA.debugLineNum = 751;BA.debugLine="precioreg.Close";
_precioreg.Close();
 //BA.debugLineNum = 753;BA.debugLine="If c2.GetString(\"HVD_CODPROMO\") = Subs.traeAl";
if ((_c2.GetString("HVD_CODPROMO")).equals(_subs._traealmacen /*String*/ (ba))) { 
 //BA.debugLineNum = 754;BA.debugLine="Private pup As String = c2.GetString(\"HVD_CO";
_pup = BA.NumberToString((double)(Double.parseDouble(_c2.GetString("HVD_COSTO_TOT")))/(double)(double)(Double.parseDouble(_c2.GetString("HVD_CANT"))));
 //BA.debugLineNum = 757;BA.debugLine="Log(\"algo1\")";
__c.LogImpl("819464285","algo1",0);
 //BA.debugLineNum = 758;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,PE_RUTA, PE_TIPO,PE_CEDIS,PE_FECHA,PE_USUARIO,FECHA_PREV,RUTA_REP,PE_REGALO) VALUES (?,?,?,?,?,?,?,0,0,?,?,?,?,?,?,?,?,?)",anywheresoftware.b4a.keywords.Common.ArrayToList(new String[]{BA.ObjectToString(_estetag.Get((int) (2))),_c2.GetString("HVD_PRONOMBRE"),BA.NumberToString(1*(double)(Double.parseDouble(_minimoadesc))),BA.ObjectToString(_estetag.Get((int) (5))),_subs._traecliente /*String*/ (ba),BA.NumberToString(((double)(Double.parseDouble(_pup))*(double)(Double.parseDouble(_minimoadesc)))),BA.NumberToString(((double)(Double.parseDouble(_pup))*(double)(Double.parseDouble(_minimoadesc)))),BA.ObjectToString(_estetag.Get((int) (6))),_subs._traerutaprev /*String*/ (ba),"PREVENTA",_subs._traealmacen /*String*/ (ba),_sdate+" "+_stime,_subs._traeusuario /*String*/ (ba),_subs._traefechaprev /*String*/ (ba),_subs._traerutareparto /*String*/ (ba),_esregalo}));
 }else {
 //BA.debugLineNum = 760;BA.debugLine="Log(\"|\" & preciofull& \"|\")";
__c.LogImpl("819464288","|"+_preciofull+"|",0);
 //BA.debugLineNum = 761;BA.debugLine="Log(\"|\" & minimoadesc& \"|\")";
__c.LogImpl("819464289","|"+_minimoadesc+"|",0);
 //BA.debugLineNum = 765;BA.debugLine="Log(esteTag.Get(2))";
__c.LogImpl("819464293",BA.ObjectToString(_estetag.Get((int) (2))),0);
 //BA.debugLineNum = 766;BA.debugLine="Log(c2.GetString(\"HVD_PRONOMBRE\"))";
__c.LogImpl("819464294",_c2.GetString("HVD_PRONOMBRE"),0);
 //BA.debugLineNum = 767;BA.debugLine="Log((1*minimoadesc))";
__c.LogImpl("819464295",BA.NumberToString((1*(double)(Double.parseDouble(_minimoadesc)))),0);
 //BA.debugLineNum = 768;BA.debugLine="Log(esteTag.Get(5))";
__c.LogImpl("819464296",BA.ObjectToString(_estetag.Get((int) (5))),0);
 //BA.debugLineNum = 769;BA.debugLine="Log(Subs.traeCliente)";
__c.LogImpl("819464297",_subs._traecliente /*String*/ (ba),0);
 //BA.debugLineNum = 770;BA.debugLine="Log((preciofull*minimoadesc))";
__c.LogImpl("819464298",BA.NumberToString(((double)(Double.parseDouble(_preciofull))*(double)(Double.parseDouble(_minimoadesc)))),0);
 //BA.debugLineNum = 771;BA.debugLine="Log(esteTag.Get(6))";
__c.LogImpl("819464299",BA.ObjectToString(_estetag.Get((int) (6))),0);
 //BA.debugLineNum = 772;BA.debugLine="Log(Subs.traerUTAPREV)";
__c.LogImpl("819464300",_subs._traerutaprev /*String*/ (ba),0);
 //BA.debugLineNum = 773;BA.debugLine="Log(Subs.traeAlmacen)";
__c.LogImpl("819464301",_subs._traealmacen /*String*/ (ba),0);
 //BA.debugLineNum = 774;BA.debugLine="Log(sDate & \" \" & sTime)";
__c.LogImpl("819464302",_sdate+" "+_stime,0);
 //BA.debugLineNum = 775;BA.debugLine="Log(Subs.traeUsuario)";
__c.LogImpl("819464303",_subs._traeusuario /*String*/ (ba),0);
 //BA.debugLineNum = 776;BA.debugLine="Log(Subs.traefECHAPREV)";
__c.LogImpl("819464304",_subs._traefechaprev /*String*/ (ba),0);
 //BA.debugLineNum = 777;BA.debugLine="Log(Subs.traeRutaReparto)";
__c.LogImpl("819464305",_subs._traerutareparto /*String*/ (ba),0);
 //BA.debugLineNum = 778;BA.debugLine="Log(esregalo)";
__c.LogImpl("819464306",_esregalo,0);
 //BA.debugLineNum = 781;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,PE_RUTA, PE_TIPO,PE_CEDIS,PE_FECHA,PE_USUARIO,FECHA_PREV,RUTA_REP,PE_REGALO) VALUES (?,?,?,?,?,?,?,0,0,?,?,?,?,?,?,?,?,?)",anywheresoftware.b4a.keywords.Common.ArrayToList(new String[]{BA.ObjectToString(_estetag.Get((int) (2))),_c2.GetString("HVD_PRONOMBRE"),BA.NumberToString(1*(double)(Double.parseDouble(_minimoadesc))),BA.ObjectToString(_estetag.Get((int) (5))),_subs._traecliente /*String*/ (ba),BA.NumberToString(((double)(Double.parseDouble(_preciofull))*(double)(Double.parseDouble(_minimoadesc)))),BA.NumberToString(((double)(Double.parseDouble(_preciofull))*(double)(Double.parseDouble(_minimoadesc)))),BA.ObjectToString(_estetag.Get((int) (6))),_subs._traerutaprev /*String*/ (ba),"PREVENTA",_subs._traealmacen /*String*/ (ba),_sdate+" "+_stime,_subs._traeusuario /*String*/ (ba),_subs._traefechaprev /*String*/ (ba),_subs._traerutareparto /*String*/ (ba),_esregalo}));
 };
 };
 };
 //BA.debugLineNum = 788;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 = 793;BA.debugLine="B4XPage_Appear";
_b4xpage_appear();
 };
 };
 //BA.debugLineNum = 810;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 = "";
anywheresoftware.b4a.sql.SQL.CursorWrapper _c2 = null;
String _puc = "";
 //BA.debugLineNum = 813;BA.debugLine="Private Sub b_prodMasC_Click";
 //BA.debugLineNum = 814;BA.debugLine="etCantHasFocus = False";
_etcanthasfocus = __c.False;
 //BA.debugLineNum = 816;BA.debugLine="LogColor(\"b_prodMas_Click\", Colors.Magenta)";
__c.LogImpl("819529731","b_prodMas_Click",__c.Colors.Magenta);
 //BA.debugLineNum = 817;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 = 818;BA.debugLine="Dim pnl0 As B4XView = clv_pedido.GetPanel(index)";
_pnl0 = new anywheresoftware.b4a.objects.B4XViewWrapper();
_pnl0 = _clv_pedido._getpanel(_index);
 //BA.debugLineNum = 819;BA.debugLine="Dim pnl As B4XView = pnl0.GetView(0)";
_pnl = new anywheresoftware.b4a.objects.B4XViewWrapper();
_pnl = _pnl0.GetView((int) (0));
 //BA.debugLineNum = 820;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 = 821;BA.debugLine="LogColor(laCantc.Text&\"--------------------------";
__c.LogImpl("819529736",_lacantc.getText()+"-----------------------------",__c.Colors.Blue);
 //BA.debugLineNum = 825;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 = 826;BA.debugLine="Log(\"LC_TEXT:\"&laCantc.Text&\"|LC_TAG:\"&laCantc.Ta";
__c.LogImpl("819529741","LC_TEXT:"+_lacantc.getText()+"|LC_TAG:"+BA.ObjectToString(_lacantc.getTag())+"|ET:"+BA.ObjectToString(_estetag),0);
 //BA.debugLineNum = 827;BA.debugLine="If laCantc.Text = \"\" Then laCantc.Text = 0";
if ((_lacantc.getText()).equals("")) { 
_lacantc.setText(BA.ObjectToCharSequence(0));};
 //BA.debugLineNum = 829;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 = 830;BA.debugLine="LogColor(esteTag.Get(1),Colors.Red)";
__c.LogImpl("819529745",BA.ObjectToString(_estetag.Get((int) (1))),__c.Colors.Red);
 //BA.debugLineNum = 831;BA.debugLine="LogColor(esteTag.Get(4),Colors.Red)";
__c.LogImpl("819529746",BA.ObjectToString(_estetag.Get((int) (4))),__c.Colors.Red);
 //BA.debugLineNum = 832;BA.debugLine="LogColor($\"++++++++++++++++++++++++++   ${esteTag";
__c.LogImpl("819529747",("++++++++++++++++++++++++++   "+__c.SmartStringFormatter("",(Object)(_estetag.getObject()))+""),__c.Colors.Green);
 //BA.debugLineNum = 834;BA.debugLine="Log(maxProds)";
__c.LogImpl("819529749",_maxprods,0);
 //BA.debugLineNum = 837;BA.debugLine="Log(esteTag.Get(4))";
__c.LogImpl("819529752",BA.ObjectToString(_estetag.Get((int) (4))),0);
 //BA.debugLineNum = 838;BA.debugLine="If esteTag.Get(4) = \"0\" Then";
if ((_estetag.Get((int) (4))).equals((Object)("0"))) { 
 }else {
 //BA.debugLineNum = 841;BA.debugLine="If laCantc.Text + 1 <= maxProds Then";
if ((double)(Double.parseDouble(_lacantc.getText()))+1<=(double)(Double.parseDouble(_maxprods))) { 
 //BA.debugLineNum = 842;BA.debugLine="Log($\"NuevaCant = ${laCantc.Text + 1}\"$)";
__c.LogImpl("819529757",("NuevaCant = "+__c.SmartStringFormatter("",(Object)((double)(Double.parseDouble(_lacantc.getText()))+1))+""),0);
 //BA.debugLineNum = 844;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 = 845;BA.debugLine="LogColor(esteTag,Colors.Magenta)";
__c.LogImpl("819529760",BA.ObjectToString(_estetag),__c.Colors.Magenta);
 //BA.debugLineNum = 847;BA.debugLine="LogColor(laCantc.Text,Colors.Red)";
__c.LogImpl("819529762",_lacantc.getText(),__c.Colors.Red);
 //BA.debugLineNum = 850;BA.debugLine="c = Starter.skmt.ExecQuery2(\"SELECT * FROM PEDI";
_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) (6)))})));
 //BA.debugLineNum = 851;BA.debugLine="If c.RowCount > 0 Then";
if (_c.getRowCount()>0) { 
 //BA.debugLineNum = 852;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 HIST_VENTAS WHERE HVD_PROID = ? AND CONSECUTIVO = ? ",new String[]{BA.ObjectToString(_estetag.Get((int) (2))),BA.ObjectToString(_estetag.Get((int) (6)))})));
 //BA.debugLineNum = 853;BA.debugLine="If c2.RowCount > 0 Then";
if (_c2.getRowCount()>0) { 
 //BA.debugLineNum = 854;BA.debugLine="c2.Position = 0";
_c2.setPosition((int) (0));
 //BA.debugLineNum = 855;BA.debugLine="Private puc As String = c2.GetString(\"HVD_COS";
_puc = BA.NumberToString((double)(Double.parseDouble(_c2.GetString("HVD_COSTO_TOT")))/(double)(double)(Double.parseDouble(_c2.GetString("CANTC"))));
 //BA.debugLineNum = 857;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)(_puc))+"', 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) (6)))+"'"));
 //BA.debugLineNum = 858;BA.debugLine="B4XPage_Appear";
_b4xpage_appear();
 //BA.debugLineNum = 859;BA.debugLine="Log(\"aqui2\")";
__c.LogImpl("819529774","aqui2",0);
 };
 }else {
 //BA.debugLineNum = 862;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 HIST_VENTAS WHERE HVD_PROID = ? AND CONSECUTIVO = ? ",new String[]{BA.ObjectToString(_estetag.Get((int) (2))),BA.ObjectToString(_estetag.Get((int) (6)))})));
 //BA.debugLineNum = 863;BA.debugLine="If c2.RowCount > 0 Then";
if (_c2.getRowCount()>0) { 
 //BA.debugLineNum = 864;BA.debugLine="c2.Position = 0";
_c2.setPosition((int) (0));
 //BA.debugLineNum = 865;BA.debugLine="Private puc As String = c2.GetString(\"HVD_COS";
_puc = BA.NumberToString((double)(Double.parseDouble(_c2.GetString("HVD_COSTO_TOT")))/(double)(double)(Double.parseDouble(_c2.GetString("CANTC"))));
 //BA.debugLineNum = 866;BA.debugLine="Log(puc)";
__c.LogImpl("819529781",_puc,0);
 //BA.debugLineNum = 869;BA.debugLine="Starter.skmt.ExecNonQuery2(\"INSERT INTO PEDID";
_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,PE_RUTA, PE_TIPO,PE_CEDIS,PE_FECHA,PE_USUARIO,FECHA_PREV,RUTA_REP,PE_REGALO) VALUES (?,?,?,?,?,?,?,1,1,?,?,?,?,?,?,?,?,?)",anywheresoftware.b4a.keywords.Common.ArrayToList(new String[]{BA.ObjectToString(_estetag.Get((int) (2))),_c2.GetString("HVD_PRONOMBRE"),_subs._traeconversion /*String*/ (ba,BA.ObjectToString(_estetag.Get((int) (2)))),BA.ObjectToString(_estetag.Get((int) (5))),_subs._traecliente /*String*/ (ba),_puc,_puc,BA.ObjectToString(_estetag.Get((int) (6))),_subs._traerutaprev /*String*/ (ba),"PREVENTA",_subs._traealmacen /*String*/ (ba),_sdate+" "+_stime,_subs._traeusuario /*String*/ (ba),_subs._traefechaprev /*String*/ (ba),_subs._traerutareparto /*String*/ (ba),BA.NumberToString(0)}));
 //BA.debugLineNum = 870;BA.debugLine="B4XPage_Appear";
_b4xpage_appear();
 };
 };
 };
 };
 //BA.debugLineNum = 876;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 = 558;BA.debugLine="Sub b_prodMenos_Click";
 //BA.debugLineNum = 559;BA.debugLine="etCantHasFocus = False";
_etcanthasfocus = __c.False;
 //BA.debugLineNum = 560;BA.debugLine="Log(\"etCantHasFocus=\" & etCantHasFocus)";
__c.LogImpl("819398658","etCantHasFocus="+BA.ObjectToString(_etcanthasfocus),0);
 //BA.debugLineNum = 561;BA.debugLine="LogColor(\"b_prodMenos_Click\", Colors.Magenta)";
__c.LogImpl("819398659","b_prodMenos_Click",__c.Colors.Magenta);
 //BA.debugLineNum = 562;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 = 563;BA.debugLine="Dim pnl0 As B4XView = clv_pedido.GetPanel(index)";
_pnl0 = new anywheresoftware.b4a.objects.B4XViewWrapper();
_pnl0 = _clv_pedido._getpanel(_index);
 //BA.debugLineNum = 564;BA.debugLine="Dim pnl As B4XView = pnl0.GetView(0)";
_pnl = new anywheresoftware.b4a.objects.B4XViewWrapper();
_pnl = _pnl0.GetView((int) (0));
 //BA.debugLineNum = 565;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 = 567;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 = 568;BA.debugLine="Log(\"LC_TEXT:\"&laCant.Text&\"|PROMO:\"&esteTag.Get(";
__c.LogImpl("819398666","LC_TEXT:"+_lacant.getText()+"|PROMO:"+BA.ObjectToString(_estetag.Get((int) (3)))+"|LC_TAG:"+BA.ObjectToString(_lacant.getTag())+"|ET:"+BA.ObjectToString(_estetag),0);
 //BA.debugLineNum = 570;BA.debugLine="Private minimoadesc As String";
_minimoadesc = "";
 //BA.debugLineNum = 571;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 = 572;BA.debugLine="If minimos.RowCount > 0 Then";
if (_minimos.getRowCount()>0) { 
 //BA.debugLineNum = 573;BA.debugLine="minimos.Position = 0";
_minimos.setPosition((int) (0));
 //BA.debugLineNum = 574;BA.debugLine="minimoadesc = minimos.GetString(\"CAT_DP_CANT_MIN";
_minimoadesc = _minimos.GetString("CAT_DP_CANT_MIN_VENTA");
 }else {
 //BA.debugLineNum = 576;BA.debugLine="minimoadesc = \"1\"";
_minimoadesc = "1";
 };
 //BA.debugLineNum = 578;BA.debugLine="minimos.Close";
_minimos.Close();
 //BA.debugLineNum = 580;BA.debugLine="minimoadesc = \"1\"";
_minimoadesc = "1";
 //BA.debugLineNum = 581;BA.debugLine="If laCant.Text > 0 Then";
if ((double)(Double.parseDouble(_lacant.getText()))>0) { 
 //BA.debugLineNum = 616;BA.debugLine="If laCant.Text = \"\" Then laCant.Text = 0";
if ((_lacant.getText()).equals("")) { 
_lacant.setText(BA.ObjectToCharSequence(0));};
 //BA.debugLineNum = 617;BA.debugLine="laCant.Text = $\"$1.0{laCant.Text-(1*minimoadesc)";
_lacant.setText(BA.ObjectToCharSequence((""+__c.SmartStringFormatter("1.0",(Object)((double)(Double.parseDouble(_lacant.getText()))-(1*(double)(Double.parseDouble(_minimoadesc)))))+"")));
 //BA.debugLineNum = 618;BA.debugLine="If laCant.Text < 0 Then laCant.Text = 0";
if ((double)(Double.parseDouble(_lacant.getText()))<0) { 
_lacant.setText(BA.ObjectToCharSequence(0));};
 //BA.debugLineNum = 619;BA.debugLine="Log(\"NO ES promo\")";
__c.LogImpl("819398717","NO ES promo",0);
 //BA.debugLineNum = 624;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) (6)))})));
 //BA.debugLineNum = 625;BA.debugLine="If c3.RowCount > 0 Then";
if (_c3.getRowCount()>0) { 
 //BA.debugLineNum = 626;BA.debugLine="c3.Position = 0";
_c3.setPosition((int) (0));
 //BA.debugLineNum = 627;BA.debugLine="If c3.GetString(\"PE_CANT\")> minimoadesc Then";
if ((double)(Double.parseDouble(_c3.GetString("PE_CANT")))>(double)(Double.parseDouble(_minimoadesc))) { 
 //BA.debugLineNum = 628;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 = 629;BA.debugLine="If c2.RowCount > 0 Then";
if (_c2.getRowCount()>0) { 
 //BA.debugLineNum = 630;BA.debugLine="c2.Position = 0";
_c2.setPosition((int) (0));
 //BA.debugLineNum = 632;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) (6)))+"'"));
 };
 }else if((_c3.GetString("PE_CANT")).equals(_minimoadesc)) { 
 //BA.debugLineNum = 635;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 = 636;BA.debugLine="If c2.RowCount > 0 Then";
if (_c2.getRowCount()>0) { 
 //BA.debugLineNum = 637;BA.debugLine="c2.Position = 0";
_c2.setPosition((int) (0));
 //BA.debugLineNum = 640;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) (6)))+"'"));
 };
 };
 };
 //BA.debugLineNum = 647;BA.debugLine="B4XPage_Appear";
_b4xpage_appear();
 };
 //BA.debugLineNum = 650;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 = 651;BA.debugLine="Log(\"PU: \" & preciou)";
__c.LogImpl("819398749","PU: "+BA.NumberToString(_preciou),0);
 //BA.debugLineNum = 662;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 = 878;BA.debugLine="Private Sub b_prodMenosC_Click";
 //BA.debugLineNum = 879;BA.debugLine="etCantHasFocus = False";
_etcanthasfocus = __c.False;
 //BA.debugLineNum = 880;BA.debugLine="Log(\"etCantHasFocus=\" & etCantHasFocus)";
__c.LogImpl("819595266","etCantHasFocus="+BA.ObjectToString(_etcanthasfocus),0);
 //BA.debugLineNum = 881;BA.debugLine="LogColor(\"b_prodMenos_Click\", Colors.Magenta)";
__c.LogImpl("819595267","b_prodMenos_Click",__c.Colors.Magenta);
 //BA.debugLineNum = 882;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 = 883;BA.debugLine="Dim pnl0 As B4XView = clv_pedido.GetPanel(index)";
_pnl0 = new anywheresoftware.b4a.objects.B4XViewWrapper();
_pnl0 = _clv_pedido._getpanel(_index);
 //BA.debugLineNum = 884;BA.debugLine="Dim pnl As B4XView = pnl0.GetView(0)";
_pnl = new anywheresoftware.b4a.objects.B4XViewWrapper();
_pnl = _pnl0.GetView((int) (0));
 //BA.debugLineNum = 885;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 = 887;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 = 888;BA.debugLine="Log(\"LC_TEXT:\"&laCantc.Text&\"|PROMO:\"&esteTag.Get";
__c.LogImpl("819595274","LC_TEXT:"+_lacantc.getText()+"|PROMO:"+BA.ObjectToString(_estetag.Get((int) (3)))+"|LC_TAG:"+BA.ObjectToString(_lacantc.getTag())+"|ET:"+BA.ObjectToString(_estetag),0);
 //BA.debugLineNum = 892;BA.debugLine="If laCantc.Text > 0 Then";
if ((double)(Double.parseDouble(_lacantc.getText()))>0) { 
 //BA.debugLineNum = 895;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) (6)))})));
 //BA.debugLineNum = 896;BA.debugLine="If c3.RowCount > 0 Then";
if (_c3.getRowCount()>0) { 
 //BA.debugLineNum = 897;BA.debugLine="c3.Position = 0";
_c3.setPosition((int) (0));
 //BA.debugLineNum = 898;BA.debugLine="If c3.GetString(\"PE_CAJAS\") > 1 Then";
if ((double)(Double.parseDouble(_c3.GetString("PE_CAJAS")))>1) { 
 //BA.debugLineNum = 899;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("",_estetag.Get((int) (6)))+"'"));
 }else if((_c3.GetString("PE_CAJAS")).equals(BA.NumberToString(1))) { 
 //BA.debugLineNum = 901;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("",_estetag.Get((int) (6)))+"'"));
 };
 };
 //BA.debugLineNum = 904;BA.debugLine="Log(\"entre al if o algo asi \")";
__c.LogImpl("819595290","entre al if o algo asi ",0);
 //BA.debugLineNum = 905;BA.debugLine="If laCantc.Text = \"\" Then laCantc.Text = 0";
if ((_lacantc.getText()).equals("")) { 
_lacantc.setText(BA.ObjectToCharSequence(0));};
 //BA.debugLineNum = 906;BA.debugLine="laCantc.Text = laCantc.Text - 1";
_lacantc.setText(BA.ObjectToCharSequence((double)(Double.parseDouble(_lacantc.getText()))-1));
 //BA.debugLineNum = 907;BA.debugLine="If laCantc.Text < 0 Then laCantc.Text = 0";
if ((double)(Double.parseDouble(_lacantc.getText()))<0) { 
_lacantc.setText(BA.ObjectToCharSequence(0));};
 //BA.debugLineNum = 908;BA.debugLine="B4XPage_Appear";
_b4xpage_appear();
 }else if((_lacantc.getText()).equals(BA.NumberToString(0))) { 
 };
 //BA.debugLineNum = 914;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 = 915;BA.debugLine="Log(\"PU: \" & preciou)";
__c.LogImpl("819595301","PU: "+BA.NumberToString(_preciou),0);
 //BA.debugLineNum = 916;BA.debugLine="End Sub";
return "";
}
public String  _b_regresar_click() throws Exception{
 //BA.debugLineNum = 367;BA.debugLine="Sub b_regresar_Click";
 //BA.debugLineNum = 368;BA.debugLine="B4XPages.ShowPage(\"Cliente\")";
_b4xpages._showpage /*String*/ (ba,"Cliente");
 //BA.debugLineNum = 369;BA.debugLine="End Sub";
return "";
}
public String  _b_revversar_click() throws Exception{
 //BA.debugLineNum = 922;BA.debugLine="Private Sub b_revversar_Click";
 //BA.debugLineNum = 923;BA.debugLine="Starter.skmt.ExecNonQuery($\"update HIST_VENTAS se";
_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("update HIST_VENTAS set HVD_RECHAZO = 0,  HVD_RECHAZOCANT = 0  WHERE HVD_cliente in (Select CUENTA from cuentaa)"));
 //BA.debugLineNum = 924;BA.debugLine="B4XPage_Appear";
_b4xpage_appear();
 //BA.debugLineNum = 925;BA.debugLine="End Sub";
return "";
}
public String  _b4xpage_appear() throws Exception{
int _i = 0;
anywheresoftware.b4a.objects.LabelWrapper _label1 = null;
int _bgcolor = 0;
int _textcolor = 0;
anywheresoftware.b4a.sql.SQL.CursorWrapper _c2 = null;
anywheresoftware.b4a.sql.SQL.CursorWrapper _d5 = null;
String _restacant = "";
anywheresoftware.b4a.sql.SQL.CursorWrapper _c3 = null;
String _resta = "";
anywheresoftware.b4a.sql.SQL.CursorWrapper _preciocat = null;
String _preciofull = "";
anywheresoftware.b4a.sql.SQL.CursorWrapper _oc = null;
int _cant2 = 0;
String _puc = "";
 //BA.debugLineNum = 74;BA.debugLine="Sub B4XPage_Appear";
 //BA.debugLineNum = 75;BA.debugLine="Label2.Visible = False";
_label2.setVisible(__c.False);
 //BA.debugLineNum = 76;BA.debugLine="Label3.Visible = False";
_label3.setVisible(__c.False);
 //BA.debugLineNum = 77;BA.debugLine="L_TOTAL.Visible = False";
_l_total.setVisible(__c.False);
 //BA.debugLineNum = 78;BA.debugLine="L_CANT.Visible = False";
_l_cant.setVisible(__c.False);
 //BA.debugLineNum = 79;BA.debugLine="b_revversar.Visible = False";
_b_revversar.setVisible(__c.False);
 //BA.debugLineNum = 80;BA.debugLine="Subs.centraPanel(p_principal, Root.Width)";
_subs._centrapanel /*String*/ (ba,_p_principal,_root.getWidth());
 //BA.debugLineNum = 84;BA.debugLine="L_CANT.Text =\"\"";
_l_cant.setText(BA.ObjectToCharSequence(""));
 //BA.debugLineNum = 85;BA.debugLine="L_TOTAL.Text=\"\"";
_l_total.setText(BA.ObjectToCharSequence(""));
 //BA.debugLineNum = 86;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 = 87;BA.debugLine="C.Position=0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 88;BA.debugLine="Existe = C.GetString(\"EXISTE\")";
_existe = _c.GetString("EXISTE");
 //BA.debugLineNum = 89;BA.debugLine="C.Close";
_c.Close();
 //BA.debugLineNum = 93;BA.debugLine="c=Starter.skmt.ExecQuery(\"select * from HIST_VENT";
_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 * from HIST_VENTAS WHERE hvd_rechazo <> 2 and HVD_RECHAZOCANT > 0 order by HVD_CODPROMO desc, HVD_PRONOMBRE asc")));
 //BA.debugLineNum = 96;BA.debugLine="ListView1.Clear";
_listview1.Clear();
 //BA.debugLineNum = 97;BA.debugLine="clv_pedido.Clear";
_clv_pedido._clear();
 //BA.debugLineNum = 98;BA.debugLine="Subs.SetDivider(ListView1, Colors.LightGray, 2)";
_subs._setdivider /*String*/ (ba,_listview1,__c.Colors.LightGray,(int) (2));
 //BA.debugLineNum = 99;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 = 100;BA.debugLine="clv_pedido.Base_Resize(clv_pedido.GetBase.Width,";
_clv_pedido._base_resize(_clv_pedido._getbase().getWidth(),_clv_pedido._getbase().getHeight());
 //BA.debugLineNum = 102;BA.debugLine="If c.RowCount>0 Then";
if (_c.getRowCount()>0) { 
 //BA.debugLineNum = 105;BA.debugLine="For i=0 To c.RowCount -1";
{
final int step20 = 1;
final int limit20 = (int) (_c.getRowCount()-1);
_i = (int) (0) ;
for (;_i <= limit20 ;_i = _i + step20 ) {
 //BA.debugLineNum = 106;BA.debugLine="c.Position=i";
_c.setPosition(_i);
 //BA.debugLineNum = 108;BA.debugLine="If c.GetString(\"BCAJAS\") = \"0\" Then";
if ((_c.GetString("BCAJAS")).equals("0")) { 
 //BA.debugLineNum = 119;BA.debugLine="Dim label1 As Label";
_label1 = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 120;BA.debugLine="label1 = ListView1.TwoLinesLayout.Label";
_label1 = _listview1.getTwoLinesLayout().Label;
 //BA.debugLineNum = 121;BA.debugLine="label1.TextSize = 12";
_label1.setTextSize((float) (12));
 //BA.debugLineNum = 122;BA.debugLine="label1.TextColor = Colors.black";
_label1.setTextColor(__c.Colors.Black);
 //BA.debugLineNum = 123;BA.debugLine="Dim Label2 As Label";
_label2 = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 124;BA.debugLine="Label2 = ListView1.TwoLinesLayout.SecondLabel";
_label2 = _listview1.getTwoLinesLayout().SecondLabel;
 //BA.debugLineNum = 125;BA.debugLine="Label2.TextSize = 12";
_label2.setTextSize((float) (12));
 //BA.debugLineNum = 126;BA.debugLine="Label2.TextColor = Colors.black";
_label2.setTextColor(__c.Colors.Black);
 //BA.debugLineNum = 127;BA.debugLine="Private bgColor, textColor As Int";
_bgcolor = 0;
_textcolor = 0;
 //BA.debugLineNum = 128;BA.debugLine="bgColor = Colors.RGB(177, 200, 249)'azul";
_bgcolor = __c.Colors.RGB((int) (177),(int) (200),(int) (249));
 //BA.debugLineNum = 129;BA.debugLine="textColor = Colors.black";
_textcolor = __c.Colors.Black;
 //BA.debugLineNum = 130;BA.debugLine="If c.GetString(\"HVD_CODPROMO\") <> Subs.traeAlm";
if ((_c.GetString("HVD_CODPROMO")).equals(_subs._traealmacen /*String*/ (ba)) == false) { 
 //BA.debugLineNum = 132;BA.debugLine="bgColor = Colors.White";
_bgcolor = __c.Colors.White;
 };
 //BA.debugLineNum = 138;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 IFNULL(PE_CANT,0) AS PE_CANT, CONSECUTIVO, PE_BCAJAS from PEDIDO WHERE PE_CLIENTE IN (SELECT CUENTA FROM CUENTAA) AND PE_PROID ='"+__c.SmartStringFormatter("",(Object)(_c.GetString("HVD_PROID")))+"' AND CONSECUTIVO = '"+__c.SmartStringFormatter("",(Object)(_c.GetString("CONSECUTIVO")))+"'"))));
 //BA.debugLineNum = 141;BA.debugLine="Private d5 As Cursor =  Starter.skmt.ExecQuery";
_d5 = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_d5 = (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(Sum(PE_CANT),0) AS PE_CANT FROM PEDIDO WHERE PE_CLIENTEOR = '"+__c.SmartStringFormatter("",(Object)(_c.GetString("HVD_CLIENTE")))+"' AND PE_PROID = '"+__c.SmartStringFormatter("",(Object)(_c.GetString("HVD_PROID")))+"' AND CONSECUTIVO = '"+__c.SmartStringFormatter("",(Object)(_c.GetString("CONSECUTIVO")))+"'"))));
 //BA.debugLineNum = 142;BA.debugLine="d5.Position = 0";
_d5.setPosition((int) (0));
 //BA.debugLineNum = 143;BA.debugLine="Private restacant As String = d5.GetString(\"PE";
_restacant = _d5.GetString("PE_CANT");
 //BA.debugLineNum = 144;BA.debugLine="d5.Close";
_d5.Close();
 //BA.debugLineNum = 146;BA.debugLine="If (c.GetString(\"HVD_RECHAZOCANT\")-restacant)";
if (((double)(Double.parseDouble(_c.GetString("HVD_RECHAZOCANT")))-(double)(Double.parseDouble(_restacant)))!=(double)(Double.parseDouble("0"))) { 
 //BA.debugLineNum = 147;BA.debugLine="If c2.RowCount > 0 Then";
if (_c2.getRowCount()>0) { 
 //BA.debugLineNum = 148;BA.debugLine="c2.Position = 0";
_c2.setPosition((int) (0));
 //BA.debugLineNum = 150;BA.debugLine="Private c3 As Cursor=Starter.skmt.ExecQuery(";
_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 Ifnull(sum(PE_CANT),0) AS PE_CANT from PEDIDO WHERE PE_CLIENTE NOT IN (SELECT CUENTA FROM CUENTAA) AND PE_CLIENTEOR = '"+__c.SmartStringFormatter("",(Object)(_c.GetString("HVD_CLIENTE")))+"' AND PE_PROID ='"+__c.SmartStringFormatter("",(Object)(_c.GetString("HVD_PROID")))+"' AND CONSECUTIVO = '"+__c.SmartStringFormatter("",(Object)(_c.GetString("CONSECUTIVO")))+"'"))));
 //BA.debugLineNum = 151;BA.debugLine="Private resta As String = 0";
_resta = BA.NumberToString(0);
 //BA.debugLineNum = 153;BA.debugLine="If c3.RowCount > 0 Then";
if (_c3.getRowCount()>0) { 
 //BA.debugLineNum = 155;BA.debugLine="c3.Position = 0";
_c3.setPosition((int) (0));
 //BA.debugLineNum = 156;BA.debugLine="resta =  c3.GetString(\"PE_CANT\")";
_resta = _c3.GetString("PE_CANT");
 }else {
 //BA.debugLineNum = 159;BA.debugLine="resta = 0";
_resta = BA.NumberToString(0);
 };
 //BA.debugLineNum = 162;BA.debugLine="Dim preciocat As Cursor = Starter.skmt.ExecQ";
_preciocat = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_preciocat = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery(("select IFNULL(CAT_GP_PRECIO,0) AS CAT_GP_PRECIO from CAT_GUNAPROD WHERE CAT_GP_ID = '"+__c.SmartStringFormatter("",(Object)(_c.GetString("HVD_PROID")))+"'"))));
 //BA.debugLineNum = 163;BA.debugLine="If preciocat.RowCount > 0 Then";
if (_preciocat.getRowCount()>0) { 
 //BA.debugLineNum = 164;BA.debugLine="preciocat.Position = 0";
_preciocat.setPosition((int) (0));
 //BA.debugLineNum = 165;BA.debugLine="Dim preciofull As String = preciocat.GetStr";
_preciofull = _preciocat.GetString("CAT_GP_PRECIO");
 };
 //BA.debugLineNum = 167;BA.debugLine="preciocat.Close";
_preciocat.Close();
 //BA.debugLineNum = 168;BA.debugLine="Log(c.GetString(\"HVD_CODPROMO\"))";
__c.LogImpl("818874462",_c.GetString("HVD_CODPROMO"),0);
 //BA.debugLineNum = 169;BA.debugLine="Log(Subs.traeAlmacen)";
__c.LogImpl("818874463",_subs._traealmacen /*String*/ (ba),0);
 //BA.debugLineNum = 172;BA.debugLine="If c.GetString(\"HVD_CODPROMO\") = Subs.traeAl";
if ((_c.GetString("HVD_CODPROMO")).equals(_subs._traealmacen /*String*/ (ba))) { 
 //BA.debugLineNum = 173;BA.debugLine="clv_pedido.Add(CreateListItem(c.GetString(\"";
_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.parseDouble(_c2.GetString("PE_CANT"))),(int) ((double)(Double.parseDouble(_c.GetString("HVD_RECHAZOCANT")))-(double)(Double.parseDouble(_c2.GetString("PE_CANT")))-(double)(Double.parseDouble(_resta))),_clv_pedido._asview().getWidth(),__c.DipToCurrent((int) (118)),_bmp,_c.GetString("HVD_PROID"),_bgcolor,_textcolor,_c.GetString("HVD_CODPROMO"),_c.GetString("HVD_CLIENTE"),(int)(Double.parseDouble(_c.GetString("CONSECUTIVO")))).getObject())),(Object)(_i));
 }else {
 //BA.debugLineNum = 175;BA.debugLine="Log(\"aqui arriba\")";
__c.LogImpl("818874469","aqui arriba",0);
 //BA.debugLineNum = 176;BA.debugLine="clv_pedido.Add(CreateListItem(c.GetString(\"";
_clv_pedido._add((anywheresoftware.b4a.objects.B4XViewWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.B4XViewWrapper(), (java.lang.Object)(_createlistitem(_c.GetString("HVD_PRONOMBRE"),_preciofull,(int)(Double.parseDouble(_c2.GetString("PE_CANT"))),(int) ((double)(Double.parseDouble(_c.GetString("HVD_RECHAZOCANT")))-(double)(Double.parseDouble(_c2.GetString("PE_CANT")))-(double)(Double.parseDouble(_resta))),_clv_pedido._asview().getWidth(),__c.DipToCurrent((int) (118)),_bmp,_c.GetString("HVD_PROID"),_bgcolor,_textcolor,_c.GetString("HVD_CODPROMO"),_c.GetString("HVD_CLIENTE"),(int)(Double.parseDouble(_c.GetString("CONSECUTIVO")))).getObject())),(Object)(_i));
 };
 }else if(_c2.getRowCount()==0) { 
 //BA.debugLineNum = 181;BA.debugLine="Private c3 As Cursor=Starter.skmt.ExecQuery(";
_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 Ifnull(sum(PE_CANT),0) AS PE_CANT from PEDIDO WHERE PE_CLIENTE NOT IN (SELECT CUENTA FROM CUENTAA) AND PE_CLIENTEOR = '"+__c.SmartStringFormatter("",(Object)(_c.GetString("HVD_CLIENTE")))+"' AND PE_PROID ='"+__c.SmartStringFormatter("",(Object)(_c.GetString("HVD_PROID")))+"' AND CONSECUTIVO = '"+__c.SmartStringFormatter("",(Object)(_c.GetString("CONSECUTIVO")))+"'"))));
 //BA.debugLineNum = 182;BA.debugLine="Private resta As String = 0";
_resta = BA.NumberToString(0);
 //BA.debugLineNum = 184;BA.debugLine="If c3.RowCount > 0 Then";
if (_c3.getRowCount()>0) { 
 //BA.debugLineNum = 186;BA.debugLine="c3.Position = 0";
_c3.setPosition((int) (0));
 //BA.debugLineNum = 187;BA.debugLine="resta =  c3.GetString(\"PE_CANT\")";
_resta = _c3.GetString("PE_CANT");
 }else {
 //BA.debugLineNum = 190;BA.debugLine="resta = 0";
_resta = BA.NumberToString(0);
 };
 //BA.debugLineNum = 194;BA.debugLine="Dim preciocat As Cursor = Starter.skmt.ExecQ";
_preciocat = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_preciocat = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery(("select IFNULL(CAT_GP_PRECIO,0) AS CAT_GP_PRECIO from CAT_GUNAPROD WHERE CAT_GP_ID = '"+__c.SmartStringFormatter("",(Object)(_c.GetString("HVD_PROID")))+"'"))));
 //BA.debugLineNum = 195;BA.debugLine="If preciocat.RowCount > 0 Then";
if (_preciocat.getRowCount()>0) { 
 //BA.debugLineNum = 196;BA.debugLine="preciocat.Position = 0";
_preciocat.setPosition((int) (0));
 //BA.debugLineNum = 197;BA.debugLine="Dim preciofull As String = preciocat.GetStr";
_preciofull = _preciocat.GetString("CAT_GP_PRECIO");
 };
 //BA.debugLineNum = 199;BA.debugLine="preciocat.Close";
_preciocat.Close();
 //BA.debugLineNum = 200;BA.debugLine="Log(c.GetString(\"HVD_CODPROMO\"))";
__c.LogImpl("818874494",_c.GetString("HVD_CODPROMO"),0);
 //BA.debugLineNum = 201;BA.debugLine="Log(Subs.traeAlmacen)";
__c.LogImpl("818874495",_subs._traealmacen /*String*/ (ba),0);
 //BA.debugLineNum = 203;BA.debugLine="If c.GetString(\"HVD_CODPROMO\") = Subs.traeAl";
if ((_c.GetString("HVD_CODPROMO")).equals(_subs._traealmacen /*String*/ (ba))) { 
 //BA.debugLineNum = 204;BA.debugLine="clv_pedido.Add(CreateListItem(c.GetString(\"";
_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) (0),(int) ((double)(Double.parseDouble(_c.GetString("HVD_RECHAZOCANT")))-(double)(Double.parseDouble(_resta))),_clv_pedido._asview().getWidth(),__c.DipToCurrent((int) (118)),_bmp,_c.GetString("HVD_PROID"),_bgcolor,_textcolor,_c.GetString("HVD_CODPROMO"),_c.GetString("HVD_CLIENTE"),(int)(Double.parseDouble(_c.GetString("CONSECUTIVO")))).getObject())),(Object)(_i));
 }else {
 //BA.debugLineNum = 206;BA.debugLine="Log(\"aqui abajo\")";
__c.LogImpl("818874500","aqui abajo",0);
 //BA.debugLineNum = 207;BA.debugLine="clv_pedido.Add(CreateListItem(c.GetString(\"";
_clv_pedido._add((anywheresoftware.b4a.objects.B4XViewWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.B4XViewWrapper(), (java.lang.Object)(_createlistitem(_c.GetString("HVD_PRONOMBRE"),_preciofull,(int) (0),(int) ((double)(Double.parseDouble(_c.GetString("HVD_RECHAZOCANT")))-(double)(Double.parseDouble(_resta))),_clv_pedido._asview().getWidth(),__c.DipToCurrent((int) (118)),_bmp,_c.GetString("HVD_PROID"),_bgcolor,_textcolor,_c.GetString("HVD_CODPROMO"),_c.GetString("HVD_CLIENTE"),(int)(Double.parseDouble(_c.GetString("CONSECUTIVO")))).getObject())),(Object)(_i));
 };
 };
 };
 //BA.debugLineNum = 214;BA.debugLine="c2.Close";
_c2.Close();
 }else if((_c.GetString("BCAJAS")).equals("1")) { 
 //BA.debugLineNum = 218;BA.debugLine="Log(\"AQUI1\")";
__c.LogImpl("818874512","AQUI1",0);
 //BA.debugLineNum = 221;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_VENTAS 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 = 222;BA.debugLine="Private cant2 As Int = 0";
_cant2 = (int) (0);
 //BA.debugLineNum = 223;BA.debugLine="If oc.RowCount > 0 Then";
if (_oc.getRowCount()>0) { 
 //BA.debugLineNum = 224;BA.debugLine="oc.Position = 0";
_oc.setPosition((int) (0));
 //BA.debugLineNum = 225;BA.debugLine="cant2 = oc.GetString(\"HVD_CANT\")";
_cant2 = (int)(Double.parseDouble(_oc.GetString("HVD_CANT")));
 };
 //BA.debugLineNum = 227;BA.debugLine="oc.Close";
_oc.Close();
 //BA.debugLineNum = 228;BA.debugLine="Dim label1 As Label";
_label1 = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 229;BA.debugLine="label1 = ListView1.TwoLinesLayout.Label";
_label1 = _listview1.getTwoLinesLayout().Label;
 //BA.debugLineNum = 230;BA.debugLine="label1.TextSize = 12";
_label1.setTextSize((float) (12));
 //BA.debugLineNum = 231;BA.debugLine="label1.TextColor = Colors.black";
_label1.setTextColor(__c.Colors.Black);
 //BA.debugLineNum = 232;BA.debugLine="Dim Label2 As Label";
_label2 = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 233;BA.debugLine="Label2 = ListView1.TwoLinesLayout.SecondLabel";
_label2 = _listview1.getTwoLinesLayout().SecondLabel;
 //BA.debugLineNum = 234;BA.debugLine="Label2.TextSize = 12";
_label2.setTextSize((float) (12));
 //BA.debugLineNum = 235;BA.debugLine="Label2.TextColor = Colors.black";
_label2.setTextColor(__c.Colors.Black);
 //BA.debugLineNum = 236;BA.debugLine="Private bgColor, textColor As Int";
_bgcolor = 0;
_textcolor = 0;
 //BA.debugLineNum = 237;BA.debugLine="bgColor = Colors.RGB(177, 200, 249)'azul";
_bgcolor = __c.Colors.RGB((int) (177),(int) (200),(int) (249));
 //BA.debugLineNum = 238;BA.debugLine="textColor = Colors.black";
_textcolor = __c.Colors.Black;
 //BA.debugLineNum = 239;BA.debugLine="If c.GetString(\"HVD_CODPROMO\") <> Subs.traeAlm";
if ((_c.GetString("HVD_CODPROMO")).equals(_subs._traealmacen /*String*/ (ba)) == false) { 
 //BA.debugLineNum = 241;BA.debugLine="bgColor = Colors.White";
_bgcolor = __c.Colors.White;
 };
 //BA.debugLineNum = 246;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 * from PEDIDO WHERE PE_CLIENTE IN (SELECT CUENTA FROM CUENTAA)"))));
 //BA.debugLineNum = 248;BA.debugLine="Private d5 As Cursor =  Starter.skmt.ExecQuery";
_d5 = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_d5 = (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(Sum(PE_CANT),0) AS PE_CANT FROM PEDIDO WHERE PE_CLIENTEOR = '"+__c.SmartStringFormatter("",(Object)(_c.GetString("HVD_CLIENTE")))+"' AND PE_PROID = '"+__c.SmartStringFormatter("",(Object)(_c.GetString("HVD_PROID")))+"' AND CONSECUTIVO = '"+__c.SmartStringFormatter("",(Object)(_c.GetString("CONSECUTIVO")))+"'"))));
 //BA.debugLineNum = 249;BA.debugLine="d5.Position = 0";
_d5.setPosition((int) (0));
 //BA.debugLineNum = 250;BA.debugLine="Private restacant As String = d5.GetString(\"PE";
_restacant = _d5.GetString("PE_CANT");
 //BA.debugLineNum = 251;BA.debugLine="d5.Close";
_d5.Close();
 //BA.debugLineNum = 253;BA.debugLine="If (c.GetString(\"HVD_RECHAZOCANT\")-restacant)";
if (((double)(Double.parseDouble(_c.GetString("HVD_RECHAZOCANT")))-(double)(Double.parseDouble(_restacant)))!=(double)(Double.parseDouble("0"))) { 
 //BA.debugLineNum = 254;BA.debugLine="If c2.RowCount > 0 Then";
if (_c2.getRowCount()>0) { 
 //BA.debugLineNum = 255;BA.debugLine="c2.Position = 0";
_c2.setPosition((int) (0));
 //BA.debugLineNum = 256;BA.debugLine="Log(\"SI ENTRO A PONER CAJAS BIEN \")";
__c.LogImpl("818874550","SI ENTRO A PONER CAJAS BIEN ",0);
 //BA.debugLineNum = 257;BA.debugLine="Log(c2.GetString(\"PE_CAJAS\"))";
__c.LogImpl("818874551",_c2.GetString("PE_CAJAS"),0);
 //BA.debugLineNum = 258;BA.debugLine="Private c3 As Cursor=Starter.skmt.ExecQuery(";
_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 Ifnull(sum(PE_CANT),0) AS PE_CANT from PEDIDO WHERE PE_CLIENTE NOT IN (SELECT CUENTA FROM CUENTAA) AND PE_CLIENTEOR = '"+__c.SmartStringFormatter("",(Object)(_c.GetString("HVD_CLIENTE")))+"' AND PE_PROID ='"+__c.SmartStringFormatter("",(Object)(_c.GetString("HVD_PROID")))+"' AND CONSECUTIVO = '"+__c.SmartStringFormatter("",(Object)(_c.GetString("CONSECUTIVO")))+"'"))));
 //BA.debugLineNum = 259;BA.debugLine="Private resta As String = 0";
_resta = BA.NumberToString(0);
 //BA.debugLineNum = 261;BA.debugLine="If c3.RowCount > 0 Then";
if (_c3.getRowCount()>0) { 
 //BA.debugLineNum = 263;BA.debugLine="c3.Position = 0";
_c3.setPosition((int) (0));
 //BA.debugLineNum = 264;BA.debugLine="resta =  c3.GetString(\"PE_CANT\")";
_resta = _c3.GetString("PE_CANT");
 }else {
 //BA.debugLineNum = 267;BA.debugLine="resta = 0";
_resta = BA.NumberToString(0);
 };
 //BA.debugLineNum = 269;BA.debugLine="Private puc As String = c.GetString(\"HVD_COS";
_puc = BA.NumberToString((double)(Double.parseDouble(_c.GetString("HVD_COSTO_TOT")))/(double)(double)(Double.parseDouble(_c.GetString("CANTC"))));
 //BA.debugLineNum = 270;BA.debugLine="LogColor((restacant/Subs.traeConversion(c.Ge";
__c.LogImpl("818874564",BA.NumberToString(((double)(Double.parseDouble(_restacant))/(double)(double)(Double.parseDouble(_subs._traeconversion /*String*/ (ba,_c.GetString("HVD_PROID")))))),__c.Colors.Green);
 //BA.debugLineNum = 271;BA.debugLine="clv_pedido.Add(CreateListItem2(c.GetString(\"";
_clv_pedido._add((anywheresoftware.b4a.objects.B4XViewWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.B4XViewWrapper(), (java.lang.Object)(_createlistitem2(_c.GetString("HVD_PRONOMBRE"),_puc,(int) (((double)(Double.parseDouble(_restacant))/(double)(double)(Double.parseDouble(_subs._traeconversion /*String*/ (ba,_c.GetString("HVD_PROID")))))),(int) ((((double)(Double.parseDouble(_c.GetString("HVD_RECHAZOCANT")))-(double)(Double.parseDouble(_restacant))-(double)(Double.parseDouble(_resta)))/(double)(double)(Double.parseDouble(_subs._traeconversion /*String*/ (ba,_c.GetString("HVD_PROID")))))),_clv_pedido._asview().getWidth(),__c.DipToCurrent((int) (118)),_bmp,_c.GetString("HVD_PROID"),_bgcolor,_textcolor,_c.GetString("HVD_CODPROMO"),_c.GetString("HVD_CLIENTE"),(int)(Double.parseDouble(_c.GetString("CONSECUTIVO")))).getObject())),(Object)(_i));
 }else {
 //BA.debugLineNum = 273;BA.debugLine="Log(\"NO ENTRO A PONER CAJAS BIEN \")";
__c.LogImpl("818874567","NO ENTRO A PONER CAJAS BIEN ",0);
 //BA.debugLineNum = 274;BA.debugLine="Private c3 As Cursor=Starter.skmt.ExecQuery(";
_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 Ifnull(sum(PE_CANT),0) AS PE_CANT from PEDIDO WHERE PE_CLIENTE NOT IN (SELECT CUENTA FROM CUENTAA) AND PE_CLIENTEOR = '"+__c.SmartStringFormatter("",(Object)(_c.GetString("HVD_CLIENTE")))+"' AND PE_PROID ='"+__c.SmartStringFormatter("",(Object)(_c.GetString("HVD_PROID")))+"' AND CONSECUTIVO = '"+__c.SmartStringFormatter("",(Object)(_c.GetString("CONSECUTIVO")))+"'"))));
 //BA.debugLineNum = 275;BA.debugLine="Private resta As String = 0";
_resta = BA.NumberToString(0);
 //BA.debugLineNum = 277;BA.debugLine="If c3.RowCount > 0 Then";
if (_c3.getRowCount()>0) { 
 //BA.debugLineNum = 279;BA.debugLine="c3.Position = 0";
_c3.setPosition((int) (0));
 //BA.debugLineNum = 280;BA.debugLine="resta =  c3.GetString(\"PE_CANT\")";
_resta = _c3.GetString("PE_CANT");
 }else {
 //BA.debugLineNum = 283;BA.debugLine="resta = 0";
_resta = BA.NumberToString(0);
 };
 //BA.debugLineNum = 285;BA.debugLine="LogColor(resta,Colors.Green)";
__c.LogImpl("818874579",_resta,__c.Colors.Green);
 //BA.debugLineNum = 286;BA.debugLine="Private puc As String = c.GetString(\"HVD_COS";
_puc = BA.NumberToString((double)(Double.parseDouble(_c.GetString("HVD_COSTO_TOT")))/(double)(double)(Double.parseDouble(_c.GetString("CANTC"))));
 //BA.debugLineNum = 288;BA.debugLine="clv_pedido.Add(CreateListItem2(c.GetString(\"";
_clv_pedido._add((anywheresoftware.b4a.objects.B4XViewWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.B4XViewWrapper(), (java.lang.Object)(_createlistitem2(_c.GetString("HVD_PRONOMBRE"),_puc,(int) (0),(int) ((((double)(Double.parseDouble(_c.GetString("HVD_RECHAZOCANT")))-(double)(Double.parseDouble(_resta)))/(double)(double)(Double.parseDouble(_subs._traeconversion /*String*/ (ba,_c.GetString("HVD_PROID")))))),_clv_pedido._asview().getWidth(),__c.DipToCurrent((int) (118)),_bmp,_c.GetString("HVD_PROID"),_bgcolor,_textcolor,_c.GetString("HVD_CODPROMO"),_c.GetString("HVD_CLIENTE"),(int)(Double.parseDouble(_c.GetString("CONSECUTIVO")))).getObject())),(Object)(_i));
 };
 };
 //BA.debugLineNum = 291;BA.debugLine="c2.Close";
_c2.Close();
 };
 }
};
 };
 //BA.debugLineNum = 360;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_intmex.keymon.lat.c_productos parent) {
this.parent = parent;
}
reparto_intmex.keymon.lat.c_productos parent;

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

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

            }
        }
    }
}
public String  _b4xpage_created(anywheresoftware.b4a.objects.B4XViewWrapper _root1) throws Exception{
 //BA.debugLineNum = 62;BA.debugLine="Private Sub B4XPage_Created (Root1 As B4XView)";
 //BA.debugLineNum = 63;BA.debugLine="Root = Root1";
_root = _root1;
 //BA.debugLineNum = 64;BA.debugLine="B4XPages.SetTitle(Me, \"Productos\")";
_b4xpages._settitle /*String*/ (ba,this,(Object)("Productos"));
 //BA.debugLineNum = 66;BA.debugLine="g.Initialize(\"GPS\")";
_g.Initialize("GPS");
 //BA.debugLineNum = 67;BA.debugLine="Root.LoadLayout(\"detalleVenta\")";
_root.LoadLayout("detalleVenta",ba);
 //BA.debugLineNum = 68;BA.debugLine="b_borra.Visible = False";
_b_borra.setVisible(__c.False);
 //BA.debugLineNum = 69;BA.debugLine="Titulo.Text = \"Pedido\"";
_titulo.setText(BA.ObjectToCharSequence("Pedido"));
 //BA.debugLineNum = 70;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 b_revversar As Button";
_b_revversar = new anywheresoftware.b4a.objects.ButtonWrapper();
 //BA.debugLineNum = 47;BA.debugLine="Private Label2 As Label";
_label2 = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 48;BA.debugLine="Private Label3 As Label";
_label3 = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 49;BA.debugLine="Private l_piezas As Label";
_l_piezas = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 50;BA.debugLine="Private l_cajas As Label";
_l_cajas = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 52;BA.debugLine="Private l_cajas As Label";
_l_cajas = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 53;BA.debugLine="Private l_piezas As Label";
_l_piezas = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 54;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,int _consecutivo) throws Exception{
anywheresoftware.b4a.objects.B4XViewWrapper _p = null;
anywheresoftware.b4a.objects.CSBuilder _cs = null;
 //BA.debugLineNum = 492;BA.debugLine="Sub CreateListItem(Text As String, precioU As Stri";
 //BA.debugLineNum = 493;BA.debugLine="Dim p As B4XView = xui.CreatePanel(\"\")";
_p = new anywheresoftware.b4a.objects.B4XViewWrapper();
_p = _xui.CreatePanel(ba,"");
 //BA.debugLineNum = 494;BA.debugLine="Private cs As CSBuilder";
_cs = new anywheresoftware.b4a.objects.CSBuilder();
 //BA.debugLineNum = 495;BA.debugLine="cs.Initialize";
_cs.Initialize();
 //BA.debugLineNum = 496;BA.debugLine="p.SetLayoutAnimated(0, 0, 0, Width, Height)";
_p.SetLayoutAnimated((int) (0),(int) (0),(int) (0),_width,_height);
 //BA.debugLineNum = 497;BA.debugLine="p.LoadLayout(\"prodItem2\")";
_p.LoadLayout("prodItem2",ba);
 //BA.debugLineNum = 498;BA.debugLine="p_prods.Color = bc";
_p_prods.setColor(_bc);
 //BA.debugLineNum = 499;BA.debugLine="l_prodX.TextColor = tc";
_l_prodx.setTextColor(_tc);
 //BA.debugLineNum = 500;BA.debugLine="precioU = $\"$1.2{precioU}\"$";
_preciou = (""+__c.SmartStringFormatter("1.2",(Object)(_preciou))+"");
 //BA.debugLineNum = 501;BA.debugLine="l_prodX.Text = Text&CRLF&\"Cant: \" & inv2 & \"   $\"";
_l_prodx.setText(BA.ObjectToCharSequence(_text+__c.CRLF+"Cant: "+BA.NumberToString(_inv2)+"   $"+_preciou));
 //BA.debugLineNum = 502;BA.debugLine="If promo <> \"1\" And precioU = 0 Then";
if ((_promo).equals("1") == false && (_preciou).equals(BA.NumberToString(0))) { 
 //BA.debugLineNum = 503;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 = 505;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 = 508;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+"|"+BA.NumberToString(_consecutivo)));
 //BA.debugLineNum = 509;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+"|"+BA.NumberToString(_consecutivo)));
 //BA.debugLineNum = 510;BA.debugLine="p_prods.Tag = l_pCant.tag";
_p_prods.setTag(_l_pcant.getTag());
 //BA.debugLineNum = 512;BA.debugLine="l_pCant.Text = inv";
_l_pcant.setText(BA.ObjectToCharSequence(_inv));
 //BA.debugLineNum = 516;BA.debugLine="l_pCant.BringToFront";
_l_pcant.BringToFront();
 //BA.debugLineNum = 517;BA.debugLine="et_pCant.SendToBack";
_et_pcant.SendToBack();
 //BA.debugLineNum = 518;BA.debugLine="p_botMasMenC.Visible = False";
_p_botmasmenc.setVisible(__c.False);
 //BA.debugLineNum = 519;BA.debugLine="l_cajas.Visible = False";
_l_cajas.setVisible(__c.False);
 //BA.debugLineNum = 521;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 = 522;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,int _consecutivo) throws Exception{
anywheresoftware.b4a.objects.B4XViewWrapper _p = null;
anywheresoftware.b4a.objects.CSBuilder _cs = null;
 //BA.debugLineNum = 524;BA.debugLine="Sub CreateListItem2(Text As String, precioU As Str";
 //BA.debugLineNum = 525;BA.debugLine="Dim p As B4XView = xui.CreatePanel(\"\")";
_p = new anywheresoftware.b4a.objects.B4XViewWrapper();
_p = _xui.CreatePanel(ba,"");
 //BA.debugLineNum = 526;BA.debugLine="Private cs As CSBuilder";
_cs = new anywheresoftware.b4a.objects.CSBuilder();
 //BA.debugLineNum = 527;BA.debugLine="cs.Initialize";
_cs.Initialize();
 //BA.debugLineNum = 528;BA.debugLine="p.SetLayoutAnimated(0, 0, 0, Width, Height)";
_p.SetLayoutAnimated((int) (0),(int) (0),(int) (0),_width,_height);
 //BA.debugLineNum = 529;BA.debugLine="p.LoadLayout(\"prodItem2\")";
_p.LoadLayout("prodItem2",ba);
 //BA.debugLineNum = 530;BA.debugLine="p_prods.Color = bc";
_p_prods.setColor(_bc);
 //BA.debugLineNum = 531;BA.debugLine="l_prodX.TextColor = tc";
_l_prodx.setTextColor(_tc);
 //BA.debugLineNum = 532;BA.debugLine="precioU = $\"$1.2{precioU}\"$";
_preciou = (""+__c.SmartStringFormatter("1.2",(Object)(_preciou))+"");
 //BA.debugLineNum = 533;BA.debugLine="l_prodX.Text = Text&CRLF&\"Cant: \" & inv2 & \"   $\"";
_l_prodx.setText(BA.ObjectToCharSequence(_text+__c.CRLF+"Cant: "+BA.NumberToString(_inv2)+"   $"+_preciou));
 //BA.debugLineNum = 534;BA.debugLine="If promo <> \"1\" And precioU = 0 Then";
if ((_promo).equals("1") == false && (_preciou).equals(BA.NumberToString(0))) { 
 //BA.debugLineNum = 535;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 = 538;BA.debugLine="Log(inv&\" inventario 1\")";
__c.LogImpl("819333134",BA.NumberToString(_inv)+" inventario 1",0);
 //BA.debugLineNum = 539;BA.debugLine="Log(inv2&\" inventario 2\")";
__c.LogImpl("819333135",BA.NumberToString(_inv2)+" inventario 2",0);
 //BA.debugLineNum = 540;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 = 542;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+"|"+BA.NumberToString(_consecutivo)));
 //BA.debugLineNum = 543;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+"|"+BA.NumberToString(_consecutivo)));
 //BA.debugLineNum = 544;BA.debugLine="p_prods.Tag = l_pCantC.tag";
_p_prods.setTag(_l_pcantc.getTag());
 //BA.debugLineNum = 546;BA.debugLine="l_pCantC.Text = NumberFormat2(inv,0,0,0,False)";
_l_pcantc.setText(BA.ObjectToCharSequence(__c.NumberFormat2(_inv,(int) (0),(int) (0),(int) (0),__c.False)));
 //BA.debugLineNum = 550;BA.debugLine="l_pCantC.BringToFront";
_l_pcantc.BringToFront();
 //BA.debugLineNum = 551;BA.debugLine="et_pCantC.SendToBack";
_et_pcantc.SendToBack();
 //BA.debugLineNum = 552;BA.debugLine="p_botMasMen.Visible = False";
_p_botmasmen.setVisible(__c.False);
 //BA.debugLineNum = 553;BA.debugLine="l_piezas.Visible = False";
_l_piezas.setVisible(__c.False);
 //BA.debugLineNum = 555;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 = 556;BA.debugLine="End Sub";
return null;
}
public String  _cuentaprods(String _accion) throws Exception{
 //BA.debugLineNum = 927;BA.debugLine="Sub cuentaProds(accion As String)";
 //BA.debugLineNum = 1089;BA.debugLine="End Sub";
return "";
}
public String  _gps_locationchanged(anywheresoftware.b4a.gps.LocationWrapper _location1) throws Exception{
 //BA.debugLineNum = 362;BA.debugLine="Sub GPS_LocationChanged (Location1 As Location)";
 //BA.debugLineNum = 365;BA.debugLine="End Sub";
return "";
}
public Object  _initialize(anywheresoftware.b4a.BA _ba) throws Exception{
innerInitialize(_ba);
 //BA.debugLineNum = 57;BA.debugLine="Public Sub Initialize As Object";
 //BA.debugLineNum = 58;BA.debugLine="Return Me";
if (true) return this;
 //BA.debugLineNum = 59;BA.debugLine="End Sub";
return null;
}
public String  _l_pcant_click() throws Exception{
 //BA.debugLineNum = 1096;BA.debugLine="Private Sub l_pCant_Click";
 //BA.debugLineNum = 1098;BA.debugLine="End Sub";
return "";
}
public String  _l_pcantc_click() throws Exception{
 //BA.debugLineNum = 918;BA.debugLine="Private Sub l_pCantC_Click";
 //BA.debugLineNum = 920;BA.debugLine="End Sub";
return "";
}
public String  _listview1_itemlongclick(int _position,Object _value) throws Exception{
 //BA.debugLineNum = 379;BA.debugLine="Sub ListView1_ItemLongClick (Position As Int, Valu";
 //BA.debugLineNum = 423;BA.debugLine="End Sub";
return "";
}
public String  _lv2_itemclick(int _position,Object _value) throws Exception{
 //BA.debugLineNum = 425;BA.debugLine="Sub lv2_ItemClick (Position As Int, Value As Objec";
 //BA.debugLineNum = 486;BA.debugLine="End Sub";
return "";
}
public String  _p_prods_click() throws Exception{
 //BA.debugLineNum = 1100;BA.debugLine="Sub p_prods_Click";
 //BA.debugLineNum = 1101;BA.debugLine="Log(Sender.As(Panel).tag)";
__c.LogImpl("819988481",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 = 1102;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;
}
}
