Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions CRM/Upgrade/Incremental/sql/6.18.alpha1.mysql.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,14 @@ INSERT IGNORE INTO civicrm_state_province (country_id, abbreviation, name) VALUE
(@country_id, 'F', 'Bolívar'),
(@country_id, 'R', 'Sucre'),
(@country_id, 'Z', 'Amazonas');

-- dev/core#3871 : add activity for 'Write-off' feature for pledges
SELECT @option_group_id_activity_type := max(id) from civicrm_option_group where name = 'activity_type';
SELECT @max_val := MAX(ROUND(op.value)) FROM civicrm_option_value op WHERE op.option_group_id = @option_group_id_activity_type;
SELECT @max_wt := max(weight) from civicrm_option_value where option_group_id=@option_group_id_activity_type;
SELECT @pledgeCompId := id FROM `civicrm_component` where `name` like 'CiviPledge';

INSERT INTO civicrm_option_value
(option_group_id, {localize field='label'}label{/localize}, {localize field='description'}description{/localize}, value, name, weight, filter, component_id)
VALUES
(@option_group_id_activity_type, {localize}'{ts escape="sql"}Pledge write-off{/ts}'{/localize},{localize}''{/localize}, (SELECT @max_val := @max_val+1), 'Pledge write-off', (SELECT @max_wt := @max_wt+1), 0, @pledgeCompId);