Bugzilla – Attachment 6051 Details for
Bug 6894
Default currency on Acquisitions suggestion form
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 6894: Order from suggestion defaulting to wrong currency
Bug-6894-Order-from-suggestion-defaulting-to-wrong.patch (text/plain), 2.02 KB, created by
Katrin Fischer
on 2011-10-25 15:44:51 UTC
(
hide
)
Description:
Bug 6894: Order from suggestion defaulting to wrong currency
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2011-10-25 15:44:51 UTC
Size:
2.02 KB
patch
obsolete
>From 4de0db4c24e0f232a568bc5b9444de4b6ec9124d Mon Sep 17 00:00:00 2001 >From: Katrin Fischer <Katrin.Fischer.83@web.de> >Date: Tue, 25 Oct 2011 17:38:04 +0200 >Subject: [PATCH] Bug 6894: Order from suggestion defaulting to wrong currency > >This problem turned out to be a bit different, than I initally thought. > >This patch fixes the currency selections for new orders created in staff. >Before this patch, the first currency in the list was selected instead >of the active currency. So you needed to change it explicitly. > >After patch it should work like this: > >1) Suggestion created in OPAC - currency defaults to NULL in database >2) Editing a suggestion created in OPAC will default to active currency. >3) Creating a new suggestion in staff will default to active currency. >4) When ordering, the currency will default to the vendor currency, if no >currency is set in the suggestion. (still happens, when suggestions are accepted >in batch from the list. > >I hope this is right - comments and testing appreciated. >--- > suggestion/suggestion.pl | 10 +++++++++- > 1 files changed, 9 insertions(+), 1 deletions(-) > >diff --git a/suggestion/suggestion.pl b/suggestion/suggestion.pl >index d00b632..38b79b9 100755 >--- a/suggestion/suggestion.pl >+++ b/suggestion/suggestion.pl >@@ -307,13 +307,21 @@ $template->param( "statusselected_$$suggestion_ref{'STATUS'}" =>1); > # get currencies and rates > my @rates = GetCurrencies(); > my $count = scalar @rates; >+my $active_currency = GetCurrency(); >+my $selected_currency; >+if ($$suggestion_ref{'currency'}) { >+ $selected_currency = $$suggestion_ref{'currency'}; >+} >+else { >+ $selected_currency = $active_currency->{currency}; >+} > > my @loop_currency = (); > for ( my $i = 0 ; $i < $count ; $i++ ) { > my %line; > $line{currcode} = $rates[$i]->{'currency'}; > $line{rate} = $rates[$i]->{'rate'}; >- $line{selected} = 1 if ($$suggestion_ref{'currency'} && $line{'currcode'} eq $$suggestion_ref{'currency'}); >+ $line{selected} = 1 if ($line{'currcode'} eq $selected_currency); > push @loop_currency, \%line; > } > >-- >1.7.5.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 6894
:
6051
|
6097
|
6435