lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [6394] Regularize idioms to distinguish new business from


From: Greg Chicares
Subject: [lmi-commits] [6394] Regularize idioms to distinguish new business from inforce
Date: Sat, 07 Nov 2015 13:44:27 +0000

Revision: 6394
          http://svn.sv.gnu.org/viewvc/?view=rev&root=lmi&revision=6394
Author:   chicares
Date:     2015-11-07 13:44:27 +0000 (Sat, 07 Nov 2015)
Log Message:
-----------
Regularize idioms to distinguish new business from inforce

Modified Paths:
--------------
    lmi/trunk/ihs_acctval.cpp
    lmi/trunk/ihs_avstrtgy.cpp
    lmi/trunk/ihs_server7702.cpp
    lmi/trunk/ledger_invariant.cpp

Modified: lmi/trunk/ihs_acctval.cpp
===================================================================
--- lmi/trunk/ihs_acctval.cpp   2015-11-07 13:42:46 UTC (rev 6393)
+++ lmi/trunk/ihs_acctval.cpp   2015-11-07 13:44:27 UTC (rev 6394)
@@ -484,10 +484,7 @@
     InvariantValues().InforceMonth = yare_input_.InforceMonth;
 
     bool inforce_is_mec =
-           (
-              0 != yare_input_.InforceYear
-           || 0 != yare_input_.InforceMonth
-           )
+           yare_input_.EffectiveDate != yare_input_.InforceAsOfDate
         && yare_input_.InforceIsMec
         ;
     InvariantValues().InforceIsMec = inforce_is_mec;
@@ -506,7 +503,7 @@
         }
     std::vector<double> pmts_7702a;
     std::vector<double> bfts_7702a;
-    if(0 == InforceYear && 0 == InforceMonth)
+    if(yare_input_.EffectiveDate == yare_input_.InforceAsOfDate)
         {
         // No need to initialize 'pmts_7702a' in this case.
         bfts_7702a.push_back
@@ -529,7 +526,7 @@
         bfts_7702a = std::vector<double>(length_7702a, 
yare_input_.InforceLeastDeathBenefit);
         }
     double lowest_death_benefit = yare_input_.InforceLeastDeathBenefit;
-    if(0 == InforceYear && 0 == InforceMonth)
+    if(yare_input_.EffectiveDate == yare_input_.InforceAsOfDate)
         {
         lowest_death_benefit = bfts_7702a.front(); // TAXATION !! See 
above--use input LDB instead.
         }

Modified: lmi/trunk/ihs_avstrtgy.cpp
===================================================================
--- lmi/trunk/ihs_avstrtgy.cpp  2015-11-07 13:42:46 UTC (rev 6393)
+++ lmi/trunk/ihs_avstrtgy.cpp  2015-11-07 13:44:27 UTC (rev 6394)
@@ -156,7 +156,7 @@
         DeathBfts_->set_specamt(round_specamt()(std::max(m, z)), j, 1 + j);
         if
             (  j == InforceYear
-            && !(0 == InforceYear && 0 == InforceMonth)
+            && yare_input_.EffectiveDate != yare_input_.InforceAsOfDate
             && mce_sa_input_scalar == strategy
             && inforce_specamt < m
             && !Solving

Modified: lmi/trunk/ihs_server7702.cpp
===================================================================
--- lmi/trunk/ihs_server7702.cpp        2015-11-07 13:42:46 UTC (rev 6393)
+++ lmi/trunk/ihs_server7702.cpp        2015-11-07 13:44:27 UTC (rev 6394)
@@ -223,8 +223,7 @@
             );
         }
 
-    // Casual, but strictly correct for all testdeck cases:
-    IsIssuedToday = 0 == Input.InforceYear;
+    IsIssuedToday = Input.EffectiveDate == Input.InforceAsOfDate;
 
     IsPossibleAdjustableEvent =
 // TODO ?? Why treat a taxable withdrawal as an adjustment event?
@@ -268,6 +267,7 @@
 {
     bool okay =
             Input.InforceYear               == 0
+        &&  Input.EffectiveDate             == Input.InforceAsOfDate
         &&  Input.InforceGlp                == 0.0
         &&  Input.InforceGsp                == 0.0
         &&  Input.OldGender                 == Input.NewGender

Modified: lmi/trunk/ledger_invariant.cpp
===================================================================
--- lmi/trunk/ledger_invariant.cpp      2015-11-07 13:42:46 UTC (rev 6393)
+++ lmi/trunk/ledger_invariant.cpp      2015-11-07 13:44:27 UTC (rev 6394)
@@ -859,9 +859,16 @@
         ,mce_annual_rate
         )[0];
 
-    // Dubious--see:
-    //   http://lists.nongnu.org/archive/html/lmi/2015-09/msg00017.html
-    IsInforce = 0 != b->yare_input_.InforceYear || 0 != 
b->yare_input_.InforceMonth;
+    IsInforce = b->yare_input_.EffectiveDate != b->yare_input_.InforceAsOfDate;
+    // This test is probably redundant, but it is difficult to prove
+    // that it is actually redundant and will always remain so.
+    if(IsInforce && (0 == b->yare_input_.InforceYear && 0 == 
b->yare_input_.InforceMonth))
+        {
+        fatal_error()
+            << "Inforce illustrations not permitted during month of issue."
+            << LMI_FLUSH
+            ;
+        }
 
     SupplementalReport         = b->yare_input_.CreateSupplementalReport;
     SupplementalReportColumn00 = 
mc_str(b->yare_input_.SupplementalReportColumn00);




reply via email to

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