Package com.wesabe.api.util.money

Examples of com.wesabe.api.util.money.Money


  @Override
  public Money getAmount() throws UnknownCurrencyCodeException {
    if (amount == null) {
      return txaction.getAmount();
    }
    return new Money(amount, txaction.getAccount().getCurrency());
  }
View Full Code Here


    result.addProperty("uri", String.format("/accounts/%d", account.getRelativeId()));
    result.addProperty("type", account.getAccountType().toString());
    result.addProperty("currency", account.getCurrency().getCurrencyCode());
    result.addProperty("status", account.getStatus().toString().toLowerCase(Locale.US));
    if (account.hasBalance()) {
      final Money balance = account.getBalance();
      result.add(moneyPresenter.present("balance", balance, locale));
      result.addProperty("last-balance-at", ISO_DATETIME.print(account.getLastActivityDate()));
    }
    FinancialInst financialInst = account.getFinancialInst();
    if (financialInst != null) {
View Full Code Here

   * (non-Javadoc)
   * @see com.wesabe.api.accounts.entities.Monetary#getAmount()
   */
  @Override
  public Money getAmount() throws UnknownCurrencyCodeException {
    return new Money(amount, account.getCurrency());
  }
View Full Code Here

  public List<TaggedAmount> getTaggedAmounts() {
    return taggedAmounts;
  }

  public Money getAmountByFilteringTags(Set<Tag> filteredTags) {
    final Money txactionAmount = getAmount().abs();
    Money filteredAmount = new Money(BigDecimal.ZERO, account.getCurrency());
    for (TaggedAmount taggedAmount : taggedAmounts) {
      if (filteredTags.contains(taggedAmount.getTag())) {
        filteredAmount = filteredAmount.add(taggedAmount.getAmount().abs());
      }
    }
   
    if (txactionAmount.compareTo(filteredAmount) <= 0) {
      return new Money(BigDecimal.ZERO, account.getCurrency());
    }
    return txactionAmount.subtract(filteredAmount).multiply(getAmount().signum());
  }
View Full Code Here

    return uploadId;
  }

  public Money getAvailableCash() {
    if (availableCash != null) {
      return new Money(availableCash, account.getCurrency());
    } else {
      return null;
    }
  }
View Full Code Here

    }
  }

  public Money getMarginBalance() {
    if (marginBalance != null) {
      return new Money(marginBalance, account.getCurrency());
    } else {
      return null;
    }
  }
View Full Code Here

    }
  }

  public Money getShortBalance() {
    if (shortBalance != null) {
      return new Money(shortBalance, account.getCurrency());
    } else {
      return null;
    }
  }
View Full Code Here

    }
  }

  public Money getBuyingPower() {
    if (buyingPower != null) {
      return new Money(buyingPower, account.getCurrency());
    } else {
      return null;
    }
  }
View Full Code Here

  public int getId() {
    return id;
  }

  public Money getBalance() {
    return new Money(balance, account.getCurrency());
  }
View Full Code Here

  public BigDecimal getUnits() {
    return units;
  }

  public Money getUnitPrice() {
    return new Money(unitPrice, account.getCurrency());
  }
View Full Code Here

TOP

Related Classes of com.wesabe.api.util.money.Money

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.