Link Here
|
|
|
1 |
package Core::Community::Circulation; |
2 |
|
3 |
use strict; |
4 |
use warnings; |
5 |
|
6 |
use Carp; |
7 |
use Data::Dumper; |
8 |
use C4::Circulation; |
9 |
|
10 |
use Core::Exceptions; |
11 |
use parent qw( Core::Circulation Core::Prefs ); |
12 |
|
13 |
=head |
14 |
legacy support for C4::Circulation::AddReturn |
15 |
=cut |
16 |
sub Checkin { |
17 |
my ($self, $exemptFine, $dropBox, $returnDate, $dropBoxDate) = @_; |
18 |
my ($doreturn, $messages, $iteminformation, $borrower) = |
19 |
C4::Circulation::AddReturn( $self->{item}->barcode, $self->{library}->branchcode, $exemptFine, $dropBox, $returnDate ); |
20 |
$doreturn or $self->{error} = Core::Exception::Circulation::CheckinError->new(); |
21 |
|
22 |
$self->{messages} = $messages; |
23 |
$self->{patron} = Koha::Patrons->find($borrower->{borrowernumber}); |
24 |
return $self; |
25 |
} |
26 |
|
27 |
=head |
28 |
legacy support for C4::Circulation::AddIssue |
29 |
=cut |
30 |
sub Checkout { |
31 |
my ($self, $dateDue, $cancelReserve, $issueDate, $sipMode, $params) = @_; |
32 |
my $issue = C4::Circulation::AddIssue( $self->{patron}->unblessed, $self->{item}->barcode, $dateDue, $cancelReserve, $issueDate, $sipMode, $params ); |
33 |
$self->{checkout} = $issue; |
34 |
$issue or $self->{error} = Core::Exception::Circulation::CheckoutError->new(); |
35 |
return $self; |
36 |
} |
37 |
|
38 |
=head |
39 |
legacy support for C4::Circulation::AddRenewal |
40 |
=cut |
41 |
|
42 |
sub Renew { |
43 |
my ($self, $dateDue, $lastRenewedDate) = @_; |
44 |
my $newDateDue = C4::Circulation::AddRenewal( $self->{patron}->borrowernumber, $self->{item}->itemnumber, $self->{library}->branchcode, $dateDue, $lastRenewedDate); |
45 |
$newDateDue or $self->{error} = Core::Exception::Circulation::RenewError->new(); |
46 |
return $self, $newDateDue; |
47 |
} |
48 |
|
49 |
1; |