2019-01-14 17:53:18 +00:00
|
|
|
/* @flow */
|
2019-01-15 17:36:04 +00:00
|
|
|
import { setSituationBranch } from 'Actions/actions'
|
2019-01-15 18:04:29 +00:00
|
|
|
import {
|
2019-02-01 12:31:57 +00:00
|
|
|
defineDirectorStatus,
|
|
|
|
isAutoentrepreneur
|
2019-01-15 18:04:29 +00:00
|
|
|
} from 'Actions/companyStatusActions'
|
2019-01-24 18:06:30 +00:00
|
|
|
import RuleLink from 'Components/RuleLink'
|
2018-12-11 12:50:53 +00:00
|
|
|
import React from 'react'
|
|
|
|
import { connect } from 'react-redux'
|
2019-01-14 17:53:18 +00:00
|
|
|
import { config } from 'react-spring'
|
2019-01-24 18:06:30 +00:00
|
|
|
import { branchAnalyseSelector } from 'Selectors/analyseSelectors'
|
2019-02-15 14:45:35 +00:00
|
|
|
import { règleAvecMontantSelector } from 'Selectors/regleSelectors'
|
2019-01-14 17:53:18 +00:00
|
|
|
import Animate from 'Ui/animate'
|
2019-02-12 14:59:01 +00:00
|
|
|
import { noUserInputSelector } from '../selectors/analyseSelectors'
|
2019-01-08 19:43:57 +00:00
|
|
|
import './ComparativeTargets.css'
|
2019-01-14 17:53:18 +00:00
|
|
|
import SchemeCard from './ui/SchemeCard'
|
2019-02-15 14:45:35 +00:00
|
|
|
|
|
|
|
import type { RègleAvecMontant } from 'Types/RegleTypes'
|
2019-01-04 18:24:49 +00:00
|
|
|
|
2019-01-15 17:01:53 +00:00
|
|
|
const connectRègles = (situationBranchName: string) =>
|
2019-01-15 17:36:04 +00:00
|
|
|
connect(
|
2019-01-24 18:06:30 +00:00
|
|
|
state => {
|
2019-02-01 12:31:57 +00:00
|
|
|
return ({
|
2019-01-24 18:06:30 +00:00
|
|
|
revenuDisponible:
|
2019-02-12 14:59:01 +00:00
|
|
|
!noUserInputSelector(state) &&
|
2019-01-24 18:06:30 +00:00
|
|
|
règleAvecMontantSelector(state, {
|
|
|
|
situationBranchName
|
2019-02-15 14:45:35 +00:00
|
|
|
})('revenu net')
|
2019-02-01 12:31:57 +00:00
|
|
|
}: {
|
2019-03-04 16:46:35 +00:00
|
|
|
revenuDisponible: boolean | RègleAvecMontant
|
2019-02-01 12:31:57 +00:00
|
|
|
})
|
2019-01-24 18:06:30 +00:00
|
|
|
},
|
2019-01-15 18:04:29 +00:00
|
|
|
{
|
|
|
|
setSituationBranch,
|
2019-01-30 17:38:17 +00:00
|
|
|
isAutoentrepreneur,
|
2019-01-15 18:04:29 +00:00
|
|
|
defineDirectorStatus
|
|
|
|
}
|
2019-01-15 17:36:04 +00:00
|
|
|
)
|
2019-01-14 17:53:18 +00:00
|
|
|
|
2019-02-01 12:31:57 +00:00
|
|
|
type ComparativeTargetsProps = {
|
|
|
|
plafondAutoEntrepreneurDépassé: ?{ message: string }
|
|
|
|
}
|
|
|
|
const ComparativeTargets: React$ComponentType<{}> = connect(state => {
|
2019-01-17 17:49:00 +00:00
|
|
|
const analyse = branchAnalyseSelector(state, {
|
2019-01-30 17:38:17 +00:00
|
|
|
situationBranchName: 'Auto-entrepreneur'
|
2019-01-21 17:41:18 +00:00
|
|
|
})
|
|
|
|
return {
|
2019-01-30 17:38:17 +00:00
|
|
|
plafondAutoEntrepreneurDépassé:
|
2019-01-21 17:41:18 +00:00
|
|
|
analyse.controls &&
|
|
|
|
analyse.controls.find(({ test }) =>
|
|
|
|
test.includes('base des cotisations > plafond')
|
|
|
|
)
|
2019-01-17 17:49:00 +00:00
|
|
|
}
|
2019-02-01 12:31:57 +00:00
|
|
|
})(({ plafondAutoEntrepreneurDépassé }: ComparativeTargetsProps) => (
|
2019-01-15 16:22:27 +00:00
|
|
|
<Animate.fromBottom config={config.gentle}>
|
2019-02-15 14:45:35 +00:00
|
|
|
<div className="comparative-targets ui__ full-width">
|
2019-01-30 17:38:17 +00:00
|
|
|
<AutoEntrepreneur
|
2019-01-21 17:41:18 +00:00
|
|
|
branchIndex={0}
|
|
|
|
plafondDépassé={
|
2019-02-01 12:31:57 +00:00
|
|
|
plafondAutoEntrepreneurDépassé &&
|
|
|
|
plafondAutoEntrepreneurDépassé.message
|
2019-01-21 17:41:18 +00:00
|
|
|
}
|
|
|
|
/>
|
2019-01-15 18:04:29 +00:00
|
|
|
<AssimiléSalarié branchIndex={2} />
|
|
|
|
<Indépendant branchIndex={1} />
|
2019-01-15 16:22:27 +00:00
|
|
|
</div>
|
|
|
|
</Animate.fromBottom>
|
2019-01-17 17:49:00 +00:00
|
|
|
))
|
2019-01-14 17:53:18 +00:00
|
|
|
|
2019-01-15 17:01:53 +00:00
|
|
|
const Indépendant = connectRègles('Indépendant')(
|
2019-01-15 18:04:29 +00:00
|
|
|
({
|
|
|
|
revenuDisponible,
|
|
|
|
branchIndex,
|
|
|
|
setSituationBranch,
|
|
|
|
defineDirectorStatus,
|
2019-01-30 17:38:17 +00:00
|
|
|
isAutoentrepreneur
|
2019-01-15 18:04:29 +00:00
|
|
|
}) => (
|
2019-01-15 17:01:53 +00:00
|
|
|
<SchemeCard
|
2019-01-21 17:41:18 +00:00
|
|
|
title="Indépendant"
|
2019-01-15 17:01:53 +00:00
|
|
|
subtitle="La protection à la carte"
|
2019-01-15 18:04:29 +00:00
|
|
|
onAmountClick={() => setSituationBranch(branchIndex)}
|
2019-01-15 17:01:53 +00:00
|
|
|
amount={revenuDisponible.montant}
|
|
|
|
icon="👩🔧"
|
|
|
|
amountDesc={<RuleLink {...revenuDisponible} />}
|
|
|
|
features={[
|
|
|
|
'Régime des indépendants',
|
2019-01-16 17:41:39 +00:00
|
|
|
'Complémentaire santé et prévoyance non incluses',
|
2019-01-15 17:01:53 +00:00
|
|
|
'Accidents du travail non couverts',
|
2019-01-16 17:41:39 +00:00
|
|
|
'Retraite faible (41% du dernier brut)',
|
2019-01-15 17:01:53 +00:00
|
|
|
'Indemnités journalières plus faibles',
|
|
|
|
'Montant minimum de cotisations',
|
2019-01-16 17:41:39 +00:00
|
|
|
'Cotisations en décalage de deux ans'
|
2019-01-15 17:01:53 +00:00
|
|
|
]}
|
2019-01-15 18:04:29 +00:00
|
|
|
onSchemeChoice={() => {
|
|
|
|
defineDirectorStatus('SELF_EMPLOYED')
|
2019-01-30 17:38:17 +00:00
|
|
|
isAutoentrepreneur(false)
|
2019-01-15 18:04:29 +00:00
|
|
|
}}
|
2019-01-15 17:01:53 +00:00
|
|
|
/>
|
|
|
|
)
|
|
|
|
)
|
2019-01-14 17:53:18 +00:00
|
|
|
|
2019-01-15 17:01:53 +00:00
|
|
|
const AssimiléSalarié = connectRègles('Assimilé salarié')(
|
2019-01-15 18:04:29 +00:00
|
|
|
({
|
|
|
|
revenuDisponible,
|
|
|
|
branchIndex,
|
|
|
|
setSituationBranch,
|
|
|
|
defineDirectorStatus
|
|
|
|
}) => (
|
2019-01-15 17:01:53 +00:00
|
|
|
<SchemeCard
|
|
|
|
title="Assimilé salarié"
|
2019-01-15 18:04:29 +00:00
|
|
|
onAmountClick={() => setSituationBranch(branchIndex)}
|
2019-01-15 17:01:53 +00:00
|
|
|
subtitle="Le régime tout compris"
|
|
|
|
amount={revenuDisponible.montant}
|
2019-01-16 17:41:39 +00:00
|
|
|
featured="Le choix de 58% des dirigeants de sociétés"
|
2019-01-15 17:01:53 +00:00
|
|
|
icon="☂"
|
|
|
|
amountDesc={<RuleLink {...revenuDisponible} />}
|
|
|
|
features={[
|
|
|
|
'Régime général',
|
2019-01-16 17:41:39 +00:00
|
|
|
'Complémentaires santé et prévoyance incluses',
|
2019-01-15 17:01:53 +00:00
|
|
|
'Accidents du travail couverts',
|
2019-01-16 17:41:39 +00:00
|
|
|
'Retraite élevée (62 % du dernier brut)',
|
|
|
|
'Pas de cotisations minimales',
|
2019-01-15 17:01:53 +00:00
|
|
|
"Seuil pour l'activation des droits (4000€/an)",
|
2019-01-16 17:41:39 +00:00
|
|
|
'Fiches de paie mensuelles',
|
|
|
|
'Prélèvement des cotisations à la source'
|
2019-01-15 17:01:53 +00:00
|
|
|
]}
|
2019-01-17 09:47:46 +00:00
|
|
|
onSchemeChoice={() => {
|
|
|
|
defineDirectorStatus('SALARIED')
|
2019-01-30 17:38:17 +00:00
|
|
|
isAutoentrepreneur(false)
|
2019-01-17 09:47:46 +00:00
|
|
|
}}
|
2019-01-15 17:01:53 +00:00
|
|
|
/>
|
|
|
|
)
|
|
|
|
)
|
2019-01-14 17:53:18 +00:00
|
|
|
|
2019-01-30 17:38:17 +00:00
|
|
|
const AutoEntrepreneur = connectRègles('Auto-entrepreneur')(
|
2019-01-15 18:04:29 +00:00
|
|
|
({
|
|
|
|
revenuDisponible,
|
|
|
|
setSituationBranch,
|
2019-01-30 17:38:17 +00:00
|
|
|
isAutoentrepreneur,
|
2019-01-16 17:41:39 +00:00
|
|
|
branchIndex,
|
2019-01-21 17:41:18 +00:00
|
|
|
plafondDépassé
|
2019-01-17 09:14:44 +00:00
|
|
|
}) => {
|
|
|
|
return (
|
|
|
|
<SchemeCard
|
2019-01-30 17:38:17 +00:00
|
|
|
title="Auto-entrepreneur"
|
2019-01-17 09:14:44 +00:00
|
|
|
subtitle="Pour les petites activités"
|
|
|
|
onAmountClick={() => setSituationBranch(branchIndex)}
|
2019-01-17 17:49:00 +00:00
|
|
|
disabled={plafondDépassé}
|
2019-01-17 09:14:44 +00:00
|
|
|
amountDesc={<RuleLink {...revenuDisponible} />}
|
|
|
|
icon="🚶♂️"
|
|
|
|
amount={revenuDisponible.montant}
|
|
|
|
features={[
|
|
|
|
'Régime des indépendants',
|
|
|
|
'Pas de déduction des charges',
|
|
|
|
'Pas de déduction fiscale pour la mutuelle (Madelin)',
|
2019-01-21 17:41:18 +00:00
|
|
|
"Chiffre d'affaires plafonné",
|
2019-03-26 14:05:08 +00:00
|
|
|
"Durée de l'ACRE plus élevée",
|
2019-01-17 09:14:44 +00:00
|
|
|
'Comptabilité réduite au minimum'
|
|
|
|
]}
|
2019-01-17 09:47:46 +00:00
|
|
|
onSchemeChoice={() => {
|
|
|
|
defineDirectorStatus('SELF_EMPLOYED')
|
2019-01-30 17:38:17 +00:00
|
|
|
isAutoentrepreneur(true)
|
2019-01-17 09:47:46 +00:00
|
|
|
}}
|
2019-01-17 09:14:44 +00:00
|
|
|
/>
|
|
|
|
)
|
|
|
|
}
|
2019-01-15 17:01:53 +00:00
|
|
|
)
|
|
|
|
|
2019-01-14 17:53:18 +00:00
|
|
|
export default ComparativeTargets
|