diff --git a/app/Http/Controllers/ModulePlantLineController.php b/app/Http/Controllers/ModulePlantLineController.php index 6b418fb62..2bc80d446 100644 --- a/app/Http/Controllers/ModulePlantLineController.php +++ b/app/Http/Controllers/ModulePlantLineController.php @@ -88,6 +88,7 @@ class ModulePlantLineController extends Controller } $plantName = $request->header('plant-name'); + $chartName = $request->header('chart-name'); if (empty($plantName)) { return response()->json([ @@ -105,6 +106,8 @@ class ModulePlantLineController extends Controller ], 404); } + + // Load only lines NOT equal to FG Line $nonFgLines = Line::where('plant_id', $plant->id) ->where('type', '!=', 'FG Line') @@ -119,8 +122,12 @@ class ModulePlantLineController extends Controller ], 404); } + if (strtolower(trim($chartName)) !== 'production hourly count') { + array_unshift($nonFgLines, 'All Lines'); + } + // Add "All Lines" to beginning and "FG Lines" at the end - array_unshift($nonFgLines, 'All Lines'); + // array_unshift($nonFgLines, 'All Lines'); $nonFgLines[] = 'FG Lines'; return response()->json([