From d9a21cce00a096271ac2316e9c532b106ce4824b Mon Sep 17 00:00:00 2001 From: Ivan Nieto Vivanco Date: Thu, 15 Dec 2022 14:12:05 -0600 Subject: [PATCH] Add other items' purchase_cost columns to the same permission --- config/permissions.php | 2 +- resources/views/account/view-assets.blade.php | 24 ++++++++++++------- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/config/permissions.php b/config/permissions.php index 366590e8c7..0b65a4e26b 100644 --- a/config/permissions.php +++ b/config/permissions.php @@ -648,7 +648,7 @@ return [ [ 'permission' => 'self.view_purchase_cost', 'label' => 'View Purchase-Cost Column', - 'note' => 'This user can see the purchase cost column of assets assigned to them.', + 'note' => 'This user can see the purchase cost column of items assigned to them.', 'display' => true, ], diff --git a/resources/views/account/view-assets.blade.php b/resources/views/account/view-assets.blade.php index e333a72625..b77bddcf0d 100755 --- a/resources/views/account/view-assets.blade.php +++ b/resources/views/account/view-assets.blade.php @@ -536,7 +536,9 @@ {{ trans('general.name') }} - {{ trans('general.purchase_cost') }} + @can('self.view_purchase_cost') + {{ trans('general.purchase_cost') }} + @endcan {{ trans('general.action') }} @@ -544,9 +546,11 @@ @foreach ($user->accessories as $accessory) {{ $accessory->name }} - - {!! Helper::formatCurrencyOutput($accessory->purchase_cost) !!} - + @can('self.view_purchase_cost') + + {!! Helper::formatCurrencyOutput($accessory->purchase_cost) !!} + + @endcan @can('checkin', $accessory) {{ trans('general.checkin') }} @@ -583,7 +587,9 @@ {{ trans('general.name') }} - {{ trans('general.purchase_cost') }} + @can('self.view_purchase_cost') + {{ trans('general.purchase_cost') }} + @endcan {{ trans('general.date') }} {{ trans('general.notes') }} @@ -592,9 +598,11 @@ @foreach ($user->consumables as $consumable) {{ $consumable->name }} - - {!! Helper::formatCurrencyOutput($consumable->purchase_cost) !!} - + @can('self.view_purchase_cost') + + {!! Helper::formatCurrencyOutput($consumable->purchase_cost) !!} + + @endcan {{ Helper::getFormattedDateObject($consumable->pivot->created_at, 'datetime', false) }} {{ $consumable->pivot->note }}