|
|
@@ -113,6 +113,56 @@ class BookItemCustomClass extends BaseClass
|
|
|
return $bookItemCustomRes;
|
|
|
}
|
|
|
|
|
|
+ public static function addRoadNum($bookItemCustomRes, $addRoadNum, $num, $bill, $shop, $product, $params)
|
|
|
+ {
|
|
|
+ $bookItemCustomRes->roadNum = bcadd($bookItemCustomRes->roadNum, $addRoadNum);
|
|
|
+ $bookItemCustomRes->save();
|
|
|
+ $bookItemResId = $bookItemCustomRes->id ?? 0;
|
|
|
+
|
|
|
+ $ioRes = $params['ioRes'] ?? null;
|
|
|
+ $relatedId = $ioRes->id ?? 0;
|
|
|
+ $bigUnit = $product->bigUnit ?? '扎';
|
|
|
+ $itemId = $product->id ?? 0;
|
|
|
+ $ptItemId = $product->itemId ?? 0;
|
|
|
+ $name = $product->name ?? '';
|
|
|
+ $py = $product->py ?? '';
|
|
|
+ $bookSn = $shop->bookSn ?? '';
|
|
|
+ $mainId = $shop->mainId ?? 0;
|
|
|
+ $staffName = $params['staffName'] ?? '';
|
|
|
+ $staffId = $params['staffId'] ?? 0;
|
|
|
+ $currentCapitalType = dict::getDict('capitalType', 'ghsPurchase');
|
|
|
+ $customId = $bookItemCustomRes->customId ?? 0;
|
|
|
+ $customName = $bookItemCustomRes->customName ?? '';
|
|
|
+ $customNamePy = $bookItemCustomRes->customNamePy ?? '';
|
|
|
+ $orderSn = $bill->orderSn ?? '';
|
|
|
+ $event = "{$staffName} 新增待入库采购单 {$orderSn},路上增加 {$name}" . $addRoadNum . $bigUnit;
|
|
|
+
|
|
|
+ $changeData = [
|
|
|
+ 'mainId' => $mainId,
|
|
|
+ 'bookSn' => $bookSn,
|
|
|
+ 'name' => $name,
|
|
|
+ 'py' => $py,
|
|
|
+ 'itemId' => $itemId,
|
|
|
+ 'ptItemId' => $ptItemId,
|
|
|
+ 'customId' => $customId,
|
|
|
+ 'customName' => $customName,
|
|
|
+ 'customNamePy' => $customNamePy,
|
|
|
+ 'relateId' => $relatedId,
|
|
|
+ 'relateSecondId' => $bookItemResId,
|
|
|
+ 'ptStyle' => 2,
|
|
|
+ 'capitalType' => $currentCapitalType,
|
|
|
+ 'io' => 1,
|
|
|
+ 'changeNum' => $addRoadNum,
|
|
|
+ 'num' => $bookItemCustomRes->roadNum,
|
|
|
+ 'event' => $event,
|
|
|
+ 'staffId' => $staffId,
|
|
|
+ 'staffName' => $staffName,
|
|
|
+ 'remark' => '',
|
|
|
+ ];
|
|
|
+ BookRoadChangeClass::add($changeData, true);
|
|
|
+ return $bookItemCustomRes;
|
|
|
+ }
|
|
|
+
|
|
|
public static function delRoadNum($bookItemCustomRes, $delRoadNum, $num, $bill, $shop, $product, $params)
|
|
|
{
|
|
|
$bookItemCustomRes->roadNum = bcsub($bookItemCustomRes->roadNum, $delRoadNum);
|
|
|
@@ -129,7 +179,7 @@ class BookItemCustomClass extends BaseClass
|
|
|
$py = $product->py ?? '';
|
|
|
$bookSn = $shop->bookSn ?? '';
|
|
|
$mainId = $shop->mainId ?? 0;
|
|
|
-
|
|
|
+ $currentCapitalType = dict::getDict('capitalType', 'delBook');
|
|
|
$staffName = $params['staffName'] ?? '';
|
|
|
$staffId = $params['staffId'] ?? 0;
|
|
|
|
|
|
@@ -182,7 +232,7 @@ class BookItemCustomClass extends BaseClass
|
|
|
return $bookItemCustomRes;
|
|
|
}
|
|
|
|
|
|
- public static function delNeedCgNum($bookItemCustomRes, $delNeedCgNum, $totalBookNum, $order, $shop, $product, $params)
|
|
|
+ public static function delNeedCgNum($bookItemCustomRes, $delNeedCgNum, $totalBookNum, $bill, $shop, $product, $params)
|
|
|
{
|
|
|
$bookItemCustomRes->needCgNum = bcsub($bookItemCustomRes->needCgNum, $delNeedCgNum);
|
|
|
$bookItemCustomRes->save();
|
|
|
@@ -191,21 +241,32 @@ class BookItemCustomClass extends BaseClass
|
|
|
$ioRes = $params['ioRes'] ?? null;
|
|
|
$relatedId = $ioRes->id ?? 0;
|
|
|
|
|
|
- //待采减少变动记录
|
|
|
$itemId = $product->id ?? 0;
|
|
|
$ptItemId = $product->itemId ?? 0;
|
|
|
$name = $product->name ?? '';
|
|
|
$py = $product->py ?? '';
|
|
|
$bigUnit = $product->bigUnit ?? '扎';
|
|
|
$bookSn = $shop->bookSn ?? '';
|
|
|
- $mainId = $order->mainId ?? 0;
|
|
|
- $customId = $order->customId ?? 0;
|
|
|
- $customName = $order->customName ?? '';
|
|
|
- $customNamePy = $order->customNamePy ?? '';
|
|
|
+ $mainId = $shop->mainId ?? 0;
|
|
|
$currentCapitalType = dict::getDict('capitalType', 'delBook');
|
|
|
$staffName = $params['staffName'] ?? '';
|
|
|
$staffId = $params['staffId'] ?? 0;
|
|
|
- $event = $customName . '减少预订' . $name . $totalBookNum . $bigUnit . ',其中减少待采' . $delNeedCgNum . $bigUnit;
|
|
|
+ $customId = $bookItemCustomRes->customId ?? 0;
|
|
|
+ $customName = $bookItemCustomRes->customName ?? '';
|
|
|
+ $customNamePy = $bookItemCustomRes->customNamePy ?? '';
|
|
|
+ $currentChangeType = $params['currentChangeType']??'delBook';
|
|
|
+ $event = '';
|
|
|
+ if($currentChangeType == 'addCg'){
|
|
|
+ $currentCapitalType = dict::getDict('capitalType', 'ghsPurchase');
|
|
|
+ $orderSn = $bill->orderSn??'';
|
|
|
+ $event = $staffName."增加待入库单 {$orderSn} 减少待采 {$name} ". $delNeedCgNum . $bigUnit;
|
|
|
+ }elseif($currentChangeType == 'delBook'){
|
|
|
+ $currentCapitalType = dict::getDict('capitalType', 'delBook');
|
|
|
+ $event = $customName . '减少预订' . $name . $totalBookNum . $bigUnit . ',其中减少待采' . $delNeedCgNum . $bigUnit;
|
|
|
+ }else{
|
|
|
+ util::fail('没有找到的操作');
|
|
|
+ }
|
|
|
+
|
|
|
$changeData = [
|
|
|
'mainId' => $mainId,
|
|
|
'bookSn' => $bookSn,
|