shish 2 жил өмнө
parent
commit
50b53773d4

+ 34 - 0
app-ghs/controllers/PurchaseOrderController.php

@@ -10,6 +10,7 @@ use bizGhs\order\classes\PurchaseOrderItemClass;
 use bizGhs\product\classes\ProductClass;
 use bizGhs\shop\classes\ShopClass;
 use bizHd\purchase\classes\PurchaseClass;
+use common\components\dateUtil;
 use common\components\dict;
 use common\components\noticeUtil;
 use common\components\printUtil;
@@ -548,4 +549,37 @@ class PurchaseOrderController extends BaseController
         util::complete('修改成功');
     }
 
+    //应付款统计 ssh 20240528
+    public function actionDueList()
+    {
+        $get = Yii::$app->request->get();
+        $where = [];
+        $mainId = $this->mainId;
+        $debt = isset($get['debt']) && is_numeric($get['debt']) ? $get['debt'] : -1;
+        $where['mainId'] = $mainId;
+        $searchTime = isset($get['searchTime']) && !empty($get['searchTime']) ? $get['searchTime'] : 'today';
+
+        $startTime = $get['startTime'] ?? '';
+        $endTime = $get['endTime'] ?? '';
+        $period = dateUtil::formatTime($searchTime, $startTime, $endTime, true);
+        $start = $period['startTime'];
+        $end = $period['endTime'];
+        $where['time'] = ['between', [$start, $end]];
+        if ($debt > -1) {
+            $where['debt'] = $debt;
+        }
+
+        $ghsList = GhsClass::getAllByCondition(['ownShopId' => $this->shopId], null, 'id,name', 'id');
+
+        $currentStartDate = date('Y-m-d', strtotime($start));
+        $currentEndDate = date('Y-m-d', strtotime($end));
+        $currentStartTime = $currentStartDate . ' 00:00:00';
+        $currentEndTime = $currentEndDate . ' 23:59:59';
+
+        $cgWhere = ['mainId' => $mainId, 'status' => 4];
+        $cgWhere['entryTime'] = ['between', [$currentStartTime, $currentEndTime]];
+        $cgList = PurchaseOrderClass::getAllByCondition($cgWhere, null, '*');
+
+    }
+
 }

+ 0 - 35
biz-ghs/order/classes/PurchaseOrderClass.php

@@ -19,9 +19,7 @@ use bizGhs\order\traits\OrderTrait;
 use bizGhs\shop\classes\ShopAdminClass;
 use bizGhs\stock\classes\OnStockRecordClass;
 use bizGhs\stock\classes\StockRecordClass;
-use bizGhs\stock\services\StockRecordService;
 use bizGhs\product\classes\ProductClass;
-use common\components\dateUtil;
 use common\components\dict;
 use common\components\imgUtil;
 use common\components\noticeUtil;
@@ -1199,37 +1197,4 @@ class PurchaseOrderClass extends BaseClass
 
     }
 
-    //应付款统计 ssh 20240528
-    public function actionDueList()
-    {
-        $get = Yii::$app->request->get();
-        $where = [];
-        $mainId = $this->mainId;
-        $debt = isset($get['debt']) && is_numeric($get['debt']) ? $get['debt'] : -1;
-        $where['mainId'] = $mainId;
-        $searchTime = isset($get['searchTime']) && !empty($get['searchTime']) ? $get['searchTime'] : 'today';
-
-        $startTime = $get['startTime'] ?? '';
-        $endTime = $get['endTime'] ?? '';
-        $period = dateUtil::formatTime($searchTime, $startTime, $endTime, true);
-        $start = $period['startTime'];
-        $end = $period['endTime'];
-        $where['time'] = ['between', [$start, $end]];
-        if ($debt > -1) {
-            $where['debt'] = $debt;
-        }
-
-        $ghsList = GhsClass::getAllByCondition(['ownShopId' => $this->shopId], null, 'id,name', 'id');
-
-        $currentStartDate = date('Y-m-d', strtotime($start));
-        $currentEndDate = date('Y-m-d', strtotime($end));
-        $currentStartTime = $currentStartDate . ' 00:00:00';
-        $currentEndTime = $currentEndDate . ' 23:59:59';
-
-        $cgWhere = ['mainId' => $mainId, 'status' => 4];
-        $cgWhere['entryTime'] = ['between', [$currentStartTime, $currentEndTime]];
-        $cgList = PurchaseOrderClass::getAllByCondition($cgWhere, null, '*');
-
-    }
-
 }