From 09e4d4051b0957b07fe22bcf10d52a22e70ac2e3 Mon Sep 17 00:00:00 2001 From: emile Date: Tue, 17 Jun 2025 16:04:20 +0300 Subject: [PATCH] new --- .../details_templates/customer-details.html | 114 ++++++++++++++++++ osinaweb/osinacore/views.py | 4 +- 2 files changed, 117 insertions(+), 1 deletion(-) diff --git a/osinaweb/osinacore/templates/details_templates/customer-details.html b/osinaweb/osinacore/templates/details_templates/customer-details.html index decd0fa2..133cc5be 100644 --- a/osinaweb/osinacore/templates/details_templates/customer-details.html +++ b/osinaweb/osinacore/templates/details_templates/customer-details.html @@ -425,6 +425,120 @@ {% endif %} + + {% if customer_services %} +
+
+
+

Services

+
+ + +
+ +
+ + + + + + + + + +{##} +{# #} + + + + + {% for service in customer_services %} + + + + + + + + + + + + + +{# #} +{##} +{# #} + + {% endfor %} +
+ Title + + Description + + Item type + + Amount + + Recurring + #} +{# Actions#} +{#
+

{{service.title}}

+
+

${{service.description}}

+
+

{{service.item_type}}

+
+

${{service.amount}}

+
+

${{service.recurring}}

+
#} +{#
#} +{#
#} +{# #} +{# #} +{# #} +{#
#} +{#
#} +{# #} +{#
#} +{#
#} +{#
#} +{# #} +{# #} +{# #} +{#
#} +{##} +{#
#} +{# #} +{# #} +{# #} +{#
#} +{#
#} +{#
+
+
+ {% endif %} + + {% if customer_payments %}
diff --git a/osinaweb/osinacore/views.py b/osinaweb/osinacore/views.py index a6ed3600..460948f3 100644 --- a/osinaweb/osinacore/views.py +++ b/osinaweb/osinacore/views.py @@ -25,6 +25,7 @@ from django.db.models import Max from django.core.paginator import Paginator from osichat.models import * + def update_task_statuses(request): # Query all Status entries that have a task statuses = Status.objects.filter(task__isnull=False) @@ -489,7 +490,7 @@ def customerdetails(request, customer_id): customer_payments = OrderPayment.objects.filter(order__customer=customer).order_by('-id') customer_active_subscriptions = OrderItem.objects.filter(active=True, order__customer=customer) customer_orders = Order.objects.filter(customer=customer) - + customer_services = Item.objects.filter(customer=customer, type='service') total_all_orders = sum([order.get_cart_total for order in customer_orders]) total_paid_all_orders = sum([order.get_paid_amount for order in customer_orders]) total_remaining_all_orders = total_all_orders - total_paid_all_orders @@ -503,6 +504,7 @@ def customerdetails(request, customer_id): 'total_all_orders': total_all_orders, 'total_paid_all_orders': total_paid_all_orders, 'total_remaining_all_orders': total_remaining_all_orders, + 'customer_services': customer_services, } return render(request, 'details_templates/customer-details.html', context)