Lines 1-5
Link Here
|
1 |
use Modern::Perl; |
1 |
use Modern::Perl; |
2 |
use Test::More tests => 25; |
2 |
use Test::More tests => 29; |
3 |
|
3 |
|
4 |
BEGIN {use_ok('C4::Budgets') } |
4 |
BEGIN {use_ok('C4::Budgets') } |
5 |
use C4::Biblio; |
5 |
use C4::Biblio; |
Lines 336-342
is(
Link Here
|
336 |
is_deeply( |
336 |
is_deeply( |
337 |
_get_dependencies($budget_hierarchy), |
337 |
_get_dependencies($budget_hierarchy), |
338 |
_get_dependencies($budget_hierarchy_cloned), |
338 |
_get_dependencies($budget_hierarchy_cloned), |
339 |
'CloneBudgetPeriod keep the same dependencies order' |
339 |
'CloneBudgetPeriod keeps the same dependencies order' |
|
|
340 |
); |
341 |
|
342 |
# CloneBudgetPeriod with param mark_original_budget_as_inactive |
343 |
my $budget_period = C4::Budgets::GetBudgetPeriod($budget_period_id); |
344 |
is( $budget_period->{budget_period_active}, 1, |
345 |
'CloneBudgetPeriod does not mark as inactive the budgetperiod if not needed' |
346 |
); |
347 |
|
348 |
$budget_period_id_cloned = C4::Budgets::CloneBudgetPeriod( |
349 |
{ |
350 |
budget_period_id => $budget_period_id, |
351 |
budget_period_startdate => '2014-01-01', |
352 |
budget_period_enddate => '2014-12-31', |
353 |
mark_original_budget_as_inactive => 1, |
354 |
} |
355 |
); |
356 |
|
357 |
$budget_hierarchy = GetBudgetHierarchy($budget_period_id); |
358 |
$budget_hierarchy_cloned = GetBudgetHierarchy($budget_period_id_cloned); |
359 |
|
360 |
is( scalar(@$budget_hierarchy_cloned), scalar(@$budget_hierarchy), |
361 |
'CloneBudgetPeriod (with inactive param) clones the same number of budgets (funds)' |
362 |
); |
363 |
is_deeply( |
364 |
_get_dependencies($budget_hierarchy), |
365 |
_get_dependencies($budget_hierarchy_cloned), |
366 |
'CloneBudgetPeriod (with inactive param) keeps the same dependencies order' |
367 |
); |
368 |
$budget_period = C4::Budgets::GetBudgetPeriod($budget_period_id); |
369 |
is( $budget_period->{budget_period_active}, 0, |
370 |
'CloneBudgetPeriod (with inactive param) marks as inactive the budgetperiod' |
340 |
); |
371 |
); |
341 |
|
372 |
|
342 |
sub _get_dependencies { |
373 |
sub _get_dependencies { |
343 |
- |
|
|