add - filter on transaction dashboard

This commit is contained in:
2025-11-29 10:43:38 +03:30
parent e4eaba2dcd
commit 8ad5687942
4 changed files with 30 additions and 5 deletions

View File

@@ -230,9 +230,20 @@ class InventoryQuotaSaleTransactionViewSet(
"""
dashboard of full detail of all my transactions
"""
query_param = self.request.query_params # noqa
start_date = query_param.get('start') if 'start' in query_param.keys() else None
end_date = query_param.get('end') if 'end' in query_param.keys() else None
transaction_status = query_param.get('status') if 'status' in query_param.keys() else None
org = get_organization_by_user(request.user)
transaction_dashboard_data = self.get_dashboard(org)
# filer by date & transaction status
transaction_dashboard_data = self.get_dashboard(
org,
start_date=start_date,
end_date=end_date,
status=transaction_status
)
return Response(transaction_dashboard_data, status=status.HTTP_200_OK)