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

(-)a/C4/Circulation.pm (-12 / +15 lines)
Lines 1448-1465 sub AddIssue { Link Here
1448
            C4::Reserves::MoveReserve( $item_object->itemnumber, $borrower->{'borrowernumber'}, $cancelreserve );
1448
            C4::Reserves::MoveReserve( $item_object->itemnumber, $borrower->{'borrowernumber'}, $cancelreserve );
1449
1449
1450
            # Starting process for transfer job (checking transfert and validate it if we have one)
1450
            # Starting process for transfer job (checking transfert and validate it if we have one)
1451
            my ($datesent) = GetTransfers( $item_object->itemnumber );
1451
            if ( my $transfer = $item_object->get_transfer ) {
1452
            if ($datesent) {
1453
                # updating line of branchtranfert to finish it, and changing the to branch value, implement a comment for visibility of this case (maybe for stats ....)
1452
                # updating line of branchtranfert to finish it, and changing the to branch value, implement a comment for visibility of this case (maybe for stats ....)
1454
                my $sth = $dbh->prepare(
1453
                $transfer->set(
1455
                    "UPDATE branchtransfers 
1454
                    {
1456
                        SET datearrived = now(),
1455
                        datearrived => dt_from_string,
1457
                        tobranch = ?,
1456
                        tobranch    => C4::Context->userenv->{branch},
1458
                        comments = 'Forced branchtransfer'
1457
                        comments    => 'Forced branchtransfer'
1459
                    WHERE itemnumber= ? AND datearrived IS NULL"
1458
                    }
1460
                );
1459
                )->store;
1461
                $sth->execute( C4::Context->userenv->{'branch'},
1460
                if ( $transfer->reason eq 'Reserve' ) {
1462
                    $item_object->itemnumber );
1461
                    my $hold = $item_object->holds->search( { found => 'T' } )->next;
1462
                    if ( $hold ) { # Is this really needed?
1463
                        $hold->set( { found => undef } )->store;
1464
                        C4::Reserves::ModReserveMinusPriority($item_object->itemnumber, $hold->reserve_id);
1465
                    }
1466
                }
1463
            }
1467
            }
1464
1468
1465
            # If automatic renewal wasn't selected while issuing, set the value according to the issuing rule.
1469
            # If automatic renewal wasn't selected while issuing, set the value according to the issuing rule.
1466
- 

Return to bug 24598