@@ -, +, @@ during ordering --- 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(-) --- a/acqui/neworderempty.pl +++ a/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'}, --- a/koha-tmpl/intranet-tmpl/prog/en/js/acq.js +++ a/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; } --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt @@ -503,12 +503,31 @@ $(document).ready(function()
  • [% IF ( close ) %] + Discount percentage: + + [% ELSE %] + + + [% END %] +
  • +
  • + [% IF ( close ) %] + Miscellaneous cost: + + [% ELSE %] + + + [% END %] +
  • +
  • + [% IF ( close ) %] [% ELSE %] [% END %] + [% IF ( discount_2dp ) %] (adjusted for [% discount_2dp %]% discount) [% END %]
  • [% IF ( close ) %] --