--- /dev/null
+<?php
+
+use yii\db\Migration;
+
+/**
+ * Class m241018_051346_add_new_column_on_admin_person_bonus
+ */
+class m241018_051346_add_new_column_on_admin_person_bonus extends Migration
+{
+ public function safeUp()
+ {
+ if (!$this->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');
+ }
+ }
+}
* @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
{
],
[['date_time', 'retention_comment'], 'safe'],
[['date'], 'string', 'max' => 100],
+ [['overtime'], 'number'],
];
}
'prepaid_expense' => 'Аванс',
'counting' => 'Подсчёт',
'date_time' => 'Date Time',
+ 'overtime' => 'Переработка',
];
}
->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 = 'Персональный вычет';
$makeMatrix = ArrayHelper::getValue($premiumByMatrix, 'makeMatrix');
$bonusMakeMatrix = ArrayHelper::getValue($premiumByMatrix, 'bonusMakeMatrix');
$matrixPrime = ArrayHelper::getValue($premiumByMatrix, 'matrixPrime');
+ $overtimeMatrix =
$consolidatedPremiumByStore = 0;
$arrayColumnWages = array_merge($arrayColumnWages, $personBonusesArrayInfo);
}
+ if (!empty($overtime)) {
+ $personBonusesArrayInfo = [
+ 'Переработка' => (float) $overtime,
+ ];
+ $arrayColumnWages = array_merge($arrayColumnWages, $personBonusesArrayInfo);
+ }
+
if (!empty($personPartTimeJobHoursPay)) {
$personBonusesArrayInfo = [
'Оплата подработок по часам' . ' ('. $personPartTimeJobHours . '*' . $hourPayment . ' руб/час из оклада)' => (int) $personPartTimeJobHoursPay,
'Премия за продажи не фокусной продукции (Другие товары)' => $userSalaryOtherItemsPremium,
'Премия за качество (' . $userQualityPercent . '%)' => $userQualityPremium,
'Командный бонус' => $teamBonusValue,
+// 'Переработка' =>
);
$sumValuesFlorist = array_merge($personBonusesArrayInfo, $sumValuesFlorist);
}
+ if (!empty($overtime)) {
+ $personBonusesArrayInfo = [
+ 'Переработка' => (float) $overtime,
+ ];
+ $sumValuesFlorist = array_merge($personBonusesArrayInfo, $sumValuesFlorist);
+ }
+
if (!empty($personPremiumByStore)) {
$personBonusesArrayInfo = [
'Премия за продажу фокусных позиции в праздники' => $personPremiumByStore,
$bonusVariableByMonth = array_merge($personBonusesArrayInfo, $bonusVariableByMonth);
}
+ if (!empty($overtime)) {
+ $personBonusesArrayInfo = [
+ 'Переработка' => (float) $overtime,
+ ];
+ $bonusVariableByMonth = array_merge($personBonusesArrayInfo, $bonusVariableByMonth);
+ }
if (!empty($personPartTimeJobHoursPay)) {
$personBonusesArrayInfo = [
$arrayColumnWages = array_merge($arrayColumnWages, $personBonusesArrayInfo);
}
+ if (!empty($overtime)) {
+ $personBonusesArrayInfo = [
+ 'Переработка' => (float) $overtime,
+ ];
+ $arrayColumnWages = array_merge($arrayColumnWages, $personBonusesArrayInfo);
+ }
+
if (!empty($personRetention)) {
$personRetentionArrayInfo = [
'Персональный вычет' => $personRetention * (-1),