[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 }}
- [lmi-commits] [lmi] master 6f09722 107/156: Add missing words to the narrative summary continuation page, (continued)
- [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
- [lmi-commits] [lmi] master a85943b 124/156: Add the rest of individual private placement illustration pages, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master f0b9cea 113/156: Add "Assumption Detail" page to NASD illustrations,
Greg Chicares <=
- [lmi-commits] [lmi] master 031070b 132/156: Implement supplemental report page for the regular illustrations, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 9fe1d07 125/156: Implement page-specific footer for "Tabular Details" pages, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 4f3a02e 078/156: Add company logo to the cover page, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 2d93248 118/156: Add the rest of group private placement illustration pages, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 1272ce2 127/156: Don't include "Assumptions" page in composite NASD illustrations, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master e00ab7d 080/156: Hide "attained age" column for composite illustrations, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 29e63d6 117/156: Add basic illustration page of group placement illustration, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 1a9bfb3 137/156: Factor out standard_supplemental_report class, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 7c0ff88 145/156: Add copyright notices to all .mst template files, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 2fd6a11 147/156: Use shorter and more consistent names for external templates, Greg Chicares, 2018/01/30