Skip to main content
Sign in
Snippets Groups Projects
Commit d382f893 authored by cgl's avatar cgl Committed by clallemand
Browse files

corrige l'affichage de la retraite brute dans le résumé du cas type

parent 4d45a61c
No related branches found
No related tags found
No related merge requests found
Pipeline #22015 passed
......@@ -21,7 +21,7 @@
import { entityByKey, personEntityKey } from "$lib/entities"
import { getParameter, rootParameter } from "$lib/parameters"
import publicConfig from "$lib/public_config"
import { billName } from "$lib/shared.svelte"
import { billName, billActive } from "$lib/shared.svelte"
import {
getCalculatedVariableValueByCalculationName,
getSituationVariableValue,
......@@ -757,11 +757,9 @@
"primes_salaires",
populationId,
)}
{@const retraite_brute = getVariableValue(
situation,
"retraite_brute",
populationId,
)}
{@const retraite_brute = billActive
? getVariableValue(situation, "retraite_de_base_n_1", populationId)
: getVariableValue(situation, "retraite_de_base", populationId)}
{@const salarie_regime_alsace_moselle = getVariableValue(
situation,
"salarie_regime_alsace_moselle",
......@@ -951,14 +949,36 @@
{:else if retraite_brute}
<span>
{euroAmountFormatter(
getVariableNumberValue(
billActive
? (getVariableNumberValue(
situation,
"retraite_brute",
"retraite_de_base_n_1",
populationId,
) ?? 0,
) ?? 0) +
(getVariableNumberValue(
situation,
"retraite_complementaire",
populationId,
) ?? 0)
: (getVariableNumberValue(
situation,
"retraite_de_base",
populationId,
) ?? 0) +
(getVariableNumberValue(
situation,
"retraite_complementaire",
populationId,
) ?? 0),
)}
</span>
<span class="text-xs"> de retraite brute/an </span>
<span class="text-xs">
{#if billActive}
de retraite brute de l'année passée/an
{:else}
de retraite brute/an
{/if}
</span>
<span
class="text-nowrap rounded-full px-2 py-0.5 text-base font-bold text-black"
class:text-sm={mode === "select"}
......@@ -967,11 +987,27 @@
>
{parseFloat(
(
(billActive
? (getVariableNumberValue(
situation,
"retraite_de_base_n_1",
populationId,
) ?? 0) +
(getVariableNumberValue(
situation,
"retraite_brute",
"retraite_complementaire",
populationId,
) ?? 0) /
) ?? 0)
: (getVariableNumberValue(
situation,
"retraite_de_base",
populationId,
) ?? 0) +
(getVariableNumberValue(
situation,
"retraite_complementaire",
populationId,
) ?? 0)) /
(smicValue.value * 12)
).toFixed(2),
)}
......
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment