package reparto_mazapa.keymon.lat;


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

public class c_tabulador extends B4AClass.ImplB4AClass implements BA.SubDelegator{
    private static java.util.HashMap<String, java.lang.reflect.Method> htSubs;
    private void innerInitialize(BA _ba) throws Exception {
        if (ba == null) {
            ba = new BA(_ba, this, htSubs, "reparto_mazapa.keymon.lat.c_tabulador");
            if (htSubs == null) {
                ba.loadHtSubs(this.getClass());
                htSubs = ba.htSubs;
            }
            
        }
        if (BA.isShellModeRuntimeCheck(ba)) 
			   this.getClass().getMethod("_class_globals", reparto_mazapa.keymon.lat.c_tabulador.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.objects.EditTextWrapper _et_mil = null;
public anywheresoftware.b4a.objects.EditTextWrapper _et_quinientos = null;
public anywheresoftware.b4a.objects.EditTextWrapper _et_docientos = null;
public anywheresoftware.b4a.objects.EditTextWrapper _et_cien = null;
public anywheresoftware.b4a.objects.EditTextWrapper _et_cincuenta = null;
public anywheresoftware.b4a.objects.EditTextWrapper _et_veinte = null;
public anywheresoftware.b4a.objects.EditTextWrapper _et_m_veinte = null;
public anywheresoftware.b4a.objects.EditTextWrapper _et_m_diez = null;
public anywheresoftware.b4a.objects.EditTextWrapper _et_m_cinco = null;
public anywheresoftware.b4a.objects.EditTextWrapper _et_m_dos = null;
public anywheresoftware.b4a.objects.EditTextWrapper _et_m_peso = null;
public anywheresoftware.b4a.objects.EditTextWrapper _et_m_centavo = null;
public anywheresoftware.b4a.objects.ButtonWrapper _b_calcular = null;
public anywheresoftware.b4a.objects.ButtonWrapper _b_guardar = null;
public anywheresoftware.b4a.objects.LabelWrapper _l_total = null;
public int _sum_billetes = 0;
public float _sum_monedas = 0f;
public float _total = 0f;
public anywheresoftware.b4a.sql.SQL.CursorWrapper _c = null;
public anywheresoftware.b4a.sql.SQL.CursorWrapper _d = null;
public b4a.example.dateutils _dateutils = null;
public reparto_mazapa.keymon.lat.main _main = null;
public reparto_mazapa.keymon.lat.appupdater _appupdater = null;
public reparto_mazapa.keymon.lat.tracker _tracker = null;
public reparto_mazapa.keymon.lat.starter _starter = null;
public reparto_mazapa.keymon.lat.subs _subs = null;
public reparto_mazapa.keymon.lat.firebasemessaging _firebasemessaging = null;
public reparto_mazapa.keymon.lat.foto _foto = null;
public reparto_mazapa.keymon.lat.mapa_cliente _mapa_cliente = null;
public reparto_mazapa.keymon.lat.mapa_rutas _mapa_rutas = null;
public reparto_mazapa.keymon.lat.newinst2 _newinst2 = null;
public reparto_mazapa.keymon.lat.b4xpages _b4xpages = null;
public reparto_mazapa.keymon.lat.b4xcollections _b4xcollections = null;
public reparto_mazapa.keymon.lat.httputils2service _httputils2service = null;
public reparto_mazapa.keymon.lat.xuiviewsutils _xuiviewsutils = null;
public String  _b_calcular_click() throws Exception{
 //BA.debugLineNum = 87;BA.debugLine="Private Sub b_calcular_Click";
 //BA.debugLineNum = 88;BA.debugLine="If et_mil.Text = \"\" Then";
if ((_et_mil.getText()).equals("")) { 
 //BA.debugLineNum = 89;BA.debugLine="et_mil.Text = 0";
_et_mil.setText(BA.ObjectToCharSequence(0));
 };
 //BA.debugLineNum = 91;BA.debugLine="If et_quinientos.Text = \"\" Then";
if ((_et_quinientos.getText()).equals("")) { 
 //BA.debugLineNum = 92;BA.debugLine="et_quinientos.Text = 0";
_et_quinientos.setText(BA.ObjectToCharSequence(0));
 };
 //BA.debugLineNum = 94;BA.debugLine="If et_docientos.Text = \"\" Then";
if ((_et_docientos.getText()).equals("")) { 
 //BA.debugLineNum = 95;BA.debugLine="et_docientos.Text = 0";
_et_docientos.setText(BA.ObjectToCharSequence(0));
 };
 //BA.debugLineNum = 97;BA.debugLine="If et_cien.Text = \"\" Then";
if ((_et_cien.getText()).equals("")) { 
 //BA.debugLineNum = 98;BA.debugLine="et_cien.Text = 0";
_et_cien.setText(BA.ObjectToCharSequence(0));
 };
 //BA.debugLineNum = 100;BA.debugLine="If et_cincuenta.Text = \"\" Then";
if ((_et_cincuenta.getText()).equals("")) { 
 //BA.debugLineNum = 101;BA.debugLine="et_cincuenta.Text = 0";
_et_cincuenta.setText(BA.ObjectToCharSequence(0));
 };
 //BA.debugLineNum = 103;BA.debugLine="If et_veinte.Text = \"\" Then";
if ((_et_veinte.getText()).equals("")) { 
 //BA.debugLineNum = 104;BA.debugLine="et_veinte.Text = 0";
_et_veinte.setText(BA.ObjectToCharSequence(0));
 };
 //BA.debugLineNum = 106;BA.debugLine="If et_m_veinte.Text = \"\" Then";
if ((_et_m_veinte.getText()).equals("")) { 
 //BA.debugLineNum = 107;BA.debugLine="et_m_veinte.Text = 0";
_et_m_veinte.setText(BA.ObjectToCharSequence(0));
 };
 //BA.debugLineNum = 109;BA.debugLine="If et_m_diez.Text = \"\" Then";
if ((_et_m_diez.getText()).equals("")) { 
 //BA.debugLineNum = 110;BA.debugLine="et_m_diez.Text = 0";
_et_m_diez.setText(BA.ObjectToCharSequence(0));
 };
 //BA.debugLineNum = 112;BA.debugLine="If et_m_cinco.Text = \"\" Then";
if ((_et_m_cinco.getText()).equals("")) { 
 //BA.debugLineNum = 113;BA.debugLine="et_m_cinco.Text = 0";
_et_m_cinco.setText(BA.ObjectToCharSequence(0));
 };
 //BA.debugLineNum = 115;BA.debugLine="If et_m_dos.Text = \"\" Then";
if ((_et_m_dos.getText()).equals("")) { 
 //BA.debugLineNum = 116;BA.debugLine="et_m_dos.Text = 0";
_et_m_dos.setText(BA.ObjectToCharSequence(0));
 };
 //BA.debugLineNum = 118;BA.debugLine="If et_m_peso.Text = \"\" Then";
if ((_et_m_peso.getText()).equals("")) { 
 //BA.debugLineNum = 119;BA.debugLine="et_m_peso.Text = 0";
_et_m_peso.setText(BA.ObjectToCharSequence(0));
 };
 //BA.debugLineNum = 121;BA.debugLine="If et_m_centavo.Text = \"\" Then";
if ((_et_m_centavo.getText()).equals("")) { 
 //BA.debugLineNum = 122;BA.debugLine="et_m_centavo.Text = 0";
_et_m_centavo.setText(BA.ObjectToCharSequence(0));
 };
 //BA.debugLineNum = 124;BA.debugLine="sum_billetes = (et_mil.Text * 1000) + (et_quinien";
_sum_billetes = (int) (((double)(Double.parseDouble(_et_mil.getText()))*1000)+((double)(Double.parseDouble(_et_quinientos.getText()))*500)+((double)(Double.parseDouble(_et_docientos.getText()))*200)+((double)(Double.parseDouble(_et_cien.getText()))*100)+((double)(Double.parseDouble(_et_cincuenta.getText()))*50)+((double)(Double.parseDouble(_et_veinte.getText()))*20));
 //BA.debugLineNum = 125;BA.debugLine="sum_monedas = (et_m_veinte.Text * 20) + ( et_m_di";
_sum_monedas = (float) (((double)(Double.parseDouble(_et_m_veinte.getText()))*20)+((double)(Double.parseDouble(_et_m_diez.getText()))*10)+((double)(Double.parseDouble(_et_m_cinco.getText()))*5)+((double)(Double.parseDouble(_et_m_dos.getText()))*2)+((double)(Double.parseDouble(_et_m_peso.getText()))*1)+((double)(Double.parseDouble(_et_m_centavo.getText()))*0.50));
 //BA.debugLineNum = 126;BA.debugLine="total = sum_billetes + sum_monedas";
_total = (float) (_sum_billetes+_sum_monedas);
 //BA.debugLineNum = 127;BA.debugLine="l_total.Text = Round2(total, 2)";
_l_total.setText(BA.ObjectToCharSequence(__c.Round2(_total,(int) (2))));
 //BA.debugLineNum = 128;BA.debugLine="End Sub";
return "";
}
public String  _b_guardar_click() throws Exception{
 //BA.debugLineNum = 78;BA.debugLine="Private Sub b_guardar_Click";
 //BA.debugLineNum = 79;BA.debugLine="b_calcular_Click";
_b_calcular_click();
 //BA.debugLineNum = 80;BA.debugLine="Starter.skmt.ExecNonQuery(\"DELETE FROM TABULADOR_";
_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("DELETE FROM TABULADOR_MONEDAS");
 //BA.debugLineNum = 81;BA.debugLine="Starter.skmt.ExecNonQuery(\"DELETE FROM TABULADOR_";
_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("DELETE FROM TABULADOR_BILLETES");
 //BA.debugLineNum = 82;BA.debugLine="Starter.skmt.ExecNonQuery2(\"INSERT INTO TABULADOR";
_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("INSERT INTO TABULADOR_BILLETES (MIL, QUINIENTOS, DOCIENTOS, CIEN, CINCUENTA, VEINTE) VALUES (?,?,?,?,?,?)",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(_et_mil.getText()),(Object)(_et_quinientos.getText()),(Object)(_et_docientos.getText()),(Object)(_et_cien.getText()),(Object)(_et_cincuenta.getText()),(Object)(_et_veinte.getText())}));
 //BA.debugLineNum = 83;BA.debugLine="Starter.skmt.ExecNonQuery2(\"INSERT INTO TABULADOR";
_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("INSERT INTO TABULADOR_MONEDAS (VEINTE, DIEZ, CINCO, DOS, PESO, CENTAVO, TOTAL) VALUES (?,?,?,?,?,?,?)",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(_et_m_veinte.getText()),(Object)(_et_m_diez.getText()),(Object)(_et_m_cinco.getText()),(Object)(_et_m_dos.getText()),(Object)(_et_m_peso.getText()),(Object)(_et_m_centavo.getText()),(Object)(_l_total.getText())}));
 //BA.debugLineNum = 84;BA.debugLine="B4XPages.ShowPage(\"Principal\")";
_b4xpages._showpage /*String*/ (ba,"Principal");
 //BA.debugLineNum = 85;BA.debugLine="End Sub";
return "";
}
public String  _b4xpage_appear() throws Exception{
 //BA.debugLineNum = 38;BA.debugLine="Sub B4XPage_Appear";
 //BA.debugLineNum = 39;BA.debugLine="d = Starter.skmt.ExecQuery(\"SELECT VEINTE, DIEZ,";
_d = (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 VEINTE, DIEZ, CINCO, DOS, PESO, CENTAVO, TOTAL FROM TABULADOR_MONEDAS")));
 //BA.debugLineNum = 40;BA.debugLine="c = Starter.skmt.ExecQuery(\"SELECT MIL, QUINIENTO";
_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 MIL, QUINIENTOS, DOCIENTOS, CIEN, CINCUENTA, VEINTE FROM TABULADOR_BILLETES")));
 //BA.debugLineNum = 41;BA.debugLine="c.Position = 0";
_c.setPosition((int) (0));
 //BA.debugLineNum = 42;BA.debugLine="d.Position = 0";
_d.setPosition((int) (0));
 //BA.debugLineNum = 43;BA.debugLine="If c.RowCount > 0 And d.RowCount > 0 Then";
if (_c.getRowCount()>0 && _d.getRowCount()>0) { 
 //BA.debugLineNum = 44;BA.debugLine="Log(\"TABULADR CON RESUKTADO\")";
__c.LogImpl("325690118","TABULADR CON RESUKTADO",0);
 //BA.debugLineNum = 45;BA.debugLine="et_mil.Text = c.GetString(\"MIL\")";
_et_mil.setText(BA.ObjectToCharSequence(_c.GetString("MIL")));
 //BA.debugLineNum = 46;BA.debugLine="et_quinientos.Text = c.GetString(\"QUINIENTOS\")";
_et_quinientos.setText(BA.ObjectToCharSequence(_c.GetString("QUINIENTOS")));
 //BA.debugLineNum = 47;BA.debugLine="et_docientos.Text = c.GetString(\"DOCIENTOS\")";
_et_docientos.setText(BA.ObjectToCharSequence(_c.GetString("DOCIENTOS")));
 //BA.debugLineNum = 48;BA.debugLine="et_cien.Text = c.GetString(\"CIEN\")";
_et_cien.setText(BA.ObjectToCharSequence(_c.GetString("CIEN")));
 //BA.debugLineNum = 49;BA.debugLine="et_cincuenta.Text = c.GetString(\"CINCUENTA\")";
_et_cincuenta.setText(BA.ObjectToCharSequence(_c.GetString("CINCUENTA")));
 //BA.debugLineNum = 50;BA.debugLine="et_veinte.Text = c.GetString(\"VEINTE\")";
_et_veinte.setText(BA.ObjectToCharSequence(_c.GetString("VEINTE")));
 //BA.debugLineNum = 51;BA.debugLine="et_m_veinte.Text = d.GetString(\"VEINTE\")";
_et_m_veinte.setText(BA.ObjectToCharSequence(_d.GetString("VEINTE")));
 //BA.debugLineNum = 52;BA.debugLine="et_m_diez.Text = d.GetString(\"DIEZ\")";
_et_m_diez.setText(BA.ObjectToCharSequence(_d.GetString("DIEZ")));
 //BA.debugLineNum = 53;BA.debugLine="et_m_cinco.Text = d.GetString(\"CINCO\")";
_et_m_cinco.setText(BA.ObjectToCharSequence(_d.GetString("CINCO")));
 //BA.debugLineNum = 54;BA.debugLine="et_m_dos.Text = d.GetString(\"DOS\")";
_et_m_dos.setText(BA.ObjectToCharSequence(_d.GetString("DOS")));
 //BA.debugLineNum = 55;BA.debugLine="et_m_peso.Text = d.GetString(\"PESO\")";
_et_m_peso.setText(BA.ObjectToCharSequence(_d.GetString("PESO")));
 //BA.debugLineNum = 56;BA.debugLine="et_m_centavo.Text = d.GetString(\"CENTAVO\")";
_et_m_centavo.setText(BA.ObjectToCharSequence(_d.GetString("CENTAVO")));
 //BA.debugLineNum = 57;BA.debugLine="l_total.Text = d.GetString(\"TOTAL\")";
_l_total.setText(BA.ObjectToCharSequence(_d.GetString("TOTAL")));
 }else if(_c.getRowCount()==0 && _d.getRowCount()==0) { 
 //BA.debugLineNum = 59;BA.debugLine="Log(\"TABULADR SIN RESUKTADO\")";
__c.LogImpl("325690133","TABULADR SIN RESUKTADO",0);
 //BA.debugLineNum = 60;BA.debugLine="et_mil.Text = \"\"";
_et_mil.setText(BA.ObjectToCharSequence(""));
 //BA.debugLineNum = 61;BA.debugLine="et_quinientos.Text = \"\"";
_et_quinientos.setText(BA.ObjectToCharSequence(""));
 //BA.debugLineNum = 62;BA.debugLine="et_docientos.Text = \"\"";
_et_docientos.setText(BA.ObjectToCharSequence(""));
 //BA.debugLineNum = 63;BA.debugLine="et_cien.Text = \"\"";
_et_cien.setText(BA.ObjectToCharSequence(""));
 //BA.debugLineNum = 64;BA.debugLine="et_cincuenta.Text = \"\"";
_et_cincuenta.setText(BA.ObjectToCharSequence(""));
 //BA.debugLineNum = 65;BA.debugLine="et_veinte.Text = \"\"";
_et_veinte.setText(BA.ObjectToCharSequence(""));
 //BA.debugLineNum = 66;BA.debugLine="et_m_veinte.Text = \"\"";
_et_m_veinte.setText(BA.ObjectToCharSequence(""));
 //BA.debugLineNum = 67;BA.debugLine="et_m_diez.Text = \"\"";
_et_m_diez.setText(BA.ObjectToCharSequence(""));
 //BA.debugLineNum = 68;BA.debugLine="et_m_cinco.Text = \"\"";
_et_m_cinco.setText(BA.ObjectToCharSequence(""));
 //BA.debugLineNum = 69;BA.debugLine="et_m_dos.Text = \"\"";
_et_m_dos.setText(BA.ObjectToCharSequence(""));
 //BA.debugLineNum = 70;BA.debugLine="et_m_peso.Text = \"\"";
_et_m_peso.setText(BA.ObjectToCharSequence(""));
 //BA.debugLineNum = 71;BA.debugLine="et_m_centavo.Text = \"\"";
_et_m_centavo.setText(BA.ObjectToCharSequence(""));
 //BA.debugLineNum = 72;BA.debugLine="l_total.Text = \"\"";
_l_total.setText(BA.ObjectToCharSequence(""));
 };
 //BA.debugLineNum = 74;BA.debugLine="c.Close";
_c.Close();
 //BA.debugLineNum = 75;BA.debugLine="d.Close";
_d.Close();
 //BA.debugLineNum = 76;BA.debugLine="End Sub";
return "";
}
public String  _b4xpage_created(anywheresoftware.b4a.objects.B4XViewWrapper _root1) throws Exception{
 //BA.debugLineNum = 32;BA.debugLine="Private Sub B4XPage_Created (Root1 As B4XView)";
 //BA.debugLineNum = 33;BA.debugLine="Root = Root1";
_root = _root1;
 //BA.debugLineNum = 35;BA.debugLine="Root.LoadLayout(\"tabulador\")";
_root.LoadLayout("tabulador",ba);
 //BA.debugLineNum = 36;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="Private et_mil As EditText";
_et_mil = new anywheresoftware.b4a.objects.EditTextWrapper();
 //BA.debugLineNum = 5;BA.debugLine="Private et_quinientos As EditText";
_et_quinientos = new anywheresoftware.b4a.objects.EditTextWrapper();
 //BA.debugLineNum = 6;BA.debugLine="Private et_docientos As EditText";
_et_docientos = new anywheresoftware.b4a.objects.EditTextWrapper();
 //BA.debugLineNum = 7;BA.debugLine="Private et_cien As EditText";
_et_cien = new anywheresoftware.b4a.objects.EditTextWrapper();
 //BA.debugLineNum = 8;BA.debugLine="Private et_cincuenta As EditText";
_et_cincuenta = new anywheresoftware.b4a.objects.EditTextWrapper();
 //BA.debugLineNum = 9;BA.debugLine="Private et_veinte As EditText";
_et_veinte = new anywheresoftware.b4a.objects.EditTextWrapper();
 //BA.debugLineNum = 10;BA.debugLine="Private et_m_veinte As EditText";
_et_m_veinte = new anywheresoftware.b4a.objects.EditTextWrapper();
 //BA.debugLineNum = 11;BA.debugLine="Private et_m_diez As EditText";
_et_m_diez = new anywheresoftware.b4a.objects.EditTextWrapper();
 //BA.debugLineNum = 12;BA.debugLine="Private et_m_cinco As EditText";
_et_m_cinco = new anywheresoftware.b4a.objects.EditTextWrapper();
 //BA.debugLineNum = 13;BA.debugLine="Private et_m_dos As EditText";
_et_m_dos = new anywheresoftware.b4a.objects.EditTextWrapper();
 //BA.debugLineNum = 14;BA.debugLine="Private et_m_peso As EditText";
_et_m_peso = new anywheresoftware.b4a.objects.EditTextWrapper();
 //BA.debugLineNum = 15;BA.debugLine="Private et_m_centavo As EditText";
_et_m_centavo = new anywheresoftware.b4a.objects.EditTextWrapper();
 //BA.debugLineNum = 16;BA.debugLine="Private b_calcular As Button";
_b_calcular = new anywheresoftware.b4a.objects.ButtonWrapper();
 //BA.debugLineNum = 17;BA.debugLine="Private b_guardar As Button";
_b_guardar = new anywheresoftware.b4a.objects.ButtonWrapper();
 //BA.debugLineNum = 18;BA.debugLine="Private l_total As Label";
_l_total = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 19;BA.debugLine="Dim sum_billetes As Int";
_sum_billetes = 0;
 //BA.debugLineNum = 20;BA.debugLine="Dim sum_monedas As Float";
_sum_monedas = 0f;
 //BA.debugLineNum = 21;BA.debugLine="Dim total As Float";
_total = 0f;
 //BA.debugLineNum = 22;BA.debugLine="Dim c As Cursor";
_c = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
 //BA.debugLineNum = 23;BA.debugLine="Dim d As Cursor";
_d = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
 //BA.debugLineNum = 24;BA.debugLine="End Sub";
return "";
}
public Object  _initialize(anywheresoftware.b4a.BA _ba) throws Exception{
innerInitialize(_ba);
 //BA.debugLineNum = 27;BA.debugLine="Public Sub Initialize As Object";
 //BA.debugLineNum = 28;BA.debugLine="Return Me";
if (true) return this;
 //BA.debugLineNum = 29;BA.debugLine="End Sub";
return null;
}
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]);
return BA.SubDelegator.SubNotFound;
}
}
