Good morning,
We have recently updated our Polisadministratie component to the latest version and the necessary components for that.
Also with the new way of managing discount and surcharges. We only stumbled upon the following error, but cannot explain why it happens:
I’ve traced it down to the function discounted_premium_per_day() and it only happens to some of the coverages on a system version.
When I got the full expression from the function out of the architect:
{
systemversions,
premium_per_day().multperc(
Percentage:if(
SystemVersionDiscountAndSurcharges:count({
SystemVersionDiscountAndSurcharges,
this,
Boolean:and([
system_version.equals(parent),
discount.is_discount_percentages(),
percentage.equals(Percentage:load(1.0)),
discount.discount_or_surcharge.equals(NDiscountsurcharge:load(0))
])
}).equals(Int:load(0)),
Percentage:product({
SystemVersionDiscountAndSurcharges,
percentage,
Boolean:and([
system_version.equals(parent),
discount.is_discount_percentages(),
Boolean:not(
Boolean:and([
discount.discount_or_surcharge.equals(NDiscountsurcharge:load(0)),
percentage.equals(Percentage:load(1.0))
])
)
])
}),
Percentage:load(0.0)
)
)}
In that expression I traced it back to
Percentage:product({
SystemVersionDiscountAndSurcharges,
percentage,
Boolean:and([
system_version.equals(parent),
discount.is_discount_percentages(),
Boolean:not(
Boolean:and([
discount.discount_or_surcharge.equals(NDiscountsurcharge:load(0)),
percentage.equals(Percentage:load(1.0))
])
)
])
})
And it is in the percentage:product() function. It breaks on the below percentage (a negative number). The coverages with positive numbers it runs fine.
But the weird thing is if I call percentage:product(percentage:load(-0.5012)) in the system debugger it just returns it without any problems.
I’m at a loss what the problem could be.
Any help would be appreciated!
Kind regards,
Timothy

