Skip to content

Commit

Permalink
update extractor problème BENNOUR
Browse files Browse the repository at this point in the history
  • Loading branch information
MrJimmyChevallier committed Oct 23, 2024
1 parent 9a5acb0 commit 652b384
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions api/src/utils/extractor.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 652b384

Please sign in to comment.