@@ -, +, @@ $ kshell k$ prove t/db_dependent/Koha/Acquisition/Basket.t --- Koha/Acquisition/Basket.pm | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) --- a/Koha/Acquisition/Basket.pm +++ a/Koha/Acquisition/Basket.pm @@ -21,6 +21,7 @@ use Modern::Perl; use Koha::Database; use Koha::Acquisition::BasketGroups; +use Koha::Patrons; use base qw( Koha::Object Koha::Object::Mixin::AdditionalFields ); @@ -30,7 +31,7 @@ Koha::Acquisition::Basket - Koha Basket Object class =head1 API -=head2 Class Methods +=head2 Class methods =cut @@ -46,6 +47,20 @@ sub bookseller { return Koha::Acquisition::Bookseller->_new_from_dbic( $bookseller_rs ); } +=head3 creator + + my $creator = $basket->creator; + +Returns the I for the basket creator. + +=cut + +sub creator { + my ($self) = @_; + return Koha::Patrons->find( $self->authorisedby ) + if $self->authorisedby; +} + =head3 basket_group Returns the basket group associated to this basket @@ -109,11 +124,11 @@ sub to_api_mapping { creationdate => 'creation_date', closedate => 'close_date', booksellerid => 'vendor_id', - authorisedby => 'authorised_by', + authorisedby => 'creator_id', booksellerinvoicenumber => undef, basketgroupid => 'basket_group_id', - deliveryplace => 'delivery_place', - billingplace => 'billing_place', + deliveryplace => 'delivery_library_id', + billingplace => 'billing_library_id', branch => 'library_id', is_standing => 'standing' }; --