Example #1
0
  /** Dynamic Init. - Load Bank Info - Load BPartner - Init Table */
  private void dynInit() {
    ArrayList<BankInfo> bankAccountData = getBankAccountData();
    for (BankInfo bi : bankAccountData) fieldBankAccount.appendItem(bi.toString(), bi);

    if (fieldBankAccount.getItemCount() == 0) FDialog.error(m_WindowNo, form, "VPaySelectNoBank");
    else fieldBankAccount.setSelectedIndex(0);

    ArrayList<KeyNamePair> bpartnerData = getBPartnerData();
    for (KeyNamePair pp : bpartnerData) fieldBPartner.appendItem(pp.getName(), pp);
    fieldBPartner.setSelectedIndex(0);

    ArrayList<KeyNamePair> docTypeData = getDocTypeData();
    for (KeyNamePair pp : docTypeData) fieldDtype.appendItem(pp.getName(), pp);

    prepareTable(miniTable);

    miniTable.getModel().addTableModelListener(this);
    //
    fieldPayDate.setMandatory(true);
    fieldPayDate.setValue(new Timestamp(System.currentTimeMillis()));
  } //  dynInit
Example #2
0
  /** Query and create TableInfo */
  private void loadTableInfo() {
    Timestamp payDate = (Timestamp) fieldPayDate.getValue();
    miniTable.setColorCompare(payDate);
    log.config("PayDate=" + payDate);

    BankInfo bi = (BankInfo) fieldBankAccount.getSelectedItem().getValue();

    ValueNamePair paymentRule = (ValueNamePair) fieldPaymentRule.getSelectedItem().getValue();
    KeyNamePair bpartner = (KeyNamePair) fieldBPartner.getSelectedItem().getValue();
    KeyNamePair docType = (KeyNamePair) fieldDtype.getSelectedItem().getValue();

    loadTableInfo(bi, payDate, paymentRule, onlyDue.isSelected(), bpartner, docType, miniTable);

    calculateSelection();
  } //  loadTableInfo
Example #3
0
  /** Generate PaySelection */
  private void generatePaySelect() {
    if (miniTable.getRowCount() == 0) return;
    miniTable.setSelectedIndices(new int[] {0});
    calculateSelection();
    if (m_noSelected == 0) return;

    String msg =
        generatePaySelect(
            miniTable,
            (ValueNamePair) fieldPaymentRule.getSelectedItem().getValue(),
            new Timestamp(fieldPayDate.getComponent().getValue().getTime()),
            (BankInfo) fieldBankAccount.getSelectedItem().getValue());

    if (msg != null && msg.length() > 0) {
      FDialog.error(m_WindowNo, form, "SaveError", msg);
      return;
    }

    //  Ask to Post it
    if (!FDialog.ask(m_WindowNo, form, "VPaySelectGenerate?", "(" + m_ps.getName() + ")")) return;

    //  Prepare Process
    int AD_Proces_ID = 155; // 	C_PaySelection_CreatePayment

    //	Execute Process
    ProcessModalDialog dialog =
        new ProcessModalDialog(
            this,
            m_WindowNo,
            AD_Proces_ID,
            X_C_PaySelection.Table_ID,
            m_ps.getC_PaySelection_ID(),
            false);
    if (dialog.isValid()) {
      try {
        dialog.setWidth("500px");
        dialog.setVisible(true);
        dialog.setPage(form.getPage());
        dialog.doModal();
      } catch (SuspendNotAllowedException e) {
        log.log(Level.SEVERE, e.getLocalizedMessage(), e);
      } catch (InterruptedException e) {
        log.log(Level.SEVERE, e.getLocalizedMessage(), e);
      }
    }
  } //  generatePaySelect
Example #4
0
  /**
   * Static Init
   *
   * @throws Exception
   */
  private void zkInit() throws Exception {
    //
    form.appendChild(mainPanel);
    mainPanel.appendChild(mainLayout);
    mainPanel.setStyle("width: 100%; height: 100%; padding: 0; margin: 0");
    mainLayout.setHeight("100%");
    mainLayout.setWidth("99%");
    parameterPanel.appendChild(parameterLayout);
    //
    labelBankAccount.setText(Msg.translate(Env.getCtx(), "C_BankAccount_ID"));
    fieldBankAccount.addActionListener(this);
    labelBPartner.setText(Msg.translate(Env.getCtx(), "C_BPartner_ID"));
    fieldBPartner.addActionListener(this);
    bRefresh.addActionListener(this);
    labelPayDate.setText(Msg.translate(Env.getCtx(), "PayDate"));
    labelPaymentRule.setText(Msg.translate(Env.getCtx(), "PaymentRule"));
    fieldPaymentRule.addActionListener(this);
    labelDtype.setText(Msg.translate(Env.getCtx(), "C_DocType_ID"));
    fieldDtype.addActionListener(this);
    //
    labelBankBalance.setText(Msg.translate(Env.getCtx(), "CurrentBalance"));
    labelBalance.setText("0");
    onlyDue.setText(Msg.getMsg(Env.getCtx(), "OnlyDue"));
    dataStatus.setText(" ");
    dataStatus.setPre(true);
    //
    bGenerate.addActionListener(this);
    bCancel.addActionListener(this);
    //
    North north = new North();
    north.setStyle("border: none");
    mainLayout.appendChild(north);
    north.appendChild(parameterPanel);

    Rows rows = parameterLayout.newRows();
    Row row = rows.newRow();
    row.appendChild(labelBankAccount.rightAlign());
    row.appendChild(fieldBankAccount);
    row.appendChild(labelBankBalance.rightAlign());
    Panel balancePanel = new Panel();
    balancePanel.appendChild(labelCurrency);
    balancePanel.appendChild(labelBalance);
    row.appendChild(balancePanel);
    row.appendChild(new Space());

    row = rows.newRow();
    row.appendChild(labelBPartner.rightAlign());
    row.appendChild(fieldBPartner);
    row.appendChild(new Space());
    row.appendChild(onlyDue);
    row.appendChild(new Space());

    row = rows.newRow();
    row.appendChild(labelDtype.rightAlign());
    row.appendChild(fieldDtype);
    row.appendChild(new Space());
    row.appendChild(new Space());
    row.appendChild(new Space());

    row = rows.newRow();
    row.appendChild(labelPayDate.rightAlign());
    row.appendChild(fieldPayDate.getComponent());
    row.appendChild(labelPaymentRule.rightAlign());
    row.appendChild(fieldPaymentRule);
    row.appendChild(bRefresh);

    South south = new South();
    south.setStyle("border: none");
    mainLayout.appendChild(south);
    southPanel = new Panel();
    southPanel.appendChild(dataStatus);
    south.appendChild(southPanel);
    Center center = new Center();
    mainLayout.appendChild(center);
    center.appendChild(miniTable);
    //
    commandPanel.addButton(bGenerate);
    commandPanel.getButton(ConfirmPanel.A_OK).setVisible(false);
  } //  jbInit
  private void zkInit() {
    form.appendChild(mainLayout);
    mainLayout.setWidth("99%");
    mainLayout.setHeight("100%");

    parameterPanel.appendChild(parameterLayout);

    lGroup = new Label(Msg.getMsg(Env.getCtx(), "Group"));
    lBPartner = new Label(Msg.getMsg(Env.getCtx(), "Teacher"));
    lDateFrm = new Label(Msg.getMsg(Env.getCtx(), "Date"));
    lSubject = new Label(Msg.getMsg(Env.getCtx(), "Subject"));

    North north = new North();
    north.setStyle("border: none");
    mainLayout.appendChild(north);
    north.appendChild(parameterPanel);
    Rows rows = null;
    Row row = null;
    parameterLayout.setWidth("800px");
    rows = parameterLayout.newRows();
    row = rows.newRow();

    row.appendChild(lGroup);
    row.appendChild(fGroup.getComponent());
    row.appendChild(lBPartner);
    row.appendChild(fBPartner.getComponent());
    row = rows.newRow();
    row.appendChild(lDateFrm);
    row.appendChild(fDateFrom.getComponent());
    row.appendChild(lSubject);
    row.appendChild(fSubject.getComponent());

    row = rows.newRow();
    row.appendChild(new Space());

    row = rows.newRow();
    row.appendChild(new Space());
    row.appendChild(periodControl);

    Span span = new Span();
    span.setParent(periodControl);
    span.setStyle("height: 99%; display: inline-block; width: 20%;");
    span.appendChild(bBack);

    span = new Span();
    span.setParent(periodControl);
    span.setStyle("height: 99%; display: inline-block; width: 10%;");
    span.appendChild(lPeriod);

    span = new Span();
    span.setParent(periodControl);
    span.setStyle("height: 99%; display: inline-block; width: 20%;");
    span.appendChild(bNext);

    row.appendChild(new Space());
    row.appendChild(bSave);

    Center center = new Center();
    center.setFlex(true);
    center.appendChild(mainPanel);

    span = new Span();
    span.setParent(mainPanel);
    span.setStyle("height: 99%; display: inline-block; width: 10%;");
    span.appendChild(labelGrid);

    labelGrid.setWidth("90%");
    rows = labelGrid.newRows();

    row = rows.newRow();
    row.appendChild(new Space());
    row = rows.newRow();
    row.appendChild(new Space());
    row = rows.newRow();
    row.appendChild(lDay.rightAlign());
    row = rows.newRow();
    row.appendChild(new Space());
    row = rows.newRow();
    row.setHeight("35px");
    row.appendChild(lUnit.rightAlign());
    row = rows.newRow();
    row.setHeight("35px");
    row.appendChild(lLesson.rightAlign());
    row = rows.newRow();
    row.setHeight("35px");
    row.appendChild(lStage.rightAlign());
    row = rows.newRow();
    row.setHeight("35px");
    row.appendChild(lActivity.rightAlign());
    row = rows.newRow();
    row.setHeight("35px");
    row.appendChild(lHomework.rightAlign());
    row = rows.newRow();
    row.setHeight("35px");
    row.appendChild(lValues.rightAlign());
    row = rows.newRow();
    row.setHeight("35px");
    row.appendChild(lComments.rightAlign());
    row = rows.newRow();
    row.setHeight("35px");
    row.appendChild(lLink.rightAlign());
    row = rows.newRow();
    row.setHeight("35px");
    row.appendChild(lImage.rightAlign());

    for (PlanBookDay planDay : planDays) {
      span = new Span();
      span.setParent(mainPanel);
      span.setStyle("height: 99%; display: inline-block; width: 16%;");
      span.appendChild(planDay);
    }

    mainLayout.appendChild(center);
  }