1. 實作一鍵補貨智慧重新計算邏輯:切換倉庫或機台時自動更新預覽。 2. 新增多語系支援:補齊繁中、日文、英文語系檔中的庫存/上限、重新計算等關鍵字。 3. 優化 RWD 響應式佈局:在手機版自動切換為卡片式 (Card) 佈局,提升行動裝置操作體驗。 4. 新增刪除功能:預覽清單中每一行貨道皆可獨立移除,並配合唯一辨識碼 (slot_no) 修正 state 殘留 bug。 5. 完善一鍵補貨 Modal 腳底控制項:新增手動「重新計算」按鈕與樣式優化。 6. 完成補貨單管理功能:包含新增、取消、分配人員等後台邏輯與多租戶隔離。 7. 優化庫存轉移 (Transfers) 介面與詳情面板 RWD 表現。
56 lines
1.1 KiB
PHP
56 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace App\Models\Warehouse;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
|
use App\Traits\TenantScoped;
|
|
|
|
class StockInOrder extends Model
|
|
{
|
|
use HasFactory, SoftDeletes, TenantScoped;
|
|
|
|
protected $fillable = [
|
|
'company_id',
|
|
'warehouse_id',
|
|
'order_no',
|
|
'status',
|
|
'note',
|
|
'created_by',
|
|
'completed_at',
|
|
];
|
|
|
|
public const STATUS_DRAFT = 'draft';
|
|
public const STATUS_COMPLETED = 'completed';
|
|
public const STATUS_CANCELLED = 'cancelled';
|
|
|
|
protected $casts = [
|
|
'completed_at' => 'datetime',
|
|
];
|
|
|
|
/**
|
|
* 所屬倉庫
|
|
*/
|
|
public function warehouse()
|
|
{
|
|
return $this->belongsTo(Warehouse::class);
|
|
}
|
|
|
|
/**
|
|
* 入庫單明細
|
|
*/
|
|
public function items()
|
|
{
|
|
return $this->hasMany(StockInOrderItem::class);
|
|
}
|
|
|
|
/**
|
|
* 建立人
|
|
*/
|
|
public function creator()
|
|
{
|
|
return $this->belongsTo(\App\Models\System\User::class, 'created_by');
|
|
}
|
|
}
|