Bugzilla – Attachment 7911 Details for
Bug 2865
Acquisitions: GST not calculating correctly.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Makes corrections to acq.js and parcel.pl regarding gst and discount calculations
0001-bug-2865-acq-calculations-incorrectly-calculating-gs.patch (text/plain), 2.11 KB, created by
Chris Hall
on 2012-02-27 23:55:48 UTC
(
hide
)
Description:
Makes corrections to acq.js and parcel.pl regarding gst and discount calculations
Filename:
MIME Type:
Creator:
Chris Hall
Created:
2012-02-27 23:55:48 UTC
Size:
2.11 KB
patch
obsolete
>From 2db7cb03ba883534e07fc3eeffe954eb3d1ba77c Mon Sep 17 00:00:00 2001 >From: Chris Hall <chrish@catalyst.net.nz> >Date: Tue, 28 Feb 2012 12:45:57 +1300 >Subject: [PATCH] bug 2865 acq calculations incorrectly calculating gst and discounts > >--- > acqui/parcel.pl | 4 ++-- > koha-tmpl/intranet-tmpl/prog/en/js/acq.js | 12 +++++++----- > 2 files changed, 9 insertions(+), 7 deletions(-) > >diff --git a/acqui/parcel.pl b/acqui/parcel.pl >index 5d0d164..5a5ba3c 100755 >--- a/acqui/parcel.pl >+++ b/acqui/parcel.pl >@@ -315,8 +315,8 @@ $template->param( > totalquantity => $totalquantity, > tototal => sprintf($cfstr, $tototal), > ordergrandtotal => sprintf($cfstr, $ordergrandtotal), >- gst => $gst, >- grandtot => sprintf($cfstr, $tototal + $gst), >+ gst => sprintf($cfstr, $gst), >+ grandtot => sprintf($cfstr, $tototal * (1+$gst)), > totalPunitprice => sprintf("%.2f", $totalPunitprice), > totalPquantity => $totalPquantity, > totalPqtyrcvd => $totalPqtyrcvd, >diff --git a/koha-tmpl/intranet-tmpl/prog/en/js/acq.js b/koha-tmpl/intranet-tmpl/prog/en/js/acq.js >index b137f59..c9ae9ca 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/js/acq.js >+++ b/koha-tmpl/intranet-tmpl/prog/en/js/acq.js >@@ -660,15 +660,17 @@ function calcNeworderTotal(){ > var currcode = new String(document.getElementById('currency').value); > var exchangerate = new Number(document.getElementById(currcode).value); > >- var gst_on=(!listinc && invoiceingst); >- > //do real stuff > var rrp = new Number(listprice*exchangerate); > var ecost = new Number(Math.floor(rrp * (100 - discount ))/100); > var GST = new Number(0); >- if (gst_on) { >- rrp=rrp * (1+f.gstrate.value / 100); >- GST=ecost * f.gstrate.value / 100; >+ >+ rrp *= (100-discount) / 100; >+ if (listinc==0){ >+ rrp *= 1 + new Number(f.gstrate.value); >+ if(invoiceingst!=0) { >+ GST=ecost * f.gstrate.value / 100; >+ } > } > > var total = new Number( (ecost + GST) * quantity); >-- >1.7.4.1 >
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 2865
:
898
|
899
|
7911
|
8375
|
8460
|
9212