Lines 855-861
sub cancel {
Link Here
|
855 |
interface => C4::Context->interface, |
855 |
interface => C4::Context->interface, |
856 |
library_id => C4::Context->userenv ? C4::Context->userenv->{'branch'} : undef, |
856 |
library_id => C4::Context->userenv ? C4::Context->userenv->{'branch'} : undef, |
857 |
type => 'RESERVE_EXPIRED', |
857 |
type => 'RESERVE_EXPIRED', |
858 |
item_id => $self->itemnumber |
858 |
item_id => $self->itemnumber, |
|
|
859 |
hold_id => $self->id, |
859 |
} |
860 |
} |
860 |
) if $charge; |
861 |
) if $charge; |
861 |
} |
862 |
} |
Lines 1221-1226
sub charge_hold_fee {
Link Here
|
1221 |
description => $self->biblio->title, |
1222 |
description => $self->biblio->title, |
1222 |
type => 'RESERVE', |
1223 |
type => 'RESERVE', |
1223 |
item_id => $self->itemnumber, |
1224 |
item_id => $self->itemnumber, |
|
|
1225 |
hold_id => $self->id, |
1224 |
user_id => C4::Context->userenv ? C4::Context->userenv->{number} : undef, |
1226 |
user_id => C4::Context->userenv ? C4::Context->userenv->{number} : undef, |
1225 |
library_id => C4::Context->userenv ? C4::Context->userenv->{branch} : undef, |
1227 |
library_id => C4::Context->userenv ? C4::Context->userenv->{branch} : undef, |
1226 |
interface => C4::Context->interface, |
1228 |
interface => C4::Context->interface, |
Lines 1358-1364
sub _move_to_old {
Link Here
|
1358 |
my ($self) = @_; |
1360 |
my ($self) = @_; |
1359 |
my $hold_infos = $self->unblessed; |
1361 |
my $hold_infos = $self->unblessed; |
1360 |
require Koha::Old::Hold; |
1362 |
require Koha::Old::Hold; |
1361 |
return Koha::Old::Hold->new($hold_infos)->store; |
1363 |
|
|
|
1364 |
# Create the old hold record |
1365 |
my $old_hold = Koha::Old::Hold->new($hold_infos)->store; |
1366 |
|
1367 |
# Update any linked accountlines to point to old_reserve_id instead of reserve_id |
1368 |
$self->_result->search_related('accountlines')->update( |
1369 |
{ |
1370 |
old_reserve_id => $self->id, |
1371 |
reserve_id => undef, |
1372 |
} |
1373 |
); |
1374 |
|
1375 |
return $old_hold; |
1362 |
} |
1376 |
} |
1363 |
|
1377 |
|
1364 |
=head3 to_api_mapping |
1378 |
=head3 to_api_mapping |
Lines 1450-1455
sub strings_map {
Link Here
|
1450 |
return $strings; |
1464 |
return $strings; |
1451 |
} |
1465 |
} |
1452 |
|
1466 |
|
|
|
1467 |
=head3 debits |
1468 |
|
1469 |
my $debits = $hold->debits; |
1470 |
|
1471 |
Get all debit account lines (charges) associated with this hold |
1472 |
|
1473 |
=cut |
1474 |
|
1475 |
sub debits { |
1476 |
my ($self) = @_; |
1477 |
|
1478 |
my $accountlines_rs = $self->_result->search_related( |
1479 |
'accountlines', |
1480 |
{ |
1481 |
credit_type_code => undef, # Only debits (no credits) |
1482 |
}, |
1483 |
{ |
1484 |
order_by => { -desc => 'timestamp' }, |
1485 |
} |
1486 |
); |
1487 |
return Koha::Account::Debits->_new_from_dbic($accountlines_rs); |
1488 |
} |
1489 |
|
1453 |
=head2 Internal methods |
1490 |
=head2 Internal methods |
1454 |
|
1491 |
|
1455 |
=head3 _type |
1492 |
=head3 _type |