[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 36c84ce 123/156: Add another individual priva
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 36c84ce 123/156: Add another individual private placement illustration page |
Date: |
Tue, 30 Jan 2018 17:22:28 -0500 (EST) |
branch: master
commit 36c84ce29602966db20906c3ebe3674a445427e7
Author: Vadim Zeitlin <address@hidden>
Commit: Vadim Zeitlin <address@hidden>
Add another individual private placement illustration page
This required adding PremiumLoads and AdminCharges vectors used in the
table on this page.
---
ledger_evaluator.cpp | 13 ++++++++
ledger_pdf_generator_wx.cpp | 76 +++++++++++++++++++++++++++++++++++++++++++
reg_d_individual_cur.mustache | 13 ++++++++
3 files changed, 102 insertions(+)
diff --git a/ledger_evaluator.cpp b/ledger_evaluator.cpp
index dbc1347..403881b 100644
--- a/ledger_evaluator.cpp
+++ b/ledger_evaluator.cpp
@@ -634,6 +634,19 @@ ledger_evaluator Ledger::make_evaluator() const
LedgerVariant const& Curr_ = GetCurrFull();
LedgerVariant const& Guar_ = GetGuarFull();
+ std::vector<double> PremiumLoads(max_duration);
+ std::vector<double> AdminCharges(max_duration);
+ for(int j = 0; j < max_duration; ++j)
+ {
+ PremiumLoads[j] = Invar.GrossPmt[j] - Curr_.NetPmt[j];
+ AdminCharges[j] = Curr_.SpecAmtLoad[j] + Curr_.PolicyFee[j];
+ }
+
+ vectors ["PremiumLoads"] = &PremiumLoads;
+ format_map["PremiumLoads"] = f1;
+ vectors ["AdminCharges"] = &AdminCharges;
+ format_map["AdminCharges"] = f1;
+
// ET !! Easier to write as
// std::vector<double> NetDeathBenefit =
// Curr_.EOYDeathBft - Curr_.TotalLoanBalance;
diff --git a/ledger_pdf_generator_wx.cpp b/ledger_pdf_generator_wx.cpp
index eda4714..2cbb089 100644
--- a/ledger_pdf_generator_wx.cpp
+++ b/ledger_pdf_generator_wx.cpp
@@ -2601,6 +2601,81 @@ class reg_d_individual_cur_irr : public
reg_d_individual_irr_base
}
};
+class reg_d_individual_cur : public page_with_tabular_report
+{
+ private:
+ enum
+ {column_policy_year
+ ,column_end_of_year_age
+ ,column_premium_outlay
+ ,column_premium_loads
+ ,column_admin_charges
+ ,column_cur_mortality_charges
+ ,column_cur_asset_charges
+ ,column_cur_investment_income
+ ,column_cur_account_value
+ ,column_cur_cash_surr_value
+ ,column_cur_death_benefit
+ ,column_max
+ };
+
+ std::string get_fixed_page_contents() const override
+ {
+ return "{{>reg_d_individual_cur}}";
+ }
+
+ 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" }
+ ,{ "PremiumLoads" , "Premium\nLoads" , "999,999" }
+ ,{ "AdminCharges" , "Admin\nCharges" , "999,999" }
+ ,{ "COICharge_Current" , "Mortality\nCharges", "999,999" }
+ ,{ "SepAcctCharges_Current" , "Asset\nCharges" , "999,999" }
+ ,{ "GrossIntCredited_Current", "Investment\nIncome", "999,999" }
+ ,{ "AcctVal_Current" , "Account\nValue" , "999,999" }
+ ,{ "CSVNet_Current" , "Cash\nSurr Value" , "999,999" }
+ ,{ "EOYDeathBft_Current" , "Death\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();
+ }
+
+ 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
+ {
+ table.output_super_header
+ (interpolate_html
+ ("{{InitAnnSepAcctGrossInt_Guaranteed}} Hypothetical Rate of
Return*"
+ ).as_html()
+ ,column_cur_investment_income
+ ,column_max
+ ,pos_y
+ ,output_mode
+ );
+
+ *pos_y += table.get_separator_line_height();
+ table.output_horz_separator
+ (column_cur_investment_income
+ ,column_max
+ ,*pos_y
+ ,output_mode
+ );
+ }
+};
+
// Private individual placement illustration.
class pdf_illustration_reg_d_individual : public pdf_illustration
{
@@ -2619,6 +2694,7 @@ class pdf_illustration_reg_d_individual : public
pdf_illustration
add<standard_page>("reg_d_individual_cover_page");
add<reg_d_individual_guar_irr>();
add<reg_d_individual_cur_irr>();
+ add<reg_d_individual_cur>();
}
std::string get_upper_footer_template_name() const override
diff --git a/reg_d_individual_cur.mustache b/reg_d_individual_cur.mustache
new file mode 100644
index 0000000..d2e5baa
--- /dev/null
+++ b/reg_d_individual_cur.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 current charges values table is generated from C++ code }}
- [lmi-commits] [lmi] master 7a1e1e8 025/156: Include the missing <cstring> header, (continued)
- [lmi-commits] [lmi] master 7a1e1e8 025/156: Include the missing <cstring> header, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 8bfb896 109/156: Add NASD illustration first explanatory notes page, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master ea20a31 095/156: Make pdf_illustration dtor virtual, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 61fae89 091/156: Reimplement the contract numbers fragment as an external template, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 0c55621 085/156: Replace trivial PDF page classes with single standard_page one, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master ea2564b 099/156: Split the NASD header template in the upper and lower parts, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master c1bf4a8 032/156: Adjust position of the right hand side of the header manually, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 89b4674 120/156: Add automatic support for multiline super-headers, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 0f885a2 116/156: Define CorpNameAbbrev60 and Insured1Abbrev30 in common code, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 08559c3 121/156: Factor out base_suffix() and ir_suffix() functions, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 36c84ce 123/156: Add another individual private placement illustration page,
Greg Chicares <=
- [lmi-commits] [lmi] master 0ecc8ec 036/156: Add support for partials to our ad hoc Mustache parser, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 6f09722 107/156: Add missing words to the narrative summary continuation page, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 6510601 150/156: Rename a mute variable to avoid gcc -Wshadow warning, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 048ae05 093/156: Start NASD PDF illustration class implementation, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 5ea5c86 101/156: Simplify and correct current PDF DC font handling, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master ec490eb 153/156: Revise and extend some comments in PDF generation code, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 38cab5e 096/156: Make footer template depend on illustration kind, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master d1204c2 111/156: Factor out common parts of render_or_measure_fixed_page_part(), Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master e388f6e 037/156: Add beginning of numeric summary page using an external template, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 531699b 115/156: Factor out common page_with_basic_tabular_report class, Greg Chicares, 2018/01/30