|
|
@@ -6,6 +6,7 @@ use biz\stat\classes\StatCgClass;
|
|
|
use biz\stat\classes\StatStockInClass;
|
|
|
use biz\stat\classes\StatStockOutClass;
|
|
|
use bizGhs\expend\classes\ExpendClass;
|
|
|
+use bizGhs\order\classes\PurchaseOrderClass;
|
|
|
use bizGhs\staff\classes\SalaryClass;
|
|
|
use bizHd\order\classes\OrderClass as HdOrderClass;
|
|
|
use bizGhs\order\classes\OrderClass;
|
|
|
@@ -43,8 +44,23 @@ class StatSaleClass extends BaseClass
|
|
|
|
|
|
//出库
|
|
|
$stockOut = StatStockOutClass::getSum($where);
|
|
|
+
|
|
|
//采购入库
|
|
|
- $cg = StatCgClass::getSum($where);
|
|
|
+ //$cg = StatCgClass::getSum($where);
|
|
|
+ $cgWhere = ['mainId' => $mainId, 'status' => 4];
|
|
|
+ $cgWhere['addTime'] = ['between', [$currentStartTime, $currentEndTime]];
|
|
|
+ $cgList = PurchaseOrderClass::getAllByCondition($cgWhere, null, '*');
|
|
|
+ $cg = 0;
|
|
|
+ if (!empty($cgList)) {
|
|
|
+ foreach ($cgList as $cgKey => $cgItem) {
|
|
|
+ $actPrice = $cgItem['actPrice'] ?? 0;
|
|
|
+ $paidPrice = $cgItem['paidPrice'] ?? 0;
|
|
|
+ $total = bcadd($actPrice, $paidPrice, 2);
|
|
|
+ $cg = bcadd($cg, $total, 2);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $cg = floatval($cg);
|
|
|
+
|
|
|
//调拨入库
|
|
|
$stockIn = StatStockInClass::getSum($where);
|
|
|
|