Bug 7528 - amount subtracting 1 cent

Rounding issue with JavaScript and float numbers, JavaScript changed to do no calculation if discount is 0

Signed-off-by: Ian Walls <koha.sekjal@gmail.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
This commit is contained in:
mveron 2012-04-15 17:20:16 +02:00 committed by Jared Camins-Esakov
parent da4abc7a33
commit ed2420273b
1 changed files with 4 additions and 1 deletions

View File

@ -664,7 +664,10 @@ function calcNeworderTotal(){
//do real stuff
var rrp = new Number(listprice*exchangerate);
var ecost = new Number(Math.floor(rrp * (100 - discount ))/100);
var ecost = rrp;
if (100-discount != 100) { //Prevent rounding issues if no discount
ecost = new Number(Math.floor(rrp * (100 - discount ))/100);
}
var GST = new Number(0);
if (gst_on) {
rrp=rrp * (1+f.gstrate.value / 100);