emile 1 week ago
parent ea880caf78
commit 2a1d580a73

@ -24,6 +24,14 @@
</div>
{% endif %}
<div class="w-full h-fit flex justify-start items-center bg-gray-100 shadow-md rounded-md px-3 py-3 mt-3">
<div>Total: ${{ total_all_orders }}</div>
<div>Paid: ${{ total_paid_all_orders }}</div>
<div>Remaining: ${{ total_remaining_all_orders }}</div>
</div>
<div class="w-full h-fit flex justify-end items-center bg-gray-100 shadow-md rounded-md px-3 py-3 mt-3">
<div class="w-full md:w-fit flex flex-col md:flex-row justify-end items-center gap-3">
<button

@ -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)

Loading…
Cancel
Save