This project is not covered by Drupal’s security advisory policy.

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.

Frontend

User balance sheets can be viewed at "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.

D7 Status

Currently, this module has not been fully ported to D7. I would like to do so reasonably soon, however, I want to push some further improvements to the D6 version before doing a D7 port.

D8 Status

A Drupal 8 port has been made from the current D7 dev branch. Work is still ongoing.

adan has contributed a monster patch in Token, rules, realname integration and other improvements patch which contains a lot of improvements. However, the size of it is too big for me to break up and review on my own. If someone could break up the different added features into their own issues, I would love to review and include them separately. Once that is all in, I will move into the D7 port.

Sponsor

Module developed by Brian Vuyk Web Design & Development.

Project Information

Downloads