|
Lines 165-170
sub renewals {
Link Here
|
| 165 |
return Koha::Checkouts::Renewals->_new_from_dbic($renewals_rs); |
165 |
return Koha::Checkouts::Renewals->_new_from_dbic($renewals_rs); |
| 166 |
} |
166 |
} |
| 167 |
|
167 |
|
|
|
168 |
=head3 quota |
| 169 |
|
| 170 |
my $quota = $checkout->quota; |
| 171 |
|
| 172 |
Return the checked out quota |
| 173 |
|
| 174 |
=cut |
| 175 |
|
| 176 |
sub quota { |
| 177 |
my ($self) = @_; |
| 178 |
my $usage_rs = $self->_result->quota_usages->search( |
| 179 |
{}, |
| 180 |
{ |
| 181 |
rows => 1, |
| 182 |
order_by => { '-desc' => 'creation_date' } |
| 183 |
} |
| 184 |
)->single; |
| 185 |
return unless $usage_rs; |
| 186 |
return Koha::Patron::Quota->_new_from_dbic( $usage_rs->patron_quota ); |
| 187 |
} |
| 188 |
|
| 168 |
=head3 attempt_auto_renew |
189 |
=head3 attempt_auto_renew |
| 169 |
|
190 |
|
| 170 |
my ($success, $error, $updated) = $checkout->auto_renew({ confirm => 1 }); |
191 |
my ($success, $error, $updated) = $checkout->auto_renew({ confirm => 1 }); |