# Generated by Django 3.1.4 on 2021-03-10 08:07

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('product', '0013_product_brand'),
        ('company', '0184_auto_20210309_0805'),
    ]

    operations = [
        migrations.CreateModel(
            name='Category',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50, verbose_name='类别名称')),
                ('sn', models.SmallIntegerField(default=0, verbose_name='序号')),
                ('remark', models.CharField(blank=True, max_length=100, null=True, verbose_name='备注说明')),
                ('company', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='category_company', to='company.company', verbose_name='公司名称')),
            ],
            options={
                'verbose_name': '用酒类别',
                'verbose_name_plural': '用酒类别',
            },
        ),
        migrations.CreateModel(
            name='EntApplication',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('subject', models.CharField(max_length=50, verbose_name='接待对象')),
                ('headcount', models.IntegerField(verbose_name='接待人数')),
                ('reason', models.CharField(max_length=100, verbose_name='接待原因')),
                ('location', models.CharField(max_length=100, verbose_name='接待地点')),
                ('aprv_department', models.BooleanField(blank=True, default=False, null=True, verbose_name='部门负责人')),
                ('aprv_deputy', models.BooleanField(blank=True, default=False, null=True, verbose_name='分管领导')),
                ('aprv_gm', models.BooleanField(blank=True, default=False, null=True, verbose_name='总经理')),
                ('qty_box', models.IntegerField(default=0, verbose_name='箱数')),
                ('qty_bottle', models.IntegerField(default=0, verbose_name='瓶数')),
                ('dt', models.DateField(auto_now_add=True, db_index=True, verbose_name='创建日期')),
                ('tm', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('is_writeoff', models.BooleanField(default=False, verbose_name='是否已核销')),
                ('remark', models.CharField(blank=True, max_length=100, null=True, verbose_name='备注说明')),
                ('category', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='entertainment.category', verbose_name='用酒类别')),
                ('company', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='entapp_company', to='company.company', verbose_name='公司名称')),
                ('department', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='company.department', verbose_name='部门名称')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='entapp_user', to=settings.AUTH_USER_MODEL, verbose_name='经办人')),
            ],
            options={
                'verbose_name': '用酒审批单',
                'verbose_name_plural': '用酒审批单',
            },
        ),
        migrations.CreateModel(
            name='Expense',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50, verbose_name='类别名称')),
                ('sn', models.SmallIntegerField(default=0, verbose_name='序号')),
                ('remark', models.CharField(blank=True, max_length=100, null=True, verbose_name='备注说明')),
            ],
            options={
                'verbose_name': '费用类别',
                'verbose_name_plural': '费用类别',
            },
        ),
        migrations.CreateModel(
            name='EntAppWriteoff',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('label', models.CharField(db_index=True, max_length=20, verbose_name='标签号码')),
                ('label_code', models.CharField(db_index=True, max_length=20, unique=True, verbose_name='物流号码')),
                ('label_pkg_id', models.SmallIntegerField(verbose_name='标签类型')),
                ('label_pk_id', models.BigIntegerField(verbose_name='主标签ID')),
                ('dt', models.DateField(auto_now_add=True, db_index=True, verbose_name='创建日期')),
                ('tm', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('entapplication', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='entappwriteoff_app', to='entertainment.entapplication', verbose_name='用酒审批单')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='entappwriteoff_user', to=settings.AUTH_USER_MODEL, verbose_name='核销人')),
            ],
            options={
                'verbose_name': '用酒单核销记录',
                'verbose_name_plural': '用酒单核销记录',
            },
        ),
        migrations.CreateModel(
            name='EntAppProduct',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('spec', models.CharField(max_length=20, verbose_name='规格')),
                ('qty_x', models.IntegerField(verbose_name='箱数')),
                ('qty_h', models.IntegerField(verbose_name='瓶数')),
                ('entapplication', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='entproduct_app', to='entertainment.entapplication', verbose_name='用酒审批单')),
                ('product', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='product.product', verbose_name='产品名称')),
            ],
            options={
                'verbose_name': '用酒单产品',
                'verbose_name_plural': '用酒单产品',
            },
        ),
        migrations.CreateModel(
            name='EntAppAprv',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('position', models.CharField(blank=True, max_length=20, null=True, verbose_name='职务')),
                ('dt', models.DateField(auto_now_add=True, db_index=True, verbose_name='创建日期')),
                ('tm', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('remark', models.CharField(blank=True, max_length=100, null=True, verbose_name='备注说明')),
                ('entapplication', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='entappaprv_app', to='entertainment.entapplication', verbose_name='用酒审批单')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='entappaprv_user', to=settings.AUTH_USER_MODEL, verbose_name='审批人')),
            ],
            options={
                'verbose_name': '用酒单审批记录',
                'verbose_name_plural': '用酒单审批记录',
            },
        ),
        migrations.AddField(
            model_name='category',
            name='expense',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='entertainment.expense', verbose_name='费用类别'),
        ),
    ]
