Remove on-hold orders from tax reports as they are not paid yet. Tax reports should only contain paid orders.

This commit is contained in:
Gerhard 2019-01-11 14:44:09 +02:00
parent a7463c5535
commit cf38ed4aba
2 changed files with 6 additions and 4 deletions

View File

@ -116,6 +116,7 @@ class WC_Report_Taxes_By_Code extends WC_Admin_Report {
),
);
// We exclude on-hold orders as they are still pending payment.
$tax_rows_orders = $this->get_order_report_data(
array(
'data' => $query_data,
@ -124,8 +125,8 @@ class WC_Report_Taxes_By_Code extends WC_Admin_Report {
'query_type' => 'get_results',
'filter_range' => true,
'order_types' => array_merge( wc_get_order_types( 'sales-reports' ), array( 'shop_order_refund' ) ),
'order_status' => array( 'completed', 'processing', 'on-hold' ),
'parent_order_status' => array( 'completed', 'processing', 'on-hold' ), // Partial refunds inside refunded orders should be ignored
'order_status' => array( 'completed', 'processing' ),
'parent_order_status' => array( 'completed', 'processing' ), // Partial refunds inside refunded orders should be ignored
)
);

View File

@ -104,6 +104,7 @@ class WC_Report_Taxes_By_Date extends WC_Admin_Report {
),
);
// We exlude on-hold orders are they are still pending payment.
$tax_rows_orders = $this->get_order_report_data(
array(
'data' => $query_data,
@ -112,7 +113,7 @@ class WC_Report_Taxes_By_Date extends WC_Admin_Report {
'query_type' => 'get_results',
'filter_range' => true,
'order_types' => wc_get_order_types( 'sales-reports' ),
'order_status' => array( 'completed', 'processing', 'on-hold', 'refunded' ),
'order_status' => array( 'completed', 'processing', 'refunded' ),
)
);
@ -151,7 +152,7 @@ class WC_Report_Taxes_By_Date extends WC_Admin_Report {
'query_type' => 'get_results',
'filter_range' => true,
'order_types' => array( 'shop_order_refund' ),
'parent_order_status' => array( 'completed', 'processing', 'on-hold' ), // Partial refunds inside refunded orders should be ignored.
'parent_order_status' => array( 'completed', 'processing' ), // Partial refunds inside refunded orders should be ignored.
)
);