+
+
+ {{ trans('admin/users/table.total_assets_cost') }}
+
+
+
+
+
+ {{trans('general.assets').': '. Helper::formatCurrencyOutput($user->getUserTotalCost()->asset_cost)}}
+ {{trans('general.licenses').': '. Helper::formatCurrencyOutput($user->getUserTotalCost()->license_cost)}}
+ {{trans('general.accessories').': '.Helper::formatCurrencyOutput($user->getUserTotalCost()->accessory_cost)}}
+
+
+
@@ -1109,6 +1130,12 @@ $(function () {
}
});
+ $("#optional_info").on("click",function(){
+ $('#optional_details').fadeToggle(100);
+ $('#optional_info_icon').toggleClass('fa-caret-right fa-caret-down');
+ var optional_info_open = $('#optional_info_icon').hasClass('fa-caret-down');
+ document.cookie = "optional_info_open="+optional_info_open+'; path=/';
+ });
});
diff --git a/tests/Feature/Api/Assets/AssetCheckinTest.php b/tests/Feature/Api/Assets/AssetCheckinTest.php
new file mode 100644
index 0000000000..f71191d80c
--- /dev/null
+++ b/tests/Feature/Api/Assets/AssetCheckinTest.php
@@ -0,0 +1,30 @@
+superuser()->create();
+ $asset = Asset::factory()->create(['last_checkin' => null]);
+
+ $asset->checkOut(User::factory()->create(), $admin, now());
+
+ $this->actingAsForApi($admin)
+ ->postJson(route('api.asset.checkin', $asset))
+ ->assertOk();
+
+ $this->assertNotNull(
+ $asset->fresh()->last_checkin,
+ 'last_checkin field should be set on checkin'
+ );
+ }
+}
diff --git a/tests/Feature/Assets/AssetCheckinTest.php b/tests/Feature/Assets/AssetCheckinTest.php
new file mode 100644
index 0000000000..059fb1294f
--- /dev/null
+++ b/tests/Feature/Assets/AssetCheckinTest.php
@@ -0,0 +1,32 @@
+superuser()->create();
+ $asset = Asset::factory()->create(['last_checkin' => null]);
+
+ $asset->checkOut(User::factory()->create(), $admin, now());
+
+ $this->actingAs($admin)
+ ->post(route('hardware.checkin.store', [
+ 'assetId' => $asset->id,
+ ]))
+ ->assertRedirect();
+
+ $this->assertNotNull(
+ $asset->fresh()->last_checkin,
+ 'last_checkin field should be set on checkin'
+ );
+ }
+}
diff --git a/tests/Feature/Reports/CustomReportTest.php b/tests/Feature/Reports/CustomReportTest.php
index b27ebc27ef..a1a269a4ab 100644
--- a/tests/Feature/Reports/CustomReportTest.php
+++ b/tests/Feature/Reports/CustomReportTest.php
@@ -107,4 +107,29 @@ class CustomReportTest extends TestCase
->assertDontSeeTextInStreamedResponse('Asset A')
->assertSeeTextInStreamedResponse('Asset B');
}
+
+ public function testCanLimitAssetsByLastCheckIn()
+ {
+ Asset::factory()->create(['name' => 'Asset A', 'last_checkin' => '2023-08-01']);
+ Asset::factory()->create(['name' => 'Asset B', 'last_checkin' => '2023-08-02']);
+ Asset::factory()->create(['name' => 'Asset C', 'last_checkin' => '2023-08-03']);
+ Asset::factory()->create(['name' => 'Asset D', 'last_checkin' => '2023-08-04']);
+ Asset::factory()->create(['name' => 'Asset E', 'last_checkin' => '2023-08-05']);
+
+ $this->actingAs(User::factory()->canViewReports()->create())
+ ->post('reports/custom', [
+ 'asset_name' => '1',
+ 'asset_tag' => '1',
+ 'serial' => '1',
+ 'checkin_date' => '1',
+ 'checkin_date_start' => '2023-08-02',
+ 'checkin_date_end' => '2023-08-04',
+ ])->assertOk()
+ ->assertHeader('content-type', 'text/csv; charset=UTF-8')
+ ->assertDontSeeTextInStreamedResponse('Asset A')
+ ->assertSeeTextInStreamedResponse('Asset B')
+ ->assertSeeTextInStreamedResponse('Asset C')
+ ->assertSeeTextInStreamedResponse('Asset D')
+ ->assertDontSeeTextInStreamedResponse('Asset E');
+ }
}