Commit Graph

129 Commits

Author SHA1 Message Date
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
Christian
0dd24c6420 fix: better error handling for order generation (v1.3.62)
- Added more specific error message when customer not found
- Added debug logging to check customer object type
- Changed error from 'Customer not found' to include customer_id
- Helps diagnose 'string indices must be integers' error
2025-12-24 09:39:31 +01:00
Christian
d228362617 fix: parse customer_rate as float in wizard (v1.3.61)
- Fixed customer_rate being returned as string from DB (NUMERIC type)
- Added parseFloat() when using customer_rate in calculations
- Fixes customer stats showing '-' instead of actual hourly rate
- Applied to loadCustomerContext(), displayCaseEntries(), and approveEntry()
2025-12-24 09:35:46 +01:00
Christian
097f0633f5 fix: settings sync stats loading (v1.3.60)
- Fixed loadSyncStats() to correctly parse API response
- Customers API returns {customers: [...]} not array directly
- Added const data = await response.json() and data.customers
- Fixes sync stats counters showing NaN or incorrect values
2025-12-23 15:50:20 +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
1b0217ef7b feat: manual link customer to e-conomic (v1.3.58)
- Added POST /api/v1/customers/{id}/link-economic endpoint
- Allows manually setting economic_customer_number for customers without CVR
- Useful for vTiger customers that can't auto-match via CVR or name
- Updates last_synced_at timestamp when linking
2025-12-23 15:36:17 +01:00
Christian
c254e7cb76 feat: dynamic version from VERSION file (v1.3.57)
- Created VERSION file with current version
- Health endpoints now read version from VERSION file instead of hardcoded
- Fixes issue where health check showed wrong version
- main.py /health and /api/v1/system/health now show correct version
2025-12-23 15:32:34 +01:00
Christian
0833f149e1 fix: always sync economic_customer_number from e-conomic (v1.3.56)
- Fixed UPDATE query to include economic_customer_number field
- Previously only set on INSERT, not UPDATE when matching by CVR
- Now e-conomic customer number is always synced as source of truth
- Fixes issue where customers synced from e-conomic were missing customer numbers
2025-12-23 15:22:55 +01:00
Christian
38a47f4d27 fix: wizard customer_rate field name mismatch (v1.3.55)
- Changed wizard.html to use customer_rate instead of customer_hourly_rate
- Fixes issue where wizard displayed default 1200 DKK instead of customer-specific hourly rate
- Backend API returns customer_rate field (from TModuleTimeWithContext model)
- Frontend now correctly reads customer_rate from API response
- Affected lines: 571, 807, 1084 in wizard.html
2025-12-23 15:12:45 +01:00
Christian
64e85da71c Fix: Use absolute URL for bulk rate update to avoid path resolution issues (v1.3.54) 2025-12-23 15:03:49 +01:00
Christian
641698be8b Fix: Bulk customer rate update using request body (v1.3.53)
Fixed API endpoint to accept JSON request body instead of query params:
- Added TModuleBulkRateUpdate Pydantic model
- Changed endpoint to accept request body
- Fixed parameter references to use request.customer_ids and request.hourly_rate
- Added migration for hourly_rate_updated and time_card_toggled event types

Resolves: 'Not Found' error and audit log constraint violations
2025-12-23 14:39:57 +01:00
Christian
246ad27fe3 Feature: Bulk customer hourly rate updates (v1.3.52)
Added bulk selection and update functionality for customer hourly rates:

Frontend (customers.html):
- Added checkbox column with select-all functionality
- Created bulk price update modal with customer list
- Implemented JavaScript for selection state management
- Shows selected count in UI badge
- Supports indeterminate state for partial selection

Backend (router.py):
- New POST /api/v1/timetracking/customers/bulk-update-rate endpoint
- Accepts {customer_ids: List[int], hourly_rate: float}
- Updates multiple customers in single SQL query
- Creates audit log entries for each updated customer
- Returns updated count

Use case: Select multiple customers and update hourly rate simultaneously
2025-12-23 14:31:10 +01:00