From: Aleksey Filippov Date: Wed, 6 Aug 2025 20:59:14 +0000 (+0300) Subject: [ERP-446] Отключение тест групп по списанию X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=ab1f35b614481a55061891171b8aa595842b6071;p=erp24_rep%2Fyii-erp24%2F.git [ERP-446] Отключение тест групп по списанию --- 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) {