/** * Return amount (with tax) of all credit notes and deposits invoices used by invoice * * @return int <0 if KO, Sum of credit notes and deposits amount otherwise */ function getSumCreditNotesUsed() { require_once DOL_DOCUMENT_ROOT . '/core/class/discount.class.php'; $discountstatic = new DiscountAbsolute($this->db); $result = $discountstatic->getSumCreditNotesUsed($this); if ($result >= 0) { return $result; } else { $this->error = $discountstatic->error; return -1; } }