diff --git a/R/InsuranceContract.R b/R/InsuranceContract.R index a7a1a1d054580059894097ae4f2ddaf4d2b6fe16..a353f2eb39f18e0e31a18a7f7b78f4691b63fa69 100644 --- a/R/InsuranceContract.R +++ b/R/InsuranceContract.R @@ -479,7 +479,7 @@ InsuranceContract = R6Class( # Override with arguments explicitly given arguments = list(...) params[names(arguments)] = arguments[names(arguments)] - params$comment = sprintf("Dynamic increase at time %d to sum %02f", t, NewSumInsured) + params$comment = sprintf("Dynamic increase at time %d to sum %0.2f", t, NewSumInsured) do.call(self$addBlock, params) }, @@ -725,6 +725,11 @@ InsuranceContract = R6Class( self$Values$basicData = consolidateField("basicData") # self$Values$basicData[,c("InterestRate", "PolicyDuration", "PremiumPeriod")] = NULL + # Some fields can NOT be summed, but have to be left untouched. + # Hard-code these to use the values from the main contract part: + self$Values$reservesBalanceSheet[,c("date", "time")] = self$blocks[[1]]$Values$reservesBalanceSheet[,c("date", "time")] + self$Values$basicData[,c("InterestRate", "PolicyDuration", "PremiumPeriod")] = self$blocks[[1]]$Values$basicData[,c("InterestRate", "PolicyDuration", "PremiumPeriod")] + invisible(self) },