Package nu.lazy8.ledger.jdbc

Examples of nu.lazy8.ledger.jdbc.DataComboBox


    checkbox4 = new HelpedCheckBox(Translator.getTranslation("Include in the balance in reports"),
        false, "balance", "accounttype", view);
    jPanel1.add(new JPanel());
    jPanel1.add(checkbox4);

    accountTypeAccess = new JdbcTable("AccountType", 2, view);
    dataMovementPane = new DataMovementPane(
        accountTypeAccess, this, bIsAddOnly, view);

    jPanel22.add(dataMovementPane);
    JPanel horizontalSpacePanel = new JPanel();
View Full Code Here


    label1 = new HelpedLabel(sLabelText, "company", helpFile, view);
    if (jPanel1 != null) {
      jPanel1.add(label1);
    }

    comboBox = new DataComboBox(new JdbcTable("Company", 1, view), false, "company", helpFile, view);
    comboBox.setMaximumSize(new Dimension(accountNameFieldSize, accountNameFieldSize));
    comboBox.setMinimumSize(new Dimension(accountNameFieldSize / 2, 1));
    ActionListener lsel =
      new ActionListener() {
        //{{{ +actionPerformed(ActionEvent) : void
        public void actionPerformed(ActionEvent e) {
          SwingUtilities.invokeLater(
            new Runnable() {
              //{{{ +run() : void
              public void run() {
                updateBoxes();
              }//}}}
            });
        }//}}}
      };
    if (jPanel1 != null) {
      jPanel1.add(comboBox);
    }

    comboBox.loadComboBox("Name", "CompId", new Integer(0));
    //select the default company
    JdbcTable aa = new JdbcTable("Company", 1, view);
    try {
      aa.setObject(new Integer(
          SetupInfo.getProperty(SetupInfo.DEFAULT_COMPANY)),
          "CompId");
      if (aa.GetFirstRecord()) {
        comboBox.setSelectedItemFromKey((Integer)
            aa.getObject("CompId", null));
      }
    } catch (Exception ex) {
      comboBox.setSelectedItem("");
      /*
       *  just clear the dialog
View Full Code Here

    if (jPanel1 != null) {
      jPanel1.add(label2);
    }

    comboBoxPeriod = new DataComboBox(new JdbcTable("AccountingPeriods", 1, view), false, "period", sHelpFile, view);
    ActionListener lsel =
      new ActionListener() {

        //{{{ +actionPerformed(ActionEvent) : void
        public void actionPerformed(ActionEvent e) {
View Full Code Here

      j1.add(jPanel1);
    } else {
      j1.add(new JPanel());
    }
    jPanel2.add(j1);
    accountAccess = new JdbcTable("APP.Account", 2, view);
    dataMovementPane = new DataMovementPane(
        accountAccess, this, bIsAddOnly, view);

    jPanel2.add(dataMovementPane);
View Full Code Here

    jPanel1.add(textField1);

    jPanel1.add(label2);
    jPanel1.add(textField2);

    CompanyAccess = new JdbcTable("Company", 1, view);
    dataMovementPane = new DataMovementPane(
        CompanyAccess, this, view);

    jPanel22.add(dataMovementPane);
View Full Code Here

    jPanel1.add(label3);
    jPanel1.add(textField3);

    jPanel1.add(new HelpedLabel(Translator.getTranslation("Default account"),
        "DefaultAccount", "customer", view));
    accountCombo = new DataComboBox(new JdbcTable("APP.Account", 2, view), true, "Account", "transaction", view);
    accountCombo.loadComboBox("AccDesc", "Account", (Integer) cc.comboBox.getSelectedItemsKey());
    accountCombo.setMaximumSize(new Dimension(accountNameFieldSize, accountNameFieldSize));
    accountCombo.setMinimumSize(new Dimension(accountNameFieldSize / 2, 1));

    jPanel1.add(accountCombo);

    customerAccess = new JdbcTable("Customer2", 2, view);
    dataMovementPane = new DataMovementPane(
        customerAccess, this, bIsAddOnly, view);

    jPanel22.add(dataMovementPane);
    JPanel horizontalSpacePanel = new JPanel();
View Full Code Here

    StringBuffer sb = new StringBuffer();
    sb.append(
        "SELECT CustId ,CustName, CustDesc, DefaultAcc " +
        " FROM Customer2 WHERE CompId=" + compId +
        " ORDER BY CustId ");
    JdbcTable db = new JdbcTable(sb.toString(), view, new int[]{0});
    if (isJFreeReport) {
      db.GetFirstRecord();
      return new CustomerTable(db.resultSet);
    }

    if (!db.GetFirstRecord()) {
      return "";
    }

    //Print the Report header
    AddReportHeaders();

    initializeRow(fieldSize, 3);
    addField(Translator.getTranslation("CustId"), fieldSize, 1,
        -1, false);
    addField(Translator.getTranslation("Customer name"), fieldSize, 2,
        -1, false);
    addField(Translator.getTranslation("Customer description"), fieldSize, 3,
        -1, false);
    addField(Translator.getTranslation("Default account"), fieldSize, 4,
        -1, false);
    jTextArea.append(sbRow.toString());
    jTextArea.append(newline);
    initializeRow(fieldSize, 3);
    addField("-----------------------", fieldSize, 1, -1, false);
    addField("------------------------------------------------------------", fieldSize, 2, -1, false);
    addField("------------------------------------------------------------", fieldSize, 3, -1, false);
    addField("-----------------------", fieldSize, 4, -1, false);
    jTextArea.append(sbRow.toString());
    jTextArea.append(newline);

    do {
      jTextArea.append(renderIntegerField(
          db.getObject("CustId", null), fieldSize[1]));
      jTextArea.append(renderField((String)
          db.getObject("CustName", null), fieldSize[2]));
      jTextArea.append(renderField((String)
          db.getObject("CustDesc", null), fieldSize[3]));
      jTextArea.append(renderIntegerField((Integer)
          db.getObject("DefaultAcc", null), fieldSize[4]));
      jTextArea.append(newline);
    } while (db.GetNextRecord());

    return jTextField3.getText();
  }//}}}
View Full Code Here

   * @param  compId         Description of the Parameter
   * @return                Description of the Return Value
   */
  public Object buttonGetReportOld(boolean isJFreeReport,
      String rapName, int compId) {
    JdbcTable db = getJdbcTable(compId, true);
    if (isJFreeReport) {
      if (db==null)return null;
      db.GetFirstRecord();
      try {
        return new AccountReportTable(db.resultSet,new java.sql.Date(
            jTextField1.getDate().getTime()),new java.sql.Date(
            jTextField2.getDate().getTime()),compId);
      } catch (Exception e) {
        e.printStackTrace();
        return null;
      }
    }
    if (db==null)return "";

    if (!db.GetFirstRecord()) {
      return "";
    }

    if (((Integer) customerComboBox.getSelectedItemsKey()).intValue() != 0) {
      jTextArea.append(Translator.getTranslation("Customer") + "     " + customerComboBox.getSelectedItemsSecondaryKey());
      jTextArea.append(newline);
    }
    //Print the Report header
    AddReportHeaders();

    Integer processingAccount = (Integer) db.getObject("Amount.Account", null);
    Integer processingCustomer = (Integer) db.getObject("Amount.Customer", null);
    boolean bIsNewAccount = true;
    boolean bIsNewCustomer = true;
    boolean bIsNewPost = false;
    double fDebitTotal = 0;
    double fCreditTotal = 0;
    double fCustDebitTotal = 0;
    double fCustCreditTotal = 0;
    do {
      if(bIsNewAccount){
        jTextArea.append("               " + Translator.getTranslation("Account") +
            " " + IntegerField.ConvertIntToLocalizedString(
            processingAccount) + " : " +
            (String) db.getObject("AccDesc", null));
        jTextArea.append(newline);
        jTextArea.append(newline);
      }
      jTextArea.append("               " + Translator.getTranslation("Customer") +
          " " + IntegerField.ConvertIntToLocalizedString(
          processingCustomer) + " : " +
          (String) db.getObject("CustName", null));
      jTextArea.append(newline);
      jTextArea.append(newline);
      initializeRow(fieldSize, 6);
      addField(Translator.getTranslation("Transaction"), fieldSize, 1,
          -1, false);
      addField(Translator.getTranslation("InvDate"), fieldSize, 2,
          -1, false);
      addField(Translator.getTranslation("Commentary"), fieldSize, 3,
          -1, false);
      addField(Translator.getTranslation("Commentary"), fieldSize, 4,
          -1, false);
      addField(Translator.getTranslation("Customer"), fieldSize, 5,
          -1, false);
      addField(Translator.getTranslation("Debit"), fieldSize, 6,
          -1, true);
      addField(Translator.getTranslation("Credit"), fieldSize, 7,
          -1, true);
      jTextArea.append(sbRow.toString());
      jTextArea.append(newline);

      do {
        jTextArea.append(renderIntegerField(
            db.getObject("Amount.Act_id", null), fieldSize[1]));
        jTextArea.append(renderDateField(
            db.getObject("InvDate", null), fieldSize[2]));
        jTextArea.append(renderField((String)
            db.getObject("Activity2.Notes", null), fieldSize[3]));
        jTextArea.append(renderField((String)
            db.getObject("Amount.Notes", null), fieldSize[4]));
        jTextArea.append(renderField((String)
            db.getObject("CustName", null), fieldSize[5]));

        jTextArea.append(renderDecimalField(((Double)
            db.getObject("Debit", null)), fieldSize[6]));
        fCustDebitTotal += ((Double)
            db.getObject("Debit", null)).doubleValue();
        fDebitTotal += ((Double)
            db.getObject("Debit", null)).doubleValue();
        jTextArea.append(renderDecimalField(((Double)
            db.getObject("Credit", null)), fieldSize[7]));
        fCustCreditTotal += ((Double)
            db.getObject("Credit", null)).doubleValue();
        fCreditTotal += ((Double)
            db.getObject("Credit", null)).doubleValue();
        jTextArea.append(newline);
        bIsNewPost = db.GetNextRecord();
        if (bIsNewPost) {
          bIsNewAccount = processingAccount.compareTo(
              (Integer) db.getObject("Amount.Account", null)) != 0;
          bIsNewCustomer = processingCustomer.compareTo(
              (Integer) db.getObject("Amount.Customer", null)) != 0;
        }
      } while (bIsNewPost && !bIsNewAccount && !bIsNewCustomer);
      initializeRow(fieldSize, 7);
      addField("-----------------------", fieldSize, 6, -1, false);
      addField("-----------------------", fieldSize, 7, -1, false);
      jTextArea.append(sbRow.toString());
      jTextArea.append(newline);
      initializeRow(fieldSize, 7);
      addField(Translator.getTranslation("Balance"), fieldSize, 4, -1, false);
      addField(new Double(fCustDebitTotal-fCustCreditTotal), fieldSize, 5, Types.DOUBLE, false);
      addField(new Double(fCustDebitTotal), fieldSize, 6, Types.DOUBLE, false);
      addField(new Double(fCustCreditTotal), fieldSize, 7, Types.DOUBLE, false);
      jTextArea.append(sbRow.toString());
      jTextArea.append(newline);
      processingCustomer = (Integer) db.getObject("Amount.Customer", null);
      fCustCreditTotal=0;
      fCustDebitTotal=0;
      if(bIsNewAccount || !bIsNewPost){
        initializeRow(fieldSize, 7);
        addField("-----------------------", fieldSize, 6, -1, false);
        addField("-----------------------", fieldSize, 7, -1, false);
        jTextArea.append(sbRow.toString());
        jTextArea.append(newline);
        initializeRow(fieldSize, 7);
        addField(Translator.getTranslation("Balance"), fieldSize, 4, -1, false);
        addField(new Double(fDebitTotal-fCreditTotal), fieldSize, 5, Types.DOUBLE, false);
        addField(new Double(fDebitTotal), fieldSize, 6, Types.DOUBLE, false);
        addField(new Double(fCreditTotal), fieldSize, 7, Types.DOUBLE, false);
        jTextArea.append(sbRow.toString());
        jTextArea.append(newline);
        processingAccount = (Integer) db.getObject("Amount.Account", null);
        fCreditTotal=0;
        fDebitTotal=0;
      }

    } while (bIsNewPost);
View Full Code Here

          startNum=rs.getInt("id")+1;
        }
        st.close();
      }catch(Exception e){
      }
      UniqNumGenerator a = new UniqNumGenerator();
      accountTypeAccess.setObject(
          new Integer(a.GetUniqueNumber("AccTypeId", startNum, 999999999,
          (Integer) cc.comboBox.getSelectedItemsKey())), "AccTypeId");
    } else {
      getCustomerId(i++);
    }
    accountTypeAccess.setObject(textField2.getText(), "TypeName");
View Full Code Here

  /**
   *  Description of the Method
   */
  public void AfterGoodDelete() {
    super.AfterGoodDelete();
    EditBus.send(new AccountListChanged(this, "no parameters"));
  }//}}}
View Full Code Here

TOP

Related Classes of nu.lazy8.ledger.jdbc.DataComboBox

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.