From: Alexander Smirnov Date: Thu, 29 Aug 2024 12:54:03 +0000 (+0300) Subject: [ERP-140] Данные из 1с берутся из month мотивации X-Git-Tag: 1.4~5^2~16 X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=7f03affbaed6e3a2edac2bdd2efb445e8f8fd2c6;p=erp24_rep%2Fyii-erp24%2F.git [ERP-140] Данные из 1с берутся из month мотивации --- 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); } } }