unset default Check Number, disable widget if not Check Payment,
and disable Apply Payment button if Check Payment with invalid Check Number
Signed-off-by: Jason Etheridge <jason@esilibrary.com>
Signed-off-by: Kathy Lussier <klussier@masslnc.org>
</label>
<div class="col-md-6">
<input type="number" min="1" step="any" id="check-input"
- ng-model="check_number" focus-me="focus_check"
+ ng-model="check_number" focus-me="focus_check"
+ ng-disabled="payment_type!='check_payment'"
value="" class="form-control col-md-6 "/>
</div>
<div class="form-group">
<button
type="submit"
class="btn btn-default"
- ng-disabled="!gridControls.selectedItems().length"
+ ng-disabled="invalid_check_number() || !gridControls.selectedItems().length"
>[% l('Apply Payment') %]</button>
</div>
</div>
billSvc.userId = $routeParams.id;
// set up some defaults
- $scope.check_number = 1;
+ $scope.check_number = null;
$scope.payment_amount = null;
$scope.session_voided = 0;
$scope.payment_type = 'cash_payment';
});
return -(amount / 100);
}
+ $scope.invalid_check_number = function() {
+ return $scope.payment_type == 'check_payment' && ! $scope.check_number;
+ }
// update the item.payment_pending value each time the user
// selects different transactions to pay against.