This commit is contained in:
behruz-dev
2025-10-31 17:44:31 +05:00
parent 30b0f5f50a
commit 1f254464aa

View File

@@ -34,10 +34,11 @@ class InventoryListApiView(generics.GenericAPIView):
inventories = inventories.filter(project_folder__in=project_folder_ids) inventories = inventories.filter(project_folder__in=project_folder_ids)
if project_ids: if project_ids:
inventories = inventories.filter(project__in=project_ids) inventories = inventories.filter(project__in=project_ids)
if product_exists.lower() == 'true': if product_exists:
inventories = inventories.exclude(quantity__lte=0) if product_exists.lower() == 'true':
elif product_exists.lower() == 'false': inventories = inventories.exclude(quantity__lte=0)
inventories = inventories.filter(quantity__lte=0) elif product_exists.lower() == 'false':
inventories = inventories.filter(quantity__lte=0)
if start_date and end_date: if start_date and end_date:
inventories = inventories.filter(created_at__range=(start_date, end_date)) inventories = inventories.filter(created_at__range=(start_date, end_date))
page = self.paginate_queryset(inventories) page = self.paginate_queryset(inventories)