Fix: hightlights depends on period

This commit is contained in:
Bertrand Benjamin 2021-08-04 21:20:21 +02:00
parent 5683b57e24
commit 4d77e61b25

View File

@ -101,9 +101,9 @@ const travail = {
// Amount of mounts // Amount of mounts
return Object.keys(getters.months).length return Object.keys(getters.months).length
}, },
ca: (state) => { ca: (state, getters) => {
// Total CA (ca_react if sets, ca_retro otherwise) // Total CA (ca_react if sets, ca_retro otherwise)
return Object.values(state.months).map(a => monthCA(a)).reduce( return Object.values(getters.months).map(a => monthCA(a)).reduce(
(acc, v) => acc + v, (acc, v) => acc + v,
0 0
) )
@ -115,30 +115,30 @@ const travail = {
0 0
) / getters.count) ) / getters.count)
}, },
caTheo: (state) => { caTheo: (state, getters) => {
// Total theorical CA // Total theorical CA
return Object.values(state.months).map(a => a.ca_theo).reduce( return Object.values(getters.months).map(a => a.ca_theo).reduce(
(acc, v) => acc + v, (acc, v) => acc + v,
0 0
) )
}, },
remuneration: (state) => { remuneration: (state, getters) => {
// Total remuneration // Total remuneration
return Object.values(state.months).map(a => a.remuneration).reduce( return Object.values(getters.months).map(a => a.remuneration).reduce(
(acc, v) => acc + v, (acc, v) => acc + v,
0 0
) )
}, },
remunerationMean: (state, getters) => { remunerationMean: (state, getters) => {
// Mean of remuneration // Mean of remuneration
return Math.floor(Object.values(state.months).map(a => a.remuneration).reduce( return Math.floor(Object.values(getters.months).map(a => a.remuneration).reduce(
(acc, v) => acc + v, (acc, v) => acc + v,
0 0
) / getters.count) ) / getters.count)
}, },
retrocession: (state) => { retrocession: (state, getters) => {
// Total retrocession // Total retrocession
return Object.values(state.months) return Object.values(getters.months)
.map(a => a.retro) .map(a => a.retro)
.reduce( .reduce(
(acc, v) => acc + v, (acc, v) => acc + v,
@ -148,7 +148,7 @@ const travail = {
retrocessionMean: (state, getters) => { retrocessionMean: (state, getters) => {
// Mean of retrocession // Mean of retrocession
return Math.floor( return Math.floor(
Object.values(state.months) Object.values(getters.months)
.map(a => a.retro) .map(a => a.retro)
.reduce( .reduce(
(acc, v) => acc + v, (acc, v) => acc + v,