fix payments
This commit is contained in:
@@ -658,10 +658,10 @@ public function financialReport()
|
||||
}, $discountDetailsBuilder->orderBy('du.id', 'ASC')->get()->getResultArray());
|
||||
|
||||
$paymentDetailsBuilder = $db->table('payments p')
|
||||
->select("p.id, p.invoice_id, p.parent_id, p.paid_amount, p.payment_method, p.payment_date, p.status, p.transaction_id, p.check_number, i.invoice_number, CONCAT(COALESCE(u.firstname, ''), ' ', COALESCE(u.lastname, '')) AS parent_name")
|
||||
->join('invoices i', 'i.id = p.invoice_id', 'left')
|
||||
->select("p.id, p.invoice_id, p.parent_id, p.paid_amount, p.payment_method, p.payment_date, p.status AS payment_status, p.transaction_id, p.check_number, i.invoice_number, i.balance AS invoice_current_balance, i.status AS invoice_status, i.school_year, CONCAT(COALESCE(u.firstname, ''), ' ', COALESCE(u.lastname, '')) AS parent_name")
|
||||
->join('invoices i', 'i.id = p.invoice_id', 'inner')
|
||||
->join('users u', 'u.id = p.parent_id', 'left')
|
||||
->where('p.school_year', $schoolYear)
|
||||
->where('i.school_year', $schoolYear)
|
||||
->groupStart()
|
||||
->whereNotIn('p.status', $paymentExclude)
|
||||
->orWhere('p.status IS NULL', null, false)
|
||||
@@ -677,9 +677,12 @@ public function financialReport()
|
||||
'Parent' => trim((string)($row['parent_name'] ?? '')),
|
||||
'Invoice #' => (string)($row['invoice_number'] ?? ''),
|
||||
'Paid Amount' => (float)($row['paid_amount'] ?? 0),
|
||||
'Invoice Balance' => (float)($row['invoice_current_balance'] ?? 0),
|
||||
'Payment Method' => (string)($row['payment_method'] ?? ''),
|
||||
'Payment Date' => (string)($row['payment_date'] ?? ''),
|
||||
'Status' => (string)($row['status'] ?? ''),
|
||||
'Payment Status' => (string)($row['payment_status'] ?? ''),
|
||||
'Invoice Status' => (string)($row['invoice_status'] ?? ''),
|
||||
'School Year' => (string)($row['school_year'] ?? ''),
|
||||
'Transaction ID' => (string)($row['transaction_id'] ?? ''),
|
||||
'Check Number' => (string)($row['check_number'] ?? ''),
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user