# Generated by Django 2.2.4 on 2021-02-04 23:59

import datetime
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import main.models


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0011_update_proxy_permissions'),
    ]

    operations = [
        migrations.CreateModel(
            name='Compra',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('fecha', models.DateField()),
                ('total', models.IntegerField()),
            ],
        ),
        migrations.CreateModel(
            name='Log',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('usuario', models.IntegerField()),
                ('negocio', models.IntegerField()),
                ('tiempo', models.DateField(default=datetime.datetime.now)),
                ('accion', models.TextField()),
            ],
        ),
        migrations.CreateModel(
            name='Pabellon',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nombre', models.CharField(max_length=45)),
                ('descripcion', models.TextField(null=True)),
            ],
        ),
        migrations.CreateModel(
            name='Proveedor',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('razon_social', models.CharField(max_length=45)),
                ('nombre', models.CharField(max_length=45)),
                ('telefono', models.CharField(max_length=45, null=True)),
                ('direccion', models.CharField(max_length=45, null=True)),
                ('celular', models.CharField(max_length=45, null=True)),
                ('email', models.CharField(max_length=45, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='unidad_medida',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nombre_unidad', models.CharField(max_length=45)),
                ('abreviatura_unidad', models.CharField(max_length=45)),
            ],
        ),
        migrations.CreateModel(
            name='Usuario',
            fields=[
                ('id', models.OneToOneField(on_delete=django.db.models.deletion.DO_NOTHING, primary_key=True, serialize=False, to=settings.AUTH_USER_MODEL)),
                ('documento', models.CharField(max_length=45)),
                ('telefono', models.CharField(max_length=45, null=True)),
                ('direccion', models.CharField(max_length=45, null=True)),
                ('foto', models.ImageField(null=True, upload_to=main.models.get_upload_path)),
            ],
        ),
        migrations.CreateModel(
            name='Venta',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('fecha', models.DateField()),
                ('total', models.IntegerField()),
                ('observacion', models.CharField(max_length=45, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='Producto',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nombre', models.CharField(max_length=45)),
                ('stock', models.IntegerField()),
                ('valor_costo', models.IntegerField()),
                ('valor_venta', models.IntegerField()),
                ('imagen', models.ImageField(null=True, upload_to=main.models.get_upload_path)),
                ('descripcion', models.TextField(null=True)),
                ('estado', models.CharField(choices=[('1', 'Activo'), ('2', 'Finalizado')], max_length=1)),
                ('unidad_medida_id', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='main.unidad_medida')),
            ],
        ),
        migrations.CreateModel(
            name='Negocio',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nombre', models.CharField(max_length=45)),
                ('nit', models.CharField(max_length=45, null=True, unique=True)),
                ('telefono', models.CharField(max_length=45, null=True)),
                ('email', models.CharField(max_length=45, null=True)),
                ('pabellon_id', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='main.Pabellon')),
            ],
        ),
        migrations.CreateModel(
            name='detalle_venta',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('cantidad', models.IntegerField()),
                ('cantidad_stock_momento', models.IntegerField()),
                ('cantidad_stock_anterior', models.IntegerField()),
                ('total_producto', models.IntegerField()),
                ('producto_id', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='main.Producto')),
                ('venta_id', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='main.Venta')),
            ],
        ),
        migrations.CreateModel(
            name='detalle_usuario_negocio',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('negocio_id', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='main.Negocio')),
                ('usuario_id', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='main.Usuario')),
            ],
        ),
        migrations.CreateModel(
            name='detalle_negocio_producto',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('negocio_id', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='main.Negocio')),
                ('producto_id', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, to='main.Producto')),
                ('proveedor_id', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='main.Proveedor')),
            ],
        ),
        migrations.CreateModel(
            name='detalle_compra',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('cantidad', models.IntegerField()),
                ('cantidad_stock_momento', models.IntegerField()),
                ('cantidad_stock_anterior', models.IntegerField()),
                ('valor_unitario', models.IntegerField()),
                ('total_producto', models.IntegerField()),
                ('compra_id', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='main.Compra')),
                ('producto_id', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='main.Producto')),
                ('proveedor_id', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='main.Proveedor')),
            ],
        ),
    ]
