View | Details | Raw Unified | Return to bug 15084
Collapse All | Expand All

(-)a/C4/Budgets.pm (-33 lines)
Lines 59-66 BEGIN { Link Here
59
59
60
        &ModBudgetPlan
60
        &ModBudgetPlan
61
61
62
        &ConvertCurrency
63
        
64
		&GetBudgetsPlanCell
62
		&GetBudgetsPlanCell
65
        &AddBudgetPlanValue
63
        &AddBudgetPlanValue
66
        &GetBudgetAuthCats
64
        &GetBudgetAuthCats
Lines 913-949 sub CanUserModifyBudget { Link Here
913
    return 1;
911
    return 1;
914
}
912
}
915
913
916
# -------------------------------------------------------------------
917
918
=head2 ConvertCurrency
919
920
  $foreignprice = &ConvertCurrency($currency, $localprice);
921
922
Converts the price C<$localprice> to foreign currency C<$currency> by
923
dividing by the exchange rate, and returns the result.
924
925
If no exchange rate is found, e is one to one.
926
927
=cut
928
929
sub ConvertCurrency {
930
    my ( $currency, $price ) = @_;
931
    my $dbh   = C4::Context->dbh;
932
    my $query = "
933
        SELECT rate
934
        FROM   currency
935
        WHERE  currency=?
936
    ";
937
    my $sth = $dbh->prepare($query);
938
    $sth->execute($currency);
939
    my $cur = ( $sth->fetchrow_array() )[0];
940
    unless ($cur) {
941
        $cur = 1;
942
    }
943
    return ( $price / $cur );
944
}
945
946
947
=head2 CloneBudgetPeriod
914
=head2 CloneBudgetPeriod
948
915
949
  my $new_budget_period_id = CloneBudgetPeriod({
916
  my $new_budget_period_id = CloneBudgetPeriod({
(-)a/acqui/basketgroup.pl (-2 lines)
Lines 51-57 use C4::Auth; Link Here
51
use C4::Output;
51
use C4::Output;
52
use CGI qw ( -utf8 );
52
use CGI qw ( -utf8 );
53
53
54
use C4::Budgets qw/ConvertCurrency/;
55
use C4::Acquisition qw/CloseBasketgroup ReOpenBasketgroup GetOrders GetBasketsByBasketgroup GetBasketsByBookseller ModBasketgroup NewBasketgroup DelBasketgroup GetBasketgroups ModBasket GetBasketgroup GetBasket GetBasketGroupAsCSV/;
54
use C4::Acquisition qw/CloseBasketgroup ReOpenBasketgroup GetOrders GetBasketsByBasketgroup GetBasketsByBookseller ModBasketgroup NewBasketgroup DelBasketgroup GetBasketgroups ModBasket GetBasketgroup GetBasket GetBasketGroupAsCSV/;
56
use C4::Branch qw/GetBranches/;
55
use C4::Branch qw/GetBranches/;
57
use C4::Members qw/GetMember/;
56
use C4::Members qw/GetMember/;
58
- 

Return to bug 15084