add refund logic and fix books inventory logic
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use CodeIgniter\Model;
|
||||
|
||||
class WithdrawalFinancialCalculationModel extends Model
|
||||
{
|
||||
protected $table = 'withdrawal_financial_calculations';
|
||||
protected $primaryKey = 'id';
|
||||
protected $returnType = 'array';
|
||||
protected $useTimestamps = true;
|
||||
|
||||
protected $allowedFields = [
|
||||
'version', 'enrollment_id', 'student_id', 'parent_id', 'invoice_id',
|
||||
'school_year', 'policy_version', 'annual_fee_includes_books',
|
||||
'school_year_start_date', 'enrollment_date', 'withdrawal_request_date',
|
||||
'total_instructional_weeks', 'total_chargeable_days',
|
||||
'studied_calendar_days', 'studied_weeks', 'annual_fee_allocation_cents',
|
||||
'issued_book_charge_cents', 'annual_instruction_cents',
|
||||
'earned_tuition_cents', 'other_charge_cents', 'retained_charge_cents',
|
||||
'original_invoice_charge_cents', 'invoice_adjustment_cents',
|
||||
'adjusted_invoice_charge_cents',
|
||||
'valid_payment_cents', 'completed_payout_cents', 'open_reservation_cents',
|
||||
'refundable_credit_cents', 'new_refund_request_cents', 'balance_due_cents',
|
||||
'book_evidence_json', 'explanation_json', 'calculation_hash',
|
||||
'active_posted_key', 'books_discount_eligible', 'status', 'superseded_by_id',
|
||||
'override_reason', 'overridden_at', 'overridden_by',
|
||||
'calculated_by', 'posted_by', 'calculated_at', 'posted_at',
|
||||
];
|
||||
|
||||
protected $validationRules = [
|
||||
'version' => 'required|integer|greater_than[0]',
|
||||
'enrollment_id' => 'required|integer',
|
||||
'student_id' => 'required|integer',
|
||||
'parent_id' => 'required|integer',
|
||||
'school_year' => 'required|string|max_length[16]',
|
||||
'annual_fee_includes_books' => 'required|in_list[1]',
|
||||
'total_instructional_weeks' => 'required|integer|greater_than[0]',
|
||||
'status' => 'required|in_list[preview,posted,superseded,requires_review]',
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user