|
|
|
@ -490,12 +490,19 @@ def customerdetails(request, customer_id):
|
|
|
|
|
customer_active_subscriptions = OrderItem.objects.filter(active=True, order__customer=customer)
|
|
|
|
|
customer_orders = Order.objects.filter(customer=customer)
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
context = {
|
|
|
|
|
'customer': customer,
|
|
|
|
|
'customer_projects': customer_projects,
|
|
|
|
|
'customer_payments': customer_payments,
|
|
|
|
|
'customer_active_subscriptions': customer_active_subscriptions,
|
|
|
|
|
'customer_orders': customer_orders,
|
|
|
|
|
'total_all_orders': total_all_orders,
|
|
|
|
|
'total_paid_all_orders': total_paid_all_orders,
|
|
|
|
|
'total_remaining_all_orders': total_remaining_all_orders,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return render(request, 'details_templates/customer-details.html', context)
|
|
|
|
|