]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
Правки по количеству - расчет с раскрытием товаров
authorfomichev <vladimir.fomichev@erp-flowers.ru>
Fri, 30 May 2025 10:42:01 +0000 (13:42 +0300)
committerfomichev <vladimir.fomichev@erp-flowers.ru>
Fri, 30 May 2025 10:42:01 +0000 (13:42 +0300)
erp24/controllers/AutoPlannogrammaController.php
erp24/services/AutoPlannogrammaService.php
erp24/views/auto-plannogramma/1.php
erp24/views/auto-plannogramma/3.php
erp24/views/auto-plannogramma/5.php

index 0fabb8d1f4bc128e9c9593e852cb95809c809c94..ad9bbc52e698947607bd8049689a0b73ff780873 100644 (file)
@@ -244,6 +244,7 @@ class AutoPlannogrammaController extends BaseController
                         'base_total_store' => $row['base_total_store'] ?? null,
                         'new_total_store' => $row['new_total_store'] ?? null,
                         'total_sum' => $row['total_sum'] ?? null,
+                        'old_total_sum' => $row['old_total_sum'] ?? null,
                         'percent' => $row['percent'] ?? null,
                     ];
                 }
index 214f4feace9fed0d0746ae7958585618538a45dd..8a9dd24d7b094af28f8a76574a3d84261d77f81d 100644 (file)
@@ -217,6 +217,7 @@ class AutoPlannogrammaService
 
             $result[$sid][] = [
                 'category' => $r['category'],
+                'old_total_sum' => (float)$r['total_sum'],
                 'total_sum' => $newTotal,
                 'percent' => $percent,
                 'type' => $type,
@@ -428,6 +429,7 @@ class AutoPlannogrammaService
                 'store_id'                 => $sid,
                 'category'                 => $cat,
                 'subcategory'              => $subcat,
+                'old_total_sum'            => $subTotal,
                 'total_sum'                => $newSubTotal,
                 'percent'                  => $percent,
                 'type'                     => $type,
@@ -684,6 +686,7 @@ class AutoPlannogrammaService
                 'category'                 => $cat,
                 'subcategory'              => $subcat,
                 'species'                  => $spec ,
+                'old_total_sum'            => $specTotal,
                 'total_sum'                => $newSpecTotal,
                 'percent'                  => $percent,
                 'type'                     => $type,
index 2c89b15159aa1de575a876d277eb7010fd5ed49f..cab06204435c902a7e7b7611c3ae6c949f6543c6 100644 (file)
@@ -68,6 +68,7 @@
 
 <?= GridView::widget([
     'dataProvider' => $dataProvider,
+    'showPageSummary' => true,
     'columns' => [
         ['attribute' => 'store_id', 'label' => 'Магазин', 'value' => function ($data) {
             return CityStore::findOne($data['store_id'])->name ?? null;
@@ -75,8 +76,9 @@
         ['attribute' => 'category', 'label' => 'Категория'],
         ['attribute' => 'base_total_store', 'label' => 'Сумма продаж', 'format' => ['decimal', 2]],
         ['attribute' => 'new_total_store', 'label' => 'Сумма с Раскрытыми', 'format' => ['decimal', 2]],
-        ['attribute' => 'total_sum', 'label' => 'Сумма категории', 'format' => ['decimal', 2]],
-        ['attribute' => 'percent', 'label' => 'Доля', 'format' => ['percent', 2]],
+        ['attribute' => 'old_total_sum', 'label' => 'Сумма категории', 'format' => ['decimal', 2], 'pageSummary' => true,],
+        ['attribute' => 'total_sum', 'label' => 'Сумма категории с Раскрытыми', 'format' => ['decimal', 2], 'pageSummary' => true,],
+        ['attribute' => 'percent', 'label' => 'Доля', 'format' => ['percent', 2], 'pageSummary' => true,],
     ],
 ]); ?>
 
index 22586e78839b4b7480006f1ab57039dd45d7ec12..c3fa44f44d1ab76b8ce8aa46bafd73de6f89f390 100644 (file)
 
 <?= GridView::widget([
     'dataProvider' => $dataProvider,
+    'showPageSummary' => true,
     'columns' => [
         ['attribute' => 'store_id', 'label' => 'Магазин', 'value' => function ($data) {
             return CityStore::findOne($data['store_id'])->name ?? null;
         }],
         ['attribute' => 'category', 'label' => 'Категория'],
         ['attribute' => 'subcategory', 'label' => 'Подкатегория'],
-        ['attribute' => 'total_sum', 'label' => 'Сумма', 'format' => ['decimal', 2]],
+        ['attribute' => 'old_total_sum', 'label' => 'Сумма', 'format' => ['decimal', 2], 'pageSummary' => true,],
+        ['attribute' => 'total_sum', 'label' => 'Сумма с раскрытием', 'format' => ['decimal', 2], 'pageSummary' => true,],
         ['attribute' => 'percent', 'label' => 'Доля', 'format' => ['percent', 2]],
     ],
 ]); ?>
index fc707197c18fdf9664075529ac9583265ce8fdc4..6903b9b19cbda87804c4c3da2676d83fee1d75f1 100644 (file)
@@ -94,6 +94,7 @@
 
 <?= GridView::widget([
     'dataProvider' => $dataProvider,
+    'showPageSummary' => true,
     'columns' => [
         ['attribute' => 'store_id', 'label' => 'Магазин', 'value' => function ($data) {
             return CityStore::findOne($data['store_id'])->name ?? null;
         ['attribute' => 'category', 'label' => 'Категория'],
         ['attribute' => 'subcategory', 'label' => 'Подкатегория'],
         ['attribute' => 'species', 'label' => 'Тип'],
-        ['attribute' => 'total_sum', 'label' => 'Сумма', 'format' => ['decimal', 2]],
+        ['attribute' => 'old_total_sum', 'label' => 'Сумма', 'format' => ['decimal', 2], 'pageSummary' => true],
+        ['attribute' => 'total_sum', 'label' => 'Сумма с раскрытием', 'format' => ['decimal', 2], 'pageSummary' => true],
         ['attribute' => 'percent', 'label' => 'Доля', 'format' => ['percent', 2]],
     ],
 ]); ?>