From 9ada0e573fc400b6f7aa2652dff7b0601631d51b Mon Sep 17 00:00:00 2001 From: fomichev Date: Mon, 21 Jul 2025 16:59:44 +0300 Subject: [PATCH] =?utf8?q?=D0=A2=D0=B8=D0=BF=20=D0=BF=D0=BB=D0=B0=D0=BD?= =?utf8?q?=D0=BE=D0=B3=D1=80=D0=B0=D0=BC=D0=BC=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- erp24/controllers/AutoPlannogrammaController.php | 11 ++++++++--- erp24/views/auto-plannogramma/index.php | 2 +- erp24/web/css/autoplannogramma/index.css | 11 +++++++++++ erp24/web/js/autoplannogramma/autoplannogramma.js | 8 ++++++-- 4 files changed, 26 insertions(+), 6 deletions(-) create mode 100644 erp24/web/css/autoplannogramma/index.css 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) {