# Generated by Django 2.0.6 on 2018-06-24 20:59

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import mptt.fields


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('document', '0001_initial'),
        ('client', '0001_initial'),
        ('accounting', '0001_initial'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('core', '0001_initial'),
    ]

    operations = [
        migrations.AddField(
            model_name='transactiontype',
            name='author',
            field=models.ForeignKey(blank=True, editable=False, null=True, on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='transactiontype',
            name='inverse_transaction_type',
            field=models.ForeignKey(blank=True, db_column='inverse_transaction_type', null=True, on_delete=django.db.models.deletion.PROTECT, to='accounting.TransactionType'),
        ),
        migrations.AddField(
            model_name='gltransaction',
            name='gl_account_type',
            field=models.ForeignKey(blank=True, db_column='gl_account_type', null=True, on_delete=django.db.models.deletion.PROTECT, to='accounting.GLAccountType'),
        ),
        migrations.AddField(
            model_name='gltransaction',
            name='transaction',
            field=models.ForeignKey(blank=True, db_column='gl_transaction', null=True, on_delete=django.db.models.deletion.PROTECT, to='accounting.AccountTransaction'),
        ),
        migrations.AddField(
            model_name='glbalance',
            name='client',
            field=models.ForeignKey(blank=True, db_column='client', null=True, on_delete=django.db.models.deletion.PROTECT, to='client.Client'),
        ),
        migrations.AddField(
            model_name='glbalance',
            name='gl_account_type',
            field=models.ForeignKey(blank=True, db_column='gl_account_type', null=True, on_delete=django.db.models.deletion.PROTECT, to='accounting.GLAccountType'),
        ),
        migrations.AddField(
            model_name='glbalance',
            name='last_transaction',
            field=models.ForeignKey(blank=True, db_column='last_gl_transaction', null=True, on_delete=django.db.models.deletion.PROTECT, to='accounting.GLTransaction'),
        ),
        migrations.AddField(
            model_name='glaccounttype',
            name='author',
            field=models.ForeignKey(blank=True, editable=False, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='glaccounttype',
            name='parent',
            field=mptt.fields.TreeForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='children', to='accounting.GLAccountType'),
        ),
        migrations.AddField(
            model_name='accounttype',
            name='author',
            field=models.ForeignKey(blank=True, editable=False, null=True, on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='accounttransaction',
            name='account_document',
            field=models.ForeignKey(blank=True, db_column='account_document', null=True, on_delete=django.db.models.deletion.PROTECT, to='accounting.AccountDocument'),
        ),
        migrations.AddField(
            model_name='accounttransaction',
            name='account_type',
            field=models.ForeignKey(blank=True, db_column='account_type', null=True, on_delete=django.db.models.deletion.PROTECT, to='accounting.AccountType'),
        ),
        migrations.AddField(
            model_name='accounttransaction',
            name='balance',
            field=models.ForeignKey(blank=True, db_column='balance', null=True, on_delete=django.db.models.deletion.PROTECT, to='accounting.AccountBalance'),
        ),
        migrations.AddField(
            model_name='accounttransaction',
            name='client',
            field=models.ForeignKey(blank=True, db_column='client', null=True, on_delete=django.db.models.deletion.PROTECT, to='client.Client'),
        ),
        migrations.AddField(
            model_name='accounttransaction',
            name='concept_type',
            field=models.ForeignKey(blank=True, db_column='concept_type', null=True, on_delete=django.db.models.deletion.PROTECT, to='core.ConceptType'),
        ),
        migrations.AddField(
            model_name='accounttransaction',
            name='currency',
            field=models.ForeignKey(blank=True, db_column='currency', null=True, on_delete=django.db.models.deletion.PROTECT, to='core.Currency'),
        ),
        migrations.AddField(
            model_name='accounttransaction',
            name='document',
            field=models.ForeignKey(blank=True, db_column='document', null=True, on_delete=django.db.models.deletion.PROTECT, to='document.DocumentHeader'),
        ),
        migrations.AddField(
            model_name='accounttransaction',
            name='transaction_type',
            field=models.ForeignKey(blank=True, db_column='transaction_type', null=True, on_delete=django.db.models.deletion.PROTECT, to='accounting.TransactionType'),
        ),
        migrations.AddField(
            model_name='accountrule',
            name='account_type',
            field=models.ForeignKey(blank=True, db_column='account_type', null=True, on_delete=django.db.models.deletion.PROTECT, to='accounting.AccountType'),
        ),
        migrations.AddField(
            model_name='accountrule',
            name='author',
            field=models.ForeignKey(blank=True, editable=False, null=True, on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='accountrule',
            name='concept_type',
            field=models.ForeignKey(blank=True, db_column='concept_type', null=True, on_delete=django.db.models.deletion.PROTECT, to='core.ConceptType'),
        ),
        migrations.AddField(
            model_name='accountrule',
            name='fixed_client',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='client.Client'),
        ),
        migrations.AddField(
            model_name='accountrule',
            name='form_definition',
            field=models.ForeignKey(db_column='form_definition', on_delete=django.db.models.deletion.PROTECT, related_name='account_rule_set', to='document.FormDefinition'),
        ),
        migrations.AddField(
            model_name='accountrule',
            name='transaction_type',
            field=models.ForeignKey(db_column='transaction_type', on_delete=django.db.models.deletion.PROTECT, to='accounting.TransactionType'),
        ),
        migrations.AddField(
            model_name='accountdocument',
            name='document',
            field=models.OneToOneField(db_column='document_header', on_delete=django.db.models.deletion.PROTECT, to='document.DocumentHeader'),
        ),
        migrations.AddField(
            model_name='accountbalance',
            name='account_type',
            field=models.ForeignKey(db_column='account_type', on_delete=django.db.models.deletion.PROTECT, to='accounting.AccountType'),
        ),
        migrations.AddField(
            model_name='accountbalance',
            name='base_document',
            field=models.ForeignKey(blank=True, db_column='base_document', null=True, on_delete=django.db.models.deletion.PROTECT, related_name='account_document_base_document_set', to='document.DocumentHeader'),
        ),
        migrations.AddField(
            model_name='accountbalance',
            name='client',
            field=models.ForeignKey(db_column='client', on_delete=django.db.models.deletion.PROTECT, to='client.Client'),
        ),
        migrations.AddField(
            model_name='accountbalance',
            name='compliance_document',
            field=models.ForeignKey(blank=True, db_column='compliance_document', null=True, on_delete=django.db.models.deletion.PROTECT, related_name='account_document_compliance_document_set', to='document.DocumentHeader'),
        ),
        migrations.AddField(
            model_name='accountbalance',
            name='concept_type',
            field=models.ForeignKey(blank=True, db_column='concept_type', null=True, on_delete=django.db.models.deletion.PROTECT, to='core.ConceptType'),
        ),
        migrations.AddField(
            model_name='accountbalance',
            name='default_currency',
            field=models.ForeignKey(blank=True, db_column='default_currency', null=True, on_delete=django.db.models.deletion.PROTECT, to='core.Currency'),
        ),
        migrations.AlterUniqueTogether(
            name='accountbalance',
            unique_together={('client', 'concept_type', 'period', 'account_type')},
        ),
    ]
