1. 修復倉庫統計數據加總與樣式。 2. 修正可用庫存計算邏輯(排除不可銷售倉庫)。 3. 撥補單商品列表加入批號與效期顯示。 4. 修正撥補單儲存邏輯以支援精確批號轉移。 5. 整合 FEATURES.md 至 README.md。
54 lines
1.1 KiB
PHP
54 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace App\Modules\Production\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use App\Modules\Inventory\Models\Product;
|
|
|
|
class ProductionOrderItem extends Model
|
|
{
|
|
/** @use HasFactory<\Database\Factories\ProductionOrderItemFactory> */
|
|
use HasFactory;
|
|
|
|
protected $fillable = [
|
|
'production_order_id',
|
|
'inventory_id',
|
|
'quantity_used',
|
|
'unit_id',
|
|
];
|
|
|
|
protected $casts = [
|
|
'quantity_used' => 'decimal:4',
|
|
];
|
|
|
|
/**
|
|
* @deprecated 使用 InventoryServiceInterface 獲取庫存資訊
|
|
*/
|
|
public function inventory()
|
|
{
|
|
return null;
|
|
}
|
|
|
|
/**
|
|
* @deprecated
|
|
*/
|
|
public function unit()
|
|
{
|
|
return null;
|
|
}
|
|
|
|
public function productionOrder(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
|
{
|
|
return $this->belongsTo(ProductionOrder::class);
|
|
}
|
|
|
|
/**
|
|
* @deprecated 使用 InventoryServiceInterface 獲取產品資訊
|
|
*/
|
|
public function product()
|
|
{
|
|
return null;
|
|
}
|
|
}
|