# -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2017-05-08 22:10
from __future__ import unicode_literals

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 = [
        ('cashdesk', '0001_initial'),
        ('nomenclature', '0001_initial'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Delivery',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False, verbose_name='Номер')),
                ('order_date', models.DateField(default=django.utils.timezone.now, verbose_name='Дата на заявка')),
                ('status', models.CharField(choices=[('ORDERED', 'ПОРЪЧАНO'), ('DELIVERED', 'ДОСТАВЕНО'), ('CANCELED', 'ОТКАЗАНО')], default='ORDERED', max_length=80, verbose_name='Статус')),
                ('delivery_date', models.DateField(blank=True, null=True, verbose_name='Дата на доставка')),
                ('invoice_no', models.CharField(blank=True, max_length=400, null=True, verbose_name='Номер на фактура')),
                ('firm_invoice_no', models.CharField(blank=True, max_length=400, null=True, verbose_name='Факт. На фирма:')),
                ('paid', models.CharField(choices=[('НЕ', 'НЕ'), ('ДА', 'ДА')], default='НЕ', max_length=80, verbose_name='Платено')),
                ('notes', models.TextField(blank=True, max_length=2000, null=True, verbose_name='Забележка')),
                ('last_update_date', models.DateTimeField(blank=True, null=True, verbose_name='Дата на опресняване')),
                ('cashdesk_fk', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='cashdesk.Cashdesk', verbose_name='Дата на плащане')),
                ('club_fk', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='nomenclature.Club', verbose_name='Клуб')),
                ('supplier_fk', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='nomenclature.Supplier', verbose_name='Доставчик')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='Служител')),
            ],
            options={
                'managed': True,
                'verbose_name': 'Доставка',
                'verbose_name_plural': 'Доставки',
                'db_table': 'delivery',
            },
        ),
        migrations.CreateModel(
            name='DeliveryDetail',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False, verbose_name='Номер')),
                ('cnt', models.DecimalField(decimal_places=3, max_digits=8, verbose_name='Количество')),
                ('price', models.DecimalField(decimal_places=2, max_digits=8, verbose_name='Единична цена')),
            ],
            options={
                'managed': True,
                'verbose_name': 'Доставка описание',
                'verbose_name_plural': 'Доставки описание',
                'db_table': 'delivery_detail',
            },
        ),
        migrations.CreateModel(
            name='ArticleDelivery',
            fields=[
            ],
            options={
                'verbose_name': 'Артикул доставки',
                'verbose_name_plural': 'Артикули доставки',
                'proxy': True,
            },
            bases=('nomenclature.article',),
        ),
        migrations.AddField(
            model_name='deliverydetail',
            name='article_fk',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='delivery.ArticleDelivery', verbose_name='Артикул'),
        ),
        migrations.AddField(
            model_name='deliverydetail',
            name='delivery_fk',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='delivery.Delivery', verbose_name='Доставка N'),
        ),
    ]
