Package nu.lazy8.ledger.jdbc

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


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

  }//}}}

  //{{{ +AfterGoodChange() : void
  public void AfterGoodChange() {
    super.AfterGoodChange();
    EditBus.send(new AccountListChanged(this, "no parameters"));
    wasWriteOk = true;
    if (parent != null && bIsAddOnly) {
      parent.setVisible(false);
    }
  }//}}}
View Full Code Here

  /**
   *  Description of the Method
   */
  public void AfterGoodWrite() {
    super.AfterGoodWrite();
    EditBus.send(new AccountListChanged(this, "no parameters"));
    wasWriteOk = true;
    if (parent != null && bIsAddOnly) {
      parent.setVisible(false);
    }
  }//}}}
View Full Code Here

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

  }//}}}

  //{{{ +AfterGoodChange() : void
  public void AfterGoodChange() {
    super.AfterGoodChange();
    EditBus.send(new AccountTypeListChanged(this, "no parameters"));
  }//}}}
View Full Code Here

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

        }
      }
    }
    EditBus.send(new CompanyListChanged(null, "no parameters"));
    EditBus.send(new CustomerListChanged(null, "no parameters"));
    EditBus.send(new AccountTypeListChanged(null, "no parameters"));
  }//}}}
View Full Code Here

      st.executeUpdate(dcc.filterSQL("DELETE FROM AccountType WHERE CompId=" + companyId));
      if (deleteCompanyDef) {
        st = dcc.con.createStatement();
        st.executeUpdate(dcc.filterSQL("DELETE FROM Company WHERE CompId=" + companyId));
      }
      EditBus.send(new CompanyListChanged(null, "no parameters"));
    } catch (Exception e) {
      Log.log(Log.DEBUG, null, "Error in RemoveCompanyFromDatabase= " + e);
    }
  }//}}}
View Full Code Here

   */
  public void AfterGoodDelete() {
    //just make sure everything is gone.  Call function that deletes everything
    DeleteCompany.RemoveCompanyFromDatabase(textField1.getInteger().intValue(), view, false);
    super.AfterGoodDelete();
    EditBus.send(new CompanyListChanged(this, "no parameters"));
  }//}}}
View Full Code Here

TOP

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

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.