]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
Merge branch 'develop' into feature_smirnov_erp-187_personal_recalculation
authorAlexander Smirnov <fredeom@mail.ru>
Thu, 26 Sep 2024 13:26:08 +0000 (16:26 +0300)
committerAlexander Smirnov <fredeom@mail.ru>
Thu, 26 Sep 2024 13:26:08 +0000 (16:26 +0300)
1  2 
erp24/services/MotivationService.php

index e49cacbd00e06586773df5748e8a42cd50be3064,a3058570965d79458eba34aded29faf20e360b2e..313f2c414e66afe135028c9334220fb64ffe0ee1
@@@ -755,10 -770,14 +771,10 @@@ class MotivationServic
              $result = 0;
              foreach ($adminIds as $admin_id) {
                  $timetableFactModel = TimetableFactModel::find()->select(['COUNT(*) as total', 'admin_group_id'])->where(['store_id' => $store_id, 'admin_id' => $admin_id])
-                     ->andWhere(['between', 'date_shift', $monthStart, $monthEnd])->groupBy(['admin_group_id'])->asArray()->one();
+                     ->andWhere(['between', 'date', $monthStart, $monthEnd])->groupBy(['admin_group_id'])->asArray()->one();
  
 -                $norma = 15;
 -                if ($timetableFactModel['admin_group_id'] != AdminGroup::GROUP_WORKERS) {
 -                    $timetablePlan = Timetable::find()->select(['COUNT(*) as total'])->where(['store_id' => $store_id, 'admin_id' => $admin_id, 'tabel' => 0, 'slot_type_id' => Timetable::TIMESLOT_WORK])
 -                        ->andWhere(['between', 'date', $monthStart, $monthEnd])->asArray()->one();
 -                    $norma = $timetablePlan['total'];
 -                }
 +                $norma = $timetableFactModel['admin_group_id'] == AdminGroup::GROUP_ADMINISTRATORS ?
 +                    HtmlHelper::getWorkDays($month, $year) : 15;
                  $result += $norma == 0 ? 0 : $timetableFactModel['total'] / $norma;
              }
              self::saveOrUpdateMotivationValue($motivation->id, 'fact', MotivationCostsItem::CODE_EMPLOYEES_QUANTITY, 'float', $result);