@@ -, +, @@
specify from_branch
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
---
circ/branchtransfers.pl | 10 ++++----
.../prog/en/modules/circ/branchtransfers.tt | 11 +++++++++
t/db_dependent/Circulation.t | 28 +++++++++++++++++++++-
3 files changed, 44 insertions(+), 5 deletions(-)
--- a/circ/branchtransfers.pl
+++ a/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;
@@ -126,19 +127,19 @@ defined $barcode and $barcode =~ s/^\s*|\s*$//g; # FIXME: barcodeInputFilter
# warn "barcode : $barcode";
if ($barcode) {
+ my $item = Koha::Items->find({ barcode => $barcode });
+ $frombranchcd = $item->holdingbranch if $frombranchcd eq "current_holding";
( $transferred, $messages ) =
transferbook({
- from_branch => C4::Context->userenv->{'branch'},
+ from_branch => $frombranchcd,
to_branch => $tobranchcd,
barcode => $barcode,
ignore_reserves => $ignoreRs
});
- my $item = Koha::Items->find({ barcode => $barcode });
$found = $messages->{'ResFound'};
if ($transferred) {
my %item;
my $biblio = $item->biblio;
- my $frbranchcd = C4::Context->userenv->{'branch'};
$item{'biblionumber'} = $item->biblionumber;
$item{'itemnumber'} = $item->itemnumber;
$item{'title'} = $biblio->title;
@@ -150,7 +151,7 @@ if ($barcode) {
$item{'location'} = $av->count ? $av->next->lib : '';
$item{counter} = 0;
$item{barcode} = $barcode;
- $item{frombrcd} = $frbranchcd;
+ $item{frombrcd} = $frombranchcd;
$item{tobrcd} = $tobranchcd;
push( @trsfitemloop, \%item );
}
@@ -240,6 +241,7 @@ $template->param(
itemnumber => $itemnumber,
barcode => $barcode,
biblionumber => $biblionumber,
+ frombranchcd => $frombranchcd,
tobranchcd => $tobranchcd,
reqmessage => $reqmessage,
cancelled => $cancelled,
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/branchtransfers.tt
+++ a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/branchtransfers.tt
@@ -71,6 +71,7 @@
+
@@ -127,6 +128,7 @@
[% ELSE %]
Collection code: [% AuthorisedValues.GetByCode( 'CCODE', errmsgloo.code ) | html %]
[% END %]
+ Originating library: [% Branches.GetName( errmsgloo.fbr ) | html %]
Destination library: [% Branches.GetName( errmsgloo.tbr ) | html %]
@@ -150,6 +152,13 @@
-
+
+
+
+ -