# Generated by Django 3.1.4 on 2021-01-05 15:02

import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import unoletutils.libs.text


class Migration(migrations.Migration):

    dependencies = [
        ('company', '0002_auto_20210104_1639'),
        ('finance', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='TaxReceipt',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('code', models.CharField(help_text='código del tipo de comprobante según la DGII.', max_length=5, verbose_name='código')),
                ('name', models.CharField(help_text='nombre del tipo de comprobante físcal.', max_length=100, verbose_name='nombre')),
                ('is_active', models.BooleanField(default=True, verbose_name='activo')),
                ('min_available_to_notify', models.IntegerField(default=0, help_text='notifica al usuario cuando el disponible alcance este valor.', validators=[django.core.validators.MinValueValidator(0)], verbose_name='disponible mínimo para avisar')),
                ('min_days_before_expiration_to_notify', models.IntegerField(default=0, help_text='notifica al usuario cuando el comprobante alcance los días restantes indicados antes de su vencimiento.', validators=[django.core.validators.MinValueValidator(0)], verbose_name='días mínimos antes de vencer para avisar')),
                ('company', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='company.company', verbose_name='Empresa')),
            ],
            options={
                'verbose_name': 'comprobante fiscal',
                'verbose_name_plural': 'comprobantes fiscales',
                'ordering': ['company', 'code'],
            },
            bases=(models.Model, unoletutils.libs.text.Text),
        ),
        migrations.CreateModel(
            name='TaxReceiptAuthorization',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('authorization', models.CharField(help_text='número de autorización suministrado por el emisor de los comprobantes fiscales.', max_length=50, verbose_name='autorización')),
                ('authorization_date', models.DateField(help_text='fecha en que fueron autorizados estos comprobantes.', verbose_name='fecha de autorización')),
                ('expiration_date', models.DateField(blank=True, help_text='fecha en que vencerán estos números de comprobantes fiscales.', null=True, verbose_name='fecha de vencimiento')),
                ('first_receipt', models.CharField(help_text='número de comprobante inicial.', max_length=11, verbose_name='comprobante inicial')),
                ('last_receipt', models.CharField(help_text='número de comprobante final.', max_length=11, verbose_name='comprobante final')),
                ('tax_receipt', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='finance.taxreceipt', verbose_name='comprobante fiscal')),
            ],
            options={
                'verbose_name': 'autorización de comprobantes fiscales',
                'verbose_name_plural': 'autorizaciones de comprobantes fiscales',
                'ordering': ['tax_receipt__company', '-authorization_date'],
            },
            bases=(models.Model, unoletutils.libs.text.Text),
        ),
        migrations.CreateModel(
            name='TaxReceiptNumber',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('number', models.CharField(editable=False, max_length=11, verbose_name='número')),
                ('serie', models.CharField(max_length=1)),
                ('sequence', models.CharField(max_length=8, validators=[django.core.validators.MinLengthValidator(8), django.core.validators.MaxLengthValidator(8)])),
                ('authorization', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='finance.taxreceiptauthorization')),
                ('tax_receipt', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='finance.taxreceipt')),
            ],
            options={
                'verbose_name': 'número de comprobante fiscal',
                'verbose_name_plural': 'números de comprobantes fiscales',
                'ordering': ['tax_receipt__company', 'number'],
            },
            bases=(models.Model, unoletutils.libs.text.Text),
        ),
        migrations.AddConstraint(
            model_name='taxreceiptnumber',
            constraint=models.UniqueConstraint(fields=('tax_receipt', 'number'), name='unique_number_tax_receipt'),
        ),
        migrations.AddConstraint(
            model_name='taxreceipt',
            constraint=models.UniqueConstraint(fields=('company', 'code'), name='unique_code_for_company'),
        ),
        migrations.AddConstraint(
            model_name='taxreceipt',
            constraint=models.UniqueConstraint(fields=('company', 'name'), name='unique_name_for_company'),
        ),
    ]

# Generated by Django 3.1.4 on 2021-01-05 15:02

import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import unoletutils.libs.text


class Migration(migrations.Migration):

    dependencies = [
        ('company', '0002_auto_20210104_1639'),
        ('finance', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='TaxReceipt',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('code', models.CharField(help_text='código del tipo de comprobante según la DGII.', max_length=5, verbose_name='código')),
                ('name', models.CharField(help_text='nombre del tipo de comprobante físcal.', max_length=100, verbose_name='nombre')),
                ('is_active', models.BooleanField(default=True, verbose_name='activo')),
                ('min_available_to_notify', models.IntegerField(default=0, help_text='notifica al usuario cuando el disponible alcance este valor.', validators=[django.core.validators.MinValueValidator(0)], verbose_name='disponible mínimo para avisar')),
                ('min_days_before_expiration_to_notify', models.IntegerField(default=0, help_text='notifica al usuario cuando el comprobante alcance los días restantes indicados antes de su vencimiento.', validators=[django.core.validators.MinValueValidator(0)], verbose_name='días mínimos antes de vencer para avisar')),
                ('company', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='company.company', verbose_name='Empresa')),
            ],
            options={
                'verbose_name': 'comprobante fiscal',
                'verbose_name_plural': 'comprobantes fiscales',
                'ordering': ['company', 'code'],
            },
            bases=(models.Model, unoletutils.libs.text.Text),
        ),
        migrations.CreateModel(
            name='TaxReceiptAuthorization',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('authorization', models.CharField(help_text='número de autorización suministrado por el emisor de los comprobantes fiscales.', max_length=50, verbose_name='autorización')),
                ('authorization_date', models.DateField(help_text='fecha en que fueron autorizados estos comprobantes.', verbose_name='fecha de autorización')),
                ('expiration_date', models.DateField(blank=True, help_text='fecha en que vencerán estos números de comprobantes fiscales.', null=True, verbose_name='fecha de vencimiento')),
                ('first_receipt', models.CharField(help_text='número de comprobante inicial.', max_length=11, verbose_name='comprobante inicial')),
                ('last_receipt', models.CharField(help_text='número de comprobante final.', max_length=11, verbose_name='comprobante final')),
                ('tax_receipt', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='finance.taxreceipt', verbose_name='comprobante fiscal')),
            ],
            options={
                'verbose_name': 'autorización de comprobantes fiscales',
                'verbose_name_plural': 'autorizaciones de comprobantes fiscales',
                'ordering': ['tax_receipt__company', '-authorization_date'],
            },
            bases=(models.Model, unoletutils.libs.text.Text),
        ),
        migrations.CreateModel(
            name='TaxReceiptNumber',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('number', models.CharField(editable=False, max_length=11, verbose_name='número')),
                ('serie', models.CharField(max_length=1)),
                ('sequence', models.CharField(max_length=8, validators=[django.core.validators.MinLengthValidator(8), django.core.validators.MaxLengthValidator(8)])),
                ('authorization', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='finance.taxreceiptauthorization')),
                ('tax_receipt', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='finance.taxreceipt')),
            ],
            options={
                'verbose_name': 'número de comprobante fiscal',
                'verbose_name_plural': 'números de comprobantes fiscales',
                'ordering': ['tax_receipt__company', 'number'],
            },
            bases=(models.Model, unoletutils.libs.text.Text),
        ),
        migrations.AddConstraint(
            model_name='taxreceiptnumber',
            constraint=models.UniqueConstraint(fields=('tax_receipt', 'number'), name='unique_number_tax_receipt'),
        ),
        migrations.AddConstraint(
            model_name='taxreceipt',
            constraint=models.UniqueConstraint(fields=('company', 'code'), name='unique_code_for_company'),
        ),
        migrations.AddConstraint(
            model_name='taxreceipt',
            constraint=models.UniqueConstraint(fields=('company', 'name'), name='unique_name_for_company'),
        ),
    ]

# Generated by Django 3.1.4 on 2021-01-05 15:02