Add budget option to categories

This commit is contained in:
Edgar P. Burkhart 2022-12-20 15:28:56 +01:00
parent 19490e62b2
commit 396ef9ead5
Signed by: edpibu
GPG Key ID: 9833D3C5A25BD227
4 changed files with 188 additions and 38 deletions

View File

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: 0.0.1\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-12-19 11:42+0100\n"
"POT-Creation-Date: 2022-12-20 15:28+0100\n"
"PO-Revision-Date: 2022-05-30 19:00+0200\n"
"Last-Translator: edpibu <git@edgarpierre.fr>\n"
"Language-Team: edpibu <git@edgarpierre.fr>\n"
@ -17,119 +17,123 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
#: .\main\models.py:12 .\main\models.py:21 .\main\models.py:55
#: .\main\templates\main\tag\transaction_table.html:10
#: .\models.py:12 .\models.py:22 .\models.py:56
#: .\templates\main\tag\transaction_table.html:10
msgid "Category"
msgstr "Catégorie"
#: .\main\models.py:12 .\main\models.py:36 .\main\models.py:87
#: .\main\templates\main\tag\transaction_table.html:7
#: .\models.py:12 .\models.py:37 .\models.py:88
#: .\templates\main\tag\transaction_table.html:7
msgid "Name"
msgstr "Nom"
#: .\main\models.py:14
#: .\models.py:14
msgid "Icon"
msgstr "Icône"
#: .\main\models.py:22 .\main\templates\main\index.html:57
#: .\main\templates\main\snapshot.html:33
#: .\models.py:15
msgid "Budget"
msgstr "Budget"
#: .\models.py:23 .\templates\main\index.html:57
#: .\templates\main\snapshot.html:33
msgid "Categories"
msgstr "Catégories"
#: .\main\models.py:36 .\main\models.py:63
#: .\models.py:37 .\models.py:64
msgid "Transaction"
msgstr "Transaction"
#: .\main\models.py:38 .\main\templates\main\tag\transaction_table.html:11
#: .\models.py:39 .\templates\main\tag\transaction_table.html:11
msgid "Description"
msgstr "Description"
#: .\main\models.py:40 .\main\models.py:121 .\main\templates\main\index.html:23
#: .\main\templates\main\tag\transaction_table.html:8
#: .\models.py:41 .\models.py:122 .\templates\main\index.html:23
#: .\templates\main\tag\transaction_table.html:8
msgid "Value"
msgstr "Valeur"
#: .\main\models.py:42 .\main\models.py:119 .\main\templates\main\index.html:22
#: .\main\templates\main\tag\transaction_table.html:6
#: .\models.py:43 .\models.py:120 .\templates\main\index.html:22
#: .\templates\main\tag\transaction_table.html:6
msgid "Date"
msgstr "Date"
#: .\main\models.py:43
#: .\models.py:44
msgid "Real date"
msgstr "Date réelle"
#: .\main\models.py:45 .\main\templates\main\tag\transaction_table.html:9
#: .\models.py:46 .\templates\main\tag\transaction_table.html:9
msgid "Trader"
msgstr "Commerçant"
#: .\main\models.py:48
#: .\models.py:49
msgid "Payment"
msgstr "Paiement"
#: .\main\models.py:64 .\main\templates\main\base.html:30
#: .\main\templates\main\category.html:22 .\main\templates\main\index.html:14
#: .\main\templates\main\index.html:25 .\main\templates\main\snapshot.html:87
#: .\main\templates\main\transactions.html:13
#: .\models.py:65 .\templates\main\base.html:30
#: .\templates\main\category.html:22 .\templates\main\index.html:14
#: .\templates\main\index.html:25 .\templates\main\snapshot.html:87
#: .\templates\main\transactions.html:13
msgid "Transactions"
msgstr "Transactions"
#: .\main\models.py:87 .\main\models.py:104
#: .\models.py:88 .\models.py:105
msgid "Invoice"
msgstr "Facture"
#: .\main\models.py:92
#: .\models.py:93
msgid "File"
msgstr "Fichier"
#: .\main\models.py:105 .\main\templates\main\transaction.html:23
#: .\models.py:106 .\templates\main\transaction.html:23
msgid "Invoices"
msgstr "Factures"
#: .\main\models.py:211
#: .\models.py:230
msgid "Snapshot"
msgstr "Relevé"
#: .\main\models.py:212 .\main\templates\main\index.html:19
#: .\models.py:231 .\templates\main\index.html:19
msgid "Snapshots"
msgstr "Relevés"
#: .\main\templates\main\base.html:35
#: .\templates\main\base.html:35
msgid "New transaction"
msgstr "Nouvelle transaction"
#: .\main\templates\main\base.html:40
#: .\templates\main\base.html:40
msgid "New category"
msgstr "Nouvelle catégorie"
#: .\main\templates\main\base.html:45
#: .\templates\main\base.html:45
msgid "New snapshot"
msgstr "Nouveau relevé"
#: .\main\templates\main\index.html:24
#: .\templates\main\index.html:24
msgid "Difference"
msgstr "Différence"
#: .\main\templates\main\index.html:26
#: .\templates\main\index.html:26
msgid "Valid"
msgstr "Valide"
#: .\main\templates\main\login.html:12 .\main\templates\main\login.html:24
#: .\templates\main\login.html:12 .\templates\main\login.html:31
msgid "Log In"
msgstr "Se connecter"
#: .\main\templates\main\tag\form_buttons.html:4
#: .\main\templates\main\transaction.html:29
#: .\templates\main\tag\form_buttons.html:4
#: .\templates\main\transaction.html:29
msgid "Delete"
msgstr "Supprimer"
#: .\main\templates\main\tag\form_buttons.html:14
#: .\templates\main\tag\form_buttons.html:14
msgid "Save"
msgstr "Enregistrer"
#: .\main\templates\main\transaction.html:36
#: .\templates\main\transaction.html:36
msgid "Add invoice"
msgstr "Ajouter une facture"
#: .\main\templates\main\transaction.html:41
#: .\templates\main\transaction.html:41
msgid "Add"
msgstr "Ajouter"

View File

@ -0,0 +1,145 @@
# Generated by Django 4.1.4 on 2022-12-20 14:26
import datetime
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
("main", "0005_alter_category_name"),
]
operations = [
migrations.AlterModelOptions(
name="category",
options={
"ordering": ["name"],
"verbose_name": "Catégorie",
"verbose_name_plural": "Catégories",
},
),
migrations.AlterModelOptions(
name="invoice",
options={"verbose_name": "Facture", "verbose_name_plural": "Factures"},
),
migrations.AlterModelOptions(
name="snapshot",
options={
"ordering": ["-date"],
"verbose_name": "Relevé",
"verbose_name_plural": "Relevés",
},
),
migrations.AlterModelOptions(
name="transaction",
options={
"ordering": ["-date"],
"verbose_name": "Transaction",
"verbose_name_plural": "Transactions",
},
),
migrations.AddField(
model_name="category",
name="budget",
field=models.BooleanField(default=True, verbose_name="Budget"),
),
migrations.AlterField(
model_name="category",
name="icon",
field=models.CharField(
default="folder", max_length=64, verbose_name="Icône"
),
),
migrations.AlterField(
model_name="category",
name="name",
field=models.CharField(
default="Catégorie", max_length=64, verbose_name="Nom"
),
),
migrations.AlterField(
model_name="invoice",
name="file",
field=models.FileField(
upload_to="invoices/",
validators=[django.core.validators.FileExtensionValidator(["pdf"])],
verbose_name="Fichier",
),
),
migrations.AlterField(
model_name="invoice",
name="name",
field=models.CharField(
default="Facture", max_length=256, verbose_name="Nom"
),
),
migrations.AlterField(
model_name="snapshot",
name="date",
field=models.DateField(unique=True, verbose_name="Date"),
),
migrations.AlterField(
model_name="snapshot",
name="value",
field=models.DecimalField(
decimal_places=2, default=0, max_digits=12, verbose_name="Valeur"
),
),
migrations.AlterField(
model_name="transaction",
name="category",
field=models.ForeignKey(
blank=True,
null=True,
on_delete=django.db.models.deletion.SET_NULL,
to="main.category",
verbose_name="Catégorie",
),
),
migrations.AlterField(
model_name="transaction",
name="date",
field=models.DateField(default=datetime.date.today, verbose_name="Date"),
),
migrations.AlterField(
model_name="transaction",
name="description",
field=models.TextField(blank=True, null=True, verbose_name="Description"),
),
migrations.AlterField(
model_name="transaction",
name="name",
field=models.CharField(
default="Transaction", max_length=256, verbose_name="Nom"
),
),
migrations.AlterField(
model_name="transaction",
name="payment",
field=models.CharField(
blank=True, max_length=128, null=True, verbose_name="Paiement"
),
),
migrations.AlterField(
model_name="transaction",
name="real_date",
field=models.DateField(blank=True, null=True, verbose_name="Date réelle"),
),
migrations.AlterField(
model_name="transaction",
name="trader",
field=models.CharField(
blank=True, max_length=128, null=True, verbose_name="Commerçant"
),
),
migrations.AlterField(
model_name="transaction",
name="value",
field=models.DecimalField(
decimal_places=2, default=0, max_digits=12, verbose_name="Valeur"
),
),
]

View File

@ -12,6 +12,7 @@ class Category(models.Model):
max_length=64, default=_("Category"), verbose_name=_("Name")
)
icon = models.CharField(max_length=64, default="folder", verbose_name=_("Icon"))
budget = models.BooleanField(default=True, verbose_name=_("Budget"))
def __str__(self):
return self.name
@ -27,7 +28,7 @@ class CategoryForm(ModelForm):
class Meta:
model = Category
fields = ["name", "icon"]
fields = ["name", "icon", "budget"]
class Transaction(models.Model):