import { ThemeColorsContext } from 'Components/utils/colors' import Value from 'Components/Value' import { getRuleFromAnalysis } from 'Engine/ruleUtils' import React, { Fragment, useContext } from 'react' import { Trans } from 'react-i18next' import { useSelector } from 'react-redux' import { analysisWithDefaultsSelector, parsedRulesSelector } from 'Selectors/analyseSelectors' import { analysisToCotisationsSelector } from 'Selectors/ficheDePaieSelectors' import './PaySlip.css' import { Line, SalaireBrutSection, SalaireNetSection } from './PaySlipSections' import RuleLink from './RuleLink' export default function PaySlip() { const { lightestColor } = useContext(ThemeColorsContext) const cotisations = useSelector(analysisToCotisationsSelector) const analysis = useSelector(analysisWithDefaultsSelector) const parsedRules = useSelector(parsedRulesSelector) let getRule = getRuleFromAnalysis(analysis) const heuresSupplémentaires = getRule( 'contrat salarié . temps de travail . heures supplémentaires' ) return (
{!!heuresSupplémentaires?.nodeValue && ( )}
{/* Section cotisations */}

Cotisations sociales

Part employeur

Part salarié

{cotisations.map(([brancheDottedName, cotisationList]) => { let branche = parsedRules[brancheDottedName] return (
{cotisationList.map(cotisation => ( {cotisation.montant.partPatronale} {cotisation.montant.partSalariale} ))}
) })} {/* Total cotisation */}
Total des retenues
{/* Salaire chargé */}
{/* Section salaire net */}
) }