diff --git a/app/routes/admin.py b/app/routes/admin.py index e8ab80c..de1960d 100644 --- a/app/routes/admin.py +++ b/app/routes/admin.py @@ -305,6 +305,13 @@ def toggle_telemetry(): def settings(): """Manage system settings""" settings_obj = Settings.get_settings() + installation_config = get_installation_config() + + # Sync analytics preference from installation config to database on load + # (installation config is the source of truth for telemetry) + if settings_obj.allow_analytics != installation_config.get_telemetry_preference(): + settings_obj.allow_analytics = installation_config.get_telemetry_preference() + db.session.commit() if request.method == 'POST': # Validate timezone @@ -343,7 +350,18 @@ def settings(): settings_obj.invoice_notes = request.form.get('invoice_notes', 'Thank you for your business!') # Update privacy and analytics settings - settings_obj.allow_analytics = request.form.get('allow_analytics') == 'on' + allow_analytics = request.form.get('allow_analytics') == 'on' + old_analytics_state = settings_obj.allow_analytics + settings_obj.allow_analytics = allow_analytics + + # Also update the installation config (used by telemetry system) + # This ensures the telemetry system sees the updated preference + installation_config.set_telemetry_preference(allow_analytics) + + # Log analytics preference change if it changed + if old_analytics_state != allow_analytics: + app_module.log_event("admin.analytics_toggled", user_id=current_user.id, new_state=allow_analytics) + app_module.track_event(current_user.id, "admin.analytics_toggled", {"enabled": allow_analytics}) if not safe_commit('admin_update_settings'): flash('Could not update settings due to a database error. Please check server logs.', 'error') diff --git a/app/routes/invoices.py b/app/routes/invoices.py index fb16435..e8208eb 100644 --- a/app/routes/invoices.py +++ b/app/routes/invoices.py @@ -101,6 +101,10 @@ def create_invoice(): "has_tax": tax_rate > 0 }) + # Get currency from settings + settings = Settings.get_settings() + currency_code = settings.currency if settings else 'USD' + # Create invoice invoice = Invoice( invoice_number=invoice_number, @@ -113,7 +117,8 @@ def create_invoice(): client_address=client_address, tax_rate=tax_rate, notes=notes, - terms=terms + terms=terms, + currency_code=currency_code ) db.session.add(invoice) @@ -643,7 +648,8 @@ def duplicate_invoice(invoice_id): client_id=original_invoice.client_id, tax_rate=original_invoice.tax_rate, notes=original_invoice.notes, - terms=original_invoice.terms + terms=original_invoice.terms, + currency_code=original_invoice.currency_code ) db.session.add(new_invoice) diff --git a/app/static/uploads/logos/.gitkeep b/app/static/uploads/logos/.gitkeep index 8f5b058..9d486bd 100644 --- a/app/static/uploads/logos/.gitkeep +++ b/app/static/uploads/logos/.gitkeep @@ -1,2 +1,2 @@ -# This file ensures the uploads directory is preserved in git -# Company logos will be stored in this directory +# This file ensures the logos directory is tracked by git +# Logo files uploaded through the admin interface will be stored here diff --git a/app/templates/admin/settings.html b/app/templates/admin/settings.html index 8e757f7..4c52856 100644 --- a/app/templates/admin/settings.html +++ b/app/templates/admin/settings.html @@ -46,6 +46,149 @@ + + +
+ Note: Admin users are configured via the ADMIN_USERNAMES environment variable, not in this UI. +
+Allowed formats: PNG, JPG, GIF, SVG, WEBP
+Help improve TimeTracker by sharing anonymous usage data:
+Privacy: All data is anonymized. No personal information, time entries, or client data is ever collected.
+This is the same setting as the telemetry preference shown during initial setup.
+Tip: You can also manage this setting in Admin → Settings (Privacy & Analytics section)
{% if telemetry.enabled %} diff --git a/app/templates/invoices/list.html b/app/templates/invoices/list.html index 1759d6f..71a9644 100644 --- a/app/templates/invoices/list.html +++ b/app/templates/invoices/list.html @@ -31,7 +31,7 @@Why? Anonymous usage data helps us prioritize features and fix issues. - You can change this anytime in Admin → Telemetry Dashboard. + You can change this anytime in Admin → Settings (Privacy & Analytics section).