Commit Graph

904 Commits

Author SHA1 Message Date
Dries Peeters 2ca4fd3f1a feat(client-portal): enhance error handling and UI improvements
- Add custom error handlers (403, 404, 500) with user-friendly error pages
- Create new error.html template with consistent styling and navigation
- Enhance context processor to inject pending approvals and notifications counts
- Add error handling to client approval service with proper rollback
- Update all client portal templates with improved UI/UX
- Improve base template with better navigation and data injection
- Add graceful error handling to prevent cascading failures

This update significantly improves the user experience in the client portal
by providing clear error messages and better visual feedback throughout
all pages.
2026-01-16 09:14:46 +01:00
Dries Peeters be88d867c7 Fix PDF editor overflow issues and refactor toolbox styling
- Fix horizontal overflow in action bar on smaller screens with responsive wrapping
- Fix canvas header overflow by adding flex-wrap and responsive stacking
- Fix canvas toolbar overflow with proper wrapping and button sizing
- Hide page size help text on mobile to prevent overflow
- Replace purple gradient sidebar with clean white card design
- Update colors to use app's primary blue (#3B82F6) and neutral grays
- Redesign element items with proper card styling and hover effects
- Update search box and tabs to match app's input/button components
- Add comprehensive dark mode support throughout toolbox
- Improve visual consistency between invoice and quote PDF editors

All fixes applied to both invoice and quote PDF editors for consistent
responsive behavior across all screen sizes.
2026-01-15 21:18:41 +01:00
Dries Peeters 8a1d36b533 fix(inventory): fix trackable check blocking return/waste movements
The trackable item validation was running too early, blocking all return/waste movements even when devaluation wasn't enabled. Move the check to only run when devaluation is actually being used.

- Move trackable validation to devaluation-specific code paths

- Allow non-trackable items for return/waste without devaluation

- Update form to show all active items (trackability only required for devaluation)

Fixes #385
2026-01-14 21:15:33 +01:00
Dries Peeters 785f09057b build: Improve desktop Windows build script
- Inline asset preparation logic in PowerShell script
- Add better error handling and diagnostics for missing assets
- Improve icon file detection and generation guidance
- Add ASSETS_PREPARED environment variable to prevent duplicate work
- Fix path handling and output messages
- Bump desktop package version to 4.10.6
- Remove .assets_prepared build artifact from version control
2026-01-14 21:15:30 +01:00
Dries Peeters b44028c5b5 ci: Improve iOS build artifact handling
- Add iOS archive creation step to build-mobile.yml
- Enhance error handling and diagnostics in cd-release.yml
- Add file existence checks and directory listings for debugging
- Change artifact upload from 'ignore' to 'error' for better failure detection
2026-01-14 21:15:28 +01:00
Dries Peeters c5ada775d3 chore: Bump version to 4.10.7 2026-01-14 21:15:24 +01:00
Dries Peeters 0b76df53e2 feat: Add configurable date format for PDF templates
- Add date_format column to invoice_pdf_templates and quote_pdf_templates tables
- Default date format set to DD.MM.YYYY (%d.%m.%Y)
- Update PDF generators to use template-specific date format
- Add date format configuration in admin PDF template editor
- Replace Babel date formatting with strftime for consistent formatting
- Update template filters to use DD.MM.YYYY format by default

This allows users to customize date formatting per PDF template while
maintaining backward compatibility with existing templates.
2026-01-14 21:15:18 +01:00
Dries Peeters 64eee1acd9 Fix decorative image disappearing after save and PDF black screen issue
Fixes issue #432 where decorative images would disappear after saving
the layout and PDF preview would show mostly black.

Root causes:
- Konva's toJSON() doesn't serialize custom attributes like imageUrl
- Warning system adds 'element-overlap' suffix to names, breaking exact matches
- PDF generation tried to render images with empty/invalid sources

Fixes applied:

1. Serialization fixes (quote_pdf_layout.html, pdf_layout.html):
   - Manually inject imageUrl into JSON after Konva serialization
   - Store imageUrl in a map before serialization and match by position/index
   - Ensure primary name is 'decorative-image' before serialization
   - Fix name matching to handle 'decorative-image element-overlap' names

2. Restoration fixes (quote_pdf_layout.html, pdf_layout.html):
   - Search for decorative images using .includes() instead of exact match
   - Match by position when searching saved JSON for imageUrl
   - Create placeholder elements when imageUrl is missing
   - Ensure decorative image groups remain visible even without imageUrl

3. PDF generation fixes (pdf_generator_reportlab.py):
   - Skip decorative images with empty/invalid sources gracefully
   - Log warnings instead of attempting to render invalid images
   - Prevents black screen in PDF preview

4. Enhanced logging:
   - Added [INVOICE] and [SAVE]/[LOAD] prefixes for better debugging
   - Verify imageUrl presence in JSON before saving and after loading

The fixes ensure decorative images are properly saved with their imageUrl
attribute, correctly restored on load, and don't break PDF generation when
the image source is missing or invalid.
2026-01-14 21:15:08 +01:00
Dries Peeters ac062182f2 fix(pdf-editor): improve decorative image handling and debugging
- Add comprehensive logging with [INVOICE] prefixes for better traceability
- Fix decorative image detection to handle modified names (e.g., 'decorative-image element-overlap')
- Implement position-based matching for imageUrl restoration from saved JSON
- Improve robustness when searching for decorative-image groups in Konva layer
- Add fallback mechanisms for finding imageUrl when position matching fails
- Enhance error messages and warnings with detailed context
- Ensure primary name 'decorative-image' is preserved before serialization
- Add verification logging to track imageUrl assignment and retrieval

These changes address issues where decorative images could lose their imageUrl
when saved/loaded, especially when elements have additional names or classes
applied (like 'element-overlap'). The position-based matching ensures correct
imageUrl restoration even when multiple decorative images exist.
2026-01-14 21:13:18 +01:00
Dries Peeters 936beff4c0 Update android & IOS app 2026-01-14 07:01:31 +01:00
Dries Peeters 6d6e67db97 Update Android & IOS builds 2026-01-14 06:53:06 +01:00
Dries Peeters d7c0a277d5 Update setup.py 2026-01-13 21:58:43 +01:00
Dries Peeters 62c34faf08 Fix: Add missing push_subscriptions table migration
- Create migration 090 to add push_subscriptions table
- Fixes database error when deleting users (relation 'push_subscriptions' does not exist)
- Table includes foreign key to users with CASCADE delete
- Adds index on user_id column
- Follows idempotent migration pattern for safe execution

Fixes #428
2026-01-13 21:57:37 +01:00
Dries Peeters 5d62b16bd5 Fix unwanted border lines in PDF template editor
- Remove separator lines from loadDefaultLayout() in both quote and invoice templates
- Improve cleanup logic to detect and remove border lines at origin (0,0) with full page width
- Enhance filtering in code generation to catch border lines before export
- Add comprehensive line detection that calculates actual position from points array
- Filter out lines with colors #667eea, #dee2e6, and other gray/blue separator colors
- Ensure cleanup runs on template load to remove any saved unwanted elements

This fixes the persistent issue where unwanted border lines would reappear
even after deletion, especially at position (0,0) with full page width.
The lines are now filtered at multiple stages: during load, before save,
and during code generation to ensure they never appear in exported templates.

Fixes issue with unwanted border lines in PDF previews and generated PDFs.
2026-01-13 20:09:15 +01:00
Dries Peeters f998961041 Version Bump 2026-01-13 13:45:36 +01:00
Dries Peeters 289df65f85 Fix mysterious border in PDF preview and export
Remove padding from wrapper elements that was causing an unwanted
border-like gap around PDF content in both preview and export.

Changes:
- Remove 20px padding from .quote-wrapper and .invoice-wrapper in
  generated CSS (quote_pdf_layout.html and pdf_layout.html)
- Remove 20px padding from preview HTML templates in admin.py for both
  invoice and quote previews
- Set padding to 0 !important to ensure content aligns with page edges

This ensures the preview and export match the exact page boundaries
shown by the blue border in the editor, eliminating the mysterious
border issue reported in #425.
2026-01-13 13:44:09 +01:00
Dries Peeters e9049ef923 fix(mobile): add missing Flutter app source files to fix build errors
- Add lib/main.dart entry point with proper routing setup
- Create Timer model (lib/data/models/timer.dart) with toJson support
- Enhance ApiClient with all required API methods:
  * Timer operations (getTimerStatus, startTimer, stopTimer)
  * Time entry operations (CRUD)
  * Project and task operations
- Add toJson() methods to TimeEntry and Timer models
- Fix splash screen auth check to use async methods properly
- Add missing provider methods (getElapsedTime, checkTimerStatus, loadTimeEntries)
- Update .gitignore to allow tracking mobile/lib/ directory

Fixes build error: 'Target file lib/main.dart not found' when running
flutter build apk --release or flutter build ios --release
2026-01-13 13:43:56 +01:00
Dries Peeters ba9b789c51 feat: Add decorative images to PDF templates with full sync between invoice and quote editors
- Add decorative image element to PDF Layout Designer for both invoice and quote templates
- Implement template-level decorative image upload and management
- Add backend routes for template image upload and serving
- Update PDF generation (HTML preview and ReportLab) to handle template images with transparency preservation
- Sync all decorative image functionality between invoice and quote PDF layout editors

Fixes:
- Fix upload button not opening file picker in invoice template (use fresh DOM references)
- Fix element name matching to handle 'decorative-image element-overlap' format (use .includes() instead of strict equality)
- Fix image restoration after page reload with enhanced JSON searching and position matching
- Fix image persistence in Konva.js serialization/deserialization

Improvements:
- Enhanced image restoration logic with fallback mechanisms
- Improved error handling and console logging for debugging
- Better handling of transparent backgrounds in PDF export
- Consistent behavior between invoice and quote template editors
2026-01-13 13:33:55 +01:00
Dries Peeters 2af0a931aa chore: bump version to 4.10.3 2026-01-12 20:09:15 +01:00
Dries Peeters 2180f7d539 ci: temporarily skip mobile app tests in build workflow
- Comment out mobile app tests as source code is incomplete
- Tests exist but lib/ source code is missing
- Allows CI/CD to continue building while mobile app is in development
2026-01-12 20:09:11 +01:00
Dries Peeters 14d5874883 docs: improve mobile app documentation and configuration
- Add comprehensive API token setup instructions
- Document connection process and troubleshooting
- Update pubspec.yaml dependencies
- Improve README with step-by-step configuration guide
2026-01-12 20:09:07 +01:00
Dries Peeters 681a4b0ec2 feat: enhance desktop app with timer status in system tray
- Add real-time timer status display in system tray tooltip
- Show elapsed time for active timers in tray
- Improve system tray menu with timer status updates
- Add IPC communication for timer status updates
- Enhance API client with better error handling
- Update desktop app styling and UI improvements
- Update README with detailed API token setup instructions
2026-01-12 20:09:04 +01:00
Dries Peeters 61bead4cb2 feat: add devaluation support to stock movements
- Add 'devaluation' to stock movement types
- Add validation to ensure trackable items for devaluation
- Improve error handling for devaluation operations
2026-01-12 20:09:00 +01:00
Dries Peeters c8f7b13b89 feat: enhance PDF template designer for invoices and quotes
- Add comprehensive visual designer interface for PDF templates
- Support drag-and-drop element placement and styling
- Add support for additional element types (shapes, images, tables)
- Improve template preview and editing capabilities
- Add JSON import/export functionality for templates
- Enhance quote PDF layout editor with full design capabilities
- Refactor admin routes to support new template editing features
2026-01-12 20:08:55 +01:00
Dries Peeters f978370a8e Update for android app. 2026-01-11 21:59:39 +01:00
Dries Peeters e6cc5609ec Update build-mobile.yml 2026-01-11 21:55:38 +01:00
Dries Peeters dd125fbc9c Bump version to 4.10.2 2026-01-11 21:48:32 +01:00
Dries Peeters 6460048396 UI: Improve PDF designer interface
- Disable rotation handles in transformer (rotateEnabled: false)
- Remove warning indicator dots from canvas (warnings shown in panel only)
- Add text color to warning items for better visibility
- Clean up warning indicators when loading templates
- Apply improvements to both invoice and quote PDF designers
2026-01-11 21:48:29 +01:00
Dries Peeters aed612e0d4 Fix: Ensure PDF template page dimensions match page size
- Add validation to ensure page width/height match selected page size
- Apply fix to both invoice and quote PDF templates
- Fixes layout issues when templates are customized with mismatched dimensions
- Add logging for dimension updates
2026-01-11 21:48:26 +01:00
Dries Peeters 581d38ff24 Add utility scripts for desktop build management
- Add asset checking and preparation scripts
- Add cache clearing utilities for Electron Builder
- Add build fix and troubleshooting scripts
- Add desktop setup verification script
- Add test build script for validation
2026-01-11 20:51:38 +01:00
Dries Peeters 3c433e2593 Add comprehensive documentation for build process and branding
- Add build troubleshooting and Windows-specific guides
- Document branding guidelines and asset management
- Add desktop build configuration documentation
- Include symlink and OneDrive fix guides
- Add code signing and permissions documentation
- Document quick start guides for various scenarios
2026-01-11 20:51:32 +01:00
Dries Peeters 4e21221ca0 Update configuration files
- Update mobile pubspec.yaml version
- Add brand colors to Tailwind config
- Update .gitignore to exclude build artifacts and temporary files
2026-01-11 20:51:28 +01:00
Dries Peeters 29b41cfe9c Update inventory routes with improvements
- Enhance inventory route functionality
- Improve code organization and maintainability
2026-01-11 20:51:24 +01:00
Dries Peeters 4d037d604c Improve permissions system with auto-sync and better role handling
- Add automatic permission and role synchronization on role list view
- Improve system role editing: allow editing but prevent name changes
- Enhance permissions seed utility for better role management
- Fix role editing validation to be more user-friendly
2026-01-11 20:51:17 +01:00
Dries Peeters 00f1f18abb Improve build scripts and CI/CD workflows
- Enhance build scripts with better error handling and Windows support
- Add Windows-specific build scripts and PowerShell utilities
- Add asset preparation and verification scripts
- Update GitHub Actions workflows for desktop and mobile builds
- Add build configuration and troubleshooting utilities
- Improve cross-platform build compatibility
2026-01-11 20:51:13 +01:00
Dries Peeters 7195a4e43e Enhance desktop app with improved branding and features
- Update package.json version to 4.10.1 with enhanced metadata
- Add splash screen with branding
- Improve window management and preload security
- Enhance renderer styles with brand colors
- Add asset preparation tracking
- Update desktop README with comprehensive documentation
2026-01-11 20:51:07 +01:00
Dries Peeters 25b8d928b0 Update templates with new branding and logo integration
- Integrate new logo assets across all templates
- Update base template with improved favicon and meta tags
- Add logo support to login, admin, and inventory templates
- Update web manifest with new branding
- Enhance PDF layouts with logo support
2026-01-11 20:51:03 +01:00
Dries Peeters 79200f0760 Add branding assets: logo SVGs and brand color stylesheets
- Add TimeTracker logo variants (dark, light, horizontal, icon)
- Add brand-colors.css for consistent color theming
- Include desktop app logo assets
2026-01-11 20:50:59 +01:00
Dries Peeters 15b0c2c2b4 chore: bump version to 4.10.1 2026-01-11 12:15:37 +01:00
Dries Peeters 7332928958 fix: add boundary checking for PDF elements and page numbers
- Add page dimension validation in PDF generators to prevent content
  from being drawn outside page boundaries
- Fix page number positioning in fallback PDF generator to ensure
  they stay within page margins
- Add boundary constraints for absolutely positioned elements in
  ReportLab template renderer
- Prevent rendering errors when elements exceed page dimensions
2026-01-11 12:15:34 +01:00
Dries Peeters ebf6126fe2 chore(docker): change Redis default to disabled
- Change REDIS_ENABLED default from 'true' to 'false' in docker-compose.yml
- This prevents Redis connection attempts when Redis is not needed
- Applications will use in-memory cache fallback instead
2026-01-11 10:06:24 +01:00
Dries Peeters 059b8dba1f perf(cache): optimize Redis connection timeouts for faster failures
- Reduce socket_connect_timeout from 5s to 1s for faster failure detection
- Reduce socket_timeout from 5s to 1s for faster operation timeouts
- Disable socket_keepalive to avoid connection delays
- Disable retry_on_timeout to fail fast instead of retrying
- Improve fallback to in-memory cache when Redis is unavailable
2026-01-11 10:06:20 +01:00
Dries Peeters 8de734458c perf(auth): defer analytics tracking to avoid blocking login redirects
- Move track_event calls to background threads for both local and OIDC login
- Prevent PostHog timeouts from blocking user login flow
- Add error handling to prevent analytics errors from affecting login
- Maintain fast log_event calls while deferring slower track_event calls
2026-01-11 10:06:16 +01:00
Dries Peeters c9df042d2b feat(integrations): add CalendarEvent sync support to Google Calendar connector
- Add bidirectional sync for CalendarEvent objects (similar to CalDAV)
- Import Google Calendar events as CalendarEvent instead of TimeEntry
- Sync CalendarEvent objects to Google Calendar with proper markers
- Add methods to create/update Google Calendar events from CalendarEvent
- Track imports using description markers instead of IntegrationExternalEventLink
- Prevent circular sync by checking for import markers
- Update logging to include calendar event counts alongside time entries
2026-01-11 10:06:13 +01:00
Dries Peeters bd7798129b feat(pdf): add page border visualization and zoom display
- Add blue page border to clearly mark page boundaries in PDF editor
- Add zoom percentage display next to zoom controls
- Update overlap detection to exclude page border
- Ensure page border is recreated after canvas clear and page size changes
- Filter out page border from exported templates
- Fix totals text styling by finding element by name instead of index
2026-01-11 10:06:01 +01:00
Dries Peeters 03d912038e docs: Update mobile and desktop apps implementation plan 2026-01-11 08:38:39 +01:00
Dries Peeters 36483648bb chore: Update Docker configuration and infrastructure setup
- Update Dockerfile with improved build configuration
- Refactor docker-compose.yml with better service definitions
- Update setup.py for package installation
- Improve .dockerignore to exclude unnecessary files
- Clean up template files (whitespace and formatting)
2026-01-11 08:38:10 +01:00
Dries Peeters 0178ef03ad feat: Increase invoice prefix length from 10 to 50 characters
- Add database migration to extend invoice_prefix column length
- Support longer invoice prefixes for better customization
- Migration includes SQLite compatibility handling
2026-01-11 08:37:59 +01:00
Dries Peeters bad397fbdb feat: Enhance invoice management, expenses, and PDF generation
- Improve invoice model with enhanced prefix handling and validation
- Enhance expense routes with better error handling and validation
- Refactor PDF generator with improved template support and formatting
- Update Google Calendar integration with improved error handling
- Enhance scheduled tasks with better logging and reliability
- Update admin routes with improved permission checks
- Improve email utility with better template handling
2026-01-11 08:37:48 +01:00
Dries Peeters d1d5b819a9 ci: Add CI/CD workflows for mobile and desktop app builds
- Add GitHub Actions workflow for building Flutter mobile apps
- Add GitHub Actions workflow for building Electron desktop apps
- Update release workflow to include mobile and desktop build jobs
- Support cross-platform builds (Android, iOS, Windows, macOS, Linux)
- Add artifact publishing for built applications
2026-01-11 08:37:37 +01:00