Commit Graph

240 Commits

Author SHA1 Message Date
Christian
ef171c7573 Fix: Migration interface now shows correct Podman commands for production servers
- Updated migrations.html to detect production environment and use podman/docker accordingly
- Added container runtime info to settings page
- Updated VERSION to 2.1.1
2026-01-29 00:47:40 +01:00
Christian
4b467aeeec Release v2.1.0 2026-01-29 00:36:32 +01:00
Christian
f059cb6c95 feat: Add product search endpoint and enhance opportunity management
- Implemented a new endpoint for searching webshop products with filters for visibility and configuration.
- Enhanced the webshop frontend to include a customer search feature for improved user experience.
- Added opportunity line items management with CRUD operations and comments functionality.
- Created database migrations for opportunity line items and comments, including necessary triggers and indexes.
2026-01-28 14:37:47 +01:00
Christian
c66d652283 Release v2.0.6 2026-01-28 10:52:36 +01:00
Christian
43c7d64a01 Release v2.0.5 2026-01-28 10:47:29 +01:00
Christian
08b7abbeea Release v2.0.4 2026-01-28 10:41:48 +01:00
Christian
3543a9b079 Release v2.0.3 2026-01-28 10:36:08 +01:00
Christian
7c569527fe Add migration execution feature 2026-01-28 10:25:21 +01:00
Christian
5c63385495 Add migrations link to settings page 2026-01-28 09:09:39 +01:00
Christian
ce7bbff766 Release v2.0.0 updates 2026-01-28 08:03:17 +01:00
Christian
c2a265d5f9 Add local pipeline opportunities 2026-01-28 07:48:10 +01:00
Christian
262fa80aef Add pipeline page and link 2026-01-28 01:41:57 +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
04a472d204 fix: Remove undefined matrixHtml reference
v1.3.148:
- Fixed JavaScript error: matrixHtml is not defined
- Removed duplicate table population code
- bodyRows.innerHTML already contains the matrix HTML
2026-01-27 08:36:32 +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
1f5d6a8536 fix: Add ALLOWED_EXTENSIONS config for file uploads
- Added ALLOWED_EXTENSIONS setting to core config
- Supports PDF, images, documents, and archives
- Fixes supplier invoice upload validation error
- Added configuration to .env.example
2026-01-26 17:07:17 +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
f62cd8104a feat: Enhance time tracking with Hub Worklog integration and editing capabilities
- Added hub_customer_id to TModuleApprovalStats for better tracking.
- Introduced TModuleWizardEditRequest for editing time entries, allowing updates to description, hours, and billing method.
- Implemented approval and rejection logic for Hub Worklogs, including handling negative IDs.
- Created a new endpoint for updating entry details, supporting both Hub Worklogs and Module Times.
- Updated frontend to include an edit modal for time entries, with specific fields for Hub Worklogs and Module Times.
- Enhanced customer statistics retrieval to include pending counts from Hub Worklogs.
- Added migrations for ticket enhancements, including new fields and constraints for worklogs and prepaid cards.
2026-01-10 21:09:29 +01:00
Christian
a1d4696005 feat: Add new time tracking wizard and registrations view
- Implemented a new simplified time tracking wizard (wizard2) for approval processes.
- Added a registrations view to list all time tracking entries.
- Enhanced the existing wizard.html to include a billable checkbox for entries.
- Updated JavaScript logic to handle billable state and travel status for time entries.
- Introduced a cleanup step in the deployment script to remove old images.
- Created a new HTML template for registrations with filtering and pagination capabilities.
2026-01-10 01:37:08 +01:00
Christian
19827d03a8 feat: Enhance time tracking by excluding billed entries from views and approval processes 2026-01-09 08:01:28 +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
1f21ad2ec1 fix: Correct BMC Office router file structure 2026-01-06 13:17:28 +01:00
Christian
08fd2a04c7 feat: Complete activity logging system - customer CRUD, contacts, subscriptions, BMC Office 2026-01-06 13:16:25 +01:00
Christian
af044a7be8 feat: Add comprehensive customer activity logging for all CRUD operations 2026-01-06 13:12:46 +01:00
Christian
50fbb5ab92 feat: Add activity logging for BMC Office subscription imports 2026-01-06 12:54:10 +01:00
Christian
2419ddc5d8 fix: Allow external navigation from settings menu 2026-01-06 08:45:36 +01:00
Christian
c7986b0abf feat: Add BMC Office Import link to admin menu 2026-01-06 08:43:30 +01:00
Christian
bd746b7f9c feat: Add BMC Office subscriptions Excel upload interface with auto customer mapping 2026-01-06 08:21:24 +01:00
Christian
da5ec19188 fix: Use execute_query instead of execute_query_single to return all customer contacts 2026-01-05 19:03:34 +01:00
Christian
935d2253f7 fix: Move order number from heading to otherReference field only 2026-01-05 18:56:24 +01:00
Christian
3195afe460 fix: Only use case_no from vtiger_data, never parse from vtiger_id (v1.3.116) 2026-01-05 17:17:46 +01:00
Christian
34ca9fca93 fix: Prioritize 'title' field over 'ticket_title' from vTiger (v1.3.115) 2026-01-05 17:16:44 +01:00
Christian
99eac06cfd fix: Wizard shows case title instead of case_no (v1.3.114) 2026-01-05 17:12:41 +01:00
Christian
0974f41bd1 feat: Add endpoint to fix empty case titles from vtiger_data (v1.3.113) 2026-01-05 17:06:44 +01:00
Christian
0b9765c5a2 fix: Use 'title' field from vTiger Cases as fallback for ticket_title (v1.3.112) 2026-01-05 16:56:28 +01:00
Christian
1ebb1fa2cd fix: Never use time descriptions as case title, only contact+date fallback (v1.3.111) 2026-01-05 16:52:58 +01:00
Christian
d99d542a24 fix: Use contact name + date as case title fallback (v1.3.110) 2026-01-05 16:44:18 +01:00
Christian
1e45ec70bf fix: Better case title fallback logic - use descriptions or 'Arbejde' (v1.3.109) 2026-01-05 16:43:16 +01:00
Christian
11f9e97c1d fix: Use case_no from vtiger_data for order case numbers (v1.3.108) 2026-01-05 16:34:13 +01:00
Christian
9336edd5cc feat: Add manual customer linking endpoint (v1.3.106) 2026-01-05 14:15:04 +01:00
Christian
fa55e6b98e Fix: Simply-CRM sync opretter nu manglende customers i Hub (ikke kun opdaterer eksisterende) 2026-01-05 12:35:02 +01:00
Christian
5e66ef6563 Add: Customer linking verification endpoint med health score og anbefalinger 2026-01-05 11:34:39 +01:00
Christian
05ec5b5903 Fix: Brug economic_acc_number field fra Simply-CRM (ikke account_no) 2026-01-05 11:28:45 +01:00
Christian
1380369dff Add: Sync e-conomic customer numbers fra Simply-CRM + auto-link timetracking customers 2026-01-05 11:08:49 +01:00
Christian
24a517a10c Fix: Brug fuldt case ID (ikke kun sidste 4 cifre) + auto-link kunder efter vTiger sync 2026-01-05 10:56:32 +01:00
Christian
68eb1d31d1 Fix: Bedre case title fallback og klarere fejlbesked for manglende customer linking 2026-01-05 10:42:57 +01:00
Christian
e69f211fbf Fix: Vis kun den specifikke entry når time_id parameter er sat 2026-01-02 16:53:25 +01:00
Christian
d76296ea73 Fix: Fjern duplicate loadNextEntry() call der overskriver currentEntry 2026-01-02 16:50:40 +01:00
Christian
d704a2f780 Debug: Tilføj console.log for at tracke entry loading i wizard 2026-01-02 16:40:03 +01:00
Christian
1c12014c5a Fix: Load specific entry viser nu korrekt entry selv hvis den ikke er pending 2026-01-02 16:34:59 +01:00
Christian
0b06276963 Fix: displayCaseEntries viser nu korrekt den ønskede entry i stedet for altid første entry 2026-01-02 16:25:13 +01:00
Christian
26fda2e419 Fix: Brug korrekt funktion og setup til at vise specifik time entry i wizard 2026-01-02 16:17:46 +01:00
Christian
1356c251e9 Fix: Tilføj manglende except block i get_customer_time_entries 2026-01-02 16:08:59 +01:00
Christian
bf72fc4a49 Fix: Wizard kan nu hoppe direkte til specifik tidsregistrering via time_id parameter 2026-01-02 15:53:00 +01:00
Christian
8100432079 Vis case titel fra vTiger i fakturalinje beskrivelse 2026-01-02 15:27:46 +01:00
Christian
ffbaf6190a Fjern oprundingsinfo fra fakturalinje beskrivelse 2026-01-02 15:17:46 +01:00
Christian
acc89d9f09 Fix: Fjern dato-mønstre fra fakturalinjer + vis oprunding i minutter 2026-01-02 15:12:05 +01:00
Christian
cbc05b52ce fix: Use execute_query_single for case details (v1.3.83)
- Fix get_case_details using execute_query instead of execute_query_single
- execute_query returns list, execute_query_single returns dict
- Prevents 500 error when loading case details
2026-01-02 13:01:20 +01:00
Christian
45d4f78006 debug: Add detailed logging to approval flow (v1.3.82)
- Add logging before approval object creation
- Add logging after approval object creation
- Add logging before database update
- Add logging after database update
- Add time_id to error messages
- This will help diagnose 500 errors on production
2026-01-02 12:58:53 +01:00
Christian
420507027a fix: Remove ge constraint from rounded_to field (v1.3.81)
- Remove ge=0.25 constraint that prevents None values
- Optional fields should accept None without validation
- Fixes approval validation error
2026-01-02 12:56:27 +01:00
Christian
e45b1ed19e fix: Remove float() conversion for Decimal fields (v1.3.78)
- Let Pydantic handle Decimal conversion
- Send approved_hours as Decimal, not float
- Send rounded_to as Decimal, not float
- Add exc_info=True to error logging
2026-01-02 12:51:12 +01:00
Christian
17cd871909 fix: Add Body() annotation to approval endpoint (v1.3.77)
- Add Body(...) to request parameter
- Import Body from fastapi
- Fix FastAPI body parameter handling
2026-01-02 12:49:19 +01:00
Christian
7cb38663bc fix: Timetracking wizard approval endpoint (v1.3.76)
- Fix parameter handling in approve_time_entry endpoint
- Change from query params to body Dict[str, Any]
- Send all required fields to wizard.approve_time_entry()
- Calculate rounded_to if auto-rounding enabled
- Add approval_note, billable, is_travel fields
- Add Dict, Any imports
2026-01-02 12:45:25 +01:00
Christian
6c4042b9b6 feat: Implement SFTP offsite backup functionality (v1.3.75)
- Add SFTP upload support with paramiko
- Add database columns for offsite tracking (status, location, attempts, error)
- Add manual upload endpoint /api/v1/backups/offsite/{job_id}
- Add frontend button for offsite upload
- Add SFTP configuration in config.py
- Fix infinite loop in _ensure_remote_directory for relative paths
- Add upload verification and retry mechanism
- Add progress tracking and logging
2026-01-02 12:35:02 +01:00
Christian
1b84bee868 Add APScheduler dependency and fix scheduler endpoint 2026-01-02 02:28:33 +01:00
Christian
ebf3b1f31c Fix backup jobs query and add missing config 2026-01-02 02:26:33 +01:00
Christian
3ffee6d428 Add backup storage config settings 2026-01-02 02:23:10 +01:00
Christian
58b598058a Enable backup module functionality 2026-01-02 02:13:17 +01:00
Christian
9fb149c02a Fix Mattermost config field names 2026-01-02 02:06:05 +01:00
Christian
3a3d81cf4c Add Mattermost notification settings 2026-01-02 02:02:44 +01:00
Christian
f77e6dc70b Add backup system configuration settings 2026-01-02 01:54:52 +01:00
Christian
bbb9ce8487 Add debug endpoint for timetracking invoice field diagnostics 2026-01-02 00:01:12 +01:00
Christian
8ac3a9db2f v1.3.64 - Redesigned sync architecture with clear field ownership
BREAKING CHANGES:
- vTiger sync: Never overwrites existing vtiger_id
- Contact sync: REPLACES links instead of appending (idempotent)
- E-conomic sync: Only updates fields it owns (address, city, postal, email_domain, website)
- E-conomic sync: Does NOT overwrite name or cvr_number anymore

ARCHITECTURE:
- Each data source owns specific fields
- Sync operations are now idempotent (can run multiple times)
- Clear documentation of field ownership in sync_router.py
- Contact links deleted and recreated on sync to match vTiger state

FIXED:
- Contact relationships now correct after re-sync
- No more mixed customer data from different sources
- Sorting contacts by company_count DESC (companies first)
2025-12-24 10:34:13 +01:00
Christian
a867a7f128 fix: sync address field from e-conomic (v1.3.63)
- Added address field to UPDATE query in economic sync
- Added address field to INSERT query for new customers
- Fixes issue where address from e-conomic was not synced
- Prevents mixed data (København address with Lundby city/postal)
- Address is now synced along with city, postal_code, country
2025-12-24 09:41:51 +01:00