lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master f0b9cea 113/156: Add "Assumption Detail" page


From: Greg Chicares
Subject: [lmi-commits] [lmi] master f0b9cea 113/156: Add "Assumption Detail" page to NASD illustrations
Date: Tue, 30 Jan 2018 17:22:24 -0500 (EST)

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

    Add "Assumption Detail" page to NASD illustrations
    
    This is relatively straightforward but did require the creation of
    "InitAnnLoanDueRate" pseudo-vector in the previous commit.
    
    An alternative approach would be to somehow mark the name of this
    variable (e.g. with a leading "=" sign to indicate that is constant
    across all rows) and handle such variables specially in the code of
    page_with_tabular_report::render().
---
 ledger_pdf_generator_wx.cpp     | 72 +++++++++++++++++++++++++++++++++++++++++
 nasd_assumption_detail.mustache | 12 +++++++
 2 files changed, 84 insertions(+)

diff --git a/ledger_pdf_generator_wx.cpp b/ledger_pdf_generator_wx.cpp
index a33a470..a54e8d5 100644
--- a/ledger_pdf_generator_wx.cpp
+++ b/ledger_pdf_generator_wx.cpp
@@ -2214,6 +2214,77 @@ class nasd_supplemental : public page_with_tabular_report
     }
 };
 
+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
+        ,column_m_and_e
+        ,column_ee_payment_mode
+        ,column_er_payment_mode
+        ,column_assumed_loan_interest
+        ,column_max
+        };
+
+    std::string get_fixed_page_contents() const override
+    {
+        return "{{>nasd_assumption_detail}}";
+    }
+
+    illustration_table_columns const& get_table_columns() const override
+    {
+        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%" }
+            ,{ "CurrMandE"           , "M&E"                         ,     
"99.99%" }
+            ,{ "EeMode"              , "Indiv\nPmt Mode"             , 
"Semiannual" }
+            ,{ "ErMode"              , "Corp\nPmt Mode"              , 
"Semiannual" }
+            ,{ "InitAnnLoanDueRate"  , "Assumed\nLoan Interest"      ,     
"99.99%" }
+            };
+
+        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;
+    }
+};
+
 // NASD illustration.
 class pdf_illustration_nasd : public pdf_illustration
 {
@@ -2265,6 +2336,7 @@ 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>();
     }
 
     std::string get_upper_footer_template_name() const override
diff --git a/nasd_assumption_detail.mustache b/nasd_assumption_detail.mustache
new file mode 100644
index 0000000..ccc3965
--- /dev/null
+++ b/nasd_assumption_detail.mustache
@@ -0,0 +1,12 @@
+{{>nasd_header_upper}}
+    <p align="center">
+    Illustration Assumption Detail
+    </p>
+    <br></br>
+    <br></br>
+{{>nasd_header_lower}}
+
+<br></br>
+<br></br>
+
+{{! Illustration assumption detail table is created from C++ code }}



reply via email to

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