C4/SIP/ILS/Transaction/Checkout.pm includes the following bit of code which remove any hold that that matches the biblio and bilbionumber in checkout: # Fill any reserves the patron had on the item. # TODO: this logic should be pulled internal to AddIssue for all Koha. $debug and warn "pending_queue: " . (@$pending) ? Dumper($pending) : '[]'; foreach (grep {$_->{borrowernumber} eq $self->{patron}->{borrowernumber}} @$pending) { $debug and warn "Filling reserve (borrowernumber,biblionumber,reservedate): " . sprintf("(%s,%s,%s)\n",$_->{borrowernumber},$_->{biblionumber},$_->{reservedate}); ModReserveFill($_); # TODO: adjust representation in $self->item } As far as I can tell, this code is completely unnecessary, since C4::Circulation::AddIssue allread calls C4::Reserves::MoveReserve which fullfills the hold. What's more, if the borrower has multiple holds on the same biblio, all of them will be removed. This is clearly wrong. I purpose to remove the code above, unless someone can explain why SIP checkout should behave different than normal checkout in this case.
This is clearly wrong, I have a library having this exact problem right now. Will give your solution a go and see what happens. Cheers, Liz
Created attachment 84070 [details] [review] Bug 19832: Unit tests
Created attachment 84071 [details] [review] Bug 19832: Don't fill holds in SIP/Transaction/Checkout.pm AddIssue already checks for holds in the item being issued and deals with them The sip code, additionally, does not consider that multiple holds per bib is allowed To test: 0 - Apply only first patch (unit tests) 1 - Place two holds for a patron on a bib 2 - Checkout that item via sip_cli_emulator 3 - Note all holds are cancelled/filled 4 - prove -v t/db_dependent/SIP/Transaction.t 5 - it fails 6 - Apply second patch 7 - prove tests, all green 8 - Place two holds on a single bib for one patron again 9 - Checkout the item via sip_cli_emulator 10 - Only one holds is filled
Created attachment 84180 [details] [review] Bug 19832: Unit tests Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 84181 [details] [review] Bug 19832: Don't fill holds in SIP/Transaction/Checkout.pm AddIssue already checks for holds in the item being issued and deals with them The sip code, additionally, does not consider that multiple holds per bib is allowed To test: 0 - Apply only first patch (unit tests) 1 - Place two holds for a patron on a bib 2 - Checkout that item via sip_cli_emulator 3 - Note all holds are cancelled/filled 4 - prove -v t/db_dependent/SIP/Transaction.t 5 - it fails 6 - Apply second patch 7 - prove tests, all green 8 - Place two holds on a single bib for one patron again 9 - Checkout the item via sip_cli_emulator 10 - Only one holds is filled Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Code seems sound and passes tests. Signing Off.
Created attachment 85149 [details] [review] Bug 19832: Unit tests Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Amended: maxissueqty => 10. Replaced dot by comma.
Created attachment 85150 [details] [review] Bug 19832: Don't fill holds in SIP/Transaction/Checkout.pm AddIssue already checks for holds in the item being issued and deals with them The sip code, additionally, does not consider that multiple holds per bib is allowed To test: 0 - Apply only first patch (unit tests) 1 - Place two holds for a patron on a bib 2 - Checkout that item via sip_cli_emulator 3 - Note all holds are cancelled/filled 4 - prove -v t/db_dependent/SIP/Transaction.t 5 - it fails 6 - Apply second patch 7 - prove tests, all green 8 - Place two holds on a single bib for one patron again 9 - Checkout the item via sip_cli_emulator 10 - Only one holds is filled Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Created attachment 85151 [details] [review] Bug 19832: (QA follow-up) Remove obsolete pending_queue call Only use of $pending was removed in the former patch. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Nick++ for unit tests
Awesome work all! Pushed to master for 19.05
Pushed to 18.11.x for 18.11.04