# Generated by Django 4.2.30 on 2026-09-26 11:13

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 = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('myapp', '0018_attendance_location_profiles_geostatus_leaverequests'),
    ]

    operations = [
        migrations.CreateModel(
            name='Fee',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('service', models.CharField(choices=[('GST Filing', 'GST Filing'), ('GST Renewal', 'GST Renewal'), ('IT Filing', 'IT Filing'), ('IT Filing Renewal', 'IT Filing Renewal'), ('TDS Filing', 'TDS Filing'), ('ROC Filing', 'ROC Filing'), ('Trademark', 'Trademark'), ('Insurance', 'Insurance'), ('Other', 'Other')], default='GST Filing', max_length=50)),
                ('service_other', models.CharField(blank=True, max_length=100, null=True)),
                ('fee_amount', models.DecimalField(decimal_places=2, default=0.0, max_digits=10)),
                ('billing_frequency', models.CharField(choices=[('Monthly', 'Monthly'), ('Quarterly', 'Quarterly'), ('Yearly', 'Yearly'), ('One-Time', 'One-Time')], default='Monthly', max_length=20)),
                ('due_date', models.DateField()),
                ('next_due_date', models.DateField(blank=True, null=True)),
                ('paid_amount', models.DecimalField(decimal_places=2, default=0.0, max_digits=10)),
                ('balance', models.DecimalField(decimal_places=2, default=0.0, max_digits=10)),
                ('payment_status', models.CharField(choices=[('Paid', 'Paid'), ('Pending', 'Pending'), ('Partial', 'Partial')], default='Pending', max_length=10)),
                ('notes', models.TextField(blank=True, null=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
            ],
            options={
                'db_table': 'fees',
                'ordering': ['-due_date'],
            },
        ),
        migrations.CreateModel(
            name='FeePayment',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('amount', models.DecimalField(decimal_places=2, max_digits=10)),
                ('payment_date', models.DateField(default=django.utils.timezone.now)),
                ('payment_mode', models.CharField(choices=[('Cash', 'Cash'), ('UPI', 'UPI'), ('Bank Transfer', 'Bank Transfer'), ('Cheque', 'Cheque'), ('Other', 'Other')], default='Cash', max_length=20)),
                ('reference_no', models.CharField(blank=True, max_length=100, null=True)),
                ('note', models.CharField(blank=True, max_length=255, null=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('collected_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='fee_payments_collected', to='myapp.employee')),
                ('fee', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='payments', to='myapp.fee')),
            ],
            options={
                'db_table': 'fee_payments',
                'ordering': ['-payment_date', '-created_at'],
            },
        ),
        migrations.CreateModel(
            name='FeeClient',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255)),
                ('mobile', models.CharField(blank=True, max_length=15, null=True)),
                ('address', models.TextField(blank=True, null=True)),
                ('gst_number', models.CharField(blank=True, max_length=20, null=True)),
                ('status', models.SmallIntegerField(default=1)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('created_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='fee_clients_created_by', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'db_table': 'fee_clients',
                'ordering': ['name'],
            },
        ),
        migrations.AddField(
            model_name='fee',
            name='client',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='fees', to='myapp.feeclient'),
        ),
        migrations.AddField(
            model_name='fee',
            name='created_by',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='fees_created_by', to='myapp.employee'),
        ),
    ]
