lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master 4250de9 104/156: Add first variant of NASD su


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 4250de9 104/156: Add first variant of NASD supplemental page
Date: Tue, 30 Jan 2018 17:22:22 -0500 (EST)

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

    Add first variant of NASD supplemental page
    
    Still missing the "split premiums" variant implementation.
---
 ledger_pdf_generator_wx.cpp | 70 +++++++++++++++++++++++++++++++++++++++++++++
 nasd_supplemental.mustache  |  8 ++++++
 2 files changed, 78 insertions(+)

diff --git a/ledger_pdf_generator_wx.cpp b/ledger_pdf_generator_wx.cpp
index e7f1ab3..5a5a6d6 100644
--- a/ledger_pdf_generator_wx.cpp
+++ b/ledger_pdf_generator_wx.cpp
@@ -2111,6 +2111,75 @@ class nasd_basic : public page_with_tabular_report
     }
 };
 
+class nasd_supplemental : public page_with_tabular_report
+{
+  private:
+    enum
+        {column_policy_year
+        ,column_end_of_year_age
+        ,column_premium_outlay
+        ,column_admin_charge
+        ,column_premium_tax_load
+        ,column_dac_tax_load
+        ,column_net_premium
+        ,column_cost_of_insurance_charges
+        ,column_cur_account_value
+        ,column_cur_cash_surr_value
+        ,column_cur_death_benefit
+        ,column_max
+        };
+
+    illustration_table_columns const& get_table_columns() const override
+    {
+        static illustration_table_columns const columns =
+            {{ "PolicyYear"          ,  "Policy\nYear"                ,       
"999" }
+            ,{ "AttainedAge"         ,  "End of\nYear Age"            ,       
"999" }
+            ,{ "GrossPmt"            ,  "Premium\nOutlay"             ,   
"999,999" }
+            ,{ "PolicyFee_Current"   ,  "Admin\nCharge"               ,   
"999,999" }
+            ,{ "PremTaxLoad_Current" ,  "Premium\nTax Load"           ,   
"999,999" }
+            ,{ "DacTaxLoad_Current"  ,  "DAC\nTax Load"               ,   
"999,999" }
+            ,{ "NetPmt_Current"      ,  "Net\nPremium"                ,   
"999,999" }
+            ,{ "COICharge_Current"   ,  "Cost of\nInsurance\nCharges" ,   
"999,999" }
+            ,{ "AcctVal_Current"     ,  "Current\nAccount\nValue"     ,   
"999,999" }
+            ,{ "CSVNet_Current"      ,  "Current\nCash Surr\nValue"   ,   
"999,999" }
+            ,{ "EOYDeathBft_Current" ,  "Current\nDeath\nBenefit"     , 
"9,999,999" }
+            };
+
+        return columns;
+    }
+
+    bool should_show_column(Ledger const& ledger, int column) const override
+    {
+        // One column should be hidden for composite ledgers.
+        return column != column_end_of_year_age || !ledger.is_composite();
+    }
+
+    int render_or_measure_fixed_page_part
+        (illustration_table_generator&  table
+        ,pdf_writer_wx&                 writer
+        ,html_interpolator const&       interpolate_html
+        ,enum_output_mode               output_mode
+        ) const override
+    {
+        int pos_y = writer.get_vert_margin();
+
+        pos_y += writer.output_html
+            (writer.get_horz_margin()
+            ,pos_y
+            ,writer.get_page_width()
+            ,interpolate_html("{{>nasd_supplemental}}")
+            ,output_mode
+            );
+
+        table.output_header(&pos_y, output_mode);
+
+        pos_y += table.get_separator_line_height();
+        table.output_horz_separator(0, column_max, pos_y, output_mode);
+
+        return pos_y;
+    }
+};
+
 // NASD illustration.
 class pdf_illustration_nasd : public pdf_illustration
 {
@@ -2152,6 +2221,7 @@ class pdf_illustration_nasd : public pdf_illustration
         // Add all the pages.
         add<cover_page>();
         add<nasd_basic>();
+        add<nasd_supplemental>();
         add<standard_page>("nasd_column_headings");
     }
 
diff --git a/nasd_supplemental.mustache b/nasd_supplemental.mustache
new file mode 100644
index 0000000..8661f10
--- /dev/null
+++ b/nasd_supplemental.mustache
@@ -0,0 +1,8 @@
+{{>nasd_header}}
+
+{{>dollar_units}}
+
+<br></br>
+<br></br>
+
+{{! Supplemental illustration table is created from C++ code }}



reply via email to

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