forked from DGNum/gestioCOF
Improve type display
This commit is contained in:
parent
a173be4f7d
commit
20b7156e1f
1 changed files with 14 additions and 19 deletions
|
@ -746,6 +746,19 @@ class SpecialOperation extends Operation {
|
||||||
return Operation.props.concat(['type', 'is_checkout']);
|
return Operation.props.concat(['type', 'is_checkout']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Verbose names for operation types
|
||||||
|
* @type {Object}
|
||||||
|
*/
|
||||||
|
static get verbose_types() {
|
||||||
|
return {
|
||||||
|
'deposit': 'Charge',
|
||||||
|
'withdraw': 'Retrait',
|
||||||
|
'edit': 'Édition',
|
||||||
|
'initial': 'Initial',
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Default values for SpecialOperation model instances
|
* Default values for SpecialOperation model instances
|
||||||
* @default <tt>{@link Models.Operation.default_data|Operation.default_data} + {'type': '', 'is_checkout': false}
|
* @default <tt>{@link Models.Operation.default_data|Operation.default_data} + {'type': '', 'is_checkout': false}
|
||||||
|
@ -1606,25 +1619,7 @@ class SpecialOpeFormatter extends OperationFormatter {
|
||||||
}
|
}
|
||||||
|
|
||||||
static prop_infos2(a) {
|
static prop_infos2(a) {
|
||||||
if (!a.is_checkout)
|
return SpecialOperation.verbose_types(a.type) || '' ;
|
||||||
return 'Édition';
|
|
||||||
|
|
||||||
switch (a.type) {
|
|
||||||
case 'initial':
|
|
||||||
return 'Initial';
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'deposit':
|
|
||||||
return 'Charge';
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'withdraw':
|
|
||||||
return 'Retrait';
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue