[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 8e61062 2/5: Fix an off-by-one error
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 8e61062 2/5: Fix an off-by-one error |
Date: |
Fri, 31 Aug 2018 19:59:47 -0400 (EDT) |
branch: master
commit 8e61062b414cc35be9dbb72e16f3e9fc95f140de
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>
Fix an off-by-one error
Certain products have a crediting rate that increases annually, reaching
an "ultimate" value in the sixth year that doesn't change thereafter:
v0, v1, v2, v3, v4, v5...v5
1st 2nd 3rd 4th 5th 6th 6th
Along with the current year's rate, the ultimate rate is to be printed
whenever it differs from current. The old XSL template confusingly
expressed that condition as
InforceYear <= 4
i.e., we haven't reached the sixth year if the zero-based index is less
than or equal to four; [0,4] is more naturally expressed as [0,5). Then
the difference between "<=" and '<' was lost in translation to
add_variable("InforceYearLE4", inforce_year < 4)
which has now been replaced by
add_variable("InforceYearLT5", inforce_year < 5)
Eventually this product-specific logic should be abstracted into the
product database: it never belonged in presentation code.
---
ill_reg_header.mst | 4 ++--
ledger_pdf_generator_wx.cpp | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/ill_reg_header.mst b/ill_reg_header.mst
index d97b2de..e78d2f2 100644
--- a/ill_reg_header.mst
+++ b/ill_reg_header.mst
@@ -98,7 +98,7 @@
<br>
{{#SinglePremium}}
- {{#InforceYearLE4}}
+ {{#InforceYearLT5}}
Ultimate Illustrated Crediting Rate:
{{#ModifiedSinglePremium0}}
{{AnnGAIntRate_Current[11]}}
@@ -107,7 +107,7 @@
{{AnnGAIntRate_Current[6]}}
{{/ModifiedSinglePremium0}}
<br>
- {{/InforceYearLE4}}
+ {{/InforceYearLT5}}
{{/SinglePremium}}
{{^Composite}}
diff --git a/ledger_pdf_generator_wx.cpp b/ledger_pdf_generator_wx.cpp
index 84f432e..7620235 100644
--- a/ledger_pdf_generator_wx.cpp
+++ b/ledger_pdf_generator_wx.cpp
@@ -2082,8 +2082,8 @@ class pdf_illustration_regular : public pdf_illustration
);
add_variable
- ("InforceYearLE4"
- ,inforce_year < 4
+ ("InforceYearLT5"
+ ,inforce_year < 5
);
auto const max_duration = invar.EndtAge - invar.Age;