# Generated by Django 2.1.7 on 2019-10-24 16:02

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('product', '0001_initial'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('company', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Batch',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('note_id', models.IntegerField(blank=True, null=True, verbose_name='单据ID')),
                ('code', models.CharField(blank=True, db_index=True, max_length=20, null=True, verbose_name='单据号码')),
                ('batch_no', 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='生成时间')),
                ('dt_handled', models.DateField(blank=True, db_index=True, null=True, verbose_name='完成时间')),
                ('tm_handled', models.DateTimeField(blank=True, null=True, verbose_name='完成时间')),
                ('remark', models.CharField(blank=True, max_length=50, null=True, verbose_name='备注说明')),
                ('company_fr', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='batch_fr_company', to='company.Company', verbose_name='发货公司')),
                ('company_to', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='batch_to_company', to='company.Company', verbose_name='收货公司')),
                ('prd_line', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='company.PrdLine', verbose_name='生产线')),
                ('prd_plant', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='batch_plant', to='company.PrdPlant', verbose_name='工厂/厂区')),
                ('prd_workshop', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='company.PrdWorkshop', verbose_name='生产车间')),
                ('product', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='product.Product', verbose_name='产品名称')),
                ('qc', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='company.PrdQc', verbose_name='质检员')),
            ],
            options={
                'verbose_name': '出库Batch处理',
                'verbose_name_plural': '出库Batch处理',
            },
        ),
        migrations.CreateModel(
            name='BatchDetails',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('label_code', models.CharField(db_index=True, max_length=20, verbose_name='标签号码')),
                ('label_id', models.IntegerField(blank=True, db_index=True, null=True, verbose_name='标签ID')),
                ('dt', models.DateField(blank=True, db_index=True, null=True, verbose_name='生成日期')),
                ('tm', models.DateTimeField(auto_now_add=True, verbose_name='生成时间')),
                ('label_pkg', models.SmallIntegerField(blank=True, db_index=True, null=True, verbose_name='标签类型')),
                ('batch', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='inventory.Batch', verbose_name='扫码枪Batch')),
            ],
            options={
                'verbose_name': '扫码枪Detail',
                'verbose_name_plural': '扫码枪Detail',
            },
        ),
        migrations.CreateModel(
            name='BindingBatch',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('batch_no', models.CharField(max_length=20, verbose_name='生产批次')),
                ('dt', models.DateField(db_index=True, default=django.utils.timezone.now, verbose_name='日期')),
                ('tm', models.DateTimeField(default=django.utils.timezone.now, verbose_name='时间')),
                ('company', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='binding_batch_company', to='company.Company', verbose_name='公司名称')),
                ('prd_line', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='binding_batch_line', to='company.PrdLine', verbose_name='生产线')),
                ('prd_plant', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='binding_batch_plant', to='company.PrdPlant', verbose_name='工厂/厂区')),
                ('prd_qc', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='binding_batch_qc', to='company.PrdQc', verbose_name='质检员')),
                ('prd_team', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='binding_batch_team', to='company.PrdTeam', verbose_name='班组')),
                ('product', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='binding_batch_product', to='product.Product', verbose_name='产品名称')),
            ],
            options={
                'verbose_name': '在线绑定BATCH',
                'verbose_name_plural': '在线绑定BATCH',
            },
        ),
        migrations.CreateModel(
            name='BindingDetails',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('code_x', models.CharField(blank=True, db_index=True, max_length=20, null=True, verbose_name='箱标')),
                ('code_h', models.CharField(blank=True, db_index=True, max_length=20, null=True, verbose_name='盒标')),
                ('code_p', models.CharField(blank=True, db_index=True, max_length=20, null=True, verbose_name='瓶标')),
                ('tm', models.DateTimeField(default=django.utils.timezone.now, verbose_name='时间')),
                ('batch', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='inventory.BindingBatch', verbose_name='在线绑定Batch')),
            ],
            options={
                'verbose_name': '在线绑定明细',
                'verbose_name_plural': '在线绑定明细',
            },
        ),
        migrations.CreateModel(
            name='GCN',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('batch_id', models.IntegerField(blank=True, null=True, verbose_name='Batch_ID')),
                ('batch_no', models.CharField(blank=True, max_length=20, null=True, verbose_name='生产批次')),
                ('code', models.CharField(blank=True, db_index=True, max_length=20, null=True, verbose_name='退库单号')),
                ('tm', models.DateTimeField(default=django.utils.timezone.now, verbose_name='时间')),
                ('dt', models.DateField(db_index=True, default=django.utils.timezone.now, verbose_name='日期')),
                ('remark', models.CharField(blank=True, max_length=50, null=True, verbose_name='备注说明')),
                ('company', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='gcn_company', to='company.Company', verbose_name='公司名称')),
                ('prd_line', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='company.PrdLine', verbose_name='生产线')),
                ('prd_workshop', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='company.PrdWorkshop', verbose_name='生产车间')),
                ('product', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='product.Product', verbose_name='产品名称')),
            ],
            options={
                'verbose_name': '标签退库单',
                'verbose_name_plural': '标签退库单',
            },
        ),
        migrations.CreateModel(
            name='GDN',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('batch_id', models.IntegerField(blank=True, null=True, verbose_name='Batch_ID')),
                ('code', models.CharField(blank=True, max_length=20, null=True, verbose_name='出库单号')),
                ('tm', models.DateTimeField(default=django.utils.timezone.now, verbose_name='时间')),
                ('dt', models.DateField(db_index=True, default=django.utils.timezone.now, verbose_name='日期')),
                ('remark', models.CharField(blank=True, max_length=50, null=True, verbose_name='备注说明')),
                ('company', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='gdn_company', to='company.Company', verbose_name='发货公司')),
                ('company_to', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='company_to', to='company.Company', verbose_name='收货公司')),
                ('product', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='gdn_product', to='product.Product', verbose_name='产品名称 ')),
            ],
            options={
                'verbose_name': '销售出库单',
                'verbose_name_plural': '销售出库单',
            },
        ),
        migrations.CreateModel(
            name='GRN',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('batch_id', models.IntegerField(blank=True, null=True, verbose_name='Batch_ID')),
                ('batch_no', models.CharField(blank=True, max_length=20, null=True, verbose_name='生产批次')),
                ('code', models.CharField(blank=True, db_index=True, max_length=20, null=True, verbose_name='入库单号')),
                ('dt', models.DateField(db_index=True, default=django.utils.timezone.now, verbose_name='日期')),
                ('tm', models.DateTimeField(default=django.utils.timezone.now, verbose_name='时间')),
                ('remark', models.CharField(blank=True, max_length=50, null=True, verbose_name='备注说明')),
                ('company', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='grn_company', to='company.Company', verbose_name='公司名称')),
                ('prd_line', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='grn_line', to='company.PrdLine', verbose_name='生产线')),
                ('prd_plant', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='grn_plant', to='company.PrdPlant', verbose_name='工厂/厂区')),
                ('prd_qc', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='grn_qc', to='company.PrdQc', verbose_name='质检员')),
                ('prd_workshop', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='grn_workshop', to='company.PrdWorkshop', verbose_name='生产车间')),
                ('product', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='product.Product', verbose_name='产品名称')),
            ],
            options={
                'verbose_name': '成品入库单',
                'verbose_name_plural': '成品入库单',
            },
        ),
        migrations.CreateModel(
            name='GTN',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('batch_id', models.IntegerField(blank=True, null=True, verbose_name='Batch_ID')),
                ('code', models.CharField(blank=True, db_index=True, max_length=20, null=True, verbose_name='转库单号')),
                ('tm', models.DateTimeField(default=django.utils.timezone.now, verbose_name='时间')),
                ('dt', models.DateField(db_index=True, default=django.utils.timezone.now, verbose_name='日期')),
                ('remark', models.CharField(blank=True, max_length=50, null=True, verbose_name='备注说明')),
                ('company', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='gtn_company', to='company.Company', verbose_name='公司名称')),
                ('product', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='product.Product', verbose_name='产品名称')),
            ],
            options={
                'verbose_name': '成品转库单',
                'verbose_name_plural': '成品转库单',
            },
        ),
        migrations.CreateModel(
            name='GWN',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('batch_id', models.IntegerField(blank=True, null=True, verbose_name='Batch_ID')),
                ('code', models.CharField(blank=True, db_index=True, max_length=20, null=True, verbose_name='退库单号')),
                ('tm', models.DateTimeField(default=django.utils.timezone.now, verbose_name='时间')),
                ('dt', models.DateField(db_index=True, default=django.utils.timezone.now, verbose_name='日期')),
                ('remark', models.CharField(blank=True, max_length=50, null=True, verbose_name='备注说明')),
                ('company', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='gwn_company', to='company.Company', verbose_name='所属公司')),
                ('company_fr', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='gwn_company_fr', to='company.Company', verbose_name='退货公司')),
                ('product', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='gwn_product', to='product.Product', verbose_name='退货产品')),
            ],
            options={
                'verbose_name': '销售退库单',
                'verbose_name_plural': '销售退库单',
            },
        ),
        migrations.CreateModel(
            name='InvType',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('code', models.CharField(max_length=10, verbose_name='类别代码')),
                ('name', models.CharField(max_length=20, verbose_name='类别名称')),
                ('remark', models.CharField(blank=True, max_length=100, null=True, verbose_name='备注说明')),
            ],
            options={
                'verbose_name': '存货类别',
                'verbose_name_plural': '存货类别',
            },
        ),
        migrations.CreateModel(
            name='ReceiptBatch',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('companyid', models.IntegerField(blank=True, null=True, verbose_name='Legacy CompanyID')),
                ('productid', models.IntegerField(blank=True, null=True, verbose_name='Legacy ProductID')),
                ('levelid', models.SmallIntegerField(blank=True, null=True, verbose_name='Legacy LevelID')),
                ('userid', models.IntegerField(blank=True, null=True, verbose_name='Legacy UserID')),
                ('location', models.CharField(blank=True, max_length=100, null=True, verbose_name='收货地点')),
                ('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(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='receipt_batch_company', to='company.Company', verbose_name='收货公司')),
                ('level', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='company.Level', verbose_name='层级')),
                ('product', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='receipt_batch_product', to='product.Product', verbose_name='产品名称')),
                ('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='receipt_batch_user', to=settings.AUTH_USER_MODEL, verbose_name='操作员')),
            ],
            options={
                'verbose_name': '收货确认BATCH',
                'verbose_name_plural': '收货确认BATCH',
            },
        ),
        migrations.CreateModel(
            name='ReceiptDetails',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('label_code', models.CharField(db_index=True, max_length=20, verbose_name='标签号码')),
                ('label_id', models.BigIntegerField(blank=True, null=True, verbose_name='标签ID')),
                ('tm', models.DateTimeField(auto_now_add=True, verbose_name='收货时间')),
                ('batch', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='receipt_batch', to='inventory.ReceiptBatch', verbose_name='收货确认BATCH')),
            ],
            options={
                'verbose_name': '收货确认明细',
                'verbose_name_plural': '收货确认明细',
            },
        ),
        migrations.CreateModel(
            name='Stack',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('code', models.CharField(blank=True, max_length=20, null=True, verbose_name='垛编号')),
                ('position', models.CharField(blank=True, max_length=100, null=True, verbose_name='具体位置')),
                ('qty_lmt', models.SmallIntegerField(default=50, verbose_name='最大数量')),
                ('is_fixed', models.BooleanField(default=False, verbose_name='是否为固定垛位')),
                ('company', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='company.Company', verbose_name='公司名称')),
            ],
            options={
                'verbose_name': '垛',
                'verbose_name_plural': '垛',
            },
        ),
        migrations.CreateModel(
            name='StackLabels',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('label_code', models.CharField(db_index=True, max_length=20, verbose_name='标签号码')),
                ('tm', models.DateTimeField(auto_now_add=True, verbose_name='时间')),
            ],
            options={
                'verbose_name': '垛位标签明细',
                'verbose_name_plural': '垛位标签明细',
            },
        ),
        migrations.CreateModel(
            name='StackLog',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('voucher_type', models.CharField(db_index=True, max_length=20, verbose_name='凭证类别')),
                ('voucher_id', models.IntegerField(blank=True, null=True, verbose_name='凭证ID')),
                ('tm', models.DateTimeField(auto_now_add=True, verbose_name='时间')),
                ('dt', models.DateField(auto_now_add=True, db_index=True, verbose_name='日期')),
                ('remark', models.CharField(blank=True, max_length=100, null=True, verbose_name='备注说明')),
                ('company', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='stack_log_company', to='company.Company', 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.CreateModel(
            name='StackLogDetails',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('label_code', models.CharField(db_index=True, max_length=20, verbose_name='标签号码')),
                ('dt', models.DateField(auto_now_add=True, db_index=True, verbose_name='日期')),
                ('tm', models.DateTimeField(auto_now_add=True, verbose_name='时间')),
                ('log', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='stack_log_details', to='inventory.StackLog', verbose_name='垛位日志')),
                ('stack', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, related_name='stack_log_details_stack', to='inventory.Stack', verbose_name='垛')),
            ],
            options={
                'verbose_name': '垛位日志明细',
                'verbose_name_plural': '垛位日志明细',
            },
        ),
        migrations.CreateModel(
            name='StkClosing',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('yr', models.SmallIntegerField(verbose_name='年')),
                ('mn', models.SmallIntegerField(verbose_name='月')),
                ('qty_x', models.IntegerField(verbose_name='箱数')),
                ('qty_h', models.IntegerField(verbose_name='盒数')),
                ('qty_p', models.IntegerField(verbose_name='瓶数')),
                ('tm', models.DateTimeField(auto_now_add=True, verbose_name='时间')),
                ('company', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='stk_company', to='company.Company', verbose_name='公司名称')),
                ('product', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='stk_product', to='product.Product', verbose_name='退货产品')),
            ],
            options={
                'verbose_name': '库存期结',
                'verbose_name_plural': '库存期结',
            },
        ),
        migrations.CreateModel(
            name='StkDetails',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('voucher_type', models.CharField(choices=[('grn', '成品入库单'), ('gdn', '销售出库单'), ('gtn', '成品转库单'), ('gwn', '销售退库单'), ('gcn', '标签退库单')], db_index=True, max_length=3, verbose_name='单据类别')),
                ('voucher_id', models.IntegerField(db_index=True, verbose_name='单据ID')),
                ('label_id', models.BigIntegerField(db_index=True, verbose_name='标签ID')),
                ('label_code', models.CharField(db_index=True, max_length=20, verbose_name='标签号码')),
                ('label_pkg', models.SmallIntegerField(db_index=True, verbose_name='标签类型')),
                ('dt', models.DateField(db_index=True, default=django.utils.timezone.now, verbose_name='日期')),
                ('is_delete', models.BooleanField(blank=True, db_index=True, default=False, null=True, verbose_name='是否已删除（入库退标）')),
                ('company', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='inv_detail_company', to='company.Company', verbose_name='公司名称')),
                ('company_to', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='inv_detail_company_to', to='company.Company', verbose_name='收货公司')),
                ('product', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='inv_detail_product', to='product.Product', verbose_name='产品名称')),
            ],
            options={
                'verbose_name': '进出存明细',
                'verbose_name_plural': '进出存明细',
            },
        ),
        migrations.CreateModel(
            name='Storehouse',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('external_id', models.IntegerField(blank=True, db_index=True, null=True, verbose_name='外部ID')),
                ('legacy_id', models.IntegerField(blank=True, null=True, verbose_name='SqlSrvID')),
                ('name', models.CharField(db_index=True, max_length=100, verbose_name='仓库名称')),
                ('contact', models.CharField(blank=True, max_length=50, null=True, verbose_name='联系人')),
                ('telephone', models.CharField(blank=True, max_length=20, null=True, verbose_name='电话')),
                ('adm_id', models.IntegerField(blank=True, null=True, verbose_name='GIS')),
                ('province', models.CharField(blank=True, max_length=20, null=True, verbose_name='省份')),
                ('city', models.CharField(blank=True, max_length=20, null=True, verbose_name='城市')),
                ('address', models.CharField(blank=True, max_length=100, null=True, verbose_name='地址')),
                ('external_code', models.CharField(blank=True, max_length=30, null=True, verbose_name='外部编码')),
                ('is_active', models.BooleanField(default=True, verbose_name='是否已激活')),
                ('is_delete', models.BooleanField(default=False, 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.CASCADE, to='company.Company', verbose_name='公司名称')),
                ('inv_type', models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, to='inventory.InvType', verbose_name='存货类别')),
                ('workshop', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='company.PrdWorkshop', verbose_name='所属车间')),
            ],
            options={
                'verbose_name': '仓库信息',
                'verbose_name_plural': '仓库信息',
            },
        ),
        migrations.CreateModel(
            name='Voucher',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('code', models.CharField(max_length=20, unique=True, verbose_name='单据代码')),
                ('name', models.CharField(max_length=30, unique=True, verbose_name='单据名称')),
                ('direction', models.SmallIntegerField(choices=[(1, '增加'), (-1, '减少'), (0, '转库')], verbose_name='库存影响')),
                ('remark', models.CharField(blank=True, max_length=100, null=True, verbose_name='备注说明')),
                ('inv_type', models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, to='inventory.InvType', verbose_name='存货类别')),
            ],
            options={
                'verbose_name': '单据类别',
                'verbose_name_plural': '单据类别',
            },
        ),
        migrations.AddField(
            model_name='stkdetails',
            name='store',
            field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='inv_detail_store', to='inventory.Storehouse', verbose_name='仓库'),
        ),
        migrations.AddField(
            model_name='stkdetails',
            name='store_fr',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='inv_detail_store_fr', to='inventory.Storehouse', verbose_name='转出仓库（转货）'),
        ),
        migrations.AddField(
            model_name='stkclosing',
            name='store',
            field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='stk_store', to='inventory.Storehouse', verbose_name='仓库'),
        ),
        migrations.AddField(
            model_name='stacklabels',
            name='log',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='stack_log_labels', to='inventory.StackLog', verbose_name='垛位日志'),
        ),
        migrations.AddField(
            model_name='stacklabels',
            name='stack',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='stack_labels_stack', to='inventory.Stack', verbose_name='垛'),
        ),
        migrations.AddField(
            model_name='stack',
            name='store',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='Stack_store', to='inventory.Storehouse', verbose_name='仓库'),
        ),
        migrations.AddField(
            model_name='gwn',
            name='store',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='gwn_store', to='inventory.Storehouse', verbose_name='仓库'),
        ),
        migrations.AddField(
            model_name='gwn',
            name='user',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='gwn_user', to=settings.AUTH_USER_MODEL, verbose_name='操作员'),
        ),
        migrations.AddField(
            model_name='gtn',
            name='store_fr',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='gtn_fr_store', to='inventory.Storehouse', verbose_name='转出仓库'),
        ),
        migrations.AddField(
            model_name='gtn',
            name='store_to',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='gtn_to_store', to='inventory.Storehouse', verbose_name='转入仓库'),
        ),
        migrations.AddField(
            model_name='gtn',
            name='user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='gtn_user', to=settings.AUTH_USER_MODEL, verbose_name='操作员'),
        ),
        migrations.AddField(
            model_name='grn',
            name='store',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='grn_store', to='inventory.Storehouse', verbose_name='仓库'),
        ),
        migrations.AddField(
            model_name='grn',
            name='user',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='grn_user', to=settings.AUTH_USER_MODEL, verbose_name='操作员'),
        ),
        migrations.AddField(
            model_name='gdn',
            name='store',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='gdn_fr_store', to='inventory.Storehouse', verbose_name='发货仓库'),
        ),
        migrations.AddField(
            model_name='gdn',
            name='store_to',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='gdn_to_store', to='inventory.Storehouse', verbose_name='收货仓库'),
        ),
        migrations.AddField(
            model_name='gdn',
            name='user',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='gdn_user', to=settings.AUTH_USER_MODEL, verbose_name='操作员'),
        ),
        migrations.AddField(
            model_name='gcn',
            name='store',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='gcn_store', to='inventory.Storehouse', verbose_name='仓库'),
        ),
        migrations.AddField(
            model_name='gcn',
            name='user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='gcn_user', to=settings.AUTH_USER_MODEL, verbose_name='操作员'),
        ),
        migrations.AddField(
            model_name='batch',
            name='store_fr',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='batch_fr_store', to='inventory.Storehouse', verbose_name='发货仓库'),
        ),
        migrations.AddField(
            model_name='batch',
            name='store_to',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='batch_to_store', to='inventory.Storehouse', verbose_name='收货仓库'),
        ),
        migrations.AddField(
            model_name='batch',
            name='user',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='操作员'),
        ),
        migrations.AddField(
            model_name='batch',
            name='voucher',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='inventory.Voucher', verbose_name='单据类别'),
        ),
        migrations.AlterUniqueTogether(
            name='storehouse',
            unique_together={('company', 'name')},
        ),
        migrations.AlterIndexTogether(
            name='stkclosing',
            index_together={('company', 'product', 'store', 'yr', 'mn')},
        ),
    ]
