From 616c9503bcd1347aece05c5fa50268161081956d Mon Sep 17 00:00:00 2001 From: fede Date: Fri, 30 May 2025 00:08:46 -0300 Subject: [PATCH] =?UTF-8?q?a=C3=B1adido=20skeleton=20del=20codigo=20para?= =?UTF-8?q?=20pagos/ingresos?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Front/src/paginas/Informes.svelte | 71 ++++++++++++++++++++++++++++++- Front/src/types.d.ts | 6 +++ 2 files changed, 76 insertions(+), 1 deletion(-) diff --git a/Front/src/paginas/Informes.svelte b/Front/src/paginas/Informes.svelte index 19e2e89..15ca489 100644 --- a/Front/src/paginas/Informes.svelte +++ b/Front/src/paginas/Informes.svelte @@ -5,7 +5,7 @@ import FChart from "../Componentes/Estadisticas/fChart.svelte"; import ModalEstatico from "../Componentes/ModalEstatico.svelte"; import { urlG } from "../stores/urlStore"; - import type { ChartData } from "../types"; + import type { ChartData, IngresosDto } from "../types"; let token = sessionStorage.getItem("token") || ""; let y = $state(2025); @@ -97,6 +97,28 @@ } }); } + + let ingresos: IngresosDto[] = $state([]); + let chartingresos: ChartData | null = $state(null); + async function getIngresos() { + try{ + const req = await fetch($urlG+"", { + method:"GET", + headers: { + "Auth": token || "", + }, + }); + const data = await req.json(); + if (req.ok){ + ingresos = data.tabla; + chartingresos = data.chart; + } else { + modaldata = data.message; + } + }catch{ + modaldata="Fallo la req para obtener ingresos"; + } + } {#if modaldata} @@ -249,6 +271,53 @@ +
+

+ +

+
+
+
+ + + + + + + + + + {#each ingresos as i } + + + + + + {/each} + +
MesIngreso AR$Ingreso US$
{i.mes}{i.ingresoAr}{i.ingresoUs}
+
+
+ {#if chartingresos != null} + + {/if} +
+
+
+
diff --git a/Front/src/types.d.ts b/Front/src/types.d.ts index f5bf440..28cdf7f 100644 --- a/Front/src/types.d.ts +++ b/Front/src/types.d.ts @@ -242,3 +242,9 @@ export type ClientePanel = { email:string, emailRecuperacion:string|null } + +export type IngresosDto = { + mes:number, + ingresoAr:number, + ingresoUs:number +}