From: fomichev Date: Mon, 21 Jul 2025 13:59:44 +0000 (+0300) Subject: Тип планограммы X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=9ada0e573fc400b6f7aa2652dff7b0601631d51b;p=erp24_rep%2Fyii-erp24%2F.git Тип планограммы --- diff --git a/erp24/controllers/AutoPlannogrammaController.php b/erp24/controllers/AutoPlannogrammaController.php index 4606c91f..b57a605f 100644 --- a/erp24/controllers/AutoPlannogrammaController.php +++ b/erp24/controllers/AutoPlannogrammaController.php @@ -100,8 +100,8 @@ class AutoPlannogrammaController extends BaseController ->andFilterWhere(['=', 'cp.address_city', $filters['city']]) ->andFilterWhere(['=', 'cp.address_region', $filters['region']]) ->andFilterWhere(['=', 'cp.address_district', $filters['district']]) - ->andFilterWhere(['=', 'cp.store_type', $filters['store_type']]) - ->andFilterWhere(['=', 'a.capacity_type', $filters['capacity_type']]); + ->andFilterWhere(['=', 'cp.store_type', $filters['store_type']]); + //->andFilterWhere(['=', 'a.capacity_type', $filters['capacity_type']]); if (!empty($filters['territorial_manager'])) { $territorialManagerStoreIds = StoreDynamic::find() @@ -148,9 +148,14 @@ class AutoPlannogrammaController extends BaseController ]; } + if (!empty($filters['capacity_type']) && $filters['capacity_type'] == 'min') { + $quantity = round((int)$model['modify'] * 0.3, 2); + } else { + $quantity = (int)$model['modify']; + } $result[$productId]['values'][] = [ 'id' => $model['plan_id'], - 'quantity' => (int)$model['modify'], + 'quantity' => $quantity, 'store_id' => (int)$model['store_id'], 'title' => !empty($model['details']) ? json_decode($model['details'], true) : null, ]; diff --git a/erp24/views/auto-plannogramma/index.php b/erp24/views/auto-plannogramma/index.php index 9ee91af0..d5c42049 100644 --- a/erp24/views/auto-plannogramma/index.php +++ b/erp24/views/auto-plannogramma/index.php @@ -19,7 +19,7 @@ use yii\jui\Accordion; use yii\data\ArrayDataProvider; - +$this->registerCssFile(Yii::getAlias('@web') . '/css/autoplannogramma/index.css'); $tooltipText = "Оффлайн: 50 Флаумак (off-line): 20 Флаумак (on-line): 10 Флаумак (market): 10 Изумительная (off-line): 30 Списания: 20"; $this->registerJsFile('/js/autoplannogramma/autoplannogramma.js', ['position' => View::POS_END]); ?> diff --git a/erp24/web/css/autoplannogramma/index.css b/erp24/web/css/autoplannogramma/index.css new file mode 100644 index 00000000..76d7a68c --- /dev/null +++ b/erp24/web/css/autoplannogramma/index.css @@ -0,0 +1,11 @@ +.auto-input-bg { + background-color: #5b9aff !important; + color: #fff !important; + border: 1px solid #5b9aff !important; +} + +.corrected-input-bg { + background-color: #9dff5b !important; + color: #fff !important; + border: 1px solid #9dff5b !important; +} \ No newline at end of file diff --git a/erp24/web/js/autoplannogramma/autoplannogramma.js b/erp24/web/js/autoplannogramma/autoplannogramma.js index e337b58d..00f03c3f 100644 --- a/erp24/web/js/autoplannogramma/autoplannogramma.js +++ b/erp24/web/js/autoplannogramma/autoplannogramma.js @@ -44,6 +44,10 @@ document.addEventListener("DOMContentLoaded", () => { $(document).ready(function () { $('.btn-apply').trigger('click'); + $('#polnogramma-type').on('change', function () { + console.log('Выбрано:', $(this).val()); + + }); }); @@ -105,7 +109,7 @@ $('.subcategory .list-group-item').on('click', function (e) { filters.month = getMonthByWeek(week, year, true); filters.category = category; filters.subcategory = subcategory; - + console.log(filters.capacity_type); $('.loader-overlay').removeClass('d-none'); $.ajax({ @@ -160,7 +164,7 @@ $('.subcategory .list-group-item').on('click', function (e) {