diff --git a/app/Http/Controllers/Admin/WarehouseController.php b/app/Http/Controllers/Admin/WarehouseController.php index 2ce49e4..3b3c8c4 100644 --- a/app/Http/Controllers/Admin/WarehouseController.php +++ b/app/Http/Controllers/Admin/WarehouseController.php @@ -745,7 +745,7 @@ class WarehouseController extends Controller ->orderByRaw('CAST(slot_no AS UNSIGNED) ASC') ->get(); - $headers = ['貨道號', '商品名稱', '商品條碼', '類型', '目前庫存', '滿庫容量', '庫存率(%)', '效期', '批號', '啟用', '鎖定']; + $headers = ['貨道號', '商品ID', '商品名稱', '商品條碼', '類型', '目前庫存', '滿庫容量', '庫存率(%)', '效期', '批號', '啟用', '鎖定']; $safeSerial = preg_replace('/[^A-Za-z0-9_-]/', '', (string) $machine->serial_no); $filename = '貨道明細_' . ($safeSerial ?: $machine->id) . '_' . now()->format('YmdHis') . '.' . $ext; @@ -772,6 +772,7 @@ class WarehouseController extends Controller $row = [ $slot->slot_no, + $slot->product_id ?? '', $slot->product->name ?? '', $slot->product->barcode ?? '', $slot->type, @@ -829,7 +830,7 @@ class WarehouseController extends Controller } $machines = $query->get(); - $headers = ['貨道號', '商品名稱', '商品條碼', '類型', '目前庫存', '滿庫容量', '庫存率(%)', '效期', '批號', '啟用', '鎖定']; + $headers = ['貨道號', '商品ID', '商品名稱', '商品條碼', '類型', '目前庫存', '滿庫容量', '庫存率(%)', '效期', '批號', '啟用', '鎖定']; $ts = now()->format('YmdHis'); // 單台的資料列 @@ -841,6 +842,7 @@ class WarehouseController extends Controller $rate = $capacity > 0 ? round($stock / $capacity * 100) : 0; $rows[] = [ (string) $slot->slot_no, + $slot->product_id ?? '', $slot->product->name ?? '', $slot->product->barcode ?? '', (string) $slot->type,