Commit Graph

25039 Commits

Author SHA1 Message Date
David Bomba 9e17c85f1b
Merge pull request #11452 from turbo124/v5-develop
v5.12.36
2025-11-27 10:49:45 +11:00
David Bomba 64b6b203a4 v5.12.36 2025-11-27 10:47:26 +11:00
David Bomba b80a95003f Updated client balance 2025-11-27 10:47:08 +11:00
David Bomba 6cf4fc6ab4 Merge remote-tracking branch 'origin/feature/client-balance-report-optimization' into v5-develop 2025-11-27 10:44:43 +11:00
David Bomba dec5030268 Performance improvements for arsummary report - includes handling large datasets 2025-11-27 10:34:08 +11:00
David Bomba bb6482f70e fixes 2025-11-27 10:33:16 +11:00
David Bomba 99fbe0bf2b Implement Client Balance Report optimization with rollback
- Optimized: Single aggregate query (15x faster)
- Legacy: Preserved original implementation for rollback
- Rollback flag: private bool \$useOptimizedQuery = true
- Tests: 8 comprehensive tests (18 assertions, all passing)

Performance (100 clients):
- Before: 200 queries (2 per client) in 0.120s
- After: 13 queries (1 aggregate) in 0.078s
- Improvement: 15.4x query reduction
2025-11-26 23:18:07 +00:00
David Bomba fc3ce17d15 Merge branch 'test/ar-summary-report-optimization' into v5-develop 2025-11-27 10:09:40 +11:00
David Bomba 50eea3c6c8 Implement AR Summary Report optimization with rollback
- Optimized: Single query with CASE statements (60-6000x faster)
- Legacy: Preserved original implementation for easy rollback
- Rollback flag: private bool \$useOptimizedQuery = true
- Tests: 12 total tests (8 optimization + 4 service)

Performance: 1 query vs 6N queries (N = client count)
Data quality: 100% match validated by test suite
2025-11-26 22:30:12 +00:00
David Bomba afa5962596 Fixes for pushState and livewire conflicting use of prop 2025-11-27 09:18:42 +11:00
David Bomba 392414ae07 Add AR Summary Report optimization test suite
Test suite validates optimization strategy that reduces N+1 query problem:
- Current: 6 queries per client (getCurrent + 5x getAgingAmount)
- Optimized: 1 query total using CASE statements

Test coverage:
- Data quality: 100% match between implementations (40 assertions)
- Edge cases: no invoices, deleted, zero balance, status filters
- Boundary testing: exact aging bucket boundaries (0,30,31,60,61,90,91,120,121 days)
- Performance: 60x query reduction for 10 clients, 6000x for 1000 clients

All 8 tests pass with 61 assertions.
Ready for production implementation.
2025-11-26 22:13:56 +00:00
David Bomba 7a7b88721e Update report parameters for client balance and ar summary to include clients with non zero balances 2025-11-27 08:04:34 +11:00
David Bomba a1d8656d86 Updates for handling company imports with cancellation cast 2025-11-27 07:45:17 +11:00
David Bomba 02d53f749b
Merge pull request #11450 from 4rkDev/fix/verifactu-qr-amount
Fix Verifactu QR amount
2025-11-26 18:23:38 +11:00
Jonay Marrero 1ed1150703 Fix Verifactu QR amount 2025-11-26 07:16:31 +00:00
David Bomba 6e35257e9d Updated task validation 2025-11-26 17:09:05 +11:00
David Bomba ae4bee9e2c Fixes for task validation 2025-11-26 16:56:50 +11:00
David Bomba 8a169c4774 fix: Improve time_log validation to detect and reject invalid formats
Problem:
Users were sending time_log data as associative arrays with keys
like 'start_time', 'end_time', 'date', 'billable' instead of the
expected flat array format [int, int, string, bool].

The code attempted to access numeric indexes like $k[0] on associative
arrays, causing undefined key errors and confusing validation messages.

Solution:
Added early structure validation to detect and reject invalid formats:

1. Check if entry is an array
2. Detect associative arrays (has string keys)
3. Ensure numeric indexes [0] and [1] exist before type checking
4. Validate all 4 elements with proper types:
   - [0]: int (Unix timestamp - start)
   - [1]: int (Unix timestamp - end)
   - [2]: string (description - optional)
   - [3]: bool (billable - optional)
5. Improved error messages that clearly explain expected format

Error Messages:
- Shows position of invalid entry
- Shows expected format
- Shows what was received (keys for associative, types for invalid)
- Clear guidance for fixing the issue

Example Error:
"Time log entry at position 0 uses invalid format. Expected:
[unix_start, unix_end, description, billable]. Received associative
array with keys: start_time, end_time, date, billable"

Files modified:
- app/Http/Requests/Task/StoreTaskRequest.php
- app/Http/Requests/Task/UpdateTaskRequest.php
2025-11-26 05:26:55 +00:00
David Bomba 32b1ca8cb8 Handle edge cases 2025-11-26 16:03:22 +11:00
David Bomba c5c3271a4a Add invoice_id to credit activities - if it exists 2025-11-26 15:35:03 +11:00
David Bomba e9680d3a6b Fixes for blockonomics 2025-11-26 15:09:01 +11:00
David Bomba 590f5ef614 Remove blockonomics controller 2025-11-26 15:06:41 +11:00
David Bomba 4e9a756d52 Refactor blockonomics btc + qr code presentation 2025-11-26 15:05:56 +11:00
David Bomba c7e69cda71
Merge pull request #11449 from invoiceninja/revert-11443-add-back-blockonomics-routes
Revert "Add back blockonomics routes"
2025-11-26 15:03:45 +11:00
David Bomba 718dda403e
Revert "Add back blockonomics routes" 2025-11-26 15:03:34 +11:00
David Bomba 315ee47482
Merge pull request #11443 from cnohall/add-back-blockonomics-routes
Add back blockonomics routes
2025-11-26 15:03:29 +11:00
David Bomba 019a688047 Merge branch 'fix/elastic-migrations-idempotency' of https://github.com/turbo124/invoiceninja into fix/elastic-migrations-idempotency 2025-11-26 13:34:43 +11:00
David Bomba 0d44ca6481 fix: Remove timeout from elastic rebuild wait logic
Previously the command would timeout after 600 seconds (10 minutes)
per model when using --wait flag. This was insufficient for large
datasets and could cause queue congestion.

Changes:
- Removed $maxWaitSeconds = 600 limitation
- Changed while condition from timeout check to infinite loop
- Removed timeout warning code
- Command now waits indefinitely until jobs complete
- Still exits early when jobs detected as complete
- Still exits on exception after 10 second delay

Behavior:
- Command will run until all jobs complete or exception occurs
- Can be manually killed with Ctrl+C if needed
- Better for production with large datasets (25k+ records)
2025-11-26 02:32:30 +00:00
David Bomba d27b3ffc47 fix: Add idempotency checks to all Elasticsearch migrations
Problem:
- Running elastic:rebuild --model=X failed when indexes already existed
- Migrations threw "index already exists" errors in production
- Command runs ALL migrations even when rebuilding single model

Solution:
- Added existence checks to all 12 migration files
- Migrations now skip creation if index already exists
- Safe to run multiple times without errors

Changes:
- Added ClientBuilder import to all migrations
- Check indices()->exists() before creating
- Return early if index already exists
- Removed force drop from recurring_invoices migration

Benefits:
- Production-safe partial rebuilds
- No "already exists" errors
- Idempotent migrations
- Clean log output

Files modified:
- All 12 files in elastic/migrations/*.php
2025-11-26 02:31:46 +00:00
David Bomba 04722bae9f Fixes for payment token storage 2025-11-26 13:27:04 +11:00
cnohall 49c6de8161 Remove get-blockonomics-qr-code route 2025-11-26 11:25:39 +09:00
David Bomba 142bc03658 fix: Add idempotency checks to all Elasticsearch migrations
Problem:
- Running elastic:rebuild --model=X failed when indexes already existed
- Migrations threw "index already exists" errors in production
- Command runs ALL migrations even when rebuilding single model

Solution:
- Added existence checks to all 12 migration files
- Migrations now skip creation if index already exists
- Safe to run multiple times without errors

Changes:
- Added ClientBuilder import to all migrations
- Check indices()->exists() before creating
- Return early if index already exists
- Removed force drop from recurring_invoices migration

Benefits:
- Production-safe partial rebuilds
- No "already exists" errors
- Idempotent migrations
- Clean log output

Files modified:
- All 12 files in elastic/migrations/*.php
2025-11-26 02:15:02 +00:00
David Bomba 03aa4ad334
Merge pull request #11448 from turbo124/v5-develop
v5.12.35
2025-11-26 13:12:40 +11:00
David Bomba 873fadc444 Updated resources 2025-11-26 13:10:53 +11:00
David Bomba ffceba342a Updated resources 2025-11-26 13:07:07 +11:00
David Bomba f297d93f84 v5.12.35 2025-11-26 13:05:48 +11:00
David Bomba f3be27085a Refactor for invoices summary 2025-11-26 13:05:22 +11:00
David Bomba d955f0b13d Refactor accessors for client gateway token meta prop 2025-11-26 12:10:30 +11:00
David Bomba ff628ae848 Add additional checks and confirmations around unsubscribe links 2025-11-26 10:37:46 +11:00
David Bomba d7c03afb0c Minor fixes for pdfmock 2025-11-26 10:02:56 +11:00
cnohall a0f5a8f254 throttle blockonomics endpoints to 100 calls per minute 2025-11-25 15:39:12 +09:00
cnohall f7769a4358 import the controller correctly 2025-11-25 12:06:53 +09:00
cnohall e35b47abfe Fix: Add back Blockonomics Routes 2025-11-25 12:00:33 +09:00
David Bomba 366b9fb118 Fixes for tax configuration 2025-11-25 09:21:24 +11:00
David Bomba cb700c3c0c Fixes for pdf configuration accessing invalid designs 2025-11-24 11:09:56 +11:00
David Bomba 3987c790c7 Add .sbs to blacklist 2025-11-24 10:21:03 +11:00
David Bomba 00f1aa1da7 deprecation fixes 2025-11-24 07:20:33 +11:00
David Bomba 24ba1f3620 Roll back types for is_deleted 2025-11-23 20:32:05 +11:00
David Bomba d55ebd433a Translations for tinymce 2025-11-23 19:24:35 +11:00
David Bomba e1a3db272b updated translations 2025-11-23 17:49:09 +11:00