Lines 911-922
subtest 'Acquisition logging' => sub {
Link Here
|
911 |
|
911 |
|
912 |
Koha::ActionLogs->delete; |
912 |
Koha::ActionLogs->delete; |
913 |
my $basketno = NewBasket( $booksellerid, 1 ); |
913 |
my $basketno = NewBasket( $booksellerid, 1 ); |
914 |
my @create_logs = Koha::ActionLogs->search({ module =>'ACQUISITIONS', action => 'ADD_BASKET', object => $basketno }); |
914 |
my @create_logs = Koha::ActionLogs->search({ module =>'ACQUISITIONS', action => 'ADD_BASKET', object => $basketno })->as_list; |
915 |
is (scalar @create_logs, 1, 'Basket creation is logged'); |
915 |
is (scalar @create_logs, 1, 'Basket creation is logged'); |
916 |
|
916 |
|
917 |
Koha::ActionLogs->delete; |
917 |
Koha::ActionLogs->delete; |
918 |
C4::Acquisition::ReopenBasket($basketno); |
918 |
C4::Acquisition::ReopenBasket($basketno); |
919 |
my @reopen_logs = Koha::ActionLogs->search({ module =>'ACQUISITIONS', action => 'REOPEN_BASKET', object => $basketno }); |
919 |
my @reopen_logs = Koha::ActionLogs->search({ module =>'ACQUISITIONS', action => 'REOPEN_BASKET', object => $basketno })->as_list; |
920 |
is (scalar @reopen_logs, 1, 'Basket reopen is logged'); |
920 |
is (scalar @reopen_logs, 1, 'Basket reopen is logged'); |
921 |
|
921 |
|
922 |
Koha::ActionLogs->delete; |
922 |
Koha::ActionLogs->delete; |
Lines 924-940
subtest 'Acquisition logging' => sub {
Link Here
|
924 |
basketno => $basketno, |
924 |
basketno => $basketno, |
925 |
booksellerid => $booksellerid |
925 |
booksellerid => $booksellerid |
926 |
}); |
926 |
}); |
927 |
my @mod_logs = Koha::ActionLogs->search({ module =>'ACQUISITIONS', action => 'MODIFY_BASKET', object => $basketno }); |
927 |
my @mod_logs = Koha::ActionLogs->search({ module =>'ACQUISITIONS', action => 'MODIFY_BASKET', object => $basketno })->as_list; |
928 |
is (scalar @mod_logs, 1, 'Basket modify is logged'); |
928 |
is (scalar @mod_logs, 1, 'Basket modify is logged'); |
929 |
|
929 |
|
930 |
Koha::ActionLogs->delete; |
930 |
Koha::ActionLogs->delete; |
931 |
C4::Acquisition::ModBasketHeader($basketno,"Test","","","",$booksellerid); |
931 |
C4::Acquisition::ModBasketHeader($basketno,"Test","","","",$booksellerid); |
932 |
my @mod_header_logs = Koha::ActionLogs->search({ module =>'ACQUISITIONS', action => 'MODIFY_BASKET_HEADER', object => $basketno }); |
932 |
my @mod_header_logs = Koha::ActionLogs->search({ module =>'ACQUISITIONS', action => 'MODIFY_BASKET_HEADER', object => $basketno })->as_list; |
933 |
is (scalar @mod_header_logs, 1, 'Basket header modify is logged'); |
933 |
is (scalar @mod_header_logs, 1, 'Basket header modify is logged'); |
934 |
|
934 |
|
935 |
Koha::ActionLogs->delete; |
935 |
Koha::ActionLogs->delete; |
936 |
C4::Acquisition::ModBasketUsers($basketno,(1)); |
936 |
C4::Acquisition::ModBasketUsers($basketno,(1)); |
937 |
my @mod_users_logs = Koha::ActionLogs->search({ module =>'ACQUISITIONS', action => 'MODIFY_BASKET_USERS', object => $basketno }); |
937 |
my @mod_users_logs = Koha::ActionLogs->search({ module =>'ACQUISITIONS', action => 'MODIFY_BASKET_USERS', object => $basketno })->as_list; |
938 |
is (scalar @mod_users_logs, 1, 'Basket users modify is logged'); |
938 |
is (scalar @mod_users_logs, 1, 'Basket users modify is logged'); |
939 |
|
939 |
|
940 |
t::lib::Mocks::mock_preference('AcquisitionLog', 0); |
940 |
t::lib::Mocks::mock_preference('AcquisitionLog', 0); |