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

(-)a/C4/Circulation.pm (-26 lines)
Lines 115-121 BEGIN { Link Here
115
		&transferbook
115
		&transferbook
116
		&GetTransfers
116
		&GetTransfers
117
		&GetTransfersFromTo
117
		&GetTransfersFromTo
118
		&updateWrongTransfer
119
		&DeleteTransfer
118
		&DeleteTransfer
120
                &IsBranchTransferAllowed
119
                &IsBranchTransferAllowed
121
                &CreateBranchTransferLimit
120
                &CreateBranchTransferLimit
Lines 3468-3498 sub SendCirculationAlert { Link Here
3468
    return;
3467
    return;
3469
}
3468
}
3470
3469
3471
=head2 updateWrongTransfer
3472
3473
  $items = updateWrongTransfer($itemNumber,$borrowernumber,$waitingAtLibrary,$FromLibrary);
3474
3475
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 
3476
3477
=cut
3478
3479
sub updateWrongTransfer {
3480
	my ( $itemNumber,$waitingAtLibrary,$FromLibrary ) = @_;
3481
	my $dbh = C4::Context->dbh;	
3482
# first step validate the actual line of transfert .
3483
	my $sth =
3484
        	$dbh->prepare(
3485
			"update branchtransfers set datearrived = now(),tobranch=?,comments='wrongtransfer' where itemnumber= ? AND datearrived IS NULL"
3486
          	);
3487
        	$sth->execute($FromLibrary,$itemNumber);
3488
3489
# second step create a new line of branchtransfer to the right location .
3490
	ModItemTransfer($itemNumber, $FromLibrary, $waitingAtLibrary);
3491
3492
#third step changing holdingbranch of item
3493
	UpdateHoldingbranch($FromLibrary,$itemNumber);
3494
}
3495
3496
=head2 UpdateHoldingbranch
3470
=head2 UpdateHoldingbranch
3497
3471
3498
  $items = UpdateHoldingbranch($branch,$itmenumber);
3472
  $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