mirror of
https://github.com/DRYTRIX/TimeTracker.git
synced 2026-05-08 05:19:48 -05:00
feat(payments): add analytics integration and improve UI consistency
## Payment Analytics Integration - Add 5 new API endpoints for payment metrics: - /api/analytics/payments-over-time - trend visualization - /api/analytics/payments-by-status - status distribution - /api/analytics/payments-by-method - method breakdown - /api/analytics/payment-summary - statistics with period comparison - /api/analytics/revenue-vs-payments - collection rate tracking - Integrate payment data into analytics dashboard with 4 new charts - Add payment metrics to reports page (total, count, fees, net received) - Update summary endpoint to include payment statistics ## UI/UX Improvements - Standardize form styling across all payment templates - Replace inconsistent Tailwind classes with form-input utility - Update card backgrounds to use card-light/card-dark - Fix label spacing to match application patterns - Ensure consistent border colors and backgrounds - Replace browser confirm() with system-wide modal for payment deletion - Consistent danger variant with warning icon - Keyboard support (Enter/Escape) - Dark mode compatible - Clear messaging about impact on invoice status ## Technical Changes - Import Payment and Invoice models in analytics and reports routes - Add proper admin/user scoping for payment queries - Maintain responsive design across all new components Closes payment tracking phase 2 (analytics & polish)
This commit is contained in:
@@ -100,7 +100,7 @@
|
||||
<nav class="flex-1">
|
||||
{% set ep = request.endpoint or '' %}
|
||||
{% set work_open = ep.startswith('projects.') or ep.startswith('clients.') or ep.startswith('tasks.') or ep.startswith('timer.') or ep.startswith('kanban.') or ep.startswith('time_entry_templates.') %}
|
||||
{% set finance_open = ep.startswith('reports.') or ep.startswith('invoices.') or ep.startswith('expenses.') %}
|
||||
{% set finance_open = ep.startswith('reports.') or ep.startswith('invoices.') or ep.startswith('payments.') or ep.startswith('expenses.') %}
|
||||
{% set analytics_open = ep.startswith('analytics.') %}
|
||||
{% set admin_open = ep.startswith('admin.') or ep.startswith('permissions.') %}
|
||||
<div class="flex items-center justify-between mb-4">
|
||||
@@ -170,6 +170,7 @@
|
||||
<ul id="financeDropdown" class="{% if not finance_open %}hidden {% endif %}mt-2 space-y-2 ml-6">
|
||||
{% set nav_active_reports = ep.startswith('reports.') %}
|
||||
{% set nav_active_invoices = ep.startswith('invoices.') %}
|
||||
{% set nav_active_payments = ep.startswith('payments.') %}
|
||||
{% set nav_active_expenses = ep.startswith('expenses.') %}
|
||||
<li>
|
||||
<a class="block px-2 py-1 rounded {% if nav_active_reports %}text-primary font-semibold bg-background-light dark:bg-background-dark{% else %}text-text-light dark:text-text-dark hover:bg-background-light dark:hover:bg-background-dark{% endif %}" href="{{ url_for('reports.reports') }}">{{ _('Reports') }}</a>
|
||||
@@ -177,6 +178,9 @@
|
||||
<li>
|
||||
<a class="block px-2 py-1 rounded {% if nav_active_invoices %}text-primary font-semibold bg-background-light dark:bg-background-dark{% else %}text-text-light dark:text-text-dark hover:bg-background-light dark:hover:bg-background-dark{% endif %}" href="{{ url_for('invoices.list_invoices') }}">{{ _('Invoices') }}</a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="block px-2 py-1 rounded {% if nav_active_payments %}text-primary font-semibold bg-background-light dark:bg-background-dark{% else %}text-text-light dark:text-text-dark hover:bg-background-light dark:hover:bg-background-dark{% endif %}" href="{{ url_for('payments.list_payments') }}">{{ _('Payments') }}</a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="block px-2 py-1 rounded {% if nav_active_expenses %}text-primary font-semibold bg-background-light dark:bg-background-dark{% else %}text-text-light dark:text-text-dark hover:bg-background-light dark:hover:bg-background-dark{% endif %}" href="{{ url_for('expenses.list_expenses') }}">{{ _('Expenses') }}</a>
|
||||
</li>
|
||||
|
||||
Reference in New Issue
Block a user