# Generated by Django 3.2 on 2021-07-15 18:38

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Caja',
            fields=[
                ('id_caja', models.AutoField(primary_key=True, serialize=False)),
                ('descripcion', models.CharField(max_length=15, unique=True)),
            ],
        ),
        migrations.CreateModel(
            name='Cliente',
            fields=[
                ('dni_cliente', models.CharField(max_length=11, primary_key=True, serialize=False)),
                ('nombre', models.CharField(max_length=50)),
                ('apellido', models.CharField(max_length=50)),
                ('email', models.EmailField(max_length=100, null=True)),
                ('telefono', models.CharField(max_length=11)),
                ('direccion', models.CharField(max_length=100)),
            ],
        ),
        migrations.CreateModel(
            name='Compra',
            fields=[
                ('id_Compra', models.AutoField(primary_key=True, serialize=False)),
                ('serie_comprobante', models.CharField(max_length=4, null=True)),
                ('numero_comprobante', models.CharField(max_length=8, null=True)),
                ('monto_compra', models.DecimalField(decimal_places=2, max_digits=10)),
                ('fechaCompra', models.DateField()),
                ('estado', models.BooleanField()),
            ],
        ),
        migrations.CreateModel(
            name='Forma_Pago',
            fields=[
                ('id_FormaPago', models.AutoField(primary_key=True, serialize=False)),
                ('descripcion', models.CharField(max_length=20, unique=True)),
            ],
        ),
        migrations.CreateModel(
            name='Laboratorio',
            fields=[
                ('ruc_laboratorio', models.CharField(max_length=11, primary_key=True, serialize=False)),
                ('razon_social', models.CharField(max_length=50)),
                ('direccion', models.CharField(max_length=80)),
                ('telefono', models.CharField(max_length=9)),
            ],
        ),
        migrations.CreateModel(
            name='Lote',
            fields=[
                ('id_Lote', models.AutoField(primary_key=True, serialize=False)),
                ('descripcion', models.CharField(max_length=10, unique=True)),
            ],
        ),
        migrations.CreateModel(
            name='Proveedor',
            fields=[
                ('ruc', models.CharField(max_length=11, primary_key=True, serialize=False)),
                ('razon_social', models.CharField(max_length=50)),
                ('contacto', models.CharField(max_length=100)),
                ('telefono_contacto', models.CharField(max_length=9)),
                ('email', models.EmailField(max_length=100, null=True, unique=True)),
                ('direccion', models.CharField(max_length=70)),
                ('telefono_proveedor', models.CharField(max_length=9)),
            ],
        ),
        migrations.CreateModel(
            name='Tipo_Documento',
            fields=[
                ('id_TipoDocumento', models.AutoField(primary_key=True, serialize=False)),
                ('descripcion', models.CharField(max_length=20, unique=True)),
            ],
        ),
        migrations.CreateModel(
            name='Trabajador',
            fields=[
                ('dni', models.CharField(max_length=8, primary_key=True, serialize=False)),
                ('nombre', models.CharField(max_length=50)),
                ('apellido', models.CharField(max_length=50)),
                ('email', models.EmailField(max_length=100, null=True)),
                ('telefono', models.CharField(max_length=11)),
                ('direccion', models.CharField(max_length=100)),
            ],
        ),
        migrations.CreateModel(
            name='Unidad_Medida',
            fields=[
                ('id_UnidadMedida', models.AutoField(primary_key=True, serialize=False)),
                ('descripcion', models.CharField(max_length=10, unique=True)),
            ],
        ),
        migrations.CreateModel(
            name='Venta',
            fields=[
                ('id_Venta', models.AutoField(primary_key=True, serialize=False)),
                ('serie_comprobante', models.CharField(max_length=4)),
                ('numero_comprobante', models.CharField(max_length=4)),
                ('monto', models.DecimalField(decimal_places=2, max_digits=8)),
                ('fechaVenta', models.DateField()),
                ('estado', models.BooleanField()),
                ('dni', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='gestion.trabajador')),
                ('dni_Cliente', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='gestion.cliente')),
                ('id_FormaPago', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='gestion.forma_pago')),
                ('id_TipoDocumento', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='gestion.tipo_documento')),
                ('id_caja', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='gestion.caja')),
            ],
        ),
        migrations.CreateModel(
            name='Usuario',
            fields=[
                ('id_usuario', models.AutoField(primary_key=True, serialize=False)),
                ('user', models.CharField(max_length=50, unique=True)),
                ('password', models.CharField(max_length=100)),
                ('rol', models.CharField(max_length=2)),
                ('estado', models.BooleanField()),
                ('dni', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='gestion.trabajador')),
            ],
        ),
        migrations.CreateModel(
            name='Medicamento',
            fields=[
                ('codigo_medicamento', models.CharField(max_length=10, primary_key=True, serialize=False)),
                ('descripcion', models.CharField(max_length=20)),
                ('accion_farm', models.CharField(max_length=100)),
                ('stock_minimo', models.IntegerField()),
                ('fecha_vencimiento', models.DateField()),
                ('precio', models.DecimalField(decimal_places=2, max_digits=8, null=True)),
                ('stock', models.IntegerField()),
                ('estado', models.BooleanField()),
                ('id_unidad_medida', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='gestion.unidad_medida')),
                ('ruc_laboratorio', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='gestion.laboratorio')),
            ],
        ),
        migrations.CreateModel(
            name='Detalle_Venta',
            fields=[
                ('id_DetalleVenta', models.AutoField(primary_key=True, serialize=False)),
                ('precio', models.DecimalField(decimal_places=2, max_digits=8)),
                ('cantidad', models.IntegerField()),
                ('codigo_medicamento', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='gestion.medicamento')),
                ('id_Venta', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='gestion.venta')),
            ],
        ),
        migrations.CreateModel(
            name='Detalle_Compra',
            fields=[
                ('id_DetalleCompra', models.AutoField(primary_key=True, serialize=False)),
                ('precio', models.DecimalField(decimal_places=2, max_digits=10)),
                ('cantidad', models.IntegerField()),
                ('codigo_medicamento', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='gestion.medicamento')),
                ('id_Compra', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='gestion.compra')),
                ('id_Lote', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='gestion.lote')),
                ('ruc_proveedor', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='gestion.proveedor')),
            ],
        ),
        migrations.AddField(
            model_name='compra',
            name='dni',
            field=models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='gestion.trabajador'),
        ),
        migrations.AddField(
            model_name='compra',
            name='id_TipoDocumento',
            field=models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='gestion.tipo_documento'),
        ),
        migrations.AddField(
            model_name='compra',
            name='ruc_proveedor',
            field=models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='gestion.proveedor'),
        ),
    ]
