# Generated by Django 3.1.4 on 2021-01-06 11:17

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


class Migration(migrations.Migration):

    dependencies = [
        ('company', '0107_auto_20201230_0952'),
        ('inventory', '0073_auto_20210106_1011'),
    ]

    operations = [
        migrations.AlterModelOptions(
            name='stkclosingperiod',
            options={'verbose_name': '库存期结会计期', 'verbose_name_plural': '库存期结会计期'},
        ),
        migrations.RemoveField(
            model_name='stkclosingbatchdetails',
            name='stkclosing',
        ),
        migrations.RemoveField(
            model_name='stkclosingperiod',
            name='ancestor_id',
        ),
        migrations.RemoveField(
            model_name='stkclosingperiod',
            name='company',
        ),
        migrations.RemoveField(
            model_name='stkclosingperiod',
            name='dt',
        ),
        migrations.RemoveField(
            model_name='stkclosingstkdetails',
            name='stkclosing',
        ),
        migrations.AddField(
            model_name='stkclosingbatchdetails',
            name='stkperiod',
            field=models.ForeignKey(default=1, on_delete=django.db.models.deletion.PROTECT, related_name='stkclosingbatchdetails_period', to='inventory.stkclosingperiod', verbose_name='所属会计期'),
            preserve_default=False,
        ),
        migrations.AddField(
            model_name='stkclosingstkdetails',
            name='stkperiod',
            field=models.ForeignKey(default=1, on_delete=django.db.models.deletion.PROTECT, related_name='stkclosingdetails_period', to='inventory.stkclosingperiod', verbose_name='所属会计期'),
            preserve_default=False,
        ),
        migrations.AlterField(
            model_name='stkclosingperiod',
            name='tm',
            field=models.DateTimeField(auto_now_add=True, verbose_name='创建时间'),
        ),
        migrations.CreateModel(
            name='StkClosingCurrent',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('ancestor', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='stkclosingcurrent_company', to='company.company', verbose_name='企业名称')),
                ('stkperiod', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='stkclosingcurrent_period', to='inventory.stkclosingperiod', verbose_name='当前会计期')),
            ],
            options={
                'verbose_name': '企业当前会计期',
                'verbose_name_plural': '企业当前会计期',
            },
        ),
        migrations.CreateModel(
            name='StkClosingBatch',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('ancestor_id', models.IntegerField(db_index=True, verbose_name='企业ID')),
                ('store', models.IntegerField(default=0, verbose_name='仓库ID')),
                ('dt', models.DateField(auto_now_add=True, verbose_name='日期')),
                ('tm', models.DateTimeField(auto_now_add=True, 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='stkclosingbatch_company', to='company.company', verbose_name='公司')),
                ('stkperiod', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='stkclosingbatch_period', to='inventory.stkclosingperiod', verbose_name='所属会计期')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='stkclosingbatch_user', to='company.company', verbose_name='操作人')),
            ],
            options={
                'verbose_name': '企业当前会计期',
                'verbose_name_plural': '企业当前会计期',
            },
        ),
        migrations.AddField(
            model_name='stkclosingbatchdetails',
            name='closingbatch',
            field=models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, related_name='stkclosingbatchdetails_batch', to='inventory.stkclosingbatch', verbose_name='公司'),
            preserve_default=False,
        ),
        migrations.AddField(
            model_name='stkclosingstkdetails',
            name='closingbatch',
            field=models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, related_name='stkclosingstkdetails_batch', to='inventory.stkclosingbatch', verbose_name='期结BATCH'),
            preserve_default=False,
        ),
    ]
