[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master bb75971 033/156: Implement the second part of
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master bb75971 033/156: Implement the second part of the narrative summary page |
Date: |
Tue, 30 Jan 2018 17:22:04 -0500 (EST) |
branch: master
commit bb759714c3cfc041e695fee1e110e42897a77eef
Author: Vadim Zeitlin <address@hidden>
Commit: Vadim Zeitlin <address@hidden>
Implement the second part of the narrative summary page
Replace "SalesLoadRefund" variable with "HasSalesLoadRefund" not
formatted as percentage, which doesn't make sense for a boolean value.
---
ledger_evaluator.cpp | 6 +-
ledger_pdf_generator_wx.cpp | 336 +++++++++++++++++++++++++++++++++++++++++++-
2 files changed, 337 insertions(+), 5 deletions(-)
diff --git a/ledger_evaluator.cpp b/ledger_evaluator.cpp
index 76a2b44..acc6bb9 100644
--- a/ledger_evaluator.cpp
+++ b/ledger_evaluator.cpp
@@ -348,7 +348,6 @@ ledger_evaluator Ledger::make_evaluator() const
// F3: scaled by 100, zero decimals, with '%' at end:
// > Format as percentage with no decimal places (##0%)
- format_map["SalesLoadRefund" ] = f3;
format_map["SalesLoadRefundRate0" ] = f3;
format_map["SalesLoadRefundRate1" ] = f3;
@@ -389,6 +388,7 @@ ledger_evaluator Ledger::make_evaluator() const
format_map["HasADD" ] = f1;
format_map["HasChildRider" ] = f1;
format_map["HasHoneymoon" ] = f1;
+ format_map["HasSalesLoadRefund" ] = f1;
format_map["HasSpouseRider" ] = f1;
format_map["HasSupplSpecAmt" ] = f1;
format_map["HasTerm" ] = f1;
@@ -692,12 +692,12 @@ ledger_evaluator Ledger::make_evaluator() const
strings["PrepMonth"] = &PrepMonth;
strings["PrepDay" ] = &PrepDay;
- double SalesLoadRefund =
+ double HasSalesLoadRefund =
!each_equal(ledger_invariant_->RefundableSalesLoad, 0.0);
double SalesLoadRefundRate0 = ledger_invariant_->RefundableSalesLoad[0];
double SalesLoadRefundRate1 = ledger_invariant_->RefundableSalesLoad[1];
- scalars["SalesLoadRefund" ] = &SalesLoadRefund ;
+ scalars["HasSalesLoadRefund" ] = &HasSalesLoadRefund ;
scalars["SalesLoadRefundRate0"] = &SalesLoadRefundRate0;
scalars["SalesLoadRefundRate1"] = &SalesLoadRefundRate1;
diff --git a/ledger_pdf_generator_wx.cpp b/ledger_pdf_generator_wx.cpp
index 0ede1c1..cf63b78 100644
--- a/ledger_pdf_generator_wx.cpp
+++ b/ledger_pdf_generator_wx.cpp
@@ -1108,6 +1108,321 @@ persistency, profits and expenses.
}
};
+class narrative_summary_cont_page : public numbered_page
+{
+ public:
+ void render
+ (Ledger const& ledger
+ ,pdf_writer_wx& writer
+ ,wxDC& dc
+ ,html_interpolator const& interpolate_html
+ ) override
+ {
+ numbered_page::render(ledger, writer, dc, interpolate_html);
+
+ // Just a convenient helper performing a common operation.
+ auto const add_body_paragraph = [=](std::string const& s) -> text
+ {
+ return add_body_paragraph_html(interpolate_html(s));
+ };
+
+ text summary_html = tag::p[attr::align("center")]
+ (text::from("NARRATIVE SUMMARY (Continued)")
+ );
+
+ summary_html += tag::br;
+
+ if(interpolate_html.test_variable("HasSalesLoadRefund"))
+ {
+ summary_html += add_body_paragraph
+ (R"(
+Sales Load Refund: We will refund a portion of the sales load
+to you, as part of your {{CsvName}}
+Value, if you surrender your contract within the first two
+policy years. In policy year 1, we will refund
+{{SalesLoadRefundRate0}}
+of the first contract year sales load collected
+and in contract year 2, we will refund
+{{SalesLoadRefundRate1}}
+of the first contract year sales load collected.
+)"
+ );
+ }
+
+ if(interpolate_html.test_variable("NoLapse"))
+ {
+ summary_html += add_body_paragraph
+ (R"(
+{{NoLapseProvisionName}}:
+The contract will remain in force after the first premium
+has been paid, even if there is insufficient
+{{AvName}} Value
+to cover the monthly charges provided that the insured
+is not in a substandard rating class and the policy debt
+does not exceed {{AvName}} Value.
+)"
+ );
+ }
+
+ summary_html += add_body_paragraph("{{GuarMortalityFootnote}}");
+
+ summary_html += add_body_paragraph
+ (R"(
+This illustration assumes death of the insured at age {{EndtAge}}.
+)"
+ );
+
+ summary_html += add_body_paragraph
+ (R"(
+ The loan interest rate is fixed at {{InitAnnLoanDueRate}} per year.
+)"
+ );
+
+ summary_html += add_body_paragraph
+ (R"(
+The state of issue is {{StatePostalAbbrev}}.
+)"
+ );
+
+ summary_html += add_body_paragraph
+ (R"(
+This illustration assumes an initial Selected Face Amount of
+${{InitBaseSpecAmt}}. Selected Face
+Amount reductions assumed in this illustration (if any) are shown
+in the Tabular Detail.
+)"
+ );
+
+ if(interpolate_html.test_variable("IsInforce"))
+ {
+ summary_html += add_body_paragraph
+ (R"(
+This illustration assumes a beginning account value of
+${{InforceUnloanedAV}} as of the date of this illustration.
+)"
+ );
+
+ summary_html += add_body_paragraph
+ (R"(
+This illustration assumes a beginning cost basis of
+${{InforceTaxBasis}} as
+of the date of this illustration; the actual cost basis
+may be higher or lower. Consult the Home Office for cost
+basis information.
+)"
+ );
+ }
+
+ if(interpolate_html.test_variable("Composite"))
+ {
+ summary_html += add_body_paragraph
+ (R"(
+Please see the attached census, listing the face amounts,
+underwriting classes and issue ages for individual participants.
+)"
+ );
+ }
+
+ if(interpolate_html.test_variable("StateIsCarolina"))
+ {
+ summary_html += add_body_paragraph
+ (R"(
+In the states of North Carolina and South Carolina,
+Guaranteed Issue Underwriting is referred
+to as "Limited Underwriting" and Simplified
+Issue Underwriting is referred to as "Simplified Underwriting".
+)"
+ );
+ }
+
+ if(interpolate_html.test_variable("StateIsMaryland"))
+ {
+ summary_html += add_body_paragraph
+ (R"(
+In the state of Maryland, Guaranteed Issue Underwriting
+is referred to as "Nonstandard Limited Underwriting"
+and Simplified Issue Underwriting is referred to as
+"Nonstandard Simplified Underwriting".
+)"
+ );
+ }
+
+ if(interpolate_html.test_variable("GroupExperienceRating"))
+ {
+ summary_html += add_body_paragraph
+ (R"(
+We may assess a Market Value Adjustment upon a surrender
+of the certificate when the surrender proceeds are intended
+to be applied to an insurance policy issued by an insurer
+unaffiliated with
+{{InsCoShortName}}
+with an intent to qualify the exchange as a tax free exchange
+under IRC section 1035.
+)"
+ );
+
+ if(!interpolate_html.test_variable("UseExperienceRating"))
+ {
+ summary_html += add_body_paragraph
+ ("This illustration does not reflect experience rating."
+ );
+ }
+
+ summary_html += add_body_paragraph
+ (R"(
+The guaranteed values reflect the maximum charges permitted
+by the contract, which may include an Experience Rating
+Risk Charge.
+)"
+ );
+
+ summary_html += add_body_paragraph
+ (R"(
+No Experience Rating Risk Charge or a distribution
+of an Experience Rating Reserve Credit is reflected
+in the current, non-guaranteed values. Actual charges
+and credits will be based on the actual experience of the group.
+)"
+ );
+ }
+
+ if(interpolate_html.test_variable("Has1035ExchCharge"))
+ {
+ summary_html += add_body_paragraph
+ (R"(
+{{^SinglePremium}}
+ Upon surrender of this policy, where the surrender
+ proceeds are intended to be applied to an insurance policy
+ or certificate issued in conjunction with an intent
+ to qualify the exchange as a tax free exchange
+ under Section 1035 of the Internal Revenue Code,
+ we may assess an Exchange Charge. The Exchange Charge
+ is the greater of the Market Value Adjustment Charge
+ and the Percentage of Premium Charge. In the states
+ of Florida or Indiana, the Exchange charge
+ (referred to as Assignment Charge in Florida)
+ will be the Percentage of Premium Charge only.
+ The Exchange Charge will potentially reduce
+ the surrender proceeds, but will never increase
+ the surrender proceeds. Please refer to your policy
+ for details.
+{{/SinglePremium}}
+{{#SinglePremium}}
+ Upon surrender of this policy, where the surrender proceeds
+ are intended to be applied to an insurance policy
+ or certificate issued in conjunction with an intent
+ to qualify the exchange as a tax free exchange
+ under Section 1035 of the Internal Revenue Code (1035
+ Exchange), we may assess an Exchange Charge. The Exchange
+ Charge will potentially reduce the surrender proceeds,
+ but will never increase the surrender proceeds.
+ Please refer to your policy for details.
+{{/SinglePremium}}
+)"
+ );
+ }
+
+ if(interpolate_html.test_variable("HasSpouseRider"))
+ {
+ summary_html += add_body_paragraph
+ (R"(
+The ${{SpouseRiderAmount}} Spouse
+rider provides term life insurance on the spouse
+(issue age {{SpouseIssueAge}})
+for a limited duration, for an extra charge.
+Please refer to your contract for specific provisions
+and a detailed schedule of charges.
+)"
+ );
+ }
+
+ if(interpolate_html.test_variable("HasChildRider"))
+ {
+ summary_html += add_body_paragraph
+ (R"(
+The ${{ChildRiderAmount}} Child
+rider provides term life insurance on the insured's children
+for a limited duration, for an extra charge. Please refer
+to your contract for specific provisions
+and a detailed schedule of charges.
+)"
+ );
+ }
+
+ summary_html += add_body_paragraph("{{SurrenderFootnote}}");
+
+ summary_html += add_body_paragraph("{{FundRateFootnote}}");
+
+ summary_html += add_body_paragraph("{{Space2}}{{FundRateFootnote0}}");
+
+ summary_html += add_body_paragraph("{{Space2}}{{FundRateFootnote1}}");
+
+ summary_html += tag::p[attr::align("center")]
+ (tag::b
+ (text::from("IMPORTANT TAX DISCLOSURE")
+ )
+ );
+
+ summary_html += add_body_paragraph
+ (R"(
+As illustrated, this contract
+{{#IsMec}}
+ becomes
+{{/IsMec}}
+{{^IsMec}}
+ would not become
+{{/IsMec}}
+a Modified Endowment Contract (MEC)
+under the Internal Revenue Code
+{{#IsMec}}
+{{MecYearPlus1}}
+{{/IsMec}}
+To the extent of gain in the contract, loans, distributions
+and withdrawals from a MEC are subject to income tax
+and may also trigger a penalty tax.
+)"
+ );
+
+ if
+ ( !interpolate_html.test_variable("SinglePremium")
+ && !interpolate_html.test_variable("IsInforce")
+ )
+ {
+ summary_html += add_body_paragraph
+ (R"(
+The initial 7-pay premium limit is ${{InitSevenPayPrem}}.
+)"
+ );
+ }
+
+ summary_html += tag::p
+ (tag::font[attr::size("-1")]
+ (tag::b
+ (interpolate_html
+ (R"(
+The information contained in this illustration is not written
+or intended as tax or legal advice, and may not be relied upon
+for purposes of avoiding any federal tax penalties.
+Neither {{InsCoShortName}} nor any
+of its employees or representatives are authorized to give tax
+or legal advice. For more information pertaining
+to the tax consequences of purchasing or owning this policy,
+consult with your own independent tax or legal counsel.
+)"
+ )
+ )
+ )
+ );
+
+ writer.output_html
+ (writer.get_horz_margin()
+ ,writer.get_vert_margin()
+ ,writer.get_page_width()
+ ,summary_html
+ );
+ }
+};
+
// Regular illustration.
class pdf_illustration_regular : public pdf_illustration
{
@@ -1119,11 +1434,12 @@ class pdf_illustration_regular : public pdf_illustration
{
auto const& invar = ledger.GetLedgerInvariant();
auto const& policy_name = invar.PolicyLegalName;
+ auto const& state_abbrev = invar.GetStatePostalAbbrev();
// Define variables specific to this illustration.
add_variable
("ModifiedSinglePremium"
- ,starts_with(policy_name, "Single") &&
invar.GetStatePostalAbbrev() == "MA"
+ ,starts_with(policy_name, "Single") && state_abbrev == "MA"
);
add_variable
@@ -1146,6 +1462,11 @@ class pdf_illustration_regular : public pdf_illustration
,policy_name == "Group Flexible Premium Adjustable Life Insurance
Policy"
);
+ add_variable
+ ("MecYearPlus1"
+ ,invar.MecYear + 1
+ );
+
// Variable representing the premium payment frequency with the
// appropriate indefinite article preceding it, e.g. "an annual" or "a
// monthly".
@@ -1170,8 +1491,18 @@ class pdf_illustration_regular : public pdf_illustration
);
add_variable
+ ("StateIsCarolina"
+ ,state_abbrev == "NC" || state_abbrev == "SC"
+ );
+
+ add_variable
+ ("StateIsMaryland"
+ ,state_abbrev == "MD"
+ );
+
+ add_variable
("StateIsTX"
- ,invar.GetStatePostalAbbrev() == "TX"
+ ,state_abbrev == "TX"
);
add_variable
@@ -1187,6 +1518,7 @@ class pdf_illustration_regular : public pdf_illustration
// Add all the pages.
add<cover_page>();
add<narrative_summary_page>();
+ add<narrative_summary_cont_page>();
}
};
- [lmi-commits] [lmi] master 9fe1d07 125/156: Implement page-specific footer for "Tabular Details" pages, (continued)
- [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
- [lmi-commits] [lmi] master b09a25f 026/156: Implement numbering pages in the PDF output, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master bb75971 033/156: Implement the second part of the narrative summary page,
Greg Chicares <=
- [lmi-commits] [lmi] master 964db82 067/156: Rename columns_headings_page to column_headings_page, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 2a94469 074/156: Use Mustache template files from the data directory, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 01be23a 103/156: Automatically squeeze table columns to make them fit if necessary, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 46a7442 068/156: Factor out helper render_template() method, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master d77620f 100/156: Factor out dollar_units template from the existing ones, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 833eef5 086/156: Use std::make_unique<> instead of raw "new", Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 34c088c 073/156: Move footer contents into an external template too, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 0ba1c32 146/156: Consistently use "curr" as abbreviation of "current", Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 29865fc 133/156: Add supplemental report to NASD illustrations too, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 919d796 001/156: Remove old XSL-FO-based PDF generation code, Greg Chicares, 2018/01/30