diff --git a/views/order/_form.php b/views/order/_form.php index 3a1bfe0..9f5c872 100755 --- a/views/order/_form.php +++ b/views/order/_form.php @@ -5,7 +5,6 @@ use artweb\artbox\ecommerce\models\OrderPayment; use artweb\artbox\ecommerce\models\OrderProduct; use backend\models\SmsTemplate; - use common\components\CreditHelper; use common\models\User; use kartik\grid\GridView; use kartik\grid\SerialColumn; @@ -146,7 +145,6 @@ JS; 'main-form', - // 'options' => [ 'class' => 'form-inline' ], ] ); ?>
@@ -332,53 +330,11 @@ JS; 'id', 'short' ), - [ 'prompt' => 'Способ оплаты ...' ] + [ + 'prompt' => 'Способ оплаты ...', + 'disabled' => $model->payment == 10 ? 'disabled' : false, + ] ); ?> - payment == 10) { - ?> -
-
- field($model, 'credit_sum') - ->textInput( - [ - 'class' => 'form-control credit_input', - 'data-sum' => $model->total, - ] - ); - ?> -
-
- total - $model->credit_sum, [ - 'class' => 'credit_value_full', - ]); - ?> -
-
- field($model, 'credit_month') - ->textInput( - [ - 'class' => 'form-control credit_input', - ] - ); - ?> -
-
-

- - total - $model->credit_sum, $model->credit_month); - ?> - - грн/мес -

-
- field($model, 'insurance') ?> diff --git a/views/order/update.php b/views/order/update.php index ef4fc11..6a4f2f6 100755 --- a/views/order/update.php +++ b/views/order/update.php @@ -10,11 +10,15 @@ use yii\helpers\Html; use yii\web\View; - $this->title = 'Заказ #' . $model->id; + $this->title = 'Обновить заказ #' . $model->id; $this->params[ 'breadcrumbs' ][] = [ 'url' => yii\helpers\Url::to([ '/ecommerce/order/index' ]), 'label' => \Yii::t('app', 'Заказы'), ]; + $this->params[ 'breadcrumbs' ][] = [ + 'url' => yii\helpers\Url::to([ '/ecommerce/order/view', 'id' => $model->id, ]), + 'label' => \Yii::t('app', 'Заказ #') . $model->id, + ]; $this->params[ 'breadcrumbs' ][] = $this->title; $js = ' diff --git a/views/order/view.php b/views/order/view.php index 0d61ee8..4889a05 100755 --- a/views/order/view.php +++ b/views/order/view.php @@ -1,6 +1,7 @@ [ 'index' ], ]; $this->params[ 'breadcrumbs' ][] = $this->title; + + if (empty($model->payment)) { + $payment = ''; + } elseif ($model->payment == 10) { + $payment = Html::tag('h4', $model->orderPayment->lang->title, [ 'class' => 'text-navy' ]) . Html::beginTag( + 'table', + [ 'class' => 'table table-bordered' ] + ) . Html::tag( + 'tr', + Html::tag('td', $model->getAttributeLabel('credit_sum')) . Html::tag('td', $model->credit_sum) + ) . Html::tag( + 'tr', + Html::tag('td', $model->getAttributeLabel('credit_month')) . Html::tag('td', $model->credit_month) + ) . Html::tag( + 'tr', + Html::tag('td', 'Кредит') . Html::tag('td', $model->total - $model->credit_sum) + ) . Html::tag( + 'tr', + Html::tag('td', 'Оплата в месяц') . Html::tag( + 'td', + CreditHelper::getCredit( + $model->total - $model->credit_sum, + $model->credit_month + ) . ' грн/мес' + ) + ) . Html::endTag('table'); + } else { + $payment = $model->orderPayment->lang->title; + } + ?>
@@ -36,7 +67,7 @@ ], [ 'class' => 'btn btn-primary' ] ) ?> - + 'Причина', - 'value' => empty($model->reason) ? '' : Order::REASONS[$model->reason], + 'value' => empty($model->reason) ? '' : Order::REASONS[ $model->reason ], ], [ 'label' => 'Статус', @@ -81,8 +112,9 @@ 'declaration', 'stock', [ - 'label' => 'Способ оплаты', - 'value' => empty($model->payment) ? '' : $model->orderPayment->lang->title, + 'label' => 'Способ оплаты', + 'value' => $payment, + 'format' => 'html', ], 'insurance', 'city', @@ -134,24 +166,28 @@
- - - $historyData, - 'layout' => '{items}', - 'itemView' => '_timeline_item', - 'itemOptions' => [ + + + $historyData, + 'layout' => '{items}', + 'itemView' => '_timeline_item', + 'itemOptions' => [ 'tag' => false, - ], - 'options' => [ - 'tag' => 'ul', - 'class' => 'list-view timeline', - ], - ] - ); - ?> + ], + 'options' => [ + 'tag' => $historyData->totalCount == 0 ? 'div' : 'ul', + 'class' => $historyData->totalCount == 0 ? 'list-view' : 'list-view timeline', + ], + 'emptyText' => 'У этого заказа пока нет истории', + 'emptyTextOptions' => [ + 'class' => 'callout callout-info', + ], + ] + ); + ?>
-- libgit2 0.21.4