Added payment field to transaction

This commit is contained in:
Edgar P. Burkhart 2022-05-22 13:52:09 +02:00
parent 215787e204
commit b45150d4ff
Signed by: edpibu
GPG key ID: 9833D3C5A25BD227
3 changed files with 32 additions and 4 deletions

View file

@ -6,13 +6,13 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('main', '0002_alter_snapshot_date_alter_snapshot_diff'),
("main", "0002_alter_snapshot_date_alter_snapshot_diff"),
]
operations = [
migrations.AddField(
model_name='transaction',
name='real_date',
model_name="transaction",
name="real_date",
field=models.DateField(blank=True, null=True),
),
]

View file

@ -0,0 +1,18 @@
# Generated by Django 4.0.4 on 2022-05-22 11:51
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("main", "0003_transaction_real_date"),
]
operations = [
migrations.AddField(
model_name="transaction",
name="payment",
field=models.CharField(blank=True, max_length=128, null=True),
),
]

View file

@ -33,6 +33,7 @@ class Transaction(models.Model):
date = models.DateField(default=date.today)
real_date = models.DateField(blank=True, null=True)
trader = models.CharField(max_length=128, blank=True, null=True)
payment = models.CharField(max_length=128, blank=True, null=True)
category = models.ForeignKey(
Category, on_delete=models.SET_NULL, blank=True, null=True
)
@ -50,7 +51,16 @@ class Transaction(models.Model):
class TransactionForm(ModelForm):
class Meta:
model = Transaction
fields = ["date", "name", "value", "trader", "category", "real_date", "description"]
fields = [
"date",
"name",
"value",
"trader",
"category",
"real_date",
"payment",
"description",
]
class Invoice(models.Model):