Examples of Coupon


Examples of com.jada.jpa.entity.Coupon

          shoppingCartItem.setItem(item);
        }
        iterator = shoppingCartCoupons.iterator();
        while (iterator.hasNext()) {
          ShoppingCartCoupon shoppingCartCoupon = (ShoppingCartCoupon) iterator.next();
          Coupon coupon = (Coupon) em.find(Coupon.class, shoppingCartCoupon.getCoupon().getCouponId());
          shoppingCartCoupon.setCoupon(coupon);
        }
 
        requestId = ContentLookupDispatchAction.getRequestId(request);
 
View Full Code Here

Examples of com.jada.jpa.entity.Coupon

            "order by couponId";
    Query query = em.createQuery(sql);
    query.setParameter("siteId", contentSessionKey.getSiteId());
    iterator = query.getResultList().iterator();
    while (iterator.hasNext()) {
      Coupon coupon = (Coupon) iterator.next();
      ShoppingCartCoupon scCoupon = new ShoppingCartCoupon();
      scCoupon.setCoupon(coupon);
      coupons.add(scCoupon);
    }
    // Ensure coupons are applied in the sequence of priority
View Full Code Here

Examples of com.jada.jpa.entity.Coupon

    }
    return discountTotal;
  }
 
  public void postProcess() throws CouponNotApplicableException, Exception {
    Coupon coupon = shoppingCartCoupon.getCoupon();
    if (String.valueOf(coupon.getCouponScope()).equals(Constants.COUPONSCOPE_ORDER)) {
      applyDiscountToOrder(shoppingCartCoupon.getCouponAmount());
    }
  }
View Full Code Here

Examples of com.jada.jpa.entity.Coupon

    }
    return discountTotal;
  }
 
  public void postProcess() throws CouponNotApplicableException, Exception {
    Coupon coupon = shoppingCartCoupon.getCoupon();
    if (String.valueOf(coupon.getCouponScope()).equals(Constants.COUPONSCOPE_ORDER)) {
      applyDiscountToOrder(shoppingCartCoupon.getCouponAmount());
    }
  }
View Full Code Here

Examples of com.jada.jpa.entity.Coupon

  }

  public boolean isDirty(Coupon value) {
    Iterator<?> iterator = coupons.iterator();
    while (iterator.hasNext()) {
      Coupon coupon = (Coupon) iterator.next();
      if (coupon.equals(value)) {
        return true;
      }
    }
    return false;
  }
View Full Code Here

Examples of com.jada.jpa.entity.Coupon

      saveMessages(request, messages);
            ActionForward actionForward = actionMapping.findForward("error");
            return actionForward;
      }
     
        Coupon coupon = CouponDAO.loadByCouponCode(site.getSiteId(), couponCode);
        if (coupon == null) {
        this.initAddressInfo(form, site, shoppingCart, request, messages);
          this.initCartInfo(form, site, shoppingCart, request, messages);
        messages.add("couponCode", new ActionMessage("content.error.coupon.invalid"));
      saveMessages(request, messages);
View Full Code Here

Examples of com.jada.jpa.entity.Coupon

    }
    return discountTotal;
  }
 
  public void postProcess() throws CouponNotApplicableException, Exception {
    Coupon coupon = shoppingCartCoupon.getCoupon();
    if (String.valueOf(coupon.getCouponScope()).equals(Constants.COUPONSCOPE_ORDER)) {
      applyDiscountToOrder(shoppingCartCoupon.getCouponAmount());
    }
  }
View Full Code Here

Examples of com.opengamma.analytics.financial.interestrate.payments.derivative.Coupon

  }

  @Test
  public void toDerivativesNoData() {
    final ZonedDateTime pricingDate = DateUtils.getUTCDate(2011, 7, 29);
    final Coupon yearOnYearCouponConverted = YoY_COUPON_DEFINITION.toDerivative(pricingDate);
    final double paymentTime = ACT_ACT.getDayCountFraction(pricingDate, PAYMENT_DATE);
    final double referenceStartTime = ACT_ACT.getDayCountFraction(pricingDate, REFERENCE_START_DATE);
    final double referenceEndTime = ACT_ACT.getDayCountFraction(pricingDate, REFERENCE_END_DATE);
    final double naturalPaymentStartPaymentTime = ACT_ACT.getDayCountFraction(pricingDate, ACCRUAL_START_DATE);
    final double naturalPaymentEndPaymentTime = ACT_ACT.getDayCountFraction(pricingDate, ACCRUAL_END_DATE);
View Full Code Here

Examples of com.opengamma.analytics.financial.interestrate.payments.derivative.Coupon

    final ZonedDateTime pricingDate = DateUtils.getUTCDate(2011, 7, 29);
    final DoubleTimeSeries<ZonedDateTime> priceIndexTS = ImmutableZonedDateTimeDoubleTimeSeries.ofUTC(new ZonedDateTime[] {DateUtils.getUTCDate(2017, 4, 30),
      DateUtils.getUTCDate(2017, 5, 31), DateUtils.getUTCDate(2018, 4, 30), DateUtils.getUTCDate(2018, 5, 31) },
        new double[] {
          127.23, 127.43, 128.23, 128.43 });
    final Coupon yearOnYearCouponConverted = YoY_COUPON_DEFINITION.toDerivative(pricingDate, priceIndexTS);
    final double paymentTime = ACT_ACT.getDayCountFraction(pricingDate, PAYMENT_DATE);
    final double referenceStartTime = ACT_ACT.getDayCountFraction(pricingDate, REFERENCE_START_DATE);
    final double referenceEndTime = ACT_ACT.getDayCountFraction(pricingDate, REFERENCE_END_DATE);
    final double naturalPaymentStartPaymentTime = ACT_ACT.getDayCountFraction(pricingDate, ACCRUAL_START_DATE);
    final double naturalPaymentEndPaymentTime = ACT_ACT.getDayCountFraction(pricingDate, ACCRUAL_END_DATE);
View Full Code Here

Examples of com.opengamma.analytics.financial.interestrate.payments.derivative.Coupon

    final ZonedDateTime pricingDate = DateUtils.getUTCDate(2018, 7, 25);
    final DoubleTimeSeries<ZonedDateTime> priceIndexTS = ImmutableZonedDateTimeDoubleTimeSeries.ofUTC(new ZonedDateTime[] {DateUtils.getUTCDate(2017, 5, 31),
      DateUtils.getUTCDate(2017, 6, 30), DateUtils.getUTCDate(2018, 5, 31), DateUtils.getUTCDate(2018, 6, 30) },
        new double[] {
          127.23, 127.43, 128.23, 128.43 });
    final Coupon zeroCouponConverted = YoY_COUPON_DEFINITION.toDerivative(pricingDate, priceIndexTS);
    final double paymentTime = ACT_ACT.getDayCountFraction(pricingDate, PAYMENT_DATE);
    final CouponFixed zeroCoupon = new CouponFixed(CUR, paymentTime, 1.0, NOTIONAL, 128.23 / 127.23 - 1.0);
    assertEquals("Inflation zero-coupon: toDerivative", zeroCoupon, zeroCouponConverted);
  }
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.