From c47062ce861308969fafb5ca0c6afd5604ca5fb2 Mon Sep 17 00:00:00 2001 From: Bertrand Benjamin Date: Mon, 9 Aug 2021 14:07:42 +0200 Subject: [PATCH] Feat: add hightlights --- src/components/hightlights.vue | 24 ++++++++++++++++++++++++ src/store/config/index.js | 5 +++-- src/store/travail/index.js | 12 ++++++++++++ 3 files changed, 39 insertions(+), 2 deletions(-) diff --git a/src/components/hightlights.vue b/src/components/hightlights.vue index c676959..8032b2f 100644 --- a/src/components/hightlights.vue +++ b/src/components/hightlights.vue @@ -48,6 +48,24 @@
  • Rétrocession moyenne
  • +
    + +
    +
    + +
    +
    + +
    @@ -61,6 +79,9 @@ export default { return {} }, computed: { + ...mapGetters('config', { + caProPercentage: 'caProPercentage', + }), ...mapGetters('travail', { ca: "ca", caMean: "caMean", @@ -69,6 +90,9 @@ export default { remunerationMean: "remunerationMean", retrocession: "retrocession", retrocessionMean: "retrocessionMean", + caPro: "caPro", + caPerso: "caPerso", + caPersoUntouch: "caPersoUntouch", }) }, mounted () { diff --git a/src/store/config/index.js b/src/store/config/index.js index 1513ee9..e119a65 100644 --- a/src/store/config/index.js +++ b/src/store/config/index.js @@ -8,12 +8,14 @@ const config = { return { //userDir: '~/.config/sousmargot/', userDir: './userDir/', - dataFile: 'datas.csv' + dataFile: 'datas.csv', + caProPercentage: 0.5, } }, getters: { userDir (state) { return state.userDir }, dataFilePath (state) { return path.join(state.userDir, state.dataFile) }, + caProPercentage (state) { return state.caProPercentage }, }, mutations: { }, @@ -39,4 +41,3 @@ const config = { } export default config - diff --git a/src/store/travail/index.js b/src/store/travail/index.js index 50093bc..9ffdb65 100644 --- a/src/store/travail/index.js +++ b/src/store/travail/index.js @@ -157,6 +157,18 @@ const travail = { return Math.floor(getters.retrocession / getters.count ) }, + caPro: (state, getters, rootState, rootGetters) => { + // Part of the CA to keep for professional use + return getters.ca * rootGetters['config/caProPercentage'] + }, + caPerso: (state, getters) => { + // Part of the CA to keep for personal use + return getters.ca - getters.caPro + }, + caPersoUntouch: (state, getters) => { + // Part of the personnal use CA that haven't been use + return getters.caPerso - getters.remuneration + }, }, mutations: { cleanMonths (state) {