1 package Koha
::StockRotationItems
;
3 # Copyright PTFS Europe 2016
5 # This file is part of Koha.
7 # Koha is free software; you can redistribute it and/or modify it
8 # under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 3 of the License, or
10 # (at your option) any later version.
12 # Koha is distributed in the hope that it will be useful, but
13 # WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with Koha; if not, see <http://www.gnu.org/licenses>.
23 use Koha
::StockRotationItem
;
25 use base
qw(Koha::Objects);
29 StockRotationItems - Koha StockRotationItems Object class
33 StockRotationItems class used primarily by stockrotation .pls and the stock
38 Standard Koha::Objects definitions, and additional methods.
51 return 'Stockrotationitem';
59 return 'Koha::StockRotationItem';
64 my $report = $items->investigate;
66 Return a stockrotation report about this set of stockrotationitems.
68 In this part of the overall investigation process we split individual item
69 reports into appropriate action segments of our items report and increment
72 The report generated here will be used on the stage level to slot our item
73 reports into appropriate sections of the branched report.
75 For details of intent and context of this procedure, please see
76 Koha::StockRotationRota->investigate.
86 initiable_items
=> [],
87 repatriable_items
=> [],
88 advanceable_items
=> [],
93 while ( my $item = $self->next ) {
94 my $report = $item->investigate;
95 if ( $report->{reason
} eq 'initiation' ) {
96 $items_report->{initiable
}++;
97 $items_report->{actionable
}++;
98 push @
{$items_report->{items
}}, $report;
99 push @
{$items_report->{initiable_items
}}, $report;
100 } elsif ( $report->{reason
} eq 'repatriation' ) {
101 $items_report->{repatriable
}++;
102 $items_report->{actionable
}++;
103 push @
{$items_report->{items
}}, $report;
104 push @
{$items_report->{repatriable_items
}}, $report;
105 } elsif ( $report->{reason
} eq 'advancement' ) {
106 $items_report->{actionable
}++;
107 push @
{$items_report->{items
}}, $report;
108 push @
{$items_report->{advanceable_items
}}, $report;
109 } elsif ( $report->{reason
} eq 'in-demand' ) {
110 $items_report->{actionable
}++;
111 push @
{$items_report->{items
}}, $report;
112 push @
{$items_report->{indemand_items
}}, $report;
114 $items_report->{stationary
}++;
115 push @
{$items_report->{log}}, $report;
119 return $items_report;
126 Alex Sassmannshausen <alex.sassmannshausen@ptfs-europe.com>