From 79d54aff8e219af8906a9971643b06a7e4968b0c Mon Sep 17 00:00:00 2001 From: lat9 Date: Tue, 25 Apr 2023 01:00:57 -0400 Subject: [PATCH] #40: Add "Last 12 Months" preset --- .../languages/english/lang.stats_sales_report2.php | 11 ++++++----- .../SalesReport/v4.0.0/admin/stats_sales_report2.php | 9 +++++++++ 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/zc_plugins/SalesReport/v4.0.0/admin/includes/languages/english/lang.stats_sales_report2.php b/zc_plugins/SalesReport/v4.0.0/admin/includes/languages/english/lang.stats_sales_report2.php index 5103373..23e249f 100644 --- a/zc_plugins/SalesReport/v4.0.0/admin/includes/languages/english/lang.stats_sales_report2.php +++ b/zc_plugins/SalesReport/v4.0.0/admin/includes/languages/english/lang.stats_sales_report2.php @@ -101,7 +101,7 @@ // certificates, it will have a total of 0. In this // situation, the order will not be displayed in the results. // - // EXAMPLE: 'EXCLUDE_PRODUCTS' => serialize(array(25, 14, 43)) ); + // EXAMPLE: 'EXCLUDE_PRODUCTS' => serialize([25, 14, 43]) ); // 'EXCLUDE_PRODUCTS' => serialize([]), @@ -114,10 +114,10 @@ 'HEADING_TITLE_SORT' => '2. Sort & Specify Results', 'HEADING_TITLE_PROCESS' => '3. Generate Report', 'SEARCH_TIMEFRAME' => 'Timeframe', - 'SEARCH_TIMEFRAME_DAY' => 'Daily', - 'SEARCH_TIMEFRAME_WEEK' => 'Weekly', - 'SEARCH_TIMEFRAME_MONTH' => 'Monthly', - 'SEARCH_TIMEFRAME_YEAR' => 'Annually', + 'SEARCH_TIMEFRAME_DAY' => ' Daily', + 'SEARCH_TIMEFRAME_WEEK' => ' Weekly', + 'SEARCH_TIMEFRAME_MONTH' => ' Monthly', + 'SEARCH_TIMEFRAME_YEAR' => ' Annually', 'SEARCH_TIMEFRAME_SORT' => 'Timeframe Sort', 'SEARCH_DATE_PRESET' => 'Preset Date Range', 'SEARCH_DATE_CUSTOM' => 'Custom Date Range', @@ -126,6 +126,7 @@ 'SEARCH_DATE_LAST_MONTH' => ' Last Month (%s)', 'SEARCH_DATE_THIS_MONTH' => ' This Month (%s)', 'SEARCH_DATE_LAST_YEAR' => ' Last Year (%s)', + 'SEARCH_DATE_LAST_12_MONTHS' => ' Last 12 Months', 'SEARCH_DATE_YTD' => ' YTD (%s)', 'SEARCH_START_DATE' => 'Start Date', 'SEARCH_END_DATE' => 'End Date (inclusive)', 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 0401ecf..2573391 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 @@ -201,6 +201,10 @@ $start_date = date(DATE_FORMAT, strtotime('last year January 1st', $today_timestamp)); $end_date = date(DATE_FORMAT, strtotime('last year December 31st', $today_timestamp)); break; + case 'last_12_months': + $start_date = date(DATE_FORMAT, strtotime('1 year ago', $today_timestamp)); + $end_date = date(DATE_FORMAT, $today_timestamp); + break; default: $_GET['date_preset'] = 'YTD'; $start_date = date(DATE_FORMAT, strtotime('first day of January this year', $today_timestamp)); @@ -542,6 +546,11 @@ + + + + +