public function checkPaidAmount() { if (false == $this->getInvoiceId()) { return false; } if (false == $this->getAmount()) { return false; } $objDataInvoice = new GSALES_DATA_INVOICE(); $objInvoice = $objDataInvoice->getInvoiceByIdWithoutUserCheck($this->getInvoiceId(), true); if ($objInvoice->getOpenAmount() == $this->getAmount()) { return true; } if (number_format($this->getAmount(), 2) == number_format($objInvoice->getOpenAmount(), 2)) { return true; } // to compare calculated floats (currency) :( return false; }