*/
public static function calculatePledgeStatus($pledgeId) {
$paymentStatusTypes = CRM_Contribute_PseudoConstant::contributionStatus(NULL, 'name');
+ $pledgeStatusTypes = CRM_Core_OptionGroup::values('pledge_status',
+ FALSE, FALSE, FALSE, NULL, 'name', TRUE
+ );
//return if the pledge is cancelled.
$currentPledgeStatus = CRM_Core_DAO::getFieldValue('CRM_Pledge_DAO_Pledge', $pledgeId, 'status_id', 'id', TRUE);
- if ($currentPledgeStatus == array_search('Cancelled', $paymentStatusTypes)) {
+ if ($currentPledgeStatus == array_search('Cancelled', $pledgeStatusTypes)) {
return $currentPledgeStatus;
}
}
if (array_search('Overdue', $allStatus)) {
- $statusId = array_search('Overdue', $paymentStatusTypes);
+ $statusId = array_search('Overdue', $pledgeStatusTypes);
}
elseif (array_search('Completed', $allStatus)) {
if (count(array_count_values($allStatus)) == 1) {
- $statusId = array_search('Completed', $paymentStatusTypes);
+ $statusId = array_search('Completed', $pledgeStatusTypes);
}
else {
- $statusId = array_search('In Progress', $paymentStatusTypes);
+ $statusId = array_search('In Progress', $pledgeStatusTypes);
}
}
else {
- $statusId = array_search('Pending', $paymentStatusTypes);
+ $statusId = array_search('Pending', $pledgeStatusTypes);
}
return $statusId;
*/
public static function getOldestPledgePayment($pledgeID, $limit = 1) {
// get pending / overdue statuses
- $pledgeStatuses = CRM_Contribute_PseudoConstant::contributionStatus(NULL, 'name');
+ $pledgeStatuses = CRM_Core_OptionGroup::values('pledge_status',
+ FALSE, FALSE, FALSE, NULL, 'name'
+ );
// get pending and overdue payments
$status[] = array_search('Pending', $pledgeStatuses);
('msg_mode' , '{ts escape="sql"}Message Mode{/ts}' , NULL, 1, 1, 0),
('contact_date_reminder_options' , '{ts escape="sql"}Contact Date Reminder Options{/ts}' , NULL, 1, 1, 1),
('wysiwyg_presets' , '{ts escape="sql"}WYSIWYG Editor Presets{/ts}' , NULL, 1, 1, 0),
- ('relative_date_filters' , '{ts escape="sql"}Relative Date Filters{/ts}' , NULL, 1, 1, 0);
+ ('relative_date_filters' , '{ts escape="sql"}Relative Date Filters{/ts}' , NULL, 1, 1, 0),
+ ('pledge_status' , '{ts escape="sql"}Pledge Status{/ts}' , NULL, 1, 1, 1);
SELECT @option_group_id_pcm := max(id) from civicrm_option_group where name = 'preferred_communication_method';
SELECT @option_group_id_act := max(id) from civicrm_option_group where name = 'activity_type';
SELECT @option_group_id_contactDateMode := max(id) from civicrm_option_group where name = 'contact_date_reminder_options';
SELECT @option_group_id_date_filter := max(id) from civicrm_option_group where name = 'relative_date_filters';
SELECT @option_group_id_wysiwyg_presets := max(id) from civicrm_option_group where name = 'wysiwyg_presets';
+SELECT @option_group_id_ps := max(id) from civicrm_option_group where name = 'pledge_status';
SELECT @contributeCompId := max(id) FROM civicrm_component where name = 'CiviContribute';
SELECT @eventCompId := max(id) FROM civicrm_component where name = 'CiviEvent';
(@option_group_id_report, {localize}'{ts escape="sql"}Contribution and Membership Details{/ts}'{/localize}, 'member/contributionDetail', 'CRM_Report_Form_Member_ContributionDetail', NULL, 0, NULL, 48, {localize}'{ts escape="sql"}Contribution details for any type of contribution, plus associated membership information for contributions which are in payment for memberships.{/ts}'{/localize}, 0, 0, 1, @memberCompId, NULL, NULL),
(@option_group_id_report, {localize}'{ts escape="sql"}Recurring Contributions Report{/ts}'{/localize}, 'contribute/recur', 'CRM_Report_Form_Contribute_Recur', NULL, 0, NULL, 49, {localize}'{ts escape="sql"}Provides information about the status of recurring contributions{/ts}'{/localize}, 0, 0, 1, @contributeCompId, NULL, NULL),
(@option_group_id_report, {localize}'{ts escape="sql"}Recurring Contributions Summary{/ts}'{/localize}, 'contribute/recursummary', 'CRM_Report_Form_Contribute_RecurSummary', NULL, 0, NULL, 49, {localize}'{ts escape="sql"}Provides simple summary for each payment instrument for which there are recurring contributions (e.g. Credit Card, Standing Order, Direct Debit, etc., NULL), showing within a given date range.{/ts}'{/localize}, 0, 0, 1, @contributeCompId, NULL, NULL),
- (@option_group_id_report, {localize}'{ts escape="sql"}Deferred Revenue Details{/ts}'{/localize}, 'contribute/deferredrevenue', 'CRM_Report_Form_Contribute_DeferredRevenue', NULL, 0, NULL, 50, {localize}'{ts escape="sql"}Deferred Revenue Details Report{/ts}'{/localize}, 0, 0, 1, @contributeCompId, NULL, NULL),
+ (@option_group_id_report, {localize}'{ts escape="sql"}Deferred Revenue Details{/ts}'{/localize}, 'contribute/deferredrevenue', 'CRM_Report_Form_Contribute_DeferredRevenue', NULL, 0, NULL, 50, {localize}'{ts escape="sql"}Deferred Revenue Details Report{/ts}'{/localize}, 0, 0, 1, @contributeCompId, NULL, NULL),
(@option_group_id_acs, '{ts escape="sql"}Scheduled{/ts}', 1, 'Scheduled', NULL, 0, 1, 1, NULL, 0, 1, 1, NULL, NULL, NULL),
(@option_group_id_acs, '{ts escape="sql"}Completed{/ts}', 2, 'Completed', NULL, 1, NULL, 2, NULL, 0, 1, 1, NULL, NULL, NULL),
(@option_group_id_date_filter, '{ts escape="sql"}From end of previous week{/ts}', 'greater_previous.week', 'greater_previous.week', NULL, NULL, NULL,59, NULL, 0, 0, 1, NULL, NULL, NULL),
(@option_group_id_date_filter, '{ts escape="sql"}From end of previous calendar month{/ts}', 'greater_previous.month', 'greater_previous.month', NULL, NULL, NULL,60, NULL, 0, 0, 1, NULL, NULL, NULL),
(@option_group_id_date_filter, '{ts escape="sql"}From end of previous quarter{/ts}', 'greater_previous.quarter', 'greater_previous.quarter', NULL, NULL, NULL,61, NULL, 0, 0, 1, NULL, NULL, NULL),
- (@option_group_id_date_filter, '{ts escape="sql"}From end of previous calendar year{/ts}', 'greater_previous.year', 'greater_previous.year', NULL, NULL, NULL,62, NULL, 0, 0, 1, NULL, NULL, NULL);
+ (@option_group_id_date_filter, '{ts escape="sql"}From end of previous calendar year{/ts}', 'greater_previous.year', 'greater_previous.year', NULL, NULL, NULL,62, NULL, 0, 0, 1, NULL, NULL, NULL),
+
+-- Pledge Status
+ (@option_group_id_ps, '{ts escape="sql"}Completed{/ts}' , 1, 'Completed' , NULL, 0, NULL, 1, NULL, 0, 1, 1, NULL, NULL, NULL),
+ (@option_group_id_ps, '{ts escape="sql"}Pending{/ts}' , 2, 'Pending' , NULL, 0, NULL, 2, NULL, 0, 1, 1, NULL, NULL, NULL),
+ (@option_group_id_ps, '{ts escape="sql"}Cancelled{/ts}' , 3, 'Cancelled' , NULL, 0, NULL, 3, NULL, 0, 1, 1, NULL, NULL, NULL),
+ (@option_group_id_ps, '{ts escape="sql"}In Progress{/ts}', 4, 'In Progress', NULL, 0, NULL, 5, NULL, 0, 1, 1, NULL, NULL, NULL),
+ (@option_group_id_ps, '{ts escape="sql"}Overdue{/ts}' , 5, 'Overdue' , NULL, 0, NULL, 6, NULL, 0, 1, 1, NULL, NULL, NULL);
-- financial accounts
SELECT @opval := value FROM civicrm_option_value WHERE name = 'Revenue' and option_group_id = @option_group_id_fat;