|
Lines 111-116
sub add_item {
Link Here
|
| 111 |
$rs->create({ ordernumber => $self->ordernumber, itemnumber => $itemnumber }); |
111 |
$rs->create({ ordernumber => $self->ordernumber, itemnumber => $itemnumber }); |
| 112 |
} |
112 |
} |
| 113 |
|
113 |
|
|
|
114 |
=head3 add_user |
| 115 |
|
| 116 |
$order->add_user( $borrowernumber ); |
| 117 |
|
| 118 |
Link an user to this order. |
| 119 |
|
| 120 |
=cut |
| 121 |
|
| 114 |
sub add_user { |
122 |
sub add_user { |
| 115 |
my ( $self, $borrowernumber ) = @_; |
123 |
my ( $self, $borrowernumber ) = @_; |
| 116 |
|
124 |
|
|
Lines 177-182
sub subscription {
Link Here
|
| 177 |
return Koha::Subscription->_new_from_dbic( $subscription_rs ); |
185 |
return Koha::Subscription->_new_from_dbic( $subscription_rs ); |
| 178 |
} |
186 |
} |
| 179 |
|
187 |
|
|
|
188 |
=head3 items |
| 189 |
|
| 190 |
my $items = $order->items |
| 191 |
|
| 192 |
Returns the items associated to the order. |
| 193 |
|
| 194 |
=cut |
| 195 |
|
| 180 |
sub items { |
196 |
sub items { |
| 181 |
my ( $self ) = @_; |
197 |
my ( $self ) = @_; |
| 182 |
# aqorders_items is not a join table |
198 |
# aqorders_items is not a join table |
|
Lines 186-191
sub items {
Link Here
|
| 186 |
return Koha::Items->search({ itemnumber => \@itemnumbers }); |
202 |
return Koha::Items->search({ itemnumber => \@itemnumbers }); |
| 187 |
} |
203 |
} |
| 188 |
|
204 |
|
|
|
205 |
=head3 users |
| 206 |
|
| 207 |
my $patrons = $order->users |
| 208 |
|
| 209 |
Returns the users (Koha::Patrons) that are in the basket users list |
| 210 |
|
| 211 |
=cut |
| 212 |
|
| 189 |
sub users { |
213 |
sub users { |
| 190 |
my ( $self ) = @_; |
214 |
my ( $self ) = @_; |
| 191 |
my $users_rs = $self->_result->aqorder_users; |
215 |
my $users_rs = $self->_result->aqorder_users; |
|
Lines 193-198
sub users {
Link Here
|
| 193 |
return Koha::Patrons->search({ borrowernumber=> \@borrowernumbers }); |
217 |
return Koha::Patrons->search({ borrowernumber=> \@borrowernumbers }); |
| 194 |
} |
218 |
} |
| 195 |
|
219 |
|
|
|
220 |
=head3 duplicate_to |
| 221 |
|
| 222 |
my $duplicated_order = $order->duplicate_to($basket, [$default_values]); |
| 223 |
|
| 224 |
Duplicate an existing order and attach it to a basket. $default_values can be specified as a hashref |
| 225 |
that contain default values for the different order's attributes. |
| 226 |
Items will be duplicated as well but barcodes will be set to null. |
| 227 |
|
| 228 |
=cut |
| 229 |
|
| 196 |
sub duplicate_to { |
230 |
sub duplicate_to { |
| 197 |
my ( $self, $basket, $default_values ) = @_; |
231 |
my ( $self, $basket, $default_values ) = @_; |
| 198 |
my $new_order; |
232 |
my $new_order; |
| 199 |
- |
|
|