Commit Graph

56 Commits

Author SHA1 Message Date
Christian
84c837f303 fix: store PDF bytes in DB (content_data) + re-save existing email attachments v2.2.11 2026-03-01 16:36:05 +01:00
Christian
bef5c20c83 feat: Implement AI-powered Case Analysis Service and QuickCreate Modal
- Added CaseAnalysisService for analyzing case text using Ollama LLM.
- Integrated AI analysis into the QuickCreate modal for automatic case creation.
- Created HTML structure for QuickCreate modal with dynamic fields for title, description, customer, priority, technician, and tags.
- Implemented customer search functionality with debounce for efficient querying.
- Added priority field to sag_sager table with migration for consistency in case management.
- Introduced caching mechanism in CaseAnalysisService to optimize repeated analyses.
- Enhanced error handling and user feedback in the QuickCreate modal.
2026-02-20 07:10:06 +01:00
Christian
3cddb71cec feat: Add Technician Dashboard V1, V2, and V3 with enhanced UI and functionality
- Introduced Technician Dashboard V1 (tech_v1_overview.html) with KPI cards and new cases overview.
- Implemented Technician Dashboard V2 (tech_v2_workboard.html) featuring a workboard layout for daily tasks and opportunities.
- Developed Technician Dashboard V3 (tech_v3_table_focus.html) with a power table for detailed case management.
- Created a dashboard selector page (technician_dashboard_selector.html) for easy navigation between dashboard versions.
- Added user dashboard preferences migration (130_user_dashboard_preferences.sql) to store default dashboard paths.
- Enhanced sag_sager table with assigned group ID (131_sag_assignment_group.sql) for better case management.
- Updated sag_subscriptions table to include cancellation rules and billing dates (132_subscription_cancellation.sql, 134_subscription_billing_dates.sql).
- Implemented subscription staging for CRM integration (136_simply_subscription_staging.sql).
- Added a script to move time tracking section in detail view (move_time_section.py).
- Created a test script for subscription processing (test_subscription_processing.py).
2026-02-17 08:29:05 +01:00
Christian
891180f3f0 Refactor opportunities and settings management
- Removed opportunity detail page route from views.py.
- Deleted opportunity_service.py as it is no longer needed.
- Updated router.py to seed new setting for case_type_module_defaults.
- Enhanced settings.html to include standard modules per case type with UI for selection.
- Implemented JavaScript functions to manage case type module defaults.
- Added RelationService for handling case relations with a tree structure.
- Created migration scripts (128 and 129) for new pipeline fields and descriptions.
- Added script to fix relation types in the database.
2026-02-15 11:12:58 +01:00
Christian
0831715d3a feat: add SMS service and frontend integration
- Implement SmsService class for sending SMS via CPSMS API.
- Add SMS sending functionality in the frontend with validation and user feedback.
- Create database migrations for SMS message storage and telephony features.
- Introduce telephony settings and user-specific configurations for click-to-call functionality.
- Enhance user experience with toast notifications for incoming calls and actions.
2026-02-14 02:26:29 +01:00
Christian
489f81a1e3 feat: Enhance hardware detail view with ESET data synchronization and specifications
- Added a button to sync ESET data in the hardware detail view.
- Introduced a new tab for ESET specifications, displaying relevant device information.
- Included ESET UUID and group details in the hardware information section.
- Implemented a JavaScript function to handle ESET data synchronization via API.
- Updated the ESET import template to improve device listing and inline contact selection.
- Enhanced the Nextcloud and locations routers to support customer ID resolution from contacts.
- Added utility functions for retrieving customer IDs linked to contacts.
- Removed debug information from the service contract wizard for cleaner output.
2026-02-11 23:51:21 +01:00
Christian
297a8ef2d6 feat: Implement ESET integration for hardware management
- Added ESET sync functionality to periodically fetch devices and incidents.
- Created new ESET service for API interactions, including authentication and data retrieval.
- Introduced new database tables for storing ESET incidents and hardware contacts.
- Updated hardware assets schema to include ESET-specific fields (UUID, specs, group).
- Developed frontend templates for ESET overview, import, and testing.
- Enhanced existing hardware creation form to auto-generate AnyDesk links.
- Added global logout functionality to clear user session data.
- Improved error handling and logging for ESET API interactions.
2026-02-11 13:23:32 +01:00
Christian
3d7fb1aa48 feat(migrations): add AnyDesk session management and customer wiki slug updates
- Created migration scripts for AnyDesk sessions and hardware assets.
- Implemented apply_migration_115.py to execute migration for AnyDesk sessions.
- Added set_customer_wiki_slugs.py script to update customer wiki slugs based on a predefined folder list.
- Developed run_migration.py to apply AnyDesk migration schema.
- Added tests for Service Contract Wizard to ensure functionality and dry-run mode.
2026-02-10 14:40:38 +01:00
Christian
e4b9091a1b feat: Implement fixed-price agreements frontend views and related templates
- Added views for listing fixed-price agreements, displaying agreement details, and a reporting dashboard.
- Created HTML templates for listing, detailing, and reporting on fixed-price agreements.
- Introduced API endpoint to fetch active customers for agreement creation.
- Added migration scripts for creating necessary database tables and views for fixed-price agreements, billing periods, and reporting.
- Implemented triggers for auto-generating agreement numbers and updating timestamps.
- Enhanced ticket management with archived ticket views and filtering capabilities.
2026-02-08 01:45:00 +01:00
Christian
b43e9f797d feat: Add reminder system for sag cases with user preferences and notification channels
- Implemented user notification preferences table for managing default notification settings.
- Created sag_reminders table to define reminder rules with various trigger types and recipient configurations.
- Developed sag_reminder_queue for processing reminder events triggered by status changes or scheduled times.
- Added sag_reminder_logs to track reminder notifications and user interactions.
- Introduced frontend notification system using Bootstrap 5 Toast for displaying reminders.
- Created email template for sending reminders with case details and action links.
- Implemented rate limiting for user notifications to prevent spamming.
- Added triggers and functions for automatic updates and reminder processing.
2026-02-06 10:47:14 +01:00
Christian
c2a265d5f9 Add local pipeline opportunities 2026-01-28 07:48:10 +01:00
Christian
31fc285342 feat: Fetch from multiple e-conomic endpoints for complete data
v1.3.149:
- Added /invoices/booked (sent invoices)
- Added /invoices/paid (paid invoices)
- Added /invoices/unpaid (unpaid invoices)
- Keep /invoices/drafts (draft invoices)
- Track unique invoices to avoid duplicates
- Apply customer and date filters correctly after fetching
2026-01-27 08:42:22 +01:00
Christian
41716ba683 fix: Use /invoices/drafts with proper customer filtering
v1.3.147:
- Changed from /customers/{id}/invoices/sent (404) to /invoices/drafts
- Fetch all drafts, then filter by customer number
- Apply date filter ONLY on customer invoices (fixes bug)
- Proper order: fetch all -> filter customer -> filter date
2026-01-27 08:31:22 +01:00
Christian
0d9f5a4332 feat: Use customer-specific invoices endpoint
v1.3.146:
- Changed to /customers/{customerNumber}/invoices/sent
- More direct approach - fetches only that customer's invoices
- Removed unnecessary customer filtering step
- Still applies 13-month date filter
2026-01-27 07:24:35 +01:00
Christian
e14aff89d7 fix: Apply date filter on customer_invoices not all_invoices
v1.3.145:
- CRITICAL FIX: Date filter was running on all invoices
- Now correctly filters customer_invoices by date
- Prevents showing other customers' invoices
2026-01-27 07:23:19 +01:00
Christian
bff284f398 fix: Remove duplicate customer filtering code
v1.3.144:
- Removed duplicate filtering logic
- Fixed logic flow: check invoices -> filter -> date filter
- Cleaner logs without duplicates
2026-01-27 07:22:00 +01:00
Christian
ffffa8e004 feat: Fetch from multiple e-conomic endpoints
v1.3.143:
- Check drafts, booked, paid, unpaid endpoints
- Deduplicate invoices by invoice number
- Pagination support for each endpoint
- Filter by customer + 13 months date after fetching
2026-01-27 07:21:02 +01:00
Christian
b764224eff fix: Use /invoices/drafts endpoint instead of /sent
v1.3.142:
- Changed from /invoices/sent to /invoices/drafts
- /drafts contains most active invoices (29 vs 0 in /sent)
- Still applies pagination and 13-month filter
2026-01-27 07:20:01 +01:00
Christian
404e81a7a8 fix: Fetch all invoices then filter by customer
v1.3.141:
- Removed unsupported customer filter from API params
- Fetch all invoices from /invoices/sent with pagination
- Filter by customer number in code
- Apply 13-month date filter after customer filter
2026-01-27 07:18:36 +01:00
Christian
8d98e3f01c feat: Use customer filter in e-conomic API call
v1.3.140:
- Use /invoices/sent endpoint with customer.customerNumber filter
- More efficient: only fetch invoices for specific customer
- Apply 13-month date filter after fetching
- Simplified endpoint logic (single endpoint vs 8 endpoints)
2026-01-27 07:17:26 +01:00
Christian
2c524c9a05 fix: Apply date filter in code instead of API parameter
v1.3.139:
- Removed date filter from API params (causes 404 on some endpoints)
- Apply 13-month filter in code after fetching invoices
- Parse invoice dates and filter >= start_date
- More reliable filtering across all e-conomic endpoints
2026-01-27 07:15:44 +01:00
Christian
e0909d4586 fix: Fix month calculation bug in date filter
v1.3.138:
- Fixed ValueError: month must be in 1..12
- Use python-dateutil for proper month arithmetic
- Uses relativedelta for correct 13 month calculation
2026-01-27 07:14:40 +01:00
Christian
1bf04d45b1 feat: Extend invoice filter to 13 months for yearly items
v1.3.137:
- Changed from 12 to 13 months lookback
- Ensures yearly billed items are visible
- Example: Jan 27, 2026 -> fetches from Jan 1, 2025
2026-01-27 07:10:25 +01:00
Christian
86ad68c362 fix: Adjust date filter to 1st of month 12 months back
v1.3.136:
- Changed filter from 365 days to exactly 12 months
- Uses 1st day of the month 12 months ago
- Example: Jan 27, 2026 -> fetches from Feb 1, 2025
2026-01-27 07:09:50 +01:00
Christian
180933948f feat: Add 1-year filter + search to subscription matrix
v1.3.135:
- Added date filter to e-conomic API (only fetch invoices from last year)
- Implemented product search in billing matrix
- Shows/hides search field based on product count
- Real-time filtering with clear button
2026-01-27 07:08:09 +01:00
Christian
7d5ec89e13 fix: Skip invoice lines with zero amount (text/description fields only) 2026-01-27 06:58:39 +01:00
Christian
cb7e209769 fix: Add pagination to e-conomic API to fetch ALL invoices (not just first 1000) 2026-01-27 01:53:34 +01:00
Christian
4ce8031513 feat: Add comprehensive logging to subscription matrix for debugging 2026-01-27 01:46:38 +01:00
Christian
2ba9f5e103 fix: Lenient filtering for subscription matrix - include all recurring products 2026-01-27 01:33:46 +01:00
Christian
501032efcd fix: Include period-based lines and normalize product grouping
- Include lines with period fields even without keywords
- Normalize product names to group similar lines
- Improves monthly Hosting - AR2 visibility
2026-01-27 01:19:08 +01:00
Christian
0b5d98fdc4 fix: Prefer line-level period text and broaden invoice title parsing
- Parse 'periode/abonnement' from line description
- Broaden invoice title fields used for period detection
- Prefer line period over invoice period
- Improve month assignment accuracy
2026-01-27 00:59:02 +01:00
Christian
fbe43b82e1 fix: Group products and parse period from invoice title
- Group identical product lines on same row
- Parse month from invoice title/notes (e.g., 'Periode May 2025')
- Assign lines to correct month from title
- Sum amounts per month and merge statuses
2026-01-27 00:49:23 +01:00
Christian
39b49d4d54 feat: Include invoice title keywords in subscription matrix filter
- Match 'periode'/'abonnement' in invoice notes/title fields
- Allows period-only titles to include line items
- Keeps line-level keyword filtering
2026-01-27 00:34:44 +01:00
Christian
1b48e659a8 feat: Show 12-month matrix with empty cells for missing invoices
- Generate all 12 months automatically (last 12 months from today)
- Display empty cells with 'missing' status for months without invoices
- Makes it easy to spot billing gaps
- Empty cells show 0 kr and null invoice_number
2026-01-26 17:17:14 +01:00
Christian
6b7b63f7d7 feat: Add Abonnements Matrix feature with e-conomic invoice aggregation
- New SubscriptionMatrixService for billing matrix generation
- Products grouped by product number with monthly aggregation
- Support for archived, draft, sent, booked, paid, unpaid invoices
- Fixed amount calculation with fallback logic (grossAmount, unitNetPrice)
- Status mapping based on invoice type (draft, invoiced, paid)
- Frontend tab on customer detail page with dynamic table rendering
- Fixed Blåhund customer economic number linking
2026-01-25 14:46:00 +01:00
Christian
3dcd04396e feat(webshop): Initial implementation of webshop module with views, migrations, and templates
- Added views for webshop admin interface using FastAPI and Jinja2 templates.
- Created initial SQL migration for webshop configurations, products, orders, and order items.
- Defined module metadata in module.json for webshop.
- Implemented HTML template for the webshop index page.
- Documented frontend requirements and API contracts in WEBSHOP_FRONTEND_PROMPT.md.
- Introduced scripts for generating conversation summaries and testing Whisper capabilities.
2026-01-25 03:29:28 +01:00
Christian
eacbd36e83 feat: Implement Transcription Service for audio files using Whisper API
- Added `transcription_service.py` to handle audio transcription via Whisper API.
- Integrated logging for transcription processes and error handling.
- Supported audio format checks based on configuration settings.

docs: Create Ordre System Implementation Plan

- Drafted comprehensive implementation plan for e-conomic order integration.
- Outlined business requirements, database changes, backend and frontend implementation details.
- Included testing plan and deployment steps for the new order system.

feat: Add AI prompts and regex action capabilities

- Created `ai_prompts` table for storing custom AI prompts.
- Added regex extraction and linking action to email workflow actions.

feat: Introduce conversations module for transcribed audio

- Created `conversations` table to store transcribed conversations with relevant metadata.
- Added indexing for customer, ticket, and user linkage.
- Implemented full-text search capabilities for Danish language.

fix: Add category column to conversations for classification

- Added `category` column to `conversations` table for better conversation classification.
2026-01-11 19:23:21 +01:00
Christian
ccb7714779 feat: Implement tracking of billed Hub order ID for time entries and update related services 2026-01-08 18:57:04 +01:00
Christian
cbcd0fe4e7 feat: Implement data consistency checking system for customer data across BMC Hub, vTiger, and e-conomic
- Added CustomerConsistencyService to compare and sync customer data.
- Introduced new API endpoints for data consistency checks and field synchronization.
- Enhanced customer detail page with alert for discrepancies and modal for manual syncing.
- Updated vTiger and e-conomic services to support fetching and updating customer data.
- Added configuration options for enabling/disabling sync operations and automatic checks.
- Implemented data normalization and error handling for robust comparisons.
- Documented the new system and its features in DATA_CONSISTENCY_SYSTEM.md.
2026-01-08 18:28:00 +01:00
Christian
c855f5d027 feat(migrations): add supplier invoice enhancements for accounting integration
- Added new columns to supplier_invoice_lines for contra_account, line_purpose, resale_customer_id, resale_order_number, is_invoiced_to_customer, and invoiced_date.
- Created indexes for faster filtering by purpose and resale status.
- Introduced economic_accounts table to cache e-conomic chart of accounts with relevant fields and indexes.
- Added comments for documentation on new columns and tables.
- Included success message for migration completion.
2026-01-07 10:32:41 +01:00
Christian
ca53573952 feat: Enhance email processing and backup scheduling
- Added PostgreSQL client installation to Dockerfile for database interactions.
- Updated BackupScheduler to manage both backup jobs and email fetching jobs.
- Implemented email fetching job with logging and error handling.
- Enhanced the frontend to display scheduled jobs, including email fetch status.
- Introduced email upload functionality with drag-and-drop support and progress tracking.
- Added import_method tracking to email_messages for better source identification.
- Updated email parsing logic for .eml and .msg files, including attachment handling.
- Removed obsolete email scheduler service as functionality is integrated into BackupScheduler.
- Updated requirements for extract-msg to the latest version.
- Created migration script to add import_method column to email_messages table.
2026-01-06 15:11:28 +01:00
Christian
af044a7be8 feat: Add comprehensive customer activity logging for all CRUD operations 2026-01-06 13:12:46 +01:00
Christian
4c2593b99c feat: search e-conomic for customers by name (v1.3.59)
- Added EconomicService.search_customer_by_name() method
- Added GET /api/v1/customers/{id}/search-economic endpoint
- Returns matching e-conomic customers by name (partial match)
- Helps find economic customer number for customers without CVR
- Shows customerNumber, name, CVR, email, city in results
2025-12-23 15:39:35 +01:00
Christian
c9af509e1c Implement e-conomic customer sync and CVR search (get_customers + search_customer_by_cvr) 2025-12-19 16:41:11 +01:00
Christian
ffb3d335bc feat: Add Simply-CRM integration setup documentation and configuration details
docs: Create vTiger & Simply-CRM integration setup guide with credential requirements

feat: Implement ticket system enhancements including relations, calendar events, templates, and AI suggestions

refactor: Update ticket system migration to include audit logging and enhanced email metadata
2025-12-16 15:36:11 +01:00
Christian
3806c7d011 feat(ticket-module): Implement ticket system with comprehensive database schema, permissions, and testing suite
- Added migration 025 for the Ticket System, creating tables for tickets, comments, attachments, worklogs, prepaid cards, and audit logs.
- Introduced migration 026 to add ticket-related permissions to the auth system and assign them to user groups.
- Developed a test suite for the Ticket Module, validating database schema, ticket number generation, prepaid card constraints, service logic, worklog creation, audit logging, and views.
2025-12-15 23:40:23 +01:00
Christian
3fb43783a6 feat: Implement Email Workflow System with comprehensive documentation and migration scripts
- Added Email Workflow System with automated actions based on email classification.
- Created database schema with tables for workflows, executions, and actions.
- Developed API endpoints for CRUD operations on workflows and execution history.
- Included pre-configured workflows for invoice processing, time confirmation, and bankruptcy alerts.
- Introduced user guide and workflow system improvements for better usability.
- Implemented backup system for automated backup jobs and notifications.
- Established email activity log to track all actions and events related to emails.
2025-12-15 12:28:12 +01:00
Christian
38fa3b6c0a feat: Add subscriptions lock feature to customers
- Added a new column `subscriptions_locked` to the `customers` table to manage subscription access.
- Implemented a script to create new modules from a template, including updates to various files (module.json, README.md, router.py, views.py, and migration SQL).
- Developed a script to import BMC Office subscriptions from an Excel file into the database, including error handling and statistics reporting.
- Created a script to lookup and update missing CVR numbers using the CVR.dk API.
- Implemented a script to relink Hub customers to e-conomic customer numbers based on name matching.
- Developed scripts to sync CVR numbers from Simply-CRM and vTiger to the local customers database.
2025-12-13 12:06:28 +01:00
Christian
361f2fad5d feat: Implement vTiger integration for subscriptions and sales orders
- Added a new VTigerService class for handling API interactions with vTiger CRM.
- Implemented methods to fetch customer subscriptions and sales orders.
- Created a new database migration for BMC Office subscriptions, including table structure and view for totals.
- Enhanced customer detail frontend to display subscriptions and sales orders with improved UI/UX.
- Added JavaScript functions for loading and displaying subscription data dynamically.
- Created tests for vTiger API queries and field inspections to ensure data integrity and functionality.
2025-12-11 23:14:20 +01:00
Christian
7f325b5c32 feat: Implement email management UI with FastAPI and keyword-based classification
- Added FastAPI router for serving email management UI at /emails
- Created Jinja2 template for the email frontend
- Developed SimpleEmailClassifier for keyword-based email classification
- Documented email UI implementation details, features, and API integration in EMAIL_UI_IMPLEMENTATION.md
2025-12-11 12:45:29 +01:00