Bugzilla – Attachment 3422 Details for
Bug 5946
Acquisitions: Budget planning does not total correctly
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Proposed patch
0002-Bug-5946-followup-MT1236-aqplan.pl-Fixe-the-problem-.patch (text/plain), 1.99 KB, created by
Chris Cormack
on 2011-03-24 20:46:12 UTC
(
hide
)
Description:
Proposed patch
Filename:
MIME Type:
Creator:
Chris Cormack
Created:
2011-03-24 20:46:12 UTC
Size:
1.99 KB
patch
obsolete
>From 3372fc5be4e349c252fce079c1346194e9e508c4 Mon Sep 17 00:00:00 2001 >From: Alex Arnaud <alex.arnaud@biblibre.com> >Date: Mon, 17 May 2010 12:14:57 +0200 >Subject: [PATCH] Bug 5946 followup : (MT1236) aqplan.pl - Fixe the problem of unrounded sums > >--- > koha-tmpl/intranet-tmpl/prog/en/js/acq.js | 13 +++++++++---- > 1 files changed, 9 insertions(+), 4 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/js/acq.js b/koha-tmpl/intranet-tmpl/prog/en/js/acq.js >index 28afc19..1b924a2 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/js/acq.js >+++ b/koha-tmpl/intranet-tmpl/prog/en/js/acq.js >@@ -596,7 +596,7 @@ function calcTotalRow(cell) { > > function autoFillRow(bud_id) { > >- var remainingTotal = document.getElementById("budget_est_"+bud_id).textContent; >+ var remainingTotal = document.getElementById("budget_est_"+bud_id); > var remainingNew = new Number; > var budgetTotal = document.getElementById("budget_tot_"+bud_id ).textContent; > var arr = getElementsByClass("plan_entry_" + bud_id); >@@ -604,20 +604,25 @@ function autoFillRow(bud_id) { > budgetTotal = budgetTotal.replace(/\,/, ""); > var qty = new Number; > // get the totals >+ var novalueArr = new Array(); > for ( var i=0, len=arr.length; i<len; ++i ) { > remainingNew += Math.abs (arr[i].value ); > > if ( arr[i].value == 0 ) { >+ novalueArr[qty] = arr[i]; > qty += 1; > } > } > > remainingNew = Math.abs( budgetTotal) - remainingNew ; > var newCell = new Number (remainingNew / qty); >+ var rest = new Number (remainingNew - (newCell.toFixed(2) * (novalueArr.length - 1))); > >- for ( var i=0, len=arr.length; i<len; ++i ) { >- if ( Math.abs(arr[i].value) == 0 ) { >- arr[i].value = newCell.toFixed(2) ; >+ for (var i = 0; i<novalueArr.length; ++i) { >+ if (i == novalueArr.length - 1) { >+ novalueArr[i].value = rest.toFixed(2); >+ }else { >+ novalueArr[i].value = newCell.toFixed(2); > } > } > >-- >1.7.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 5946
:
3421
|
3422
|
3653
|
3654