[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master a1342a9 106/156: Fix supplemental NASD illust
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master a1342a9 106/156: Fix supplemental NASD illustration page for split premiums |
Date: |
Tue, 30 Jan 2018 17:22:22 -0500 (EST) |
branch: master
commit a1342a986cff35186d0e38cb9e0f13770d922ebb
Author: Vadim Zeitlin <address@hidden>
Commit: Vadim Zeitlin <address@hidden>
Fix supplemental NASD illustration page for split premiums
Show slightly different columns in this case.
---
ledger_pdf_generator_wx.cpp | 76 ++++++++++++++++++++++++++++++++++++---------
1 file changed, 62 insertions(+), 14 deletions(-)
diff --git a/ledger_pdf_generator_wx.cpp b/ledger_pdf_generator_wx.cpp
index 5a5a6d6..9c1a9e7 100644
--- a/ledger_pdf_generator_wx.cpp
+++ b/ledger_pdf_generator_wx.cpp
@@ -2117,10 +2117,14 @@ class nasd_supplemental : public
page_with_tabular_report
enum
{column_policy_year
,column_end_of_year_age
+ ,column_er_gross_payment
+ ,column_ee_gross_payment
,column_premium_outlay
,column_admin_charge
,column_premium_tax_load
,column_dac_tax_load
+ ,column_er_min_premium
+ ,column_ee_min_premium
,column_net_premium
,column_cost_of_insurance_charges
,column_cur_account_value
@@ -2132,17 +2136,21 @@ class nasd_supplemental : public
page_with_tabular_report
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" }
+ {{ "PolicyYear" , "Policy\nYear" ,
"999" }
+ ,{ "AttainedAge" , "End of\nYear Age" ,
"999" }
+ ,{ "ErGrossPmt" , "ER Gross\nPayment" ,
"999,999" }
+ ,{ "EeGrossPmt" , "EE Gross\nPayment" ,
"999,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" }
+ ,{ "ErModalMinimumPremium", "ER Modal\nMinimum\nPremium" ,
"999,999" }
+ ,{ "EeModalMinimumPremium", "EE Modal\nMinimum\nPremium" ,
"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;
@@ -2150,8 +2158,43 @@ class nasd_supplemental : public page_with_tabular_report
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();
+ auto const& invar = ledger.GetLedgerInvariant();
+
+ // The supplemental page in NASD illustrations exists in two versions:
+ // default one and one with split premiums. Hide columns that are not
+ // needed for the current illustration.
+ switch(column)
+ {
+ case column_end_of_year_age:
+ // This column doesn't make sense for composite ledgers.
+ return !ledger.is_composite();
+
+ case column_admin_charge:
+ case column_premium_tax_load:
+ case column_dac_tax_load:
+ // These columns only appear in non-split premiums case.
+ return invar.SplitMinPrem == 0.;
+
+ case column_er_gross_payment:
+ case column_ee_gross_payment:
+ case column_er_min_premium:
+ case column_ee_min_premium:
+ // While those only appear in split premiums case.
+ return invar.SplitMinPrem == 1.;
+
+ case column_policy_year:
+ case column_premium_outlay:
+ case column_net_premium:
+ case column_cost_of_insurance_charges:
+ case column_cur_account_value:
+ case column_cur_cash_surr_value:
+ case column_cur_death_benefit:
+ case column_max:
+ // These columns are common to both cases and never hidden.
+ break;
+ }
+
+ return true;
}
int render_or_measure_fixed_page_part
@@ -2174,7 +2217,12 @@ class nasd_supplemental : public page_with_tabular_report
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);
+ table.output_horz_separator
+ (0
+ ,table.columns_count()
+ ,pos_y
+ ,output_mode
+ );
return pos_y;
}
- [lmi-commits] [lmi] master 830e1fd 130/156: Manually break column titles into lines, (continued)
- [lmi-commits] [lmi] master 830e1fd 130/156: Manually break column titles into lines, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 43859a6 053/156: Add support for "measure only" output mode to wx_table_generator, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 772f4a4 139/156: Refactor: use get_fixed_page_contents_template_name(), Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 81ccdc8 129/156: Remove the never used elements of the columns title map, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 2478fbc 010/156: Start implementing PDF illustrations directly, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 9d24cd9 024/156: Compilation fix for C++11 but not C++14 compilers, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 1229745 020/156: Make add_body_paragraph() even more convenient to use, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 14aca9e 142/156: Replace underscores in title map with explicit line breaks, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 5241f0f 045/156: Fix some typos in wx_table_generator::add_column() comment, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 47bddbf 155/156: Merge branch 'vz-no-xslfo' into gwc-no-xslfo, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master a1342a9 106/156: Fix supplemental NASD illustration page for split premiums,
Greg Chicares <=
- [lmi-commits] [lmi] master ec0b298 110/156: Add NASD illustration second explanatory notes page, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 80423d2 134/156: Improve appearance of lower header part in NASD illustrations, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 408ba18 156/156: Merge branch 'gwc-no-xslfo' [387], Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master de5d0b8 060/156: Inline output_and_check_for_page_break() function, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 5421d85 002/156: Factor out pdf_writer_wx from group_quote_pdf_gen_wx, Greg Chicares, 2018/01/30