]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
Убираем поправку на 3 недели, оставляем день в день
authorvladfo <fvv2011@gmail.com>
Thu, 17 Oct 2024 06:59:57 +0000 (09:59 +0300)
committervladfo <fvv2011@gmail.com>
Thu, 17 Oct 2024 06:59:57 +0000 (09:59 +0300)
erp24/services/MotivationService.php

index 6680b398ad8a5abf24fe8df459dd18e479229ae6..0574d1b684d2d49c9e69b81c05240629da73d15a 100644 (file)
@@ -1838,13 +1838,13 @@ class MotivationService
             ->all();
 
 
-        $endDatePlusThreeWeeks = date('Y-m-d 23:59:59', strtotime($endDate . ' +3 weeks'));
+
 
         $returnedSales = Sales::find()
             ->select(['sales_check'])
             ->where(['store_id' => $storeId, 'operation' => Sales::OPERATION_RETURN])
             ->andWhere(['>=', 'date', $startDate])
-            ->andWhere(['<=', 'date', $endDatePlusThreeWeeks])  // $endDate + 3 недели
+            ->andWhere(['<=', 'date', $endDate])
             ->andWhere(['is not', 'sales_check', null])  // Проверяем, что поле sales_check не пустое
             ->asArray()
             ->all();
@@ -1933,14 +1933,14 @@ class MotivationService
             ->asArray()
             ->all();
 
-        $endDatePlusThreeWeeks = date('Y-m-d 23:59:59', strtotime($endDate . ' +3 weeks'));
 
-        // Находим возвраты за указанный период + 3 недели
+
+        // Находим возвраты за указанный период
         $returnedSales = Sales::find()
             ->select(['sales_check'])
             ->where(['store_id' => $storeId, 'operation' => Sales::OPERATION_RETURN])
             ->andWhere(['>=', 'date', $startDate])
-            ->andWhere(['<=', 'date', $endDatePlusThreeWeeks])
+            ->andWhere(['<=', 'date', $endDate])
             ->andWhere(['is not', 'sales_check', null])
             ->asArray()
             ->all();
@@ -2032,14 +2032,14 @@ class MotivationService
             ->asArray()
             ->all();
 
-        $endDatePlusThreeWeeks = date('Y-m-d 23:59:59', strtotime($endDate . ' +3 weeks'));
 
-        // Находим возвраты за указанный период + 3 недели
+
+        // Находим возвраты за указанный период
         $returnedSales = Sales::find()
           //  ->select(['id', 'date', 'sales_check'])
             ->where(['store_id' => $storeId, 'operation' => Sales::OPERATION_RETURN])
             ->andWhere(['>=', 'date', $startDate])
-            ->andWhere(['<=', 'date', $endDatePlusThreeWeeks])
+            ->andWhere(['<=', 'date', $endDate])
             ->andWhere(['is not', 'sales_check', null])
             ->asArray()
             ->all();