# Generated by Django 4.1.7 on 2025-07-14 14:59

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    dependencies = [
        ('humanresource', '0002_alter_attachment_name_alter_employment_tin_number'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('inventory', '0049_alter_doctorcommission_doctor_and_more'),
    ]

    operations = [
        migrations.CreateModel(
            name='SupplierAccount',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('tx_date', models.DateField(auto_now=True)),
                ('tx_number', models.CharField(max_length=191, unique=True)),
                ('details', models.CharField(default='Details', max_length=191)),
                ('previous_balance', models.DecimalField(decimal_places=2, default=0, max_digits=10)),
                ('credit', models.DecimalField(decimal_places=2, default=0, max_digits=10)),
                ('debit', models.DecimalField(decimal_places=2, default=0, max_digits=10)),
                ('current_balance', models.DecimalField(decimal_places=2, default=0, max_digits=10)),
                ('created_at', models.DateTimeField(auto_now_add=True, null=True)),
                ('updated_at', models.DateTimeField(auto_now=True, null=True)),
                ('created_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='supplier_accounts_created', to=settings.AUTH_USER_MODEL)),
                ('supplier', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='inventory.supplier')),
                ('updated_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='supplier_accounts_updated', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': 'Supplier Account',
                'verbose_name_plural': 'Supplier Accounts',
            },
        ),
        migrations.CreateModel(
            name='Payment_To_Supplier',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('paid_from', models.CharField(choices=[('C/H', 'CASH IN HAND'), ('C/B', 'CASH IN BANK')], default='C/H', max_length=3)),
                ('amount_paid', models.DecimalField(decimal_places=2, default=0, max_digits=10)),
                ('remain_amount', models.DecimalField(decimal_places=2, default=0, max_digits=10)),
                ('receipt_no', models.CharField(blank=True, max_length=191, null=True)),
                ('remarks', models.TextField(blank=True, null=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('created_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='supplier_payment_created', to=settings.AUTH_USER_MODEL)),
                ('paid_by', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='humanresource.employment')),
                ('supplier', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='inventory.supplier')),
                ('updated_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='supplier_payment_updated', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': 'Supplier Payment',
                'verbose_name_plural': 'Supplier Payments',
            },
        ),
    ]
