3
0
mirror of https://github.com/snipe/snipe-it.git synced 2026-08-18 11:15:42 +00:00

Implement locations

This commit is contained in:
Marcus Moore
2026-05-07 11:44:49 -07:00
parent 1f19f6b0fc
commit c94de01547
2 changed files with 6 additions and 2 deletions

View File

@ -64,6 +64,7 @@ class CustomComponentReportController extends Controller
'company',
'manufacturer',
'supplier',
'location',
]);
$localConstraints = [
@ -81,6 +82,7 @@ class CustomComponentReportController extends Controller
'by_category_id' => 'components.category_id',
'by_manufacturer_id' => 'components.manufacturer_id',
'by_supplier_id' => 'components.supplier_id',
'by_location_id' => 'components.location_id',
];
foreach ($foreignConstraints as $formKey => $column) {
@ -128,6 +130,10 @@ class CustomComponentReportController extends Controller
$row[] = $component?->supplier->name;
}
if ($request->filled('location')) {
$row[] = $component?->location->name;
}
// CSV_ESCAPE_FORMULAS is set to false in the .env
if (config('app.escape_formulas') === false) {
fputcsv($handle, $row);

View File

@ -262,8 +262,6 @@ class CustomComponentReportTest extends TestCase
public function test_limiting_by_location()
{
$this->markTestIncomplete();
[$locationA, $locationB] = Location::factory()->count(2)->create()->all();
Component::factory()