User Credits not being deducted sometimes

  • Patrick Gay
  • Topic Author
  • Offline
  • Expert Boarder
  • Expert Boarder
More
5 years 2 months ago #25336 by Patrick Gay
User Credits not being deducted sometimes was created by Patrick Gay
We are using ABPro 4.0.3.RC1 to handle vacation request (paid time off).
We use User Credits.
We give everyone a credit balance to draw from based on how much vacation time they get each year.
When someone books a resource, we subtract time from their user credit account (8 hours for a full day or 4 hours for a half day)

For some reason that I can't figure out, sometimes, someone books a resource (for example Full Day that costs 8 hours) the transaction is not being written to the user credit table j3_sv_apptpro3_user_credit_activity and the j3_sv_apptpro3_user_credit table is not being updated. if I cancel the request and re-enter it, it works.

The resource is being booked and the update is being pushed to the google calendar, but the user credit table isn't always being updated.

We have been using this for 4 years at this point and the problem started to occur in December 2018.

Any ideas what I can do to troubleshoot this?

Please Log in to join the conversation.

More
5 years 2 months ago #25337 by Rob
Check the User Credits log to ensure that no one is manually adding the credits back.
Check the ABPro Error Log screen to see if problems may be occurring.

Please Log in to join the conversation.

  • Patrick Gay
  • Topic Author
  • Offline
  • Expert Boarder
  • Expert Boarder
More
5 years 2 months ago #25338 by Patrick Gay
Replied by Patrick Gay on topic User Credits not being deducted sometimes
The user credits log (i'm assuming is the Person Credits option under the admin screen) does not show the credits being added back. In fact, it doesn't even show the transaction to decrease the credits at all.

I checked the error log and there are zero errors there.

Any ideas about how I can dig into this to see what might be occurring?

For example, I just saw someone enter quite a few bookings and all of them except 1 handled the user credits correctly.
They are using Google Chrome 65.0.3325.162 so I asked them to update to a newer version of Chrome to see if it could be a browser based issue.

Which code is being called that updates the user_credit tables?

Please Log in to join the conversation.

More
5 years 2 months ago #25339 by Rob

In fact, it doesn't even show the transaction to decrease the credits at all.


That's pretty strange.
Are the bookings being made via the normal front end booking screen?
I assume you have logins required, as the user credits only work for registered and logged in users.

Please Log in to join the conversation.

  • Patrick Gay
  • Topic Author
  • Offline
  • Expert Boarder
  • Expert Boarder
More
5 years 2 months ago #25340 by Patrick Gay
Replied by Patrick Gay on topic User Credits not being deducted sometimes
Yes, the booking_screen_gad screen.
yes, Logins are required

Please Log in to join the conversation.

More
5 years 2 months ago #25341 by Rob
Each user has their own login? No possibility of people sharing or using the wrong login?

Are bookings done via the desktop? You are not using the jQuery web app?

Please Log in to join the conversation.

More
5 years 2 months ago - 5 years 2 months ago #25342 by Rob
Additional..

If you have not changed the program, it seems more likely a user issue than a program issue.
Maybe someone is using the system in a way you had not anticipated.

Do they have access to the Front Desk and thereby the staff booking screen?

Is it common to one or two users? If so, maybe ask them exactly how they are booking.
Last edit: 5 years 2 months ago by Rob.

Please Log in to join the conversation.

  • Patrick Gay
  • Topic Author
  • Offline
  • Expert Boarder
  • Expert Boarder
More
5 years 2 months ago #25343 by Patrick Gay
Replied by Patrick Gay on topic User Credits not being deducted sometimes
OK. I think I may have found something. Back on Dec 17, 2018, I upgraded PHP to version 7.2.13 and that's about the same time I started seeing the problem.
In the PHP error log, I see:
[24-Jan-2019 11:34:53 America/Chicago] PHP Warning: count(): Parameter must be an array or an object that implements Countable in /data1/webserver/htdocs/components/com_rsappt_pro3/functions2.php on line 667

I'm not sure if this is an ignorable PHP error or not or if upgrading PHP might be the culprit.

Please Log in to join the conversation.

More
5 years 2 months ago #25344 by Rob
I do not think that has anything to do with what you are seeing. It is just a php warning, in an area unrelated.

If everyone is using the same screen, and are logged in, then the exact same code is run for everyone so I cannot see how it would work sometimes and not others.

If you look at the booking detail, it will show the $ deducted from the user's credit.

Also, see questions in my previous posts.
Confirm you are running with auto-accept = yes.

In the Payment Processors scree, General Settings tab, ensure you have Non-Pay Booking Button = Display and Block

Please Log in to join the conversation.

  • Patrick Gay
  • Topic Author
  • Offline
  • Expert Boarder
  • Expert Boarder
More
5 years 2 months ago #25345 by Patrick Gay
Replied by Patrick Gay on topic User Credits not being deducted sometimes
Hi Rob,
Please find below:
1. Each user has their own login --> Yes. No one can share logins, we use LDAP for users.
2. Are bookings done via the desktop --> Yes, we are only using the desktop, no mobile phones or jQuery web apps.
3. Do they have access to the Front Desk and thereby the staff booking screen? --> No, only the GAD
4. Is it common to one or two users? --> No, it can happen to anyone.
5. The booking detail shows $0.00 when it fails.
6. Auto Accept is set to Yes (we have been running this for 4 years and it's worked until December 2018).
7. Non-Pay Booking Button is set to No and has been for the last 4 years.

Please Log in to join the conversation.

More
5 years 2 months ago #25346 by Rob
I think the problem is in the booking cost.
If the booking cost = $0 then ABPro will have nothing to deduct from the credit.

Non-Pay Booking Button is set to No and has been for the last 4 years

If Non-Pay Booking Button = No, then you must be using PayPal or other payment processor in order to show booking costs.

Which payment processor are you using?

Please Log in to join the conversation.

  • Patrick Gay
  • Topic Author
  • Offline
  • Expert Boarder
  • Expert Boarder
More
5 years 2 months ago #25347 by Patrick Gay
Replied by Patrick Gay on topic User Credits not being deducted sometimes
It will show $8 when you are trying to book it on the GAD screen.
When it works, the booking details shows $8.00 and it deducts from the User Credits
When it fails, the booking details shows $0.00 and it doesn't enter a transaction in the User Credits.
I have PayPal set to Yes, but it never calls PayPal because we "give" people credits. When they run out of credits, they can't make any more requests.

Effectively, 1 credit = 1 hour of vacation time. A full day "resource" costs 8 credits (or $8.00). A half day "resource" costs 4 credits (or $4.00). At the beginning of the year, I calculate how many days of vacation time each person receives and then I go to User Credits and increase their Credit Balance to however many days of vacation they get. When someone books a resource, for example 1 day of vacation time, it subtracts 8 credits from their credit "account". Once they get to 0 credits, they are sent to PayPal to buy more, but this isn't real - it sends them to the Test PayPal server and they can't actually "purchase" more vacation time.

Please Log in to join the conversation.

More
5 years 2 months ago #25348 by Rob

When it fails, the booking details shows $0.00 and it doesn't enter a transaction in the User Credits.


Yes, that is how it is designed to work.

The question is why does it show $0.00.

Ensure you have not turned on Joomla cache, as that can send old data out to the browser.

Ensure your resource Rate is just a number (no $).

Please Log in to join the conversation.

  • Patrick Gay
  • Topic Author
  • Offline
  • Expert Boarder
  • Expert Boarder
More
5 years 2 months ago #25349 by Patrick Gay
Replied by Patrick Gay on topic User Credits not being deducted sometimes
1. Joomla Cache:
System Cache: OFF - Caching disabled

2. Resource Rage:
Rate: 1.00 Rate Unit: per Hour

Please Log in to join the conversation.

More
5 years 2 months ago #25350 by Rob
Maybe something is causing the JavaScript that calculates booking cost to fail and leave the cost as $0.

Unfortunately, unless you can reproduce it, I can see no way to troubleshoot that scenario further.

Maybe look for anything common to all failed bookings(??).

Another option may be to brute force stop the booking if the credit used = $0.
I will investigate what would be required to do that.

Please Log in to join the conversation.

  • Patrick Gay
  • Topic Author
  • Offline
  • Expert Boarder
  • Expert Boarder
More
5 years 2 months ago #25412 by Patrick Gay
Replied by Patrick Gay on topic User Credits not being deducted sometimes
Well, I don't know what was causing the problem, but as quickly as the problem started occurring, it's also disappeared. I do have some SQL that I wrote that I run every day to tell me if the problem returns so I guess I'll just hang loose and see if it happens again.
Thanks for your help.

Please Log in to join the conversation.

More
5 years 2 months ago #25413 by Rob

as quickly as the problem started occurring, it's also disappeared


Aren't computers fun ;-)

Please Log in to join the conversation.

  • Patrick Gay
  • Topic Author
  • Offline
  • Expert Boarder
  • Expert Boarder
More
5 years 2 months ago #25449 by Patrick Gay
Replied by Patrick Gay on topic User Credits not being deducted sometimes
Well, the problem returned. Can you give me some SQL that will insert/update the appropriate table(s) around user credits so I can just do updates when the problem happens instead of having people cancel and rebook?

Alternately, point me to the file that has the code in it about the user credits and I'll review that and ask questions if I have any.

Please Log in to join the conversation.

More
5 years 2 months ago - 5 years 2 months ago #25450 by Rob

Can you give me some SQL that will insert/update the appropriate table(s) around user credits so I can just do updates when the problem happens instead of having people cancel and rebook?

You could go in to the User Credits screen and manually adjust the user's credits.


Alternately, point me to the file that has the code in it about the user credits and I'll review that and ask questions if I have any.

I thing we determined the issue is not in the user credits code, it is the booking amount due being $0 so ABPro does not do any credit adjustment.

Ensure you have Early Booking Discounts = No in the Config Basic Setting tab.
If that were on, it could be discounting the booking charge based on when they book.
The amount to discount and days in advance are is set in the resource or service setup screen, the default is $1 discount if booked 7 days in advance. As you using a $1 booking charge, that would discount to free booking.



You could hard code a check in the validation that if the credit is $0, the process aborts.
To instruct on how to do that I would need to know which booking screen you use.
Last edit: 5 years 2 months ago by Rob.

Please Log in to join the conversation.

  • Patrick Gay
  • Topic Author
  • Offline
  • Expert Boarder
  • Expert Boarder
More
5 years 2 months ago #25451 by Patrick Gay
Replied by Patrick Gay on topic User Credits not being deducted sometimes
1. Enable Early Booking Discounts is set to No and has always been. (Just verified it).
2. We use the GAD Booking Screen.
3. Can you tell me what sql I need to use to insert the missing rows in the user_credits and user_credit_activity tables for the bookings that are already missing user credits?

Please Log in to join the conversation.

Time to create page: 0.141 seconds
Powered by Kunena Forum

Just thought I'd pass along some positive feedback from my client:
"All of us are excited about our new online booking!! Shanyn & Chelsea said it’s “fun”; even I’m getting the hang of it!  There are still a few glitches so we’re having another meeting on Tuesday - but all of us are thrilled!  Thank you! Thank you!"

The "glitches" they mentioned are all minor and I've tweaked a few settings and answered a few questions to address them. Overall they're very happy. "
Chris C


"Hi, im back 
 After using appbooking pro for 3 years successfully i have tried another booking system for a new site that was more expensive, promised a lot but full of errors and the developers wanted to suck the $$ for every little request.

Anyways, great to be back here "
roll82


"thanks for all the help you have given me over the past few months. We have managed to get the system to work so that multiple businesses around the country can log into our website and manage appointments for their own businesses through the ABPro System."

owen_molloy October 2013


Just thought I'd pass along some positive feedback from my client:
"All of us are excited about our new online booking!! Shanyn & Chelsea said it’s “fun”; even I’m getting the hang of it!  There are still a few glitches so we’re having another meeting on Tuesday - but all of us are thrilled!  Thank you! Thank you!"

The "glitches" they mentioned are all minor and I've tweaked a few settings and answered a few questions to address them. Overall they're very happy. "
Chris C


"Hi, im back 
 After using appbooking pro for 3 years successfully i have tried another booking system for a new site that was more expensive, promised a lot but full of errors and the developers wanted to suck the $$ for every little request.

Anyways, great to be back here "
roll82


"thanks for all the help you have given me over the past few months. We have managed to get the system to work so that multiple businesses around the country can log into our website and manage appointments for their own businesses through the ABPro System."

owen_molloy October 2013


Just thought I'd pass along some positive feedback from my client:
"All of us are excited about our new online booking!! Shanyn & Chelsea said it’s “fun”; even I’m getting the hang of it!  There are still a few glitches so we’re having another meeting on Tuesday - but all of us are thrilled!  Thank you! Thank you!"

The "glitches" they mentioned are all minor and I've tweaked a few settings and answered a few questions to address them. Overall they're very happy. "
Chris C


"Hi, im back 
 After using appbooking pro for 3 years successfully i have tried another booking system for a new site that was more expensive, promised a lot but full of errors and the developers wanted to suck the $$ for every little request.

Anyways, great to be back here "
roll82


"thanks for all the help you have given me over the past few months. We have managed to get the system to work so that multiple businesses around the country can log into our website and manage appointments for their own businesses through the ABPro System."

owen_molloy October 2013


Just thought I'd pass along some positive feedback from my client:
"All of us are excited about our new online booking!! Shanyn & Chelsea said it’s “fun”; even I’m getting the hang of it!  There are still a few glitches so we’re having another meeting on Tuesday - but all of us are thrilled!  Thank you! Thank you!"

The "glitches" they mentioned are all minor and I've tweaked a few settings and answered a few questions to address them. Overall they're very happy. "
Chris C


"Hi, im back 
 After using appbooking pro for 3 years successfully i have tried another booking system for a new site that was more expensive, promised a lot but full of errors and the developers wanted to suck the $$ for every little request.

Anyways, great to be back here "
roll82


"thanks for all the help you have given me over the past few months. We have managed to get the system to work so that multiple businesses around the country can log into our website and manage appointments for their own businesses through the ABPro System."

owen_molloy October 2013


Just thought I'd pass along some positive feedback from my client:
"All of us are excited about our new online booking!! Shanyn & Chelsea said it’s “fun”; even I’m getting the hang of it!  There are still a few glitches so we’re having another meeting on Tuesday - but all of us are thrilled!  Thank you! Thank you!"

The "glitches" they mentioned are all minor and I've tweaked a few settings and answered a few questions to address them. Overall they're very happy. "
Chris C


"Hi, im back 
 After using appbooking pro for 3 years successfully i have tried another booking system for a new site that was more expensive, promised a lot but full of errors and the developers wanted to suck the $$ for every little request.

Anyways, great to be back here "
roll82


"thanks for all the help you have given me over the past few months. We have managed to get the system to work so that multiple businesses around the country can log into our website and manage appointments for their own businesses through the ABPro System."

owen_molloy October 2013


Just thought I'd pass along some positive feedback from my client:
"All of us are excited about our new online booking!! Shanyn & Chelsea said it’s “fun”; even I’m getting the hang of it!  There are still a few glitches so we’re having another meeting on Tuesday - but all of us are thrilled!  Thank you! Thank you!"

The "glitches" they mentioned are all minor and I've tweaked a few settings and answered a few questions to address them. Overall they're very happy. "
Chris C


"Hi, im back 
 After using appbooking pro for 3 years successfully i have tried another booking system for a new site that was more expensive, promised a lot but full of errors and the developers wanted to suck the $$ for every little request.

Anyways, great to be back here "
roll82


"thanks for all the help you have given me over the past few months. We have managed to get the system to work so that multiple businesses around the country can log into our website and manage appointments for their own businesses through the ABPro System."

owen_molloy October 2013


Just thought I'd pass along some positive feedback from my client:
"All of us are excited about our new online booking!! Shanyn & Chelsea said it’s “fun”; even I’m getting the hang of it!  There are still a few glitches so we’re having another meeting on Tuesday - but all of us are thrilled!  Thank you! Thank you!"

The "glitches" they mentioned are all minor and I've tweaked a few settings and answered a few questions to address them. Overall they're very happy. "
Chris C


"Hi, im back 
 After using appbooking pro for 3 years successfully i have tried another booking system for a new site that was more expensive, promised a lot but full of errors and the developers wanted to suck the $$ for every little request.

Anyways, great to be back here "
roll82


"thanks for all the help you have given me over the past few months. We have managed to get the system to work so that multiple businesses around the country can log into our website and manage appointments for their own businesses through the ABPro System."

owen_molloy October 2013


Just thought I'd pass along some positive feedback from my client:
"All of us are excited about our new online booking!! Shanyn & Chelsea said it’s “fun”; even I’m getting the hang of it!  There are still a few glitches so we’re having another meeting on Tuesday - but all of us are thrilled!  Thank you! Thank you!"

The "glitches" they mentioned are all minor and I've tweaked a few settings and answered a few questions to address them. Overall they're very happy. "
Chris C


"Hi, im back 
 After using appbooking pro for 3 years successfully i have tried another booking system for a new site that was more expensive, promised a lot but full of errors and the developers wanted to suck the $$ for every little request.

Anyways, great to be back here "
roll82


"thanks for all the help you have given me over the past few months. We have managed to get the system to work so that multiple businesses around the country can log into our website and manage appointments for their own businesses through the ABPro System."

owen_molloy October 2013