From 7f03affbaed6e3a2edac2bdd2efb445e8f8fd2c6 Mon Sep 17 00:00:00 2001 From: Alexander Smirnov Date: Thu, 29 Aug 2024 15:54:03 +0300 Subject: [PATCH] =?utf8?q?[ERP-140]=20=D0=94=D0=B0=D0=BD=D0=BD=D1=8B=D0=B5?= =?utf8?q?=20=D0=B8=D0=B7=201=D1=81=20=D0=B1=D0=B5=D1=80=D1=83=D1=82=D1=81?= =?utf8?q?=D1=8F=20=D0=B8=D0=B7=20month=20=D0=BC=D0=BE=D1=82=D0=B8=D0=B2?= =?utf8?q?=D0=B0=D1=86=D0=B8=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- erp24/actions/motivation/TestFactAction.php | 2 +- .../scripts/tasks/task_32_motivation_fact.php | 2 +- erp24/services/MotivationService.php | 21 +++++++++++++++++-- 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/erp24/actions/motivation/TestFactAction.php b/erp24/actions/motivation/TestFactAction.php index 4b62b879..4a784f20 100644 --- a/erp24/actions/motivation/TestFactAction.php +++ b/erp24/actions/motivation/TestFactAction.php @@ -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')); diff --git a/erp24/scripts/tasks/task_32_motivation_fact.php b/erp24/scripts/tasks/task_32_motivation_fact.php index b3ed76aa..3d641799 100644 --- a/erp24/scripts/tasks/task_32_motivation_fact.php +++ b/erp24/scripts/tasks/task_32_motivation_fact.php @@ -75,7 +75,7 @@ try { MotivationService::calculateMonthCeoAndSaleOfWebsiteGoods($year, $month); -// MotivationService::initMonth1cFields($year, $month); + MotivationService::initMonth1cFields($year, $month); ////////////////////////////////////////////// diff --git a/erp24/services/MotivationService.php b/erp24/services/MotivationService.php index f8d543da..c31df16e 100644 --- a/erp24/services/MotivationService.php +++ b/erp24/services/MotivationService.php @@ -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); } } } -- 2.39.5