Updated reports

This commit is contained in:
Mike Jolley 2014-07-25 15:46:19 +01:00
parent 710a570525
commit 029bbbec39
4 changed files with 12 additions and 5 deletions

View File

@ -447,7 +447,7 @@ class WC_Product {
* @return string
*/
public function get_title() {
return apply_filters( 'woocommerce_product_title', $this->post->post_title, $this );
return apply_filters( 'woocommerce_product_title', $this->post ? $this->post->post_title : '', $this );
}
/**

View File

@ -225,7 +225,8 @@ class WC_Report_Sales_By_Product extends WC_Admin_Report {
'group_by' => 'product_id',
'limit' => 12,
'query_type' => 'get_results',
'filter_range' => true
'filter_range' => true,
'order_types' => wc_get_order_types( 'order-count' ),
) );
if ( $top_sellers ) {

View File

@ -89,6 +89,11 @@ class WC_Report_Taxes_By_Code extends WC_Admin_Report {
'order_item_type' => 'tax',
'function' => '',
'name' => 'rate_id'
),
'order_id' => array(
'type' => 'order_item',
'function' => '',
'name' => 'order_id'
)
),
'where' => array(
@ -141,8 +146,9 @@ class WC_Report_Taxes_By_Code extends WC_Admin_Report {
'shipping_tax_amount' => 0
);
}
$grouped_tax_tows[ $tax_row->rate_id ]->total_orders ++;
if ( 'shop_order' === get_post_type( $tax_row->order_id ) ) {
$grouped_tax_tows[ $tax_row->rate_id ]->total_orders ++;
}
$grouped_tax_tows[ $tax_row->rate_id ]->tax_amount += wc_round_tax_total( $tax_row->tax_amount );
$grouped_tax_tows[ $tax_row->rate_id ]->shipping_tax_amount += wc_round_tax_total( $tax_row->shipping_tax_amount );
}

View File

@ -107,7 +107,7 @@ class WC_Report_Taxes_By_Date extends WC_Admin_Report {
<thead>
<tr>
<th><?php _e( 'Period', 'woocommerce' ); ?></th>
<th class="total_row"><?php _e( 'Number of orders', 'woocommerce' ); ?></th>
<th class="total_row"><?php _e( 'Orders/refunds', 'woocommerce' ); ?></th>
<th class="total_row"><?php _e( 'Total Sales', 'woocommerce' ); ?> <a class="tips" data-tip="<?php _e("This is the sum of the 'Order Total' field within your orders.", 'woocommerce'); ?>" href="#">[?]</a></th>
<th class="total_row"><?php _e( 'Total Shipping', 'woocommerce' ); ?> <a class="tips" data-tip="<?php _e("This is the sum of the 'Shipping Total' field within your orders.", 'woocommerce'); ?>" href="#">[?]</a></th>
<th class="total_row"><?php _e( 'Total Tax', 'woocommerce' ); ?> <a class="tips" data-tip="<?php esc_attr_e( 'This is the total tax for the rate (shipping tax + product tax).', 'woocommerce' ); ?>" href="#">[?]</a></th>