Great, that looks like it's done the trick.
Now I've just been through the thread to see if I've missed anything and spotted the following...
Another thing to consider is that you'll have to add some additional validation to ensure that you don't oversell. It's unlikely but it could happen, for instance if an Owner and a Reseller are both logged on and see that 1 ticket is remaining, they might both start the process to mark that ticket sold. If one of them finishes while the other is still working, then they both might actually be able to sell a ticket. So you'll need to have some additional validation code that determines if there truly is a ticket available to sell at the point of form submission. We offer the cred_form_validate API that can help with this.
https://toolset.com/documentation/programmer-reference/cred-api/#cred_form_validate
So we implemented the validation to make sure the number of Variations that can be booked is no more than the number of Tickets available, but if I'm right you're suggesting it may still be possible to overbook if both users are logged in and booking the same remaining place at the same time?
That sounds correct, you should perform validation when that form is submitted to verify there are still available tickets. If no tickets are available, it means that someone took the last ticket while the current user was in the process of booking. In that case you should show an error. The code should be similar to the solution in this ticket, but you'll need to do a bit more to figure out the ancestor ticket ID since it's not a direct parent of the booking post:
https://toolset.com/forums/topic/limit-numerical-field-value-in-child-to-the-value-of-numerical-field-in-parent/
Here's a quick message to keep the thread from closing - I'll test the above as soon as possible and get back to you.
Sounds good, we'll stand by for now.