Corrige le bug du préremplissage de la date de création
parent
5dc9f07db4
commit
cde3a95308
|
@ -152,6 +152,7 @@ function existingCompany(state: Company | null = null, action): Company | null {
|
|||
action.catégorieJuridique
|
||||
)
|
||||
return {
|
||||
...state,
|
||||
siren: state.siren,
|
||||
statutJuridique,
|
||||
dateDeCréation: action.dateDeCréation
|
||||
|
|
|
@ -248,7 +248,21 @@ function simulation(
|
|||
}
|
||||
return state
|
||||
}
|
||||
|
||||
const existingCompanyReducer = (state, action: Action) => {
|
||||
if (action.type.startsWith('EXISTING_COMPANY::') && state.simulation) {
|
||||
return {
|
||||
...state,
|
||||
simulation: {
|
||||
...state.simulation,
|
||||
situation: {
|
||||
...state.simulation.situation,
|
||||
...getCompanySituation(state.inFranceApp.existingCompany)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return state
|
||||
}
|
||||
const mainReducer = (state, action: Action) =>
|
||||
combineReducers({
|
||||
lang,
|
||||
|
@ -271,6 +285,7 @@ const mainReducer = (state, action: Action) =>
|
|||
|
||||
export default reduceReducers<RootState>(
|
||||
mainReducer as any,
|
||||
existingCompanyReducer as any,
|
||||
storageRootReducer as any
|
||||
) as Reducer<RootState>
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ import RuleLink from 'Components/RuleLink'
|
|||
import 'Components/TargetSelection.css'
|
||||
import { formatValue } from 'Engine/format'
|
||||
import InputComponent from 'Engine/InputComponent'
|
||||
import React, { useState } from 'react'
|
||||
import React, { useEffect, useState } from 'react'
|
||||
import { useDispatch, useSelector } from 'react-redux'
|
||||
import { RootState } from 'Reducers/rootReducer'
|
||||
import {
|
||||
|
@ -69,9 +69,14 @@ export default function DNRTI() {
|
|||
<SubSection dottedName="situation personnelle . IJSS" />
|
||||
<SubSection dottedName="dirigeant . indépendant . conjoint collaborateur" />
|
||||
|
||||
<SubSection dottedName="dirigeant . indépendant . cotisations et contributions . exonérations" />
|
||||
<h3>Exonérations</h3>
|
||||
<SimpleField dottedName="entreprise . ACRE" />
|
||||
<SimpleField dottedName="établissement . ZFU" />
|
||||
<SubSection
|
||||
dottedName="dirigeant . indépendant . cotisations et contributions . exonérations"
|
||||
sectionTitle={false}
|
||||
/>
|
||||
|
||||
<h3>International</h3>
|
||||
<SimpleField dottedName="situation personnelle . domiciliation fiscale à l'étranger" />
|
||||
<SubSection
|
||||
|
@ -139,6 +144,10 @@ function SimpleField({ dottedName, question }: SimpleFieldProps) {
|
|||
})
|
||||
setCurrentValue(value)
|
||||
}
|
||||
useEffect(() => {
|
||||
setCurrentValue(value)
|
||||
}, [value])
|
||||
|
||||
if (!analysis.isApplicable) {
|
||||
return null
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue