'allowed_reserve' => $status->allowed_reserve,
'allowed_closing' => $status->allowed_closing,
'allowed_editing' => $status->allowed_editing,
+ 'successful_order' => $status->successful_order,
+ 'cancelled_order' => $status->cancelled_order,
'hint' => $status->status_instruction,
'status_id' => $status->status_id,
'allowed_statuses' => $relationsToSend
--- /dev/null
+<?php
+
+use yii\db\Migration;
+
+class m250717_134217_add_successfull_order_cancelled_order_fields_to_marketplace_orders_1c_statuses_table extends Migration
+{
+ const TABLE_NAME = 'erp24.marketplace_order_1c_statuses';
+ /**
+ * {@inheritdoc}
+ */
+ public function safeUp()
+ {
+ $table = $this->db->schema->getTableSchema(self::TABLE_NAME);
+ if ($table === null) {
+ return;
+ }
+
+ if (!$this->db->schema->getTableSchema(self::TABLE_NAME, true)->getColumn('successful_order')) {
+ $this->addColumn(
+ self::TABLE_NAME,
+ 'successful_order',
+ $this->integer()->defaultValue(0)->comment('Ключ успешного завершения заказа'),
+ );
+ }
+ if (!$this->db->schema->getTableSchema(self::TABLE_NAME, true)->getColumn('cancelled_order')) {
+ $this->addColumn(
+ self::TABLE_NAME,
+ 'cancelled_order',
+ $this->integer()->defaultValue(0)->comment('Ключ отмененного заказа'),
+ );
+ }
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function safeDown()
+ {
+ if ($this->db->schema->getTableSchema(self::TABLE_NAME, true)->getColumn('successful_order')) {
+ $this->dropColumn(self::TABLE_NAME, 'successful_order');
+ }
+ if ($this->db->schema->getTableSchema(self::TABLE_NAME, true)->getColumn('cancelled_order')) {
+ $this->dropColumn(self::TABLE_NAME, 'cancelled_order');
+ }
+ }
+
+ /*
+ // Use up()/down() to run migration code without a transaction.
+ public function up()
+ {
+
+ }
+
+ public function down()
+ {
+ echo "m250717_134217_add_successfull_order_cancelled_order_fields_to_marketplace_orders_1c_statuses_table cannot be reverted.\n";
+
+ return false;
+ }
+ */
+}
* @property int $marketplace_id Маркетплейс
* @property int $allowed_reserve Разрешено резервирование
* @property int $allowed_closing Разрешено закрытие
+ * @property int $cancelled_order Ключ отмененного заказа
+ * @property int $successful_order Ключ успешного завершения заказа
* @property string $status_id артикул
* @property string $status Статус
* @property string $status_instruction Инструкция к статусу
'allowed_closing',
'order_status_id',
'order_substatus_id',
- 'allowed_editing'
+ 'allowed_editing',
+ 'successful_order',
+ 'cancelled_order'
], 'integer'],
[['status_instruction', 'status_id'], 'string'],
[['status_id', 'status'], 'string', 'max' => 100],
'posit' => 'Порядок статусов',
'order_status_id' => 'Ссылка на статус заказа в МП',
'order_substatus_id' => 'Ссылка на субстатус заказа в МП',
- 'allowed_editing' => 'Разрешено редактирование'
+ 'allowed_editing' => 'Разрешено редактирование',
+ 'successful_order' => 'Ключ успешного завершения заказа',
+ 'cancelled_order' => 'Ключ отмененного заказа'
];
}
'id' => 'marketplace-order1cstatuses-allowed_editing',
]
) ?>
+ <?= $form->field($model, 'successful_order')
+ ->dropDownList(
+ [0 => 'Нет', 1 => 'Да'],
+ [
+ 'prompt' => 'Выберите завершен ли заказ успешно',
+ 'id' => 'marketplace-order1cstatuses-successful_order',
+ ]
+ ) ?>
+ <?= $form->field($model, 'cancelled_order')
+ ->dropDownList(
+ [0 => 'Нет', 1 => 'Да'],
+ [
+ 'prompt' => 'Выберите завершен ли заказ отменой',
+ 'id' => 'marketplace-order1cstatuses-cancelled_order',
+ ]
+ ) ?>
<?= $form->field($model, 'order_status_id')
->dropDownList(
$orderStatusTypes,
$reserve = $model->allowed_reserve === 0 ? 'Нет' : 'Да';
$closing = $model->allowed_closing === 0 ? 'Нет' : 'Да';
$editing = $model->allowed_editing === 0 ? 'Нет' : 'Да';
+ $success = $model->successful_order === 0 ? 'Нет' : 'Да';
+ $cancel = $model->cancelled_order === 0 ? 'Нет' : 'Да';
$html = '<div class="d-flex flex-column justify-content-between">';
$html .= '<div class="d-flex justify-content-between" >' . '<div>Резервирование:</div><strong > ' . $reserve . '</strong></div>';
$html .= '<div class="d-flex justify-content-between" >' . '<div>Закрытие:</div><strong > ' . $closing . '</strong></div>';
$html .= '<div class="d-flex justify-content-between" >' . '<div>Редактирование:</div><strong > ' . $editing . '</strong></div>';
+ $html .= '<div class="d-flex justify-content-between" >' . '<div>Успех:</div><strong > ' . $success . '</strong></div>';
+ $html .= '<div class="d-flex justify-content-between" >' . '<div>Отказ:</div><strong > ' . $cancel . '</strong></div>';
$html .= '</div>';
return $html;
}
return $model->allowed_editing === 0 ? 'Нет' : 'Да';
}
],
+ [
+ 'attribute' => 'successful_order',
+ 'value' => function ($model) {
+ return $model->successful_order === 0 ? 'Нет' : 'Да';
+ }
+ ],
+ [
+ 'attribute' => 'cancelled_order',
+ 'value' => function ($model) {
+ return $model->cancelled_order === 0 ? 'Нет' : 'Да';
+ }
+ ],
[
'attribute' => 'order_status_id',
'value' => function ($model) {