From 0f6270d310498aee2e5e81037d43348feb2a6058 Mon Sep 17 00:00:00 2001 From: Alex Arnaud Date: Fri, 14 May 2010 17:07:55 +0200 Subject: [PATCH] Bug 5946 : (MT1177) aqplan.pl, fix the problem of calculating the total remaining. Bug 5946 followup : (MT1236) aqplan.pl - Fixe the problem of unrounded sums Signed-off-by: Paul Poulain Signed-off-by: Chris Cormack --- koha-tmpl/intranet-tmpl/prog/en/js/acq.js | 21 ++++++++++++------- .../prog/en/modules/admin/aqplan.tmpl | 2 +- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/js/acq.js b/koha-tmpl/intranet-tmpl/prog/en/js/acq.js index de9e92c484..59363592de 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/js/acq.js +++ b/koha-tmpl/intranet-tmpl/prog/en/js/acq.js @@ -557,12 +557,14 @@ function getElementsByClass( searchClass, domNode, tagName) { function calcTotalRow(cell) { - var bud_id = cell.className; + var string = cell.name; + var pos = string.indexOf(",", 0); + var bud_id = string.substring(0, pos); var val1 = cell.value; - var remainingTotal = document.getElementById("budget_est_"+bud_id).textContent; + var remainingTotal = document.getElementById("budget_est_"+bud_id); var remainingNew =0; var budgetTotal = document.getElementById("budget_tot_"+bud_id ).textContent; - var arr = getElementsByClass(bud_id); + var arr = getElementsByClass(cell.className); budgetTotal = budgetTotal.replace(/\,/, ""); @@ -594,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); @@ -602,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

Planning for by

- +" /> -- 2.39.2