Bugzilla – Attachment 54528 Details for
Bug 16272
Transform checkout from on-site checkout to regular checkout
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 16272: (follow-up) Specific case when switching an on-site checkout to a regular checkout
Bug-16272-follow-up-Specific-case-when-switching-a.patch (text/plain), 2.68 KB, created by
Nick Clemens (kidclamp)
on 2016-08-16 18:16:46 UTC
(
hide
)
Description:
Bug 16272: (follow-up) Specific case when switching an on-site checkout to a regular checkout
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2016-08-16 18:16:46 UTC
Size:
2.68 KB
patch
obsolete
>From 3c6652702af85b594c24ce402b6a29b3ac2329d1 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 16 Aug 2016 16:52:27 +0100 >Subject: [PATCH] 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> >--- > C4/Circulation.pm | 3 ++- > t/db_dependent/Circulation/SwitchOnSiteCheckouts.t | 19 +++++++++++++++++-- > 2 files changed, 19 insertions(+), 3 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index 3fa4e2b..4ab7afa 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -531,7 +531,8 @@ sub TooMany { > } > } > if ( C4::Context->preference('ConsiderOnSiteCheckoutsAsNormalCheckouts') ) { >- if ( $checkout_count >= $max_checkouts_allowed ) { >+ my $delta = $switch_onsite_checkout ? 1 : 0; >+ if ( $checkout_count >= $max_checkouts_allowed + $delta ) { > return { > reason => 'TOO_MANY_CHECKOUTS', > count => $checkout_count, >diff --git a/t/db_dependent/Circulation/SwitchOnSiteCheckouts.t b/t/db_dependent/Circulation/SwitchOnSiteCheckouts.t >index 4f8f175..5a46a20 100644 >--- a/t/db_dependent/Circulation/SwitchOnSiteCheckouts.t >+++ b/t/db_dependent/Circulation/SwitchOnSiteCheckouts.t >@@ -15,7 +15,7 @@ > # with Koha; if not, see <http://www.gnu.org/licenses>. > > use Modern::Perl; >-use Test::More tests => 5; >+use Test::More tests => 8; > use C4::Context; > > use C4::Biblio; >@@ -117,8 +117,23 @@ my $another_item = $builder->build({ > }); > > C4::Circulation::AddIssue( $patron, $another_item->{barcode}, dt_from_string, undef, dt_from_string, undef, { onsite_checkout => 1 } ); >-( undef, undef, undef, $messages ) = C4::Circulation::CanBookBeIssued( $patron, $another_item->{barcode} ); >+( $impossible, undef, undef, $messages ) = C4::Circulation::CanBookBeIssued( $patron, $another_item->{barcode} ); > is( $messages->{ONSITE_CHECKOUT_WILL_BE_SWITCHED}, 1, '' ); >+is( exists $impossible->{TOO_MANY}, '', '' ); >+ >+$dbh->do(q|DELETE FROM issuingrules|); >+my $borrower_circ_rule = $builder->build({ >+ source => 'DefaultCircRule', >+ value => { >+ branchcode => $branch->{branchcode}, >+ categorycode => '*', >+ maxissueqty => 2, >+ maxonsiteissueqty => 1, >+ }, >+}); >+( $impossible, undef, undef, $messages ) = C4::Circulation::CanBookBeIssued( $patron, $another_item->{barcode} ); >+is( $messages->{ONSITE_CHECKOUT_WILL_BE_SWITCHED}, 1, '' ); >+is( exists $impossible->{TOO_MANY}, '', '' ); > > $schema->storage->txn_rollback; > >-- >2.1.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 16272
:
50606
|
50607
|
51331
|
51332
|
51333
|
54498
|
54499
|
54523
|
54524
|
54526
|
54527
| 54528 |
54529
|
54579
|
54580