]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
[ERP-446] Отключение тест групп по списанию feature_filippov_erp-446_test_store_dis_wr_off_erp origin/feature_filippov_erp-446_test_store_dis_wr_off_erp
authorAleksey Filippov <Aleksey.Filippov@erp-flowers.ru>
Wed, 6 Aug 2025 20:59:14 +0000 (23:59 +0300)
committerAleksey Filippov <Aleksey.Filippov@erp-flowers.ru>
Wed, 6 Aug 2025 20:59:14 +0000 (23:59 +0300)
erp24/records/WriteOffsErp.php
erp24/web/js/validate/validateForm.js

index da7ae3db83b2eeb382c9acf93d55227242109175..477b7a2cc8c565a5342cebd08451ea8d4fb51f41 100644 (file)
@@ -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));
     }
 }
index 5f4db3ef9384390682988a4ed73ffc6c64be11d6..288bbc98d1db0540c02eff3036a56173a7c6ec89 100755 (executable)
@@ -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) {