]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
[ERP-283] поправки к отзыву
authorAlexander Smirnov <fredeom@mail.ru>
Fri, 7 Feb 2025 10:02:46 +0000 (13:02 +0300)
committerAlexander Smirnov <fredeom@mail.ru>
Fri, 7 Feb 2025 10:02:46 +0000 (13:02 +0300)
erp24/controllers/SalesWriteOffsPlanController.php

index daa967945d306736acb3e8006d288a91d5f53e76..28528e5d429bf9ddee735b503c221596903b3f99 100644 (file)
@@ -46,7 +46,10 @@ class SalesWriteOffsPlanController extends Controller
         $sales = Sales::find()->select([
             "sum(CASE WHEN operation='Продажа' THEN summ ELSE (CASE WHEN operation='Возврат' THEN -summ ELSE 0 END) END) as total",
             'store_id'])
-            ->where(['between', 'date', $prevPrevMonthStart, $prevPrevMonthEnd])
+            ->where(['between', 'date',
+                date("Y-m-d 00:00:00", strtotime($prevPrevMonthStart)),
+                date("Y-m-d 23:59:59", strtotime($prevPrevMonthEnd))])
+            ->andWhere(['in', 'order_id', [0, '']])
             ->groupBy(['store_id'])
             ->indexBy('store_id')
             ->asArray()->all();