Examples of UniqNumGenerator


Examples of nu.lazy8.ledger.jdbc.UniqNumGenerator

          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

Examples of nu.lazy8.ledger.jdbc.UniqNumGenerator

    report1.setProperty("startdatetext", Translator.getTranslation("Start date"));
    report1.setProperty("stopdatetext", Translator.getTranslation("Stop date"));
    report1.setProperty("company", compName);
    report1.setProperty("companytext", Translator.getTranslation("Company"));
    report1.setProperty("LastTransactionNumberText", Translator.getTranslation("Last transaction number"));
    int iActId = (new UniqNumGenerator()).ViewNextAvailableNumber("Act_Id", 1, 999999999, new Integer(compId));
    if (iActId>0)iActId-=1;
    report1.setProperty("LastTransactionNumber", IntegerField.ConvertIntToLocalizedString(new Integer(iActId)));
    // add an image as a report property...
    if (imagePath.length() != 0) {
      try {
View Full Code Here

Examples of nu.lazy8.ledger.jdbc.UniqNumGenerator

      }
      Log.log(Log.DEBUG, this, "writeIB Start");
      java.sql.Date todaysDate = new java.sql.Date(Calendar.getInstance().getTime().getTime());
      java.sql.Date headerDate = todaysDate;
      double balanceSum = 0;
      int actId = new UniqNumGenerator().GetUniqueNumber("Act_Id", 1, 999999999, new Integer(compId));

      //write the Amounts
      for (int i = 0; i < list.size(); i++) {
        //these wont balance. Make them balance!!!!!
        Object[] row = (Object[]) list.get(i);
View Full Code Here

Examples of nu.lazy8.ledger.jdbc.UniqNumGenerator

          Object[] row = (Object[]) list.get(i);
//Log.log(Log.DEBUG,this,"writeSaldos date="+(java.sql.Date)row[YearDefinition.REGISTERDATE]);
          if (startCal.getTime().compareTo((java.sql.Date) row[YearDefinition.REGISTERDATE]) <= 0
               && stopCal.getTime().compareTo((java.sql.Date) row[YearDefinition.REGISTERDATE]) > 0) {
            if (!foundPeriod) {
              actId = (new UniqNumGenerator()).GetUniqueNumber("Act_Id", 1, 999999999, new Integer(compId));
              foundPeriod = true;
            }
            printedMonth = (java.sql.Date) row[YearDefinition.REGISTERDATE];
            double amount = ((Double) row[YearDefinition.AMOUNT]).doubleValue();
            int custId = ((Integer) row[YearDefinition.CUSTOMER]).intValue();
View Full Code Here

Examples of nu.lazy8.ledger.jdbc.UniqNumGenerator

        return;
      }
      java.sql.Date todaysDate = new java.sql.Date(Calendar.getInstance().getTime().getTime());
      java.sql.Date headerDate = todaysDate;
      double balanceSum = 0;
      int actId = new UniqNumGenerator().GetUniqueNumber("Act_Id", 1, 999999999, new Integer(compId));
      //write the Amounts
      for (int i = 0; i < uB.size(); i++) {
        //everything in one big transaction
        Object[] row = (Object[]) uB.get(i);
        double amount = ((Double) row[YearDefinition.AMOUNT]).doubleValue();
View Full Code Here

Examples of nu.lazy8.ledger.jdbc.UniqNumGenerator

    fileInfoTextField.setText("");
    lableTransaction.setText("");
    //lets put the next available number in the lableTransaction..
    Integer compId = (Integer) cc.comboBox.getSelectedItemsKey();
    Integer iActId = IntegerField.ConvertLocalizedStringToInt(lableTransaction.getText());
    UniqNumGenerator a = new UniqNumGenerator();
    String UniqKey="Act_Id";
    if (SetupInfo.getBoolProperty(SetupInfo.SHOW_PERIOD_ID))
      UniqKey="PeriodId="+ (Date) cc.comboBoxPeriod.getSelectedItemsKey() + "-"
        +(Date) cc.comboBoxPeriod.getSelectedItemsSecondaryKey();
    iActId = new Integer(a.ViewNextAvailableNumber(UniqKey, 1, 999999999, compId));
    lableTransaction.setText(IntegerField.ConvertIntToLocalizedString(iActId));
    clearTable();
    TotalDebitAndCredit();
    SetSelectionFirstNoEdit();
    //repaints whole table
View Full Code Here

Examples of nu.lazy8.ledger.jdbc.UniqNumGenerator

  private void getWholeList(int ii, int iWhyGet) {
    Integer compId = (Integer) cc.comboBox.getSelectedItemsKey();
    Integer iActId =iLastActId;
    Integer iPeriodId =iLastPeriodId;
    if (iWhyGet == DataMovementPane.ADD) {
      UniqNumGenerator a = new UniqNumGenerator();
      iActId = new Integer(a.GetUniqueNumber("Act_Id", 1, 999999999, compId));
      getAndAddAmounts(iActId, compId);
      iPeriodId = new Integer(a.GetUniqueNumber("PeriodId="
        + (Date) cc.comboBoxPeriod.getSelectedItemsKey() + "-"
        + (Date) cc.comboBoxPeriod.getSelectedItemsSecondaryKey(), 1, 999999999, compId));
      if (SetupInfo.getBoolProperty(SetupInfo.SHOW_PERIOD_ID))
        lableTransaction.setText(IntegerField.ConvertIntToLocalizedString(iPeriodId));
      else
View Full Code Here

Examples of nu.lazy8.ledger.jdbc.UniqNumGenerator

      Log.log(Log.DEBUG, this, "doExport CompName =" + CompName);
      ResultSet rsCompany = st.executeQuery(dc.filterSQL(select));
      while(rsCompany.next()) {
        CompId=rsCompany.getInt(1);
        bufOut.write("  <company code=\"" + rsCompany.getInt(1) + "\" name=\"" + XmlEncode(rsCompany.getString(2)) +
          "\" lastAbsTransNum=\"" + (new UniqNumGenerator()).GetUniqueNumber("Act_Id", 1, 999999999, CompId) + "\" >");
        bufOut.newLine();  
        select="SELECT APP.Account.Account, AccDesc,AccTypeId, TypeName, SortOrder, IsInBalanceReport " +
          " FROM AccountType JOIN Account ON AccountType.AccTypeId=APP.Account.IsAsset WHERE " +
          " AccountType.CompId=" + CompId + " AND APP.Account.CompId=" + CompId +
          " ORDER BY AccTypeId,APP.Account.Account";
View Full Code Here

Examples of nu.lazy8.ledger.jdbc.UniqNumGenerator

      }
      //get rid of all uniq num posts for period ids
      dc.con.createStatement().executeQuery(dc.filterSQL(
        "DELETE FROM UniqNum WHERE UniqName LIKE 'PeriodId=%'"));
      //adjust the periodid for each activity
      UniqNumGenerator uniqnum = new UniqNumGenerator();
      ResultSet rsPeriods=null;
      String select="SELECT CompId,Act_id,InvDate FROM Activity2 ";
      if (inCompId>0)
        select+=" WHERE CompId=" + inCompId;
      select+=" ORDER BY CompId,Act_id";
      ResultSet rsOldTrans = dc.con.createStatement().executeQuery(dc.filterSQL(select));
      int lastCompId=-1;
      rsOldTrans.last();
      int numRecs=rsOldTrans.getRow();
      rsOldTrans.beforeFirst();
      while (rsOldTrans.next()) {
        if (lastCompId!=rsOldTrans.getInt(1)){
          //get all the periods for the CompId
          lastCompId=rsOldTrans.getInt(1);
          rsPeriods=dc.con.createStatement().executeQuery(dc.filterSQL(
            "SELECT StartPeriod,EndPeriod FROM AccountingPeriods WHERE CompId=" + lastCompId));
        }
        Date invoiceDate=rsOldTrans.getDate(3);
        int periodId=0;
        rsPeriods.beforeFirst();
        //find the appropriate period if it exists.
        while (rsPeriods.next()) {
          if (invoiceDate.compareTo(rsPeriods.getDate(1))>=0 && invoiceDate.compareTo(rsPeriods.getDate(2))<=0){
            //increment period id counter
            periodId=uniqnum.GetUniqueNumber("PeriodId="+ rsPeriods.getDate(1) + "-"
              + rsPeriods.getDate(2), 1, 999999999,new Integer(lastCompId));
            break; //we found the period we need
          }
        }
        dc.con.createStatement().executeQuery(dc.filterSQL(
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.