$$(document).on('page:init', '.page[data-name="company_add"]', function(e) {

  $(document).off("click", "#company_add_button").on("click", "#company_add_button", function(e) {

    e.preventDefault();

    const name = $('#c2_name').val();

    const initial= $('#c2_initial').val();

    const nib= $('#c2_nib').val();

    const npwp= $('#c2_npwp').val();

    const address= $('#c2_address').val();

    const city= $('#c2_city').val();

    const postcode= $('#c2_postcode').val();

    const relation= $('#c2_relation').val();



    let req = {

      name,initial,nib,npwp,address,city,postcode,relation

    }

    if (name) {

      company_add(req);

    } else {

      app.dialog.alert("All fields are required", "Company Add Errors");

    }

  });

})