# Generated by Django 3.1.5 on 2021-01-21 09:41

import django.db.models.deletion
import django.utils.timezone
from django.conf import settings
from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('billing', '0004_auto_20210119_1514'),
    ]

    operations = [
        migrations.CreateModel(
            name='Bill',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('cdate', models.DateTimeField(default=django.utils.timezone.now, verbose_name='Дата создания')),
                ('mdate', models.DateTimeField(auto_now=True, verbose_name='Дата изменения')),
                ('bill_type', models.CharField(choices=[('prepay', 'предоплата на счет'), ('sell', 'реализация товара или услуги'), ('commission', 'Плата за оказание услуги продажи'), ('proceeds', 'Выручка')], max_length=32, verbose_name='Тип счета')),
                ('status', models.CharField(choices=[('not_activated', 'Счет не активирован'), ('activated', 'Счет активирован'), ('cancelled', 'Счет отменен')], default='not_activated', max_length=32, verbose_name='статус счета')),
                ('amount', models.DecimalField(decimal_places=2, max_digits=19, verbose_name='Сумма счета')),
                ('vat', models.IntegerField(verbose_name='НДС')),
                ('client', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='Владелец счета')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='transaction',
            name='bill',
            field=models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, to='billing.bill', verbose_name='Счет'),
            preserve_default=False,
        ),
    ]
