]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
[ERP-140] Подсчёт всякой всячины
authorAlexander Smirnov <fredeom@mail.ru>
Wed, 14 Aug 2024 13:50:06 +0000 (16:50 +0300)
committerAlexander Smirnov <fredeom@mail.ru>
Wed, 14 Aug 2024 13:50:06 +0000 (16:50 +0300)
erp24/actions/motivation/TestFactAction.php
erp24/scripts/tasks/task_32_motivation_fact.php
erp24/services/MotivationService.php

index b604f9de3502fad5ef8bec58afe4538b53b0297d..d4a07310b0b1656330dea86802287f5f66d4b56f 100644 (file)
@@ -63,6 +63,14 @@ class TestFactAction extends Action
             MotivationService::calculateMonthAccauntingAndTax($model->year, $model->month);
 
             MotivationService::calculateMonthLegalServices($model->year, $model->month);
+
+            MotivationService::calculateMonthPersonalAdministrationLaborProtection($model->year, $model->month);
+
+            MotivationService::calculateMonthAdministrationOfItInfrastructureConnectionsToDatabasesSoftwareMailInternet($model->year, $model->month);
+
+            MotivationService::calculateMonthSoftwareLicenseErpSystem($model->year, $model->month);
+
+            MotivationService::calculateMonthCeoAndSaleOfWebsiteGoods($model->year, $model->month);
         }
 
         return $this->controller->render('test-fact', compact('model', 'years', 'months'));
index 2aa53064a0851203ca99bd5eee695e6ffc01677e..fb35da4d6032efbc098eeaf046ca17b02803d8fd 100644 (file)
@@ -67,6 +67,13 @@ try {
 
         MotivationService::calculateMonthLegalServices($year, $month);
 
+        MotivationService::calculateMonthPersonalAdministrationLaborProtection($year, $month);
+
+        MotivationService::calculateMonthAdministrationOfItInfrastructureConnectionsToDatabasesSoftwareMailInternet($year, $month);
+
+        MotivationService::calculateMonthSoftwareLicenseErpSystem($year, $month);
+
+        MotivationService::calculateMonthCeoAndSaleOfWebsiteGoods($year, $month);
         //////////////////////////////////////////////
 
 
index 27528d2406dcaf9766572b677e7e135c0311ba62..f71f70e2c6ae88159e634ddba06bc6ce3342a5e8 100644 (file)
@@ -1142,4 +1142,44 @@ class MotivationService
                 6, 28, "float", $plan);
         }
     }
+
+    public static function calculateMonthPersonalAdministrationLaborProtection($year, $month) {
+
+    }
+
+    public static function calculateMonthAdministrationOfItInfrastructureConnectionsToDatabasesSoftwareMailInternet($year, $month) {
+        $motivations = Motivation::find()
+            ->where(['year' => $year, 'month' => $month])
+            ->all();
+
+        foreach ($motivations as $motivation) {
+            $plan = self::getMotivationValue($motivation->id, 7, 31);
+            self::saveOrUpdateMotivationValue($motivation->id,
+                6, 31, "float", $plan);
+        }
+    }
+
+    public static function calculateMonthSoftwareLicenseErpSystem($year, $month) {
+        $motivations = Motivation::find()
+            ->where(['year' => $year, 'month' => $month])
+            ->all();
+
+        foreach ($motivations as $motivation) {
+            $plan = self::getMotivationValue($motivation->id, 7, 32);
+            self::saveOrUpdateMotivationValue($motivation->id,
+                6, 32, "float", $plan);
+        }
+    }
+
+    public static function calculateMonthCeoAndSaleOfWebsiteGoods($year, $month) {
+        $motivations = Motivation::find()
+            ->where(['year' => $year, 'month' => $month])
+            ->all();
+
+        foreach ($motivations as $motivation) {
+            $correction = self::getMotivationValue($motivation->id, 8, 33);
+            self::saveOrUpdateMotivationValue($motivation->id,
+                6, 33, "float", $correction);
+        }
+    }
 }