调整商品溯源

This commit is contained in:
lewis 2025-03-14 18:16:27 +08:00
parent c9684b2f8b
commit a49919882a
2 changed files with 5 additions and 3 deletions

View File

@ -268,6 +268,7 @@ class ProductSourceLinkLogic extends BaseLogic
if ($inventoryTransfer['two_type'] == 1) {
$info['store_id'] = $inventoryTransfer['two_id'];
} else {
$info['store_id'] = $inventoryTransfer['one_id'];
$info['warehouse_id'] = $inventoryTransfer['two_id'];
}
$list = $query->where('current_nums', '>', 0)

View File

@ -99,9 +99,10 @@ class WarehouseProductReturnLogic extends BaseLogic
WarehouseProductReturn::create($datas);
$updateNums = bcsub($params['nums'], $find['nums'],2);
if ($updateNums != 0) {
WarehouseProductLogic::updateProductSourceLink($find, $params, $updateNums);
$updateNums = bcsub($find['nums'], $params['nums'], 2);
if ($params['nums'] != 0) {
$numTemp = bcsub($find['nums'], $params['nums'], 2);
WarehouseProductLogic::updateProductSourceLink($find, array_merge($params, ['nums' => $numTemp]), $updateNums);
}
if ($params['financial_pm'] == 1 && $params['return_type'] == 1) {