feat: 修正庫存與撥補單邏輯並整合文件
1. 修復倉庫統計數據加總與樣式。 2. 修正可用庫存計算邏輯(排除不可銷售倉庫)。 3. 撥補單商品列表加入批號與效期顯示。 4. 修正撥補單儲存邏輯以支援精確批號轉移。 5. 整合 FEATURES.md 至 README.md。
This commit is contained in:
@@ -11,26 +11,25 @@ class UtilityFee extends Model
|
||||
use HasFactory;
|
||||
|
||||
protected $fillable = [
|
||||
'type', // 'electricity', 'water', 'gas', etc.
|
||||
'billing_period_start',
|
||||
'billing_period_end',
|
||||
'due_date',
|
||||
'transaction_date',
|
||||
'category',
|
||||
'amount',
|
||||
'usage_amount', // kWh, m3, etc.
|
||||
'unit', // 度, 立方米
|
||||
'status', // 'pending', 'paid', 'overdue'
|
||||
'paid_at',
|
||||
'payment_method',
|
||||
'notes',
|
||||
'receipt_image_path',
|
||||
'invoice_number',
|
||||
'description',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'billing_period_start' => 'date',
|
||||
'billing_period_end' => 'date',
|
||||
'due_date' => 'date',
|
||||
'paid_at' => 'datetime',
|
||||
'transaction_date' => 'date',
|
||||
'amount' => 'decimal:2',
|
||||
'usage_amount' => 'decimal:2',
|
||||
];
|
||||
|
||||
public function tapActivity(\Spatie\Activitylog\Contracts\Activity $activity, string $eventName)
|
||||
{
|
||||
$activity->properties = $activity->properties->put('snapshot', [
|
||||
'transaction_date' => $this->transaction_date->format('Y-m-d'),
|
||||
'category' => $this->category,
|
||||
'amount' => $this->amount,
|
||||
'invoice_number' => $this->invoice_number,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user