April 24, 20206 yr There is a fundamental logic fault in the design of stats modules' queries. The (original?) programmer presumed that each order will have an associated invoice but for many it's not the case (I am one of those many). The queries use 'invoice_date' where they should use 'date_add'. The solution is simple: search and replace the first with the latter and number will appear. Use the quotes too, there is at least one function name containing invoice_date in one of the stats*.php files, you don't want to mess it up.
April 24, 20206 yr 9 minutes ago, varadipeter said: There is a fundamental logic fault in the design of stats modules' queries. The (original?) programmer presumed that each order will have an associated invoice but for many it's not the case (I am one of those many). The queries use 'invoice_date' where they should use 'date_add'. The solution is simple: search and replace the first with the latter and number will appear. Use the quotes too, there is at least one function name containing invoice_date in one of the stats*.php files, you don't want to mess it up. I wouldn't call that a flaw. It really depends on what you want to report on. As you know, orders does not always mean income. From accounting and tax perspective, reporting based on invoice data are more important. There is actually a github issue, and PR as well, for this migration to order based reporting. It was never integrated into the mainstream code, because community couldn't decide on what is the right approach here. We even created a poll back in the day, and the result was 50/50. I guess the best approach would be to have this as a preference, or possibility to switch during report generation
April 24, 20206 yr 32 minutes ago, datakick said: From accounting and tax perspective, reporting based on invoice data are more important. This is exactly why I called it a flaw: internal invoicing is turned off because we use a proper accounting software. TB is there to what it is good at: collect online orders. Displaying a menu saying "orders profit" and then displaying "invoiced profit" is just ... what was the expression I used? 🙂 "I guess the best approach would be to have this as a preference, or possibility to switch during report generation" I would love to see a toggle switch to do that or at least to replace 'invoice_date' with a variable within the files.
April 24, 20206 yr For same reason (accounting) I renamed "Invoice" to "Order Confirmation" everywhere where customer could see it, but have "Invoices" enabled to use it as printout for packing orders and user can download it for review.
April 26, 20206 yr On 4/24/2020 at 7:32 PM, varadipeter said: The queries use 'invoice_date' where they should use 'date_add'. This goes into the right direction, but isn't universally true. Because for many merchants, a sale is only a sale when an invoice got generated. For example, an order waiting for bankwire payment didn't generate income yet, so it can hardly be counted as revenue.
Create an account or sign in to comment