Lines 1014-1023
sub ConvertCurrency {
Link Here
|
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 |
}); |
1019 |
}); |
1019 |
|
1020 |
|
1020 |
Clone a budget period with all budgets. |
1021 |
Clone a budget period with all budgets. |
|
|
1022 |
If the mark_origin_budget_as_inactive is set (0 by default), |
1023 |
the original budget will be marked as inactive. |
1021 |
|
1024 |
|
1022 |
=cut |
1025 |
=cut |
1023 |
|
1026 |
|
Lines 1026-1031
sub CloneBudgetPeriod {
Link Here
|
1026 |
my $budget_period_id = $params->{budget_period_id}; |
1029 |
my $budget_period_id = $params->{budget_period_id}; |
1027 |
my $budget_period_startdate = $params->{budget_period_startdate}; |
1030 |
my $budget_period_startdate = $params->{budget_period_startdate}; |
1028 |
my $budget_period_enddate = $params->{budget_period_enddate}; |
1031 |
my $budget_period_enddate = $params->{budget_period_enddate}; |
|
|
1032 |
my $mark_original_budget_as_inactive = |
1033 |
$params->{mark_original_budget_as_inactive} || 0; |
1029 |
|
1034 |
|
1030 |
my $budget_period = GetBudgetPeriod($budget_period_id); |
1035 |
my $budget_period = GetBudgetPeriod($budget_period_id); |
1031 |
|
1036 |
|
Lines 1037-1044
sub CloneBudgetPeriod {
Link Here
|
1037 |
|
1042 |
|
1038 |
my $budgets = GetBudgetHierarchy($budget_period_id); |
1043 |
my $budgets = GetBudgetHierarchy($budget_period_id); |
1039 |
CloneBudgetHierarchy( |
1044 |
CloneBudgetHierarchy( |
1040 |
{ budgets => $budgets, new_budget_period_id => $new_budget_period_id } |
1045 |
{ |
|
|
1046 |
budgets => $budgets, |
1047 |
new_budget_period_id => $new_budget_period_id |
1048 |
} |
1041 |
); |
1049 |
); |
|
|
1050 |
|
1051 |
if ($mark_original_budget_as_inactive) { |
1052 |
ModBudgetPeriod( |
1053 |
{ |
1054 |
budget_period_id => $budget_period_id, |
1055 |
budget_period_active => 0, |
1056 |
} |
1057 |
); |
1058 |
} |
1059 |
|
1042 |
return $new_budget_period_id; |
1060 |
return $new_budget_period_id; |
1043 |
} |
1061 |
} |
1044 |
|
1062 |
|