-
Notifications
You must be signed in to change notification settings - Fork 0
/
default_configuration.json
266 lines (266 loc) · 11.6 KB
/
default_configuration.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
[
{
"Label": "Total Lifetime Contributions",
"MName": "",
"DataType": "Money",
"SelectRef": "none",
"Query": "SELECT IF(SUM(t1.total_amount) IS NULL, 0, SUM(t1.total_amount))\nFROM civicrm_contribution t1 \nWHERE t1.contact_id = {contact_id} AND\nt1.contribution_status_id = 1 AND t1.is_test = 0 AND\nt1.financial_type_id IN ({financial_types})",
"Optgroup": "fundraising",
"Remove": false,
"CFID": 0,
"Weight": "",
"column_name": ""
},
{
"Label": "Total Contributions in the Last 12 Months",
"MName": "",
"DataType": "Money",
"SelectRef": "none",
"Query": "SELECT COALESCE(SUM(t1.total_amount),0)\nFROM civicrm_contribution t1\nWHERE CAST(receive_date AS DATE) BETWEEN DATE_SUB(NOW(), INTERVAL 12 MONTH) AND NOW()\nAND t1.contact_id = {contact_id} AND\nt1.contribution_status_id = 1 AND t1.financial_type_id IN ({financial_types}) AND t1.is_test = 0",
"Optgroup": "fundraising",
"Remove": false,
"CFID": 0,
"Weight": "",
"column_name": ""
},
{
"Label": "Total Contributions this Fiscal Year",
"MName": "",
"DataType": "Money",
"SelectRef": "none",
"Query": "SELECT COALESCE(SUM(t1.total_amount),0)\nFROM civicrm_contribution t1\nWHERE CAST(receive_date AS DATE) \nBETWEEN \"{current_fiscal_year_begin}\" AND \"{current_fiscal_year_end}\" AND t1.contact_id = {contact_id} \nAND t1.contribution_status_id = 1 \nAND t1.financial_type_id IN ({financial_types}) \nAND t1.is_test = 0",
"Optgroup": "fundraising",
"Remove": false,
"CFID": 0,
"Weight": "",
"column_name": ""
},
{
"Label": "Total Deductible Contributions this Fiscal Year",
"MName": "",
"DataType": "Money",
"SelectRef": "none",
"Query": "SELECT COALESCE(SUM(line_total),0) - COALESCE(SUM(qty * COALESCE(t3.non_deductible_amount, 0)), 0)\n FROM civicrm_contribution t1 JOIN civicrm_financial_type t2 ON\n t1.financial_type_id = t2.id AND is_deductible = 1\n JOIN civicrm_line_item t3 ON t1.id = t3.contribution_id\n WHERE CAST(receive_date AS DATE) BETWEEN \"{current_fiscal_year_begin}\" AND\n \"{current_fiscal_year_end}\" AND t1.contact_id IN ({contact_id}) AND\n t1.contribution_status_id = 1 AND t3.financial_type_id IN (1,2,3,4,5,6,7,8) AND t1.is_test = 0",
"Optgroup": "fundraising",
"Remove": false,
"CFID": 0,
"Weight": "",
"column_name": ""
},
{
"Label": "Total Contributions last Fiscal Year",
"MName": "",
"DataType": "Money",
"SelectRef": "none",
"Query": "SELECT COALESCE(SUM(t1.total_amount),0)\nFROM civicrm_contribution t1\nWHERE CAST(receive_date AS DATE) BETWEEN \"{last_fiscal_year_begin}\"\nAND \"{last_fiscal_year_end}\" \nAND t1.contact_id = {contact_id} AND\nt1.contribution_status_id = 1 \nAND t1.financial_type_id IN ({financial_types}) \nAND t1.is_test = 0",
"Optgroup": "fundraising",
"Remove": false,
"CFID": 0,
"Weight": "",
"column_name": ""
},
{
"Label": "Total Deductible Contributions last Fiscal Year",
"MName": "",
"DataType": "Money",
"SelectRef": "none",
"Query": "SELECT COALESCE(SUM(line_total),0) - COALESCE(SUM(qty * COALESCE(t3.non_deductible_amount, 0)), 0)\nFROM civicrm_contribution t1 JOIN civicrm_financial_type t2 ON\nt1.financial_type_id = t2.id AND is_deductible = 1\nJOIN civicrm_line_item t3 ON t1.id = t3.contribution_id\nWHERE CAST(receive_date AS DATE) BETWEEN \"{last_fiscal_year_begin}\" AND\n \"{last_fiscal_year_end}\" AND t1.contact_id IN ({contact_id}) AND\nt1.contribution_status_id = 1 AND t3.financial_type_id IN ({financial_types}) AND t1.is_test = 0",
"Optgroup": "fundraising",
"Remove": false,
"CFID": 0,
"Weight": "",
"column_name": ""
},
{
"Label": "Total Contributions Fiscal Year Before Last",
"MName": "",
"DataType": "Money",
"SelectRef": "none",
"Query": "SELECT COALESCE(SUM(t1.total_amount),0)\nFROM civicrm_contribution t1\nWHERE CAST(receive_date AS DATE) BETWEEN \"{year_before_last_fiscal_year_begin}\"\nAND \"{year_before_last_fiscal_year_end}\"\n AND t1.contact_id = {contact_id} \nAND t1.contribution_status_id = 1 \nAND t1.financial_type_id IN ({financial_types}) \nAND t1.is_test = 0",
"Optgroup": "fundraising",
"Remove": false,
"CFID": 0,
"Weight": "",
"column_name": ""
},
{
"Label": "Total Deductible Contributions Fiscal Year Before Last",
"MName": "",
"DataType": "Money",
"SelectRef": "none",
"Query": "SELECT COALESCE(SUM(line_total),0) - COALESCE(SUM(qty * COALESCE(t3.non_deductible_amount, 0)), 0)\nFROM civicrm_contribution t1 JOIN civicrm_financial_type t2 ON\nt1.financial_type_id = t2.id AND is_deductible = 1\nJOIN civicrm_line_item t3 ON t1.id = t3.contribution_id\nWHERE CAST(receive_date AS DATE) BETWEEN \"{year_before_last_fiscal_year_begin}\" AND\n\"{year_before_last_fiscal_year_end}\" AND t1.contact_id IN ({contact_id}) AND\nt1.contribution_status_id = 1 AND t3.financial_type_id IN ({financial_types}) AND t1.is_test = 0",
"Optgroup": "fundraising",
"Remove": false,
"CFID": 0,
"Weight": "",
"column_name": ""
},
{
"Label": "Amount of first contribution",
"MName": "",
"DataType": "Money",
"SelectRef": "none",
"Query": "SELECT IFNULL((SELECT t1.total_amount\nFROM civicrm_contribution t1\nWHERE t1.contact_id = {contact_id}\nAND t1.contribution_status_id = 1 \nAND t1.financial_type_id IN ({financial_types})\nAND t1.is_test = 0 ORDER BY t1.receive_date ASC LIMIT 1),'0')",
"Optgroup": "fundraising",
"Remove": false,
"CFID": 0,
"Weight": "",
"column_name": ""
},
{
"Label": "Date of First Contribution",
"MName": "",
"DataType": "Date",
"SelectRef": "none",
"Query": "SELECT MIN(t1.receive_date) FROM civicrm_contribution t1\nWHERE t1.contact_id = {contact_id} AND t1.contribution_status_id = 1 \nAND t1.financial_type_id IN ({financial_types}) AND t1.is_test = 0",
"Optgroup": "fundraising",
"Remove": false,
"CFID": 0,
"Weight": "",
"column_name": ""
},
{
"Label": "Amount of last contribution",
"MName": "",
"DataType": "Money",
"SelectRef": "none",
"Query": "SELECT IFNULL((SELECT t1.total_amount\nFROM civicrm_contribution t1\nWHERE t1.contact_id = {contact_id}\nAND t1.contribution_status_id = 1 \nAND t1.financial_type_id IN ({financial_types}) \nAND t1.is_test = 0 \nORDER BY t1.receive_date DESC LIMIT 1),'0')",
"Optgroup": "fundraising",
"Remove": false,
"CFID": 0,
"Weight": "",
"column_name": ""
},
{
"Label": "Date of Last Contribution",
"MName": "",
"DataType": "Date",
"SelectRef": "none",
"Query": "SELECT MAX(t1.receive_date) FROM civicrm_contribution t1\nWHERE t1.contact_id = {contact_id} AND t1.contribution_status_id = 1 \nAND t1.financial_type_id IN ({financial_types}) AND t1.is_test = 0",
"Optgroup": "fundraising",
"Remove": false,
"CFID": 0,
"Weight": "",
"column_name": ""
},
{
"Label": "Campaign of first contribution",
"MName": "",
"DataType": "Selector",
"SelectRef": "campaign",
"Query": "SELECT t1.campaign_id FROM civicrm_contribution t1\nWHERE t1.contact_id = {contact_id} AND t1.contribution_status_id = 1 \nAND t1.financial_type_id IN ({financial_types}) AND t1.is_test = 0\norder by receive_date asc limit 1",
"Optgroup": "fundraising",
"Remove": false,
"CFID": 0,
"Weight": "",
"column_name": ""
},
{
"Label": "Largest Contribution",
"MName": "",
"DataType": "Money",
"SelectRef": "none",
"Query": "SELECT COALESCE(MAX(t1.total_amount), 0)\nFROM civicrm_contribution t1\nWHERE t1.contact_id = {contact_id} \nAND t1.contribution_status_id = 1 \nAND t1.financial_type_id IN ({financial_types}) \nAND t1.is_test = 0",
"Optgroup": "fundraising",
"Remove": false,
"CFID": 0,
"Weight": "",
"column_name": ""
},
{
"Label": "Total count of contributions",
"MName": "",
"DataType": "String",
"SelectRef": "none",
"Query": "SELECT COALESCE(COUNT(t1.id), 0) FROM civicrm_contribution t1\nWHERE t1.contact_id = {contact_id} AND t1.contribution_status_id = 1 AND\nt1.financial_type_id IN ({financial_types}) AND t1.is_test = 0",
"Optgroup": "fundraising",
"Remove": false,
"CFID": 0,
"Weight": "",
"column_name": ""
},
{
"Label": "Count of contributions this year",
"MName": "",
"DataType": "String",
"SelectRef": "none",
"Query": "SELECT COALESCE(COUNT(t1.id), 0) \nFROM civicrm_contribution t1\nWHERE t1.contact_id = {contact_id}\nAND t1.contribution_status_id = 1 AND\nt1.financial_type_id IN ({financial_types}) \nAND YEAR(t1.receive_date) = YEAR(CURDATE())\nAND t1.is_test = 0",
"Optgroup": "fundraising",
"Remove": false,
"CFID": 0,
"Weight": "",
"column_name": ""
},
{
"Label": "Count of contributions last year",
"MName": "",
"DataType": "String",
"SelectRef": "none",
"Query": "SELECT COALESCE(COUNT(t1.id), 0) \nFROM civicrm_contribution t1\nWHERE t1.contact_id = {contact_id}\nAND t1.contribution_status_id = 1 AND\nt1.financial_type_id IN ({financial_types}) \nAND YEAR(t1.receive_date) = YEAR(DATE_SUB(CURDATE(), INTERVAL 1 YEAR))\nAND t1.is_test = 0",
"Optgroup": "fundraising",
"Remove": false,
"CFID": 0,
"Weight": "",
"column_name": ""
},
{
"Label": "Count of contributions year before last year",
"MName": "",
"DataType": "String",
"SelectRef": "none",
"Query": "SELECT COALESCE(COUNT(t1.id), 0) \nFROM civicrm_contribution t1\nWHERE t1.contact_id = {contact_id}\nAND t1.contribution_status_id = 1 AND\nt1.financial_type_id IN ({financial_types}) \nAND YEAR(t1.receive_date) = YEAR(DATE_SUB(CURDATE(), INTERVAL 2 YEAR))\nAND t1.is_test = 0",
"Optgroup": "fundraising",
"Remove": false,
"CFID": 0,
"Weight": "",
"column_name": ""
},
{
"Label": "Average Annual (Calendar Year) Contribution",
"MName": "",
"DataType": "Money",
"SelectRef": "none",
"Query": "SELECT IFNULL(ROUND(AVG(t0.total_amount),2) ,0)\nFROM civicrm_contribution t0\nWHERE t0.contact_id = {contact_id} \nAND t0.financial_type_id IN ({financial_types}) \nAND t0.contribution_status_id = 1 \nAND is_test = 0",
"Optgroup": "fundraising",
"Remove": false,
"CFID": 0,
"Weight": "",
"column_name": ""
},
{
"Label": "Campaign of largest contribution",
"MName": "",
"DataType": "Selector",
"SelectRef": "campaign",
"Query": "SELECT t1.campaign_id\nFROM civicrm_contribution t1\nWHERE t1.contact_id = {contact_id}\nAND t1.contribution_status_id = 1 \nAND t1.financial_type_id IN ({financial_types}) \nAND t1.is_test = 0\nORDER BY t1.total_amount DESC\nLIMIT 1",
"Optgroup": "fundraising",
"Remove": false,
"CFID": 0,
"Weight": "",
"column_name": ""
},
{
"Label": "Date of Last Membership payment",
"MName": "",
"DataType": "Date",
"SelectRef": "none",
"Query": "SELECT MAX(t1.receive_date) FROM civicrm_contribution t1\nWHERE t1.contact_id = {contact_id} AND t1.contribution_status_id = 1 \nAND t1.financial_type_id IN ({mbr_financial_types}) AND t1.is_test = 0",
"Optgroup": "membership",
"Remove": false,
"CFID": 0,
"Weight": "",
"column_name": ""
},
{
"Label": "Amount of last Membership payment",
"MName": "",
"DataType": "Money",
"SelectRef": "none",
"Query": "SELECT IFNULL((SELECT t1.total_amount\nFROM civicrm_contribution t1\nWHERE t1.contact_id = {contact_id}\nAND t1.contribution_status_id = 1 \nAND t1.financial_type_id IN ({mbr_financial_types}) \nAND t1.is_test = 0 \nORDER BY t1.receive_date DESC LIMIT 1),'0')",
"Optgroup": "membership",
"Remove": false,
"CFID": 0,
"Weight": "",
"column_name": ""
}
]