From 5eb9837e1cf54dec1108ab6a027ca2f238a526f3 Mon Sep 17 00:00:00 2001 From: Bertrand Benjamin Date: Fri, 13 Aug 2021 10:19:26 +0200 Subject: [PATCH] Feat: computed attributes for months --- src/components/MonthPresentation.vue | 59 ++++++++++++----------- src/store/config/index.js | 71 ++++++++++++++++++++++++---- 2 files changed, 93 insertions(+), 37 deletions(-) diff --git a/src/components/MonthPresentation.vue b/src/components/MonthPresentation.vue index 631005e..a4abeb4 100644 --- a/src/components/MonthPresentation.vue +++ b/src/components/MonthPresentation.vue @@ -1,32 +1,30 @@ @@ -98,7 +96,7 @@ export default { margin: 20px; } - .date { + #date { font-size: 1em; font-weight: bold; border-right: 1px solid black; @@ -107,18 +105,24 @@ export default { font-size: 2em; } - ul { + #display { list-style-type: none; padding: 0; display: flex; flex-flow: row wrap; + align-items: center; + justify-content: space-around; } - li { + #display > * { margin: 3px; - width: 30%; + width: 80px; display: flex; flex-direction: column-reverse; } + label{ + text-align: right; + font-size: 0.8em; + } .value { font-size: 1.5em; font-weight: bold; @@ -133,4 +137,5 @@ export default { font-size: 0.8em; width: auto; } + diff --git a/src/store/config/index.js b/src/store/config/index.js index a9cd4a0..4b7716c 100644 --- a/src/store/config/index.js +++ b/src/store/config/index.js @@ -1,6 +1,13 @@ import path from 'path' import Papa from 'papaparse' import { writeFile } from 'fs' +import { + ca, + notInvoiced, + caPro, + caPerso, + caPersoUntouch, +} from '../../lib/months.js' const config = { namespaced: true, @@ -12,68 +19,112 @@ const config = { caProPercentage: 0.5, monthDesc : [ { + name: 'caTheo', color: '', desc: 'CA "scéances effectuées"', type: 'base', - name: 'caTheo', unit: '€', - hightlight: true, + hightlight: false, output: month => month.caTheo, }, { + name: 'caRetro', color: '', desc: 'CA "Séances facturées"', type: 'base', - name: 'caRetro', unit: '€', hightlight: false, output: month => month.caRetro, }, { + name: 'caReact', color: '', desc: 'CA "Séances facturées" réactualisé', type: 'base', - name: 'caReact', unit: '€', - hightlight: true, + hightlight: false, output: month => month.caReact, }, { + name: 'sessionQty', color: '', desc: 'Nombre de séances effectuées', - type: 'base', - name: 'sessionQty', unit: '', hightlight: false, output: month => month.sessionQty, }, { + name: 'retro', color: '', desc: 'Montant de la rétrocession', type: 'base', - name: 'retro', unit: '€', hightlight: false, output: month => month.retro, }, { + name: 'remuneration', color: '', desc: 'Rémuneration', type: 'base', - name: 'remuneration', unit: '€', hightlight: true, output: month => month.remuneration, }, { + name: 'proPercentage', color: '', desc: 'Pourcentage du CA pour la partie pro', type: 'base', - name: 'proPercentage', unit: '%', hightlight: false, output: month => month.proPercentage, }, + { + name: 'ca', + color: '', + desc: 'ca', + type: 'compute', + unit: '€', + hightlight: true, + output: month => ca(month), + }, + { + name: 'notInvoiced', + color: '', + desc: 'Non facturé', + type: 'compute', + unit: '€', + hightlight: true, + output: month => notInvoiced(month), + }, + { + name: 'caPro', + color: '', + desc: 'CA pour le partie pro', + type: 'compute', + unit: '€', + hightlight: false, + output: month => caPro(month), + }, + { + name: 'caPerso', + color: '', + desc: 'CA destiné à la rémuneration', + type: 'compute', + unit: '€', + hightlight: false, + output: month => caPerso(month), + }, + { + name: 'caPersoUntouch', + color: '', + desc: 'CA destiné à la rémuneration non reversé', + type: 'compute', + unit: '€', + hightlight: false, + output: month => caPersoUntouch(month), + }, ], } },