|
|
@@ -17,9 +17,9 @@ use common\components\util;
|
|
|
class StatController extends BaseController
|
|
|
{
|
|
|
|
|
|
+ //利润表 shish 20210829
|
|
|
public function actionProfit()
|
|
|
{
|
|
|
-
|
|
|
$get = Yii::$app->request->get();
|
|
|
$where = [];
|
|
|
$where['shopId'] = $this->shopId;
|
|
|
@@ -36,6 +36,7 @@ class StatController extends BaseController
|
|
|
|
|
|
//开单
|
|
|
$sale = StatSaleClass::getSum($where);
|
|
|
+
|
|
|
//调拨出库
|
|
|
$stockOut = StatStockOutClass::getSum($where);
|
|
|
//盘盈
|
|
|
@@ -52,7 +53,7 @@ class StatController extends BaseController
|
|
|
//退款
|
|
|
$refund = StatRefundClass::getSum($where);
|
|
|
|
|
|
- $profit = ($sale * 100 + $stockOut * 100 + $pdAdd * 100 - $cg * 100 - $wast * 100 - $stockIn * 100 - $pdSub * 100 - $refund * 100) / 100;
|
|
|
+ $balance = ($sale * 100 + $stockOut * 100 + $pdAdd * 100 - $cg * 100 - $wast * 100 - $stockIn * 100 - $pdSub * 100 - $refund * 100) / 100;
|
|
|
|
|
|
$out = [
|
|
|
'income' => [
|
|
|
@@ -67,7 +68,7 @@ class StatController extends BaseController
|
|
|
['name' => '盘亏', 'amount' => $pdSub],
|
|
|
['name' => '退款', 'amount' => $refund],
|
|
|
],
|
|
|
- 'profit' => $profit,
|
|
|
+ 'balance' => $balance,
|
|
|
];
|
|
|
|
|
|
util::success($out);
|