Merge pull request #14832 from snipe/fixes/added_consumables_to_inventory_email

Fixed #14812 - added consumables to individual inventory report
This commit is contained in:
snipe 2024-06-05 20:42:35 +01:00 committed by GitHub
commit e19d2d6ec9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
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