_rows as $row) { $amount += $row->amountNoTax(); } return $amount; } /** * * calculate the total amount for the selected rowset * * @return float */ public function totalAmount() { $amount = 0; /** @var \Ppb\Db\Table\Row\AbstractAccounting $row */ foreach ($this->_rows as $row) { $amount += $row->totalAmount(); } return $amount; } /** * * calculate the tax amount for the selected rowset * * @return float */ public function taxAmount() { return $this->totalAmount() - $this->amountNoTax(); } /** * * get rowset currency * * @return string|null */ public function currency() { /** @var \Ppb\Db\Table\Row\AbstractAccounting $row */ $row = $this->_rows[0]; if ($row instanceof AbstractAccountingRow) { return $row->getData('currency'); } return null; } }