{"id":1099280,"date":"2016-04-06T16:46:33","date_gmt":"2016-04-06T23:46:33","guid":{"rendered":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/tickets-sales-via-woocommerce-math-bug\/"},"modified":"2016-05-20T07:49:17","modified_gmt":"2016-05-20T14:49:17","slug":"tickets-sales-via-woocommerce-math-bug","status":"closed","type":"topic","link":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/tickets-sales-via-woocommerce-math-bug\/","title":{"rendered":"Tickets sales (via Woocommerce) math bug?"},"content":{"rendered":"<p>If you are looking at a list of events in the admin, the ones that have tickets for sale will have an option to click &#8220;Attendees.&#8221;<\/p>\n<p>If you go to that page there is an accounting of tickets sold in the top righthand part of the screen:<br \/>\n&#8211; Total sold<br \/>\n&#8211; Finalized<br \/>\n&#8211; Awaiting review<br \/>\n&#8211; Checked in<br \/>\n&#8211; Deleted<\/p>\n<p>The math here is happening wrong.<\/p>\n<p>in attendees.php (lines 14-20)<\/p>\n<p><code>foreach ( $tickets as $ticket ) {<br \/>\n$total_sold += $ticket-&gt;qty_sold() + $ticket-&gt;qty_pending();<br \/>\n$total_pending += $ticket-&gt;qty_pending();<br \/>\n}<br \/>\n$total_completed = $total_sold - $total_pending;<br \/>\n$total_attendees = Tribe__Tickets__Tickets::get_event_attendees_count( $event_id );<br \/>\n$deleted_attendees = $total_sold - $total_attendees;<br \/>\n<\/code><\/p>\n<p>I didn&#8217;t trace this all the way back, but I&#8217;m wondering if $ticket-&gt;qty_sold() actually includes the pending tickets so you shouldn&#8217;t be adding the two together to get $total_sold. The other math would be off, as well. Or qty_pending() is simply those sales not &#8220;completed,&#8221; which is different than payments &#8220;pending payment.&#8221;<\/p>\n<p>When you go through the Orders and &#8220;complete&#8221; them all, the numbers eventually come back to their correct amounts.<\/p>\n<p>Couple screenshots:<br \/>\nBefore: showing erroneous tallies:<br \/>\nhttps:\/\/dl.dropboxusercontent.com\/u\/2505483\/Screen%20Shot%202016-04-06%20at%202.48.05%20PM.png<\/p>\n<p>After orders are marked &#8220;completed&#8221;:<br \/>\nhttps:\/\/dl.dropboxusercontent.com\/u\/2505483\/Screen%20Shot%202016-04-06%20at%202.48.53%20PM.png<\/p>\n","protected":false},"template":"","class_list":["post-1099280","topic","type-topic","status-closed","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Tickets sales (via Woocommerce) math bug? -<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/tickets-sales-via-woocommerce-math-bug\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Tickets sales (via Woocommerce) math bug? -\" \/>\n<meta property=\"og:description\" content=\"If you are looking at a list of events in the admin, the ones that have tickets for sale will have an option to click &#8220;Attendees.&#8221; If you go to that page there is an accounting of tickets sold in the top righthand part of the screen: &#8211; Total sold &#8211; Finalized &#8211; Awaiting review [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/tickets-sales-via-woocommerce-math-bug\/\" \/>\n<meta property=\"article:modified_time\" content=\"2016-05-20T14:49:17+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/tickets-sales-via-woocommerce-math-bug\/\",\"url\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/tickets-sales-via-woocommerce-math-bug\/\",\"name\":\"Tickets sales (via Woocommerce) math bug? -\",\"isPartOf\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\"},\"datePublished\":\"2016-04-06T23:46:33+00:00\",\"dateModified\":\"2016-05-20T14:49:17+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/tickets-sales-via-woocommerce-math-bug\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/tickets-sales-via-woocommerce-math-bug\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/tickets-sales-via-woocommerce-math-bug\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/theeventscalendar.com\/support\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Topics\",\"item\":\"https:\/\/theeventscalendar.com\/support\/topics\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Ticket Products\",\"item\":\"https:\/\/theeventscalendar.com\/support\/forums\/forum\/event-tickets\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Event Tickets Plus\",\"item\":\"https:\/\/theeventscalendar.com\/support\/forums\/forum\/event-tickets\/event-tickets-plus\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"Tickets sales (via Woocommerce) math bug?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\",\"url\":\"https:\/\/theeventscalendar.com\/support\/\",\"name\":\"\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/theeventscalendar.com\/support\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Tickets sales (via Woocommerce) math bug? -","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/tickets-sales-via-woocommerce-math-bug\/","og_locale":"en_US","og_type":"article","og_title":"Tickets sales (via Woocommerce) math bug? -","og_description":"If you are looking at a list of events in the admin, the ones that have tickets for sale will have an option to click &#8220;Attendees.&#8221; If you go to that page there is an accounting of tickets sold in the top righthand part of the screen: &#8211; Total sold &#8211; Finalized &#8211; Awaiting review [&hellip;]","og_url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/tickets-sales-via-woocommerce-math-bug\/","article_modified_time":"2016-05-20T14:49:17+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/tickets-sales-via-woocommerce-math-bug\/","url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/tickets-sales-via-woocommerce-math-bug\/","name":"Tickets sales (via Woocommerce) math bug? -","isPartOf":{"@id":"https:\/\/theeventscalendar.com\/support\/#website"},"datePublished":"2016-04-06T23:46:33+00:00","dateModified":"2016-05-20T14:49:17+00:00","breadcrumb":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/tickets-sales-via-woocommerce-math-bug\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/theeventscalendar.com\/support\/forums\/topic\/tickets-sales-via-woocommerce-math-bug\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/tickets-sales-via-woocommerce-math-bug\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/theeventscalendar.com\/support\/"},{"@type":"ListItem","position":2,"name":"Topics","item":"https:\/\/theeventscalendar.com\/support\/topics\/"},{"@type":"ListItem","position":3,"name":"Ticket Products","item":"https:\/\/theeventscalendar.com\/support\/forums\/forum\/event-tickets\/"},{"@type":"ListItem","position":4,"name":"Event Tickets Plus","item":"https:\/\/theeventscalendar.com\/support\/forums\/forum\/event-tickets\/event-tickets-plus\/"},{"@type":"ListItem","position":5,"name":"Tickets sales (via Woocommerce) math bug?"}]},{"@type":"WebSite","@id":"https:\/\/theeventscalendar.com\/support\/#website","url":"https:\/\/theeventscalendar.com\/support\/","name":"","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/theeventscalendar.com\/support\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1099280","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":1,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1099280\/revisions"}],"predecessor-version":[{"id":1099464,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1099280\/revisions\/1099464"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/media?parent=1099280"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}