|
Lines 1013-1027
sub ConvertCurrency {
Link Here
|
| 1013 |
|
1013 |
|
| 1014 |
my $new_budget_period_id = CloneBudgetPeriod({ |
1014 |
my $new_budget_period_id = CloneBudgetPeriod({ |
| 1015 |
budget_period_id => $budget_period_id, |
1015 |
budget_period_id => $budget_period_id, |
| 1016 |
budget_period_startdate => $budget_period_startdate; |
1016 |
budget_period_startdate => $budget_period_startdate, |
| 1017 |
budget_period_enddate => $budget_period_enddate; |
1017 |
budget_period_enddate => $budget_period_enddate, |
| 1018 |
mark_original_budget_as_inactive => 1 |
1018 |
mark_original_budget_as_inactive => 1n |
|
|
1019 |
reset_all_budgets => 1, |
| 1019 |
}); |
1020 |
}); |
| 1020 |
|
1021 |
|
| 1021 |
Clone a budget period with all budgets. |
1022 |
Clone a budget period with all budgets. |
| 1022 |
If the mark_origin_budget_as_inactive is set (0 by default), |
1023 |
If the mark_origin_budget_as_inactive is set (0 by default), |
| 1023 |
the original budget will be marked as inactive. |
1024 |
the original budget will be marked as inactive. |
| 1024 |
|
1025 |
|
|
|
1026 |
If the reset_all_budgets is set (0 by default), all budget (fund) |
| 1027 |
amounts will be reset. |
| 1028 |
|
| 1025 |
=cut |
1029 |
=cut |
| 1026 |
|
1030 |
|
| 1027 |
sub CloneBudgetPeriod { |
1031 |
sub CloneBudgetPeriod { |
|
Lines 1031-1036
sub CloneBudgetPeriod {
Link Here
|
| 1031 |
my $budget_period_enddate = $params->{budget_period_enddate}; |
1035 |
my $budget_period_enddate = $params->{budget_period_enddate}; |
| 1032 |
my $mark_original_budget_as_inactive = |
1036 |
my $mark_original_budget_as_inactive = |
| 1033 |
$params->{mark_original_budget_as_inactive} || 0; |
1037 |
$params->{mark_original_budget_as_inactive} || 0; |
|
|
1038 |
my $reset_all_budgets = $params->{reset_all_budgets} || 0; |
| 1034 |
|
1039 |
|
| 1035 |
my $budget_period = GetBudgetPeriod($budget_period_id); |
1040 |
my $budget_period = GetBudgetPeriod($budget_period_id); |
| 1036 |
|
1041 |
|
|
Lines 1057-1062
sub CloneBudgetPeriod {
Link Here
|
| 1057 |
); |
1062 |
); |
| 1058 |
} |
1063 |
} |
| 1059 |
|
1064 |
|
|
|
1065 |
if ( $reset_all_budgets ) { |
| 1066 |
my $budgets = GetBudgets({ budget_period_id => $new_budget_period_id }); |
| 1067 |
for my $budget ( @$budgets ) { |
| 1068 |
$budget->{budget_amount} = 0; |
| 1069 |
ModBudget( $budget ); |
| 1070 |
} |
| 1071 |
} |
| 1072 |
|
| 1060 |
return $new_budget_period_id; |
1073 |
return $new_budget_period_id; |
| 1061 |
} |
1074 |
} |
| 1062 |
|
1075 |
|