From: Alexander Smirnov Date: Thu, 5 Dec 2024 14:22:19 +0000 (+0300) Subject: [ERP-258] отсортировать продукты, открыть детали если выбраны X-Git-Tag: 1.7~189^2~10 X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=5ecd748febdf9b2f1b2d148eeb0c0f231d96596c;p=erp24_rep%2Fyii-erp24%2F.git [ERP-258] отсортировать продукты, открыть детали если выбраны --- diff --git a/erp24/controllers/ShiftTransferController.php b/erp24/controllers/ShiftTransferController.php index f601b015..c8520596 100644 --- a/erp24/controllers/ShiftTransferController.php +++ b/erp24/controllers/ShiftTransferController.php @@ -53,8 +53,9 @@ class ShiftTransferController extends Controller public function buildLoadDataShiftRemains($groups, $storeGuid) { $productsClass = ProductsClass::find()->select(['category_id'])->where(['tip' => $groups])->column(); - $products = ArrayHelper::map(Products1c::find()->select(['id', 'name']) - ->where(['parent_id' => $productsClass])->orderBy(['name' => SORT_ASC, 'parent_id' => SORT_DESC])->all(), 'id', 'name'); + $products = ArrayHelper::map(Products1c::find()->alias('p')->select(['id', 'name'])->leftJoin('products_class pc', 'pc.category_id = p.parent_id') + ->where(['parent_id' => $productsClass])->orderBy(['(CASE WHEN pc.tip = \'other_items\' THEN 1 ELSE 0 END)' => SORT_DESC + ,'name' => SORT_ASC])->all(), 'id', 'name'); $balance = ArrayHelper::map(Balances::find()->select(['quantity', 'product_id']) ->where(['store_id' => $storeGuid])->all(), 'product_id', 'quantity'); $productGuids = []; diff --git a/erp24/views/shift-transfer/_transfer.php b/erp24/views/shift-transfer/_transfer.php index 52d3b1b5..b07dbc9c 100644 --- a/erp24/views/shift-transfer/_transfer.php +++ b/erp24/views/shift-transfer/_transfer.php @@ -25,13 +25,13 @@ echo \kartik\grid\GridView::widget([ return $products[$data['product_guid']] ?? ''; }, ], - [ - 'attribute' => 'group_label', - 'label' => 'Название группы', - 'value' => function($data) { - return ProductsClass::getHints()[$data['group_label']] ?? ''; - }, - ], +// [ +// 'attribute' => 'group_label', +// 'label' => 'Название группы', +// 'value' => function($data) { +// return ProductsClass::getHints()[$data['group_label']] ?? ''; +// }, +// ], [ 'attribute' => 'retail_price', 'label' => 'Розничная цена, руб', diff --git a/erp24/views/shift-transfer/update.php b/erp24/views/shift-transfer/update.php index 1d00f908..58ac35d1 100644 --- a/erp24/views/shift-transfer/update.php +++ b/erp24/views/shift-transfer/update.php @@ -73,7 +73,7 @@ $this->registerCss(' 'Номенклатура 1%'] ?> field($shiftTransfer, 'groups2')->checkboxList($hints2, ['checked' => 1, 'onclick' => '$("#acceptDiv").removeClass("d-none");']) ?> -
+
groups2) ? 'open' : '' ?> > Другие
@@ -90,7 +90,7 @@ $this->registerCss('
field($shiftTransfer, 'shiftRemainsCopy')->widget(MultipleInput::class, [ 'min' => 0, - 'max' => 100, + 'max' => 2000, 'columns' => [ [ 'name' => 'product_guid', @@ -98,8 +98,6 @@ $this->registerCss(' 'type' => Select2::class, 'options' => [ 'data' => $productGuids, -// ArrayHelper::map(Products1c::find()->select(['id', 'name']) -// ->where(['tip' => 'products'])->orderBy(['name' => SORT_ASC])->all(), 'id', 'name'), ], 'value' => function($data) { return $data['product_guid'] ?? '';