private static $extensions;
/**
- * Get options for a given field.
+ * Low-level option getter, rarely accessed directly.
+ * NOTE: Rather than calling this function directly use CRM_*_BAO_*::buildOptions()
+ *
* @param String $daoName
* @param String $fieldName
* @param Array $params
* if true, the results are reversed
* - grouping boolean if true, return the value in 'grouping' column (currently unsupported for tables other than option_value)
* - localize boolean if true, localize the results before returning
- * - condition string add another condition to the sql query
+ * - condition string|array add condition(s) to the sql query
* - keyColumn string the column to use for 'id'
* - labelColumn string the column to use for 'label'
- * - orderColumn string the column to use for sorting, defaults to 'weight'
+ * - orderColumn string the column to use for sorting, defaults to 'weight' column if one exists, else defaults to labelColumn
* - onlyActive boolean return only the action option values
* - fresh boolean ignore cache entries and go back to DB
*
$from = "FROM %3";
$wheres = array();
$order = "ORDER BY %2";
- // Condition param can be passed as an sql string
+ // Condition param can be passed as an sql clause string or an array of clauses
if (!empty($params['condition'])) {
- $wheres[] = $params['condition'];
+ $wheres[] = implode(' AND ', (array) $params['condition']);
}
- // Support for onlyActive param if option table contains is_active field
+ // onlyActive param will automatically filter on common flags
if (!empty($params['onlyActive'])) {
- if (in_array('is_active', $availableFields)) {
- $wheres[] = 'is_active = 1';
+ foreach (array('is_active' => 1, 'is_deleted' => 0, 'is_test' => 0) as $flag => $val) {
+ if (in_array($flag, $availableFields)) {
+ $wheres[] = "$flag = $val";
+ }
}
}
+ // Filter domain specific options
+ if (in_array('domain_id', $availableFields)) {
+ $wheres[] = 'domain_id = ' . CRM_Core_Config::domainID();
+ }
$queryParams = array(
1 => array($params['keyColumn'], 'String', CRM_Core_DAO::QUERY_FORMAT_NO_QUOTES),
2 => array($params['labelColumn'], 'String', CRM_Core_DAO::QUERY_FORMAT_NO_QUOTES),
'is_active' => TRUE,
);
$result = civicrm_api('customGroup', 'create', $api_params);
+ $this->assertAPISuccess($result);
// Create a Group for testing.
$group_name = md5(microtime());
'is_active' => TRUE,
);
$result = civicrm_api('group', 'create', $api_params);
+ $this->assertAPISuccess($result);
+
+ // Create a PaymentProcessor for testing.
+ $pp_name = md5(microtime());
+ $api_params = array(
+ 'version' => 3,
+ 'domain_id' => 1,
+ 'payment_processor_type_id' => 10,
+ 'name' => $pp_name,
+ 'user_name' => $pp_name,
+ 'class_name' => 'Payment_Dummy',
+ 'url_site' => 'https://test.com/',
+ 'url_recur' => 'https://test.com/',
+ 'is_active' => 1,
+ );
+ $result = civicrm_api('payment_processor', 'create', $api_params);
+ $this->assertAPISuccess($result);
/**
* daoName/field combinations to test
'fieldName' => 'status_id',
'sample' => 'Scheduled',
),
+ array(
+ 'fieldName' => 'priority_id',
+ 'sample' => 'Urgent',
+ ),
),
'CRM_Campaign_DAO_Survey' => array(
array(
'sample' => 'Accounts Receivable',
'max' => 15,
),
+ array(
+ 'fieldName' => 'currency',
+ 'sample' => '$',
+ 'max' => 200,
+ ),
),
'CRM_Financial_DAO_FinancialTrxn' => array(
array(
'sample' => 'Accounts Receivable',
'max' => 15,
),
+ array(
+ 'fieldName' => 'currency',
+ 'sample' => '$',
+ 'max' => 200,
+ ),
),
'CRM_Financial_DAO_FinancialAccount' => array(
array(
'sample' => 'Cost of Sales',
),
),
- 'CRM_Event_DAO_Participant' => array(
- array(
- 'fieldName' => 'fee_currency',
- 'sample' => '$',
- 'max' => 200,
- ),
- ),
'CRM_Core_DAO_UFField' => array(
array(
'fieldName' => 'uf_group_id',
'max' => 200,
),
),
- 'CRM_Contribute_DAO_Contribution' => array(
- array(
- 'fieldName' => 'currency',
- 'sample' => '$',
- 'max' => 200,
- ),
- ),
'CRM_Contribute_DAO_Product' => array(
array(
'fieldName' => 'currency',
'max' => 200,
),
),
- 'CRM_Contribute_DAO_ContributionPage' => array(
- array(
- 'fieldName' => 'currency',
- 'sample' => '$',
- 'max' => 200,
- ),
- ),
'CRM_Contribute_DAO_ContributionRecur' => array(
array(
'fieldName' => 'currency',
'max' => 200,
),
),
- 'CRM_Event_DAO_Event' => array(
- array(
- 'fieldName' => 'currency',
- 'sample' => '$',
- 'max' => 200,
- ),
- ),
- 'CRM_Financial_DAO_FinancialItem' => array(
- array(
- 'fieldName' => 'currency',
- 'sample' => '$',
- 'max' => 200,
- ),
- ),
'CRM_Financial_DAO_OfficialReceipt' => array(
array(
'fieldName' => 'currency',
'max' => 200,
),
),
- 'CRM_Financial_DAO_FinancialTrxn' => array(
- array(
- 'fieldName' => 'currency',
- 'sample' => '$',
- 'max' => 200,
- ),
- ),
- 'CRM_Grant_DAO_Grant' => array(
- array(
- 'fieldName' => 'currency',
- 'sample' => '$',
- 'max' => 200,
- ),
- ),
'CRM_Pledge_DAO_PledgePayment' => array(
array(
'fieldName' => 'currency',
'sample' => '$',
'max' => 200,
),
+ array(
+ 'fieldName' => 'status_id',
+ 'sample' => 'Approved',
+ ),
),
'CRM_Core_DAO_CustomField' => array(
array(
'sample' => 'Urgent',
),
),
- 'CRM_Activity_DAO_Activity' => array(
- array(
- 'fieldName' => 'priority_id',
- 'sample' => 'Urgent',
- ),
- ),
'CRM_Core_DAO_MailSettings' => array(
array(
'fieldName' => 'protocol',
'sample' => 'In Honor of',
),
),
- 'CRM_Contribute_DAO_Contribution' => array(
- array(
- 'fieldName' => 'honor_type_id',
- 'sample' => 'In Honor of',
- ),
- ),
'CRM_Core_DAO_Phone' => array(
array(
'fieldName' => 'phone_type_id',
'fieldName' => 'role_id',
'sample' => 'Speaker',
),
+ array(
+ 'fieldName' => 'fee_currency',
+ 'sample' => '$',
+ 'max' => 200,
+ ),
),
'CRM_Event_DAO_Event' => array(
array(
'fieldName' => 'event_type_id',
'sample' => 'Fundraiser',
),
- ),
- 'CRM_PCP_DAO_PCP' => array(
array(
- 'fieldName' => 'status_id',
- 'sample' => 'Approved',
+ 'fieldName' => 'payment_processor',
+ 'sample' => $pp_name,
+ ),
+ array(
+ 'fieldName' => 'financial_type_id',
+ 'sample' => 'Donation',
+ ),
+ array(
+ 'fieldName' => 'currency',
+ 'sample' => '$',
+ 'max' => 200,
),
),
'CRM_Member_DAO_Membership' => array(
'fieldName' => 'grant_type_id',
'sample' => 'Emergency',
),
+ array(
+ 'fieldName' => 'currency',
+ 'sample' => '$',
+ 'max' => 200,
+ ),
+ ),
+ 'CRM_Contribute_DAO_Contribution' => array(
+ array(
+ 'fieldName' => 'payment_instrument_id',
+ 'sample' => 'Credit Card',
+ ),
+ array(
+ 'fieldName' => 'financial_type_id',
+ 'sample' => 'Donation',
+ ),
+ array(
+ 'fieldName' => 'currency',
+ 'sample' => '$',
+ 'max' => 200,
+ ),
+ array(
+ 'fieldName' => 'contribution_status_id',
+ 'sample' => 'Completed',
+ ),
+ array(
+ 'fieldName' => 'honor_type_id',
+ 'sample' => 'In Honor of',
+ ),
+ ),
+ 'CRM_Contribute_DAO_ContributionPage' => array(
+ array(
+ 'fieldName' => 'payment_processor',
+ 'sample' => $pp_name,
+ ),
+ array(
+ 'fieldName' => 'financial_type_id',
+ 'sample' => 'Donation',
+ ),
+ array(
+ 'fieldName' => 'currency',
+ 'sample' => '$',
+ 'max' => 200,
+ ),
),
);
foreach ($daoFields as $field) {
$message = "DAO name: '{$daoName}', field: '{$field['fieldName']}'";
- $optionValues = CRM_Core_PseudoConstant::get($daoName, $field['fieldName']);
+ $optionValues = $daoName::buildOptions($field['fieldName']);
$this->assertNotEmpty($optionValues, $message);
// Ensure sample value is contained in the returned optionValues.
//ok this is a bit long-winded but it gets there & is consistent with above approach
$field['pseudoconstant'] = array();
$validOptions = array(
- 'name',
+ // Fields can specify EITHER optionGroupName OR table, not both
+ // (since declaring optionGroupName means we are using the civicrm_option_value table)
'optionGroupName',
'table',
+ // Optional additional params will be passed into CRM_Core_PseudoConstant::get()
'keyColumn',
'labelColumn',
- 'class',
'condition',
);
foreach ($validOptions as $pseudoOption){
<name>payment_instrument_id</name>
<type>int unsigned</type>
<comment>fk to Payment Instrument options in civicrm_option_values</comment>
+ <pseudoconstant>
+ <optionGroupName>payment_instrument</optionGroupName>
+ </pseudoconstant>
<add>4.3</add>
</field>
<field>
-<?xml version="1.0" encoding="iso-8859-1" ?>
+<?xml version="1.0" encoding="iso-8859-1" ?>
-<table>
- <base>CRM/Contribute</base>
- <class>Contribution</class>
- <name>civicrm_contribution</name>
- <add>1.3</add>
+<table>
+ <base>CRM/Contribute</base>
+ <class>Contribution</class>
+ <name>civicrm_contribution</name>
+ <add>1.3</add>
<log>true</log>
- <field>
- <name>id</name>
+ <field>
+ <name>id</name>
<uniqueName>contribution_id</uniqueName>
- <type>int unsigned</type>
+ <type>int unsigned</type>
<required>true</required>
- <import>true</import>
+ <import>true</import>
<title>Contribution ID</title>
- <comment>Contribution ID</comment>
- <add>1.3</add>
- </field>
- <primaryKey>
- <name>id</name>
- <autoincrement>true</autoincrement>
- </primaryKey>
- <field>
- <name>contact_id</name>
+ <comment>Contribution ID</comment>
+ <add>1.3</add>
+ </field>
+ <primaryKey>
+ <name>id</name>
+ <autoincrement>true</autoincrement>
+ </primaryKey>
+ <field>
+ <name>contact_id</name>
<uniqueName>contribution_contact_id</uniqueName>
<title>Contact ID</title>
- <type>int unsigned</type>
- <required>true</required>
+ <type>int unsigned</type>
+ <required>true</required>
<import>true</import>
<headerPattern>/contact(.?id)?/i</headerPattern>
<dataPattern>/^\d+$/</dataPattern>
- <comment>FK to Contact ID</comment>
- <add>1.3</add>
- </field>
- <foreignKey>
- <name>contact_id</name>
- <table>civicrm_contact</table>
- <key>id</key>
- <add>1.3</add>
+ <comment>FK to Contact ID</comment>
+ <add>1.3</add>
+ </field>
+ <foreignKey>
+ <name>contact_id</name>
+ <table>civicrm_contact</table>
+ <key>id</key>
+ <add>1.3</add>
<onDelete>CASCADE</onDelete>
- </foreignKey>
- <field>
- <name>solicitor_id</name>
+ </foreignKey>
+ <field>
+ <name>solicitor_id</name>
<title>Solicitor ID</title>
- <type>int unsigned</type>
- <comment>FK to Solicitor ID</comment>
- <add>1.4</add>
+ <type>int unsigned</type>
+ <comment>FK to Solicitor ID</comment>
+ <add>1.4</add>
<drop>2.2</drop>
- </field>
- <foreignKey>
- <name>solicitor_id</name>
- <table>civicrm_contact</table>
- <key>id</key>
- <add>1.4</add>
+ </field>
+ <foreignKey>
+ <name>solicitor_id</name>
+ <table>civicrm_contact</table>
+ <key>id</key>
+ <add>1.4</add>
<drop>2.2</drop>
<onDelete>SET NULL</onDelete>
- </foreignKey>
- <field>
- <name>contribution_type_id</name>
+ </foreignKey>
+ <field>
+ <name>contribution_type_id</name>
<title>Contribution Type</title>
<export>false</export>
<type>int unsigned</type>
<comment>FK to Contribution Type</comment>
- <add>1.3</add>
- <drop>4.3</drop>
- </field>
- <foreignKey>
- <name>contribution_type_id</name>
- <table>civicrm_contribution_type</table>
- <key>id</key>
- <add>1.3</add>
- <drop>4.3</drop>
+ <add>1.3</add>
+ <drop>4.3</drop>
+ </field>
+ <foreignKey>
+ <name>contribution_type_id</name>
+ <table>civicrm_contribution_type</table>
+ <key>id</key>
+ <add>1.3</add>
+ <drop>4.3</drop>
<onDelete>SET NULL</onDelete>
- </foreignKey>
- <field>
+ </foreignKey>
+ <field>
<name>financial_type_id</name>
<title>Financial Type</title>
<export>false</export>
<type>int unsigned</type>
<comment>FK to Financial Type for (total_amount - non_deductible_amount).</comment>
- <add>4.3</add>
- </field>
- <foreignKey>
- <name>financial_type_id</name>
- <table>civicrm_financial_type</table>
- <key>id</key>
+ <pseudoconstant>
+ <table>civicrm_financial_type</table>
+ <keyColumn>id</keyColumn>
+ <labelColumn>name</labelColumn>
+ </pseudoconstant>
<add>4.3</add>
- </foreignKey>
- <field>
- <name>contribution_page_id</name>
+ </field>
+ <foreignKey>
+ <name>financial_type_id</name>
+ <table>civicrm_financial_type</table>
+ <key>id</key>
+ <add>4.3</add>
+ </foreignKey>
+ <field>
+ <name>contribution_page_id</name>
<title>Contribution Page</title>
<type>int unsigned</type>
<import>true</import>
- <comment>The Contribution Page which triggered this contribution</comment>
- <add>1.5</add>
- </field>
- <foreignKey>
- <name>contribution_page_id</name>
- <table>civicrm_contribution_page</table>
- <key>id</key>
+ <comment>The Contribution Page which triggered this contribution</comment>
+ <pseudoconstant>
+ <table>civicrm_contribution_page</table>
+ <keyColumn>id</keyColumn>
+ <labelColumn>title</labelColumn>
+ </pseudoconstant>
+ <add>1.5</add>
+ </field>
+ <foreignKey>
+ <name>contribution_page_id</name>
+ <table>civicrm_contribution_page</table>
+ <key>id</key>
<onDelete>SET NULL</onDelete>
</foreignKey>
- <field>
+ <field>
<name>payment_instrument_id</name>
<uniqueName>contribution_payment_instrument_id</uniqueName>
<title>Payment Instrument</title>
<type>int unsigned</type>
<comment>FK to Payment Instrument</comment>
<pseudoconstant>
- <name>paymentInstrument</name>
- <optionGroupName>paymentInstrument</optionGroupName>
- <class>CRM_Contribute_PseudoConstant</class>
+ <optionGroupName>payment_instrument</optionGroupName>
</pseudoconstant>
<add>1.3</add>
- </field>
+ </field>
<index>
<name>UI_contrib_payment_instrument_id</name>
- <fieldName>payment_instrument_id</fieldName>
+ <fieldName>payment_instrument_id</fieldName>
<add>1.6</add>
- </index>
- <field>
- <name>receive_date</name>
- <type>datetime</type>
+ </index>
+ <field>
+ <name>receive_date</name>
+ <type>datetime</type>
<import>true</import>
<headerPattern>/receive(.?date)?/i</headerPattern>
<dataPattern>/^\d{4}-?\d{2}-?\d{2} ?(\d{2}:?\d{2}:?(\d{2})?)?$/</dataPattern>
- <comment>when was gift received</comment>
- <add>1.3</add>
- </field>
- <field>
- <name>non_deductible_amount</name>
+ <comment>when was gift received</comment>
+ <add>1.3</add>
+ </field>
+ <field>
+ <name>non_deductible_amount</name>
<title>Non-deductible Amount</title>
<type>decimal</type>
<default>0</default>
<import>true</import>
<headerPattern>/non?.?deduct/i</headerPattern>
<dataPattern>/^\d+(\.\d{2})?$/</dataPattern>
- <comment>Portion of total amount which is NOT tax deductible. Equal to total_amount for non-deductible financial types.</comment>
- <add>1.3</add>
+ <comment>Portion of total amount which is NOT tax deductible. Equal to total_amount for non-deductible financial types.</comment>
+ <add>1.3</add>
</field>
- <field>
- <name>total_amount</name>
- <type>decimal</type>
+ <field>
+ <name>total_amount</name>
+ <type>decimal</type>
<required>true</required>
<import>true</import>
<headerPattern>/^total|(.?^am(ou)?nt)/i</headerPattern>
<dataPattern>/^\d+(\.\d{2})?$/</dataPattern>
- <comment>Total amount of this contribution. Use market value for non-monetary gifts.</comment>
- <add>1.3</add>
+ <comment>Total amount of this contribution. Use market value for non-monetary gifts.</comment>
+ <add>1.3</add>
</field>
- <field>
- <name>fee_amount</name>
- <type>decimal</type>
+ <field>
+ <name>fee_amount</name>
+ <type>decimal</type>
<import>true</import>
<headerPattern>/fee(.?am(ou)?nt)?/i</headerPattern>
<dataPattern>/^\d+(\.\d{2})?$/</dataPattern>
<comment>actual processor fee if known - may be 0.</comment>
- <add>1.3</add>
- </field>
- <field>
- <name>net_amount</name>
- <type>decimal</type>
+ <add>1.3</add>
+ </field>
+ <field>
+ <name>net_amount</name>
+ <type>decimal</type>
<import>true</import>
<headerPattern>/net(.?am(ou)?nt)?/i</headerPattern>
<dataPattern>/^\d+(\.\d{2})?$/</dataPattern>
<comment>actual funds transfer amount. total less fees. if processor does not report actual fee during transaction, this is set to total_amount.</comment>
- <add>1.3</add>
+ <add>1.3</add>
</field>
- <field>
- <name>trxn_id</name>
+ <field>
+ <name>trxn_id</name>
<title>Transaction ID</title>
- <type>varchar</type>
- <length>255</length>
+ <type>varchar</type>
+ <length>255</length>
<import>true</import>
<headerPattern>/tr(ansactio|x)n(.?id)?/i</headerPattern>
<comment>unique transaction id. may be processor id, bank id + trans id, or account number + check number... depending on payment_method</comment>
- <add>1.3</add>
- </field>
- <field>
- <name>invoice_id</name>
+ <add>1.3</add>
+ </field>
+ <field>
+ <name>invoice_id</name>
<title>Invoice ID</title>
- <type>varchar</type>
- <length>255</length>
+ <type>varchar</type>
+ <length>255</length>
<import>true</import>
<headerPattern>/invoice(.?id)?/i</headerPattern>
<comment>unique invoice id, system generated or passed in</comment>
- <add>1.3</add>
- </field>
- <field>
- <name>currency</name>
- <type>varchar</type>
+ <add>1.3</add>
+ </field>
+ <field>
+ <name>currency</name>
+ <type>varchar</type>
<length>3</length>
<default>NULL</default>
<import>true</import>
<keyColumn>name</keyColumn>
<labelColumn>symbol</labelColumn>
</pseudoconstant>
- </field>
- <field>
- <name>cancel_date</name>
- <type>datetime</type>
+ </field>
+ <field>
+ <name>cancel_date</name>
+ <type>datetime</type>
<import>true</import>
<headerPattern>/cancel(.?date)?/i</headerPattern>
<dataPattern>/^\d{4}-?\d{2}-?\d{2} ?(\d{2}:?\d{2}:?(\d{2})?)?$/</dataPattern>
- <comment>when was gift cancelled</comment>
- <add>1.3</add>
- </field>
- <field>
- <name>cancel_reason</name>
- <type>text</type>
+ <comment>when was gift cancelled</comment>
+ <add>1.3</add>
+ </field>
+ <field>
+ <name>cancel_reason</name>
+ <type>text</type>
<import>true</import>
<headerPattern>/(cancel.?)?reason/i</headerPattern>
- <add>1.3</add>
- </field>
- <field>
- <name>receipt_date</name>
- <type>datetime</type>
+ <add>1.3</add>
+ </field>
+ <field>
+ <name>receipt_date</name>
+ <type>datetime</type>
<import>true</import>
<headerPattern>/receipt(.?date)?/i</headerPattern>
<dataPattern>/^\d{4}-?\d{2}-?\d{2} ?(\d{2}:?\d{2}:?(\d{2})?)?$/</dataPattern>
<comment>when (if) receipt was sent. populated automatically for online donations w/ automatic receipting</comment>
- <add>1.3</add>
- </field>
- <field>
+ <add>1.3</add>
+ </field>
+ <field>
<name>thankyou_date</name>
<title>Thank-you Date</title>
- <type>datetime</type>
+ <type>datetime</type>
<import>true</import>
<headerPattern>/thank(s|(.?you))?(.?date)?/i</headerPattern>
<dataPattern>/^\d{4}-?\d{2}-?\d{2} ?(\d{2}:?\d{2}:?(\d{2})?)?$/</dataPattern>
- <comment>when (if) was donor thanked</comment>
- <add>1.3</add>
- </field>
- <field>
+ <comment>when (if) was donor thanked</comment>
+ <add>1.3</add>
+ </field>
+ <field>
<name>source</name>
<uniqueName>contribution_source</uniqueName>
<title>Contribution Source</title>
- <type>varchar</type>
+ <type>varchar</type>
<length>255</length>
<import>true</import>
<headerPattern>/source/i</headerPattern>
- <comment>Origin of this Contribution.</comment>
- <add>1.3</add>
- </field>
- <field>
+ <comment>Origin of this Contribution.</comment>
+ <add>1.3</add>
+ </field>
+ <field>
<name>amount_level</name>
<title>Amount Label</title>
- <type>text</type>
+ <type>text</type>
<import>true</import>
- <add>1.7</add>
- </field>
+ <add>1.7</add>
+ </field>
<field>
<name>note</name>
<type>text</type>
<unique>true</unique>
<add>2.1</add>
</index>
- <field>
- <name>contribution_recur_id</name>
- <type>int unsigned</type>
- <comment>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.</comment>
- <add>1.4</add>
- </field>
- <foreignKey>
- <name>contribution_recur_id</name>
- <table>civicrm_contribution_recur</table>
- <key>id</key>
- <add>1.4</add>
+ <field>
+ <name>contribution_recur_id</name>
+ <type>int unsigned</type>
+ <comment>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.</comment>
+ <add>1.4</add>
+ </field>
+ <foreignKey>
+ <name>contribution_recur_id</name>
+ <table>civicrm_contribution_recur</table>
+ <key>id</key>
+ <add>1.4</add>
<onDelete>SET NULL</onDelete>
</foreignKey>
- <field>
- <name>honor_contact_id</name>
+ <field>
+ <name>honor_contact_id</name>
<title>Honor Contact</title>
- <type>int unsigned</type>
- <comment>FK to contact ID</comment>
- <add>1.3</add>
- </field>
- <foreignKey>
- <name>honor_contact_id</name>
- <table>civicrm_contact</table>
- <key>id</key>
- <add>1.6</add>
+ <type>int unsigned</type>
+ <comment>FK to contact ID</comment>
+ <add>1.3</add>
+ </field>
+ <foreignKey>
+ <name>honor_contact_id</name>
+ <table>civicrm_contact</table>
+ <key>id</key>
+ <add>1.6</add>
<onDelete>SET NULL</onDelete>
- </foreignKey>
- <field>
- <name>is_test</name>
+ </foreignKey>
+ <field>
+ <name>is_test</name>
<title>Test</title>
<type>boolean</type>
<default>0</default>
<import>true</import>
</field>
- <field>
- <name>is_pay_later</name>
+ <field>
+ <name>is_pay_later</name>
<title>Is Pay Later</title>
<type>boolean</type>
<default>0</default>
<import>true</import>
- <add>2.1</add>
+ <add>2.1</add>
</field>
<field>
<name>contribution_status_id</name>
<import>true</import>
<export>true</export>
<headerPattern>/status/i</headerPattern>
+ <pseudoconstant>
+ <optionGroupName>contribution_status</optionGroupName>
+ </pseudoconstant>
<add>1.6</add>
</field>
<field>
<fieldName>receive_date</fieldName>
<add>1.6</add>
</index>
- <field>
- <name>address_id</name>
- <type>int unsigned</type>
- <comment>Conditional foreign key to civicrm_address.id. We insert an address record for each contribution when we have associated billing name and address data.</comment>
- <add>2.2</add>
- </field>
- <foreignKey>
- <name>address_id</name>
- <table>civicrm_address</table>
- <key>id</key>
- <add>2.2</add>
+ <field>
+ <name>address_id</name>
+ <type>int unsigned</type>
+ <comment>Conditional foreign key to civicrm_address.id. We insert an address record for each contribution when we have associated billing name and address data.</comment>
+ <add>2.2</add>
+ </field>
+ <foreignKey>
+ <name>address_id</name>
+ <table>civicrm_address</table>
+ <key>id</key>
+ <add>2.2</add>
<onDelete>SET NULL</onDelete>
</foreignKey>
- <field>
- <name>check_number</name>
+ <field>
+ <name>check_number</name>
<title>Check Number</title>
<headerPattern>/check(.?number)?/i</headerPattern>
- <type>varchar</type>
+ <type>varchar</type>
<length>255</length>
- <size>SIX</size>
+ <size>SIX</size>
<import>true</import>
- <add>2.2</add>
- </field>
+ <add>2.2</add>
+ </field>
<index>
<name>check_number</name>
<fieldName>check_number</fieldName>
<add>2.2</add>
</index>
- <field>
+ <field>
<name>campaign_id</name>
<uniqueName>contribution_campaign_id</uniqueName>
<type>int unsigned</type>
<title>Campaign ID</title>
- <import>true</import>
- <comment>The campaign for which this contribution has been triggered.</comment>
- <add>3.4</add>
- </field>
- <foreignKey>
- <name>campaign_id</name>
- <table>civicrm_campaign</table>
- <key>id</key>
+ <import>true</import>
+ <comment>The campaign for which this contribution has been triggered.</comment>
+ <add>3.4</add>
+ </field>
+ <foreignKey>
+ <name>campaign_id</name>
+ <table>civicrm_campaign</table>
+ <key>id</key>
<onDelete>SET NULL</onDelete>
</foreignKey>
</table>
<comment>Text and html allowed. Displayed below title.</comment>
<add>1.3</add>
</field>
- <field>
- <name>contribution_type_id</name>
- <type>int unsigned</type>
- <required>true</required>
- <comment>default Contribution type assigned to contributions submitted via this page, e.g. Contribution, Campaign Contribution</comment>
- <add>1.3</add>
+ <field>
+ <name>contribution_type_id</name>
+ <type>int unsigned</type>
+ <required>true</required>
+ <comment>default Contribution type assigned to contributions submitted via this page, e.g. Contribution, Campaign Contribution</comment>
+ <add>1.3</add>
<drop>4.3</drop>
- </field>
- <foreignKey>
- <name>contribution_type_id</name>
- <table>civicrm_contribution_type</table>
- <key>id</key>
+ </field>
+ <foreignKey>
+ <name>contribution_type_id</name>
+ <table>civicrm_contribution_type</table>
+ <key>id</key>
<drop>4.3</drop>
</foreignKey>
- <field>
- <name>financial_type_id</name>
- <type>int unsigned</type>
- <comment>default financial type assigned to contributions submitted via this page, e.g. Contribution, Campaign Contribution</comment>
+ <field>
+ <name>financial_type_id</name>
+ <type>int unsigned</type>
+ <comment>default financial type assigned to contributions submitted via this page, e.g. Contribution, Campaign Contribution</comment>
+ <pseudoconstant>
+ <table>civicrm_financial_type</table>
+ <keyColumn>id</keyColumn>
+ <labelColumn>name</labelColumn>
+ </pseudoconstant>
+ <add>4.3</add>
+ </field>
+ <foreignKey>
+ <name>financial_type_id</name>
+ <table>civicrm_financial_type</table>
+ <key>id</key>
<add>4.3</add>
- </field>
- <foreignKey>
- <name>financial_type_id</name>
- <table>civicrm_financial_type</table>
- <key>id</key>
- <add>4.3</add>
</foreignKey>
- <field>
- <name>payment_processor</name>
+ <field>
+ <name>payment_processor</name>
<type>varchar</type>
<length>128</length>
- <comment>Payment Processors configured for this contribution Page </comment>
- <add>1.8</add>
- </field>
- <field>
- <name>is_credit_card_only</name>
- <type>boolean</type>
- <comment>if true - processing logic must reject transaction at confirmation stage if pay method != credit card</comment>
+ <comment>Payment Processors configured for this contribution Page</comment>
+ <pseudoconstant>
+ <table>civicrm_payment_processor</table>
+ <keyColumn>id</keyColumn>
+ <labelColumn>name</labelColumn>
+ </pseudoconstant>
+ <add>1.8</add>
+ </field>
+ <field>
+ <name>is_credit_card_only</name>
+ <type>boolean</type>
+ <comment>if true - processing logic must reject transaction at confirmation stage if pay method != credit card</comment>
+ <default>0</default>
+ <add>1.3</add>
+ </field>
+ <field>
+ <name>is_monetary</name>
+ <type>boolean</type>
+ <default>1</default>
+ <comment>if true - allows real-time monetary transactions otherwise non-monetary transactions</comment>
+ <add>1.6</add>
+ </field>
+ <field>
+ <name>is_recur</name>
+ <type>boolean</type>
<default>0</default>
- <add>1.3</add>
- </field>
- <field>
- <name>is_monetary</name>
- <type>boolean</type>
- <default>1</default>
- <comment>if true - allows real-time monetary transactions otherwise non-monetary transactions</comment>
- <add>1.6</add>
- </field>
- <field>
- <name>is_recur</name>
- <type>boolean</type>
- <default>0</default>
- <comment>if true - allows recurring contributions, valid only for PayPal_Standard</comment>
- <add>1.6</add>
- </field>
- <field>
- <name>is_confirm_enabled</name>
- <type>boolean</type>
- <default>1</default>
- <comment>if false, the confirm page in contribution pages gets skipped</comment>
- <add>4.2</add>
+ <comment>if true - allows recurring contributions, valid only for PayPal_Standard</comment>
+ <add>1.6</add>
+ </field>
+ <field>
+ <name>is_confirm_enabled</name>
+ <type>boolean</type>
+ <default>1</default>
+ <comment>if false, the confirm page in contribution pages gets skipped</comment>
+ <add>4.2</add>
</field>
<field>
<name>recur_frequency_unit</name>
<add>2.1</add>
</field>
<field>
- <name>is_recur_interval</name>
- <type>boolean</type>
- <default>0</default>
- <comment>if true - supports recurring intervals</comment>
- <add>2.1</add>
+ <name>is_recur_interval</name>
+ <type>boolean</type>
+ <default>0</default>
+ <comment>if true - supports recurring intervals</comment>
+ <add>2.1</add>
</field>
<field>
- <name>is_recur_installments</name>
- <type>boolean</type>
- <default>0</default>
- <comment>if true - asks user for recurring installments</comment>
- <add>4.3</add>
+ <name>is_recur_installments</name>
+ <type>boolean</type>
+ <default>0</default>
+ <comment>if true - asks user for recurring installments</comment>
+ <add>4.3</add>
</field>
- <field>
- <name>is_pay_later</name>
- <type>boolean</type>
- <default>0</default>
- <comment>if true - allows the user to send payment directly to the org later</comment>
- <add>2.0</add>
+ <field>
+ <name>is_pay_later</name>
+ <type>boolean</type>
+ <default>0</default>
+ <comment>if true - allows the user to send payment directly to the org later</comment>
+ <add>2.0</add>
</field>
- <field>
- <name>pay_later_text</name>
- <type>text</type>
+ <field>
+ <name>pay_later_text</name>
+ <type>text</type>
<localizable>true</localizable>
- <comment>The text displayed to the user in the main form</comment>
- <add>2.0</add>
+ <comment>The text displayed to the user in the main form</comment>
+ <add>2.0</add>
</field>
- <field>
- <name>pay_later_receipt</name>
- <type>text</type>
+ <field>
+ <name>pay_later_receipt</name>
+ <type>text</type>
<localizable>true</localizable>
- <comment>The receipt sent to the user instead of the normal receipt text</comment>
- <add>2.0</add>
- </field>
- <field>
- <name>is_partial_payment</name>
- <type>boolean</type>
- <default>0</default>
- <comment>is partial payment enabled for this online contribution page</comment>
- <add>4.3</add>
- </field>
- <field>
- <name>initial_amount_label</name>
- <type>varchar</type>
- <length>255</length>
+ <comment>The receipt sent to the user instead of the normal receipt text</comment>
+ <add>2.0</add>
+ </field>
+ <field>
+ <name>is_partial_payment</name>
+ <type>boolean</type>
+ <default>0</default>
+ <comment>is partial payment enabled for this online contribution page</comment>
+ <add>4.3</add>
+ </field>
+ <field>
+ <name>initial_amount_label</name>
+ <type>varchar</type>
+ <length>255</length>
<localizable>true</localizable>
- <comment>Initial amount label for partial payment</comment>
- <add>4.3</add>
+ <comment>Initial amount label for partial payment</comment>
+ <add>4.3</add>
</field>
- <field>
- <name>initial_amount_help_text</name>
- <type>text</type>
+ <field>
+ <name>initial_amount_help_text</name>
+ <type>text</type>
<localizable>true</localizable>
- <comment>Initial amount help text for partial payment</comment>
- <add>4.3</add>
+ <comment>Initial amount help text for partial payment</comment>
+ <add>4.3</add>
</field>
- <field>
- <name>min_initial_amount</name>
- <type>decimal</type>
- <comment>Minimum initial amount for partial payment</comment>
- <add>4.3</add>
+ <field>
+ <name>min_initial_amount</name>
+ <type>decimal</type>
+ <comment>Minimum initial amount for partial payment</comment>
+ <add>4.3</add>
</field>
- <field>
- <name>is_allow_other_amount</name>
- <type>boolean</type>
- <comment>if true, page will include an input text field where user can enter their own amount</comment>
- <default>0</default>
- <add>1.3</add>
+ <field>
+ <name>is_allow_other_amount</name>
+ <type>boolean</type>
+ <comment>if true, page will include an input text field where user can enter their own amount</comment>
+ <default>0</default>
+ <add>1.3</add>
</field>
<field>
<name>default_amount_id</name>
<comment>FK to civicrm_option_value.</comment>
<add>1.7</add>
</field>
- <field>
- <name>min_amount</name>
- <type>decimal</type>
- <comment>if other amounts allowed, user can configure minimum allowed.</comment>
- <add>1.3</add>
- </field>
- <field>
- <name>max_amount</name>
- <type>decimal</type>
- <comment>if other amounts allowed, user can configure maximum allowed.</comment>
- <add>1.3</add>
- </field>
- <field>
- <name>goal_amount</name>
- <type>decimal</type>
- <comment>The target goal for this page, allows people to build a goal meter</comment>
- <add>1.5</add>
+ <field>
+ <name>min_amount</name>
+ <type>decimal</type>
+ <comment>if other amounts allowed, user can configure minimum allowed.</comment>
+ <add>1.3</add>
+ </field>
+ <field>
+ <name>max_amount</name>
+ <type>decimal</type>
+ <comment>if other amounts allowed, user can configure maximum allowed.</comment>
+ <add>1.3</add>
+ </field>
+ <field>
+ <name>goal_amount</name>
+ <type>decimal</type>
+ <comment>The target goal for this page, allows people to build a goal meter</comment>
+ <add>1.5</add>
</field>
<field>
<name>thankyou_title</name>
<comment>Title for Thank-you page (header title tag, and display at the top of the page).</comment>
<add>1.3</add>
</field>
- <field>
- <name>thankyou_text</name>
+ <field>
+ <name>thankyou_text</name>
<title>Thank-you Text</title>
- <type>text</type>
+ <type>text</type>
<htmlType>textarea</htmlType>
<rows>8</rows>
<cols>60</cols>
<localizable>true</localizable>
- <comment>text and html allowed. displayed above result on success page</comment>
- <add>1.3</add>
- </field>
- <field>
- <name>thankyou_footer</name>
+ <comment>text and html allowed. displayed above result on success page</comment>
+ <add>1.3</add>
+ </field>
+ <field>
+ <name>thankyou_footer</name>
<title>Thank-you Footer</title>
- <type>text</type>
+ <type>text</type>
<htmlType>textarea</htmlType>
<rows>8</rows>
<cols>60</cols>
<localizable>true</localizable>
- <comment>Text and html allowed. displayed at the bottom of the success page. Common usage is to include link(s) to other pages such as tell-a-friend, etc.</comment>
- <add>1.3</add>
- </field>
- <field>
- <name>is_for_organization</name>
- <type>boolean</type>
- <comment>if true, signup is done on behalf of an organization</comment>
+ <comment>Text and html allowed. displayed at the bottom of the success page. Common usage is to include link(s) to other pages such as tell-a-friend, etc.</comment>
+ <add>1.3</add>
+ </field>
+ <field>
+ <name>is_for_organization</name>
+ <type>boolean</type>
+ <comment>if true, signup is done on behalf of an organization</comment>
<default>0</default>
- <add>2.1</add>
- </field>
- <field>
- <name>for_organization</name>
+ <add>2.1</add>
+ </field>
+ <field>
+ <name>for_organization</name>
<title>On Behalf Of Organization</title>
- <type>text</type>
+ <type>text</type>
<htmlType>textarea</htmlType>
<rows>2</rows>
<cols>50</cols>
<localizable>true</localizable>
- <comment>This text field is shown when is_for_organization is checked. For example - I am contributing on behalf on an organization.</comment>
- <add>2.1</add>
- </field>
- <field>
- <name>is_email_receipt</name>
- <type>boolean</type>
- <comment>if true, receipt is automatically emailed to contact on success</comment>
+ <comment>This text field is shown when is_for_organization is checked. For example - I am contributing on behalf on an organization.</comment>
+ <add>2.1</add>
+ </field>
+ <field>
+ <name>is_email_receipt</name>
+ <type>boolean</type>
+ <comment>if true, receipt is automatically emailed to contact on success</comment>
<default>0</default>
- <add>1.3</add>
- </field>
- <field>
+ <add>1.3</add>
+ </field>
+ <field>
<name>receipt_from_name</name>
- <type>varchar</type>
+ <type>varchar</type>
<length>255</length>
<localizable>true</localizable>
- <comment>FROM email name used for receipts generated by contributions to this contribution page.</comment>
- <add>1.3</add>
- </field>
- <field>
- <name>receipt_from_email</name>
- <type>varchar</type>
+ <comment>FROM email name used for receipts generated by contributions to this contribution page.</comment>
+ <add>1.3</add>
+ </field>
+ <field>
+ <name>receipt_from_email</name>
+ <type>varchar</type>
<length>255</length>
- <comment>FROM email address used for receipts generated by contributions to this contribution page.</comment>
- <add>1.3</add>
- </field>
- <field>
- <name>cc_receipt</name>
- <type>varchar</type>
+ <comment>FROM email address used for receipts generated by contributions to this contribution page.</comment>
+ <add>1.3</add>
+ </field>
+ <field>
+ <name>cc_receipt</name>
+ <type>varchar</type>
<length>255</length>
- <comment>comma-separated list of email addresses to cc each time a receipt is sent</comment>
- <add>1.3</add>
- </field>
- <field>
- <name>bcc_receipt</name>
- <type>varchar</type>
+ <comment>comma-separated list of email addresses to cc each time a receipt is sent</comment>
+ <add>1.3</add>
+ </field>
+ <field>
+ <name>bcc_receipt</name>
+ <type>varchar</type>
<length>255</length>
- <comment>comma-separated list of email addresses to bcc each time a receipt is sent</comment>
- <add>1.3</add>
- </field>
- <field>
- <name>receipt_text</name>
+ <comment>comma-separated list of email addresses to bcc each time a receipt is sent</comment>
+ <add>1.3</add>
+ </field>
+ <field>
+ <name>receipt_text</name>
<type>text</type>
<htmlType>textarea</htmlType>
<rows>6</rows>
<cols>50</cols>
<localizable>true</localizable>
<comment>text to include above standard receipt info on receipt email. emails are text-only, so do not allow html for now</comment>
- <add>1.3</add>
- </field>
+ <add>1.3</add>
+ </field>
<field>
<name>is_active</name>
<type>boolean</type>
<default>1</default>
<add>1.5</add>
</field>
- <field>
- <name>honor_block_is_active</name>
- <type>boolean</type>
- <comment>Should this contribution have the honor block enabled?</comment>
- <add>1.6</add>
+ <field>
+ <name>honor_block_is_active</name>
+ <type>boolean</type>
+ <comment>Should this contribution have the honor block enabled?</comment>
+ <add>1.6</add>
</field>
- <field>
- <name>honor_block_title</name>
- <type>varchar</type>
+ <field>
+ <name>honor_block_title</name>
+ <type>varchar</type>
<length>255</length>
<localizable>true</localizable>
- <comment>Title for honor block.</comment>
- <add>1.5</add>
+ <comment>Title for honor block.</comment>
+ <add>1.5</add>
</field>
- <field>
- <name>honor_block_text</name>
- <type>text</type>
+ <field>
+ <name>honor_block_text</name>
+ <type>text</type>
<htmlType>textarea</htmlType>
<rows>2</rows>
<cols>50</cols>
<localizable>true</localizable>
- <comment>text for honor block.</comment>
- <add>1.5</add>
+ <comment>text for honor block.</comment>
+ <add>1.5</add>
</field>
<field>
<name>start_date</name>
<comment>Date and time that contribution page was created.</comment>
<add>3.0</add>
</field>
- <field>
- <name>currency</name>
- <type>varchar</type>
+ <field>
+ <name>currency</name>
+ <type>varchar</type>
<length>3</length>
<default>NULL</default>
<headerPattern>/cur(rency)?/i</headerPattern>
<keyColumn>name</keyColumn>
<labelColumn>symbol</labelColumn>
</pseudoconstant>
- </field>
- <field>
- <name>campaign_id</name>
- <type>int unsigned</type>
- <comment>The campaign for which we are collecting contributions with this page.</comment>
- <add>3.4</add>
- </field>
- <foreignKey>
- <name>campaign_id</name>
- <table>civicrm_campaign</table>
- <key>id</key>
+ </field>
+ <field>
+ <name>campaign_id</name>
+ <type>int unsigned</type>
+ <comment>The campaign for which we are collecting contributions with this page.</comment>
+ <add>3.4</add>
+ </field>
+ <foreignKey>
+ <name>campaign_id</name>
+ <table>civicrm_campaign</table>
+ <key>id</key>
<onDelete>SET NULL</onDelete>
</foreignKey>
- <field>
- <name>is_share</name>
+ <field>
+ <name>is_share</name>
<type>boolean</type>
- <default>1</default>
- <comment>Can people share the contribution page through social media?</comment>
+ <default>1</default>
+ <comment>Can people share the contribution page through social media?</comment>
<add>4.1</add>
</field>
</table>
</field>
<field>
<name>frequency_unit</name>
- <type>enum</type>
+ <type>enum</type>
<values>day,week,month,year</values>
<default>'month'</default>
<comment>Time units for recurrence of payment.</comment>
<comment>Date this recurring contribution finished successfully</comment>
<add>1.6</add>
</field>
- <field>
+ <field>
<name>processor_id</name>
- <type>varchar</type>
+ <type>varchar</type>
<length>255</length>
- <comment>Possibly needed to store a unique identifier for this recurring payment order - if this is available from the processor??</comment>
- <add>1.6</add>
- </field>
- <field>
- <name>trxn_id</name>
+ <comment>Possibly needed to store a unique identifier for this recurring payment order - if this is available from the processor??</comment>
+ <add>1.6</add>
+ </field>
+ <field>
+ <name>trxn_id</name>
<title>Transaction ID</title>
- <type>varchar</type>
- <length>255</length>
+ <type>varchar</type>
+ <length>255</length>
<comment>unique transaction id. may be processor id, bank id + trans id, or account number + check number... depending on payment_method</comment>
- <add>1.6</add>
- </field>
- <field>
- <name>invoice_id</name>
+ <add>1.6</add>
+ </field>
+ <field>
+ <name>invoice_id</name>
<title>Invoice ID</title>
- <type>varchar</type>
- <length>255</length>
+ <type>varchar</type>
+ <length>255</length>
<comment>unique invoice id, system generated or passed in</comment>
- <add>1.6</add>
- </field>
+ <add>1.6</add>
+ </field>
<index>
<name>UI_contrib_trxn_id</name>
<fieldName>trxn_id</fieldName>
<fieldName>contribution_status_id</fieldName>
<add>1.6</add>
</index>
- <field>
- <name>is_test</name>
+ <field>
+ <name>is_test</name>
<title>Test</title>
<type>boolean</type>
<default>0</default>
<comment>At Groundspring we set a business rule to retry failed payments every 7 days - and stored the next scheduled attempt date there.</comment>
<add>1.6</add>
</field>
- <field>
+ <field>
<name>auto_renew</name>
- <type>boolean</type>
- <required>true</required>
+ <type>boolean</type>
+ <required>true</required>
<default>0</default>
- <comment>Some systems allow contributor to set a number of installments - but then auto-renew the subscription or commitment if they do not cancel.</comment>
- <add>1.6</add>
+ <comment>Some systems allow contributor to set a number of installments - but then auto-renew the subscription or commitment if they do not cancel.</comment>
+ <add>1.6</add>
</field>
<field>
<name>payment_processor_id</name>
<comment>Foreign key to civicrm_payment_processor.id</comment>
<add>3.3</add>
</field>
- <foreignKey>
- <name>payment_processor_id</name>
- <table>civicrm_payment_processor</table>
- <key>id</key>
- <add>3.3</add>
+ <foreignKey>
+ <name>payment_processor_id</name>
+ <table>civicrm_payment_processor</table>
+ <key>id</key>
+ <add>3.3</add>
<onDelete>SET NULL</onDelete>
</foreignKey>
<field>
<title>Payment Instrument</title>
<type>int unsigned</type>
<comment>FK to Payment Instrument</comment>
+ <pseudoconstant>
+ <optionGroupName>payment_instrument</optionGroupName>
+ </pseudoconstant>
<add>4.1</add>
</field>
<index>
<key>id</key>
<onDelete>SET NULL</onDelete>
</foreignKey>
- <field>
- <name>is_email_receipt</name>
- <type>boolean</type>
- <comment>if true, receipt is automatically emailed to contact on each successful payment</comment>
+ <field>
+ <name>is_email_receipt</name>
+ <type>boolean</type>
+ <comment>if true, receipt is automatically emailed to contact on each successful payment</comment>
<default>1</default>
- <add>4.1</add>
- </field>
+ <add>4.1</add>
+ </field>
</table>
<type>int unsigned</type>
<title>Financial Type ID</title>
<default>NULL</default>
- <comment>Financial type assigned to paid event registrations for this event. Required if is_monetary is true.</comment>
+ <comment>Financial type assigned to paid event registrations for this event. Required if is_monetary is true.</comment>
+ <pseudoconstant>
+ <table>civicrm_financial_type</table>
+ <keyColumn>id</keyColumn>
+ <labelColumn>name</labelColumn>
+ </pseudoconstant>
<add>4.3</add>
</field>
<field>
<type>varchar</type>
<length>128</length>
<comment>Payment Processors configured for this Event (if is_monetary is true)</comment>
+ <pseudoconstant>
+ <table>civicrm_payment_processor</table>
+ <keyColumn>id</keyColumn>
+ <labelColumn>name</labelColumn>
+ </pseudoconstant>
<add>1.8</add>
</field>
<field>
<?xml version="1.0" encoding="iso-8859-1" ?>
-<table>
- <base>CRM/Financial</base>
- <class>FinancialTrxn</class>
- <name>civicrm_financial_trxn</name>
- <add>1.3</add>
+<table>
+ <base>CRM/Financial</base>
+ <class>FinancialTrxn</class>
+ <name>civicrm_financial_trxn</name>
+ <add>1.3</add>
<log>true</log>
- <field>
- <name>id</name>
- <type>int unsigned</type>
- <required>true</required>
- <add>1.3</add>
- </field>
- <primaryKey>
- <name>id</name>
- <autoincrement>true</autoincrement>
- </primaryKey>
- <field>
- <name>from_account_id</name>
- <type>int unsigned</type>
- <comment>FK to financial_account table.</comment>
- <add>3.2</add>
+ <field>
+ <name>id</name>
+ <type>int unsigned</type>
+ <required>true</required>
+ <add>1.3</add>
+ </field>
+ <primaryKey>
+ <name>id</name>
+ <autoincrement>true</autoincrement>
+ </primaryKey>
+ <field>
+ <name>from_account_id</name>
+ <type>int unsigned</type>
+ <comment>FK to financial_account table.</comment>
+ <add>3.2</add>
<drop>4.3</drop>
- </field>
- <foreignKey>
- <name>from_account_id</name>
- <table>civicrm_financial_account</table>
- <key>id</key>
+ </field>
+ <foreignKey>
+ <name>from_account_id</name>
+ <table>civicrm_financial_account</table>
+ <key>id</key>
<add>3.2</add>
- <drop>4.3</drop>
+ <drop>4.3</drop>
</foreignKey>
- <field>
- <name>to_account_id</name>
- <type>int unsigned</type>
- <comment>FK to financial_account table.</comment>
- <add>3.2</add>
+ <field>
+ <name>to_account_id</name>
+ <type>int unsigned</type>
+ <comment>FK to financial_account table.</comment>
+ <add>3.2</add>
<drop>4.3</drop>
- </field>
- <foreignKey>
- <name>to_account_id</name>
- <table>civicrm_financial_account</table>
- <key>id</key>
+ </field>
+ <foreignKey>
+ <name>to_account_id</name>
+ <table>civicrm_financial_account</table>
+ <key>id</key>
<add>3.2</add>
- <drop>4.3</drop>
+ <drop>4.3</drop>
</foreignKey>
- <field>
- <name>from_financial_account_id</name>
- <type>int unsigned</type>
- <comment>FK to financial_account table.</comment>
+ <field>
+ <name>from_financial_account_id</name>
+ <type>int unsigned</type>
+ <comment>FK to financial_account table.</comment>
<add>4.3</add>
<pseudoconstant>
<table>civicrm_financial_account</table>
<keyColumn>id</keyColumn>
<labelColumn>name</labelColumn>
</pseudoconstant>
- </field>
- <foreignKey>
- <name>from_financial_account_id</name>
- <table>civicrm_financial_account</table>
- <key>id</key>
+ </field>
+ <foreignKey>
+ <name>from_financial_account_id</name>
+ <table>civicrm_financial_account</table>
+ <key>id</key>
<add>4.3</add>
</foreignKey>
- <field>
- <name>to_financial_account_id</name>
- <type>int unsigned</type>
- <comment>FK to financial_financial_account table.</comment>
+ <field>
+ <name>to_financial_account_id</name>
+ <type>int unsigned</type>
+ <comment>FK to financial_financial_account table.</comment>
<add>4.3</add>
<pseudoconstant>
<table>civicrm_financial_account</table>
<keyColumn>id</keyColumn>
<labelColumn>name</labelColumn>
</pseudoconstant>
- </field>
- <foreignKey>
- <name>to_financial_account_id</name>
- <table>civicrm_financial_account</table>
- <key>id</key>
+ </field>
+ <foreignKey>
+ <name>to_financial_account_id</name>
+ <table>civicrm_financial_account</table>
+ <key>id</key>
<add>4.3</add>
</foreignKey>
- <field>
- <name>trxn_date</name>
- <type>datetime</type>
- <default>NULL</default>
- <comment>date transaction occurred</comment>
- <add>1.3</add>
- </field>
- <field>
- <name>trxn_type</name>
- <type>enum</type>
+ <field>
+ <name>trxn_date</name>
+ <type>datetime</type>
+ <default>NULL</default>
+ <comment>date transaction occurred</comment>
+ <add>1.3</add>
+ </field>
+ <field>
+ <name>trxn_type</name>
+ <type>enum</type>
<values>Debit,Credit</values>
- <required>true</required>
- <add>1.3</add>
+ <required>true</required>
+ <add>1.3</add>
<drop>4.3</drop>
- </field>
- <field>
- <name>total_amount</name>
- <type>decimal</type>
+ </field>
+ <field>
+ <name>total_amount</name>
+ <type>decimal</type>
<required>true</required>
<comment>amount of transaction</comment>
- <add>1.3</add>
- </field>
- <field>
- <name>fee_amount</name>
- <type>decimal</type>
+ <add>1.3</add>
+ </field>
+ <field>
+ <name>fee_amount</name>
+ <type>decimal</type>
<comment>actual processor fee if known - may be 0.</comment>
- <add>1.3</add>
- </field>
- <field>
- <name>net_amount</name>
- <type>decimal</type>
+ <add>1.3</add>
+ </field>
+ <field>
+ <name>net_amount</name>
+ <type>decimal</type>
<comment>actual funds transfer amount. total less fees. if processor does not report actual fee during transaction, this is set to total_amount.</comment>
- <add>1.3</add>
+ <add>1.3</add>
</field>
<field>
<name>currency</name>
<type>varchar</type>
<length>3</length>
- <default>NULL</default>
+ <default>NULL</default>
<import>true</import>
<headerPattern>/cur(rency)?/i</headerPattern>
<dataPattern>/^[A-Z]{3}$/</dataPattern>
<labelColumn>symbol</labelColumn>
</pseudoconstant>
</field>
- <field>
- <name>payment_processor</name>
- <type>varchar</type>
- <length>64</length>
+ <field>
+ <name>payment_processor</name>
+ <type>varchar</type>
+ <length>64</length>
<required>true</required>
- <comment>derived from Processor setting in civicrm.settings.php.</comment>
- <add>1.3</add>
+ <comment>derived from Processor setting in civicrm.settings.php.</comment>
+ <add>1.3</add>
<drop>4.3</drop>
- </field>
- <field>
- <name>trxn_id</name>
- <type>varchar</type>
+ </field>
+ <field>
+ <name>trxn_id</name>
+ <type>varchar</type>
<length>255</length>
- <comment>user-specified unique processor transaction id, bank id + trans id,... depending on payment_method</comment>
- <add>1.3</add>
- </field>
- <field>
- <name>trxn_result_code</name>
- <type>varchar</type>
- <length>255</length>
- <comment>processor result code</comment>
- <add>1.3</add>
- </field>
+ <comment>user-specified unique processor transaction id, bank id + trans id,... depending on payment_method</comment>
+ <add>1.3</add>
+ </field>
+ <field>
+ <name>trxn_result_code</name>
+ <type>varchar</type>
+ <length>255</length>
+ <comment>processor result code</comment>
+ <add>1.3</add>
+ </field>
<field>
<name>status_id</name>
<title>Financial Transaction Status Id</title>
<type>int unsigned</type>
<import>true</import>
- <export>true</export>
- <comment>pseudo FK to civicrm_option_value of financial_item status option_group</comment>
+ <export>true</export>
+ <comment>pseudo FK to civicrm_option_value of financial_item status option_group</comment>
<headerPattern>/status/i</headerPattern>
<add>4.3</add>
</field>
- <field>
- <name>payment_processor_id</name>
- <type>int unsigned</type>
- <comment>Payment Processor for this financial transaction</comment>
- <add>4.3</add>
- </field>
- <foreignKey>
- <name>payment_processor_id</name>
- <table>civicrm_payment_processor</table>
- <key>id</key>
+ <field>
+ <name>payment_processor_id</name>
+ <type>int unsigned</type>
+ <comment>Payment Processor for this financial transaction</comment>
+ <add>4.3</add>
+ </field>
+ <foreignKey>
+ <name>payment_processor_id</name>
+ <table>civicrm_payment_processor</table>
+ <key>id</key>
<onDelete>SET NULL</onDelete>
- <add>4.3</add>
+ <add>4.3</add>
</foreignKey>
<field>
<name>payment_instrument_id</name>
<type>int unsigned</type>
<comment>FK to payment_instrument option group values</comment>
<pseudoconstant>
- <name>paymentInstrument</name>
- <optionGroupName>paymentInstrument</optionGroupName>
- <class>CRM_Contribute_PseudoConstant</class>
+ <optionGroupName>payment_instrument</optionGroupName>
</pseudoconstant>
<add>4.3</add>
</field>
<type>int unsigned</type>
<title>Grant Type Id</title>
<pseudoconstant>
- <name>grantType</name>
<optionGroupName>grant_type</optionGroupName>
</pseudoconstant>
<export>false</export>