This feature will a an alert if a patron already has an issue for the same biblio. The librarian can force the checkout anyway. It doesn't alert the librarian if the biblio is a subscription.
Created attachment 20954 [details] [review] Bug 10859: Alert if a borrower already has an issue for the same biblio The librarian can force the checkout anyway. It doesn't alert the librarian if the biblio is a subscription Test plan: 1. Create a biblio with at least 2 items 2. Checkout the first item for a borrower 3. Set syspref AllowMultipleIssuesOnABiblio to OFF. 4. Try to checkout the second item with the same borrower. A message should appear telling you that this borrower already borrowed an item from this biblio. If you have the permission 'force_checkout' You should also see two buttons to confirm (or not) the checkout 5. Click on 'No'. The checkout is not done 6. Repeat step 4 and click 'Yes', the checkout is done. 7. Return the second item. 8. Set syspref AllowMultipleIssuesOnABiblio to ON 9. Try to checkout the second item with the same borrower. This time the checkout is done without warnings.
Applying: Bug 10859: Alert if a borrower already has an issue for the same biblio Repository lacks necessary blobs to fall back on 3-way merge. Cannot fall back to three-way merge. Patch failed at 0001 Bug 10859: Alert if a borrower already has an issue for the same biblio The copy of the patch that failed is found in: /home/christopher/git/koha/.git/rebase-apply/patch When you have resolved this problem, run "git am --continue". If you prefer to skip this patch, run "git am --skip" instead. To restore the original branch and stop patching, run "git am --abort".
(In reply to I'm just a bot from comment #2) Depend on bug 10863
This bug depends on 10863 which is in status Failed QA
I rebased bug 10863, this one applies cleanly now.
Would like to sign off, but does not apply.
Created attachment 25362 [details] [review] Bug 10859: Alert if a borrower already has an issue for the same biblio The librarian can force the checkout anyway. It doesn't alert the librarian if the biblio is a subscription Test plan: 1. Create a biblio with at least 2 items 2. Checkout the first item for a borrower 3. Set syspref AllowMultipleIssuesOnABiblio to OFF. 4. Try to checkout the second item with the same borrower. A message should appear telling you that this borrower already borrowed an item from this biblio. If you have the permission 'force_checkout' You should also see two buttons to confirm (or not) the checkout 5. Click on 'No'. The checkout is not done 6. Repeat step 4 and click 'Yes', the checkout is done. 7. Return the second item. 8. Set syspref AllowMultipleIssuesOnABiblio to ON 9. Try to checkout the second item with the same borrower. This time the checkout is done without warnings.
Created attachment 25366 [details] [review] [Signed-off] Bug 10859: Alert if a borrower already has an issue for the same biblio The librarian can force the checkout anyway. It doesn't alert the librarian if the biblio is a subscription Test plan: 1. Create a biblio with at least 2 items 2. Checkout the first item for a borrower 3. Set syspref AllowMultipleIssuesOnABiblio to OFF. 4. Try to checkout the second item with the same borrower. A message should appear telling you that this borrower already borrowed an item from this biblio. If you have the permission 'force_checkout' You should also see two buttons to confirm (or not) the checkout 5. Click on 'No'. The checkout is not done 6. Repeat step 4 and click 'Yes', the checkout is done. 7. Return the second item. 8. Set syspref AllowMultipleIssuesOnABiblio to ON 9. Try to checkout the second item with the same borrower. This time the checkout is done without warnings. Followed test plan. Works as expected. Signed-off-by: Marc Véron <veron@veron.ch>
Comment on attachment 25366 [details] [review] [Signed-off] Bug 10859: Alert if a borrower already has an issue for the same biblio Review of attachment 25366 [details] [review]: ----------------------------------------------------------------- Hi Julian, some notes from me - could you take a look please? ::: C4/Circulation.pm @@ +1051,5 @@ > + my $is_a_subscription = C4::Serials::CountSubscriptionFromBiblionumber($biblionumber); > + unless ($is_a_subscription) { > + my $issues = GetIssues( { > + borrowernumber => $borrower->{borrowernumber}, > + biblionumber => $biblionumber, I like that it excludes items that belong to serials. Could we add this to the system preference description for documentation? ::: koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref @@ +341,5 @@ > + - pref: AllowMultipleIssuesOnABiblio > + choices: > + yes: Allow > + no: "Don't allow" > + - patrons to check out multiple items from the same biblio. Not a native speaker, but maybe: Allow/Don't allow patrons to check out multiple items from the same record, except for records with subscriptions. ::: koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ +271,5 @@ > [% END %] > + > +[% IF BIBLIO_ALREADY_ISSUED %] > + <li> > + Borrower has already an issue on another item from this biblio. I think we prefer 'patron', 'check out' and 'record' in the interface, so maybe we could say: Patron has already checked out another item from this record. ::: t/db_dependent/Circulation/GetIssues.t @@ +97,5 @@ > + DelBranch($branchcode); > + } > +}; > + > +done_testing; The tests are failing for me :( prove t/db_dependent/Circulation/GetIssues.t t/db_dependent/Circulation/GetIssues.t .. Undefined subroutine &main::GetIssues called at t/db_dependent/Circulation/GetIssues.t line 61. t/db_dependent/Circulation/GetIssues.t .. Dubious, test returned 255 (wstat 65280, 0xff00) No subtests run I also notice that you don't use the 'new rollback transactions trick'. I think if you added this to your tests, you could also avoid having to cleanup as the database in the ind. It will just go back to the state it was in before the tests were run. I think you can find an example in Reserves.t and also some other test files.
Ah, now I realize the bug is assigned to Julian, but the patch is from Jonathan... or I think it is. Changing the assignee for now, please change back if wrong.
Created attachment 26263 [details] [review] Bug 10859: wording
Created attachment 26264 [details] [review] Bug 10859: GetIssues.t - Execute unit tests in a transaction
Created attachment 26267 [details] [review] [PASSED QA] Bug 10859: Alert if a borrower already has an issue for the same biblio The librarian can force the checkout anyway. It doesn't alert the librarian if the biblio is a subscription Test plan: 1. Create a biblio with at least 2 items 2. Checkout the first item for a borrower 3. Set syspref AllowMultipleIssuesOnABiblio to OFF. 4. Try to checkout the second item with the same borrower. A message should appear telling you that this borrower already borrowed an item from this biblio. If you have the permission 'force_checkout' You should also see two buttons to confirm (or not) the checkout 5. Click on 'No'. The checkout is not done 6. Repeat step 4 and click 'Yes', the checkout is done. 7. Return the second item. 8. Set syspref AllowMultipleIssuesOnABiblio to ON 9. Try to checkout the second item with the same borrower. This time the checkout is done without warnings. Followed test plan. Works as expected. Signed-off-by: Marc Véron <veron@veron.ch> Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> All tests and QA script pass, works well. Tested: * Permission to override * check out a second item from a record with subscriptions works * check out a second item from a 'normal' record is warned about, but can be done * No permission to override * subscription item: can be checked out * normal item: can't be checked out * Feature turned off * Check out never warns/blocks
Created attachment 26268 [details] [review] [PASSED QA] Bug 10859: wording Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Created attachment 26269 [details] [review] [PASSED QA] Bug 10859: GetIssues.t - Execute unit tests in a transaction Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Created attachment 26270 [details] [review] Bug 10859: QA follow up: Fixing order in sysprefs.sql
Pushed to master, along with a follow-up that clarifies the logic in the case where the item to be checked out is already on loan to the patron. Thanks, Jonathan!
I choose to not apply to 3.14.x so I set as resolved.