fix financial issues

This commit is contained in:
root
2026-06-01 02:08:27 -04:00
parent 090cb88573
commit 6444b61416
56 changed files with 4196 additions and 1824 deletions
+1 -1
View File
@@ -35,7 +35,7 @@ class AdditionalChargeModel extends Model
'description' => 'permit_empty|string',
'amount' => 'required|decimal',
'due_date' => 'permit_empty|valid_date',
'status' => 'required|in_list[pending,applied]',
'status' => 'required|in_list[pending,applied,voided]',
'created_by' => 'permit_empty|integer',
];
-38
View File
@@ -1,38 +0,0 @@
<?php
namespace App\Models;
use CodeIgniter\Model;
class PayPalPaymentModel extends Model
{
protected $table = 'paypal_payments';
protected $primaryKey = 'id';
protected $allowedFields = [
'webhook_id',
'parent_school_id',
'order_id',
'transaction_id',
'status',
'amount',
'currency',
'paypal_fee',
'net_amount',
'payer_email',
'merchant_id',
'event_type',
'summary',
'raw_payload',
'synced',
'semester',
'school_year',
'sync_attempts'
];
// Enable timestamps
protected $useTimestamps = true;
protected $createdField = 'created_at';
protected $updatedField = ''; // not used; leave empty if not needed
}
+2
View File
@@ -17,6 +17,7 @@ class PaymentModel extends Model
'paid_amount',
'balance',
'number_of_installments',
'installment_seq',
'transaction_id',
'check_file',
'check_number',
@@ -114,6 +115,7 @@ class PaymentModel extends Model
->selectSum('paid_amount', 'total_paid')
->where('parent_id', $parentId)
->where('school_year', $schoolYear)
->whereNotIn('status', ['void', 'voided', 'refunded', 'failed', 'chargeback', 'declined', 'reversed', 'canceled', 'cancelled'])
->get()
->getRowArray();
-30
View File
@@ -1,30 +0,0 @@
<?php
namespace App\Models;
use CodeIgniter\Model;
class PaypalTransactionModel extends Model
{
protected $table = 'paypal_transactions';
protected $primaryKey = 'id';
protected $allowedFields = [
'transaction_id',
'payment_id',
'firstname',
'lastname',
'event_type',
'payer_email',
'amount',
'currency',
'status',
'payment_method',
'transaction_fee',
'semester',
'school_year',
'raw_data'
];
protected $useTimestamps = true;
}