This commit is contained in:
@@ -860,8 +860,13 @@ class LandingPageController extends BaseController
|
||||
->get()
|
||||
->getResultArray();
|
||||
|
||||
// Fetch latest invoice balance
|
||||
$paymentBalance = $this->invoiceModel->getLatestInvoiceTotalAmount($parentId);
|
||||
$paymentRow = $this->db->table('invoices')
|
||||
->select('COALESCE(SUM(balance), 0) AS account_balance')
|
||||
->where('parent_id', $parentId)
|
||||
->where('school_year', $this->schoolYear)
|
||||
->get()
|
||||
->getRowArray();
|
||||
$paymentBalance = (float) ($paymentRow['account_balance'] ?? 0);
|
||||
|
||||
// Pass data to the view, including the deadlines
|
||||
return view('/landing_page/parent_dashboard', [
|
||||
|
||||
Reference in New Issue
Block a user