区分采购订单和退货订单的入库逻辑
修改了入库逻辑,以区分采购订单和退货订单: - 采购订单在入库时增加库存 - 退货订单在确认时更新为确认时间 - 为所有订单类型添加了订单类型字段
This commit is contained in:
parent
02ada622ef
commit
454b9b2e9d
@ -158,6 +158,7 @@ class BeforehandOrderLogic extends BaseLogic
|
|||||||
'store_id' => $store_id,
|
'store_id' => $store_id,
|
||||||
'financial_pm' => 0,
|
'financial_pm' => 0,
|
||||||
'batch' => 1,
|
'batch' => 1,
|
||||||
|
'order_type' => $order['order_type'],
|
||||||
'nums' => $arr['cart_num'],
|
'nums' => $arr['cart_num'],
|
||||||
'status' => 1,
|
'status' => 1,
|
||||||
'admin_id' => $admin_id,
|
'admin_id' => $admin_id,
|
||||||
|
@ -64,8 +64,8 @@ class SystemStoreStorageLogic extends BaseLogic
|
|||||||
Db::startTrans();
|
Db::startTrans();
|
||||||
try {
|
try {
|
||||||
$find=SystemStoreStorage::where(['id' => $params['id']])->find();
|
$find=SystemStoreStorage::where(['id' => $params['id']])->find();
|
||||||
|
|
||||||
if($find){
|
if($find){
|
||||||
|
if($find['order_type']==1){
|
||||||
$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())]);
|
$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();
|
$branch_product=StoreBranchProduct::where(['product_id'=>$find['product_id'],'store_id'=>$find['store_id']])->find();
|
||||||
if($branch_product){
|
if($branch_product){
|
||||||
@ -76,6 +76,10 @@ class SystemStoreStorageLogic extends BaseLogic
|
|||||||
$storeBranchProduct->stock = $find['nums'];
|
$storeBranchProduct->stock = $find['nums'];
|
||||||
$storeBranchProduct->save();
|
$storeBranchProduct->save();
|
||||||
}
|
}
|
||||||
|
}else{
|
||||||
|
$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())]);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
Db::commit();
|
Db::commit();
|
||||||
return true;
|
return true;
|
||||||
|
@ -154,6 +154,7 @@ class WarehouseProductLogic extends BaseLogic
|
|||||||
SystemStoreStorage::create([
|
SystemStoreStorage::create([
|
||||||
'store_id' => $params['store_id'],
|
'store_id' => $params['store_id'],
|
||||||
'admin_id' => $params['admin_id'],
|
'admin_id' => $params['admin_id'],
|
||||||
|
'order_type' => $params['order_type'],
|
||||||
'staff_id' => 0,
|
'staff_id' => 0,
|
||||||
'type' => 1,
|
'type' => 1,
|
||||||
'product_id' => $params['product_id'],
|
'product_id' => $params['product_id'],
|
||||||
|
Loading…
x
Reference in New Issue
Block a user