[Feature] Cost Centers and Billing Functionality#1448
Conversation
- Introduced cost center permissions in permissions.py. - Added finance-related fields and models in archive.py, finance.py, library.py, print_queue.py, and settings.py. - Implemented database migrations for cost centers and wallet transactions in database.py.
…the backend - Introduced CostCenter and related models for managing print costs and budgets. - Updated PrintArchive and PrintQueueItem models to include cost_center_id and estimated_cost. - Implemented budget reservation logic in finance services to validate and manage print costs. - Enhanced ArchiveService and BackgroundDispatchService to handle cost center information during print jobs. - Added wallet transaction handling for print charges, including partial charges based on filament usage. - Created finance billing and budget services to manage user wallets and budget reservations. - Ensured user finance defaults are created upon user registration, including wallets and private cost centers. - Updated print scheduler to validate budget before processing print jobs.
Settings: - Introduced billing enabled toggle with printer kill switch functionality in the settings. - Added finance monthly budget reset day and timezone settings. Other: - Added cost center fields to PrintModal (if enabled) - Switched sequence in PrintModal (cost center after estimated cost, and before print options) - Implemented Finance Page
…ed for fr, it, ja, pt, zh)
|
2026-05-23 13:28:33,480 INFO [root] [-] Bambuddy starting - debug=False, log_level=INFO |
|
...should be fixed but I my setup is not using PostgreSQL so its an untested fix unfortunately. |
Description
This PR introduces a billing functionality to BamBuddy. This includes cost center creation/management (each user has a personal one as well as optional shared ones), wallet transactions, budget tracking, and financial reporting.
Related Issue
Fixes #1065
Documentation
Companion docs PRs (delete lines that don't apply):
Pick one:
Type of Change
Changes Made
Screenshots
Changes:





PrintModal (before):
PrintModal (after):
Queue (before):
Queue (after)
Queue with insufficient budget (same behavior for PrintModal)
Settings (before):


Settings (after):
New:






Create a new cost center:
Manage cost center members:
Adjust Wallet (Deposit/Withdraw):
Add a (historic) print:
Personal View:
Admin View:
Testing
Checklist
Additional Notes
The docs entry is currently kept very short but is obviously a candidate to be extended and explained a lot more.
I only have access to one printer, i.e., I am not aware if there are side effects using more printers. Likely I missed some cases for the tests.