Fix multiple issues: PDF Unicode, tab persistence, invoice numbering
- Fix#3157: Remove DejaVu Sans as default PDF font to enable proper
Unicode support for Thai and other Asian languages in PDFs
- Fix#2618: Ensure invoice number (nr) is stored as integer to prevent
double-padding when displaying in client dashboard vs admin panel
- Fix#2835: Add tab persistence via URL hash so users stay on their
selected tab (Configuration, Addons, etc.) after page reload
Co-authored-by: OpenCode
Fix#3158: Display Before and After invoice content in PDF
The PDF invoice template was missing the code to render text_1 (before
invoice table) and text_2 (after invoice table) fields, even though these
fields are properly stored in the database and passed to the template.
Changes made:
- Added text_1 rendering before the invoice items table
- Added text_2 rendering after the invoice items table but before footer
- Used consistent styling and markdown filter matching HTML templates
The fix resolves the issue where banking details and other notes entered
in the Before/After Invoice fields were not appearing in PDF invoices.
Fix: Persist currency selection on installation validation failure (#2746)
- Move currency session storage before validation steps
- Prevents currency from resetting to USD when database connection or admin validation fails
- Ensures consistent behavior with other form fields
Fix: Prevent add funds invoices from being auto-paid with credits
When paying an add funds invoice via Stripe or PayPal, the payment was
processed successfully but the balance would show as /bin/zsh. This happened
because after adding funds to the client balance, the code would also try
to pay the invoice using credits, effectively canceling out the deposit.
The fix adds a check using the existing isInvoiceTypeDeposit() method to
skip the credit payment for deposit invoices, since funds were already
added directly.
FixesFOSSBilling/FOSSBilling#2988
Added additional Stripe charge statuses to the status mapping, ensuring more accurate transaction status handling for cases such as 'requires_action', 'requires_payment_method', 'requires_confirmation', 'requires_capture', 'processing', and 'canceled'.
* chore: Remove jQuery dependencies and update build system
- Remove jQuery from theme dependencies
- Simplify build configuration
- Update documentation to reflect jQuery removal
- Apply PSR-12 code style formatting
- Replace jQuery with vanilla JS in ClientBalance adapter
* refactor: Complete JavaScript API rewrite with modern architecture
- Rewrite API.js with improved URL handling and CSRF management
- Add reusable utility functions in utils.js
- Remove deprecated jQuery-based bb object
- Update Tom Select integration
* feat: Add Twig API functions for declarative API interaction
- Add fb_api(), fb_api_form(), fb_api_link() Twig functions
- Add asset deduplication to prevent duplicate script/style loading
Note: Dashboard/Index module moved to separate refactor/index PR
* refactor: Integrate new API into theme layouts and core templates
- Update theme layouts to use new API functions
- Convert theme partials and macros
- Update core admin module templates (System, Theme, Wysiwyg, Staff)
* refactor: Update module templates to use new API functions
- Replace data-api-* attributes with fb_api_*() Twig functions
- Remove manual CSRF token handling
- Update all module templates for consistency
Note: Index module excluded (moved to refactor/index PR)
* Remove custom ignore rule from phpstan.neon
Deleted a specific ignore rule for ctype_alnum argument count in src/modules/Extension/Service.php, likely because it is no longer needed or the underlying issue has been resolved.
* Validate `gateway_id` in IPN and transaction creation
Added input validation for `gateway_id` in `ipn.php` to ensure it is a positive integer, returning a 400 error for invalid values. In ServiceTransaction, now checks if the provided `gateway_id` exists in the database and throws an exception if not, logging a warning for invalid gateway IDs.
* Add logger existence check in `ServiceTransaction`
Ensures that the logger is set before attempting to log a warning when an invalid `gateway_id` is encountered. Also removes an unnecessary `gateway_id` entry from test data in `ServiceTransactionTest`.
Wrapped `OR` conditions in SQL `WHERE` clauses with parentheses across multiple service classes to ensure correct logical grouping and prevent operator precedence issues during search queries.
* Initial plan
* Remove unused variables and fix test issues in Invoice ServiceTest
- Remove unused $itemInvoiceServiceMock variable from testGetDi()
- Remove duplicate test data for 'id' => 1 in dataForSearchQuery()
- Remove unused $itemInvoiceServiceMock and fix closure in testToApiArray()
- Remove duplicate setDi() call in testOnAfterAdminInvoiceReminderSent()
- Fix incorrect method call to onAfterAdminInvoiceReminderSent()
Co-authored-by: admdly <2807620+admdly@users.noreply.github.com>
* Fix test: handle both 'email' and 'Email' service names
The onAfterAdminInvoiceReminderSent method calls mod_service('Email')
with uppercase E, but the test closure was only checking for lowercase
'email'. Updated the closure to handle both cases.
Co-authored-by: admdly <2807620+admdly@users.noreply.github.com>
* Fix test: remove return value assertions for void method
The onAfterAdminInvoiceReminderSent method has a void return type,
so the test should not check for a return value. Removed the result
variable and assertions that were expecting a boolean return.
Co-authored-by: admdly <2807620+admdly@users.noreply.github.com>
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: admdly <2807620+admdly@users.noreply.github.com>
* Apply security and code quality fixes to Invoice Service
- Rename ambiguous variable 'int' to 'search_numeric_id'
- Fix SQL injection in order IDs batch loading with parameterized queries
- Fix SQL injection in product IDs batch loading with parameterized queries
- Replace hard-coded 'unpaid' with Model_Invoice::STATUS_UNPAID constant
- Rename camelCase 'invoiceIdentifier' to snake_case 'invoice_identifier'
Co-authored-by: admdly <2807620+admdly@users.noreply.github.com>
* Improve readability of product lookup logic
Simplify nested ternary operator by extracting product ID lookup into a separate variable for better code readability.
Co-authored-by: admdly <2807620+admdly@users.noreply.github.com>
* Fix PHPUnit test for renamed parameter
Update test expectation to use 'search_numeric_id' instead of 'int' to match the code changes that renamed this parameter for better clarity.
Co-authored-by: admdly <2807620+admdly@users.noreply.github.com>
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: admdly <2807620+admdly@users.noreply.github.com>
* Remove Font Awesome from huraga theme and related modules
* Add `aria-hidden` to SVG icons for accessibility
Added the aria-hidden="true" attribute to SVG icons in order button and layout templates to improve accessibility for screen readers.
* Replace jQuery with vanilla JS in `PayPalEmail` adapter
Removes jQuery dependency for auto-redirect functionality by using
document.addEventListener('DOMContentLoaded', ...) instead of .ready()
* Apply suggestions from code review
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* fix(deps): update dependency php-debugbar/php-debugbar to v3
* Add `php-debugbar/twig-bridge` and update dependencies
Added `php-debugbar/twig-bridge` to `composer.json` and updated several dependencies to their latest versions, including doctrine/collections, doctrine/orm, dompdf/php-svg-lib, monolog/monolog, php-debugbar/php-debugbar, pimple/pimple, prinsfrank/standards, sabberworm/php-css-parser, symfony/* packages, and others. These updates improve compatibility, security, and feature support.
---------
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Adam Daley <admdly@users.noreply.github.com>
* chore(deps): update streetsidesoftware/cspell-action digest to 24fa8d3
* Update PHPStan config to ignore `ctype_alnum` argument count
Added a new ignore rule in `phpstan.neon` for the 'Function ctype_alnum invoked with 1 parameter, 0 required' message in src/modules/Extension/Service.php. Minor formatting change in `phpstan-baseline.neon`.
---------
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Adam Daley <admdly@users.noreply.github.com>