[2.3] Refund reporting Fixes #8010

- Prevents the refund amount being SUMed and multiplied by the number
of items
- Does LEFT join on qty, so refunds are reported if not done directly
on the line
This commit is contained in:
Mike Jolley 2015-04-23 10:19:43 +01:00
parent ec14e4b8ab
commit a2a0e6f10d
1 changed files with 3 additions and 2 deletions

View File

@ -184,7 +184,7 @@ class WC_Report_Sales_By_Date extends WC_Admin_Report {
'data' => array(
'_refund_amount' => array(
'type' => 'meta',
'function' => 'SUM',
'function' => '',
'name' => 'total_refund'
),
'post_date' => array(
@ -196,7 +196,8 @@ class WC_Report_Sales_By_Date extends WC_Admin_Report {
'type' => 'order_item_meta',
'order_item_type' => 'line_item',
'function' => 'SUM',
'name' => 'order_item_count'
'name' => 'order_item_count',
'join_type' => 'LEFT'
)
),
'group_by' => $this->group_by_query,