From 24c49ab1ed300a43cd8ce468f76564d9cf1e0477 Mon Sep 17 00:00:00 2001 From: Andrew Isherwood Date: Mon, 19 Oct 2020 10:48:57 +0100 Subject: [PATCH] Bug 23971: (follow-up) Respond to feedback As requested by Jonathan in commit #28: - We now no longer pass a flag to CloseBasket indicating if the closure was due to an EDI basket approval, we log the closure and approval as separate events. --- C4/Acquisition.pm | 5 ++--- Koha/EDI.pm | 14 +++++++++++--- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/C4/Acquisition.pm b/C4/Acquisition.pm index 0682020f06..d5a46144c5 100644 --- a/C4/Acquisition.pm +++ b/C4/Acquisition.pm @@ -224,7 +224,7 @@ close a basket (becomes unmodifiable, except for receives) =cut sub CloseBasket { - my ($basketno, $edi_approval) = @_; + my ($basketno) = @_; my $dbh = C4::Context->dbh; $dbh->do('UPDATE aqbasket SET closedate=now() WHERE basketno=?', {}, $basketno ); @@ -235,10 +235,9 @@ q{UPDATE aqorders SET orderstatus = 'ordered' WHERE basketno = ? AND orderstatus # Log the closure if (C4::Context->preference("AcqLog")) { - my $action = $edi_approval ? 'APPROVE_BASKET' : 'CLOSE_BASKET'; logaction( 'ACQUISITIONS', - $action, + 'CLOSE_BASKET', $basketno ); } diff --git a/Koha/EDI.pm b/Koha/EDI.pm index 088676961a..70f17594e4 100644 --- a/Koha/EDI.pm +++ b/Koha/EDI.pm @@ -33,6 +33,7 @@ use C4::Suggestions qw( ModSuggestion ); use C4::Biblio qw( AddBiblio TransformKohaToMarc GetMarcBiblio GetFrameworkCode GetMarcFromKohaField ); use Koha::Edifact::Order; use Koha::Edifact; +use C4::Log qw(logaction); use Log::Log4perl; use Text::Unidecode; use Koha::Plugins::Handler; @@ -592,9 +593,16 @@ sub process_quote { basketno => $b, } ); - # Close the basket, passing a flag indicating that this action - # originated from an approval - CloseBasket($b, 1); + # Close the basket + CloseBasket($b); + # Log the approval of this basket + if (C4::Context->preference("AcqLog")) { + logaction( + 'ACQUISITIONS', + 'APPROVE_BASKET', + $b + ); + } } } -- 2.20.1