lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master ffc600c 2/2: Round each rider charge separate


From: Greg Chicares
Subject: [lmi-commits] [lmi] master ffc600c 2/2: Round each rider charge separately
Date: Tue, 25 Aug 2020 12:15:50 -0400 (EDT)

branch: master
commit ffc600cb35757a3901560a38cb82b657a6d5c470
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>

    Round each rider charge separately
    
    Some products clearly specify that the charge for each rider is to be
    rounded separately, as common sense would suggest anyway.
    
    Commit 785e6f4acf9f of 20200812T171129Z rounded only the total charge
    for all riders. That's still desirable in addition to this new commit:
    it can ensure that the deduction for all riders combined is an integral
    number of cents, even if the new round_rider_charges() is configured
    to perform no rounding.
---
 ihs_avmly.cpp | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/ihs_avmly.cpp b/ihs_avmly.cpp
index 049d515..746eea9 100644
--- a/ihs_avmly.cpp
+++ b/ihs_avmly.cpp
@@ -1778,17 +1778,21 @@ void AccountValue::TxSetRiderDed()
     if(yare_input_.AccidentalDeathBenefit)
         {
         AdbCharge = YearsAdbRate * std::min(ActualSpecAmt, AdbLimit);
+        AdbCharge = round_rider_charges()(AdbCharge);
         }
 
     SpouseRiderCharge = 0.0;
     if(yare_input_.SpouseRider)
         {
         SpouseRiderCharge = YearsSpouseRiderRate * 
yare_input_.SpouseRiderAmount;
+        SpouseRiderCharge = round_rider_charges()(SpouseRiderCharge);
         }
+
     ChildRiderCharge = 0.0;
     if(yare_input_.ChildRider)
         {
         ChildRiderCharge = YearsChildRiderRate * yare_input_.ChildRiderAmount;
+        ChildRiderCharge = round_rider_charges()(ChildRiderCharge);
         }
 
     TermCharge = 0.0;
@@ -1796,6 +1800,7 @@ void AccountValue::TxSetRiderDed()
     if(TermRiderActive)
         {
         TermCharge    = YearsTermRate   * TermDB * DBDiscountRate[Year];
+        TermCharge    = round_rider_charges()(TermCharge);
         // TAXATION !! Integrated term: s/TermDB/TermSpecAmt/ because
         // it can't go into the corridor under tax assumptions.
         // TAXATION !! Use a distinct discount rate for taxation? Or
@@ -1812,6 +1817,7 @@ void AccountValue::TxSetRiderDed()
             case oe_waiver_times_specamt:
                 {
                 WpCharge = YearsWpRate * std::min(ActualSpecAmt, WpLimit);
+                WpCharge = round_rider_charges()(WpCharge);
                 DcvWpCharge = WpCharge;
                 }
                 break;
@@ -1830,6 +1836,7 @@ void AccountValue::TxSetRiderDed()
                         +   ChildRiderCharge
                         +   TermCharge
                         );
+                WpCharge = round_rider_charges()(WpCharge);
                 DcvWpCharge =
                     YearsWpRate
                     *   (
@@ -1871,6 +1878,8 @@ void AccountValue::TxDoMlyDed()
         +   DcvWpCharge
         ;
 
+    // Round total rider charges, even if each individual charge was
+    // not rounded, so that deductions can be integral cents.
     RiderCharges = round_minutiae()(simple_rider_charges + TermCharge + 
WpCharge);
     YearsTotalRiderCharges += RiderCharges;
     MlyDed = CoiCharge + RiderCharges;



reply via email to

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