From: fomichev Date: Wed, 16 Apr 2025 06:45:08 +0000 (+0300) Subject: Вывод расчетов X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=505274d337780c78ec952b16ff6eb53deee2129c;p=erp24_rep%2Fyii-erp24%2F.git Вывод расчетов --- 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