From: Vladimir Fomichev Date: Wed, 4 Sep 2024 10:53:25 +0000 (+0300) Subject: добавление проверки возвратных чеков + 3 недели X-Git-Tag: 1.4~8^2 X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=2063adf016ac5a0667d434f9e59ccee9628b9fab;p=erp24_rep%2Fyii-erp24%2F.git добавление проверки возвратных чеков + 3 недели --- diff --git a/erp24/services/MotivationService.php b/erp24/services/MotivationService.php index 9e60fdaf..35773ce1 100644 --- a/erp24/services/MotivationService.php +++ b/erp24/services/MotivationService.php @@ -1398,11 +1398,13 @@ class MotivationService ->all(); + $endDatePlusThreeWeeks = date('Y-m-d', strtotime($endDate . ' +3 weeks')); + $returnedSales = Sales::find() ->select(['sales_check']) ->where(['store_id' => $storeId, 'operation' => 'Возврат']) ->andWhere(['>=', 'date', $startDate]) - ->andWhere(['<=', 'date', $endDate]) + ->andWhere(['<=', 'date', $endDatePlusThreeWeeks]) // $endDate + 3 недели ->andWhere(['is not', 'sales_check', null]) // Проверяем, что поле sales_check не пустое ->asArray() ->all();