Răsfoiți Sursa

欠款明细

shish 2 ani în urmă
părinte
comite
c31289607f
2 a modificat fișierele cu 56 adăugiri și 0 ștergeri
  1. 50 0
      biz-ghs/book/classes/BookItemClass.php
  2. 6 0
      common/components/dict.php

+ 50 - 0
biz-ghs/book/classes/BookItemClass.php

@@ -7,6 +7,7 @@ use bizGhs\custom\classes\CustomClass;
 use bizGhs\notify\classes\NotifyClass;
 use bizGhs\product\classes\ProductClass;
 use bizGhs\shop\classes\ShopClass;
+use common\components\dict;
 use common\components\noticeUtil;
 use common\components\util;
 use Yii;
@@ -276,6 +277,55 @@ class BookItemClass extends BaseClass
             $bookItemRes->needCgNum = bcadd($bookItemRes->needCgNum, $addNeedCgNum);
             $bookItemRes->save();
 
+            //预订增加变动记录
+            $currentCapitalType = dict::getDict('capitalType', 'addBook');
+            $changeData = [
+                'mainId'=>$mainId,
+                'bookSn'=>$bookSn,
+                'name'=>$name,
+                'py'=>$py,
+                'itemId'=>$itemId,
+                'ptItemId'=>$ptItemId,
+                'customId'=>$customId,
+                'customName'=>$customName,
+                'customNamePy'=>$customNamePy,
+                'relateId'=>$bookItemResId,
+                'relateSecondId'=>0,
+                'ptStyle'=>2,
+                'capitalType'=>$currentCapitalType,
+                'io'=>1,
+                'changeNum'=>$num,
+                'num'=>0,
+                'event'=>'',
+                'staffId'=>0,
+                'staffName'=>'',
+                'remark'=>'',
+            ];
+            BookChangeClass::add($changeData,true);
+            $globalChangeData = [
+                'mainId'=>$mainId,
+                'bookSn'=>$bookSn,
+                'name'=>'',
+                'py'=>'',
+                'itemId'=>0,
+                'ptItemId'=>0,
+                'customId'=>0,
+                'customName'=>'',
+                'customNamePy'=>'',
+                'relateId'=>0,
+                'relateSecondId'=>0,
+                'ptStyle'=>2,
+                'capitalType'=>$currentCapitalType,
+                'io'=>1,
+                'changeNum'=>$num,
+                'num'=>0,
+                'event'=>'',
+                'staffId'=>0,
+                'staffName'=>'',
+                'remark'=>'',
+            ];
+            BookChangeGlobalClass::add($globalChangeData,true);
+
             $bookItemCustomRes = BookItemCustomClass::getByCondition(['mainId' => $mainId, 'bookSn' => $bookSn, 'customId' => $customId, 'itemId' => $itemId], true);
             if (empty($bookItemCustomRes)) {
                 $currentData = [

+ 6 - 0
common/components/dict.php

@@ -349,6 +349,10 @@ class dict
             'customAskGhsUseBalanceClear' => ['id' => 65, 'name' => 'customAskGhsUseBalanceClear'],
             //客户主动向供货商充值
             'customRechargeToGhs' => ['id' => 66, 'name' => 'customRechargeToGhs'],
+            //新增预订
+            'addBook' => ['id' => 67, 'name' => 'addBook'],
+            //减少预订
+            'delBook' => ['id' => 68, 'name' => 'delBook'],
         ],
         "capitalTypeList" => [//流水类型的对应链接,后台收支明细查看时跳转的链接
             0 => ['link' => '/capital/order-detail', 'name' => '网店', 'orderLink' => '/order/detail', 'id' => 0,],
@@ -388,6 +392,8 @@ class dict
             64 => ['link' => '', 'name' => '结账', 'id' => 64,],
             65 => ['link' => '', 'name' => '结账', 'id' => 65,],
             66 => ['link' => '', 'name' => '充值', 'id' => 66,],
+            67 => ['link' => '', 'name' => '新增预订', 'id' => 67,],
+            68 => ['link' => '', 'name' => '减少预订', 'id' => 68,],
         ],
 
         //用户来源