39 lines
1.1 KiB
PHP
39 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use CodeIgniter\Model;
|
|
use App\Models\Concerns\SchoolYearAutoFillTrait;
|
|
use App\Libraries\FinancialStatus;
|
|
|
|
class ReimbursementModel extends Model
|
|
{
|
|
use SchoolYearAutoFillTrait;
|
|
|
|
protected $table = 'reimbursements';
|
|
protected $primaryKey = 'id';
|
|
protected $allowedFields = [
|
|
'amount',
|
|
'reimbursed_to',
|
|
'approved_by',
|
|
'receipt_path',
|
|
'description',
|
|
'status',
|
|
'expense_id',
|
|
'added_by',
|
|
'school_year',
|
|
'semester',
|
|
'check_number',
|
|
'reimbursement_method',
|
|
'batch_number',
|
|
'updated_by',
|
|
];
|
|
protected $validationRules = [
|
|
'school_year' => 'required|string|max_length[9]',
|
|
'amount' => 'if_exist|decimal|greater_than[0]',
|
|
'status' => 'if_exist|in_list[' . FinancialStatus::REIMBURSEMENT_PENDING . ',' . FinancialStatus::REIMBURSEMENT_APPROVED . ',' . FinancialStatus::REIMBURSEMENT_PAID . ',' . FinancialStatus::REIMBURSEMENT_REJECTED . ',' . FinancialStatus::REIMBURSEMENT_REVERSED . ',Pending,Approved,Paid,Rejected,Reversed]',
|
|
];
|
|
|
|
|
|
}
|