From 6d68a4cb56cdbe45112853ee0b5ecf15179b057d Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Mon, 6 May 2013 16:50:30 -0700 Subject: [PATCH] Add financial pseudoconstants CRM-12464 ---------------------------------------- * CRM-12464: Search improvements in 4.4 http://issues.civicrm.org/jira/browse/CRM-12464 --- CRM/Core/PseudoConstant.php | 24 +- tests/phpunit/CRM/Core/PseudoConstantTest.php | 162 ++++--- xml/GenCode.php | 5 +- xml/schema/Batch/Batch.xml | 3 + xml/schema/Contribute/Contribution.xml | 415 +++++++++-------- xml/schema/Contribute/ContributionPage.xml | 440 +++++++++--------- xml/schema/Contribute/ContributionRecur.xml | 75 +-- xml/schema/Event/Event.xml | 12 +- xml/schema/Financial/FinancialTrxn.xml | 236 +++++----- xml/schema/Grant/Grant.xml | 1 - 10 files changed, 723 insertions(+), 650 deletions(-) diff --git a/CRM/Core/PseudoConstant.php b/CRM/Core/PseudoConstant.php index e6c87c75bc..d70e769ac6 100644 --- a/CRM/Core/PseudoConstant.php +++ b/CRM/Core/PseudoConstant.php @@ -196,7 +196,9 @@ class CRM_Core_PseudoConstant { 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 @@ -205,10 +207,10 @@ class CRM_Core_PseudoConstant { * 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 * @@ -293,16 +295,22 @@ class CRM_Core_PseudoConstant { $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), diff --git a/tests/phpunit/CRM/Core/PseudoConstantTest.php b/tests/phpunit/CRM/Core/PseudoConstantTest.php index eab4917fa4..0658a5185a 100644 --- a/tests/phpunit/CRM/Core/PseudoConstantTest.php +++ b/tests/phpunit/CRM/Core/PseudoConstantTest.php @@ -58,6 +58,7 @@ class CRM_Core_PseudoConstantTest extends CiviUnitTestCase { 'is_active' => TRUE, ); $result = civicrm_api('customGroup', 'create', $api_params); + $this->assertAPISuccess($result); // Create a Group for testing. $group_name = md5(microtime()); @@ -67,6 +68,23 @@ class CRM_Core_PseudoConstantTest extends CiviUnitTestCase { '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 @@ -124,6 +142,10 @@ class CRM_Core_PseudoConstantTest extends CiviUnitTestCase { 'fieldName' => 'status_id', 'sample' => 'Scheduled', ), + array( + 'fieldName' => 'priority_id', + 'sample' => 'Urgent', + ), ), 'CRM_Campaign_DAO_Survey' => array( array( @@ -171,6 +193,11 @@ class CRM_Core_PseudoConstantTest extends CiviUnitTestCase { 'sample' => 'Accounts Receivable', 'max' => 15, ), + array( + 'fieldName' => 'currency', + 'sample' => '$', + 'max' => 200, + ), ), 'CRM_Financial_DAO_FinancialTrxn' => array( array( @@ -183,6 +210,11 @@ class CRM_Core_PseudoConstantTest extends CiviUnitTestCase { 'sample' => 'Accounts Receivable', 'max' => 15, ), + array( + 'fieldName' => 'currency', + 'sample' => '$', + 'max' => 200, + ), ), 'CRM_Financial_DAO_FinancialAccount' => array( array( @@ -190,13 +222,6 @@ class CRM_Core_PseudoConstantTest extends CiviUnitTestCase { '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', @@ -218,13 +243,6 @@ class CRM_Core_PseudoConstantTest extends CiviUnitTestCase { 'max' => 200, ), ), - 'CRM_Contribute_DAO_Contribution' => array( - array( - 'fieldName' => 'currency', - 'sample' => '$', - 'max' => 200, - ), - ), 'CRM_Contribute_DAO_Product' => array( array( 'fieldName' => 'currency', @@ -232,13 +250,6 @@ class CRM_Core_PseudoConstantTest extends CiviUnitTestCase { 'max' => 200, ), ), - 'CRM_Contribute_DAO_ContributionPage' => array( - array( - 'fieldName' => 'currency', - 'sample' => '$', - 'max' => 200, - ), - ), 'CRM_Contribute_DAO_ContributionRecur' => array( array( 'fieldName' => 'currency', @@ -246,20 +257,6 @@ class CRM_Core_PseudoConstantTest extends CiviUnitTestCase { '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', @@ -267,20 +264,6 @@ class CRM_Core_PseudoConstantTest extends CiviUnitTestCase { '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', @@ -301,6 +284,10 @@ class CRM_Core_PseudoConstantTest extends CiviUnitTestCase { 'sample' => '$', 'max' => 200, ), + array( + 'fieldName' => 'status_id', + 'sample' => 'Approved', + ), ), 'CRM_Core_DAO_CustomField' => array( array( @@ -326,12 +313,6 @@ class CRM_Core_PseudoConstantTest extends CiviUnitTestCase { 'sample' => 'Urgent', ), ), - 'CRM_Activity_DAO_Activity' => array( - array( - 'fieldName' => 'priority_id', - 'sample' => 'Urgent', - ), - ), 'CRM_Core_DAO_MailSettings' => array( array( 'fieldName' => 'protocol', @@ -351,12 +332,6 @@ class CRM_Core_PseudoConstantTest extends CiviUnitTestCase { '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', @@ -457,17 +432,29 @@ class CRM_Core_PseudoConstantTest extends CiviUnitTestCase { '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( @@ -491,6 +478,49 @@ class CRM_Core_PseudoConstantTest extends CiviUnitTestCase { '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, + ), ), ); @@ -498,7 +528,7 @@ class CRM_Core_PseudoConstantTest extends CiviUnitTestCase { 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. diff --git a/xml/GenCode.php b/xml/GenCode.php index 600810b339..bd7d8879c8 100644 --- a/xml/GenCode.php +++ b/xml/GenCode.php @@ -718,12 +718,13 @@ Alternatively you can get a version of CiviCRM that matches your PHP version //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){ diff --git a/xml/schema/Batch/Batch.xml b/xml/schema/Batch/Batch.xml index 50b470495c..cd99cf117c 100644 --- a/xml/schema/Batch/Batch.xml +++ b/xml/schema/Batch/Batch.xml @@ -152,6 +152,9 @@ payment_instrument_id int unsigned fk to Payment Instrument options in civicrm_option_values + + payment_instrument + 4.3 diff --git a/xml/schema/Contribute/Contribution.xml b/xml/schema/Contribute/Contribution.xml index bbf4063f4b..ae47e85bf6 100644 --- a/xml/schema/Contribute/Contribution.xml +++ b/xml/schema/Contribute/Contribution.xml @@ -1,194 +1,202 @@ - + - - CRM/Contribute - Contribution - civicrm_contribution - 1.3 +
+ CRM/Contribute + Contribution + civicrm_contribution + 1.3true - - id + + id contribution_id - int unsigned + int unsigned true - true + true Contribution ID - Contribution ID - 1.3 - - - id - true - - - contact_id + Contribution ID + 1.3 + + + id + true + + + contact_id contribution_contact_id Contact ID - int unsigned - true + int unsigned + true true /contact(.?id)?/i /^\d+$/ - FK to Contact ID - 1.3 - - - contact_id -
civicrm_contact
- id - 1.3 + FK to Contact ID + 1.3 +
+ + contact_id + civicrm_contact
+ id + 1.3 CASCADE -
- - solicitor_id + + + solicitor_id Solicitor ID - int unsigned - FK to Solicitor ID - 1.4 + int unsigned + FK to Solicitor ID + 1.4 2.2 - - - solicitor_id - civicrm_contact
- id - 1.4 +
+ + solicitor_id + civicrm_contact
+ id + 1.4 2.2 SET NULL -
- - contribution_type_id + + + contribution_type_id Contribution Type false int unsigned FK to Contribution Type - 1.3 - 4.3 - - - contribution_type_id - civicrm_contribution_type
- id - 1.3 - 4.3 + 1.3 + 4.3 +
+ + contribution_type_id + civicrm_contribution_type
+ id + 1.3 + 4.3 SET NULL -
- + + financial_type_id Financial Type false int unsigned FK to Financial Type for (total_amount - non_deductible_amount). - 4.3 - - - financial_type_id - civicrm_financial_type
- id + + civicrm_financial_type
+ id + name +
4.3 -
- - contribution_page_id + + + financial_type_id + civicrm_financial_type
+ id + 4.3 +
+ + contribution_page_id Contribution Page int unsigned true - The Contribution Page which triggered this contribution - 1.5 - - - contribution_page_id - civicrm_contribution_page
- id + The Contribution Page which triggered this contribution + + civicrm_contribution_page
+ id + title +
+ 1.5 +
+ + contribution_page_id + civicrm_contribution_page
+ id SET NULL
- + payment_instrument_id contribution_payment_instrument_id Payment Instrument int unsigned FK to Payment Instrument - paymentInstrument - paymentInstrument - CRM_Contribute_PseudoConstant + payment_instrument 1.3 - + UI_contrib_payment_instrument_id - payment_instrument_id + payment_instrument_id 1.6 - - - receive_date - datetime + + + receive_date + datetime true /receive(.?date)?/i /^\d{4}-?\d{2}-?\d{2} ?(\d{2}:?\d{2}:?(\d{2})?)?$/ - when was gift received - 1.3 - - - non_deductible_amount + when was gift received + 1.3 + + + non_deductible_amount Non-deductible Amount decimal 0 true /non?.?deduct/i /^\d+(\.\d{2})?$/ - Portion of total amount which is NOT tax deductible. Equal to total_amount for non-deductible financial types. - 1.3 + Portion of total amount which is NOT tax deductible. Equal to total_amount for non-deductible financial types. + 1.3 - - total_amount - decimal + + total_amount + decimal true true /^total|(.?^am(ou)?nt)/i /^\d+(\.\d{2})?$/ - Total amount of this contribution. Use market value for non-monetary gifts. - 1.3 + Total amount of this contribution. Use market value for non-monetary gifts. + 1.3 - - fee_amount - decimal + + fee_amount + decimal true /fee(.?am(ou)?nt)?/i /^\d+(\.\d{2})?$/ actual processor fee if known - may be 0. - 1.3 - - - net_amount - decimal + 1.3 + + + net_amount + decimal true /net(.?am(ou)?nt)?/i /^\d+(\.\d{2})?$/ actual funds transfer amount. total less fees. if processor does not report actual fee during transaction, this is set to total_amount. - 1.3 + 1.3 - - trxn_id + + trxn_id Transaction ID - varchar - 255 + varchar + 255 true /tr(ansactio|x)n(.?id)?/i unique transaction id. may be processor id, bank id + trans id, or account number + check number... depending on payment_method - 1.3 - - - invoice_id + 1.3 + + + invoice_id Invoice ID - varchar - 255 + varchar + 255 true /invoice(.?id)?/i unique invoice id, system generated or passed in - 1.3 - - - currency - varchar + 1.3 + + + currency + varchar 3 NULL true @@ -201,60 +209,60 @@ name symbol - - - cancel_date - datetime + + + cancel_date + datetime true /cancel(.?date)?/i /^\d{4}-?\d{2}-?\d{2} ?(\d{2}:?\d{2}:?(\d{2})?)?$/ - when was gift cancelled - 1.3 - - - cancel_reason - text + when was gift cancelled + 1.3 + + + cancel_reason + text true /(cancel.?)?reason/i - 1.3 - - - receipt_date - datetime + 1.3 + + + receipt_date + datetime true /receipt(.?date)?/i /^\d{4}-?\d{2}-?\d{2} ?(\d{2}:?\d{2}:?(\d{2})?)?$/ when (if) receipt was sent. populated automatically for online donations w/ automatic receipting - 1.3 - - + 1.3 + + thankyou_date Thank-you Date - datetime + datetime true /thank(s|(.?you))?(.?date)?/i /^\d{4}-?\d{2}-?\d{2} ?(\d{2}:?\d{2}:?(\d{2})?)?$/ - when (if) was donor thanked - 1.3 - - + when (if) was donor thanked + 1.3 + + source contribution_source Contribution Source - varchar + varchar 255 true /source/i - Origin of this Contribution. - 1.3 - - + Origin of this Contribution. + 1.3 + + amount_level Amount Label - text + text true - 1.7 - + 1.7 + note text @@ -280,47 +288,47 @@ true 2.1 - - contribution_recur_id - int unsigned - 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. - 1.4 - - - contribution_recur_id - civicrm_contribution_recur
- id - 1.4 + + contribution_recur_id + int unsigned + 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. + 1.4 + + + contribution_recur_id + civicrm_contribution_recur
+ id + 1.4 SET NULL
- - honor_contact_id + + honor_contact_id Honor Contact - int unsigned - FK to contact ID - 1.3 - - - honor_contact_id - civicrm_contact
- id - 1.6 + int unsigned + FK to contact ID + 1.3 +
+ + honor_contact_id + civicrm_contact
+ id + 1.6 SET NULL -
- - is_test +
+ + is_test Test boolean 0 true - - is_pay_later + + is_pay_later Is Pay Later boolean 0 true - 2.1 + 2.1 contribution_status_id @@ -330,6 +338,9 @@ true true /status/i + + contribution_status + 1.6 @@ -353,47 +364,47 @@ receive_date 1.6 - - address_id - int unsigned - Conditional foreign key to civicrm_address.id. We insert an address record for each contribution when we have associated billing name and address data. - 2.2 - - - address_id - civicrm_address
- id - 2.2 + + address_id + int unsigned + Conditional foreign key to civicrm_address.id. We insert an address record for each contribution when we have associated billing name and address data. + 2.2 + + + address_id + civicrm_address
+ id + 2.2 SET NULL
- - check_number + + check_number Check Number /check(.?number)?/i - varchar + varchar 255 - SIX + SIX true - 2.2 - + 2.2 + check_number check_number 2.2 - + campaign_id contribution_campaign_id int unsigned Campaign ID - true - The campaign for which this contribution has been triggered. - 3.4 - - - campaign_id - civicrm_campaign
- id + true + The campaign for which this contribution has been triggered. + 3.4 +
+ + campaign_id + civicrm_campaign
+ id SET NULL
diff --git a/xml/schema/Contribute/ContributionPage.xml b/xml/schema/Contribute/ContributionPage.xml index d48d1886c8..a004764286 100644 --- a/xml/schema/Contribute/ContributionPage.xml +++ b/xml/schema/Contribute/ContributionPage.xml @@ -36,66 +36,76 @@ Text and html allowed. Displayed below title. 1.3
- - contribution_type_id - int unsigned - true - default Contribution type assigned to contributions submitted via this page, e.g. Contribution, Campaign Contribution - 1.3 + + contribution_type_id + int unsigned + true + default Contribution type assigned to contributions submitted via this page, e.g. Contribution, Campaign Contribution + 1.3 4.3 - - - contribution_type_id - civicrm_contribution_type
- id +
+ + contribution_type_id + civicrm_contribution_type
+ id 4.3
- - financial_type_id - int unsigned - default financial type assigned to contributions submitted via this page, e.g. Contribution, Campaign Contribution + + financial_type_id + int unsigned + default financial type assigned to contributions submitted via this page, e.g. Contribution, Campaign Contribution + + civicrm_financial_type
+ id + name +
+ 4.3 +
+ + financial_type_id + civicrm_financial_type
+ id 4.3 -
- - financial_type_id - civicrm_financial_type
- id - 4.3
- - payment_processor + + payment_processor varchar 128 - Payment Processors configured for this contribution Page - 1.8 - - - is_credit_card_only - boolean - if true - processing logic must reject transaction at confirmation stage if pay method != credit card + Payment Processors configured for this contribution Page + + civicrm_payment_processor
+ id + name +
+ 1.8 +
+ + is_credit_card_only + boolean + if true - processing logic must reject transaction at confirmation stage if pay method != credit card + 0 + 1.3 + + + is_monetary + boolean + 1 + if true - allows real-time monetary transactions otherwise non-monetary transactions + 1.6 + + + is_recur + boolean 0 - 1.3 - - - is_monetary - boolean - 1 - if true - allows real-time monetary transactions otherwise non-monetary transactions - 1.6 - - - is_recur - boolean - 0 - if true - allows recurring contributions, valid only for PayPal_Standard - 1.6 - - - is_confirm_enabled - boolean - 1 - if false, the confirm page in contribution pages gets skipped - 4.2 + if true - allows recurring contributions, valid only for PayPal_Standard + 1.6 + + + is_confirm_enabled + boolean + 1 + if false, the confirm page in contribution pages gets skipped + 4.2 recur_frequency_unit @@ -105,74 +115,74 @@ 2.1 - is_recur_interval - boolean - 0 - if true - supports recurring intervals - 2.1 + is_recur_interval + boolean + 0 + if true - supports recurring intervals + 2.1 - is_recur_installments - boolean - 0 - if true - asks user for recurring installments - 4.3 + is_recur_installments + boolean + 0 + if true - asks user for recurring installments + 4.3 - - is_pay_later - boolean - 0 - if true - allows the user to send payment directly to the org later - 2.0 + + is_pay_later + boolean + 0 + if true - allows the user to send payment directly to the org later + 2.0 - - pay_later_text - text + + pay_later_text + text true - The text displayed to the user in the main form - 2.0 + The text displayed to the user in the main form + 2.0 - - pay_later_receipt - text + + pay_later_receipt + text true - The receipt sent to the user instead of the normal receipt text - 2.0 - - - is_partial_payment - boolean - 0 - is partial payment enabled for this online contribution page - 4.3 - - - initial_amount_label - varchar - 255 + The receipt sent to the user instead of the normal receipt text + 2.0 + + + is_partial_payment + boolean + 0 + is partial payment enabled for this online contribution page + 4.3 + + + initial_amount_label + varchar + 255 true - Initial amount label for partial payment - 4.3 + Initial amount label for partial payment + 4.3 - - initial_amount_help_text - text + + initial_amount_help_text + text true - Initial amount help text for partial payment - 4.3 + Initial amount help text for partial payment + 4.3 - - min_initial_amount - decimal - Minimum initial amount for partial payment - 4.3 + + min_initial_amount + decimal + Minimum initial amount for partial payment + 4.3 - - is_allow_other_amount - boolean - if true, page will include an input text field where user can enter their own amount - 0 - 1.3 + + is_allow_other_amount + boolean + if true, page will include an input text field where user can enter their own amount + 0 + 1.3 default_amount_id @@ -180,23 +190,23 @@ FK to civicrm_option_value. 1.7 - - min_amount - decimal - if other amounts allowed, user can configure minimum allowed. - 1.3 - - - max_amount - decimal - if other amounts allowed, user can configure maximum allowed. - 1.3 - - - goal_amount - decimal - The target goal for this page, allows people to build a goal meter - 1.5 + + min_amount + decimal + if other amounts allowed, user can configure minimum allowed. + 1.3 + + + max_amount + decimal + if other amounts allowed, user can configure maximum allowed. + 1.3 + + + goal_amount + decimal + The target goal for this page, allows people to build a goal meter + 1.5 thankyou_title @@ -207,92 +217,92 @@ Title for Thank-you page (header title tag, and display at the top of the page). 1.3 - - thankyou_text + + thankyou_text Thank-you Text - text + text textarea 8 60 true - text and html allowed. displayed above result on success page - 1.3 - - - thankyou_footer + text and html allowed. displayed above result on success page + 1.3 + + + thankyou_footer Thank-you Footer - text + text textarea 8 60 true - 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. - 1.3 - - - is_for_organization - boolean - if true, signup is done on behalf of an organization + 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. + 1.3 + + + is_for_organization + boolean + if true, signup is done on behalf of an organization 0 - 2.1 - - - for_organization + 2.1 + + + for_organization On Behalf Of Organization - text + text textarea 2 50 true - This text field is shown when is_for_organization is checked. For example - I am contributing on behalf on an organization. - 2.1 - - - is_email_receipt - boolean - if true, receipt is automatically emailed to contact on success + This text field is shown when is_for_organization is checked. For example - I am contributing on behalf on an organization. + 2.1 + + + is_email_receipt + boolean + if true, receipt is automatically emailed to contact on success 0 - 1.3 - - + 1.3 + + receipt_from_name - varchar + varchar 255 true - FROM email name used for receipts generated by contributions to this contribution page. - 1.3 - - - receipt_from_email - varchar + FROM email name used for receipts generated by contributions to this contribution page. + 1.3 + + + receipt_from_email + varchar 255 - FROM email address used for receipts generated by contributions to this contribution page. - 1.3 - - - cc_receipt - varchar + FROM email address used for receipts generated by contributions to this contribution page. + 1.3 + + + cc_receipt + varchar 255 - comma-separated list of email addresses to cc each time a receipt is sent - 1.3 - - - bcc_receipt - varchar + comma-separated list of email addresses to cc each time a receipt is sent + 1.3 + + + bcc_receipt + varchar 255 - comma-separated list of email addresses to bcc each time a receipt is sent - 1.3 - - - receipt_text + comma-separated list of email addresses to bcc each time a receipt is sent + 1.3 + + + receipt_text text textarea 6 50 true text to include above standard receipt info on receipt email. emails are text-only, so do not allow html for now - 1.3 - + 1.3 + is_active boolean @@ -316,29 +326,29 @@ 1 1.5 - - honor_block_is_active - boolean - Should this contribution have the honor block enabled? - 1.6 + + honor_block_is_active + boolean + Should this contribution have the honor block enabled? + 1.6 - - honor_block_title - varchar + + honor_block_title + varchar 255 true - Title for honor block. - 1.5 + Title for honor block. + 1.5 - - honor_block_text - text + + honor_block_text + text textarea 2 50 true - text for honor block. - 1.5 + text for honor block. + 1.5 start_date @@ -374,9 +384,9 @@ Date and time that contribution page was created. 3.0 - - currency - varchar + + currency + varchar 3 NULL /cur(rency)?/i @@ -388,24 +398,24 @@ name symbol - - - campaign_id - int unsigned - The campaign for which we are collecting contributions with this page. - 3.4 - - - campaign_id - civicrm_campaign
- id +
+ + campaign_id + int unsigned + The campaign for which we are collecting contributions with this page. + 3.4 + + + campaign_id + civicrm_campaign
+ id SET NULL
- - is_share + + is_share boolean - 1 - Can people share the contribution page through social media? + 1 + Can people share the contribution page through social media? 4.1 diff --git a/xml/schema/Contribute/ContributionRecur.xml b/xml/schema/Contribute/ContributionRecur.xml index c6f6f8d47e..7129e4b3a1 100644 --- a/xml/schema/Contribute/ContributionRecur.xml +++ b/xml/schema/Contribute/ContributionRecur.xml @@ -52,7 +52,7 @@ frequency_unit - enum + enum day,week,month,year 'month' Time units for recurrence of payment. @@ -103,29 +103,29 @@ Date this recurring contribution finished successfully 1.6 - + processor_id - varchar + varchar 255 - Possibly needed to store a unique identifier for this recurring payment order - if this is available from the processor?? - 1.6 - - - trxn_id + Possibly needed to store a unique identifier for this recurring payment order - if this is available from the processor?? + 1.6 + + + trxn_id Transaction ID - varchar - 255 + varchar + 255 unique transaction id. may be processor id, bank id + trans id, or account number + check number... depending on payment_method - 1.6 - - - invoice_id + 1.6 + + + invoice_id Invoice ID - varchar - 255 + varchar + 255 unique invoice id, system generated or passed in - 1.6 - + 1.6 + UI_contrib_trxn_id trxn_id @@ -151,8 +151,8 @@ contribution_status_id 1.6 - - is_test + + is_test Test boolean 0 @@ -185,13 +185,13 @@ At Groundspring we set a business rule to retry failed payments every 7 days - and stored the next scheduled attempt date there. 1.6 - + auto_renew - boolean - true + boolean + true 0 - Some systems allow contributor to set a number of installments - but then auto-renew the subscription or commitment if they do not cancel. - 1.6 + Some systems allow contributor to set a number of installments - but then auto-renew the subscription or commitment if they do not cancel. + 1.6 payment_processor_id @@ -199,11 +199,11 @@ Foreign key to civicrm_payment_processor.id 3.3 - - payment_processor_id - civicrm_payment_processor
- id - 3.3 + + payment_processor_id + civicrm_payment_processor
+ id + 3.3 SET NULL
@@ -243,6 +243,9 @@ Payment Instrument int unsigned FK to Payment Instrument + + payment_instrument + 4.1 @@ -265,11 +268,11 @@ id SET NULL
- - is_email_receipt - boolean - if true, receipt is automatically emailed to contact on each successful payment + + is_email_receipt + boolean + if true, receipt is automatically emailed to contact on each successful payment 1 - 4.1 - + 4.1 + diff --git a/xml/schema/Event/Event.xml b/xml/schema/Event/Event.xml index 3a7f88801c..921b5b0eda 100644 --- a/xml/schema/Event/Event.xml +++ b/xml/schema/Event/Event.xml @@ -181,7 +181,12 @@ int unsigned Financial Type ID NULL - Financial type assigned to paid event registrations for this event. Required if is_monetary is true. + Financial type assigned to paid event registrations for this event. Required if is_monetary is true. + + civicrm_financial_type
+ id + name +
4.3
@@ -189,6 +194,11 @@ varchar 128 Payment Processors configured for this Event (if is_monetary is true) + + civicrm_payment_processor
+ id + name +
1.8
diff --git a/xml/schema/Financial/FinancialTrxn.xml b/xml/schema/Financial/FinancialTrxn.xml index 36d21e0b82..2565512144 100755 --- a/xml/schema/Financial/FinancialTrxn.xml +++ b/xml/schema/Financial/FinancialTrxn.xml @@ -1,122 +1,122 @@ - - CRM/Financial - FinancialTrxn - civicrm_financial_trxn - 1.3 +
+ CRM/Financial + FinancialTrxn + civicrm_financial_trxn + 1.3true - - id - int unsigned - true - 1.3 - - - id - true - - - from_account_id - int unsigned - FK to financial_account table. - 3.2 + + id + int unsigned + true + 1.3 + + + id + true + + + from_account_id + int unsigned + FK to financial_account table. + 3.2 4.3 - - - from_account_id -
civicrm_financial_account
- id +
+ + from_account_id + civicrm_financial_account
+ id 3.2 - 4.3 + 4.3
- - to_account_id - int unsigned - FK to financial_account table. - 3.2 + + to_account_id + int unsigned + FK to financial_account table. + 3.2 4.3 - - - to_account_id - civicrm_financial_account
- id +
+ + to_account_id + civicrm_financial_account
+ id 3.2 - 4.3 + 4.3
- - from_financial_account_id - int unsigned - FK to financial_account table. + + from_financial_account_id + int unsigned + FK to financial_account table. 4.3 civicrm_financial_account
id name
-
- - from_financial_account_id - civicrm_financial_account
- id +
+ + from_financial_account_id + civicrm_financial_account
+ id 4.3
- - to_financial_account_id - int unsigned - FK to financial_financial_account table. + + to_financial_account_id + int unsigned + FK to financial_financial_account table. 4.3 civicrm_financial_account
id name
-
- - to_financial_account_id - civicrm_financial_account
- id +
+ + to_financial_account_id + civicrm_financial_account
+ id 4.3
- - trxn_date - datetime - NULL - date transaction occurred - 1.3 - - - trxn_type - enum + + trxn_date + datetime + NULL + date transaction occurred + 1.3 + + + trxn_type + enum Debit,Credit - true - 1.3 + true + 1.3 4.3 - - - total_amount - decimal + + + total_amount + decimal true amount of transaction - 1.3 - - - fee_amount - decimal + 1.3 + + + fee_amount + decimal actual processor fee if known - may be 0. - 1.3 - - - net_amount - decimal + 1.3 + + + net_amount + decimal actual funds transfer amount. total less fees. if processor does not report actual fee during transaction, this is set to total_amount. - 1.3 + 1.3 currency varchar 3 - NULL + NULL true /cur(rency)?/i /^[A-Z]{3}$/ @@ -128,51 +128,51 @@ symbol - - payment_processor - varchar - 64 + + payment_processor + varchar + 64 true - derived from Processor setting in civicrm.settings.php. - 1.3 + derived from Processor setting in civicrm.settings.php. + 1.3 4.3 - - - trxn_id - varchar + + + trxn_id + varchar 255 - user-specified unique processor transaction id, bank id + trans id,... depending on payment_method - 1.3 - - - trxn_result_code - varchar - 255 - processor result code - 1.3 - + user-specified unique processor transaction id, bank id + trans id,... depending on payment_method + 1.3 + + + trxn_result_code + varchar + 255 + processor result code + 1.3 + status_id Financial Transaction Status Id int unsigned true - true - pseudo FK to civicrm_option_value of financial_item status option_group + true + pseudo FK to civicrm_option_value of financial_item status option_group /status/i 4.3 - - payment_processor_id - int unsigned - Payment Processor for this financial transaction - 4.3 - - - payment_processor_id - civicrm_payment_processor
- id + + payment_processor_id + int unsigned + Payment Processor for this financial transaction + 4.3 + + + payment_processor_id + civicrm_payment_processor
+ id SET NULL - 4.3 + 4.3
payment_instrument_id @@ -181,9 +181,7 @@ int unsigned FK to payment_instrument option group values - paymentInstrument - paymentInstrument - CRM_Contribute_PseudoConstant + payment_instrument 4.3 diff --git a/xml/schema/Grant/Grant.xml b/xml/schema/Grant/Grant.xml index 3199c5a119..3fe82f373a 100644 --- a/xml/schema/Grant/Grant.xml +++ b/xml/schema/Grant/Grant.xml @@ -81,7 +81,6 @@ int unsigned Grant Type Id - grantType grant_type false -- 2.25.1