lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [6560] Deduce plan type


From: Greg Chicares
Subject: [lmi-commits] [6560] Deduce plan type
Date: Thu, 05 May 2016 14:39:20 +0000

Revision: 6560
          http://svn.sv.gnu.org/viewvc/?view=rev&root=lmi&revision=6560
Author:   chicares
Date:     2016-05-05 14:39:20 +0000 (Thu, 05 May 2016)
Log Message:
-----------
Deduce plan type

Modified Paths:
--------------
    lmi/trunk/ChangeLog
    lmi/trunk/group_quote_pdf_gen_wx.cpp

Modified: lmi/trunk/ChangeLog
===================================================================
--- lmi/trunk/ChangeLog 2016-05-05 11:20:18 UTC (rev 6559)
+++ lmi/trunk/ChangeLog 2016-05-05 14:39:20 UTC (rev 6560)
@@ -38979,3 +38979,8 @@
   group_quote_pdf_gen_wx.cpp
 Refactor to increase flexibility.
 
+20160505T1439Z <address@hidden> [451]
+
+  group_quote_pdf_gen_wx.cpp
+Deduce plan type.
+

Modified: lmi/trunk/group_quote_pdf_gen_wx.cpp
===================================================================
--- lmi/trunk/group_quote_pdf_gen_wx.cpp        2016-05-05 11:20:18 UTC (rev 
6559)
+++ lmi/trunk/group_quote_pdf_gen_wx.cpp        2016-05-05 14:39:20 UTC (rev 
6560)
@@ -553,6 +553,9 @@
         std::string effective_date_;
         std::string footer_;
 
+        // Dynamically-determined fields.
+        std::string plan_type_footnote_;
+
         // Optional supplementary fields.
         std::vector<extra_summary_field> extra_fields_;
         };
@@ -611,10 +614,15 @@
     page_metrics page_;
 
     int row_num_;
+
+    bool has_suppl_specamt_;
+
+    std::string plan_type_;
 };
 
 group_quote_pdf_generator_wx::group_quote_pdf_generator_wx()
     :row_num_(0)
+    ,has_suppl_specamt_(false)
 {
 }
 
@@ -652,6 +660,7 @@
     footer_ =
           brbr (invar.GroupQuoteIsNotAnOffer)
         + brbr (invar.GroupQuoteRidersFooter)
+        + brbr (plan_type_footnote_)
         + brbr (invar.GroupQuotePolicyFormId)
         + brbr (invar.GroupQuoteStateVariations)
         + brbr (invar.MarketingNameFootnote)
@@ -671,6 +680,7 @@
 
     assert_nonblank(invar.GroupQuoteIsNotAnOffer   , "First footnote");
     assert_nonblank(invar.GroupQuoteRidersFooter   , "Second footnote");
+    // treat plan_type_footnote_ similarly, soon
     assert_nonblank(invar.GroupQuotePolicyFormId   , "Third footnote");
     assert_nonblank(invar.GroupQuoteStateVariations, "Fourth footnote");
     assert_nonblank(invar.MarketingNameFootnote    , "Fifth footnote");
@@ -756,6 +766,7 @@
             case e_col_supplemental_face_amount:
                 {
                 double const z = invar.TermSpecAmt.at(year);
+                has_suppl_specamt_ = has_suppl_specamt_ || 0.0 != z;
                 rd.values[col] = '$' + ledger_format(z, f0);
                 if(is_composite)
                     {
@@ -813,6 +824,16 @@
     // total columns) be suppressed.
     if(is_composite)
         {
+        plan_type_ =
+            (invar.GroupIndivSelection ? invar.GroupQuoteRubricVoluntary
+            :has_suppl_specamt_        ? invar.GroupQuoteRubricFusion
+            :                            invar.GroupQuoteRubricMandatory
+            );
+        report_data_.plan_type_footnote_ =
+            (invar.GroupIndivSelection ? invar.GroupQuoteFooterVoluntary
+            :has_suppl_specamt_        ? invar.GroupQuoteFooterFusion
+            :                            invar.GroupQuoteFooterMandatory
+            );
         report_data_.fill_global_report_data(ledger);
         }
     else
@@ -1165,8 +1186,12 @@
         );
     }
 
-    // Then add any additional fields in left-to-right then top-to-bottom 
order.
-    std::vector<extra_summary_field> const& fields = 
report_data_.extra_fields_;
+    // Add a "plan type" field, then any additional fields,
+    // in left-to-right then top-to-bottom order.
+    std::vector<extra_summary_field> fields;
+    fields.push_back(extra_summary_field({"Plan Type", plan_type_}));
+    std::vector<extra_summary_field> const& f = report_data_.extra_fields_;
+    fields.insert(fields.end(), f.begin(), f.end());
 
     typedef std::vector<extra_summary_field>::const_iterator esfci;
     for(esfci i = fields.begin(); i != fields.end();)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]