From bd1637e67627bdb679cb34558a39ac14690ff9c4 Mon Sep 17 00:00:00 2001 From: phasefx Date: Thu, 30 Dec 2010 18:42:30 +0000 Subject: [PATCH] Never do money math as anything but pennies I tell you. :-) Three $0.60 transactions run through check-in were showing a running tally of $1.79 instead of $1.80. git-svn-id: svn://svn.open-ils.org/ILS/trunk@19086 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/xul/staff_client/server/circ/checkin.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Open-ILS/xul/staff_client/server/circ/checkin.js b/Open-ILS/xul/staff_client/server/circ/checkin.js index a766685227..9475803568 100644 --- a/Open-ILS/xul/staff_client/server/circ/checkin.js +++ b/Open-ILS/xul/staff_client/server/circ/checkin.js @@ -423,7 +423,10 @@ circ.checkin.prototype = { addCSSClass(no_change_label,'click_link'); } if (document.getElementById('fine_tally')) { - var amount = Number( document.getElementById('fine_tally').getAttribute('amount') ) + Number( bill.balance_owed() ); + var amount = util.money.cents_as_dollars( + Number( util.money.dollars_float_to_cents_integer( document.getElementById('fine_tally').getAttribute('amount') ) ) + + Number( util.money.dollars_float_to_cents_integer( bill.balance_owed() ) ) + ); document.getElementById('fine_tally').setAttribute('amount',amount); document.getElementById('fine_tally').setAttribute( 'value', -- 2.11.0