Support

Home Forums Event Espresso Premium Ticketing Numbers Slightly Off

Ticketing Numbers Slightly Off

Posted: October 27, 2016 at 9:53 pm

Viewing 11 reply threads


Giant Dwarf

October 27, 2016 at 9:53 pm

We seem to be experiencing an issue with the sold count on some of our tickets being off by a small number (about five in the last case) compared to the actual number of tickets sold when we export a ticket sales report, or manually count them.

Investigating this issue, it seems that the numbers of tickets sold are based on a stored integer in the database rather than being calculated based on the actual number of tickets, and it is this integer being incorrect that is causing the discrepancy.

Is there a way we can narrow down why this is happening, and/or re-calculate the ticket numbers so the stored number is accurate.


Giant Dwarf

October 27, 2016 at 11:36 pm

It may be completely unrelated, but I’ve also noticed that searching for the ticket name and filtering by “approved” in the backend produces an incorrect “x results found” string that seems to match the incorrect count in the database.

This is in spite of the number of actual results displayed being correct.


Lorenzo Orlando Caum

  • Support Staff

October 28, 2016 at 5:02 am

Hello,

Could you share an example from one of your recent events?

It would be helpful to see a screenshot (https://eventespresso.com/wiki/troubleshooting-checklist/#screenshots) of the date times and ticket selector area in the event editor.

Also, please let us know the default registration status which can be found in the top right area of the event editor. It is usually set to pending payment but there are other options available.

Thanks


Lorenzo


Giant Dwarf

October 28, 2016 at 5:25 am

Here is a screenshot of the date times and ticket selectors for an event.

Here is a screenshot of the ticket sales numbers that have been counted using an sql query.

The default registration status is set to pending payment.

Apologies for obscuring the event name as I’m not sure performers would be too keen on us posting event data publicly.

The “holds” column in the first screenshot can be ignored, it simply stores a variable for our event report generator.


Josh

  • Support Staff

October 28, 2016 at 9:35 am

Hi there,

May I ask if any of Event Espresso’s core code has been customized? Also, it will really help to know what the SQL query was that you used to get the data in that second screenshot.


Giant Dwarf

October 30, 2016 at 5:56 am

We have made a few small modifications to the core code.

– We have made a copy of the ticket_selector_chart.template.php, which is now hosted outside the core plugin folder. This should not affect ticket sale numbers, the customisations are entirely to do with the front end.

– We have made some modifications to <b>event-espresso-core-reg\caffeinated\admin\new\pricing\espresso_events_Pricing_Hooks_class.php</b> in order to give staff the ability to hide some events on the site’s front end. This involves the addition of two lines to _update_tkts:

$TKT_fronthide = isset( $tkt['TKT_fronthide'] ) ? $tkt['TKT_fronthide'] : 0;
$TKT->update_extra_meta( 'TKT_fronthide', $TKT_fronthide);

– We have added some customisations to store “holds” in the event meta for reports that we generate for clients. Our logged changes are:

in <b>caffeinated/admin/new/pricing/assets/ee-datetime-ticket-metabox.js</b>
under line <b>DTTeditform = $(DTTeditform).appendTo(DTT_row_container);</b>
added

DTTeditform.find('#event_holds-'+row).each( function() {
DTT_holds = $('#add-new-event-datetime-holds').val();
$(this).val(DTT_holds);
});

in <b>caffeinated/admin/new/pricing/templates/event_tickets_datetime_edit_row.template.php</b>
as a fifth column
added
<td class="event-datetime-column small-txt-column">
<input type="text" name="event_holds[]" id="event_holds-<?php echo $dtt_row; ?>" class="" value="<?php global $post; echo get_post_meta( $post->ID, 'event_holds_'.$dtt_row, true ); ?>" style="width: 40px;">
</td>

in <b>caffeinated/admin/new/pricing/templates/event_tickets_metabox_main.template.php</b>
as part of table <b>#add-new-event-datetime-table</b>
added
<td class="event-datetime-column holds-column" style="display: none;">
<label class="" for="add-new-event-datetime-holds"><?php _e('Holds', 'event_espresso'); ?></label>
<input type="text" name="add_new_datetime_holds" id="add-new-event-datetime-holds" class="ee-numeric ee-small-text-inp">
</td>

The rest of the code for that functionality is stored in a custom plugin and only touches the post_meta for the event, it doesn’t modify or interact with the EE tables in the database.

The SQL I’ve used to generate those numbers in the second screenshot is:
SELECT COUNT(REG_ID) FROM wp_esp_registration WHERE TKT_ID = " . $ticket->ID() . " AND STS_ID = 'RAP'

I realise the result from that query may not be entirely accurate, but it’s a stopgap measure which closer matches the ticket sales we’ve manually counted.


Giant Dwarf

November 1, 2016 at 8:12 pm

Any ideas guys? This is a real problem having ticket counts off and it’s affecting our ability to sell the correct number of tickets and calculate revenue.


Josh

  • Support Staff

November 2, 2016 at 5:50 pm

So your query is only on RAP registrations, so any registrations of other statuses wouldn’t be counted. That’s probably where the discrepancy is.

It really makes me nervous to see that the core code has been customized like that, the way to avoid hacking core code is you do a pull request for adding hooks to allow those to be added in via the add-on API or a simple plugin. Along with that, there’s a new feature that’s going to be added to the ticket selector soon so you’ll probably need to refactor the custom ticket selector template that you have before you update to the version that adds it.


Giant Dwarf

November 4, 2016 at 12:58 am

The SQL query was only created after we realised sales numbers being reported by the Event Espresso plugin were wrong. Even if it’s not generating the correct number, it’s definitely not the cause of the issue we’re trying to resolve.

So you can see what I’m describing here’s a report for an event, as generated by Event Espresso. Event Espresso is reporting that there were 144 sales for that datetime under “sold” when editing the event in the backend. By my count there are actually only 142 sales. I would be very happy to be corrected.

Another example report from the event for which I posted screenshots above. There aren’t even enough rows for the datetime to match the 249 “sold” tickets that EE is reporting in the backend on the event.


Josh

  • Support Staff

November 4, 2016 at 11:35 am

Of course the SQL query isn’t causing the issue, but it’s only counting RAP status registrations.

If you take a close look at the report you linked to, you’ll see that there are Pending Payment and Cancelled registrations there. Those do not count as sales.


Giant Dwarf

November 4, 2016 at 8:47 pm

There are 146 rows of bookings in that first report.

Four of those rows are “pending payment” with the transaction status “incomplete”.

Two further rows are “pending payment” with the transaction status “complete” (we have reported this discrepancy in a previous thread).

There are another eight rows where the registration is “approved” but have the transaction status incomplete. Once again this has been noted in a previous thread as an ongoing problem.

I have gone over both spreadsheets three further times and have not found a single cancelled status. I have also done a search, and asked a co-worker to also double check this.

I am unable to see how 146 rows, less six (or four) “Pending Payment” rows add up to 144 ticket sales, which is what we are being told by EE in the backend is the number of sold tickets for that datetime.

If you are not able or willing to offer any solution to this problem please just tell me so I can stop posting here instead of going round in circles like this.


Josh

  • Support Staff

November 7, 2016 at 12:16 pm

You’ll see two rows with Cancelled reg status in the Event report 2 spreadsheet, on lines 192 and 193.

Viewing 11 reply threads

The support post ‘Ticketing Numbers Slightly Off’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso