From d72cf4b7537f43e3ef97c8e6b567a8dbc835eabc Mon Sep 17 00:00:00 2001 From: Mael Date: Fri, 4 Jan 2019 19:24:49 +0100 Subject: [PATCH] =?UTF-8?q?Utilisation=20choisie=20des=20contr=C3=B4les=20?= =?UTF-8?q?pertinents?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Pour n'afficher dans le simulateur des indépendants que le contrôle relatif au plafond de la micro-entreprise, et bien l'intégrer dans l'interface --- source/components/ComparativeSimulation.js | 6 -- source/components/ComparativeTargets.css | 9 +++ source/components/ComparativeTargets.js | 70 ++++++++++++++-------- source/règles/base.yaml | 2 +- 4 files changed, 54 insertions(+), 33 deletions(-) diff --git a/source/components/ComparativeSimulation.js b/source/components/ComparativeSimulation.js index 8a20e66c5..2eb60e7d3 100644 --- a/source/components/ComparativeSimulation.js +++ b/source/components/ComparativeSimulation.js @@ -10,7 +10,6 @@ import { nextStepsSelector, analysisWithDefaultsSelector } from 'Selectors/analyseSelectors' -import Controls from './Controls' import simulationConfig from './simulateur-rémunération-dirigeant.yaml' import { createMarkdownDiv } from 'Engine/marked' @@ -28,10 +27,6 @@ export default compose( } render() { let { colours, noNextSteps, previousAnswers, analyses } = this.props - let controls = uniqBy( - ({ test, dottedName }) => test + dottedName, - chain(({ controls }) => controls, analyses) - ) return (
@@ -57,7 +52,6 @@ export default compose( simulationConfig={simulationConfig} textColourOnWhite={this.props.colours.textColourOnWhite} /> - {noNextSteps && ( <>

Plus de questions !

diff --git a/source/components/ComparativeTargets.css b/source/components/ComparativeTargets.css index 7f62da545..08101327c 100644 --- a/source/components/ComparativeTargets.css +++ b/source/components/ComparativeTargets.css @@ -38,3 +38,12 @@ text-decoration: none; line-height: 0; } +#targets #microNotApplicable { + font-style: italic; + text-align: center; + font-size: 90%; +} +#targets .microNotApplicable { + opacity: 0.85; + filter: grayscale(80%) + } diff --git a/source/components/ComparativeTargets.js b/source/components/ComparativeTargets.js index 409fac5da..41eb19f39 100644 --- a/source/components/ComparativeTargets.js +++ b/source/components/ComparativeTargets.js @@ -52,38 +52,56 @@ export default compose( if (!analysis.targets) return null let { nodeValue, dottedName } = analysis.targets[0], name = simulationConfig.branches[i].nom + + let microNotApplicable = + name === 'Micro-entreprise' && + analysis.controls?.find(({ test }) => + test.includes('base des cotisations > plafond') + ) + return (
  • {name} - - - - {' '} - setSituationBranch(i)} - className="explanation"> - {emoji('📖')} - - - - Soit{' '} - {Math.round( - ((chiffreAffaires - nodeValue) / +chiffreAffaires) * 100 - )}{' '} - % de prélèvements - + {microNotApplicable ? ( +

    {microNotApplicable.message}

    + ) : ( + <> + + + + {' '} + setSituationBranch(i)} + className="explanation"> + {emoji('📖')} + + + + Soit{' '} + {Math.round( + ((chiffreAffaires - nodeValue) / +chiffreAffaires) * + 100 + )}{' '} + % de prélèvements + + + )}
  • ) })} diff --git a/source/règles/base.yaml b/source/règles/base.yaml index 3c7a3e244..61ca46ed6 100644 --- a/source/règles/base.yaml +++ b/source/règles/base.yaml @@ -2854,7 +2854,7 @@ période: flexible contrôles: - si: base des cotisations > plafond - message: Attention, vous dépassez le plafond de la micro-entreprise. Vous devez créer une entreprise normale. + message: Le plafond de la micro-entreprise est dépassé. niveau: avertissement - espace: micro entreprise