lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master 4f98db5 081/156: Don't show "Age 70" row in n


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 4f98db5 081/156: Don't show "Age 70" row in numeric summary for composites
Date: Tue, 30 Jan 2018 17:22:16 -0500 (EST)

branch: master
commit 4f98db5cac10aa9aaf23d680695c95ebe8db570f
Author: Vadim Zeitlin <address@hidden>
Commit: Vadim Zeitlin <address@hidden>

    Don't show "Age 70" row in numeric summary for composites
    
    "Age" is not defined for a composite illustration.
---
 ledger_pdf_generator_wx.cpp | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/ledger_pdf_generator_wx.cpp b/ledger_pdf_generator_wx.cpp
index 69aec5d..f85792b 100644
--- a/ledger_pdf_generator_wx.cpp
+++ b/ledger_pdf_generator_wx.cpp
@@ -1039,6 +1039,17 @@ class numeric_summary_table_cell
                 continue;
                 }
 
+            // Last row, showing the values for "Age 70" normally, needs to be
+            // handled specially.
+            bool const is_last_row = &year == &summary_years.back();
+
+            // For composite ledgers, "Age" doesn't make sense and so this row
+            // should be just skipped for them.
+            if(is_last_row && ledger.is_composite())
+                {
+                continue;
+                }
+
             switch(output_mode)
                 {
                 case e_output_measure_only:
@@ -1054,7 +1065,7 @@ class numeric_summary_table_cell
                         // policy year in the last row with the age.
                         if(col == column_policy_year)
                             {
-                            if(&year == &summary_years.back())
+                            if(is_last_row)
                                 {
                                 std::ostringstream oss;
                                 oss << "Age " << age_last;



reply via email to

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