Bug 16272 - Transform checkout from on-site checkout to regular checkout
Summary: Transform checkout from on-site checkout to regular checkout
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Circulation (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks: 17345 18321 26583
  Show dependency treegraph
 
Reported: 2016-04-15 12:48 UTC by Nicolas Legrand
Modified: 2020-10-01 10:36 UTC (History)
5 users (show)

See Also:
Change sponsored?: Sponsored
Patch complexity: ---
Text to go in the release notes:
A patron checks some items out on-site and want to take it home. To facilitate the librarian work the checkout is directly switched from on-site to regular when checked out if the new pref SwitchOnSiteCheckouts is on. If SwitchOnSiteCheckouts is off and you check out an item with "on-site checkout" you receive an "This item can not be renewed, it's an on-site checkout".
Version(s) released in:


Attachments
Bug 16272: Automatically switch an on-site checkout to a regular checkout when checked out (13.24 KB, patch)
2016-04-25 08:56 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 16272: Specific case when switching an on-site checkout to a regular checkout (4.32 KB, patch)
2016-04-25 08:56 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 16272: Automatically switch an on-site checkout to a regular checkout when checked out (13.42 KB, patch)
2016-05-09 15:12 UTC, Nicolas Legrand
Details | Diff | Splinter Review
Bug 16272: Automatically switch an on-site checkout to a regular checkout when checked out (13.42 KB, patch)
2016-05-09 15:12 UTC, Nicolas Legrand
Details | Diff | Splinter Review
Bug 16272: Specific case when switching an on-site checkout to a regular checkout (4.38 KB, patch)
2016-05-09 15:12 UTC, Nicolas Legrand
Details | Diff | Splinter Review
Bug 16272: Automatically switch an on-site checkout to a regular checkout when checked out (13.67 KB, patch)
2016-08-16 08:35 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 16272: Specific case when switching an on-site checkout to a regular checkout (4.38 KB, patch)
2016-08-16 08:35 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 16272: (follow-up) Specific case when switching an on-site checkout to a regular checkout (2.63 KB, patch)
2016-08-16 16:00 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 16272: Add description for tests (3.66 KB, patch)
2016-08-16 16:00 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 16272: Automatically switch an on-site checkout to a regular checkout when checked out (13.73 KB, patch)
2016-08-16 18:16 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 16272: Specific case when switching an on-site checkout to a regular checkout (4.44 KB, patch)
2016-08-16 18:16 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 16272: (follow-up) Specific case when switching an on-site checkout to a regular checkout (2.68 KB, patch)
2016-08-16 18:16 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 16272: Add description for tests (3.71 KB, patch)
2016-08-16 18:16 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 16272 [QA Followup] - Indexer fails on indexing temparary testing records (1.07 KB, patch)
2016-08-18 16:37 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 16272 [QA Followup] - Indexer fails on indexing temparary testing records (1.07 KB, patch)
2016-08-18 16:37 UTC, Kyle M Hall
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Nicolas Legrand 2016-04-15 12:48:37 UTC
At the BULAC library, patrons may ask more one-site checkouts than regular checkouts. Often they request a bunch of books from the stacks, get them checked out as on-site checkouts, consult them. Eventually they come back to the desk asking to check in books they are not interested in and transform their on-site checkout to regular checkouts on books they wish to bring home.

We would like to have a quick way to do this on the intranet: by checkin out an item which is on-site checked out for the same borrower, we would like the loan to become a regular check out.
Comment 1 Jonathan Druart 2016-04-25 08:56:18 UTC Comment hidden (obsolete)
Comment 2 Jonathan Druart 2016-04-25 08:56:26 UTC Comment hidden (obsolete)
Comment 3 Nicolas Legrand 2016-05-09 15:12:03 UTC Comment hidden (obsolete)
Comment 4 Nicolas Legrand 2016-05-09 15:12:34 UTC Comment hidden (obsolete)
Comment 5 Nicolas Legrand 2016-05-09 15:12:40 UTC Comment hidden (obsolete)
Comment 6 Nick Clemens 2016-08-12 16:16:10 UTC
Smallish conflict in C4/Circulation.pm
Comment 7 Jonathan Druart 2016-08-16 08:35:34 UTC Comment hidden (obsolete)
Comment 8 Jonathan Druart 2016-08-16 08:35:39 UTC Comment hidden (obsolete)
Comment 9 Jonathan Druart 2016-08-16 08:36:28 UTC
(In reply to Nick Clemens from comment #6)
> Smallish conflict in C4/Circulation.pm

Fixed!
Comment 10 Nick Clemens 2016-08-16 13:25:31 UTC
For the special case, if a default rule is set in addition to the circ rule then the onsite checkout to change to a regular checkout still activates a too many warning

I think you need the delta at the lines below as well

 539         if ( C4::Context->preference('ConsiderOnSiteCheckoutsAsNormalCheckouts') ) {
 540             if ( $checkout_count >= $max_checkouts_allowed ) {
 541                 return {
 542                     reason => 'TOO_MANY_CHECKOUTS',
 543                     count => $checkout_count,
 544                     max_allowed => $max_checkouts_allowed,
 545                 };
 546             }
Comment 11 Jonathan Druart 2016-08-16 16:00:22 UTC Comment hidden (obsolete)
Comment 12 Jonathan Druart 2016-08-16 16:00:38 UTC Comment hidden (obsolete)
Comment 13 Jonathan Druart 2016-08-16 16:01:13 UTC
(In reply to Nick Clemens from comment #10)
> For the special case, if a default rule is set in addition to the circ rule
> then the onsite checkout to change to a regular checkout still activates a
> too many warning
> 
> I think you need the delta at the lines below as well

Good catch! Thanks
Comment 14 Nick Clemens 2016-08-16 18:16:31 UTC
Created attachment 54526 [details] [review]
Bug 16272: Automatically switch an on-site checkout to a regular checkout when checked out

Use case: A patron checks some items out on-site and want to take it home.
To facilitate the librarian work the checkout is directly switched from
on-site to regular when checked out if the new pref SwitchOnSiteCheckouts is on.

Test plan:
0/ Let the new pref SwitchOnSiteCheckouts off
1/ Checkout one items to a patron and tick the "on-site checkout"
checkbox
2/ Check the same item out without ticking the "on-site checkout"
checkbox
=> You should get "This item can not be renewed, it's an on-site checkout"
3/ Switch the pref on
4/ Repeat 2
=> The on-site checkout should be automatically switched to a regular checkout

Sponsored-by: BULAC - http://www.bulac.fr/
Signed-off-by: Nicolas Legrand <nicolas.legrand@bulac.fr>
With small changes to apply to master.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 15 Nick Clemens 2016-08-16 18:16:38 UTC
Created attachment 54527 [details] [review]
Bug 16272: Specific case when switching an on-site checkout to a regular checkout

In the case on-site checkouts are considered as a regular checkout in issuing
rules (i.e. ConsiderOnSiteCheckoutsAsNormalCheckouts is on):
When after the on-site checkout the maximum limit of checkouts is
reached and the patron wants to switch an on-site checkout to a regular
checkout, the C4::Circulation::TooMany subroutine will return a
TOO_MANY_CHECKOUTS error.
To avoid that, we need to allow an extra checkout in this subroutine.

Test plan:
0/ Switch ConsiderOnSiteCheckoutsAsNormalCheckouts and
SwitchOnSiteCheckouts on
1/ In the issuing rules, set the total number of checkouts (maxissueqty)
to 2 and the number of on-site checkouts to 2 (maxonsiteissueqty)
2/ Check 2 items out ticking the 'on-site checkout' checkbox
3/ Check one of these items out, to automatically switch it to a regular
checkout
=> The checkout should be allowed.

Sponsored-by: BULAC - http://www.bulac.fr/
Signed-off-by: Nicolas Legrand <nicolas.legrand@bulac.fr>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 16 Nick Clemens 2016-08-16 18:16:46 UTC
Created attachment 54528 [details] [review]
Bug 16272: (follow-up) Specific case when switching an on-site checkout to a regular checkout

Same as previous patch but if another circ rule exists

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 17 Nick Clemens 2016-08-16 18:16:51 UTC
Created attachment 54529 [details] [review]
Bug 16272: Add description for tests

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 18 Kyle M Hall 2016-08-18 16:37:05 UTC Comment hidden (obsolete)
Comment 19 Kyle M Hall 2016-08-18 16:37:20 UTC
Created attachment 54580 [details] [review]
Bug 16272 [QA Followup] - Indexer fails on indexing temparary testing records
Comment 20 Kyle M Hall 2016-09-09 12:53:56 UTC
Pushed to master for 16.11, thanks Jonathan!