Bugzilla – Attachment 108184 Details for
Bug 23695
Items holdingbranch should be set to the originating library when generating a manual transfer
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23695: Alter transferbook to take a hash of params and specify from_branch
Bug-23695-Alter-transferbook-to-take-a-hash-of-par.patch (text/plain), 7.34 KB, created by
Martin Renvoize (ashimema)
on 2020-08-13 13:45:05 UTC
(
hide
)
Description:
Bug 23695: Alter transferbook to take a hash of params and specify from_branch
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2020-08-13 13:45:05 UTC
Size:
7.34 KB
patch
obsolete
>From 6289ef3f4e7f504bf0127c6d34d55e1fd882e781 Mon Sep 17 00:00:00 2001 >From: Nick <nick@bywatersolutions.com> >Date: Mon, 30 Sep 2019 10:37:03 +0000 >Subject: [PATCH] Bug 23695: Alter transferbook to take a hash of params and > specify from_branch > >To test: > 1 - Go to Circulation->Transfer > 2 - Find an item from your branch and create a transfer to branch B > 3 - Note you can specify the origin and default is 'Item's holding library' > 4 - Confirm the item is marked as held at your current branch and is being transferred to B > 5 - Find an item from a third branch, branch C > 6 - Transfer that item to branch B from branch D > 7 - Confirm the item is held at branch D and is being transferred to B > 8 - prove -v t/db_dependent/Circulation.t > 9 - prove -v t/db_dependent/Koha/Items.t >10 - prove -v t/db_dependent/RotatingCollections.t > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > circ/branchtransfers.pl | 2 ++ > .../prog/en/modules/circ/branchtransfers.tt | 11 ++++++++ > t/db_dependent/Circulation.t | 28 ++++++++++++++++++- > 3 files changed, 40 insertions(+), 1 deletion(-) > >diff --git a/circ/branchtransfers.pl b/circ/branchtransfers.pl >index 1e9f48c48e..b5e807b8c1 100755 >--- a/circ/branchtransfers.pl >+++ b/circ/branchtransfers.pl >@@ -80,6 +80,7 @@ my $setwaiting; > > my $request = $query->param('request') || ''; > my $borrowernumber = $query->param('borrowernumber') || 0; >+my $frombranchcd = $query->param('frombranchcd') || C4::Context->userenv->{'branch'}; > my $tobranchcd = $query->param('tobranchcd') || ''; > > my $ignoreRs = 0; >@@ -223,6 +224,7 @@ $template->param( > itemnumber => $itemnumber, > barcode => $barcode, > biblionumber => $biblionumber, >+ frombranchcd => $frombranchcd, > tobranchcd => $tobranchcd, > reqmessage => $reqmessage, > cancelled => $cancelled, >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/branchtransfers.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/branchtransfers.tt >index 5eb69ed385..b640cf07db 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/branchtransfers.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/branchtransfers.tt >@@ -72,6 +72,7 @@ > <input type="hidden" name="biblionumber" value="[% biblionumber | html %]" /> > <input type="hidden" name="borrowernumber" value="[% borrowernumber | html %]" /> > <input type="hidden" name="tobranchcd" value="[% tobranchcd | html %]" /> >+ <input type="hidden" name="frombranchcd" value="[% tobranchcd | html %]" /> > <input type="hidden" name="barcode" value="[% barcode | html %]" /> > <input type="hidden" name="request" value="KillReserved" /> > <input type="submit" value="Cancel" /> >@@ -128,6 +129,7 @@ > [% ELSE %] > <li>Collection: <b>[% AuthorisedValues.GetByCode( 'CCODE', errmsgloo.code ) | html %]</b></li> > [% END %] >+ <li>Originating library: <b>[% Branches.GetName( errmsgloo.fbr ) | html %]</b></li> > <li>Destination library: <b>[% Branches.GetName( errmsgloo.tbr ) | html %]</b></li> > </ol> > </li> >@@ -151,6 +153,13 @@ > <legend>Transfer</legend> > <ol> > <li> >+ <label for="frombranchcd">Originating library: </label> >+ <select name="frombranchcd" id="frombranchcd"> >+ <option value="current_holding">Item's holding branch</option> >+ [% PROCESS options_for_libraries libraries => Branches.all( selected => '', unfiltered => 1) %] >+ </select> >+ </li> >+ <li> > <label for="tobranchcd">Destination library: </label> > <select name="tobranchcd" id="tobranchcd"> > [% PROCESS options_for_libraries libraries => Branches.all( selected => tobranchcd, unfiltered => 1) %] >@@ -182,6 +191,7 @@ > <th class="tf-itemcallnumber">Call number</th> > <th class="tf-itemtype">Item type</th> > <th class="tf-ccode">Collection</th> >+ <th class="tf-origin">Origin</th> > <th class="tf-destination">Destination</th> > </tr> > [% FOREACH trsfitemloo IN trsfitemloop %] >@@ -197,6 +207,7 @@ > <td class="tf-itemcallnumber">[% trsfitemloo.item.itemcallnumber | html %]</td> > <td class="tf-itemtype">[% ItemTypes.GetDescription( trsfitemloo.item.effective_itemtype ) | html %]</td> > <td class="tf-ccode">[% AuthorisedValues.GetByCode( 'CCODE', trsfitemloo.item.ccode ) | html %]</td> >+ <td class="tf-origin">[% Branches.GetName( trsfitemloo.frombrcd ) | html %]</td> > <td class="tf-destination">[% Branches.GetName( trsfitemloo.tobrcd ) | html %]</td> > </tr> > [% END %] >diff --git a/t/db_dependent/Circulation.t b/t/db_dependent/Circulation.t >index f3f2671a1b..22446cde11 100755 >--- a/t/db_dependent/Circulation.t >+++ b/t/db_dependent/Circulation.t >@@ -18,7 +18,7 @@ > use Modern::Perl; > use utf8; > >-use Test::More tests => 49; >+use Test::More tests => 50; > use Test::MockModule; > use Test::Deep qw( cmp_deeply ); > >@@ -3293,6 +3293,32 @@ subtest 'Cancel transfers on lost items' => sub { > is( $tobranch, undef, 'The transfer on the lost item has been deleted as the LostItemCancelOutstandingTransfer is enabled'); > $itemcheck = Koha::Items->find($item->itemnumber); > is( $itemcheck->holdingbranch, $library_1->{branchcode}, 'Lost item with cancelled hold has holding branch equallying the transfers source branch' ); >+ >+}; >+ >+subtest 'transferbook test' => sub { >+ plan tests => 5; >+ >+ my $library = $builder->build_object( { class => 'Koha::Libraries' } ); >+ my $item = $builder->build_sample_item(); >+ ok( $item->holdingbranch ne $library->branchcode && $item->homebranch ne $library->branchcode, "Item is not held or owned by library"); >+ C4::Circulation::transferbook({ >+ from_branch => $library->branchcode, >+ to_branch => $item->homebranch, >+ barcode => $item->barcode, >+ }); >+ my ($datesent,$from_branch,$to_branch) = GetTransfers($item->itemnumber); >+ is( $from_branch, $library->branchcode, 'The transfer is initiated from the specified branch, not the items home or holdingbranch'); >+ is( $to_branch, $item->homebranch, 'The transfer is initiated to the specified branch'); >+ C4::Circulation::transferbook({ >+ from_branch => $item->homebranch, >+ to_branch => $library->branchcode, >+ barcode => $item->barcode, >+ }); >+ ($datesent,$from_branch,$to_branch) = GetTransfers($item->itemnumber); >+ is( $from_branch, $item->homebranch, 'The transfer is initiated from the specified branch'); >+ is( $to_branch, $library->branchcode, 'The transfer is initiated to the specified branch'); >+ > }; > > subtest 'CanBookBeIssued | is_overdue' => sub { >-- >2.20.1
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 23695
:
93231
|
98942
|
99955
|
99956
|
100567
|
100568
|
101441
|
101442
|
101443
|
107463
|
107464
|
107465
|
108183
| 108184 |
108185
|
108186
|
108273
|
108495
|
111391
|
111394