[FEAT] 實作公共事業費逾期提醒、租戶自訂通知設定及發送測試信功能
All checks were successful
ERP-Deploy-Demo / deploy-demo (push) Successful in 56s
All checks were successful
ERP-Deploy-Demo / deploy-demo (push) Successful in 56s
This commit is contained in:
@@ -10,26 +10,37 @@ class UtilityFee extends Model
|
||||
/** @use HasFactory<\Database\Factories\UtilityFeeFactory> */
|
||||
use HasFactory;
|
||||
|
||||
// 狀態常數
|
||||
const STATUS_PENDING = 'pending';
|
||||
const STATUS_PAID = 'paid';
|
||||
const STATUS_OVERDUE = 'overdue';
|
||||
|
||||
protected $fillable = [
|
||||
'transaction_date',
|
||||
'due_date',
|
||||
'category',
|
||||
'amount',
|
||||
'payment_status',
|
||||
'invoice_number',
|
||||
'description',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'transaction_date' => 'date:Y-m-d',
|
||||
'due_date' => 'date:Y-m-d',
|
||||
'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'),
|
||||
$snapshot = [
|
||||
'transaction_date' => $this->transaction_date?->format('Y-m-d'),
|
||||
'due_date' => $this->due_date?->format('Y-m-d'),
|
||||
'category' => $this->category,
|
||||
'amount' => $this->amount,
|
||||
'payment_status' => $this->payment_status,
|
||||
'invoice_number' => $this->invoice_number,
|
||||
]);
|
||||
];
|
||||
$activity->properties = $activity->properties->put('snapshot', $snapshot);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user