# Generated by Django 3.2.6 on 2021-08-21 19:53

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='OrderRequisitions',
            fields=[
                ('list_id', models.CharField(max_length=20, primary_key=True, serialize=False)),
                ('supplier_name', models.CharField(max_length=255)),
                ('created_employee', models.CharField(max_length=20)),
            ],
        ),
        migrations.CreateModel(
            name='PurchaseOrders',
            fields=[
                ('order_id', models.CharField(max_length=20, primary_key=True, serialize=False)),
                ('supplier_name', models.CharField(max_length=255)),
                ('shipping_method', models.CharField(max_length=200)),
                ('grand_total', models.DecimalField(decimal_places=2, max_digits=13)),
            ],
        ),
        migrations.CreateModel(
            name='Suppliers',
            fields=[
                ('supplier_id', models.CharField(max_length=10, primary_key=True, serialize=False)),
                ('supplier_name', models.CharField(max_length=255)),
                ('license_no', models.CharField(max_length=15)),
                ('email', models.EmailField(max_length=255)),
                ('phone', models.CharField(max_length=15)),
                ('organization_type', models.CharField(max_length=255)),
                ('bank', models.CharField(max_length=255)),
                ('branch', models.CharField(max_length=255)),
            ],
        ),
        migrations.CreateModel(
            name='Items',
            fields=[
                ('row_id', models.IntegerField(primary_key=True, serialize=False)),
                ('list_type', models.CharField(choices=[('requisitions', 'requisition'), ('deficiencyLists', 'deficiency list')], default='requisitions', max_length=255)),
                ('item_id', models.CharField(max_length=20)),
                ('item_description', models.CharField(max_length=150)),
                ('unit_price', models.DecimalField(decimal_places=2, max_digits=13, null=True)),
                ('amount', models.DecimalField(decimal_places=2, max_digits=13, null=True)),
                ('list_id', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='SupplierManagement.orderrequisitions')),
            ],
        ),
        migrations.CreateModel(
            name='Invoices',
            fields=[
                ('invoice_id', models.CharField(max_length=20, primary_key=True, serialize=False)),
                ('sub_total', models.DecimalField(decimal_places=2, max_digits=9)),
                ('tax', models.DecimalField(decimal_places=2, max_digits=10)),
                ('discount', models.CharField(max_length=10)),
                ('grand_total', models.DecimalField(decimal_places=2, max_digits=13)),
                ('payment_term', models.CharField(max_length=200)),
                ('payment_method', models.CharField(max_length=200)),
                ('order_id', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='SupplierManagement.purchaseorders')),
                ('supplier_id', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='SupplierManagement.suppliers')),
            ],
        ),
        migrations.CreateModel(
            name='OrderRequisitionInvoice',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('invoice_id', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='SupplierManagement.invoices')),
                ('list_id', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='SupplierManagement.orderrequisitions')),
                ('order_id', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='SupplierManagement.purchaseorders')),
            ],
            options={
                'unique_together': {('list_id', 'invoice_id', 'order_id')},
            },
        ),
    ]
