The budgeting system in Leo Counter lets you define spending (or income) targets for each category on a monthly basis, then automatically compare those targets against your recorded movements. Each budget is scoped to a single category and a single calendar month, ensuring that the system can give you a precise view of how much you have spent relative to what you planned.Documentation 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.
How Budgets Work
Budgets are stored in thepresupuestos table. Each record pairs a categoria_id with a periodo (the first day of the target month) and a monto target. When the reports engine runs, it queries both the budget and the actual movements for that category in that month, then produces a UsedBudgetDTO with four derived values: amount spent, amount budgeted, amount remaining, and percentage used.
categoria_id and periodo is unique, meaning you can have at most one budget per category per month.
Current-Month Budgets
The primary budget management interface lives at/presupuestos/mes-actual. It only shows budgets whose periodo matches the first day of the current month.
Budget Fields
The category this budget targets. Must be unique within the current month — you cannot have two budgets for the same category in the same period.
The spending or income target (min 0, up to 12 digits with 2 decimal places).
Optional note about this budget’s purpose (max 80 characters).
Routes
| Method | URI | Action |
|---|---|---|
| GET | /presupuestos/mes-actual | List current-month budgets |
| GET | /presupuestos/mes-actual/create | Show creation form |
| POST | /presupuestos/mes-actual | Store a new budget |
| GET | /presupuestos/mes-actual/{id}/edit | Show edit form |
| PUT | /presupuestos/mes-actual/{id} | Update a budget |
| DELETE | /presupuestos/mes-actual/{id} | Soft-delete a budget |
| POST | /presupuestos/mes-actual/{id}/duplicate | Duplicate a budget |
Duplicating a Budget
The duplicate feature lets you carry a budget forward without re-entering the form. When you callPOST /presupuestos/mes-actual/{id}/duplicate, the DuplicatePresupuestoHandler finds the original budget aggregate, verifies it can be duplicated (uniqueness check), generates a new UUID, and persists the copy with the same category and amount.
CurrentMonthPresupuestoForListDTO exposes an isDuplicate boolean flag that the UI uses to hide the duplicate button on budgets that have already been carried forward.
Historical Budgets
A read-only archive of past budgets is available at/presupuestos/historicos. This view is paginated and lets you look back at any previous month’s plan without being able to accidentally edit historical data.
| Method | URI | Action |
|---|---|---|
| GET | /presupuestos/historicos | Paginated list of past budgets |
Budget Progress Tracking
TheUsedBudgetAssembler calculates budget consumption in the reports engine:
| Field | Type | Description |
|---|---|---|
gastado | float | Total spent against this budget so far |
presupuestado | float | The original budget target |
disponible | float | presupuestado - gastado |
porcentaje_usado | float | Percentage of the budget consumed |
Relationship to Categories and Accounts
Each budget is linked to a category (which itself belongs to a movement type — income or expense). Movements recorded against that category during the budget’s period are summed and compared to the budget target. The account is not part of the budget definition; the same budget applies regardless of which account you use to pay expenses in that category.You can only budget for categories that exist and have not been soft-deleted. If a category is removed after a budget is created, the budget record is retained but the category field displays as blank in the UI.
Monthly Planning Workflow
Create budgets for the month
Go to
/presupuestos/mes-actual and click Create. Select a category, enter a target amount, and optionally add a description. Repeat for each spending category you want to track.Record movements throughout the month
As you record spontaneous, fixed, and pending movements linked to those categories, Leo Counter automatically accumulates the spending totals.
Track progress in real time
Return to
/presupuestos/mes-actual to see the list of budgets. The percentage-used indicator updates every time a new movement is saved.Review in the Reports module
Navigate to
/reportes to see the budget percentage chart, which visualizes gastado vs presupuestado for every budgeted category in the selected period.