You are here

function userpoints_rules_amount_before in User Points 6

Condition: check Userpoints before the transaction

File

./userpoints_rules.rules.inc, line 187
Provide better integration into the rules module

Code

function userpoints_rules_amount_before($account, $transaction, $settings) {
  $balance = userpoints_get_current_points($account->uid, $settings['type']) - $transaction['points'];
  return $balance >= $settings['amount'];
}