# Generated by Django 2.0.6 on 2018-06-07 12:09

from django.db import migrations, models
import django.db.models.deletion
import oscar.models.fields
import phonenumber_field.modelfields


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('address', '0001_initial'),
        ('order', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Invoice',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('number', models.CharField(max_length=128, verbose_name='Invoice number')),
                ('notes', models.TextField(null=True, verbose_name='Notes for invoice')),
                ('document', models.FileField(blank=True, max_length=255, null=True, upload_to='invoices/%Y/%m/', verbose_name='Document')),
            ],
            options={
                'verbose_name': 'Invoice',
                'verbose_name_plural': 'Invoices',
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='LegalEntity',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('shop_name', models.CharField(blank=True, max_length=255, null=True, verbose_name='Shop name')),
                ('business_name', models.CharField(db_index=True, max_length=255, verbose_name='Business name')),
                ('vat_number', models.CharField(max_length=20, verbose_name='VAT identification number')),
                ('logo', models.ImageField(blank=True, max_length=255, null=True, upload_to='images/products/%Y/%m/', verbose_name='Logo')),
                ('email', models.EmailField(blank=True, max_length=254, null=True, verbose_name='Email')),
                ('web_site', models.URLField(blank=True, null=True, verbose_name='Website')),
            ],
            options={
                'verbose_name': 'Legal Entity',
                'verbose_name_plural': 'Legal Entities',
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='LegalEntityAddress',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(blank=True, choices=[('Mr', 'Mr'), ('Miss', 'Miss'), ('Mrs', 'Mrs'), ('Ms', 'Ms'), ('Dr', 'Dr')], max_length=64, verbose_name='Title')),
                ('first_name', models.CharField(blank=True, max_length=255, verbose_name='First name')),
                ('last_name', models.CharField(blank=True, max_length=255, verbose_name='Last name')),
                ('line1', models.CharField(max_length=255, verbose_name='First line of address')),
                ('line2', models.CharField(blank=True, max_length=255, verbose_name='Second line of address')),
                ('line3', models.CharField(blank=True, max_length=255, verbose_name='Third line of address')),
                ('line4', models.CharField(blank=True, max_length=255, verbose_name='City')),
                ('state', models.CharField(blank=True, max_length=255, verbose_name='State/County')),
                ('postcode', oscar.models.fields.UppercaseCharField(blank=True, max_length=64, verbose_name='Post/Zip-code')),
                ('search_text', models.TextField(editable=False, verbose_name='Search text - used only for searching addresses')),
                ('phone_number', phonenumber_field.modelfields.PhoneNumberField(blank=True, max_length=128, verbose_name='Phone number')),
                ('fax_number', phonenumber_field.modelfields.PhoneNumberField(blank=True, max_length=128, verbose_name='Fax number')),
                ('country', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='address.Country', verbose_name='Country')),
                ('legal_entity', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='addresses', to='oscar_invoices.LegalEntity', verbose_name='Legal Entity')),
            ],
            options={
                'verbose_name': 'Legal Entity Address',
                'verbose_name_plural': 'Legal Entity Addresses',
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='invoice',
            name='legal_entity',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='invoices', to='oscar_invoices.LegalEntity', verbose_name='Legal Entity'),
        ),
        migrations.AddField(
            model_name='invoice',
            name='order',
            field=models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='invoice', to='order.Order', verbose_name='Order'),
        ),
    ]
