# Generated by Django 3.1.4 on 2021-03-13 10:47

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


class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('company', '0186_auto_20210312_1354'),
        ('product', '0013_product_brand'),
        ('entertainment', '0007_auto_20210312_2024'),
    ]

    operations = [
        migrations.CreateModel(
            name='ActApplication',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('schema_no', models.CharField(blank=True, max_length=30, null=True, verbose_name='总案流水号')),
                ('app_no', models.CharField(blank=True, max_length=30, null=True, verbose_name='申请单流水号')),
                ('subject', models.CharField(blank=True, max_length=100, null=True, verbose_name='会议活动主题')),
                ('hotel', models.CharField(blank=True, max_length=100, null=True, verbose_name='招待酒店/餐厅')),
                ('dinner_dt', models.DateField(blank=True, null=True, verbose_name='用餐日期')),
                ('dinner_address', models.CharField(blank=True, max_length=100, null=True, verbose_name='酒店/餐厅地址')),
                ('dinner_headcount', models.IntegerField(blank=True, null=True, verbose_name='用餐人数')),
                ('cellphone', models.CharField(blank=True, max_length=11, null=True, verbose_name='联系电话')),
                ('invitee', models.CharField(blank=True, max_length=50, null=True, verbose_name='招待对象')),
                ('agent_id', models.IntegerField(blank=True, null=True, verbose_name='规属平台商')),
                ('salesman_id', models.IntegerField(blank=True, 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='创建时间')),
                ('qty_box', models.IntegerField(blank=True, default=0, null=True, verbose_name='箱数')),
                ('qty_bottle', models.IntegerField(blank=True, default=0, null=True, verbose_name='瓶数')),
                ('remark', models.CharField(blank=True, max_length=100, null=True, verbose_name='备注说明')),
                ('category', models.ForeignKey(default=5, on_delete=django.db.models.deletion.PROTECT, related_name='actapp_category', to='entertainment.category', verbose_name='用酒类别')),
                ('company', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='actapp_company', to='company.company', verbose_name='公司名称')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='actapp_user', to=settings.AUTH_USER_MODEL, verbose_name='提交人')),
            ],
            options={
                'verbose_name': '会议活动用酒',
                'verbose_name_plural': '会议活动用酒',
            },
        ),
        migrations.CreateModel(
            name='ActAppProduct',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('qty_x', models.IntegerField(verbose_name='箱数')),
                ('qty_p', models.IntegerField(verbose_name='瓶数')),
                ('actapplication', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='entproduct_app', to='entertainment.actapplication', 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='EntWriteoff',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('company_id', models.IntegerField(verbose_name='企业ID')),
                ('category_id', models.IntegerField(blank=True, null=True, verbose_name='用酒类别')),
                ('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='物流号码')),
                ('box_code', models.CharField(blank=True, max_length=20, null=True, verbose_name='主箱标')),
                ('label_pk_id', models.BigIntegerField(blank=True, null=True, verbose_name='主箱标ID')),
                ('product_id', models.IntegerField(blank=True, null=True, verbose_name='产品ID')),
                ('agent_id', models.IntegerField(blank=True, null=True, verbose_name='经销商')),
                ('salesdivision_id', models.IntegerField(blank=True, null=True, verbose_name='战区ID')),
                ('subdivision_id', models.IntegerField(blank=True, null=True, verbose_name='分区ID')),
                ('dt', models.DateField(auto_now_add=True, db_index=True, verbose_name='创建日期')),
                ('tm', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('actapplication', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='entwriteoff_act', to='entertainment.actapplication', verbose_name='会议活动用酒')),
            ],
            options={
                'verbose_name': '用酒销记录',
                'verbose_name_plural': '用酒核销记录',
            },
        ),
        migrations.AddField(
            model_name='entapplication',
            name='aprv_status',
            field=models.IntegerField(blank=True, null=True, verbose_name='审批状态'),
        ),
        migrations.DeleteModel(
            name='EntAppWriteoff',
        ),
        migrations.AddField(
            model_name='entwriteoff',
            name='entapplication',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='entwriteoff_app', to='entertainment.entapplication', verbose_name='用酒审批单'),
        ),
        migrations.AddField(
            model_name='entwriteoff',
            name='user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='entappwriteoff_user', to=settings.AUTH_USER_MODEL, verbose_name='核销人'),
        ),
    ]
