diff --git a/app/lang/en/admin/accessories/general.php b/app/lang/en/admin/accessories/general.php
index 7c84fbb00f..c0182c2a03 100755
--- a/app/lang/en/admin/accessories/general.php
+++ b/app/lang/en/admin/accessories/general.php
@@ -11,6 +11,8 @@ return array(
'require_acceptance' => 'Require users to confirm acceptance of assets in this category.',
'no_default_eula' => 'No primary default EULA found. Add one in Settings.',
'qty' => 'QTY',
+ 'total' => 'Total',
+ 'remaining' => 'Avail',
'update' => 'Update Category',
'use_default_eula' => 'Use the primary default EULA instead.',
'use_default_eula_disabled' => 'Use the primary default EULA instead. No primary default EULA is set. Please add one in Settings.',
diff --git a/app/models/Accessory.php b/app/models/Accessory.php
index 3d87adeb1f..5314af73b5 100755
--- a/app/models/Accessory.php
+++ b/app/models/Accessory.php
@@ -52,6 +52,13 @@ class Accessory extends Elegant
}
}
+
+ public function numRemaining() {
+ $checkedout = $this->users->count();
+ $total = $this->qty;
+ $remaining = $total - $checkedout;
+ return $remaining;
+ }
}
diff --git a/app/views/backend/accessories/index.blade.php b/app/views/backend/accessories/index.blade.php
index b635584756..82439a5e99 100755
--- a/app/views/backend/accessories/index.blade.php
+++ b/app/views/backend/accessories/index.blade.php
@@ -24,8 +24,9 @@
| @lang('admin/accessories/table.title') | -@lang('admin/accessories/general.qty') | +@lang('admin/accessories/table.title') | +@lang('admin/accessories/general.total') | +@lang('admin/accessories/general.remaining') | @lang('table.actions') |
|---|---|---|---|---|---|
| {{{ $accessory->name }}} | -{{{ $accessory->qty }}} | +{{{ $accessory->qty }}} | +{{{ $accessory->numRemaining() }}} | - @lang('general.checkout') + numRemaining()== 0) ? ' disabled' : '') }}>@lang('general.checkout') |