From: marina Date: Tue, 22 Oct 2024 06:03:05 +0000 (+0300) Subject: ERP-223 Добавить в /admin-person-bonuses/ строчку Переработка (сумма) X-Git-Tag: 1.6~22^2 X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=8e6cbd3c326ef1f3775b8d121aa0891fcec37a3b;p=erp24_rep%2Fyii-erp24%2F.git ERP-223 Добавить в /admin-person-bonuses/ строчку Переработка (сумма) --- diff --git a/erp24/migrations/m241018_051346_add_new_column_on_admin_person_bonus.php b/erp24/migrations/m241018_051346_add_new_column_on_admin_person_bonus.php new file mode 100644 index 00000000..801b16b9 --- /dev/null +++ b/erp24/migrations/m241018_051346_add_new_column_on_admin_person_bonus.php @@ -0,0 +1,27 @@ +db->schema->getTableSchema('admin_person_bonuses', true)->getColumn('overtime')) { + $this->addColumn('admin_person_bonuses', 'overtime', $this->float()->defaultValue(null)); + } + } + + + /** + * {@inheritdoc} + */ + public function safeDown() + { + if ($this->db->schema->getTableSchema('admin_person_bonuses', true)->getColumn('overtime')) { + $this->dropColumn('admin_person_bonuses', 'overtime'); + } + } +} diff --git a/erp24/records/AdminPersonBonuses.php b/erp24/records/AdminPersonBonuses.php index 2f29d9f8..5d4bde7e 100755 --- a/erp24/records/AdminPersonBonuses.php +++ b/erp24/records/AdminPersonBonuses.php @@ -24,6 +24,7 @@ use yii\db\ActiveQueryInterface; * @property int|null $part_time_job_hours * @property string $retention_comment * @property int $created_admin_id + * @property float overtime */ class AdminPersonBonuses extends \yii\db\ActiveRecord { @@ -58,6 +59,7 @@ class AdminPersonBonuses extends \yii\db\ActiveRecord ], [['date_time', 'retention_comment'], 'safe'], [['date'], 'string', 'max' => 100], + [['overtime'], 'number'], ]; } @@ -82,6 +84,7 @@ class AdminPersonBonuses extends \yii\db\ActiveRecord 'prepaid_expense' => 'Аванс', 'counting' => 'Подсчёт', 'date_time' => 'Date Time', + 'overtime' => 'Переработка', ]; } diff --git a/erp24/services/CabinetService.php b/erp24/services/CabinetService.php index 501d251e..f89daafe 100755 --- a/erp24/services/CabinetService.php +++ b/erp24/services/CabinetService.php @@ -2738,6 +2738,7 @@ class CabinetService ->one(); $personBonuses = ArrayHelper::getValue($personBonusesArray, 'bonuses'); // Персональная премия + $overtime = ArrayHelper::getValue($personBonusesArray, 'overtime'); // Переработка $personColorRubleBonuses = ArrayHelper::getValue($personBonusesArray, 'color_ruble_bonuses'); // Персональная премия $personRetention = ArrayHelper::getValue($personBonusesArray, 'retention'); // Персональный вычет $personRetentionСomment = 'Персональный вычет'; @@ -2865,6 +2866,7 @@ class CabinetService $makeMatrix = ArrayHelper::getValue($premiumByMatrix, 'makeMatrix'); $bonusMakeMatrix = ArrayHelper::getValue($premiumByMatrix, 'bonusMakeMatrix'); $matrixPrime = ArrayHelper::getValue($premiumByMatrix, 'matrixPrime'); + $overtimeMatrix = $consolidatedPremiumByStore = 0; @@ -3036,6 +3038,13 @@ false $arrayColumnWages = array_merge($arrayColumnWages, $personBonusesArrayInfo); } + if (!empty($overtime)) { + $personBonusesArrayInfo = [ + 'Переработка' => (float) $overtime, + ]; + $arrayColumnWages = array_merge($arrayColumnWages, $personBonusesArrayInfo); + } + if (!empty($personPartTimeJobHoursPay)) { $personBonusesArrayInfo = [ 'Оплата подработок по часам' . ' ('. $personPartTimeJobHours . '*' . $hourPayment . ' руб/час из оклада)' => (int) $personPartTimeJobHoursPay, @@ -3214,6 +3223,7 @@ false 'Премия за продажи не фокусной продукции (Другие товары)' => $userSalaryOtherItemsPremium, 'Премия за качество (' . $userQualityPercent . '%)' => $userQualityPremium, 'Командный бонус' => $teamBonusValue, +// 'Переработка' => ); @@ -3224,6 +3234,13 @@ false $sumValuesFlorist = array_merge($personBonusesArrayInfo, $sumValuesFlorist); } + if (!empty($overtime)) { + $personBonusesArrayInfo = [ + 'Переработка' => (float) $overtime, + ]; + $sumValuesFlorist = array_merge($personBonusesArrayInfo, $sumValuesFlorist); + } + if (!empty($personPremiumByStore)) { $personBonusesArrayInfo = [ 'Премия за продажу фокусных позиции в праздники' => $personPremiumByStore, @@ -3318,6 +3335,12 @@ false $bonusVariableByMonth = array_merge($personBonusesArrayInfo, $bonusVariableByMonth); } + if (!empty($overtime)) { + $personBonusesArrayInfo = [ + 'Переработка' => (float) $overtime, + ]; + $bonusVariableByMonth = array_merge($personBonusesArrayInfo, $bonusVariableByMonth); + } if (!empty($personPartTimeJobHoursPay)) { $personBonusesArrayInfo = [ @@ -7146,6 +7169,13 @@ Group BY admin_id $arrayColumnWages = array_merge($arrayColumnWages, $personBonusesArrayInfo); } + if (!empty($overtime)) { + $personBonusesArrayInfo = [ + 'Переработка' => (float) $overtime, + ]; + $arrayColumnWages = array_merge($arrayColumnWages, $personBonusesArrayInfo); + } + if (!empty($personRetention)) { $personRetentionArrayInfo = [ 'Персональный вычет' => $personRetention * (-1), diff --git a/erp24/views/admin_person_bonuses/_form.php b/erp24/views/admin_person_bonuses/_form.php index 96205dbb..04c0c769 100755 --- a/erp24/views/admin_person_bonuses/_form.php +++ b/erp24/views/admin_person_bonuses/_form.php @@ -77,6 +77,8 @@ use yii_app\records\Admin; field($model, 'counting')->textInput() ?> + field($model, 'overtime')->textInput(['type' => 'number', 'step' => 'any']) ?> +
'btn btn-success']) ?>
diff --git a/erp24/views/admin_person_bonuses/_update_form.php b/erp24/views/admin_person_bonuses/_update_form.php index 2ab320d4..f224a881 100755 --- a/erp24/views/admin_person_bonuses/_update_form.php +++ b/erp24/views/admin_person_bonuses/_update_form.php @@ -39,6 +39,8 @@ use yii_app\records\Admin; field($model, 'counting')->textInput() ?> + field($model, 'overtime')->textInput(['type' => 'number', 'step' => 'any']) ?> +
'btn btn-success']) ?>
diff --git a/erp24/views/admin_person_bonuses/index.php b/erp24/views/admin_person_bonuses/index.php index 20031ace..a8cffb8c 100755 --- a/erp24/views/admin_person_bonuses/index.php +++ b/erp24/views/admin_person_bonuses/index.php @@ -61,6 +61,7 @@ $this->params['breadcrumbs'][] = $this->title; 'shift_correction', 'prepaid_expense', 'counting', + 'overtime', //'date_time', [ 'class' => ActionColumn::className(), diff --git a/erp24/views/admin_person_bonuses/view.php b/erp24/views/admin_person_bonuses/view.php index acd456a1..54f16711 100755 --- a/erp24/views/admin_person_bonuses/view.php +++ b/erp24/views/admin_person_bonuses/view.php @@ -38,6 +38,7 @@ $this->params['breadcrumbs'][] = $this->title; 'shift_correction', 'prepaid_expense', 'counting', + 'overtime', // 'date_time', ], ]) ?>