View | Details | Raw Unified | Return to bug 7362
Collapse All | Expand All

(-)a/C4/Circulation.pm (-20 / +18 lines)
Lines 314-320 sub transferbook { Link Here
314
314
315
    # check if it is still issued to someone, return it...
315
    # check if it is still issued to someone, return it...
316
    if ($issue->{borrowernumber}) {
316
    if ($issue->{borrowernumber}) {
317
        AddReturn( $barcode, $fbr );
317
        AddReturn( $itemnumber, $fbr );
318
        $messages->{'WasReturned'} = $issue->{borrowernumber};
318
        $messages->{'WasReturned'} = $issue->{borrowernumber};
319
    }
319
    }
320
320
Lines 997-1003 sub AddIssue { Link Here
997
				# This book is currently on loan, but not to the person
997
				# This book is currently on loan, but not to the person
998
				# who wants to borrow it now. mark it returned before issuing to the new borrower
998
				# who wants to borrow it now. mark it returned before issuing to the new borrower
999
				AddReturn(
999
				AddReturn(
1000
					$item->{'barcode'},
1000
					$item->{'itemnumber'},
1001
					C4::Context->userenv->{'branch'}
1001
					C4::Context->userenv->{'branch'}
1002
				);
1002
				);
1003
			}
1003
			}
Lines 1419-1431 sub GetBranchItemRule { Link Here
1419
=head2 AddReturn
1419
=head2 AddReturn
1420
1420
1421
  ($doreturn, $messages, $iteminformation, $borrower) =
1421
  ($doreturn, $messages, $iteminformation, $borrower) =
1422
      &AddReturn($barcode, $branch, $exemptfine, $dropbox);
1422
      &AddReturn($itemnumber, $branch, $exemptfine, $dropbox);
1423
1423
1424
Returns a book.
1424
Returns a book.
1425
1425
1426
=over 4
1426
=over 4
1427
1427
1428
=item C<$barcode> is the bar code of the book being returned.
1428
=item C<$itemnumber> is the item number of the book being returned.
1429
1429
1430
=item C<$branch> is the code of the branch where the book is being returned.
1430
=item C<$branch> is the code of the branch where the book is being returned.
1431
1431
Lines 1449-1461 The keys of the hash are: Link Here
1449
1449
1450
=over 4
1450
=over 4
1451
1451
1452
=item C<BadBarcode>
1452
=item C<BadItemnumber>
1453
1453
1454
No item with this barcode exists. The value is C<$barcode>.
1454
No item with this itemnumber exists. The value is C<$itemnumber>.
1455
1455
1456
=item C<NotIssued>
1456
=item C<NotIssued>
1457
1457
1458
The book is not currently on loan. The value is C<$barcode>.
1458
The book is not currently on loan. The value is C<$itemnumber>.
1459
1459
1460
=item C<IsPermanent>
1460
=item C<IsPermanent>
1461
1461
Lines 1465-1471 the book's home branch. Link Here
1465
1465
1466
=item C<wthdrawn>
1466
=item C<wthdrawn>
1467
1467
1468
This book has been withdrawn/cancelled. The value should be ignored.
1468
This book has been withdrawn/cancelled. The value should be ignored. The
1469
spelling is not a typo.
1469
1470
1470
=item C<Wrongbranch>
1471
=item C<Wrongbranch>
1471
1472
Lines 1491-1497 patron who last borrowed the book. Link Here
1491
=cut
1492
=cut
1492
1493
1493
sub AddReturn {
1494
sub AddReturn {
1494
    my ( $barcode, $branch, $exemptfine, $dropbox ) = @_;
1495
    my ( $itemnumber, $branch, $exemptfine, $dropbox ) = @_;
1495
    if ($branch and not GetBranchDetail($branch)) {
1496
    if ($branch and not GetBranchDetail($branch)) {
1496
        warn "AddReturn error: branch '$branch' not found.  Reverting to " . C4::Context->userenv->{'branch'};
1497
        warn "AddReturn error: branch '$branch' not found.  Reverting to " . C4::Context->userenv->{'branch'};
1497
        undef $branch;
1498
        undef $branch;
Lines 1502-1522 sub AddReturn { Link Here
1502
    my $biblio;
1503
    my $biblio;
1503
    my $doreturn       = 1;
1504
    my $doreturn       = 1;
1504
    my $validTransfert = 0;
1505
    my $validTransfert = 0;
1505
    my $stat_type = 'return';    
1506
    my $stat_type = 'return';
1506
1507
1507
    # get information on item
1508
    # get information on item
1508
    my $itemnumber = GetItemnumberFromBarcode( $barcode );
1509
    my $item = GetItem($itemnumber);
1509
    unless ($itemnumber) {
1510
    unless ($item) {
1510
        return (0, { BadBarcode => $barcode }); # no barcode means no item or borrower.  bail out.
1511
        return (0, { BadItemnumber => $itemnumber });
1511
    }
1512
    }
1512
    my $issue  = GetItemIssue($itemnumber);
1513
    my $issue  = GetItemIssue($itemnumber);
1513
#   warn Dumper($iteminformation);
1514
#   warn Dumper($iteminformation);
1514
    if ($issue and $issue->{borrowernumber}) {
1515
    if ($issue and $issue->{borrowernumber}) {
1515
        $borrower = C4::Members::GetMemberDetails($issue->{borrowernumber})
1516
        $borrower = C4::Members::GetMemberDetails($issue->{borrowernumber})
1516
            or die "Data inconsistency: barcode $barcode (itemnumber:$itemnumber) claims to be issued to non-existant borrowernumber '$issue->{borrowernumber}'\n"
1517
            or die "Data inconsistency: itemnumber:$itemnumber claims to be issued to non-existant borrowernumber '$issue->{borrowernumber}'\n"
1517
                . Dumper($issue) . "\n";
1518
                . Dumper($issue) . "\n";
1518
    } else {
1519
    } else {
1519
        $messages->{'NotIssued'} = $barcode;
1520
        $messages->{'NotIssued'} = $itemnumber;
1520
        # even though item is not on loan, it may still be transferred;  therefore, get current branch info
1521
        # even though item is not on loan, it may still be transferred;  therefore, get current branch info
1521
        $doreturn = 0;
1522
        $doreturn = 0;
1522
        # No issue, no borrowernumber.  ONLY if $doreturn, *might* you have a $borrower later.
1523
        # No issue, no borrowernumber.  ONLY if $doreturn, *might* you have a $borrower later.
Lines 1527-1535 sub AddReturn { Link Here
1527
        }
1528
        }
1528
    }
1529
    }
1529
1530
1530
    my $item = GetItem($itemnumber) or die "GetItem($itemnumber) failed";
1531
        # full item data, but no borrowernumber or checkout info (no issue)
1532
        # we know GetItem should work because GetItemnumberFromBarcode worked
1533
    my $hbr      = C4::Context->preference("HomeOrHoldingBranchReturn") || "homebranch";
1531
    my $hbr      = C4::Context->preference("HomeOrHoldingBranchReturn") || "homebranch";
1534
    $hbr = $item->{$hbr} || '';
1532
    $hbr = $item->{$hbr} || '';
1535
        # item must be from items table -- issues table has branchcode and issuingbranch, not homebranch nor holdingbranch
1533
        # item must be from items table -- issues table has branchcode and issuingbranch, not homebranch nor holdingbranch
Lines 1611-1617 sub AddReturn { Link Here
1611
1609
1612
    # fix up the accounts.....
1610
    # fix up the accounts.....
1613
    if ($item->{'itemlost'}) {
1611
    if ($item->{'itemlost'}) {
1614
        _FixAccountForLostAndReturned($item->{'itemnumber'}, $borrowernumber, $barcode);    # can tolerate undef $borrowernumber
1612
        _FixAccountForLostAndReturned($item->{'itemnumber'}, $borrowernumber, $item->{'barcode'});    # can tolerate undef $borrowernumber
1615
        $messages->{'WasLost'} = 1;
1613
        $messages->{'WasLost'} = 1;
1616
    }
1614
    }
1617
1615
Lines 1619-1625 sub AddReturn { Link Here
1619
    if ($borrowernumber) {
1617
    if ($borrowernumber) {
1620
        my $fix = _FixOverduesOnReturn($borrowernumber, $item->{itemnumber}, $exemptfine, $dropbox);
1618
        my $fix = _FixOverduesOnReturn($borrowernumber, $item->{itemnumber}, $exemptfine, $dropbox);
1621
        defined($fix) or warn "_FixOverduesOnReturn($borrowernumber, $item->{itemnumber}...) failed!";  # zero is OK, check defined
1619
        defined($fix) or warn "_FixOverduesOnReturn($borrowernumber, $item->{itemnumber}...) failed!";  # zero is OK, check defined
1622
        
1620
1623
        # fix fine days
1621
        # fix fine days
1624
        my $debardate = _FixFineDaysOnReturn( $borrower, $item, $issue->{date_due} );
1622
        my $debardate = _FixFineDaysOnReturn( $borrower, $item, $issue->{date_due} );
1625
        $messages->{'Debarred'} = $debardate if ($debardate);
1623
        $messages->{'Debarred'} = $debardate if ($debardate);
(-)a/C4/Items.pm (-1 / +4 lines)
Lines 2-7 package C4::Items; Link Here
2
2
3
# Copyright 2007 LibLime, Inc.
3
# Copyright 2007 LibLime, Inc.
4
# Parts Copyright Biblibre 2010
4
# Parts Copyright Biblibre 2010
5
# Copyright 2011 Catalyst IT
5
#
6
#
6
# This file is part of Koha.
7
# This file is part of Koha.
7
#
8
#
Lines 134-139 Return item information, for a given itemnumber or barcode. Link Here
134
The return value is a hashref mapping item column
135
The return value is a hashref mapping item column
135
names to values.  If C<$serial> is true, include serial publication data.
136
names to values.  If C<$serial> is true, include serial publication data.
136
137
138
If the requested item doesn't exist, C<undef> is returned.
139
137
=cut
140
=cut
138
141
139
sub GetItem {
142
sub GetItem {
Lines 160-166 sub GetItem { Link Here
160
        ($data->{'serialseq'} , $data->{'publisheddate'}) = $ssth->fetchrow_array();
163
        ($data->{'serialseq'} , $data->{'publisheddate'}) = $ssth->fetchrow_array();
161
    }
164
    }
162
	#if we don't have an items.itype, use biblioitems.itemtype.
165
	#if we don't have an items.itype, use biblioitems.itemtype.
163
	if( ! $data->{'itype'} ) {
166
	if( $data && ! $data->{'itype'} ) {
164
		my $sth = $dbh->prepare("SELECT itemtype FROM biblioitems  WHERE biblionumber = ?");
167
		my $sth = $dbh->prepare("SELECT itemtype FROM biblioitems  WHERE biblionumber = ?");
165
		$sth->execute($data->{'biblionumber'});
168
		$sth->execute($data->{'biblionumber'});
166
		($data->{'itype'}) = $sth->fetchrow_array;
169
		($data->{'itype'}) = $sth->fetchrow_array;
(-)a/C4/SIP/ILS/Transaction/Checkin.pm (-3 / +3 lines)
Lines 45-53 sub new { Link Here
45
sub do_checkin {
45
sub do_checkin {
46
    my $self = shift;
46
    my $self = shift;
47
    my $branch = @_ ? shift : 'SIP2' ;
47
    my $branch = @_ ? shift : 'SIP2' ;
48
    my $barcode = $self->{item}->id;
48
    my $itemnumber = $self->{item}->{'itemnumber'};
49
    $debug and warn "do_checkin() calling AddReturn($barcode, $branch)";
49
    $debug and warn "do_checkin() calling AddReturn($itemnumber, $branch)";
50
    my ($return, $messages, $iteminformation, $borrower) = AddReturn($barcode, $branch);
50
    my ($return, $messages, $iteminformation, $borrower) = AddReturn($itemnumber, $branch);
51
    $self->alert(!$return);
51
    $self->alert(!$return);
52
    # ignoring messages: NotIssued, IsPermanent, WasLost, WasTransfered
52
    # ignoring messages: NotIssued, IsPermanent, WasLost, WasTransfered
53
53
(-)a/circ/circulation.pl (-11 / +12 lines)
Lines 92-98 my ( $template, $loggedinuser, $cookie ) = get_template_and_user ( Link Here
92
92
93
my $branches = GetBranches();
93
my $branches = GetBranches();
94
94
95
my @failedrenews = $query->param('failedrenew');    # expected to be itemnumbers 
95
my @failedrenews = $query->param('failedrenew');    # expected to be itemnumbers
96
my %renew_failed;
96
my %renew_failed;
97
for (@failedrenews) { $renew_failed{$_} = 1; }
97
for (@failedrenews) { $renew_failed{$_} = 1; }
98
98
Lines 665-671 $template->param( Link Here
665
    borrower          => $borrower,
665
    borrower          => $borrower,
666
    borrowernumber    => $borrowernumber,
666
    borrowernumber    => $borrowernumber,
667
    branch            => $branch,
667
    branch            => $branch,
668
    branchname        => GetBranchName($borrower->{'branchcode'}),
668
    branchname        => GetBranchName( $borrower->{'branchcode'} ),
669
    printer           => $printer,
669
    printer           => $printer,
670
    printername       => $printer,
670
    printername       => $printer,
671
    firstname         => $borrower->{'firstname'},
671
    firstname         => $borrower->{'firstname'},
Lines 673-679 $template->param( Link Here
673
    showname          => $borrower->{'showname'},
673
    showname          => $borrower->{'showname'},
674
    category_type     => $borrower->{'category_type'},
674
    category_type     => $borrower->{'category_type'},
675
    dateexpiry        => format_date($newexpiry),
675
    dateexpiry        => format_date($newexpiry),
676
    expiry            => format_date($borrower->{'dateexpiry'}),
676
    expiry            => format_date( $borrower->{'dateexpiry'} ),
677
    categorycode      => $borrower->{'categorycode'},
677
    categorycode      => $borrower->{'categorycode'},
678
    categoryname      => $borrower->{description},
678
    categoryname      => $borrower->{description},
679
    address           => $address,
679
    address           => $address,
Lines 682-688 $template->param( Link Here
682
    emailpro          => $borrower->{'emailpro'},
682
    emailpro          => $borrower->{'emailpro'},
683
    borrowernotes     => $borrower->{'borrowernotes'},
683
    borrowernotes     => $borrower->{'borrowernotes'},
684
    city              => $borrower->{'city'},
684
    city              => $borrower->{'city'},
685
    state              => $borrower->{'state'},
685
    state             => $borrower->{'state'},
686
    zipcode           => $borrower->{'zipcode'},
686
    zipcode           => $borrower->{'zipcode'},
687
    country           => $borrower->{'country'},
687
    country           => $borrower->{'country'},
688
    phone             => $borrower->{'phone'} || $borrower->{'mobile'},
688
    phone             => $borrower->{'phone'} || $borrower->{'mobile'},
Lines 694-713 $template->param( Link Here
694
    duedatespec       => $duedatespec,
694
    duedatespec       => $duedatespec,
695
    message           => $message,
695
    message           => $message,
696
    CGIselectborrower => $CGIselectborrower,
696
    CGIselectborrower => $CGIselectborrower,
697
    totalprice        => sprintf('%.2f', $totalprice),
697
    totalprice        => sprintf( '%.2f', $totalprice ),
698
    totaldue          => sprintf('%.2f', $total),
698
    totaldue          => sprintf( '%.2f', $total ),
699
    todayissues       => \@todaysissues,
699
    todayissues       => \@todaysissues,
700
    previssues        => \@previousissues,
700
    previssues        => \@previousissues,
701
    relissues			=> \@relissues,
701
    relissues         => \@relissues,
702
    relprevissues		=> \@relprevissues,
702
    relprevissues     => \@relprevissues,
703
    displayrelissues		=> $displayrelissues,
703
    displayrelissues  => $displayrelissues,
704
    inprocess         => $inprocess,
704
    inprocess         => $inprocess,
705
    memberofinstution => $member_of_institution,
705
    memberofinstution => $member_of_institution,
706
    CGIorganisations  => $CGIorganisations,
706
    CGIorganisations  => $CGIorganisations,
707
    is_child          => ($borrower->{'category_type'} eq 'C'),
707
    is_child          => ( $borrower->{'category_type'} eq 'C' ),
708
    circview => 1,
708
    circview          => 1,
709
    soundon           => C4::Context->preference("SoundOn"),
709
    soundon           => C4::Context->preference("SoundOn"),
710
    fast_cataloging   => $fast_cataloging,
710
    fast_cataloging   => $fast_cataloging,
711
    can_be_itemnumber => C4::Context->preference('CircFallbackItemnumber'),
711
);
712
);
712
713
713
# save stickyduedate to session
714
# save stickyduedate to session
(-)a/circ/returns.pl (-61 / +91 lines)
Lines 3-9 Link Here
3
# Copyright 2000-2002 Katipo Communications
3
# Copyright 2000-2002 Katipo Communications
4
#           2006 SAN-OP
4
#           2006 SAN-OP
5
#           2007-2010 BibLibre, Paul POULAIN
5
#           2007-2010 BibLibre, Paul POULAIN
6
#           2010 Catalyst IT
6
#           2010-2011 Catalyst IT
7
#
7
#
8
# This file is part of Koha.
8
# This file is part of Koha.
9
#
9
#
Lines 86-91 my $userenv_branch = C4::Context->userenv->{'branch'} || ''; Link Here
86
my %returneditems;
86
my %returneditems;
87
my %riduedate;
87
my %riduedate;
88
my %riborrowernumber;
88
my %riborrowernumber;
89
my %ribarcode;
89
my @inputloop;
90
my @inputloop;
90
foreach ( $query->param ) {
91
foreach ( $query->param ) {
91
    my $counter;
92
    my $counter;
Lines 99-122 foreach ( $query->param ) { Link Here
99
        next;
100
        next;
100
    }
101
    }
101
102
103
    # These "slide up" the list of returned items, to make room for the one
104
    # being processed now.
102
    my %input;
105
    my %input;
103
    my $barcode        = $query->param("ri-$counter");
106
    my $itemnumber     = $query->param("ri-$counter");
107
    my $barcode        = $query->param("bc-$counter");
104
    my $duedate        = $query->param("dd-$counter");
108
    my $duedate        = $query->param("dd-$counter");
105
    my $borrowernumber = $query->param("bn-$counter");
109
    my $borrowernumber = $query->param("bn-$counter");
106
    $counter++;
110
    $counter++;
107
111
108
    # decode barcode    ## Didn't we already decode them before passing them back last time??
112
    $returneditems{$counter}    = $itemnumber;
109
    $barcode =~ s/^\s*|\s*$//g; # remove leading/trailing whitespace
110
    $barcode = barcodedecode($barcode) if(C4::Context->preference('itemBarcodeInputFilter'));
111
112
    ######################
113
    #Are these lines still useful ?
114
    $returneditems{$counter}    = $barcode;
115
    $riduedate{$counter}        = $duedate;
113
    $riduedate{$counter}        = $duedate;
116
    $riborrowernumber{$counter} = $borrowernumber;
114
    $riborrowernumber{$counter} = $borrowernumber;
115
    $ribarcode{$counter}        = $barcode;
117
116
118
    #######################
119
    $input{counter}        = $counter;
117
    $input{counter}        = $counter;
118
    $input{itemnumber}     = $itemnumber;
120
    $input{barcode}        = $barcode;
119
    $input{barcode}        = $barcode;
121
    $input{duedate}        = $duedate;
120
    $input{duedate}        = $duedate;
122
    $input{borrowernumber} = $borrowernumber;
121
    $input{borrowernumber} = $borrowernumber;
Lines 168-173 my $returned = 0; Link Here
168
my $messages;
167
my $messages;
169
my $issueinformation;
168
my $issueinformation;
170
my $itemnumber;
169
my $itemnumber;
170
# Depending on the setting of CircItemnumberFallback, this may also contain
171
# the itemnumber.
171
my $barcode     = $query->param('barcode');
172
my $barcode     = $query->param('barcode');
172
my $exemptfine  = $query->param('exemptfine');
173
my $exemptfine  = $query->param('exemptfine');
173
my $dropboxmode = $query->param('dropboxmode');
174
my $dropboxmode = $query->param('dropboxmode');
Lines 198-218 if ($canceltransfer){ Link Here
198
}
199
}
199
200
200
# actually return book and prepare item table.....
201
# actually return book and prepare item table.....
202
my $item;
201
if ($barcode) {
203
if ($barcode) {
202
    $barcode =~ s/^\s*|\s*$//g; # remove leading/trailing whitespace
204
    $barcode =~ s/^\s*|\s*$//g; # remove leading/trailing whitespace
205
    my $orig_barcode = $barcode;
203
    $barcode = barcodedecode($barcode) if C4::Context->preference('itemBarcodeInputFilter');
206
    $barcode = barcodedecode($barcode) if C4::Context->preference('itemBarcodeInputFilter');
204
    $itemnumber = GetItemnumberFromBarcode($barcode);
207
    $itemnumber = GetItemnumberFromBarcode($barcode);
205
208
    if (!$itemnumber && C4::Context->preference('CircFallbackItemnumber')) {
206
    if ( C4::Context->preference("InProcessingToShelvingCart") ) {
209
        # See if we have a real item number instead of a barcode
207
        my $item = GetItem( $itemnumber );
210
        $item = GetItem($orig_barcode);
211
        $itemnumber = $item->{itemnumber} if $item;
212
    }
213
    else {
214
        $item = GetItem($itemnumber);
215
    }
216
    # If the provided item doesn't exist, then we will fall through and
217
    # this problem is picked up by AddReturn.
218
    if ( C4::Context->preference("InProcessingToShelvingCart") && $item ) {
208
        if ( $item->{'location'} eq 'PROC' ) {
219
        if ( $item->{'location'} eq 'PROC' ) {
209
            $item->{'location'} = 'CART';
220
            $item->{'location'} = 'CART';
210
            ModItem( $item, $item->{'biblionumber'}, $item->{'itemnumber'} );
221
            ModItem( $item, $item->{'biblionumber'}, $item->{'itemnumber'} );
211
        }
222
        }
212
    }
223
    }
213
224
214
    if ( C4::Context->preference("ReturnToShelvingCart") ) {
225
    if ( C4::Context->preference("ReturnToShelvingCart") && $item) {
215
        my $item = GetItem( $itemnumber );
216
        $item->{'location'} = 'CART';
226
        $item->{'location'} = 'CART';
217
        ModItem( $item, $item->{'biblionumber'}, $item->{'itemnumber'} );
227
        ModItem( $item, $item->{'biblionumber'}, $item->{'itemnumber'} );
218
    }
228
    }
Lines 221-227 if ($barcode) { Link Here
221
# save the return
231
# save the return
222
#
232
#
223
    ( $returned, $messages, $issueinformation, $borrower ) =
233
    ( $returned, $messages, $issueinformation, $borrower ) =
224
      AddReturn( $barcode, $userenv_branch, $exemptfine, $dropboxmode);     # do the return
234
      AddReturn( $itemnumber, $userenv_branch, $exemptfine, $dropboxmode );
225
    my $homeorholdingbranchreturn = C4::Context->preference('HomeOrHoldingBranchReturn') or 'homebranch';
235
    my $homeorholdingbranchreturn = C4::Context->preference('HomeOrHoldingBranchReturn') or 'homebranch';
226
236
227
    # get biblio description
237
    # get biblio description
Lines 237-259 if ($barcode) { Link Here
237
        itembarcode      => $biblio->{'barcode'},
247
        itembarcode      => $biblio->{'barcode'},
238
        itemtype         => $biblio->{'itemtype'},
248
        itemtype         => $biblio->{'itemtype'},
239
        ccode            => $biblio->{'ccode'},
249
        ccode            => $biblio->{'ccode'},
240
        itembiblionumber => $biblio->{'biblionumber'},    
250
        itembiblionumber => $biblio->{'biblionumber'},
251
        itemnumber       => $itemnumber,
241
    );
252
    );
242
253
243
    my %input = (
254
    my %input = (
244
        counter => 0,
255
        counter    => 0,
245
        first   => 1,
256
        first      => 1,
246
        barcode => $barcode,
257
        barcode    => $biblio->{barcode},
258
        itemnumber => $itemnumber,
247
    );
259
    );
248
260
249
    if ($returned) {
261
    if ($returned) {
250
        my $duedate = $issueinformation->{'date_due'};
262
        my $duedate = $issueinformation->{'date_due'};
251
        $returneditems{0}      = $barcode;
263
        $returneditems{0}      = $itemnumber;
252
        $riborrowernumber{0}   = $borrower->{'borrowernumber'};
264
        $riborrowernumber{0}   = $borrower->{'borrowernumber'};
253
        $riduedate{0}          = $duedate;
265
        $riduedate{0}          = $duedate;
266
        $ribarcode{0}          = $biblio->{barcode};
254
        $input{borrowernumber} = $borrower->{'borrowernumber'};
267
        $input{borrowernumber} = $borrower->{'borrowernumber'};
255
        $input{duedate}        = $duedate;
268
        $input{duedate}        = $duedate;
256
        $input{return_overdue} = 1 if ($duedate and $duedate lt $today->output('iso'));
269
        $input{return_overdue} = 1
270
          if ( $duedate and $duedate lt $today->output('iso') );
257
        push( @inputloop, \%input );
271
        push( @inputloop, \%input );
258
272
259
        if ( C4::Context->preference("FineNotifyAtCheckin") ) {
273
        if ( C4::Context->preference("FineNotifyAtCheckin") ) {
Lines 283-291 if ($barcode) { Link Here
283
            }
297
            }
284
        }
298
        }
285
    }
299
    }
286
    elsif ( !$messages->{'BadBarcode'} ) {
300
    elsif ( !$messages->{'BadItemnumber'} ) {
287
        $input{duedate}   = 0;
301
        $input{duedate}   = 0;
288
        $returneditems{0} = $barcode;
302
        $returneditems{0} = $itemnumber;
289
        $riduedate{0}     = 0;
303
        $riduedate{0}     = 0;
290
        if ( $messages->{'wthdrawn'} ) {
304
        if ( $messages->{'wthdrawn'} ) {
291
            $input{withdrawn}      = 1;
305
            $input{withdrawn}      = 1;
Lines 376-385 if ( $messages->{'ResFound'}) { Link Here
376
            );
390
            );
377
        } elsif ( $reserve->{'ResFound'} eq "Reserved" ) {
391
        } elsif ( $reserve->{'ResFound'} eq "Reserved" ) {
378
            $template->param(
392
            $template->param(
379
                intransit    => ($userenv_branch eq $reserve->{'branchcode'} ? 0 : 1 ),
393
                intransit =>
380
                transfertodo => ($userenv_branch eq $reserve->{'branchcode'} ? 0 : 1 ),
394
                  ( $userenv_branch eq $reserve->{'branchcode'} ? 0 : 1 ),
381
                resbarcode   => $barcode,
395
                transfertodo =>
382
                reserved     => 1,
396
                  ( $userenv_branch eq $reserve->{'branchcode'} ? 0 : 1 ),
397
                resbarcode    => $item->{barcode},
398
                resitemnumber => $item->{itemnumber},
399
                reserved      => 1,
383
            );
400
            );
384
        }
401
        }
385
402
Lines 401-407 if ( $messages->{'ResFound'}) { Link Here
401
            borcnum        => $borr->{'cardnumber'},
418
            borcnum        => $borr->{'cardnumber'},
402
            debarred       => $borr->{'debarred'},
419
            debarred       => $borr->{'debarred'},
403
            gonenoaddress  => $borr->{'gonenoaddress'},
420
            gonenoaddress  => $borr->{'gonenoaddress'},
404
            barcode        => $barcode,
421
            barcode        => $reserve->{'barcode'},
405
            destbranch     => $reserve->{'branchcode'},
422
            destbranch     => $reserve->{'branchcode'},
406
            borrowernumber => $reserve->{'borrowernumber'},
423
            borrowernumber => $reserve->{'borrowernumber'},
407
            itemnumber     => $reserve->{'itemnumber'},
424
            itemnumber     => $reserve->{'itemnumber'},
Lines 415-423 my @errmsgloop; Link Here
415
foreach my $code ( keys %$messages ) {
432
foreach my $code ( keys %$messages ) {
416
    my %err;
433
    my %err;
417
    my $exit_required_p = 0;
434
    my $exit_required_p = 0;
418
    if ( $code eq 'BadBarcode' ) {
435
    if ( $code eq 'BadItemnumber' ) {
419
        $err{badbarcode} = 1;
436
        $err{badbarcode} = 1;
420
        $err{msg}        = $messages->{'BadBarcode'};
437
        $err{msg}        = $messages->{'BadItemnumber'} || $barcode;
421
    }
438
    }
422
    elsif ( $code eq 'NotIssued' ) {
439
    elsif ( $code eq 'NotIssued' ) {
423
        $err{notissued} = 1;
440
        $err{notissued} = 1;
Lines 499-510 if ($borrower) { Link Here
499
            my $items = $flags->{$flag}->{'itemlist'};
516
            my $items = $flags->{$flag}->{'itemlist'};
500
            foreach my $item (@$items) {
517
            foreach my $item (@$items) {
501
                my $biblio = GetBiblioFromItemNumber( $item->{'itemnumber'});
518
                my $biblio = GetBiblioFromItemNumber( $item->{'itemnumber'});
502
                push @waitingitemloop, {
519
                push @waitingitemloop,
503
                    biblionum => $biblio->{'biblionumber'},
520
                  {
504
                    barcode   => $biblio->{'barcode'},
521
                    biblionum  => $biblio->{'biblionumber'},
505
                    title     => $biblio->{'title'},
522
                    barcode    => $biblio->{'barcode'},
506
                    brname    => $branches->{ $biblio->{'holdingbranch'} }->{'branchname'},
523
                    itemnumber => $item->{'itemnumber'},
507
                };
524
                    title      => $biblio->{'title'},
525
                    brname =>
526
                      $branches->{ $biblio->{'holdingbranch'} }->{'branchname'},
527
                  };
508
            }
528
            }
509
            $flaginfo{itemloop} = \@waitingitemloop;
529
            $flaginfo{itemloop} = \@waitingitemloop;
510
        }
530
        }
Lines 515-527 if ($borrower) { Link Here
515
                @$items )
535
                @$items )
516
            {
536
            {
517
                my $biblio = GetBiblioFromItemNumber( $item->{'itemnumber'});
537
                my $biblio = GetBiblioFromItemNumber( $item->{'itemnumber'});
518
                push @itemloop, {
538
                push @itemloop,
519
                    duedate   => format_date($item->{'date_due'}),
539
                  {
520
                    biblionum => $biblio->{'biblionumber'},
540
                    duedate    => format_date( $item->{'date_due'} ),
521
                    barcode   => $biblio->{'barcode'},
541
                    biblionum  => $biblio->{'biblionumber'},
522
                    title     => $biblio->{'title'},
542
                    barcode    => $biblio->{'barcode'},
523
                    brname    => $branches->{ $biblio->{'holdingbranch'} }->{'branchname'},
543
                    itemnumber => $item->{'itemnumber'},
524
                };
544
                    title      => $biblio->{'title'},
545
                    brname =>
546
                      $branches->{ $biblio->{'holdingbranch'} }->{'branchname'},
547
                  };
525
            }
548
            }
526
            $flaginfo{itemloop} = \@itemloop;
549
            $flaginfo{itemloop} = \@itemloop;
527
            $flaginfo{overdue}  = 1;
550
            $flaginfo{overdue}  = 1;
Lines 551-557 my $shelflocations = GetKohaAuthorisedValues('items.location',''); Link Here
551
foreach ( sort { $a <=> $b } keys %returneditems ) {
574
foreach ( sort { $a <=> $b } keys %returneditems ) {
552
    my %ri;
575
    my %ri;
553
    if ( $count++ < $returned_counter ) {
576
    if ( $count++ < $returned_counter ) {
554
        my $bar_code = $returneditems{$_};
577
        my $returned_item = $returneditems{$_};
555
        my $duedate = $riduedate{$_};
578
        my $duedate = $riduedate{$_};
556
        if ($duedate) {
579
        if ($duedate) {
557
            my @tempdate = split( /-/, $duedate );
580
            my @tempdate = split( /-/, $duedate );
Lines 574-582 foreach ( sort { $a <=> $b } keys %returneditems ) { Link Here
574
        }
597
        }
575
598
576
        #        my %ri;
599
        #        my %ri;
577
        my $biblio = GetBiblioFromItemNumber(GetItemnumberFromBarcode($bar_code));
600
        my $biblio = GetBiblioFromItemNumber($returned_item);
601
578
        # fix up item type for display
602
        # fix up item type for display
579
        $biblio->{'itemtype'} = C4::Context->preference('item-level_itypes') ? $biblio->{'itype'} : $biblio->{'itemtype'};
603
        $biblio->{'itemtype'} =
604
          C4::Context->preference('item-level_itypes')
605
          ? $biblio->{'itype'}
606
          : $biblio->{'itemtype'};
580
        $ri{itembiblionumber} = $biblio->{'biblionumber'};
607
        $ri{itembiblionumber} = $biblio->{'biblionumber'};
581
        $ri{itemtitle}        = $biblio->{'title'};
608
        $ri{itemtitle}        = $biblio->{'title'};
582
        $ri{itemauthor}       = $biblio->{'author'};
609
        $ri{itemauthor}       = $biblio->{'author'};
Lines 584-595 foreach ( sort { $a <=> $b } keys %returneditems ) { Link Here
584
        $ri{itemtype}         = $biblio->{'itemtype'};
611
        $ri{itemtype}         = $biblio->{'itemtype'};
585
        $ri{itemnote}         = $biblio->{'itemnotes'};
612
        $ri{itemnote}         = $biblio->{'itemnotes'};
586
        $ri{ccode}            = $biblio->{'ccode'};
613
        $ri{ccode}            = $biblio->{'ccode'};
614
        $ri{barcode}          = $biblio->{'barcode'};
587
        $ri{itemnumber}       = $biblio->{'itemnumber'};
615
        $ri{itemnumber}       = $biblio->{'itemnumber'};
588
        $ri{barcode}          = $bar_code;
589
590
        $ri{location}         = $biblio->{'location'};
616
        $ri{location}         = $biblio->{'location'};
591
        my $shelfcode = $ri{'location'};
617
        my $shelfcode = $ri{'location'};
592
        $ri{'location'} = $shelflocations->{$shelfcode} if ( defined( $shelfcode ) && defined($shelflocations) && exists( $shelflocations->{$shelfcode} ) );
618
        $ri{'location'} = $shelflocations->{$shelfcode}
619
          if ( defined($shelfcode)
620
            && defined($shelflocations)
621
            && exists( $shelflocations->{$shelfcode} ) );
593
622
594
    }
623
    }
595
    else {
624
    else {
Lines 599-615 foreach ( sort { $a <=> $b } keys %returneditems ) { Link Here
599
}
628
}
600
629
601
$template->param(
630
$template->param(
602
    riloop         => \@riloop,
631
    riloop            => \@riloop,
603
    genbrname      => $branches->{$userenv_branch}->{'branchname'},
632
    genbrname         => $branches->{$userenv_branch}->{'branchname'},
604
    genprname      => $printers->{$printer}->{'printername'},
633
    genprname         => $printers->{$printer}->{'printername'},
605
    branchname     => $branches->{$userenv_branch}->{'branchname'},
634
    branchname        => $branches->{$userenv_branch}->{'branchname'},
606
    printer        => $printer,
635
    printer           => $printer,
607
    errmsgloop     => \@errmsgloop,
636
    errmsgloop        => \@errmsgloop,
608
    exemptfine     => $exemptfine,
637
    exemptfine        => $exemptfine,
609
    dropboxmode    => $dropboxmode,
638
    dropboxmode       => $dropboxmode,
610
    dropboxdate    => $dropboxdate->output(),
639
    dropboxdate       => $dropboxdate->output(),
611
    overduecharges => $overduecharges,
640
    overduecharges    => $overduecharges,
612
    soundon        => C4::Context->preference("SoundOn"),
641
    soundon           => C4::Context->preference("SoundOn"),
642
    can_be_itemnumber => C4::Context->preference('CircFallbackItemnumber'),
613
);
643
);
614
644
615
### Comment out rotating collections for now to allow it a little more time to bake
645
### Comment out rotating collections for now to allow it a little more time to bake
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-search.inc (-1 / +1 lines)
Lines 71-77 YAHOO.util.Event.onContentReady("header_search", function() { Link Here
71
	
71
	
72
[% IF ( CAN_user_circulate ) %]
72
[% IF ( CAN_user_circulate ) %]
73
<div id="checkin_search" class="residentsearch" style="display:none;">
73
<div id="checkin_search" class="residentsearch" style="display:none;">
74
    <p class="tip">Scan a barcode to check in:</p>
74
    <p class="tip">Scan a barcode [% IF (can_be_itemnumber) %]or enter an itemnumber [% END %]to check in:</p>
75
    <form method="post" action="/cgi-bin/koha/circ/returns.pl" autocomplete="off">
75
    <form method="post" action="/cgi-bin/koha/circ/returns.pl" autocomplete="off">
76
        <input name="barcode" id="ret_barcode" size="40" />
76
        <input name="barcode" id="ret_barcode" size="40" />
77
        <input value="Submit" class="submit" type="submit" />
77
        <input value="Submit" class="submit" type="submit" />
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-search.inc (-1 / +1 lines)
Lines 5-11 Link Here
5
    [% INCLUDE 'patron-search-box.inc' %]
5
    [% INCLUDE 'patron-search-box.inc' %]
6
[% IF ( CAN_user_circulate ) %]
6
[% IF ( CAN_user_circulate ) %]
7
<div id="checkin_search" class="residentsearch" style="display:none;">
7
<div id="checkin_search" class="residentsearch" style="display:none;">
8
    <p class="tip">Scan a barcode to check in:</p>
8
    <p class="tip">Scan a barcode [% IF (can_be_itemnumber) %]or enter an itemnumber [% END %]to check in:</p>
9
    <form method="post" action="/cgi-bin/koha/circ/returns.pl" autocomplete="off">
9
    <form method="post" action="/cgi-bin/koha/circ/returns.pl" autocomplete="off">
10
        <input name="barcode" id="ret_barcode" size="40" accesskey="r" />
10
        <input name="barcode" id="ret_barcode" size="40" accesskey="r" />
11
        <input value="Submit" class="submit" type="submit" />
11
        <input value="Submit" class="submit" type="submit" />
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc (-1 / +1 lines)
Lines 108-114 YAHOO.util.Event.onContentReady("header_search", function() { Link Here
108
	</div>[% END %]
108
	</div>[% END %]
109
    [% IF ( CAN_user_circulate ) %]
109
    [% IF ( CAN_user_circulate ) %]
110
    <div id="checkin_search" class="residentsearch" style="display:none;">
110
    <div id="checkin_search" class="residentsearch" style="display:none;">
111
    <p class="tip">Scan a barcode to check in:</p>
111
    <p class="tip">Scan a barcode [% IF (can_be_itemnumber) %]or enter an itemnumber [% END %]to check in:</p>
112
    <form method="post" action="/cgi-bin/koha/circ/returns.pl" autocomplete="off">
112
    <form method="post" action="/cgi-bin/koha/circ/returns.pl" autocomplete="off">
113
    <input name="barcode" id="ret_barcode" size="40" accesskey="r" />
113
    <input name="barcode" id="ret_barcode" size="40" accesskey="r" />
114
    <input value="Submit" class="submit" type="submit" />
114
    <input value="Submit" class="submit" type="submit" />
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt (-15 / +15 lines)
Lines 57-96 Link Here
57
var allcheckboxes = $(".checkboxed");
57
var allcheckboxes = $(".checkboxed");
58
	$("#renew_all").click(function(){
58
	$("#renew_all").click(function(){
59
		$(allcheckboxes).checkCheckboxes(":input[name*=items]"); 
59
		$(allcheckboxes).checkCheckboxes(":input[name*=items]"); 
60
		$(allcheckboxes).unCheckCheckboxes(":input[name*=barcodes]");
60
		$(allcheckboxes).unCheckCheckboxes(":input[name*=itemnumbers]");
61
	});
61
	});
62
	$("#CheckAllitems").click(function(){
62
	$("#CheckAllitems").click(function(){
63
		$(allcheckboxes).checkCheckboxes(":input[name*=items]");
63
		$(allcheckboxes).checkCheckboxes(":input[name*=items]");
64
		$(allcheckboxes).unCheckCheckboxes(":input[name*=barcodes]"); return false;
64
		$(allcheckboxes).unCheckCheckboxes(":input[name*=itemnumbers]"); return false;
65
	});
65
	});
66
    $("#CheckNoitems").click(function(){
66
    $("#CheckNoitems").click(function(){
67
		$(allcheckboxes).unCheckCheckboxes(":input[name*=items]"); return false;
67
		$(allcheckboxes).unCheckCheckboxes(":input[name*=items]"); return false;
68
	});
68
	});
69
	$("#CheckAllreturns").click(function(){
69
	$("#CheckAllreturns").click(function(){
70
		$(allcheckboxes).checkCheckboxes(":input[name*=barcodes]");
70
		$(allcheckboxes).checkCheckboxes(":input[name*=itemnumbers]");
71
		$(allcheckboxes).unCheckCheckboxes(":input[name*=items]"); return false;
71
		$(allcheckboxes).unCheckCheckboxes(":input[name*=items]"); return false;
72
	});
72
	});
73
    $("#CheckNoreturns" ).click(function(){
73
    $("#CheckNoreturns" ).click(function(){
74
		$(allcheckboxes).unCheckCheckboxes(":input[name*=barcodes]"); return false;
74
		$(allcheckboxes).unCheckCheckboxes(":input[name*=itemnumbers]"); return false;
75
	});
75
	});
76
76
77
    $("#relrenew_all").click(function(){
77
    $("#relrenew_all").click(function(){
78
        $(allcheckboxes).checkCheckboxes(":input[name*=items]");
78
        $(allcheckboxes).checkCheckboxes(":input[name*=items]");
79
        $(allcheckboxes).unCheckCheckboxes(":input[name*=barcodes]");
79
        $(allcheckboxes).unCheckCheckboxes(":input[name*=itemnumbers]");
80
    });
80
    });
81
    $("#relCheckAllitems").click(function(){
81
    $("#relCheckAllitems").click(function(){
82
        $(allcheckboxes).checkCheckboxes(":input[name*=items]");
82
        $(allcheckboxes).checkCheckboxes(":input[name*=items]");
83
        $(allcheckboxes).unCheckCheckboxes(":input[name*=barcodes]"); return false;
83
        $(allcheckboxes).unCheckCheckboxes(":input[name*=itemnumbers]"); return false;
84
    });
84
    });
85
    $("#relCheckNoitems").click(function(){
85
    $("#relCheckNoitems").click(function(){
86
        $(allcheckboxes).unCheckCheckboxes(":input[name*=items]"); return false;
86
        $(allcheckboxes).unCheckCheckboxes(":input[name*=items]"); return false;
87
    });
87
    });
88
    $("#relCheckAllreturns").click(function(){
88
    $("#relCheckAllreturns").click(function(){
89
        $(allcheckboxes).checkCheckboxes(":input[name*=barcodes]");
89
        $(allcheckboxes).checkCheckboxes(":input[name*=itemnumbers]");
90
        $(allcheckboxes).unCheckCheckboxes(":input[name*=items]"); return false;
90
        $(allcheckboxes).unCheckCheckboxes(":input[name*=items]"); return false;
91
    });
91
    });
92
    $("#relCheckNoreturns").click(function(){
92
    $("#relCheckNoreturns").click(function(){
93
        $(allcheckboxes).unCheckCheckboxes(":input[name*=barcodes]"); return false;
93
        $(allcheckboxes).unCheckCheckboxes(":input[name*=itemnumbers]"); return false;
94
    });
94
    });
95
95
96
    [% IF ( CAN_user_circulate_override_renewals ) %]
96
    [% IF ( CAN_user_circulate_override_renewals ) %]
Lines 342-348 function refocus(calendar) { Link Here
342
            <li>The due date &quot;[% INVALID_DATE %]&quot; is invalid</li>
342
            <li>The due date &quot;[% INVALID_DATE %]&quot; is invalid</li>
343
        [% END %]
343
        [% END %]
344
344
345
        [% IF ( UNKNOWN_BARCODE ) %]
345
        [% IF ( UNKNOWN_ITEMNUMBER ) %]
346
            <li>The barcode [% IF (can_be_itemnumber) %]or item number [% END %]was not found: [% barcode %]</li>
346
            <li>The barcode [% IF (can_be_itemnumber) %]or item number [% END %]was not found: [% barcode %]</li>
347
	    [% IF ( fast_cataloging ) %]
347
	    [% IF ( fast_cataloging ) %]
348
	        [% IF ( CAN_user_editcatalogue_fast_cataloging ) %]
348
	        [% IF ( CAN_user_editcatalogue_fast_cataloging ) %]
Lines 756-766 No patron matched <span class="ex">[% message %]</span> Link Here
756
      [% ELSE %]
756
      [% ELSE %]
757
            [% IF ( todayissue.renew_error_on_reserve ) %]
757
            [% IF ( todayissue.renew_error_on_reserve ) %]
758
               <td><a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% todayissue.biblionumber %]">On Hold</a>
758
               <td><a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% todayissue.biblionumber %]">On Hold</a>
759
                <input type="checkbox" name="all_barcodes[]" value="[% todayissue.barcode %]" checked="checked" style="display: none;" />
759
                <input type="checkbox" name="all_itemnumbers[]" value="[% todayissue.itemnumber %]" checked="checked" style="display: none;" />
760
                </td>
760
                </td>
761
            [% ELSE %]
761
            [% ELSE %]
762
            <td><input type="checkbox" class="radio" name="barcodes[]"  value="[% todayissue.barcode %]" />
762
            <td><input type="checkbox" class="radio" name="itemnumbers[]"  value="[% todayissue.itemnumber %]" />
763
                <input type="checkbox" name="all_barcodes[]" value="[% todayissue.barcode %]" checked="checked" style="display: none;" />
763
                <input type="checkbox" name="all_itemnumbers[]" value="[% todayissue.itemnumber %]" checked="checked" style="display: none;" />
764
            </td>
764
            </td>
765
            [% END %]
765
            [% END %]
766
      [% END %]
766
      [% END %]
Lines 831-841 No patron matched <span class="ex">[% message %]</span> Link Here
831
        [% ELSE %]
831
        [% ELSE %]
832
            [% IF ( previssue.renew_error_on_reserve ) %]
832
            [% IF ( previssue.renew_error_on_reserve ) %]
833
               <td><a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% previssue.biblionumber %]">On Hold</a>
833
               <td><a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% previssue.biblionumber %]">On Hold</a>
834
                <input type="checkbox" name="all_barcodes[]" value="[% previssue.barcode %]" checked="checked" style="display: none;" />
834
                <input type="checkbox" name="all_itemnumbers[]" value="[% previssue.itemnumber %]" checked="checked" style="display: none;" />
835
                </td>
835
                </td>
836
            [% ELSE %]
836
            [% ELSE %]
837
            <td><input type="checkbox" class="radio" name="barcodes[]"  value="[% previssue.barcode %]" />
837
            <td><input type="checkbox" class="radio" name="itemnumbers[]"  value="[% previssue.itemnumber %]" />
838
                <input type="checkbox" name="all_barcodes[]" value="[% previssue.barcode %]" checked="checked" style="display: none;" />
838
                <input type="checkbox" name="all_itemnumbers[]" value="[% previssue.itemnumber %]" checked="checked" style="display: none;" />
839
            </td>
839
            </td>
840
            [% END %]
840
            [% END %]
841
      [% END %]
841
      [% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt (-8 / +17 lines)
Lines 47-54 function Dopop(link) { Link Here
47
47
48
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/circ/circulation-home.pl">Circulation</a> &rsaquo; Check In</div>
48
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/circ/circulation-home.pl">Circulation</a> &rsaquo; Check In</div>
49
49
50
[% IF (can_be_itemnumber) %]
51
<div id="doc" class="yui-t7" style="width: 66.69em;">
52
[% ELSE %]
50
<div id="doc" class="yui-t7">
53
<div id="doc" class="yui-t7">
51
54
[% END %]
52
   <div id="bd">
55
   <div id="bd">
53
	<div id="yui-main">
56
	<div id="yui-main">
54
57
Lines 134-140 function Dopop(link) { Link Here
134
137
135
			<input type="submit" value="Print and Confirm" class="print" onclick="Dopop('hold-transfer-slip.pl?borrowernumber=[% borrowernumber %]&amp;biblionumber=[% itembiblionumber %]&amp;op=slip'); this.form.submit();" />
138
			<input type="submit" value="Print and Confirm" class="print" onclick="Dopop('hold-transfer-slip.pl?borrowernumber=[% borrowernumber %]&amp;biblionumber=[% itembiblionumber %]&amp;op=slip'); this.form.submit();" />
136
            [% FOREACH inputloo IN inputloop %]
139
            [% FOREACH inputloo IN inputloop %]
137
                <input type="hidden" name="ri-[% inputloo.counter %]" value="[% inputloo.barcode %]" />
140
                <input type="hidden" name="ri-[% inputloo.counter %]" value="[% inputloo.itemnumber %]" />
141
                <input type="hidden" name="bc-[% inputloo.counter %]" value="[% inputloo.barcode %]" />
138
                <input type="hidden" name="dd-[% inputloo.counter %]" value="[% inputloo.duedate %]" />
142
                <input type="hidden" name="dd-[% inputloo.counter %]" value="[% inputloo.duedate %]" />
139
                <input type="hidden" name="bn-[% inputloo.counter %]" value="[% inputloo.borrowernumber %]" />
143
                <input type="hidden" name="bn-[% inputloo.counter %]" value="[% inputloo.borrowernumber %]" />
140
            [% END %]
144
            [% END %]
Lines 176-182 function Dopop(link) { Link Here
176
            <input type="submit" class="approve" value="Confirm" />
180
            <input type="submit" class="approve" value="Confirm" />
177
			<input type="submit" value="Print Slip and Confirm" class="print" onclick="Dopop('hold-transfer-slip.pl?transfer=1&amp;borrowernumber=[% borrowernumber %]&amp;biblionumber=[% itembiblionumber %]&amp;op=slip'); this.form.submit();" />
181
			<input type="submit" value="Print Slip and Confirm" class="print" onclick="Dopop('hold-transfer-slip.pl?transfer=1&amp;borrowernumber=[% borrowernumber %]&amp;biblionumber=[% itembiblionumber %]&amp;op=slip'); this.form.submit();" />
178
            [% FOREACH inputloo IN inputloop %]
182
            [% FOREACH inputloo IN inputloop %]
179
                <input type="hidden" name="ri-[% inputloo.counter %]" value="[% inputloo.barcode %]" />
183
                <input type="hidden" name="ri-[% inputloo.counter %]" value="[% inputloo.itemnumber %]" />
184
                <input type="hidden" name="bc-[% inputloo.counter %]" value="[% inputloo.barcode %]" />
180
                <input type="hidden" name="dd-[% inputloo.counter %]" value="[% inputloo.duedate %]" />
185
                <input type="hidden" name="dd-[% inputloo.counter %]" value="[% inputloo.duedate %]" />
181
                <input type="hidden" name="bn-[% inputloo.counter %]" value="[% inputloo.borrowernumber %]" />
186
                <input type="hidden" name="bn-[% inputloo.counter %]" value="[% inputloo.borrowernumber %]" />
182
            [% END %]
187
            [% END %]
Lines 213-219 function Dopop(link) { Link Here
213
        <input type="hidden" name="exemptfine" value="[% exemptfine %]" />
218
        <input type="hidden" name="exemptfine" value="[% exemptfine %]" />
214
        <input type="hidden" name="dropboxmode" value="[% dropboxmode %]" />
219
        <input type="hidden" name="dropboxmode" value="[% dropboxmode %]" />
215
	[% FOREACH inputloo IN inputloop %]
220
	[% FOREACH inputloo IN inputloop %]
216
	<input type="hidden" name="ri-[% inputloo.counter %]" value="[% inputloo.barcode %]" />
221
	<input type="hidden" name="ri-[% inputloo.counter %]" value="[% inputloo.itemnumber %]" />
222
	<input type="hidden" name="bc-[% inputloo.counter %]" value="[% inputloo.barcode %]" />
217
	<input type="hidden" name="dd-[% inputloo.counter %]" value="[% inputloo.duedate %]" />
223
	<input type="hidden" name="dd-[% inputloo.counter %]" value="[% inputloo.duedate %]" />
218
	<input type="hidden" name="bn-[% inputloo.counter %]" value="[% inputloo.borrowernumber %]" />
224
	<input type="hidden" name="bn-[% inputloo.counter %]" value="[% inputloo.borrowernumber %]" />
219
	[% END %]
225
	[% END %]
Lines 237-243 function Dopop(link) { Link Here
237
        <form method="post" action="returns.pl"><input type="submit" value="OK" />
243
        <form method="post" action="returns.pl"><input type="submit" value="OK" />
238
            [% FOREACH inputloo IN inputloop %]
244
            [% FOREACH inputloo IN inputloop %]
239
                [% UNLESS ( inputloo.first ) %]
245
                [% UNLESS ( inputloo.first ) %]
240
                    <input type="hidden" name="ri-[% inputloo.counter %]" value="[% inputloo.barcode %]" />
246
                    <input type="hidden" name="ri-[% inputloo.counter %]" value="[% inputloo.itemnumber %]" />
247
                    <input type="hidden" name="bc-[% inputloo.counter %]" value="[% inputloo.barcode %]" />
241
                    <input type="hidden" name="dd-[% inputloo.counter %]" value="[% inputloo.duedate %]" />
248
                    <input type="hidden" name="dd-[% inputloo.counter %]" value="[% inputloo.duedate %]" />
242
                    <input type="hidden" name="bn-[% inputloo.counter %]" value="[% inputloo.borrowernumber %]" />
249
                    <input type="hidden" name="bn-[% inputloo.counter %]" value="[% inputloo.borrowernumber %]" />
243
                [% END %]
250
                [% END %]
Lines 286-292 function Dopop(link) { Link Here
286
            [% END %]
293
            [% END %]
287
                <input type="submit" class="deny" value="Ignore" onclick="$('.dialog:visible').hide('slow'); $('#barcode').focus(); return false;" />
294
                <input type="submit" class="deny" value="Ignore" onclick="$('.dialog:visible').hide('slow'); $('#barcode').focus(); return false;" />
288
            [% FOREACH inputloo IN inputloop %]
295
            [% FOREACH inputloo IN inputloop %]
289
	<input type="hidden" name="ri-[% inputloo.counter %]" value="[% inputloo.barcode %]" />
296
	<input type="hidden" name="ri-[% inputloo.counter %]" value="[% inputloo.itemnumber %]" />
297
	<input type="hidden" name="bc-[% inputloo.counter %]" value="[% inputloo.barcode %]" />
290
	<input type="hidden" name="dd-[% inputloo.counter %]" value="[% inputloo.duedate %]" />
298
	<input type="hidden" name="dd-[% inputloo.counter %]" value="[% inputloo.duedate %]" />
291
	<input type="hidden" name="bn-[% inputloo.counter %]" value="[% inputloo.borrowernumber %]" />[% END %]
299
	<input type="hidden" name="bn-[% inputloo.counter %]" value="[% inputloo.borrowernumber %]" />[% END %]
292
            <input type="hidden" name="itemnumber" value="[% itemnumber %]" />
300
            <input type="hidden" name="itemnumber" value="[% itemnumber %]" />
Lines 348-354 function Dopop(link) { Link Here
348
    <div class="yui-u first">
356
    <div class="yui-u first">
349
            <fieldset>
357
            <fieldset>
350
	<legend>Check In</legend>
358
	<legend>Check In</legend>
351
            <label for="barcode">Enter item barcode: </label>
359
            <label for="barcode">Enter item barcode[% IF (can_be_itemnumber) %] or itemnumber[% END %]: </label>
352
			[% IF ( exemptfine ) %]
360
			[% IF ( exemptfine ) %]
353
			<input name="barcode" id="barcode" size="14" class="focus alert"/>
361
			<input name="barcode" id="barcode" size="14" class="focus alert"/>
354
			[% ELSIF ( dropboxmode ) %]
362
			[% ELSIF ( dropboxmode ) %]
Lines 358-364 function Dopop(link) { Link Here
358
			[% END %]
366
			[% END %]
359
            <input type="submit" class="submit" value="Submit" />
367
            <input type="submit" class="submit" value="Submit" />
360
            [% FOREACH inputloo IN inputloop %]
368
            [% FOREACH inputloo IN inputloop %]
361
                <input type="hidden" name="ri-[% inputloo.counter %]" value="[% inputloo.barcode %]" />
369
                <input type="hidden" name="ri-[% inputloo.counter %]" value="[% inputloo.itemnumber %]" />
370
                <input type="hidden" name="bc-[% inputloo.counter %]" value="[% inputloo.barcode %]" />
362
                <input type="hidden" name="dd-[% inputloo.counter %]" value="[% inputloo.duedate %]" />
371
                <input type="hidden" name="dd-[% inputloo.counter %]" value="[% inputloo.duedate %]" />
363
                <input type="hidden" name="bn-[% inputloo.counter %]" value="[% inputloo.borrowernumber %]" />
372
                <input type="hidden" name="bn-[% inputloo.counter %]" value="[% inputloo.borrowernumber %]" />
364
            [% END %]
373
            [% END %]
(-)a/members/moremember.pl (-1 / +2 lines)
Lines 2-7 Link Here
2
2
3
# Copyright 2000-2002 Katipo Communications
3
# Copyright 2000-2002 Katipo Communications
4
# Copyright 2010 BibLibre
4
# Copyright 2010 BibLibre
5
# Copyright 2011 Catalyst IT
5
#
6
#
6
# This file is part of Koha.
7
# This file is part of Koha.
7
#
8
#
Lines 323-329 sub build_issue_data { Link Here
323
        $row{'can_confirm'} = ( !$renewokay && $renewerror ne 'on_reserve' );
324
        $row{'can_confirm'} = ( !$renewokay && $renewerror ne 'on_reserve' );
324
        $row{"norenew_reason_$renewerror"} = 1 if $renewerror;
325
        $row{"norenew_reason_$renewerror"} = 1 if $renewerror;
325
        $row{'renew_failed'}  = $renew_failed{ $issue->[$i]{'itemnumber'} };
326
        $row{'renew_failed'}  = $renew_failed{ $issue->[$i]{'itemnumber'} };
326
        $row{'return_failed'} = $return_failed{$issue->[$i]{'barcode'}};   
327
        $row{'return_failed'} = $return_failed{$issue->[$i]{'itemnumber'}};
327
        push( @$localissue, \%row );
328
        push( @$localissue, \%row );
328
    }
329
    }
329
    return $localissue;
330
    return $localissue;
(-)a/opac/sco/sco-main.pl (-1 / +1 lines)
Lines 124-130 if ($op eq "logout") { Link Here
124
    $query->param( patronid => undef, patronlogin => undef, patronpw => undef );
124
    $query->param( patronid => undef, patronlogin => undef, patronpw => undef );
125
}
125
}
126
elsif ( $op eq "returnbook" && $allowselfcheckreturns ) {
126
elsif ( $op eq "returnbook" && $allowselfcheckreturns ) {
127
    my ($doreturn) = AddReturn( $barcode, $branch );
127
    my ($doreturn) = AddReturn( $item->{itemnumber}, $branch );
128
    #warn "returnbook: " . $doreturn;
128
    #warn "returnbook: " . $doreturn;
129
    $borrower = GetMemberDetails(undef,$patronid);
129
    $borrower = GetMemberDetails(undef,$patronid);
130
}
130
}
(-)a/reserve/renewscript.pl (-9 / +9 lines)
Lines 6-11 Link Here
6
6
7
7
8
# Copyright 2000-2002 Katipo Communications
8
# Copyright 2000-2002 Katipo Communications
9
# Copyright 2011 Catalyst IT
9
#
10
#
10
# This file is part of Koha.
11
# This file is part of Koha.
11
#
12
#
Lines 56-66 else { Link Here
56
    @data = $input->param('items[]');
57
    @data = $input->param('items[]');
57
}
58
}
58
59
59
my @barcodes;
60
my @itemnumbers;
60
if ($input->param('return_all')) {
61
if ($input->param('return_all')) {
61
    @barcodes = $input->param('all_barcodes[]');
62
    @itemnumbers = $input->param('all_itemnumbers[]');
62
} else {
63
} else {
63
    @barcodes = $input->param('barcodes[]');
64
    @itemnumbers = $input->param('itemnumbers[]');
64
}
65
}
65
66
66
my $branch=$input->param('branch');
67
my $branch=$input->param('branch');
Lines 69-75 if ($input->param('newduedate')){ Link Here
69
    $datedue=C4::Dates->new($input->param('newduedate'));
70
    $datedue=C4::Dates->new($input->param('newduedate'));
70
}
71
}
71
72
72
# warn "barcodes : @barcodes";
73
#
73
#
74
# renew items
74
# renew items
75
#
75
#
Lines 85-99 foreach my $itemno (@data) { Link Here
85
        AddRenewal($borrowernumber,$itemno,$branch,$datedue);
85
        AddRenewal($borrowernumber,$itemno,$branch,$datedue);
86
    }
86
    }
87
	else {
87
	else {
88
		$failedrenews.="&failedrenew=$itemno";        
88
		$failedrenews.="&failedrenew=$itemno";
89
	}
89
	}
90
}
90
}
91
my $failedreturn = q{};
91
my $failedreturn = q{};
92
foreach my $barcode (@barcodes) {
92
foreach my $itemnumber (@itemnumbers) {
93
    # check status before renewing issue
93
    # check status before renewing issue
94
   my ( $returned, $messages, $issueinformation, $borrower ) = 
94
   my ( $returned, $messages, $issueinformation, $borrower ) =
95
    AddReturn($barcode, $branch, $exemptfine);
95
    AddReturn($itemnumber, $branch, $exemptfine);
96
   $failedreturn.="&failedreturn=$barcode" unless ($returned);
96
   $failedreturn.="&failedreturn=$itemnumber" unless ($returned);
97
}
97
}
98
98
99
#
99
#
(-)a/tools/inventory.pl (-2 / +1 lines)
Lines 161-167 if ($uploadbarcodes && length($uploadbarcodes)>0){ Link Here
161
                $qonloan->execute($barcode);
161
                $qonloan->execute($barcode);
162
                if ($qonloan->rows){
162
                if ($qonloan->rows){
163
                    my $data = $qonloan->fetchrow_hashref;
163
                    my $data = $qonloan->fetchrow_hashref;
164
                    my ($doreturn, $messages, $iteminformation, $borrower) =AddReturn($barcode, $data->{homebranch});
164
                    my ($doreturn, $messages, $iteminformation, $borrower) =AddReturn($item->{itemnumber}, $data->{homebranch});
165
                    if ($doreturn){
165
                    if ($doreturn){
166
                        push @errorloop, {'barcode'=>$barcode,'ERR_ONLOAN_RET'=>1}
166
                        push @errorloop, {'barcode'=>$barcode,'ERR_ONLOAN_RET'=>1}
167
                    } else {
167
                    } else {
168
- 

Return to bug 7362