Files
kakebo/app/yearly/models.py
Andros Fenollosa a7dd758d44 Add planned expenses to Year with month breakdown
- PlannedExpense model: year, month, concept, amount
- CRUD via LiveView in Year page (add form + delete)
- Tables grouped by month with totals
- Variable expenses line in Year charts includes planned expenses
- Month page shows read-only planned expenses table for the month
- Month end calculations include planned expenses in totals
2026-03-22 10:28:16 +01:00

15 lines
403 B
Python

from django.db import models
class PlannedExpense(models.Model):
year = models.PositiveIntegerField()
month = models.PositiveSmallIntegerField()
concept = models.CharField(max_length=255)
amount = models.DecimalField(max_digits=10, decimal_places=2)
class Meta:
ordering = ["year", "month", "concept"]
def __str__(self):
return f"{self.concept} - {self.amount} ({self.month}/{self.year})"