Merge branch 'develop'

This commit is contained in:
snipe 2017-10-18 04:49:16 -07:00
commit 463d9513e2
2 changed files with 26 additions and 10 deletions

View file

@ -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) { $factory->defineAs(Actionlog::class, 'asset-checkout-user', function (Faker\Generator $faker) {
$target = User::inRandomOrder()->first(); $target = User::inRandomOrder()->first();

View file

@ -41,25 +41,30 @@
$totalCost = 0; $totalCost = 0;
?> ?>
@foreach ($assetMaintenances as $assetMaintenance) @foreach ($assetMaintenances as $assetMaintenance)
<?php $assetMaintenanceTime = intval($assetMaintenance->asset_maintenance_time); ?>
@if ($assetMaintenance->asset) @if ($assetMaintenance->asset)
<tr> <tr>
<td>{{ ($assetMaintenance->asset->company) ? $assetMaintenance->asset->company->name : '' }}</td> <td>{{ ($assetMaintenance->asset->company) ? $assetMaintenance->asset->company->name : '' }}</td>
<td>{{ $assetMaintenance->asset->asset_tag }}</td> <td>{{ $assetMaintenance->asset->asset_tag }}</td>
<td>{{ $assetMaintenance->asset->name }}</td> <td>{{ $assetMaintenance->asset->name }}</td>
<td>{{ $assetMaintenance->supplier->name }}</td> <td>
@if ($assetMaintenance->supplier)
{{ $assetMaintenance->supplier->name }}
@else
(deleted supplier)
@endif
</td>
<td>{{ $assetMaintenance->asset_maintenance_type }}</td> <td>{{ $assetMaintenance->asset_maintenance_type }}</td>
<td>{{ $assetMaintenance->title }}</td> <td>{{ $assetMaintenance->title }}</td>
<td>{{ $assetMaintenance->start_date }}</td> <td>{{ $assetMaintenance->start_date }}</td>
<td>{{ is_null($assetMaintenance->completion_date) ? trans('admin/asset_maintenances/message.asset_maintenance_incomplete') : $assetMaintenance->completion_date }}</td> <td>{{ is_null($assetMaintenance->completion_date) ? trans('admin/asset_maintenances/message.asset_maintenance_incomplete') : $assetMaintenance->completion_date }}</td>
@if (is_null($assetMaintenance->asset_maintenance_time)) <?php
<?php
$assetMaintenanceTime = intval(Carbon::now()->diffInDays(Carbon::parse($assetMaintenance->start_date))); if (is_null($assetMaintenance->asset_maintenance_time)) {
?> $assetMaintenanceTime = intval(Carbon::now()->diffInDays(Carbon::parse($assetMaintenance->start_date)));
@else }
<?php
$assetMaintenanceTime = intval($assetMaintenance->asset_maintenance_time); ?>
?>
@endif
<td>{{ $assetMaintenanceTime }}</td> <td>{{ $assetMaintenanceTime }}</td>
<td> <td>
{{ $snipeSettings->default_currency }} {{ $snipeSettings->default_currency }}