&ModBudgetPlan
- &ConvertCurrency
-
&GetBudgetsPlanCell
&AddBudgetPlanValue
&GetBudgetAuthCats
return 1;
}
-# -------------------------------------------------------------------
-
-=head2 ConvertCurrency
-
- $foreignprice = &ConvertCurrency($currency, $localprice);
-
-Converts the price C<$localprice> to foreign currency C<$currency> by
-dividing by the exchange rate, and returns the result.
-
-If no exchange rate is found, e is one to one.
-
-=cut
-
-sub ConvertCurrency {
- my ( $currency, $price ) = @_;
- my $dbh = C4::Context->dbh;
- my $query = "
- SELECT rate
- FROM currency
- WHERE currency=?
- ";
- my $sth = $dbh->prepare($query);
- $sth->execute($currency);
- my $cur = ( $sth->fetchrow_array() )[0];
- unless ($cur) {
- $cur = 1;
- }
- return ( $price / $cur );
-}
-
sub _round {
my ($value, $increment) = @_;
use C4::Output;
use CGI qw ( -utf8 );
-use C4::Budgets qw/ConvertCurrency/;
use C4::Acquisition qw/CloseBasketgroup ReOpenBasketgroup GetOrders GetBasketsByBasketgroup GetBasketsByBookseller ModBasketgroup NewBasketgroup DelBasketgroup GetBasketgroups ModBasket GetBasketgroup GetBasket GetBasketGroupAsCSV/;
use C4::Branch qw/GetBranches/;
use C4::Members qw/GetMember/;