From 9e069858937cc557a13bdae906fbe62cfc43d921 Mon Sep 17 00:00:00 2001 From: Mojtaba-z Date: Sun, 28 Sep 2025 13:38:35 +0330 Subject: [PATCH] add new fields (trans-date, pos-date, rancher) --- ...yquotasaletransaction_pos_date_and_more.py | 33 +++++++++++++++++++ apps/warehouse/models.py | 4 +++ 2 files changed, 37 insertions(+) create mode 100644 apps/warehouse/migrations/0035_inventoryquotasaletransaction_pos_date_and_more.py diff --git a/apps/warehouse/migrations/0035_inventoryquotasaletransaction_pos_date_and_more.py b/apps/warehouse/migrations/0035_inventoryquotasaletransaction_pos_date_and_more.py new file mode 100644 index 0000000..85c007e --- /dev/null +++ b/apps/warehouse/migrations/0035_inventoryquotasaletransaction_pos_date_and_more.py @@ -0,0 +1,33 @@ +# Generated by Django 5.0 on 2025-09-28 10:07 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('warehouse', '0034_inventoryquotasaleitem_livestock_statistic'), + ] + + operations = [ + migrations.AddField( + model_name='inventoryquotasaletransaction', + name='pos_date', + field=models.PositiveBigIntegerField(default=0), + ), + migrations.AddField( + model_name='inventoryquotasaletransaction', + name='rancher_fullname', + field=models.CharField(max_length=150, null=True), + ), + migrations.AddField( + model_name='inventoryquotasaletransaction', + name='rancher_mobile', + field=models.CharField(max_length=25, null=True), + ), + migrations.AddField( + model_name='inventoryquotasaletransaction', + name='transaction_date', + field=models.DateTimeField(auto_now_add=True, null=True), + ), + ] diff --git a/apps/warehouse/models.py b/apps/warehouse/models.py index ffe0ff9..e625f19 100644 --- a/apps/warehouse/models.py +++ b/apps/warehouse/models.py @@ -64,6 +64,8 @@ class InventoryQuotaSaleTransaction(BaseModel): related_name='transactions', null=True ) + rancher_fullname = models.CharField(max_length=150, null=True) + rancher_mobile = models.CharField(max_length=25, null=True) pos_device = models.ForeignKey( Device, on_delete=models.CASCADE, @@ -119,6 +121,8 @@ class InventoryQuotaSaleTransaction(BaseModel): ref_num = models.CharField(max_length=50, null=True) terminal = models.CharField(max_length=50, null=True) payer_cart = models.CharField(max_length=50, null=True) + pos_date = models.PositiveBigIntegerField(default=0) + transaction_date = models.DateTimeField(auto_now_add=True, null=True) free_sale_state = models.BooleanField(default=False) pre_sale_state = models.BooleanField(default=False) additional = models.JSONField(default=dict)