From dcb352d6c3af5a60aba715ecc340e35695c593c0 Mon Sep 17 00:00:00 2001 From: A R R R Associates Date: Mon, 6 Jul 2026 11:20:37 +0530 Subject: [PATCH] Upgrade client dashboard to v2 grouped ajax portal --- .../templates/clients/portal_dashboard.html | 18 +++++------ .../portal_partials/action_centre.html | 12 ++++++++ .../portal_partials/billing_messages.html | 11 +++++++ .../clients/portal_partials/overview.html | 30 +++++++++++-------- .../portal_partials/services_documents.html | 14 +++++++++ app/modules/clients/ui.py | 6 ++-- 6 files changed, 68 insertions(+), 23 deletions(-) create mode 100644 app/modules/clients/templates/clients/portal_partials/action_centre.html create mode 100644 app/modules/clients/templates/clients/portal_partials/billing_messages.html create mode 100644 app/modules/clients/templates/clients/portal_partials/services_documents.html diff --git a/app/modules/clients/templates/clients/portal_dashboard.html b/app/modules/clients/templates/clients/portal_dashboard.html index e262a16..b62489e 100644 --- a/app/modules/clients/templates/clients/portal_dashboard.html +++ b/app/modules/clients/templates/clients/portal_dashboard.html @@ -6,13 +6,14 @@

Client Portal

-

My Compliance & Firm Communication

-

Track pending actions, service status, documents, messages, bills and firm updates from one place.

+

My Compliance Workspace

+

View pending actions, service progress, documents, invoices, payments and firm messages from one clean dashboard.

{% if client_row %} - Update My Profile - Upload Documents + Upload Documents + Messages + Profile {% endif %}
@@ -25,11 +26,9 @@ {% else %} {% set client_tabs = [ ('overview','Overview'), - ('pending','Pending From Me'), - ('services','Services'), - ('documents','Documents'), - ('billing','Invoices & Payments'), - ('messages','Messages'), + ('action-centre','Action Centre'), + ('services-documents','Services & Documents'), + ('billing-messages','Billing & Messages'), ('reports','Reports') ] %} @@ -76,6 +75,7 @@ } } + window.loadClientDashboardTab = loadTab; buttons.forEach((btn) => btn.addEventListener('click', () => loadTab(btn.dataset.tab || 'overview'))); })(); diff --git a/app/modules/clients/templates/clients/portal_partials/action_centre.html b/app/modules/clients/templates/clients/portal_partials/action_centre.html new file mode 100644 index 0000000..eca8f72 --- /dev/null +++ b/app/modules/clients/templates/clients/portal_partials/action_centre.html @@ -0,0 +1,12 @@ +
+
+ + +
Documents
{{ recent_documents|length if recent_documents else 0 }}
Recent uploads / shared files
+
+ +
+
{% include "modules/clients/templates/clients/portal_partials/pending.html" %}
+
{% include "modules/clients/templates/clients/portal_partials/messages.html" %}
+
+
diff --git a/app/modules/clients/templates/clients/portal_partials/billing_messages.html b/app/modules/clients/templates/clients/portal_partials/billing_messages.html new file mode 100644 index 0000000..8bc6401 --- /dev/null +++ b/app/modules/clients/templates/clients/portal_partials/billing_messages.html @@ -0,0 +1,11 @@ +
+
+ +
Total Bills
{{ billing_total_count or 0 }}
Invoices & receipts
+ +
+
+
{% include "modules/clients/templates/clients/portal_partials/billing.html" %}
+
{% include "modules/clients/templates/clients/portal_partials/messages.html" %}
+
+
diff --git a/app/modules/clients/templates/clients/portal_partials/overview.html b/app/modules/clients/templates/clients/portal_partials/overview.html index 49a6abb..679d12f 100644 --- a/app/modules/clients/templates/clients/portal_partials/overview.html +++ b/app/modules/clients/templates/clients/portal_partials/overview.html @@ -1,16 +1,19 @@
-
Active Services
{{ total_engagements or 0 }}
Services / filings
- -
With Firm
{{ with_firm or 0 }}
Being handled
-
Recent Documents
{{ recent_documents|length if recent_documents else 0 }}
Latest documents
-
Outstanding Bills
₹ {{ '%.2f'|format(billing_outstanding_amount or 0) }}
{{ billing_open_count or 0 }} open bill(s)
+
Active Services
{{ total_engagements or 0 }}
Services handled by firm
+ +
With Firm
{{ with_firm or 0 }}
Being processed
+ +
-

Needs Your Attention

Open items where the firm may need documents, replies or confirmation from you.

View Services
+
+

Needs Your Attention

Documents, replies or confirmations currently expected from you.

+ +
{% set shown = namespace(count=0) %} {% for task in task_rows or [] %} @@ -25,15 +28,18 @@ {% endif %} {% endfor %} {% if shown.count == 0 %} -
No urgent action is pending from you.
+
No immediate action is pending from you.
{% endif %}
-

Upcoming Compliance

Nearest active service due dates.

Open Compliance
-
- {% for row in due_soon_engagements[:6] %} +
+

Upcoming Services & Due Dates

Important service deadlines visible to your client login.

+ Full Compliance Page +
+
+ {% for row in engagements[:6] if engagements is defined %}
{{ row.catalogue.service_name if row.catalogue else 'Service' }}
FY {{ row.financial_year }}{% if row.assessment_year %} • AY {{ row.assessment_year }}{% endif %}
@@ -41,7 +47,7 @@
{% else %} -
No upcoming compliance due dates found.
+
No upcoming service due dates found.
{% endfor %}
@@ -62,7 +68,7 @@

Quick Actions

- View My Services + Upload / View Documents Messages from Firm View Bills & Receipts diff --git a/app/modules/clients/templates/clients/portal_partials/services_documents.html b/app/modules/clients/templates/clients/portal_partials/services_documents.html new file mode 100644 index 0000000..42d1bde --- /dev/null +++ b/app/modules/clients/templates/clients/portal_partials/services_documents.html @@ -0,0 +1,14 @@ +
+
+
+

Services & Documents

Track services handled by the firm and documents visible to you.

+
+ + + Upload Documents +
+
+
+ {% include "modules/clients/templates/clients/portal_partials/services.html" %} + {% include "modules/clients/templates/clients/portal_partials/documents.html" %} +
diff --git a/app/modules/clients/ui.py b/app/modules/clients/ui.py index 01530f1..fc37273 100644 --- a/app/modules/clients/ui.py +++ b/app/modules/clients/ui.py @@ -916,15 +916,17 @@ def _active_financial_year(request: Request) -> str | None: CLIENT_PORTAL_TABS = { "overview": "modules/clients/templates/clients/portal_partials/overview.html", + "action-centre": "modules/clients/templates/clients/portal_partials/action_centre.html", + "services-documents": "modules/clients/templates/clients/portal_partials/services_documents.html", + "billing-messages": "modules/clients/templates/clients/portal_partials/billing_messages.html", + "reports": "modules/clients/templates/clients/portal_partials/reports.html", "pending": "modules/clients/templates/clients/portal_partials/pending.html", "services": "modules/clients/templates/clients/portal_partials/services.html", "documents": "modules/clients/templates/clients/portal_partials/documents.html", "billing": "modules/clients/templates/clients/portal_partials/billing.html", "messages": "modules/clients/templates/clients/portal_partials/messages.html", - "reports": "modules/clients/templates/clients/portal_partials/reports.html", } - def _client_dashboard_payload(db, client_row, financial_year: str | None = None) -> dict: summary = build_client_portal_summary(db, client_row, financial_year=financial_year) billing_summary = build_client_billing_summary(db, client_row, financial_year=financial_year)