Merge pull request #11605 from snipe/fixes/really_disable_consumable_checkout

Disallow checkout if qty = 0
This commit is contained in:
snipe 2022-08-02 12:31:29 -07:00 committed by GitHub
commit 8d8c502546
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -126,9 +126,20 @@
@endif
@can('checkout', \App\Models\Consumable::class)
<div class="col-md-12">
<a href="{{ route('consumables.checkout.show', $consumable->id) }}" style="padding-bottom:5px;" class="btn btn-primary btn-sm" {{ (($consumable->numRemaining() > 0 ) ? '' : ' disabled') }}>{{ trans('general.checkout') }}</a>
@if ($consumable->numRemaining() > 0)
<a href="{{ route('consumables.checkout.show', $consumable->id) }}" style="padding-bottom:5px;" class="btn btn-primary btn-sm">
{{ trans('general.checkout') }}
</a>
@else
<button style="padding-bottom:5px;" class="btn btn-primary btn-sm disabled">
{{ trans('general.checkout') }}
</button>
@endif
</div>
@endcan
@if ($consumable->notes)