diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt
index 8862af1c4..a8e54ead1 100644
--- a/docs/changelog/7.x.x.txt
+++ b/docs/changelog/7.x.x.txt
@@ -18,6 +18,8 @@
- fix ordering of statuses in In/Out board
- fix package importing
- fix: can't turn off Is Group Admin setting
+ - fix: Event Management System -> Manage Registrants (www_searchBadges) would
+ display badges not yet purchased
- Check correct IP for spectre connections
- Inbox messages sent by Data Forms add sent by user
- Hide encryption settings for edit branch when SSL disabled
diff --git a/lib/WebGUI/Asset/Wobject/EventManagementSystem.pm b/lib/WebGUI/Asset/Wobject/EventManagementSystem.pm
index 8868d9ac1..6174637a4 100644
--- a/lib/WebGUI/Asset/Wobject/EventManagementSystem.pm
+++ b/lib/WebGUI/Asset/Wobject/EventManagementSystem.pm
@@ -4220,17 +4220,23 @@ sub www_searchBadges {
order by lastName, firstName", [$self->getId, $wildQuery, $wildQuery, $wildQuery, $wildQuery]);
$results .= q|
|;
while (my ($badgeId, $last, $first, $city, $state, $email) = $badges->array) {
- $results .= q|| Name | Location | Email | Badge ID |
|;
- $results .= qq|| $last, $first | $city, $state | $email |
- $badgeId |
|;
- $results .= q|
|
|;
+ # Get the transaction that processed this badge
my $events = $db->read(q|select b.productId, c.sku, c.title, c.price, g.gateway,
from_unixtime(d.startDate,"%a %M:%i"), from_unixtime(d.endDate,"%a %H:%i")
from EventManagementSystem_registrations b left join products c on c.productId=b.productId
left join EventManagementSystem_products d ON d.productId=b.productId
left join EventManagementSystem_purchases f ON b.purchaseId=f.purchaseId
- left join transaction g ON f.transactionId=g.transactionId where b.returned='0' and b.badgeId=?
+ left join transaction g ON f.transactionId=g.transactionId and g.status="Completed"
+ where b.returned='0' and b.badgeId=? and g.gateway IS NOT NULL
order by d.startDate,d.endDate,c.title|,[$badgeId]);
+
+ # Make sure the transation is complete before we display this badge
+ next unless $events->rows;
+
+ $results .= q|| Name | Location | Email | Badge ID |
|;
+ $results .= qq|| $last, $first | $city, $state | $email |
+ $badgeId |
|;
+ $results .= q|
|
|;
while (my ($productId, $sku, $title, $price, $gateway, $start, $end) = $events->array) {
$results .= qq|| $sku : $title |
$start - $end | ($gateway) $price |
|;