[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master c0d68e1 122/156: Add rate of return pages of
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master c0d68e1 122/156: Add rate of return pages of the individual placement illustration |
Date: |
Tue, 30 Jan 2018 17:22:27 -0500 (EST) |
branch: master
commit c0d68e1a92b6f93d0931673fedc32a843209fdc4
Author: Vadim Zeitlin <address@hidden>
Commit: Vadim Zeitlin <address@hidden>
Add rate of return pages of the individual placement illustration
Reuse the same class for both guaranteed and current charges cases as
they are almost identical.
---
ledger_pdf_generator_wx.cpp | 160 +++++++++++++++++++++++++++++++++++++
reg_d_individual_cur_irr.mustache | 13 +++
reg_d_individual_guar_irr.mustache | 13 +++
reg_d_individual_header.mustache | 69 ++++++++++++++++
4 files changed, 255 insertions(+)
diff --git a/ledger_pdf_generator_wx.cpp b/ledger_pdf_generator_wx.cpp
index f2d2d15..eda4714 100644
--- a/ledger_pdf_generator_wx.cpp
+++ b/ledger_pdf_generator_wx.cpp
@@ -2443,6 +2443,164 @@ class pdf_illustration_reg_d_group : public
pdf_illustration
}
};
+// This page exists in two almost identical versions, one using guaranteed and
+// the other one using current values, use a base class to share the common
+// parts.
+class reg_d_individual_irr_base : public page_with_tabular_report
+{
+ private:
+ enum
+ {column_policy_year
+ ,column_end_of_year_age
+ ,column_premium_outlay
+ ,column_zero_cash_surr_value
+ ,column_zero_death_benefit
+ ,column_zero_irr_surr_value
+ ,column_zero_irr_death_benefit
+ ,column_separator
+ ,column_nonzero_cash_surr_value
+ ,column_nonzero_death_benefit
+ ,column_nonzero_irr_surr_value
+ ,column_nonzero_irr_death_benefit
+ ,column_max
+ };
+
+ // Must be overridden to return the base being used.
+ virtual base get_base() const = 0;
+
+ 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();
+ }
+
+ void render_or_measure_extra_headers
+ (illustration_table_generator& table
+ ,html_interpolator const& interpolate_html
+ ,int* pos_y
+ ,enum_output_mode output_mode
+ ) const override
+ {
+ std::ostringstream header_zero;
+ header_zero
+ << "{{InitAnnSepAcctGrossInt_"
+ << base_suffix(get_base())
+ << ir_suffix(interest_rate::zero)
+ << "}} Hypothetical Rate of\n"
+ << "Return*"
+ ;
+
+ auto pos_y_copy = *pos_y;
+ table.output_super_header
+ (interpolate_html(header_zero.str()).as_html()
+ ,column_zero_cash_surr_value
+ ,column_zero_irr_surr_value
+ ,pos_y
+ ,output_mode
+ );
+
+ std::ostringstream header_nonzero;
+ header_nonzero
+ << "{{InitAnnSepAcctGrossInt_"
+ << base_suffix(get_base())
+ << ir_suffix(interest_rate::non_zero)
+ << "}} Hypothetical Rate of\n"
+ << "Return*"
+ ;
+
+ *pos_y = pos_y_copy;
+ table.output_super_header
+ (interpolate_html(header_nonzero.str()).as_html()
+ ,column_nonzero_cash_surr_value
+ ,column_nonzero_irr_surr_value
+ ,pos_y
+ ,output_mode
+ );
+
+ *pos_y += table.get_separator_line_height();
+ table.output_horz_separator
+ (column_zero_cash_surr_value
+ ,column_zero_irr_surr_value
+ ,*pos_y
+ ,output_mode
+ );
+ table.output_horz_separator
+ (column_nonzero_cash_surr_value
+ ,column_nonzero_irr_surr_value
+ ,*pos_y
+ ,output_mode
+ );
+ }
+};
+
+class reg_d_individual_guar_irr : public reg_d_individual_irr_base
+{
+ private:
+ base get_base() const override
+ {
+ return base::guaranteed;
+ }
+
+ std::string get_fixed_page_contents() const override
+ {
+ return "{{>reg_d_individual_guar_irr}}";
+ }
+
+ 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" }
+ ,{ "CSVNet_GuaranteedZero" , "Cash Surr\nValue" ,
"999,999" }
+ ,{ "EOYDeathBft_GuaranteedZero" , "Death\nBenefit" ,
"9,999,999" }
+ ,{ "IrrCsv_GuaranteedZero" , "IRR on\nSurr Value" ,
"99.99%" }
+ ,{ "IrrDb_GuaranteedZero" , "IRR on\nDeath Bft" ,
"99.99%" }
+ ,{ "" , " " ,
"-" }
+ ,{ "CSVNet_Guaranteed" , "Cash Surr\nValue" ,
"999,999" }
+ ,{ "EOYDeathBft_Guaranteed" , "Death\nBenefit" ,
"9,999,999" }
+ ,{ "IrrCsv_Guaranteed" , "IRR on\nSurr Value" ,
"99.99%" }
+ ,{ "IrrDb_Guaranteed" , "IRR on\nDeath Bft" ,
"99.99%" }
+ };
+
+ return columns;
+ }
+};
+
+class reg_d_individual_cur_irr : public reg_d_individual_irr_base
+{
+ private:
+ base get_base() const override
+ {
+ return base::current;
+ }
+
+ std::string get_fixed_page_contents() const override
+ {
+ return "{{>reg_d_individual_cur_irr}}";
+ }
+
+ 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" }
+ ,{ "CSVNet_CurrentZero" , "Cash Surr\nValue" ,
"999,999" }
+ ,{ "EOYDeathBft_CurrentZero" , "Death\nBenefit" ,
"9,999,999" }
+ ,{ "IrrCsv_CurrentZero" , "IRR on\nSurr Value" ,
"99.99%" }
+ ,{ "IrrDb_CurrentZero" , "IRR on\nDeath Bft" ,
"99.99%" }
+ ,{ "" , " " ,
"-" }
+ ,{ "CSVNet_Current" , "Cash Surr\nValue" ,
"999,999" }
+ ,{ "EOYDeathBft_Current" , "Death\nBenefit" ,
"9,999,999" }
+ ,{ "IrrCsv_Current" , "IRR on\nSurr Value" ,
"99.99%" }
+ ,{ "IrrDb_Current" , "IRR on\nDeath Bft" ,
"99.99%" }
+ };
+
+ return columns;
+ }
+};
+
// Private individual placement illustration.
class pdf_illustration_reg_d_individual : public pdf_illustration
{
@@ -2459,6 +2617,8 @@ class pdf_illustration_reg_d_individual : public
pdf_illustration
// Add all the pages.
add<standard_page>("reg_d_individual_cover_page");
+ add<reg_d_individual_guar_irr>();
+ add<reg_d_individual_cur_irr>();
}
std::string get_upper_footer_template_name() const override
diff --git a/reg_d_individual_cur_irr.mustache
b/reg_d_individual_cur_irr.mustache
new file mode 100644
index 0000000..77cb34c
--- /dev/null
+++ b/reg_d_individual_cur_irr.mustache
@@ -0,0 +1,13 @@
+{{>reg_d_individual_header}}
+
+<font size="-1">
+
+<p align="center">
+End of Year Policy Values using Current Charges
+</p>
+
+{{>dollar_units}}
+
+</font>
+
+{{! The IRR values table is generated from C++ code }}
diff --git a/reg_d_individual_guar_irr.mustache
b/reg_d_individual_guar_irr.mustache
new file mode 100644
index 0000000..4794654
--- /dev/null
+++ b/reg_d_individual_guar_irr.mustache
@@ -0,0 +1,13 @@
+{{>reg_d_individual_header}}
+
+<font size="-1">
+
+<p align="center">
+End of Year Policy Values using Guaranteed Charges
+</p>
+
+{{>dollar_units}}
+
+</font>
+
+{{! The IRR values table is generated from C++ code }}
diff --git a/reg_d_individual_header.mustache b/reg_d_individual_header.mustache
new file mode 100644
index 0000000..58c3695
--- /dev/null
+++ b/reg_d_individual_header.mustache
@@ -0,0 +1,69 @@
+<scaled_image inv_factor="0.36" src="company_logo.png"></scaled_image>
+
+<font size="-1">
+
+<p align="center">
+{{^IsInforce}}
+ Illustration for Flexible Premium Variable Adjustable
+ Life Insurance Contract.
+{{/IsInforce}}
+{{#IsInforce}}
+ In Force Illustration for Flexible Premium Variable Adjustable
+ Life Insurance Contract.
+{{/IsInforce}}
+
+<br></br>
+<br></br>
+
+The purpose of the Illustration is to show how the performance of the
+underlying separate account divisions could affect the policy's
+account values and death benefits. This Illustration is hypothetical
+and may not be used to project or predict investment results.
+</p>
+
+<br></br>
+<br></br>
+
+<table width="100%" cellspacing="0" cellpadding="0" valign="top">
+ <tr>
+ <td width="60%">
+ Date Prepared: {{date_prepared}}<br>
+ {{#Composite}}
+ Composite of individuals<br>
+ {{/Composite}}
+ {{^Composite}}
+ Prepared for: {{Insured1Abbrev30}}<br>
+ Age: {{Age}}<br>
+ Issue State: {{StatePostalAbbrev}}<br>
+ {{/Composite}}
+ Selected Face Amount: ${{InitTotalSA}}<br>
+ Initial Death Benefit Option: {{InitDBOpt}}<br>
+ </td>
+ <td width="40%">
+ Policy: {{PolicyMktgName}}<br>
+ {{^Composite}}
+ Underwriting Type:
+ {{#UWTypeIsMedical}}
+ Fully underwritten<br>
+ {{/UWTypeIsMedical}}
+ {{^UWTypeIsMedical}}
+ {{UWType}}<br>
+ {{/UWTypeIsMedical}}
+
+ Rate Classification: {{Gender}}, {{Smoker}}, {{UWClass}}<br>
+
+ {{#UWClassIsRated}}
+ Table Rating: {{SubstandardTable}}<br>
+ {{!
+ Flats don't require "Rated" class; and does this value
actually print anyway?
+ These questions apply as well to the original:
+
http://svn.savannah.nongnu.org/viewvc/lmi/trunk/individual_private_placement.xsl?annotate=696&root=lmi&pathrev=3585
+ }}
+ Initial Annual Flat Extra: {{AnnualFlatExtra[1]}} per
1,000<br>
+ {{/UWClassIsRated}}
+ {{/Composite}}
+ </td>
+ </tr>
+</table>
+
+</font>
- [lmi-commits] [lmi] master d5d8185 057/156: Add tabular_details page, (continued)
- [lmi-commits] [lmi] master d5d8185 057/156: Add tabular_details page, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master bb64784 013/156: Add a helper allowing to interpolate variables in strings, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master b72ced6 014/156: Replace ad hoc illustration properties with HTML interpolator, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master e7d763d 066/156: Add company logo display to the PDF illustration header, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master f575c94 003/156: Refactor more group_quote_pdf_gen_wx code to allow its reuse, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 5e2fc70 007/156: Make HTML generation utilities more type-safe, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 7ed2bbf 027/156: Simplify footer generation code by moving font tag outside, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master d7244c1 043/156: Change the colour used for lines and borders, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 41ae40d 089/156: Fix wrong "<br>" tag in the header template, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master acb7aae 049/156: Add numbered_page::get_extra_pages_needed() hook, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master c0d68e1 122/156: Add rate of return pages of the individual placement illustration,
Greg Chicares <=
- [lmi-commits] [lmi] master 875ca7d 039/156: Rename StateIsTX ledger variable to StateIsTexas, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 31048c8 047/156: Make wx_table_generator even more customizable, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 10dd0a9 051/156: Factor enum_output_mode into a separate header to allow its reuse, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 8fa972e 052/156: Add "Tabular Detail, continued" page to the PDF illustration, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master ca6e17c 031/156: Add function generating a standard header and use it, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master c378bc5 064/156: Remove unnecessary value_cast inclusion, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 41de2e2 140/156: Add helper expand_template() method, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 3e8e257 017/156: Add pdf_illustration_regular and narrative_summary_page, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 614fb47 135/156: Add supplemental reports pages to private placement illustrations, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 49cc809 072/156: Remove HTML construction helpers not needed any more, Greg Chicares, 2018/01/30