Bug 15530 - Editing a course item via a disabled course disables it even if it is...
[koha-ffzg.git] / C4 / Budgets.pm
index f2f376a..79012ba 100644 (file)
@@ -61,7 +61,6 @@ BEGIN {
 
         &GetCurrency
         &GetCurrencies
-        &ModCurrencies
         &ConvertCurrency
         
                &GetBudgetsPlanCell
@@ -529,8 +528,8 @@ sub GetBudgetHierarchy {
 
     # link child to parent
     my @first_parents;
-    foreach ( sort keys %links ) {
-        my $child = $links{$_};
+    foreach my $budget ( sort { $a->{budget_code} cmp $b->{budget_code} } values %links ) {
+        my $child = $links{$budget->{budget_id}};
         if ( $child->{'budget_parent_id'} ) {
             my $parent = $links{ $child->{'budget_parent_id'} };
             if ($parent) {
@@ -956,25 +955,6 @@ sub GetCurrency {
     return $r;
 }
 
-=head2 ModCurrencies
-
-&ModCurrencies($currency, $newrate);
-
-Sets the exchange rate for C<$currency> to be C<$newrate>.
-
-=cut
-
-sub ModCurrencies {
-    my ( $currency, $rate ) = @_;
-    my $dbh   = C4::Context->dbh;
-    my $query = qq|
-        UPDATE currency
-        SET    rate=?
-        WHERE  currency=? |;
-    my $sth = $dbh->prepare($query);
-    $sth->execute( $rate, $currency );
-}
-
 # -------------------------------------------------------------------
 
 =head2 ConvertCurrency