# Generated by Django 4.2.23 on 2025-08-21 02:29 from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ("inventory", "0001_initial"), migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ migrations.CreateModel( name="GoodsReceipt", fields=[ ( "id", models.BigAutoField( auto_created=True, primary_key=True, serialize=False, verbose_name="ID", ), ), ("gr_number", models.CharField(max_length=50, unique=True)), ("receipt_date", models.DateField()), ("notes", models.TextField(blank=True)), ("created_at", models.DateTimeField(auto_now_add=True)), ], ), migrations.CreateModel( name="PurchaseOrder", fields=[ ( "id", models.BigAutoField( auto_created=True, primary_key=True, serialize=False, verbose_name="ID", ), ), ("po_number", models.CharField(max_length=50, unique=True)), ("order_date", models.DateField()), ("expected_delivery_date", models.DateField(blank=True, null=True)), ( "status", models.CharField( choices=[ ("ordered", "Ordered"), ("completed", "Completed"), ("cancelled", "Cancelled"), ], default="ordered", max_length=20, ), ), ( "subtotal", models.DecimalField(decimal_places=2, default=0, max_digits=12), ), ( "tax_amount", models.DecimalField(decimal_places=2, default=0, max_digits=12), ), ( "total_amount", models.DecimalField(decimal_places=2, default=0, max_digits=12), ), ("notes", models.TextField(blank=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, to=settings.AUTH_USER_MODEL, ), ), ], ), migrations.CreateModel( name="Supplier", fields=[ ( "id", models.BigAutoField( auto_created=True, primary_key=True, serialize=False, verbose_name="ID", ), ), ("code", models.CharField(max_length=50, unique=True)), ("name", models.CharField(max_length=200)), ("contact_person", models.CharField(blank=True, max_length=100)), ("email", models.EmailField(blank=True, max_length=254)), ("phone", models.CharField(blank=True, max_length=20)), ("address", models.TextField(blank=True)), ("tax_id", models.CharField(blank=True, max_length=50)), ("payment_terms", models.CharField(blank=True, max_length=100)), ("is_active", models.BooleanField(default=True)), ("created_at", models.DateTimeField(auto_now_add=True)), ("updated_at", models.DateTimeField(auto_now=True)), ], ), migrations.CreateModel( name="PurchaseOrderItem", fields=[ ( "id", models.BigAutoField( auto_created=True, primary_key=True, serialize=False, verbose_name="ID", ), ), ("quantity", models.DecimalField(decimal_places=2, max_digits=10)), ("unit_price", models.DecimalField(decimal_places=2, max_digits=10)), ("total_price", models.DecimalField(decimal_places=2, max_digits=12)), ( "received_quantity", models.DecimalField(decimal_places=2, default=0, max_digits=10), ), ( "po", models.ForeignKey( on_delete=django.db.models.deletion.CASCADE, related_name="items", to="purchasing.purchaseorder", ), ), ( "product", models.ForeignKey( on_delete=django.db.models.deletion.CASCADE, to="inventory.product", ), ), ], ), migrations.AddField( model_name="purchaseorder", name="supplier", field=models.ForeignKey( on_delete=django.db.models.deletion.CASCADE, to="purchasing.supplier" ), ), migrations.CreateModel( name="GoodsReceiptItem", fields=[ ( "id", models.BigAutoField( auto_created=True, primary_key=True, serialize=False, verbose_name="ID", ), ), ( "received_quantity", models.DecimalField(decimal_places=2, max_digits=10), ), ("notes", models.TextField(blank=True)), ( "po_item", models.ForeignKey( on_delete=django.db.models.deletion.CASCADE, to="purchasing.purchaseorderitem", ), ), ( "receipt", models.ForeignKey( on_delete=django.db.models.deletion.CASCADE, related_name="items", to="purchasing.goodsreceipt", ), ), ], ), migrations.AddField( model_name="goodsreceipt", name="po", field=models.ForeignKey( on_delete=django.db.models.deletion.CASCADE, to="purchasing.purchaseorder", ), ), migrations.AddField( model_name="goodsreceipt", name="received_by", field=models.ForeignKey( null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL, ), ), ]