# -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-11-22 23:49
from __future__ import unicode_literals

import datetime
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Cliente',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nombre', models.CharField(max_length=100)),
                ('nit', models.CharField(max_length=17)),
                ('telefono', models.CharField(max_length=9)),
            ],
            options={
                'verbose_name': 'Cliente',
                'verbose_name_plural': 'Clientes',
            },
        ),
        migrations.CreateModel(
            name='Cuenta',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nombre', models.CharField(max_length=50, unique=True)),
                ('acreedor', models.BooleanField(default=True)),
                ('fecha', models.DateTimeField(auto_now=True)),
            ],
            options={
                'verbose_name': 'Cuenta',
                'verbose_name_plural': 'Cuentas',
            },
        ),
        migrations.CreateModel(
            name='CuentaMayor',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('fecha', models.DateTimeField(auto_now=True)),
                ('nombre', models.CharField(max_length=50, unique=True)),
            ],
            options={
                'verbose_name': 'Cuenta Mayor',
                'verbose_name_plural': 'Cuentas Mayor',
            },
        ),
        migrations.CreateModel(
            name='Empleado',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nombres', models.CharField(max_length=50)),
                ('apellidos', models.CharField(max_length=50)),
                ('edad', models.IntegerField()),
                ('sexo', models.CharField(choices=[('M', 'Masculino'), ('F', 'Femenino')], max_length=1)),
                ('direccion', models.TextField(max_length=200)),
                ('telefono', models.CharField(max_length=9)),
                ('contacto', models.CharField(max_length=9)),
                ('dui', models.CharField(max_length=10)),
                ('nit', models.CharField(max_length=17)),
                ('afp', models.CharField(max_length=12)),
                ('eficiencia', models.FloatField(default=0.9)),
                ('activo', models.BooleanField()),
                ('fecha_contratacion', models.DateField(default='2001-01-01')),
            ],
            options={
                'verbose_name': 'Empleado',
                'verbose_name_plural': 'Empleado',
            },
        ),
        migrations.CreateModel(
            name='Movimiento',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('cantidad', models.FloatField(default=0.0, null=True)),
                ('debe', models.BooleanField(default=True)),
                ('cuenta', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='contables.Cuenta')),
            ],
            options={
                'verbose_name': 'Movimiento',
                'verbose_name_plural': 'Movimientos',
            },
        ),
        migrations.CreateModel(
            name='MovimientoInventario',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('fecha', models.DateTimeField(auto_now=True)),
                ('detalle', models.CharField(max_length=100)),
                ('eCantidad', models.IntegerField(default=0)),
                ('ePUnitario', models.FloatField(default=0.0)),
                ('eTotal', models.FloatField(default=0.0)),
                ('sCantidad', models.IntegerField(default=0)),
                ('sPUnitario', models.FloatField(default=0.0)),
                ('sTotal', models.FloatField(default=0.0)),
                ('saldoCantidad', models.IntegerField(default=0)),
                ('saldoPUnitario', models.FloatField(default=0.0)),
                ('saldoTotal', models.FloatField(default=0.0)),
                ('idAux', models.IntegerField(default=0)),
            ],
            options={
                'verbose_name': 'MovimientoInventario',
                'verbose_name_plural': 'MovimientoInventarios',
            },
        ),
        migrations.CreateModel(
            name='ordenDeFabricacion',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('fechaExpedicion', models.DateField()),
                ('fechaRequerida', models.DateField()),
                ('materal', models.CharField(max_length=100)),
                ('catidadMP', models.FloatField()),
                ('costoUnitarioMP', models.FloatField()),
                ('numHoras', models.IntegerField()),
                ('costoHora', models.FloatField()),
                ('tasaCIF', models.FloatField()),
                ('cliente', models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, to='contables.Cliente')),
                ('obrero', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='contables.Empleado')),
            ],
            options={
                'verbose_name': 'Orden de Fabricacion',
                'verbose_name_plural': 'Ordenes de Fabricacion',
            },
        ),
        migrations.CreateModel(
            name='producto',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nombre', models.CharField(max_length=50)),
                ('inventarioInicialMp', models.FloatField(default=0.0)),
                ('compras', models.FloatField(default=0.0)),
                ('inventarioFinal', models.FloatField(default=0.0)),
                ('invIniPenP', models.FloatField(default=0.0)),
                ('invFinalPenP', models.FloatField(default=0.0)),
                ('invInicialProductTerminado', models.FloatField(default=0.0)),
                ('invFinalProductTerminado', models.FloatField(default=0.0)),
                ('nuneroArticulos', models.IntegerField()),
                ('ordenDeFabricacion', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='contables.ordenDeFabricacion')),
            ],
            options={
                'verbose_name': 'Producto',
                'verbose_name_plural': 'Productos',
            },
        ),
        migrations.CreateModel(
            name='Puesto',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nombre', models.CharField(max_length=30)),
                ('salarioMensual', models.FloatField(default=0.0)),
            ],
            options={
                'verbose_name': 'Puesto',
                'verbose_name_plural': 'Puestos',
            },
        ),
        migrations.CreateModel(
            name='Rubro',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nombre', models.CharField(max_length=50, unique=True)),
                ('fecha', models.DateTimeField(auto_now=True)),
            ],
            options={
                'verbose_name': 'Rubro',
                'verbose_name_plural': 'Rubros',
            },
        ),
        migrations.CreateModel(
            name='TipoCuenta',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('codigo', models.IntegerField(default=1, unique=True, validators=[django.core.validators.MaxValueValidator(9), django.core.validators.MinValueValidator(1)])),
                ('nombre', models.CharField(max_length=50, unique=True)),
            ],
            options={
                'verbose_name': 'Tipo de Cuenta',
                'verbose_name_plural': 'Tipos de Cuenta',
            },
        ),
        migrations.CreateModel(
            name='TipoTransaccion',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nombre', models.CharField(max_length=49)),
            ],
            options={
                'verbose_name': 'Tipo Transaccion',
                'verbose_name_plural': 'Tipo Transacciones',
            },
        ),
        migrations.CreateModel(
            name='Transaccion',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('fecha', models.DateField(default=datetime.datetime.now)),
                ('descripcion', models.TextField(max_length=100, null=True)),
                ('empleado', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='contables.Empleado')),
                ('tipo', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='contables.TipoTransaccion')),
            ],
            options={
                'verbose_name': 'Transaccion',
                'verbose_name_plural': 'Transacciones',
            },
        ),
        migrations.AddField(
            model_name='rubro',
            name='tipo',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='contables.TipoCuenta'),
        ),
        migrations.AddField(
            model_name='movimiento',
            name='transaccion',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='contables.Transaccion'),
        ),
        migrations.AddField(
            model_name='empleado',
            name='puesto',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='contables.Puesto'),
        ),
        migrations.AddField(
            model_name='cuentamayor',
            name='rubro',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='contables.Rubro'),
        ),
        migrations.AddField(
            model_name='cuenta',
            name='cuentaMayor',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='contables.CuentaMayor'),
        ),
    ]
