orders: add order type

This commit is contained in:
behruz-dev
2025-10-31 16:15:36 +05:00
parent 01fac3110e
commit 5c845917df
6 changed files with 504 additions and 3415 deletions

View File

@@ -6,6 +6,7 @@ from core.apps.orders.models import Order
@admin.register(Order)
class OrderAdmin(admin.ModelAdmin):
list_display = ['id', 'product', 'wherehouse', 'currency', 'counterparty']
list_filter = ['counterparty']
# # Statuslar: {'ORDERED', 'PARTIALLY_RECIEVED', 'pending', "open", "buying", "rejected", "recieved", "passive"}
# open -> yangi == NEW

View File

@@ -52,7 +52,8 @@ class Command(BaseCommand):
quantity=item['quantity'],
currency=item['currency']['symbol'].lower(),
created_at=created_at,
date=delivery_date
date=delivery_date,
type='order'
)
# break

View File

@@ -99,6 +99,7 @@ class Command(BaseCommand):
project_folder=project_folder,
wherehouse=wherehouse,
counterparty=counterparty,
type='party',
)
total_price += i["total_amount"]
paid_amount += i["paid_amount"]

View File

@@ -83,6 +83,7 @@ class MultipleOrderCreateSerializer(serializers.Serializer):
quantity=resource['quantity'],
date=common_date,
employee=self.context.get('user'),
type='order',
)
orders.append(order)
body = f"""{user.full_name} {order.project_folder.name} uchun {order.wherehouse.name} ombor ga {order.quantity} {order.unity.value} {order.product.name} ga buyurtma berdi. Buyurtma yetkazish sanasi {common_date}

View File

@@ -62,6 +62,7 @@ class PartyCreateSerializer(serializers.Serializer):
qqs_price=resource.get("qqs_price"),
total_price=resource.get("total_price"),
qqs=resource.get("qqs"),
type="party"
)
)
if resource.get("currency") == "usd":

3912
order.json

File diff suppressed because it is too large Load Diff