Balance Tracker

brianV - June 25, 2009 - 20:17
User Balance sheet, with UI tools to add custom credits and debits

Balance Tracker creates a balance sheet to display account credits and debits belonging to users. It also provides UI tools, Views integration, and an API to allow the site administrators or other modules to credit or debit a user's account. This is intended for any website or service which credits users for accounts, sales, or other activities, and needs to track payouts.

#D7CX: Balance Tracker will have a full Drupal 7 release on the day that Drupal 7 is released.

Frontend

User balance sheets can be viewed at user/balance or user/%uid/balance. Please note that the 'view all balances' and 'view own balances' must be set accordingly.

A report for all user's balances may be viewed at admin/reports/balances.

All date, time & currency formats are configurable by the admin for international usage.

Invite Commissions

'Invite Commissions' is a module packaged with Balance Tracker since 6.x-1.4. Invite commissions integrates Ubercart, Invite, and Balance tracker. It automatically credits a user with a configurable commission percentage of any sales made by other users whom the user has invited. This is intended both to provide a useful functionality as well as demonstrate how BT can be used on a production site.

You will need to set up a new Ubercart Conditional Action to use the 'Pay commissions to inviting user' action. Best used on the 'Order status updated' trigger.

API

Balance Tracker provides a simple API to credit and debit charges. Once I have a handbook page set up, it will be described better. For now, the API functions are below:

balance_tracker_credit_account($uid, $amount, $message)
Credit a user's account.
balance_tracker_debit_account($uid, $amount, $message)
Debit a user's account.
balance_tracker_get_balance($uid)
Get the user's current balance
hook_balance_prewrite($uid, $type, &$amount, &$message)
Hook called prior to a balance item being written. Can be used to modify the amount or the message prior to saving.
hook_balance_write($uid, $type, $amount, $message)
Hook called after a balance item is written.

Future Plans

The near future hold the development of a 'Simple Statistics' module to provide some simple monthly credit & debit statistics for users. This will be developed as an optional sub-module, as many implementations will likely implement their own statistics for their own specific needs.

7.x Port

I've begun work on porting the module to 7.x, and the module is mostly functional under D7! However, as the module depends on the Views and Date modules, a full D7 port cannot be released until these two modules have working D7 code available.

Sponsor

Module developed by Brian Vuyk Web Design & Development. We are happy to quote any Balance Tracker-related development work.

Downloads

Recommended releases

Version Downloads Date Links
6.x-1.6 Download (16.63 KB) 2010-Jan-02 Notes

Development releases

Version Downloads Date Links
7.x-1.x-dev Download (16.92 KB) 2010-Jan-05 Notes
6.x-1.x-dev Download (16.64 KB) 2010-Jan-03 Notes


 
 

Drupal is a registered trademark of Dries Buytaert.