Description
Nicolas Legrand
2016-04-15 12:48:37 UTC
Created attachment 50606 [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/ Created attachment 50607 [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/ Created attachment 51331 [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. Created attachment 51332 [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. Created attachment 51333 [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> Smallish conflict in C4/Circulation.pm Created attachment 54498 [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. Created attachment 54499 [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> (In reply to Nick Clemens from comment #6) > Smallish conflict in C4/Circulation.pm Fixed! 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 } Created attachment 54523 [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 Created attachment 54524 [details] [review] Bug 16272: Add description for tests (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 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> 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> 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> Created attachment 54529 [details] [review] Bug 16272: Add description for tests Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 54579 [details] [review] Bug 16272 [QA Followup] - Indexer fails on indexing temparary testing records Created attachment 54580 [details] [review] Bug 16272 [QA Followup] - Indexer fails on indexing temparary testing records Pushed to master for 16.11, thanks Jonathan! |