diff --git a/.gitignore b/.gitignore index 9614c9e..91f40d7 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,5 @@ __pycache__ __pycache__/ venv/ env/ -*/migrations/ postgres_data/ !.env.sample \ No newline at end of file diff --git a/cart/migrations/0001_initial.py b/cart/migrations/0001_initial.py new file mode 100644 index 0000000..cb40ebd --- /dev/null +++ b/cart/migrations/0001_initial.py @@ -0,0 +1,29 @@ +# Generated by Django 4.1 on 2024-04-10 23:53 + +import colorfield.fields +from django.db import migrations, models + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ] + + operations = [ + migrations.CreateModel( + name='displayed_items', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('barcode', models.CharField(max_length=16, unique=True)), + ('display_name', models.CharField(max_length=125)), + ('display_info', models.CharField(blank=True, default='', max_length=125)), + ('display_color', colorfield.fields.ColorField(default='#575757', image_field=None, max_length=18, samples=None)), + ('variable_price', models.BooleanField()), + ], + options={ + 'verbose_name_plural': 'Displayed Item', + }, + ), + ] diff --git a/cart/migrations/__init__.py b/cart/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/inventory/migrations/0001_initial.py b/inventory/migrations/0001_initial.py new file mode 100644 index 0000000..ee5cbd7 --- /dev/null +++ b/inventory/migrations/0001_initial.py @@ -0,0 +1,64 @@ +# Generated by Django 4.1 on 2024-04-10 23:53 + +import django.core.validators +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ] + + operations = [ + migrations.CreateModel( + name='department', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('department_name', models.CharField(max_length=32, unique=True)), + ('department_desc', models.TextField(blank=True)), + ('department_slug', models.SlugField(blank=True, max_length=32, unique=True)), + ], + ), + migrations.CreateModel( + name='deposit', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('deposit_category', models.CharField(max_length=32, unique=True)), + ('deposit_desc', models.TextField(blank=True)), + ('deposit_value', models.DecimalField(decimal_places=2, max_digits=7)), + ], + options={ + 'verbose_name_plural': 'Deposit Information', + }, + ), + migrations.CreateModel( + name='tax', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('tax_category', models.CharField(max_length=32, unique=True)), + ('tax_desc', models.TextField(blank=True)), + ('tax_percentage', models.DecimalField(decimal_places=3, max_digits=6, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(100)])), + ], + options={ + 'verbose_name_plural': 'Tax Information', + }, + ), + migrations.CreateModel( + name='product', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('barcode', models.CharField(max_length=16, unique=True)), + ('name', models.CharField(max_length=125)), + ('sales_price', models.DecimalField(decimal_places=2, max_digits=7)), + ('qty', models.IntegerField(default=0)), + ('cost_price', models.DecimalField(decimal_places=2, default=0, max_digits=7)), + ('product_desc', models.TextField(blank=True, null=True)), + ('department', models.ForeignKey(on_delete=django.db.models.deletion.RESTRICT, to='inventory.department')), + ('deposit_category', models.ForeignKey(on_delete=django.db.models.deletion.RESTRICT, to='inventory.deposit')), + ('tax_category', models.ForeignKey(on_delete=django.db.models.deletion.RESTRICT, to='inventory.tax')), + ], + ), + ] diff --git a/inventory/migrations/__init__.py b/inventory/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/transaction/migrations/0001_initial.py b/transaction/migrations/0001_initial.py new file mode 100644 index 0000000..d1fd5da --- /dev/null +++ b/transaction/migrations/0001_initial.py @@ -0,0 +1,63 @@ +# Generated by Django 4.1 on 2024-04-10 23:53 + +from django.conf import settings +import django.core.validators +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), + ] + + operations = [ + migrations.CreateModel( + name='transaction', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('date_time', models.DateTimeField(auto_now_add=True)), + ('transaction_dt', models.DateTimeField(editable=False)), + ('transaction_id', models.CharField(editable=False, max_length=50, unique=True)), + ('total_sale', models.DecimalField(decimal_places=2, editable=False, max_digits=7)), + ('sub_total', models.DecimalField(decimal_places=2, editable=False, max_digits=7)), + ('tax_total', models.DecimalField(decimal_places=2, editable=False, max_digits=7, null=True)), + ('deposit_total', models.DecimalField(decimal_places=2, editable=False, max_digits=7, null=True)), + ('payment_type', models.CharField(choices=[('CASH', 'CASH'), ('DEBIT/CREDIT', 'DEBIT/CREDIT'), ('EBT', 'EBT')], editable=False, max_length=32)), + ('receipt', models.TextField(editable=False)), + ('products', models.TextField(editable=False)), + ('user', models.ForeignKey(editable=False, on_delete=django.db.models.deletion.RESTRICT, to=settings.AUTH_USER_MODEL)), + ], + options={ + 'verbose_name_plural': 'Transactions', + }, + ), + migrations.CreateModel( + name='productTransaction', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('transaction_id_num', models.CharField(editable=False, max_length=50)), + ('transaction_date_time', models.DateTimeField(editable=False)), + ('barcode', models.CharField(editable=False, max_length=32)), + ('name', models.CharField(editable=False, max_length=125)), + ('department', models.CharField(editable=False, max_length=125, null=True)), + ('sales_price', models.DecimalField(decimal_places=2, editable=False, max_digits=7)), + ('qty', models.IntegerField(default=0, editable=False, null=True)), + ('cost_price', models.DecimalField(decimal_places=2, default=0, editable=False, max_digits=7, null=True)), + ('tax_category', models.CharField(editable=False, max_length=125)), + ('tax_percentage', models.DecimalField(decimal_places=3, max_digits=6, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(100)])), + ('tax_amount', models.DecimalField(decimal_places=2, default=0, editable=False, max_digits=7, null=True)), + ('deposit_category', models.CharField(editable=False, max_length=125)), + ('deposit', models.DecimalField(decimal_places=2, max_digits=7)), + ('deposit_amount', models.DecimalField(decimal_places=2, default=0, editable=False, max_digits=7, null=True)), + ('payment_type', models.CharField(editable=False, max_length=32)), + ('transaction', models.ForeignKey(editable=False, on_delete=django.db.models.deletion.RESTRICT, to='transaction.transaction')), + ], + options={ + 'verbose_name_plural': 'Product Transactions', + }, + ), + ] diff --git a/transaction/migrations/__init__.py b/transaction/migrations/__init__.py new file mode 100644 index 0000000..e69de29