The reports module atDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/juanVillamilEchavarria/Leo_Counter-app/llms.txt
Use this file to discover all available pages before exploring further.
/reportes is the analytical heart of Leo Counter. It combines every movement, category, account, and budget record into a single interactive view that covers KPI summary cards, time-series trend charts, a category distribution pie chart, a net balance line chart, and a budget consumption bar. All sections update immediately when you change the active filters — no page reload required.
How Reports Are Generated
TheReporteController renders the Inertia page shell. The useReporteApi hook then takes over client-side, calling the report API endpoints which dispatch GenerateFinancialReportQuery through GenerateReportHandler.
| Method | URI | Action |
|---|---|---|
| GET | /api/reportes | Generate report with default date range |
| POST | /api/reportes/generate | Generate report with custom filters |
| GET | /api/reportes/form-options | Fetch available categories and accounts for filters |
- KPIAssembler →
PeriodKPIDTO - IngresosVsGastosAssembler →
IngresosVsGastosDTO - BalanceNetoAssembler → raw balance series
- CategoryDistributionAssembler →
FullCategoryDistributionDTO - UsedBudgetAssembler →
UsedBudgetDTO
{ KPIs, tendencia, distribuiciones } from the API response and passes them to the KPISection and ChartSection components.
KPI Cards
TheKPISection renders four primary metric cards sourced from PeriodKPIDTO:
Total Income
Sum of all income movements (
totalIngresos) in the selected period, with a percentage change badge comparing against the prior equivalent period.Total Expenses
Sum of all expense movements (
totalGastos) in the selected period, with a period-over-period variation indicator.Net Balance
balance_neto = ingresos − gastos. Shows whether the period ended in surplus or deficit, including the percentage variation vs. the prior period.Movement Count
Total number of movements recorded (
totalMovimientos) with a count variation badge.null when there is no prior period data to compare against.
Charts
Income vs. Expense (Trend Chart)
TheIngresosVsGastosAssembler produces an IngresosVsGastosDTO that includes both a time-series breakdown (data) and a set of averages (promedios):
ReportGranularityResolver based on the selected date range.
Net Balance Line Chart
TheBalanceNetoAssembler extracts the balance series (BALANCE_NETO) from the query result and passes it directly to the chart, drawing a single line that shows whether your household was in surplus or deficit at each point in the period.
Category Distribution (Pie Chart)
TheCategoryDistributionAssembler groups movements by category and returns a FullCategoryDistributionDTO:
Budget Percentage Chart
TheUsedBudgetAssembler compares actual spending to budgeted targets:
porcentaje_usado. Bars that exceed 100 % are highlighted to flag over-budget categories.
Filters
The filter sheet lets you narrow the report to a specific time window, a subset of categories, or a specific account. Filter values are validated byGenerateReporteRequest:
Period
Set
startDate and endDate to focus on any date range — a single week, a quarter, or a full year.Categories
Select one or more categories to include. Leave empty to include all. Enable
only_categorias_fijas to show only fixed-expense categories.Accounts
Filter by one or more accounts to see the report for a specific bank account or cash wallet.
Active Filter Display
TheActiveReportFilters component renders a pill row showing every currently active filter — period, selected categories, and selected accounts. Each pill has an individual remove button. A Reset button clears all filters at once by calling useResetActiveFilters.
Downloading Reports
TheDownloadReportButton component offers two export options:
PDF Export
Renders the
ReporteDataSectionId div server-side using barryvdh/laravel-dompdf and streams a PDF file. Ideal for sharing or archiving.Image / PDF (client-side)
Uses html-to-image and jsPDF in the browser to capture the visible report as a PNG or PDF without a server round-trip.
How to Use the Reports Module
Open the filter sheet
Navigate to
/reportes. Click the filter button to open the filter sheet. Select a date range, optionally narrow by categories and/or accounts, and choose whether to limit to fixed categories only.Apply filters and view the report
Click Apply. The API call fires with your parameters, and all KPI cards and charts update to reflect the filtered data. Active filter pills appear in the header row so you always know which filters are in effect.
Analyse the charts
Review the income-vs-expense trend, the net balance trajectory, the category distribution pie, and the budget consumption bars. Use the period averages (
promedios) to benchmark individual movements against your typical patterns.Reset or refine filters
Remove individual filter pills or click Reset to return to the default view. Adjust the date range granularity by widening or narrowing the period.
If no movements exist for the selected filters, the report page renders an empty-state message: “Aún no tienes movimientos registrados para generar reportes.” Add movements that match your filter criteria and reload the report.