From 505274d337780c78ec952b16ff6eb53deee2129c Mon Sep 17 00:00:00 2001 From: fomichev Date: Wed, 16 Apr 2025 09:45:08 +0300 Subject: [PATCH] =?utf8?q?=D0=92=D1=8B=D0=B2=D0=BE=D0=B4=20=D1=80=D0=B0?= =?utf8?q?=D1=81=D1=87=D0=B5=D1=82=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- erp24/controllers/BouquetController.php | 10 ++--- erp24/services/StorePlanService.php | 1 - erp24/views/bouquet/month-goal.php | 60 +++++++++++++++++++++++-- 3 files changed, 62 insertions(+), 9 deletions(-) diff --git a/erp24/controllers/BouquetController.php b/erp24/controllers/BouquetController.php index e3e0f85a..6adf096b 100644 --- a/erp24/controllers/BouquetController.php +++ b/erp24/controllers/BouquetController.php @@ -253,22 +253,22 @@ class BouquetController extends Controller return $data; } - public function actionMonthGoal($month, $year) + public function actionMonthGoal() { + $request = Yii::$app->request; + + $month = $request->post('month') ? (int)$request->post('month') : 5; + $year = $request->post('year') ? (int)$request->post('year') : 2025; $result = StorePlanService::getBouquetSpiecesMonthGoal($month, $year); - $month = $month ?? 5; - $year = $year ?? 2025; $stores = CityStore::find() ->select(['id', 'name']) ->where(['visible' => CityStore::IS_VISIBLE]) ->asArray() ->all(); - $storesMap = ArrayHelper::map($stores, 'id', 'name'); - return $this->render('month-goal', [ 'result' => $result, 'storesMap' => $storesMap, diff --git a/erp24/services/StorePlanService.php b/erp24/services/StorePlanService.php index 98bab0ec..4137efd3 100755 --- a/erp24/services/StorePlanService.php +++ b/erp24/services/StorePlanService.php @@ -863,7 +863,6 @@ class StorePlanService $finalResult = []; foreach ($resultArr as $typeSalesId => $speciesData) { foreach ($speciesData as $species => $salesDetails) { - // Здесь $salesDetails — это массив вида [storeSalesType1 => cost1, storeSalesType2 => cost2, …] $finalResult[$typeSalesId][$species] = round(array_sum($salesDetails), 2); } } diff --git a/erp24/views/bouquet/month-goal.php b/erp24/views/bouquet/month-goal.php index a6ff09ca..29a07842 100644 --- a/erp24/views/bouquet/month-goal.php +++ b/erp24/views/bouquet/month-goal.php @@ -1,4 +1,7 @@ store_name] @var $month integer @@ -7,6 +10,20 @@ ?>

Цели на месяц: /

+ + + + 1, 'max' => 12]) ?> + + + 2000, 'max' => 2100]) ?> + + 'btn btn-primary']) ?> + + +
+ +

Итоговые суммы по магазинам и видам продукции

@@ -20,13 +37,13 @@ $speciesData): ?> $sum): ?> - - + + @@ -37,4 +54,41 @@ +
+ + +

Подробный расчёт по магазинам

+ + + + + + + + + + + + $speciesData): ?> + + $saleTypes): ?> + $amount): ?> + + + + + + + + + + + + + + +
МагазинВид продукцииТип продажСумма
Нет данных для отображения.
\ No newline at end of file -- 2.39.5