Skip to content

Commit 89b22a1

Browse files
pcaspersjenkins
authored andcommitted
QPR-12569 adjust pay date if calendar and convention are given
1 parent 359e417 commit 89b22a1

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

OREData/ored/portfolio/legdata.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -942,7 +942,9 @@ Leg makeSimpleLeg(const LegData& data) {
942942
Leg leg;
943943
for (Size i = 0; i < dates.size(); i++) {
944944
Date d = parseDate(dates[i]);
945-
leg.push_back(QuantLib::ext::shared_ptr<CashFlow>(new SimpleCashFlow(amounts[i], d)));
945+
if (!data.paymentCalendar().empty() && !data.paymentConvention().empty())
946+
d = parseCalendar(data.paymentCalendar()).adjust(d, parseBusinessDayConvention(data.paymentConvention()));
947+
leg.push_back(QuantLib::ext::make_shared<SimpleCashFlow>(amounts[i], d));
946948
}
947949
return leg;
948950
}

0 commit comments

Comments
 (0)