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 @@