Bugzilla – Attachment 14524 Details for
Bug 8343
Editable discount rate and miscellaneous charges during ordering
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 8343 - Editable discount rate and miscellaneous charges during ordering
Bug-8343---Editable-discount-rate-and-miscellaneou.patch (text/plain), 4.79 KB, created by
Jonathan Druart
on 2013-01-10 15:08:31 UTC
(
hide
)
Description:
Bug 8343 - Editable discount rate and miscellaneous charges during ordering
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2013-01-10 15:08:31 UTC
Size:
4.79 KB
patch
obsolete
>From 385ea6a92d692e5168b767eceb9babdc902454c3 Mon Sep 17 00:00:00 2001 >From: Shinoy M <shinoy.m@osslabs.biz> >Date: Mon, 2 Jul 2012 18:18:31 +0530 >Subject: [PATCH] Bug 8343 - Editable discount rate and miscellaneous charges > during ordering > >Add new fields like -Discount percentage- and -Miscellaneous cost- in the >order page.Default discount rate will be shown in the Discount percentage >field and it is editable.You can enter Miscellaneous charges in the >Miscellaneous cost field and it is calculated per quantity. >--- > acqui/neworderempty.pl | 2 +- > koha-tmpl/intranet-tmpl/prog/en/js/acq.js | 9 +++++++-- > .../prog/en/modules/acqui/neworderempty.tt | 19 +++++++++++++++++++ > 3 files changed, 27 insertions(+), 3 deletions(-) > >diff --git a/acqui/neworderempty.pl b/acqui/neworderempty.pl >index 807a82b..9bb2338 100755 >--- a/acqui/neworderempty.pl >+++ b/acqui/neworderempty.pl >@@ -360,7 +360,7 @@ $template->param( > authorisedbyname => $borrower->{'firstname'} . " " . $borrower->{'surname'}, > biblioitemnumber => $data->{'biblioitemnumber'}, > discount_2dp => sprintf( "%.2f", $bookseller->{'discount'} ) , # for display >- discount => $bookseller->{'discount'}, >+ discount => defined($data->{'discount'}) ? $data->{'discount'} : $bookseller->{'discount'}, > orderdiscount_2dp => sprintf( "%.2f", $data->{'discount'} || 0 ), > orderdiscount => $data->{'discount'}, > listincgst => $bookseller->{'listincgst'}, >diff --git a/koha-tmpl/intranet-tmpl/prog/en/js/acq.js b/koha-tmpl/intranet-tmpl/prog/en/js/acq.js >index 0c3ce91..dbe33c1 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/js/acq.js >+++ b/koha-tmpl/intranet-tmpl/prog/en/js/acq.js >@@ -646,12 +646,13 @@ function updateCosts(){ > var listprice = new Number($("#listprice").val()); > var currcode = new String($("#currency").val()); > var exchangerate = new Number($("#currency_rate_"+currcode).val()); >+ var miscellaneous = new Number($("#miscellaneous").val()); > var gst_on=false; > > var rrp = new Number(listprice*exchangerate); >- var ecost = rrp; >+ var ecost = rrp + miscellaneous; > if ( 100-discount != 100 ) { //Prevent rounding issues if no discount >- ecost = new Number(Math.floor(rrp * (100 - discount )) / 100); >+ ecost = new Number(Math.floor(rrp * (100 - discount )) / 100) + miscellaneous; > } > var total = new Number( ecost * quantity); > $("#rrp").val(rrp.toFixed(2)); >@@ -659,6 +660,10 @@ function updateCosts(){ > $("#total").val(total.toFixed(2)); > $("listprice").val(listprice.toFixed(2)); > >+ // In case the discount changed, we should update the message >+ var discount_2dp = discount.toFixed(2); >+ $('#discount_value').html(discount_2dp); >+ > return true; > } > >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 398a568..9deef47 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt >@@ -503,12 +503,31 @@ $(document).ready(function() > </li> > <li> > [% IF ( close ) %] >+ <span class="label">Discount percentage: </span> >+ <input type="text" size="20" name="discount" id="discount" value="[% discount %]" /> >+ [% ELSE %] >+ <label for="discount">Discount percentage: </label> >+ <input type="text" size="20" name="discount" id="discount" value="[% discount %]" onchange="calcNeworderTotal()"/> >+ [% END %] >+ </li> >+ <li> >+ [% IF ( close ) %] >+ <span class="label">Miscellaneous cost: </span> >+ <input type="text" size="20" name="miscellaneous" id="miscellaneous" /> >+ [% ELSE %] >+ <label for="miscellaneous">Miscellaneous cost: </label> >+ <input type="text" size="20" name="miscellaneous" id="miscellaneous" onchange="calcNeworderTotal()"/> >+ [% END %] >+ </li> >+ <li> >+ [% IF ( close ) %] > <label for="ecost">Budgeted cost: </label> > <input type="text" size="20" name="ecost" id="ecost" value="[% ecost %]" readonly="readonly" /> > [% ELSE %] > <label for="ecost">Budgeted cost: </label> > <input type="text" size="20" name="ecost" id="ecost" value="[% ecost %]" /> > [% END %] >+ [% IF ( discount_2dp ) %] (adjusted for <span id="discount_value">[% discount_2dp %]</span>% discount) [% END %] > </li> > <li> > [% IF ( close ) %] >-- >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 8343
:
10601
| 14524