Fixed #14812 - added consumables to individual inventory report

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe 2024-06-05 20:40:45 +01:00
parent de7b8940fe
commit 871255f28c
3 changed files with 15 additions and 1 deletions

View file

@ -43,7 +43,7 @@ class SendCurrentInventoryToUsers extends Command
$count = 0;
foreach ($users as $user) {
if (($user->assets->count() > 0) || ($user->accessories->count() > 0) || ($user->licenses->count() > 0)) {
if (($user->assets->count() > 0) || ($user->accessories->count() > 0) || ($user->licenses->count() > 0) || ($user->consumables->count() > 0)) {
$count++;
$user->notify((new CurrentInventory($user)));
}

View file

@ -43,6 +43,7 @@ class CurrentInventory extends Notification
'assets' => $this->user->assets,
'accessories' => $this->user->accessories,
'licenses' => $this->user->licenses,
'consumables' => $this->user->consumables,
])
->subject(trans('mail.inventory_report'));

View file

@ -56,6 +56,19 @@
</table>
@endif
@if ($consumables->count() > 0)
## {{ $consumables->count() }} {{ trans('general.consumables') }}
<table width="100%">
<tr><th align="left">{{ trans('mail.name') }} </th> <th></th> </tr>
@foreach($consumables as $consumable)
<tr>
<td>{{ $consumable->name }}</td>
</tr>
@endforeach
</table>
@endif
@endcomponent