lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [5053] Move premium-tax database lookup out of class Loads


From: Greg Chicares
Subject: [lmi-commits] [5053] Move premium-tax database lookup out of class Loads
Date: Fri, 23 Jul 2010 10:29:11 +0000

Revision: 5053
          http://svn.sv.gnu.org/viewvc/?view=rev&root=lmi&revision=5053
Author:   chicares
Date:     2010-07-23 10:29:11 +0000 (Fri, 23 Jul 2010)
Log Message:
-----------
Move premium-tax database lookup out of class Loads

Modified Paths:
--------------
    lmi/trunk/ChangeLog
    lmi/trunk/ihs_basicval.cpp
    lmi/trunk/ledger_invariant.cpp
    lmi/trunk/loads.cpp
    lmi/trunk/loads_impl.hpp
    lmi/trunk/loads_test.cpp

Modified: lmi/trunk/ChangeLog
===================================================================
--- lmi/trunk/ChangeLog 2010-07-22 22:55:41 UTC (rev 5052)
+++ lmi/trunk/ChangeLog 2010-07-23 10:29:11 UTC (rev 5053)
@@ -26453,3 +26453,19 @@
 Remove an obsolete defect marker. Code that attempted to avoid a MEC
 by increasing specified amount was removed long ago.
 
+20100722T2255Z <address@hidden> [685]
+
+  basic_values.hpp
+  basicvalues.cpp
+  ihs_basicval.cpp
+Add members that will soon become useful for premium-tax calculations.
+
+20100723T1029Z <address@hidden> [685]
+
+  ihs_basicval.cpp
+  ledger_invariant.cpp
+  loads.cpp
+  loads_impl.hpp
+  loads_test.cpp
+Move premium-tax database lookup out of class Loads.
+

Modified: lmi/trunk/ihs_basicval.cpp
===================================================================
--- lmi/trunk/ihs_basicval.cpp  2010-07-22 22:55:41 UTC (rev 5052)
+++ lmi/trunk/ihs_basicval.cpp  2010-07-23 10:29:11 UTC (rev 5053)
@@ -821,6 +821,22 @@
 /// Set all parameters that depend on premium-tax state.
 ///
 /// (For the nonce, state of jurisdiction is used instead.)
+///
+/// These database entities should be looked up by tax state:
+///  - DB_PremTaxLoad
+///  - DB_PremTaxRate
+///  - DB_PremTaxRetalLimit
+/// These probably (for inchoate amortization) shouldn't:
+///  - DB_PremTaxAmortPeriod
+///  - DB_PremTaxAmortIntRate
+/// This definitely shouldn't be:
+///  - DB_PremTaxState
+/// These aren't used anywhere yet:
+///  - DB_PremTaxFundCharge
+///  - DB_PremTaxTable
+///  - DB_PremTaxTierGroup
+///  - DB_PremTaxTierPeriod
+///  - DB_PremTaxTierNonDecr
 
 void BasicValues::SetPremiumTaxParameters()
 {
@@ -838,13 +854,11 @@
 
     // TODO ?? It would be better not to constrain so many things
     // not to vary by duration by using Query(enumerator).
-    StateOfDomicile_    = 
mc_state_from_string(ProductData_->datum("InsCoDomicile"));
 
-    // TODO ?? Perhaps we want the premium-tax load instead of the
-    // premium-tax rate here; or maybe we want neither as a member
-    // variable, since the premium-tax load is in the loads class.
-    PremiumTaxRate_     = Database_->Query(DB_PremTaxRate);
+    PremiumTaxRate_ = Database_->Query(DB_PremTaxRate);
+    PremiumTaxLoad_ = Database_->Query(DB_PremTaxLoad);
 
+    StateOfDomicile_ = 
mc_state_from_string(ProductData_->datum("InsCoDomicile"));
     {
     yare_input YI(*Input_);
     YI.State            = GetStateOfDomicile();
@@ -856,6 +870,7 @@
         DomiciliaryPremiumTaxLoad_ = TempDatabase.Query(DB_PremTaxLoad);
         }
     }
+
     TestPremiumTaxLoadConsistency();
 
     FirstYearPremiumRetaliationLimit_ = Database_->Query(DB_PremTaxRetalLimit);

Modified: lmi/trunk/ledger_invariant.cpp
===================================================================
--- lmi/trunk/ledger_invariant.cpp      2010-07-22 22:55:41 UTC (rev 5052)
+++ lmi/trunk/ledger_invariant.cpp      2010-07-23 10:29:11 UTC (rev 5053)
@@ -753,17 +753,13 @@
     PartMortTableName       = "1983 GAM"; // TODO ?? Hardcoded.
     StatePostalAbbrev       = mc_str(b->GetStateOfJurisdiction());
 
+    // SOMEDAY !! No output form uses these as of 2010-07; for now at
+    // least, they're assumed to be scalars.
+    // TODO ?? Some states have tiered rates, which probably shouldn't
+    // be represented as single scalars. Should these variables simply
+    // be removed?
     StatePremTaxRate        = b->PremiumTaxRate();
-    // SOMEDAY !! No output form uses this as of 2010-07; for now at
-    // least, it's assumed to be a scalar unless it is tiered.
-    StatePremTaxLoad        = b->Loads_->premium_tax_load()[0];
-    LMI_ASSERT
-        (PremiumTaxLoadIsTiered || each_equal
-            (b->Loads_->premium_tax_load().begin()
-            ,b->Loads_->premium_tax_load().end()
-            ,b->Loads_->premium_tax_load().front()
-            )
-        );
+    StatePremTaxLoad        = b->PremiumTaxLoad();
     DacTaxPremLoadRate      = b->Loads_->dac_tax_load()[0];
     // SOMEDAY !! No output form uses this as of 2010-07; for now at
     // least, it's assumed to be scalar.

Modified: lmi/trunk/loads.cpp
===================================================================
--- lmi/trunk/loads.cpp 2010-07-22 22:55:41 UTC (rev 5052)
+++ lmi/trunk/loads.cpp 2010-07-23 10:29:11 UTC (rev 5053)
@@ -57,8 +57,9 @@
     load_details details
         (length
         ,V.yare_input_.AmortizePremiumLoad
+        ,V.PremiumTaxLoad()
         ,V.LowestPremiumTaxLoad()
-        ,V.Database_->Query(DB_PremTaxRate)
+        ,V.PremiumTaxRate()
         ,V.Database_->Query(DB_PremTaxAmortIntRate)
         ,V.Database_->Query(DB_PremTaxAmortPeriod)
         ,V.Database_->Query(DB_AssetChargeType)
@@ -125,7 +126,6 @@
 void Loads::Initialize(product_database const& database)
 {
     database.Query(refundable_sales_load_proportion_   , DB_LoadRfdProportion 
);
-    database.Query(premium_tax_load_                   , DB_PremTaxLoad       
);
     database.Query(dac_tax_load_                       , DB_DacTaxPremLoad    
);
 
     database.Query(monthly_policy_fee_   [mce_gen_guar], DB_GuarMonthlyPolFee 
);
@@ -151,6 +151,8 @@
 
 void Loads::Calculate(load_details const& details)
 {
+    premium_tax_load_.assign(details.length_, details.premium_tax_load_);
+
     for(int j = mce_gen_curr; j != mc_n_gen_bases; j++)
         {
         // ET !! PETE could support an apply-and-assign operation, e.g.:

Modified: lmi/trunk/loads_impl.hpp
===================================================================
--- lmi/trunk/loads_impl.hpp    2010-07-22 22:55:41 UTC (rev 5052)
+++ lmi/trunk/loads_impl.hpp    2010-07-23 10:29:11 UTC (rev 5053)
@@ -45,6 +45,9 @@
 ///
 /// length_: Number of elements in any vector of loads.
 ///
+/// premium_tax_load_: Rate of passed-through premium tax, assumed to
+/// be a scalar.
+///
 /// LowestPremiumTaxLoadRate_: The lowest rate of premium tax, which
 /// products that pass through premium tax need for 7702 calculations.
 /// The actual rate may vary if it is tiered.
@@ -82,6 +85,7 @@
     load_details
         (int                        length
         ,bool                       AmortizePremLoad
+        ,double                     premium_tax_load
         ,double                     LowestPremiumTaxLoadRate
         ,double                     premium_tax_rate
         ,double                     premium_tax_amortization_rate
@@ -97,6 +101,7 @@
         )
         :length_                          (length)
         ,AmortizePremLoad_                (AmortizePremLoad)
+        ,premium_tax_load_                (premium_tax_load)
         ,LowestPremiumTaxLoadRate_        (LowestPremiumTaxLoadRate)
         ,premium_tax_rate_                (premium_tax_rate)
         ,premium_tax_amortization_rate_   (premium_tax_amortization_rate)
@@ -113,6 +118,7 @@
 
     int                        length_;
     bool                       AmortizePremLoad_;
+    double                     premium_tax_load_;
     double                     LowestPremiumTaxLoadRate_;
     double                     premium_tax_rate_;
     double                     premium_tax_amortization_rate_;

Modified: lmi/trunk/loads_test.cpp
===================================================================
--- lmi/trunk/loads_test.cpp    2010-07-22 22:55:41 UTC (rev 5052)
+++ lmi/trunk/loads_test.cpp    2010-07-23 10:29:11 UTC (rev 5053)
@@ -86,7 +86,6 @@
 void LoadsTest::Reinitialize()
 {
     loads_.refundable_sales_load_proportion_    = std::vector<double>(length, 
0.50000);
-    loads_.premium_tax_load_                    = std::vector<double>(length, 
0.02100);
     loads_.dac_tax_load_                        = std::vector<double>(length, 
0.00500);
 
     loads_.monthly_policy_fee_   [mce_gen_guar] = std::vector<double>(length, 
8.00000);
@@ -200,6 +199,7 @@
     load_details details
         (length                 // length_
         ,false                  // AmortizePremLoad_
+        ,0.021                  // premium_tax_load_
         ,0.02                   // LowestPremiumTaxLoadRate_
         ,999.999                // premium_tax_rate_                [unused]
         ,999.999                // premium_tax_amortization_rate_   [unused]




reply via email to

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