Add real date field to transactions

This commit is contained in:
Edgar P. Burkhart 2022-05-22 13:36:43 +02:00
parent 83aefe1f84
commit 215787e204
Signed by: edpibu
GPG Key ID: 9833D3C5A25BD227
2 changed files with 20 additions and 1 deletions

View File

@ -0,0 +1,18 @@
# Generated by Django 4.0.4 on 2022-05-22 11:35
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('main', '0002_alter_snapshot_date_alter_snapshot_diff'),
]
operations = [
migrations.AddField(
model_name='transaction',
name='real_date',
field=models.DateField(blank=True, null=True),
),
]

View File

@ -31,6 +31,7 @@ class Transaction(models.Model):
description = models.TextField(null=True, blank=True)
value = models.DecimalField(max_digits=12, decimal_places=2, default=0)
date = models.DateField(default=date.today)
real_date = models.DateField(blank=True, null=True)
trader = models.CharField(max_length=128, blank=True, null=True)
category = models.ForeignKey(
Category, on_delete=models.SET_NULL, blank=True, null=True
@ -49,7 +50,7 @@ class Transaction(models.Model):
class TransactionForm(ModelForm):
class Meta:
model = Transaction
fields = ["date", "name", "value", "trader", "category", "description"]
fields = ["date", "name", "value", "trader", "category", "real_date", "description"]
class Invoice(models.Model):