diff --git a/CRM/Pledge/BAO/Query.php b/CRM/Pledge/BAO/Query.php index 1b3779060efd..0e0ff052c215 100644 --- a/CRM/Pledge/BAO/Query.php +++ b/CRM/Pledge/BAO/Query.php @@ -82,6 +82,12 @@ public static function select(&$query) { $query->_tables['civicrm_pledge'] = $query->_whereTables['civicrm_pledge'] = 1; } + if (!empty($query->_returnProperties['pledge_end_date'])) { + $query->_select['pledge_end_date'] = 'civicrm_pledge.end_date as pledge_end_date'; + $query->_element['pledge_end_date'] = 1; + $query->_tables['civicrm_pledge'] = $query->_whereTables['civicrm_pledge'] = 1; + } + if (!empty($query->_returnProperties['pledge_start_date'])) { $query->_select['pledge_start_date'] = 'civicrm_pledge.start_date as pledge_start_date'; $query->_element['pledge_start_date'] = 1; diff --git a/CRM/Pledge/DAO/Pledge.php b/CRM/Pledge/DAO/Pledge.php index fe6abc9014b7..76d0e11dd292 100644 --- a/CRM/Pledge/DAO/Pledge.php +++ b/CRM/Pledge/DAO/Pledge.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Pledge/Pledge.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:5e5bb725caa46ae10f0c5d039a03c675) + * (GenCodeChecksum:a25cc68d8392b1d60d7179ca484b604a) */ /** @@ -420,17 +420,19 @@ public static function &fields() { 'type' => 'Text', ], ], - 'start_date' => [ + 'pledge_start_date' => [ 'name' => 'start_date', 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME, 'title' => ts('Pledge Start Date'), 'description' => ts('The date the first scheduled pledge occurs.'), 'required' => TRUE, 'where' => 'civicrm_pledge.start_date', + 'export' => TRUE, 'table_name' => 'civicrm_pledge', 'entity' => 'Pledge', 'bao' => 'CRM_Pledge_BAO_Pledge', 'localizable' => 0, + 'unique_title' => ts('Payments Start Date'), 'html' => [ 'type' => 'Select Date', ], @@ -491,16 +493,18 @@ public static function &fields() { 'type' => 'Select Date', ], ], - 'end_date' => [ + 'pledge_end_date' => [ 'name' => 'end_date', 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME, 'title' => ts('Pledge End Date'), 'description' => ts('Date this pledge finished successfully (total pledge payments equal to or greater than pledged amount).'), 'where' => 'civicrm_pledge.end_date', + 'export' => TRUE, 'table_name' => 'civicrm_pledge', 'entity' => 'Pledge', 'bao' => 'CRM_Pledge_BAO_Pledge', 'localizable' => 0, + 'unique_title' => ts('Payments Ended Date'), 'html' => [ 'type' => 'Select Date', ], diff --git a/tests/phpunit/CRM/Export/BAO/ExportTest.php b/tests/phpunit/CRM/Export/BAO/ExportTest.php index 71f8d5b068d5..51add7935599 100644 --- a/tests/phpunit/CRM/Export/BAO/ExportTest.php +++ b/tests/phpunit/CRM/Export/BAO/ExportTest.php @@ -2348,7 +2348,7 @@ protected function getPledgeHeaderDefinition() { 82 => 'Total Pledged', 83 => 'Total Paid', 84 => 'Pledge Made', - 85 => 'pledge_start_date', + 85 => 'Pledge Start Date', 86 => 'Next Payment Date', 87 => 'Next Payment Amount', 88 => 'Pledge Status', @@ -2694,7 +2694,7 @@ public function getPledgeSqlColumns() { 'pledge_amount' => 'pledge_amount varchar(32)', 'pledge_total_paid' => 'pledge_total_paid text', 'pledge_create_date' => 'pledge_create_date varchar(32)', - 'pledge_start_date' => 'pledge_start_date text', + 'pledge_start_date' => 'pledge_start_date varchar(32)', 'pledge_next_pay_date' => 'pledge_next_pay_date text', 'pledge_next_pay_amount' => 'pledge_next_pay_amount text', 'pledge_status' => 'pledge_status varchar(255)', diff --git a/xml/schema/Pledge/Pledge.xml b/xml/schema/Pledge/Pledge.xml index 50ecd9c2261b..7fd1cf35cc2c 100644 --- a/xml/schema/Pledge/Pledge.xml +++ b/xml/schema/Pledge/Pledge.xml @@ -196,11 +196,14 @@ datetime Pledge Start Date true + true The date the first scheduled pledge occurs. 2.1 - Select Date - + Select Date + + pledge_start_date + Payments Start Date create_date @@ -209,6 +212,7 @@ Pledge Made true true + true When this pledge record was created. 2.1 @@ -222,7 +226,7 @@ When a pledge acknowledgement message was sent to the contributor. 2.1 - Select Date + Select Date @@ -239,18 +243,21 @@ Date this pledge was cancelled by contributor. 2.1 - Select Date + Select Date end_date datetime Pledge End Date + true Date this pledge finished successfully (total pledge payments equal to or greater than pledged amount). 2.1 - Select Date + Select Date + pledge_end_date + Payments Ended Date max_reminders @@ -259,8 +266,8 @@ 1 The maximum number of payment reminders to send for any given payment. - Text - + Text + 2.1 @@ -271,8 +278,8 @@ Send initial reminder this many days prior to the payment due date. 2.1 - Select - + Select + additional_reminder_day @@ -282,8 +289,8 @@ Send additional reminder this many days after last one sent, up to maximum number of reminders. 2.1 - Text - + Text + status_id diff --git a/xml/schema/Pledge/PledgePayment.xml b/xml/schema/Pledge/PledgePayment.xml index e13eb9e16b7d..711204820b10 100644 --- a/xml/schema/Pledge/PledgePayment.xml +++ b/xml/schema/Pledge/PledgePayment.xml @@ -98,6 +98,7 @@ pledge_payment_scheduled_date Scheduled Date true + true datetime true The date the pledge payment is supposed to happen.