# Generated by Django 3.1.4 on 2020-12-31 18:42

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


class Migration(migrations.Migration):

    dependencies = [
        ('company', '0107_auto_20201230_0952'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('sales', '0118_bugsell_tm_delivery'),
    ]

    operations = [
        migrations.AlterField(
            model_name='rebatepayable',
            name='image_invoice',
            field=models.JSONField(blank=True, null=True),
        ),
        migrations.AlterField(
            model_name='rebatepayable',
            name='log_edit',
            field=models.JSONField(blank=True, null=True),
        ),
        migrations.AlterField(
            model_name='rebatepayee',
            name='log_edit',
            field=models.JSONField(blank=True, default=list, null=True),
        ),
        migrations.CreateModel(
            name='RebateApplication',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('company_id', models.IntegerField(db_index=True, verbose_name='公司ID')),
                ('agent_name', models.CharField(max_length=100, verbose_name='经销商名称')),
                ('parent_name', models.CharField(blank=True, max_length=100, null=True, verbose_name='父级名称')),
                ('level_id', models.SmallIntegerField(blank=True, null=True, verbose_name='经销商层级')),
                ('payee_name', models.CharField(blank=True, max_length=15, null=True, verbose_name='实名收款人')),
                ('amount', models.DecimalField(decimal_places=2, max_digits=12, verbose_name='申请提现金额')),
                ('img_invoices', models.JSONField(blank=True, null=True, verbose_name='上传发票')),
                ('bank_receipt', models.CharField(blank=True, max_length=50, 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='时间')),
                ('tm_chceked', models.DateTimeField(blank=True, null=True, verbose_name='审核时间')),
                ('remark', models.CharField(blank=True, max_length=100, null=True, verbose_name='备注说明')),
                ('agent', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='rebateapplication_agent', to='company.company', verbose_name='经销商ID')),
                ('payee', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='rebateapplication_user', to=settings.AUTH_USER_MODEL, verbose_name='收款人')),
                ('rebateclosing', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='rebateapplication_closing', to='sales.rebateclosing', verbose_name='会计期')),
            ],
            options={
                'verbose_name': '会计期返利提现申请',
                'verbose_name_plural': '会计期返利提现申请',
            },
        ),
    ]
