Utilisation choisie des contrôles pertinents
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'interfacebarème-continu
parent
25ffb3d09f
commit
d72cf4b753
|
@ -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 (
|
||||
<div id="ComparativeSimulation" className="ui__ container">
|
||||
|
@ -57,7 +52,6 @@ export default compose(
|
|||
simulationConfig={simulationConfig}
|
||||
textColourOnWhite={this.props.colours.textColourOnWhite}
|
||||
/>
|
||||
<Controls {...{ controls }} />
|
||||
{noNextSteps && (
|
||||
<>
|
||||
<h2>Plus de questions ! </h2>
|
||||
|
|
|
@ -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%)
|
||||
}
|
||||
|
|
|
@ -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 (
|
||||
<li
|
||||
style={{
|
||||
color: colours.textColour,
|
||||
background: `linear-gradient(
|
||||
60deg,
|
||||
${colours.darkColour} 0%,
|
||||
${colours.colour} 100%
|
||||
)`
|
||||
...{
|
||||
color: colours.textColour,
|
||||
background: `linear-gradient(
|
||||
60deg,
|
||||
${colours.darkColour} 0%,
|
||||
${colours.colour} 100%
|
||||
)`
|
||||
},
|
||||
...(microNotApplicable: {})
|
||||
}}
|
||||
className={microNotApplicable ? 'microNotApplicable' : ''}
|
||||
key={name}>
|
||||
<span className="title">{name}</span>
|
||||
<span className="figure">
|
||||
<span className="value">
|
||||
<AnimatedTargetValue value={nodeValue} />
|
||||
</span>{' '}
|
||||
<Link
|
||||
title="Quel est calcul ?"
|
||||
style={{ color: this.props.colours.colour }}
|
||||
to={'/règle/' + dottedName}
|
||||
onClick={() => setSituationBranch(i)}
|
||||
className="explanation">
|
||||
{emoji('📖')}
|
||||
</Link>
|
||||
</span>
|
||||
<small>
|
||||
Soit{' '}
|
||||
{Math.round(
|
||||
((chiffreAffaires - nodeValue) / +chiffreAffaires) * 100
|
||||
)}{' '}
|
||||
% de prélèvements
|
||||
</small>
|
||||
{microNotApplicable ? (
|
||||
<p id="microNotApplicable">{microNotApplicable.message}</p>
|
||||
) : (
|
||||
<>
|
||||
<span className="figure">
|
||||
<span className="value">
|
||||
<AnimatedTargetValue value={nodeValue} />
|
||||
</span>{' '}
|
||||
<Link
|
||||
title="Quel est calcul ?"
|
||||
style={{ color: this.props.colours.colour }}
|
||||
to={'/règle/' + dottedName}
|
||||
onClick={() => setSituationBranch(i)}
|
||||
className="explanation">
|
||||
{emoji('📖')}
|
||||
</Link>
|
||||
</span>
|
||||
<small>
|
||||
Soit{' '}
|
||||
{Math.round(
|
||||
((chiffreAffaires - nodeValue) / +chiffreAffaires) *
|
||||
100
|
||||
)}{' '}
|
||||
% de prélèvements
|
||||
</small>
|
||||
</>
|
||||
)}
|
||||
</li>
|
||||
)
|
||||
})}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue