[RELEASE] demo -> main: 機台庫存匯出 Excel 加「商品ID」欄
1. 機台庫存概覽批次匯出與單機台詳細匯出,欄位新增「商品ID」(貨道號後、商品名稱前)
This commit is contained in:
commit
c4d34926a6
@ -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,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user