#
# This file is part of Koha.
#
-# Koha is free software; you can redistribute it and/or modify it under the
-# terms of the GNU General Public License as published by the Free Software
-# Foundation; either version 2 of the License, or (at your option) any later
-# version.
+# Koha is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
#
-# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
-# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
-# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+# Koha is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
#
-# You should have received a copy of the GNU General Public License along
-# with Koha; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+# You should have received a copy of the GNU General Public License
+# along with Koha; if not, see <http://www.gnu.org/licenses>.
=head1 NAME
use strict;
use CGI qw ( -utf8 );
use C4::Context;
-use C4::Input;
use C4::Auth;
use C4::Budgets;
-use C4::Input;
use C4::Acquisition;
use C4::Contract;
use C4::Biblio; # GetBiblioData GetMarcPrice
use C4::Items; #PrepareItemRecord
use C4::Output;
-use C4::Input;
use C4::Koha;
use C4::Branch; # GetBranches
use C4::Members;
+my ( @order_user_ids, @order_users );
if ( $ordernumber eq '' ) { # create order
$new = 'yes';
$basket = GetBasket( $data->{'basketno'} );
$basketno = $basket->{'basketno'};
+
+ @order_user_ids = GetOrderUsers($ordernumber);
+ foreach my $order_user_id (@order_user_ids) {
+ my $order_user = GetMember(borrowernumber => $order_user_id);
+ push @order_users, $order_user if $order_user;
+ }
}
my $suggestion;
firstnamesuggestedby => $suggestion->{firstnamesuggestedby},
biblionumber => $biblionumber,
uncertainprice => $data->{'uncertainprice'},
- authorisedbyname => $borrower->{'firstname'} . " " . $borrower->{'surname'},
discount_2dp => sprintf( "%.2f", $bookseller->{'discount'} ) , # for display
discount => $bookseller->{'discount'},
orderdiscount_2dp => sprintf( "%.2f", $data->{'discount'} || 0 ),
import_batch_id => $import_batch_id,
subscriptionid => $subscriptionid,
acqcreate => C4::Context->preference("AcqCreateItem") eq "ordering" ? 1 : "",
+ users_ids => join(':', @order_user_ids),
+ users => \@order_users,
(uc(C4::Context->preference("marcflavour"))) => 1
);