Bugzilla – Attachment 14410 Details for
Bug 9346
acqui/neworderempty.pl ignores exchange rates and destroys user data on page load
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 9346 - acqui/neworderempty.pl ignores exchange rates and destroys user data on page load
Bug-9346---acquineworderemptypl-ignores-exchange-r.patch (text/plain), 4.79 KB, created by
Jonathan Druart
on 2013-01-04 09:01:11 UTC
(
hide
)
Description:
Bug 9346 - acqui/neworderempty.pl ignores exchange rates and destroys user data on page load
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2013-01-04 09:01:11 UTC
Size:
4.79 KB
patch
obsolete
>From 300f47dc91b8af80bc552bc86cfe84a05351cbbc Mon Sep 17 00:00:00 2001 >From: Dobrica Pavlinusic <dpavlin@rot13.org> >Date: Thu, 3 Jan 2013 23:38:17 +0100 >Subject: [PATCH] Bug 9346 - acqui/neworderempty.pl ignores exchange rates and > destroys user data on page load >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >This restores behaviour of new order form before Bug 5335 merge > >Test scenario: > >1. load Receipt summary for existing customer >2. take note of Unit cost and Order cost >3. open existing order line and verify that Replacement cost, > Budgeted cost and Total are not re-calculated on page load >4. change currency and verify that costs are updated > (change currency to system default and all values should become > same as vendor price) >5. change Quantity, get alert "You can't add a new item, please create a new order line" > and verify that Total still reflects correct value > >Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> >--- > acqui/neworderempty.pl | 3 --- > koha-tmpl/intranet-tmpl/prog/en/js/acq.js | 5 +++-- > koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt | 8 ++++++-- > 3 files changed, 9 insertions(+), 7 deletions(-) > >diff --git a/acqui/neworderempty.pl b/acqui/neworderempty.pl >index 90b4732..807a82b 100755 >--- a/acqui/neworderempty.pl >+++ b/acqui/neworderempty.pl >@@ -336,8 +336,6 @@ my @gst_values = map { > option => $_ > }, split( '\|', C4::Context->preference("gist") ); > >-my $cur = GetCurrency(); >- > $template->param( > existing => $biblionumber, > ordernumber => $ordernumber, >@@ -371,7 +369,6 @@ $template->param( > cur_active_sym => $active_currency->{'symbol'}, > cur_active => $active_currency->{'currency'}, > loop_currencies => \@loop_currency, >- currency_rate => $cur->{rate}, > orderexists => ( $new eq 'yes' ) ? 0 : 1, > title => $data->{'title'}, > author => $data->{'author'}, >diff --git a/koha-tmpl/intranet-tmpl/prog/en/js/acq.js b/koha-tmpl/intranet-tmpl/prog/en/js/acq.js >index d67b05b..0c3ce91 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/js/acq.js >+++ b/koha-tmpl/intranet-tmpl/prog/en/js/acq.js >@@ -644,7 +644,8 @@ function updateCosts(){ > var discount = new Number($("#discount").val()); > var applygst = new Number ($("#applygst").val()); > var listprice = new Number($("#listprice").val()); >- var exchangerate = new Number($("#currency_rate").val()); >+ var currcode = new String($("#currency").val()); >+ var exchangerate = new Number($("#currency_rate_"+currcode).val()); > var gst_on=false; > > var rrp = new Number(listprice*exchangerate); >@@ -669,7 +670,7 @@ function calcNewsuggTotal(){ > // var currency = f.currency.value; > var currcode = new String(document.getElementById('currency').value); > var price = new Number(document.getElementById('price').value); >- var exchangerate = new Number(document.getElementById(currcode).value); >+ var exchangerate = new Number(document.getElementById('currency_rate_'+currcode).value); > > var total = new Number(quantity*price*exchangerate); > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt >index 2631e3c..398a568 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt >@@ -125,6 +125,7 @@ $(document).ready(function() > alert(_("You can't add a new item, please create a new order line")); > // and we replace the original value > $(this).val([% quantityrec %]) >+ updateCosts(); // blur is invoked after change which updated values > return false; > } > }); >@@ -146,7 +147,7 @@ $(document).ready(function() > //]]> > </script> > </head> >-<body id="acq_neworderempty" class="acq" onload="updateCosts()"> >+<body id="acq_neworderempty" class="acq"> > > [% INCLUDE 'header.inc' %] > [% INCLUDE 'acquisitions-search.inc' %] >@@ -230,7 +231,10 @@ $(document).ready(function() > <input type="hidden" name="invoiceincgst" id="invoiceincgst" value="[% invoiceincgst %]" /> > <input type="hidden" name="suggestionid" value="[% suggestionid %]" /> > <input type="hidden" name="import_batch_id" value="[% import_batch_id %]" /> >- <input type="hidden" name="currency_rate" id="currency_rate" value="[% currency_rate %]" /> >+ >+ [% FOREACH loop_currencie IN loop_currencies %] >+ <input type="hidden" id="currency_rate_[% loop_currencie.currcode %]" name="[% loop_currencie.currcode %]" value="[% loop_currencie.rate %]" /> >+ [% END %] > > <ol><li> > [% IF ( biblionumber ) %] >-- >1.7.10.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 9346
:
14405
|
14410
|
14425