private void add_customer() {

    Window p = (Window) this;
    Dlg_customers nd = Dlg_customers.create(p, true);
    nd.setTitle("");
    //        nd.do_pass2();
    nd.setCallback(
        new Dlg_customers.Callback() {

          @Override
          public void ok(CloseDialog closeDialog, Dlg_customers.OutputData data) {
            closeDialog.ok();
            add_cust(
                data.name,
                data.add,
                data.contact,
                data.occupation,
                data.income,
                data.bday,
                data.civil_status,
                data.gender,
                data.credit_limit);
          }

          @Override
          public void balance(CloseDialog closeDialog, Dlg_customers.OutputData data) {}
        });
    Center.setCenter(nd);

    nd.setVisible(true);
  }
  private void delete_cust() {
    int row = tbl_cust.getSelectedRow();
    if (row < 0) {
      return;
    }
    final String num = tbl_cust.getModel().getValueAt(row, 1).toString();
    Window p = (Window) this;
    Dlg_confirm nd = Dlg_confirm.create(p, true);
    nd.setTitle("");
    //        nd.do_pass("");
    nd.setCallback(
        new Dlg_confirm.Callback() {

          @Override
          public void ok(CloseDialog closeDialog, Dlg_confirm.Data data) {
            closeDialog.ok();
            delete(num);
          }

          @Override
          public void cancel(CloseDialog closeDialog) {
            //                throw new UnsupportedOperationException("Not supported yet.");
          }
        });
    Center.setCenter(nd);

    nd.setVisible(true);
  }
  private void do_pay() {

    int[] idx = tbl_charges.getSelectedRows();
    //        JOptionPane.showMessageDialog(null, idx);
    if (idx.length <= 0) {
      return;
    }

    final List<S2_customers.to_cust_charges> cus = new ArrayList();

    final List<String> rem = new ArrayList();
    double charges = 0;
    for (int ix : idx) {
      charges +=
          Double.parseDouble(NumType.no_comma(tbl_charges.getModel().getValueAt(ix, 2).toString()));
      String or_number = tbl_charges.getModel().getValueAt(ix, 0).toString();
      String ci_number = tbl_charges.getModel().getValueAt(ix, 1).toString();
      //            rem.add(tbl_charges.getModel().getValueAt(ix, 1).toString());

      S2_customers.to_cust_charges to =
          new S2_customers.to_cust_charges(or_number, ci_number, 0, "");

      cus.add(to);
      //            System.out.println(tbl_charges.getModel().getValueAt(ix, 1).toString());
    }

    int row = tbl_charges.getSelectedRow();
    if (row < 0) {
      return;
    }
    String num = tbl_charges.getModel().getValueAt(row, 1).toString();

    Window p = (Window) this;
    Dlg_quantity1 nd = Dlg_quantity1.create(p, true);
    nd.setTitle("");
    nd.do_pass(charges);
    nd.setCallback(
        new Dlg_quantity1.Callback() {

          @Override
          public void ok(CloseDialog closeDialog, Dlg_quantity1.OutputData data) {
            closeDialog.ok();
            pay3(cus);
            //                pay(rem);
          }
        });
    Center.setCenter(nd);

    nd.setVisible(true);
  }
  private void ok1() {

    int row = tbl_cust.getSelectedRow();
    if (row < 0) {
      return;
    }

    final String num = tbl_cust.getModel().getValueAt(row, 1).toString();
    final String names = tbl_cust.getModel().getValueAt(row, 0).toString();
    final double balance = Double.parseDouble(tbl_cust.getModel().getValueAt(row, 2).toString());
    String[] details = new String[3];
    details = S2_customers.get_details(num);
    final String name = details[0];
    final String add = details[1];
    final String contact = details[2];
    //           final String name=details[0];
    Window p = (Window) this;

    Dlg_credit_card nd = Dlg_credit_card.create(p, true);
    nd.setTitle("");
    nd.do_pass(names, details[1], details[2], credit_amount, balance);
    nd.setCallback(
        new Dlg_credit_card.Callback() {

          @Override
          public void ok(CloseDialog closeDialog, Dlg_credit_card.OutputData data) {
            closeDialog.ok();

            ok2(name, add, contact, credit_amount, data.to, data.pay_mode, num);
            disposed();
          }

          @Override
          public void credit(CloseDialog closeDialog, Dlg_credit_card.OutputData data) {
            ok2(name, add, contact, credit_amount, data.to, data.pay_mode, num);
            //                disposed();
          }

          @Override
          public void prepaid(CloseDialog closeDialog, Dlg_credit_card.OutputData data) {
            ok2(name, add, contact, credit_amount, data.to, data.pay_mode, num);
            //                disposed();
          }
        });
    Center.setCenter(nd);

    nd.setVisible(true);
  }
  private void keyboard(final JTextField tf) {
    Window p = (Window) this;
    dlg_keyboard nd = dlg_keyboard.create(p, true);
    nd.setTitle("");
    nd.do_pass(tf.getText());
    nd.setCallback(
        new dlg_keyboard.Callback() {

          @Override
          public void ok(CloseDialog closeDialog, dlg_keyboard.OutputData data) {
            //                closeDialog.ok();
            tf.setText(data.name);
            data_employee();
          }
        });
    Center.setRight(nd);

    nd.setVisible(true);
  }
  private void edit_customer() {

    int row = tbl_cust.getSelectedRow();
    if (row < 0) {
      return;
    }
    final String num = tbl_cust.getModel().getValueAt(row, 1).toString();

    //         JOptionPane.showMessageDialog(null, to.b_date);
    Window p = (Window) this;
    Dlg_customers nd = Dlg_customers.create(p, true);
    nd.setTitle("");
    if (System.getProperty("version", "resto").equals("resto")) {
      S2_customers.customers to = S2_customers.get_cust_guest(num);
      //            System.out.println(to.member_name + " asdasd");
      nd.do_pass(
          to.member_name,
          to.address,
          to.contact,
          to.occupation,
          to.income,
          to.b_date,
          to.civil_status,
          to.is_male,
          to.balance,
          num,
          to.credit_limit);
    } else {
      S2_customers.customers to = S2_customers.get_cust_details(num);
      nd.do_pass(
          to.member_name,
          to.address,
          to.contact,
          to.occupation,
          to.income,
          to.b_date,
          to.civil_status,
          to.is_male,
          to.balance,
          num,
          to.credit_limit);
    }

    nd.setCallback(
        new Dlg_customers.Callback() {

          @Override
          public void ok(CloseDialog closeDialog, Dlg_customers.OutputData data) {
            closeDialog.ok();
            do_edit_customer(
                data.name,
                data.add,
                data.contact,
                data.occupation,
                data.income,
                data.bday,
                data.civil_status,
                data.gender,
                num,
                data.balance,
                data.credit_limit);
          }

          @Override
          public void balance(CloseDialog closeDialog, Dlg_customers.OutputData data) {
            data_employee();
            int row = tbl_cust.getSelectedRow();
            if (row < 0) {
              return;
            }
            String num = tbl_cust.getModel().getValueAt(row, 1).toString();
            //        JOptionPane.showMessageDialog(null, num);
            loadData_charges(S2_customers.ret_charges(num));
            compute_charges();
          }
        });
    Center.setCenter(nd);

    nd.setVisible(true);
  }