From 020c9dd7f00d8d4bbcc32068b85bb91bb017c053 Mon Sep 17 00:00:00 2001 From: Alexander Smirnov Date: Fri, 31 Jan 2025 14:21:06 +0300 Subject: [PATCH] =?utf8?q?[ERP-283]=20=D0=BF=D1=80=D0=B5=D0=B4=D0=BF=D1=80?= =?utf8?q?=D0=B5=D0=B4=D1=8B=D0=B4=D1=83=D1=89=D0=B8=D0=B9=20=D0=BC=D0=B5?= =?utf8?q?=D1=81=D1=8F=D1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- erp24/controllers/SalesWriteOffsPlanController.php | 6 +++--- erp24/views/sales-write-offs-plan/index.php | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/erp24/controllers/SalesWriteOffsPlanController.php b/erp24/controllers/SalesWriteOffsPlanController.php index fc69a2e8..daa96794 100644 --- a/erp24/controllers/SalesWriteOffsPlanController.php +++ b/erp24/controllers/SalesWriteOffsPlanController.php @@ -31,8 +31,8 @@ class SalesWriteOffsPlanController extends Controller $model->load(Yii::$app->request->get()); - $prevMonthStart = date("Y-m-01", strtotime("-1 month", strtotime($model->year . "-" . $model->month . "-01"))); - $prevMonthEnd = date("Y-m-t", strtotime("-1 month", strtotime($model->year . "-" . $model->month . "-01"))); + $prevPrevMonthStart = date("Y-m-01", strtotime("-2 month", strtotime($model->year . "-" . $model->month . "-01"))); + $prevPrevMonthEnd = date("Y-m-t", strtotime("-2 month", strtotime($model->year . "-" . $model->month . "-01"))); $years = []; for ($i = 3; $i >= 0; $i--) { @@ -46,7 +46,7 @@ class SalesWriteOffsPlanController extends Controller $sales = Sales::find()->select([ "sum(CASE WHEN operation='Продажа' THEN summ ELSE (CASE WHEN operation='Возврат' THEN -summ ELSE 0 END) END) as total", 'store_id']) - ->where(['between', 'date', $prevMonthStart, $prevMonthEnd]) + ->where(['between', 'date', $prevPrevMonthStart, $prevPrevMonthEnd]) ->groupBy(['store_id']) ->indexBy('store_id') ->asArray()->all(); diff --git a/erp24/views/sales-write-offs-plan/index.php b/erp24/views/sales-write-offs-plan/index.php index c15a9ebb..0df15a5d 100644 --- a/erp24/views/sales-write-offs-plan/index.php +++ b/erp24/views/sales-write-offs-plan/index.php @@ -141,7 +141,8 @@ function colorScheme2($p) { МагазиныTotalОффлайн торговляОнлайн торговля Оффлайн + онлайн торговляМагазинИнтернет-магазинМаркетплейсы - ПродажиК прошлому месяцуСписанияК ПлануЦельК прошлому месяцуЦельК прошлому месяцуЦельК прошлому месяцу + ПродажиК позапрошлому месяцуСписанияК ПлануЦельК позапрошлому месяцу + ЦельК позапрошлому месяцуЦельК позапрошлому месяцу -- 2.39.5