# Generated by Django 3.2.21 on 2023-10-12 00:36

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

    operations = [
        migrations.CreateModel(
            name='Factura',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('factura', models.CharField(max_length=256)),
                ('fecha_facturacion', models.DateTimeField(default=django.utils.timezone.now)),
                ('descripcion', models.CharField(blank=True, max_length=256, null=True)),
                ('archivo', models.FileField(blank=True, null=True, upload_to='facturas/')),
            ],
            options={
                'verbose_name_plural': 'Facturas',
                'ordering': ['id'],
            },
        ),
        migrations.CreateModel(
            name='Utr',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nombre', models.CharField(max_length=256)),
                ('serial', models.CharField(max_length=256)),
                ('imei', models.CharField(blank=True, max_length=256, null=True)),
                ('entregada', models.BooleanField(default=False)),
                ('cancelada', models.BooleanField(default=False)),
                ('faltante_cables', models.BooleanField(default=False)),
                ('fecha_entrega_faltante_cables', models.DateTimeField(default=django.utils.timezone.now)),
                ('faltante_baterias', models.BooleanField(default=False)),
                ('fecha_entrega_faltante_baterias', models.DateTimeField(default=django.utils.timezone.now)),
            ],
            options={
                'verbose_name_plural': "Utr's",
                'ordering': ['id'],
            },
        ),
        migrations.CreateModel(
            name='StatusConstruccion',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('status', models.CharField(choices=[('ING', 'ETAPA DE INGENIERIA'), ('ACO', 'APROBADO PARA CONSTRUCCION'), ('PFA', 'EN PROCESO DE FABRICACION'), ('TRC', 'TERMINADO EN REVISION DE CALIDAD'), ('EPE', 'EN PROCESO DE ENTREGA'), ('ENT', 'ENTREGADO')], default='MXN', max_length=3)),
                ('fecha', models.DateTimeField(default=django.utils.timezone.now)),
                ('creado_por', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name_plural': 'Status de Construcción',
                'ordering': ['id'],
            },
        ),
        migrations.CreateModel(
            name='Proyecto',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('fecha_creacion', models.DateTimeField(default=django.utils.timezone.now)),
                ('tipo', models.CharField(choices=[('SR', 'SERVICIO'), ('RF', 'REFACCIONES'), ('EQ', 'EQUIPOS'), ('IP', 'INTEGRACIÓN / PROYECTO'), ('CP', 'CAPACITACIÓN')], default='IP', max_length=2)),
                ('usuario_final', models.CharField(max_length=256)),
                ('orden_de_compra', models.CharField(max_length=64)),
                ('sales_order', models.CharField(max_length=64)),
                ('fecha_pedido', models.DateField()),
                ('fecha_entrega_solicitada', models.DateField()),
                ('fecha_entrega_confirmada', models.DateField(blank=True, null=True)),
                ('fecha_entrega_real', models.DateField(blank=True, null=True)),
                ('descripcion', models.CharField(blank=True, max_length=400, null=True)),
                ('monto', models.FloatField(default=0.0)),
                ('moneda', models.CharField(choices=[('MXN', 'MXN'), ('USD', 'USD'), ('EUR', 'EUR'), ('GBP', 'GBP')], default='MXN', max_length=3)),
                ('facturado', models.BooleanField(default=False)),
                ('fecha_facturado', models.DateTimeField(blank=True, null=True)),
                ('pagado', models.BooleanField(default=False)),
                ('fecha_pagado', models.DateTimeField(blank=True, null=True)),
                ('pausado', models.BooleanField(default=False)),
                ('fecha_pausado', models.DateTimeField(blank=True, null=True)),
                ('activo', models.BooleanField(default=True)),
                ('cliente', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='mainsite.client')),
                ('contacto_tecnico', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='contacto_tecnico', to=settings.AUTH_USER_MODEL)),
                ('creado_por', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
                ('facturas', models.ManyToManyField(blank=True, to='ventas.Factura')),
                ('status_construccion', models.ManyToManyField(to='ventas.StatusConstruccion')),
            ],
            options={
                'verbose_name_plural': 'Proyectos',
                'ordering': ['id'],
            },
        ),
    ]
