lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] master 12f58cd 10/15: Simplify single-premium condit


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 12f58cd 10/15: Simplify single-premium conditionals
Date: Tue, 27 Aug 2019 13:50:19 -0400 (EDT)

branch: master
commit 12f58cdd3f0c15b4d6e24df9ed9ef3fa08463ffc
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>

    Simplify single-premium conditionals
    
    Replaced four booleans with these two:
     - {{SinglePremium}} (whether "Modified" or not), and
     - {{ModifiedSinglePremium}} ("Modified" only).
    Each product has its own '.policy' and '.database' files, which already
    embody all its parameters. The old XSL-FO logic attempted to deduce some
    parameters by parsing 'PolicyLegalName', but that approach was fragile,
    difficult to understand, and unnecessarily complicated: in effect, it
    did something like this in an lmi C++ file:
      add_variable("product_deduced_to_be_sample2_naic", complex_code);
    and this in an MST file:
      {{#product_deduced_to_be_sample2_naic}}
        Special-case string value.
      {{/product_deduced_to_be_sample2_naic}}
      {{^product_deduced_to_be_sample2_naic}}
        {{SomeStringVariable}}
      {{/product_deduced_to_be_sample2_naic}}
    whereas the proper approach is to make the variable vary by product,
    e.g., in 'sample2_naic.policy':
      <SomeStringVariable>Special-case string value.</SomeStringVariable>
    A product's database is always consulted, and that lookup constitutes
    a switch on product already: replicating that switch in MST templates
    was a grave mistake.
---
 ill_reg_column_headings.mst |  8 ++++----
 ill_reg_narr_summary.mst    |  8 ++++----
 pdf_command_wx.cpp          | 12 ------------
 3 files changed, 8 insertions(+), 20 deletions(-)

diff --git a/ill_reg_column_headings.mst b/ill_reg_column_headings.mst
index 036e54a..eb69feb 100644
--- a/ill_reg_column_headings.mst
+++ b/ill_reg_column_headings.mst
@@ -125,12 +125,12 @@ to income tax and may also trigger a tax penalty.
 {{/IsInforce}}
 {{MinDeathBenefitFootnote}}
 <!-- Single Premium Logic -->
-{{#ModifiedSinglePremiumOrModifiedSinglePremium0}}
+{{#ModifiedSinglePremium}}
 <p>
 <b>Modified Single Premium:</b>
 {{SinglePremiumFootnote}}
 </p>
-{{/ModifiedSinglePremiumOrModifiedSinglePremium0}}
+{{/ModifiedSinglePremium}}
 <p>
 <b>Monthly Charges:</b>
 The monthly charges for the following month which include:
@@ -159,12 +159,12 @@ minimum defined in your {{ContractName}}.
 </p>
 <!-- Single Premium Logic -->
 {{#SinglePremium}}
-{{^ModifiedSinglePremiumOrModifiedSinglePremium0}}
+{{^ModifiedSinglePremium}}
 <p>
 <b>Single Premium:</b>
 {{SinglePremiumFootnote}}
 </p>
-{{/ModifiedSinglePremiumOrModifiedSinglePremium0}}
+{{/ModifiedSinglePremium}}
 {{/SinglePremium}}
 
 {{UltCreditingRateFootnote}}
diff --git a/ill_reg_narr_summary.mst b/ill_reg_narr_summary.mst
index 87fe7d2..2e09c70 100644
--- a/ill_reg_narr_summary.mst
+++ b/ill_reg_narr_summary.mst
@@ -56,18 +56,18 @@ Even more surprisingly, 'AllowExperienceRating' has the 
same effect.
     and flexible premiums.
 {{/SinglePremium}}
 {{#SinglePremium}}
-    {{#ModifiedSinglePremiumOrModifiedSinglePremium0}}
+    {{#ModifiedSinglePremium}}
         {{PolicyMktgName}}
         is a modified single premium adjustable life
         insurance {{ContractName}}. It features accumulating
         account values, adjustable benefits, and single premium.
-    {{/ModifiedSinglePremiumOrModifiedSinglePremium0}}
-    {{^ModifiedSinglePremiumOrModifiedSinglePremium0}}
+    {{/ModifiedSinglePremium}}
+    {{^ModifiedSinglePremium}}
         {{PolicyMktgName}}
         is a single premium adjustable life insurance {{ContractName}}.
         It features accumulating account values,
         adjustable benefits, and single premium.
-    {{/ModifiedSinglePremiumOrModifiedSinglePremium0}}
+    {{/ModifiedSinglePremium}}
 {{/SinglePremium}}
 </p>
 
diff --git a/pdf_command_wx.cpp b/pdf_command_wx.cpp
index 286b247..8680a30 100644
--- a/pdf_command_wx.cpp
+++ b/pdf_command_wx.cpp
@@ -2217,7 +2217,6 @@ class pdf_illustration_naic : public pdf_illustration
         :pdf_illustration{ledger, pdf_out_file}
     {
         auto const& invar = ledger.GetLedgerInvariant();
-        auto const& policy_name = invar.PolicyLegalName;
         auto const& state_of_jurisdiction = invar.StateOfJurisdiction;
 
         // Define variables specific to this illustration.
@@ -2236,17 +2235,6 @@ class pdf_illustration_naic : public pdf_illustration
             ,oe_modified_single_premium == invar.IsSinglePremium
             );
 
-        add_variable
-            ("ModifiedSinglePremium0"
-            ,starts_with(policy_name, "Modified")
-            );
-
-        add_variable
-            ("ModifiedSinglePremiumOrModifiedSinglePremium0"
-            , test_variable("ModifiedSinglePremium")
-            ||test_variable("ModifiedSinglePremium0")
-            );
-
         // Variable representing the premium payment frequency with the
         // appropriate indefinite article preceding it, e.g. "an annual"
         // or "a monthly".



reply via email to

[Prev in Thread] Current Thread [Next in Thread]