añadido skeleton del codigo para pagos/ingresos

This commit is contained in:
2025-05-30 00:08:46 -03:00
parent da7f0cf167
commit 616c9503bc
2 changed files with 76 additions and 1 deletions

View File

@@ -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";
}
}
</script>
{#if modaldata}
@@ -249,6 +271,53 @@
</div>
</div>
</div>
<div class="accordion-item">
<h2 class="accordion-header">
<button class="accordion-button collapsed"
type="button"
data-bs-toggle="collapse"
data-bs-target="#c3"
aria-expanded="false"
aria-controls="c3"
>
Ingresos
</button>
</h2>
<div class="accordion-collapse collapse" id="c3"
data-bs-parent="#accordionExample"
>
<div class="accordion-body d-flex">
<div>
<table class="table table-striped table-hover">
<thead>
<tr>
<th>Mes</th>
<th>Ingreso AR$</th>
<th>Ingreso US$</th>
</tr>
</thead>
<tbody>
{#each ingresos as i }
<tr>
<td>{i.mes}</td>
<td>{i.ingresoAr}</td>
<td>{i.ingresoUs}</td>
</tr>
{/each}
</tbody>
</table>
</div>
<div>
{#if chartingresos != null}
<FChart
chartData={chartingresos}
typec="pie"
/>
{/if}
</div>
</div>
</div>
</div>
</div>
</div>
</div>

View File

@@ -242,3 +242,9 @@ export type ClientePanel = {
email:string,
emailRecuperacion:string|null
}
export type IngresosDto = {
mes:number,
ingresoAr:number,
ingresoUs:number
}