feat: 倉庫業務屬性、庫存成本追蹤與採購單功能更新
1. 倉庫管理:新增業務類型 (Owned/External/Customer) 與車牌資訊與司機欄位。 2. 庫存管理:實作成本追蹤 (unit_cost, total_value),更新列表與撥補單顯示。 3. 採購單:新增採購日期 (order_date),調整欄位名稱與順序。 4. 前端優化:更新相關 TS Type 定義與 UI 顯示。
This commit is contained in:
@@ -18,6 +18,8 @@ class Inventory extends Model
|
||||
'product_id',
|
||||
'quantity',
|
||||
'location',
|
||||
'unit_cost',
|
||||
'total_value',
|
||||
// 批號追溯欄位
|
||||
'batch_number',
|
||||
'box_number',
|
||||
@@ -32,6 +34,8 @@ class Inventory extends Model
|
||||
protected $casts = [
|
||||
'arrival_date' => 'date:Y-m-d',
|
||||
'expiry_date' => 'date:Y-m-d',
|
||||
'unit_cost' => 'decimal:4',
|
||||
'total_value' => 'decimal:4',
|
||||
];
|
||||
|
||||
/**
|
||||
|
||||
@@ -15,6 +15,7 @@ class InventoryTransaction extends Model
|
||||
'inventory_id',
|
||||
'type',
|
||||
'quantity',
|
||||
'unit_cost',
|
||||
'balance_before',
|
||||
'balance_after',
|
||||
'reason',
|
||||
@@ -26,6 +27,7 @@ class InventoryTransaction extends Model
|
||||
|
||||
protected $casts = [
|
||||
'actual_time' => 'datetime',
|
||||
'unit_cost' => 'decimal:4',
|
||||
];
|
||||
|
||||
public function inventory(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
|
||||
@@ -15,13 +15,17 @@ class Warehouse extends Model
|
||||
protected $fillable = [
|
||||
'code',
|
||||
'name',
|
||||
'type',
|
||||
'address',
|
||||
'description',
|
||||
'is_sellable',
|
||||
'license_plate',
|
||||
'driver_name',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'is_sellable' => 'boolean',
|
||||
'type' => \App\Enums\WarehouseType::class,
|
||||
];
|
||||
|
||||
public function getActivitylogOptions(): \Spatie\Activitylog\LogOptions
|
||||
|
||||
Reference in New Issue
Block a user