-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreportVolunteering.js
157 lines (157 loc) · 4.87 KB
/
reportVolunteering.js
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
function readVolunteering(stmt, cell) {
makeReport(stmt, {
sheetName: "Volunteering",
query: `
SELECT
\`first_name\` AS "First Name",
\`nickname\` AS "Facebook Name",
pd.cc_volunteer AS "Selected Roles",
volunteer_caving_preevent_facebook_promo AS "FB promo",
volunteer_caving_event_reporter AS "Reporter",
volunteer_caving_head_chef AS "Head Chef",
volunteer_caving_evening_meal_chef AS "EM Chef",
volunteer_caving_breakfast_lunch_chef AS "B&L Chef",
volunteer_caving_packed_lunch_marshal AS "Lunch Marshal",
volunteer_caving_breakfast_marshal AS "Breakfast Marshal",
volunteer_caving_lift_sharing_coordinator AS "Lift Coordinator",
volunteer_caving_activities_coordinator AS "Activities Coordinator",
volunteer_caving_kit_coordinator AS "Kit Coordinator",
volunteer_caving_newbie_buddy_maker AS "Newbie Buddy",
volunteer_caving_covid_marshal AS "Covid Marshal",
volunteer_caving_evening_meal_washing_up_marshal AS "EM Wash Up",
volunteer_caving_breakfast_washing_up_marshal AS "B&L Wash Up",
volunteer_caving_event_assistant AS "Event Assistant",
volunteer_caving_event_director AS "Trip Director",
scores_volunteer_score_cached AS "Receptiveness",
\`admin-first-timer-question\` AS "First time with Crew?",
\`admin-first-timer-caving\` AS "First caving trip?",
\`stats_volunteer_for_denominator_cached\` AS "Attended events",
\`stats_attendance_caving_attended_cached\` AS "Attended caving trips",
\`admin-caving-requests-notes\` AS "Requests and notes",
pd.order_id AS "Order ID",
pd.user_id AS "User ID"
FROM jtl_member_db db
JOIN jtl_order_product_customer_lookup pd ON pd.user_id = db.id
WHERE product_id=${cell} AND status IN ("wc-processing", "wc-onhold", "wc-on-hold")
ORDER BY FIELD(pd.cc_volunteer, "none", "trip_director", "buddy_coordinator", "kit_coordinator",
"transport_coordinator", "lunch_breakfast_chef", "evening_meal_chef", "breakfast_marshal",
"lunch_marshal", "caving_coordinator", "evening_meal_washingup_marshal", "postpromo1") ASC,
\`admin-first-timer-caving\` DESC, CAST(stats_attendance_caving_attended_cached AS UNSIGNED INTEGER) ASC
`,
formatting: [
{ type: "numberFormat", column: "Attended events", format: "0" },
{
type: "colorLessThanOrEqual",
column: "Attended events",
value: "10",
color: colors.pink,
},
{
type: "colorLessThanOrEqual",
column: "Attended events",
value: "20",
color: colors.lightYellow,
},
{
type: "colorLessThanOrEqual",
column: "Attended events",
value: "30",
color: colors.yellow,
},
{
type: "color",
column: "Selected Roles",
search: "none",
color: colors.lightGreen,
},
{
type: "color",
column: "Selected Roles",
search: "Selected",
color: colors.white,
},
{
type: "color",
column: "Selected Roles",
search: "",
color: colors.lightBlue,
},
{ type: "text", column: "FB promo", search: "No", color: colors.grey },
{ type: "text", column: "Reporter", search: "No", color: colors.grey },
{ type: "text", column: "Head Chef", search: "No", color: colors.grey },
{ type: "text", column: "EM Chef", search: "No", color: colors.grey },
{ type: "text", column: "B&L Chef", search: "No", color: colors.grey },
{
type: "text",
column: "Lunch Marshal",
search: "No",
color: colors.grey,
},
{
type: "text",
column: "Breakfast Marshal",
search: "No",
color: colors.grey,
},
{
type: "text",
column: "Lift Coordinator",
search: "No",
color: colors.grey,
},
{
type: "text",
column: "Activities Coordinator",
search: "No",
color: colors.grey,
},
{
type: "text",
column: "Kit Coordinator",
search: "No",
color: colors.grey,
},
{
type: "text",
column: "Newbie Buddy",
search: "No",
color: colors.grey,
},
{
type: "text",
column: "Covid Marshal",
search: "No",
color: colors.grey,
},
{ type: "text", column: "EM Wash Up", search: "No", color: colors.grey },
{ type: "text", column: "B&L Wash Up", search: "No", color: colors.grey },
{
type: "text",
column: "Event Assistant",
search: "No",
color: colors.grey,
},
{
type: "text",
column: "Trip Director",
search: "No",
color: colors.grey,
},
{
type: "color",
column: "First time with Crew?",
search: "Yes",
color: colors.lightYellow,
},
{
type: "color",
column: "First caving trip?",
search: "Yes",
color: colors.lightYellow,
},
{ type: "columnWidth", column: "Requests and notes", width: 300 },
{ type: "columnWidth", column: "First Name", width: 150 },
{ type: "wrap", column: "Requests and notes" },
],
});
}