fix:depot
This commit is contained in:
@@ -143,18 +143,8 @@ class DepotService extends BaseService{
|
|||||||
public function purchase():array
|
public function purchase():array
|
||||||
{
|
{
|
||||||
$depotId = (int)$this->request->input('depot_id');
|
$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');
|
$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');
|
$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');
|
$purchase_price = (double)$this->request->input('purchase_price');
|
||||||
$number = (double)$this->request->input('number');
|
$number = (double)$this->request->input('number');
|
||||||
@@ -626,6 +616,10 @@ class DepotService extends BaseService{
|
|||||||
->where('id',$id)
|
->where('id',$id)
|
||||||
->first();
|
->first();
|
||||||
|
|
||||||
|
if ($info->status == MaterialCode::AUDITED){
|
||||||
|
throw new ErrException('该回收已审核通过');
|
||||||
|
}
|
||||||
|
|
||||||
$info->is_del = MaterialCode::IS_DEL;
|
$info->is_del = MaterialCode::IS_DEL;
|
||||||
|
|
||||||
$materialStock = $this->MaterialStockModel
|
$materialStock = $this->MaterialStockModel
|
||||||
|
|||||||
Reference in New Issue
Block a user