Bugzilla – Attachment 3658 Details for
Bug 5961
Acquistions: New feature to create a bunch of orders from a staged file
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
patch, follow-up for currency
0001-BZ5961-follow-up-save-currency.patch (text/plain), 4.45 KB, created by
Paul Poulain
on 2011-04-05 10:04:53 UTC
(
hide
)
Description:
patch, follow-up for currency
Filename:
MIME Type:
Creator:
Paul Poulain
Created:
2011-04-05 10:04:53 UTC
Size:
4.45 KB
patch
obsolete
>From 75ae1d7115cbcb0bf8e8ff20504eeb2b2778c840 Mon Sep 17 00:00:00 2001 >From: Paul Poulain <paul.poulain@biblibre.com> >Date: Tue, 5 Apr 2011 12:03:34 +0200 >Subject: [PATCH] BZ5961: follow-up, save currency > >Cait noticed that currency was not saved properly in the aqorders table. > >note a surprise, as the 3.2 had no currency feature and 5961 had been written against 3.2 >anyway, this patch fixes the problem >--- > acqui/addorderiso2709.pl | 36 +++++++++++++++++++- > .../prog/en/modules/acqui/addorderiso2709.tmpl | 9 +++++ > 2 files changed, 44 insertions(+), 1 deletions(-) > >diff --git a/acqui/addorderiso2709.pl b/acqui/addorderiso2709.pl >index a77b111..c46263a 100755 >--- a/acqui/addorderiso2709.pl >+++ b/acqui/addorderiso2709.pl >@@ -87,8 +87,41 @@ if ($op eq ""){ > # > } elsif ($op eq "batch_details"){ > #display lines inside the selected batch >+ # get currencies (for change rates calcs if needed) >+ my $active_currency = GetCurrency(); >+ my $default_currency; >+ if (! $data->{currency} ) { # New order no currency set >+ if ( $bookseller->{listprice} ) { >+ $default_currency = $bookseller->{listprice}; >+ } >+ else { >+ $default_currency = $active_currency->{currency}; >+ } >+ } >+ my @rates = GetCurrencies(); >+ >+ # ## @rates >+ >+ my @loop_currency = (); >+ for my $curr ( @rates ) { >+ my $selected; >+ if ($data->{currency} ) { >+ $selected = $curr->{currency} eq $data->{currency}; >+ } >+ else { >+ $selected = $curr->{currency} eq $default_currency; >+ } >+ push @loop_currency, { >+ currcode => $curr->{currency}, >+ rate => $curr->{rate}, >+ selected => $selected, >+ } >+ } >+ > $template->param("batch_details" => 1, >- "basketno" => $cgiparams->{'basketno'}); >+ "basketno" => $cgiparams->{'basketno'}, >+ loop_currencies => \@loop_currency, >+ ); > import_biblios_list($template, $cgiparams->{'import_batch_id'}); > if ( C4::Context->preference('AcqCreateItem') eq 'ordering' && !$ordernumber ) { > # prepare empty item form >@@ -166,6 +199,7 @@ if ($op eq ""){ > "budget_id", $budget_id, "uncertainprice", 1, > "sort1", $cgiparams->{'sort1'},"sort2", $cgiparams->{'sort2'}, > "notes", $cgiparams->{'notes'}, "budget_id", $cgiparams->{'budget_id'}, >+ "currency",$cgiparams->{'currency'}, > ); > # get the price if there is one. > # filter by storing only the 1st number >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tmpl >index 7365030..1bd65e4 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tmpl >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tmpl >@@ -156,6 +156,14 @@ > <span class="label">Budget: </span> > <input type="hidden" size="20" name="budget_id" id="budget_id" value="<!-- TMPL_VAR NAME="budget_id" -->" /><!-- TMPL_VAR NAME="Budget_name" --> > <!-- TMPL_ELSE --> >+ <li> >+ <label for="currency">Currency:</label> >+ <select name="currency" id="currency" onchange="calcNeworderTotal();"> >+ <!-- TMPL_LOOP name="loop_currencies" --> >+ <!-- TMPL_IF NAME="selected" --><option value="<!-- TMPL_VAR name="currcode" -->" selected="selected"><!-- TMPL_VAR name="currcode" --></option><!-- TMPL_ELSE --><option value="<!-- TMPL_VAR name="currcode" -->"><!-- TMPL_VAR name="currcode" --></option><!-- /TMPL_IF --><!-- /TMPL_LOOP --> >+ </select> >+ </li> >+ <li> > <label for="budget_id">Budget: </label> > <select id="budget_id" onchange="fetchSortDropbox(this.form)" size="1" name="budget_id"> > <!-- TMPL_LOOP NAME="budget_loop" --> >@@ -166,6 +174,7 @@ > <!-- /TMPL_IF --> > <!-- /TMPL_LOOP --> > </select> >+ </li> > <!--/TMPL_IF--> > </li> > <li> >-- >1.7.1 >
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 5961
:
3449
|
3497
|
3498
|
3658
|
3663
|
3666