Example #1
0
 /**
  * Delete this receipt.
  *
  * @param $parameters         an assoc. array of creation parameters TODO: to be defined
  *
  * @return TRUE if successfull, FALSE otherwise. In that case, the $parameters['error'] contains an error message
  */
 public function delete(&$parameters)
 {
     self::getCustomFields();
     // delete pdf file if exists
     $status = empty($parameters['status']) ? 'ORIGINAL' : $parameters['status'];
     $query = "DELETE FROM `civicrm_value_donation_receipt_%d` WHERE `id` = %d";
     $query = sprintf($query, self::$_custom_group_id, $this->Id);
     $result = CRM_Core_DAO::executeQuery($query, $status);
     CRM_Donrec_Logic_ReceiptItem::deleteAll($this->Id);
     return TRUE;
 }