From b1e4e69423ca6169ee60e86d1310928f148bb362 Mon Sep 17 00:00:00 2001 From: Aleksey Filippov Date: Thu, 21 Mar 2024 12:03:00 +0300 Subject: [PATCH] payroll fix --- erp24/records/Timetable.php | 18 ++++++++------- erp24/views/payroll/management.php | 35 +++++++++++++++++++++++------- 2 files changed, 37 insertions(+), 16 deletions(-) diff --git a/erp24/records/Timetable.php b/erp24/records/Timetable.php index 7901d5de..7da52600 100755 --- a/erp24/records/Timetable.php +++ b/erp24/records/Timetable.php @@ -456,14 +456,16 @@ class Timetable extends ActiveRecord $dateKeyPreparedRow = explode('_', $keyRow); $dateKeyRow = ArrayHelper::getValue($dateKeyPreparedRow, array_key_first($dateKeyPreparedRow)); foreach ($itemRows as $itemRow) { - $arrayRow = [ - 'admin_id' => $itemRow['admin']['id'], - 'admin_guid' => $itemRow['admin']['guid'], - 'admin_name' => $itemRow['admin']['name'], - ]; - $adminsPrepared[$keyRow][] = $arrayRow; - $adminsByDate[$dateKeyRow][] = $arrayRow; - $adminsByDateGuids[$dateKeyRow][] = $itemRow['admin']['guid']; + if (!empty($itemRow) && is_array($itemRow)) { + $arrayRow = [ + 'admin_id' => $itemRow['admin']['id'], + 'admin_guid' => $itemRow['admin']['guid'], + 'admin_name' => $itemRow['admin']['name'], + ]; + $adminsPrepared[$keyRow][] = $arrayRow; + $adminsByDate[$dateKeyRow][] = $arrayRow; + $adminsByDateGuids[$dateKeyRow][] = $itemRow['admin']['guid']; + } } } } diff --git a/erp24/views/payroll/management.php b/erp24/views/payroll/management.php index aadd4abf..69751050 100644 --- a/erp24/views/payroll/management.php +++ b/erp24/views/payroll/management.php @@ -81,12 +81,12 @@ $this->params['breadcrumbs'][] = $this->title;
'form_make_payroll_month']); echo Html::hiddenInput('action', 'startMakePayroll'); echo Html::hiddenInput('start', 1689226046, ['id' => 'start_form_value']); echo $form->field($yearMonthSearchForm, 'year') ->label(false)->dropDownList( - array_combine(range(2022,2026),range(2022,2026)), // Flat array ('id'=>'label') + array_combine(range(2022,2028),range(2022,2028)), // Flat array ('id'=>'label') ['prompt' => 'Выберите год'] // options ); ?> @@ -103,8 +103,11 @@ $this->params['breadcrumbs'][] = $this->title;
'checkbox', 'required' => 'required', - + echo Html::checkbox('start_time',false, [ + 'class' => 'checkbox', + 'label' => 'запустить', + 'required' => 'required', + 'id' => 'start_time_form_value', 'onclick'=>"$('#start_form_value').val('" . time() . "')", ]); ?> @@ -115,6 +118,7 @@ $this->params['breadcrumbs'][] = $this->title; echo Html::submitButton('Запустить формирование ведомости', [ 'class' => 'btn btn-primary', + 'id' => 'start_submit_form', 'data' => [ 'confirm' => 'Вы уверены, что хотите запустить формирование ведомости?', 'method' => 'post', @@ -135,7 +139,7 @@ $this->params['breadcrumbs'][] = $this->title; ActiveForm::end(); ?>
'form_disable_last_make_payroll']); echo Html::hiddenInput('action', 'disableLastMakePayroll'); ?>
@@ -150,6 +154,7 @@ $this->params['breadcrumbs'][] = $this->title; 'confirm' => 'Вы уверены, что хотите удалить этот документ?', 'method' => 'post', ], + 'onclick'=>"$('#form_disable_last_make_payroll').submit()", ] ); @@ -160,11 +165,11 @@ $this->params['breadcrumbs'][] = $this->title; // 'method' => 'post', // ], // ]); + ?>
- +
@@ -243,4 +248,18 @@ $this->params['breadcrumbs'][] = $this->title; } ?> + -- 2.39.5