|
Lines 938-944
sub cancel {
Link Here
|
| 938 |
interface => C4::Context->interface, |
938 |
interface => C4::Context->interface, |
| 939 |
library_id => C4::Context->userenv ? C4::Context->userenv->{'branch'} : undef, |
939 |
library_id => C4::Context->userenv ? C4::Context->userenv->{'branch'} : undef, |
| 940 |
type => 'RESERVE_EXPIRED', |
940 |
type => 'RESERVE_EXPIRED', |
| 941 |
item_id => $self->itemnumber |
941 |
item_id => $self->itemnumber, |
|
|
942 |
hold_id => $self->id, |
| 942 |
} |
943 |
} |
| 943 |
) if $charge; |
944 |
) if $charge; |
| 944 |
} |
945 |
} |
|
Lines 1309-1314
sub charge_hold_fee {
Link Here
|
| 1309 |
description => $self->biblio->title, |
1310 |
description => $self->biblio->title, |
| 1310 |
type => 'RESERVE', |
1311 |
type => 'RESERVE', |
| 1311 |
item_id => $self->itemnumber, |
1312 |
item_id => $self->itemnumber, |
|
|
1313 |
hold_id => $self->id, |
| 1312 |
user_id => C4::Context->userenv ? C4::Context->userenv->{number} : undef, |
1314 |
user_id => C4::Context->userenv ? C4::Context->userenv->{number} : undef, |
| 1313 |
library_id => C4::Context->userenv ? C4::Context->userenv->{branch} : undef, |
1315 |
library_id => C4::Context->userenv ? C4::Context->userenv->{branch} : undef, |
| 1314 |
interface => C4::Context->interface, |
1316 |
interface => C4::Context->interface, |
|
Lines 1446-1452
sub _move_to_old {
Link Here
|
| 1446 |
my ($self) = @_; |
1448 |
my ($self) = @_; |
| 1447 |
my $hold_infos = $self->unblessed; |
1449 |
my $hold_infos = $self->unblessed; |
| 1448 |
require Koha::Old::Hold; |
1450 |
require Koha::Old::Hold; |
| 1449 |
return Koha::Old::Hold->new($hold_infos)->store; |
1451 |
|
|
|
1452 |
# Create the old hold record |
| 1453 |
my $old_hold = Koha::Old::Hold->new($hold_infos)->store; |
| 1454 |
|
| 1455 |
# Update any linked accountlines to point to old_reserve_id instead of reserve_id |
| 1456 |
$self->_result->search_related('accountlines')->update( |
| 1457 |
{ |
| 1458 |
old_reserve_id => $self->id, |
| 1459 |
reserve_id => undef, |
| 1460 |
} |
| 1461 |
); |
| 1462 |
|
| 1463 |
return $old_hold; |
| 1450 |
} |
1464 |
} |
| 1451 |
|
1465 |
|
| 1452 |
=head3 to_api_mapping |
1466 |
=head3 to_api_mapping |
|
Lines 1538-1543
sub strings_map {
Link Here
|
| 1538 |
return $strings; |
1552 |
return $strings; |
| 1539 |
} |
1553 |
} |
| 1540 |
|
1554 |
|
|
|
1555 |
=head3 debits |
| 1556 |
|
| 1557 |
my $debits = $hold->debits; |
| 1558 |
|
| 1559 |
Get all debit account lines (charges) associated with this hold |
| 1560 |
|
| 1561 |
=cut |
| 1562 |
|
| 1563 |
sub debits { |
| 1564 |
my ($self) = @_; |
| 1565 |
|
| 1566 |
my $accountlines_rs = $self->_result->search_related( |
| 1567 |
'accountlines', |
| 1568 |
{ |
| 1569 |
credit_type_code => undef, # Only debits (no credits) |
| 1570 |
}, |
| 1571 |
{ |
| 1572 |
order_by => { -desc => 'timestamp' }, |
| 1573 |
} |
| 1574 |
); |
| 1575 |
return Koha::Account::Debits->_new_from_dbic($accountlines_rs); |
| 1576 |
} |
| 1577 |
|
| 1541 |
=head2 Internal methods |
1578 |
=head2 Internal methods |
| 1542 |
|
1579 |
|
| 1543 |
=head3 _type |
1580 |
=head3 _type |