LP1781274 Resolve bill payment rounding error user/berick/lp1781274-webstaff-billpay-rounding
authorBill Erickson <berickxx@gmail.com>
Thu, 30 Jan 2020 19:57:47 +0000 (14:57 -0500)
committerBill Erickson <berickxx@gmail.com>
Thu, 30 Jan 2020 19:57:49 +0000 (14:57 -0500)
When calculating the amount left to apply for selected transactions in
the web staff bills interface, use the *100/100 trick to avoid rounding
errors.

Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/web/js/ui/default/staff/circ/patron/bills.js

index 25a01d8..4ab52e9 100644 (file)
@@ -351,7 +351,7 @@ function($scope , $q , $routeParams , egCore , egConfirmDialog , $location,
                 // pending payment exceeds balance of current item.
                 // pay the entire item.
                 item.payment_pending = owed;
-                payment_amount -= owed;
+                payment_amount = (payment_amount * 100 - owed * 100) / 100;
 
             } else {
                 // balance owed on the current item matches or exceeds