大更新
All checks were successful
Koori-ERP-Deploy-System / deploy-demo (push) Has been skipped
Koori-ERP-Deploy-System / deploy-production (push) Successful in 58s

This commit is contained in:
2026-01-08 16:32:10 +08:00
parent 7848976a06
commit 0b60dab208
25 changed files with 661 additions and 392 deletions

View File

@@ -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 ?? '個',
];
});