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>
<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>
$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 : {