Koha::Checkout - Koha Checkout object class
my $is_overdue = $checkout->is_overdue( [ $reference_dt ] );
Return 1 if the checkout is overdue.
A reference date can be passed, in this case it will be used, otherwise today will be the reference date.
my $item = $checkout->item;
Return the checked out item
my $account_lines = $checkout->account_lines;
Return the checked out account_lines
my $fines = $checkout->overdue_fines;
Return the account lines for just the overdue fines
my $library = $checkout->library;
Return the library in which the transaction took place
my $patron = $checkout->patron
Return the patron for who the checkout has been done
my $issuer = $checkout->issuer
Return the patron by whom the checkout was done
my $renewals = $checkout->renewals;
Return a Koha::Checkouts::Renewals set attached to this checkout
my $booking = $checkout->booking;
Return the linked booking
my ($success, $error, $updated) = $checkout->auto_renew({ confirm => 1 });
Attempt to automatically renew a book. Return error reason if it cannot be renewed. Also return whether a change has been made to avoid notifying on more than one attempt.
If not passed confirm, we will only report and no changes will be made.
This method returns the mapping for representing a Koha::Checkout object on the API.
This method returns the list of publicly readable database fields for both API and UI output purposes
my $return_claim = $checkout->claim_returned();
This method sets the checkout as claimed return. It will:
1. Add a new row to the `return_claims` table 2. Set the item as lost using the 'ClaimReturnedLostValue' 3. Charge a fee depending on the value of ClaimReturnedChargeFee 3a. If set to charge, then accruing overdues will be halted 3b. If set to charge, then any existing transfers will be cancelled and the holding branch will be set back to 'frombranch'. 4. The issue will be marked as returned as per the 'MarkLostItemsAsReturned' preference
my $branchcode = Koha::Checkout->branch_for_fee_context( fee_type => 'OVERDUE' | 'LOST' | 'PROCESSING', patron => $patron_obj, # Koha::Patron object or hashref item => $item_obj, # Koha::Item object or hashref issue => $issue_obj, # Koha::Checkout object or hashref (optional) );
Determines which branch's rules should apply to a fee based on system preferences and available context.
For LOST/PROCESSING fees, honors LostChargesControl preference: - PatronLibrary: Uses patron's home branch - PickupLibrary: Uses checkout branch (falls back to patron, then item) - ItemHomeLibrary: Uses item's home or holding branch (per HomeOrHoldingBranch pref)
For OVERDUE fees, honors CircControl preference (same values as above).
Parameters: - fee_type: 'OVERDUE', 'LOST', or 'PROCESSING' (defaults to 'OVERDUE') - patron: Koha::Patron object or hashref with branchcode - item: Koha::Item object or hashref with homebranch/holdingbranch - issue: Koha::Checkout object or hashref with branchcode (optional)
Returns: A branchcode (string) or undef if no branch can be determined.
Note: Returning undef is acceptable - calling code should handle this gracefully. When passed to Koha::Account->add_debit as library_id, undef indicates no specific branch context is available for the fee.
Kyle M Hall <kyle@bywatersolutions.com>
Jonathan Druart <jonathan.druart@bugs.koha-community.org>