LP1781274 Fix floating point issue preventing transactions from closing
authorMichele Morgan <mmorgan@noblenet.org>
Fri, 20 Dec 2019 21:00:08 +0000 (16:00 -0500)
committerChris Sharp <csharp@georgialibraries.org>
Tue, 14 Jan 2020 15:39:50 +0000 (10:39 -0500)
Limits pending payment amounts to 2 decimal places.

Signed-off-by: Michele Morgan <mmorgan@noblenet.org>
Open-ILS/web/js/ui/default/staff/circ/patron/bills.js

index 25a01d8..4d597eb 100644 (file)
@@ -357,7 +357,8 @@ function($scope , $q , $routeParams , egCore , egConfirmDialog , $location,
                 // balance owed on the current item matches or exceeds
                 // the pending payment.  Apply the full remainder of
                 // the payment to this item.. and we're done.
-                item.payment_pending = payment_amount;
+                // Limit to two decimal places to avoid floating point issues
+                item.payment_pending = payment_amount.toFixed(2);
                 break;
             }
         }