From f9ff3a0ae3da169e637c63119a9178826f434d13 Mon Sep 17 00:00:00 2001 From: Andrew Isherwood Date: Mon, 26 Oct 2020 11:44:50 +0000 Subject: [PATCH] Bug 24190: (follow-up) Modify order of logging Basket creation involves two steps in Koha, creating the basket then modifying its header. We were logging these two steps in the wrong order. This commit fixes that. --- C4/Acquisition.pm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/C4/Acquisition.pm b/C4/Acquisition.pm index d5a46144c5..7a9b61f085 100644 --- a/C4/Acquisition.pm +++ b/C4/Acquisition.pm @@ -198,6 +198,11 @@ sub NewBasket { . 'VALUES (now(),?,?)'; $dbh->do( $query, {}, $booksellerid, $authorisedby ); + # Log the basket creation + if (C4::Context->preference("AcqLog")) { + logaction('ACQUISITIONS', 'ADD_BASKET', $basket); + } + my $basket = $dbh->{mysql_insertid}; $basketname ||= q{}; # default to empty strings $basketnote ||= q{}; @@ -205,11 +210,6 @@ sub NewBasket { ModBasketHeader( $basket, $basketname, $basketnote, $basketbooksellernote, $basketcontractnumber, $booksellerid, $deliveryplace, $billingplace, $is_standing, $create_items ); - # Log the basket creation - if (C4::Context->preference("AcqLog")) { - logaction('ACQUISITIONS', 'ADD_BASKET', $basket); - } - return $basket; } -- 2.20.1