[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 9878b92 02/10: Refactor
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 9878b92 02/10: Refactor |
Date: |
Fri, 4 Sep 2020 21:16:09 -0400 (EDT) |
branch: master
commit 9878b921c0d6ef1524576b580eeed3b16290610a
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>
Refactor
---
account_value.hpp | 1 +
ihs_acctval.cpp | 71 +++++++++++++++++++++++++++++--------------------------
2 files changed, 39 insertions(+), 33 deletions(-)
diff --git a/account_value.hpp b/account_value.hpp
index 6c1f1c3..3ec5a12 100644
--- a/account_value.hpp
+++ b/account_value.hpp
@@ -288,6 +288,7 @@ class LMI_SO AccountValue final
void set_list_bill_year_and_month();
void set_list_bill_premium();
+ void set_modal_min_premium();
void SetMaxLoan ();
void SetMaxWD ();
diff --git a/ihs_acctval.cpp b/ihs_acctval.cpp
index c8bf08f..d2a6499 100644
--- a/ihs_acctval.cpp
+++ b/ihs_acctval.cpp
@@ -872,39 +872,7 @@ void AccountValue::InitializeSpecAmt()
ActualSpecAmt = InvariantValues().SpecAmt[Year];
TermSpecAmt = InvariantValues().TermSpecAmt[Year];
- // These "modal minimum" premiums are designed for group plans.
- // They are intended roughly to approximate the minimum payment
- // (at a modal frequency chosen by the employer) necessary to
- // prevent lapse if no other premium is paid.
- //
- // Some products apportion them explicitly between ee and er. For
- // those that don't, convention deems the er to pay it all.
- //
- // Most other yearly values are posted to InvariantValues() in
- // FinalizeYear(), but it seems clearer to post these here where
- // they're calculated along with 'MlyNoLapsePrem'.
- if(!SplitMinPrem)
- {
- auto const z = GetModalMinPrem
- (Year
- ,Outlay_->er_premium_modes()[Year]
- ,InvariantValues().SpecAmt[Year]
- );
- InvariantValues().ModalMinimumPremium[Year] = z;
- InvariantValues().ErModalMinimumPremium[Year] = z;
- }
- else
- {
- auto const z = GetModalPremMlyDedEx
- (Year
- ,Outlay_->er_premium_modes()[Year]
- ,InvariantValues().SpecAmt[Year]
- ,InvariantValues().TermSpecAmt[Year]
- );
- InvariantValues().EeModalMinimumPremium[Year] = z.first;
- InvariantValues().ErModalMinimumPremium[Year] = z.second;
- InvariantValues().ModalMinimumPremium[Year] = z.first + z.second;
- }
+ set_modal_min_premium();
// No-lapse premium generally changes whenever specamt changes for
// any reason (e.g., elective increases or decreases, DBO changes,
@@ -995,6 +963,43 @@ void AccountValue::set_list_bill_premium()
}
}
+void AccountValue::set_modal_min_premium()
+{
+ // These "modal minimum" premiums are designed for group plans.
+ // They are intended roughly to approximate the minimum payment
+ // (at a modal frequency chosen by the employer) necessary to
+ // prevent lapse if no other premium is paid.
+ //
+ // Some products apportion them explicitly between ee and er. For
+ // those that don't, convention deems the er to pay it all.
+ //
+ // Most other yearly values are posted to InvariantValues() in
+ // FinalizeYear(), but it seems clearer to post these here where
+ // they're calculated along with 'MlyNoLapsePrem'.
+ if(!SplitMinPrem)
+ {
+ auto const z = GetModalMinPrem
+ (Year
+ ,Outlay_->er_premium_modes()[Year]
+ ,InvariantValues().SpecAmt[Year]
+ );
+ InvariantValues().ModalMinimumPremium[Year] = z;
+ InvariantValues().ErModalMinimumPremium[Year] = z;
+ }
+ else
+ {
+ auto const z = GetModalPremMlyDedEx
+ (Year
+ ,Outlay_->er_premium_modes()[Year]
+ ,InvariantValues().SpecAmt[Year]
+ ,InvariantValues().TermSpecAmt[Year]
+ );
+ InvariantValues().EeModalMinimumPremium[Year] = z.first;
+ InvariantValues().ErModalMinimumPremium[Year] = z.second;
+ InvariantValues().ModalMinimumPremium[Year] = z.first + z.second;
+ }
+}
+
/// Surrender charge.
///
/// The "cash value enhancement" components should be implemented as
- [lmi-commits] [lmi] master updated (520bb97 -> c4f84b4), Greg Chicares, 2020/09/04
- [lmi-commits] [lmi] master f2e2cd7 01/10: Refactor to do less work, Greg Chicares, 2020/09/04
- [lmi-commits] [lmi] master 9878b92 02/10: Refactor,
Greg Chicares <=
- [lmi-commits] [lmi] master 8fa4ca4 03/10: Reformat and append to commentary, Greg Chicares, 2020/09/04
- [lmi-commits] [lmi] master 4f10238 05/10: Rename a local variable, Greg Chicares, 2020/09/04
- [lmi-commits] [lmi] master 42f390d 06/10: Improve documentation, Greg Chicares, 2020/09/04
- [lmi-commits] [lmi] master e8c4054 04/10: Localize a data member, Greg Chicares, 2020/09/04
- [lmi-commits] [lmi] master e360e0d 07/10: Add some commentary on a marked defect, Greg Chicares, 2020/09/04
- [lmi-commits] [lmi] master 6a54fd9 09/10: Never read 7702 or 7702A specamt directly from LedgerInvariant, Greg Chicares, 2020/09/04
- [lmi-commits] [lmi] master f474d10 08/10: Prepare to abstract specified amount, Greg Chicares, 2020/09/04
- [lmi-commits] [lmi] master c4f84b4 10/10: Never read specamt directly from LedgerInvariant, Greg Chicares, 2020/09/04