Deposit Slip: ' . date('l, F jS, Y, g:ia') . '' . "\n"; //pr(compact('deposit')); // Handle account summaries $rows = array(); $row_class = array(); foreach ($deposit['ledgers'] AS $ledger) { $row_class[] = array(); $rows[] = array($ledger['name'].':', FormatHelper::_n(count($ledger['entries']), 'Item'), FormatHelper::currency($ledger['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['ledgers'] AS $ledger) { //echo ('Count: ' . count($ledger['entries']) . '
'); //pr($ledger['entries']); if (count($ledger['entries']) == 0) continue; $rows = array(); foreach ($ledger['entries'] AS $entry) { $rows[] = array($entry['Customer']['name'], $entry['MonetarySource']['name'], $entry['LedgerEntry']['amount']); } echo $this->element('table', array('class' => 'item deposit-slip list', 'caption' => $ledger['name'] . ' Items', 'rows' => $rows, 'headers' => array('Customer', 'Item', 'Amount'), 'column_class' => array('customer', 'item', 'amount'), )); } /* End page div */ //echo '' . "\n";