Bug 20494: Remove unused code in neworderempty.pl and addbiblio.pl
[koha.git] / acqui / finishreceive.pl
index b8854a6..8c1439c 100755 (executable)
@@ -20,8 +20,7 @@
 # You should have received a copy of the GNU General Public License
 # along with Koha; if not, see <http://www.gnu.org/licenses>.
 
-use strict;
-use warnings;
+use Modern::Perl;
 use CGI qw ( -utf8 );
 use C4::Auth;
 use C4::Output;
@@ -60,12 +59,13 @@ my $order            = GetOrder($ordernumber);
 my $new_ordernumber  = $ordernumber;
 
 $unitprice = Koha::Number::Price->new( $unitprice )->unformat();
+my $basket = Koha::Acquisition::Orders->find( $ordernumber )->basket;
 
 #need old receivedate if we update the order, parcel.pl only shows the right parcel this way FIXME
 if ($quantityrec > $origquantityrec ) {
     my @received_items = ();
-    if(C4::Context->preference('AcqCreateItem') eq 'ordering') {
-        @received_items = $input->multi_param('items_to_receive');
+    if ($basket->effective_create_items eq 'ordering') {
+        @received_items = $input->param('items_to_receive');
         my @affects = split q{\|}, C4::Context->preference("AcqItemSetSubfieldsWhenReceived");
         if ( @affects ) {
             my $frameworkcode = GetFrameworkCode($biblionumber);
@@ -111,7 +111,7 @@ if ($quantityrec > $origquantityrec ) {
     }
 
     # now, add items if applicable
-    if (C4::Context->preference('AcqCreateItem') eq 'receiving') {
+    if ($basket->effective_create_items eq 'receiving') {
 
         my @tags         = $input->multi_param('tag');
         my @subfields    = $input->multi_param('subfield');