# Generated by Django 2.0.4 on 2019-05-13 03:51

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


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='facturaVenta',
            fields=[
                ('id_factura_de_venta', models.BigAutoField(primary_key=True, serialize=False)),
                ('fecha', models.DateTimeField(default=django.utils.timezone.now)),
                ('total', models.DecimalField(decimal_places=2, max_digits=10)),
            ],
            options={
                'verbose_name': 'Factura de venta',
                'verbose_name_plural': 'Facturas de venta',
            },
        ),
        migrations.CreateModel(
            name='facturaVentaContieneProductos',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('precio', models.DecimalField(decimal_places=2, max_digits=10)),
                ('cantidad', models.IntegerField()),
                ('descuento', models.DecimalField(decimal_places=2, max_digits=10)),
                ('id_factura_de_venta', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='factura_de_venta.facturaVenta')),
                ('id_producto', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='productos.Producto', verbose_name='Producto')),
            ],
            options={
                'verbose_name': 'Factura de venta contiene productos',
                'verbose_name_plural': 'Facturas de venta contiene productos',
            },
        ),
        migrations.CreateModel(
            name='MedioDePago',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('medio_de_pago', models.CharField(choices=[('efectivo', 'efectivo'), ('tarjeta', 'tarjeta')], default='efectivo', max_length=10)),
            ],
            options={
                'verbose_name': 'Medio de pago',
                'verbose_name_plural': 'Medios de pago',
            },
        ),
        migrations.CreateModel(
            name='TipoDeVenta',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('tipo_de_venta', models.CharField(choices=[('PO1', 'Opcion 1'), ('P02', 'Opcion 2')], default='PO1', max_length=50)),
            ],
            options={
                'verbose_name': 'Tipo de venta',
                'verbose_name_plural': 'Tipos de venta',
            },
        ),
        migrations.AddField(
            model_name='facturaventa',
            name='id_medio_de_pago',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='factura_de_venta.MedioDePago', verbose_name='Medio de pago'),
        ),
        migrations.AddField(
            model_name='facturaventa',
            name='id_tipo_de_venta',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='factura_de_venta.TipoDeVenta', verbose_name='tipo de venta'),
        ),
    ]
