From ab1f35b614481a55061891171b8aa595842b6071 Mon Sep 17 00:00:00 2001 From: Aleksey Filippov Date: Wed, 6 Aug 2025 23:59:14 +0300 Subject: [PATCH] =?utf8?q?[ERP-446]=20=D0=9E=D1=82=D0=BA=D0=BB=D1=8E=D1=87?= =?utf8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20=D1=82=D0=B5=D1=81=D1=82=20=D0=B3?= =?utf8?q?=D1=80=D1=83=D0=BF=D0=BF=20=D0=BF=D0=BE=20=D1=81=D0=BF=D0=B8?= =?utf8?q?=D1=81=D0=B0=D0=BD=D0=B8=D1=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- erp24/records/WriteOffsErp.php | 3 +++ erp24/web/js/validate/validateForm.js | 32 +++++++-------------------- 2 files changed, 11 insertions(+), 24 deletions(-) diff --git a/erp24/records/WriteOffsErp.php b/erp24/records/WriteOffsErp.php index da7ae3db..477b7a2c 100644 --- a/erp24/records/WriteOffsErp.php +++ b/erp24/records/WriteOffsErp.php @@ -791,6 +791,9 @@ class WriteOffsErp extends \yii\db\ActiveRecord public static function isTestStore(int $storeId) : bool { + if (date("Y-m-d",time()) >= '2025-08-07') { + return true; + } return (in_array($storeId, self::TEST_STORES)); } } diff --git a/erp24/web/js/validate/validateForm.js b/erp24/web/js/validate/validateForm.js index 5f4db3ef..288bbc98 100755 --- a/erp24/web/js/validate/validateForm.js +++ b/erp24/web/js/validate/validateForm.js @@ -2,11 +2,9 @@ let initialCommentValue = ''; function updateCommentReadonly() { const currentUser = $('.admin-name').text().trim(); - const selectedStoreId = $('#writeoffserp-store_id').val(); - const specialStoreIds = ['1', '9', '28', '30', '15', '44', '8']; const allowedCommentUsers = ['Емельянова Ольга', 'Яшенкова Алёна', 'Ольга Цветкова']; - const isReadonly = specialStoreIds.includes(selectedStoreId) && !allowedCommentUsers.includes(currentUser); + const isReadonly = !allowedCommentUsers.includes(currentUser); $('#writeoffserp-comment').prop('readonly', isReadonly); } @@ -65,30 +63,16 @@ $(".form-validate button").click(function (e) { const selectedStoreId = $('#writeoffserp-store_id').val(); const commentValue = $('#writeoffserp-comment').val().trim(); - const specialStoreIds = [ - '1,', - '8,', - '9,', - '13', - '15', - '19', - '28', - '30', - '41', - '44', - ]; const allowedCommentUsers = ['Емельянова Ольга', 'Яшенкова Алёна', 'Ольга Цветкова']; - if (specialStoreIds.includes(selectedStoreId)) { - if (!allRowsHaveImage) { - if (!errors['__common']) errors['__common'] = []; - errors['__common'].push('Пожалуйста, добавьте хотя бы одно фото к каждому списанию перед сохранением.'); - } + if (!allRowsHaveImage) { + if (!errors['__common']) errors['__common'] = []; + errors['__common'].push('Пожалуйста, добавьте хотя бы одно фото к каждому списанию перед сохранением.'); + } - if (!allowedCommentUsers.includes(currentUser) && commentValue !== initialCommentValue) { - if (!errors['__common']) errors['__common'] = []; - errors['__common'].push('Вы не можете редактировать комментарий для данного магазина.'); - } + if (!allowedCommentUsers.includes(currentUser) && commentValue !== initialCommentValue) { + if (!errors['__common']) errors['__common'] = []; + errors['__common'].push('Вы не можете редактировать комментарий для данного магазина.'); } if (Object.keys(errors).length > 0) { -- 2.39.5