From 7284bd9de76285052c404b3391960e9e765253d7 Mon Sep 17 00:00:00 2001
From: Colin Campbell <colin.campbell@ptfs-europe.com>
Date: Mon, 19 Mar 2018 10:45:26 +0000
Subject: [PATCH] Bug 20446 Revert to using syspref for item creation

Using a per-basket setting is nonsensical when baskets
are created automatically by quote processing a few lines before
this attempts to read it. cron job aborts with a runtime error
leaving basket for quote half-created.
This reverts to the previous code using the global setting.
(Basket itself will have been set to the global setting
by default)
---
 Koha/EDI.pm | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/Koha/EDI.pm b/Koha/EDI.pm
index bad68d1995..1a15507171 100644
--- a/Koha/EDI.pm
+++ b/Koha/EDI.pm
@@ -797,9 +797,7 @@ sub quote_item {
                     );
                 }
 
-                my $basket = Koha::Acquisition::Basket->find( $basketno );
-
-                if ( $basket->effective_create_item eq 'ordering' ) {
+                if ( C4::Context->preference('AcqCreateItem') eq 'ordering' ) {
                     my $new_item = {
                         notforloan       => -1,
                         cn_sort          => q{},
-- 
2.14.3