* Fix crash on Product Promotions page for promo rows with NULL flags The `promo` table's maxuses/used/freesetup/once_per_client/recurring/ active columns are nullable in the DB, but the Doctrine entity mapped them as non-nullable typed properties. When a row (typically from a legacy install) has NULL in one of these columns, Doctrine's TypedNoDefaultPropertyAccessor unsets the property instead of applying the PHP default, so any read throws "must not be accessed before initialization" — crashing the admin Product Promotions page. Align the entity mapping with the actual nullable schema and coalesce null to the intended defaults in the getters and toApiArray(). Fixes #3942 * Coalesce NULL used counts in promo usage SQL promoCanBeApplied() now treats a NULL used column as 0, but PromoRepository's raw SQL for incrementing/decrementing usage did not: `used + 1` and `GREATEST(used - ?, 0)` both propagate NULL in MySQL, and `maxuses > used` is unknown (never true) when used IS NULL. That let checkout accept a legacy promo with a NULL used count and then immediately fail to reserve it, throwing "maximum number of uses reached". Coalesce used to 0 in both the SET and WHERE clauses so reservation matches what promoCanBeApplied() already allows.
Note
FOSSBilling is under active development and currently considered beta. Expect rough edges and limited support.
FOSSBilling is a free, open-source billing and client management system. It helps online service businesses automate invoicing, payments, and client communication. While it’s popular with web hosting providers, it also works well for software licensing, digital downloads, and subscription services.
Features
- Billing & Invoicing: automated invoices, reminders, and basic reporting.
- Client Management: a central place for client data and communication.
- Extensibility: extension-friendly architecture for integrations and custom features.
- Payments: support for multiple gateways.
- Translations: community-powered, multi-language interface.
- Responsive UI: usable on desktop and mobile.
- Security-focused: built with security best practices in mind.
Getting Started
Requirements
FOSSBilling runs on standard LAMP/LEMP stacks. For the latest system requirements (PHP version, extensions, database, etc.), see the official requirements.
Installation
Follow the step-by-step Getting Started guide.
Just exploring? Try the public demo.
Contributing
We welcome contributions from the community! We’re actively modernizing the codebase and there’s plenty to do.
- Read the contributor guide.
- Pick an item from the open issues.
- Open a PR when you’re ready.
If you prefer to start a conversation first, drop by the forum or say hello on Discord.
Star History
Not a developer? Starring the repository helps others discover the project.
License
FOSSBilling is released under the Apache 2.0 license. See LICENSE for details.
This project includes third-party work:
- Open Source Iconography by Pictogrammers under the Pictogrammers Free License.
Links
- Website: https://www.fossbilling.org/
- Documentation: https://docs.fossbilling.org/
- Discord: https://fossbilling.org/discord
- Twitter/X: https://twitter.com/FOSSBilling
