From f82d6766a68d863e176abeb3c172285d70078b88 Mon Sep 17 00:00:00 2001 From: Alexander Smirnov Date: Wed, 14 Aug 2024 16:50:06 +0300 Subject: [PATCH] =?utf8?q?[ERP-140]=20=D0=9F=D0=BE=D0=B4=D1=81=D1=87=D1=91?= =?utf8?q?=D1=82=20=D0=B2=D1=81=D1=8F=D0=BA=D0=BE=D0=B9=20=D0=B2=D1=81?= =?utf8?q?=D1=8F=D1=87=D0=B8=D0=BD=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- erp24/actions/motivation/TestFactAction.php | 8 ++++ .../scripts/tasks/task_32_motivation_fact.php | 7 ++++ erp24/services/MotivationService.php | 40 +++++++++++++++++++ 3 files changed, 55 insertions(+) diff --git a/erp24/actions/motivation/TestFactAction.php b/erp24/actions/motivation/TestFactAction.php index b604f9de..d4a07310 100644 --- a/erp24/actions/motivation/TestFactAction.php +++ b/erp24/actions/motivation/TestFactAction.php @@ -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')); diff --git a/erp24/scripts/tasks/task_32_motivation_fact.php b/erp24/scripts/tasks/task_32_motivation_fact.php index 2aa53064..fb35da4d 100644 --- a/erp24/scripts/tasks/task_32_motivation_fact.php +++ b/erp24/scripts/tasks/task_32_motivation_fact.php @@ -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); ////////////////////////////////////////////// diff --git a/erp24/services/MotivationService.php b/erp24/services/MotivationService.php index 27528d24..f71f70e2 100644 --- a/erp24/services/MotivationService.php +++ b/erp24/services/MotivationService.php @@ -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); + } + } } -- 2.39.5