diff --git a/zc_plugins/SalesReport/v4.0.0/admin/includes/classes/sales_report2.php b/zc_plugins/SalesReport/v4.0.0/admin/includes/classes/sales_report2.php index 1926ecc..6f475a6 100644 --- a/zc_plugins/SalesReport/v4.0.0/admin/includes/classes/sales_report2.php +++ b/zc_plugins/SalesReport/v4.0.0/admin/includes/classes/sales_report2.php @@ -77,7 +77,19 @@ class sales_report2 extends base $timeframe_id, $timeframe_sort; - function __construct($parms) + // ----- + // Static methods used by the report to display the up- and down-arrow icons. + // + public static function getUpArrowIcon() + { + return ''; + } + public static function getDownArrowIcon() + { + return ''; + } + + public function __construct($parms) { global $db; diff --git a/zc_plugins/SalesReport/v4.0.0/admin/stats_sales_report2.php b/zc_plugins/SalesReport/v4.0.0/admin/stats_sales_report2.php index 183fe70..99ff1cc 100644 --- a/zc_plugins/SalesReport/v4.0.0/admin/stats_sales_report2.php +++ b/zc_plugins/SalesReport/v4.0.0/admin/stats_sales_report2.php @@ -25,7 +25,6 @@ //_TODO ability filter results by manufacturer (not just sort!) //_TODO Matrix -> checkboxes for "per manufacturer" / "per product" / "per customer" stats - require 'includes/application_top.php'; require DIR_WS_CLASSES . 'currencies.php'; @@ -345,10 +344,10 @@ // $new_window = isset($_GET['new_window']); $_SESSION['sales_report_new_window'] = $new_window; - + // start the page parsing timer $parse_start = get_microtime(); - + // if any required field is empty, cancel the report and alert the user // JavaScript checks should usually catch these, this is "just in case" if (!$start_date || !$end_date || !$date_target || !$detail_level || !$output_format) { @@ -388,7 +387,7 @@ // we have to pass the sorting values of the form since // the class instantiation does not require them $sr->output_csv($csv_header); - exit; + zen_exit(); } } // END if ($output_format != 'none') } @@ -409,17 +408,25 @@ '; } ?> - + - + -
' . PAGE_HEADING . '
'; ?>
+ + +
+
' . $start_date . PRINT_DATE_TO . $end_date . '
'; ?>
+ + +
+
@@ -441,9 +448,9 @@
+ - +
@@ -452,7 +459,7 @@ @@ -461,7 +468,7 @@ @@ -488,11 +495,14 @@ var StartDate = new ctlSpiffyCalendarBox("StartDate", "search", "start_date", "btnDate1", "", scBTNMODE_CALBTN); var EndDate = new ctlSpiffyCalendarBox("EndDate", "search", "end_date", "btnDate2", "", scBTNMODE_CALBTN); - +
- + @@ -502,36 +512,62 @@ @@ -623,14 +692,22 @@
+ +
- + - + - + - + - + - + - +
  +   + +
+ +
+ +
+ +
+ +
+ +
+ +
- + - + - +
  +   + +

+ +
+ +

+ +
+ +
@@ -540,48 +576,81 @@ - + - + - + - + - +
' . - zen_draw_radio_field('date_target', 'status', ($date_target != 'purchased')) . ' ' . RADIO_DATE_TARGET_STATUS; + echo zen_draw_radio_field('date_target', 'purchased', ($date_target === 'purchased')) . ' ' . RADIO_DATE_TARGET_PURCHASED . '
' . + zen_draw_radio_field('date_target', 'status', ($date_target !== 'purchased')) . ' ' . RADIO_DATE_TARGET_STATUS; ?>
+ +
+ +
+ +
+ +
+ +
- + - + + '0', 'text' => TEXT_EMPTY_SELECT]]; +?> - + - + - +

' . zen_draw_pull_down_menu('payment_method', $payments_array, $payment_method, 'id="payment_method"'); ?>
+ +
+ +

' . zen_draw_pull_down_menu('payment_method_omit', $payments_array, $payment_method_omit, 'id="payment_method_omit"'); ?>
+ +
+ +

' . zen_draw_pull_down_menu('current_status', array_merge([['id' => '0', 'text' => TEXT_EMPTY_SELECT]], $status_array), $current_status, 'id="current_status"'); ?>
+ +
+ +

' . zen_draw_pull_down_menu('excluded_status', array_merge([['id' => '0', 'text' => TEXT_EMPTY_SELECT]], $status_array), $excluded_status, 'id="excluded-status"'); ?>
+ +
+ +

' . zen_draw_pull_down_menu('manufacturer', $manufacturer_array, $manufacturer, 'id="manufacturer"'); ?>
+ +
+ +
' . - zen_draw_radio_field('timeframe', 'week', $timeframe == 'week') . SEARCH_TIMEFRAME_WEEK . '
' . - zen_draw_radio_field('timeframe', 'month', $timeframe == 'month') . SEARCH_TIMEFRAME_MONTH . '
' . - zen_draw_radio_field('timeframe', 'year', $timeframe == 'year') . SEARCH_TIMEFRAME_YEAR; ?> + zen_draw_radio_field('timeframe', 'day', $timeframe === 'day') . SEARCH_TIMEFRAME_DAY . '
' . + zen_draw_radio_field('timeframe', 'week', $timeframe === 'week') . SEARCH_TIMEFRAME_WEEK . '
' . + zen_draw_radio_field('timeframe', 'month', $timeframe === 'month') . SEARCH_TIMEFRAME_MONTH . '
' . + zen_draw_radio_field('timeframe', 'year', $timeframe === 'year') . SEARCH_TIMEFRAME_YEAR; ?>
- +

+ +
+ +
- - + + - + grand_total['goods_tax'] > 0); - // DEBUG - //$display_tax = true; if ($output_format === 'display') { ?> '; ?> - - - + + - - + + - - - - - + + + + + - - + + - - + + - - - - - + + + + + detail_level === 'order' && $order_total_validation) { + if ($sr->detail_level === 'order' && $order_total_validation === true) { ?> - + @@ -855,29 +942,29 @@ - + - + - - + + - - + + - + - + - + detail_level === 'order' && $order_total_validation) { + if ($sr->detail_level === 'order' && $order_total_validation === true) { ?> - + @@ -897,7 +984,7 @@ ?> - + - - - + + - - + if ($show_country_and_state === true) { +?> + + - - + + - - + if ($display_tax === true) { +?> + + - - - - - + + + + + - + @@ -966,39 +1080,79 @@ } ?> - - + + - - + if ($show_country_and_state === true) { +?> + + - - - + + + - - + if ($display_tax === true) { +?> + + - - - - - - - - + + + + + + + + - + @@ -1026,10 +1180,10 @@ // because the displayed data is so different from timeframe // totals, otherwise column layout is a nightmare :) $colspan = 13; - if ($display_tax) { + if ($display_tax === true) { $colspan += 2; } - if ($order_total_validation) { + if ($order_total_validation === true) { $colspan += 1; } ?> @@ -1037,75 +1191,123 @@
+ + + +
@@ -638,9 +715,9 @@ zen_draw_pull_down_menu('li_sort_a', $product_sorts_array, $li_sort_a_product, 'id="li-sort-a-product"'); ?>
' . - zen_draw_radio_field('li_sort_order_a', 'desc', $li_sort_order_a !== 'asc') . sales_report2::getDownArrowIcon() . RADIO_LI_SORT_DESC; + zen_draw_radio_field('li_sort_order_a', 'desc', $li_sort_order_a !== 'asc') . sales_report2::getDownArrowIcon() . RADIO_LI_SORT_DESC; ?>
@@ -671,14 +748,24 @@
- - + - - +


+
+ +
+ +
+ +
-
+
+ + + +
+
@@ -686,7 +773,7 @@
    
> - + > + + +
  
format($timeframe['total']['goods']); ?>format($timeframe['total']['goods']); ?> format($timeframe['total']['goods_tax']); ?>format($timeframe['total']['order_recorded_tax']); ?>format($timeframe['total']['goods_tax']); ?>format($timeframe['total']['order_recorded_tax']); ?> format($timeframe['total']['shipping']); ?>format($timeframe['total']['discount']); ?>format($timeframe['total']['shipping']); ?>format($timeframe['total']['discount']); ?> format($timeframe['total']['gc_sold']); ?>format($timeframe['total']['gc_sold']); ?> format($timeframe['total']['gc_used']); ?>format($timeframe['total']['gc_used']); ?> format($timeframe['total']['grand']); ?>format($timeframe['total']['grand']); ?>   
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + 1 ? TEXT_DIFF . sizeof($o_data['diff_products']) : ($o_data['num_products'] > 1 ? TEXT_SAME : TEXT_SAME_ONE) ); ?>format($o_data['goods']); ?> + + + 1 ? TEXT_DIFF . count($o_data['diff_products']) : ($o_data['num_products'] > 1 ? TEXT_SAME : TEXT_SAME_ONE)); ?> + + format($o_data['goods']); ?> + format($o_data['goods_tax']); ?>format($o_data['order_recorded_tax']); ?> + format($o_data['goods_tax']); ?> + + format($o_data['order_recorded_tax']); ?> + format($o_data['shipping']); ?>format($o_data['discount']); ?>format($o_data['gc_sold']); ?>format($o_data['gc_used']); ?>format($o_data['grand']); ?> + format($o_data['shipping']); ?> + + format($o_data['discount']); ?> + + + + format($o_data['gc_sold']); ?> + + + + format($o_data['gc_used']); ?> + + + + format($o_data['grand']); ?> + + + - - - + + + - + - - - - + + + + - + - + - + - + $p_data) { ?> - - - + + + - + - - - - + + + + - + - + - + - + $p_data) { @@ -1115,90 +1317,148 @@ detail_level === 'matrix' && isset($timeframe['orders']) && isset($timeframe['products'])) { // display the data matrix $colspan = 13; - if ($display_tax) { + if ($display_tax === true) { $colspan += 2; } - if ($order_total_validation) { + if ($order_total_validation === true) { $colspan += 1; } ?> - + - +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + format($p_data['base_price']); ?>format($p_data['final_price']); ?> + + + format($p_data['base_price']); ?> + + format($p_data['final_price']); ?> + + + format($p_data['tax']); ?> + format($p_data['tax']); ?> + format($p_data['onetime_charges']); ?> + format($p_data['onetime_charges']); ?> + format($p_data['total']); ?> + format($p_data['total']); ?> + format($p_data['grand']); ?> + format($p_data['grand']); ?> +
+ +
- + - - - + + + - - - + + +
+ +
format($timeframe['orders'][ $timeframe['matrix']['biggest_per_revenue'] ]['goods']) . ')'; ?> + + + + + format($timeframe['orders'][ $timeframe['matrix']['biggest_per_revenue'] ]['goods']) . ')'; ?> +
format($timeframe['orders'][ $timeframe['matrix']['smallest_per_revenue'] ]['goods']) . ')'; ?> + + + + + format($timeframe['orders'][ $timeframe['matrix']['smallest_per_revenue'] ]['goods']) . ')'; ?> +
- + - - - + + + - - - + + +
+ +
+ + + + + +
+ + + + + +
- + - - + + - - + + - - + + - - + +
+ +
format($timeframe['matrix']['avg_order_value']); ?> + format($timeframe['matrix']['avg_order_value']); ?> + + +
+ + + +
+ + + +
+ + + +
+ +
- + $payment) { ?> - - - + + +
+ +
+ + + + + +
- + $cc) { ?> - - + +
+ +
+ + + +
- + $shipping) { ?> - - - + + +
+ +
+ + + + + +
- + $currency) { ?> - - + + - +
+ +
+ + + +
+ +
- - - - - + + + + + $p_data) { ?> - - - - - + + + + + detail_level !== 'timeframe') { ?> - - - - + + + + - - + if ($display_tax === true) { +?> + + - - - - - + + + + + detail_level === 'order' && $order_total_validation) { + if ($sr->detail_level === 'order' && $order_total_validation === true) { ?> - + @@ -1333,30 +1657,58 @@ ?> - - - - + + + + - - + if ($display_tax === true) { +?> + + - - - - - - - - + + + + + + + + detail_level === 'order' && $order_total_validation) { + if ($sr->detail_level === 'order' && $order_total_validation === true) { ?> - + @@ -1372,7 +1724,9 @@ ?> - + - + - + -
+ + + + + + + + + +
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +   
timeframe) . TABLE_FOOTER_TIMEFRAMES; ?>grand_total['num_orders']; ?>grand_total['num_products']; ?>format($sr->grand_total['goods']); ?> + timeframe) . TABLE_FOOTER_TIMEFRAMES; ?> + + grand_total['num_orders']; ?> + + grand_total['num_products']; ?> + + format($sr->grand_total['goods']); ?> + format($sr->grand_total['goods_tax']); ?>format($sr->grand_total['order_recorded_tax']); ?> + format($sr->grand_total['goods_tax']); ?> + + format($sr->grand_total['order_recorded_tax']); ?> + format($sr->grand_total['shipping']); ?>format($sr->grand_total['discount']); ?>grand_total['discount_qty']; ?>format($sr->grand_total['gc_sold']); ?>grand_total['gc_sold_qty']; ?>format($sr->grand_total['gc_used']); ?>grand_total['gc_used_qty']; ?>format($sr->grand_total['grand']); ?> + format($sr->grand_total['shipping']); ?> + + format($sr->grand_total['discount']); ?> + + grand_total['discount_qty']; ?> + + format($sr->grand_total['gc_sold']); ?> + + grand_total['gc_sold_qty']; ?> + + format($sr->grand_total['gc_used']); ?> + + grand_total['gc_used_qty']; ?> + + format($sr->grand_total['grand']); ?> +   
+ +
' . TEXT_PRINT_FORMAT . ''; ?> + + + +
+ +
+
'; ?>