fix:depot
This commit is contained in:
@@ -143,18 +143,8 @@ class DepotService extends BaseService{
|
||||
public function purchase():array
|
||||
{
|
||||
$depotId = (int)$this->request->input('depot_id');
|
||||
$depotInfo = $this->DepotModel->getInfoById($depotId);
|
||||
if (empty($depotInfo)) throw new ErrException('仓库不存在');
|
||||
|
||||
$materialId = (int)$this->request->input('material_id');
|
||||
$materialInfo = $this->MaterialModel->getInfoById($materialId);
|
||||
if (empty($materialInfo)) throw new ErrException("材料不存在");
|
||||
|
||||
$supplierId = (int)$this->request->input('supplier_id');
|
||||
if (!empty($supplierId)){
|
||||
$supplierInfo = $this->SupplierModel->getInfoById($supplierId);
|
||||
if (empty($supplierInfo)) throw new ErrException('供应商不存在');
|
||||
}
|
||||
|
||||
$purchase_price = (double)$this->request->input('purchase_price');
|
||||
$number = (double)$this->request->input('number');
|
||||
@@ -626,6 +616,10 @@ class DepotService extends BaseService{
|
||||
->where('id',$id)
|
||||
->first();
|
||||
|
||||
if ($info->status == MaterialCode::AUDITED){
|
||||
throw new ErrException('该回收已审核通过');
|
||||
}
|
||||
|
||||
$info->is_del = MaterialCode::IS_DEL;
|
||||
|
||||
$materialStock = $this->MaterialStockModel
|
||||
|
||||
Reference in New Issue
Block a user