lp1776757 Default Billing Price Not Updating
authorMike Risher <mrisher@catalyte.io>
Wed, 29 Jan 2020 20:20:35 +0000 (20:20 +0000)
committerGalen Charlton <gmc@equinoxinitiative.org>
Tue, 28 Jul 2020 14:45:15 +0000 (10:45 -0400)
Fix the following bug: When billing a patron and one switches from
one billing type to a different billing type, the price isn't updating
to show the new default price

Signed-off-by: Mike Risher <mrisher@catalyte.io>
Signed-off-by: Terran McCanna <tmccanna@georgialibraries.org>
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Open-ILS/src/templates/staff/circ/share/t_bill_patron_dialog.tt2
Open-ILS/web/js/ui/default/staff/circ/services/billing.js

index dd10c8b..8769174 100644 (file)
@@ -69,7 +69,7 @@
       <div class="form-group">
         <label for="bill-dialog-amount" class="control-label col-md-4">[% l('Amount:') %]</label>
         <div class="col-md-8">
-          <input type="number" min="0" step="any" class="form-control" 
+          <input type="string" min="0" step="any" class="form-control" 
             focus-me='focus' ng-required="true" id="bill-dialog-amount"
             ng-model="billArgs.amount"/>
         </div>
index 048e9d7..920de26 100644 (file)
@@ -140,8 +140,11 @@ function($uibModal , $q , egCore) {
                 $scope.updateDefaultPrice = function() {
                     var type = billingTypes.filter(function(t) {
                         return t.id() == $scope.billArgs.billingType })[0];
-                    if (type.default_price() && !$scope.billArgs.amount) 
-                        $scope.billArgs.amount = Number(type.default_price());
+                    if (type.default_price()) {
+                        $scope.billArgs.amount = parseFloat(type.default_price()).toFixed(2);
+                    } else {
+                        $scope.billArgs.amount = null;
+                    }
                 }
             }],
             resolve : {