Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo
I am looking at a problem with checkout at the moment, and am getting a bit confused.
It seems to me that if a books is available, and you checkout the bar-code, then everything is fine. But when the barcode is scanned and the book is not available (or booked) then we go into a procedure around line 129 of booking.php.
Is this in case a book is booked for somebody on a specific date, and checks if the books could be borrowed to be back on time before it is required? That kind of makes sense if that is the case, and explains why I crash in Bookings.php (well, the message I get that there are no copies available is generated there, but I think that there has been a modification somewhere in the code which makes inserts go wrong somewhere, and that causes me to end up there).
Also, I find the message, there are no copies available very strange, and probably causes my confusion, as when I check out a book with a barcode, I don't expect that there are other copies with that barcode. Even if there are other copies of the bibid, that would not have a direct influence on the particular copy the person is checking out, so why do we check all the time with checkout on the amount of copies available? Or am I lost somewhere?
Micah, could you confirm or comment on the above regards to bookings?
It sounds like you're reading things right. Most of Bookings->validate_el() is about making sure a reservation for a specific date can be made. Reservations are made on a particular biblio, not on a copy. Allowing reservations sort of turned checkouts on their head. Traditional checkouts involve a book in your hand that you want to take with you - if it's in your hand, it must be available. When you make a reservation, though, you don't care which copy you get, only that you get a copy of a particular book. The libraries I did all this for used items both ways - by reservation and by checkout. So when you make a checkout, you have to make sure you'll be left with enough copies on hand to fulfill any reservations for the same item that have already been made. That's where the error message comes from. "Not enough copies available" means the system won't have enough copies to keep its promises if it allows the booking you're asking it to make. I agree that the error message is cryptic. The trouble is that the message really needs to work both for a checkout or a reservation, as the same code applies to both. (A checkout is just a reservation that's fulfilled immediately.) "This transaction would not leave enough copies of the item on hand for the library to fulfill reservations already on file" is probably too wordy - I'm open to suggestions.
Oke that makes a lot of sense and cleares it up more.
Yes I think it should be looked at, first if it is possible to adjust the text when checking out THIS book, as the message is just strange (as there is only one copy of THIS copy). Maybe something like "This item cannot be checkout due to reserved copies" or so would work? Not 100% for making reservations, but the message is clear.
Further, this functionality should be tested, as there has been done a bit of work (by me) on this area a few months ago as there was a bug in checking out. As I wasn't fully aware of reservations (I only use on Hold) I didn't verify if it still works correctly in the current head.