Lines 276-282
sub GetPendingHoldRequestsForBib {
Link Here
|
276 |
|
276 |
|
277 |
my $dbh = C4::Context->dbh; |
277 |
my $dbh = C4::Context->dbh; |
278 |
|
278 |
|
279 |
my $request_query = "SELECT biblionumber, borrowernumber, itemnumber, priority, reserves.branchcode, |
279 |
my $request_query = "SELECT biblionumber, borrowernumber, itemnumber, priority, reserve_id, reserves.branchcode, |
280 |
reservedate, reservenotes, borrowers.branchcode AS borrowerbranch, itemtype, item_level_hold |
280 |
reservedate, reservenotes, borrowers.branchcode AS borrowerbranch, itemtype, item_level_hold |
281 |
FROM reserves |
281 |
FROM reserves |
282 |
JOIN borrowers USING (borrowernumber) |
282 |
JOIN borrowers USING (borrowernumber) |
Lines 438-443
sub MapItemsToHoldRequests {
Link Here
|
438 |
holdingbranch => $item->{holdingbranch}, |
438 |
holdingbranch => $item->{holdingbranch}, |
439 |
pickup_branch => $request->{branchcode} |
439 |
pickup_branch => $request->{branchcode} |
440 |
|| $request->{borrowerbranch}, |
440 |
|| $request->{borrowerbranch}, |
|
|
441 |
reserve_id => $request->{reserve_id}, |
441 |
item_level => $request->{item_level_hold}, |
442 |
item_level => $request->{item_level_hold}, |
442 |
reservedate => $request->{reservedate}, |
443 |
reservedate => $request->{reservedate}, |
443 |
reservenotes => $request->{reservenotes}, |
444 |
reservenotes => $request->{reservenotes}, |
Lines 717-731
sub AddToHoldTargetMap {
Link Here
|
717 |
my $dbh = C4::Context->dbh; |
718 |
my $dbh = C4::Context->dbh; |
718 |
|
719 |
|
719 |
my $insert_sql = q( |
720 |
my $insert_sql = q( |
720 |
INSERT INTO hold_fill_targets (borrowernumber, biblionumber, itemnumber, source_branchcode, item_level_request) |
721 |
INSERT INTO hold_fill_targets (borrowernumber, biblionumber, itemnumber, source_branchcode, item_level_request, reserve_id) |
721 |
VALUES (?, ?, ?, ?, ?) |
722 |
VALUES (?, ?, ?, ?, ?, ?) |
722 |
); |
723 |
); |
723 |
my $sth_insert = $dbh->prepare($insert_sql); |
724 |
my $sth_insert = $dbh->prepare($insert_sql); |
724 |
|
725 |
|
725 |
foreach my $itemnumber (keys %$item_map) { |
726 |
foreach my $itemnumber (keys %$item_map) { |
726 |
my $mapped_item = $item_map->{$itemnumber}; |
727 |
my $mapped_item = $item_map->{$itemnumber}; |
727 |
$sth_insert->execute($mapped_item->{borrowernumber}, $mapped_item->{biblionumber}, $itemnumber, |
728 |
$sth_insert->execute($mapped_item->{borrowernumber}, $mapped_item->{biblionumber}, $itemnumber, |
728 |
$mapped_item->{holdingbranch}, $mapped_item->{item_level}); |
729 |
$mapped_item->{holdingbranch}, $mapped_item->{item_level}, $mapped_item->{reserve_id}); |
729 |
} |
730 |
} |
730 |
} |
731 |
} |
731 |
|
732 |
|