# Generated by Django 2.1.7 on 2020-09-24 17:54

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


class Migration(migrations.Migration):

    dependencies = [
        ('company', '0063_company_lng_lat'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('product', '0010_test'),
        ('promotion', '0002_auto_20200923_1454'),
    ]

    operations = [
        migrations.CreateModel(
            name='PrjMaterial',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('qty', models.IntegerField(verbose_name='数量')),
                ('material', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='promotion.Material', verbose_name='物料名称')),
            ],
            options={
                'verbose_name': '方案促销物料数量',
                'verbose_name_plural': '方案促销物料数量',
            },
        ),
        migrations.CreateModel(
            name='PrjMaterialDetails',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('qty', models.IntegerField(verbose_name='数量')),
                ('dt', models.DateField(auto_now_add=True, db_index=True, verbose_name='日期')),
                ('tm', models.DateTimeField(auto_now_add=True, verbose_name='时间')),
                ('company', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='company.Company', verbose_name='公司名称')),
                ('material', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='promotion.Material', verbose_name='物料名称')),
            ],
            options={
                'verbose_name': '促销物料状态明细',
                'verbose_name_plural': '促销物料状态明细',
            },
        ),
        migrations.CreateModel(
            name='PrjProduct',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('qty', models.IntegerField(verbose_name='数量')),
                ('package_id', models.SmallIntegerField(choices=[(3, '箱'), (1, '瓶')], 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='PrjProductDetails',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('label_code', models.CharField(max_length=20, verbose_name='标签号码')),
                ('package_id', models.SmallIntegerField(blank=True, null=True, verbose_name='标签类型')),
                ('label_id', models.BigIntegerField(blank=True, null=True, verbose_name='标签ID')),
                ('label_pk_id', models.BigIntegerField(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='时间')),
                ('company', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='company.Company', 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='PrjStatus',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=20, verbose_name='状态名')),
                ('remqrk', models.CharField(blank=True, max_length=50, null=True, verbose_name='备注说明')),
            ],
            options={
                'verbose_name': '礼品核销状态',
                'verbose_name_plural': '礼品核销状态',
            },
        ),
        migrations.CreateModel(
            name='PrjStatusLog',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('tm', models.DateTimeField(auto_now_add=True, verbose_name='时间')),
                ('remark', models.CharField(blank=True, max_length=100, null=True, verbose_name='备注')),
            ],
            options={
                'verbose_name': '方案状态日志',
                'verbose_name_plural': '方案状态日志',
            },
        ),
        migrations.CreateModel(
            name='Project',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('code', models.CharField(max_length=10, verbose_name='方案编号')),
                ('content', models.CharField(max_length=100, verbose_name='方案内容')),
                ('remark', models.CharField(blank=True, max_length=100, null=True, verbose_name='备注说明')),
                ('tm', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('agent', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='project_agent', to='company.Company', verbose_name='客户名称')),
                ('company', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='company.Company', verbose_name='公司名称')),
                ('saldiv', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='company.SalesDivision', verbose_name='营销战区')),
                ('salesman', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='project_salesman', to=settings.AUTH_USER_MODEL, verbose_name='业务员')),
                ('status', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='promotion.PrjStatus', verbose_name='核销状态')),
                ('subdiv', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='company.SubSalDivision', verbose_name='营销分区')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='操作员')),
            ],
            options={
                'verbose_name': '礼品促销方案',
                'verbose_name_plural': '礼品促销方案',
            },
        ),
        migrations.AddField(
            model_name='prjstatuslog',
            name='project',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='promotion.Project', verbose_name='促销方案'),
        ),
        migrations.AddField(
            model_name='prjstatuslog',
            name='status',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='promotion.PrjStatus', verbose_name='核销状态'),
        ),
        migrations.AddField(
            model_name='prjstatuslog',
            name='user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='操作员'),
        ),
        migrations.AddField(
            model_name='prjproductdetails',
            name='project',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='promotion.Project', verbose_name='促销方案'),
        ),
        migrations.AddField(
            model_name='prjproductdetails',
            name='status',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='promotion.PrjStatus', verbose_name='核销状态'),
        ),
        migrations.AddField(
            model_name='prjproductdetails',
            name='user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='操作人'),
        ),
        migrations.AddField(
            model_name='prjproduct',
            name='project',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='promotion.Project', verbose_name='促销方案'),
        ),
        migrations.AddField(
            model_name='prjmaterialdetails',
            name='project',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='promotion.Project', verbose_name='促销方案'),
        ),
        migrations.AddField(
            model_name='prjmaterialdetails',
            name='status',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='promotion.PrjStatus', verbose_name='核销状态'),
        ),
        migrations.AddField(
            model_name='prjmaterialdetails',
            name='user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='操作人'),
        ),
        migrations.AddField(
            model_name='prjmaterial',
            name='project',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='promotion.Project', verbose_name='促销方案'),
        ),
        migrations.AlterUniqueTogether(
            name='prjproductdetails',
            unique_together={('project', 'company', 'label_code', 'status')},
        ),
    ]
