Merge pull request 'dev' (#444) from dev into main

Reviewed-on: #444
This commit is contained in:
mkm 2025-01-08 15:15:31 +08:00
commit 9316467ffa
4 changed files with 12 additions and 13 deletions

View File

@ -692,10 +692,6 @@ class BeforehandOrderLogic extends BaseLogic
{
$order_info = new OrderInfo();
$order = BeforehandOrder::where('id', $params['id'])->find();
if ($order['order_type'] == 7 && isset($params['print']) && $params['print'] == 1) {
$order->is_buying = 1;
$order->save();
}
$order['admin_name'] = Admin::where('id', $order['admin_id'])->value('name');
$data = PurchaseProductOffer::where('order_id', $params['id'])->select()->each(function ($item) {
$find = StoreProduct::where('id', $item['product_id'])->field('top_cate_id,store_name,unit,gross_weight,net_weight')->withTrashed()->find();

View File

@ -69,7 +69,8 @@ class SystemStoreStorageLogic extends BaseLogic
$find->save(['status'=>1,'staff_id'=>$params['staff_id']??0,'admin_id'=>$params['admin_id']??0,'mark'=>'入库时间:'.date('Y-m-d H:i:s',time())]);
$branch_product=StoreBranchProduct::where(['product_id'=>$find['product_id'],'store_id'=>$find['store_id']])->find();
if($branch_product){
$branch_product->save(['stock'=>$branch_product['stock']+$find['nums']]);
$branch_product->stock=$branch_product['stock']+$find['nums'];
$branch_product->save();
SqlChannelLog('StoreBranchProduct', $branch_product['id'], $find['nums'], 1,Request()->url(),$admin_id);
}else{
$storeProduct = StoreProduct::where('id', $find['product_id'])->findOrEmpty();

View File

@ -76,15 +76,15 @@ class WarehouseProductReturnLogic extends BaseLogic
throw new BusinessException('该商品库存:'.$params['nums'].'小于仓库库存'.$proudct['nums']);
}
}
$offer = PurchaseProductOffer::where('order_id', $params['bhoid'])->where('product_id', $find['product_id'])->find();
if (!$offer) {
throw new BusinessException('该商品没有采购信息');
}
// $offer = PurchaseProductOffer::where('order_id', $params['bhoid'])->where('product_id', $find['product_id'])->find();
// if (!$offer) {
// throw new BusinessException('该商品没有采购信息');
// }
$datas = [
'source_id' => $params['id'],
'bhoid' => $params['bhoid'] ?? 0,
'warehouse_id' => $find['warehouse_id'],
'supplier_id' => $offer['supplier_id'],
'supplier_id' => 0,
'store_id' => $find['store_id'],
'product_id' => $find['product_id'],
'unit' => $find['unit'],
@ -93,8 +93,10 @@ class WarehouseProductReturnLogic extends BaseLogic
'nums' => $params['nums'],
'return_type' => $params['return_type'],
'mark' => $params['mark'],
'price' => $offer['price'],
'total_price' => bcmul($params['nums'], $offer['price'], 2),
// 'price' => $offer['price'],
// 'total_price' => bcmul($params['nums'], $offer['price'], 2),
'price' => 0,
'total_price' => 0,
];
}

View File

@ -22,7 +22,7 @@ class WeChatPay extends PayTool
'out_refund_no' => 'BO' . time(),
'amount' => [
'refund' => $totalFee,
'total' => $order['pay_price'],
'total' => (int)bcmul($order['pay_price'], 100),
'currency' => 'CNY',
],
];