From 652b384be3b905c3eb435123e5f98ab311da117f Mon Sep 17 00:00:00 2001 From: MrJimmyChevallier <103670713+MrJimmyChevallier@users.noreply.github.com> Date: Wed, 23 Oct 2024 17:54:49 +0200 Subject: [PATCH] =?UTF-8?q?update=20extractor=20probl=C3=A8me=20BENNOUR?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/src/utils/extractor.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/src/utils/extractor.js b/api/src/utils/extractor.js index 508972d0..de81ddc0 100644 --- a/api/src/utils/extractor.js +++ b/api/src/utils/extractor.js @@ -351,7 +351,7 @@ export const computeExtractDdg = async (models, allHuman, flatReferentielsList, }) const isGone = dateStop > human.dateEnd - if (isGone && sumBy(reelEtpObject, 'etp') / sumBy(reelEtpObject, 'countNbOfDays') === 1) { + if (human.dateEnd && isGone && sumBy(reelEtpObject, 'etp') / sumBy(reelEtpObject, 'countNbOfDays') === 1) { let difCalculation = (totalDays - totalDaysGone) / totalDays - (refObj[key] || 0) reelEtp = difCalculation < 0.00001 ? 0 : difCalculation } else reelEtp = sumBy(reelEtpObject, 'etp') / sumBy(reelEtpObject, 'countNbOfDays') - (refObj[key] || 0) @@ -540,7 +540,7 @@ export const computeExtract = async (models, allHuman, flatReferentielsList, cat }) const isGone = dateStop > human.dateEnd - if (isGone && sumBy(reelEtpObject, 'etp') / sumBy(reelEtpObject, 'countNbOfDays') === 1) { + if (human.dateEnd && isGone && sumBy(reelEtpObject, 'etp') / sumBy(reelEtpObject, 'countNbOfDays') === 1) { let difCalculation = (totalDays - totalDaysGone) / totalDays - (refObj[key] || 0) reelEtp = difCalculation < 0.00001 ? 0 : difCalculation } else reelEtp = sumBy(reelEtpObject, 'etp') / sumBy(reelEtpObject, 'countNbOfDays') - (refObj[key] || 0)