|
Lines 949-955
sub cancel {
Link Here
|
| 949 |
interface => C4::Context->interface, |
949 |
interface => C4::Context->interface, |
| 950 |
library_id => C4::Context->userenv ? C4::Context->userenv->{'branch'} : undef, |
950 |
library_id => C4::Context->userenv ? C4::Context->userenv->{'branch'} : undef, |
| 951 |
type => 'RESERVE_EXPIRED', |
951 |
type => 'RESERVE_EXPIRED', |
| 952 |
item_id => $self->itemnumber |
952 |
item_id => $self->itemnumber, |
|
|
953 |
hold_id => $self->id, |
| 953 |
} |
954 |
} |
| 954 |
) if $charge; |
955 |
) if $charge; |
| 955 |
} |
956 |
} |
|
Lines 1329-1334
sub charge_hold_fee {
Link Here
|
| 1329 |
description => $self->biblio->title, |
1330 |
description => $self->biblio->title, |
| 1330 |
type => 'RESERVE', |
1331 |
type => 'RESERVE', |
| 1331 |
item_id => $self->itemnumber, |
1332 |
item_id => $self->itemnumber, |
|
|
1333 |
hold_id => $self->id, |
| 1332 |
user_id => C4::Context->userenv ? C4::Context->userenv->{number} : undef, |
1334 |
user_id => C4::Context->userenv ? C4::Context->userenv->{number} : undef, |
| 1333 |
library_id => C4::Context->userenv ? C4::Context->userenv->{branch} : undef, |
1335 |
library_id => C4::Context->userenv ? C4::Context->userenv->{branch} : undef, |
| 1334 |
interface => C4::Context->interface, |
1336 |
interface => C4::Context->interface, |
|
Lines 1466-1472
sub _move_to_old {
Link Here
|
| 1466 |
my ($self) = @_; |
1468 |
my ($self) = @_; |
| 1467 |
my $hold_infos = $self->unblessed; |
1469 |
my $hold_infos = $self->unblessed; |
| 1468 |
require Koha::Old::Hold; |
1470 |
require Koha::Old::Hold; |
| 1469 |
return Koha::Old::Hold->new($hold_infos)->store; |
1471 |
|
|
|
1472 |
# Create the old hold record |
| 1473 |
my $old_hold = Koha::Old::Hold->new($hold_infos)->store; |
| 1474 |
|
| 1475 |
# Update any linked accountlines to point to old_reserve_id instead of reserve_id |
| 1476 |
$self->_result->search_related('accountlines')->update( |
| 1477 |
{ |
| 1478 |
old_reserve_id => $self->id, |
| 1479 |
reserve_id => undef, |
| 1480 |
} |
| 1481 |
); |
| 1482 |
|
| 1483 |
return $old_hold; |
| 1470 |
} |
1484 |
} |
| 1471 |
|
1485 |
|
| 1472 |
=head3 to_api_mapping |
1486 |
=head3 to_api_mapping |
|
Lines 1562-1567
sub strings_map {
Link Here
|
| 1562 |
return $strings; |
1576 |
return $strings; |
| 1563 |
} |
1577 |
} |
| 1564 |
|
1578 |
|
|
|
1579 |
=head3 debits |
| 1580 |
|
| 1581 |
my $debits = $hold->debits; |
| 1582 |
|
| 1583 |
Get all debit account lines (charges) associated with this hold |
| 1584 |
|
| 1585 |
=cut |
| 1586 |
|
| 1587 |
sub debits { |
| 1588 |
my ($self) = @_; |
| 1589 |
|
| 1590 |
my $accountlines_rs = $self->_result->search_related( |
| 1591 |
'accountlines', |
| 1592 |
{ |
| 1593 |
credit_type_code => undef, # Only debits (no credits) |
| 1594 |
}, |
| 1595 |
{ |
| 1596 |
order_by => { -desc => 'timestamp' }, |
| 1597 |
} |
| 1598 |
); |
| 1599 |
return Koha::Account::Debits->_new_from_dbic($accountlines_rs); |
| 1600 |
} |
| 1601 |
|
| 1565 |
=head2 Internal methods |
1602 |
=head2 Internal methods |
| 1566 |
|
1603 |
|
| 1567 |
=head3 _type |
1604 |
=head3 _type |