|
Lines 19-25
use Modern::Perl;
Link Here
|
| 19 |
|
19 |
|
| 20 |
use POSIX qw(strftime); |
20 |
use POSIX qw(strftime); |
| 21 |
|
21 |
|
| 22 |
use Test::More tests => 66; |
22 |
use Test::More tests => 73; |
| 23 |
use t::lib::Mocks; |
23 |
use t::lib::Mocks; |
| 24 |
use Koha::Database; |
24 |
use Koha::Database; |
| 25 |
use Koha::DateUtils qw(dt_from_string output_pref); |
25 |
use Koha::DateUtils qw(dt_from_string output_pref); |
|
Lines 125-130
sub _check_fields_of_orders {
Link Here
|
| 125 |
my $schema = Koha::Database->new()->schema(); |
125 |
my $schema = Koha::Database->new()->schema(); |
| 126 |
$schema->storage->txn_begin(); |
126 |
$schema->storage->txn_begin(); |
| 127 |
|
127 |
|
|
|
128 |
t::lib::Mocks::mock_preference('AcqLog', 1); |
| 129 |
|
| 128 |
# Creating some orders |
130 |
# Creating some orders |
| 129 |
my $bookseller = Koha::Acquisition::Bookseller->new( |
131 |
my $bookseller = Koha::Acquisition::Bookseller->new( |
| 130 |
{ |
132 |
{ |
|
Lines 148-153
ok(
Link Here
|
| 148 |
); |
150 |
); |
| 149 |
ok( $basket = GetBasket($basketno), "GetBasket($basketno) returns $basket" ); |
151 |
ok( $basket = GetBasket($basketno), "GetBasket($basketno) returns $basket" ); |
| 150 |
|
152 |
|
|
|
153 |
my @create_logs = Koha::ActionLogs->find({ module =>'ACQUISITIONS', action => 'ADD_BASKET', object => $basketno }); |
| 154 |
ok( scalar @create_logs == 1, 'Basket creation is logged'); |
| 155 |
|
| 151 |
my $bpid=AddBudgetPeriod({ |
156 |
my $bpid=AddBudgetPeriod({ |
| 152 |
budget_period_startdate => '2008-01-01' |
157 |
budget_period_startdate => '2008-01-01' |
| 153 |
, budget_period_enddate => '2008-12-31' |
158 |
, budget_period_enddate => '2008-12-31' |
|
Lines 411-416
$search_orders = SearchOrders({
Link Here
|
| 411 |
}); |
416 |
}); |
| 412 |
is( scalar (@$search_orders), 4, "SearchOrders with pending and ordered params gets only pending ordered orders. After closing the basket, orders are marked as 'ordered' (bug 11170)" ); |
417 |
is( scalar (@$search_orders), 4, "SearchOrders with pending and ordered params gets only pending ordered orders. After closing the basket, orders are marked as 'ordered' (bug 11170)" ); |
| 413 |
|
418 |
|
|
|
419 |
my @close_logs = Koha::ActionLogs->find({ module =>'ACQUISITIONS', action => 'CLOSE_BASKET', object => $basketno }); |
| 420 |
ok( scalar @close_logs == 1, 'Basket closure is logged'); |
| 421 |
C4::Acquisition::ReopenBasket($basketno); |
| 422 |
my @reopen_logs = Koha::ActionLogs->find({ module =>'ACQUISITIONS', action => 'REOPEN_BASKET', object => $basketno }); |
| 423 |
ok( scalar @reopen_logs == 1, 'Basket reopen is logged'); |
| 424 |
C4::Acquisition::CloseBasket($basketno, 1); |
| 425 |
my @approve_logs = Koha::ActionLogs->find({ module =>'ACQUISITIONS', action => 'APPROVE_BASKET', object => $basketno }); |
| 426 |
ok( scalar @approve_logs == 1, 'Basket approval is logged'); |
| 427 |
C4::Acquisition::ModBasket({ |
| 428 |
basketno => $basketno, |
| 429 |
booksellerid => $booksellerid |
| 430 |
}); |
| 431 |
my @mod_logs = Koha::ActionLogs->find({ module =>'ACQUISITIONS', action => 'MODIFY_BASKET', object => $basketno }); |
| 432 |
ok( scalar @mod_logs == 1, 'Basket modify is logged'); |
| 433 |
C4::Acquisition::ModBasketHeader($basketno,"Test","","","",$booksellerid); |
| 434 |
my @mod_header_logs = Koha::ActionLogs->find({ module =>'ACQUISITIONS', action => 'MODIFY_BASKET_HEADER', object => $basketno }); |
| 435 |
ok( scalar @mod_header_logs == 1, 'Basket header modify is logged'); |
| 436 |
C4::Acquisition::ModBasketUsers($basketno,(1)); |
| 437 |
my @mod_users_logs = Koha::ActionLogs->find({ module =>'ACQUISITIONS', action => 'MODIFY_BASKET_USERS', object => $basketno }); |
| 438 |
ok( scalar @mod_users_logs == 1, 'Basket users modify is logged'); |
| 439 |
|
| 414 |
# |
440 |
# |
| 415 |
# Test AddClaim |
441 |
# Test AddClaim |
| 416 |
# |
442 |
# |
| 417 |
- |
|
|