Feat: change type base to editable and add getters for hightlights and
editable
This commit is contained in:
@@ -17,12 +17,12 @@ const config = {
|
||||
userDir: './userDir/',
|
||||
dataFile: 'datas.csv',
|
||||
caProPercentage: 0.5,
|
||||
monthDesc : [
|
||||
descAll : [
|
||||
{
|
||||
name: 'caTheo',
|
||||
color: '',
|
||||
desc: 'CA "scéances effectuées"',
|
||||
type: 'base',
|
||||
label: 'CA "scéances effectuées"',
|
||||
type: 'editable',
|
||||
unit: '€',
|
||||
hightlight: false,
|
||||
output: month => month.caTheo,
|
||||
@@ -30,8 +30,8 @@ const config = {
|
||||
{
|
||||
name: 'caRetro',
|
||||
color: '',
|
||||
desc: 'CA "Séances facturées"',
|
||||
type: 'base',
|
||||
label: 'CA "Séances facturées"',
|
||||
type: 'editable',
|
||||
unit: '€',
|
||||
hightlight: false,
|
||||
output: month => month.caRetro,
|
||||
@@ -39,8 +39,8 @@ const config = {
|
||||
{
|
||||
name: 'caReact',
|
||||
color: '',
|
||||
desc: 'CA "Séances facturées" réactualisé',
|
||||
type: 'base',
|
||||
label: 'CA "Séances facturées" réactualisé',
|
||||
type: 'editable',
|
||||
unit: '€',
|
||||
hightlight: false,
|
||||
output: month => month.caReact,
|
||||
@@ -48,7 +48,7 @@ const config = {
|
||||
{
|
||||
name: 'sessionQty',
|
||||
color: '',
|
||||
desc: 'Nombre de séances effectuées',
|
||||
label: 'Nombre de séances effectuées',
|
||||
unit: '',
|
||||
hightlight: false,
|
||||
output: month => month.sessionQty,
|
||||
@@ -56,8 +56,8 @@ const config = {
|
||||
{
|
||||
name: 'retro',
|
||||
color: '',
|
||||
desc: 'Montant de la rétrocession',
|
||||
type: 'base',
|
||||
label: 'Montant de la rétrocession',
|
||||
type: 'editable',
|
||||
unit: '€',
|
||||
hightlight: false,
|
||||
output: month => month.retro,
|
||||
@@ -65,8 +65,8 @@ const config = {
|
||||
{
|
||||
name: 'remuneration',
|
||||
color: '',
|
||||
desc: 'Rémuneration',
|
||||
type: 'base',
|
||||
label: 'Rémuneration',
|
||||
type: 'editable',
|
||||
unit: '€',
|
||||
hightlight: true,
|
||||
output: month => month.remuneration,
|
||||
@@ -74,8 +74,8 @@ const config = {
|
||||
{
|
||||
name: 'proPercentage',
|
||||
color: '',
|
||||
desc: 'Pourcentage du CA pour la partie pro',
|
||||
type: 'base',
|
||||
label: 'Pourcentage du CA pour la partie pro',
|
||||
type: 'editable',
|
||||
unit: '%',
|
||||
hightlight: false,
|
||||
output: month => month.proPercentage,
|
||||
@@ -83,7 +83,7 @@ const config = {
|
||||
{
|
||||
name: 'ca',
|
||||
color: '',
|
||||
desc: 'ca',
|
||||
label: 'ca',
|
||||
type: 'compute',
|
||||
unit: '€',
|
||||
hightlight: true,
|
||||
@@ -92,7 +92,7 @@ const config = {
|
||||
{
|
||||
name: 'notInvoiced',
|
||||
color: '',
|
||||
desc: 'Non facturé',
|
||||
label: 'Non facturé',
|
||||
type: 'compute',
|
||||
unit: '€',
|
||||
hightlight: true,
|
||||
@@ -101,7 +101,7 @@ const config = {
|
||||
{
|
||||
name: 'caPro',
|
||||
color: '',
|
||||
desc: 'CA pour le partie pro',
|
||||
label: 'CA pour le partie pro',
|
||||
type: 'compute',
|
||||
unit: '€',
|
||||
hightlight: false,
|
||||
@@ -110,7 +110,7 @@ const config = {
|
||||
{
|
||||
name: 'caPerso',
|
||||
color: '',
|
||||
desc: 'CA destiné à la rémuneration',
|
||||
label: 'CA destiné à la rémuneration',
|
||||
type: 'compute',
|
||||
unit: '€',
|
||||
hightlight: false,
|
||||
@@ -119,7 +119,7 @@ const config = {
|
||||
{
|
||||
name: 'caPersoUntouch',
|
||||
color: '',
|
||||
desc: 'CA destiné à la rémuneration non reversé',
|
||||
label: 'CA destiné à la rémuneration non reversé',
|
||||
type: 'compute',
|
||||
unit: '€',
|
||||
hightlight: false,
|
||||
@@ -131,8 +131,18 @@ const config = {
|
||||
getters: {
|
||||
userDir (state) { return state.userDir },
|
||||
dataFilePath (state) { return path.join(state.userDir, state.dataFile) },
|
||||
monthDesc (state) { return state.monthDesc },
|
||||
monthHightlightDesc (state) { return state.monthDesc.filter(a => a.hightlight) },
|
||||
descAll (state) {
|
||||
// All description of attributes for months
|
||||
return state.descAll
|
||||
},
|
||||
descEditable (state) {
|
||||
// All description of attributes for months
|
||||
return state.descAll.filter(d => d.type == 'editable')
|
||||
},
|
||||
descOf: (state) => (desc) => {
|
||||
return state.descAll.filter(d => d.name == desc)[0]
|
||||
},
|
||||
monthHightlightDesc (state) { return state.descAll.filter(a => a.hightlight) },
|
||||
caProPercentage (state) { return state.caProPercentage },
|
||||
},
|
||||
mutations: {
|
||||
|
||||
Reference in New Issue
Block a user