35611-vm/core/views.py
Flatlogic Bot cc56417940 v1
2025-11-10 06:29:01 +00:00

19 lines
605 B
Python

from django.shortcuts import render
from django.utils import timezone
import decimal
def index(request):
"""Render the main analytics dashboard."""
# Dummy data for the dashboard cards
total_spend_ytd = decimal.Decimal('125432.50')
total_invoices = 1342
avg_invoice_value = total_spend_ytd / total_invoices if total_invoices > 0 else 0
context = {
'total_spend_ytd': total_spend_ytd,
'total_invoices': total_invoices,
'documents_uploaded': 1500,
'avg_invoice_value': avg_invoice_value,
}
return render(request, 'core/index.html', context)