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:
@ -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);
|
||||
|
||||
@ -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()
|
||||
|
||||
Reference in New Issue
Block a user