Skip to content

Commit

Permalink
XP-59 fix: Amount cannot be negative
Browse files Browse the repository at this point in the history
  • Loading branch information
MuhammadMaazFaisal authored and faizahmed1234 committed Aug 7, 2024
1 parent e119cdf commit 42d707d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion resources/views/accounts/create.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
<label for="balance" class="col-md-4 col-form-label text-md-right">Starting Balance</label>

<div class="col-md-6">
<input id="balance" type="number" value="{{ $account ?? '' ? $account->balance : '0.00'}}" step="0.01" class="form-control @error('balance') is-invalid @enderror" name="balance" autocomplete="balance">
<input id="balance" type="number" min=0 value="{{ $account ?? '' ? $account->balance : '0.00'}}" step="0.01" class="form-control @error('balance') is-invalid @enderror" name="balance" autocomplete="balance">

@error('balance')
<span class="invalid-feedback" role="alert">
Expand Down
2 changes: 1 addition & 1 deletion resources/views/transactions/create-widget.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ class="form-control @error('category_id') is-invalid @enderror" autocomplete="ca
<div class="form-group">
<label for="amount" class="col-form-label">Amount <span class="text-danger">*</span></label>

<input id="amount" type="number" step="0.01" class="form-control @error('amount') is-invalid @enderror"
<input id="amount" type="number" min=0 step="0.01" class="form-control @error('amount') is-invalid @enderror"
name="amount" value="{{ $transaction ?? '' ? $transaction->amount ?? old('amount') : '' }}" required
autocomplete="amount">

Expand Down

0 comments on commit 42d707d

Please sign in to comment.