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

(-)a/C4/Circulation.pm (-26 lines)
Lines 114-120 BEGIN { Link Here
114
		&transferbook
114
		&transferbook
115
		&GetTransfers
115
		&GetTransfers
116
		&GetTransfersFromTo
116
		&GetTransfersFromTo
117
		&updateWrongTransfer
118
		&DeleteTransfer
117
		&DeleteTransfer
119
                &IsBranchTransferAllowed
118
                &IsBranchTransferAllowed
120
                &CreateBranchTransferLimit
119
                &CreateBranchTransferLimit
Lines 3523-3553 sub SendCirculationAlert { Link Here
3523
    return;
3522
    return;
3524
}
3523
}
3525
3524
3526
=head2 updateWrongTransfer
3527
3528
  $items = updateWrongTransfer($itemNumber,$borrowernumber,$waitingAtLibrary,$FromLibrary);
3529
3530
This function validate the line of brachtransfer but with the wrong destination (mistake from a librarian ...), and create a new line in branchtransfer from the actual library to the original library of reservation 
3531
3532
=cut
3533
3534
sub updateWrongTransfer {
3535
	my ( $itemNumber,$waitingAtLibrary,$FromLibrary ) = @_;
3536
	my $dbh = C4::Context->dbh;	
3537
# first step validate the actual line of transfert .
3538
	my $sth =
3539
        	$dbh->prepare(
3540
			"update branchtransfers set datearrived = now(),tobranch=?,comments='wrongtransfer' where itemnumber= ? AND datearrived IS NULL"
3541
          	);
3542
        	$sth->execute($FromLibrary,$itemNumber);
3543
3544
# second step create a new line of branchtransfer to the right location .
3545
	ModItemTransfer($itemNumber, $FromLibrary, $waitingAtLibrary);
3546
3547
#third step changing holdingbranch of item
3548
	UpdateHoldingbranch($FromLibrary,$itemNumber);
3549
}
3550
3551
=head2 UpdateHoldingbranch
3525
=head2 UpdateHoldingbranch
3552
3526
3553
  $items = UpdateHoldingbranch($branch,$itmenumber);
3527
  $items = UpdateHoldingbranch($branch,$itmenumber);
(-)a/circ/returns.pl (-6 lines)
Lines 142-152 foreach ( $query->param ) { Link Here
142
142
143
############
143
############
144
# Deal with the requests....
144
# Deal with the requests....
145
146
if ($query->param('WT-itemNumber')){
147
	updateWrongTransfer ($query->param('WT-itemNumber'),$query->param('WT-waitingAt'),$query->param('WT-From'));
148
}
149
150
if ( $query->param('reserve_id') ) {
145
if ( $query->param('reserve_id') ) {
151
    my $itemnumber     = $query->param('itemnumber');
146
    my $itemnumber     = $query->param('itemnumber');
152
    my $borrowernumber = $query->param('borrowernumber');
147
    my $borrowernumber = $query->param('borrowernumber');
153
- 

Return to bug 24434