feat: 優化操作紀錄顯示與邏輯 (恢復描述欄位、支援來源標記、改進快照)
This commit is contained in:
@@ -56,6 +56,9 @@ class TransferOrderController extends Controller
|
||||
// 3. 執行庫存轉移 (扣除來源)
|
||||
$oldSourceQty = $sourceInventory->quantity;
|
||||
$newSourceQty = $oldSourceQty - $validated['quantity'];
|
||||
|
||||
// 設定活動紀錄原因
|
||||
$sourceInventory->activityLogReason = "撥補出庫 至 {$targetWarehouse->name}";
|
||||
$sourceInventory->update(['quantity' => $newSourceQty]);
|
||||
|
||||
// 記錄來源異動
|
||||
@@ -72,6 +75,9 @@ class TransferOrderController extends Controller
|
||||
// 4. 執行庫存轉移 (增加目標)
|
||||
$oldTargetQty = $targetInventory->quantity;
|
||||
$newTargetQty = $oldTargetQty + $validated['quantity'];
|
||||
|
||||
// 設定活動紀錄原因
|
||||
$targetInventory->activityLogReason = "撥補入庫 來自 {$sourceWarehouse->name}";
|
||||
$targetInventory->update(['quantity' => $newTargetQty]);
|
||||
|
||||
// 記錄目標異動
|
||||
|
||||
Reference in New Issue
Block a user