# Generated by Django 2.0.4 on 2019-06-04 16:30

from django.conf import settings
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import django_extensions.db.fields
import events.helpers.models


class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('events', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Invoice',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', django_extensions.db.fields.CreationDateTimeField(auto_now_add=True, verbose_name='created')),
                ('modified', django_extensions.db.fields.ModificationDateTimeField(auto_now=True, verbose_name='modified')),
                ('amount', models.DecimalField(decimal_places=2, max_digits=18, verbose_name='monto')),
                ('partial_payment', models.BooleanField(default=False, verbose_name='pago parcial')),
                ('complete_payment', models.BooleanField(default=False, verbose_name='pago completo')),
                ('close', models.BooleanField(default=False, verbose_name='cerrado')),
                ('observations', models.CharField(blank=True, max_length=2048, verbose_name='observaciones')),
                ('document', models.FileField(blank=True, upload_to='invoices/documments/', verbose_name='archivo')),
                ('invoice_ok', models.BooleanField(default=False, verbose_name='Factura generada OK')),
                ('changed_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='events_invoice_changed_by', to=settings.AUTH_USER_MODEL)),
                ('created_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='events_invoice_created_by', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'abstract': False,
            },
            bases=(events.helpers.models.SaveReversionMixin, models.Model),
        ),
        migrations.CreateModel(
            name='InvoiceAffect',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', django_extensions.db.fields.CreationDateTimeField(auto_now_add=True, verbose_name='created')),
                ('modified', django_extensions.db.fields.ModificationDateTimeField(auto_now=True, verbose_name='modified')),
                ('amount', models.DecimalField(decimal_places=2, max_digits=18, verbose_name='monto')),
                ('observations', models.CharField(blank=True, max_length=2048, verbose_name='observaciones')),
                ('document', models.FileField(blank=True, upload_to='invoice_affects/documments/', verbose_name='archivo')),
                ('category', models.CharField(choices=[('Pay', 'Pago'), ('Hold', 'Retencion'), ('Oth', 'Otros')], max_length=5, verbose_name='tipo')),
                ('changed_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='events_invoiceaffect_changed_by', to=settings.AUTH_USER_MODEL)),
                ('created_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='events_invoiceaffect_created_by', to=settings.AUTH_USER_MODEL)),
                ('invoice', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='events.Invoice', verbose_name='factura')),
            ],
            options={
                'abstract': False,
            },
            bases=(events.helpers.models.SaveReversionMixin, models.Model),
        ),
        migrations.CreateModel(
            name='Sponsor',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', django_extensions.db.fields.CreationDateTimeField(auto_now_add=True, verbose_name='created')),
                ('modified', django_extensions.db.fields.ModificationDateTimeField(auto_now=True, verbose_name='modified')),
                ('enabled', models.BooleanField(default=False, verbose_name='habilitado')),
                ('active', models.BooleanField(default=True, verbose_name='activo')),
                ('organization_name', models.CharField(help_text='Razón social.', max_length=317, verbose_name='razón social')),
                ('document_number', models.CharField(help_text='CUIT, formato ##-########-#', max_length=13, unique=True, validators=[django.core.validators.RegexValidator('^(20|23|24|27|30|33|34)-[0-9]{8}-[0-9]$', 'El CUIT ingresado no es correcto.')], verbose_name='CUIT')),
                ('contact_info', models.TextField(blank=True, verbose_name='información de contacto')),
                ('address', models.CharField(blank=True, help_text='Dirección', max_length=2048, verbose_name='direccion')),
                ('vat_condition', models.CharField(choices=[('responsable inscripto', 'Responsable Inscripto'), ('monotributo', 'Monotributo'), ('exterior', 'Exterior'), ('otro', 'Otro')], max_length=317, verbose_name='condición frente al iva')),
                ('other_vat_condition_text', models.CharField(blank=True, default='', help_text='Especifica otra condición frente al iva', max_length=317, verbose_name='otra condicion frente al iva')),
                ('changed_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='events_sponsor_changed_by', to=settings.AUTH_USER_MODEL)),
                ('created_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='events_sponsor_created_by', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'ordering': ['-created'],
                'permissions': (('set_sponsors_enabled', 'puede habilitar patrocinadores'), ('view_sponsors', 'puede ver patrocinadores')),
            },
            bases=(events.helpers.models.SaveReversionMixin, models.Model),
        ),
        migrations.CreateModel(
            name='Sponsoring',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', django_extensions.db.fields.CreationDateTimeField(auto_now_add=True, verbose_name='created')),
                ('modified', django_extensions.db.fields.ModificationDateTimeField(auto_now=True, verbose_name='modified')),
                ('comments', models.TextField(blank=True, verbose_name='comentarios')),
                ('changed_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='events_sponsoring_changed_by', to=settings.AUTH_USER_MODEL)),
                ('created_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='events_sponsoring_created_by', to=settings.AUTH_USER_MODEL)),
                ('sponsor', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='sponsoring', to='events.Sponsor')),
                ('sponsorcategory', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='sponsor_by', to='events.SponsorCategory')),
            ],
            options={
                'abstract': False,
            },
            bases=(events.helpers.models.SaveReversionMixin, models.Model),
        ),
        migrations.AlterField(
            model_name='bankaccountdata',
            name='account_number',
            field=models.CharField(help_text='Número de cuenta.', max_length=13, verbose_name='número de cuenta'),
        ),
        migrations.AlterField(
            model_name='bankaccountdata',
            name='account_type',
            field=models.CharField(choices=[('CC', 'Cuenta corriente'), ('CA', 'Caja de ahorros')], max_length=3, verbose_name='Tipo cuenta'),
        ),
        migrations.AlterField(
            model_name='bankaccountdata',
            name='bank_entity',
            field=models.CharField(help_text='Nombre de la entiedad bancaria.', max_length=317, verbose_name='entidad bancaria'),
        ),
        migrations.AlterField(
            model_name='bankaccountdata',
            name='document_number',
            field=models.CharField(help_text='CUIT del propietario de la cuenta, formato ##-########-#', max_length=13, validators=[django.core.validators.RegexValidator('^(20|23|24|27|30|33|34)-[0-9]{8}-[0-9]$', 'El CUIT ingresado no es correcto.')], verbose_name='CUIT'),
        ),
        migrations.AlterField(
            model_name='bankaccountdata',
            name='organization_name',
            field=models.CharField(help_text='Razón social o nombre del propietario de la cuenta.', max_length=317, verbose_name='razón social'),
        ),
        migrations.AddField(
            model_name='invoice',
            name='sponsoring',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='invoices', to='events.Sponsoring', verbose_name='patrocinio'),
        ),
        migrations.AddField(
            model_name='sponsorcategory',
            name='sponsors',
            field=models.ManyToManyField(related_name='sponsor_categories', through='events.Sponsoring', to='events.Sponsor', verbose_name='patrocinios'),
        ),
    ]
