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>
Changes to be committed:
modified: Open-ILS/src/templates/staff/circ/share/t_bill_patron_dialog.tt2
modified: Open-ILS/web/js/ui/default/staff/circ/services/billing.js
<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 : {