Пример #1
0
  /**
   * @see
   *     org.kuali.kfs.module.endow.document.service.CurrentTaxLotService#getCurrentTaxLotBalanceSecurityUnitValue(String)
   *     Method to get the security unit value for the current balance tax lot record
   * @param securityId
   * @return securityUnitValue
   */
  public BigDecimal getCurrentTaxLotBalanceSecurityUnitValue(String securityId) {
    BigDecimal securityUnitValue = BigDecimal.ZERO;

    Security security = securityService.getByPrimaryKey(securityId);

    return security.getUnitValue();
  }
Пример #2
0
  /**
   * @see
   *     org.kuali.kfs.module.endow.document.service.CurrentTaxLotService#getHoldingMarketValue(HoldingTaxLot,
   *     String)
   */
  public BigDecimal getHoldingMarketValue(HoldingTaxLot holdingTaxLot, String securityId) {
    BigDecimal holdingMarketValue = BigDecimal.ZERO;

    Security security = securityService.getByPrimaryKey(securityId);

    String classCodeType = security.getClassCode().getClassCodeType();

    if (EndowConstants.ClassCodeTypes.ALTERNATIVE_INVESTMENT.equalsIgnoreCase(classCodeType)) {
      String kemid = holdingTaxLot.getKemid();
      if (dataDictionaryService.getAttributeForceUppercase(
          TransactionArchive.class, EndowPropertyConstants.TRANSACTION_ARCHIVE_KEM_ID)) {
        kemid = kemid.toUpperCase();
      }
      BigDecimal totalCashActivity =
          transactionArchiveDao.getTransactionArchivesTotalCashActivity(kemid, securityId);
      return (security.getSecurityValueByMarket().subtract(totalCashActivity));
    }
    // calculations for BONDS
    if (EndowConstants.ClassCodeTypes.BOND.equalsIgnoreCase(classCodeType)) {
      holdingMarketValue =
          KEMCalculationRoundingHelper.multiply(
              holdingTaxLot.getUnits(),
              security.getUnitValue(),
              EndowConstants.Scale.SECURITY_MARKET_VALUE);
      holdingMarketValue =
          KEMCalculationRoundingHelper.divide(
              holdingMarketValue,
              BigDecimal.valueOf(100),
              EndowConstants.Scale.SECURITY_MARKET_VALUE);
      return holdingMarketValue;
    }

    // other cases...
    holdingMarketValue =
        KEMCalculationRoundingHelper.multiply(
            holdingTaxLot.getUnits(),
            security.getUnitValue(),
            EndowConstants.Scale.SECURITY_MARKET_VALUE);

    return holdingMarketValue;
  }