parent
e718537a36
commit
8c81b42a62
|
@ -102,7 +102,6 @@ function updateSituation(
|
|||
function updateDefaultUnit(situation, { toUnit, analysis }) {
|
||||
const unit = parseUnit(toUnit)
|
||||
const goals = goalsFromAnalysis(analysis)
|
||||
console.log(goals)
|
||||
const convertedSituation = Object.keys(situation)
|
||||
.map(
|
||||
dottedName =>
|
||||
|
@ -111,10 +110,11 @@ function updateDefaultUnit(situation, { toUnit, analysis }) {
|
|||
)
|
||||
.filter(
|
||||
rule =>
|
||||
goals?.includes(rule.dottedName) &&
|
||||
(rule.unit || rule.defaultUnit) &&
|
||||
!rule.unité &&
|
||||
areUnitConvertible(rule.unit || rule.defaultUnit, unit)
|
||||
rule.dottedName === 'entreprise . charges' || // HACK en attendant de revoir le fonctionnement des unités
|
||||
(goals?.includes(rule.dottedName) &&
|
||||
(rule.unit || rule.defaultUnit) &&
|
||||
!rule.unité &&
|
||||
areUnitConvertible(rule.unit || rule.defaultUnit, unit))
|
||||
)
|
||||
.reduce(
|
||||
(convertedSituation, rule) => ({
|
||||
|
|
Loading…
Reference in New Issue