调整采购单

This commit is contained in:
lewis 2024-12-26 11:42:26 +08:00
parent e722c1a773
commit a695d47934
4 changed files with 10 additions and 4 deletions

View File

@ -112,6 +112,8 @@ class BeforehandOrderLists extends BaseAdminDataLists implements ListsSearchInte
$item->order_type_name = '往期补单';
} elseif ($item->order_type == 7) {
$item->order_type_name = '采购订单';
} elseif ($item->order_type == 8) {
$item->order_type_name = '其他订单';
}
$item->msg = '';
$count1 = PurchaseProductOffer::where('order_id', $item->id)->where('buyer_confirm', 0)->count('id');

View File

@ -72,7 +72,6 @@ class PurchaseProductOfferLists extends BaseAdminDataLists implements ListsSearc
$item->order_sn=BeforehandOrder::where('id',$item['order_id'])->value('order_id');
$find=StoreProduct::where('id',$item->product_id)->withTrashed()->find();
$item->store_name=$find->store_name;
$item->store_info=$find->store_info;
$item->image=$find->image;
$item->unit_name=StoreProductUnit::where('id',$item->unit)->value('name');
$item->cate_name=StoreCategory::where('id',$find->cate_id)->value('name');

View File

@ -62,9 +62,6 @@ class PurchaseProductOfferLogic extends BaseLogic
}
$find=StoreProduct::where('id',$params['product_id'])->find();
$purchaseProductOffer = PurchaseProductOffer::where(['order_id' => $procurementOrder['id'], 'product_id' => $params['product_id']])->find();
$procurementOrder->total_price = bcadd($procurementOrder->total_price, bcmul($find['price'], $params['need_num'], 2), 2);
$procurementOrder->pay_price = $procurementOrder->total_price;
$procurementOrder->save();
if ($purchaseProductOffer) {
$purchaseProductOffer->need_num = $purchaseProductOffer['need_num'] + $params['need_num'];
if (!empty($purchaseProductOffer['source_order_info'])) {
@ -184,6 +181,10 @@ class PurchaseProductOfferLogic extends BaseLogic
// $find = StoreProductPrice::where(['offer_id' => $params['id']])->find();
$product = StoreProduct::where('id', $offer['product_id'])->withTrashed()->field('id,store_name,top_cate_id,two_cate_id')->find();
$unit_name=StoreProductUnit::where('id', $offer['unit'])->value('name');
$order = BeforehandOrder::where('id', $params['bhoid'])->find();
$order->pay_price = bcadd($offer['total_price'], $order->pay_price, 2);
$order->total_price = $order->pay_price;
$order->save();
self::setProductGroupPrice($params, $product);
// $data = [];
// $dict_data = DictData::where('type_value', 'price_lv_' . $product['top_cate_id'])->field('name,value')->select();

View File

@ -73,6 +73,8 @@ class StoreProductLogic extends BaseLogic
'store_batch' => $params['store_batch'] ?? 1,
'product_type' => $params['product_type'] ?? 0,
'is_show' => $params['is_show'] ?? 0,
'made_place' => $params['made_place'] ?? '',
'shelf_life' => $params['shelf_life'] ?? 0,
];
$rose = 0;
//零售-供货
@ -222,6 +224,8 @@ class StoreProductLogic extends BaseLogic
'manufacturer_information' => $params['manufacturer_information'] ?? '',
'swap' => $params['swap'] ?? 0,
'is_show' => $params['is_show'] ?? 0,
'made_place' => $params['made_place'] ?? '',
'shelf_life' => $params['shelf_life'] ?? 0,
];
$rose = 0;
//零售-供货