addition to delete duplicate entries.

This commit is contained in:
Matthew Wilson 2006-05-10 13:38:13 +00:00
parent 8b827e6067
commit f056701c04

View file

@ -48,6 +48,11 @@ sub handler {
my $purchaseId;
if ($purchaseId = $self->session->scratch->get("purchaseId".$counter)) {
$self->session->db->setRow('EventManagementSystem_purchases', 'purchaseId', {'purchaseId'=>$purchaseId, 'transactionId'=>$transactionId}, $purchaseId);
my $theseRegs = $self->session->db->buildArrayRefOfHashRefs("select * from EventManagementSystem_registrations where purchaseId=?",[$purchaseId]);
foreach (@$theseRegs) {
# clean up the duplicate registrations, if any.
$self->session->db->write("delete from EventManagementSystem_registrations where badgeId=? and productId=? and registrationId!=?,[$_->{badgeId},$_->{productId},$_->{registrationId}]);
}
$self->session->scratch->delete("purchaseId".$counter);
$counter++;
}