/**
   * Laster import
   *
   * @param bunt
   */
  void loadImport(Bunt bunt) {
    deductImportList.clear();

    List<AvdelingAvregningBelop> belop = avdelingAvregningBelopManager.findByBunt(bunt);

    if (belop != null) {
      deductImportList.addAll(belop);
    }
    table.packAll();
  }
  /**
   * Viser rapport
   *
   * @param window
   */
  void showReport(WindowInterface window) {
    GuiUtil.setWaitCursor(window);
    Batchable batch = (Batchable) batchSelectionList.getSelection();
    if (batch != null) {
      List<ReconcilVInterface> lines = reconcilVManager.findByBatchId(batch.getBatchId());

      if (lines != null) {
        reportList.clear();
        reportList.addAll(lines);
      }
    }
    table.packAll();
    GuiUtil.setDefaultCursor(window);
  }
  private void select_official_schedule_types() {
    int row = tbl_official_schedule_types.getSelectedRow();
    if (row < 0) {
      return;
    }
    int col = tbl_official_schedule_types.getSelectedColumn();
    final to_official_schedule_types to =
        (to_official_schedule_types) tbl_official_schedule_types_ALM.get(row);
    if (col == 1) {
      jTextField1.setText(to.schedule_type);
    }
    if (col == 2) {
      Window p = (Window) this;
      Dlg_confirm_action nd = Dlg_confirm_action.create(p, true);
      nd.setTitle("");

      nd.setCallback(
          new Dlg_confirm_action.Callback() {

            @Override
            public void ok(CloseDialog closeDialog, Dlg_confirm_action.OutputData data) {
              closeDialog.ok();
              Official_schedule_types.delete_data(to);
              ret_official_schedule_types();
              Alert.set(3, "");
            }
          });
      nd.setLocationRelativeTo(this);
      nd.setVisible(true);
    }
  }
 private void save_official_schedule_types() {
   int row = tbl_official_schedule_types.getSelectedRow();
   if (row < 0) {
     int id = 0;
     String created_at = DateType.now();
     String updated_at = DateType.now();
     String created_by = Res.getUser_id();
     String updated_by = Res.getUser_id();
     int status = 1;
     String schedule_type = jTextField1.getText();
     to_official_schedule_types type =
         new to_official_schedule_types(
             id, created_at, updated_at, created_by, updated_by, status, schedule_type);
     Official_schedule_types.add_data(type);
     ret_official_schedule_types();
     Alert.set(1, "");
   } else {
     to_official_schedule_types to =
         (to_official_schedule_types) tbl_official_schedule_types_ALM.get(row);
     int id = to.id;
     String created_at = to.created_at;
     String updated_at = DateType.now();
     String created_by = to.created_by;
     String updated_by = Res.getUser_id();
     int status = 1;
     String schedule_type = jTextField1.getText();
     to_official_schedule_types type =
         new to_official_schedule_types(
             id, created_at, updated_at, created_by, updated_by, status, schedule_type);
     Official_schedule_types.update_data(type);
     ret_official_schedule_types();
     Alert.set(2, "");
   }
 }
  private void select_disbursement_categories() {

    int row = tbl_disbursement_categories.getSelectedRow();
    if (row < 0) {
      return;
    }
    to_disbursement_categories to =
        (to_disbursement_categories) tbl_disbursement_categories_ALM.get(row);
    tf_category_name.setText(to.category_name);
  }
 private void select_delivery_trucks() {
   int row = tbl_delivery_trucks.getSelectedRow();
   if (row < 0) {
     return;
   }
   to_delivery_trucks to =
       (to_delivery_trucks)
           tbl_delivery_trucks_ALM.get(tbl_delivery_trucks.convertRowIndexToModel(row));
   tf_description.setText(to.description);
   tf_plate_no.setText(to.plate_no);
 }
 private void delete_delivery_trucks() {
   int row = tbl_delivery_trucks.getSelectedRow();
   if (row < 0) {
     return;
   }
   to_delivery_trucks to =
       (to_delivery_trucks)
           tbl_delivery_trucks_ALM.get(tbl_delivery_trucks.convertRowIndexToModel(row));
   S1_delivery_trucks.delete_delivery_trucks(to);
   data_cols();
   clear_delivery_trucks();
 }
 private void delete_disbursement_categories() {
   int row = tbl_disbursement_categories.getSelectedRow();
   if (row < 0) {
     return;
   }
   to_disbursement_categories to =
       (to_disbursement_categories) tbl_disbursement_categories_ALM.get(row);
   S1_disbursement_categories.delete_data(to);
   tf_category_name.setText("");
   data_disbursement_categories();
   tf_category_name.grabFocus();
 }
  public DeductImportViewHandler(
      Bunt bunt,
      DeductBatchViewHandler aDeductBatchViewHandler,
      AvdelingAvregningBelopManager aAvdelingAvregningBelopManager) {
    avdelingAvregningBelopManager = aAvdelingAvregningBelopManager;
    deductBatchViewHandler = aDeductBatchViewHandler;
    deductImportList = new ArrayListModel();

    if (bunt != null && bunt.getAvdelingAvregningImports() != null) {
      deductImportList.addAll(bunt.getAvdelingAvregningImports());
    }
    deductImportSelectionList = new SelectionInList((ListModel) deductImportList);
  }
 private void compute_charges() {
   //
   double total = 0;
   if (tbl_charges_ALM.isEmpty()) {
     total = 0;
   } else {
     List<S2_customers.to_cust_charges> datas = tbl_charges_ALM;
     for (S2_customers.to_cust_charges to : datas) {
       total += to.amount;
     }
   }
   tf_total.setText("" + NumType.with_comma(Double.parseDouble("" + total)));
 }
  private void delete_branch_locations() {
    int row = tbl_branch_locations.getSelectedRow();
    if (row < 0) {
      return;
    }
    final to_branch_locations to =
        (to_branch_locations)
            tbl_branch_locations_ALM.get(tbl_branch_locations.convertRowIndexToModel(row));
    if (to.status == 1) {
      Alert.set(0, "Cannot Delete Default Location");
      return;
    }
    Window p = (Window) this;
    Dlg_auth nd = Dlg_auth.create(p, true);
    nd.setTitle("");
    nd.setCallback(
        new Dlg_auth.Callback() {

          @Override
          public void ok(CloseDialog closeDialog, Dlg_auth.OutputData data) {
            closeDialog.ok();
            jProgressBar1.setString("Loading...Please wait...");
            jProgressBar1.setIndeterminate(true);
            btn_new.setEnabled(false);
            btn_add.setEnabled(false);
            btn_edit.setEnabled(false);
            btn_delete.setEnabled(false);
            Thread t =
                new Thread(
                    new Runnable() {
                      @Override
                      public void run() {
                        S1_branch_locations.delete_branch_locations(to);
                        data_cols();
                        clear_branch_locations();
                        Alert.set(3, "");
                        jProgressBar1.setString("Finished...");
                        jProgressBar1.setIndeterminate(false);
                        btn_new.setEnabled(true);
                        btn_add.setEnabled(true);
                        btn_edit.setEnabled(true);
                        btn_delete.setEnabled(true);
                      }
                    });
            t.start();
          }
        });
    nd.setLocationRelativeTo(jScrollPane2);
    nd.setVisible(true);
  }
 private void edit_delivery_trucks() {
   int row = tbl_delivery_trucks.getSelectedRow();
   if (row < 0) {
     return;
   }
   to_delivery_trucks to =
       (to_delivery_trucks)
           tbl_delivery_trucks_ALM.get(tbl_delivery_trucks.convertRowIndexToModel(row));
   int id = to.id;
   String description = tf_description.getText();
   String plate_no = tf_plate_no.getText();
   to_delivery_trucks to1 = new to_delivery_trucks(id, description, plate_no);
   S1_delivery_trucks.edit_delivery_trucks(to1);
   data_cols();
   clear_delivery_trucks();
 }
  private void update_disbursement_categories() {

    int row = tbl_disbursement_categories.getSelectedRow();
    if (row < 0) {
      return;
    }
    to_disbursement_categories to =
        (to_disbursement_categories) tbl_disbursement_categories_ALM.get(row);
    int id = to.id;
    String category_name = tf_category_name.getText();

    to_disbursement_categories to1 = new to_disbursement_categories(id, category_name);
    S1_disbursement_categories.update_data(to1);
    tf_category_name.setText("");
    data_disbursement_categories();
    tf_category_name.grabFocus();
  }
 @Override
 public void setValueAt(Object aValue, int rowIndex, int columnIndex)
     throws NumberFormatException {
   logger.debug("MachineTableModel setValue {} {} {}", aValue, rowIndex, columnIndex);
   Machine machine = (Machine) listModel.get(rowIndex);
   if (columnIndex == Machine.Column.PART_NO.getIndex()) {
     machine.getMold().setPartNo((String) aValue);
   } else if (columnIndex == Machine.Column.TARGET.getIndex()) {
     machine.setTarget((Integer) aValue);
   } else if (columnIndex == Machine.Column.ACTUAL.getIndex()) {
     machine.setActual((Integer) aValue);
   } else if (columnIndex == Machine.Column.MULTIPLY.getIndex()) {
     machine.getMold().setMultiply((Integer) aValue);
   } else if (columnIndex == Machine.Column.STATUS.getIndex()) {
     machine.setStatus((Status) aValue);
   } else {
     throw new IllegalArgumentException("Invalid column index:" + columnIndex);
   }
 }
 @Override
 public Object getValueAt(int rowIndex, int columnIndex) {
   Machine machine = ((Machine) listModel.get(rowIndex));
   if (columnIndex == Machine.Column.NO.getIndex()) {
     return machine.getMachineNo();
   } else if (columnIndex == Machine.Column.PART_NO.getIndex()) {
     return machine.getMold().getPartNo();
   } else if (columnIndex == Machine.Column.TARGET.getIndex()) {
     return machine.getTarget();
   } else if (columnIndex == Machine.Column.ACTUAL.getIndex()) {
     return machine.getActual();
   } else if (columnIndex == Machine.Column.MULTIPLY.getIndex()) {
     return machine.getMold().getMultiply();
   } else if (columnIndex == Machine.Column.STATUS.getIndex()) {
     return machine.getStatus();
   } else {
     return "NULL";
   }
 }
 public static void loadData_official_schedule_types(List<to_official_schedule_types> acc) {
   tbl_official_schedule_types_ALM.clear();
   tbl_official_schedule_types_ALM.addAll(acc);
 }
 private void loadData_delivery_trucks(List<to_delivery_trucks> acc) {
   tbl_delivery_trucks_ALM.clear();
   tbl_delivery_trucks_ALM.addAll(acc);
 }
 private void loadData_charges(List<S2_customers.to_cust_charges> acc) {
   tbl_charges_ALM.clear();
   tbl_charges_ALM.addAll(acc);
 }
 private void loadData_baptism(List<S2_customers.to_customers> acc) {
   tbl_employee_payroll_ALM.clear();
   tbl_employee_payroll_ALM.addAll(acc);
 }
 private void loadData_branch_locations(List<to_branch_locations> acc) {
   tbl_branch_locations_ALM.clear();
   tbl_branch_locations_ALM.addAll(acc);
 }
 private void data_cols() {
   String search = tf_branch_id.getText();
   String location = tf_search.getText();
   loadData_branch_locations(S1_branch_locations.ret_data_by_branch_id(search, location));
   jLabel6.setText("" + tbl_branch_locations_ALM.size());
 }
Exemple #22
0
 private void loadData_chats(List<to_chats> acc) {
   tbl_chats_ALM.clear();
   tbl_chats_ALM.addAll(acc);
 }
 public static void loadData_disbursement_categories(List<to_disbursement_categories> acc) {
   tbl_disbursement_categories_ALM.clear();
   tbl_disbursement_categories_ALM.addAll(acc);
 }