diff --git a/database/factories/ActionLogFactory.php b/database/factories/ActionLogFactory.php index 3cf6b408db..a49d56b852 100644 --- a/database/factories/ActionLogFactory.php +++ b/database/factories/ActionLogFactory.php @@ -14,6 +14,17 @@ $factory->define(Actionlog::class, function (Faker\Generator $faker) { }); +$factory->defineAs(App\Models\Actionlog::class, 'asset-upload', function ($faker) { + $asset = factory(App\Models\Asset::class)->create(); + return [ + 'item_type' => get_class($asset), + 'item_id' => 1, + 'user_id' => 1, + 'filename' => $faker->word, + 'action_type' => 'uploaded' + ]; +}); + $factory->defineAs(Actionlog::class, 'asset-checkout-user', function (Faker\Generator $faker) { $target = User::inRandomOrder()->first(); diff --git a/resources/views/reports/asset_maintenances.blade.php b/resources/views/reports/asset_maintenances.blade.php index 79dbb806cd..31d61e0b76 100644 --- a/resources/views/reports/asset_maintenances.blade.php +++ b/resources/views/reports/asset_maintenances.blade.php @@ -41,25 +41,30 @@ $totalCost = 0; ?> @foreach ($assetMaintenances as $assetMaintenance) + asset_maintenance_time); ?> @if ($assetMaintenance->asset) {{ ($assetMaintenance->asset->company) ? $assetMaintenance->asset->company->name : '' }} {{ $assetMaintenance->asset->asset_tag }} {{ $assetMaintenance->asset->name }} - {{ $assetMaintenance->supplier->name }} + + @if ($assetMaintenance->supplier) + {{ $assetMaintenance->supplier->name }} + @else + (deleted supplier) + @endif + {{ $assetMaintenance->asset_maintenance_type }} {{ $assetMaintenance->title }} {{ $assetMaintenance->start_date }} {{ is_null($assetMaintenance->completion_date) ? trans('admin/asset_maintenances/message.asset_maintenance_incomplete') : $assetMaintenance->completion_date }} - @if (is_null($assetMaintenance->asset_maintenance_time)) - diffInDays(Carbon::parse($assetMaintenance->start_date))); - ?> - @else - asset_maintenance_time); - ?> - @endif + asset_maintenance_time)) { + $assetMaintenanceTime = intval(Carbon::now()->diffInDays(Carbon::parse($assetMaintenance->start_date))); + } + + ?> {{ $assetMaintenanceTime }} {{ $snipeSettings->default_currency }}