]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
[ERP-140] Данные из 1с берутся из month мотивации
authorAlexander Smirnov <fredeom@mail.ru>
Thu, 29 Aug 2024 12:54:03 +0000 (15:54 +0300)
committerAlexander Smirnov <fredeom@mail.ru>
Thu, 29 Aug 2024 12:54:03 +0000 (15:54 +0300)
erp24/actions/motivation/TestFactAction.php
erp24/scripts/tasks/task_32_motivation_fact.php
erp24/services/MotivationService.php

index 4b62b8793717289ac8c9df4d1505792e55f35757..4a784f209fa6780bf4fca7d2179daa5cde109ce5 100644 (file)
@@ -72,7 +72,7 @@ class TestFactAction extends Action
 
             MotivationService::calculateMonthCeoAndSaleOfWebsiteGoods($model->year, $model->month);
 
-//            MotivationService::initMonth1cFields($model->year, $model->month);
+            MotivationService::initMonth1cFields($model->year, $model->month);
         }
 
         return $this->controller->render('test-fact', compact('model', 'years', 'months'));
index b3ed76aa7f8ab5969fec090419c5a6b51d02b92f..3d641799cfb6f6c66e4e7373753d616c9ca894e6 100644 (file)
@@ -75,7 +75,7 @@ try {
 
         MotivationService::calculateMonthCeoAndSaleOfWebsiteGoods($year, $month);
 
-//        MotivationService::initMonth1cFields($year, $month);
+        MotivationService::initMonth1cFields($year, $month);
         //////////////////////////////////////////////
 
 
index f8d543daea50e92f632e01a6cbdeafdd9fce558a..c31df16e3e945fd516dd412d0d64c98e1eb3c0f0 100644 (file)
@@ -1488,11 +1488,28 @@ class MotivationService
             ->where(['year' => $year, 'month' => $month])
             ->all();
 
-        $valueIdIndices = [12, 13, 14, 15, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 30];
+        $valueIdIndices = [
+            self::CODE_RENT, // 12
+            self::CODE_PUBLIC_SERVICES, // 13
+            self::CODE_SECURITY, // 14
+            self::CODE_CLEANING_SERVICES_FOR_PREMISES_AND_TERRITORY, // 15
+            self::CODE_DELIVERY_TO_CLIENT_TAXI, // 17
+            self::CODE_MARKETPLACE_SERVICES, // 18
+            self::CODE_REFRIGERATION_EQUIPMENT_REPAIR_MAINTANANCE, // 19
+            self::CODE_COSTS_FOR_MAINTENANCE_AND_REPAIR_OF_OFFICE_EQUIPMENT_INCLUDING_CONSUMABLES, // 20
+            self::CODE_EXPENSES_FOR_MAINENANCE_AND_REPAIR_OF_OTHER_FIXED_ASSETS, // 21
+            self::CODE_MAINTENANCE_OF_CASH_REGISTERS, // 22
+            self::CODE_INTERNET, // 23
+            self::CODE_HOUSEHOLD_GOODS, // 24
+            self::CODE_STATIONARY, // 25
+            self::CODE_DRINKING_WATER, // 26
+            self::CODE_RECRUITMENT_SERVICES, // 30
+        ];
 
         foreach ($motivations as $motivation) {
             foreach ($valueIdIndices as $index) {
-                self::saveOrUpdateMotivationValue($motivation->id, "fact", $index, "float", 0);
+                $value = self::getMotivationValue($motivation->id, "month", $index)
+                self::saveOrUpdateMotivationValue($motivation->id, "fact", $index, "float", $value);
             }
         }
     }