Skip to content

Commit 64339a0

Browse files
committed
Exclude refunded tickets from copied emails on ticketing page
1 parent c22b353 commit 64339a0

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

src/ui/pages/tickets/ViewTickets.page.tsx

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,17 +67,22 @@ const ViewTicketsPage: React.FC = () => {
6767
try {
6868
let emailsToCopy: string[] = [];
6969
let copyModeHumanString = '';
70+
const nonRefundedTickets = allTickets.filter((x) => !x.refunded);
7071
switch (mode) {
7172
case TicketsCopyMode.ALL:
72-
emailsToCopy = allTickets.map((x) => x.purchaserData.email);
73+
emailsToCopy = nonRefundedTickets.map((x) => x.purchaserData.email);
7374
copyModeHumanString = 'All';
7475
break;
7576
case TicketsCopyMode.FULFILLED:
76-
emailsToCopy = allTickets.filter((x) => x.fulfilled).map((x) => x.purchaserData.email);
77+
emailsToCopy = nonRefundedTickets
78+
.filter((x) => x.fulfilled)
79+
.map((x) => x.purchaserData.email);
7780
copyModeHumanString = 'Fulfilled';
7881
break;
7982
case TicketsCopyMode.UNFULFILLED:
80-
emailsToCopy = allTickets.filter((x) => !x.fulfilled).map((x) => x.purchaserData.email);
83+
emailsToCopy = nonRefundedTickets
84+
.filter((x) => !x.fulfilled)
85+
.map((x) => x.purchaserData.email);
8186
copyModeHumanString = 'Unfulfilled';
8287
break;
8388
}
@@ -157,7 +162,7 @@ const ViewTicketsPage: React.FC = () => {
157162
return (
158163
<AuthGuard resourceDef={{ service: 'core', validRoles: [AppRoles.TICKETS_MANAGER] }}>
159164
<Title order={2}>View Tickets/Merch Sales</Title>
160-
<Group mt="md" mb="md">
165+
<Group mt="md">
161166
<Button
162167
onClick={() => {
163168
copyEmails(TicketsCopyMode.ALL);
@@ -180,8 +185,11 @@ const ViewTicketsPage: React.FC = () => {
180185
Copy Unfulfilled Emails
181186
</Button>
182187
</Group>
188+
<Text size="xs">Note: all lists do not include refunded tickets.</Text>
183189
<div>
184-
<Title order={4}>{pluralize('item', totalQuantitySold, true)} sold</Title>
190+
<Title mt="md" order={4}>
191+
{pluralize('item', totalQuantitySold, true)} sold
192+
</Title>
185193
<Table>
186194
<Table.Thead>
187195
<Table.Tr>

0 commit comments

Comments
 (0)