# Generated by Django 2.1.7 on 2019-03-13 16:15

import datetime
from django.db import migrations, models
import public.fields
import public.models


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Expenses',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('object_id', models.PositiveIntegerField()),
                ('expense_by_uom', models.CharField(choices=[('part', '夹数'), ('quantity', '数量(t/m3/m2)'), ('one', '次/个/车'), ('another', '手动输入数量')], max_length=20, verbose_name='计费单位')),
                ('quantity', models.DecimalField(blank=True, decimal_places=2, max_digits=10, null=True, verbose_name='数量')),
            ],
            options={
                'verbose_name': '费用明细',
            },
        ),
        migrations.CreateModel(
            name='ExpensesItem',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=20, verbose_name='费用名称')),
                ('price', models.DecimalField(decimal_places=2, max_digits=8, verbose_name='单价')),
                ('uom_name', models.CharField(max_length=10, verbose_name='单位')),
            ],
            options={
                'verbose_name': '费用名称',
            },
        ),
        migrations.CreateModel(
            name='InOutOrder',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('state', models.CharField(choices=[('draft', '草稿'), ('confirm', '确认'), ('done', '完成'), ('cancel', '取消')], default='draft', max_length=20, verbose_name='状态')),
                ('date', models.DateField(verbose_name='日期')),
                ('created', models.DateField(auto_now_add=True, verbose_name='创建日期')),
                ('updated', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
                ('type', models.CharField(choices=[('in', '入库'), ('out', '出库')], max_length=10, verbose_name='出入库类型')),
                ('order', public.fields.OrderField(blank=True, default='New', max_length=20, verbose_name='单号')),
                ('counter', models.IntegerField(blank=True, null=True, verbose_name='货柜数')),
                ('cart_number', models.CharField(blank=True, max_length=20, null=True, verbose_name='车牌/柜号')),
                ('pickup_staff', models.CharField(blank=True, max_length=12, null=True, verbose_name='提货人')),
            ],
            options={
                'verbose_name': '出入库操作',
                'ordering': ('-date', '-created'),
            },
            bases=(public.models.HasChangedMixin, models.Model),
        ),
        migrations.CreateModel(
            name='InOutOrderItem',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('line', public.fields.LineField(blank=True, verbose_name='行')),
                ('piece', models.IntegerField(default=1, verbose_name='件')),
                ('quantity', models.DecimalField(decimal_places=2, max_digits=10, verbose_name='数量')),
                ('uom', models.CharField(choices=[('t', '吨'), ('m3', '立方'), ('m2', '平方')], default='t', max_length=10, verbose_name='计量单位')),
            ],
            options={
                'verbose_name': '出入库操作明细行',
            },
            bases=(public.models.OrderItemSaveCreateCommentMixin, models.Model),
        ),
        migrations.CreateModel(
            name='InventoryOrder',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100, verbose_name='盘点简述')),
                ('state', models.CharField(choices=[('draft', '草稿'), ('confirm', '确认'), ('done', '完成'), ('cancel', '取消')], default='draft', max_length=20, verbose_name='状态')),
                ('order', public.fields.OrderField(blank=True, default='New', max_length=20, verbose_name='单号')),
                ('product_type', models.CharField(blank=True, choices=[('block', '荒料'), ('semi_slab', '毛板'), ('slab', '板材')], max_length=10, null=True, verbose_name='产品类型')),
                ('date', models.DateField(default=datetime.datetime.now, verbose_name='日期')),
                ('created', models.DateField(auto_now_add=True, verbose_name='创建日期')),
                ('updated', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
            ],
            options={
                'verbose_name': '盘点库存',
                'ordering': ('-created',),
            },
            bases=(public.models.HasChangedMixin, models.Model),
        ),
        migrations.CreateModel(
            name='InventoryOrderItem',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('line', public.fields.LineField(blank=True, verbose_name='行')),
                ('is_check', models.BooleanField(default=False, verbose_name='已盘')),
                ('old_piece', models.IntegerField(default=1, verbose_name='原件数')),
                ('old_quantity', models.DecimalField(decimal_places=2, max_digits=10, verbose_name='原数量')),
                ('now_piece', models.IntegerField(blank=True, null=True, verbose_name='现件数')),
                ('now_quantity', models.DecimalField(blank=True, decimal_places=2, max_digits=10, null=True, verbose_name='现数量')),
                ('piece', models.IntegerField(blank=True, null=True, verbose_name='件数')),
                ('quantity', models.DecimalField(blank=True, decimal_places=2, max_digits=10, null=True, verbose_name='数量')),
                ('uom', models.CharField(choices=[('t', '吨'), ('m3', '立方'), ('m2', '平方')], default='t', max_length=10, verbose_name='计量单位')),
                ('ps', models.CharField(blank=True, max_length=120, null=True, verbose_name='备注')),
            ],
            options={
                'verbose_name': '盘点库存明细行',
                'ordering': ('line',),
            },
        ),
        migrations.CreateModel(
            name='InventoryOrderNewItem',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('line', public.fields.LineField(blank=True, verbose_name='行')),
                ('product_type', models.CharField(choices=[('block', '荒料'), ('semi_slab', '毛板'), ('slab', '板材')], max_length=10, verbose_name='产品类型')),
                ('thickness', models.DecimalField(blank=True, decimal_places=2, max_digits=5, null=True, verbose_name='厚度规格')),
                ('piece', models.IntegerField(blank=True, null=True, verbose_name='实际件数')),
                ('quantity', models.DecimalField(blank=True, decimal_places=2, max_digits=10, null=True, verbose_name='实际数量')),
                ('uom', models.CharField(choices=[('t', '吨'), ('m3', '立方'), ('m2', '平方')], default='t', max_length=10, verbose_name='计量单位')),
                ('ps', models.CharField(blank=True, max_length=120, null=True, verbose_name='备注')),
            ],
            options={
                'verbose_name': '盘点新增产品',
                'ordering': ('line',),
            },
        ),
        migrations.CreateModel(
            name='MoveLocationOrder',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('state', models.CharField(choices=[('draft', '草稿'), ('confirm', '确认'), ('done', '完成'), ('cancel', '取消')], default='draft', max_length=20, verbose_name='状态')),
                ('date', models.DateField(verbose_name='日期')),
                ('created', models.DateField(auto_now_add=True, verbose_name='创建日期')),
                ('updated', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
                ('order', public.fields.OrderField(blank=True, default='New', max_length=20, verbose_name='单号')),
            ],
            options={
                'verbose_name': '移库单',
                'ordering': ('-date', '-created'),
            },
            bases=(public.models.HasChangedMixin, models.Model),
        ),
        migrations.CreateModel(
            name='MoveLocationOrderItem',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('line', public.fields.LineField(blank=True, verbose_name='行')),
                ('piece', models.IntegerField(default=1, verbose_name='件')),
                ('quantity', models.DecimalField(decimal_places=2, max_digits=10, verbose_name='数量')),
                ('uom', models.CharField(choices=[('t', '吨'), ('m3', '立方'), ('m2', '平方')], default='t', max_length=10, verbose_name='计量单位')),
            ],
            options={
                'verbose_name': '移库单明细行',
            },
            bases=(public.models.OrderItemSaveCreateCommentMixin, models.Model),
        ),
        migrations.CreateModel(
            name='ProductionOrder',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('state', models.CharField(choices=[('draft', '草稿'), ('confirm', '确认'), ('done', '完成'), ('cancel', '取消')], default='draft', max_length=20, verbose_name='状态')),
                ('date', models.DateField(verbose_name='日期')),
                ('created', models.DateField(auto_now_add=True, verbose_name='创建日期')),
                ('updated', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
                ('order', public.fields.OrderField(blank=True, default='New', max_length=20, verbose_name='单号')),
            ],
            options={
                'verbose_name': '生产订单',
                'ordering': ('-date', '-created'),
            },
            bases=(public.models.HasChangedMixin, models.Model),
        ),
        migrations.CreateModel(
            name='ProductionOrderProduceItem',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('line', public.fields.LineField(blank=True, verbose_name='行')),
                ('piece', models.IntegerField(default=1, verbose_name='件')),
                ('uom', models.CharField(choices=[('t', '吨'), ('m3', '立方'), ('m2', '平方')], default='t', max_length=10, verbose_name='计量单位')),
                ('thickness', models.DecimalField(blank=True, decimal_places=2, max_digits=5, null=True, verbose_name='厚度规格')),
                ('quantity', models.DecimalField(blank=True, decimal_places=2, max_digits=10, null=True, verbose_name='数量')),
                ('price', models.DecimalField(blank=True, decimal_places=2, max_digits=8, null=True, verbose_name='单价')),
                ('pic', models.IntegerField(blank=True, null=True, verbose_name='件')),
                ('pi', models.IntegerField(blank=True, null=True, verbose_name='皮')),
            ],
            options={
                'verbose_name': '生产单成品行',
            },
            bases=(public.models.OrderItemSaveCreateCommentMixin, models.Model),
        ),
        migrations.CreateModel(
            name='ProductionOrderRawItem',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('line', public.fields.LineField(blank=True, verbose_name='行')),
                ('piece', models.IntegerField(blank=True, default=1, null=True, verbose_name='件')),
                ('quantity', models.DecimalField(blank=True, decimal_places=2, max_digits=5, null=True, verbose_name='数量')),
                ('uom', models.CharField(choices=[('t', '吨'), ('m3', '立方'), ('m2', '平方')], default='t', max_length=10, verbose_name='计量单位')),
                ('price', models.DecimalField(blank=True, decimal_places=2, max_digits=8, null=True, verbose_name='单价')),
            ],
            options={
                'verbose_name': '生产单原料行',
            },
            bases=(public.models.OrderItemSaveCreateCommentMixin, models.Model),
        ),
        migrations.CreateModel(
            name='ProductionType',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=30, verbose_name='业务类型')),
                ('expense_by', models.CharField(choices=[('raw', '原材料项'), ('produce', '产品项'), ('all', '原料及产品')], max_length=10, verbose_name='费用结算按')),
                ('raw_item_type', models.CharField(choices=[('block', '荒料'), ('semi_slab', '毛板'), ('slab', '板材')], default='block', max_length=10, verbose_name='原材料类型')),
                ('produce_item_type', models.CharField(choices=[('block', '荒料'), ('semi_slab', '毛板'), ('slab', '板材')], default='block', max_length=10, verbose_name='产出品类型')),
                ('activate', models.BooleanField(default=True, verbose_name='启用')),
            ],
            options={
                'verbose_name': '生产业务类型明细',
            },
        ),
        migrations.CreateModel(
            name='TurnBackOrder',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('object_id', models.PositiveIntegerField()),
                ('state', models.CharField(choices=[('draft', '草稿'), ('confirm', '确认'), ('done', '完成'), ('cancel', '取消')], default='draft', max_length=20, verbose_name='状态')),
                ('reason', models.CharField(max_length=80, verbose_name='原因')),
                ('order', public.fields.OrderField(blank=True, default='New', max_length=20, verbose_name='单号')),
                ('date', models.DateField(default=datetime.datetime.now, verbose_name='日期')),
                ('created', models.DateField(auto_now_add=True, verbose_name='创建日期')),
                ('updated', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
            ],
            options={
                'verbose_name': '库存回退',
                'ordering': ('-date', '-created'),
            },
            bases=(public.models.HasChangedMixin, models.Model),
        ),
        migrations.CreateModel(
            name='TurnBackOrderItem',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('line', public.fields.LineField(blank=True, verbose_name='行')),
                ('piece', models.IntegerField(default=1, verbose_name='件')),
                ('quantity', models.DecimalField(decimal_places=2, max_digits=10, verbose_name='数量')),
                ('uom', models.CharField(choices=[('t', '吨'), ('m3', '立方'), ('m2', '平方')], default='t', max_length=10, verbose_name='计量单位')),
            ],
            options={
                'verbose_name': '库存回退明细行',
            },
            bases=(public.models.OrderItemSaveCreateCommentMixin, models.Model),
        ),
    ]
