Package org.internna.ossmoney.model

Examples of org.internna.ossmoney.model.Payee


  protected Double getDouble(String line) throws ParseException {
    return nFormat.parse(line).doubleValue();
  }

  protected Payee getOrCreatePayee(Register register, Account account) {
    Payee payee = Payee.findByName(register.getPayee());
    if (payee == null) {
      payee = new Payee();
      payee.setName(register.getPayee());
      payee.setOwner(account.getOwner());
      payee.persist();
      payee.flush();
    }
    return payee;
  }
View Full Code Here


    createPayee(user, name);
  }

  @Override public void createPayee(UserDetails owner, String name) {
    if (hasText(name) && (owner != null)) {
      Payee payee = new Payee();
      payee.setName(name);
      payee.setOwner(owner);
      payee.persist();
      owner.getPayees().add(payee);
      owner.merge();
    }
  }
View Full Code Here

        transferMoney(user, originAccount, targetAccount, operationDate, amount, chargeAmount, rate, memo);
    }

    protected void transferMoney(UserDetails user, Account origin, Account target, Date operationDate, BigDecimal amount, BigDecimal chargeAmount, double rate, String memo) {
        if (isValidTransfer(user, origin, target, operationDate, amount)) {
            Payee payee = Payee.findMySelf(user);
            Subcategory transferCategory = Subcategory.findBySubcategory("category.transfer.out", user);
            Subcategory transferInCategory = Subcategory.findBySubcategory("category.transfer.in", user);
            AccountTransaction send = AccountTransaction.createInstance(origin, payee, transferCategory, calculateAmount(amount), operationDate, memo);
            AccountTransaction receive = AccountTransaction.createInstance(target, payee, transferInCategory, calculateTargetAmount(amount, rate), operationDate, memo);
            receive.setOriginOfTheFunds(origin.getName());
View Full Code Here

TOP

Related Classes of org.internna.ossmoney.model.Payee

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.