&DelBudget
&GetBudgetSpent
&GetBudgetOrdered
+ &GetBudgetName
&GetPeriodsCount
&GetChildBudgetsSpent
return $sum;
}
+=head2 GetBudgetName
+
+ my $budget_name = &GetBudgetName($budget_id);
+
+get the budget_name for a given budget_id
+
+=cut
+
+sub GetBudgetName {
+ my ( $budget_id ) = @_;
+ my $dbh = C4::Context->dbh;
+ my $sth = $dbh->prepare(
+ qq|
+ SELECT budget_name
+ FROM aqbudgets
+ WHERE budget_id = ?
+ |);
+
+ $sth->execute($budget_id);
+ return $sth->fetchrow_array;
+}
+
# -------------------------------------------------------------------
sub GetBudgetAuthCats {
my ($budget_period_id) = shift;
my $option_list = [];
my @authorised_values = ( q{} );
- while (my ($value, $lib) = $sth->fetchrow_array) {
+ while (my $av = $sth->fetchrow_hashref) {
push @{$option_list}, {
- value => $value,
- label => $lib,
- default => ($default eq $value),
+ value => $av->{authorised_value},
+ label => $av->{lib},
+ default => ($default eq $av->{authorised_value}),
};
}
# -------------------------------------------------------------------
sub GetBudgets {
- my ($filters,$orderby) = @_;
+ my $filters = shift;
+ my $orderby = shift || 'budget_name';
return SearchInTable("aqbudgets",$filters, $orderby, undef,undef, undef, "wide");
}