<?php
class AgedReceivablesController extends Controller
{
    public function indexAction()
    {
        $asOf = trim((string)($_GET['as_of'] ?? '')) ?: date('Y-m-d');
        $m = new AgedReceivables();

        $this->view->setLayout($this->roleLayout());
        $this->view->render('AgedReceivables/index', [
            'page_title' => 'Aged Receivables',
            'as_of'      => $asOf,
            'rows'       => $m->summary($asOf),
            'totals'     => $m->totals($asOf),
        ]);
    }
}
