Lines 11-16
use C4::Acquisition;
Link Here
|
11 |
|
11 |
|
12 |
use Koha::Acquisition::Booksellers; |
12 |
use Koha::Acquisition::Booksellers; |
13 |
use Koha::Acquisition::Orders; |
13 |
use Koha::Acquisition::Orders; |
|
|
14 |
use Koha::Acquisition::Funds; |
14 |
use Koha::Patrons; |
15 |
use Koha::Patrons; |
15 |
|
16 |
|
16 |
use t::lib::TestBuilder; |
17 |
use t::lib::TestBuilder; |
Lines 477-482
is ( GetBudgetOrdered( $fund ), '20', "total ordered price is 20");
Link Here
|
477 |
|
478 |
|
478 |
|
479 |
|
479 |
# CloneBudgetPeriod |
480 |
# CloneBudgetPeriod |
|
|
481 |
# Let's make sure our timestamp is old |
482 |
my @orig_funds = Koha::Acquisition::Funds->search({ budget_period_id => $budget_period_id }); |
483 |
foreach my $fund (@orig_funds){ |
484 |
$fund->timestamp('1999-12-31 23:59:59')->store; |
485 |
} |
486 |
|
480 |
my $budget_period_id_cloned = C4::Budgets::CloneBudgetPeriod( |
487 |
my $budget_period_id_cloned = C4::Budgets::CloneBudgetPeriod( |
481 |
{ |
488 |
{ |
482 |
budget_period_id => $budget_period_id, |
489 |
budget_period_id => $budget_period_id, |
Lines 490-501
my $budget_period_cloned = C4::Budgets::GetBudgetPeriod($budget_period_id_cloned
Link Here
|
490 |
is($budget_period_cloned->{budget_period_description}, 'Budget Period Cloned', 'Cloned budget\'s description is updated.'); |
497 |
is($budget_period_cloned->{budget_period_description}, 'Budget Period Cloned', 'Cloned budget\'s description is updated.'); |
491 |
|
498 |
|
492 |
my $budget_cloned = C4::Budgets::GetBudgets({ budget_period_id => $budget_period_id_cloned }); |
499 |
my $budget_cloned = C4::Budgets::GetBudgets({ budget_period_id => $budget_period_id_cloned }); |
493 |
my $test = $budget_cloned->[0]->{timestamp}; |
500 |
my $budget_time = $budget_cloned->[0]->{timestamp}; |
494 |
my $budget_time = Koha::DateUtils::dt_from_string($test); |
|
|
495 |
my $local_time = Koha::DateUtils::dt_from_string(); |
496 |
|
497 |
|
501 |
|
498 |
is(DateTime::compare($budget_time, $local_time), 0, "New budget got the right timestamp"); |
502 |
isnt($budget_time, '1999-12-31 23:59:59', "New budget has an updated timestamp"); |
499 |
|
503 |
|
500 |
|
504 |
|
501 |
|
505 |
|
502 |
- |
|
|