Skip to content

Commit

Permalink
Merge pull request #11194 from highfalutin/CRM-21346-export-pledge-in…
Browse files Browse the repository at this point in the history
…stallment-amount-and-count

CRM-21346: Make pledge installment count & amount exportable
  • Loading branch information
monishdeb authored Oct 25, 2017
2 parents 9af8bfd + 547cbec commit cbbfe3c
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
12 changes: 12 additions & 0 deletions CRM/Pledge/BAO/Query.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,18 @@ public static function select(&$query) {
$query->_tables['civicrm_pledge'] = $query->_whereTables['civicrm_pledge'] = 1;
}

if (!empty($query->_returnProperties['pledge_original_installment_amount'])) {
$query->_select['pledge_original_installment_amount'] = 'civicrm_pledge.original_installment_amount as pledge_original_installment_amount';
$query->_element['pledge_original_installment_amount'] = 1;
$query->_tables['civicrm_pledge'] = $query->_whereTables['civicrm_pledge'] = 1;
}

if (!empty($query->_returnProperties['installments'])) {
$query->_select['installments'] = 'civicrm_pledge.installments as installments';
$query->_element['installments'] = 1;
$query->_tables['civicrm_pledge'] = $query->_whereTables['civicrm_pledge'] = 1;
}

if (!empty($query->_returnProperties['pledge_create_date'])) {
$query->_select['pledge_create_date'] = 'civicrm_pledge.create_date as pledge_create_date';
$query->_element['pledge_create_date'] = 1;
Expand Down
10 changes: 9 additions & 1 deletion CRM/Pledge/DAO/Pledge.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
*
* Generated from xml/schema/CRM/Pledge/Pledge.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
* (GenCodeChecksum:02d420c23b3c72fc2687cd857cc7d178)
* (GenCodeChecksum:0e2129564a1877226e6dfce2840ce831)
*/
require_once 'CRM/Core/DAO.php';
require_once 'CRM/Utils/Type.php';
Expand Down Expand Up @@ -318,6 +318,10 @@ static function &fields() {
20,
2
) ,
'export' => true,
'where' => 'civicrm_pledge.original_installment_amount',
'headerPattern' => '',
'dataPattern' => '',
'table_name' => 'civicrm_pledge',
'entity' => 'Pledge',
'bao' => 'CRM_Pledge_BAO_Pledge',
Expand Down Expand Up @@ -404,6 +408,10 @@ static function &fields() {
'type' => CRM_Utils_Type::T_INT,
'title' => ts('Pledge Number of Installments') ,
'description' => 'Total number of payments to be made.',
'export' => true,
'where' => 'civicrm_pledge.installments',
'headerPattern' => '',
'dataPattern' => '',
'default' => '1',
'table_name' => 'civicrm_pledge',
'entity' => 'Pledge',
Expand Down
2 changes: 2 additions & 0 deletions xml/schema/Pledge/Pledge.xml
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@
<html>
<type>Text</type>
</html>
<export>true</export>
</field>
<field>
<name>currency</name>
Expand Down Expand Up @@ -187,6 +188,7 @@
<html>
<type>Text</type>
</html>
<export>true</export>
</field>
<field>
<name>start_date</name>
Expand Down

0 comments on commit cbbfe3c

Please sign in to comment.