join('t_supplierdetailsn', 't_expense.supplier_id = t_supplierdetailsn.SupplierID') ->where('t_expense.isactive', 1) ->where('t_expense.created_on >=',"$fromDate") ->where('t_expense.created_on <=',"$toDate") ->orderBy('t_expense.created_on', 'DESC') ->findAll(); } // Insert new expense public function insertExpense($data) { return $this->insert($data) ? $this->insertID() : false; } // Get expense by ID public function getExpenseById($id) { return $this->where($this->primaryKey, $id)->first(); // Use primary key } // Update expense by ID public function updateExpense($id, $data) { return $this->update($id, $data); // Use primary key } public function deleteFile($expenseId) { // Update the database to set transporter_file to null return $this->update($expenseId, ['transporter_file' => null]); } } ?>