⚙️ ✅ Meilleure implémentation des périodes
parent
a62bde43ba
commit
c24d838c15
|
@ -28,12 +28,14 @@ export let treatVariable = (rules, rule, filter) => parseResult => {
|
|||
node.explanation.dottedName
|
||||
)
|
||||
|
||||
let variablePeriod = ruleToTransform['période'] || situation('période')
|
||||
let environmentPeriod = situation('période') || 'mois'
|
||||
let callingPeriod = rule['période'] || environmentPeriod
|
||||
let calledPeriod = ruleToTransform['période'] || environmentPeriod
|
||||
|
||||
let newNodeValue =
|
||||
rule['période'] === 'mois' && variablePeriod === 'année'
|
||||
callingPeriod === 'mois' && calledPeriod === 'année'
|
||||
? nodeValue / 12
|
||||
: rule['période'] === 'année' && variablePeriod === 'mois'
|
||||
: callingPeriod === 'année' && calledPeriod === 'mois'
|
||||
? nodeValue * 12
|
||||
: nodeValue
|
||||
|
||||
|
|
|
@ -105,3 +105,19 @@
|
|||
assiette deux: 3000
|
||||
valeur attendue: 300
|
||||
|
||||
- nom: assiette trois
|
||||
période: année
|
||||
format: €
|
||||
|
||||
- test: Périodes, variable neutre appelant variable annuelle
|
||||
formule:
|
||||
multiplication:
|
||||
assiette: assiette trois
|
||||
taux: 10%
|
||||
|
||||
exemples:
|
||||
- situation:
|
||||
période: mois
|
||||
assiette trois: 36000
|
||||
valeur attendue: 300
|
||||
|
||||
|
|
Loading…
Reference in New Issue