alexis 34 Report post Posted January 29, 2016 I believe, it would be good to have a condition to check for the balance of a member: whether a user has a necessary amount of points for doing some certain actions. Currently we have only six conditions, included in Points Economy, and some of them probably should help to check, whether points are enough, if we know some of PHP code: The problem is, that not all the forum admins' php knowledge is good enough to fill that text area, so probably adding "points" to the data use for this condition will help? Since the amount of points should be an integer field, it won't be too complicated? (The event of the rule above is just a "Custom Data updated") By the way, I didn't find a way, how to make such actions with points like we can do with Updating our custom data fields: As you can see, I'm particularly speaking about missing the "subtract" action. In the Actions, we only have two possible operations which we can do with Economy Points: "Credit or Debit a points balance" and "Transfer or exchange a points balance". With the first one, we only can proceed with Automatic Credit/Debit, Credit Only or Debit Only adjustment types. But none of them allow us to input a negative amount for adjustment! That's why for the operations, where we need the certain points amount to be subtracted, we have to use another E.Points action called "Transfer or exchange a points balance". Is it planned to be done in this way? Or do I miss something? (Kevin, what about adding a Spoiler button to the Editor on your forum? ) 1 Quote Share this post Link to post Share on other sites
Kevin Carwile 295 Report post Posted January 29, 2016 13 minutes ago, alexis said: I believe, it would be good to have a condition to check for the balance of a member I agree. 14 minutes ago, alexis said: and some of them probably should help to check, whether points are enough You can check if a credit or debit is possible using the condition to check if an adjustment is possible. 16 minutes ago, alexis said: so probably adding "points" to the data use for this condition will help? Since the amount of points should be an integer field, it won't be too complicated? Balances are different per bank, and currency can have decimal places, and available balance vs total balance are different, and the member might have a balance but has been moved to a group without permission to use it... 23 minutes ago, alexis said: As you can see, I'm particularly speaking about missing the "subtract" action. In the Actions, we only have two possible operations which we can do with Economy Points: "Credit or Debit a points balance" Credit is addition, Debit is subtraction. 26 minutes ago, alexis said: But none of them allow us to input a negative amount for adjustment! Because if you credit 1 point, that adds 1 point. If you debit 1 point, that subtracts 1 point. You dont credit or debit negative values. The "automatic" option will take an event argument and either credit or debit according to if it is negative or not. 30 minutes ago, alexis said: That's why for the operations, where we need the certain points amount to be subtracted, we have to use another E.Points action called "Transfer or exchange a points balance". Is it planned to be done in this way? Or do I miss something? Just choose debit to subtract points. 1 Quote Share this post Link to post Share on other sites
alexis 34 Report post Posted January 30, 2016 22 hours ago, Kevin Carwile said: Balances are different per bank, and currency can have decimal places, and available balance vs total balance are different, and the member might have a balance but has been moved to a group without permission to use it... your words mean, that the implementing the requested feature will be a little bit complicated? Actually, this kind of checking, whether a user has enough "money", is sometimes necessary, if this "money" is needed for some certain actions, for example, changing the title of a member: with the Event "update custom data field", each member can use this "paid service" for changing his title, but only if he has enough points to "pay" for it. If using your advice with checking by "check if an adjustment is permissible",so it doesn't work for me, since it doesn't check, whether the user has enough points or not (neither with "Credit Only" nor with "Debit only" adjustment type). Quote Share this post Link to post Share on other sites
Kevin Carwile 295 Report post Posted January 30, 2016 1 hour ago, alexis said: Actually, this kind of checking, whether a user has enough "money", is sometimes necessary, if this "money" is needed for some certain actions, for example, changing the title of a member: with the Event "update custom data field", each member can use this "paid service" for changing his title, but only if he has enough points to "pay" for it. If using your advice with checking by "check if an adjustment is permissible",so it doesn't work for me, since it doesn't check, whether the user has enough points or not (neither with "Credit Only" nor with "Debit only" adjustment type). Yes, I understand there is a valuable condition missing from the set. Quote Share this post Link to post Share on other sites
alexis 34 Report post Posted February 9, 2016 Currently I'm stuck with finding out a way, how to check for the total balance of a member, which includes all the balance in the certain currency. This total amount is shown in the left panel under our post count: As you see, this number - 94 points - is the total amount of points the user currently has "in cash" in all his banks and accounts in this certain currency. I suppose, we can output this value only using PHP code? (My main aim for figuring out this issue, is to assign the user with negative amount (total amount!) into a penalty group.) Quote Share this post Link to post Share on other sites
Kevin Carwile 295 Report post Posted February 11, 2016 1 Quote Share this post Link to post Share on other sites
alexis 34 Report post Posted February 12, 2016 A big thank to Kevin for providing this perfect documentation! All works fine and great, except for one moment, which I've failed to specify using your manual: This code works only with one certain member, which we specify in the code: $currency = \IPS\points\Currency::load( 1 ); $member = \IPS\Member::load( 26 ); $amount = $currency->netWorthAsOf( new \IPS\DateTime( 'now' ), $member ); return $amount; In this example, which I use as a condition for the Rule, triggered by Event: A balance has been adjusted, the condition is checking only the user №26, I plan to check for the users, whose balance has been adjusted. And it could be any member, not only №26 I've tried $member = $member ?: \IPS\Member::loggedIn(); and $member = \IPS\Member::loggedIn(); -- but they don't fit to the rule, if the user could be offline when the adjustment has been proceeded. Could you please share with me, how to check for the member, whose balance has been adjusted? Quote Share this post Link to post Share on other sites
Kevin Carwile 295 Report post Posted February 12, 2016 $balance->member() 1 Quote Share this post Link to post Share on other sites