|
Lines 37-42
Koha::Library::FloatLimits - Koha Library::FloatLimit object set class
Link Here
|
| 37 |
|
37 |
|
| 38 |
=head3 lowest_ratio_library |
38 |
=head3 lowest_ratio_library |
| 39 |
|
39 |
|
|
|
40 |
my $library = Koha::Library::FloatLimits->lowest_ratio_library( |
| 41 |
$item, $branchcode, $from_branch |
| 42 |
); |
| 43 |
|
| 44 |
Determines the optimal library to transfer an item to based on float limit ratios. |
| 45 |
|
| 46 |
This method calculates the ratio of current items to float limits for each library |
| 47 |
with configured float limits for the item's type. It considers items currently at |
| 48 |
the branch, items in transit to/from the branch, and respects library group |
| 49 |
restrictions if the item's return policy is set to 'returnbylibrarygroup'. |
| 50 |
|
| 51 |
The method returns the library with the lowest ratio (most need for this item type), |
| 52 |
with preference given to the current branch in case of ties. Returns undef if no |
| 53 |
suitable transfer destination is found or if branch transfer limits prevent the |
| 54 |
transfer. |
| 55 |
|
| 56 |
=over 4 |
| 57 |
|
| 58 |
=item * $item - Koha::Item object to be transferred |
| 59 |
|
| 60 |
=item * $branchcode - branchcode of the return/checkin location |
| 61 |
|
| 62 |
=item * $from_branch - (optional) branchcode where item was previously held, used for |
| 63 |
adjusting item counts during the calculation |
| 64 |
|
| 65 |
=back |
| 66 |
|
| 67 |
Returns: Koha::Library object of the destination branch, or undef if no transfer needed |
| 68 |
|
| 40 |
=cut |
69 |
=cut |
| 41 |
|
70 |
|
| 42 |
sub lowest_ratio_library { |
71 |
sub lowest_ratio_library { |