* Fix the batch connect logic for hooks
Closes#2729 by fixing the logic for hook connections and added a solution to remove anything that was registered when it wasn't really a hook
* Slight optimization. Also probably fixed the tests
* We can continue early here as a tiny optimization
* Update ServiceTest.php
* Update ServiceTest.php
* Introduce the new Paginator class
* Rename it back to Pagination
* Move #2756 here
* Use HttpFoundation\Request
* Restore Box_Paginator
* Tests
* Replace the deprecated methods wherever used
* No need
* Tests
* Tests again
* tests
* Tests hopefully for the last time
* Use a subquery instead
* Found a faulty query
`m.*` already includes `client_id`. was getting a duplicated column error.
* New pagination logic in Huraga & a couple of improvements
* Type safety
* Accessibility and other improvements
* Fixed tests
* Make aria tags translatable
* Update partial_pagination.html.twig
* Dot operator and little docblock improvement
---------
Fix: Invoice Tax and Balance Logic
This commit provides a comprehensive fix for invoice tax calculations and client balance deductions when handling discounted invoices.
Modifications in `src/modules/Invoice/Service.php`:
1. `getTax()`: Overhauled to calculate tax based on the sum of all taxable invoice item amounts (price * quantity) *before* applying the invoice's tax rate and rounding. This ensures a single, accurate tax value for the entire invoice.
2. `toApiArray()`: The internal tax calculation for display purposes was previously updated to use this same "tax on total taxable subtotal" method, ensuring consistency between displayed tax and actual tax.
3. `getTotalWithTax()`: Now correctly uses the reformed `getTax()` method, ensuring it reflects the accurate total invoice amount.
4. `tryPayWithCredits()`: When an invoice is paid using client credits, this method now:
a. Uses the accurate amount from `getTotalWithTax()` for the deduction.
b. Creates a single `ClientBalance` transaction for this precise amount.
c. Calls `markAsPaid($invoice, false, true)` to prevent per-item balance transactions (which caused rounding issues) while still marking items as paid and executing service activations.
These changes collectively ensure that invoice tax is calculated and displayed consistently, and that client balance deductions for paying discounted invoices are accurate and reflect the true invoice total.
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Co-authored-by: Yağızhan <yagizhan49@protonmail.com>
Co-authored-by: John P <64874788+j-a-pope@users.noreply.github.com>
* +toHostingAccountApiArray
* +getAccountsSearchQuery
* +accounts_get_list & pagination fix for server_get_list
* Update AdminTest.php
* +tests for the account_get_list
* Update Admin.php
* Also return linked order and client data
* Update AdminTest.php
* Removed duplicated field
* Adam's suggestions
* Add delays to prevent email enumeration
* Wording tweak
* This should fix the tests
Also ran PHP-CS-Fixer and Rector
* Update ServiceTest.php
---------
Co-authored-by: Jaap Marcus <9754650+jaapmarcus@users.noreply.github.com>
* Removed the hardcoded currencies list
Also streamlined the process of adding new currencies by allowing the title & exchange rate to automatically be determined.
* Use an existing translatable string
* Update the test workflows
* Dropped the legacy test, wrote two new ones
* Fixed a typo in my assert
* Whooooops
* Bumped the Rector deadcode level
* Added the instanceof setlist
* Increasded type coverage and updated tests config too
* Bumped type coverage & ran PHP-cs-fixer
* Redid the currency rate provider UI
* Bug fix, implemented the syncing functionality
* Changes for CSpell
* This should fix the test
* Updated the UI / wording, added the data attribution
* Small tweaks
* Fix the cache key I duplicated
* Very small fixes
* Also ensure we reference the old key when syncing
Otherwise the next update would unexpectedly break this for people because their old config wouldn't apply anymore
* Slight UI improvement
* Fix accidental capitalization
* Bump the password hash cost from 10 to 12
And a few minor changes to the password class + moving it under the FOSSBilling namespace
* Slight fixup, spelling fixed
* Added proper TLD validation
* Bug fix
* Remove the test that broke.. It doesn't really test anything
* Reduce the cache length if our final validation fails
* Switched to a different list
* Update cspell.json
* Small fix
* And another one, whoops
* Slight structure change to the testcases
* Fix
* Ported some random low-level tests
* Spelling
* Ported over some other low-level tests
* Fixes
* And now other fixes
* Another one
* Wrote a few more tests, improvements
* Ran Rector & PHP-CS-Fixer
* Append a capital letter to the test client passwords
* Minor tweaks
* Display more info after the tests run
* Oops, I forgot to set the dir
* Fix cron behavior for test env, dropped legacy tests
* Rename the empty test suite so PHPUnit ignores it
* Update cspell.json
* Minor tweaks to the tests
* Fixes
* Implemented a new class for config management
* Run Rector & PHP-CS-Fixer
* Spelling
* Pointed a bunch of code to the new class
* Fix tests, removed 2 broken ones that did nothing
* Quick run of PHP-CS-Fixer
* Fixed issues noticed in self review
* Updated remaining old methods. Fixed minor error page issue
* Very minor code tweak
* Fixes, added a related test
* Check for OPCache functions being defined
* I don't think this timeout is needed
* Rename tests to tests-legacy
* Groundwork for live tests
* Somewhat working tests on a live instance
* Hmmmmmm
* Fix
* Fixed the other bug
* Added a handful of various tests
* Typos, all these are admin endpoints
* Bypass this check for testing envs
* Disable it for now
* Mini cleanup
* Cleanup from debugging, ran PHP-CS-Fixer