# Generated by Django 4.0.1 on 2023-03-29 22:16

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('members', '0002_remove_member_not_waiting_and_more'),
    ]

    operations = [
        migrations.CreateModel(
            name='Ledger',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=30, verbose_name='Name')),
            ],
            options={
                'verbose_name': 'Ledger',
                'verbose_name_plural': 'Ledgers',
            },
        ),
        migrations.CreateModel(
            name='Statement',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('short_description', models.CharField(blank=True, max_length=30, verbose_name='Short description')),
                ('explanation', models.TextField(blank=True, verbose_name='Explanation')),
                ('night_cost', models.DecimalField(decimal_places=2, default=0, max_digits=5, verbose_name='Price per night')),
                ('submitted', models.BooleanField(default=False, verbose_name='Submitted')),
                ('submitted_date', models.DateTimeField(default=None, null=True, verbose_name='Submitted on')),
                ('confirmed', models.BooleanField(default=False, verbose_name='Confirmed')),
                ('confirmed_date', models.DateTimeField(default=None, null=True, verbose_name='Paid on')),
                ('confirmed_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='confirmed_statements', to='members.member', verbose_name='Authorized by')),
                ('created_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='created_statements', to='members.member', verbose_name='Created by')),
                ('excursion', models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='members.freizeit', verbose_name='Associated excursion')),
                ('submitted_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='submitted_statements', to='members.member', verbose_name='Submitted by')),
            ],
            options={
                'verbose_name': 'Statement',
                'verbose_name_plural': 'Statements',
                'permissions': [('may_edit_submitted_statements', 'Is allowed to edit submitted statements')],
            },
        ),
        migrations.CreateModel(
            name='Transaction',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('reference', models.TextField(verbose_name='Reference')),
                ('amount', models.DecimalField(decimal_places=2, max_digits=6, verbose_name='Amount')),
                ('confirmed', models.BooleanField(default=False, verbose_name='Paid')),
                ('confirmed_date', models.DateTimeField(default=None, null=True, verbose_name='Paid on')),
                ('confirmed_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='confirmed_transactions', to='members.member', verbose_name='Authorized by')),
                ('ledger', models.ForeignKey(default=None, null=True, on_delete=django.db.models.deletion.SET_NULL, to='finance.ledger', verbose_name='Ledger')),
                ('member', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='members.member', verbose_name='Recipient')),
                ('statement', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='finance.statement', verbose_name='Statement')),
            ],
            options={
                'verbose_name': 'Transaction',
                'verbose_name_plural': 'Transactions',
            },
        ),
        migrations.CreateModel(
            name='Receipt',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('short_description', models.CharField(max_length=30, verbose_name='Short description')),
                ('amount', models.DecimalField(decimal_places=2, max_digits=6)),
                ('comments', models.TextField()),
                ('ledger', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='finance.ledger', verbose_name='Ledger')),
            ],
        ),
        migrations.CreateModel(
            name='Bill',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('short_description', models.CharField(max_length=30, verbose_name='Short description')),
                ('explanation', models.TextField(blank=True, verbose_name='Explanation')),
                ('amount', models.DecimalField(decimal_places=2, default=0, max_digits=6)),
                ('costs_covered', models.BooleanField(default=False, verbose_name='Covered')),
                ('refunded', models.BooleanField(default=False, verbose_name='Refunded')),
                ('proof', models.ImageField(blank=True, upload_to='bill_images', verbose_name='Proof')),
                ('paid_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='members.member', verbose_name='Paid by')),
                ('statement', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='finance.statement', verbose_name='Statement')),
            ],
            options={
                'verbose_name': 'Bill',
                'verbose_name_plural': 'Bills',
            },
        ),
        migrations.CreateModel(
            name='StatementConfirmed',
            fields=[
            ],
            options={
                'verbose_name': 'Paid statement',
                'verbose_name_plural': 'Paid statements',
                'permissions': (('may_manage_confirmed_statements', 'Can view and manage confirmed statements.'),),
                'proxy': True,
                'indexes': [],
                'constraints': [],
            },
            bases=('finance.statement',),
        ),
        migrations.CreateModel(
            name='StatementSubmitted',
            fields=[
            ],
            options={
                'verbose_name': 'Submitted statement',
                'verbose_name_plural': 'Submitted statements',
                'permissions': (('may_manage_submitted_statements', 'Can view and manage submitted statements.'),),
                'proxy': True,
                'indexes': [],
                'constraints': [],
            },
            bases=('finance.statement',),
        ),
        migrations.CreateModel(
            name='StatementUnSubmitted',
            fields=[
            ],
            options={
                'verbose_name': 'Statement in preparation',
                'verbose_name_plural': 'Statements in preparation',
                'proxy': True,
                'indexes': [],
                'constraints': [],
            },
            bases=('finance.statement',),
        ),
    ]
