From: Alexander Smirnov Date: Wed, 14 Aug 2024 13:50:06 +0000 (+0300) Subject: [ERP-140] Подсчёт всякой всячины X-Git-Tag: 1.4~5^2~28 X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=f82d6766a68d863e176abeb3c172285d70078b88;p=erp24_rep%2Fyii-erp24%2F.git [ERP-140] Подсчёт всякой всячины --- 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); + } + } }