# -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2018-01-29 08:41
from __future__ import unicode_literals

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


class Migration(migrations.Migration):

    dependencies = [
        ('codenerix_payments', '0001_initial'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('codenerix_invoicing', '0002_auto_20180129_0937'),
    ]

    operations = [
        migrations.CreateModel(
            name='PrintCounterDocumentAlbaran',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', models.DateTimeField(auto_now_add=True, verbose_name='Created')),
                ('updated', models.DateTimeField(auto_now=True, verbose_name='Updated')),
                ('date', models.DateTimeField(default=django.utils.timezone.now, editable=False, verbose_name='Date')),
                ('status_document', models.CharField(choices=[('TM', 'Temporary'), ('DF', 'Definitive')], default='TM', max_length=2, verbose_name='Status document')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='PrintCounterDocumentBasket',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', models.DateTimeField(auto_now_add=True, verbose_name='Created')),
                ('updated', models.DateTimeField(auto_now=True, verbose_name='Updated')),
                ('date', models.DateTimeField(default=django.utils.timezone.now, editable=False, verbose_name='Date')),
                ('status_document', models.CharField(choices=[('TM', 'Temporary'), ('DF', 'Definitive')], default='TM', max_length=2, verbose_name='Status document')),
                ('basket', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='print_counter_document_basket', to='codenerix_invoicing.SalesBasket', verbose_name='Document')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='print_counter_document_basket', to=settings.AUTH_USER_MODEL, verbose_name='User')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='PrintCounterDocumentInvoice',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', models.DateTimeField(auto_now_add=True, verbose_name='Created')),
                ('updated', models.DateTimeField(auto_now=True, verbose_name='Updated')),
                ('date', models.DateTimeField(default=django.utils.timezone.now, editable=False, verbose_name='Date')),
                ('status_document', models.CharField(choices=[('TM', 'Temporary'), ('DF', 'Definitive')], default='TM', max_length=2, verbose_name='Status document')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='PrintCounterDocumentInvoiceRectification',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', models.DateTimeField(auto_now_add=True, verbose_name='Created')),
                ('updated', models.DateTimeField(auto_now=True, verbose_name='Updated')),
                ('date', models.DateTimeField(default=django.utils.timezone.now, editable=False, verbose_name='Date')),
                ('status_document', models.CharField(choices=[('TM', 'Temporary'), ('DF', 'Definitive')], default='TM', max_length=2, verbose_name='Status document')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='PrintCounterDocumentOrder',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', models.DateTimeField(auto_now_add=True, verbose_name='Created')),
                ('updated', models.DateTimeField(auto_now=True, verbose_name='Updated')),
                ('date', models.DateTimeField(default=django.utils.timezone.now, editable=False, verbose_name='Date')),
                ('status_document', models.CharField(choices=[('TM', 'Temporary'), ('DF', 'Definitive')], default='TM', max_length=2, verbose_name='Status document')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='PrintCounterDocumentTicket',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', models.DateTimeField(auto_now_add=True, verbose_name='Created')),
                ('updated', models.DateTimeField(auto_now=True, verbose_name='Updated')),
                ('date', models.DateTimeField(default=django.utils.timezone.now, editable=False, verbose_name='Date')),
                ('status_document', models.CharField(choices=[('TM', 'Temporary'), ('DF', 'Definitive')], default='TM', max_length=2, verbose_name='Status document')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='PrintCounterDocumentTicketRectification',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', models.DateTimeField(auto_now_add=True, verbose_name='Created')),
                ('updated', models.DateTimeField(auto_now=True, verbose_name='Updated')),
                ('date', models.DateTimeField(default=django.utils.timezone.now, editable=False, verbose_name='Date')),
                ('status_document', models.CharField(choices=[('TM', 'Temporary'), ('DF', 'Definitive')], default='TM', max_length=2, verbose_name='Status document')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='SalesAlbaran',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', models.DateTimeField(auto_now_add=True, verbose_name='Created')),
                ('updated', models.DateTimeField(auto_now=True, verbose_name='Updated')),
                ('lock', models.BooleanField(default=False, verbose_name='Lock')),
                ('parent_pk', models.IntegerField(blank=True, null=True, verbose_name='Parent pk')),
                ('code', models.CharField(max_length=64, verbose_name='Code')),
                ('code_counter', models.IntegerField(editable=False, verbose_name='Code counter')),
                ('date', models.DateTimeField(default=django.utils.timezone.now, verbose_name='Date')),
                ('observations', models.TextField(blank=True, max_length=256, null=True, verbose_name='Observations')),
                ('subtotal', models.DecimalField(decimal_places=2, default=0, editable=False, max_digits=10, verbose_name='Subtotal')),
                ('discounts', models.FloatField(default=0, editable=False, verbose_name='Discounts')),
                ('taxes', models.FloatField(default=0, editable=False, verbose_name='Taxes')),
                ('equivalence_surcharges', models.FloatField(default=0, editable=False, verbose_name='Equivalence surcharge')),
                ('total', models.DecimalField(decimal_places=2, default=0, editable=False, max_digits=10, verbose_name='Total')),
                ('removed', models.BooleanField(default=False, editable=False, verbose_name='Removed')),
                ('summary_delivery', models.TextField(blank=True, max_length=256, null=True, verbose_name='Address delivery')),
                ('billing_series', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='albaran_sales', to='codenerix_invoicing.BillingSeries', verbose_name='Billing series')),
            ],
            options={
                'default_permissions': ('add', 'change', 'delete', 'view', 'list'),
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='SalesInvoice',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', models.DateTimeField(auto_now_add=True, verbose_name='Created')),
                ('updated', models.DateTimeField(auto_now=True, verbose_name='Updated')),
                ('lock', models.BooleanField(default=False, verbose_name='Lock')),
                ('parent_pk', models.IntegerField(blank=True, null=True, verbose_name='Parent pk')),
                ('code', models.CharField(max_length=64, verbose_name='Code')),
                ('code_counter', models.IntegerField(editable=False, verbose_name='Code counter')),
                ('date', models.DateTimeField(default=django.utils.timezone.now, verbose_name='Date')),
                ('observations', models.TextField(blank=True, max_length=256, null=True, verbose_name='Observations')),
                ('subtotal', models.DecimalField(decimal_places=2, default=0, editable=False, max_digits=10, verbose_name='Subtotal')),
                ('discounts', models.FloatField(default=0, editable=False, verbose_name='Discounts')),
                ('taxes', models.FloatField(default=0, editable=False, verbose_name='Taxes')),
                ('equivalence_surcharges', models.FloatField(default=0, editable=False, verbose_name='Equivalence surcharge')),
                ('total', models.DecimalField(decimal_places=2, default=0, editable=False, max_digits=10, verbose_name='Total')),
                ('removed', models.BooleanField(default=False, editable=False, verbose_name='Removed')),
                ('summary_invoice', models.TextField(blank=True, max_length=256, null=True, verbose_name='Address invoice')),
                ('billing_series', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='invoice_sales', to='codenerix_invoicing.BillingSeries', verbose_name='Billing series')),
                ('customer', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='invoice_sales', to='codenerix_invoicing.Customer', verbose_name='Customer')),
            ],
            options={
                'default_permissions': ('add', 'change', 'delete', 'view', 'list'),
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='SalesInvoiceRectification',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', models.DateTimeField(auto_now_add=True, verbose_name='Created')),
                ('updated', models.DateTimeField(auto_now=True, verbose_name='Updated')),
                ('lock', models.BooleanField(default=False, verbose_name='Lock')),
                ('parent_pk', models.IntegerField(blank=True, null=True, verbose_name='Parent pk')),
                ('code', models.CharField(max_length=64, verbose_name='Code')),
                ('code_counter', models.IntegerField(editable=False, verbose_name='Code counter')),
                ('date', models.DateTimeField(default=django.utils.timezone.now, verbose_name='Date')),
                ('observations', models.TextField(blank=True, max_length=256, null=True, verbose_name='Observations')),
                ('subtotal', models.DecimalField(decimal_places=2, default=0, editable=False, max_digits=10, verbose_name='Subtotal')),
                ('discounts', models.FloatField(default=0, editable=False, verbose_name='Discounts')),
                ('taxes', models.FloatField(default=0, editable=False, verbose_name='Taxes')),
                ('equivalence_surcharges', models.FloatField(default=0, editable=False, verbose_name='Equivalence surcharge')),
                ('total', models.DecimalField(decimal_places=2, default=0, editable=False, max_digits=10, verbose_name='Total')),
                ('removed', models.BooleanField(default=False, editable=False, verbose_name='Removed')),
                ('billing_series', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='invoicerectification_sales', to='codenerix_invoicing.BillingSeries', verbose_name='Billing series')),
                ('invoice', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='invoicerectification_sales', to='codenerix_invoicing.SalesInvoice', verbose_name='Invoice')),
            ],
            options={
                'default_permissions': ('add', 'change', 'delete', 'view', 'list'),
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='SalesOrder',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', models.DateTimeField(auto_now_add=True, verbose_name='Created')),
                ('updated', models.DateTimeField(auto_now=True, verbose_name='Updated')),
                ('lock', models.BooleanField(default=False, verbose_name='Lock')),
                ('parent_pk', models.IntegerField(blank=True, null=True, verbose_name='Parent pk')),
                ('code', models.CharField(max_length=64, verbose_name='Code')),
                ('code_counter', models.IntegerField(editable=False, verbose_name='Code counter')),
                ('date', models.DateTimeField(default=django.utils.timezone.now, verbose_name='Date')),
                ('observations', models.TextField(blank=True, max_length=256, null=True, verbose_name='Observations')),
                ('subtotal', models.DecimalField(decimal_places=2, default=0, editable=False, max_digits=10, verbose_name='Subtotal')),
                ('discounts', models.FloatField(default=0, editable=False, verbose_name='Discounts')),
                ('taxes', models.FloatField(default=0, editable=False, verbose_name='Taxes')),
                ('equivalence_surcharges', models.FloatField(default=0, editable=False, verbose_name='Equivalence surcharge')),
                ('total', models.DecimalField(decimal_places=2, default=0, editable=False, max_digits=10, verbose_name='Total')),
                ('removed', models.BooleanField(default=False, editable=False, verbose_name='Removed')),
                ('number_tracking', models.CharField(blank=True, max_length=128, null=True, verbose_name='Number of tracking')),
                ('status_order', models.CharField(choices=[('PE', 'Pending'), ('PA', 'Payment accepted'), ('SE', 'Sent'), ('DE', 'Delivered')], default='PE', max_length=2, verbose_name='Status')),
                ('payment_detail', models.CharField(blank=True, choices=[('TRA', 'Wire transfer'), ('CAR', 'Card'), ('CAS', 'Cash'), ('CRE', 'Credit'), ('PYP', 'Paypal'), ('30C', '30 day credit'), ('60C', '60 day credit'), ('90C', '90 day credit')], max_length=3, null=True, verbose_name='Payment detail')),
                ('source', models.CharField(blank=True, max_length=250, null=True, verbose_name='Source of purchase')),
                ('billing_series', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='order_sales', to='codenerix_invoicing.BillingSeries', verbose_name='Billing series')),
                ('budget', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='order_sales', to='codenerix_invoicing.SalesBasket', verbose_name='Budget')),
                ('customer', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='order_sales', to='codenerix_invoicing.Customer', verbose_name='Customer')),
                ('payment', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='order_sales', to='codenerix_payments.PaymentRequest', verbose_name='Payment Request')),
            ],
            options={
                'default_permissions': ('add', 'change', 'delete', 'view', 'list'),
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='SalesTicket',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', models.DateTimeField(auto_now_add=True, verbose_name='Created')),
                ('updated', models.DateTimeField(auto_now=True, verbose_name='Updated')),
                ('lock', models.BooleanField(default=False, verbose_name='Lock')),
                ('parent_pk', models.IntegerField(blank=True, null=True, verbose_name='Parent pk')),
                ('code', models.CharField(max_length=64, verbose_name='Code')),
                ('code_counter', models.IntegerField(editable=False, verbose_name='Code counter')),
                ('date', models.DateTimeField(default=django.utils.timezone.now, verbose_name='Date')),
                ('observations', models.TextField(blank=True, max_length=256, null=True, verbose_name='Observations')),
                ('subtotal', models.DecimalField(decimal_places=2, default=0, editable=False, max_digits=10, verbose_name='Subtotal')),
                ('discounts', models.FloatField(default=0, editable=False, verbose_name='Discounts')),
                ('taxes', models.FloatField(default=0, editable=False, verbose_name='Taxes')),
                ('equivalence_surcharges', models.FloatField(default=0, editable=False, verbose_name='Equivalence surcharge')),
                ('total', models.DecimalField(decimal_places=2, default=0, editable=False, max_digits=10, verbose_name='Total')),
                ('removed', models.BooleanField(default=False, editable=False, verbose_name='Removed')),
                ('billing_series', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='ticket_sales', to='codenerix_invoicing.BillingSeries', verbose_name='Billing series')),
                ('customer', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='ticket_sales', to='codenerix_invoicing.Customer', verbose_name='Customer')),
            ],
            options={
                'default_permissions': ('add', 'change', 'delete', 'view', 'list'),
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='SalesTicketRectification',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', models.DateTimeField(auto_now_add=True, verbose_name='Created')),
                ('updated', models.DateTimeField(auto_now=True, verbose_name='Updated')),
                ('lock', models.BooleanField(default=False, verbose_name='Lock')),
                ('parent_pk', models.IntegerField(blank=True, null=True, verbose_name='Parent pk')),
                ('code', models.CharField(max_length=64, verbose_name='Code')),
                ('code_counter', models.IntegerField(editable=False, verbose_name='Code counter')),
                ('date', models.DateTimeField(default=django.utils.timezone.now, verbose_name='Date')),
                ('observations', models.TextField(blank=True, max_length=256, null=True, verbose_name='Observations')),
                ('subtotal', models.DecimalField(decimal_places=2, default=0, editable=False, max_digits=10, verbose_name='Subtotal')),
                ('discounts', models.FloatField(default=0, editable=False, verbose_name='Discounts')),
                ('taxes', models.FloatField(default=0, editable=False, verbose_name='Taxes')),
                ('equivalence_surcharges', models.FloatField(default=0, editable=False, verbose_name='Equivalence surcharge')),
                ('total', models.DecimalField(decimal_places=2, default=0, editable=False, max_digits=10, verbose_name='Total')),
                ('removed', models.BooleanField(default=False, editable=False, verbose_name='Removed')),
                ('billing_series', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='ticketrectification_sales', to='codenerix_invoicing.BillingSeries', verbose_name='Billing series')),
                ('ticket', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='ticketrectification_sales', to='codenerix_invoicing.SalesTicket', verbose_name='Ticket')),
            ],
            options={
                'default_permissions': ('add', 'change', 'delete', 'view', 'list'),
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='printcounterdocumentticketrectification',
            name='ticket_rectification',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='print_counter_document_ticket_rectification', to='codenerix_invoicing.SalesTicketRectification', verbose_name='Document'),
        ),
        migrations.AddField(
            model_name='printcounterdocumentticketrectification',
            name='user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='print_counter_document_ticket_rectification', to=settings.AUTH_USER_MODEL, verbose_name='User'),
        ),
        migrations.AddField(
            model_name='printcounterdocumentticket',
            name='ticket',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='print_counter_document_ticket', to='codenerix_invoicing.SalesTicket', verbose_name='Document'),
        ),
        migrations.AddField(
            model_name='printcounterdocumentticket',
            name='user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='print_counter_document_ticket', to=settings.AUTH_USER_MODEL, verbose_name='User'),
        ),
        migrations.AddField(
            model_name='printcounterdocumentorder',
            name='order',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='print_counter_document_order', to='codenerix_invoicing.SalesOrder', verbose_name='Document'),
        ),
        migrations.AddField(
            model_name='printcounterdocumentorder',
            name='user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='print_counter_document_order', to=settings.AUTH_USER_MODEL, verbose_name='User'),
        ),
        migrations.AddField(
            model_name='printcounterdocumentinvoicerectification',
            name='invoice_rectification',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='print_counter_document_invoice_rectification', to='codenerix_invoicing.SalesInvoiceRectification', verbose_name='Document'),
        ),
        migrations.AddField(
            model_name='printcounterdocumentinvoicerectification',
            name='user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='print_counter_document_invoice_rectification', to=settings.AUTH_USER_MODEL, verbose_name='User'),
        ),
        migrations.AddField(
            model_name='printcounterdocumentinvoice',
            name='invoice',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='print_counter_document_invoice', to='codenerix_invoicing.SalesInvoice', verbose_name='Document'),
        ),
        migrations.AddField(
            model_name='printcounterdocumentinvoice',
            name='user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='print_counter_document_invoice', to=settings.AUTH_USER_MODEL, verbose_name='User'),
        ),
        migrations.AddField(
            model_name='printcounterdocumentalbaran',
            name='albaran',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='print_counter_document_albaran', to='codenerix_invoicing.SalesAlbaran', verbose_name='Document'),
        ),
        migrations.AddField(
            model_name='printcounterdocumentalbaran',
            name='user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='print_counter_document_albaran', to=settings.AUTH_USER_MODEL, verbose_name='User'),
        ),
        migrations.AlterUniqueTogether(
            name='salesticketrectification',
            unique_together=set([('code', 'parent_pk')]),
        ),
        migrations.AlterUniqueTogether(
            name='salesticket',
            unique_together=set([('code', 'parent_pk')]),
        ),
        migrations.AlterUniqueTogether(
            name='salesorder',
            unique_together=set([('code', 'parent_pk')]),
        ),
        migrations.AlterUniqueTogether(
            name='salesinvoicerectification',
            unique_together=set([('code', 'parent_pk')]),
        ),
        migrations.AlterUniqueTogether(
            name='salesinvoice',
            unique_together=set([('code', 'parent_pk')]),
        ),
        migrations.AlterUniqueTogether(
            name='salesalbaran',
            unique_together=set([('code', 'parent_pk')]),
        ),
    ]
