Deposit Slip: ' . date('l, F jS, Y, g:ia') . '' . "\n"; //pr(compact('deposit')); // Handle account summaries $rows = array(); $row_class = array(); foreach ($deposit['types'] AS $type) { $row_class[] = array(); $rows[] = array($type['name'].':', FormatHelper::_n(count($type['entries']), 'Item'), FormatHelper::currency($type['total'], true)); } $row_class[] = 'grand'; $rows[] = array('Deposit Total:', null, FormatHelper::currency($deposit['total'], true)); echo $this->element('table', array('class' => 'deposit-summary', 'rows' => $rows, 'row_class' => $row_class, 'column_class' => array('account', 'quantity', 'total'), 'suppress_alternate_rows' => true, )); // Print out the items of each ledger foreach ($deposit['types'] AS $type) { if (count($type['entries']) == 0) continue; $rows = array(); foreach ($type['entries'] AS $entry) { $rows[] = array($entry['customer'], $entry['name'], $entry['amount']); } echo $this->element('table', array('class' => 'item deposit-slip list', 'caption' => $type['name'] . ' Items', 'rows' => $rows, 'headers' => array('Customer', 'Item', 'Amount'), 'column_class' => array('customer', 'item', 'amount'), )); } /* End page div */ //echo '' . "\n";