feat: 統一進貨單 UI、修復庫存異動紀錄與廠商詳情顯示報錯
All checks were successful
Koori-ERP-Deploy-System / deploy-demo (push) Successful in 51s
Koori-ERP-Deploy-System / deploy-production (push) Has been skipped

This commit is contained in:
2026-01-27 17:23:31 +08:00
parent a7c445bd3f
commit 95d8dc2e84
24 changed files with 1613 additions and 466 deletions

View File

@@ -420,7 +420,7 @@ class PurchaseOrderController extends Controller
'order_date' => 'required|date', // 新增驗證
'expected_delivery_date' => 'nullable|date',
'remark' => 'nullable|string',
'status' => 'required|string|in:draft,pending,processing,shipping,confirming,completed,cancelled,partial',
'status' => 'required|string|in:draft,pending,approved,partial,completed,closed,cancelled',
'invoice_number' => ['nullable', 'string', 'max:11', 'regex:/^[A-Z]{2}-\d{8}$/'],
'invoice_date' => 'nullable|date',
'invoice_amount' => 'nullable|numeric|min:0',

View File

@@ -95,14 +95,15 @@ class VendorController extends Controller
if (!$product) return null;
return (object) [
'id' => (string) $pivot->id,
'productId' => (string) $product->id,
'productName' => $product->name,
'unit' => $product->baseUnit?->name ?? 'N/A',
'baseUnit' => $product->baseUnit?->name,
'largeUnit' => $product->largeUnit?->name,
'conversionRate' => (float) $product->conversion_rate,
'lastPrice' => (float) $pivot->last_price,
'id' => (string) $product->id, // Frontend expects product ID here as p.id
'name' => $product->name,
'baseUnit' => $product->baseUnit ? (object)['name' => $product->baseUnit->name] : null,
'largeUnit' => $product->largeUnit ? (object)['name' => $product->largeUnit->name] : null,
'conversion_rate' => (float) $product->conversion_rate,
'purchase_unit' => $product->purchaseUnit?->name,
'pivot' => (object) [
'last_price' => (float) $pivot->last_price,
],
];
})->filter()->values();
@@ -119,7 +120,7 @@ class VendorController extends Controller
'email' => $vendor->email,
'address' => $vendor->address,
'remark' => $vendor->remark,
'supplyProducts' => $supplyProducts,
'products' => $supplyProducts, // Changed from supplyProducts to products
];
return Inertia::render('Vendor/Show', [