Examples of Payee


Examples of net.sourceforge.wampum.finance.entities.Payee

    public void setPayee(Payee payee) {
        this.payee = payee;
    }

    public void setPayeePayeeID(String payeeID) {
        Payee payee = new Payee();
        payee.setPayeeID(payeeID);
        this.payee = payee;
    }
View Full Code Here

Examples of net.sourceforge.wampum.finance.entities.Payee

                    transaction.setDatePosted(datePostedCalendar);
                }
                if (resultSet.wasNull())
                    transaction.setDatePosted(null);

                Payee payee = new Payee();
                payee.setName(resultSet.getString("NAME"));
                transaction.setPayee(payee);

                List transSplitList = new ArrayList();
                TransSplit transSplit = new TransSplit();
                transSplit.setAmount(new Double(resultSet.getDouble("AMOUNT")));
View Full Code Here

Examples of net.sourceforge.wampum.finance.entities.Payee

      amount.setText(GUIConstants.CURRENCY_FORMAT.format(newAmount));
      updateSplitTableData();
    }
    else {
      if (payee.getSelectedItem() instanceof Payee) {
        Payee tempPayee = (Payee)payee.getSelectedItem();
        if (trans.getPayee() != null && trans.getPayeePayeeID().equals(tempPayee.getPayeeID()))
          return;
        Transaction payeeTrans = PayeeUtils.findLastTransactionForPayee(tempPayee, this.account.getAccountID());
        trans = new Transaction();
        trans.setPayee(tempPayee);
        trans.setDatePosted(Calendar.getInstance());
View Full Code Here

Examples of net.sourceforge.wampum.finance.entities.Payee

     
      try {
        factory.beginTransaction();
        if (trans == null) {
          trans = new Transaction();
          Payee payee = PayeeUtils.findPayee(this.name, true);
          trans.setPayee(payee);
          trans.setDatePosted(datePosted);
       
          Transaction payeeTrans = PayeeUtils.findLastTransactionForPayee(payee, this.accountID);
          if (payeeTrans != null) {
            List transSplitList = payeeTrans.getTransSplitList();
            TransSplit transSplit = null;
            TransSplit newSplit = null;
            double oldTotal = 0;
            for (int i=0; i<transSplitList.size(); i++) {
              transSplit = (TransSplit)transSplitList.get(i);
              if (transSplit.getAmount().doubleValue() >= 0)
                oldTotal += transSplit.getAmount().doubleValue();
            }
         
            for (int i=0; i<transSplitList.size(); i++) {
              transSplit = (TransSplit)transSplitList.get(i);
              newSplit = new TransSplit();
              newSplit.setParentTransaction(trans);
              newSplit.setAccount(transSplit.getAccount());
              double splitAmount = Math.abs((transSplit.getAmount().doubleValue()/oldTotal)*amount);
              if (newSplit.getAccountAccountID().equals(accountID)) {
                if (amount >= 0) {
                  newSplit.setAmount(new Double(splitAmount));
                }
                else {
                  newSplit.setAmount(new Double(-splitAmount));
                }
              }
              else {
                if (amount >= 0) {
                  newSplit.setAmount(new Double(-splitAmount));
                }
                else {
                  newSplit.setAmount(new Double(splitAmount));
                }
              }
              trans.appendTransSplit(newSplit);
            }
          }
          else {
            RegisterDAO registerDAO = (RegisterDAO)factory.getDAO("register");
            List payeeTransList = registerDAO.loadTransactionsForAccountPayeeDate(this.accountID, payee.getPayeeID(), trans.getDatePosted());
            if (payeeTransList.size()>0) {
              boolean createTrans = false;
              Transaction tempTrans = null;
              for (int i=0; i<payeeTransList.size(); i++) {
                tempTrans = (Transaction)payeeTransList.get(i);
View Full Code Here

Examples of net.sourceforge.wampum.finance.entities.Payee

      DAOFactory daoFactory = new DAOFactory();
      PayeeDAO payeeDao = (PayeeDAO)daoFactory.getDAO("payee");
     
      String textLine = null;
      String[] payeeStr = null;
      Payee payee = null;
      while ((textLine = in.readLine()) != null) {
        payeeStr = textLine.split(",");
        payee = new Payee();
        payee.setName(payeeStr[0]);
        payee.setFilters(payeeStr[1]);
        payeeDao.create(payee, false);
      }
      daoFactory.commit();
    }
    catch (Exception ex) {
View Full Code Here

Examples of net.sourceforge.wampum.finance.entities.Payee

          System.out.println("Transaction found!");
        }
     
        if (trans == null) {
          trans = new Transaction();
          Payee payee = PayeeUtils.findPayee(this.name, true);
          trans.setPayee(payee);
          trans.setDatePosted(datePosted);
          trans.setFitID(fitID);
       
          Transaction payeeTrans = PayeeUtils.findLastTransactionForPayee(payee, this.accountID);
View Full Code Here

Examples of net.sourceforge.wampum.finance.entities.Payee

      TransactionDAO transactionDAO = (TransactionDAO)daoFactory.getDAO("transaction");
      try {
        //System.out.println("Transaction: " + currentTransaction.getTransactionID());
        String where = "where TRANSACTION_ID = '" + currentTransaction.getTransactionID() + "'";
        if (transactionDAO.load(where, null, true).size() == 0) {
          Payee payee = PayeeUtils.findPayee(currentTransaction.getDescription(), true);
          currentTransaction.setPayee(payee);
          transactionDAO.create(currentTransaction, false);
          if (this.eventListener != null)
            this.eventListener.GNUCashEvent(new GNUCashEvent("Transaction: " + currentTransaction.getDescription() +
                " Payee:" + payee.getName()));
        }
        else {
          Payee payee = PayeeUtils.findPayee(currentTransaction.getDescription(), true);
          currentTransaction.setPayee(payee);
          transactionDAO.update(currentTransaction, false);
        }
       
        // create transaction splits
View Full Code Here

Examples of net.sourceforge.wampum.finance.entities.Payee

  protected JButton mergeButton;
  protected JComboBox mergePayee;
 
  public PayeesController(JPanel contentPanel) {
    this.contentPanel = contentPanel;
    this.currentPayee = new Payee();
    initGUI();
  }
View Full Code Here

Examples of net.sourceforge.wampum.finance.entities.Payee

      buildPayeesTree();
      buildPayeeDropDown();
      checkButtonStatus();
    }
    else if ("clearButton".equals(e.getActionCommand())) {
        currentPayee = new Payee();
        name.setText(currentPayee.getName());
        filters.setText(currentPayee.getFilters());
        updateRegisterTableData();
        checkButtonStatus();
    }
    else if ("deleteButton".equals(e.getActionCommand())) {
      DAOFactory daoFactory = new DAOFactory();
      PayeeDAO payeeDao = (PayeeDAO)daoFactory.getDAO("payee");
      currentPayee.setActive(new Boolean(false));
      payeeDao.delete(currentPayee);
     
        currentPayee = new Payee();
        name.setText(currentPayee.getName());
        filters.setText(currentPayee.getFilters());
        updateRegisterTableData();
        buildPayeesTree();
        buildPayeeDropDown();
        checkButtonStatus();
    }
    else if ("mergeButton".equals(e.getActionCommand())) {
      Payee payee = (Payee)mergePayee.getSelectedItem();
      PayeeUtils.mergePayees(payee, currentPayee);
      buildPayeesTree();
      buildPayeeDropDown();
     
        currentPayee = payee;
View Full Code Here

Examples of net.sourceforge.wampum.finance.entities.Payee

  private static List payeeList = null;
 
  public static Payee findPayee(String name, boolean create) {
    if (name == null)
      throw new RuntimeException("Payee name is null!");
    Payee payee = null;
    if (payeeList == null) {
      DAOFactory daoFactory = new DAOFactory();
      PayeeDAO payeeDao = (PayeeDAO)daoFactory.getDAO("payee");
      payeeList = payeeDao.load(null, null, true);
    }
   
    boolean found = false;
    int count = 0;
    Payee currentPayee = null;
    while (!found && count<payeeList.size()) {
      currentPayee = (Payee)payeeList.get(count);
      if (name.equalsIgnoreCase(currentPayee.getName()) ||
          (currentPayee.getFilters() != null &&
          Pattern.matches(currentPayee.getFilters(), name))) {
        found = true;
        payee = currentPayee;
      }
      count++;
    }
   
    if (!found) {
      payee = new Payee();
      payee.setName(name);
     
      DAOFactory daoFactory = new DAOFactory();
      PayeeDAO payeeDao = (PayeeDAO)daoFactory.getDAO("payee");
      payeeDao.create(payee, false);
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.