Quellcode durchsuchen

充值赠送收入

shish vor 11 Monaten
Ursprung
Commit
62d2436347
2 geänderte Dateien mit 7 neuen und 1 gelöschten Zeilen
  1. 1 1
      app-hd/controllers/StatController.php
  2. 6 0
      biz-ghs/stat/classes/StatSaleClass.php

+ 1 - 1
app-hd/controllers/StatController.php

@@ -84,7 +84,7 @@ class StatController extends BaseController
         $balance = $respond['balance'] ?? 0;
         $payCodeIncome = $respond['payCodeIncome'] ?? 0;
 
-        //由于损耗而造成少赚的钱
+        //由于损耗而造成的损失
         $wastageRespond = \bizGhs\stat\classes\StatSaleClass::wastage($mainId);
         $wastagePrice = $wastageRespond['totalPrice'] ?? 0;
         $wastagePrice = floatval($wastagePrice);

+ 6 - 0
biz-ghs/stat/classes/StatSaleClass.php

@@ -302,6 +302,7 @@ class StatSaleClass extends BaseClass
         //零售开单
         $payCodeIncome = 0;
         $lsAfterSale = 0;
+        $lsGiveBalance = 0;
         $lsIncome = 0;
         $lsSendCost = 0;
         $lsServiceFee = 0;
@@ -338,6 +339,10 @@ class StatSaleClass extends BaseClass
                     $payCodeIncome = bcadd($payCodeIncome, $actPrice, 2);
                     $payCodeIncome = floatval($payCodeIncome);
                 }
+                $giveBalance = $hdOrder['giveBalance'] ?? 0;
+                $giveBalanceTk = $hdOrder['giveBalanceTk'] ?? 0;
+                $remainGiveBalance = bcsub($giveBalance, $giveBalanceTk, 2);
+                $lsGiveBalance = bcadd($lsGiveBalance, $remainGiveBalance, 2);
             }
         }
 
@@ -389,6 +394,7 @@ class StatSaleClass extends BaseClass
             ['name' => '调拨入库', 'id' => 'allot', 'amount' => floatval($stockIn)],
             ['name' => '员工工资', 'id' => 'salary', 'amount' => floatval($salary)],
             ['name' => '收款码重复收入', 'id' => 'salary', 'amount' => floatval($payCodeIncome)],
+            ['name' => '零售充值赠送', 'id' => 'salary', 'amount' => floatval($lsGiveBalance)],
         ];
         if (!empty($expendAmount)) {
             foreach ($expendAmount as $it) {