Bugzilla – Attachment 2800 Details for
Bug 5466
Allow currency to be set during order creation
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch against master, introduces currency drop down list in order screen
0002-Acquisitions-ability-to-set-currency-in-order-scre.patch (text/plain), 7.69 KB, created by
Savitra Sirohi
on 2010-12-04 07:54:12 UTC
(
hide
)
Description:
Patch against master, introduces currency drop down list in order screen
Filename:
MIME Type:
Creator:
Savitra Sirohi
Created:
2010-12-04 07:54:12 UTC
Size:
7.69 KB
patch
obsolete
>From fec03818fae93d4695017347ee1f237e804c92fa Mon Sep 17 00:00:00 2001 >From: Savitra Sirohi <savitra.sirohi@osslabs.biz> >Date: Wed, 1 Dec 2010 21:42:46 +0530 >Subject: [PATCH] Acquisitions - ability to set currency in order screens > >--- > acqui/basket.pl | 9 +++++++-- > acqui/neworderempty.pl | 7 ++++--- > koha-tmpl/intranet-tmpl/prog/en/js/acq.js | 7 +++++-- > .../prog/en/modules/acqui/neworderempty.tmpl | 19 +++++++++++++++---- > 4 files changed, 31 insertions(+), 11 deletions(-) > >diff --git a/acqui/basket.pl b/acqui/basket.pl >index 005fcb9..928d150 100755 >--- a/acqui/basket.pl >+++ b/acqui/basket.pl >@@ -217,8 +217,12 @@ if ( $op eq 'delete_confirm' ) { > "loggedinuser: $loggedinuser; creationdate: %s; authorisedby: %s", > $basket->{creationdate}, $basket->{authorisedby}; > >+ #to get active currency >+ my $cur = GetCurrency(); >+ >+ > my @results = GetOrders( $basketno ); >- >+ > my $gist = $bookseller->{gstrate} || C4::Context->preference("gist") || 0; > my $discount = $bookseller->{'discount'} / 100; > my $total_rrp; # RRP Total, its value will be assigned to $total_rrp_gsti or $total_rrp_gste depending of $bookseller->{'listincgst'} >@@ -310,7 +314,8 @@ if ( $op eq 'delete_confirm' ) { > gist_rrp => sprintf( "%.2f", $gist_rrp ), > total_rrp_gsti => sprintf( "%.2f", $total_rrp_gsti ), > total_est_gsti => sprintf( "%.2f", $total_est_gsti ), >- currency => $bookseller->{'listprice'}, >+# currency => $bookseller->{'listprice'}, >+ currency => $cur->{'currency'}, > qty_total => $qty_total, > GST => $gist, > basketgroups => $basketgroups, >diff --git a/acqui/neworderempty.pl b/acqui/neworderempty.pl >index 61f0962..3883c46 100755 >--- a/acqui/neworderempty.pl >+++ b/acqui/neworderempty.pl >@@ -203,8 +203,9 @@ my $count = scalar @rates; > my @loop_currency = (); > for ( my $i = 0 ; $i < $count ; $i++ ) { > my %line; >- $line{currency} = $rates[$i]->{'currency'}; >+ $line{currcode} = $rates[$i]->{'currency'}; > $line{rate} = $rates[$i]->{'rate'}; >+ $line{selected} = 1 if ($line{currcode} eq $data->{currency}); > push @loop_currency, \%line; > } > >@@ -336,7 +337,7 @@ $template->param( > name => $bookseller->{'name'}, > cur_active_sym => $cur->{'symbol'}, > cur_active => $cur->{'currency'}, >- currency => $bookseller->{'listprice'} || $cur->{'currency'}, # eg: 'EUR' >+# currency => $bookseller->{'listprice'} || $cur->{'currency'}, # eg: 'EUR' > loop_currencies => \@loop_currency, > orderexists => ( $new eq 'yes' ) ? 0 : 1, > title => $data->{'title'}, >@@ -348,7 +349,7 @@ $template->param( > quantity => $data->{'quantity'}, > quantityrec => $data->{'quantity'}, > rrp => $data->{'rrp'}, >- listprice => sprintf("%.2f", $data->{'listprice'}||$listprice), >+ listprice => sprintf("%.2f", $data->{'listprice'}||$data->{'price'}||$listprice), > total => sprintf("%.2f", ($data->{'ecost'}||0)*($data->{'quantity'}||0) ), > ecost => $data->{'ecost'}, > notes => $data->{'notes'}, >diff --git a/koha-tmpl/intranet-tmpl/prog/en/js/acq.js b/koha-tmpl/intranet-tmpl/prog/en/js/acq.js >index 537aa26..705bc24 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/js/acq.js >+++ b/koha-tmpl/intranet-tmpl/prog/en/js/acq.js >@@ -645,11 +645,14 @@ function calcNeworderTotal(){ > var quantity = new Number(f.quantity.value); > var discount = new Number(f.discount.value); > var listinc = new Number (f.listinc.value); >- var currency = f.currency.value; >+ //var currency = f.currency.value; > var applygst = new Number (f.applygst.value); > var listprice = new Number(f.listprice.value); > var invoiceingst = new Number (f.invoiceincgst.value); >- var exchangerate = new Number(f.elements[currency].value); //get exchange rate >+// var exchangerate = new Number(f.elements[currency].value); //get exchange rate >+ var currcode = new String(document.getElementById('currency').value); >+ var exchangerate = new Number(document.getElementById(currcode).value); >+ > var gst_on=(!listinc && invoiceingst); > > //do real stuff >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tmpl >index e53c7da..a82029d 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tmpl >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tmpl >@@ -127,7 +127,7 @@ ff.submit(); > <input type="hidden" name="biblioitemnumber" value="<!-- TMPL_VAR NAME="biblioitemnumber" -->" /> > <input type="hidden" name="discount" value="<!-- TMPL_VAR NAME="discount" -->" /> > <input type="hidden" name="listinc" value="<!-- TMPL_VAR NAME="listincgst" -->" /> >- <input type="hidden" name="currency" value="<!-- TMPL_VAR NAME="currency" -->" /> >+<!-- <input type="hidden" name="currency" value="<!-- TMPL_VAR NAME="currency" -->" />--> > <input type="hidden" name="applygst" value="<!-- TMPL_VAR NAME="gstreg" -->" /> > <input type="hidden" name="invoiceincgst" value="<!-- TMPL_VAR NAME="invoiceincgst" -->" /> > <input type="hidden" name="gstrate" value="<!-- TMPL_VAR NAME="gstrate" -->" /> >@@ -135,7 +135,7 @@ ff.submit(); > <input type="hidden" name="import_batch_id" value="<!-- TMPL_VAR name="import_batch_id" -->" /> > > <!-- TMPL_LOOP NAME="loop_currencies" --> >- <input type="hidden" name="<!-- TMPL_VAR NAME="currency" -->" value="<!-- TMPL_VAR NAME="rate" -->" /> >+ <input type="hidden" id="<!-- TMPL_VAR NAME="currcode" -->" name="<!-- TMPL_VAR NAME="currcode" -->" value="<!-- TMPL_VAR NAME="rate" -->" /> > <!-- /TMPL_LOOP --> > <ol><li> > <!-- TMPL_IF name="biblionumber" --> >@@ -263,14 +263,25 @@ ff.submit(); > </select> > <!--/TMPL_IF--> > </li> >+ <li> >+ <!-- TMPL_IF name="close" --> >+ <span class="label">Currency: </span> >+ <input type="hidden" size="10" name="currency" id="currency" value="<!-- TMPL_VAR NAME="currency" -->" /><!-- TMPL_VAR NAME="currency" --> >+ <!-- TMPL_ELSE --> >+ <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> >+ <!-- /TMPL_IF--> >+ </li> > <li> > <!-- TMPL_IF name="close" --> > <span class="label">Vendor price: </span> > <input type="hidden" size="20" name="listprice" id="listprice" value="<!-- TMPL_VAR NAME="listprice" -->" /><!-- TMPL_VAR NAME="listprice" --> > <!-- TMPL_ELSE --> > <label for="listprice">Vendor price: </label> >- <input type="text" size="20" name="listprice" id="listprice" value="<!-- TMPL_VAR NAME="listprice" -->" onchange="calcNeworderTotal()" /> (entered as <!-- TMPL_VAR NAME="currency" -->) >- >+ <input type="text" size="20" name="listprice" id="listprice" value="<!-- TMPL_VAR NAME="listprice" -->" onchange="calcNeworderTotal()" /> > <!--/TMPL_IF--> > </li> > <!-- TMPL_UNLESS NAME="close" --> >-- >1.5.4.5 >
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 5466
:
2800
|
2826
|
3349
|
3350