Open samtimmins opened 8 years ago
As you can see from the table, the database stores recurring bookings by week/day values rather than specific date values, this increases the difficulty of fixing this bug.
booking_id | school_id | period_id | week_id | day_num | room_id | user_id | date | notes | cancelled | paid |
---|---|---|---|---|---|---|---|---|---|---|
1 | 1 | 1 | 1 | 6 | 1 | 1 | NULL | 0 | 0 | |
2 | 1 | 2 | NULL | NULL | 1 | 1 | 2016-10-30 | 0 | 0 | |
3 | 1 | 1 | 1 | 1 | 1 | 2 | NULL | 0 | 0 | |
4 | 1 | 2 | 1 | 1 | 1 | 2 | NULL | 0 | 0 |
When creating a recurring booking, it fills the booking slot in both chronological directions. Basically: A recurring booking configured for the 26/10/16 applies every week possible, in the past and future! So 19/10/16, 12/10/16 etc. This would mean that a customers invoice is wrong.
Also: Deleting a recurring booking entry removes ALL traces of that booking have existed. It removes current week/future week and past week entries.
I imagine this all has to do with the booking logic and not having proper controls for what the current date is?