@@ -, +, @@ --- C4/Acquisition.pm | 31 ++++++++++++++++++++++++++----- Koha/EDI.pm | 11 +++++++++++ acqui/addorder.pl | 6 +++++- 3 files changed, 42 insertions(+), 6 deletions(-) --- a/C4/Acquisition.pm +++ a/C4/Acquisition.pm @@ -45,6 +45,7 @@ use C4::Koha; use MARC::Field; use MARC::Record; +use JSON qw(to_json); use Time::localtime; @@ -207,7 +208,13 @@ sub NewBasket { # Log the basket creation if (C4::Context->preference("AcqLog")) { - logaction('ACQUISITIONS', 'ADD_BASKET', $basket); + my $created = Koha::Acquisition::Baskets->find( $basket ); + logaction( + 'ACQUISITIONS', + 'ADD_BASKET', + $basket, + to_json($created->unblessed) + ); } return $basket; @@ -235,10 +242,12 @@ sub ReopenBasket { # Log the basket reopening if (C4::Context->preference("AcqLog")) { + my $reopened = Koha::Acquisition::Baskets->find( $basketno ); logaction( 'ACQUISITIONS', 'REOPEN_BASKET', - $basketno + $basketno, + to_json($reopened->unblessed) ); } return; @@ -518,10 +527,14 @@ sub ModBasket { # Log the basket update if (C4::Context->preference("AcqLog")) { + my $modified = Koha::Acquisition::Baskets->find( + $basketinfo->{basketno} + ); logaction( 'ACQUISITIONS', 'MODIFY_BASKET', - $basketinfo->{'basketno'} + $basketinfo->{basketno}, + to_json($modified->unblessed) ); } @@ -585,10 +598,14 @@ sub ModBasketHeader { # Log the basket update if (C4::Context->preference("AcqLog")) { + my $modified = Koha::Acquisition::Baskets->find( + $basketno + ); logaction( 'ACQUISITIONS', 'MODIFY_BASKET_HEADER', - $basketno + $basketno, + to_json($modified->unblessed) ); } @@ -778,7 +795,11 @@ sub ModBasketUsers { logaction( 'ACQUISITIONS', 'MODIFY_BASKET_USERS', - $basketno + $basketno, + to_json({ + basketno => $basketno, + basketusers => @basketusers_ids + }) ); } --- a/Koha/EDI.pm +++ a/Koha/EDI.pm @@ -594,9 +594,20 @@ sub process_quote { } ); Koha::Acquisition::Baskets->find($b)->close; + # Log the approval + if (C4::Context->preference("AcqLog")) { + my $approved = Koha::Acquisition::Baskets->find( $b ); + logaction( + 'ACQUISITIONS', + 'APPROVE_BASKET', + $b, + to_json($approved->unblessed) + ); + } } } + return; } --- a/acqui/addorder.pl +++ a/acqui/addorder.pl @@ -119,6 +119,7 @@ if it is an order from an existing suggestion : the id of this suggestion. use Modern::Perl; use CGI qw ( -utf8 ); +use JSON qw ( to_json ); use C4::Auth; # get_template_and_user use C4::Acquisition; # ModOrder use C4::Suggestions; # ModStatus @@ -129,6 +130,7 @@ use C4::Output; use C4::Log qw(logaction); use Koha::Acquisition::Currencies; use Koha::Acquisition::Orders; +use Koha::Acquisition::Baskets; use C4::Barcodes; ### "-------------------- addorder.pl ----------" @@ -362,10 +364,12 @@ if ( $basket->{is_standing} || $orderinfo->{quantity} ne '0' ) { } if (C4::Context->preference("AcqLog") && $basketno) { + my $modified = Koha::Acquisition::Baskets->find( $basketno ); logaction( 'ACQUISITIONS', 'MODIFY_BASKET', - $basketno + $basketno, + to_json($modified->unblessed) ); } --