|
Lines 127-133
elsif ( $op eq 'add_validate' ) {
Link Here
|
| 127 |
#-------------------------------------------------- |
127 |
#-------------------------------------------------- |
| 128 |
elsif ( $op eq 'delete_confirm' ) { |
128 |
elsif ( $op eq 'delete_confirm' ) { |
| 129 |
## delete a budget period (preparation) |
129 |
## delete a budget period (preparation) |
| 130 |
my $dbh = C4::Context->dbh; |
|
|
| 131 |
my $funds = GetBudgets({ budget_period_id => $budget_period_id }); |
130 |
my $funds = GetBudgets({ budget_period_id => $budget_period_id }); |
| 132 |
my $fund_count = scalar @$funds; |
131 |
my $fund_count = scalar @$funds; |
| 133 |
if ( $fund_count > 0 ) { |
132 |
if ( $fund_count > 0 ) { |
|
Lines 143-152
elsif ( $op eq 'delete_confirm' ) {
Link Here
|
| 143 |
} |
142 |
} |
| 144 |
|
143 |
|
| 145 |
elsif ( $op eq 'delete_confirmed' ) { |
144 |
elsif ( $op eq 'delete_confirmed' ) { |
| 146 |
## delete the budget period record |
145 |
## confirm no funds have been added to budget |
| 147 |
|
146 |
my $funds = GetBudgets({ budget_period_id => $budget_period_id }); |
| 148 |
my $data = GetBudgetPeriod( $budget_period_id); |
147 |
my $fund_count = scalar @$funds; |
| 149 |
DelBudgetPeriod($budget_period_id); |
148 |
if ( $fund_count > 0 ) { |
|
|
149 |
$template->param( failed_delete_funds_exist => 1 ); |
| 150 |
} else { |
| 151 |
## delete the budget period record |
| 152 |
my $data = GetBudgetPeriod( $budget_period_id); |
| 153 |
DelBudgetPeriod($budget_period_id); |
| 154 |
} |
| 150 |
$op='else'; |
155 |
$op='else'; |
| 151 |
} |
156 |
} |
| 152 |
|
157 |
|