34 periodQuantity = quantity;
36 QL_FAIL(
"Invalid period quantity/pricing period combination.");
39 for (
Date periodStartDate=startDate; periodStartDate<endDate; ) {
40 Date periodEndDate = (periodStartDate + (1 *
Months)) - 1;
42 pricingPeriods.push_back(ext::make_shared<PricingPeriod>(
43 periodStartDate, periodEndDate,
44 paymentDate, periodQuantity));
45 periodStartDate = periodEndDate + 1;
49 "Invalid period quantity/pricing period combination.");
51 for (
Date periodStartDate=startDate; periodStartDate<endDate; ) {
52 Date periodEndDate = (periodStartDate + (1 *
Months)) - 1;
55 quantity * (periodEndDate - periodStartDate);
57 pricingPeriods.push_back(ext::make_shared<PricingPeriod>(
58 periodStartDate, periodEndDate,
59 paymentDate, periodQuantity));
60 periodStartDate = periodEndDate + 1;
static void createPricingPeriods(Date startDate, Date endDate, const Quantity &quantity, EnergyCommodity::DeliverySchedule deliverySchedule, EnergyCommodity::QuantityPeriodicity qtyPeriodicity, const PaymentTerm &paymentTerm, PricingPeriods &pricingPeriods)
Date getPaymentDate(const Date &date) const
Commodity pricing helpers.
#define QL_REQUIRE(condition, message)
throw an error if the given pre-condition is not verified
#define QL_FAIL(message)
throw an error (possibly with file and line information)
std::vector< ext::shared_ptr< PricingPeriod > > PricingPeriods