# Generated by Django 5.2.7 on 2026-01-31 14:27

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


class Migration(migrations.Migration):

    dependencies = [
        ('basic_info', '0024_frontend_page_and_visible_pages'),
        ('business', '0022_presalesorder_presalesorderitem'),
    ]

    operations = [
        migrations.CreateModel(
            name='PrePurchaseOrder',
            fields=[
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('updated_at', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
                ('id', models.BigAutoField(primary_key=True, serialize=False)),
                ('kind', models.IntegerField(choices=[(1, '大货'), (2, '样板')], default=1, verbose_name='预采购单类型')),
                ('remarks', models.TextField(blank=True, null=True, verbose_name='备注')),
                ('created_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='created_pre_purchase_orders', to='basic_info.employee', verbose_name='创建者')),
                ('merchant', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='pre_purchase_orders', to='basic_info.merchant', verbose_name='所属商户')),
                ('supplier', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='pre_purchase_orders', to='basic_info.supplier', verbose_name='供应商')),
                ('warehouse', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='pre_purchase_orders', to='basic_info.warehouse', verbose_name='仓库')),
            ],
            options={
                'verbose_name': '预采购单',
                'verbose_name_plural': '预采购单',
            },
        ),
        migrations.CreateModel(
            name='PrePurchaseOrderItem',
            fields=[
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('updated_at', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
                ('id', models.BigAutoField(primary_key=True, serialize=False)),
                ('product_id', models.BigIntegerField(blank=True, null=True, verbose_name='产品ID')),
                ('product_name', models.CharField(blank=True, default='', max_length=100, verbose_name='产品名称')),
                ('color', models.CharField(blank=True, max_length=50, null=True, verbose_name='颜色')),
                ('quantity', models.DecimalField(blank=True, decimal_places=2, max_digits=10, null=True, verbose_name='数量')),
                ('unit', models.CharField(blank=True, default='', max_length=50, verbose_name='单位')),
                ('spec', models.CharField(blank=True, max_length=100, null=True, verbose_name='规格')),
                ('quantity_of_rolls', models.TextField(blank=True, null=True, verbose_name='各条数数量')),
                ('num_of_rolls', models.PositiveIntegerField(default=1, verbose_name='条数')),
                ('order_quantity', models.IntegerField(blank=True, null=True, verbose_name='下单数量')),
                ('remarks', models.TextField(blank=True, null=True, verbose_name='备注')),
                ('pre_purchase_order', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='items', to='business.prepurchaseorder', verbose_name='预采购单')),
            ],
            options={
                'verbose_name': '预采购单明细',
                'verbose_name_plural': '预采购单明细',
            },
        ),
    ]
