# Generated by Django 2.2 on 2021-08-05 07:26

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


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='AccountType',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(blank=True, max_length=255, null=True)),
                ('slug', models.CharField(blank=True, max_length=255, null=True)),
                ('parent_type', models.ForeignKey(blank=True, default=None, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='prev_item', to='accounting.AccountType')),
            ],
        ),
        migrations.CreateModel(
            name='AccountYear',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(blank=True, max_length=255, null=True)),
                ('start_date', models.DateField(blank=True, null=True)),
                ('end_date', models.DateField(blank=True, null=True)),
                ('slug', models.CharField(blank=True, max_length=255, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='Ledger',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('code', models.CharField(blank=True, max_length=255, null=True)),
                ('name', models.CharField(blank=True, max_length=255, null=True)),
                ('description', models.TextField(blank=True, null=True)),
                ('total_debit', models.DecimalField(decimal_places=2, default='0.00', max_digits=12, verbose_name='Total Debit')),
                ('total_credit', models.DecimalField(decimal_places=2, default='0.00', max_digits=12, verbose_name='Total Credit')),
                ('balance', models.DecimalField(decimal_places=2, default='0.00', max_digits=12, verbose_name='Balance')),
                ('last_update_date', models.DateField(blank=True, null=True)),
                ('account_type', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='accounting.AccountType')),
            ],
        ),
        migrations.CreateModel(
            name='Transaction',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_on', models.DateTimeField(auto_now_add=True, null=True)),
                ('modified_on', models.DateTimeField(auto_now=True)),
                ('trnsaction_type', models.CharField(blank=True, choices=[('General', 'General'), ('POS', 'POS')], max_length=32)),
                ('subject', models.CharField(blank=True, max_length=255, null=True)),
                ('ref_no', models.CharField(blank=True, max_length=255, null=True)),
                ('voucher_no', models.CharField(blank=True, max_length=255, null=True)),
                ('entry_date', models.DateField(blank=True, null=True)),
                ('post_status', models.CharField(blank=True, choices=[('pending', 'pending'), ('posted', 'posted')], max_length=32)),
                ('account_year', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='accounting.AccountYear')),
                ('created_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='transaction_createdby', to=settings.AUTH_USER_MODEL)),
                ('modified_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='transaction_modifiedby', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='TransactionDetails',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('description', models.TextField(blank=True, null=True)),
                ('vat', models.DecimalField(decimal_places=2, default='0.00', max_digits=12, verbose_name='vat(%)')),
                ('tax', models.DecimalField(decimal_places=2, default='0.00', max_digits=12, verbose_name='tax(%)')),
                ('debit', models.DecimalField(decimal_places=2, default='0.00', max_digits=12, verbose_name='Debit')),
                ('credit', models.DecimalField(decimal_places=2, default='0.00', max_digits=12, verbose_name='Credit')),
                ('currency', models.CharField(blank=True, max_length=255, null=True)),
                ('account_holder', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='hr.Employee')),
                ('ledger', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='accounting.Ledger')),
                ('transaction', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='accounting.Transaction')),
            ],
        ),
        migrations.CreateModel(
            name='JournalEntry',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('ref_no', models.CharField(blank=True, max_length=255, null=True)),
                ('debit', models.DecimalField(decimal_places=2, default='0.00', max_digits=12, verbose_name='Debit')),
                ('credit', models.DecimalField(decimal_places=2, default='0.00', max_digits=12, verbose_name='Credit')),
                ('currency', models.CharField(blank=True, max_length=255, null=True)),
                ('entry_date', models.DateField(blank=True, null=True)),
                ('transaction', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='accounting.Transaction')),
            ],
        ),
    ]
