Bugzilla – Attachment 10601 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]
Editable discount rate and misc charges during ordering
0001-Bug-8343-Editable-discount-rate-and-miscellaneous-ch.patch (text/plain), 5.45 KB, created by
shinoy m
on 2012-07-02 13:00:20 UTC
(
hide
)
Description:
Editable discount rate and misc charges during ordering
Filename:
MIME Type:
Creator:
shinoy m
Created:
2012-07-02 13:00:20 UTC
Size:
5.45 KB
patch
obsolete
>From fed46148ba24de023d9677792a54107e4e1ba934 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 | 10 +++++++- > .../prog/en/modules/acqui/neworderempty.tt | 21 ++++++++++++++++++- > 3 files changed, 28 insertions(+), 5 deletions(-) > >diff --git a/acqui/neworderempty.pl b/acqui/neworderempty.pl >index a461a1b..bf904c5 100755 >--- a/acqui/neworderempty.pl >+++ b/acqui/neworderempty.pl >@@ -359,7 +359,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'}, > listincgst => $bookseller->{'listincgst'}, > invoiceincgst => $bookseller->{'invoiceincgst'}, > name => $bookseller->{'name'}, >diff --git a/koha-tmpl/intranet-tmpl/prog/en/js/acq.js b/koha-tmpl/intranet-tmpl/prog/en/js/acq.js >index 2efeba0..ac76914 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/js/acq.js >+++ b/koha-tmpl/intranet-tmpl/prog/en/js/acq.js >@@ -645,6 +645,7 @@ function calcNeworderTotal(){ > var quantity = new Number(f.quantity.value); > var discount = new Number(f.discount.value); > var listinc = new Number (f.listinc.value); >+ var miscellaneous = new Number (f.miscellaneous.value); > //var currency = f.currency.value; > var applygst = new Number (f.applygst.value); > var listprice = new Number(f.listprice.value); >@@ -657,9 +658,9 @@ function calcNeworderTotal(){ > > //do real stuff > 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 GST = new Number(0); > if (gst_on) { >@@ -682,6 +683,11 @@ function calcNeworderTotal(){ > if (f.GST) { > f.GST.value=GST; > } >+ >+// 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 566318f..f6366c1 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt >@@ -222,7 +222,6 @@ $(document).ready(function() > <input type="hidden" name="booksellerid" value="[% booksellerid %]" /> > <input type="hidden" name="biblionumber" value="[% biblionumber %]" /> > <input type="hidden" name="biblioitemnumber" value="[% biblioitemnumber %]" /> >- <input type="hidden" name="discount" value="[% discount %]" /> > <input type="hidden" name="listinc" value="[% listincgst %]" /> > <!-- <input type="hidden" name="currency" value="[% currency %]" />--> > <input type="hidden" name="applygst" value="[% gstreg %]" /> >@@ -464,13 +463,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 [% discount_2dp %]% discount) [% END %] >+ [% IF ( discount_2dp ) %] (adjusted for <span id="discount_value">[% discount_2dp %]</span>% discount) [% END %] > > </li> > [% IF ( GST ) %] >-- >1.6.4.2 >
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