Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Medinaallan/ContabilidadISV/llms.txt

Use this file to discover all available pages before exploring further.

The Reportes module aggregates consolidation data stored across both the consolidaciones_generales and consolidaciones_hoteles tables into three distinct views: high-level metrics, client activity ranking, and per-account Debe/Haber summaries. All report data is served through the /api/reports router and rendered inside the ReportsSection React component. Reports can be exported to Excel (.xlsx) or PDF directly from the dashboard.

Metrics

Endpoint: GET /api/reports/metrics Returns the total count of consolidations in the system, broken down by type. Response shape:
{
  "totalConsolidaciones": 142,
  "consolidacionesGenerales": 98,
  "consolidacionesHoteles": 44
}
Query parameters:
ParameterTypeDescription
yearstringFour-digit year (e.g., 2024). Omit or pass todos for all years.
clienteIdstringNumeric client ID. Omit or pass todos for all clients.
The dashboard shows these three values as colored metric cards: Total (blue), Generales (green), and Hoteles (purple).

Client Ranking

Endpoint: GET /api/reports/ranking Returns all clients sorted in descending order by their total consolidation count (Generales + Hoteles combined). The ranking is not filtered by year or client — it always reflects the full historical dataset. Response shape (array):
[
  {
    "id": 7,
    "nombre_empresa": "Comercial Tegucigalpa S.A.",
    "totalConsolidaciones": 24,
    "consolidacionesGenerales": 18,
    "consolidacionesHoteles": 6
  }
]
Query parameters:
ParameterTypeDescription
yearstringOptional filter by year.
The ranking table in the UI shows a gold, silver, or bronze medal emoji for positions 1–3, and #N for all other positions.

Detailed Summaries

Endpoint: GET /api/reports/summaries Returns aggregated Debe/Haber sums per account, per client, for a given year and time period. Each row in the response corresponds to one client and one consolidation type (general or hotel), with all 55 account fields summed across every matching consolidation. Query parameters:
ParameterTypeRequiredDescription
yearstringYesFour-digit year, e.g. 2024.
clienteIdstringNoNumeric client ID or todos for all clients.
periodostringYesOne of the period values listed below.
Supported periodo values:
ValueDescription
anualFull calendar year
bimestral-1bimestral-6Two-month periods (Jan–Feb through Nov–Dec)
trimestral-1trimestral-4Three-month quarters
semestral-1First semester (Jan–Jun)
semestral-2Second semester (Jul–Dec)
Example request — Q1 2024, all clients:
GET /api/reports/summaries?year=2024&periodo=trimestral-1&clienteId=todos
Example request — full year 2023 for client ID 5:
GET /api/reports/summaries?year=2023&periodo=anual&clienteId=5
The response includes total_debe, total_haber, and diferencia computed fields, as well as cliente_rtn and usuario_nombre for display on exported PDF headers.

Viewing Reports in the Dashboard

The ReportsSection component is accessed via the Reportes entry in the sidebar. It contains three tabs:

Métricas Generales

Count cards for total, Generales, and Hoteles consolidations. Filterable by year and client via a live-search input.

Ranking de Clientes

Sortable table showing each client’s total and per-type consolidation counts with medal indicators for top 3.

Resúmenes por Cliente

Per-account Debe/Haber table with year, client, and period filters. Includes Exportar Excel and Exportar PDF buttons.

Summaries Tab — Workflow

1

Select the Resúmenes por Cliente tab

Click the Resúmenes por Cliente tab at the top of the Reports section.
2

Set filters

Choose a Cliente (type to search, or leave as Todos los clientes), a Año, and a Período from the dropdowns.
3

Apply filters

Click Aplicar Filtros. The system fetches aggregated data from GET /api/reports/summaries.
4

Review the summary table

Each client block shows all 55 accounts in rows with their summed Debe and Haber values, plus a TOTALES row and a DIFERENCIA row at the bottom.
5

Export (optional)

Click Exportar Excel or Exportar PDF to download the current summary. Both buttons are disabled until data is loaded.
The Exportar PDF button for summaries generates a letter-sized PDF with a centered logo header, the period label, client name, RTN, generation date, and the full account table — identical layout to the per-consolidation PDF export.

Consolidations

Understand the source data that feeds into reports.

Export

Export individual consolidations in addition to summary reports.

Reports API

REST endpoints for all three report types.

Clients

Client entities referenced in report filters and summaries.

Build docs developers (and LLMs) love