Skip to content
Snippets Groups Projects
Commit 2c41720e authored by Dorine Lambinet's avatar Dorine Lambinet Committed by David Smadja
Browse files

Supprime les références à la tab "dispositif" et récupère le ticket carburant...

Supprime les références à la tab "dispositif" et récupère le ticket carburant pour le waterfall concerné
parent 2b547518
No related branches found
No related tags found
1 merge request!272Reflexions feuille de paie
......@@ -2,6 +2,7 @@
import type { VariableByName } from "@openfisca/json-model"
import { goto } from "$app/navigation"
import OilSpendingBill from "$lib/components/test_cases/OilSpendingBill.svelte"
import TestCaseGraph from "$lib/components/test_cases/TestCaseGraph.svelte"
import Tooltip from "$lib/components/Tooltip.svelte"
import ValueChange from "$lib/components/ValueChange.svelte"
......@@ -29,9 +30,10 @@
} from "$lib/situations"
import { newSimulationUrl } from "$lib/urls"
import { removeNegativeZero } from "$lib/values"
import type {
ValuesByCalculationNameByVariableName,
VariableValue,
import {
oilTypes,
type ValuesByCalculationNameByVariableName,
type VariableValue,
} from "$lib/variables"
interface Props {
......@@ -80,6 +82,15 @@
const householdEntity = entityByKey[householdEntityKey]
const personEntity = entityByKey[personEntityKey]
const oilSpendings = oilTypes.map((name) => ({
depenseTtcVariableName: `depense_${name}_ttc`,
nombreLitresVariableName: `nombre_litres_${name}`,
// prixTtcLitreVariableName: `prix_${name}_hors_remise_ttc_sortie`,
prixTtcLitreVariableName: `prix_${name}_ttc`,
ticpeVariableName: `${name}_ticpe`,
tvaVariableName: `tva_sur_${name}`,
}))
let useRevaluationInsteadOfLaw = $derived(revaluationName !== undefined)
let firstCalculationName = $derived(
......@@ -333,7 +344,7 @@
<!--Ce composant se découpe en 3 zones :
- ZONE 1 : FEUILLE DE PAIE
- ZONE 2 : VARIALBES COMPLÉMENTAIRES À LA FEUILLE DE PAIE
- ZONE 3 : GRAPHIQUE DES CAS TYPES
- ZONE 3 : TICKET DE CARBURANT & GRAPHIQUE DES CAS TYPES
-->
{#if visibleDecompositions.length > 0}
......@@ -776,7 +787,24 @@
</div>
{/if}
<!--ZONE 3 : GRAPHIQUE DES CAS TYPES-->
<!--ZONE 3.A : TICKET DE CARBURANT-->
{#if shared.waterfall.name === "disponible_to_disponible_apres_taxes_carburant"}
{#each oilSpendings as { depenseTtcVariableName, nombreLitresVariableName, prixTtcLitreVariableName, ticpeVariableName, tvaVariableName }}
<OilSpendingBill
{depenseTtcVariableName}
{nombreLitresVariableName}
{prixTtcLitreVariableName}
on:changeTestCaseToEditIndex
{situation}
{situationIndex}
{ticpeVariableName}
{tvaVariableName}
{valuesByCalculationNameByVariableName}
{year}
/>
{/each}
{:else}
<!--ZONE 3.B : GRAPHIQUE DES CAS TYPES-->
{#if firstPersonActivity !== "inactif"}
<button
class="mt-10 flex w-full items-center gap-2 border-b px-4 py-2 text-start text-neutral-600 transition-all hover:bg-neutral-100 active:bg-neutral-200"
......@@ -824,11 +852,12 @@
/>
{/if}
{/if}
{/if}
<style lang="postcss">
.fond {
background-color: #ffffff;
/* Polka dots - Heropatterns.com échelle réduite */
background-image: url("data:image/svg+xml,%3Csvg width='7' height='7' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23C0C0C0' fill-opacity='0.4' fill-rule='evenodd'%3E%3Ccircle cx='3' cy='3' r='3'/%3E%3Ccircle cx='13' cy='13' r='3'/%3E%3C/g%3E%3C/svg%3E");
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4' viewBox='0 0 4 4'%3E%3Cpath fill='%23A0A0A0' fill-opacity='0.4' d='M1 3h1v1H1V3zm2-2h1v1H3V1z'%3E%3C/path%3E%3C/svg%3E");
}
</style>
......@@ -168,7 +168,7 @@
nombreLitres,
depenseTtcVariable.name,
)}
<div class=" bg-slate-100 p-2 pb-4 shadow-md">
<div class="fond m-4 max-w-md border bg-gray-50 p-2 pb-4 shadow-md">
<h3
class="mb-2 border-b border-black pb-2 text-center font-black uppercase"
>
......@@ -290,3 +290,10 @@
{/if}
</div>
{/if}
<style lang="postcss">
.fond {
background-color: #ffffff;
background-image: url("data:image/svg+xml,%3Csvg width='6' height='6' viewBox='0 0 6 6' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23C0C0C0' fill-opacity='0.4' fill-rule='evenodd'%3E%3Cpath d='M5 0h1L0 6V5zM6 5v1H5z'/%3E%3C/g%3E%3C/svg%3E");
}
</style>
<script lang="ts">
import { getContext } from "svelte"
import type { Writable } from "svelte/store"
import SourcesMethodTooltip from "$lib/components/SourcesMethodTooltip.svelte"
import OilSpendingBill from "$lib/components/test_cases/OilSpendingBill.svelte"
import TestCaseSummary from "$lib/components/test_cases/TestCaseSummary.svelte"
import WaterfallView from "$lib/components/WaterfallView.svelte"
import WaterfallViewFocusDispositif from "$lib/components/WaterfallViewFocusDispositif.svelte"
import { waterfalls } from "$lib/decompositions"
import type { DisplayMode } from "$lib/displays"
import type { Situation } from "$lib/situations"
......@@ -36,7 +31,6 @@
highlightDecomposition = false,
situation,
situationIndex,
tabsConfig,
valuesByCalculationNameByVariableName,
year,
}: Props = $props()
......@@ -51,12 +45,10 @@
}))
let evaluationByName = $derived(shared.evaluationByNameArray[situationIndex])
const showNulls = getContext("showNulls") as Writable<boolean>
</script>
<div
class="mx-0 place-self-start overflow-hidden rounded-lg border border-gray-200 shadow-md md:mb-5"
class="mx-0 place-self-start overflow-hidden rounded-lg border border-gray-200 bg-white shadow-md md:mb-5"
id="situation_{situationIndex}"
>
{#if displayMode.edit === undefined}
......@@ -73,88 +65,9 @@
{year}
/>
</div>
<!--
<div
class="flex w-full overflow-hidden bg-gray-100 shadow-inner"
id="situations_{situationIndex}_tabs"
>
{#each tabsConfig.tabs as tabData}
<TestCaseTab
href={newSimulationUrl({
...displayMode,
tab: tabData.tab,
})}
icon={tabData.icon}
picto={tabData.picto}
text={tabData.title}
isActive={displayMode.tab === tabData.tab ||
(tabData.tab === tabsConfig.defaultTab &&
displayMode.tab === undefined)}
isDisabled={tabData?.disabled ?? false}
/>
{/each}
</div>-->
</div>
{/if}
{#if displayMode.tab === "dispositif" || (displayMode.tab === undefined && tabsConfig.defaultTab === "dispositif")}
<div class="relative w-full bg-white px-8 py-5">
{#if displayMode.parametersVariableName !== undefined}
<div class="flex gap-5">
<WaterfallViewFocusDispositif {displayMode} {situationIndex} />
<!--TICKET DE CARBURANT-->
{#if displayMode.parametersVariableName === "taxes_tous_carburants" || (displayMode.parametersVariableName !== undefined && oilTypes.some( (oilType) => displayMode.parametersVariableName?.includes(oilType), ))}
{#each oilSpendings as { depenseTtcVariableName, nombreLitresVariableName, prixTtcLitreVariableName, ticpeVariableName, tvaVariableName }}
<OilSpendingBill
{depenseTtcVariableName}
{nombreLitresVariableName}
{prixTtcLitreVariableName}
on:changeTestCaseToEditIndex
{situation}
{situationIndex}
{ticpeVariableName}
{tvaVariableName}
{valuesByCalculationNameByVariableName}
{year}
/>
{/each}
{/if}
</div>
<div
class="mt-5 flex justify-start"
id="situation_{situationIndex}_waterfall_showall"
>
<label class="inline-flex cursor-pointer items-center">
<input
type="checkbox"
value=""
class="peer sr-only"
bind:checked={$showNulls}
/>
<div
class="peer relative h-6 w-11 shrink-0 rounded-full bg-gray-400 after:absolute after:start-[2px] after:top-[2px] after:h-5 after:w-5 after:rounded-full after:bg-white after:transition-all after:content-[''] peer-checked:bg-le-bleu peer-checked:after:translate-x-full peer-checked:after:border-white peer-focus:outline-none peer-focus:ring-0"
></div>
<span class="ml-2"
>Montrer tous les dispositifs, y compris si leur montant est à 0.</span
>
</label>
</div>
{:else}
<p>Aucun dispositif sélectionné.</p>
<!-- <br/>-->
<!-- <p>Choissez-en un</p>-->
<!-- <ul>-->
<!-- <li>- parmi ceux proposés à gauche, ou</li>-->
<!-- <li>- dans la fiche de paie, ou</li>-->
<!-- <li>- en lançant une recherche.</li>-->
<!-- </ul>-->
{/if}
</div>
{/if}
{#if displayMode.tab === "fiche_de_paie" || (displayMode.tab === undefined && tabsConfig.defaultTab === "fiche_de_paie")}
<div class="">
{#if variableSummaryByName !== undefined}
{@const completeVariableSummaryByName =
billName === undefined
......@@ -210,8 +123,7 @@
<span
class="ml-2 text-xs uppercase tracking-wide text-gray-600 xl:text-sm"
class:text-le-bleu={name === shared.waterfall.name}
class:group-hover:text-black={name !==
shared.waterfall.name}
class:group-hover:text-black={name !== shared.waterfall.name}
class:font-bold={name === shared.waterfall.name}
>
{label}
......@@ -225,5 +137,3 @@
<SourcesMethodTooltip {displayMode} />
{/if}
</div>
{/if}
</div>
......@@ -251,7 +251,6 @@
class="flex w-full flex-col px-8 py-3 hover:bg-[#EEEDE1] active:bg-[#E2E1CD] 2xl:py-4"
href={newSimulationUrl({
...displayMode,
tab: "dispositif",
parametersVariableName: variable.name,
})}
onclick={() => {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment