大更新
This commit is contained in:
@@ -97,7 +97,7 @@ class TransferOrderController extends Controller
|
||||
public function getWarehouseInventories(Warehouse $warehouse)
|
||||
{
|
||||
$inventories = $warehouse->inventories()
|
||||
->with(['product:id,name,base_unit,category_id', 'product.category'])
|
||||
->with(['product.baseUnit', 'product.category'])
|
||||
->where('quantity', '>', 0) // 只回傳有庫存的
|
||||
->get()
|
||||
->map(function ($inv) {
|
||||
@@ -106,7 +106,7 @@ class TransferOrderController extends Controller
|
||||
'productName' => $inv->product->name,
|
||||
'batchNumber' => 'BATCH-' . $inv->id, // 模擬批號
|
||||
'availableQty' => (float) $inv->quantity,
|
||||
'unit' => $inv->product->base_unit,
|
||||
'unit' => $inv->product->baseUnit?->name ?? '個',
|
||||
];
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user