Lines 1-5
Link Here
|
1 |
use Modern::Perl; |
1 |
use Modern::Perl; |
2 |
use Test::More tests => 120; |
2 |
use Test::More tests => 122; |
3 |
|
3 |
|
4 |
BEGIN { |
4 |
BEGIN { |
5 |
use_ok('C4::Budgets') |
5 |
use_ok('C4::Budgets') |
Lines 229-250
my $budget_id2 = AddBudget(
Link Here
|
229 |
budget_amount => $budget_2_total, |
229 |
budget_amount => $budget_2_total, |
230 |
} |
230 |
} |
231 |
); |
231 |
); |
232 |
my $budget_id11 = AddBudget( |
232 |
my $budget_id12 = AddBudget( |
233 |
{ |
233 |
{ |
234 |
budget_code => 'budget_11', |
234 |
budget_code => 'budget_12', |
235 |
budget_name => 'budget_11', |
235 |
budget_name => 'budget_12', |
236 |
budget_period_id => $budget_period_id, |
236 |
budget_period_id => $budget_period_id, |
237 |
budget_parent_id => $budget_id1, |
237 |
budget_parent_id => $budget_id1, |
238 |
budget_amount => $budget_11_total, |
238 |
budget_amount => $budget_12_total, |
239 |
} |
239 |
} |
240 |
); |
240 |
); |
241 |
my $budget_id12 = AddBudget( |
241 |
my $budget_id11 = AddBudget( |
242 |
{ |
242 |
{ |
243 |
budget_code => 'budget_12', |
243 |
budget_code => 'budget_11', |
244 |
budget_name => 'budget_12', |
244 |
budget_name => 'budget_11', |
245 |
budget_period_id => $budget_period_id, |
245 |
budget_period_id => $budget_period_id, |
246 |
budget_parent_id => $budget_id1, |
246 |
budget_parent_id => $budget_id1, |
247 |
budget_amount => $budget_12_total, |
247 |
budget_amount => $budget_11_total, |
248 |
} |
248 |
} |
249 |
); |
249 |
); |
250 |
my $budget_id111 = AddBudget( |
250 |
my $budget_id111 = AddBudget( |
Lines 428-433
$budget_period_id_cloned = C4::Budgets::CloneBudgetPeriod(
Link Here
|
428 |
); |
428 |
); |
429 |
|
429 |
|
430 |
$budget_hierarchy = GetBudgetHierarchy($budget_period_id); |
430 |
$budget_hierarchy = GetBudgetHierarchy($budget_period_id); |
|
|
431 |
is( $budget_hierarchy->[0]->{children}->[0]->{budget_name}, 'budget_11', 'GetBudgetHierarchy should return budgets ordered by name, first child is budget_11' ); |
432 |
is( $budget_hierarchy->[0]->{children}->[1]->{budget_name}, 'budget_12', 'GetBudgetHierarchy should return budgets ordered by name, first child is budget_12' ); |
433 |
|
434 |
$budget_hierarchy = GetBudgetHierarchy($budget_period_id); |
431 |
$budget_hierarchy_cloned = GetBudgetHierarchy($budget_period_id_cloned); |
435 |
$budget_hierarchy_cloned = GetBudgetHierarchy($budget_period_id_cloned); |
432 |
|
436 |
|
433 |
is( scalar(@$budget_hierarchy_cloned), scalar(@$budget_hierarchy), |
437 |
is( scalar(@$budget_hierarchy_cloned), scalar(@$budget_hierarchy), |
434 |
- |
|
|