Add budget option to categories
This commit is contained in:
parent
19490e62b2
commit
396ef9ead5
4 changed files with 188 additions and 38 deletions
Binary file not shown.
|
@ -7,7 +7,7 @@ msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: 0.0.1\n"
|
"Project-Id-Version: 0.0.1\n"
|
||||||
"Report-Msgid-Bugs-To: \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"
|
"PO-Revision-Date: 2022-05-30 19:00+0200\n"
|
||||||
"Last-Translator: edpibu <git@edgarpierre.fr>\n"
|
"Last-Translator: edpibu <git@edgarpierre.fr>\n"
|
||||||
"Language-Team: edpibu <git@edgarpierre.fr>\n"
|
"Language-Team: edpibu <git@edgarpierre.fr>\n"
|
||||||
|
@ -17,119 +17,123 @@ msgstr ""
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
|
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
|
||||||
|
|
||||||
#: .\main\models.py:12 .\main\models.py:21 .\main\models.py:55
|
#: .\models.py:12 .\models.py:22 .\models.py:56
|
||||||
#: .\main\templates\main\tag\transaction_table.html:10
|
#: .\templates\main\tag\transaction_table.html:10
|
||||||
msgid "Category"
|
msgid "Category"
|
||||||
msgstr "Catégorie"
|
msgstr "Catégorie"
|
||||||
|
|
||||||
#: .\main\models.py:12 .\main\models.py:36 .\main\models.py:87
|
#: .\models.py:12 .\models.py:37 .\models.py:88
|
||||||
#: .\main\templates\main\tag\transaction_table.html:7
|
#: .\templates\main\tag\transaction_table.html:7
|
||||||
msgid "Name"
|
msgid "Name"
|
||||||
msgstr "Nom"
|
msgstr "Nom"
|
||||||
|
|
||||||
#: .\main\models.py:14
|
#: .\models.py:14
|
||||||
msgid "Icon"
|
msgid "Icon"
|
||||||
msgstr "Icône"
|
msgstr "Icône"
|
||||||
|
|
||||||
#: .\main\models.py:22 .\main\templates\main\index.html:57
|
#: .\models.py:15
|
||||||
#: .\main\templates\main\snapshot.html:33
|
msgid "Budget"
|
||||||
|
msgstr "Budget"
|
||||||
|
|
||||||
|
#: .\models.py:23 .\templates\main\index.html:57
|
||||||
|
#: .\templates\main\snapshot.html:33
|
||||||
msgid "Categories"
|
msgid "Categories"
|
||||||
msgstr "Catégories"
|
msgstr "Catégories"
|
||||||
|
|
||||||
#: .\main\models.py:36 .\main\models.py:63
|
#: .\models.py:37 .\models.py:64
|
||||||
msgid "Transaction"
|
msgid "Transaction"
|
||||||
msgstr "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"
|
msgid "Description"
|
||||||
msgstr "Description"
|
msgstr "Description"
|
||||||
|
|
||||||
#: .\main\models.py:40 .\main\models.py:121 .\main\templates\main\index.html:23
|
#: .\models.py:41 .\models.py:122 .\templates\main\index.html:23
|
||||||
#: .\main\templates\main\tag\transaction_table.html:8
|
#: .\templates\main\tag\transaction_table.html:8
|
||||||
msgid "Value"
|
msgid "Value"
|
||||||
msgstr "Valeur"
|
msgstr "Valeur"
|
||||||
|
|
||||||
#: .\main\models.py:42 .\main\models.py:119 .\main\templates\main\index.html:22
|
#: .\models.py:43 .\models.py:120 .\templates\main\index.html:22
|
||||||
#: .\main\templates\main\tag\transaction_table.html:6
|
#: .\templates\main\tag\transaction_table.html:6
|
||||||
msgid "Date"
|
msgid "Date"
|
||||||
msgstr "Date"
|
msgstr "Date"
|
||||||
|
|
||||||
#: .\main\models.py:43
|
#: .\models.py:44
|
||||||
msgid "Real date"
|
msgid "Real date"
|
||||||
msgstr "Date réelle"
|
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"
|
msgid "Trader"
|
||||||
msgstr "Commerçant"
|
msgstr "Commerçant"
|
||||||
|
|
||||||
#: .\main\models.py:48
|
#: .\models.py:49
|
||||||
msgid "Payment"
|
msgid "Payment"
|
||||||
msgstr "Paiement"
|
msgstr "Paiement"
|
||||||
|
|
||||||
#: .\main\models.py:64 .\main\templates\main\base.html:30
|
#: .\models.py:65 .\templates\main\base.html:30
|
||||||
#: .\main\templates\main\category.html:22 .\main\templates\main\index.html:14
|
#: .\templates\main\category.html:22 .\templates\main\index.html:14
|
||||||
#: .\main\templates\main\index.html:25 .\main\templates\main\snapshot.html:87
|
#: .\templates\main\index.html:25 .\templates\main\snapshot.html:87
|
||||||
#: .\main\templates\main\transactions.html:13
|
#: .\templates\main\transactions.html:13
|
||||||
msgid "Transactions"
|
msgid "Transactions"
|
||||||
msgstr "Transactions"
|
msgstr "Transactions"
|
||||||
|
|
||||||
#: .\main\models.py:87 .\main\models.py:104
|
#: .\models.py:88 .\models.py:105
|
||||||
msgid "Invoice"
|
msgid "Invoice"
|
||||||
msgstr "Facture"
|
msgstr "Facture"
|
||||||
|
|
||||||
#: .\main\models.py:92
|
#: .\models.py:93
|
||||||
msgid "File"
|
msgid "File"
|
||||||
msgstr "Fichier"
|
msgstr "Fichier"
|
||||||
|
|
||||||
#: .\main\models.py:105 .\main\templates\main\transaction.html:23
|
#: .\models.py:106 .\templates\main\transaction.html:23
|
||||||
msgid "Invoices"
|
msgid "Invoices"
|
||||||
msgstr "Factures"
|
msgstr "Factures"
|
||||||
|
|
||||||
#: .\main\models.py:211
|
#: .\models.py:230
|
||||||
msgid "Snapshot"
|
msgid "Snapshot"
|
||||||
msgstr "Relevé"
|
msgstr "Relevé"
|
||||||
|
|
||||||
#: .\main\models.py:212 .\main\templates\main\index.html:19
|
#: .\models.py:231 .\templates\main\index.html:19
|
||||||
msgid "Snapshots"
|
msgid "Snapshots"
|
||||||
msgstr "Relevés"
|
msgstr "Relevés"
|
||||||
|
|
||||||
#: .\main\templates\main\base.html:35
|
#: .\templates\main\base.html:35
|
||||||
msgid "New transaction"
|
msgid "New transaction"
|
||||||
msgstr "Nouvelle transaction"
|
msgstr "Nouvelle transaction"
|
||||||
|
|
||||||
#: .\main\templates\main\base.html:40
|
#: .\templates\main\base.html:40
|
||||||
msgid "New category"
|
msgid "New category"
|
||||||
msgstr "Nouvelle catégorie"
|
msgstr "Nouvelle catégorie"
|
||||||
|
|
||||||
#: .\main\templates\main\base.html:45
|
#: .\templates\main\base.html:45
|
||||||
msgid "New snapshot"
|
msgid "New snapshot"
|
||||||
msgstr "Nouveau relevé"
|
msgstr "Nouveau relevé"
|
||||||
|
|
||||||
#: .\main\templates\main\index.html:24
|
#: .\templates\main\index.html:24
|
||||||
msgid "Difference"
|
msgid "Difference"
|
||||||
msgstr "Différence"
|
msgstr "Différence"
|
||||||
|
|
||||||
#: .\main\templates\main\index.html:26
|
#: .\templates\main\index.html:26
|
||||||
msgid "Valid"
|
msgid "Valid"
|
||||||
msgstr "Valide"
|
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"
|
msgid "Log In"
|
||||||
msgstr "Se connecter"
|
msgstr "Se connecter"
|
||||||
|
|
||||||
#: .\main\templates\main\tag\form_buttons.html:4
|
#: .\templates\main\tag\form_buttons.html:4
|
||||||
#: .\main\templates\main\transaction.html:29
|
#: .\templates\main\transaction.html:29
|
||||||
msgid "Delete"
|
msgid "Delete"
|
||||||
msgstr "Supprimer"
|
msgstr "Supprimer"
|
||||||
|
|
||||||
#: .\main\templates\main\tag\form_buttons.html:14
|
#: .\templates\main\tag\form_buttons.html:14
|
||||||
msgid "Save"
|
msgid "Save"
|
||||||
msgstr "Enregistrer"
|
msgstr "Enregistrer"
|
||||||
|
|
||||||
#: .\main\templates\main\transaction.html:36
|
#: .\templates\main\transaction.html:36
|
||||||
msgid "Add invoice"
|
msgid "Add invoice"
|
||||||
msgstr "Ajouter une facture"
|
msgstr "Ajouter une facture"
|
||||||
|
|
||||||
#: .\main\templates\main\transaction.html:41
|
#: .\templates\main\transaction.html:41
|
||||||
msgid "Add"
|
msgid "Add"
|
||||||
msgstr "Ajouter"
|
msgstr "Ajouter"
|
||||||
|
|
|
@ -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"
|
||||||
|
),
|
||||||
|
),
|
||||||
|
]
|
|
@ -12,6 +12,7 @@ class Category(models.Model):
|
||||||
max_length=64, default=_("Category"), verbose_name=_("Name")
|
max_length=64, default=_("Category"), verbose_name=_("Name")
|
||||||
)
|
)
|
||||||
icon = models.CharField(max_length=64, default="folder", verbose_name=_("Icon"))
|
icon = models.CharField(max_length=64, default="folder", verbose_name=_("Icon"))
|
||||||
|
budget = models.BooleanField(default=True, verbose_name=_("Budget"))
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return self.name
|
return self.name
|
||||||
|
@ -27,7 +28,7 @@ class CategoryForm(ModelForm):
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = Category
|
model = Category
|
||||||
fields = ["name", "icon"]
|
fields = ["name", "icon", "budget"]
|
||||||
|
|
||||||
|
|
||||||
class Transaction(models.Model):
|
class Transaction(models.Model):
|
||||||
|
|
Loading…
Reference in a new issue