lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [6556] Change group-quote columns


From: Greg Chicares
Subject: [lmi-commits] [6556] Change group-quote columns
Date: Wed, 04 May 2016 14:59:49 +0000

Revision: 6556
          http://svn.sv.gnu.org/viewvc/?view=rev&root=lmi&revision=6556
Author:   chicares
Date:     2016-05-04 14:59:49 +0000 (Wed, 04 May 2016)
Log Message:
-----------
Change group-quote columns

Modified Paths:
--------------
    lmi/trunk/ChangeLog
    lmi/trunk/account_value.hpp
    lmi/trunk/group_quote_pdf_gen_wx.cpp
    lmi/trunk/ihs_acctval.cpp
    lmi/trunk/ledger_invariant.cpp
    lmi/trunk/ledger_invariant.hpp
    lmi/trunk/ledger_xml_io.cpp

Modified: lmi/trunk/ChangeLog
===================================================================
--- lmi/trunk/ChangeLog 2016-05-04 14:48:33 UTC (rev 6555)
+++ lmi/trunk/ChangeLog 2016-05-04 14:59:49 UTC (rev 6556)
@@ -38934,3 +38934,32 @@
   product_data.hpp
 Add new product-data fields for group quotes.
 
+20160503T2246Z <address@hidden> [451]
+
+  ihs_acctval.cpp
+Treat 'ModalMinimumPremium' as paid by er where not paid by ee.
+
+20160504T1050Z <address@hidden> [451]
+
+  ihs_acctval.cpp
+  ledger_invariant.cpp
+  ledger_invariant.hpp
+  ledger_text_formats.cpp
+  ledger_xml_io.cpp
+Add required dumpin and various other data to group roster.
+
+20160504T1448Z <address@hidden> [451]
+
+  group_quote_pdf_gen_wx.cpp
+Refactor to ease maintenance.
+
+20160504T1459Z <address@hidden> [451]
+
+  account_value.hpp
+  group_quote_pdf_gen_wx.cpp
+  ihs_acctval.cpp
+  ledger_invariant.cpp
+  ledger_invariant.hpp
+  ledger_xml_io.cpp
+Change group-quote columns.
+

Modified: lmi/trunk/account_value.hpp
===================================================================
--- lmi/trunk/account_value.hpp 2016-05-04 14:48:33 UTC (rev 6555)
+++ lmi/trunk/account_value.hpp 2016-05-04 14:59:49 UTC (rev 6556)
@@ -291,18 +291,6 @@
     double MinInitDumpin() const;
     double MinInitPrem() const;
     double ModalMinInitPremShortfall() const;
-    double SuppositiveModalPremium
-        (bool        with_adb
-        ,bool        with_wp
-        ) const;
-    double SuppositiveModalPremium
-        (int         year
-        ,mcenum_mode mode
-        ,double      specamt
-        ,double      termamt
-        ,bool        with_adb
-        ,bool        with_wp
-        ) const;
 
     void   SetMaxLoan              ();
     void   SetMaxWD                ();

Modified: lmi/trunk/group_quote_pdf_gen_wx.cpp
===================================================================
--- lmi/trunk/group_quote_pdf_gen_wx.cpp        2016-05-04 14:48:33 UTC (rev 
6555)
+++ lmi/trunk/group_quote_pdf_gen_wx.cpp        2016-05-04 14:59:49 UTC (rev 
6556)
@@ -437,16 +437,16 @@
     ,e_col_name
     ,e_col_age
     ,e_col_dob
-    ,e_col_salary
-    ,e_col_face_amount
-    ,e_col_premium
-    ,e_col_premium_with_waiver
-    ,e_col_premium_with_adb
-    ,e_col_premium_with_waiver_and_adb
+    ,e_col_basic_face_amount
+    ,e_col_basic_premium
+    ,e_col_supplemental_face_amount
+    ,e_col_additional_premium
+    ,e_col_total_face_amount
+    ,e_col_total_premium
     ,e_col_max
     };
 
-enum_group_quote_columns const e_first_totalled_column = e_col_face_amount;
+enum_group_quote_columns const e_first_totalled_column = 
e_col_basic_face_amount;
 
 struct column_definition
 {
@@ -454,19 +454,20 @@
     char const* widest_text_; // Empty string means variable width.
 };
 
+// Headers of premium columns include dynamically-determined payment
+// mode, so they're actually format strings.
+
 column_definition const column_definitions[] =
-    {{"Part#"                          ,            "99999"   }
-    ,{"Participant"                    ,                 ""   }
-    ,{"Issue Age"                      ,              "999"   }
-    ,{"Date of Birth"                  ,       "9999-99-99"   }
-    ,{"Income"                         ,     "$999,999,999"   }
-    ,{"Face Amount"                    , "$999,999,999,999"   }
-    // All the subsequent columns use dynamically determined "premium mode" in
-    // their title, so their labels are actually format strings.
-    ,{"%s\nPremium"                    ,   "$9,999,999,999.00"}
-    ,{"%s\nPremium with\nWaiver"       ,   "$9,999,999,999.00"}
-    ,{"%s\nPremium with\nADB"          ,   "$9,999,999,999.00"}
-    ,{"%s\nPremium with\nWaiver &\nADB",   "$9,999,999,999.00"}
+    {{"Part#"                          ,            "99999"   } // e_col_number
+    ,{"Participant"                    ,                 ""   } // e_col_name
+    ,{"Issue Age"                      ,              "999"   } // e_col_age
+    ,{"Date of Birth"                  ,       "9999-99-99"   } // e_col_dob
+    ,{"Basic\nFace Amount"             , "$999,999,999,999"   } // 
e_col_basic_face_amount
+    ,{"Basic\n%s\nPremium"             ,   "$9,999,999,999.00"} // 
e_col_basic_premium
+    ,{"Supplemental\nFace Amount"      , "$999,999,999,999"   } // 
e_col_supplemental_face_amount
+    ,{"Additional\n%s\nPremium"        ,   "$9,999,999,999.00"} // 
e_col_additional_premium
+    ,{"Total\nFace Amount"             , "$999,999,999,999"   } // 
e_col_total_face_amount
+    ,{"Total\n%s\nPremium"             ,   "$9,999,999,999.00"} // 
e_col_total_premium
     };
 
 BOOST_STATIC_ASSERT(sizeof column_definitions / sizeof(column_definitions[0]) 
== e_col_max);
@@ -740,38 +741,39 @@
                     ).FormatDate();
                 }
                 break;
-            case e_col_salary:
+            case e_col_basic_face_amount:
                 {
-                // Blank if zero.
-                if(0.0 != invar.Salary.at(year))
+                double const z = invar.SpecAmt.at(year);
+                rd.values[col] = '$' + ledger_format(z, f0);
+                if(is_composite)
                     {
-                    rd.values[col] = '$' + 
ledger_format(invar.Salary.at(year), f0);
+                    totals_.total(col, z);
                     }
                 }
                 break;
-            case e_col_face_amount:
+            case e_col_basic_premium:
                 {
-                double const z = invar.SpecAmt.at(year) + 
invar.TermSpecAmt.at(year);
-                rd.values[col] = '$' + ledger_format(z, f0);
+                double const z = invar.ErModalMinimumPremium.at(year);
+                rd.values[col] = '$' + ledger_format(z, f2);
                 if(is_composite)
                     {
                     totals_.total(col, z);
                     }
                 }
                 break;
-            case e_col_premium:
+            case e_col_supplemental_face_amount:
                 {
-                double const z = invar.InitModalPrem00;
-                rd.values[col] = '$' + ledger_format(z, f2);
+                double const z = invar.TermSpecAmt.at(year);
+                rd.values[col] = '$' + ledger_format(z, f0);
                 if(is_composite)
                     {
                     totals_.total(col, z);
                     }
                 }
                 break;
-            case e_col_premium_with_waiver:
+            case e_col_additional_premium:
                 {
-                double const z = invar.InitModalPrem01;
+                double const z = invar.EeModalMinimumPremium.at(year) + 
invar.InitMinDumpin;
                 rd.values[col] = '$' + ledger_format(z, f2);
                 if(is_composite)
                     {
@@ -779,19 +781,19 @@
                     }
                 }
                 break;
-            case e_col_premium_with_adb:
+            case e_col_total_face_amount:
                 {
-                double const z = invar.InitModalPrem10;
-                rd.values[col] = '$' + ledger_format(z, f2);
+                double const z = invar.SpecAmt.at(year) + 
invar.TermSpecAmt.at(year);
+                rd.values[col] = '$' + ledger_format(z, f0);
                 if(is_composite)
                     {
                     totals_.total(col, z);
                     }
                 }
                 break;
-            case e_col_premium_with_waiver_and_adb:
+            case e_col_total_premium:
                 {
-                double const z = invar.InitModalPrem11;
+                double const z = invar.ModalMinimumPremium.at(year) + 
invar.InitMinDumpin;
                 rd.values[col] = '$' + ledger_format(z, f2);
                 if(is_composite)
                     {
@@ -891,19 +893,18 @@
             case e_col_name:
             case e_col_age:
             case e_col_dob:
-            case e_col_salary:
-            case e_col_face_amount:
-                // Nothing to do for these columns, their labels are literal.
+            case e_col_basic_face_amount:
+            case e_col_supplemental_face_amount:
+            case e_col_total_face_amount:
+                // Nothing to do for these columns: their labels are literal.
                 break;
-            case e_col_premium:
-            case e_col_premium_with_waiver:
-            case e_col_premium_with_adb:
-            case e_col_premium_with_waiver_and_adb:
+            case e_col_basic_premium:
+            case e_col_additional_premium:
+            case e_col_total_premium:
                 {
                 // Labels of these columns are format strings as they need to
                 // be constructed dynamically.
                 LMI_ASSERT(header.find("%s") != std::string::npos);
-
                 header = wxString::Format
                     (wxString(header), report_data_.premium_mode_
                     ).ToStdString();
@@ -1251,11 +1252,12 @@
     for(int col = e_first_totalled_column; col < e_col_max; ++col)
         {
         int const num_dec =
-            ((e_col_face_amount                 == col) ? 0
-            :(e_col_premium                     == col) ? 2
-            :(e_col_premium_with_waiver         == col) ? 2
-            :(e_col_premium_with_adb            == col) ? 2
-            :(e_col_premium_with_waiver_and_adb == col) ? 2
+            ((e_col_basic_face_amount           == col) ? 0
+            :(e_col_basic_premium               == col) ? 2
+            :(e_col_supplemental_face_amount    == col) ? 0
+            :(e_col_additional_premium          == col) ? 2
+            :(e_col_total_face_amount           == col) ? 0
+            :(e_col_total_premium               == col) ? 2
             :throw std::logic_error("Invalid column type.")
             );
         std::pair<int, oenum_format_style> const f(num_dec, oe_format_normal);

Modified: lmi/trunk/ihs_acctval.cpp
===================================================================
--- lmi/trunk/ihs_acctval.cpp   2016-05-04 14:48:33 UTC (rev 6555)
+++ lmi/trunk/ihs_acctval.cpp   2016-05-04 14:59:49 UTC (rev 6556)
@@ -1048,24 +1048,6 @@
         InvariantValues().InitMinPrem   = MinInitPrem();
         }
 
-    // Calculate special initial premiums for premium-quote PDF only.
-    // Four premiums are calculated, for base and "supplemental"
-    // coverage combined:
-    //   without riders; with ADB only; with WP only; with ADB and WP
-    // All reflect MinInitDumpin() (which may be zero).
-    //
-    // This is intended for presale use only; for inforce cells, these
-    // premiums retain their default initial values of zero. There
-    // seems to be no compelling argument for further restrictions
-    // such as (DB_MinPremType == oe_monthly_deduction).
-    if(0 == Year)
-        {
-        InvariantValues().InitModalPrem00 = SuppositiveModalPremium(0, 0);
-        InvariantValues().InitModalPrem01 = SuppositiveModalPremium(0, 1);
-        InvariantValues().InitModalPrem10 = SuppositiveModalPremium(1, 0);
-        InvariantValues().InitModalPrem11 = SuppositiveModalPremium(1, 1);
-        }
-
     SurrChgSpecAmt = InvariantValues().SpecAmt[0];
     HOPEFULLY(0.0 <= SurrChgSpecAmt);
     // TODO ?? SurrChgSpecAmt is not used yet.
@@ -1169,90 +1151,6 @@
         }
 }
 
-double AccountValue::SuppositiveModalPremium
-    (bool        with_adb
-    ,bool        with_wp
-    ) const
-{
-    LMI_ASSERT(0 == Year);
-    return SuppositiveModalPremium
-        (Year
-        ,InvariantValues().ErMode[Year].value()
-        ,InvariantValues().SpecAmt[Year]
-        ,InvariantValues().TermSpecAmt[Year]
-        ,with_adb
-        ,with_wp
-        );
-}
-
-/// Determine modal premium on a basis possibly differing from input.
-///
-/// Motivation: to provide premiums with and without certain riders,
-/// for use with group premium quotes.
-///
-/// For now at least, only that narrow purpose is addressed. If, for
-/// that purpose, input is inappropriate, then output may be as well.
-/// For example, this function doesn't ascertain whether the riders it
-/// toggles are available for the product selected. Other riders are
-/// not inhibited here: all input is taken as deliberate, as an end
-/// user might reasonably wish to show the effect of other riders; if
-/// assertions as to input are to be made at all, then they should be
-/// made in the function that creates the group premium quote report.
-///
-/// Consistent with that purpose, deem the modal minimum premium to be
-/// the planned premium, and add modalized MinInitDumpin() for custom
-/// MinInitPremType #1. As a consequence, illustrations may differ
-/// from group premium quotes: for example, an illustration with a
-/// sufficiently large 1035 rollover requires no additional payment,
-/// but a group premium quote generated from the same input file
-/// ignores the 1035 exchange and always reflects MinInitDumpin().
-
-double AccountValue::SuppositiveModalPremium
-    (int         year
-    ,mcenum_mode mode
-    ,double      specamt
-    ,double      termamt
-    ,bool        with_adb
-    ,bool        with_wp
-    ) const
-{
-    LMI_ASSERT(0 == Year);
-
-    yare_input yi(yare_input_);
-
-    yi.AccidentalDeathBenefit = with_adb;
-    yi.WaiverOfPremiumBenefit = with_wp;
-
-    double z;
-    if(!SplitMinPrem)
-        {
-        z = GetModalPremMlyDed(year, mode, specamt, yi);
-        }
-    else
-        {
-        z =
-              GetModalPremMlyDedEe(year, mode, termamt, yi)
-            + GetModalPremMlyDedEr(year, mode, specamt, yi)
-            ;
-        }
-
-    // If minimum premiums are of the 'oe_monthly_deduction' type,
-    // then the initial modal minimum premium previously calculated
-    // must equal the "suppositive" result for the same rider choices.
-    if
-        (  oe_monthly_deduction == MinPremType
-        && yi.AccidentalDeathBenefit == yare_input_.AccidentalDeathBenefit
-        && yi.WaiverOfPremiumBenefit == yare_input_.WaiverOfPremiumBenefit
-        )
-        {
-        LMI_ASSERT(z == InvariantValues().ModalMinimumPremium[0]);
-        }
-
-    // The quotient needn't be rounded because MinInitDumpin() is a
-    // multiple of twelve.
-    return z + MinInitDumpin() / mode;
-}
-
 //============================================================================
 void AccountValue::AddSurrChgLayer(int year, double delta_specamt)
 {

Modified: lmi/trunk/ledger_invariant.cpp
===================================================================
--- lmi/trunk/ledger_invariant.cpp      2016-05-04 14:48:33 UTC (rev 6555)
+++ lmi/trunk/ledger_invariant.cpp      2016-05-04 14:59:49 UTC (rev 6556)
@@ -140,10 +140,6 @@
     ScalableScalars ["InitTgtPrem"           ] = &InitTgtPrem            ;
     ScalableScalars ["InitMinPrem"           ] = &InitMinPrem            ;
     ScalableScalars ["InitMinDumpin"         ] = &InitMinDumpin          ;
-    ScalableScalars ["InitModalPrem00"       ] = &InitModalPrem00        ;
-    ScalableScalars ["InitModalPrem01"       ] = &InitModalPrem01        ;
-    ScalableScalars ["InitModalPrem10"       ] = &InitModalPrem10        ;
-    ScalableScalars ["InitModalPrem11"       ] = &InitModalPrem11        ;
     ScalableScalars ["Dumpin"                ] = &Dumpin                 ;
     ScalableScalars ["External1035Amount"    ] = &External1035Amount     ;
     ScalableScalars ["Internal1035Amount"    ] = &Internal1035Amount     ;
@@ -613,10 +609,6 @@
 //  InitTgtPrem             =
 //  InitMinPrem             =
 //  InitMinDumpin           =
-    InitModalPrem00         = 0.0;
-    InitModalPrem01         = 0.0;
-    InitModalPrem10         = 0.0;
-    InitModalPrem11         = 0.0;
 
     MaleProportion          = b->yare_input_.MaleProportion;
     NonsmokerProportion     = b->yare_input_.NonsmokerProportion;

Modified: lmi/trunk/ledger_invariant.hpp
===================================================================
--- lmi/trunk/ledger_invariant.hpp      2016-05-04 14:48:33 UTC (rev 6555)
+++ lmi/trunk/ledger_invariant.hpp      2016-05-04 14:59:49 UTC (rev 6556)
@@ -153,10 +153,6 @@
     double          InitTgtPrem;
     double          InitMinPrem;
     double          InitMinDumpin;
-    double          InitModalPrem00;
-    double          InitModalPrem01;
-    double          InitModalPrem10;
-    double          InitModalPrem11;
     double          Dumpin;
     double          External1035Amount;
     double          Internal1035Amount;

Modified: lmi/trunk/ledger_xml_io.cpp
===================================================================
--- lmi/trunk/ledger_xml_io.cpp 2016-05-04 14:48:33 UTC (rev 6555)
+++ lmi/trunk/ledger_xml_io.cpp 2016-05-04 14:59:49 UTC (rev 6556)
@@ -103,10 +103,6 @@
         {"DateOfBirthJdn"        // used by group quotes
         ,"EffDateJdn"            // used by group quotes
         ,"InitDacTaxRate"        // used by PrintRosterTabDelimited(); not 
cents
-        ,"InitModalPrem00"       // group quotes only
-        ,"InitModalPrem01"       // group quotes only
-        ,"InitModalPrem10"       // group quotes only
-        ,"InitModalPrem11"       // group quotes only
         ,"InitPremTaxRate"       // used by PrintRosterTabDelimited(); not 
cents
         ,"SubstdTable"           // probably not needed
         ,"InitMlyPolFee"         // used by PrintRosterTabDelimited()




reply via email to

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