# -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-06-24 09:01
from __future__ import unicode_literals

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import djangobmf.fields


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.BMF_CONTRIB_LOCATION),
        migrations.swappable_dependency(settings.BMF_CONTRIB_PRODUCT),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        migrations.swappable_dependency(settings.BMF_CONTRIB_EMPLOYEE),
    ]

    operations = [
        migrations.CreateModel(
            name='Stock',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('bill_no', models.CharField(max_length=20, verbose_name='Bill no')),
                ('description', models.TextField(blank=True, null=True, verbose_name='Description')),
                ('date', models.DateField(null=True, verbose_name='Date')),
                ('completed', models.BooleanField(default=False, editable=False, verbose_name='Completed')),
                ('net', models.FloatField(blank=True, editable=False, null=True)),
                ('modified', models.DateTimeField(auto_now=True, null=True, verbose_name='Modified')),
                ('created', models.DateTimeField(auto_now_add=True, null=True, verbose_name='Created')),
                ('created_by', models.ForeignKey(blank=True, editable=False, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL, verbose_name='Created by')),
                ('employee', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.BMF_CONTRIB_EMPLOYEE)),
                ('modified_by', models.ForeignKey(blank=True, editable=False, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL, verbose_name='Modified by')),
            ],
            options={
                'abstract': False,
                'verbose_name': 'Stock',
                'ordering': ['bill_no'],
                'verbose_name_plural': 'Stocks',
                'swappable': 'BMF_CONTRIB_STOCK',
            },
        ),
        migrations.CreateModel(
            name='StockProduct',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('price', djangobmf.fields.MoneyField(blank=True, default=None, verbose_name='Price')),
                ('amount', models.IntegerField(default=0, verbose_name='Amount')),
                ('description', models.TextField(blank=True, null=True, verbose_name='Description')),
                ('modified', models.DateTimeField(auto_now=True, null=True, verbose_name='Modified')),
                ('created', models.DateTimeField(auto_now_add=True, null=True, verbose_name='Created')),
                ('created_by', models.ForeignKey(blank=True, editable=False, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL, verbose_name='Created by')),
                ('location', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.BMF_CONTRIB_LOCATION)),
                ('modified_by', models.ForeignKey(blank=True, editable=False, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL, verbose_name='Modified by')),
                ('product', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='stockproduct_products', to=settings.BMF_CONTRIB_PRODUCT)),
                ('stock', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='stock_products', to=settings.BMF_CONTRIB_STOCK)),
            ],
            options={
                'abstract': False,
            },
        ),
    ]
