fix financial issues
This commit is contained in:
@@ -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',
|
||||
];
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user