From b22ae94e05d1dee55e6cbfe4f40727736753d08b Mon Sep 17 00:00:00 2001 From: Vladimir Fomichev Date: Tue, 22 Jul 2025 12:13:44 +0300 Subject: [PATCH] =?utf8?q?=D0=A1=D1=82=D0=B8=D0=BB=D0=B8=20=D0=B8=20=D0=B2?= =?utf8?q?=D1=8B=D0=B2=D0=BE=D0=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- erp24/commands/CronController.php | 2 +- erp24/controllers/AutoPlannogrammaController.php | 7 ++++--- erp24/web/css/autoplannogramma/index.css | 6 +++--- erp24/web/js/autoplannogramma/autoplannogramma.js | 10 +++++++--- 4 files changed, 15 insertions(+), 10 deletions(-) diff --git a/erp24/commands/CronController.php b/erp24/commands/CronController.php index e31cad29..fe68d7f7 100644 --- a/erp24/commands/CronController.php +++ b/erp24/commands/CronController.php @@ -1696,7 +1696,7 @@ class CronController extends Controller 'capacity_type' => 1, 'details' => json_encode($details, JSON_UNESCAPED_UNICODE), 'calculate' => $quantity, - 'modify' => ceil($total), + 'modify' => null, 'total' => ceil($total) ]); diff --git a/erp24/controllers/AutoPlannogrammaController.php b/erp24/controllers/AutoPlannogrammaController.php index b57a605f..449272a6 100644 --- a/erp24/controllers/AutoPlannogrammaController.php +++ b/erp24/controllers/AutoPlannogrammaController.php @@ -149,13 +149,14 @@ class AutoPlannogrammaController extends BaseController } if (!empty($filters['capacity_type']) && $filters['capacity_type'] == 'min') { - $quantity = round((int)$model['modify'] * 0.3, 2); + $quantity = round(($model['modify'] ?? $model['total']) * 0.3, 2); } else { - $quantity = (int)$model['modify']; + $quantity = $model['modify'] ?? $model['total']; } $result[$productId]['values'][] = [ 'id' => $model['plan_id'], - 'quantity' => $quantity, + 'quantity' => (int)$quantity, + 'is_modify' => (int)$model['modify'] ? true : false, 'store_id' => (int)$model['store_id'], 'title' => !empty($model['details']) ? json_decode($model['details'], true) : null, ]; diff --git a/erp24/web/css/autoplannogramma/index.css b/erp24/web/css/autoplannogramma/index.css index 76d7a68c..fd27dcc4 100644 --- a/erp24/web/css/autoplannogramma/index.css +++ b/erp24/web/css/autoplannogramma/index.css @@ -5,7 +5,7 @@ } .corrected-input-bg { - background-color: #9dff5b !important; - color: #fff !important; - border: 1px solid #9dff5b !important; + background-color: #97e67e !important; + color: #000 !important; + border: 1px solid #97e67e !important; } \ No newline at end of file diff --git a/erp24/web/js/autoplannogramma/autoplannogramma.js b/erp24/web/js/autoplannogramma/autoplannogramma.js index 00f03c3f..538c0396 100644 --- a/erp24/web/js/autoplannogramma/autoplannogramma.js +++ b/erp24/web/js/autoplannogramma/autoplannogramma.js @@ -144,9 +144,11 @@ $('.subcategory .list-group-item').on('click', function (e) { { quantity: val.quantity || 0, id: val.id || '', - title: val.title || {} + title: val.title || {}, + is_modify: val.is_modify } ]) || []); + console.log(valuesMap); $('table thead th').each(function (index) { const $th = $(this); @@ -159,12 +161,12 @@ $('.subcategory .list-group-item').on('click', function (e) { const val = valuesMap.get(storeId) || {quantity: 0, id: '', title: {}}; const tooltipTitle = generateTitleString(val.title); const encodedTooltip = $('
').text(tooltipTitle).html(); - + const modifyClass = val.is_modify ? 'corrected-input-bg' : 'auto-input-bg'; const td = $(`