Skip to content
Snippets Groups Projects
Commit 2edc111c authored by Toufic Batache's avatar Toufic Batache
Browse files

Merge branch 'fix-bug-taxes-carburants-suite-ajout-niveau-de-vie' into 'master'

Supprime variable additionnelle taxe carburant + ajoute petit waterfall custom pour présenter le niveau de vie

See merge request !226
parents 96dffbc8 f7c1e580
No related branches found
No related tags found
1 merge request!226Supprime variable additionnelle taxe carburant + ajoute petit waterfall custom pour présenter le niveau de vie
Pipeline #14154 passed
......@@ -528,9 +528,32 @@
</div>
</div>
<!-- Choix d'affichage des montant nuls -->
<div
class="mx-4 mt-3 flex justify-start"
id="situation_{situationIndex}_waterfall_showall"
>
<label class="inline-flex items-center cursor-pointer">
<input
type="checkbox"
value=""
class="sr-only peer"
bind:checked={$showNulls}
/>
<div
class="relative w-11 h-6 bg-gray-400 peer-focus:outline-none peer-focus:ring-4 rounded-full peer dark:bg-gray-700 peer-checked:after:translate-x-full rtl:peer-checked:after:-translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:start-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-le-vert-500"
></div>
<span class="ms-3 text-sm font-medium text-gray-900 dark:text-gray-300"
>Montrer tous les dispositifs, y compris si le montant est nul.</span
>
</label>
</div>
<!--AJout de la variable niveau de vie-->
{#if $waterfall.name === "brut_to_disponible"}
<div class="relative flex flex-col">
<div
class="relative flex flex-col border-neutral-500 mt-10 ml-10 border-t-2"
>
{#if Object.values($calculationByName).filter((calculation) => calculation.running && (calculation.situationIndex === undefined || calculation.situationIndex === situationIndex)).length > 0}
<div class="absolute inset-0 z-10 bg-le-jaune bg-opacity-20" />
{/if}
......@@ -542,6 +565,13 @@
"niveau_de_vie",
populationId,
) ?? 0}
{@const revenu_disponible =
getCalculatedVariableNumberValue(
situation,
valuesByCalculationNameByVariableName,
"revenu_disponible",
populationId,
) ?? 0}
{@const unites_consommation =
getCalculatedVariableNumberValue(
situation,
......@@ -556,80 +586,77 @@
"taxes_tous_carburants",
populationId,
) ?? 0}
{#if unites_consommation !== 0}
{#if revenu_disponible !== 0}
<div
class="border-t flex items-center justify-between text-gray-500"
>
<a
href={newSimulationUrl({
...displayMode,
parametersVariableName: "unites_consommation",
parametersVariableName: "revenu_disponible",
})}
class=" ml-4 hover:underline"
>
Unités de consommation du ménage
Revenu disponible du ménage
</a>
<p class="flex gap-0.5 text-sm mr-4">
÷ <ValueChange
unitName={null}
<ValueChange
unitName="currency-EUR"
valueByCalculationName={getCalculatedVariableValueByCalculationName(
situation,
valuesByCalculationNameByVariableName,
variableSummaryByName["unites_consommation"],
variableSummaryByName["revenu_disponible"],
populationId,
)}
/>
</p>
</div>
{/if}
{#if niveau_de_vie !== 0}
{#if unites_consommation !== 0}
<div
class="border-t flex items-center justify-between text-gray-500"
>
<a
href={newSimulationUrl({
...displayMode,
parametersVariableName: "niveau_de_vie",
parametersVariableName: "unites_consommation",
})}
class="border-t border-gray-400 ml-4 hover:underline"
>Niveau de vie</a
class=" ml-4 hover:underline"
>
<p class="flex text-sm mr-4 border-t border-gray-400 p-0.5 gap-1">
= <ValueChange
unitName="currency-EUR"
Unités de consommation du ménage
</a>
<p class="flex gap-0.5 text-sm mr-4">
÷ <ValueChange
unitName={null}
valueByCalculationName={getCalculatedVariableValueByCalculationName(
situation,
valuesByCalculationNameByVariableName,
variableSummaryByName["niveau_de_vie"],
variableSummaryByName["unites_consommation"],
populationId,
)}
/>
</p>
</div>
{/if}
{#if taxes_tous_carburants !== 0}
{#if niveau_de_vie !== 0}
<div
class="border-t pt-4 flex items-center justify-between text-black font-serif cursor-pointer overflow-x-hidden text-ellipsis text-base hover:z-20 hover:overflow-x-visible hover:bg-white hover:text-le-gris-dispositif hover:underline"
class="border-t flex items-center justify-between text-gray-500 font-bold"
>
<a
href={newSimulationUrl({
...displayMode,
parametersVariableName: "taxes_tous_carburants",
parametersVariableName: "niveau_de_vie",
})}
class="ml-4 hover:underline"
>
Taxes carburants
</a>
<p
class="flex gap-2 text-base mr-4 text-black font-bold font-sans"
class="border-t border-gray-400 ml-4 hover:underline"
>Niveau de vie</a
>
- <ValueChange
unitName={"currency-EUR"}
<p class="flex text-sm mr-4 border-t border-gray-400 p-0.5 gap-1">
= <ValueChange
unitName="currency-EUR"
valueByCalculationName={getCalculatedVariableValueByCalculationName(
situation,
valuesByCalculationNameByVariableName,
variableSummaryByName["taxes_tous_carburants"],
variableSummaryByName["niveau_de_vie"],
populationId,
)}
/>
......@@ -640,23 +667,6 @@
</div>
{/if}
<!-- Choix d'affichage des montant nuls -->
<div
class="mx-6 mt-3 flex"
id="situation_{situationIndex}_waterfall_showall"
>
<label class="inline-flex py-2 text-xs leading-none text-gray-600">
<input
bind:checked={$showNulls}
class="checked rounded bg-gray-100 accent-gray-500"
type="checkbox"
/>
<span class="ml-2"
>Montrer tous les dispositifs, y compris si le montant est nul.</span
>
</label>
</div>
{#if firstPersonActivity !== "inactif"}
<button
class="w-full flex items-center gap-2 text-neutral-600 text-start border-b px-4 py-2 mt-10 hover:bg-neutral-100 active:bg-neutral-200 transition-all"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment