Example #1
0
 /**
  * returns all the column names of this table
  *
  * @access public
  * @return array
  */
 function &fields()
 {
     if (!self::$_fields) {
         self::$_fields = array('contribution_id' => array('name' => 'id', 'type' => CRM_Utils_Type::T_INT, 'title' => ts('Contribution ID'), 'required' => true, 'import' => true, 'where' => 'civicrm_contribution.id', 'headerPattern' => '', 'dataPattern' => '', 'export' => true), 'contribution_contact_id' => array('name' => 'contact_id', 'type' => CRM_Utils_Type::T_INT, 'title' => ts('Contact ID'), 'required' => true, 'import' => true, 'where' => 'civicrm_contribution.contact_id', 'headerPattern' => '/contact(.?id)?/i', 'dataPattern' => '/^\\d+$/', 'export' => true, 'FKClassName' => 'CRM_Contact_DAO_Contact'), 'contribution_type_id' => array('name' => 'contribution_type_id', 'type' => CRM_Utils_Type::T_INT, 'FKClassName' => 'CRM_Contribute_DAO_ContributionType'), 'contribution_page_id' => array('name' => 'contribution_page_id', 'type' => CRM_Utils_Type::T_INT, 'FKClassName' => 'CRM_Contribute_DAO_ContributionPage'), 'payment_instrument_id' => array('name' => 'payment_instrument_id', 'type' => CRM_Utils_Type::T_INT), 'receive_date' => array('name' => 'receive_date', 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME, 'title' => ts('Receive Date'), 'import' => true, 'where' => 'civicrm_contribution.receive_date', 'headerPattern' => '/receive(.?date)?/i', 'dataPattern' => '/^\\d{4}-?\\d{2}-?\\d{2} ?(\\d{2}:?\\d{2}:?(\\d{2})?)?$/', 'export' => true), 'non_deductible_amount' => array('name' => 'non_deductible_amount', 'type' => CRM_Utils_Type::T_MONEY, 'title' => ts('Non-deductible Amount'), 'import' => true, 'where' => 'civicrm_contribution.non_deductible_amount', 'headerPattern' => '/non?.?deduct/i', 'dataPattern' => '/^\\d+(\\.\\d{2})?$/', 'export' => true), 'total_amount' => array('name' => 'total_amount', 'type' => CRM_Utils_Type::T_MONEY, 'title' => ts('Total Amount'), 'required' => true, 'import' => true, 'where' => 'civicrm_contribution.total_amount', 'headerPattern' => '/^total|(.?^am(ou)?nt)/i', 'dataPattern' => '/^\\d+(\\.\\d{2})?$/', 'export' => true), 'fee_amount' => array('name' => 'fee_amount', 'type' => CRM_Utils_Type::T_MONEY, 'title' => ts('Fee Amount'), 'import' => true, 'where' => 'civicrm_contribution.fee_amount', 'headerPattern' => '/fee(.?am(ou)?nt)?/i', 'dataPattern' => '/^\\d+(\\.\\d{2})?$/', 'export' => true), 'net_amount' => array('name' => 'net_amount', 'type' => CRM_Utils_Type::T_MONEY, 'title' => ts('Net Amount'), 'import' => true, 'where' => 'civicrm_contribution.net_amount', 'headerPattern' => '/net(.?am(ou)?nt)?/i', 'dataPattern' => '/^\\d+(\\.\\d{2})?$/', 'export' => true), 'trxn_id' => array('name' => 'trxn_id', 'type' => CRM_Utils_Type::T_STRING, 'title' => ts('Transaction ID'), 'maxlength' => 255, 'size' => CRM_Utils_Type::HUGE, 'import' => true, 'where' => 'civicrm_contribution.trxn_id', 'headerPattern' => '/tr(ansactio|x)n(.?id)?/i', 'dataPattern' => '', 'export' => true), 'invoice_id' => array('name' => 'invoice_id', 'type' => CRM_Utils_Type::T_STRING, 'title' => ts('Invoice ID'), 'maxlength' => 255, 'size' => CRM_Utils_Type::HUGE, 'import' => true, 'where' => 'civicrm_contribution.invoice_id', 'headerPattern' => '/invoice(.?id)?/i', 'dataPattern' => '', 'export' => true), 'currency' => array('name' => 'currency', 'type' => CRM_Utils_Type::T_STRING, 'title' => ts('Currency'), 'required' => true, 'maxlength' => 64, 'size' => CRM_Utils_Type::BIG, 'import' => true, 'where' => 'civicrm_contribution.currency', 'headerPattern' => '/cur(rency)?/i', 'dataPattern' => '/^[A-Z]{3}$/i', 'export' => true), 'cancel_date' => array('name' => 'cancel_date', 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME, 'title' => ts('Cancel Date'), 'import' => true, 'where' => 'civicrm_contribution.cancel_date', 'headerPattern' => '/cancel(.?date)?/i', 'dataPattern' => '/^\\d{4}-?\\d{2}-?\\d{2} ?(\\d{2}:?\\d{2}:?(\\d{2})?)?$/', 'export' => true), 'cancel_reason' => array('name' => 'cancel_reason', 'type' => CRM_Utils_Type::T_TEXT, 'title' => ts('Cancel Reason'), 'import' => true, 'where' => 'civicrm_contribution.cancel_reason', 'headerPattern' => '/(cancel.?)?reason/i', 'dataPattern' => '', 'export' => true), 'receipt_date' => array('name' => 'receipt_date', 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME, 'title' => ts('Receipt Date'), 'import' => true, 'where' => 'civicrm_contribution.receipt_date', 'headerPattern' => '/receipt(.?date)?/i', 'dataPattern' => '/^\\d{4}-?\\d{2}-?\\d{2} ?(\\d{2}:?\\d{2}:?(\\d{2})?)?$/', 'export' => true), 'thankyou_date' => array('name' => 'thankyou_date', 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME, 'title' => ts('Thank-you Date'), 'import' => true, 'where' => 'civicrm_contribution.thankyou_date', 'headerPattern' => '/thank(s|(.?you))?(.?date)?/i', 'dataPattern' => '/^\\d{4}-?\\d{2}-?\\d{2} ?(\\d{2}:?\\d{2}:?(\\d{2})?)?$/', 'export' => true), 'contribution_source' => array('name' => 'source', 'type' => CRM_Utils_Type::T_STRING, 'title' => ts('Contribution Source'), 'maxlength' => 255, 'size' => CRM_Utils_Type::HUGE, 'import' => true, 'where' => 'civicrm_contribution.source', 'headerPattern' => '/source/i', 'dataPattern' => '', 'export' => true), 'amount_level' => array('name' => 'amount_level', 'type' => CRM_Utils_Type::T_TEXT, 'title' => ts('Amount Label'), 'import' => true, 'where' => 'civicrm_contribution.amount_level', 'headerPattern' => '', 'dataPattern' => '', 'export' => true), 'contribution_recur_id' => array('name' => 'contribution_recur_id', 'type' => CRM_Utils_Type::T_INT, 'FKClassName' => 'CRM_Contribute_DAO_ContributionRecur'), 'honor_contact_id' => array('name' => 'honor_contact_id', 'type' => CRM_Utils_Type::T_INT, 'FKClassName' => 'CRM_Contact_DAO_Contact'), 'is_test' => array('name' => 'is_test', 'type' => CRM_Utils_Type::T_BOOLEAN, 'title' => ts('Test'), 'import' => true, 'where' => 'civicrm_contribution.is_test', 'headerPattern' => '', 'dataPattern' => '', 'export' => true), 'is_pay_later' => array('name' => 'is_pay_later', 'type' => CRM_Utils_Type::T_BOOLEAN, 'title' => ts('Is Pay Later'), 'import' => true, 'where' => 'civicrm_contribution.is_pay_later', 'headerPattern' => '', 'dataPattern' => '', 'export' => true), 'contribution_status_id' => array('name' => 'contribution_status_id', 'type' => CRM_Utils_Type::T_INT, 'title' => ts('Contribution Status'), 'import' => true, 'where' => 'civicrm_contribution.contribution_status_id', 'headerPattern' => '/status/i', 'dataPattern' => '', 'export' => true, 'default' => ''), 'honor_type_id' => array('name' => 'honor_type_id', 'type' => CRM_Utils_Type::T_INT, 'title' => ts('Honor Type')), 'address_id' => array('name' => 'address_id', 'type' => CRM_Utils_Type::T_INT, 'FKClassName' => 'CRM_Core_DAO_Address'), 'check_number' => array('name' => 'check_number', 'type' => CRM_Utils_Type::T_STRING, 'title' => ts('Check Number'), 'maxlength' => 255, 'size' => CRM_Utils_Type::HUGE, 'import' => true, 'where' => 'civicrm_contribution.check_number', 'headerPattern' => '/check(.?number)?/i', 'dataPattern' => '', 'export' => true));
     }
     return self::$_fields;
 }
Example #2
0
 /**
  * Returns all the column names of this table
  *
  * @return array
  */
 static function &fields()
 {
     if (!self::$_fields) {
         self::$_fields = array('contribution_id' => array('name' => 'id', 'type' => CRM_Utils_Type::T_INT, 'title' => ts('Contribution ID'), 'description' => 'Contribution ID', 'required' => true, 'import' => true, 'where' => 'civicrm_contribution.id', 'headerPattern' => '', 'dataPattern' => '', 'export' => true), 'contribution_contact_id' => array('name' => 'contact_id', 'type' => CRM_Utils_Type::T_INT, 'title' => ts('Contact ID'), 'description' => 'FK to Contact ID', 'required' => true, 'import' => true, 'where' => 'civicrm_contribution.contact_id', 'headerPattern' => '/contact(.?id)?/i', 'dataPattern' => '/^\\d+$/', 'export' => true, 'FKClassName' => 'CRM_Contact_DAO_Contact', 'html' => array('type' => 'EntityRef')), 'financial_type_id' => array('name' => 'financial_type_id', 'type' => CRM_Utils_Type::T_INT, 'title' => ts('Financial Type'), 'description' => 'FK to Financial Type for (total_amount - non_deductible_amount).', 'export' => false, 'where' => 'civicrm_contribution.financial_type_id', 'headerPattern' => '', 'dataPattern' => '', 'FKClassName' => 'CRM_Financial_DAO_FinancialType', 'html' => array('type' => 'Select'), 'pseudoconstant' => array('table' => 'civicrm_financial_type', 'keyColumn' => 'id', 'labelColumn' => 'name')), 'contribution_page_id' => array('name' => 'contribution_page_id', 'type' => CRM_Utils_Type::T_INT, 'title' => ts('Contribution Page ID'), 'description' => 'The Contribution Page which triggered this contribution', 'import' => true, 'where' => 'civicrm_contribution.contribution_page_id', 'headerPattern' => '', 'dataPattern' => '', 'export' => true, 'FKClassName' => 'CRM_Contribute_DAO_ContributionPage', 'html' => array('type' => 'Select'), 'pseudoconstant' => array('table' => 'civicrm_contribution_page', 'keyColumn' => 'id', 'labelColumn' => 'title')), 'payment_instrument_id' => array('name' => 'payment_instrument_id', 'type' => CRM_Utils_Type::T_INT, 'title' => ts('Payment Method'), 'description' => 'FK to Payment Instrument', 'html' => array('type' => 'Select'), 'pseudoconstant' => array('optionGroupName' => 'payment_instrument', 'optionEditPath' => 'civicrm/admin/options/payment_instrument')), 'receive_date' => array('name' => 'receive_date', 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME, 'title' => ts('Date Received'), 'description' => 'Date contribution was received - not necessarily the creation date of the record', 'import' => true, 'where' => 'civicrm_contribution.receive_date', 'headerPattern' => '/receive(.?date)?/i', 'dataPattern' => '/^\\d{4}-?\\d{2}-?\\d{2} ?(\\d{2}:?\\d{2}:?(\\d{2})?)?$/', 'export' => true, 'html' => array('type' => 'Select Date')), 'non_deductible_amount' => array('name' => 'non_deductible_amount', 'type' => CRM_Utils_Type::T_MONEY, 'title' => ts('Non-deductible Amount'), 'description' => 'Portion of total amount which is NOT tax deductible. Equal to total_amount for non-deductible financial types.', 'precision' => array(20, 2), 'import' => true, 'where' => 'civicrm_contribution.non_deductible_amount', 'headerPattern' => '/non?.?deduct/i', 'dataPattern' => '/^\\d+(\\.\\d{2})?$/', 'export' => true, 'html' => array('type' => 'Text')), 'total_amount' => array('name' => 'total_amount', 'type' => CRM_Utils_Type::T_MONEY, 'title' => ts('Total Amount'), 'description' => 'Total amount of this contribution. Use market value for non-monetary gifts.', 'required' => true, 'precision' => array(20, 2), 'import' => true, 'where' => 'civicrm_contribution.total_amount', 'headerPattern' => '/^total|(.?^am(ou)?nt)/i', 'dataPattern' => '/^\\d+(\\.\\d{2})?$/', 'export' => true, 'html' => array('type' => 'Text')), 'fee_amount' => array('name' => 'fee_amount', 'type' => CRM_Utils_Type::T_MONEY, 'title' => ts('Fee Amount'), 'description' => 'actual processor fee if known - may be 0.', 'precision' => array(20, 2), 'import' => true, 'where' => 'civicrm_contribution.fee_amount', 'headerPattern' => '/fee(.?am(ou)?nt)?/i', 'dataPattern' => '/^\\d+(\\.\\d{2})?$/', 'export' => true, 'html' => array('type' => 'Text')), 'net_amount' => array('name' => 'net_amount', 'type' => CRM_Utils_Type::T_MONEY, 'title' => ts('Net Amount'), 'description' => 'actual funds transfer amount. total less fees. if processor does not report actual fee during transaction, this is set to total_amount.', 'precision' => array(20, 2), 'import' => true, 'where' => 'civicrm_contribution.net_amount', 'headerPattern' => '/net(.?am(ou)?nt)?/i', 'dataPattern' => '/^\\d+(\\.\\d{2})?$/', 'export' => true, 'html' => array('type' => 'Text')), 'trxn_id' => array('name' => 'trxn_id', 'type' => CRM_Utils_Type::T_STRING, 'title' => ts('Transaction ID'), 'description' => 'unique transaction id. may be processor id, bank id + trans id, or account number + check number... depending on payment_method', 'maxlength' => 255, 'size' => CRM_Utils_Type::HUGE, 'import' => true, 'where' => 'civicrm_contribution.trxn_id', 'headerPattern' => '/tr(ansactio|x)n(.?id)?/i', 'dataPattern' => '', 'export' => true, 'html' => array('type' => 'Text')), 'invoice_id' => array('name' => 'invoice_id', 'type' => CRM_Utils_Type::T_STRING, 'title' => ts('Invoice ID'), 'description' => 'unique invoice id, system generated or passed in', 'maxlength' => 255, 'size' => CRM_Utils_Type::HUGE, 'import' => true, 'where' => 'civicrm_contribution.invoice_id', 'headerPattern' => '/invoice(.?id)?/i', 'dataPattern' => '', 'export' => true, 'html' => array('type' => 'Text')), 'currency' => array('name' => 'currency', 'type' => CRM_Utils_Type::T_STRING, 'title' => ts('Currency'), 'description' => '3 character string, value from config setting or input via user.', 'maxlength' => 3, 'size' => CRM_Utils_Type::FOUR, 'import' => true, 'where' => 'civicrm_contribution.currency', 'headerPattern' => '/cur(rency)?/i', 'dataPattern' => '/^[A-Z]{3}$/i', 'export' => true, 'default' => 'NULL', 'html' => array('type' => 'Select'), 'pseudoconstant' => array('table' => 'civicrm_currency', 'keyColumn' => 'name', 'labelColumn' => 'full_name', 'nameColumn' => 'numeric_code')), 'cancel_date' => array('name' => 'cancel_date', 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME, 'title' => ts('Cancel Date'), 'description' => 'when was gift cancelled', 'import' => true, 'where' => 'civicrm_contribution.cancel_date', 'headerPattern' => '/cancel(.?date)?/i', 'dataPattern' => '/^\\d{4}-?\\d{2}-?\\d{2} ?(\\d{2}:?\\d{2}:?(\\d{2})?)?$/', 'export' => true, 'html' => array('type' => 'Select Date')), 'cancel_reason' => array('name' => 'cancel_reason', 'type' => CRM_Utils_Type::T_TEXT, 'title' => ts('Cancel Reason'), 'import' => true, 'where' => 'civicrm_contribution.cancel_reason', 'headerPattern' => '/(cancel.?)?reason/i', 'dataPattern' => '', 'export' => true, 'html' => array('type' => 'Text')), 'receipt_date' => array('name' => 'receipt_date', 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME, 'title' => ts('Receipt Date'), 'description' => 'when (if) receipt was sent. populated automatically for online donations w/ automatic receipting', 'import' => true, 'where' => 'civicrm_contribution.receipt_date', 'headerPattern' => '/receipt(.?date)?/i', 'dataPattern' => '/^\\d{4}-?\\d{2}-?\\d{2} ?(\\d{2}:?\\d{2}:?(\\d{2})?)?$/', 'export' => true, 'html' => array('type' => 'Select Date')), 'thankyou_date' => array('name' => 'thankyou_date', 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME, 'title' => ts('Thank-you Date'), 'description' => 'when (if) was donor thanked', 'import' => true, 'where' => 'civicrm_contribution.thankyou_date', 'headerPattern' => '/thank(s|(.?you))?(.?date)?/i', 'dataPattern' => '/^\\d{4}-?\\d{2}-?\\d{2} ?(\\d{2}:?\\d{2}:?(\\d{2})?)?$/', 'export' => true, 'html' => array('type' => 'Select Date')), 'contribution_source' => array('name' => 'source', 'type' => CRM_Utils_Type::T_STRING, 'title' => ts('Contribution Source'), 'description' => 'Origin of this Contribution.', 'maxlength' => 255, 'size' => CRM_Utils_Type::HUGE, 'import' => true, 'where' => 'civicrm_contribution.source', 'headerPattern' => '/source/i', 'dataPattern' => '', 'export' => true, 'html' => array('type' => 'Text')), 'amount_level' => array('name' => 'amount_level', 'type' => CRM_Utils_Type::T_TEXT, 'title' => ts('Amount Label'), 'import' => true, 'where' => 'civicrm_contribution.amount_level', 'headerPattern' => '', 'dataPattern' => '', 'export' => true, 'html' => array('type' => 'Text')), 'contribution_recur_id' => array('name' => 'contribution_recur_id', 'type' => CRM_Utils_Type::T_INT, 'title' => ts('Recurring Contribution ID'), 'description' => 'Conditional foreign key to civicrm_contribution_recur id. Each contribution made in connection with a recurring contribution carries a foreign key to the recurring contribution record. This assumes we can track these processor initiated events.', 'FKClassName' => 'CRM_Contribute_DAO_ContributionRecur'), 'is_test' => array('name' => 'is_test', 'type' => CRM_Utils_Type::T_BOOLEAN, 'title' => ts('Test'), 'import' => true, 'where' => 'civicrm_contribution.is_test', 'headerPattern' => '', 'dataPattern' => '', 'export' => true, 'html' => array('type' => 'CheckBox')), 'is_pay_later' => array('name' => 'is_pay_later', 'type' => CRM_Utils_Type::T_BOOLEAN, 'title' => ts('Is Pay Later'), 'import' => true, 'where' => 'civicrm_contribution.is_pay_later', 'headerPattern' => '', 'dataPattern' => '', 'export' => true, 'html' => array('type' => 'CheckBox')), 'contribution_status_id' => array('name' => 'contribution_status_id', 'type' => CRM_Utils_Type::T_INT, 'title' => ts('Contribution Status ID'), 'import' => true, 'where' => 'civicrm_contribution.contribution_status_id', 'headerPattern' => '/status/i', 'dataPattern' => '', 'export' => true, 'default' => '1', 'html' => array('type' => 'Select'), 'pseudoconstant' => array('optionGroupName' => 'contribution_status', 'optionEditPath' => 'civicrm/admin/options/contribution_status')), 'address_id' => array('name' => 'address_id', 'type' => CRM_Utils_Type::T_INT, 'title' => ts('Contribution Address'), 'description' => 'Conditional foreign key to civicrm_address.id. We insert an address record for each contribution when we have associated billing name and address data.', 'FKClassName' => 'CRM_Core_DAO_Address'), 'check_number' => array('name' => 'check_number', 'type' => CRM_Utils_Type::T_STRING, 'title' => ts('Check Number'), 'maxlength' => 255, 'size' => 6, 'import' => true, 'where' => 'civicrm_contribution.check_number', 'headerPattern' => '/check(.?number)?/i', 'dataPattern' => '', 'export' => true, 'html' => array('type' => 'Text')), 'contribution_campaign_id' => array('name' => 'campaign_id', 'type' => CRM_Utils_Type::T_INT, 'title' => ts('Campaign'), 'description' => 'The campaign for which this contribution has been triggered.', 'import' => true, 'where' => 'civicrm_contribution.campaign_id', 'headerPattern' => '', 'dataPattern' => '', 'export' => true, 'FKClassName' => 'CRM_Campaign_DAO_Campaign', 'html' => array('type' => 'Select'), 'pseudoconstant' => array('table' => 'civicrm_campaign', 'keyColumn' => 'id', 'labelColumn' => 'title')), 'creditnote_id' => array('name' => 'creditnote_id', 'type' => CRM_Utils_Type::T_STRING, 'title' => ts('Credit Note ID'), 'description' => 'unique credit note id, system generated or passed in', 'maxlength' => 255, 'size' => CRM_Utils_Type::HUGE, 'import' => true, 'where' => 'civicrm_contribution.creditnote_id', 'headerPattern' => '/creditnote(.?id)?/i', 'dataPattern' => '', 'export' => true, 'html' => array('type' => 'Text')), 'tax_amount' => array('name' => 'tax_amount', 'type' => CRM_Utils_Type::T_MONEY, 'title' => ts('Tax Amount'), 'description' => 'Total tax amount of this contribution.', 'precision' => array(20, 2), 'import' => true, 'where' => 'civicrm_contribution.tax_amount', 'headerPattern' => '/tax(.?am(ou)?nt)?/i', 'dataPattern' => '/^\\d+(\\.\\d{2})?$/', 'export' => true, 'html' => array('type' => 'Text')));
     }
     return self::$_fields;
 }