🐛 Changement de période de la complémentaire santé

Fixes #828
Cherry-picked from a140967
pull/848/head v1.6.0
Maxime Quandalle 2020-01-16 18:58:51 +01:00
parent 40639b676d
commit 877c4becf0
No known key found for this signature in database
GPG Key ID: 428641C03D29CA10
1 changed files with 2 additions and 0 deletions

View File

@ -101,6 +101,7 @@ function updateSituation(
function updateDefaultUnit(situation, { toUnit, analysis }) {
const unit = parseUnit(toUnit)
const goals = goalsFromAnalysis(analysis)
const convertedSituation = Object.keys(situation)
.map(
dottedName =>
@ -109,6 +110,7 @@ function updateDefaultUnit(situation, { toUnit, analysis }) {
)
.filter(
rule =>
goals?.includes(rule.dottedName) &&
(rule.unit || rule.defaultUnit) &&
!rule.unité &&
areUnitConvertible(rule.unit || rule.defaultUnit, unit)