- Add CRM models: Contact, ContactCommunication, Deal, DealActivity, Lead, LeadActivity
- Support multiple contacts per client with primary contact designation
- Track sales pipeline with deals and opportunities
- Manage leads with conversion tracking
- Record communication history with contacts
- Add CRM routes and templates
- Contact management (list, create, view, edit, delete)
- Deal management with pipeline view
- Lead management with conversion workflow
- Communication history tracking
- Fix SQLAlchemy relationship conflicts
- Specify foreign_keys for Deal.lead relationship to resolve ambiguity
- Remove duplicate backref definitions in DealActivity and LeadActivity
- Improve migration 062 robustness
- Add index existence checks before creation
- Handle partial migration states gracefully
- Support both assigned_to and assignee_id column names
- Add error handling for missing CRM tables
- Gracefully handle cases where migration 063 hasn't run yet
- Prevent application crashes when CRM tables don't exist
- Add database migration 063 for CRM features
- Create contacts, contact_communications, deals, deal_activities, leads, lead_activities tables
- Set up proper foreign key relationships and indexes
- Update documentation
- Add CRM features to FEATURES_COMPLETE.md
- Create CRM implementation documentation
- Add feature gap analysis documentation
Add comprehensive inventory management system with full feature set including
stock tracking, warehouse management, supplier management, purchase orders,
transfers, adjustments, and reporting.
Core Features:
- Stock Items: Full CRUD operations with categories, SKU, barcodes, pricing
- Warehouse Management: Multi-warehouse support with stock level tracking
- Supplier Management: Multi-supplier support with supplier-specific pricing
- Purchase Orders: Complete PO lifecycle (draft, sent, received, cancelled)
- Stock Transfers: Transfer stock between warehouses with audit trail
- Stock Adjustments: Dedicated interface for stock corrections
- Stock Reservations: Reserve stock for quotes/invoices/projects
- Movement History: Complete audit trail for all stock movements
- Low Stock Alerts: Automated alerts when items fall below reorder point
Reports & Analytics:
- Inventory Dashboard: Overview with key metrics and statistics
- Stock Valuation: Calculate total inventory value by warehouse/category
- Movement History Report: Detailed movement log with filters
- Turnover Analysis: Inventory turnover rates and sales analysis
- Low Stock Report: Comprehensive low stock items listing
Integration:
- Quote Integration: Stock reservation when quotes are created
- Invoice Integration: Automatic stock reduction on invoice payment
- Project Integration: Stock allocation for project requirements
- API Endpoints: RESTful API for suppliers, purchase orders, and inventory
Technical Implementation:
- 9 new database models with proper relationships
- 3 Alembic migrations for schema changes
- 60+ new routes for inventory management
- 20+ templates for all inventory features
- Comprehensive permission system integration
- CSRF protection on all forms
- Full menu navigation integration
Testing:
- Unit tests for inventory models
- Route tests for inventory endpoints
- Integration tests for quote/invoice stock integration
Documentation:
- Implementation plan document
- Missing features analysis
- Implementation status tracking
Major Features:
- Complete quote management system with CRUD operations
- Quote items management with dynamic add/remove functionality
- Discount system (percentage and fixed amount)
- Payment terms integration with invoice creation
- Approval workflow with status tracking
- Quote attachments with client visibility control
- Quote templates for reusable configurations
- Quote versioning for revision history
- Email notifications for quote lifecycle events
- Scheduled tasks for expiring quote reminders
- Client portal integration for quote viewing/acceptance
- Bulk actions for quote management
- Analytics dashboard for quote metrics
UI/UX Improvements:
- Consistent table layout matching projects/clients pages
- Professional quote view page with improved action buttons
- Enhanced create/edit forms with organized sections
- Dynamic line items management in quote forms
- PDF template editor accessible via admin menu
- PDF submenu under Admin with Invoice and Quote options
- Fixed admin menu collapse when opening nested dropdowns
PDF Template System:
- Quote PDF layout editor with visual design tools
- Separate preview route for quote PDF templates
- Template reset functionality
- Support for multiple page sizes (A4, Letter, Legal, A3, A5, Tabloid)
Bug Fixes:
- Fixed 405 Method Not Allowed error on quote PDF save
- Fixed UnboundLocalError with translation function shadowing
- Fixed quote preview template context (quote vs invoice)
- Updated template references from invoice to quote variables
Database:
- Added 9 Alembic migrations for quote system schema
- Support for quotes, quote_items, quote_attachments, quote_templates, quote_versions
- Integration with existing comments system
Technical:
- Added Quote, QuoteItem, QuoteAttachment, QuoteTemplate, QuoteVersion models
- Extended comment routes to support quotes
- Integrated payment terms from quotes to invoices
- Email notification system for quote events
- Scheduled task for expiring quote checks
This commit addresses several issues with rich text display and the invoice
PDF layout editor:
Rich Text Rendering:
- Enhanced markdown filter to properly detect and preserve HTML content
from WYSIWYG editor, allowing full rich text styling (colors, fonts,
alignment) to be displayed correctly
- Improved HTML detection logic to distinguish between HTML and markdown
content, ensuring markdown lists are properly processed
- Added support for style, class, and id attributes on all rich text
elements (p, div, span, headings, lists, tables, etc.)
- Fixed list rendering in project/task descriptions with improved CSS:
- Added explicit display properties for lists
- Set proper list-style-type (disc for ul, decimal for ol)
- Improved spacing and nested list support
Invoice Editor Improvements:
- Fixed table header text extraction: now reads actual header text from
canvas elements instead of hardcoding English text, supporting
internationalization (e.g., German headers)
- Preserved text alignment (left, center, right) in generated preview
by reading Konva Text align attribute and applying text-align CSS
- Fixed PDF preview to show updated template:
- Changed generateCode() to return template body content instead of
full HTML document (matches preview endpoint expectations)
- Added cache-busting to preview requests to prevent stale content
- Improved error handling in preview fetch
Files changed:
- app/utils/template_filters.py: Enhanced markdown filter with HTML
detection and style preservation
- app/static/enhanced-ui.css: Improved list styling for prose content
- templates/admin/pdf_layout.html: Fixed table header extraction, text
alignment preservation, and preview generation format
Replace db.session.refresh() with User.query.get() to query for user
objects fresh in the current session context. This prevents 'Object is
already attached to session X (this is Y)' errors that occur when the
user fixture object from one session is used in different session
contexts, particularly when making requests through the test client.
Fixes 8 failing tests:
- test_get_client_portal_data_with_invoices
- test_get_client_portal_data_with_time_entries
- test_client_portal_dashboard_with_access
- test_client_portal_projects_route
- test_client_portal_invoices_route
- test_client_portal_time_entries_route
- test_view_invoice_belongs_to_client
- test_admin_can_disable_client_portal
- Fix missing jsonify import in app/routes/main.py
- Added jsonify to Flask imports to resolve F821 undefined name errors
- Fixes flake8 code quality check failures
- Fix client portal access check in app/routes/client_portal.py
- Ensure client relationship is properly loaded when checking portal access
- Query client directly if relationship not loaded to prevent 403 errors
- Resolves route test failures where tests expected 200 but got 403
- Fix database locked errors in test_client_portal.py
- Use db.session.no_autoflush blocks when modifying user client portal settings
- Prevents audit logging from interfering with test transactions
- Add db.session.refresh() after commits to ensure fresh state
- Fixes SQLite database locked errors in model and route tests
All three issues (code quality checks, route test failures, and database
locked errors) are now resolved.
- Replace hardcoded English strings with translation function calls in 36 template files
- Update translation files for all supported languages (ar, de, es, fi, fr, he, it, nb, nl, no)
- Add over 55,000 new translation entries across all language files
- Update extract_translations.py to use 'python -m babel.messages.frontend' instead of pybabel
- Improve internationalization coverage for UI elements including:
* Skip to content links
* Sidebar toggle buttons
* Command palette placeholders
* Admin dashboard elements
* Form labels and buttons
* Report templates
* Payment and invoice views
This commit significantly improves the application's multilingual support
by making previously hardcoded strings translatable.
- Enable direct editing of text elements within item/expenses tables
- Add double-click functionality to select and edit table text elements
- Add Ctrl/Cmd+Click to select individual text elements instead of parent group
- Improve text element detection using multiple methods (className, getType, constructor)
- Enhance event listeners with input, change, and paste handlers
- Add visual feedback: text cursor on hover over editable table text
- Increase textarea size to 8 rows for table items (from 3)
- Properly escape HTML special characters in text content
- Add helpful hint text for table text editing
- Fix text content conversion: handle \\n to actual newlines correctly
- Add 'nb' (Norwegian Bokmål) to translation extraction script
This ensures Norwegian translations are properly included when
extracting and updating translation catalogs.
- Improve translation compilation error logging
Add exc_info=True to log full exception tracebacks when translation
compilation fails, making it easier to diagnose issues with missing
or corrupted .mo files.
Fixes issue where Norwegian (norsk) translations were not working
due to missing compiled .mo files. The app will now properly compile
Norwegian translations on startup, and any compilation errors will
be logged with full stack traces for debugging.
Replace display:none with visibility-based hiding to reserve space
for the support banner from page load. This prevents the page from
jumping when the banner becomes visible after the 2-second delay.
- Use opacity-0/invisible instead of hidden class to keep element in layout
- Reserve banner space immediately when it should be shown
- Add smooth transition for better UX
- Update dismiss function to use new visibility classes
- Fix keyboard shortcuts to respect text input focus
* Delete/Backspace only removes elements when not editing text fields
* Arrow keys only move elements when not editing text fields
* Prevents accidental deletion while typing in properties panel
- Add full editing support for items table and expenses table
* Properties panel now shows editable fields for table Groups
* Supports editing header text, font size, font style, and color
* Supports editing items template, font size, and color
* Supports editing separator line color and width
* Supports editing table width
- Fix table selection behavior
* Clicking on child elements (header, items, line) now selects parent Group
* Ensures table can be selected and edited from any part
* Adds click handlers to all child elements when creating tables
- Improve error handling and debugging
* Add comprehensive logging for troubleshooting
* Add try-catch blocks for table property processing
* Add fallback display for unrecognized Groups
This fixes the issue where users couldn't edit table properties and
prevents frustrating accidental deletions while typing in input fields.
- Add custom scrollbar styling for sidebar navigation menu
- Implement thin, subtle scrollbar with transparent track
- Support both light and dark themes with appropriate opacity
- Add hover effects for better user interaction
- Compatible with Firefox (scrollbar-width/color) and Webkit browsers
- Fixes default browser scrollbar appearance when sidebar content overflows
- Add Norwegian (Norsk) language support with locale code normalization (no -> nb)
- Create Norwegian translation files (translations/nb/ and translations/no/)
- Fill empty Norwegian translation strings with English fallback values
- Add locale normalization for Flask-Babel compatibility (no -> nb mapping)
- Update context processor to correctly display 'Norsk' label instead of 'NB'
Translation improvements:
- Wrap all hardcoded strings in templates with _() translation function
- Add missing translations for setup, timer, tasks, invoices, and admin templates
- Ensure brandnames 'drytrix' and 'TimeTracker' remain untranslated across all languages
- Add new translation strings to all language files (en, de, nl, fr, it, fi, es, no, ar, he)
- Update translation files for: initial_setup, manual_entry, tasks/list, email_templates, etc.
Bug fixes:
- Add missing /api/summary/today endpoint for daily summary notifications
- Fix 'Response body already consumed' error in smart-notifications.js
- Improve translation compilation logging and error handling
- Add debug endpoint /debug/i18n for troubleshooting translation issues
Technical changes:
- Improve ensure_translations_compiled() with better logging
- Add locale normalization function for Norwegian locale handling
- Update context processor to reverse-map normalized locales for display
- Fix JavaScript fetch error handling to check response.ok before reading body
The onboarding tour was incorrectly rendering on mobile devices (width < 768px), appearing as a small dot in the top-left corner with a dark overlay that blocked app access on the dashboard screen.
Changes:
- Add mobile detection (width <= 768px) in OnboardingManager.init() to prevent tour initialization on mobile devices
- Skip auto-start of tour on mobile in DOMContentLoaded handler
- Mark tour as completed on mobile to prevent future attempts
- Add window resize handler to cancel active tour if window is resized to mobile size
- Add mobile-responsive CSS styles for tooltip (for future use)
- Apply same mobile checks to EnhancedOnboardingManager
The tour is now automatically disabled on mobile devices, allowing users to access the app without the broken overlay blocking them. The tour continues to work normally on desktop devices.
Fixes: Onboarding tour broken layout on mobile (< 768px width)
Implement comprehensive webhook system supporting 40+ event types with automatic retries, HMAC signatures, delivery tracking, REST API, and admin UI. Integrates with Activity logging for automatic event triggering.
- Database: Add webhooks and webhook_deliveries tables (migration 046)
- API: Full CRUD endpoints with read:webhooks/write:webhooks scopes
- UI: Admin interface for webhook management and testing
- Service: Automatic retry with exponential backoff every 5 minutes
- Security: HMAC-SHA256 signature verification
- Tests: Model and service tests included
- Docs: Complete integration guide with examples
- Fix script block name from extra_js to scripts_extra to match base.html
- Replace inline onclick handlers with event listeners to fix scope issues
- Fix ReferenceError for toggleViewMode and insertVariable functions
- Improve editor initialization flow with proper script loading detection
- Add error handling and fallback to textarea if Toast UI Editor fails to load
- Add debug logging for troubleshooting initialization issues
- Ensure default templates are editable (no restrictions in backend)
- Add email templates link to admin menu in base.html
- Remove ENV file configuration details from email support page
The editor now properly initializes and all interactive features work correctly.