]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
Правки и сравнения расчетов
authorfomichev <vladimir.fomichev@erp-flowers.ru>
Wed, 25 Jun 2025 11:04:21 +0000 (14:04 +0300)
committerfomichev <vladimir.fomichev@erp-flowers.ru>
Wed, 25 Jun 2025 11:04:21 +0000 (14:04 +0300)
erp24/services/AutoPlannogrammaService.php
erp24/views/category-plan/index.php

index db390ec94fe71f9715ca2e823450edf19f566aad..4977154e8d09a3f09c2b18d1634d96e03baa51ca 100644 (file)
@@ -83,7 +83,7 @@ class AutoPlannogrammaService
 
         // Подготовка весов по месяцам
         $date = new \DateTime($dateFrom);
-        $month3 = $date->modify('-3 month')->format('Y-m');// ближний (вес 3)
+        $month3 = $date->modify('-2 month')->format('Y-m');// ближний (вес 3)
         $month2 = $date->modify('-1 month')->format('Y-m');
         $month1 = $date->modify('-1 month')->format('Y-m'); // дальний (вес 1)
 
index 59f6c393397e7785142923b64d36318d92752a74..aff8ac2fc37a303bbcda575aa7772033e33b8e7d 100644 (file)
@@ -215,20 +215,20 @@ input[readonly] {
                             <th data-type><?= $type ?></th>
                             <?php
                             $data = $categoryPlan[$type]['offline'];
-                            $p1 = $offline_sale <= 0 ? 0 : round( $data / $offline_sale, 2) * 100;
+                            $p1 = $offline_sale <= 0 ? 0 : round( $data / $offline_sale, 4) * 100;
                             ?>
                             <td data-p1-<?= $type ?> data-offline="<?= $offline_sale ?>" data-offline-type="<?= $type ?>"><?= Html::textInput('p1', number_format($p1, 2, '.', ''), ['type' => 'number', 'style' => 'max-width: 80px;', 'readonly' => !$isEditable, 'onchange' => 'editProcent(this);']) ?>%</td>
                             <td data-offline-type="<?= $type ?>"><?= Html::textInput('offline', number_format($categoryPlan[$type]['offline'], 0, '.', ''), ['type' => 'number', 'readonly' => true, ]) ?></td>
                             <?php
                             $data2 = $categoryPlan[$type]['internet_shop'];
-                            $p2 = $online_sale <= 0 ? 0 : round( $data2 / $online_sale, 2) * 100;
+                            $p2 = $online_sale <= 0 ? 0 : round( $data2 / $online_sale, 4) * 100;
                             ?>
                             <td data-p2-<?= $type ?> data-online="<?= $online_sale ?>" data-online-type="<?= $type ?>"><?= Html::textInput('p2', number_format($p2, 2, '.', ''), ['type' => 'number', 'style' => 'max-width: 80px;', 'readonly' => !$isEditable, 'onchange' => 'editProcent(this);']) ?>%</td>
                             <td data-online-type="<?= $type ?>"><?= Html::textInput('internet_shop', number_format($categoryPlan[$type]['internet_shop'], 0, '.', ''), ['type' => 'number', 'readonly' => true, ]) ?></td>
                             <?php //<td></td><td></td> ?>
                             <?php
                             $data4 = $categoryPlan[$type]['write_offs'];
-                            $p3 = $write_offs <= 0 ? 0 : round( $data4 / $write_offs, 2) * 100;
+                            $p3 = $write_offs <= 0 ? 0 : round( $data4 / $write_offs, 4) * 100;
                             ?>
                             <td data-p3-<?= $type ?> data-writeoffs="<?= $write_offs ?>" data-writeoffs-type="<?= $type ?>"><?= Html::textInput('p3', number_format($p3, 2, '.', ''), ['type' => 'number', 'style' => 'max-width: 80px;', 'readonly' => !$isEditable, 'onchange' => 'editProcent(this);']) ?>%</td>
                             <td data-writeoffs-type="<?= $type ?>"><?= Html::textInput('write_offs', number_format($categoryPlan[$type]['write_offs'], 0, '.', ''), ['type' => 'number',  'readonly' => true, ]) ?></td>