[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 9665573 070/156: Change narrative summary pag
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 9665573 070/156: Change narrative summary page to use an external template |
Date: |
Tue, 30 Jan 2018 17:22:13 -0500 (EST) |
branch: master
commit 9665573f0edc51b48e46be7a092f950ae4bb92b4
Author: Vadim Zeitlin <address@hidden>
Commit: Vadim Zeitlin <address@hidden>
Change narrative summary page to use an external template
Define the page contents in the template instead of hard-coding it.
---
ledger_pdf_generator_wx.cpp | 241 +-------------------------------------------
narrative_summary.mustache | 182 +++++++++++++++++++++++++++++++++
2 files changed, 183 insertions(+), 240 deletions(-)
diff --git a/ledger_pdf_generator_wx.cpp b/ledger_pdf_generator_wx.cpp
index eb3b3fe..cb5d95b 100644
--- a/ledger_pdf_generator_wx.cpp
+++ b/ledger_pdf_generator_wx.cpp
@@ -998,246 +998,7 @@ class narrative_summary_page : public numbered_page
{
numbered_page::render(ledger, writer, interpolate_html);
- text summary_html = get_header_html
- (ledger.GetLedgerInvariant()
- ,interpolate_html
- );
-
- summary_html += tag::p[attr::align("center")]
- (text::from("NARRATIVE SUMMARY")
- );
-
- // 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));
- };
-
- std::string description;
- if(!interpolate_html.test_variable("SinglePremium"))
- {
- description = R"(
-{{PolicyMktgName}} is a
-{{#GroupExperienceRating}}group{{/GroupExperienceRating}}
-{{#GroupCarveout}}group{{/GroupCarveout}}
-flexible premium adjustable life insurance contract.
-{{#GroupExperienceRating}}
-It is a no-load policy and is intended for large case sales.
-It is primarily marketed to financial institutions
-to fund certain corporate liabilities.
-{{/GroupExperienceRating}}
-It features accumulating account values, adjustable benefits,
-and flexible premiums.
-)";
- }
- else if( interpolate_html.test_variable("ModifiedSinglePremium")
- || interpolate_html.test_variable("ModifiedSinglePremium0")
- )
- {
- description = R"(
-{{PolicyMktgName}}
-is a modified single premium adjustable life
-insurance contract. It features accumulating
-account values, adjustable benefits, and single premium.
-)";
- }
- else
- {
- description = R"(
-{{PolicyMktgName}}
-is a single premium adjustable life insurance contract.
-It features accumulating account values,
-adjustable benefits, and single premium.
-)";
- }
-
- summary_html += add_body_paragraph(description);
-
- if(!interpolate_html.test_variable("IsInforce"))
- {
- summary_html += add_body_paragraph
- (R"(
-Coverage may be available on a Guaranteed Standard Issue basis.
-All proposals are based on case characteristics and must
-be approved by the {{InsCoShortName}}
-Home Office. For details regarding underwriting
-and coverage limitations refer to your offer letter
-or contact your {{InsCoShortName}} representative.
-)"
- );
- }
-
- summary_html += add_body_paragraph_html
- ( interpolate_html("{{AvName}}")
- + text::nbsp()
- + interpolate_html("{{MonthlyChargesPaymentFootnote}}")
- );
-
- std::string premiums;
- if(!interpolate_html.test_variable("SinglePremium"))
- {
- premiums = R"(
-Premiums are assumed to be paid on {{ErModeLCWithArticle}}
-basis and received at the beginning of the contract year.
-)";
- }
- else
- {
- premiums = R"(
-The single premium is assumed to be paid at the beginning
-of the contract year.
-)";
- }
-
- premiums += R"(
-{{AvName}} Values, {{CsvName}} Values,
-and death benefits are illustrated as of the end
-of the contract year. The method we use to allocate
-overhead expenses is the fully allocated expense method.
-)";
-
- summary_html += add_body_paragraph(premiums);
-
- if(!interpolate_html.test_variable("SinglePremium"))
- {
- summary_html += add_body_paragraph
- (R"(
-In order to guarantee coverage to age
-{{EndtAge}}, {{ErModeLCWithArticle}} premium
-{{#HasGuarPrem}}
-of ${{GuarPrem}} must be paid.
-{{/HasGuarPrem}}
-{{^HasGuarPrem}}
-is defined.
-{{/HasGuarPrem}}
-This amount is based on the guaranteed monthly charges
-and the guaranteed interest crediting rate.
-{{#DefnLifeInsIsGPT}}
-This premium may be in excess of the maximum premium allowable
-in order to qualify this policy as life insurance.
-{{/DefnLifeInsIsGPT}}
-)"
- );
- }
-
- summary_html += add_body_paragraph
- (R"(
-Loaned amounts of the {{AvName}}
-Value will be credited a rate equal to the loan interest rate less
-a spread, guaranteed not to exceed
-{{#GroupCarveout}}
-1.25%.
-{{/GroupCarveout}}
-{{^GroupCarveout}}
-3.00%.
-{{/GroupCarveout}}
-)"
- );
-
- if(interpolate_html.test_variable("HasTerm"))
- {
- summary_html += add_body_paragraph
- (R"(
-The term rider provides the option to purchase monthly
-term insurance on the life of the insured. The term rider
-selected face amount supplements the selected face amount
-of the contract. If the term rider is attached, the policy
-to which it is attached may have a lower annual cutoff premium
-and, as a result, the lower overall sales loads paid may be
-lower than a contract having the same total face amount,
-but with no term rider.
-{{#NoLapse}}
- Also, the lapse protection feature of the contract's
- {{NoLapseProvisionName}}
- does not apply to the term rider's selected face amount.
-{{/NoLapse}}
-)"
- );
- }
-
- if(interpolate_html.test_variable("HasWP"))
- {
- summary_html += add_body_paragraph
- (R"(
-The Waiver of Monthly Charges Rider provides for waiver
-of monthly charges in the event of the disability
-of the insured that begins before attained age 65
-and continues for at least 6 months, as described in the rider.
-An additional charge is associated with this rider. Please refer
-to your contract for specific provisions and a detailed schedule
-of charges.
-)"
- );
- }
-
- if(interpolate_html.test_variable("HasWP"))
- {
- summary_html += add_body_paragraph
- (R"(
-The Accidental Death benefit provides an additional benefit
-if death is due to accident. An additional charge is associated
-with this rider. Please refer to your contract
-for specific provisions and a detailed schedule of charges.
-)"
- );
- }
-
- summary_html += add_body_paragraph
- (R"(
-The definition of life insurance for this contract is the
-{{#DefnLifeInsIsGPT}}
- guideline premium test. The guideline single premium
- is ${{InitGSP}}
- and the guideline level premium
- is ${{InitGLP}}
-{{/DefnLifeInsIsGPT}}
-{{^DefnLifeInsIsGPT}}
- cash value accumulation test.
-{{/DefnLifeInsIsGPT}}
-)"
- );
-
- summary_html += add_body_paragraph
- (R"(
-This is an illustration only. An illustration is not intended
-to predict actual performance. Interest rates
-and values set forth in the illustration are not guaranteed.
-)"
- );
-
- summary_html += add_body_paragraph
- (R"(
-{{^StateIsTexas}}
-This illustration assumes that the currently illustrated
-non-guaranteed elements will continue unchanged
-for all years shown. This is not likely to occur
-and actual results may be more or less favorable than shown.
-The non-guaranteed benefits and values are not guaranteed
-and are based on assumptions such as interest credited
-and current monthly charges, which are subject to change by
-{{InsCoName}}.
-{{/StateIsTexas}}
-{{#StateIsTexas}}
-This illustration is based on both non-guaranteed
-and guaranteed assumptions. Non-guaranteed assumptions
-include interest rates and monthly charges.
-This illustration assumes that the currently illustrated
-non-guaranteed elements will continue unchanged
-for all years shown. This is not likely to occur
-and actual results may be more or less favorable than shown.
-Factors that may affect future policy performance include
-the company's expectations for future mortality, investments,
-persistency, profits and expenses.
-{{/StateIsTexas}}
-)"
- );
-
- writer.output_html
- (writer.get_horz_margin()
- ,writer.get_vert_margin()
- ,writer.get_page_width()
- ,summary_html
- );
+ render_page_template("narrative_summary", writer, interpolate_html);
}
};
diff --git a/narrative_summary.mustache b/narrative_summary.mustache
new file mode 100644
index 0000000..5b2482c
--- /dev/null
+++ b/narrative_summary.mustache
@@ -0,0 +1,182 @@
+{{>header}}
+
+<p align="center">NARRATIVE SUMMARY</p>
+
+<font size="-1">
+
+<p>
+{{^SinglePremium}}
+ {{PolicyMktgName}} is a
+ {{#GroupExperienceRating}}group{{/GroupExperienceRating}}
+ {{#GroupCarveout}}group{{/GroupCarveout}}
+ flexible premium adjustable life insurance contract.
+ {{#GroupExperienceRating}}
+ It is a no-load policy and is intended for large case sales.
+ It is primarily marketed to financial institutions
+ to fund certain corporate liabilities.
+ {{/GroupExperienceRating}}
+ It features accumulating account values, adjustable benefits,
+ and flexible premiums.
+{{/SinglePremium}}
+{{#SinglePremium}}
+ {{#ModifiedSinglePremiumOrModifiedSinglePremium0}}
+ {{PolicyMktgName}}
+ is a modified single premium adjustable life
+ insurance contract. It features accumulating
+ account values, adjustable benefits, and single premium.
+ {{/ModifiedSinglePremiumOrModifiedSinglePremium0}}
+ {{^ModifiedSinglePremiumOrModifiedSinglePremium0}}
+ {{PolicyMktgName}}
+ is a single premium adjustable life insurance contract.
+ It features accumulating account values,
+ adjustable benefits, and single premium.
+ {{/ModifiedSinglePremiumOrModifiedSinglePremium0}}
+{{/SinglePremium}}
+</p>
+
+{{^IsInforce}}
+ <p>
+ Coverage may be available on a Guaranteed Standard Issue basis.
+ All proposals are based on case characteristics and must
+ be approved by the {{InsCoShortName}}
+ Home Office. For details regarding underwriting
+ and coverage limitations refer to your offer letter
+ or contact your {{InsCoShortName}} representative.
+ </p>
+{{/IsInforce}}
+
+<p>
+{{AvName}} {{MonthlyChargesPaymentFootnote}}
+</p>
+
+<p>
+{{^SinglePremium}}
+ Premiums are assumed to be paid on {{ErModeLCWithArticle}}
+ basis and received at the beginning of the contract year.
+{{/SinglePremium}}
+{{#SinglePremium}}
+ The single premium is assumed to be paid at the beginning
+ of the contract year.
+{{/SinglePremium}}
+
+{{AvName}} Values, {{CsvName}} Values,
+and death benefits are illustrated as of the end
+of the contract year. The method we use to allocate
+overhead expenses is the fully allocated expense method.
+</p>
+
+{{^SinglePremium}}
+ <p>
+ In order to guarantee coverage to age
+ {{EndtAge}}, {{ErModeLCWithArticle}} premium
+ {{#HasGuarPrem}}
+ of ${{GuarPrem}} must be paid.
+ {{/HasGuarPrem}}
+ {{^HasGuarPrem}}
+ is defined.
+ {{/HasGuarPrem}}
+ This amount is based on the guaranteed monthly charges
+ and the guaranteed interest crediting rate.
+ {{#DefnLifeInsIsGPT}}
+ This premium may be in excess of the maximum premium allowable
+ in order to qualify this policy as life insurance.
+ {{/DefnLifeInsIsGPT}}
+ </p>
+{{/SinglePremium}}
+
+<p>
+Loaned amounts of the {{AvName}}
+Value will be credited a rate equal to the loan interest rate less
+a spread, guaranteed not to exceed
+{{#GroupCarveout}}
+1.25%.
+{{/GroupCarveout}}
+{{^GroupCarveout}}
+3.00%.
+{{/GroupCarveout}}
+</p>
+
+{{#HasTerm}}
+ <p>
+ The term rider provides the option to purchase monthly
+ term insurance on the life of the insured. The term rider
+ selected face amount supplements the selected face amount
+ of the contract. If the term rider is attached, the policy
+ to which it is attached may have a lower annual cutoff premium
+ and, as a result, the lower overall sales loads paid may be
+ lower than a contract having the same total face amount,
+ but with no term rider.
+ {{#NoLapse}}
+ Also, the lapse protection feature of the contract's
+ {{NoLapseProvisionName}}
+ does not apply to the term rider's selected face amount.
+ {{/NoLapse}}
+ </p>
+{{/HasTerm}}
+
+{{#HasWP}}
+ <p>
+ The Waiver of Monthly Charges Rider provides for waiver
+ of monthly charges in the event of the disability
+ of the insured that begins before attained age 65
+ and continues for at least 6 months, as described in the rider.
+ An additional charge is associated with this rider. Please refer
+ to your contract for specific provisions and a detailed schedule
+ of charges.
+ </p>
+{{/HasWP}}
+
+{{#HasADD}}
+ <p>
+ The Accidental Death benefit provides an additional benefit
+ if death is due to accident. An additional charge is associated
+ with this rider. Please refer to your contract
+ for specific provisions and a detailed schedule of charges.
+ </p>
+{{/HasADD}}
+
+<p>
+The definition of life insurance for this contract is the
+{{#DefnLifeInsIsGPT}}
+ guideline premium test. The guideline single premium
+ is ${{InitGSP}}
+ and the guideline level premium
+ is ${{InitGLP}}
+{{/DefnLifeInsIsGPT}}
+{{^DefnLifeInsIsGPT}}
+ cash value accumulation test.
+{{/DefnLifeInsIsGPT}}
+</p>
+
+<p>
+This is an illustration only. An illustration is not intended
+to predict actual performance. Interest rates
+and values set forth in the illustration are not guaranteed.
+</p>
+
+<p>
+{{^StateIsTexas}}
+ This illustration assumes that the currently illustrated
+ non-guaranteed elements will continue unchanged
+ for all years shown. This is not likely to occur
+ and actual results may be more or less favorable than shown.
+ The non-guaranteed benefits and values are not guaranteed
+ and are based on assumptions such as interest credited
+ and current monthly charges, which are subject to change by
+ {{InsCoName}}.
+{{/StateIsTexas}}
+{{#StateIsTexas}}
+ This illustration is based on both non-guaranteed
+ and guaranteed assumptions. Non-guaranteed assumptions
+ include interest rates and monthly charges.
+ This illustration assumes that the currently illustrated
+ non-guaranteed elements will continue unchanged
+ for all years shown. This is not likely to occur
+ and actual results may be more or less favorable than shown.
+ Factors that may affect future policy performance include
+ the company's expectations for future mortality, investments,
+ persistency, profits and expenses.
+{{/StateIsTexas}}
+</p>
+
+</font>
- [lmi-commits] [lmi] master 8c5be11 128/156: Use proper types for get_two_column_header() parameters, (continued)
- [lmi-commits] [lmi] master 8c5be11 128/156: Use proper types for get_two_column_header() parameters, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 257ff4b 065/156: Add numeric summary table to PDF illustrations, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master ef38c9d 141/156: Revert the title map related changes, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master b1ab0fa 126/156: Leave a gap between upper footer part and main page contents, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 940198c 059/156: Add numeric summary attachment page, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master b341a2a 061/156: Factor out using_illustration_table helper class, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 1b46585 076/156: Use MarketingNameFootnote & StateMarketingImprimatur on cover page, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 234cd39 012/156: Use custom font sizes to be closer to the existing illustrations, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 956fcca 071/156: Change the second narrative summary page to use a template too, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master dbe5955 015/156: Factor out html_interpolator from pdf_illustration, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 9665573 070/156: Change narrative summary page to use an external template,
Greg Chicares <=
- [lmi-commits] [lmi] master a629602 083/156: Use custom <scaled_image> HTML tag for the embedded images, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master b425030 082/156: Factor out html_cell_for_pdf_output from numeric_summary_table_cell, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master d99576a 069/156: Change cover page to use an external template, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 416ab02 030/156: Add support for vector variables to PDF generating code, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master d4dfaa9 075/156: Also use data directory for image files referenced from HTML, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 4f98db5 081/156: Don't show "Age 70" row in numeric summary for composites, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master f8853b9 090/156: Add "contract numbers" fragment to the header, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 61430d2 092/156: Move some variable definitions to the base illustration class, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 7ccd207 087/156: Rename "footer_contents" to more precise "page_number", Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 3a64b87 094/156: Correct misleading comment for page class dtor, Greg Chicares, 2018/01/30