Skip to content
Snippets Groups Projects
Commit f506cda9 authored by Dorine Lambinet's avatar Dorine Lambinet
Browse files

crée le ticket de caisse du carburant

parent a8a3fcee
Branches
Tags
1 merge request!89Ajout UI TICPE - PEPA - TO-DE
...@@ -38,6 +38,18 @@ ...@@ -38,6 +38,18 @@
const evaluationByNameArray = getContext("evaluationByNameArray") as Writable< const evaluationByNameArray = getContext("evaluationByNameArray") as Writable<
EvaluationByName[] EvaluationByName[]
> >
const euroAmountFormatter = new Intl.NumberFormat("fr-FR", {
currency: "EUR",
maximumFractionDigits: 0,
minimumFractionDigits: 0,
style: "currency",
})
const oilPriceAmountFormatter = new Intl.NumberFormat("fr-FR", {
currency: "EUR",
maximumFractionDigits: 2,
minimumFractionDigits: 2,
style: "currency",
})
const parametricReform = getContext( const parametricReform = getContext(
"parametricReform", "parametricReform",
) as Writable<ParametricReform> ) as Writable<ParametricReform>
...@@ -140,13 +152,14 @@ ...@@ -140,13 +152,14 @@
{/if} {/if}
<!--Impacts et waterfall--> <!--Impacts et waterfall-->
<div <div
class="{displayMode.compact class="{displayMode.compact
? 'w-full' ? 'w-full'
: 'w-10/12 md:w-11/12'} rounded-b-lg bg-white px-1 md:px-3" : 'w-10/12 md:w-11/12'} rounded-b-lg bg-white px-1 md:px-3"
> >
<div <div
class="relative flex-col border-gray-400 p-3 pb-5" class="relative flex-col border-gray-400 px-3 pb-5"
id="situation_{situationIndex}_totalimpact" id="situation_{situationIndex}_totalimpact"
> >
{#if Object.values($calculationByName).filter((calculation) => calculation.running && (calculation.situationIndex === undefined || calculation.situationIndex === situationIndex)).length > 0} {#if Object.values($calculationByName).filter((calculation) => calculation.running && (calculation.situationIndex === undefined || calculation.situationIndex === situationIndex)).length > 0}
...@@ -154,6 +167,8 @@ ...@@ -154,6 +167,8 @@
<Spinner /> <Spinner />
</div> </div>
{/if} {/if}
<div class="flex justify-between gap-4">
<div class="w-1/2 pt-3">
{#if !displayMode.compact || (displayMode.compact && displayMode.parametersVariableName === undefined)} {#if !displayMode.compact || (displayMode.compact && displayMode.parametersVariableName === undefined)}
<div <div
class="flex justify-between gap-4" class="flex justify-between gap-4"
...@@ -241,14 +256,16 @@ ...@@ -241,14 +256,16 @@
amendment: amendment:
Object.keys($parametricReform).length === 0 Object.keys($parametricReform).length === 0
? undefined ? undefined
: evaluationByName[displayMode.parametersVariableName] : evaluationByName[
?.calculationEvaluationByName["amendment"] displayMode.parametersVariableName
]?.calculationEvaluationByName["amendment"]
?.deltaAtVectorIndex ?? 0, ?.deltaAtVectorIndex ?? 0,
bill: bill:
$billName === undefined $billName === undefined
? undefined ? undefined
: evaluationByName[displayMode.parametersVariableName] : evaluationByName[
?.calculationEvaluationByName["bill"] displayMode.parametersVariableName
]?.calculationEvaluationByName["bill"]
?.deltaAtVectorIndex ?? 0, ?.deltaAtVectorIndex ?? 0,
law: law:
evaluationByName[displayMode.parametersVariableName] evaluationByName[displayMode.parametersVariableName]
...@@ -260,6 +277,89 @@ ...@@ -260,6 +277,89 @@
</div> </div>
{/if} {/if}
</div> </div>
<div class="w-1/2">
{#if displayMode.parametersVariableName === "aefa"}
<div class=" bg-slate-50 p-2 pb-4 shadow-md">
<h3
class="mb-2 border-b border-black pb-2 text-center font-black uppercase"
>
Budget Carburant
</h3>
<table
class="w-full border-b border-dashed border-black font-mono text-xs"
>
<tbody>
<tr>
<td class="">Type&nbsp;:</td>
<td class="text-right">Sans Plomb 95</td>
<td class="">
<button
class="inline-flex items-center text-xs text-gray-500 hover:text-le-bleu"
on:click={() =>
dispatch(
"changeTestCaseToEditIndex",
situationIndex,
)}
title="Éditer ce cas type"
id="situation_{situationIndex}_edit"
>
<Icon icon="ri-pencil-fill" class="h-5 w-5" />
</button></td
>
</tr>
<tr>
<td class="">Prix&nbsp;:</td>
<td class="text-right"
>{oilPriceAmountFormatter.format("2.2")}/L.</td
>
<td class="">
<button
class="inline-flex items-center text-xs text-gray-500 hover:text-le-bleu"
on:click={() =>
dispatch(
"changeTestCaseToEditIndex",
situationIndex,
)}
title="Éditer ce cas type"
id="situation_{situationIndex}_edit"
>
<Icon icon="ri-pencil-fill" class="h-5 w-5" />
</button></td
>
</tr>
</tbody>
</table>
<table
class="mt-4 w-full border-b border-dashed border-black font-mono text-sm"
>
<tbody>
<tr>
<td class="text-base">TOTAL TTC</td>
<td class="text-right text-lg"
>{euroAmountFormatter.format("7039")}/an</td
>
</tr>
<tr>
<td class="text-xs">dont TVA&nbsp;:</td>
<td class="text-right"
>{euroAmountFormatter.format("230")}</td
>
</tr>
<tr>
<td class="text-xs">dont TICPE&nbsp;:</td>
<td class="text-right"
>{euroAmountFormatter.format("220")}</td
>
</tr>
</tbody>
</table>
</div>
{/if}
</div>
</div>
</div>
<!--Bouton pour passer du mode compact au mode waterfall--> <!--Bouton pour passer du mode compact au mode waterfall-->
<div class="flex justify-end"> <div class="flex justify-end">
......
...@@ -58,6 +58,7 @@ const config = { ...@@ -58,6 +58,7 @@ const config = {
fontFamily: { fontFamily: {
sans: ["Lato", "sans-serif"], sans: ["Lato", "sans-serif"],
serif: ["Lora", "serif"], serif: ["Lora", "serif"],
mono: ["ui-monospace", "SFMono-Regular", "Menlo", "Monaco", "Consolas", "Liberation Mono", "Courier New", "monospace"]
}, },
}, },
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment