/** * Gets the total cost of all items in the invoice, using getTotal() on each Item, * but does not apply tax. * * @var Invoice Invoice to total. * * @return float Total cost of the invoice Items. */ public function getSubTotal(Invoice $oInvoice) { $fSubTotal = 0.0; $aItems = $oInvoice->getItems(); foreach ($aItems as $iKey => $oItem) { $fSubTotal += $oItem->getTotal(); } return $fSubTotal; }
public function persistInvoice(Invoice $oInvoice) { $this->invoices[$oInvoice->getID()] = $oInvoice; $this->dataConnector->persistInvoice($oInvoice); }