Bug 15084 [QA Followup] - Fix new uses of GetCurrency
authorKyle M Hall <kyle@bywatersolutions.com>
Mon, 7 Mar 2016 13:33:43 +0000 (13:33 +0000)
committerKyle M Hall <kyle@bywatersolutions.com>
Mon, 7 Mar 2016 13:33:43 +0000 (13:33 +0000)
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
acqui/acqui-home.pl
opac/opac-account-pay-paypal-return.pl
opac/opac-account-pay.pl

index 393a131..804e3ce 100755 (executable)
@@ -38,6 +38,7 @@ use C4::Members;
 use C4::Branch;
 use C4::Debug;
 use C4::Suggestions;
+use Koha::Acquisition::Currencies;
 
 my $query = CGI->new;
 my ( $template, $loggedinuser, $cookie, $userflags ) = get_template_and_user(
@@ -129,10 +130,10 @@ $template->param(
     suggestions_count   => $suggestions_count,
 );
 
-my $cur = GetCurrency();
+my $cur = Koha::Acquisition::Currencies->get_active;
 if ( $cur ) {
     $template->param(
-        currency => $cur->{currency},
+        currency => $cur->currency,
     );
 }
 
index 4279263..1823d2f 100755 (executable)
@@ -30,7 +30,7 @@ use C4::Auth;
 use C4::Output;
 use C4::Accounts;
 use C4::Members;
-use C4::Budgets qw(GetCurrency);
+use Koha::Acquisition::Currencies;
 use Koha::Database;
 
 my $cgi = new CGI;
@@ -50,7 +50,7 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
     }
 );
 
-my $active_currency = GetCurrency();
+my $active_currency = Koha::Acquisition::Currencies->get_active;
 
 my $token    = $cgi->param('token');
 my $payer_id = $cgi->param('PayerID');
@@ -78,7 +78,7 @@ my $nvp_params = {
     'PAYERID'                        => $payer_id,
     'TOKEN'                          => $token,
     'PAYMENTREQUEST_0_AMT'           => $amount,
-    'PAYMENTREQUEST_0_CURRENCYCODE'  => $active_currency->{currency},
+    'PAYMENTREQUEST_0_CURRENCYCODE'  => $active_currency->currency,
 };
 
 my $response = $ua->request( POST $url, $nvp_params );
index e8664e4..8dfdfcd 100755 (executable)
@@ -30,7 +30,7 @@ use URI;
 use C4::Auth;
 use C4::Output;
 use C4::Context;
-use C4::Budgets qw(GetCurrency);
+use Koha::Acquisition::Currencies;
 use Koha::Database;
 
 my $cgi = new CGI;
@@ -58,7 +58,7 @@ my $amount_to_pay =
   ->get_column('amountoutstanding')->sum();
 $amount_to_pay = sprintf( "%.2f", $amount_to_pay );
 
-my $active_currency = GetCurrency();
+my $active_currency = Koha::Acquisition::Currencies->get_active;
 
 my $error = 0;
 if ( $payment_method eq 'paypal' ) {
@@ -94,7 +94,7 @@ if ( $payment_method eq 'paypal' ) {
         'BRANDNAME'                             => C4::Context->preference('LibraryName'),
         'CANCELURL'                             => $cancel_url->as_string(),
         'RETURNURL'                             => $return_url->as_string(),
-        'PAYMENTREQUEST_0_CURRENCYCODE'         => $active_currency->{currency},
+        'PAYMENTREQUEST_0_CURRENCYCODE'         => $active_currency->currency,
         'PAYMENTREQUEST_0_AMT'                  => $amount_to_pay,
         'PAYMENTREQUEST_0_PAYMENTACTION'        => 'Sale',
         'PAYMENTREQUEST_0_ALLOWEDPAYMENTMETHOD' => 'InstantPaymentOnly',