Lines 23-28
use Koha::Database;
Link Here
|
23 |
|
23 |
|
24 |
use Koha::DateUtils qw( dt_from_string ); |
24 |
use Koha::DateUtils qw( dt_from_string ); |
25 |
use Koha::Acquisition::Order; |
25 |
use Koha::Acquisition::Order; |
|
|
26 |
use Koha::Exceptions::Exception; |
26 |
|
27 |
|
27 |
use base qw(Koha::Objects); |
28 |
use base qw(Koha::Objects); |
28 |
|
29 |
|
Lines 32-38
Koha::Acquisition::Orders object set class
Link Here
|
32 |
|
33 |
|
33 |
=head1 API |
34 |
=head1 API |
34 |
|
35 |
|
35 |
=head2 Class Methods |
36 |
=head2 Class methods |
36 |
|
37 |
|
37 |
=head3 filter_by_lates |
38 |
=head3 filter_by_lates |
38 |
|
39 |
|
Lines 130-135
sub filter_by_lates {
Link Here
|
130 |
); |
131 |
); |
131 |
} |
132 |
} |
132 |
|
133 |
|
|
|
134 |
=head3 filter_by_id_including_transfers |
135 |
|
136 |
my $orders = $orders->filter_by_id_including_transfers( |
137 |
{ |
138 |
ordernumber => $ordernumber |
139 |
} |
140 |
); |
141 |
|
142 |
When searching for orders by I<ordernumber>, include the aqorders_transfers table |
143 |
so we can find orders that have changed their ordernumber as the result of a transfer |
144 |
|
145 |
=cut |
146 |
|
147 |
sub filter_by_id_including_transfers { |
148 |
my ( $self, $params ) = @_; |
149 |
|
150 |
Koha::Exceptions::MissingParameter->throw( "The ordernumber param is mandatory" ) |
151 |
unless $params->{ordernumber}; |
152 |
|
153 |
return $self->search( |
154 |
{ |
155 |
-or => [ |
156 |
{ 'me.ordernumber' => $params->{ordernumber} }, |
157 |
{ 'aqorders_transfers_ordernumber_to.ordernumber_from' => $params->{ordernumber} } |
158 |
] |
159 |
}, |
160 |
{ join => 'aqorders_transfers_ordernumber_to' } |
161 |
); |
162 |
} |
163 |
|
133 |
=head2 Internal methods |
164 |
=head2 Internal methods |
134 |
|
165 |
|
135 |
=head3 _type (internal) |
166 |
=head3 _type (internal) |
136 |
- |
|
|