lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master 1272ce2 127/156: Don't include "Assumptions"


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 1272ce2 127/156: Don't include "Assumptions" page in composite NASD illustrations
Date: Tue, 30 Jan 2018 17:22:30 -0500 (EST)

branch: master
commit 1272ce2e4a0232d8c7e36ccf277025d05269be20
Author: Vadim Zeitlin <address@hidden>
Commit: Vadim Zeitlin <address@hidden>

    Don't include "Assumptions" page in composite NASD illustrations
    
    This page isn't useful for composites, so don't show it at all.
    
    This allows to simplify nasd_assumption_detail class implementation and
    remove the columns which were only shown for composite ledgers, as they
    wouldn't be ever shown at all anyhow now.
---
 ledger_pdf_generator_wx.cpp | 41 +++++++----------------------------------
 1 file changed, 7 insertions(+), 34 deletions(-)

diff --git a/ledger_pdf_generator_wx.cpp b/ledger_pdf_generator_wx.cpp
index 0d172cf..6c9e460 100644
--- a/ledger_pdf_generator_wx.cpp
+++ b/ledger_pdf_generator_wx.cpp
@@ -2279,8 +2279,6 @@ class nasd_assumption_detail : public 
page_with_tabular_report
   private:
     enum
         {column_policy_year
-        ,column_withdrawal
-        ,column_loan
         ,column_end_of_year_age
         ,column_sep_acct_crediting_rate
         ,column_gen_acct_crediting_rate
@@ -2300,8 +2298,6 @@ class nasd_assumption_detail : public 
page_with_tabular_report
     {
         static illustration_table_columns const columns =
             {{ "PolicyYear"          , "Policy\nYear"                ,        
"999" }
-            ,{ "NetWD"               , "Withdrawal"                  ,    
"999,999" }
-            ,{ "NewCashLoan"         , "Loan"                        ,    
"999,999" }
             ,{ "AttainedAge"         , "End of\nYear Age"            ,        
"999" }
             ,{ "AnnSAIntRate_Current", "Sep Acct Net\nInv Rate"      ,     
"99.99%" }
             ,{ "AnnGAIntRate_Current", "Gen Acct\nCurrent Rate"      ,     
"99.99%" }
@@ -2314,35 +2310,9 @@ class nasd_assumption_detail : public 
page_with_tabular_report
         return columns;
     }
 
-    bool should_show_column(Ledger const& ledger, int column) const override
-    {
-        // This table looks very differently for individual and composite
-        // illustrations.
-        switch(column)
-            {
-            case column_withdrawal:
-            case column_loan:
-                // Shown only for composite illustrations.
-                return ledger.is_composite();
-
-            case column_end_of_year_age:
-            case column_sep_acct_crediting_rate:
-            case column_gen_acct_crediting_rate:
-            case column_m_and_e:
-            case column_ee_payment_mode:
-            case column_er_payment_mode:
-            case column_assumed_loan_interest:
-                // Shown only for individual ones.
-                return !ledger.is_composite();
-
-            case column_policy_year:
-            case column_max:
-                // Always shown.
-                break;
-            }
-
-        return true;
-    }
+    // Notice that there is no need to override should_show_column() in this
+    // class as this page is not included in composite illustrations and hence
+    // all of its columns, including the "AttainedAge" one, are always shown.
 };
 
 // NASD illustration.
@@ -2393,7 +2363,10 @@ class pdf_illustration_nasd : public pdf_illustration
         add<standard_page>("nasd_column_headings");
         add<standard_page>("nasd_notes1");
         add<standard_page>("nasd_notes2");
-        add<nasd_assumption_detail>();
+        if(!ledger.is_composite())
+            {
+            add<nasd_assumption_detail>();
+            }
     }
 
     std::string get_upper_footer_template_name() const override



reply via email to

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