+
+
+#
+# reserve found and item arrived at the expected branch
+#
+if ( $messages->{'ResFound'} and not $messages->{'WrongTransfer'}) {
+ my $reserve = $messages->{'ResFound'};
+ my $branchname = $branches->{ $reserve->{'branchcode'} }->{'branchname'};
+ my ($borr) = GetMemberDetails( $reserve->{'borrowernumber'}, 0 );
+ if ( $reserve->{'ResFound'} eq "Waiting" ) {
+ if ( C4::Context->userenv->{'branch'} eq $reserve->{'branchcode'} ) {
+ $template->param( waiting => 1 );
+ }
+ else {
+ $template->param( waiting => 0 );
+ }
+
+ $template->param(
+ found => 1,
+ name => $borr->{'surname'} . " " . $borr->{'title'} . " " . $borr->{'firstname'},
+ borfirstname => $borr->{'firstname'},
+ borsurname => $borr->{'surname'},
+ bortitle => $borr->{'title'},
+ borphone => $borr->{'phone'},
+ boremail => $borr->{'email'},
+ boraddress => $borr->{'address'},
+ boraddress2 => $borr->{'address2'},
+ borcity => $borr->{'city'},
+ borzip => $borr->{'zipcode'},
+ borrowernumber => $reserve->{'borrowernumber'},
+ borcnum => $borr->{'cardnumber'},
+ debarred => $borr->{'debarred'},
+ gonenoaddress => $borr->{'gonenoaddress'},
+ currentbranch => $branches->{C4::Context->userenv->{'branch'}}->{'branchname'},
+ itemnumber => $reserve->{'itemnumber'},
+ barcode => $barcode,
+ );
+
+ }
+ if ( $reserve->{'ResFound'} eq "Reserved" ) {
+ my @da = localtime( time() );
+ my $todaysdate =
+ sprintf( "%0.2d", ( $da[3] + 1 ) ) . "/"
+ . sprintf( "%0.2d", ( $da[4] + 1 ) ) . "/"
+ . ( $da[5] + 1900 );
+
+ if ( C4::Context->userenv->{'branch'} eq $reserve->{'branchcode'} ) {
+ $template->param( intransit => 0 );
+ }
+ else {
+ $template->param( intransit => 1 );
+ }
+
+ $template->param(
+ found => 1,
+ currentbranch => $branches->{C4::Context->userenv->{'branch'}}->{'branchname'},
+ destbranchname =>
+ $branches->{ $reserve->{'branchcode'} }->{'branchname'},
+ destbranch => $reserve->{'branchcode'},
+ transfertodo => ( C4::Context->userenv->{'branch'} eq $reserve->{'branchcode'} ? 0 : 1 ),
+ reserved => 1,
+ resbarcode => $barcode,
+ today => $todaysdate,
+ itemnumber => $reserve->{'itemnumber'},
+ borsurname => $borr->{'surname'},
+ bortitle => $borr->{'title'},
+ borfirstname => $borr->{'firstname'},
+ borrowernumber => $reserve->{'borrowernumber'},
+ borcnum => $borr->{'cardnumber'},
+ borphone => $borr->{'phone'},
+ boraddress => $borr->{'address'},
+ boraddress2 => $borr->{'address2'},
+ borsub => $borr->{'suburb'},
+ borcity => $borr->{'city'},
+ borzip => $borr->{'zipcode'},
+ boremail => $borr->{'email'},
+ debarred => $borr->{'debarred'},
+ gonenoaddress => $borr->{'gonenoaddress'},
+ barcode => $barcode
+ );
+ }