Display total in views
Used this hook

function fee_management_views_pre_render(&amp;$view) {
  if($view-&gt;name == 'payment_schedules' &amp;&amp; ($view-&gt;current_display == 'receive_payments')) {    
        $total_payable_amount = 0;
        foreach($view-&gt;result as $key =&gt; $payment) {
            $total_payable_amount += $payment-&gt;fee_schedule_instalments_amount;
        }
        $view-&gt;attachment_after = "&lt;div&gt; Total Payable Amount: $total_payable_amount&lt;/div&gt;"; // does not work with fee_management_views_post_render

    }
}