[FIX] 修復所有 E2E 模組測試的標題定位器以及將測試帳號還原為 admin 權限
All checks were successful
ERP-Deploy-Demo / deploy-demo (push) Successful in 55s
All checks were successful
ERP-Deploy-Demo / deploy-demo (push) Successful in 55s
This commit is contained in:
@@ -101,11 +101,13 @@ class SalesImportController extends Controller
|
||||
|
||||
public function confirm(SalesImportBatch $import, InventoryServiceInterface $inventoryService)
|
||||
{
|
||||
if ($import->status !== 'pending') {
|
||||
return back()->with('error', '此批次無法確認。');
|
||||
}
|
||||
return DB::transaction(function () use ($import, $inventoryService) {
|
||||
// 加上 lockForUpdate() 防止併發確認
|
||||
$import = SalesImportBatch::lockForUpdate()->find($import->id);
|
||||
|
||||
DB::transaction(function () use ($import, $inventoryService) {
|
||||
if (!$import || $import->status !== 'pending') {
|
||||
throw new \Exception('此批次無法確認或已被處理。');
|
||||
}
|
||||
// 1. Prepare Aggregation
|
||||
$aggregatedDeductions = []; // Key: "warehouse_id:product_id:slot"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user