First Appointment of new users creates wrong appointment ID

Hi @Hakan,

I'm back to the tests and i'm having this serious issue.
This is the same I reported earlier, but at that time, i tought the problem was happening because of cubepoints. (https://premium.wpmudev.org/forums/topic/bug-in-appointment-cubepoints#post-337243).

Then I installed the marketpress and during the purchase process the appointment is added to the shopping cart. There i could see the problem that happens when the user is a new one and this is his first appointment.

The ID for appointment is correct, but the one that is actually being used is wrong. That causes the appointment to not complete the purchase correctly. And then this appointment is pending, till its removed. The ID added to the cart is wrong and A+ can't recognize that it was paid properly.

In the image attached the appointment ID created was 179 (is not sequential) but in the A+ backend, it was ID 51. You can see that the next appointment ID(52) is correct. That only happens with the first one after the user registered in the site.

Please register yourself in my website and add a few appointments to the cart. You will be able to check this problem happening.

Hope to hear from you soon.

Best Regards,
Diego