# Generated by Django 3.0.7 on 2020-09-28 15:10

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('people', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Categoria',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nombre', models.CharField(max_length=255, verbose_name='Nombre')),
                ('descripcion', models.TextField(verbose_name='Descripción')),
            ],
        ),
        migrations.CreateModel(
            name='Cliente',
            fields=[
                ('persona_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='people.Persona')),
            ],
            bases=('people.persona',),
        ),
        migrations.CreateModel(
            name='Compra',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('fechaCompra', models.DateField(verbose_name='Fecha de compra')),
                ('subtotal', models.DecimalField(decimal_places=2, max_digits=12, verbose_name='SubTotal')),
                ('impuesto', models.DecimalField(decimal_places=2, max_digits=12, verbose_name='Impuesto')),
                ('total', models.DecimalField(decimal_places=2, max_digits=12, verbose_name='Total')),
                ('estado', models.CharField(choices=[('POR_PAGAR', 'Por pagar'), ('PAGADO', 'Pagado')], default='POR_PAGAR', max_length=50, verbose_name='Estado')),
            ],
        ),
        migrations.CreateModel(
            name='DetalleOrden',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nombre_equipo', models.CharField(max_length=250, verbose_name='Nombre de equipo')),
                ('observacion', models.CharField(max_length=250, verbose_name='Observación')),
                ('estado', models.CharField(choices=[('NUEVO', 'Nuevo'), ('EN_REVISION', 'En revisión'), ('REVISADO', 'Revisado'), ('CONFIRMADO', 'Confirmado'), ('Arregado', 'Arreglado'), ('FINALIZADO', 'Finalizado')], default='NUEVO', max_length=50, verbose_name='Estado')),
                ('precio_servicio', models.DecimalField(decimal_places=2, default=0.0, max_digits=12, verbose_name='Precio de servicio')),
            ],
        ),
        migrations.CreateModel(
            name='Empresa',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nombre', models.CharField(max_length=250, verbose_name='Nombre')),
                ('contacto', models.CharField(max_length=250, verbose_name='Contacto')),
                ('email', models.EmailField(max_length=254, unique=True, verbose_name='Correo electrónico')),
                ('telefono', models.CharField(blank=True, max_length=250, null=True, verbose_name='Teléfono')),
                ('celular', models.CharField(blank=True, max_length=250, null=True, verbose_name='Celular')),
                ('direccion', models.CharField(blank=True, max_length=250, null=True, verbose_name='Dirección')),
            ],
        ),
        migrations.CreateModel(
            name='Proveedor',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nombre', models.CharField(max_length=250, verbose_name='Nombre')),
                ('contacto', models.CharField(max_length=250, verbose_name='Contacto')),
                ('email', models.EmailField(max_length=254, unique=True, verbose_name='Correo electrónico')),
                ('telefono', models.CharField(blank=True, max_length=250, null=True, verbose_name='Teléfono')),
                ('celular', models.CharField(blank=True, max_length=250, null=True, verbose_name='Celular')),
                ('direccion', models.CharField(blank=True, max_length=250, null=True, verbose_name='Dirección')),
            ],
        ),
        migrations.CreateModel(
            name='Tecnico',
            fields=[
                ('persona_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='people.Persona')),
                ('fecha_ingreso', models.DateField(verbose_name='Fecha de ingreso')),
            ],
            bases=('people.persona',),
        ),
        migrations.CreateModel(
            name='RevisionTecnica',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('fecha_revision', models.DateField(verbose_name='Fecha de revisión')),
                ('descripcion', models.CharField(max_length=250, verbose_name='Descripción')),
                ('detalle_orden', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='revisiones', to='store.DetalleOrden')),
                ('tecnico', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='revisiones', to='store.Tecnico')),
            ],
        ),
        migrations.CreateModel(
            name='Producto',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nombre', models.CharField(max_length=255, verbose_name='Nombre')),
                ('cantidad', models.PositiveIntegerField(verbose_name='Cantidad')),
                ('descripcion', models.TextField(verbose_name='Descripción')),
                ('categoria', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='productos', to='store.Categoria')),
            ],
        ),
        migrations.CreateModel(
            name='Precio',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('valor', models.DecimalField(decimal_places=2, max_digits=12, verbose_name='Precio')),
                ('nombre', models.CharField(blank=True, max_length=255, null=True)),
                ('producto', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='precios', to='store.Producto')),
            ],
        ),
        migrations.CreateModel(
            name='OrdenMantenimiento',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('fecha_registro', models.DateField(auto_now_add=True, verbose_name='Fecha de registro')),
                ('descripcion', models.CharField(blank=True, max_length=250, null=True, verbose_name='Descripción')),
                ('estado', models.CharField(choices=[('NUEVO', 'Nuevo'), ('EN_REVISION', 'EN revisión'), ('REVISADO', 'Revisado'), ('FINALIZADO', 'Finalizado')], default='NUEVO', max_length=50, verbose_name='Estado')),
                ('monto_servicio', models.DecimalField(decimal_places=2, default=0.0, max_digits=12, verbose_name='Monto')),
                ('cliente', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='ordenes', to='store.Cliente')),
                ('empresa', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='ordenes', to='store.Empresa')),
            ],
        ),
        migrations.CreateModel(
            name='Impuesto',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('porcentaje', models.DecimalField(decimal_places=2, max_digits=2, verbose_name='Porcentaje')),
                ('nombre', models.CharField(blank=True, max_length=255, null=True)),
                ('producto', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='impuestos', to='store.Producto')),
            ],
        ),
        migrations.CreateModel(
            name='Factura',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('fechaVenta', models.DateField(verbose_name='Fecha de compra')),
                ('subtotal', models.DecimalField(decimal_places=2, max_digits=12, verbose_name='SubTotal')),
                ('impuesto', models.DecimalField(decimal_places=2, max_digits=12, verbose_name='Impuesto')),
                ('total', models.DecimalField(decimal_places=2, max_digits=12, verbose_name='Total')),
                ('estado', models.CharField(choices=[('POR_PAGAR', 'Por pagar'), ('PAGADO', 'Pagado')], default='POR_PAGAR', max_length=50, verbose_name='Estado')),
                ('cliente', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='facturas', to='store.Cliente')),
                ('empresa', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='facturas', to='store.Empresa')),
            ],
        ),
        migrations.AddField(
            model_name='detalleorden',
            name='orden_mantenimiento',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='detalles', to='store.OrdenMantenimiento'),
        ),
        migrations.CreateModel(
            name='DetalleFactura',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('detalle', models.CharField(blank=True, max_length=255, null=True)),
                ('cantidad', models.PositiveIntegerField(verbose_name='Cantidad')),
                ('precioUnitario', models.DecimalField(decimal_places=2, max_digits=12, verbose_name='Precio Unitario')),
                ('impuesto', models.DecimalField(decimal_places=2, max_digits=12, verbose_name='Impuesto')),
                ('total', models.DecimalField(decimal_places=2, max_digits=12, verbose_name='Total')),
                ('factura', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='detalles', to='store.Factura')),
                ('producto', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='ventas', to='store.Producto')),
            ],
        ),
        migrations.CreateModel(
            name='DetalleCompra',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('detalle', models.CharField(blank=True, max_length=255, null=True)),
                ('cantidad', models.PositiveIntegerField(verbose_name='Cantidad')),
                ('precioUnitario', models.DecimalField(decimal_places=2, max_digits=12, verbose_name='Precio Unitario')),
                ('impuesto', models.DecimalField(decimal_places=2, max_digits=12, verbose_name='Impuesto')),
                ('total', models.DecimalField(decimal_places=2, max_digits=12, verbose_name='Total')),
                ('compra', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='detalles', to='store.Compra')),
                ('producto', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='compras', to='store.Producto')),
            ],
        ),
        migrations.AddField(
            model_name='compra',
            name='proveedor',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='compras', to='store.Proveedor'),
        ),
        migrations.AddField(
            model_name='categoria',
            name='empresa',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='categorias', to='store.Empresa'),
        ),
    ]
